MPC561/MPC563 Reference Manual Additional Devices Supported: MPC562 MPC564 MPC561RM REV 1.2 08/2005 How to Reach Us: Home Page: www.freescale.com E-mail: support@freescale.com USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.com Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) support@freescale.com Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064, Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po, N.T., Hong Kong +800 26668334 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 1-800-441-2447 or 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor 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 that may be provided in Freescale Semiconductor 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. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor 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 Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor 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 Freescale Semiconductor was negligent regarding the design or manufacture of the part. FreescaleTM and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. The described product is a PowerPC microprocessor. The PowerPC name is a trademark of IBM Corp. and used under license (c) Freescale Semiconductor, Inc. 2004, 2005. All rights reserved. MPC561RM REV 1.2 08/2005 Contents Paragraph Number Title Page Number About This Book lxxvii Audience ..................................................................................................................... lxxvii Organization ................................................................................................................ lxxvii Suggested Reading ........................................................................................................ lxxx Conventions and Nomenclature .................................................................................... lxxx Notational Conventions ............................................................................................... lxxxi Acronyms and Abbreviations ..................................................................................... lxxxii References .................................................................................................................. lxxxiii Chapter 1 Overview 1.1 1.2 1.3 1.3.1 1.3.1.1 1.3.1.2 1.3.1.3 1.3.1.4 1.3.1.5 1.3.1.6 1.3.1.7 1.3.1.8 1.3.2 1.3.3 1.3.3.1 1.3.3.2 1.3.3.3 1.3.3.4 1.3.3.5 1.3.3.6 1.4 1.5 1.6 1.7 1.8 Introduction ..................................................................................................................... 1-1 Block Diagram ................................................................................................................ 1-2 Key Features ................................................................................................................... 1-3 High-Performance CPU System ................................................................................. 1-3 RISC MCU Central Processing Unit (RCPU) ........................................................ 1-4 Unified System Interface Unit (USIU) ................................................................... 1-4 Burst Buffer Controller (BBC) Module .................................................................. 1-4 Flexible Memory Protection Unit ........................................................................... 1-5 Memory Controller ................................................................................................. 1-5 512-Kbytes of CDR3 Flash EEPROM Memory (UC3F) - MPC563/MPC564 Only 1-5 32-Kbyte Static RAM (CALRAM) ........................................................................ 1-6 General Purpose I/O Support (GPIO) ..................................................................... 1-6 Nexus Debug Port (Class 3) ........................................................................................ 1-6 Integrated I/O System ................................................................................................. 1-6 Two Time Processor Units (TPU3) ........................................................................ 1-6 22-Channel Modular I/O System (MIOS14) .......................................................... 1-6 Two Enhanced Queued Analog-to-Digital Converter Modules (QADC64E) ........ 1-7 Three CAN 2.0B Controller (TouCAN) Modules .................................................. 1-7 Queued Serial Multi-Channel Module (QSMCM) ................................................. 1-8 Peripheral Pin Multiplexing (PPM) ........................................................................ 1-8 MPC561/MPC563 Optional Features ............................................................................. 1-9 Comparison of MPC561/MPC563 and MPC555 ........................................................... 1-9 Additional MPC561/MPC563 Differences ................................................................... 1-10 SRAM Keep-Alive Power Behavior ............................................................................. 1-11 MPC561/MPC563 Address Map .................................................................................. 1-11 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor iii Contents Paragraph Number 1.9 Title Page Number Supporting Documentation List .................................................................................... 1-14 Chapter 2 Signal Descriptions 2.1 2.2 2.2.1 2.2.2 2.3 2.4 2.5 2.5.1 2.5.2 2.5.3 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.4.1 2.6.4.2 2.6.4.3 2.6.4.4 2.6.5 Signal Groupings ............................................................................................................ 2-1 Signal Summary .............................................................................................................. 2-3 MPC561/MPC563 Signal Multiplexing ................................................................... 2-20 READI Port Signal Sharing ...................................................................................... 2-21 Pad Module Configuration Register (PDMCR) ............................................................ 2-22 Pad Module Configuration Register (PDMCR2) .......................................................... 2-23 MPC561/MPC563 Development Support Signal Sharing ............................................ 2-28 JTAG Mode Selection .............................................................................................. 2-29 BDM Mode Selection ............................................................................................... 2-30 Nexus Mode Selection .............................................................................................. 2-30 Reset State ..................................................................................................................... 2-31 Signal Functionality Configuration Out of Reset ..................................................... 2-31 Signal State During Reset ......................................................................................... 2-31 Power-On Reset and Hard Reset .............................................................................. 2-32 Pull-Up/Pull-Down ................................................................................................... 2-32 Pull-Up/Pull-Down Enable and Disable for 5-V Only and 2.6-V Only Signals .. 2-32 Pull-Down Enable and Disable for 5-V/2.6-V Multiplexed Signals .................... 2-32 Special Pull Resistor Disable Control Functionality (SPRDS) ............................ 2-32 Pull Device Select (PULL_SEL) .......................................................................... 2-33 Signal Reset States .................................................................................................... 2-33 Chapter 3 Central Processing Unit 3.1 3.2 3.3 3.4 3.4.1 3.4.2 3.4.3 3.4.4 3.5 3.6 RCPU Block Diagram .................................................................................................... 3-1 RCPU Key Features ........................................................................................................ 3-3 Instruction Sequencer ..................................................................................................... 3-3 Independent Execution Units .......................................................................................... 3-4 Branch Processing Unit (BPU) ................................................................................... 3-5 Integer Unit (IU) ......................................................................................................... 3-5 Load/Store Unit (LSU) ............................................................................................... 3-6 Floating-Point Unit (FPU) .......................................................................................... 3-6 Levels of the PowerPC ISA Architecture ....................................................................... 3-6 RCPU Programming Model ............................................................................................ 3-7 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor iv Contents Paragraph Number 3.7 3.7.1 3.7.2 3.7.3 3.7.4 3.7.4.1 3.7.4.2 3.7.4.3 3.7.5 3.7.6 3.7.7 3.8 3.9 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 3.9.10 3.9.10.1 3.9.10.2 3.9.10.3 3.10 3.10.1 3.10.2 3.10.3 3.11 3.11.1 3.11.2 3.11.3 3.11.4 3.11.5 3.12 3.13 3.13.1 3.13.2 Title Page Number User Instruction Set Architecture (UISA) Register Set ............................................................................................................... 3-12 General-Purpose Registers (GPRs) ........................................................................... 3-12 Floating-Point Registers (FPRs) ............................................................................... 3-12 Floating-Point Status and Control Register (FPSCR) .............................................. 3-13 Condition Register (CR) ........................................................................................... 3-16 Condition Register CR0 Field Definition ............................................................. 3-17 Condition Register CR1 Field Definition ............................................................. 3-17 Condition Register CRn Field -- Compare Instruction ....................................... 3-17 Integer Exception Register (XER) ............................................................................ 3-18 Link Register (LR) .................................................................................................... 3-19 Count Register (CTR) ............................................................................................... 3-19 VEA Register Set -- Time Base (TB) .......................................................................... 3-20 OEA Register Set .......................................................................................................... 3-20 Machine State Register (MSR) ................................................................................. 3-20 DAE/Source Instruction Service Register (DSISR) ................................................. 3-22 Data Address Register (DAR) .................................................................................. 3-23 Time Base Facility (TB) -- OEA ............................................................................. 3-23 Decrementer Register (DEC) .................................................................................... 3-23 Machine Status Save/Restore Register 0 (SRR0) ..................................................... 3-23 Machine Status Save/Restore Register 1 (SRR1) ..................................................... 3-23 General SPRs (SPRG0-SPRG3) .............................................................................. 3-24 Processor Version Register (PVR) ........................................................................... 3-25 Implementation-Specific SPRs ................................................................................. 3-25 EIE, EID, and NRI Special-Purpose Registers ..................................................... 3-25 Floating-Point Exception Cause Register (FPECR) ............................................. 3-26 Additional Implementation-Specific Registers ..................................................... 3-27 Instruction Set ............................................................................................................... 3-27 Instruction Set Summary .......................................................................................... 3-28 Recommended Simplified Mnemonics ..................................................................... 3-33 Calculating Effective Addresses ............................................................................... 3-34 Exception Model ........................................................................................................... 3-34 Exception Classes ..................................................................................................... 3-35 Ordered Exceptions ................................................................................................... 3-35 Unordered Exceptions ............................................................................................... 3-35 Precise Exceptions .................................................................................................... 3-36 Exception Vector Table ............................................................................................ 3-36 Instruction Timing ........................................................................................................ 3-37 User Instruction Set Architecture (UISA) .................................................................... 3-39 Computation Modes .................................................................................................. 3-39 Reserved Fields ......................................................................................................... 3-39 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor v Contents Paragraph Number 3.13.3 3.13.4 3.13.5 3.13.6 3.13.7 3.13.7.1 3.13.7.2 3.13.8 3.13.8.1 3.13.9 3.13.9.1 3.13.9.2 3.13.10 3.13.10.1 3.13.10.2 3.13.10.3 3.13.10.4 3.13.10.5 3.13.10.6 3.13.10.7 3.13.10.8 3.14 3.14.1 3.14.2 3.14.3 3.14.4 3.14.5 3.14.6 3.15 3.15.1 3.15.1.1 3.15.1.2 3.15.2 3.15.2.1 3.15.3 3.15.4 3.15.4.1 3.15.4.2 3.15.4.3 3.15.4.4 3.15.4.5 Title Page Number Classes of Instructions .............................................................................................. 3-40 Exceptions ................................................................................................................. 3-40 Branch Processor ...................................................................................................... 3-40 Instruction Fetching .................................................................................................. 3-40 Branch Instructions ................................................................................................... 3-40 Invalid Branch Instruction Forms ......................................................................... 3-40 Branch Prediction ................................................................................................. 3-40 Fixed-Point Processor ............................................................................................... 3-41 Fixed-Point Instructions ........................................................................................ 3-41 Floating-Point Processor ........................................................................................... 3-41 General .................................................................................................................. 3-41 Optional Instructions ............................................................................................ 3-41 Load/Store Processor ................................................................................................ 3-42 Fixed-Point Load with Update and Store with Update Instructions ..................... 3-42 Fixed-Point Load and Store Multiple Instructions ............................................... 3-42 Fixed-Point Load String Instructions .................................................................... 3-42 Storage Synchronization Instructions ................................................................... 3-42 Floating-Point Load and Store With Update Instructions .................................... 3-42 Floating-Point Load Single Instructions ............................................................... 3-42 Floating-Point Store Single Instructions ............................................................... 3-42 Optional Instructions ............................................................................................ 3-43 Virtual Environment Architecture (VEA) .................................................................... 3-43 Atomic Update Primitives ........................................................................................ 3-43 Effect of Operand Placement on Performance ......................................................... 3-43 Storage Control Instructions ..................................................................................... 3-43 Instruction Synchronize (isync) Instruction .............................................................. 3-43 Enforce In-Order Execution of I/O (eieio) Instruction ............................................. 3-44 Time Base ................................................................................................................. 3-44 Operating Environment Architecture (OEA) ................................................................ 3-44 Branch Processor Registers ...................................................................................... 3-44 Machine State Register (MSR) ............................................................................. 3-44 Branch Processors Instructions ............................................................................. 3-44 Fixed-Point Processor ............................................................................................... 3-44 Special Purpose Registers ..................................................................................... 3-44 Storage Control Instructions ..................................................................................... 3-45 Exceptions ................................................................................................................. 3-45 System Reset Exception and NMI (0x0100) ........................................................ 3-45 Machine Check Exception (0x0200) .................................................................... 3-46 Data Storage Exception (0x0300) ......................................................................... 3-48 Instruction Storage Exception (0x0400) ............................................................... 3-48 External Interrupt (0x0500) .................................................................................. 3-48 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor vi Contents Paragraph Number 3.15.4.6 3.15.4.7 3.15.4.8 3.15.4.9 3.15.4.10 3.15.4.11 3.15.4.12 3.15.4.13 3.15.4.14 3.15.4.15 3.15.4.16 3.15.5 3.15.6 3.15.7 Title Page Number Alignment Exception (0x00600) .......................................................................... 3-49 Program Exception (0x0700) ................................................................................ 3-51 Floating-Point Unavailable Exception (0x0800) .................................................. 3-52 Decrementer Exception (0x0900) ......................................................................... 3-53 System Call Exception (0x0C00) ......................................................................... 3-54 Trace Exception (0x0D00) ................................................................................... 3-54 Floating-Point Assist Exception (0x0E00) ........................................................... 3-55 Implementation-Dependent Software Emulation Exception (0x1000) ................ 3-56 Implementation-Dependent Instruction Protection Exception (0x1300) .............. 3-57 Implementation-Specific Data Protection Error Exception (0x1400) .................. 3-58 Implementation-Dependent Debug Exceptions .................................................... 3-59 Partially Executed Instructions ................................................................................. 3-60 Timer Facilities ......................................................................................................... 3-61 Optional Facilities and Instructions .......................................................................... 3-61 Chapter 4 Burst Buffer Controller 2 Module 4.1 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.2 4.2.1 4.2.1.1 4.2.1.2 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.3 4.3.1 4.3.2 4.4 4.4.1 4.4.1.1 4.4.1.2 4.5 Key Features ................................................................................................................... 4-2 BIU Key Features ....................................................................................................... 4-2 IMPU Key Features .................................................................................................... 4-3 ICDU Key Features .................................................................................................... 4-3 DECRAM Key Features ............................................................................................. 4-4 Branch Target Buffer Key Features ............................................................................ 4-4 Operation Modes ............................................................................................................. 4-4 Instruction Fetch ......................................................................................................... 4-4 Decompression Off Mode ....................................................................................... 4-4 Decompression On Mode ....................................................................................... 4-5 Burst Operation of the BBC ........................................................................................ 4-5 Access Violation Detection ........................................................................................ 4-5 Slave Operation ........................................................................................................... 4-6 Reset Behavior ............................................................................................................ 4-6 Debug Operation Mode .............................................................................................. 4-7 Exception Table Relocation (ETR) ................................................................................. 4-7 ETR Operation ............................................................................................................ 4-8 Enhanced External Interrupt Relocation (EEIR) ...................................................... 4-10 Decompressor RAM (DECRAM) Functionality .......................................................... 4-12 General-Purpose Memory Operation ........................................................................ 4-13 Memory Protection Violations ............................................................................. 4-14 DECRAM Standby Operation Mode .................................................................... 4-14 Branch Target Buffer .................................................................................................... 4-14 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor vii Contents Paragraph Number 4.5.1 4.5.1.1 4.5.1.2 4.5.1.3 4.6 4.6.1 4.6.1.1 4.6.1.2 4.6.2 4.6.2.1 4.6.2.2 4.6.2.3 4.6.2.4 4.6.2.5 4.6.3 Title Page Number BTB Operation .......................................................................................................... 4-14 BTB Invalidation .................................................................................................. 4-16 BTB Enabling/Disabling ...................................................................................... 4-16 BTB Inhibit Regions ............................................................................................. 4-16 BBC Programming Model ............................................................................................ 4-17 Address Map ............................................................................................................. 4-17 BBC Special Purpose Registers (SPRs) ............................................................... 4-17 DECRAM and DCCR Block ................................................................................ 4-18 BBC Register Descriptions ....................................................................................... 4-19 BBC Module Configuration Register (BBCMCR) ............................................... 4-19 Region Base Address Registers (MI_RBA[0:3]) ................................................. 4-21 Region Attribute Registers (MI_RA[0:3]) ............................................................ 4-22 Global Region Attribute Register (MI_GRA) ...................................................... 4-23 External Interrupt Relocation Table Base Address Register (EIBADR) .............. 4-25 Decompressor Class Configuration Registers .......................................................... 4-25 Chapter 5 Unified System Interface Unit (USIU) Overview 5.1 5.1.1 Memory Map and Registers ............................................................................................ 5-2 USIU Special-Purpose Registers ................................................................................ 5-6 Chapter 6 System Configuration and Protection 6.1 6.1.1 6.1.1.1 6.1.1.2 6.1.2 6.1.2.1 6.1.2.2 6.1.3 6.1.4 6.1.4.1 6.1.4.2 6.1.4.3 6.1.4.4 6.1.4.4.1 6.1.4.4.2 System Configuration and Protection Features .............................................................. 6-3 System Configuration ................................................................................................. 6-3 USIU Pin Multiplexing ........................................................................................... 6-4 Arbitration Support ................................................................................................. 6-4 External Master Modes ............................................................................................... 6-4 Operation in External Master Modes ...................................................................... 6-5 Address Decoding for External Accesses ............................................................... 6-6 USIU General-Purpose I/O ......................................................................................... 6-6 Enhanced Interrupt Controller .................................................................................... 6-8 Key Features ........................................................................................................... 6-8 Interrupt Configuration ........................................................................................... 6-8 Regular Interrupt Controller Operation (MPC555/MPC556-Compatible Mode) 6-10 Enhanced Interrupt Controller Operation ............................................................. 6-11 Lower Priority Request Masking ...................................................................... 6-14 Backward Compatibility with MPC555/MPC556 ............................................ 6-14 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor viii Contents Paragraph Number 6.1.4.5 6.1.5 6.1.6 6.1.7 6.1.8 6.1.9 6.1.10 6.1.11 6.1.12 6.2 6.2.1 6.2.2 6.2.2.1 6.2.2.1.1 6.2.2.1.2 6.2.2.1.3 6.2.2.2 6.2.2.2.1 6.2.2.2.2 6.2.2.2.3 6.2.2.2.4 6.2.2.2.5 6.2.2.2.6 6.2.2.2.7 6.2.2.2.8 6.2.2.2.9 6.2.2.3 6.2.2.3.1 6.2.2.3.2 6.2.2.3.3 6.2.2.4 6.2.2.4.1 6.2.2.4.2 6.2.2.4.3 6.2.2.4.4 6.2.2.4.5 6.2.2.4.6 6.2.2.4.7 6.2.2.4.8 6.2.2.4.9 6.2.2.4.10 Title Page Number Interrupt Overhead Estimation for Enhanced Interrupt Controller Mode ............ 6-16 Hardware Bus Monitor ............................................................................................. 6-17 Decrementer (DEC) .................................................................................................. 6-18 Time Base (TB) ........................................................................................................ 6-19 Real-Time Clock (RTC) ........................................................................................... 6-19 Periodic Interrupt Timer (PIT) .................................................................................. 6-20 Software Watchdog Timer (SWT) ............................................................................ 6-21 Freeze Operation ....................................................................................................... 6-23 Low Power Stop Operation ....................................................................................... 6-23 Memory Map and Register Definitions ........................................................................ 6-23 Memory Map ............................................................................................................ 6-23 System Configuration and Protection Registers ....................................................... 6-24 System Configuration Registers ........................................................................... 6-24 SIU Module Configuration Register (SIUMCR) .............................................. 6-25 Internal Memory Map Register (IMMR) .......................................................... 6-28 External Master Control Register (EMCR) ...................................................... 6-29 SIU Interrupt Controller Registers ........................................................................ 6-31 SIU Interrupt Pending Register (SIPEND) ....................................................... 6-32 SIU Interrupt Pending Register 2 (SIPEND2) .................................................. 6-32 SIU Interrupt Pending Register 3 (SIPEND3) .................................................. 6-33 SIU Interrupt Mask Register (SIMASK) .......................................................... 6-33 SIU Interrupt Mask Register 2 (SIMASK2) .................................................... 6-34 SIU Interrupt Mask Register 3 (SIMASK3) ..................................................... 6-35 SIU Interrupt Edge Level Register (SIEL) ....................................................... 6-35 SIU Interrupt Vector Register (SIVEC) ........................................................... 6-35 Interrupt In-Service Registers (SISR2 and SISR3) .......................................... 6-37 System Protection Registers ................................................................................. 6-37 System Protection Control Register (SYPCR) ................................................. 6-37 Software Service Register (SWSR) .................................................................. 6-38 Transfer Error Status Register (TESR) ............................................................. 6-39 System Timer Registers ........................................................................................ 6-40 Decrementer Register (DEC) ............................................................................ 6-40 Time Base SPRs (TB) ....................................................................................... 6-40 Time Base Reference Registers (TBREF0 and TBREF1) ................................ 6-41 Time Base Control and Status Register (TBSCR) ............................................ 6-42 Real-Time Clock Status and Control Register (RTCSC) ................................. 6-42 Real-Time Clock Register (RTC) ..................................................................... 6-43 Real-Time Clock Alarm Register (RTCAL) .................................................... 6-44 Periodic Interrupt Status and Control Register (PISCR) .................................. 6-44 Periodic Interrupt Timer Count Register (PITC) .............................................. 6-45 Periodic Interrupt Timer Register (PITR) ........................................................ 6-45 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor ix Contents Paragraph Number 6.2.2.5 6.2.2.5.1 6.2.2.5.2 6.2.2.5.3 Title Page Number General-Purpose I/O Registers ............................................................................. 6-46 SGPIO Data Register 1 (SGPIODT1) ............................................................. 6-46 SGPIO Data Register 2 (SGPIODT2) ............................................................. 6-47 SGPIO Control Register (SGPIOCR) .............................................................. 6-48 Chapter 7 Reset 7.1 7.1.1 7.1.2 7.1.3 7.1.4 7.1.5 7.1.6 7.1.7 7.1.8 7.1.9 7.1.10 7.1.11 7.2 7.3 7.4 7.5 7.5.1 7.5.2 7.5.3 Reset Operation ............................................................................................................... 7-1 Power-On Reset .......................................................................................................... 7-1 Hard Reset ................................................................................................................... 7-2 Soft Reset .................................................................................................................... 7-2 Loss of PLL Lock ....................................................................................................... 7-2 On-Chip Clock Switch ................................................................................................ 7-3 Software Watchdog Reset ........................................................................................... 7-3 Checkstop Reset .......................................................................................................... 7-3 Debug Port Hard Reset ............................................................................................... 7-3 Debug Port Soft Reset ................................................................................................. 7-3 JTAG Reset ................................................................................................................. 7-3 ILBC Illegal Bit Change ............................................................................................. 7-3 Reset Actions Summary .................................................................................................. 7-3 Data Coherency During Reset ........................................................................................ 7-4 Reset Status Register (RSR) ........................................................................................... 7-5 Reset Configuration ........................................................................................................ 7-7 Hard Reset Configuration ........................................................................................... 7-7 Hard Reset Configuration Word (RCW) .................................................................. 7-11 Soft Reset Configuration .......................................................................................... 7-13 Chapter 8 Clocks and Power Control 8.1 8.2 8.2.1 8.2.2 8.2.3 8.2.4 8.2.5 8.3 8.4 System Clock Sources .................................................................................................... 8-3 System PLL ..................................................................................................................... 8-3 Frequency Multiplication ............................................................................................ 8-4 Skew Elimination ........................................................................................................ 8-4 Pre-Divider .................................................................................................................. 8-4 PLL Block Diagram .................................................................................................... 8-4 PLL Pins ..................................................................................................................... 8-5 System Clock During PLL Loss of Lock ........................................................................ 8-6 Low-Power Divider ........................................................................................................ 8-6 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor x Contents Paragraph Number 8.5 8.5.1 8.5.2 8.5.3 8.6 8.7 8.7.1 8.7.2 8.7.3 8.7.3.1 8.7.3.2 8.7.3.3 8.7.3.4 8.7.3.5 8.8 8.8.1 8.8.2 8.8.2.1 8.8.2.2 8.8.2.3 8.8.2.4 8.8.2.5 8.8.2.6 8.8.2.7 8.8.2.8 8.8.2.9 8.8.2.10 8.8.2.11 8.8.3 8.8.3.1 8.8.3.2 8.9 8.10 8.11 8.11.1 8.11.2 8.11.3 8.11.4 Title Page Number Internal Clock Signals ..................................................................................................... 8-7 General System Clocks ............................................................................................. 8-10 Clock Out (CLKOUT) .............................................................................................. 8-13 Engineering Clock (ENGCLK) ................................................................................ 8-14 Clock Source Switching ................................................................................................ 8-14 Low-Power Modes ........................................................................................................ 8-16 Entering a Low-Power Mode .................................................................................... 8-16 Power Mode Descriptions ......................................................................................... 8-17 Exiting from Low-Power Modes .............................................................................. 8-17 Exiting from Normal-Low Mode .......................................................................... 8-18 Exiting from Doze Mode ...................................................................................... 8-19 Exiting from Deep-Sleep Mode ............................................................................ 8-19 Exiting from Power-Down Mode ......................................................................... 8-19 Low-Power Modes Flow ...................................................................................... 8-19 Basic Power Structure ................................................................................................... 8-21 General Power Supply Definitions ........................................................................... 8-21 Chip Power Structure ................................................................................................ 8-22 NVDDL ................................................................................................................ 8-22 QVDDL ................................................................................................................ 8-22 VDD ...................................................................................................................... 8-22 VDDSYN, VSSSYN ............................................................................................ 8-22 KAPWR ................................................................................................................ 8-22 VDDA, VSSA ....................................................................................................... 8-22 VFLASH ............................................................................................................... 8-22 VDDF, VSSF ........................................................................................................ 8-22 VDDH ................................................................................................................... 8-23 IRAMSTBY .......................................................................................................... 8-23 VSS ....................................................................................................................... 8-23 Keep-Alive Power ..................................................................................................... 8-24 Keep-Alive Power Configuration ......................................................................... 8-24 Keep-Alive Power Registers Lock Mechanism .................................................... 8-25 IRAMSTBY Supply Failure Detection ......................................................................... 8-27 Power-Up/Down Sequencing ....................................................................................... 8-27 Clocks Unit Programming Model ................................................................................. 8-29 System Clock Control Register (SCCR) ................................................................... 8-29 PLL, Low-Power, and Reset-Control Register (PLPRCR) ...................................... 8-33 Change of Lock Interrupt Register (COLIR) ............................................................ 8-36 IRAMSTBY Control Register (VSRMCR) .............................................................. 8-37 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xi Contents Paragraph Number Title Page Number Chapter 9 External Bus Interface 9.1 9.2 9.3 9.4 9.5 9.5.1 9.5.2 9.5.2.1 9.5.2.2 9.5.2.3 9.5.3 9.5.3.1 9.5.3.2 9.5.4 9.5.5 9.5.6 9.5.7 9.5.7.1 9.5.7.2 9.5.7.3 9.5.7.4 9.5.8 9.5.8.1 9.5.8.2 9.5.8.3 9.5.8.4 9.5.8.5 9.5.8.6 9.5.8.7 9.5.9 9.5.9.1 9.5.9.2 9.5.9.3 9.5.9.4 9.5.10 9.5.11 9.5.11.1 9.5.11.2 Features ........................................................................................................................... 9-1 Bus Transfer Signals ....................................................................................................... 9-1 Bus Control Signals ........................................................................................................ 9-2 Bus Interface Signal Descriptions ................................................................................... 9-3 Bus Operations ................................................................................................................ 9-8 Basic Transfer Protocol .............................................................................................. 9-8 Single Beat Transfer ................................................................................................... 9-9 Single Beat Read Flow ........................................................................................... 9-9 Single Beat Write Flow ........................................................................................ 9-11 Single Beat Flow with Small Port Size ................................................................. 9-14 Data Bus Pre-Discharge Mode ................................................................................. 9-15 Operating Conditions ............................................................................................ 9-16 Initialization Sequence .......................................................................................... 9-16 Burst Transfer ........................................................................................................... 9-17 Burst Mechanism ...................................................................................................... 9-18 Alignment and Packaging of Transfers .................................................................... 9-29 Arbitration Phase ...................................................................................................... 9-32 Bus Request .......................................................................................................... 9-33 Bus Grant .............................................................................................................. 9-33 Bus Busy ............................................................................................................... 9-34 Internal Bus Arbiter .............................................................................................. 9-35 Address Transfer Phase Signals ................................................................................ 9-37 Transfer Start ........................................................................................................ 9-37 Address Bus .......................................................................................................... 9-37 Read/Write ............................................................................................................ 9-37 Burst Indicator ...................................................................................................... 9-37 Transfer Size ......................................................................................................... 9-38 Address Types ...................................................................................................... 9-38 Burst Data in Progress .......................................................................................... 9-40 Termination Signals .................................................................................................. 9-40 Transfer Acknowledge .......................................................................................... 9-40 Burst Inhibit .......................................................................................................... 9-40 Transfer Error Acknowledge ................................................................................ 9-40 Termination Signals Protocol ............................................................................... 9-40 Storage Reservation .................................................................................................. 9-42 Bus Exception Control Cycles .................................................................................. 9-45 Retrying a Bus Cycle ............................................................................................ 9-45 Termination Signals Protocol Summary ............................................................... 9-49 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xii Contents Paragraph Number 9.5.12 9.5.13 9.5.14 Title Page Number Bus Operation in External Master Modes ................................................................. 9-49 Contention Resolution on External Bus .................................................................... 9-53 Show Cycle Transactions .......................................................................................... 9-55 Chapter 10 Memory Controller 10.1 10.2 10.2.1 10.2.2 10.2.3 10.2.4 10.2.5 10.2.6 10.2.6.1 10.2.6.2 10.2.6.3 10.3 10.3.1 10.3.2 10.3.3 10.3.4 10.3.5 10.4 10.5 10.6 10.7 10.8 10.9 10.9.1 10.9.2 10.9.3 10.9.4 10.9.5 10.9.6 Overview ....................................................................................................................... 10-1 Memory Controller Architecture .................................................................................. 10-3 Associated Registers ................................................................................................. 10-4 Port Size Configuration ............................................................................................ 10-4 Write-Protect Configuration ..................................................................................... 10-5 Address and Address Space Checking ...................................................................... 10-5 Burst Support ............................................................................................................ 10-5 Reduced Data Setup Time ........................................................................................ 10-6 Case 1: Normal Setup Time .................................................................................. 10-6 Case 2: Short Setup Time ..................................................................................... 10-7 Summary of Short Setup Time ............................................................................. 10-8 Chip-Select Timing ..................................................................................................... 10-10 Memory Devices Interface Example ...................................................................... 10-12 Peripheral Devices Interface Example .................................................................... 10-13 Relaxed Timing Examples ...................................................................................... 10-14 Extended Hold Time on Read Accesses ................................................................. 10-18 Summary of GPCM Timing Options ...................................................................... 10-22 Write and Byte Enable Signals ................................................................................... 10-24 Dual Mapping of the Internal Flash EEPROM Array ................................................ 10-24 Dual Mapping of an External Flash Region ............................................................... 10-26 Global (Boot) Chip-Select Operation ......................................................................... 10-27 Memory Controller External Master Support ............................................................. 10-28 Programming Model ................................................................................................... 10-31 General Memory Controller Programming Notes .................................................. 10-31 Memory Controller Status Registers (MSTAT) ..................................................... 10-32 Memory Controller Base Registers (BR0-BR3) .................................................... 10-32 Memory Controller Option Registers (OR0-OR3) ................................................ 10-34 Dual-Mapping Base Register (DMBR) .................................................................. 10-36 Dual-Mapping Option Register (DMOR) ............................................................... 10-37 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xiii Contents Paragraph Number Title Page Number Chapter 11 L-Bus to U-Bus Interface (L2U) 11.1 11.2 11.3 11.4 11.4.1 11.4.2 11.4.3 11.4.4 11.5 11.5.1 11.5.2 11.5.3 11.6 11.6.1 11.6.2 11.6.3 11.7 11.7.1 11.7.2 11.7.3 11.7.4 11.7.5 11.7.6 11.8 11.8.1 11.8.2 11.8.3 11.8.4 11.8.5 11.8.6 General Features ........................................................................................................... 11-1 Data Memory Protection Unit Features ........................................................................ 11-1 L2U Block Diagram ...................................................................................................... 11-2 Modes Of Operation ..................................................................................................... 11-3 Normal Mode ............................................................................................................ 11-3 Reset Operation ......................................................................................................... 11-4 Peripheral Mode ........................................................................................................ 11-4 Factory Test Mode .................................................................................................... 11-4 Data Memory Protection ............................................................................................... 11-4 Functional Description .............................................................................................. 11-5 Associated Registers ................................................................................................. 11-6 L-Bus Memory Access Violations ............................................................................ 11-7 Reservation Support ...................................................................................................... 11-7 Reservation Protocol ................................................................................................. 11-8 L2U Reservation Support ......................................................................................... 11-8 Reserved Location (Bus) and Possible Actions ........................................................ 11-9 L-Bus Show Cycle Support .......................................................................................... 11-9 Programming Show Cycles .................................................................................... 11-10 Performance Impact ................................................................................................ 11-10 Show Cycle Protocol .............................................................................................. 11-10 L-Bus Write Show Cycle Flow ............................................................................... 11-10 L-Bus Read Show Cycle Flow ................................................................................ 11-11 Show Cycle Support Guidelines ............................................................................. 11-11 L2U Programming Model ........................................................................................... 11-12 U-Bus Access .......................................................................................................... 11-13 Transaction Size ...................................................................................................... 11-13 L2U Module Configuration Register (L2U_MCR) ................................................ 11-13 Region Base Address Registers (L2U_RBAx) ....................................................... 11-14 Region Attribute Registers (L2U_RAx) ................................................................. 11-15 Global Region Attribute Register (L2U_GRA) ...................................................... 11-16 Chapter 12 U-Bus to IMB3 Bus Interface (UIMB) 12.1 12.2 12.3 12.4 Features ......................................................................................................................... 12-1 UIMB Block Diagram .................................................................................................. 12-2 Clock Module ............................................................................................................... 12-2 Interrupt Operation ....................................................................................................... 12-3 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xiv Contents Paragraph Number 12.4.1 12.4.2 12.4.3 12.4.4 12.5 12.5.1 12.5.2 12.5.3 Title Page Number Interrupt Sources and Levels on IMB3 ..................................................................... 12-3 IMB3 Interrupt Multiplexing .................................................................................... 12-4 ILBS Sequencing ...................................................................................................... 12-4 Interrupt Synchronizer .............................................................................................. 12-5 Programming Model ..................................................................................................... 12-6 UIMB Module Configuration Register (UMCR) ..................................................... 12-7 Test Control Register (UTSTCREG) ........................................................................ 12-8 Pending Interrupt Request Register (UIPEND) ........................................................ 12-8 Chapter 13 QADC64E Legacy Mode Operation 13.1 13.2 13.2.1 13.2.2 13.2.3 13.2.4 13.2.5 13.3 13.3.1 13.3.1.1 13.3.1.2 13.3.1.3 13.3.1.4 13.3.2 13.3.3 13.3.4 13.3.5 13.3.6 13.3.7 13.3.8 13.3.9 13.3.10 13.4 13.4.1 13.4.1.1 13.4.1.2 13.4.2 13.4.3 13.4.4 QADC64E Block Diagram ........................................................................................... 13-1 Key Features and Quick Reference Diagrams .............................................................. 13-2 Features of the QADC64E Legacy Mode Operation ................................................ 13-2 Memory Map ............................................................................................................ 13-3 Legacy and Enhanced Modes of Operation .............................................................. 13-4 Using the Queue and Result Word Table ................................................................. 13-5 External Multiplexing ............................................................................................... 13-5 Programming the QADC64E Registers ........................................................................ 13-7 QADC64E Module Configuration Register (QADMCR) ........................................ 13-8 Low Power Stop Mode ......................................................................................... 13-9 Freeze Mode ......................................................................................................... 13-9 Switching Between Legacy and Enhanced Modes of Operation ........................ 13-10 Supervisor/Unrestricted Address Space ............................................................. 13-10 QADC64E Interrupt Register (QADCINT) ............................................................ 13-12 Port Data Register (PORTQA and PORTQB) ........................................................ 13-13 Port Data Direction Register (DDRQA) ................................................................. 13-14 Control Register 0 (QACR0) .................................................................................. 13-14 Control Register 1 (QACR1) .................................................................................. 13-15 Control Register 2 (QACR2) .................................................................................. 13-17 Status Registers (QASR0 and QASR1) .................................................................. 13-20 Conversion Command Word Table ........................................................................ 13-27 Result Word Table .................................................................................................. 13-32 Analog Subsystem ...................................................................................................... 13-34 Analog-to-Digital Converter Operation .................................................................. 13-34 Conversion Cycle Times ..................................................................................... 13-35 Amplifier Bypass Mode Conversion Timing ..................................................... 13-35 Channel Decode and Multiplexer ........................................................................... 13-36 Sample Buffer Amplifier ........................................................................................ 13-36 Digital-to-Analog Converter (DAC) Array ............................................................ 13-36 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xv Contents Paragraph Number 13.4.5 13.4.6 13.4.7 13.4.8 13.5 13.5.1 13.5.2 13.5.3 13.5.4 13.5.4.1 13.5.4.2 13.5.4.3 13.5.4.3.1 13.5.4.3.2 13.5.4.3.3 13.5.4.3.4 13.5.4.4 13.5.4.4.1 13.5.4.4.2 13.5.4.4.3 13.5.4.4.4 13.5.5 13.5.6 13.5.7 13.5.7.1 13.5.7.2 13.6 13.6.1 13.6.2 13.7 13.7.1 13.7.2 13.7.3 13.7.3.1 13.7.4 13.7.5 13.7.5.1 13.7.5.2 13.7.5.3 13.7.5.4 Title Page Number Comparator ............................................................................................................. 13-37 Bias ......................................................................................................................... 13-37 Successive Approximation Register ...................................................................... 13-37 State Machine ......................................................................................................... 13-37 Digital Subsystem ....................................................................................................... 13-37 Queue Priority ......................................................................................................... 13-38 Paused Sub-Queues ................................................................................................. 13-38 Boundary Conditions .............................................................................................. 13-40 Scan Modes ............................................................................................................. 13-41 Disabled Mode .................................................................................................... 13-41 Reserved Mode ................................................................................................... 13-41 Single-Scan Modes ............................................................................................. 13-42 Software Initiated Single-Scan Mode ............................................................. 13-42 External Trigger Single-Scan Mode ............................................................... 13-43 External Gated Single-Scan Mode ................................................................. 13-43 Periodic/Interval Timer Single-Scan Mode .................................................... 13-44 Continuous-Scan Modes ..................................................................................... 13-44 Software Initiated Continuous-Scan Mode ..................................................... 13-45 External Trigger Continuous-Scan Mode ....................................................... 13-46 External Gated Continuous-Scan Mode ......................................................... 13-46 Periodic/Interval Timer Continuous-Scan Mode ............................................ 13-47 QADC64E Clock (QCLK) Generation ................................................................... 13-47 Periodic / Interval Timer ......................................................................................... 13-51 Configuration and Control Using the IMB3 Interface ............................................ 13-51 QADC64E Bus Interface Unit ............................................................................ 13-51 QADC64E Bus Accessing .................................................................................. 13-52 Trigger and Queue Interaction Examples ................................................................... 13-54 Queue Priority Schemes .......................................................................................... 13-54 Conversion Timing Schemes .................................................................................. 13-63 QADC64E Integration Requirements ......................................................................... 13-66 Port Digital Input/Output Signals ........................................................................... 13-66 External Trigger Input Signals ................................................................................ 13-67 Analog Power Signals ............................................................................................. 13-67 Analog Supply Filtering and Grounding ............................................................ 13-69 Analog Reference Signals ....................................................................................... 13-71 Analog Input Signals .............................................................................................. 13-71 Analog Input Considerations .............................................................................. 13-73 Settling Time for the External Circuit ................................................................ 13-75 Error Resulting from Leakage ............................................................................ 13-75 Accommodating Positive/Negative Stress Conditions ....................................... 13-76 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xvi Contents Paragraph Number Title Page Number Chapter 14 QADC64E Enhanced Mode Operation 14.1 14.2 14.2.1 14.2.2 14.2.3 14.2.4 14.2.5 14.3 14.3.1 14.3.1.1 14.3.1.2 14.3.1.3 14.3.1.4 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.10.1 14.3.11 14.3.11.1 14.3.12 14.3.13 14.3.14 14.3.15 14.3.16 14.3.17 14.3.18 14.4 14.4.1 14.4.2 14.4.3 14.4.4 14.4.4.1 QADC64E Block Diagram ........................................................................................... 14-1 Key Features and Quick Reference Diagrams .............................................................. 14-2 Features of the QADC64E Enhanced Mode Operation ............................................ 14-2 Memory Map ............................................................................................................ 14-3 Legacy and Enhanced Modes of Operation .............................................................. 14-4 Using the Queue and Result Word Table ................................................................. 14-5 External Multiplexing ............................................................................................... 14-5 Programming the QADC64E Registers ........................................................................ 14-7 QADC64E Module Configuration Register ........................................................... 14-8 Low Power Stop Mode ......................................................................................... 14-8 Freeze Mode ......................................................................................................... 14-9 Switching Between Legacy and Enhanced Modes of Operation .......................... 14-9 Supervisor/Unrestricted Address Space ............................................................. 14-10 QADC64E Interrupt Register ................................................................................. 14-11 Port Data Register ................................................................................................... 14-12 Port Data Direction Register ................................................................................... 14-13 Control Register 0 ................................................................................................... 14-14 Control Register 1 ................................................................................................... 14-16 Control Register 2 ................................................................................................... 14-18 Status Registers (QASR0 and QASR1) .................................................................. 14-22 Conversion Command Word Table ........................................................................ 14-28 Result Word Table .................................................................................................. 14-34 Analog Subsystem .............................................................................................. 14-36 Analog-to-Digital Converter Operation .................................................................. 14-36 Conversion Cycle Times ..................................................................................... 14-36 Channel Decode and Multiplexer ........................................................................... 14-37 Sample Buffer Amplifier ........................................................................................ 14-37 Digital to Analog Converter (DAC) Array ............................................................. 14-37 Comparator ............................................................................................................. 14-38 Bias ......................................................................................................................... 14-38 Successive Approximation Register ...................................................................... 14-38 State Machine ......................................................................................................... 14-38 Digital Subsystem ....................................................................................................... 14-38 Queue Priority ......................................................................................................... 14-39 Sub-Queues That are Paused .................................................................................. 14-39 Boundary Conditions .............................................................................................. 14-41 Scan Modes ............................................................................................................. 14-42 Disabled Mode .................................................................................................... 14-42 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xvii Contents Paragraph Number 14.4.4.2 14.4.4.3 14.4.4.3.1 14.4.4.3.2 14.4.4.3.3 14.4.4.3.4 14.4.4.4 14.4.4.4.1 14.4.4.4.2 14.4.4.4.3 14.4.4.4.4 14.4.5 14.4.6 14.4.7 14.4.7.1 14.4.7.2 14.5 14.5.1 14.5.2 14.6 14.6.1 14.6.2 14.6.3 14.6.3.1 14.6.4 14.6.5 14.6.5.1 14.6.5.2 14.6.5.3 14.6.5.4 Title Page Number Reserved Mode ................................................................................................... 14-42 Single-Scan Modes ............................................................................................. 14-43 Software Initiated Single-Scan Mode ............................................................. 14-43 External Trigger Single-Scan Mode ............................................................... 14-44 External Gated Single-Scan Mode ................................................................. 14-44 Periodic/Interval Timer Single-Scan Mode .................................................... 14-45 Continuous-Scan Modes ..................................................................................... 14-45 Software Initiated Continuous-Scan Mode ..................................................... 14-46 External Trigger Continuous-Scan Mode ....................................................... 14-47 External Gated Continuous-Scan Mode ......................................................... 14-47 Periodic/Interval Timer Continuous-Scan Mode ............................................ 14-48 QADC64E Clock (QCLK) Generation ................................................................... 14-48 Periodic/Interval Timer ........................................................................................... 14-50 Configuration and Control Using the IMB3 Interface ............................................ 14-51 QADC64E Bus Interface Unit ............................................................................ 14-51 QADC64E Bus Accessing .................................................................................. 14-51 Trigger and Queue Interaction Examples ................................................................... 14-53 Queue Priority Schemes .......................................................................................... 14-53 Conversion Timing Schemes .................................................................................. 14-62 QADC64E Integration Requirements ......................................................................... 14-65 Port Digital Input/Output Signals ........................................................................... 14-65 External Trigger Input Signals ................................................................................ 14-66 Analog Power Signals ............................................................................................. 14-66 Analog Supply Filtering and Grounding ............................................................ 14-67 Analog Reference Signals ....................................................................................... 14-69 Analog Input Signals .............................................................................................. 14-70 Analog Input Considerations .............................................................................. 14-71 Settling Time for the External Circuit ................................................................ 14-73 Error Resulting from Leakage ............................................................................ 14-73 Accommodating Positive/Negative Stress Conditions ....................................... 14-74 Chapter 15 Queued Serial Multi-Channel Module 15.1 15.2 15.2.1 15.3 15.4 15.4.1 15.4.2 Block Diagram .............................................................................................................. 15-1 Key Features ................................................................................................................. 15-2 MPC561/MPC563 QSMCM Details ........................................................................ 15-3 Memory Maps ............................................................................................................... 15-4 QSMCM Global Registers ............................................................................................ 15-6 Low-Power Stop Operation ...................................................................................... 15-6 Freeze Operation ....................................................................................................... 15-6 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xviii Contents Paragraph Number 15.4.3 15.4.4 15.4.5 15.4.6 15.4.7 15.4.8 15.5 15.5.1 15.5.2 15.5.3 15.6 15.6.1 15.6.1.1 15.6.1.2 15.6.1.3 15.6.1.4 15.6.1.5 15.6.2 15.6.2.1 15.6.2.2 15.6.2.3 15.6.3 15.6.4 15.6.4.1 15.6.4.2 15.6.4.3 15.6.5 15.6.5.1 15.6.5.2 15.6.5.3 15.6.5.4 15.6.5.5 15.6.5.6 15.6.5.7 15.6.5.8 15.6.6 15.6.6.1 15.6.7 15.6.8 15.7 15.7.1 Title Page Number Access Protection ...................................................................................................... 15-6 QSMCM Interrupts ................................................................................................... 15-7 QSPI Interrupt Generation ........................................................................................ 15-8 QSMCM Configuration Register (QSMCMMCR) .................................................. 15-8 QSMCM Test Register (QTEST) ............................................................................. 15-9 QSMCM Interrupt Level Registers (QDSCI_IL, QSPI_IL) ..................................... 15-9 QSMCM Pin Control Registers .................................................................................. 15-10 Port QS Data Register (PORTQS) .......................................................................... 15-11 PORTQS Pin Assignment Register (PQSPAR) ..................................................... 15-12 PORTQS Data Direction Register (DDRQS) ......................................................... 15-13 Queued Serial Peripheral Interface ............................................................................. 15-14 QSPI Registers ....................................................................................................... 15-16 QSPI Control Register 0 (SPCR0) ...................................................................... 15-17 QSPI Control Register 1 (SPCR1) ...................................................................... 15-19 QSPI Control Register 2 (SPCR2) ...................................................................... 15-20 QSPI Control Register 3 (SPCR3) ...................................................................... 15-20 QSPI Status Register (SPSR) .............................................................................. 15-21 QSPI RAM .............................................................................................................. 15-22 Receive RAM ..................................................................................................... 15-23 Transmit RAM .................................................................................................... 15-23 Command RAM .................................................................................................. 15-23 QSPI Pins ................................................................................................................ 15-24 QSPI Operation ....................................................................................................... 15-25 Enabling, Disabling, and Halting the SPI ........................................................... 15-26 QSPI Interrupts ................................................................................................... 15-26 QSPI Flow .......................................................................................................... 15-27 Master Mode Operation .......................................................................................... 15-34 Clock Phase and Polarity .................................................................................... 15-35 Baud Rate Selection ............................................................................................ 15-35 Delay Before Transfer ........................................................................................ 15-36 Delay After Transfer ........................................................................................... 15-36 Transfer Length .................................................................................................. 15-37 Peripheral Chip Selects ....................................................................................... 15-37 Optional Enhanced Peripheral Chip Selects ....................................................... 15-37 Master Wraparound Mode .................................................................................. 15-38 Slave Mode ............................................................................................................. 15-39 Description of Slave Operation .......................................................................... 15-40 Slave Wraparound Mode ........................................................................................ 15-41 Mode Fault .............................................................................................................. 15-42 Serial Communication Interface ................................................................................. 15-42 SCI Registers .......................................................................................................... 15-45 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xix Contents Paragraph Number 15.7.2 15.7.3 15.7.4 15.7.5 15.7.6 15.7.7 15.7.7.1 15.7.7.2 15.7.7.3 15.7.7.4 15.7.7.5 15.7.7.6 15.7.7.7 15.7.7.8 15.7.7.9 15.7.7.10 15.7.7.11 15.8 15.8.1 15.8.2 15.8.2.1 15.8.2.2 15.8.3 15.8.4 15.8.5 15.8.6 15.8.7 15.8.8 15.8.9 15.8.10 15.8.11 15.8.12 Title Page Number SCI Control Register 0 (SCCxR0) .......................................................................... 15-46 SCI Control Register 1 (SCCxR1) .......................................................................... 15-47 SCI Status Register (SCxSR) .................................................................................. 15-48 SCI Data Register (SCxDR) ................................................................................... 15-50 SCI Pins .................................................................................................................. 15-51 SCI Operation ......................................................................................................... 15-51 Definition of Terms ............................................................................................ 15-51 Serial Formats ..................................................................................................... 15-52 Baud Clock ......................................................................................................... 15-52 Parity Checking .................................................................................................. 15-53 Transmitter Operation ......................................................................................... 15-54 Receiver Operation ............................................................................................. 15-55 Receiver Bit Processor ........................................................................................ 15-55 Receiver Functional Operation ........................................................................... 15-57 Idle-Line Detection ............................................................................................. 15-58 Receiver Wake-Up .............................................................................................. 15-58 Internal Loop Mode ............................................................................................ 15-59 SCI Queue Operation .................................................................................................. 15-59 Queue Operation of SCI1 for Transmit and Receive .............................................. 15-59 Queued SCI1 Status and Control Registers ............................................................ 15-59 QSCI1 Control Register (QSCI1CR) .................................................................. 15-60 QSCI1 Status Register (QSCI1SR) .................................................................... 15-61 QSCI1 Transmitter Block Diagram ........................................................................ 15-62 QSCI1 Additional Transmit Operation Features .................................................... 15-63 QSCI1 Transmit Flow Chart Implementing the Queue .......................................... 15-65 Example QSCI1 Transmit for 17 Data Bytes ......................................................... 15-67 Example SCI Transmit for 25 Data Bytes .............................................................. 15-68 QSCI1 Receiver Block Diagram ............................................................................. 15-70 QSCI1 Additional Receive Operation Features ...................................................... 15-70 QSCI1 Receive Flow Chart Implementing the Queue ............................................ 15-73 QSCI1 Receive Queue Software Flow Chart ......................................................... 15-74 Example QSCI1 Receive Operation of 17 Data Frames ......................................... 15-75 Chapter 16 CAN 2.0B Controller Module 16.1 16.2 16.2.1 16.3 16.3.1 Features ......................................................................................................................... 16-1 External Signals ............................................................................................................ 16-2 TouCAN Signal Sharing ........................................................................................... 16-3 TouCAN Architecture ................................................................................................... 16-3 Tx/Rx Message Buffer Structure .............................................................................. 16-4 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xx Contents Paragraph Number 16.3.1.1 16.3.1.2 16.3.1.3 16.3.1.4 16.3.1.5 16.3.1.6 16.3.2 16.3.3 16.3.3.1 16.3.4 16.3.5 16.4 16.4.1 16.4.2 16.4.3 16.4.3.1 16.4.3.2 16.4.4 16.4.4.1 16.4.4.2 16.4.5 16.4.6 16.5 16.5.1 16.5.2 16.5.3 16.6 16.7 16.7.1 16.7.2 16.7.3 16.7.4 16.7.5 16.7.6 16.7.7 16.7.8 16.7.9 16.7.10 16.7.11 16.7.12 16.7.13 Title Page Number Common Fields for Extended and Standard Format Frames ................................ 16-4 Fields for Extended Format Frames ..................................................................... 16-6 Fields for Standard Format Frames ...................................................................... 16-6 Serial Message Buffers ......................................................................................... 16-6 Message Buffer Activation/Deactivation Mechanism .......................................... 16-7 Message Buffer Lock/Release/Busy Mechanism ................................................. 16-7 Receive Mask Registers ............................................................................................ 16-7 Bit Timing ................................................................................................................. 16-8 Configuring the TouCAN Bit Timing ................................................................ 16-10 Error Counters ......................................................................................................... 16-10 Time Stamp ............................................................................................................. 16-12 TouCAN Operation ..................................................................................................... 16-12 TouCAN Reset ........................................................................................................ 16-12 TouCAN Initialization ............................................................................................ 16-13 Transmit Process ..................................................................................................... 16-13 Transmit Message Buffer Deactivation .............................................................. 16-14 Reception of Transmitted Frames ....................................................................... 16-14 Receive Process ...................................................................................................... 16-14 Receive Message Buffer Deactivation ................................................................ 16-16 Locking and Releasing Message Buffers ........................................................... 16-16 Remote Frames ....................................................................................................... 16-17 Overload Frames ..................................................................................................... 16-17 Special Operating Modes ............................................................................................ 16-17 Debug Mode ........................................................................................................... 16-17 Low-Power Stop Mode ........................................................................................... 16-18 Auto Power Save Mode .......................................................................................... 16-19 Interrupts ..................................................................................................................... 16-20 Programming Model ................................................................................................... 16-21 TouCAN Module Configuration Register (CANMCR) ......................................... 16-25 TouCAN Test Configuration Register .................................................................... 16-27 TouCAN Interrupt Configuration Register (CANICR) .......................................... 16-27 Control Register 0 (CANCTRL0) ........................................................................... 16-27 Control Register 1 (CANCTRL1) ........................................................................... 16-28 Prescaler Divide Register (PRESDIV) ................................................................... 16-29 Control Register 2 (CANCTRL2) ........................................................................... 16-30 Free Running Timer (TIMER) ................................................................................ 16-31 Receive Global Mask Registers (RXGMSKHI, RXGMSKLO) ............................ 16-31 Receive Buffer 14 Mask Registers (RX14MSKHI, RX14MSKLO) ...................... 16-32 Receive Buffer 15 Mask Registers (RX15MSKHI, RX15MSKLO) ...................... 16-33 Error and Status Register (ESTAT) ........................................................................ 16-33 Interrupt Mask Register (IMASK) .......................................................................... 16-35 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxi Contents Paragraph Number 16.7.14 16.7.15 Title Page Number Interrupt Flag Register (IFLAG) ............................................................................. 16-36 Error Counters (RXECTR, TXECTR) .................................................................... 16-36 Chapter 17 Modular Input/Output Subsystem (MIOS14) 17.1 17.2 17.2.1 17.2.2 17.3 17.3.1 17.3.2 17.3.3 17.3.4 17.3.5 17.4 17.4.1 17.4.2 17.5 17.6 17.6.1 17.6.1.1 17.6.1.2 17.6.1.3 17.6.1.4 17.7 17.7.1 17.7.1.1 17.7.1.2 17.7.2 17.7.3 17.7.3.1 17.7.3.2 17.8 17.8.1 17.8.1.1 17.8.2 17.8.3 17.8.4 17.8.5 Block Diagram .............................................................................................................. 17-1 MIOS14 Key Features .................................................................................................. 17-3 Submodule Numbering, Naming, and Addressing ................................................... 17-4 Signal Naming Convention ....................................................................................... 17-5 MIOS14 Configuration ................................................................................................. 17-6 MIOS14 Signals ........................................................................................................ 17-9 MIOS14 Bus System ................................................................................................ 17-9 Read/Write and Control Bus ................................................................................... 17-10 Request Bus ............................................................................................................ 17-10 Counter Bus Set ...................................................................................................... 17-10 MIOS14 Programming Model .................................................................................... 17-10 Bus Error Support ................................................................................................... 17-10 Wait States .............................................................................................................. 17-11 MIOS14 I/O Ports ....................................................................................................... 17-13 MIOS14 Bus Interface Submodule (MBISM) ............................................................ 17-13 MIOS14 Bus Interface (MBISM) Registers ........................................................... 17-13 MIOS14 Test and Signal Control Register (MIOS14TPCR) ............................. 17-13 MIOS14 Vector Register (MIOS14VECT) ........................................................ 17-14 MIOS14 Module and Version Number Register (MIOS14VNR) ...................... 17-14 MIOS14 Module Configuration Register (MIOS14MCR) ................................. 17-15 MIOS14 Counter Prescaler Submodule (MCPSM) .................................................... 17-16 MCPSM Features .................................................................................................... 17-16 MCPSM Signal Functions .................................................................................. 17-17 Modular I/O Bus (MIOB) Interface .................................................................... 17-17 Effect of RESET on MCPSM ................................................................................. 17-17 MCPSM Registers .................................................................................................. 17-17 MCPSM Registers Organization ........................................................................ 17-17 MCPSM Status/Control Register (MCPSMSCR) .............................................. 17-18 MIOS14 Modulus Counter Submodule (MMCSM) ................................................... 17-19 MMCSM Features .................................................................................................. 17-20 MMCSM Signal Functions ................................................................................. 17-21 MMCSM Prescaler ................................................................................................. 17-21 Modular I/O Bus (MIOB) Interface ........................................................................ 17-21 Effect of RESET on MMCSM ................................................................................ 17-22 MMCSM Registers ................................................................................................. 17-22 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxii Contents Paragraph Number 17.8.5.1 17.8.5.2 17.8.5.3 17.8.5.4 17.8.5.5 17.9 17.9.1 17.9.1.1 17.9.2 17.9.3 17.9.3.1 17.9.3.2 17.9.3.3 17.9.3.4 17.9.3.5 17.9.3.5.1 17.9.3.5.2 17.9.3.5.3 17.9.3.6 17.9.4 17.9.5 17.9.6 17.9.6.1 17.9.6.2 17.9.6.3 17.9.6.4 17.9.6.5 17.10 17.10.1 17.10.2 17.10.3 17.10.3.1 17.10.3.2 17.10.3.3 17.10.3.4 17.10.3.5 17.10.3.6 17.10.3.7 17.10.3.8 17.10.3.9 Title Page Number MMCSM Register Organization ......................................................................... 17-22 MMCSM Up-Counter Register (MMCSMCNT) ............................................... 17-23 MMCSM Modulus Latch Register (MMCSMML) ............................................ 17-24 MMCSM Status/Control Register (MMCSMSCRD) (Duplicated) .................................................................................................... 17-24 MMCSM Status/Control Register (MMCSMSCR) ............................................ 17-24 MIOS14 Double Action Submodule (MDASM) ........................................................ 17-26 MDASM Features ................................................................................................... 17-27 MDASM Signal Functions ................................................................................. 17-28 MDASM Description .............................................................................................. 17-28 MDASM Modes of Operation ................................................................................ 17-29 Disable (DIS) Mode ............................................................................................ 17-29 Input Pulse Width Measurement (IPWM) Mode ................................................ 17-30 Input Period Measurement (IPM) Mode ............................................................. 17-31 Input Capture (IC) Mode .................................................................................... 17-32 Output Compare (OCB and OCAB) Modes ....................................................... 17-33 Single Shot Output Pulse Operation ............................................................... 17-34 Single Output Compare Operation ................................................................. 17-35 Output Port Bit Operation ............................................................................... 17-36 Output Pulse Width Modulation (OPWM) Mode .............................................. 17-36 Modular I/O Bus (MIOB) Interface ........................................................................ 17-39 Effect of RESET on MDASM ................................................................................ 17-39 MDASM Registers ................................................................................................. 17-39 MDASM Registers Organization ....................................................................... 17-39 MDASM Data A (MDASMAR) Register .......................................................... 17-41 MDASM Data B (MDASMBR) Register ........................................................... 17-42 MDASM Status/Control Register (MDASMSCRD) (Duplicated) .................... 17-43 MDASM Status/Control Register (MDASMSCR) ............................................ 17-43 MIOS14 Pulse Width Modulation Submodule (MPWMSM) .................................... 17-46 MPWMSM Terminology ........................................................................................ 17-47 MPWMSM Features ............................................................................................... 17-47 MPWMSM Description .......................................................................................... 17-48 Clock Selection ................................................................................................... 17-49 Counter ............................................................................................................... 17-49 Period Register .................................................................................................... 17-49 Pulse Width Registers ......................................................................................... 17-50 Duty Cycles (0% and 100%) .............................................................................. 17-51 Pulse/Frequency Range Table ............................................................................ 17-52 MPWMSM Status and Control Register (SCR) ................................................. 17-53 MPWMSM Interrupt .......................................................................................... 17-53 MPWMSM Port Functions ................................................................................. 17-54 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxiii Contents Paragraph Number 17.10.3.10 17.10.4 17.10.5 17.10.6 17.10.6.1 17.10.6.2 17.10.6.3 17.10.6.4 17.10.6.5 17.11 17.11.1 17.11.2 17.11.3 17.11.3.1 17.11.3.2 17.11.4 17.11.5 17.11.6 17.11.7 17.11.8 17.11.8.1 17.11.8.2 17.12 17.12.1 17.12.2 17.12.3 17.12.3.1 17.12.3.2 17.12.3.3 17.12.4 17.12.4.1 17.12.4.2 17.12.4.3 17.12.5 17.12.6 17.12.6.1 17.12.6.2 17.13 17.13.1 17.13.2 17.13.3 Title Page Number MPWMSM Data Coherency ............................................................................... 17-54 Modular Input/Output Bus (MIOS14) Interface ..................................................... 17-54 Effect of RESET on MPWMSM ............................................................................ 17-54 MPWMSM Registers .............................................................................................. 17-55 MPWMSM Registers Organization .................................................................... 17-55 MPWMSM Period Register (MPWMPERR) ..................................................... 17-57 MPWMSM Pulse Width Register (MPWMPULR) ........................................... 17-57 MPWMSM Counter Register (MPWMCNTR) .................................................. 17-58 MPWMSM Status/Control Register (MPWMSCR) ........................................... 17-58 MIOS14 16-bit Parallel Port I/O Submodule (MPIOSM) .......................................... 17-60 MPIOSM Features .................................................................................................. 17-61 MPIOSM Signal Functions ..................................................................................... 17-61 MPIOSM Description ............................................................................................. 17-61 MPIOSM Port Function ...................................................................................... 17-61 Non-Bonded MPIOSM Pads .............................................................................. 17-61 Modular I/O Bus (MIOB) Interface ........................................................................ 17-62 Effect of RESET on MPIOSM ............................................................................... 17-62 MPIOSM Testing .................................................................................................... 17-62 MPIOSM Registers ................................................................................................. 17-62 MPIOSM Register Organization ............................................................................ 17-62 MPIOSM Data Register (MPIOSMDR) ............................................................. 17-62 MPIOSM Data Direction Register (MPIOSMDDR) .......................................... 17-63 MIOS14 Interrupts ...................................................................................................... 17-63 MIOS14 Interrupt Structure .................................................................................... 17-63 MIOS14 Interrupt Request Submodule (MIRSM) ................................................. 17-64 MIRSM0 Interrupt Registers .................................................................................. 17-65 Interrupt Status Register (MIOS14SR0) ............................................................. 17-65 Interrupt Enable Register (MIOS14ER0) ........................................................... 17-66 Interrupt Request Pending Register (MIOS14RPR0) ......................................... 17-66 MIRSM1 Interrupt Registers .................................................................................. 17-67 Interrupt Status Register (MIOS14SR1) ............................................................. 17-67 Interrupt Enable Register (MIOS14ER1) ........................................................... 17-68 Interrupt Request Pending Register (MIOS14RPR1) ......................................... 17-68 Interrupt Control Section (ICS) .............................................................................. 17-69 MBISM Interrupt Registers .................................................................................... 17-69 MIOS14 Interrupt Level Register 0 (MIOS14LVL0) ........................................ 17-69 MIOS14 Interrupt Level Register 1 (MIOS14LVL1) ........................................ 17-70 MIOS14 Function Examples ...................................................................................... 17-70 MIOS14 Input Double Edge Pulse Width Measurement ........................................ 17-70 MIOS14 Input Double Edge Period Measurement ................................................. 17-71 MIOS14 Double Edge Single Output Pulse Generation ......................................... 17-72 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxiv Contents Paragraph Number 17.13.4 17.13.5 Title Page Number MIOS14 Output Pulse Width Modulation with MDASM ...................................... 17-73 MIOS14 Input Pulse Accumulation ........................................................................ 17-74 Chapter 18 Peripheral Pin Multiplexing (PPM) Module 18.1 18.2 18.3 18.3.1 18.3.1.1 18.3.1.2 18.3.1.3 18.3.2 18.3.2.1 18.3.2.2 18.3.2.3 18.3.2.4 18.3.3 18.4 18.4.1 18.4.1.1 18.4.2 18.4.3 18.4.4 18.4.5 18.4.6 18.4.7 18.4.8 18.4.9 18.4.10 18.4.11 18.4.12 Key Features ................................................................................................................. 18-1 Programming Model ..................................................................................................... 18-2 Functional Description .................................................................................................. 18-3 PPM Parallel-to-Serial Communication Protocol ..................................................... 18-3 Internal Multiplexing ............................................................................................ 18-4 PPM Clocks .......................................................................................................... 18-5 PPM Control Settings ........................................................................................... 18-7 PPM Signal Short Functionality ............................................................................... 18-9 TouCAN Shorting ................................................................................................. 18-9 TPU Shorting ........................................................................................................ 18-9 ETRIG1 and ETRIG2 ........................................................................................... 18-9 T2CLK ................................................................................................................ 18-10 PPM Module Pad Configuration ............................................................................. 18-10 PPM Registers ............................................................................................................. 18-10 Module Configuration Register (PPMMCR) .......................................................... 18-10 Entering Stop Mode ............................................................................................ 18-11 PPM Control Register (PPMPCR) .......................................................................... 18-12 Transmit Configuration Registers (TX_CONFIG_1 and TX_CONFIG_2) ........... 18-15 Receive Configuration Registers (RX_CONFIG_1 and RX_CONFIG_2) ............ 18-16 Receive Data Register (RX_DATA) ...................................................................... 18-17 Receive Shift Register (RX_SHIFTER) ................................................................. 18-18 Transmit Data Register (TX_DATA) ..................................................................... 18-18 General-Purpose Data Out (GPDO) ....................................................................... 18-18 General-Purpose Data In (GPDI) ............................................................................ 18-19 Short Register (SHORT_REG) .............................................................................. 18-19 Short Channels Register (SHORT_CH_REG) ...................................................... 18-22 Scale Transmit Clock Register (SCALE_TCLK_REG) ........................................ 18-24 Chapter 19 Time Processor Unit 3 19.1 19.2 19.2.1 Overview ....................................................................................................................... 19-2 TPU3 Components ........................................................................................................ 19-2 Time Bases ................................................................................................................ 19-2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxv Contents Paragraph Number 19.2.2 19.2.3 19.2.4 19.2.5 19.2.6 19.3 19.3.1 19.3.2 19.3.3 19.3.4 19.3.5 19.3.6 19.3.7 19.3.8 19.3.9 19.4 19.4.1 19.4.2 19.4.3 19.4.4 19.4.5 19.4.6 19.4.7 19.4.8 19.4.9 19.4.10 19.4.11 19.4.12 19.4.13 19.4.14 19.4.15 19.5 Title Page Number Timer Channels ......................................................................................................... 19-2 Scheduler .................................................................................................................. 19-2 Microengine .............................................................................................................. 19-3 Host Interface ............................................................................................................ 19-3 Parameter RAM ........................................................................................................ 19-3 TPU Operation .............................................................................................................. 19-3 Event Timing ............................................................................................................ 19-3 Channel Orthogonality .............................................................................................. 19-4 Interchannel Communication .................................................................................... 19-4 Programmable Channel Service Priority .................................................................. 19-4 Coherency ................................................................................................................. 19-4 Emulation Support .................................................................................................... 19-4 TPU3 Interrupts ........................................................................................................ 19-5 Prescaler Control for TCR1 ...................................................................................... 19-5 Prescaler Control for TCR2 ...................................................................................... 19-7 Programming Model ..................................................................................................... 19-8 TPU Module Configuration Register (TPUMCR) ................................................. 19-11 Development Support Control Register (DSCR) .................................................... 19-12 Development Support Status Register (DSSR) ...................................................... 19-13 TPU3 Interrupt Configuration Register (TICR) ..................................................... 19-14 Channel Interrupt Enable Register (CIER) ............................................................. 19-15 Channel Function Select Registers (CFSRn) .......................................................... 19-15 Host Sequence Registers (HSQRn) ........................................................................ 19-16 Host Service Request Registers (HSRRn) ............................................................. 19-17 Channel Priority Registers (CPRx) ......................................................................... 19-18 Channel Interrupt Status Register (CISR) .............................................................. 19-19 TPU3 Module Configuration Register 2 (TPUMCR2) ........................................... 19-19 TPU Module Configuration Register 3 (TPUMCR3) ............................................. 19-21 SIU Test Register (SIUTST) ................................................................................... 19-22 Factory Test Registers ............................................................................................ 19-22 TPU3 Parameter RAM ............................................................................................ 19-23 Time Functions ........................................................................................................... 19-23 Chapter 20 Dual-Port TPU3 RAM (DPTRAM) 20.1 20.2 20.3 20.3.1 20.3.2 Features ......................................................................................................................... 20-1 DPTRAM Configuration Block Diagram ..................................................................... 20-2 Programming Model ..................................................................................................... 20-2 DPTRAM Module Configuration Register (DPTMCR) ......................................... 20-3 DPTRAM Test Register (DPTTCR) ......................................................................... 20-4 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxvi Contents Paragraph Number 20.3.3 20.3.4 20.3.5 20.4 20.4.1 20.4.2 20.4.3 20.4.4 20.4.5 20.4.6 20.5 Title Page Number RAM Base Address Register (RAMBAR) ............................................................... 20-4 MISR High (MISRH) and MISR Low Registers (MISRL) ...................................... 20-5 MISC Counter (MISCNT) ........................................................................................ 20-6 DPTRAM Operation ..................................................................................................... 20-6 Normal Operation ..................................................................................................... 20-6 Standby Operation .................................................................................................... 20-6 Reset Operation ......................................................................................................... 20-7 Stop Operation .......................................................................................................... 20-7 Freeze Operation ....................................................................................................... 20-7 TPU3 Emulation Mode Operation ............................................................................ 20-7 Multiple Input Signature Calculator (MISC) ................................................................ 20-8 Chapter 21 CDR3 Flash (UC3F) EEPROM 21.0.1 21.1 21.1.1 21.2 21.2.1 21.2.1.1 21.2.1.2 21.2.1.3 21.2.1.4 21.2.2 21.2.3 21.2.3.1 21.2.4 21.3 21.3.1 21.3.2 21.3.3 21.3.3.1 21.3.4 21.3.5 21.3.6 21.3.6.1 21.3.7 21.3.7.1 21.3.7.2 21.3.7.3 Features of the CDR3 Flash EEPROM (UC3F) ....................................................... 21-3 UC3F Interface ............................................................................................................. 21-4 External Interface ...................................................................................................... 21-4 Programming Model ..................................................................................................... 21-5 UC3F EEPROM Control Registers .......................................................................... 21-5 Register Addressing .............................................................................................. 21-5 UC3F EEPROM Configuration Register (UC3FMCR) ....................................... 21-5 UC3F EEPROM Extended Configuration Register (UC3FMCRE) ..................... 21-8 UC3F EEPROM High Voltage Control Register (UC3FCTL) .......................... 21-11 UC3F EEPROM Array Addressing ........................................................................ 21-15 UC3F EEPROM Shadow Row ............................................................................... 21-15 Reset Configuration Word (UC3FCFIG) ........................................................... 21-16 UC3F EEPROM 512-Kbyte Array Configuration .................................................. 21-19 UC3F Operation .......................................................................................................... 21-19 Reset ........................................................................................................................ 21-19 Register Read and Write Operation ........................................................................ 21-20 Array Read Operation ............................................................................................. 21-20 Array On-Page Read Operation .......................................................................... 21-21 Shadow Row Select Read Operation ...................................................................... 21-21 Array Program/Erase Interlock Write Operation .................................................... 21-21 High Voltage Operations ........................................................................................ 21-21 Overview of Program/Erase Operation .............................................................. 21-21 Programming .......................................................................................................... 21-21 Program Sequence .............................................................................................. 21-22 Program Shadow Information ............................................................................. 21-24 Program Suspend ................................................................................................ 21-25 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxvii Contents Paragraph Number 21.3.8 21.3.8.1 21.3.8.2 21.3.8.3 21.3.9 21.3.10 21.3.11 21.3.11.1 21.3.11.2 21.3.11.3 21.3.11.4 21.3.12 Title Page Number Erasing .................................................................................................................... 21-25 Erase Sequence ................................................................................................... 21-26 Erasing Shadow Information Words .................................................................. 21-28 Erase Suspend ..................................................................................................... 21-28 Stop Operation ........................................................................................................ 21-28 Disabled .................................................................................................................. 21-29 Censored Accesses and Non-Censored Accesses ................................................... 21-29 Setting and Clearing Censor ............................................................................... 21-31 Setting Censor ..................................................................................................... 21-32 Clearing Censor .................................................................................................. 21-32 Switching The UC3F EEPROM Censorship ...................................................... 21-33 Background Debug Mode or Freeze Operation ...................................................... 21-34 Chapter 22 CALRAM Operation 22.1 22.2 22.3 22.4 22.4.1 22.4.2 22.4.2.1 22.4.3 22.4.4 22.4.5 22.4.6 22.4.6.1 22.4.6.2 22.4.6.3 22.4.6.4 22.5 22.5.1 22.5.2 22.5.3 22.5.4 Features ......................................................................................................................... 22-1 CALRAM Block Diagram ............................................................................................ 22-2 CALRAM Memory Map .............................................................................................. 22-2 Modes of Operation ...................................................................................................... 22-4 Reset .......................................................................................................................... 22-5 One-Cycle Mode ....................................................................................................... 22-5 CALRAM Access/Privilege Violations ................................................................ 22-5 Two-Cycle Mode ...................................................................................................... 22-5 Standby Operation/Keep-Alive Power .................................................................... 22-5 Stop Operation .......................................................................................................... 22-6 Overlay Mode Operation ......................................................................................... 22-6 Overlay Mode Configuration ................................................................................ 22-6 Priority of Overlay Regions ................................................................................ 22-11 Normal (Non-Overlay) Access to Overlay Regions ........................................... 22-12 Calibration Write Cycle Flow ............................................................................. 22-12 Programming Model ................................................................................................... 22-12 CALRAM Module Configuration Register (CRAMMCR) .................................... 22-13 CALRAM Region Base Address Registers (CRAM_RBAx) ................................ 22-15 CALRAM Overlay Configuration Register (CRAM_OVLCR) ............................. 22-17 CALRAM Ownership Trace Register (CRAM_OTR) ........................................... 22-17 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxviii Contents Paragraph Number Title Page Number Chapter 23 Development Support 23.1 23.1.1 23.1.1.1 23.1.1.2 23.1.1.3 23.1.2 23.1.3 23.1.4 23.1.4.1 23.1.4.2 23.1.4.3 23.1.4.4 23.1.4.5 23.1.5 23.2 23.2.1 23.2.1.1 23.2.1.2 23.2.1.3 23.2.1.4 23.2.1.5 23.2.1.6 23.2.2 23.2.2.1 23.2.3 23.2.3.1 23.3 23.3.1 23.3.1.1 23.3.1.2 23.3.1.3 23.3.1.4 23.3.1.5 23.3.1.6 23.4 23.4.1 23.4.2 23.4.3 Program Flow Tracking ................................................................................................ 23-1 Program Trace Cycle ................................................................................................ 23-2 Instruction Queue Status Pins -- VF [0:2] ........................................................... 23-2 History Buffer Flushes Status Pins-- VFLS [0:1] ............................................... 23-3 Queue Flush Information Special Case ................................................................ 23-4 Program Trace when in Debug Mode ....................................................................... 23-4 Sequential Instructions Marked as Indirect Branch .................................................. 23-4 External Hardware .................................................................................................... 23-4 Synchronizing the Trace Window to the CPU Internal Events ............................ 23-5 Detecting the Trace Window Start Address ......................................................... 23-6 Detecting the Assertion/Negation of VSYNC ...................................................... 23-6 Detecting the Trace Window End Address .......................................................... 23-6 Compress .............................................................................................................. 23-7 Instruction Fetch Show Cycle Control ...................................................................... 23-7 Watchpoints and Breakpoints Support ......................................................................... 23-7 Internal Watchpoints and Breakpoints ...................................................................... 23-9 Restrictions ......................................................................................................... 23-11 Byte and Half-Word Working Modes ................................................................ 23-11 Examples ............................................................................................................. 23-12 Context Dependent Filter .................................................................................... 23-13 Ignore First Match .............................................................................................. 23-14 Generating Six Compare Types .......................................................................... 23-14 Instruction Support ................................................................................................. 23-14 Load/Store Support ............................................................................................. 23-16 Watchpoint Counters .............................................................................................. 23-19 Trap Enable Programming .................................................................................. 23-19 Development System Interface ................................................................................... 23-19 Debug Mode Support .............................................................................................. 23-21 Debug Mode Enable vs. Debug Mode Disable .................................................. 23-23 Entering Debug Mode ......................................................................................... 23-24 Check Stop State and Debug Mode .................................................................... 23-26 Saving Machine State upon Entering Debug Mode ........................................... 23-27 Running in Debug Mode .................................................................................... 23-27 Exiting Debug Mode ........................................................................................... 23-28 Development Port ....................................................................................................... 23-28 Development Port Pins ........................................................................................... 23-28 Development Serial Clock ...................................................................................... 23-29 Development Serial Data In .................................................................................... 23-29 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxix Contents Paragraph Number 23.4.4 23.4.5 23.4.5.1 23.4.5.2 23.4.5.3 23.4.6 23.4.6.1 23.4.6.2 23.4.6.3 23.4.6.4 23.4.6.5 23.4.6.6 23.4.6.7 23.4.6.8 23.4.6.9 23.4.6.10 23.4.6.11 23.5 23.5.1 23.6 23.6.1 23.6.2 23.6.3 23.6.4 23.6.5 23.6.6 23.6.7 23.6.8 23.6.9 23.6.10 23.6.11 23.6.12 23.6.13 Title Page Number Development Serial Data Out ................................................................................. 23-29 Freeze Signal ........................................................................................................... 23-29 SGPIO6/FRZ/PTR Signal ................................................................................... 23-30 IWP[0:1]/VFLS[0:1] Signals .............................................................................. 23-30 VFLS[0:1]/MPIO32B[3:4] Signals ................................................................... 23-30 Development Port Registers ................................................................................... 23-30 Development Port Shift Register ........................................................................ 23-30 Trap Enable Control Register ............................................................................. 23-30 Development Port Registers Decode .................................................................. 23-31 Development Port Serial Communications -- Clock Mode Selection ............... 23-31 Development Port Serial Communications -- Trap Enable Mode .................... 23-33 Serial Data into Development Port -- Trap Enable Mode ................................. 23-33 Serial Data Out of Development Port -- Trap Enable Mode ............................. 23-34 Development Port Serial Communications -- Debug Mode ............................. 23-35 Serial Data Into Development Port ..................................................................... 23-35 Serial Data Out of Development Port ................................................................. 23-36 Fast Download Procedure ................................................................................... 23-37 Software Monitor Debugger Support ......................................................................... 23-38 Freeze Indication ..................................................................................................... 23-38 Development Support Registers ................................................................................. 23-39 Register Protection .................................................................................................. 23-40 Comparator A-D Value Registers (CMPA-CMPD) .............................................. 23-41 Exception Cause Register (ECR) ............................................................................ 23-41 Debug Enable Register (DER) ................................................................................ 23-43 Breakpoint Counter A Value and Control Register ................................................ 23-45 Breakpoint Counter B Value and Control Register ................................................ 23-46 Comparator E-F Value Registers (CMPE-CMPF) ................................................ 23-46 Comparator G-H Value Registers (CMPG-CMPH) .............................................. 23-47 L-Bus Support Control Register 1 .......................................................................... 23-47 L-Bus Support Control Register 2 .......................................................................... 23-48 I-Bus Support Control Register (ICTRL) ............................................................... 23-51 Breakpoint Address Register (BAR) ...................................................................... 23-53 Development Port Data Register (DPDR) .............................................................. 23-53 Chapter 24 READI Module 24.1 24.1.1 24.2 24.2.1 Features Summary ........................................................................................................ 24-1 Functional Block Diagram ........................................................................................ 24-2 Modes of Operation ...................................................................................................... 24-3 Reset Configuration .................................................................................................. 24-3 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxx Contents Paragraph Number 24.2.2 24.2.3 24.2.4 24.3 24.4 24.5 24.6 24.6.1 24.6.1.1 24.6.1.2 24.6.1.3 24.6.1.4 24.6.1.5 24.6.1.6 24.6.1.7 24.6.1.8 24.6.1.9 24.6.2 24.6.3 24.6.4 24.6.5 24.6.5.1 24.6.5.2 24.7 24.7.1 24.7.1.1 24.7.2 24.7.3 24.7.4 24.7.5 24.7.5.1 24.7.5.2 24.7.5.3 24.7.5.3.1 24.7.5.3.2 24.7.5.4 24.7.6 24.7.7 24.7.7.1 24.7.7.2 Title Page Number Security ..................................................................................................................... 24-4 Normal ...................................................................................................................... 24-4 Disabled .................................................................................................................... 24-4 Parametrics .................................................................................................................... 24-4 Messages ....................................................................................................................... 24-4 Terms and Definitions .................................................................................................. 24-6 Programming Model ..................................................................................................... 24-8 Register Map ............................................................................................................. 24-8 User-Mapped Register (OTR) .............................................................................. 24-8 Tool-Mapped Registers ........................................................................................ 24-9 Device ID Register (DID) ..................................................................................... 24-9 Development Control Register (DC) .................................................................. 24-10 Mode Control Register (MC) .............................................................................. 24-11 User Base Address Register (UBA) ................................................................... 24-12 Read/Write Access Register (RWA) .................................................................. 24-13 Upload/Download Information Register (UDI) .................................................. 24-15 Data Trace Attributes 1 and 2 Registers (DTA1 and DTA2) ............................. 24-17 Accessing Memory-Mapped Locations Via the Auxiliary Port ............................................................................................... 24-18 Accessing READI Tool Mapped Registers Via the Auxiliary Port ........................ 24-19 Partial Register Updates .......................................................................................... 24-19 Programming Considerations ................................................................................. 24-20 Program Trace Guidelines .................................................................................. 24-20 Compressed Code Mode Guidelines .................................................................. 24-20 Signal Interface ........................................................................................................... 24-20 Functional Description ............................................................................................ 24-21 Signals Implemented .......................................................................................... 24-21 Functional Block Diagram ...................................................................................... 24-22 Message Priority ..................................................................................................... 24-22 Signal Protocol ........................................................................................................ 24-23 Messages ................................................................................................................. 24-24 Message Formats ................................................................................................ 24-28 Rules of Messages .............................................................................................. 24-31 Branch Trace Message Examples ....................................................................... 24-32 Example of Indirect Branch Message ............................................................. 24-32 Example of Direct Branch Message ............................................................... 24-33 Non-Temporal Ordering of Transmitted Messages ............................................ 24-33 READI Reset Configuration ................................................................................... 24-34 READI Signals ....................................................................................................... 24-36 Reset Configuration for Debug Mode ................................................................ 24-36 Reset Configuration for Non-Debug Mode ........................................................ 24-37 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxxi Contents Paragraph Number 24.7.7.3 24.7.7.4 24.7.7.5 24.8 24.8.1 24.8.1.1 24.8.2 24.8.2.1 24.8.2.2 24.8.2.3 24.8.2.4 24.8.2.4.1 24.8.2.4.2 24.8.2.4.3 24.8.2.4.4 24.8.2.4.5 24.8.2.5 24.8.2.6 24.8.3 24.8.4 24.8.4.1 24.8.4.2 24.8.4.3 24.8.4.4 24.8.5 24.8.6 24.8.7 24.9 24.9.1 24.9.2 24.9.2.1 24.9.2.2 24.9.2.3 24.9.2.4 24.9.2.5 24.9.2.6 24.9.3 24.9.4 24.9.5 24.9.6 24.9.7 Title Page Number Secure Mode ....................................................................................................... 24-37 Disabled Mode .................................................................................................... 24-37 Guidelines for Transmitting Input Messages ...................................................... 24-37 Program Trace ............................................................................................................ 24-38 Branch Trace Messaging ........................................................................................ 24-38 RCPU Instructions that Cause BTM Messages .................................................. 24-38 BTM Message Formats ........................................................................................... 24-38 Direct Branch Messages ..................................................................................... 24-38 Indirect Branch Messages ................................................................................... 24-39 Correction Messages ........................................................................................... 24-40 Synchronization Messages .................................................................................. 24-42 Direct Branch Synchronization Message ....................................................... 24-44 Indirect Branch Synchronization Message ..................................................... 24-44 Direct Branch Synchronization Message With Compressed Code ................ 24-44 Indirect Branch Synchronization Message with Compressed Code ............... 24-45 Resource Full Message ................................................................................... 24-45 Error Messages ................................................................................................... 24-46 Relative Addressing ............................................................................................ 24-46 Queue Overflow Program Trace Error Message .................................................... 24-47 Branch Trace Message Operation ........................................................................... 24-47 BTM Capture and Encoding Algorithm ............................................................. 24-47 Instruction Fetch Snooping ................................................................................. 24-48 Instruction Execution Tracking .......................................................................... 24-48 Instruction Flush Cases ....................................................................................... 24-48 Branch Trace Message Queueing ........................................................................... 24-48 BTM Timing Diagrams .......................................................................................... 24-49 Program Trace Guidelines ...................................................................................... 24-51 Data Trace .................................................................................................................. 24-52 Data Trace for the Load/Store Bus (L-Bus) ............................................................ 24-52 Data Trace Message Formats .................................................................................. 24-52 Data Write Message ............................................................................................ 24-52 Data Read Message ............................................................................................. 24-53 Data Trace Synchronization Messages ............................................................... 24-53 Data Write Synchronization Message ................................................................ 24-54 Data Read Synchronization Messaging .............................................................. 24-54 Relative Addressing ............................................................................................ 24-54 Queue Overflow Data Trace Error Message ........................................................... 24-54 Data Trace Operation .............................................................................................. 24-54 Data Trace Windowing ........................................................................................... 24-56 Special L-Bus Cases ............................................................................................... 24-56 Data Trace Queuing ................................................................................................ 24-56 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxxii Contents Paragraph Number 24.9.8 24.9.8.1 24.9.8.2 24.9.9 24.10 24.10.1 24.10.2 24.10.2.1 24.10.2.2 24.10.3 24.10.3.1 24.10.3.2 24.10.4 24.10.4.1 24.10.4.2 24.10.5 24.10.5.1 24.10.5.2 24.10.5.3 24.10.6 24.10.7 24.10.8 24.10.8.1 24.10.8.2 24.10.8.3 24.10.9 24.10.10 24.10.10.1 24.11 24.12 24.12.1 24.12.1.1 24.12.2 24.12.3 24.12.4 24.13 24.13.1 24.13.2 24.13.2.1 24.13.2.2 24.13.3 Title Page Number Throughput and Latency ......................................................................................... 24-57 Assumptions for Throughput Analysis ............................................................... 24-57 Throughput Calculations .................................................................................... 24-57 Data Timing Diagrams ............................................................................................ 24-57 Read/Write Access ...................................................................................................... 24-59 Functional Description ............................................................................................ 24-59 Write Operation to Memory-Mapped Locations and SPR Registers ..................... 24-61 Single Write Operation ....................................................................................... 24-61 Block Write Operation ........................................................................................ 24-62 Read Operation to Memory-Mapped Locations and SPR Registers ...................... 24-63 Single Read Operation ........................................................................................ 24-63 Block Read Operation ......................................................................................... 24-64 Read/Write Access to Internal READI Registers ................................................... 24-64 Write Operation .................................................................................................. 24-64 Read Operation ................................................................................................... 24-65 Error Handling ........................................................................................................ 24-65 Access Alignment ............................................................................................... 24-65 L-Bus Address Error ........................................................................................... 24-65 L-Bus Data Error ................................................................................................ 24-65 Exception Sequences .............................................................................................. 24-66 Secure Mode ........................................................................................................... 24-66 Error Messages ....................................................................................................... 24-66 Read/Write Access Error .................................................................................... 24-66 Invalid Message .................................................................................................. 24-67 Invalid Access Opcode ....................................................................................... 24-67 Faster Read/Write Accesses with Default Attributes ............................................. 24-67 Throughput and Latency ......................................................................................... 24-68 Assumptions for Throughput Analysis ............................................................... 24-68 Read/Write Timing Diagrams ..................................................................................... 24-69 Watchpoint Support ................................................................................................... 24-72 Watchpoint Messaging ........................................................................................... 24-72 Watchpoint Source Field .................................................................................... 24-73 Watchpoint Overrun Error Message ....................................................................... 24-73 Synchronization ...................................................................................................... 24-74 Watchpoint Timing Diagrams ................................................................................ 24-74 Ownership Trace ........................................................................................................ 24-74 Ownership Trace Messaging .................................................................................. 24-75 Queue Overflow Ownership Trace Error Message ................................................. 24-75 OTM Flow .......................................................................................................... 24-75 OTM Queueing ................................................................................................... 24-76 OTM Timing Diagrams .......................................................................................... 24-76 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxxiii Contents Paragraph Number 24.14 24.14.1 24.14.1.1 24.14.1.2 24.14.1.3 24.14.1.4 24.14.2 24.14.2.1 24.14.2.2 24.14.2.3 24.14.2.4 24.14.3 24.14.4 24.15 24.15.1 24.15.2 Title Page Number RCPU Development Access ...................................................................................... 24-76 RCPU Development Access Messaging ................................................................. 24-77 DSDI Message .................................................................................................... 24-77 DSDO Message .................................................................................................. 24-78 BDM Status Message ......................................................................................... 24-78 Error Message (Invalid Message) ....................................................................... 24-79 RCPU Development Access Operation .................................................................. 24-79 Enabling RCPU Development Access Via READI Signals ............................... 24-80 Entering Background Debug Mode (BDM) Via READI Signals ...................... 24-80 Non-Debug Mode Access of RCPU Development Access ................................ 24-80 RCPU Development Access Flow Diagram ....................................................... 24-81 Throughput .............................................................................................................. 24-82 Development Access Timing Diagrams ................................................................. 24-82 Power Management ................................................................................................... 24-86 Functional Description ............................................................................................ 24-86 Low Power Modes .................................................................................................. 24-86 Chapter 25 IEEE 1149.1-Compliant Interface (JTAG) 25.1 25.1.1 25.1.2 25.1.2.1 25.1.2.2 25.1.3 25.1.3.1 25.1.3.2 25.1.3.3 25.1.3.4 25.1.4 25.2 25.2.1 25.2.2 IEEE 1149.1 Test Access Port ...................................................................................... 25-1 Overview ................................................................................................................... 25-2 Entering JTAG Mode ................................................................................................ 25-3 TAP Controller ..................................................................................................... 25-4 Boundary Scan Register ....................................................................................... 25-4 Instruction Register ................................................................................................. 25-30 EXTEST ............................................................................................................. 25-31 SAMPLE/PRELOAD ......................................................................................... 25-31 BYPASS ............................................................................................................. 25-31 CLAMP ............................................................................................................... 25-32 HI-Z ........................................................................................................................ 25-32 MPC561/MPC563 Restrictions .................................................................................. 25-32 Non-Scan Chain Operation ..................................................................................... 25-32 BSDL Description ................................................................................................... 25-33 Appendix A MPC562/MPC564 Compression Features A.1 A.2 ICDU Key Features ........................................................................................................ A-1 Class-Based Compression Model Main Principles......................................................... A-1 MPC561/MPC563 Reference Manual, Rev. 1.2 xxxiv Freescale Semiconductor Contents Paragraph Number A.2.1 A.2.2 A.2.3 A.2.4 A.2.5 A.2.6 A.2.7 A.2.8 A.2.8.1 A.2.8.2 A.2.8.3 A.2.9 A.2.9.1 A.2.9.2 A.2.9.3 A.2.9.4 A.2.9.5 A.2.10 A.2.11 A.2.12 A.2.13 A.2.14 A.2.14.1 A.2.14.2 A.3 A.3.1 A.3.1.1 A.3.1.2 A.3.1.2.1 A.3.2 A.3.3 A.3.3.1 A.4 Title Page Number Compression Model Features ..................................................................................... A-1 Model Limitations....................................................................................................... A-2 Instruction Class-Based Compression Algorithm....................................................... A-2 Compressed Address Generation with Direct Branches............................................. A-4 Compressed Address Generation--Indirect Branches ............................................... A-6 Compressed Address Generation--Exceptions .......................................................... A-6 Class Code Compression Algorithm Rules ................................................................ A-7 Bypass Field Compression Rules ............................................................................... A-7 Branch Right Segment Compression #1................................................................. A-7 Branch Right Segment Compression #2................................................................. A-8 Right Segment Zero Length Compression Bypass................................................. A-8 Instruction Class Structures and Programming .......................................................... A-8 Global Bypass......................................................................................................... A-8 Single Segment Full Compression - CLASS_1 ..................................................... A-9 Twin Segment Full Compression - CLASS_2 ....................................................... A-9 Left Segment Compression and Right Segment Bypass - CLASS_3................. A-10 Left Segment Bypass and Right Segment Compression--CLASS_4..................A-11 Instruction Layout Programming Summary ..............................................................A-11 Compression Process .................................................................................................A-11 Decompression.......................................................................................................... A-12 Compression Environment Initialization .................................................................. A-13 Compression/Non-Compression Mode Switch ........................................................ A-14 Compression Definition for Exception Handlers ................................................. A-14 Running Mixed Code............................................................................................ A-14 Operation Modes........................................................................................................... A-14 Instruction Fetch ....................................................................................................... A-14 Decompression Off Mode..................................................................................... A-15 Decompression On Mode ..................................................................................... A-15 Show Cycles in Decompression On Mode ....................................................... A-15 Vocabulary Table Storage Operation ........................................................................ A-16 READI Compression ................................................................................................ A-16 I-Bus Support Control Register (ICTRL) ............................................................. A-16 Decompressor Class Configuration Registers (DCCR0-15) ........................................ A-18 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxxv Contents Paragraph Number Title Page Number Appendix B Internal Memory Map Appendix C Clock and Board Guidelines C.1 C.2 C.2.1 C.2.2 C.2.3 C.3 C.3.1 C.3.2 C.3.3 MPC56x Device Power Distribution ...............................................................................C-2 Crystal Oscillator External Components .........................................................................C-4 KAPWR Filtering ........................................................................................................C-5 PLL External Components...........................................................................................C-5 PLL Off-Chip Capacitor CXFC...................................................................................C-6 PLL and Clock Oscillator External Components Layout Requirements .........................C-7 Traces and Placement ..................................................................................................C-7 Grounding/Guarding....................................................................................................C-7 IRAMSTBY Regulator Circuit....................................................................................C-7 Appendix D TPU3 ROM Functions D.1 D.2 D.3 D.4 D.5 D.6 D.7 D.8 D.9 D.10 D.11 D.12 D.13 D.14 D.15 D.16 D.17 D.18 D.19 D.20 D.20.1 Overview......................................................................................................................... D-1 Programmable Time Accumulator (PTA) ....................................................................... D-3 Queued Output Match TPU3 Function (QOM) .............................................................. D-5 Table Stepper Motor (TSM)............................................................................................ D-7 Frequency Measurement (FQM) .................................................................................. D-10 Universal Asynchronous Receiver/Transmitter (UART).............................................. D-12 New Input Capture/Transition Counter (NITC)............................................................ D-15 Multiphase Motor Commutation (COMM) .................................................................. D-17 Hall Effect Decode (HALLD) ...................................................................................... D-20 Multichannel Pulse-Width Modulation (MCPWM) ..................................................... D-22 Multi TPU (MULTI) ..................................................................................................... D-30 Fast Quadrature Decode TPU3 Function (FQD) .......................................................... D-35 Period/Pulse-Width Accumulator (PPWA)................................................................... D-38 ID TPU3 Function (ID)................................................................................................. D-40 Output Compare (OC) .................................................................................................. D-42 Pulse-Width Modulation (PWM).................................................................................. D-44 Discrete Input/Output (DIO)......................................................................................... D-46 Synchronized Pulse-Width Modulation (SPWM)......................................................... D-48 Read/Write Timers and Pin TPU3 Function (RWTPIN) .............................................. D-51 Serial Input/Output Port (SIOP) ................................................................................... D-53 Parameters................................................................................................................. D-53 MPC561/MPC563 Reference Manual, Rev. 1.2 xxxvi Freescale Semiconductor Contents Paragraph Number D.20.1.1 D.20.1.2 D.20.1.3 D.20.1.4 D.20.1.5 D.20.1.6 D.20.2 D.20.3 D.20.3.1 D.20.3.2 D.20.3.3 Title Page Number CHAN_CONTROL .............................................................................................. D-56 BIT_D ................................................................................................................... D-56 HALF_PERIOD ................................................................................................... D-56 BIT_COUNT ........................................................................................................ D-56 XFER_SIZE.......................................................................................................... D-56 SIOP_DATA ......................................................................................................... D-57 Host RCPU Initialization of the SIOP Function....................................................... D-57 SIOP Function Performance ..................................................................................... D-57 XFER_SIZE Greater Than 16 .............................................................................. D-58 Data Positioning.................................................................................................... D-58 Data Timing .......................................................................................................... D-58 Appendix E Memory Access Timing Appendix F Electrical Characteristics F.1 F.2 F.2.1 F.2.2 F.2.3 F.3 F.3.1 F.4 F.5 F.6 F.7 F.8 F.8.1 F.8.2 F.9 F.9.1 F.9.2 F.10 F.10.1 F.11 F.12 F.13 Package ............................................................................................................................ F-2 EMI Characteristics ......................................................................................................... F-2 Reference Documents .................................................................................................. F-2 Definitions and Acronyms ........................................................................................... F-3 EMI Testing Specifications.......................................................................................... F-3 Thermal Characteristics ................................................................................................... F-3 Thermal References ..................................................................................................... F-5 ESD Protection ................................................................................................................ F-6 DC Electrical Characteristics........................................................................................... F-7 Oscillator and PLL Electrical Characteristics................................................................ F-11 Flash Electrical Characteristics...................................................................................... F-12 Power-Up/Down Sequencing......................................................................................... F-13 Power-Up/Down Option A ........................................................................................ F-13 Power-Up/Down Option B ........................................................................................ F-15 Issues Regarding Power Sequence ................................................................................ F-17 Application of PORESET or HRESET ..................................................................... F-17 Keep-Alive RAM....................................................................................................... F-18 AC Timing ..................................................................................................................... F-18 Debug Port Timing .................................................................................................... F-43 READI Electrical Characteristics .................................................................................. F-45 RESET Timing............................................................................................................... F-47 IEEE 1149.1 Electrical Characteristics.......................................................................... F-50 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxxvii Contents Paragraph Number F.14 F.15 F.16 F.17 F.18 F.19 F.20 F.20.1 F.20.2 F.20.3 F.21 F.22 F.22.1 F.22.1.1 Title Page Number QADC64E Electrical Characteristics............................................................................. F-54 QSMCM Electrical Characteristics ............................................................................... F-56 GPIO Electrical Characteristics ..................................................................................... F-60 TPU3 Electrical Characteristics..................................................................................... F-61 TouCAN Electrical Characteristics................................................................................ F-62 PPM Timing Characteristics .......................................................................................... F-62 MIOS Timing Characteristics ........................................................................................ F-64 MPWMSM Timing Characteristics ........................................................................... F-64 MMCSM Timing Characteristics .............................................................................. F-67 MDASM Timing Characteristics............................................................................... F-69 MPIOSM Timing Characteristics .................................................................................. F-71 Pin Summary ................................................................................................................. F-73 Package Diagrams...................................................................................................... F-83 MPC561/MPC563 Ball Map ................................................................................. F-86 Appendix G 66-MHz Electrical Characteristics G.1 G.2 G.3 G.3.1 G.3.2 G.3.3 G.4 G.4.1 G.5 G.6 G.7 G.8 G.9 G.9.1 G.9.2 G.10 G.10.1 G.10.2 G.11 G.11.1 G.12 G.13 G.14 66-MHz Feature Limitations .......................................................................................... G-1 Package ........................................................................................................................... G-3 EMI Characteristics ........................................................................................................ G-3 Reference Documents ................................................................................................. G-3 Definitions and Acronyms .......................................................................................... G-3 EMI Testing Specifications......................................................................................... G-3 Thermal Characteristics .................................................................................................. G-3 Thermal References .................................................................................................... G-6 ESD Protection ............................................................................................................... G-6 DC Electrical Characteristics.......................................................................................... G-7 Oscillator and PLL Electrical Characteristics............................................................... G-10 Flash Electrical Characteristics......................................................................................G-11 Power-Up/Down Sequencing........................................................................................ G-12 Power-Up/Down Option A ....................................................................................... G-13 Power-Up/Down Option B ....................................................................................... G-15 Issues Regarding Power Sequence ............................................................................... G-17 Application of PORESET or HRESET .................................................................... G-17 Keep-Alive RAM...................................................................................................... G-18 AC Timing .................................................................................................................... G-18 Debug Port Timing ................................................................................................... G-41 READI Electrical Characteristics ................................................................................. G-43 RESET Timing.............................................................................................................. G-44 IEEE 1149.1 Electrical Characteristics......................................................................... G-47 MPC561/MPC563 Reference Manual, Rev. 1.2 xxxviii Freescale Semiconductor Contents Paragraph Number G.15 G.16 G.17 G.18 G.19 G.20 G.21 G.21.1 G.21.2 G.21.3 G.22 G.23 G.23.1 G.23.1.1 Title Page Number QADC64E Electrical Characteristics............................................................................ G-50 QSMCM Electrical Characteristics .............................................................................. G-52 GPIO Electrical Characteristics .................................................................................... G-56 TPU3 Electrical Characteristics.................................................................................... G-57 TouCAN Electrical Characteristics............................................................................... G-58 PPM Timing Characteristics ......................................................................................... G-58 MIOS Timing Characteristics ....................................................................................... G-59 MPWMSM Timing Characteristics .......................................................................... G-60 MMCSM Timing Characteristics ............................................................................. G-62 MDASM Timing Characteristics.............................................................................. G-64 MPIOSM Timing Characteristics ................................................................................. G-67 Pin Summary ................................................................................................................ G-68 Package Diagrams..................................................................................................... G-78 MPC561/MPC563 Ball Map ................................................................................ G-81 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xxxix Contents Paragraph Number Title Page Number MPC561/MPC563 Reference Manual, Rev. 1.2 xl Freescale Semiconductor Figures Figure Number 1-1 1-2 1-3 1-4 2-1 2-2 2-3 2-4 2-5 2-6 3-1 3-2 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 3-11 3-12 3-13 3-14 3-15 3-16 3-17 3-18 3-19 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 4-10 Title Page Number MPC561/MPC563 Block Diagram ........................................................................................... 1-3 Recommended Connection Diagram for IRAMSTBY........................................................... 1-11 MPC561/MPC563 Memory Map ........................................................................................... 1-12 MPC561/MPC563 Internal Memory Map .............................................................................. 1-14 MPC561/MPC563 Signal Groupings ....................................................................................... 2-2 Pads Module Configuration Register (PDMCR) .................................................................... 2-22 Pads Module Configuration Register 2 (PDMCR2) ............................................................... 2-23 Debug Mode Selection (JTAG) .............................................................................................. 2-30 Debug Mode Selection (BDM)............................................................................................... 2-30 Debug Mode Selection (Nexus).............................................................................................. 2-31 RCPU Block Diagram .............................................................................................................. 3-2 Sequencer Data Path ................................................................................................................. 3-4 RCPU Programming Model ..................................................................................................... 3-8 General-Purpose Registers (GPRs)......................................................................................... 3-12 Floating-Point Registers (FPRs) ............................................................................................. 3-13 Floating-Point Status and Control Register (FPSCR)............................................................. 3-14 Condition Register (CR) ......................................................................................................... 3-16 Integer Exception Register (XER) .......................................................................................... 3-18 Link Register (LR).................................................................................................................. 3-19 Count Register (CTR) ............................................................................................................. 3-19 Machine State Register (MSR) ............................................................................................... 3-20 DAE/Source Instruction Service Register (DSISR) ............................................................... 3-22 Data Address Register (DAR) ................................................................................................ 3-23 Machine Status Save/Restore Register 0 (SRR0) ................................................................... 3-23 Machine Status Save/Restore Register 1 (SRR1) ................................................................... 3-24 SPRG0-SPRG3 -- General Special-Purpose Registers 0-3 .................................................. 3-24 Processor Version Register (PVR) ......................................................................................... 3-25 Floating-Point Exception Cause Register (FPECR) ............................................................... 3-26 Basic Instruction Pipeline ....................................................................................................... 3-38 BBC Module Block Diagram ................................................................................................... 4-2 Exception Table Entries Mapping ............................................................................................ 4-8 External Interrupt Vectors Splitting........................................................................................ 4-12 DECRAM Interfaces Block Diagram ..................................................................................... 4-13 BTB Block Diagram ............................................................................................................... 4-16 MPC561/MPC563 Memory Map ........................................................................................... 4-17 BBC Module Configuration Register (BBCMCR)................................................................. 4-19 Region Base Address Register (MI_RBA[0:3]) ..................................................................... 4-21 Region Attribute Register (MI_RA0[0:3]) ............................................................................. 4-22 Global Region Attribute Register (MI_GRA) ........................................................................ 4-23 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xli Figures Figure Page Title Number Number 4-11 External Interrupt Relocation Table Base Address Register (EIBADR)................................ 4-25 5-1 USIU Block Diagram................................................................................................................ 5-2 6-1 System Configuration and Protection Logic............................................................................. 6-3 6-2 Circuit Paths of Reading and Writing to SGPIO ...................................................................... 6-7 6-3 MPC561/MPC563 Interrupt Structure...................................................................................... 6-9 6-4 Lower Priority Request Masking--One Bit Diagram ............................................................ 6-14 6-5 MPC561/MPC563 Interrupt Controller Block Diagram ........................................................ 6-15 6-6 Typical Interrupt Handler Routine.......................................................................................... 6-17 6-7 RTC Block Diagram ............................................................................................................... 6-20 6-8 PIT Block Diagram ................................................................................................................. 6-21 6-9 SWT State Diagram ................................................................................................................ 6-22 6-10 SWT Block Diagram .............................................................................................................. 6-23 6-11 MPC561/MPC563 Memory Map ........................................................................................... 6-24 6-12 SIU Module Configuration Register (SIUMCR).................................................................... 6-25 6-13 Internal Memory Mapping Register (IMMR)......................................................................... 6-28 6-14 External Master Control Register (EMCR) ............................................................................ 6-30 6-15 SIU Interrupt Pending Register (SIPEND) ............................................................................. 6-32 6-16 SIU Interrupt Pending Register 2 (SIPEND2) ........................................................................ 6-32 6-17 SIU Interrupt Pending Register 3 (SIPEND3) ........................................................................ 6-33 6-18 SIU Interrupt Mask Register (SIMASK) ................................................................................ 6-34 6-19 SIU Interrupt Mask Register 2 (SIMASK2) ........................................................................... 6-34 6-20 SIU Interrupt Mask Register 3 (SIMASK3) ........................................................................... 6-35 6-21 SIU Interrupt Edge Level Register (SIEL) ............................................................................. 6-35 6-22 SIU Interrupt Vector Register (SIVEC).................................................................................. 6-36 6-23 Example of SIVEC Register Usage for Interrupt Table Handling ......................................... 6-36 6-24 Interrupt In-Service Register 2 (SISR2) ................................................................................. 6-37 6-25 Interrupt In-Service Register 3 (SISR3) ................................................................................. 6-37 6-26 System Protection Control Register (SYPCR) ....................................................................... 6-38 6-27 Software Service Register (SWSR) ........................................................................................ 6-39 6-28 Transfer Error Status Register (TESR) ................................................................................... 6-39 6-29 Decrementer Register (DEC).................................................................................................. 6-40 6-30 Time Base (Reading) (TB) ..................................................................................................... 6-41 6-31 Time Base (Writing) (TB) ...................................................................................................... 6-41 6-32 Time Base Reference Register 0 (TBREF0)........................................................................... 6-41 6-33 Time Base Reference Register 1 (TBREF1)........................................................................... 6-41 6-34 Time Base Control and Status Register (TBSCR).................................................................. 6-42 6-35 Real-Time Clock Status and Control Register (RTCSC) ....................................................... 6-43 6-36 Real-Time Clock Register (RTC) ........................................................................................... 6-43 6-37 Real-Time Clock Alarm Register (RTCAL) .......................................................................... 6-44 6-38 Periodic Interrupt Status and Control Register (PISCR) ........................................................ 6-44 MPC561/MPC563 Reference Manual, Rev. 1.2 xlii Freescale Semiconductor Figures Figure Page Title Number Number 6-39 Periodic Interrupt Timer Count (PITC) .................................................................................. 6-45 6-40 Periodic Interrupt Timer Register (PITR)............................................................................... 6-45 6-41 SGPIO Data Register 1 (SGPIODT1) .................................................................................... 6-46 6-42 SGPIO Data Register 2 (SGPIODT2) .................................................................................... 6-47 6-43 SGPIO Control Register (SGPIOCR)..................................................................................... 6-48 7-1 Reset Status Register (RSR) ..................................................................................................... 7-5 7-2 Reset Configuration Basic Scheme........................................................................................... 7-8 7-3 Reset Configuration Sampling Scheme for "Short" PORESET Assertion, Limp Mode Disabled ............................................................... 7-9 7-4 Reset Configuration Timing for "Short" PORESET Assertion, Limp Mode Enabled............. 7-9 7-5 Reset Configuration Timing for "Long" PORESET Assertion, Limp Mode Disabled.......... 7-10 7-6 Reset Configuration Sampling Timing Requirements............................................................ 7-10 7-7 Reset Configuration Word (RCW) ......................................................................................... 7-11 8-1 Clock Unit Block Diagram ....................................................................................................... 8-2 8-2 Main System Oscillator Crystal Configuration ........................................................................ 8-3 8-3 System PLL Block Diagram ..................................................................................................... 8-5 8-4 MPC561/MPC563 Clocks ........................................................................................................ 8-8 8-5 General System Clocks Select ................................................................................................ 8-11 8-6 Divided System Clocks Timing Diagram ............................................................................... 8-12 8-7 Clocks Timing For DFNH = 1 (or DFNL = 0) ....................................................................... 8-13 8-8 Clock Source Switching Flow Chart ...................................................................................... 8-15 8-9 Low-Power Modes Flow Diagram ......................................................................................... 8-20 8-10 IRAMSTBY Regulator Circuit ............................................................................................... 8-23 8-11 Basic Power Supply Configuration......................................................................................... 8-24 8-12 External Power Supply Scheme.............................................................................................. 8-25 8-13 Keep-Alive Register Key State Diagram................................................................................ 8-27 8-14 No Standby, No KAPWR, All System Power-On/Off ........................................................... 8-28 8-15 Standby and KAPWR, Other Power-On/Off .......................................................................... 8-29 8-16 System Clock and Reset Control Register (SCCR) ................................................................ 8-30 8-17 PLL, Low-Power, and Reset-Control Register (PLPRCR) .................................................... 8-34 8-18 Change of Lock Interrupt Register (COLIR).......................................................................... 8-36 8-19 IRAMSTBY Control Register (VSRMCR) ............................................................................ 8-37 9-1 Input Sample Window .............................................................................................................. 9-2 9-2 MPC561/MPC563 Bus Signals ................................................................................................ 9-3 9-3 Basic Transfer Protocol ............................................................................................................ 9-8 9-4 Basic Flow Diagram of a Single Beat Read Cycle ................................................................... 9-9 9-5 Single Beat Read Cycle - Basic Timing - Zero Wait States.................................................. 9-10 9-6 Single Beat Read Cycle - Basic Timing - One Wait State .................................................... 9-11 9-7 Basic Flow Diagram of a Single Beat Write Cycle ................................................................ 9-12 9-8 Single Beat Basic Write Cycle Timing - Zero Wait States .................................................... 9-13 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xliii Figures Figure Page Title Number Number 9-9 Single Beat Basic Write Cycle Timing - One Wait State ...................................................... 9-14 9-10 Single Beat 32-Bit Data Write Cycle Timing -- 16-Bit Port Size ......................................... 9-15 9-11 Read Followed by Write when Pre-Discharge Mode is Enabled, and EHTR is Set .............. 9-17 9-12 Basic Flow Diagram Of A Burst-Read Cycle......................................................................... 9-21 9-13 Burst-Read Cycle - 32-Bit Port Size - Zero Wait State......................................................... 9-21 9-14 Burst-Read Cycle - 32-Bit Port Size - One Wait State.......................................................... 9-22 9-15 Burst-Read Cycle - 32-Bit Port Size - Wait States Between Beats ....................................... 9-23 9-16 Burst-Read Cycle - 16-Bit Port Size ...................................................................................... 9-24 9-17 Basic Flow Diagram of a Burst-Write Cycle.......................................................................... 9-26 9-18 Burst-Write Cycle, 32-Bit Port Size, Zero Wait States (Only for External Master Memory Controller Service Support)........................................... 9-26 9-19 Burst-Inhibit Read Cycle, 32-Bit Port Size (Emulated Burst)................................................ 9-27 9-20 Non-Wrap Burst with Three Beats ......................................................................................... 9-28 9-21 Non-Wrap Burst with One Data Beat ..................................................................................... 9-29 9-22 Internal Operand Representation ............................................................................................ 9-30 9-23 Interface To Different Port Size Devices................................................................................ 9-31 9-24 Bus Arbitration Flowchart ...................................................................................................... 9-33 9-25 Master Signals Basic Connection ........................................................................................... 9-34 9-26 Bus Arbitration Timing Diagram............................................................................................ 9-35 9-27 Internal Bus Arbitration State Machine .................................................................................. 9-36 9-28 Termination Signals Protocol Basic Connection .................................................................... 9-41 9-29 Termination Signals Protocol Timing Diagram...................................................................... 9-41 9-30 Reservation on Local Bus ....................................................................................................... 9-43 9-31 Reservation on Multi-level Bus Hierarchy ............................................................................. 9-44 9-32 Retry Transfer Timing - Internal Arbiter ............................................................................... 9-46 9-33 Retry Transfer Timing - External Arbiter .............................................................................. 9-47 9-34 Retry on Burst Cycle............................................................................................................... 9-48 9-35 Basic Flow of an External Master Read Access ..................................................................... 9-50 9-36 Basic Flow of an External Master Write Access .................................................................... 9-51 9-37 Peripheral Mode: External Master Reads from MPC561/MPC563 (Two Wait States) ......... 9-52 9-38 Peripheral Mode: External Master Writes to MPC561/MPC563 (Two Wait States)............ 9-53 9-39 Flow of Retry of External Master Read Access ..................................................................... 9-54 9-40 Retry of External Master Access (Internal Arbiter)................................................................ 9-55 9-41 Instruction Show Cycle Transaction....................................................................................... 9-57 9-42 Data Show Cycle Transaction................................................................................................. 9-58 10-1 Memory Controller Function within the USIU....................................................................... 10-1 10-2 Memory Controller Block Diagram........................................................................................ 10-2 10-3 MPC561/MPC563 Simple System Configuration .................................................................. 10-3 10-4 Bank Base Address and Match Structure ............................................................................... 10-4 10-5 A 4-2-2-2 Burst Read Cycle (One Wait State Between Bursts) ............................................. 10-9 MPC561/MPC563 Reference Manual, Rev. 1.2 xliv Freescale Semiconductor Figures Figure Page Title Number Number 10-6 4 Beat Burst Read with Short Setup Time (Zero Wait State) ............................................... 10-10 10-7 GPCM-Memory Devices Interface ...................................................................................... 10-12 10-8 Memory Devices Interface Basic Timing (ACS = 00, TRLX = 0)....................................... 10-13 10-9 Peripheral Devices Interface ................................................................................................. 10-13 10-10 Peripheral Devices Basic Timing (ACS = 11, TRLX = 0) ................................................... 10-14 10-11 Relaxed Timing -- Read Access (ACS = 11, SCY = 1, TRLX = 1).................................... 10-15 10-12 Relaxed Timing -- Write Access (ACS = 10, SCY = 0, CSNT = 0, TRLX = 1) ................ 10-16 10-13 Relaxed Timing -- Write Access (ACS = 11, SCY = 0, CSNT = 1, TRLX = 1) ................ 10-17 10-14 Relaxed Timing -- Write Access (ACS = 00, SCY = 0, CSNT = 1, TRLX = 1.................. 10-18 10-15 Consecutive Accesses (Write After Read, EHTR = 0) ......................................................... 10-19 10-16 Consecutive Accesses (Write After Read, EHTR = 1) ......................................................... 10-20 10-17 Consecutive Accesses (Read After Read From Different Banks, EHTR = 1) .......................................................... 10-21 10-18 Consecutive Accesses (Read After Read from Same Bank, EHTR = 1).............................. 10-22 10-19 Aliasing Phenomenon Illustration ........................................................................................ 10-26 10-20 Synchronous External Master Configuration for GPCM-Handled Memory Devices .......................................................... 10-29 10-21 Synchronous External Master Basic Access (GPCM Controlled)........................................ 10-30 10-22 Memory Controller Status Register (MSTAT) ..................................................................... 10-32 10-23 Memory Controller Base Registers 0-3 (BR0-BR3) ........................................................... 10-32 10-24 Memory Controller Option Registers 1-3 (OR0-OR3) ....................................................... 10-34 10-25 Dual-Mapping Base Register (DMBR) ................................................................................ 10-36 10-26 Dual-Mapping Option Register (DMOR)............................................................................. 10-37 11-1 L2U Bus Interface Block Diagram ......................................................................................... 11-3 11-2 DMPU Basic Functional Diagram .......................................................................................... 11-5 11-3 Region Base Address Example............................................................................................... 11-7 11-4 L2U Module Configuration Register (L2U_MCR) .............................................................. 11-14 11-5 L2U Region x Base Address Register (L2U_RBAx) ........................................................... 11-14 11-6 L2U Region X Attribute Register (L2U_RAx) .................................................................... 11-15 11-7 L2U Global Region Attribute Register (L2U_GRA) ........................................................... 11-16 12-1 UIMB Interface Module Block Diagram................................................................................ 12-2 12-2 IMB3 Clock - Full-Speed IMB3 Bus ..................................................................................... 12-3 12-3 IMB3 Clock - Half-Speed IMB3 Bus .................................................................................... 12-3 12-4 Interrupt Synchronizer Signal Flow........................................................................................ 12-4 12-5 Time-Multiplexing Protocol for IRQ Signals ......................................................................... 12-5 12-6 Interrupt Synchronizer Block Diagram................................................................................... 12-6 12-7 UIMB Module Configuration Register (UMCR) ................................................................... 12-7 12-8 Pending Interrupt Request Register (UIPEND)...................................................................... 12-9 13-1 QADC64E Block Diagram ..................................................................................................... 13-1 13-2 QADC64E Conversion Queue Operation............................................................................... 13-5 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xlv Figures Figure Page Title Number Number 13-3 Example of External Multiplexing ......................................................................................... 13-6 13-4 Module Configuration Register (QADCMCR) ...................................................................... 13-8 13-5 QADC Interrupt Register (QADCINT) ................................................................................ 13-12 13-6 Interrupt Levels on IRQ with ILBS ...................................................................................... 13-13 13-7 Port x Data Register (PORTQA and PORTQB).................................................................. 13-13 13-8 Port A Data Direction Register (DDRQA) .......................................................................... 13-14 13-9 Control Register 0 (QACR0) ................................................................................................ 13-15 13-10 Control Register 1 (QACR1) ............................................................................................... 13-16 13-11 Control Register 2 (QACR2) ................................................................................................ 13-18 13-12 Status Register 0 (QASR0) ................................................................................................... 13-21 13-13 QADC64E Queue Status Transition ..................................................................................... 13-26 13-14 Status Register 1 (QASR1) ................................................................................................... 13-27 13-15 QADC64E Conversion Queue Operation............................................................................. 13-28 13-16 Conversion Command Word Table (CCW) ......................................................................... 13-30 13-17 Right Justified, Unsigned Result Format (RJURR).............................................................. 13-33 13-18 Left Justified, Signed Result Format (LJSRR) ..................................................................... 13-33 13-19 Left Justified, Unsigned Result Register (LJURR) .............................................................. 13-33 13-20 QADC64E Analog Subsystem Block Diagram .................................................................... 13-34 13-21 Conversion Timing ............................................................................................................... 13-35 13-22 Bypass Mode Conversion Timing ........................................................................................ 13-36 13-23 QADC64E Queue Operation with Pause.............................................................................. 13-39 13-24 QADC64E Clock Subsystem Functions ............................................................................... 13-48 13-25 QADC64E Clock Programmability Examples ..................................................................... 13-50 13-26 Bus Cycle Accesses .............................................................................................................. 13-53 13-27 CCW Priority Situation 1...................................................................................................... 13-56 13-28 CCW Priority Situation 2...................................................................................................... 13-56 13-29 CCW Priority Situation 3...................................................................................................... 13-57 13-30 CCW Priority Situation 4...................................................................................................... 13-57 13-31 CCW Priority Situation 5...................................................................................................... 13-58 13-32 CCW Priority Situation 6...................................................................................................... 13-58 13-33 CCW Priority Situation 7...................................................................................................... 13-59 13-34 CCW Priority Situation 8...................................................................................................... 13-59 13-35 CCW Priority Situation 9...................................................................................................... 13-60 13-36 CCW Priority Situation 10.................................................................................................... 13-60 13-37 CCW Priority Situation 11.................................................................................................... 13-61 13-38 CCW Freeze Situation 12 ..................................................................................................... 13-61 13-39 CCW Freeze Situation 13 ..................................................................................................... 13-62 13-40 CCW Freeze Situation 14 ..................................................................................................... 13-62 13-41 CCW Freeze Situation 15 ..................................................................................................... 13-62 13-42 CCW Freeze Situation 16 ..................................................................................................... 13-62 MPC561/MPC563 Reference Manual, Rev. 1.2 xlvi Freescale Semiconductor Figures Figure Page Title Number Number 13-43 CCW Freeze Situation 17 ..................................................................................................... 13-63 13-44 CCW Freeze Situation 18 ..................................................................................................... 13-63 13-45 CCW Freeze Situation 19 ..................................................................................................... 13-63 13-46 External Trigger Mode (Positive Edge) Timing with Pause................................................. 13-64 13-47 Gated Mode, Single-Scan Timing ........................................................................................ 13-65 13-48 Gated Mode, Continuous Scan Timing................................................................................. 13-66 13-49 Equivalent Analog Input Circuitry ....................................................................................... 13-68 13-50 Errors Resulting from Clipping ............................................................................................ 13-69 13-51 Star-Ground at the Point of Power Supply Origin ................................................................ 13-71 13-52 Electrical Model of an A/D Input Signal .............................................................................. 13-72 13-53 External Multiplexing of Analog Signal Sources ................................................................. 13-74 13-54 Input Signal Subjected to Negative Stress ............................................................................ 13-76 13-55 Input Signal Subjected to Positive Stress ............................................................................. 13-77 14-1 QADC64E Block Diagram ..................................................................................................... 14-1 14-2 CCW Queue and Result Table Block Diagram ...................................................................... 14-5 14-3 Example of External Multiplexing ......................................................................................... 14-6 14-4 Module Configuration Register (QADCMCR) ...................................................................... 14-8 14-5 QADC Interrupt Register (QADCINT) ................................................................................ 14-12 14-6 Interrupt Levels on IRQ with ILBS ...................................................................................... 14-12 14-7 Port A Data Register (PORTQA), Port B Data Register (PORTQB)................................... 14-13 14-8 Portx Data Direction Register (DDRQA and DDRQB) ...................................................... 14-14 14-9 Control Register 0 (QACR0) ................................................................................................ 14-14 14-10 Control Register 1 (QACR1) ............................................................................................... 14-16 14-11 Control Register 2 (QACR2) ................................................................................................ 14-18 14-12 Status Register 0 (QASR0) ................................................................................................... 14-22 14-13 Queue Status Transition........................................................................................................ 14-27 14-14 Status Register 1 (QASR1) ................................................................................................... 14-28 14-15 QADC64E Conversion Queue Operation............................................................................. 14-29 14-16 Conversion Command Word Table (CCW) ......................................................................... 14-31 14-17 Right Justified, Unsigned Result Format (RJURR).............................................................. 14-35 14-18 Left Justified, Signed Result Format (LJSRR) ..................................................................... 14-35 14-19 Left Justified, Unsigned Result Register (LJURR) .............................................................. 14-35 14-20 QADC64E Analog Subsystem Block Diagram .................................................................... 14-36 14-21 Conversion Timing ............................................................................................................... 14-37 14-22 QADC64E Queue Operation With Pause ............................................................................. 14-40 14-23 QADC64E Clock Subsystem Functions ............................................................................... 14-49 14-24 Bus Cycle Accesses .............................................................................................................. 14-52 14-25 CCW Priority Situation 1...................................................................................................... 14-55 14-26 CCW Priority Situation 2...................................................................................................... 14-55 14-27 CCW Priority Situation 3...................................................................................................... 14-56 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xlvii Figures Figure Page Title Number Number 14-28 CCW Priority Situation 4...................................................................................................... 14-56 14-29 CCW Priority Situation 5...................................................................................................... 14-57 14-30 CCW Priority Situation 6...................................................................................................... 14-57 14-31 CCW Priority Situation 7...................................................................................................... 14-58 14-32 CCW Priority Situation 8...................................................................................................... 14-58 14-33 CCW Priority Situation 9...................................................................................................... 14-59 14-34 CCW Priority Situation 10.................................................................................................... 14-59 14-35 CCW Priority Situation 11.................................................................................................... 14-60 14-36 CCW Freeze Situation 12 ..................................................................................................... 14-60 14-37 CCW Freeze Situation 13 ..................................................................................................... 14-61 14-38 CCW Freeze Situation 14 ..................................................................................................... 14-61 14-39 CCW Freeze Situation 15 ..................................................................................................... 14-61 14-40 CCW Freeze Situation 16 ..................................................................................................... 14-61 14-41 CCW Freeze Situation 17 ..................................................................................................... 14-62 14-42 CCW Freeze Situation 18 ..................................................................................................... 14-62 14-43 CCW Freeze Situation 19 ..................................................................................................... 14-62 14-44 External Trigger Mode (Positive Edge) Timing with Pause................................................. 14-63 14-45 Gated Mode, Single-Scan Timing ........................................................................................ 14-64 14-46 Gated Mode, Continuous Scan Timing................................................................................. 14-65 14-47 Equivalent Analog Input Circuitry ....................................................................................... 14-66 14-48 Errors Resulting from Clipping ............................................................................................ 14-67 14-49 Star-Ground at the Point of Power Supply Origin ................................................................ 14-69 14-50 Electrical Model of an A/D Input Signal .............................................................................. 14-71 14-51 External Multiplexing of Analog Signal Sources ................................................................. 14-72 14-52 Input Signal Subjected to Negative Stress ............................................................................ 14-74 14-53 Input Signal Subjected to Positive Stress ............................................................................. 14-75 15-1 QSMCM Block Diagram ........................................................................................................ 15-2 15-2 QSMCM Interrupt Levels ....................................................................................................... 15-7 15-3 Interrupt Hardware Block Diagram ........................................................................................ 15-8 15-4 QSMCM Configuration Register (QSMCMMCR) ................................................................ 15-8 15-5 QSM2 Dual SCI Interrupt Level Register (QDSCI_IL) ......................................................... 15-9 15-6 QSPI_IL -- QSPI Interrupt Level Register .......................................................................... 15-10 15-7 PORTQS -- Port QS Data Register ..................................................................................... 15-12 15-8 PORTQS Pin Assignment Register (PQSPAR).................................................................... 15-13 15-9 PORTQS Data Direction Register (DDRQS) ....................................................................... 15-14 15-10 QSPI Block Diagram ............................................................................................................ 15-15 15-11 QSPI Control Register 0 (SPCR0)........................................................................................ 15-17 15-12 SPCR1 -- QSPI Control Register ........................................................................................ 15-19 15-13 SPCR2 -- QSPI Control Register 2 ..................................................................................... 15-20 15-14 SPCR3 -- QSPI Control Register 3 ..................................................................................... 15-21 MPC561/MPC563 Reference Manual, Rev. 1.2 xlviii Freescale Semiconductor Figures Figure Page Title Number Number 15-15 QSPI Status Register (SPSR)................................................................................................ 15-21 15-16 QSPI RAM............................................................................................................................ 15-23 15-17 CR[0:F] -- Command RAM 0x30 51C0, 0x30 51DF.......................................................... 15-24 15-18 Flowchart of QSPI Initialization Operation.......................................................................... 15-28 15-19 Flowchart of QSPI Master Operation (Part 1) ...................................................................... 15-29 15-20 Flowchart of QSPI Master Operation (Part 2) ...................................................................... 15-30 15-21 Flowchart of QSPI Master Operation (Part 3) ...................................................................... 15-31 15-22 Flowchart of QSPI Slave Operation (Part 1) ........................................................................ 15-32 15-23 Flowchart of QSPI Slave Operation (Part 2) ........................................................................ 15-33 15-24 SCI Transmitter Block Diagram ........................................................................................... 15-43 15-25 SCI Receiver Block Diagram ............................................................................................... 15-44 15-26 SCCxR0 -- SCI Control Register 0 ..................................................................................... 15-46 15-27 SCI Control Register 1 (SCCxR1)........................................................................................ 15-47 15-28 SCIx Status Register (SCxSR).............................................................................................. 15-49 15-29 SCI Data Register (SCxDR) ................................................................................................. 15-51 15-30 Start Search Example............................................................................................................ 15-57 15-31 QSCI1 Control Register (QSCI1CR).................................................................................... 15-60 15-32 QSCI1 Status Register (QSCI1SR)....................................................................................... 15-61 15-33 Queue Transmitter Block Enhancements ............................................................................. 15-63 15-34 Queue Transmit Flow ........................................................................................................... 15-66 15-35 Queue Transmit Software Flow ............................................................................................ 15-66 15-36 Queue Transmit Example for 17 Data Bytes ........................................................................ 15-67 15-37 Queue Transmit Example for 25 Data Frames ..................................................................... 15-69 15-38 Queue Receiver Block Enhancements .................................................................................. 15-70 15-39 Queue Receive Flow ............................................................................................................. 15-73 15-40 Queue Receive Software Flow ............................................................................................. 15-74 15-41 Queue Receive Example for 17 Data Bytes.......................................................................... 15-75 16-1 TouCAN Block Diagram ........................................................................................................ 16-1 16-2 Typical CAN Network............................................................................................................ 16-3 16-3 Extended ID Message Buffer Structure .................................................................................. 16-4 16-4 Standard ID Message Buffer Structure ................................................................................... 16-4 16-5 Relationship between System Clock and CAN Bit Segments ................................................ 16-9 16-6 CAN Controller State Diagram............................................................................................. 16-12 16-7 Interrupt Levels on IRQ with ILBS ...................................................................................... 16-21 16-8 TouCAN Message Buffer Memory Map .............................................................................. 16-24 16-9 TouCAN Module Configuration Register (CANMCR) ....................................................... 16-25 16-10 TouCAN Interrupt Configuration Register (CANICR) ........................................................ 16-27 16-11 Control Register 0 (CANCTRL0)......................................................................................... 16-27 16-12 Control Register 1 (CANCTRL1)......................................................................................... 16-28 16-13 Prescaler Divide Register...................................................................................................... 16-29 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor xlix Figures Figure Page Title Number Number 16-14 Control Register 2 (CANCTRL2)......................................................................................... 16-30 16-15 Free Running Timer Register (TIMER) ............................................................................... 16-31 16-16 Receive Global Mask Register: High (RXGMSKHI), Low (RXGMSKLO) ....................... 16-31 16-17 Receive Buffer 14 Mask Registers: High (RX14MSKHI), Low (RX14MSKLO)............... 16-32 16-18 Receive Buffer 15 Mask Registers: High (RX15MSKHI), Low (RX15MSKLO)............... 16-33 16-19 Error and Status Register (ESTAT) ...................................................................................... 16-33 16-20 Interrupt Mask Register (IMASK)........................................................................................ 16-35 16-21 Interrupt Flag Register (IFLAG)........................................................................................... 16-36 16-22 Receive Error Counter (RXECTR), Transmit Error Counter (TXECTR)............................ 16-36 17-1 MPC561/MPC563 MIOS14 Block Diagram .......................................................................... 17-2 17-2 MIOS14 Memory Map ......................................................................................................... 17-13 17-3 MBISM Registers ................................................................................................................. 17-13 17-4 Test and Signal Control Register (MIOS14TPCR) .............................................................. 17-14 17-5 Vector Register (MIOS14VECT) ......................................................................................... 17-14 17-6 MIOS14 Module/Version Number Register (MIOS14VNR)............................................... 17-14 17-7 Module Configuration Register (MIOS14MCR).................................................................. 17-15 17-8 MCPSM Block Diagram....................................................................................................... 17-16 17-9 MCPSM Status/Control Register (MCPSMSCR) ................................................................ 17-18 17-10 MMCSM Block Diagram ..................................................................................................... 17-20 17-11 MMCSM Modulus Up-Counter............................................................................................ 17-20 17-12 MMCSM Up-Counter Register (MMCSMCNT) ................................................................. 17-23 17-13 MMCSM Modulus Latch Register (MMCSMML) .............................................................. 17-24 17-14 MMCSM Status/Control Register (MMCSMSCR).............................................................. 17-24 17-15 MDASM Block Diagram...................................................................................................... 17-27 17-16 Input Pulse Width Measurement Example ........................................................................... 17-31 17-17 Input Period Measurement Example..................................................................................... 17-32 17-18 MDASM Input Capture Example ......................................................................................... 17-33 17-19 Single Shot Output Pulse Example ....................................................................................... 17-35 17-20 Single Shot Output Transition Example ............................................................................... 17-36 17-21 MDASM Output Pulse Width Modulation Example............................................................ 17-37 17-22 MDASM Data A Register (MDASMAR) ............................................................................ 17-41 17-23 MDASM DataB Register (MDASMBR).............................................................................. 17-42 17-24 MDASM Status/Control Register (MDASMSCR)............................................................... 17-44 17-25 MPWMSM Block Diagram .................................................................................................. 17-47 17-26 MPWMSM Period Register (MPWMPERR) ....................................................................... 17-57 17-27 MPWMSM Pulse Width Register (MPWMPULR).............................................................. 17-58 17-28 MPWMSM Counter Register (MPWMCNTR) .................................................................... 17-58 17-29 MPWMSM Status/Control Register (MPWMSCR)............................................................. 17-58 17-30 MPIOSM 1-Bit Block Diagram ............................................................................................ 17-60 17-31 MPIOSM -- Register Organization ..................................................................................... 17-62 MPC561/MPC563 Reference Manual, Rev. 1.2 l Freescale Semiconductor Figures Figure Page Title Number Number 17-32 MPIOSM Data Register (MPIOSMDR)............................................................................... 17-62 17-33 MPIOSM Data Direction Register (MPIOSMDDR)............................................................ 17-63 17-34 MIOS14 Interrupt Structure.................................................................................................. 17-64 17-35 Interrupt Status Register (MIOS14SR0)............................................................................... 17-66 17-36 Interrupt Enable Register (MIOS14ER0) ............................................................................. 17-66 17-37 Interrupt Request Pending Register (MIOS14RPR0) ........................................................... 17-67 17-38 Interrupt Status Register (MIOS14SR1)............................................................................... 17-67 17-39 Interrupt Enable Register (MIOS14ER1) ............................................................................. 17-68 17-40 Interrupt Request Pending Register (MIOS14RPR1) ........................................................... 17-68 17-41 MIOS14 Interrupt Level Register 0 (MIOS14LVL0)........................................................... 17-69 17-42 MIOS14 Interrupt Level Register 1 (MIOS14LVL1)........................................................... 17-70 17-43 MIOS14 Example: Double Capture Pulse Width Measurement .......................................... 17-71 17-44 MIOS14 Example: Double Capture Period Measurement ................................................... 17-72 17-45 MIOS14 Example: Double Edge Output Compare .............................................................. 17-73 17-46 MIOS14 Example: Pulse Width Modulation Output............................................................ 17-74 18-1 N-Signal I/O Compared with PPM I/O................................................................................... 18-2 18-2 Block Diagram of PPM Module ............................................................................................. 18-4 18-3 Internal Multiplexer Mechanism for Transmit Data............................................................... 18-5 18-4 Internal Multiplexer Mechanism for Received Data .............................................................. 18-5 18-5 PPM Clocks and Serial Data Signals ...................................................................................... 18-6 18-6 One Transmit and Receive Cycle in SPI Mode ...................................................................... 18-7 18-7 Examples Of Several TCLK Frequencies and Sample Rates ................................................. 18-8 18-8 Module Configuration Register (PPMMCR)........................................................................ 18-10 18-9 PPM Control Register (PPMPCR)........................................................................................ 18-12 18-10 Set ENRX While ENTX = 1................................................................................................. 18-14 18-11 Set ENTX while ENRX = 1.................................................................................................. 18-14 18-12 SPI Transfer Format with CP = 0 ......................................................................................... 18-15 18-13 SPI Transfer Format with CP = 1 ......................................................................................... 18-15 18-14 Transmit Configuration Register 1 (TX_CONFIG_1) ......................................................... 18-16 18-15 Transmit Configuration Register 2 (TX_CONFIG_2) ......................................................... 18-16 18-16 Receive Configuration Register 1 (RX_CONFIG_1)........................................................... 18-16 18-17 Receive Configuration Register 2 (RX_CONFIG_2)........................................................... 18-17 18-18 Receive Data Register (RX_DATA) .................................................................................... 18-18 18-19 Receive Shifter Register (RX_SHIFTER) ............................................................................ 18-18 18-20 Transmit Data Register (TX_DATA) ................................................................................... 18-18 18-21 General Purpose Data Out Register (GPDO) ....................................................................... 18-19 18-22 General Purpose Data In Register (GPDI)............................................................................ 18-19 18-23 Short Register (SHORT_REG)............................................................................................. 18-19 18-24 Example of TouCAN Internal Short with SH_TCAN = 0b110............................................ 18-21 18-25 Short Between TPU Channels .............................................................................................. 18-22 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor li Figures Figure Page Title Number Number 18-26 Short Channels Register (SHORT_CH_REG) ..................................................................... 18-23 18-27 Scale Transmit Clock Register (SCALE_TCLK_REG)....................................................... 18-24 19-1 TPU3 Block Diagram ............................................................................................................. 19-1 19-2 TPU3 Interrupt Levels ............................................................................................................ 19-5 19-3 TCR1 Prescaler Control.......................................................................................................... 19-7 19-4 TCR2 Prescaler Control.......................................................................................................... 19-8 19-5 TPUMCR -- TPU Module Configuration Register ............................................................. 19-11 19-6 DSCR -- Development Support Control Register ............................................................... 19-12 19-7 DSSR -- Development Support Status Register .................................................................. 19-14 19-8 TICR -- TPU3 Interrupt Configuration Register ................................................................. 19-14 19-9 CIER -- Channel Interrupt Enable Register......................................................................... 19-15 19-10 CFSR0 -- Channel Function Select Register 0 .................................................................... 19-16 19-11 CFSR1 -- Channel Function Select Register 1 .................................................................... 19-16 19-12 CFSR2 -- Channel Function Select Register 2 .................................................................... 19-16 19-13 CFSR3 -- Channel Function Select Register 3 .................................................................... 19-16 19-14 HSQR0 -- Host Sequence Register 0................................................................................... 19-17 19-15 HSQR1 -- Host Sequence Register 1................................................................................... 19-17 19-16 HSRR0 -- Host Service Request Register 0 ........................................................................ 19-17 19-17 HSRR1 -- Host Service Request Register 1 ........................................................................ 19-17 19-18 CPR0 -- Channel Priority Register 0 ................................................................................... 19-18 19-19 CPR1 -- Channel Priority Register 1 ................................................................................... 19-18 19-20 CISR -- Channel Interrupt Status Register .......................................................................... 19-19 19-21 TPUMCR2 -- TPU Module Configuration Register 2 ........................................................ 19-19 19-22 TPUMCR3 -- TPU Module Configuration Register 3 ........................................................ 19-21 19-23 SIUTST -- SIU Test Register .............................................................................................. 19-22 20-1 DPTRAM Configuration ........................................................................................................ 20-2 20-2 DPTRAM Memory Map......................................................................................................... 20-3 20-3 DPT Module Configuration Register (DPTMCR).................................................................. 20-3 20-4 RAM Array Base Address Register (RAMBAR)................................................................... 20-5 20-5 Multiple Input Signature Register High (MISRH) ................................................................. 20-5 20-6 Multiple Input Signature Register Low (MISRL) .................................................................. 20-6 20-7 MISC Counter (MISCNT) ...................................................................................................... 20-6 21-1 Block Diagram for a 512 Kbyte UC3F Module Configuration .............................................. 21-2 21-2 UC3F EEPROM Configuration Register (UC3FMCR) ......................................................... 21-5 21-3 UC3FMCRE-- UC3F EEPROM Extended Configuration Register ..................................... 21-9 21-4 UC3F EEPROM High Voltage Control Register (UC3FCTL) ............................................ 21-11 21-5 PEGOOD Valid Time ........................................................................................................... 21-14 21-6 Shadow Information ............................................................................................................. 21-16 21-7 Hard Reset Configuration Word (UC3FCFIG) .................................................................... 21-16 21-8 512-Kbyte Array Configuration............................................................................................ 21-19 MPC561/MPC563 Reference Manual, Rev. 1.2 lii Freescale Semiconductor Figures Figure Page Title Number Number 21-9 Program State Diagram......................................................................................................... 21-23 21-10 Erase State Diagram.............................................................................................................. 21-27 21-11 Censorship States and Transitions ........................................................................................ 21-33 22-1 System Block Diagram ........................................................................................................... 22-2 22-2 MPC561/MPC563 Memory Map with CALRAM Address Ranges ...................................... 22-3 22-3 Standby Power Supply Configuration for CALRAM Array .................................................. 22-4 22-4 CALRAM Array ..................................................................................................................... 22-7 22-5 CALRAM Module Overlay Map of Flash (CLPS = 0) .......................................................... 22-8 22-6 CALRAM Address Map (CLPS = 0) ..................................................................................... 22-9 22-7 CALRAM Module Overlay Map of Flash (CLPS = 1) ........................................................ 22-10 22-8 CALRAM Address Map (CLPS = 1) ................................................................................... 22-11 22-9 CALRAM Module Configuration Register (CRAMMCR).................................................. 22-13 22-10 CALRAM Region Base Address Register (CRAM_RBAx) ................................................ 22-16 22-11 CALRAM Overlay Configuration Register (CRAM_OVLCR)........................................... 22-17 22-12 CALRAM Ownership Trace Register (CRAM_OTR) ......................................................... 22-18 23-1 Watchpoint and Breakpoint Support in the CPU.................................................................... 23-9 23-2 Partially Supported Watchpoint/Breakpoint Example.......................................................... 23-13 23-3 Instruction Support General Structure .................................................................................. 23-15 23-4 Load/Store Support General Structure.................................................................................. 23-18 23-5 Functional Diagram of MPC561/MPC563 Debug Mode Support ....................................... 23-21 23-6 Debug Mode Logic ............................................................................................................... 23-23 23-7 BDM Mode Selection ........................................................................................................... 23-24 23-8 Debug Mode Reset Configuration ........................................................................................ 23-25 23-9 Asynchronous Clock Serial Communications ...................................................................... 23-32 23-10 Synchronous Self Clock Serial Communication .................................................................. 23-32 23-11 Enabling Clock Mode Following Reset................................................................................ 23-33 23-12 Download Procedure Code Example .................................................................................... 23-37 23-13 Slow Download Procedure Loop .......................................................................................... 23-38 23-14 Fast Download Procedure Loop ........................................................................................... 23-38 23-15 Comparator A-D Value Register (CMPA-CMPD).............................................................. 23-41 23-16 Exception Cause Register (ECR).......................................................................................... 23-42 23-17 Debug Enable Register (DER).............................................................................................. 23-43 23-18 Breakpoint Counter A Value and Control Register (COUNTA)......................................... 23-45 23-19 Breakpoint Counter B Value and Control Register (COUNTB) .......................................... 23-46 23-20 Comparator E-F Value Registers (CMPE-CMPF) .............................................................. 23-46 23-21 Comparator G-H Value Registers (CMPG-CMPH)............................................................ 23-47 23-22 L-Bus Support Control Register 1 (LCTRL) ........................................................................ 23-47 23-23 L-Bus Support Control Register 2 (LCTRL2) ...................................................................... 23-48 23-24 I-Bus Support Control Register (ICTRL) ............................................................................. 23-51 23-25 Breakpoint Address Register (BAR) .................................................................................... 23-53 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor liii Figures Figure Page Title Number Number 23-26 Development Port Data Register (DPDR) ............................................................................ 23-53 24-1 READI Functional Block Diagram......................................................................................... 24-3 24-2 READI Ownership Trace Register (OTR).............................................................................. 24-9 24-3 READI Device ID Register .................................................................................................. 24-10 24-4 READI Development Control (DC) Register ....................................................................... 24-10 24-5 READI Mode Control (MC) Register .................................................................................. 24-12 24-6 READI User Base Address Register .................................................................................... 24-13 24-7 READI Read/Write Access Register .................................................................................... 24-14 24-8 READI Upload/Download Information Register ................................................................. 24-16 24-9 RWD Field Configuration .................................................................................................... 24-17 24-10 READI Data Trace Attributes 1 Register (DTA1) READI Data Trace Attributes 2 Register (DTA2) ............................................................... 24-17 24-11 Functional Diagram of Signal Interface................................................................................ 24-22 24-12 Auxiliary Signal Packet Structure for Program Trace Indirect Branch Message .................................................................................................................... 24-23 24-13 MSEI/MSEO Transfers......................................................................................................... 24-24 24-14 Transmission Sequence of Messages.................................................................................... 24-32 24-15 READI Module Enabled....................................................................................................... 24-34 24-16 Enabling Program Trace Out of System Reset ..................................................................... 24-36 24-17 READI Mode Selection ........................................................................................................ 24-36 24-18 READI Module Disabled...................................................................................................... 24-37 24-19 Direct Branch Message Format ............................................................................................ 24-38 24-20 Indirect Branch Message Format .......................................................................................... 24-39 24-21 Indirect Branch Message Format with Compressed Code.................................................... 24-39 24-22 Bit Pointer Format with Compressed Code .......................................................................... 24-39 24-23 Program Trace Correction Message Format ......................................................................... 24-42 24-24 Direct Branch Synchronization Message Format (PTSM = 0)............................................. 24-44 24-25 Direct Branch Synchronization Message Format (PTSM = 1)............................................. 24-44 24-26 Indirect Branch Synchronization Message Format (PTSM = 0) .......................................... 24-44 24-27 Indirect Branch Synchronization Message Format (PTSM = 1) .......................................... 24-44 24-28 Direct Branch Synchronization Message Format with Compressed Code (PTSM = 0).................................................................................................................. 24-45 24-29 Direct Branch Synchronization Message Format with Compressed Code (PTSM = 1).................................................................................................................. 24-45 24-30 Indirect Branch Synchronization Message Format with Compressed Code (PTSM - 0)................................................................................................................... 24-45 24-31 Indirect Branch Synchronization Message Format with Compressed Code (PTSM = 1).................................................................................................................. 24-45 24-32 Program Trace Full Message Format.................................................................................... 24-46 24-33 Relative Address Generation and Re-Creation ..................................................................... 24-47 MPC561/MPC563 Reference Manual, Rev. 1.2 liv Freescale Semiconductor Figures Figure Page Title Number Number 24-34 Error Message (Queue Overflow) Format ............................................................................ 24-47 24-35 Direct Branch Message ......................................................................................................... 24-49 24-36 Indirect Branch Message ...................................................................................................... 24-49 24-37 Indirect Branch Message with Compressed Code ................................................................ 24-49 24-38 Program Trace Correction Message ..................................................................................... 24-50 24-39 Error Message (Program/Data/Ownership Trace Overrun).................................................. 24-50 24-40 Direct Branch Synchronization Message.............................................................................. 24-50 24-41 Indirect Branch Synchronization Message ........................................................................... 24-51 24-42 Direct Branch Synchronization Message with Compressed Code ......................................................................................................... 24-51 24-43 Indirect Branch Synchronization Message with Compressed Code ..................................... 24-51 24-44 Data Write Message Format ................................................................................................. 24-52 24-45 Data Read Message Format .................................................................................................. 24-53 24-46 Data Write Synchronization Message Format ...................................................................... 24-54 24-47 Data Read Synchronization Message Format ....................................................................... 24-54 24-48 Error Message (Queue Overflow) Format ............................................................................ 24-54 24-49 Data Trace Flow Diagram for Non-Pipelined Access .......................................................... 24-55 24-50 Date Write Message.............................................................................................................. 24-57 24-51 Data Read Message............................................................................................................... 24-58 24-52 Data Write Synchronization Message................................................................................... 24-58 24-53 Data Read Synchronization Message ................................................................................... 24-58 24-54 Error Message (Program/Data/Ownership Trace Overrun).................................................. 24-59 24-55 Target Ready Message.......................................................................................................... 24-59 24-56 Read Register Message ......................................................................................................... 24-59 24-57 Write Register Message ........................................................................................................ 24-60 24-58 Read/Write Response Message............................................................................................. 24-60 24-59 Read/Write Access Flow Diagram ....................................................................................... 24-61 24-60 Error Message (Read/Write Access Error) Format............................................................... 24-67 24-61 Error Message (Invalid Message) Format ............................................................................ 24-67 24-62 Error Message (Invalid Access Opcode) Format.................................................................. 24-67 24-63 Block Write Access .............................................................................................................. 24-69 24-64 Block Read Access ............................................................................................................... 24-70 24-65 Device Ready for Upload/Download Request Message....................................................... 24-70 24-66 Upload Request Message...................................................................................................... 24-71 24-67 Download Request Message ................................................................................................. 24-71 24-68 Upload/Download Information Message.............................................................................. 24-72 24-69 Error Message (Invalid Access Opcode) .............................................................................. 24-72 24-70 Watchpoint Message Format ................................................................................................ 24-73 24-71 Error Message (Watchpoint Overrun) Format...................................................................... 24-73 24-72 Watchpoint Message............................................................................................................. 24-74 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lv Figures Figure Page Title Number Number 24-73 Error Message (Watchpoint Overrun) .................................................................................. 24-74 24-74 Ownership Trace Message Format ....................................................................................... 24-75 24-75 Error Message Format .......................................................................................................... 24-75 24-76 Ownership Trace Message.................................................................................................... 24-76 24-77 Error Message (Program/Data/Ownership Trace Overrun).................................................. 24-76 24-78 RCPU Development Access Multiplexing between READI and BDM Signals .................. 24-77 24-79 DSDI Message Format.......................................................................................................... 24-78 24-80 DSDO Message Format ........................................................................................................ 24-78 24-81 BDM Status Message Format ............................................................................................... 24-79 24-82 Error Message (Invalid Message) Format ............................................................................ 24-79 24-83 RCPU Development Access Flow Diagram ......................................................................... 24-81 24-84 RCPU Development Access Timing Diagram -- Debug Mode Entry Out-of-Reset........... 24-83 24-85 Transmission Sequence of DSDx Data Messages ................................................................ 24-83 24-86 Error Message (Invalid Message) ......................................................................................... 24-85 24-87 DSDI Data Message (Assert Non-Maskable Breakpoint) .................................................... 24-85 24-88 DSDI Data Message (CPU Instruction -- rfi) ...................................................................... 24-85 24-89 DSDO Data Message (CPU Data Out) ................................................................................. 24-86 25-1 Pin Requirement on JTAG...................................................................................................... 25-1 25-2 Test Logic Block Diagram...................................................................................................... 25-3 25-3 JTAG Mode Selection ............................................................................................................ 25-3 25-4 TAP Controller State Machine ............................................................................................... 25-4 25-5 Bypass Register..................................................................................................................... 25-31 A-1 Instruction Compression Alternatives ..................................................................................... A-3 A-2 Addressing Instructions with Compressed Address ................................................................ A-4 A-3 Compressed Target Address Generation by Direct Branches.................................................. A-5 A-4 Branch Right Segment Compression #1 .................................................................................. A-7 A-5 Branch Right Segment Compression #2 .................................................................................. A-8 A-6 Global Bypass Instruction Layout ........................................................................................... A-8 A-7 CLASS_1 Instruction Layout .................................................................................................. A-9 A-8 CLASS_2 Instruction Layout .................................................................................................. A-9 A-9 CLASS_3 Instruction Layout ................................................................................................ A-10 A-10 CLASS_4 Instruction Layout ................................................................................................ A-11 A-11 Code Compression Process.................................................................................................... A-12 A-12 Code Decompression Process ................................................................................................ A-13 A-13 I-Bus Support Control Register (ICTRL) .............................................................................. A-16 A-14 Decompressor Class Configuration Registers1 (DCCRx) ..................................................... A-19 C-1 MPC561/MPC563 Power Distribution Diagram -- 2.6 V .......................................................C-3 C-2 Power Distribution Diagram -- 5 V and Analog .....................................................................C-3 C-3 Crystal Oscillator Circuit ..........................................................................................................C-4 C-4 RC Filter Example ....................................................................................................................C-5 MPC561/MPC563 Reference Manual, Rev. 1.2 lvi Freescale Semiconductor Figures Figure Page Title Number Number C-5 Bypass Capacitors Example (Alternative) ................................................................................C-5 C-6 RC Filter Example ....................................................................................................................C-6 C-7 LC Filter Example (Alternative)...............................................................................................C-6 C-8 PLL Off-Chip Capacitor Example ............................................................................................C-7 C-9 IRAMSTBY Regulator Circuit .................................................................................................C-8 D-1 TPU3 Memory Map................................................................................................................. D-1 D-2 PTA Parameters ....................................................................................................................... D-4 D-3 QOM Parameters ..................................................................................................................... D-6 D-4 TSM Parameters -- Master Mode ........................................................................................... D-8 D-5 TSM Parameters -- Slave Mode ............................................................................................. D-9 D-6 FQM Parameters .................................................................................................................... D-11 D-7 UART Transmitter Parameters .............................................................................................. D-13 D-8 UART Receiver Parameters................................................................................................... D-14 D-9 NITC Parameters ................................................................................................................... D-16 D-10 COMM Parameters ................................................................................................................ D-18 D-10 COMM Parameters (continued)............................................................................................. D-20 D-11 HALLD Parameters ............................................................................................................... D-21 D-12 MCPWM Parameters -- Master Mode ................................................................................. D-23 D-13 MCPWM Parameters -- Slave Edge-Aligned Mode ............................................................ D-24 D-14 MCPWM Parameters -- Slave Ch A Non-Inverted Center-Aligned Mode.......................... D-26 D-15 MCPWM Parameters -- Slave Ch B Non-Inverted Center-Aligned Mode .......................... D-27 D-16 MCPWM Parameters -- Slave Ch A Inverted Center-Aligned Mode .................................. D-28 D-17 MCPWM Parameters -- Slave Ch B Inverted Center-Aligned Mode .................................. D-29 D-18 MULTI Parameters -- FRINC .............................................................................................. D-31 D-19 MULTI Parameters -- FREDEC........................................................................................... D-32 D-20 MULTI Parameters -- SPEED.............................................................................................. D-33 D-21 MULTI Parameters -- PWM_IN .......................................................................................... D-34 D-22 FQD Parameters -- Primary Channel ................................................................................... D-36 D-23 FQD Parameters -- Secondary Channel ............................................................................... D-37 D-24 PPWA Parameters.................................................................................................................. D-39 D-25 ID Parameters ........................................................................................................................ D-41 D-26 OC Parameters ....................................................................................................................... D-43 D-27 PWM Parameters ................................................................................................................... D-45 D-28 DIO Parameters...................................................................................................................... D-47 D-29 SPWM Parameters ................................................................................................................. D-49 D-30 RWTPIN Parameters ............................................................................................................. D-52 D-31 Two Possible SIOP Configurations ....................................................................................... D-53 D-32 SIOP Parameters .................................................................................................................... D-55 D-33 SIOP Function Data Transition Example .............................................................................. D-59 F-1 Option A Power-Up Sequence Without Keep-Alive Supply.................................................. F-14 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lvii Figures Figure Page Title Number Number F-2 Option A Power-Up Sequence With Keep-Alive Supply....................................................... F-14 F-3 Option A Power-Down Sequence Without Keep-Alive Supply............................................. F-15 F-4 Option A Power-Down Sequence With Keep-Alive Supply.................................................. F-15 F-5 Option B Power-Up Sequence Without Keep-Alive Supply.................................................. F-16 F-6 Option B Power-Up Sequence With Keep-Alive Supply ....................................................... F-16 F-7 Option B Power-Down Sequence Without Keep-Alive Supply ............................................. F-17 F-8 Option B Power-Down Sequence with Keep-Alive Supply ................................................... F-17 F-9 Generic Timing Examples ...................................................................................................... F-19 F-10 CLKOUT Pin Timing ............................................................................................................. F-27 F-11 Synchronous Output Signals Timing ...................................................................................... F-28 F-12 Predischarge Timing ............................................................................................................... F-29 F-13 Synchronous Active Pull-Up And Open Drain Outputs Signals Timing .......................................................................................................... F-30 F-14 Synchronous Input Signals Timing......................................................................................... F-31 F-15 Input Data Timing In Normal Case ........................................................................................ F-32 F-16 External Bus Read Timing (GPCM Controlled - ACS = `00').............................................. F-33 F-17 External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `10').......................... F-34 F-18 External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `11').......................... F-35 F-19 External Bus Read Timing (GPCM Controlled - TRLX = `1', ACS = `10', ACS = `11').... F-36 F-20 Address Show Cycle Bus Timing ........................................................................................... F-36 F-21 Address and Data Show Cycle Bus Timing............................................................................ F-37 F-22 External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `0') ....................... F-38 F-23 External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `1') ....................... F-39 F-24 External Bus Write Timing (GPCM Controlled - TRLX = `1', CSNT = `1') ....................... F-40 F-25 External Master Read From Internal Registers Timing.......................................................... F-41 F-26 External Master Write To Internal Registers Timing ............................................................. F-42 F-27 Interrupt Detection Timing for External Edge Sensitive Lines .............................................. F-43 F-28 Debug Port Clock Input Timing ............................................................................................. F-44 F-29 Debug Port Timings................................................................................................................ F-44 F-30 Auxiliary Port Data Input Timing Diagram............................................................................ F-45 F-31 Auxiliary Port Data Output Timing Diagram ......................................................................... F-46 F-32 Enable Auxiliary From RSTI.................................................................................................. F-46 F-33 Disable Auxiliary From RSTI................................................................................................. F-46 F-34 Reset Timing - Configuration from Data Bus........................................................................ F-48 F-35 Reset Timing - Data Bus Weak Drive During Configuration................................................ F-49 F-36 Reset Timing - Debug Port Configuration ............................................................................. F-50 F-37 JTAG Test Clock Input Timing .............................................................................................. F-51 F-38 JTAG Test Access Port Timing Diagram ............................................................................... F-52 F-39 Boundary Scan (JTAG) Timing Diagram............................................................................... F-53 F-40 QSPI Timing - Master, CPHA = 0 ......................................................................................... F-58 MPC561/MPC563 Reference Manual, Rev. 1.2 lviii Freescale Semiconductor Figures Figure Page Title Number Number F-41 QSPI Timing - Master, CPHA = 1 ......................................................................................... F-58 F-42 QSPI Timing - Slave, CPHA = 0 ........................................................................................... F-59 F-43 QSPI Timing - Slave, CPHA = 1 ........................................................................................... F-59 F-44 TPU3 Timing .......................................................................................................................... F-61 F-45 PPM_TCLK Timing ............................................................................................................... F-63 F-46 PPM Data Transfer Timing (SPI Mode)................................................................................. F-63 F-47 MCPSM Enable to VS_PCLK Pulse Timing Diagram .......................................................... F-64 F-48 MPWMSM Minimum Output Pulse Example Timing Diagram............................................ F-65 F-49 MCPSM Enable to MPWMO Output Pin Rising Edge Timing Diagram .............................. F-66 F-50 MPWMSM Enable to MPWMO Output Pin Rising Edge Timing Diagram ......................... F-66 F-51 MPWMSM Interrupt Flag to MPWMO Output Pin Falling Edge Timing Diagram.............. F-66 F-52 MMCSM Minimum Input Pin (Either Load Or Clock) Timing Diagram .............................. F-67 F-53 MMCSM Clock Pin To Counter Bus Increment Timing Diagram ........................................ F-68 F-54 MMCSM Load Pin To Counter Bus Reload Timing Diagram............................................... F-68 F-55 MMCSM Counter Bus Reload To Interrupt Flag Setting Timing Diagram........................... F-68 F-56 MMCSM Prescaler Clock Select To Counter Bus Increment Timing Diagram .................... F-69 F-57 MDASM Minimum Input Pin Timing Diagram..................................................................... F-70 F-58 MDASM Input Pin To Counter Bus Capture Timing Diagram.............................................. F-70 F-59 MDASM Input Pin to MDASM Interrupt Flag Timing Diagram .......................................... F-70 F-60 MDASM Minimum Output Pulse Width Timing Diagram.................................................... F-71 F-61 Counter Bus to MDASM Output Pin Change Timing Diagram............................................. F-71 F-62 Counter Bus to MDASM Interrupt Flag Setting Timing Diagram ......................................... F-71 F-63 MPIOSM Input Pin to MPIOSM_DR (Data Register) Timing Diagram ............................... F-72 F-64 MPC561/MPC563 Package Footprint (1 of 2) ....................................................................... F-84 F-65 MPC561/MPC563 Package Footprint (2 of 2) ....................................................................... F-85 F-66 MPC561/MPC563 Ball Map .................................................................................................. F-86 F-67 MPC561/MPC563 Ball Map (Black and White, page 1) ....................................................... F-87 F-68 MPC561/MPC563 Ball Map (Black and White, page 2) ....................................................... F-88 F-69 MPC561/MPC563 Ball Map (Black and White, page 3) ....................................................... F-89 F-70 MPC561/MPC563 Ball Map (Black and White, page 4) ....................................................... F-90 G-1 Option A Power-Up Sequence Without Keep-Alive Supply................................................. G-13 G-2 Option A Power-Up Sequence With Keep-Alive Supply...................................................... G-14 G-3 Option A Power-Down Sequence Without Keep-Alive Supply............................................ G-14 G-4 Option A Power-Down Sequence With Keep-Alive Supply................................................. G-15 G-5 Option B Power-Up Sequence Without Keep-Alive Supply................................................. G-16 G-6 Option B Power-Up Sequence With Keep-Alive Supply ...................................................... G-16 G-7 Option B Power-Down Sequence Without Keep-Alive Supply ............................................ G-17 G-8 Option B Power-Down Sequence with Keep-Alive Supply .................................................. G-17 G-9 Generic Timing Examples ..................................................................................................... G-19 G-10 CLKOUT Pin Timing ............................................................................................................ G-25 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lix Figures Figure Page Title Number Number G-11 Synchronous Output Signals Timing ..................................................................................... G-26 G-12 Synchronous Active Pull-Up And Open Drain Outputs Signals Timing .............................. G-27 G-13 Synchronous Input Signals Timing........................................................................................ G-28 G-14 Input Data Timing In Normal Case ....................................................................................... G-29 G-15 External Bus Read Timing (GPCM Controlled - ACS = `00')............................................. G-30 G-16 External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `10')......................... G-31 G-17 External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `11')......................... G-32 G-18 External Bus Read Timing (GPCM Controlled - TRLX = `1', ACS = `10', ACS = `11')... G-33 G-19 Address Show Cycle Bus Timing .......................................................................................... G-34 G-20 Address and Data Show Cycle Bus Timing........................................................................... G-35 G-21 External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `0') ...................... G-36 G-22 External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `1') ...................... G-37 G-23 External Bus Write Timing (GPCM Controlled - TRLX = `1', CSNT = `1') ...................... G-38 G-24 External Master Read From Internal Registers Timing......................................................... G-39 G-25 External Master Write To Internal Registers Timing ............................................................ G-40 G-26 Interrupt Detection Timing for External Edge Sensitive Lines ............................................. G-41 G-27 Debug Port Clock Input Timing ............................................................................................ G-42 G-28 Debug Port Timings............................................................................................................... G-42 G-29 Auxiliary Port Data Input Timing Diagram........................................................................... G-43 G-30 Auxiliary Port Data Output Timing Diagram ........................................................................ G-43 G-31 Enable Auxiliary From RSTI................................................................................................. G-44 G-32 Disable Auxiliary From RSTI................................................................................................ G-44 G-33 Reset Timing - Configuration from Data Bus....................................................................... G-45 G-34 Reset Timing - Data Bus Weak Drive During Configuration............................................... G-46 G-35 Reset Timing - Debug Port Configuration ............................................................................ G-47 G-36 JTAG Test Clock Input Timing ............................................................................................. G-48 G-37 JTAG Test Access Port Timing Diagram .............................................................................. G-48 G-38 Boundary Scan (JTAG) Timing Diagram.............................................................................. G-49 G-39 QSPI Timing - Master, CPHA = 0 ........................................................................................ G-54 G-40 QSPI Timing - Master, CPHA = 1 ........................................................................................ G-54 G-41 QSPI Timing - Slave, CPHA = 0 .......................................................................................... G-55 G-42 QSPI Timing - Slave, CPHA = 1 .......................................................................................... G-55 G-43 TPU3 Timing ......................................................................................................................... G-57 G-44 PPM_TCLK Timing .............................................................................................................. G-59 G-45 PPM Data Transfer Timing (SPI Mode)................................................................................ G-59 G-46 MCPSM Enable to VS_PCLK Pulse Timing Diagram ......................................................... G-60 G-47 MPWMSM Minimum Output Pulse Example Timing Diagram........................................... G-61 G-48 MCPSM Enable to MPWMO Output Pin Rising Edge Timing Diagram ............................. G-61 G-49 MPWMSM Enable To MPWMO Output Pin Rising Edge Timing Diagram ....................... G-62 G-50 MPWMSM Interrupt Flag to MPWMO Output Pin Falling Edge Timing Diagram............. G-62 MPC561/MPC563 Reference Manual, Rev. 1.2 lx Freescale Semiconductor Figures Figure Page Title Number Number G-51 MMCSM Minimum Input Pin (Either Load or Clock) Timing Diagram.............................. G-63 G-52 MMCSM Clock Pin to Counter Bus Increment Timing Diagram......................................... G-63 G-53 MMCSM Load Pin to Counter Bus Reload Timing Diagram ............................................... G-64 G-54 MMCSM Counter Bus Reload to Interrupt Flag Setting Timing Diagram ........................... G-64 G-55 MMCSM Prescaler Clock Select to Counter Bus Increment Timing Diagram..................... G-64 G-56 MDASM Minimum Input Pin Timing Diagram.................................................................... G-65 G-57 MDASM Input Pin To Counter Bus Capture Timing Diagram............................................. G-66 G-58 MDASM Input Pin to MDASM Interrupt Flag Timing Diagram ......................................... G-66 G-59 MDASM Minimum Output Pulse Width Timing Diagram................................................... G-66 G-60 Counter Bus to MDASM Output Pin Change Timing Diagram............................................ G-66 G-61 Counter Bus to MDASM Interrupt Flag Setting Timing Diagram ........................................ G-67 G-62 MPIOSM Input Pin to MPIOSM_DR (Data Register) Timing Diagram .............................. G-67 G-63 MPC561/MPC563 Package Footprint (1 of 2) ...................................................................... G-79 G-64 MPC561/MPC563 Package Footprint (2 of 2) ...................................................................... G-80 G-65 MPC561/MPC563 Ball Map ................................................................................................. G-81 G-66 MPC561/MPC563 Ball Map (Black and White, page 1) ...................................................... G-82 G-67 MPC561/MPC563 Ball Map (Black and White, page 2) ...................................................... G-83 G-68 MPC561/MPC563 Ball Map (Black and White, page 3) ...................................................... G-84 G-69 MPC561/MPC563 Ball Map (Black and White, page 4) ...................................................... G-85 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxi Figures Figure Number Title Page Number MPC561/MPC563 Reference Manual, Rev. 1.2 lxii Freescale Semiconductor Tables Table Number i ii 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 3-1 3-2 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 3-11 3-12 3-13 3-14 3-15 3-16 3-17 3-18 3-19 3-20 3-21 Title Page Number Notational Conventions ..................................................................................................... 1-lxxxii Acronyms and Abbreviated Terms .................................................................................... 1-lxxxii MPC56x Family Features ......................................................................................................... 1-1 Differences Between MPC555 and MPC561/MPC563............................................................ 1-9 MPC561/MPC563 Signal Descriptions .................................................................................... 2-3 MPC561/MPC563 Signal Sharing.......................................................................................... 2-20 Reduced and Full Port Mode Pads.......................................................................................... 2-21 Full Port Only Mode Pads ...................................................................................................... 2-21 PDMCR Field Descriptions .................................................................................................... 2-22 PDMCR2 Field Description.................................................................................................... 2-24 TCNC Pad Functionalities ...................................................................................................... 2-25 PPMPAD Pad Functionalities................................................................................................. 2-25 Enhanced PCS Functionality ................................................................................................. 2-25 Enhanced PCS 4 & 5 Pad Function ........................................................................................ 2-26 Enhanced PCS 6 & 7 Pad Function ........................................................................................ 2-28 MPC561/MPC563 Development Support Shared Signals ..................................................... 2-28 MPC561/MPC563 Mode Selection Options.......................................................................... 2-29 MPC561/MPC563 Signal Reset State .................................................................................... 2-34 RCPU Execution Units ............................................................................................................. 3-4 Supervisor-Level SPRs ............................................................................................................. 3-9 Development Support SPRs.................................................................................................... 3-11 FPSCR Bit Categories ............................................................................................................ 3-13 FPSCR Bit Descriptions ......................................................................................................... 3-14 Floating-Point Result Flags in FPSCR ................................................................................... 3-16 Bit Settings for CR0 Field of CR............................................................................................ 3-17 Bit Settings for CR1 Field of CR............................................................................................ 3-17 CRn Field Bit Settings for Compare Instructions ................................................................... 3-18 Integer Exception Register Bit Descriptions .......................................................................... 3-18 Machine State Register Bit Descriptions ................................................................................ 3-20 Floating-Point Exception Mode Bits ...................................................................................... 3-22 Uses of SPRG0-SPRG3 ......................................................................................................... 3-24 Processor Version Register Bit Descriptions.......................................................................... 3-25 EIE, EID, AND NRI Registers ............................................................................................... 3-25 FPECR Bit Descriptions ......................................................................................................... 3-26 Instruction Set Summary ........................................................................................................ 3-28 RCPU Exception Classes........................................................................................................ 3-35 Exception Vector Offset Table .............................................................................................. 3-36 Instruction Latency and Blockage .......................................................................................... 3-39 Floating-Point Exception Mode Encoding ............................................................................. 3-44 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxiii Tables Table Number 3-22 3-23 3-24 3-25 3-26 3-27 3-28 3-29 3-30 3-31 3-32 3-33 3-34 3-35 3-36 3-37 3-38 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 5-1 5-2 5-3 6-1 6-2 6-3 6-4 6-5 6-6 6-7 6-8 6-9 6-10 Title Page Number Settings Caused by Reset ....................................................................................................... 3-45 Register Settings following an NMI ....................................................................................... 3-45 Machine Check Exception Processor Actions ........................................................................ 3-47 Register Settings following a Machine Check Exception ...................................................... 3-47 Register Settings following External Interrupt ...................................................................... 3-49 Register Settings for Alignment Exception ........................................................................... 3-50 Register Settings following Program Exception.................................................................... 3-52 Register Settings following a Floating-Point Unavailable Exception ................................... 3-52 Register Settings Following a Decrementer Exception ......................................................... 3-53 Register Settings following a System Call Exception ........................................................... 3-54 Register Settings following a Trace Exception....................................................................... 3-55 Register Settings following Floating-Point Assist Exceptions ............................................... 3-55 Register Settings following a Software Emulation Exception................................................ 3-56 Register Settings following an Instruction Protection Exception ........................................... 3-57 Register Settings Following a Data Protection Error Exception ............................................ 3-59 Register Settings Following a Debug Exception .................................................................... 3-60 Register Settings for Data Breakpoint Match ......................................................................... 3-60 Exception Addresses Mapping ................................................................................................. 4-9 Exception Relocation Page Offset .......................................................................................... 4-10 BBC SPRs............................................................................................................................... 4-17 BBCMCR Field Descriptions ................................................................................................ 4-19 MI_RBA[0:3] Registers Bit Descriptions.............................................................................. 4-21 MI_RA[0:3] Registers Bit Descriptions ................................................................................ 4-22 Region Size Programming Possible Values............................................................................ 4-23 MI_GRA Field Descriptions.................................................................................................. 4-24 EIBADR External Interrupt Relocation Table Base Address Register Bit Descriptions ...... 4-25 USIU Address Map................................................................................................................... 5-3 USIU Special-Purpose Registers .............................................................................................. 5-7 Hex Address Format for SPR Cycles ....................................................................................... 5-7 USIU Pin Multiplexing Control................................................................................................ 6-4 SGPIO Configuration ............................................................................................................... 6-7 Priority of Interrupt Sources--Regular Operation.................................................................. 6-10 Priority of Interrupt Sources--Enhanced Operation .............................................................. 6-12 Interrupt Latency Estimation for Three Typical Cases........................................................... 6-16 Decrementer Time-Out Periods .............................................................................................. 6-18 SIUMCR Bit Descriptions ..................................................................................................... 6-25 Debug Pins Configuration ...................................................................................................... 6-27 General Pins Configuration .................................................................................................... 6-27 Single-Chip Select Field Pin Configuration ........................................................................... 6-27 MPC561/MPC563 Reference Manual, Rev. 1.2 lxiv Freescale Semiconductor Tables Table Number 6-11 6-12 6-13 6-14 6-15 6-16 6-17 6-18 6-19 6-20 6-21 6-22 6-23 6-24 6-25 6-26 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 8-11 8-12 8-13 9-1 9-2 9-3 9-4 9-5 Title Page Number Multi-Level Reservation Control Pin Configuration .............................................................. 6-28 IMMR Bit Descriptions ......................................................................................................... 6-29 EMCR Bit Descriptions ......................................................................................................... 6-30 SIU Interrupt Controller - Bit Acronym Definitions.............................................................. 6-31 SYPCR Bit Descriptions........................................................................................................ 6-38 SWSR Bit Descriptions ......................................................................................................... 6-39 TESR Bit Descriptions........................................................................................................... 6-39 TBSCR Bit Descriptions........................................................................................................ 6-42 RTCSC Bit Descriptions........................................................................................................ 6-43 PISCR Bit Descriptions ......................................................................................................... 6-44 PITC Bit Descriptions............................................................................................................ 6-45 PIT Bit Descriptions .............................................................................................................. 6-45 SGPIODT1 Bit Descriptions ................................................................................................. 6-46 SGPIODT2 Bit Descriptions ................................................................................................. 6-47 SGPIOCR Bit Descriptions ................................................................................................... 6-48 Data Direction Control............................................................................................................ 6-48 Reset Action Taken for Each Reset Cause ............................................................................... 7-4 Reset Configuration Word and Data Corruption/Coherency.................................................... 7-4 Reset Status Register Bit Descriptions ..................................................................................... 7-5 Reset Configuration Options .................................................................................................... 7-7 RCW Bit Descriptions ............................................................................................................ 7-11 Reset Clocks Source Configuration .......................................................................................... 8-9 TMBCLK Divisions ............................................................................................................... 8-10 Status of Clock Source............................................................................................................ 8-16 Power Mode Control Bit Settings .......................................................................................... 8-17 Power Mode Descriptions...................................................................................................... 8-17 Power Mode Wake-Up Operation ......................................................................................... 8-18 Power Supplies ....................................................................................................................... 8-21 KAPWR Registers and Key Registers.................................................................................... 8-26 SCCR Bit Descriptions ........................................................................................................... 8-30 COM and CQDS Bits Functionality ....................................................................................... 8-33 PLPRCR Bit Descriptions ..................................................................................................... 8-34 COLIR Bit Descriptions ........................................................................................................ 8-36 VSRMCR Bit Descriptions.................................................................................................... 8-37 MPC561/MPC563 BIU Signals................................................................................................ 9-4 Data Bus Requirements For Read Cycles............................................................................... 9-31 Data Bus Contents for Write Cycles....................................................................................... 9-32 Priority Between Internal and External Masters over External Bus ....................................... 9-36 4 Word Burst Length and Order ............................................................................................. 9-38 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxv Tables Table Number 9-6 9-7 9-8 9-9 10-1 10-2 10-3 10-4 10-5 10-6 10-7 10-8 10-9 10-10 10-11 10-12 11-1 11-2 11-3 11-4 11-5 11-6 11-7 11-8 11-9 11-10 12-1 12-2 12-3 12-4 12-5 12-6 12-7 13-1 13-2 13-3 13-4 13-5 13-6 Title Page Number BURST/TSIZE Encoding ....................................................................................................... 9-38 Address Type Pins .................................................................................................................. 9-39 Address Types Definition ....................................................................................................... 9-39 Termination Signals Protocol ................................................................................................. 9-49 Timing Requirements for Reduced Setup Time ..................................................................... 10-6 Timing Attributes Summary ................................................................................................. 10-11 Programming Rules for Timing Strobes ............................................................................... 10-22 Write Enable/Byte Enable Signals Function ........................................................................ 10-24 Boot Bank Fields Values After Hard Reset .......................................................................... 10-28 Memory Controller Address Map......................................................................................... 10-31 MSTAT Bit Descriptions..................................................................................................... 10-32 BR0-BR3 Bit Descriptions.................................................................................................. 10-33 BRx[V] Reset Value ............................................................................................................ 10-34 OR0-OR3 Bit Descriptions ................................................................................................. 10-35 DMBR Bit Descriptions........................................................................................................ 10-36 DMOR Bit Descriptions ....................................................................................................... 10-38 DMPU Registers ..................................................................................................................... 11-6 Reservation Snoop Support .................................................................................................... 11-9 L2U_MCR LSHOW Modes ................................................................................................. 11-10 L2U Show Cycle Support Chart ........................................................................................... 11-12 L2U (PPC) Register Decode................................................................................................. 11-12 Hex Address For SPR Cycles ............................................................................................... 11-13 L2U_MCR Bit Descriptions ................................................................................................ 11-14 L2U_RBAx Bit Descriptions............................................................................................... 11-15 L2U_RAx Bit Descriptions ................................................................................................. 11-15 L2U_GRA Bit Descriptions................................................................................................. 11-16 STOP and HSPEED Bit Functionality.................................................................................... 12-2 Bus Cycles and System Clock Cycles .................................................................................... 12-3 ILBS Signal Functionality ...................................................................................................... 12-5 IRQMUX Functionality .......................................................................................................... 12-5 UIMB Interface Register Map ................................................................................................ 12-6 UMCR Bit Descriptions.......................................................................................................... 12-8 UIPEND Bit Descriptions....................................................................................................... 12-9 QADC64E_A Address Map ................................................................................................... 13-3 QADC64E_B Address Map.................................................................................................... 13-4 Multiplexed Analog Input Channels....................................................................................... 13-7 Analog Input Channels ........................................................................................................... 13-7 QADCMCR Bit Descriptions ................................................................................................. 13-8 QADC64E Bus Error Response............................................................................................ 13-11 MPC561/MPC563 Reference Manual, Rev. 1.2 lxvi Freescale Semiconductor Tables Table Number 13-7 13-8 13-9 13-10 13-11 13-12 13-13 13-14 13-15 13-16 13-17 13-18 13-19 13-20 13-21 13-22 13-23 13-24 13-25 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 14-20 Title Page Number QADCINT Bit Descriptions ................................................................................................. 13-12 PORTQA, PORTQB Bit Descriptions.................................................................................. 13-14 QACR0 Bit Descriptions ...................................................................................................... 13-15 QACR1 Bit Descriptions ...................................................................................................... 13-16 Queue 1 Operating Modes .................................................................................................... 13-16 QACR2 Bit Descriptions ...................................................................................................... 13-18 Queue 2 Operating Modes .................................................................................................... 13-19 QASR0 Bit Descriptions....................................................................................................... 13-21 Pause Response..................................................................................................................... 13-25 Queue Status ......................................................................................................................... 13-25 QASR1 Bit Descriptions....................................................................................................... 13-27 CCW Bit Descriptions .......................................................................................................... 13-30 Non-Multiplexed Channel Assignments and Signal Designations....................................... 13-31 Multiplexed Channel Assignments and Signal Designations ............................................... 13-32 QADC64E Clock Programmability ...................................................................................... 13-50 Trigger Events....................................................................................................................... 13-54 Status Bits ............................................................................................................................. 13-55 External Circuit Settling Time to 1/2 LSB (10-Bit Conversions) ....................................... 13-75 Error Resulting from Input Leakage (IOFF)......................................................................... 13-76 QADC64E_A Address Map ................................................................................................... 14-3 QADC64E_B Address Map.................................................................................................... 14-4 Multiplexed Analog Input Channels....................................................................................... 14-6 Analog Input Channels ........................................................................................................... 14-7 QADCMCR Bit Descriptions ................................................................................................. 14-8 QADC64E Bus Error Response............................................................................................ 14-11 QADCINT Bit Descriptions ................................................................................................. 14-12 PORTQA, PORTQB Bit Descriptions.................................................................................. 14-13 QACR0 Bit Descriptions ...................................................................................................... 14-15 Prescaler fSYSCLK Divide-by Values.................................................................................... 14-15 QACR1 Bit Descriptions ...................................................................................................... 14-17 Queue 1 Operating Modes .................................................................................................... 14-17 QACR2 Bit Descriptions ...................................................................................................... 14-19 Queue 2 Operating Modes .................................................................................................... 14-20 QASR0 Bit Descriptions....................................................................................................... 14-22 Pause Response..................................................................................................................... 14-26 Queue Status ......................................................................................................................... 14-26 QASR1 Bit Descriptions....................................................................................................... 14-28 CCW Bit Descriptions .......................................................................................................... 14-31 QADC64E_A Multiplexed Channel Assignments and Signal Designations ....................... 14-32 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxvii Tables Table Number 14-21 14-22 14-23 14-24 14-25 14-26 15-1 15-2 15-3 15-4 15-5 15-6 15-7 15-8 15-9 15-10 15-11 15-12 15-13 15-14 15-15 15-16 15-17 15-18 15-19 15-20 15-21 15-22 15-23 15-24 15-25 15-26 15-27 15-28 15-29 15-30 15-31 15-32 15-33 Title Page Number QADC64E_B Multiplexed Channel Assignments and Signal Designations........................ 14-33 QADC64E Clock Programmability ...................................................................................... 14-50 Trigger Events....................................................................................................................... 14-53 Status Bits ............................................................................................................................. 14-54 External Circuit Settling Time to 1/2 LSB (10-Bit Conversions) ........................................ 14-73 Error Resulting From Input Leakage (IOFF)........................................................................ 14-74 QSMCM Register Map ........................................................................................................... 15-4 QSMCM Global Registers...................................................................................................... 15-6 Interrupt Levels....................................................................................................................... 15-7 QSMCMMCR Bit Descriptions.............................................................................................. 15-9 QDSCI_IL Bit Descriptions.................................................................................................... 15-9 QSPI_IL Bit Descriptions ..................................................................................................... 15-10 QSMCM Pin Control Registers ............................................................................................ 15-10 Effect of DDRQS on QSPI Pin Function.............................................................................. 15-11 QSMCM Pin Functions ........................................................................................................ 15-12 PQSPAR Bit Descriptions .................................................................................................... 15-13 DDRQS Bit Descriptions...................................................................................................... 15-14 QSPI Register Map ............................................................................................................... 15-16 SPCR0 Bit Descriptions....................................................................................................... 15-18 Bits Per Transfer ................................................................................................................... 15-18 SPCR1 Bit Descriptions........................................................................................................ 15-19 SPCR2 Bit Descriptions....................................................................................................... 15-20 SPCR3 Bit Descriptions....................................................................................................... 15-21 SPSR Bit Descriptions ......................................................................................................... 15-22 Command RAM Bit Descriptions........................................................................................ 15-24 QSPI Pin Functions............................................................................................................... 15-25 Example SCK Frequencies with a 40-MHz IMB3 Clock..................................................... 15-35 PCS Enhanced Functionality ................................................................................................ 15-37 SCI Registers ........................................................................................................................ 15-45 SCCxR0 Bit Descriptions ..................................................................................................... 15-46 SCCxR1 Bit Descriptions .................................................................................................... 15-47 SCxSR Bit Descriptions....................................................................................................... 15-49 SCxDR Bit Descriptions ...................................................................................................... 15-51 SCI Pin Functions ................................................................................................................. 15-51 Serial Frame Formats............................................................................................................ 15-52 Examples of SCIx Baud Rates.............................................................................................. 15-53 Effect of Parity Checking on Data Size ................................................................................ 15-53 QSCI1CR Bit Descriptions ................................................................................................... 15-60 QSCI1SR Bit Descriptions ................................................................................................... 15-61 MPC561/MPC563 Reference Manual, Rev. 1.2 lxviii Freescale Semiconductor Tables Table Number 16-1 16-2 16-3 16-4 16-5 16-6 16-7 16-8 16-9 16-10 16-11 16-12 16-13 16-14 16-15 16-16 16-17 16-18 16-19 16-20 16-21 16-22 16-23 16-24 16-25 16-26 16-27 16-28 17-1 17-2 17-3 17-4 17-5 17-6 17-7 17-8 17-9 17-10 17-11 Title Page Number Common Extended/Standard Format Frames ........................................................................ 16-4 Message Buffer Codes for Receive Buffers............................................................................ 16-5 Message Buffer Codes for Transmit Buffers .......................................................................... 16-5 Extended Format Frames ........................................................................................................ 16-6 Standard Format Frames ......................................................................................................... 16-6 Receive Mask Register Bit Values ......................................................................................... 16-8 Mask Examples for Normal/Extended Messages .................................................................. 16-8 Example System Clock, CAN Bit Rate, and S-Clock Frequencies ........................................ 16-9 Interrupt Levels..................................................................................................................... 16-20 TouCAN Register Map ......................................................................................................... 16-21 CANMCR Bit Descriptions .................................................................................................. 16-25 CANICR Bit Descriptions ................................................................................................... 16-27 CANCTRL0 Bit Descriptions............................................................................................... 16-28 Rx MODE[1:0] Configuration.............................................................................................. 16-28 Transmit Signal Configuration ............................................................................................. 16-28 CANCTRL1 Bit Descriptions............................................................................................... 16-29 PRESDIV Bit Descriptions.................................................................................................. 16-30 CANCTRL2 Bit Descriptions.............................................................................................. 16-30 TIMER Bit Descriptions ....................................................................................................... 16-31 RXGMSKHI, RXGMSKLO Bit Descriptions...................................................................... 16-32 RX14MSKHI, RX14MSKLO Field Descriptions ................................................................ 16-32 RX15MSKHI, RX15MSKLO Field Descriptions ................................................................ 16-33 ESTAT Bit Descriptions ...................................................................................................... 16-34 Transmit Bit Error Status ...................................................................................................... 16-35 Fault Confinement State Encoding ....................................................................................... 16-35 IMASK Bit Descriptions ...................................................................................................... 16-36 IFLAG Bit Descriptions....................................................................................................... 16-36 RXECTR, TXECTR Bit Descriptions ................................................................................. 16-36 MIOS14 Configuration Description ....................................................................................... 17-6 MIOS14 I/O Ports ................................................................................................................. 17-13 MIOS14TPCR Bit Descriptions ........................................................................................... 17-14 MIOS14VNR Bit Descriptions ............................................................................................. 17-15 MIOS14MCR Bit Descriptions ............................................................................................ 17-15 MCPSM Register Address Map ........................................................................................... 17-17 MCPSMSCR Bit Descriptions ............................................................................................ 17-18 Clock Prescaler Setting ......................................................................................................... 17-18 MMCSM Address Map ........................................................................................................ 17-22 MMCSMCNT Bit Descriptions............................................................................................ 17-23 MMCSMML Bit Descriptions.............................................................................................. 17-24 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxix Tables Table Number 17-12 17-13 17-14 17-15 17-16 17-17 17-18 17-19 17-20 17-21 17-22 17-23 17-24 17-25 17-26 17-27 17-28 17-29 17-30 17-31 17-32 17-33 17-34 17-35 17-36 17-37 17-38 17-39 17-40 17-41 17-42 17-43 18-1 18-2 18-3 18-4 18-5 18-6 18-7 Title Page Number MMCSMSCR Bit Descriptions ............................................................................................ 17-25 MMCSMCNT Edge Sensitivity............................................................................................ 17-25 MMCSMCNT Clock Signal ................................................................................................. 17-25 Prescaler Values................................................................................................................... 17-26 MDASM Modes of Operation .............................................................................................. 17-29 MDASM PWM Example Output Frequencies/Resolutions at fSYS = 40 MHz.................... 17-38 MDASM Address Map ......................................................................................................... 17-39 MDASMAR Bit Descriptions............................................................................................... 17-42 MDASMBR Bit Descriptions ............................................................................................... 17-43 MDASMSCR Bit Descriptions............................................................................................. 17-44 MDASM Mode Selects......................................................................................................... 17-45 MDASM Counter Bus Selection .......................................................................................... 17-46 PWM Pulse/Frequency Ranges (in Hz) Using /1 or /256 Option (40 MHz) ........................ 17-52 MPWMSM Address Map ..................................................................................................... 17-55 MPWMPERR Bit Descriptions ............................................................................................ 17-57 MPWMPULR Bit Descriptions ............................................................................................ 17-58 MPWMCNTR Bit Descriptions............................................................................................ 17-58 MPWMSCR Bit Descriptions............................................................................................... 17-59 PWMSM Output Signal Polarity Selection .......................................................................... 17-59 Prescaler Values.................................................................................................................... 17-60 MPIOSM I/O Signal Function .............................................................................................. 17-61 MPIOSMDR Bit Descriptions .............................................................................................. 17-63 MPIOSMDDR Bit Descriptions ........................................................................................... 17-63 MIOS14SR0 Bit Description ................................................................................................ 17-66 MIOS14ER0 Bit Descriptions .............................................................................................. 17-66 MIOS14PR0 Bit Descriptions .............................................................................................. 17-67 MIOS14SR1 Bit Descriptions .............................................................................................. 17-67 MIOS14ER1 Bit Descriptions .............................................................................................. 17-68 MIOS14RPR1 Bit Descriptions............................................................................................ 17-68 MBISM Interrupt Registers Address Map............................................................................ 17-69 MIOS14LVL0 Bit Descriptions............................................................................................ 17-70 MIOS14LVL1 Bit Descriptions............................................................................................ 17-70 PPM Memory Map ................................................................................................................. 18-2 PPMMCR Bit Descriptions .................................................................................................. 18-11 PPMPCR Bit Descriptions.................................................................................................... 18-12 SAMP[0:2] Bit Settings ........................................................................................................ 18-13 PPMPCR[CM] and PPMPCR[STR] Bit Operation.............................................................. 18-15 Configuration Register (TX and RX) Channel Settings ....................................................... 18-17 SHORT_REG Bit Descriptions ............................................................................................ 18-20 MPC561/MPC563 Reference Manual, Rev. 1.2 lxx Freescale Semiconductor Tables Table Number 18-8 18-9 18-10 18-11 18-12 18-13 19-1 19-2 19-3 19-4 19-5 19-6 19-7 19-8 19-9 19-10 19-11 19-12 19-13 19-14 19-15 19-16 19-17 19-18 19-19 19-20 19-21 19-22 19-23 19-24 20-1 20-2 20-3 21-1 21-2 21-3 21-4 21-5 21-6 Title Page Number SHORT_REG[SH_TCAN] Bit Settings ............................................................................... 18-20 SHORT_REG[SH_TPU] Bit Settings .................................................................................. 18-21 SHORT_CH_REG Bit Descriptions..................................................................................... 18-23 Examples of the SHORT_CH Bits ....................................................................................... 18-23 SCALE_TCLK Frequencies ................................................................................................. 18-24 SCALE_TCLK_REG Bit Descriptions ................................................................................ 18-24 TPU Memory Map.................................................................................................................. 19-1 Enhanced TCR1 Prescaler Divide Values .............................................................................. 19-6 TCR1 Prescaler Values ........................................................................................................... 19-6 TCR2 Counter Clock Source .................................................................................................. 19-7 TCR2 Prescaler Control.......................................................................................................... 19-8 TPU3 Register Map ................................................................................................................ 19-8 TPUMCR Bit Description .................................................................................................... 19-11 DSCR Bit Descriptions ......................................................................................................... 19-12 DSSR Bit Descriptions ......................................................................................................... 19-14 TICR Bit Description............................................................................................................ 19-15 CIER Bit Descriptions .......................................................................................................... 19-15 CFSRn Bit Descriptions........................................................................................................ 19-16 HSQRn Bit Descriptions....................................................................................................... 19-17 HSSRn Bit Descriptions ....................................................................................................... 19-18 CPRn Bit Description ........................................................................................................... 19-18 Channel Priorities ................................................................................................................. 19-18 CISR Bit Descriptions .......................................................................................................... 19-19 TPUMCR2 Bit Descriptions ................................................................................................. 19-19 Entry Table Bank Location................................................................................................... 19-20 System Clock Frequency/Minimum Guaranteed Detected Pulse......................................... 19-20 TPUMCR3 Bit Descriptions ................................................................................................. 19-21 SIUTST Bit Descriptions...................................................................................................... 19-22 Registers Used for Factory Test Only .................................................................................. 19-22 Parameter RAM Address Offset Map .................................................................................. 19-23 DPTRAM Register Map ......................................................................................................... 20-3 DPTMCR Bit Settings ............................................................................................................ 20-4 RAMBAR Bit Settings ........................................................................................................... 20-5 UC3F External Interface Signals ............................................................................................ 21-4 UC3F Register Programming Model ...................................................................................... 21-5 UC3FMCR Bit Descriptions................................................................................................... 21-6 UC3FMCRE Bit Descriptions ................................................................................................ 21-9 UC3FCTL Bit Descriptions .................................................................................................. 21-11 RCW Bit Descriptions .......................................................................................................... 21-17 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxi Tables Table Number 21-7 21-8 21-9 21-10 22-1 22-2 22-3 22-4 22-5 22-6 22-7 23-1 23-2 23-3 23-4 23-5 23-6 23-7 23-8 23-9 23-10 23-11 23-12 23-13 23-14 23-15 23-16 23-17 23-18 23-19 23-20 23-21 23-22 23-23 23-24 23-25 23-26 23-27 23-28 Title Page Number Program Interlock State Descriptions ................................................................................... 21-23 Erase Interlock State Descriptions ........................................................................................ 21-27 Censorship States .................................................................................................................. 21-30 Censorship Modes and Censorship Status ............................................................................ 21-31 Priorities of Overlay Regions ............................................................................................... 22-12 CALRAM Control Registers ................................................................................................ 22-13 CRAMMCR Bit Descriptions............................................................................................... 22-14 CRAMMCR Privilege Bit Assignment for 8-Kbyte Array Blocks ...................................... 22-15 CRAM_RBAx Bit Descriptions ........................................................................................... 22-16 RGN_SIZE Encoding ........................................................................................................... 22-16 CRAMOVLCR Bit Descriptions .......................................................................................... 22-17 VF Pins Instruction Encodings ............................................................................................... 23-3 VF Pins Queue Flush Encodings ............................................................................................ 23-3 VFLS Pin Encodings .............................................................................................................. 23-4 Detecting the Trace Buffer Start Point ................................................................................... 23-6 Fetch Show Cycles Control .................................................................................................... 23-7 Instruction Watchpoints Programming Options ................................................................... 23-15 Load/Store Data Events ........................................................................................................ 23-16 Load/Store Watchpoints Programming Options................................................................... 23-17 Check Stop State and Debug Mode ...................................................................................... 23-27 Trap Enable Data Shifted into Development Port Shift Register ......................................... 23-34 Debug Port Command Shifted Into Development Port Shift Register ................................. 23-34 Status / Data Shifted Out of Development Port Shift Register............................................. 23-35 Debug Instructions / Data Shifted into Development Port Shift Register ............................ 23-36 Development Support Programming Model......................................................................... 23-39 Development Support Registers Read Access Protection .................................................... 23-40 Development Support Registers Write Access Protection ................................................... 23-41 CMPA-CMPD Bit Descriptions ........................................................................................... 23-41 ECR Bit Descriptions............................................................................................................ 23-42 DER Bit Descriptions ........................................................................................................... 23-43 Breakpoint Counter A Value and Control Register (COUNTA).......................................... 23-45 Breakpoint Counter B Value and Control Register (COUNTB) ......................................... 23-46 CMPE-CMPF Bit Descriptions............................................................................................ 23-46 CMPG-CMPH Bit Descriptions ........................................................................................... 23-47 LCTRL1 Bit Descriptions..................................................................................................... 23-47 LCTRL2 Bit Descriptions..................................................................................................... 23-49 ICTRL Bit Descriptions........................................................................................................ 23-51 ISCT_SER Bit Descriptions ................................................................................................. 23-52 BAR Bit Descriptions ........................................................................................................... 23-53 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxii Tables Table Number 24-1 24-2 24-3 24-4 24-5 24-6 24-7 24-8 24-9 24-10 24-11 24-12 24-13 24-14 24-15 24-16 24-17 24-18 24-19 24-20 24-21 24-22 24-23 24-24 24-25 24-26 24-27 24-28 24-29 24-30 24-31 24-32 24-33 24-34 24-35 25-1 25-2 25-3 A-1 Title Page Number Public Messages...................................................................................................................... 24-5 Vendor-Defined Messages...................................................................................................... 24-5 Terms and Definitions ............................................................................................................ 24-6 OTR Bit Descriptions ............................................................................................................. 24-9 Tool-Mapped Register Space.................................................................................................. 24-9 DID Bit Descriptions ............................................................................................................ 24-10 DC Bit Descriptions.............................................................................................................. 24-11 RCPU Development Access Modes ..................................................................................... 24-11 MC Bit Descriptions ............................................................................................................. 24-12 UBA Bit Descriptions ........................................................................................................... 24-13 RWA Read/Write Access Bit Descriptions .......................................................................... 24-14 UDI Bit Descriptions ............................................................................................................ 24-16 Read Access Status ............................................................................................................... 24-16 Write Access Status .............................................................................................................. 24-16 DTA 1 AND 2 Bit Descriptions ........................................................................................... 24-17 Data Trace Values................................................................................................................. 24-18 Description of READI Signals ............................................................................................. 24-21 MSEI/MSEO Protocol .......................................................................................................... 24-23 Public Messages Supported .................................................................................................. 24-24 Error Message Codes ............................................................................................................ 24-27 Vendor-Defined Messages Supported .................................................................................. 24-27 Message Field Sizes, ............................................................................................................. 24-29 Indirect Branch Message ...................................................................................................... 24-33 Direct Branch Message ......................................................................................................... 24-33 READI Reset Configuration Options ................................................................................... 24-34 Bit Pointer Format ................................................................................................................ 24-39 Program Trace Correction Due to a Mispredicted Branch ................................................... 24-40 Program Trace Correction Due to an Exception................................................................... 24-41 Resource Codes..................................................................................................................... 24-46 Special L-Bus Case Handling ............................................................................................... 24-56 Throughput Comparison for FPM and RPM MDO/MDI Configurations ............................ 24-68 Watchpoint Source................................................................................................................ 24-73 Development Port Access: DSDI Field ................................................................................ 24-84 Development Port Access: DSDO Field............................................................................... 24-84 Power Management Mechanism Overview .......................................................................... 24-86 MPC561 Boundary Scan Bit Definition ................................................................................. 25-5 MPC563 Boundary Scan Bit Definition ............................................................................... 25-17 Instruction Decoding............................................................................................................. 25-30 ICTRL Bit Descriptions......................................................................................................... A-17 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxiii Tables Table Number A-2 A-3 A-4 B-1 B-2 B-3 B-4 B-5 B-6 B-7 B-8 B-9 B-10 B-11 B-12 B-13 B-14 B-15 B-16 B-17 B-18 C-1 C-2 D-1 D-2 D-3 D-4 E-1 E-2 F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8 F-9 F-10 Title Page Number ISCT_SER Bit Descriptions .................................................................................................. A-18 DCCR0-DCCR15 Field Descriptions .................................................................................... A-20 Instruction Layout Encoding ................................................................................................. A-21 SPR (Special Purpose Registers) ..............................................................................................B-2 UC3F Flash Array.....................................................................................................................B-4 DECRAM SRAM Array...........................................................................................................B-4 BBC (Burst Buffer Controller Module)....................................................................................B-4 USIU (Unified System Interface Unit) .....................................................................................B-5 CDR3 Flash Control Registers EEPROM (UC3F)...................................................................B-9 DPTRAM Control Registers...................................................................................................B-10 DPTRAM Memory Arrays .....................................................................................................B-10 Time Processor Unit 3 A and B (TPU3 A and B) ..................................................................B-10 QADC64E A and B (Queued Analog-to-Digital Converter)..................................................B-14 QSMCM (Queued Serial Multi-Channel Module) .................................................................B-16 Peripheral Pin Multiplexing (PPM) Module...........................................................................B-17 MIOS14 (Modular Input/Output Subsystem) .........................................................................B-18 TouCAN A, B and C (CAN 2.0B Controller) ........................................................................B-26 UIMB (U-Bus to IMB Bus Interface).....................................................................................B-31 CALRAM Control Registers ..................................................................................................B-31 CALRAM Array .....................................................................................................................B-32 READI Module Registers .......................................................................................................B-32 External Components Value For Different Crystals (Q1) ........................................................C-4 IRAMSTBY Regulator Operating Specifications ....................................................................C-8 Bank 0 and Bank 1 Functions .................................................................................................. D-2 QOM Bit Encoding .................................................................................................................. D-5 SIOP Function Valid CHAN_Control Options ..................................................................... D-56 SIOP State Timing ................................................................................................................. D-58 Memory Access Times Using Different Buses.........................................................................E-1 Instruction Timing Examples for Different Buses....................................................................E-2 Absolute Maximum Ratings (VSS = 0V) ................................................................................. F-1 Thermal Characteristics ............................................................................................................ F-3 ESD Protection ......................................................................................................................... F-6 DC Electrical Characteristics.................................................................................................... F-7 Oscillator and PLL.................................................................................................................. F-11 Array Program and Erase Characteristics ............................................................................... F-12 CENSOR Cell Program and Erase Characteristics................................................................. F-12 Flash Module Life................................................................................................................... F-12 Power Supply Pin Groups....................................................................................................... F-13 Bus Operation Timing ............................................................................................................ F-20 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxiv Tables Table Number F-12 F-11 F-13 F-14 F-15 F-16 F-17 F-18 F-19 F-20 F-21 F-22 F-23 F-24 F-25 F-26 F-27 F-28 G-1 G-2 G-3 G-4 G-5 G-6 G-7 G-8 G-9 G-10 G-11 G-12 G-13 G-14 G-15 G-16 G-17 G-18 G-19 G-20 G-21 Title Page Number Debug Port Timing ................................................................................................................. F-43 Interrupt Timing...................................................................................................................... F-43 READI AC Electrical Characteristics..................................................................................... F-45 RESET Timing ....................................................................................................................... F-47 JTAG Timing .......................................................................................................................... F-50 QADC64E Conversion Characteristics .................................................................................. F-54 QSPI Timing ........................................................................................................................... F-56 QSCI Timing........................................................................................................................... F-57 GPIO Timing .......................................................................................................................... F-60 TPU3 Timing .......................................................................................................................... F-61 TouCAN Timing..................................................................................................................... F-62 PPM Timing............................................................................................................................ F-62 MCPSM Timing Characteristics............................................................................................. F-64 MPWMSM Timing Characteristics ........................................................................................ F-64 MMCSM Timing Characteristics ........................................................................................... F-67 MDASM Timing Characteristics............................................................................................ F-69 MPIOSM Timing Characteristics ........................................................................................... F-71 MPC561/MPC563 Signal Names and Pin Names .................................................................. F-73 Absolute Maximum Ratings (VSS = 0V) ................................................................................ G-1 Thermal Characteristics ........................................................................................................... G-3 ESD Protection ........................................................................................................................ G-6 DC Electrical Characteristics................................................................................................... G-7 Oscillator and PLL................................................................................................................. G-10 Array Program and Erase Characteristics .............................................................................. G-11 CENSOR Cell Program and Erase Characteristics................................................................ G-11 Flash Module Life.................................................................................................................. G-12 Power Supply Pin Groups...................................................................................................... G-12 Bus Operation Timing ........................................................................................................... G-20 Interrupt Timing..................................................................................................................... G-40 Debug Port Timing ................................................................................................................ G-41 READI AC Electrical Characteristics.................................................................................... G-43 RESET Timing ...................................................................................................................... G-44 JTAG Timing ......................................................................................................................... G-47 QADC64E Conversion Characteristics ................................................................................. G-50 QSPI Timing .......................................................................................................................... G-52 QSCI Timing.......................................................................................................................... G-53 GPIO Timing ......................................................................................................................... G-56 TPU3 Timing ......................................................................................................................... G-57 TouCAN Timing.................................................................................................................... G-58 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxv Tables Table Number G-22 G-23 G-24 G-25 G-26 G-27 G-28 Title Page Number PPM Timing........................................................................................................................... G-58 MCPSM Timing Characteristics............................................................................................ G-60 MPWMSM Timing Characteristics ....................................................................................... G-60 MMCSM Timing Characteristics .......................................................................................... G-62 MDASM Timing Characteristics........................................................................................... G-64 MPIOSM Timing Characteristics .......................................................................................... G-67 MPC561/MPC563 Signal Names and Pin Names ................................................................. G-68 MPC561/MPC563 Reference Manual, Rev. 1.2 lxxvi Freescale Semiconductor About This Book This manual describes the capabilities, operation, and function of the Freescale MPC561/MPC563 microcontrollers. The documentation follows the modular construction of the devices in the MPC500 family product line. Each microcontroller in the MPC500 family has a comprehensive reference manual that provides sufficient information for normal operation of the device. The reference manual is supplemented by module-specific reference manuals that provide detailed information about module operation and applications. Where information in this manual varies from information in other references, this manual takes precedence. Refer to Suggested Reading for further information. Unless otherwise noted, references to the MPC561 and MPC563 also apply to their code compressed counterparts, the MPC562 and MPC564, respectively. Any functional differences between the MPC561/MPC563 and MPC562/MPC564 are noted. MPC562/MPC564-specific information is located in Appendix A, "MPC562/MPC564 Compression Features." Audience This manual is intended for system software and hardware developers and applications programmers who want to develop products for the MPC561/MPC563. It is assumed that the reader understands operating systems and microprocessor and microcontroller system design. Organization Following is a summary and brief description of the major sections of this manual: * Chapter 1, "Overview," provides an overview of the MPC561/MPC563 microcontroller, including a block diagram showing the major modular components, a features list, and a summary of differences between the MPC561/MPC563 and the MPC555. * Chapter 2, "Signal Descriptions," describes the MPC561/MPC563 microcontroller's external signals. * Chapter 3, "Central Processing Unit," describes the RISC processor (RCPU) used in the MPC500 family of microcontrollers. * Chapter 4, "Burst Buffer Controller 2 Module," describes the three main functional parts: the bus interface unit (BIU), the instruction memory protection unit (IMPU), and the instruction code decompressor unit (ICDU). * Chapter 5, "Unified System Interface Unit (USIU) Overview." The unified system interface unit (USIU) of the MPC561/MPC563 consists of several functional modules that control system start-up, system initialization and operation, system protection, and the external system bus. * Chapter 6, "System Configuration and Protection." The MPC561/MPC563 incorporates many system functions that normally must be provided in external circuits. In addition, it is designed to MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxvii * * * * * * * * * * * * provide maximum system safeguards against hardware and software faults. This chapter provides a detailed explanation of this functionality. Chapter 7, "Reset." This section describes the MPC561/MPC563 reset sources, operation, control, and status. Chapter 8, "Clocks and Power Control," describes the main timing and power control reference for the MPC561/MPC563. Chapter 9, "External Bus Interface," describes the functionality of the MPC561/MPC563 external bus. Chapter 10, "Memory Controller," generates interface signals to support a glueless interface to external memory and peripheral devices. Chapter 11, "L-Bus to U-Bus Interface (L2U)," describes the interface between the load/store bus (L-bus) and the unified bus (U-bus). The L2U module includes the Data Memory Protection Unit (DMPU), which provides protection for data memory accesses. Chapter 12, "U-Bus to IMB3 Bus Interface (UIMB)." The U-bus to IMB3 bus interface (UIMB) structure is used to connect the CPU internal unified bus (U-bus) to the intermodule bus 3 (IMB3). It controls bus communication between the U-bus and the IMB3. Chapter 13, "QADC64E Legacy Mode Operation." The two queued analog-to-digital converter (QADC) modules on MPC561/MPC563 devices are 10-bit, unipolar, successive approximation converters. The modules can be configured to operate in one of two modes, legacy mode (MPC555 compatible) and enhanced mode. This chapter describes how the modules operate in legacy mode, which is the default mode of operation. Chapter 14, "QADC64E Enhanced Mode Operation." The two queued analog-to-digital converter (QADC) modules on the MPC561/MPC563 devices are 10-bit, unipolar, successive approximation converters. The modules can be configured to operate in one of two modes, legacy mode (for MPC555 compatibility) and enhanced mode. This chapter describes how the module operates in enhanced mode. Chapter 15, "Queued Serial Multi-Channel Module." The MPC561/MPC563 contains one queued serial multi-channel module (QSMCM) which provides three serial communication interfaces: the queued serial peripheral interface (QSPI) and two serial communications interfaces (SCI/UART). This chapter describes the functionality of each. Chapter 16, "CAN 2.0B Controller Module," describes the three CAN 2.0B controller modules (TouCAN) implemented on the MPC561/MPC563. Each TouCAN is a communication controller that implements the Controller Area Network (CAN) protocol, an asynchronous communications protocol used in automotive and industrial control systems. It is a high speed (one Mbit/sec), short distance, priority based protocol that can run over a variety of mediums. Chapter 17, "Modular Input/Output Subsystem (MIOS14)." The modular I/O system (MIOS) consists of a library of flexible I/O and timer functions including I/O port, counters, input capture, output compare, pulse and period measurement, and PWM. Because the MIOS14 is composed of submodules, it is easily configurable for different kinds of applications. Chapter 18, "Peripheral Pin Multiplexing (PPM) Module." The PPM functions as a parallel-to-serial communications module that reduces the number of signals required to connect MPC561/MPC563 Reference Manual, Rev. 1.2 lxxviii Freescale Semiconductor * * * * * * * * * * * * * * the MPC561/MPC563 to an external device; and shorts internal signals to increase access to multiple functions multiplexed on the same external signal. Chapter 19, "Time Processor Unit 3," describes an enhanced version of the original TPU, an intelligent, semi-autonomous microcontroller designed for timing control. Chapter 20, "Dual-Port TPU3 RAM (DPTRAM)." The dual-port RAM (DPTRAM) module consists of a control register block and an 8-Kbyte array of static RAM that can be used either as microcode storage for the TPU3 or as general-purpose memory. The MPC561/MPC563 has one DPTRAM module that serves two TPU3 modules. Chapter 21, "CDR3 Flash (UC3F) EEPROM." The MPC563 U-bus CDR3 (UC3F) EEPROM module is designed for use in embedded microcontroller applications targeted for high-speed read performance and high-density byte count requirements. Chapter 22, "CALRAM Operation." This module provides the MPC561/MPC563 with a general purpose memory that may be read from or written to as either bytes, half-words, or words. In addition to this, a portion of the CALRAM, called the overlay region, can be used for calibration (i.e., overlaying portions of the U-bus Flash with a portion of the CALRAM array). Chapter 23, "Development Support," covers program flow tracking support, breakpoint/watchpoint support, development system interface support (debug mode) and software monitor debugger support. These features allow efficiency in debugging systems based on the MPC561/MPC563. Chapter 24, "READI Module." The READI module provides development support capabilities for MCUs in single chip mode, without requiring address and data signals for internal visibility. Chapter 25, "IEEE 1149.1-Compliant Interface (JTAG)," describes MPC561/MPC563 compatibility with the IEEE 1149.1 Standard Test Access Port and Boundary Scan Architecture as well as any potential incompatibility issues. Appendix A, "MPC562/MPC564 Compression Features," includes information about code compression features of the MPC562/MPC564. Appendix B, "Internal Memory Map," provides memory maps for the MPC561/MPC563 modules. Appendix C, "Clock and Board Guidelines." The MPC561/MPC563 built-in PLL, oscillator, and other analog and sensitive circuits require that the board design follow special layout guidelines to ensure proper operation of the chip clocks. This appendix describes how the clock supplies and external components should be connected in a system. Appendix D, "TPU3 ROM Functions," provides a brief description of the pre-programmed functions in the TPU3. Appendix E, "Memory Access Timing," lists memory access timings for internal and external memory combinations. Appendix F, "Electrical Characteristics," contains detailed information on power considerations, DC/AC electrical characteristics, and AC timing characteristics of the MPC561/MPC563 at the default 40 MHz and optional 56 MHz operating frequencies. Appendix G, "66-MHz Electrical Characteristics," contains detailed information on power considerations, DC/AC electrical characteristics, and AC timing characteristics of the MPC561/MPC563 at the optional operating frequency of 66 MHz. This document also includes a register index and comprehensive index. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxix Suggested Reading This section lists additional reading that provides background for the information in this manual as well as general information about the PowerPC architecture. Also listed are documents that further complement this manual by providing in-depth functional descriptions of certain modules: * QSM (Queued Serial Module) Reference Manual (QSMRM/AD) * TPU (Time Processor Unit) documentation (TPULITPAK/D, including the TPURM/AD) * RCPU (RISC Central Processor Unit) Reference Manual (RCPURM/AD) * Nexus Standard Specification Rev 1.0 (IEEE-ISTO 5001-1999) available at: http://www.nexus5001.org/ * JTAG IEEE 1149.1 Specification The following general documentation, available through Morgan-Kaufmann Publishers, 340 Pine Street, Sixth Floor, San Francisco, CA, provides useful information about the PowerPC architecture: * The PowerPC Architecture: A Specification for a New Family of RISC Processors, Second Edition, by International Business Machines, Inc. Freescale documentation is available from the sources listed on the back cover of this manual. A brief summary of available documentation is listed below: * Programming Environments Manual for 32-Bit Implementations of the PowerPC Architecture (MPCFPE32B/AD)--Describes resources defined by the PowerPC architecture. * Reference manuals--These books provide details about individual implementations and are intended for use with the Programming Environments Manual. * Addenda/errata to reference manuals--Because some processors have follow-on parts, an addendum is provided that describes the additional features and functionality changes and are intended for use with the corresponding reference manuals. * Product Briefs--Each device has a product brief that provides an overview of its features. This document is roughly the equivalent to the overview chapter (Chapter 1) of an implementation's reference manual. * The Programmer's Reference Guide for the PowerPC Architecture (MPCPRG/D)--This concise reference includes the register summary, exception vectors, and the PowerPC ISA instruction set. * Application notes--These short documents address specific design issues useful to programmers and engineers working with Freescale processors. Additional literature is published as new processors become available. For a current list of documentation, refer to http://www.motorola.com/semiconductors. Conventions and Nomenclature This document uses the following notational conventions: cleared/set When a bit takes the value zero, it is said to be cleared; when it takes a value of one, it is said to be set. MPC561/MPC563 Reference Manual, Rev. 1.2 lxxx Freescale Semiconductor ACTIVE_HIGH ACTIVE_LOW 0x0 0b0 italics REG[FIELD] x n & | Logic level one Logic level zero To set a bit or bits To clear a bit or bits LSB MSB Asserted Negated Names for signals that are active high are shown in uppercase text. Signals that are active high are referred to as asserted when they are high and negated when they are low. Names for signals that are active low are shown in uppercase text with an overbar. Active-low signals are referred to as asserted (active) when they are low and negated when they are high. Prefix to denote hexadecimal number Prefix to denote binary number Italics indicate variable command parameters. Book titles in text are also set in italics. Abbreviations for registers are shown in uppercase. Specific bits, fields, or ranges appear in brackets. For example, CRAMMCR[DIS] identifies the array disable bit (DIS) within the CALRAM module configuration register. A range of bits or signals is referred to by mnemonic and the numbers that define the range. For example, DATA[24:31] form the least significant byte of the data bus. In some contexts, such as signal encodings, x indicates a don't care. Used to express an undefined numerical value NOT logical operator AND logical operator OR logical operator is the voltage that corresponds to Boolean true (1) state. is the voltage that corresponds to Boolean false (0) state. means to establish logic level one on the bit or bits. means to establish logic level zero on the bit or bits. means least significant bit or bits. means most significant bit or bits. means that a signal is in active logic state. An active low signal changes from logic level one to logic level zero when asserted, and an active high signal changes from logic level zero to logic level one. means that an asserted signal changes logic state. An active low signal changes from logic level zero to logic level one when negated, and an active high signal changes from logic level one to logic level zero. Notational Conventions Table i contains notational conventions that are used in this document. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxxi Table i. Notational Conventions Symbol Function + Addition - Subtraction (two's complement) or negation * Multiplication / Division > Greater < Less = Equal Equal or greater Equal or less Not equal * AND | Inclusive OR (OR) Exclusive OR (EOR) NOT Complementation : Concatenation ? Transferred Exchanges Sign bit; also used to show tolerance Sign extension Acronyms and Abbreviations Table ii contains acronyms and abbreviations that are used in this document. Table ii. Acronyms and Abbreviated Terms Term Meaning ALU Arithmetic logic unit BIST Built-in self test BIU Bus interface unit BPU Branch processing unit BSDL Boundary-scan description language CMOS Complementary metal-oxide semiconductor EA Effective address EAR External access register FIFO First-in-first-out FPR Floating-point register FPSCR Floating-point status and control register MPC561/MPC563 Reference Manual, Rev. 1.2 lxxxii Freescale Semiconductor Table ii. Acronyms and Abbreviated Terms (continued) Term Meaning FPU Floating-point unit GPR General-purpose register IABR Instruction address breakpoint register IEEE Institute for Electrical and Electronics Engineers IU Integer unit JTAG Joint Test Action Group LIFO Last-in-first-out LR Link register LSB Least-significant bit LSU Load/store unit MSB Most-significant bit MSR Machine state register NaN Not a number No-op No operation OEA Operating environment architecture PLL Phase-locked loop POR Power-on reset PVR Processor version register RISC Reduced instruction set computing SPR Special-purpose register SRR0 Machine status save/restore register 0 SRR1 Machine status save/restore register 1 TB Time base facility TBL Time base lower register TBU Time base upper register TLB Translation lookaside buffer TTL Transistor-to-transistor logic UIMM Unsigned immediate value UISA User instruction set architecture VEA Virtual environment architecture XER Register used for indicating conditions such as carries and overflows for integer operations References The Sematech Official Dictionary and the Reference Guide to Letter Symbols for Semiconductor Devices by the JEDEC Council/Electronics Industries Association are recommended as references for terminology and symbology. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor lxxxiii MPC561/MPC563 Reference Manual, Rev. 1.2 lxxxiv Freescale Semiconductor Chapter 1 Overview This chapter provides an overview of the MPC561/MPC563 microcontrollers, including a block diagram showing the major modular components and sections that list the major features, and differences between the MPC561/MPC563 and the MPC555. The MPC561, MPC562, MPC563, and MPC564 devices are members of the Freescale MPC500 RISC Microcontroller family. The parts herein will be referred to only as MPC561/MPC563 unless specific parts need to be referenced. Table 1-1. MPC56x Family Features 1.1 Device Flash Code Compression MPC561 None Not Supported MPC562 None Supported MPC563 512-Kbytes Flash Not Supported MPC564 512-Kbytes Flash Supported Introduction The MPC561/MPC563 devices offer the following features: * PowerPC ISA-compliant 32-bit single issue RISC processor (RCPU) * 64-bit floating-point unit (FPU) * Unified system integration unit (USIU) with a flexible memory controller and enhanced interrupt controller (EIC) * 512-Kbytes of Flash EEPROM memory (available on the MPC563 only) -- Typical endurance of 100,000 write/erase cycles @ 25C -- Typical data retention of 100 years @ 25C * 32-Kbytes of static RAM in one CALRAM module, configured as -- 28-Kbyte normal access only array -- 4-Kbyte normal access or overlay access array (eight 512-byte regions) * Two time processing units (TPU3) with one 8-Kbyte dual port TPU RAM (DPTRAM) * One 22-timer channel modular I/O system (MIOS14) * Three TouCAN modules (TouCAN) * Two enhanced queued analog systems (QADC64E) * One queued serial multi-channel module (QSMCM), which contains one queued serial peripheral interface (QSPI) and two serial controller interfaces (SCI/UART) * One peripheral pin multiplexing module (PPM) with a parallel to serial driver MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-1 Overview * * * * * 1.2 Debug features: -- Nexus debug port (Class 3) -- Background debug mode (BDM) -- IEEE 1194.1-compliant interface (JTAG) for boundary scan Plastic ball grid array (PBGA) packaging -- 388 ball PBGA -- 27 mm x 27 mm body size -- 1.0 mm ball pitch Default 40-, and optional 56-, and 66-MHz operation -40C-125C Independent power supplies -- 5-V I/O (5.0 0.25 V) -- 2.6 0.1-V external bus with a 5-V tolerant I/O system -- 2.6 0.1-V internal logic -- <150A on-chip voltage shunt regulator for RAM standby operation Block Diagram Figure 1-1 is a block diagram of the MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 1-2 Freescale Semiconductor Overview 512 Kbytes Flash MPC563 only JTAG Burst Buffer Controller U-Bus E-Bus USIU READI RCPU L2U L-Bus 32-Kbyte CALRAM 28-Kbyte SRAM (No Overlay) 4-Kbyte Overlay QADC64E QADC64E QSMCM PPM UIMB IMB3 TPU3 8-Kbyte DPTRAM TPU3 Tou CAN Tou CAN Tou CAN MIOS14 Figure 1-1. MPC561/MPC563 Block Diagram 1.3 Key Features The MPC561/MPC563 key features are explained in the following sections. 1.3.1 * * High-Performance CPU System Fully static design Four major power saving modes -- On, doze, sleep, deep-sleep, and power-down MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-3 Overview 1.3.1.1 * * * * * * * * * PowerPC-compliant 32-bit single issue core Precise exception model 64-bit floating point unit (FPU) Code compression supported on MPC562/MPC564 Reduces usage of internal/external Flash memory (up to 50% for code) on the MPC564 Reduces code size up to 50% Extensive system development support On-chip watchpoints and breakpoints Program flow tracking capability 1.3.1.2 * * * * * * * * Unified System Interface Unit (USIU) System configuration and protection features: -- Periodic-interrupt timer -- Bus monitor -- Software watchdog timer -- Real-time clock (RTC) -- PPC decrementer -- Time base Clock synthesizer Power management Reset controller External bus interface that tolerates 5-V inputs, provides 2.6-V outputs, and supports multi-master designs Enhanced interrupt controller that supports up to eight external and 40 internal interrupts, simplifies the interrupt structure, and decreases interrupt processing time USIU supports dual mapping to map part of one internal/external memory to another external memory External bus, supporting non-wraparound burst for instruction fetches, with up to 8 instructions per memory cycle 1.3.1.3 * * * * RISC MCU Central Processing Unit (RCPU) Burst Buffer Controller (BBC) Module Support for enhanced interrupt controller (EIC) Support for enhanced exception table relocation feature Branch target buffer Contains 2 Kbytes of decompression RAM (DECRAM) for code compression. This RAM may also be used as general-purpose RAM when the code compression feature is not used. MPC561/MPC563 Reference Manual, Rev. 1.2 1-4 Freescale Semiconductor Overview 1.3.1.4 * * * * Flexible memory protection units (MPU) in BBC and L2U Default attributes available in one global entry Attribute support for speculative accesses Up to eight memory regions are supported, four for data and four for instructions 1.3.1.5 * * * * * * * * Memory Controller Four flexible chip selects via memory controller 32-bit address and data buses 4-Kbyte to one 16-Mbyte (data) or 4-Gbyte (instruction) region size support Supports enhanced external burst -- Up to eight-beat transfer bursts, two-clock minimum bus transactions Use with SRAM, EPROM, Flash and other peripherals Byte selects or write enables 32-bit address fully decodes internal address space (4 Gbytes) with bit masks Four regions 1.3.1.6 * * * * * * * * Flexible Memory Protection Unit 512-Kbytes of CDR3 Flash EEPROM Memory (UC3F) - MPC563/MPC564 Only One 512-Kbyte module Page read mode (2/1/1/1 clock read access time) Byte, half-word or word programmable. Block (64 Kbytes) erasable External 4.75- to 5.25-V VFLASH power supply for program, erase, and read operations Security modes for software protection Typical endurance of 100,000 write/erase cycles @ 25C Typical data retention of 100 years @ 25C MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-5 Overview 1.3.1.7 * * * * * Composed of one 32-Kbyte CALRAM module -- 28-Kbyte static RAM -- 4-Kbyte calibration (overlay) RAM feature that allows calibration of Flash-based constants Eight 512-byte overlay regions One clock fast accesses Two clock cycle access option for power saving Standby power supply (IRAMSTBY) for data retention 1.3.1.8 * * * * * * * * Nexus Debug Port (Class 3) Compliant with Class 3 of the IEEE-ISTO 5001-1999 Program trace via branch trace messaging (BTM) Data trace via data write messaging (DWM) and data read messaging (DRM) Ownership trace via ownership trace messaging (OTM) Run-time access to on-chip memory map and special-purpose registers (SPRs) via the READI read/write access protocol Watchpoint messaging via the auxiliary port 9 or 16 full-duplex auxiliary pin interface for medium and high visibility throughput All features configurable and controllable via the auxiliary port Supports the RCPU debug mode via the auxiliary port 1.3.3 Integrated I/O System 1.3.3.1 * * * * Two Time Processor Units (TPU3) True 5 V I/O Two time processing units (TPU3) with 16 channels each Each TPU3 is a micro-coded timer subsystem 8 Kbytes of dual port TPU RAM (DPTRAM) shared by two TPU3 modules for TPU micro-code 1.3.3.2 * * General Purpose I/O Support (GPIO) 24 address signals and 32 data signals can be used for general-purpose I/O in single-chip mode 16 GPIO in MIOS14 Many peripheral signals can be used as GPIO when not used as primary functions 5-V outputs with slew rate control 1.3.2 * * * * * 32-Kbyte Static RAM (CALRAM) 22-Channel Modular I/O System (MIOS14) Six modulus counter sub-modules (MCSM) 10 double-action sub-modules (DASM) MPC561/MPC563 Reference Manual, Rev. 1.2 1-6 Freescale Semiconductor Overview * * 12 dedicated PWM sub-modules (PWMSM) One MIOS14 16-bit parallel port I/O sub-modules (MPIOSM) 1.3.3.3 * * * * * * * * * * * * Two queued analog-to-digital converter modules (QADC64E_A, QADC64E_B) providing a total of 32 analog channels 16 analog input channels on each QADC64E module using internal multiplexing Directly supports up to four external multiplexers Up to 41 total input channels on the two QADC64E modules with external multiplexing Software configurable to operate in enhanced or legacy (MPC555 compatible) mode Unused analog channels can be used as digital input/output signals -- GPIO on all channels in enhanced mode 10-bit A/D converter with internal sample/hold Minimum conversion time of 7 s (with typical QCLK frequency, 2 MHz) and +/- 2 bits accuracy Two conversion command queues of variable length Automated queue modes initiated by: -- External edge trigger -- Software command -- Periodic/interval timer within the QADC64E module, that can be assigned to both queue 1 and 2 -- External gated trigger (queue 1 only) 64 result registers -- Output data is right- or left-justified, signed or unsigned. Alternate reference input (ALTREF), with control in the conversion command word (CCW) 1.3.3.4 * * Two Enhanced Queued Analog-to-Digital Converter Modules (QADC64E) Three CAN 2.0B Controller (TouCAN) Modules Three TouCAN modules (TouCAN_A, TouCAN_B, TouCAN_C) Each TouCAN provides the following features: -- 16 message buffers, programmable I/O modes -- Maskable interrupts -- Independent of the transmission medium (external transceiver is assumed) -- Open network architecture, multi-master concept -- High immunity to EMI -- Short latency time for high-priority messages -- Low-power sleep mode, with programmable wake-up on bus activity -- TouCAN_C pins are shared with MIOS14 GPIO or QSMCM MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-7 Overview 1.3.3.5 * * * * One queued serial module with one queued SPI and two SCIs (QSMCM) QSMCM matches full MPC555 QSMCM functionality Queued SPI -- Provides full-duplex communication port for peripheral expansion or inter-processor communication -- Up to 32 preprogrammed transfers, reducing overhead -- Synchronous serial interface with baud rate of up to system clock / 4 -- Four programmable peripheral-selects signals: -- Supports up to 16 devices with external decoding -- Supports up to eight devices with internal decoding -- Special wrap-around mode allows continuous sampling of a serial peripheral for efficient interfacing to serial analog-to-digital (A/D) converters SCI -- UART mode provides NRZ format and half- or full-duplex interface -- 16 register receive buffers and 16 register transmit buffers on one SCI -- Advanced error detection and optional parity generation and detection -- Word-length programmable as eight or nine bits -- Separate transmitter and receiver enable bits, and double buffering of data -- Wake-up functions allow the CPU to run uninterrupted until either a true idle line is detected, or a new address byte is received 1.3.3.6 * * * * * * * Queued Serial Multi-Channel Module (QSMCM) Peripheral Pin Multiplexing (PPM) Synchronous serial interface between the microprocessor and an external device Four internal parallel data sources can be multiplexed through the PPM -- TPU3_A: 16 channels -- TPU3_B: 16 channels -- MIOS14: 12 PWM channels, four MDA channels -- Internal GPIO: 16 general-purpose inputs, 16 general-purpose outputs Software configurable stream size Software configurable clock (TCLK) based on system clock Software selectable clock modes (SPI mode and TDM mode) Software selectable operation modes -- Continuous mode -- Start-transmit-receive (STR) mode Software configurable internal modules interconnect (shorting) MPC561/MPC563 Reference Manual, Rev. 1.2 1-8 Freescale Semiconductor Overview 1.4 MPC561/MPC563 Optional Features The following features of the MPC561/MPC563 are optional features and may not appear in certain configurations: * 56- or 66-MHz operation (40 MHz is default) * Code compression (available on MPC562 and MPC564 only) * 512 Kbytes Flash (available on MPC563 and MPC564 only) 1.5 Comparison of MPC561/MPC563 and MPC555 In Table 1-2, the MPC555 is used as a baseline to compare the high level differences from an early device offering in the MPC500 family to the MPC561/MPC563. Table 1-2. Differences Between MPC555 and MPC561/MPC563 Module MPC555 MPC561/MPC563 CPU Core BBC Identical Basic Enhanced Code Compression (classes scheme with 2 Kbytes DECRAM) Code Compression is available only on MPC562/MPC564. L2U Identical SRAM 26 Kbytes 32 Kbytes calibration SRAM with overlay features Flash 448-Kbyte CMF (2 modules, 256-Kbyte and 192-Kbyte) 512-Kbyte UC3F (1 module) on MPC563 only. No Flash on MPC561 USIU Basic Enhanced Interrupt Controller JTAG Selectable by RCW Selectable at PORESET READI None New Module (Class 3 Nexus IEEE-ISTO 5001-1999) UIMB QADC64E Identical (2) QSMCM MIOS (2) Enhanced (1) Identical (1) MIOS1 MIOS14 4 Extra PWMSM 4 Extra MCSM MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-9 Overview Table 1-2. Differences Between MPC555 and MPC561/MPC563 (continued) Module * * * * * * * * MPC561/MPC563 TouCAN (2) Identical (3) TPU3 (2) Identical (2) DPTRAM (6 Kbytes) Identical (8 Kbytes) PPM 1.6 MPC555 -- New Module Additional MPC561/MPC563 Differences The MPC561/MPC563 devices are very similar to the MPC555 with the following differences: -- Up to 66 MHz operating frequency (Refer to the applicable electrical characteristics document for more information.) -- CDR3 technology -- Two power supplies: 5.0-V I/O, 2.6-V external bus signals, 2.6-V internal logic -- New modules: READI, CALRAM, PPM -- Extra TouCAN module, additional 6 Kbytes of SRAM on L-bus (32 Kbytes total) with CALRAM overlay features, extra 2 Kbytes of DPTRAM (8 Kbytes total) QADC64E -- GPO on all channel signals in addition to GPI functions TouCAN, TPU3, QSMCM, UIMB, Core, L2U -- No changes BBC2 -- Enhanced interrupt controller support -- Enhanced exception relocation table -- Branch target buffer -- 2 Kbytes of decompression RAM for code compression. This may also be used as general-purpose RAM while not used for code compression. CALRAM (with overlay features) -- New module -- Overlay features allow calibration of Flash-based constants UC3F (U-bus CDR3 Flash module) on MPC563/MPC564 only -- 512 Kbytes of non-volatile memory (NVM) -- Designed for use in embedded microcontroller (MCU) applications targeted for high speed read performance and high density byte count requirements READI -- New module USIU -- Enhanced interrupt controller -- ENGCLK default frequency MPC561/MPC563 Reference Manual, Rev. 1.2 1-10 Freescale Semiconductor Overview * * * 1.7 -- READI support -- Reduced data setup time -- Enhanced external burst support MIOS14 -- Four additional PWM channels -- Four additional MCSM timers DPTRAM (8 Kbytes) -- No functional changes PPM (peripheral pin multiplexing) -- New module -- Four-to-one multiplexing -- Parallel-to-serial driver (SPI and TDM) SRAM Keep-Alive Power Behavior The IRAMSTBY pin provides keep-alive power to RAM when the main power supply is shut down. The IRAMSTBY pin can be powered directly from a battery using an internal shunt regulator or via a small battery for standby use. See Figure 1-2. To Battery R To IRAMSTBY Pad C Figure 1-2. Recommended Connection Diagram for IRAMSTBY While power is off, the IRAMSTBY supply powers the following: * 32-Kbyte CALRAM * 8-Kbyte DPTRAM module * 2-Kbyte BBC DECRAM module NOTE IRAMSTBY must always be supplied with at least 50A for correct operation. 1.8 MPC561/MPC563 Address Map The internal memory map is organized as a single 4-Mbyte block. The user can assign this block to one of eight locations by programming a register in the USIU (IMMR[ISB]). The eight possible locations are the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-11 Overview first eight 4-Mbyte memory blocks starting with address 0x0000 0000 (refer to Figure 1-3). The programmability of the internal memory map location allows the user to implement a multiple-chip system. 0x0000 0000 Internal 4-Mbyte Memory Block 0x003F FFFF 0x0040 0000 (Can reside in one of eight locations) 0x007F FFFF 0x0080 0000 0x00BF FFFF 0x00C0 0000 0x00FF FFFF 0x0100 0000 0x013F FFFF 0x0140 0000 0x017F FFFF 0x0180 0000 0x01BF FFFF 0x01C0 0000 0x01FF FFFF 0xFFFF FFFF Figure 1-3. MPC561/MPC563 Memory Map The internal memory space is divided into the following sections. Refer to Figure 1-4. * Flash memory (512-Kbytes) * CALRAM static RAM memory (32-Kbytes) * Control registers and IMB3 modules (64 Kbytes) -- BBC control registers (16-Kbytes) -- USIU and Flash control registers (16-Kbytes) -- UIMB interface and IMB3 modules (32-Kbytes) -- CALRAM/READI control registers (256-bytes) MPC561/MPC563 Reference Manual, Rev. 1.2 1-12 Freescale Semiconductor Overview 0x00 0000 UC3F Flash* 512 Kbytes 0x07 FFFF 0x08 0000 Reserved for Flash 2,605 Kbytes 0x2F C000 USIU Control Registers UC3F Control Registers* 0x2F C800 0x2FC80B Reserved 0x2F 7FFF 0x2F 8000 0x2F 8800 0x2F A000 0x2F BFFF 0x2F C000 BBC DECRAM 2 Kbytes Reserved for BBC BBC CONTROL DPTRAM Control (32 bytes) Reserved (8160 bytes) USIU & Flash Control 16 Kbytes 0x2F FFFF 0x30 0000 UIMB I/F & IMB 0x30 0000 0x30 0020 0x30 2000 DPTRAM (8 Kbytes) Modules 32 Kbytes TPU3_A (1 Kbyte) 0x30 7FFF 0x30 8000 Reserved for IMB 480 Kbytes 0x37 FFFF 0x38 0000 0x38 00FF 0x38 0100 0x38 3FFF 0x38 4000 TPU3_B (1 Kbyte) QADC64E_A (1 Kbyte) 0x30 4000 0x30 4400 0x30 4800 0x30 4C00 CALRAM/ READI Control 256 bytes QADC64E_B (1 Kbyte) Reserved (L-bus Control) 16 Kbytes Reserved (2 Kbytes) 0x30 5400 PPM (64 bytes) 0x30 5C00 Reserved (960 bytes) 0x30 5C80 MIOS14 (4 Kbytes) 0x30 6000 TouCAN_A (1 Kbyte) 0x30 7000 Reserved (L-bus Mem) 464 Kbytes QSMCM (1 Kbyte) 0x30 5000 0x3F 7FFF 0x3F 8000 0x3F F000 0x3F FFFF CALRAM 32 Kbytes TouCAN_B (1 Kbyte) 4-Kbyte Overlay Section Note: Flash is available only on the MPC563/MPC564. 0x30 7400 TouCAN_C (1 Kbyte) 0x30 7800 Reserved (896 bytes) 0x30 7900 UIMB Registers (128 bytes) 0x30 7F80 0x30 7FFF MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 1-13 Overview Figure 1-4. MPC561/MPC563 Internal Memory Map 1.9 Supporting Documentation List This list contains references to currently available and planned documentation. * MPC555 User's Manual (MPC555UM/AD) * RCPU Reference Manual (RCPURM/AD) * Nexus Standard Specification (non-Freescale document) available at: http://www.nexus5001.org/ * IEEE 1149.1 Specification (non-Freescale document) MPC561/MPC563 Reference Manual, Rev. 1.2 1-14 Freescale Semiconductor Chapter 2 Signal Descriptions This chapter describes the MPC561/MPC563 microcontroller's external signals. It contains a description of individual signals, shows their behavior, shows whether the signal is an input or an output, and indicates signal multiplexing. NOTE A bar over a signal name indicates that the signal is active-low--for example, TA (transfer acknowledge). Active-low signals are referred to as asserted (active) when they are low and negated when they are high. Signals that are not active-low, such as ADDR[8:31] (address bus signals) and DATA[0:31] (data bus signals) are referred to as asserted when they are high and negated when they are low. Refer to Appendix F, "Electrical Characteristics," and Appendix G, "66-MHz Electrical Characteristics," for detailed electrical information for each signal. 2.1 Signal Groupings Figure 2-1 illustrates the external signals of the MPC561/MPC563 grouped by functional module. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-1 Signal Descriptions SGPIOA[8:31] / ADDR[8:31] SGPIOD[0:31] / DATA[0:31] Bus Interface 67 Pins TSIZ[0:1] WR / RD BURST BDIP TA TEA OE TEXP / RSTCONF STS / BI TS MDO4 / SGPIOC0 / IRQ0 RSV / SGPIOC1 / IRQ1 Interrupt Controller 8 Pins CR / SGPIOC2 / MTS / IRQ2 KR / RETRY / SGPIOC3 / IRQ3 AT2 / SGPIOC4 / IRQ4 MODCK1 / SPGIOC5 / IRQ5 MODCK[2:3] / IRQ[6:7] FRZ / PTR / SGPIOC6 Development and Debug 7 Pins LWP0 / IRQOUT / SGPIOC7 VF0 / LWP1 / BG VF1 / IWP2 / BR VF2 / IWP3 / BB VFLS[0:1] / IWP[0:1] 24 32 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 QADC64E_A and QADC64E_B 39 Pins QSMCM 11 Pins B_ANw / B_PQB0 / B_AN0 B_ANx/ B_PQB1 / B_AN1 B_ANy/ B_PQB2 / B_AN2 B_ANz / B_PQB3 / B_AN3 B_PQB[4:7] / B_AN[48:51] B_MA[0:2] / B_PQA[0:2] / B_AN[52:54] B_PQA[3:7] / B_AN[55:59] VRH VRL ALTREF VDDA VSSA PCS[6:7] / ETRIG[1:2] SS / QGPIO0 / PCS0 QGPIO[1:3] / PCS[1:3] QGPIO4 / MISO QGPIO5 / MOSI QGPIO6 / SCK QGPO1 / TXD1 C_CNTX0 /QGPO2 / TXD2 QGPI1 / RXD1 C_CNRX0 / QGPI2 / RXD2 WE[0:3] / BE[0:3] / AT[0:3] Write Enable 4 Pins A_CNTX0 A_CNRX0 B_CNTX0 B_CNRX0 TouCAN 4 Pins (plus 2 Pins multiplexed with MIOS and QSMCM) 1 1 1 1 1 1 1 1 1 4 3 5 5 5 1 1 1 1 1 3 1 1 1 1 1 1 4 3 5 1 1 1 1 1 2 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 16 1 16 1 EPEE B0EPEE VFLASH VDDF VSSF HRESET PORESET / TRST SRESET TCK / DSCK / MCKI TDI / DSDI / MDI0 TDO / DSDO / MDO0 TMS / EVTI QVDDL Global Power Supply UC3F Flash EEPROM1 5 Pins System Control 3 Pins JTAG/BDM/READI 5 Pins JCOMP / RSTI MDA[11:15] MDA[27:31] MPWM0 / MDI1 MPWM1 / MDO2 MPWM2 / PPM_TX1 MPWM3 / PPM_RX1 MPWM16 MPWM[17:19] / MDO[3, 6:7] MPIO32B0 / MDO1 / VF0 MPIO32B1 / MCKO / VF1 MPIO32B2 / MSEI / VF2 MPIO32B3 / MSEO / VFLS0 MPIO32B4 / VFLS1 MPIO32B5 / MDO5 MPIO32B6 / MPWM4 / MDO6 MPIO32B[7:9] / MPWM[5,20:21] MPIO32B10 / PPM_TSYNC MPIO32B11 / C_CNRX0 MPIO32B12 / C_CNTX0 MPIO32B13 / PPM_TCLK MPIO32B14 / PPM_RX0 MPIO32B15 / PPM_TX0 A_TPUCH[0:15] A_T2CLK / PCS5 B_TPUCH[0:15] B_T2CLK / PCS4 VDD VSS KAPWR IRAMSTBY NVDDL 4 1 1 1 MPC561/563 A_ANw / A_PQB0 / A_AN0 A_ANx/ A_PQB1 / A_AN1 A_ANy/ A_PQB2 / A_AN2 A_ANz / A_PQB3 / A_AN3 A_PQB[4:7] / A_AN[48:51] A_MA[0:2] / A_PQA[0:2] / A_AN[52:54] A_PQA[3:7] / A_AN[55:59] Chip Selects 4 Pins 1 1 1 1 1 1 Configuration 1 Pin CS[0:3] 1 1 Clocks and PLL 8 Pins 4 1 1 1 1 1 XTAL EXTAL XFC CLKOUT EXTCLK ENGCLK / BUCLK VDDSYN VSSSYN PULL_SEL VDDH MIOS14 34 Pins TPU3 A and B 34 Pins Note: In cases where one multiplexed signal is an input and another is an output, together they are shown as I/O. 1 The MPC561 has no Flash EEPROM Figure 2-1. MPC561/MPC563 Signal Groupings MPC561/MPC563 Reference Manual, Rev. 1.2 2-2 Freescale Semiconductor Signal Descriptions 2.2 Signal Summary Table 2-1 describes individual MPC561/MPC563 signals, grouped by functional module. Table 2-1. MPC561/MPC563 Signal Descriptions Signal Name No. of Type Signals Function after Reset1 Description Bus Interface I/O ADDR[8:31] / SGPIOA[8:31] 24 Address Bus [8:31]. Specifies the physical address of the Controlled by bus transaction. The address is driven onto the bus and kept RCW[SC]. valid until a transfer acknowledge is received from the slave. See Table 6-10. ADDR8 is the MSB for this bus. I/O I/O DATA[0:31] / SGPIOD[0:31] 32 Port SGPIOA[8:31]. Allows the signals to be used as general-purpose inputs/outputs. Data Bus [0:31]. Provides the general-purpose data path Controlled by between the MPC561/MPC563 and all other devices. RCW[SC]. Although the data path is a maximum of 32 bits wide, it can See Table 6-10. be sized to support 8-, 16-, or 32-bit transfers. DATA0 is the MSB of the data bus. I/O Port SGPIOD[0:31]. Allows the signals to be used as general-purpose inputs/outputs. TSIZ[0:1] 2 I/O TSIZ[0:1] RD/WR 1 I/O RD/WR BURST 1 I/O BURST Burst Indicator. Driven by the bus master to indicate that the currently initiated transaction is a burst. BDIP 1 I/O BDIP Burst Data In Progress. Indicates to the slave that there is a data beat following the current data beat. TS TA 1 1 I/O I/O TS TA Transfer Size [0:1]. Indicates the size of the requested data transfer in the current bus cycle. Read/Write. Indicates the direction of the data transfer for a transaction. A logic one indicates a read from a slave device; a logic zero indicates a write to a slave device. Transfer Start. Indicates the start of a bus cycle that transfers data to/from a slave device. This signal is driven by the master only when it has gained ownership of the bus. Every master should negate this signal before relinquishing the bus. This is an active-low signal and needs an external pull-up resistor to ensure proper operation and meet signal timing specifications. Transfer Acknowledge. This line indicates that the slave device addressed in the current transaction has accepted the data transferred by the master (write) or has driven the data bus with valid data (read). The slave device negates the TA signal after the end of the transaction. The slave device will then immediately three-state the TA signal to prevent contention on the line in case a new transfer that addresses another slave device(s) is initiated. This signal is an active-low signal and needs an external pull-up resistor to ensure proper operation and conform to signal timing specifications. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-3 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 TEA 1 I/O TEA OE 1 O OE RSTCONF / TEXP I 1 BI / STS RSTCONF until reset negates. Description Transfer Error Acknowledge. This signal indicates that a bus error occurred in the current transaction. The MPC561/MPC563 asserts this signal when the bus monitor does not detect a bus cycle termination within 2040 clock cycles. The assertion of TEA causes the termination of the current bus cycle, regardless of the state of TA. An external pull-up device is required to negate TEA quickly, before a second error is detected. That is, the signal must be pulled up within one clock cycle of the time it was three-stated by the MPC561/MPC563. Output Enable. This output line is asserted when a read access is initiated by the MPC561/MPC563 to an external slave controlled by the memory controller's GPCM. Reset Configuration. This input line is sampled by the MPC561/MPC563 during the assertion of the HRESET signal in order to sample the reset configuration. If the line is asserted, the configuration mode is sampled from the external data bus. When this line is negated, the configuration mode adopted by the MPC561/MPC563 is either the internal default or read from the internal Flash (MPC563 only). O Timer Expired. This output line reflects the status of PLPRCR[TEXPS] in the USIU. This bit indicates an expired timer value. I/O Burst Inhibit. This bidirectional, active-low, three-state signal indicates that the slave device addressed in the current burst transaction is not able to support burst transfers. When the MPC561/MPC563 drives out the signal for a specific transaction, it asserts or negates BI according to the value specified in the appropriate control registers. The signal is negated after the end of the transaction and then is immediately three-stated. This is an active-low signal and needs an external pull-up resistor to ensure proper operation and signal timing specifications. 1 O Controlled by RCW[DBGC]. See Table 6-8. Special Transfer Start. This output signal is driven by the MPC561/MPC563 to indicate the start of a transaction on the external bus or signals the beginning of an internal transaction in show cycle mode. MPC561/MPC563 Reference Manual, Rev. 1.2 2-4 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Description Interrupt Controller Interrupt Request 0. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. IRQ0 is a non-maskable interrupt (NMI). I 1 I/O IRQ0 / SGPIOC0 / MDO4 O MDO4 if the Nexus (READI) port is enabled, Port SGPIOC0. Allows the signal to be used as a IRQ0 otherwise. general-purpose input/output. See Section 2.5. READI Message Data Out. Message data out (MDO4) are output signals used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight signals are implemented. Interrupt Request 1. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. I IRQ1 / RSV / SGPIOC1 1 IRQ1 O I/O Port SGPIOC1. Allows the signal to be used as a general-purpose input/output. Interrupt Request 2. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. I I IRQ2 / CR / SGPIOC2 / MTS2 1 IRQ2 I/O Cancel Reservation. Instructs the MPC561/MPC563 to clear its reservation because some other master has touched its reserved space. An external bus snooper asserts this signal. Port SGPIOC2. Allows the signal to be used as a general-purpose input/output. O Memory Transfer Start. This is the transfer start signal from the MPC561's memory controller that allows external memory access by an external bus master. I Interrupt Request 3. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. I/O IRQ3 / KR / RETRY / SGPIOC3 Reservation. This signal is used, together with the address bus, to indicate that the internal core initiated a transfer as a result of a STWCX or a LWARX instruction. 1 I/O I/O IRQ3 Kill Reservation. In case of a bus cycle initiated by a STWCX instruction issued by the RCPU core to a non-local bus on which the storage reservation has been lost, this signal is used by the non-local bus interface to back-off the cycle. Retry. Indicates to a master that the cycle is terminated but should be repeated. As an input, it is driven by the external slave to retry a cycle. Port SGPIOC3. Allows the signal to be used as a general-purpose input/output. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-5 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name IRQ4 / AT2 / SGPIOC4 No. of Type Signals 1 Function after Reset1 I Interrupt Request 4. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. O Address Type 2. A bit from the address type bus which indicates one of the 16 "address types" to which the address applies. The address type signals are valid at the rising edge of the clock in which the special transfer start (STS) is asserted. IRQ4 I/O Port SGPIOC4. Allows the signal to be used as a general-purpose input/output. I IRQ5 / MODCK1 / SPGIOC5 1 I MODCK1 until reset negates, then IRQ5 I/O I IRQ[6:7] / MODCK[2:3] 2 I CS[0:3] WE[0:3] / BE[0:3] / AT[0:3] 4 4 Description O O O Interrupt Request 5. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. Mode Clock 1. Sampled at the negation of PORESET/TRST in order to configure the phase-locked loop (PLL)/clock mode of operation. Port SGPIOC5. Allows the signal to be used as a general-purpose input/output. MODCK[2:3] until reset negates, then IRQ[6:7] CS[0:3] Controlled by RCW[ATWC]. See Table 6-8. Interrupt Request [6:7]. One of the eight external signals that can request, by means of the internal interrupt controller, a service routine from the RCPU. Mode Clock [2:3]. Sampled at the negation of PORESET/TRST in order to configure the PLL/clock mode of operation. Chip Select [0:3]. These output signals enable peripheral or memory devices at programmed addresses if defined appropriately in the memory controller. CS0 or CS3 can be configured to be the global chip select for the boot device. Write Enable[0:3]/Byte Enable[0:3]. This output signal is asserted when a write access to an external slave controlled by the memory controller is initiated by the MPC561/MPC563. It can be optionally asserted on all read and write accesses. See WEBS bit definition in Table 10-8. WEn/BEn are asserted when data lanes shown below contain valid data to be stored by the slave device. - WE0/BE0 is asserted if the data lane DATA[0:7] contains valid data to be stored by the slave device. * WE1/BE1 is asserted if the data lane DATA[8:15] contains valid data to be stored by the slave device. * WE2/BE2 is asserted if the data lane DATA[16:23] contains valid data to be stored by the slave device. * WE3/BE3 is asserted if the data lane DATA[24:31] contains valid data to be stored by the slave device. Address Type [0:3]. Indicates one of the 16 address types to which the address applies. The address type signals are valid at the rising edge of the clock in which the special transfer start (STS) is asserted. MPC561/MPC563 Reference Manual, Rev. 1.2 2-6 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Description System Control I PORESET / TRST PORESET / TRST 1 I Power-On Reset. This signal should be activated as a result of a voltage failure on the keep-alive power supply. The signal has a glitch detector to ensure that low spikes of less than 20 ns are rejected. The internal PORESET / TRST signal is asserted only if PORESET / TRST is asserted for more than 100 ns. See Chapter 7, "Reset," for more details on timing. Test Reset. This input provides asynchronous reset to the test logic (JTAG). Hard Reset. The reset controller can detect an external assertion of HRESET only if it occurs while the MPC561/MPC563 is not asserting reset. After negation of HRESET or SRESET is detected, a 16-cycle period is taken before testing the presence of an external reset. HRESET 1 I/O HRESET The internal HRESET signal is considered asserted only when assertion lasts for more than 100 ns. To meet external timing requirements, an external pull-up device is required to negate HRESET. See Chapter 7, "Reset," for more details on timing. SRESET 1 I/O SRESET Soft Reset. The reset controller can detect an external assertion of SRESET only if it occurs while the MPC561/MPC563 is not asserting reset. After negation of HRESET or SRESET is detected, a 16-cycle period is taken before testing the presence of an external soft reset. To meet external timing requirements, an external pull-up device is required to negate SRESET. See Chapter 7, "Reset," for more details on timing. Development and Debug I/O SGPIOC6 / FRZ / PTR 1 SGPIOC7 / IRQOUT/ LWP0 1 O Port SGPIOC6. Allows the signals to be used as general-purpose inputs/outputs. PTR Freeze. Indicates that the RCPU is in debug stopped mode. O Program Trace. Indicates an instruction fetch is taking place (for program flow tracking). I/O Port SGPIOC7. Allows the signal to be used as general-purpose inputs/outputs. O O LWP0 Interrupt Out. Indicates that an interrupt has been requested to all external devices. Load/Store Watchpoint 0. This output signal reports the detection of a data watchpoint in the program flow executed by the RCPU. See Chapter 23, "Development Support," for more details. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-7 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Bus Grant. Indicates external bus status. BG is asserted low when the external bus arbiter grants ownership of the external bus to a specific master. This is an active-low signal and needs an external pull-up resistor to ensure proper operation and meet signal timing specifications. I/O BG / VF0 / LWP1 1 O Controlled by RCW[DBGC]. See Table 6-8. Bus Request. Indicates that the external bus has been requested for external cycle. This is an active-low signal and needs an external pull-up resistor to ensure proper operation and meet signal timing specifications. I/O 1 O Controlled by RCW[DBGC]. See Table 6-8. O IWP[0:1] / VFLS[0:1] 1 O Visible Instruction Queue Flush Status 1. This output signal together with VF0 and VF2 is output by the MPC561/MPC563 when program instruction flow tracking is required. VFs report the number of instructions flushed from the instruction queue in the internal core. See Chapter 23, "Development Support," for more details. Instruction Watchpoint 2. This output signal reports the detection of an instruction watchpoint in the program flow executed by the RCPU. Bus Busy. Indicates that the master is using the external bus. BB is an active-low signal and needs an external pull-up resistor to ensure proper operation and signal timing specifications. I/O BB / VF2 / IWP3 Visible Instruction Queue Flush Status 0. This output signal together with VF1 and VF2 is output by the MPC561/MPC563 when program instruction flow tracking is required. VFs report the number of instructions flushed from the instruction queue in the internal core. See Chapter 23, "Development Support," for more details. Load/Store Watchpoint 1. This output signal reports the detection of a data watchpoint in the program flow executed by the RCPU. O BR / VF1 / IWP2 Description Controlled by RCW[DBGC]. See Table 6-8 Visible Instruction Queue Flush Status 2. This output signal together with VF0 and VF1 is output by the MPC561/MPC563 when a program instructions flow tracking is required. VFs report the number of instructions flushed from the instruction queue in the internal core. O Instruction Watchpoint 3. This output signal reports the detection of an instruction watchpoint in the program flow executed by the internal core. O Instruction Watchpoint [0:1]. These output signals report the detection of an instruction watchpoint in the program flow executed by the RCPU. 2 O Controlled by RCW[DBGC]. See Table 6-8. Visible History Buffer Flush Status [0:1]. These signals are output by the MPC561/MPC563 to enable program instruction flow tracking. They report the number of instructions flushed from the history buffer in the RCPU. See Chapter 23, "Development Support," for details. MPC561/MPC563 Reference Manual, Rev. 1.2 2-8 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Description JTAG/BDM/READI I TMS / EVTI 1 I TMS unless the Nexus (READI) port is enabled, then EVTI. See Section 2.5. I I TDI / DSDI / MDI0 1 I 1 I I DSDI unless the Nexus (READI) port (MDI0) or JTAG mode (TDI) is enabled. See Section 2.5. DSCK unless the Nexus (READI) port (MCKI) or JTAG mode (TCK) is enabled. See Section 2.5. O TDO / DSDO / MDO0 1 O O JCOMP / RSTI 1 I I EVTI. Event in (EVTI) is level sensitive when configured for breakpoint generation, otherwise it is edge sensitive. Test Data In. This input is used for serial test instructions and test data for on-board test logic (JTAG). I TCK / DSCK / MCKI Test Mode Select. This input controls test mode operations for on-board test logic (JTAG). DSDO unless the Nexus (READI) port (MDO0) or JTAG mode (TDO) is enabled. See Section 2.5. Development Serial Data Input. This input signal is the data in for the debug port interface. See Chapter 23, "Development Support," for details. Message Data In. MDI0 is a Nexus input signal used for downloading configuration information, writes to user resources, and so forth. Internal latching of MDI occurs on the rising edge of MCKI. Test Clock. This input provides a clock for on-board test logic (JTAG). Development Serial Clock. This input signal is the clock for the debug port interface. See Chapter 23, "Development Support," for details. Message Clock In. This input line is the input clock to the READI module for the Nexus message clock input. Test Data Out. This output is used for serial test instructions and test data for on-board test logic (JTAG). Development Serial Data Output. This output signal is the data-out line of the debug port interface. See Chapter 23, "Development Support," for details. READI Message Data Out. Message data out: MDO0 is an output signal used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight MDO signals are implemented. JTAG Compliancy. This signal enables the IEEE1149.1 JTAG compliant circuitry in the MPC561/MPC563. See Section 2.5. 0 JTAG disabled 1 JTAG enabled RSTI. Reset input for the Nexus port. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-9 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Description Clocks and PLL XTAL 1 O XTAL XTAL. This output signal is one of the connections to an external crystal for the internal oscillator circuitry. EXTAL 1 I EXTAL EXTAL. This signal is one of the connections to an external crystal for the internal oscillator circuitry. If EXTAL is unused, it must be grounded. XFC 1 I XFC External Filter Capacitance. This input signal is the connection for an external capacitor filter for the PLL circuitry. Clock Out. This output signal is the clock system frequency. The CLKOUT drive strength can be configured to full strength, half strength, quarter strength, or disabled. The drive strength is configured using the COM[0:1] bits and CQDS bits in the SCCR register in the USIU. CLKOUT 1 O CLKOUT EXTCLK 1 I EXTCLK EXTCLK. This is the external frequency source for the MPC561/MPC563. If EXTCLK is unused, it must be grounded. O ENGCLK / BUCLK 1 ENGCLK (2.6 V) O ENGCLK. This is the engineering clock output. Drive voltage can be configured to 2.6 V, 5 V (with slew-rate control), or disabled. The drive voltage is configured using the EECLK[0:1] bits in the SCCR register in the SIU. BUCLK. When the MPC561/MPC563 is in limp mode, it is operating from a less precise on-chip ring oscillator to allow the system to continue minimum functionality until the system clock is fixed. This backup clock can be seen externally if selected by the values of the EECLK[0:1] bits in the SCCR register in the USIU. VDDSYN 1 I VDDSYN VDDSYN. This is the power supply of the PLL circuitry. VSSSYN 1 I VSSSYN VSSSYN. This is the ground reference of the PLL circuitry. Configuration PULL_SEL3 1 I PULL_SEL Pull Select. PULL_SEL determines whether the pull devices on the MIOS and TPU signals are pull-ups or pull-downs. When pull-ups are selected, the pull-ups are to 5.0 V except the following MIOS signals will be pulled to 2.6V: VF[0:2]/MPIO32B[0:2], VFLS[0:1]/MPIO32B[3:4], and MDO[7:4]/MPIO32B[7:10]. When this pin is low, pull-downs are selected. TouCAN A_CNTX0 1 O A_CNTX0 TouCAN_A Transmit Data. This signal is the serial data output. A_CNRX0 1 I A_CNRX0 TouCAN_A Receive Data. This signal is the serial data input. B_CNTX0 1 O B_CNTX0 TouCAN_B Transmit Data. This signal is the serial data output. MPC561/MPC563 Reference Manual, Rev. 1.2 2-10 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name B_CNRX0 No. of Type Signals 1 I Function after Reset1 B_CNRX0 Description TouCAN_B Receive Data. This signal is the serial data input. UC3F Flash4 EPEE. This external program/erase enable control signal externally controls the program or erase operations. When held low, program or erase operations on the entire internal Flash module are disabled. Available in the MPC563 only. This signal is not connected on the MPC561. EPEE4 1 I EPEE B0EPEE4 1 I B0EPEE VFLASH4 1 I VFLASH VFLASH. Flash supply voltage (5-V supply) used during all operations of the UC3F. Available in the MPC563 only. This signal is not connected on the MPC561. VDDF4 1 I VDDF VDDF. Flash core voltage input (2.6-V supply). Available in the MPC563 only. This signal should be connected to VDD, preferably directly to a 2.6V plane on the circuit board. This signal is not connected on the MPC561. VSSF4 1 I VSSF VSSF. Flash core ground reference. Available in the MPC563 only. This signal is not connected on the MPC561. B0EPEE. This control signal externally controls the program or erase operations on block 0 of the internal Flash. When held low, program or erase operations on block 0 only are disabled. Available in the MPC563 only. This signal is not connected on the MPC561. QADC64E_A and QADC64E_B ETRIG[1:2] / PCS[6:7] A_AN0 / A_ANw / A_PQB0 2 1 I ETRIG[1:2] O PCS[6:7]. This signals provide QSPI peripheral chip select when the enhanced PCS mode is selected. I Analog Channel 0. Internally multiplexed input-only analog channel. Passed on as a separate signal to the QADC64E. I A_AN0 Multiplexed Analog Input (A_ANw). Externally multiplexed analog input. Port A_PQB0. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I/O5 A_AN1 / A_ANx/ A_PQB1 ETRIG[1:2]. These are the external trigger inputs to the QADC64E_A and QADC64E_B modules. ETRIG1 can be configured to be used by both QADC64E_A and QADC64E_B. Likewise, ETRIG2 can be used by both QADC64E_B and QADC64E_A. The trigger input signals are associated with the scan queues. I Analog Channel 1. Internally multiplexed input-only analog channel. Passed on as a separate signal to the QADC64E. I Multiplexed Analog Input (A_ANx). Externally multiplexed analog input. 1 A_AN1 I/O5 Port A_PQB1. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-11 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Analog Channel 2. Internally multiplexed input-only analog channel. The input is passed on as a separate signal to the QADC64E. I A_AN2 / A_ANy/ A_PQB2 A_AN3 / A_ANz / A_PQB3 1 1 I A_AN2 Port A_PQB2. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I Analog Input 3. Internally multiplexed input-only analog channel. The input is passed on as a separate signal to the QADC64E. I A_AN3 4 Analog Input [48:51]. Analog input channel. The input is passed on as a separate signal to the QADC64E. AN[48:51] I/O5 I 3 I A_AN[52:54] Analog Input [55:59]. Input-only. These inputs are passed on as separate signals to the QADC64E. A_AN[55:59] I/O I B_AN0 / B_ANw / B_PQB0 1 I I/O Multiplexed Address [0:2] for QADC64E Module A. Provides a three-bit multiplexed address output to the external multiplexer chip to allow selection of one of the eight inputs. Port A_PQA[0:2]. This is a bidirectional general-purpose I/O. I 5 Port A_PQB[4:7]. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. Analog Input [52:54]. Input-only. These inputs are passed on as separate signals to the QADC64E. I/O A_AN[55:59] / A_PQA[3:7] Multiplexed Analog Input (A_ANz). Externally multiplexed analog input. Port A_PQB 3. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I A_AN[52:54] / A_MA[0:2] / A_PQA[0:2] Multiplexed Analog Input (A_ANy). Externally multiplexed analog input. I/O5 I/O5 A_AN[48:51] / A_PQB[4:7] Description Port A_PQA[3:7]. This is a bidirectional general-purpose I/O. Analog Channel 0. Internally multiplexed input-only analog channel. Passed on as a separate signal to the QADC64E. B_AN0 Multiplexed Analog Input (B_ANw). Externally multiplexed analog input. Port B_PQB0. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. MPC561/MPC563 Reference Manual, Rev. 1.2 2-12 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 I B_AN1 / B_ANx/ B_PQB1 B_AN2 / B_ANy/ B_PQB2 B_AN3 / B_ANz / B_PQB3 1 1 1 I Analog Channel 1. Internally multiplexed input-only analog channel. Passed on as a separate signal to the QADC64E. B_AN1 Port B_PQB1. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I Analog Channel 2. Internally multiplexed input-only analog channel. The input is passed on as a separate signal to the QADC64E. I B_AN2 Port B_PQB2. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I Analog Input 3. Internally multiplexed input-only analog channel. The input is passed on as a separate signal to the QADC64E. I 4 B_AN3 B_AN[48:51] Analog Input [52:54]. These inputs are passed on as separate signals to the QADC64E. B_AN[52:54] I/O 5 Multiplexed Address [0:2] for QADC64E Module A. Provides a three-bit multiplexed address output to the external multiplexer chip to allow selection of one of the eight inputs. Port B_PQA[0:2]. This is a bidirectional general-purpose I/O. I B_AN[55:59] / B_PQA[3:7] Analog Input [48:51]. Analog input channel. The input is passed on as a separate signal to the QADC64E. Port B_PQB[4:7]. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I I Multiplexed Analog Input (B_ANz). Externally multiplexed analog input. Port B_PQB3. This is a bidirectional general-purpose I/O if the QADC64E is configured in enhanced mode, otherwise it is an input only. I/O 3 Multiplexed Analog Input (B_ANy). Externally multiplexed analog input. I/O I B_AN[52:54] / B_MA[0:2] / B_PQA[0:2] Multiplexed Analog Input (B_ANx). Externally multiplexed analog input. I/O I/O B_AN[48:51] / B_PQB[4:7] Description B_AN[55:59] I/O Analog Input [55:59]. These inputs are passed on as separate signals to the QADC64E. Port B_PQA[3:7]. This is a bidirectional general-purpose I/O. VRH 1 I VRH VRH. Input signal for high reference voltage for the QADC64E_A and QADC64E_B modules. VRL 1 I VRL VRL. Input signal for low reference voltage for the QADC64E_A and QADC64E_B modules. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-13 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Description ALTREF 1 I ALTREF ALTREF. Input signal for alternate reference voltage for the QADC64E_A and QADC64E_B modules. VDDA 1 I VDDA VDDA. Power supply input to analog subsystems of the QADC64E_A and QADC64E_B modules. VSSA 1 I VSSA VSSA. Ground level for analog subsystems of the QADC64E_A and QADC64E_B modules. QSMCM I/O PCS0. This signal provides QSPI peripheral chip select 0 for the QSMCM module. I/O PCS0 / SS / QGPIO0 QGPIO0 1 Port QGPIO0. When this signal is not needed for a QSPI application it can be configured as a general-purpose input/output. I/O I/O PCS[1:3] / QGPIO[1:3] MISO / QGPIO4 MOSI / QGPIO5 3 PCS[1:3]. These signals provide QSPI peripheral chip selects for the QSMCM module. QGPIO[1:3] I/O Port QGPIO[1:3]. When these signals are not needed for QSPI applications they can be configured as general-purpose input/outputs. I/O Master-In Slave-Out (MISO). This bidirectional signal is the serial data input to the QSPI in master mode, and serial data output from the QSPI in slave mode. QGPIO4 1 I/O Port QGPIO4. When this signal is not needed for a QSPI application it can be configured as a general-purpose input/output. I/O Master-Out Slave-In (MOSI). This bidirectional signal is the serial data output from the QSPI in master mode and serial data input to the QSPI in slave mode. QGPIO5 1 I/O 1 I/O QGPIO6 O TXD1 / QGPO1 1 O Port QGPIO5. When this signal is not needed for a QSPI application it can be configured as a general-purpose input/output. SCK. This bidirectional signal is the clock from the QSPI in master mode or is the clock to the QSPI in slave mode. I/O SCK / QGPIO6 SS. Assertion of this bidirectional signal places the QSPI in slave mode. Port QGPIO6 for the QSMCM module. When this signal is not needed for a QSPI application it can be configured as a general-purpose input/output. When the QSPI is enabled for serial transmitting, the signal cannot function as a GPIO. Transmit Data 1. This is the serial data output from the SCI1. QGPO1 Port QGPO 1. When these signals are not needed for SCI applications, they can be configured as general-purpose outputs. When the transmit enable bit in the SCI control register is set to a logic 1, these signals cannot function as general-purpose outputs. MPC561/MPC563 Reference Manual, Rev. 1.2 2-14 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name TXD2 / QGPO2 / C_CNTX06 No. of Type Signals 1 Function after Reset1 O Transmit Data 2. This is the serial data output from the SCI2 O Port QGPO 2. When this signal is not needed for SCI applications it can be configured as general-purpose output. When the transmit enable bit in the SCI control register is set to a logic 1, this signal cannot function as a general-purpose output. QGPO2 O TouCAN Transmit Data. This signal is the serial data output for the TouCAN_C module. I Receive Data 1. This input signal is the serial data input to the SCI. RXD1 / QGPI1 Port QGPI 1. When this signal is not needed for SCI applications, it can be configured as a general-purpose input. When the receive enable bit in the SCI control register is set to a logic 1, this signal cannot function as a general-purpose input. QGPI1 1 I I RXD2 / QGPI2 / C_CNRX06 1 Description I Receive Data 2. This input signal provides serial data input to the SCI2. Port QGPI 2. When this signal is not needed for SCI applications it can be configured as a general-purpose input. When the receive enable bit in the SCI control register is set to a logic 1, this signal cannot function as a general-purpose input. QGPI2 TouCAN Receive Data. This is the serial data input signal for the TouCAN_C module. I MIOS14 MDA[11:15, 27:31] MPWM0 / MDI1 10 I/O MDA[11:15, 27:31] I/O MPWM0 unless the Nexus (READI) port is enabled, then MDI1. See Section 2.5. 1 I Double Action. These 10 signals provide paths for two 16-bit input captures and two 16-bit output compares. Clock and Load inputs: * MDA11 can provide clock inputs to the modulus counter submodule, MMCSM6 * MDA12 can provide load inputs to the modulus counter submodule, MMCSM6 * MDA13 can provide clock inputs to MMCSM22 * MDA14 can provide load inputs to MMCSM22 * MDA27 can provide clock inputs to MMCSM23 * MDA28 can provide load inputs to MMCSM23 * MDA30 can provide clock inputs to MMCSM7 * MDA31 can provide load inputs to MMCSM7 Pulse Width Modulation 0. This signal provides variable pulse width outputs at a wide range of frequencies. Message Data In. MDI1 is a Nexus input signal used for downloading configuration information, writes to user resources, etc. Internal latching of MDI will occur on rising edge of MCKI. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-15 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals I/O MPWM1 / MDO2 1 MPWM2 / PPM_TX1 1 O Function after Reset1 MPWM1 unless the Nexus (READI) port is enabled, then MDO2. See Section 2.5. I/O MPWM2 O 1 MPWM3 I MPWM16 MPWM17 / MDO3 1 MPWM16 I/O MPWM17 unless the Nexus (READI) port is enabled. See Section 2.5. O I/O MPWM[18:19] / MDO[6:7] 2 MPWM[18:19] O READI Message Data Out. Message data out (MDO2) is an output signal used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on the rising edge of MCKO. Eight MDO signals are implemented. Pulse Width Modulation 2. This signal provides a variable pulse width output signal at a wide range of frequencies. Pulse Width Modulation 3. This signal provides a variable pulse width output signal at a wide range of frequencies. PPMRX1. Receive data to the PPM channel number 1. I/O 1 Pulse Width Modulation 1. This signal provides a variable pulse width output signal at a wide range of frequencies. PPMTX1. Transmit data from PPM channel number 1. I/O MPWM3 / PPM_RX1 Description Pulse Width Modulation 16. This signal provides a variable pulse width output at a wide range of frequencies. Clock Input: MPWM16 can provide a clock input to modulus clock submodule, MMCSM8 Pulse Width Modulation 17. This signal provides variable pulse width outputs at a wide range of frequencies. Load Input: PWM17 can provide a load input to modulus clock submodule, MMCSM8 READI Message Data Out. Message data out (MDO3) is an output signal used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight MDO signals are implemented. Pulse Width Modulation [18:19]. These signals provide variable pulse width output signals at a wide range of frequencies. Clock and Load Input: * MPWM18 can provide clock inputs to modulus counter submodule MMCSM24 * MPWM19 can provide load inputs to modulus counter submodule MMCSM24 READI Message Data Out. Message data out (MDO[6:7]) are output signals used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight MDO signals are implemented. MPC561/MPC563 Reference Manual, Rev. 1.2 2-16 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 I/O MPIO32B0 / VF0 / MDO1 1 O MIOS14 GPIO 0. Allows the signals to be used as general-purpose inputs/outputs. MPIO32B0 unless the Nexus (READI) port is enabled, then MDO1. See Section 2.5. I/O 1 O MIOS14 GPIO 1. Allows the signals to be used as general-purpose inputs/outputs. MPIO32B1 unless the Nexus (READI) port is enabled, then MCKO. See Section 2.5. I/O MPIO32B2 / VF2 / MSEI 1 I Visible Instruction Queue Flush Status 1. These signals output by the MPC561/MPC563 when program instruction flow tracking is required. VF reports the number of instructions flushed from the instruction queue in the internal core. VF signals are also multiplexed with the development and debug signals VF0 / LWP1 / BG, VF1 / IWP2 / BR, and VF2 / IWP3 / BB. MCKO. Message clock-out (MCKO) is a free-running output clock to development tools for timing of MDO and MSEO signal functions. MCKO is the same as the MPC561/MPC563 system clock. O O Visible Instruction Queue Flush Status 0. These signals output by the MPC561/MPC563 when program instruction flow tracking is required. VF reports the number of instructions flushed from the instruction queue in the internal core. VF signals are also multiplexed with the development and debug signals VF0 / LWP1 / BG, VF1 / IWP2 / BR, and VF2 / IWP3 / BB. READI Message Data Out. Message data out (MDO1) is an output signal used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight MDO signals are implemented. O MPIO32B1 / VF1 / MCKO Description MIOS14 GPIO 2. Allows the signals to be used as general-purpose inputs/outputs. MPIO32B2 unless the Nexus (READI) port is enabled, then MSEI. See Section 2.5. Visible Instruction Queue Flush Status 2. These signals output by the MPC561/MPC563 when program instruction flow tracking is required. VF reports the number of instructions flushed from the instruction queue in the internal core. VF signals are also multiplexed with the development and debug signals VF0 / LWP1 / BG, VF1 / IWP2 / BR, and VF2 / IWP3 / BB. MSEI. Message Start/End Input. The MSEI input is a Nexus input signal that indicates when a message on the MDI signals has started, when a variable length packet has ended, and when the message has ended. Internal latching of MSEI occurs on rising edge of MCKI. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-17 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 I/O O MPIO32B3 / VFLS0 / MSEO 2 MIOS14 GPIO 3. Allows the signal to be used as a general-purpose input/output. MPIO32B3 unless the Nexus (READI) port is enabled. See Section 2.5. I/O 1 MIOS14 GPIO 4. Allows the signal to be used as a general-purpose input/output. MPIO32B4 O I/O MPIO32B5 / MDO5 1 O I/O MPIO32B6 / MPWM4 / MDO6 1 I/O MIOS14 GPIO 5. Allows the signal to be used as a general-purpose input/output. MPIO32B6 unless the Nexus (READI) port is enabled, then MDO6. See Section 2.5. MIOS14 GPIO 6. Allows the signal to be used as general-purpose input/output. I/O 3 MPIO32B[7:9] I/O 1 MPIO32B11 / C_CNRX06 1 O Pulse Width Modulation 4. These signals provide variable pulse width outputs at a wide range of frequencies. READI Message Data Out. Message data out (MDO6) is an output signal used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight MDO signals are implemented. Pulse Width Modulation [5, 20:21]. These signals provide variable pulse width outputs at a wide range of frequencies. MIOS14 GPIO 10. This function allows the signals to be used as general-purpose inputs/outputs. MPIO32B10 I/O MPIO32B11 I READI Message Data Out. Message data out (MDO5) is an output signal used for uploading OTM, BTM, DTM, and read/write accesses. External latching of MDO occurs on rising edge of MCKO. Eight MDO signals are implemented. MIOS14 GPIO[7:9]. Allows these signals to be used as general-purpose input/outputs. I/O MPIO32B10 / PPM_TSYNC Visible History Buffer Flush Status 1. This signal is output by the MPC561/MPC563 to allow program instruction flow tracking. It reports the number of instructions flushed from the history buffer in the RCPU. See Chapter 23, "Development Support," for details. MPIO32B5 unless the Nexus (READI) port is enabled, then MDO5. See Section 2.5. O MPIO32B[7:9] / MPWM[5, 20:21] Visible History Buffer Flush Status 0. This signal is output by the MPC561/MPC563 to allow program instruction flow tracking. It reports the number of instructions flushed from the history buffer in the RCPU. See Chapter 23, "Development Support," for details. MSEO. Message start/end out (MSEO) is an output signal which indicates when a message on the MDO signals has started, when a variable length packet has ended, and when the message has ended. External latching of MSEO occurs on rising edge of MCKO. O MPIO32B4 / VFLS1 Description PPM_TSYNC. Synchronizes the data between the PPM and peripheral devices. MIOS14 GPIO 11. This function allows the signals to be used as general-purpose inputs/outputs. TouCAN_C Receive Data. This is the serial data input signal for the TouCAN_C module. MPC561/MPC563 Reference Manual, Rev. 1.2 2-18 Freescale Semiconductor Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 I/O MPIO32B12 / C_CNTX06 1 MIOS14 GPIO 12. This function allows the signals to be used as general-purpose inputs/outputs. MPIO32B12 O TouCAN_C Transmit Data. This is the serial data output signal for the TouCAN_C module. I/O MPIO32B13 / PPM_TCLK 1 MIOS14 GPIO 13. This function allows the signals to be used as general-purpose inputs/outputs. MPIO32B13 O PPM_TCLK. PPM bus clock I/O MPIO32B14 / PPM_RX0 1 MIOS14 GPIO 14. This function allows the signals to be used as general-purpose inputs/outputs. MPIO32B14 I PPM_RX0. Receive data to the PPM channel number 0. I/O MPIO32B15 / PPM_TX0 1 Description MIOS14 GPIO 15. This function allows the signals to be used as general-purpose inputs/outputs. MPIO32B15 O PPM_TX0. Transmit data from PPM channel number 0. TPU A_TPUCH[0:15] 16 I/O A_TPUCH[0:15] Provides TPU module A with 16 input/output programmable timed events. I/O A_T2CLK / PCS5 1 A_T2CLK O B_TPUCH[0:15] 16 I/O PCS5. This signal provides QSPI peripheral chip select when the enhanced PCS mode is selected. B_TPUCH[0:15] Provides TPU module B with 16 input/output programmable timed events. I/O B_T2CLK / PCS4 1 This signal is used to clock or gate the timer count register 2 (TCR2) within the TPU module A. This signal is an output-only in special test mode. B_T2CLK O This signal is used to clock or gate the timer count register 2 (TCR2) within the TPU module B. This signal is an output-only in special test mode. PCS4. This signal provides QSPI peripheral chip select when the enhanced PCS mode is selected. Global Power NVDDL 1 I NVDDL NVDDL. Noisy 2.6-V voltage supply input. This signal supplies the final output stage of the 2.6-V pad output drivers. The NVDDL and QVDDL supplies should be connected to the same power supply in a user's system. QVDDL 1 I QVDDL QVDDL. Quiet 2.6-V voltage supply input. This signal supplies all pad logic and pre-driver circuitry, except for the final output stage of the 2.6-V pad output drivers. The NVDDL and QVDDL supplies should be connected to the same power supply in a user's system. VDDH 1 I VDDH VDDH. 5-V voltage supply input. VDD 1 I VDD VDD. 2.6-V voltage supply input for internal logic. KAPWR 1 I KAPWR Keep-Alive Power. 2.6-V voltage supply input for the oscillator and keep-alive registers. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-19 Signal Descriptions Table 2-1. MPC561/MPC563 Signal Descriptions (continued) Signal Name No. of Type Signals Function after Reset1 Description VSS 1 I VSS VSS. Zero supply/ground level for internal logic/external bus. IRAMSTBY 1 I IRAMSTBY SRAM Keep-Alive Power. This is an input current source for an internal regulator that supplies voltage to all SRAM modules in standby mode. This pad connects through a voltage regulator and a voltage switch to the following modules: CALRAM (32-Kbyte SRAM), DPTRAM (8-Kbyte SRAM), BBC DECRAM (2-Kbyte vocabulary SRAM). 1 2 3 4 5 6 This is the function after PORESET/TRST and HRESET. This signal also included the MDO5 function on the K27S mask set of the MPC561. This signal was ECK on K27S mask set of MPC561. Only the MCP563/MPC564 have Flash memory. The input only applies in legacy mode. C_CNTX0 and C_CNRX0 can be shared either with the MIOS14 GPIO pins (MPIO32B12, MPIO32B11) or with the QSMCM SC12 pins (TXD2 / QGPO2, RXD2 / QGPI2). The selection is made by the TCNC bits in the PDMCR2 register. Refer to Section 2.4, "Pad Module Configuration Register (PDMCR2)." 2.2.1 MPC561/MPC563 Signal Multiplexing Table 2-2 describes the signal multiplexing that occurs between different modules of the MPC561/MPC563. Most of the signal functions are controlled by the PDMCR2 register. Table 2-2. MPC561/MPC563 Signal Sharing Signal Name Module Sharing C_CNTX0/MPIO32B12, C_CNRX0/MPIO32B11 TouCAN shared with MIOS14 GPIO TXD2/QGPO2/C_CNTX0 RXD2/QGPI2/C_CNRX0 TouCAN shared with QSMCM SCI2 MPIO32B5/MDO5 READI submodule shared with MIOS14 GPIO MPIO32B6/MPWM4, MPIO32B7/MPWM5, MPIO32B8/MPWM20, MPIO32B9/MPWM21 MIOS14 PWM submodule shared with MIOS14 GPIO VF0/MPIO32B0/MDO1, VF1/MPIO32B1/MCKO, VF2/MPIO32B2/MSEI, VFLS0/MPIO32B3/MSEO Debug pins shared with MIOS14 GPIO and READI MPIO32B13/PPM_TCLK MPIO32B14/PPM_RX0 MPIO32B15/PPM_TX0 PPM submodule shared with MIOS14 GPIO MPWM2/PPM_TX1 MPWM3/PPM_RX1 PPM submodule shared with MIOS14 PWM submodule MPC561/MPC563 Reference Manual, Rev. 1.2 2-20 Freescale Semiconductor Signal Descriptions Table 2-2. MPC561/MPC563 Signal Sharing (continued) Signal Name Module Sharing MPWM0/MDI1, MPWM1/MDO2, MPWM17/MDO3, MPWM[18:19]/MDO[6:7] B_T2CLK/PCS4 A_T2CLK/PCS5 TPU3 modules shared with QSMCM module. ETRIG1/PCS6 ETRIG2/PCS7 2.2.2 READI submodule shared with MIOS14 PWM submodule QADC64E modules shared with QSMCM module. READI Port Signal Sharing Table 2-3 and Table 2-4 show the signal functionality of the READI signals when the Nexus port is in reduced port mode and full port mode. . Table 2-3. Reduced and Full Port Mode Pads Functionality in Reduced Port Mode Pad Name Functionality When Not in Reduced Port Mode TDI/DSDI/MDI01 MDI0 TDI/DSDI TDO/DSDO/MDO0 MDO0 TDO/DSDO2 VF0/MPIO32B0/MDO1 MDO1 VF0/MPIO32B03 VF1/MPIO32B1/MCKO MCKO VF1/MPIO32B13 VF2/MPIO32B2/MSEI MSEI VF2/MPIO32B23 VFLS0/MPIO32B3/MSEO MSEO VFLS0/MPIO32B34 1 TDI in JTAG mode, DSDI in BDM mode. TDO in JTAG mode, DSDO in BDM mode. 3 Selected by the VF bit in the MIOS14TPCR. 4 Selected by the VFLS bit in the MIOS14TPCR. 2 Table 2-4. Full Port Only Mode Pads Functionality in Full Port Mode Pad Name Functionality when not in Full Port Mode MPWM0/MDI1 MDI1 MPWM0 MPWM1/MDO2 MDO2 MPWM1 MPWM17/MDO3 MDO3 MPWM17 IRQ0/SGPIOC0/MDO4 MDO4 IRQ0/SGPIOC0 MPIO32B5/MDO5 MDO5 MPIO32B5 MPIO32B6 / MPWM4 / MDO6 MDO61 MPIO32B6/MPWM4 1 MPWM18/MDO6 MDO6 MPWM18 MPWM19/MDO7 MDO7 MPWM19 1 The MDO6 bit in the PDMCR2 register determines where the MDO6 signal is available. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-21 Signal Descriptions 2.3 Pad Module Configuration Register (PDMCR) Bits in the PDMCR (which resides in the SIU memory map) control the slew rate and weak pull-up/pull-down characteristics of some signals; refer to Appendix F, "Electrical Characteristics." The PORESET/TRST signal resets all the PDMCR bits asynchronously. MSB 0 1 Field 2 3 4 5 SLRC 6 7 8 9 10 PRDS SPRDS T2CLK_PU HRESET 11 12 13 14 PULL_DIS 15 -- 0000_0000_0000_0000 Addr 0x2F C03C LSB 16 17 18 19 20 21 22 23 Field 24 25 26 27 28 29 30 31 -- HRESET 0000_0000_0000_0000 Figure 2-2. Pads Module Configuration Register (PDMCR) Table 2-5 contains bit descriptions for the PDMCR. Table 2-5. PDMCR Field Descriptions Bits Name Description SLRC0 controls the slew rate of signals on the following modules: TPU3, QADC64E, SGPIOA, SGPIOD, SGPIOC. For the slew rate refer to Appendix F, "Electrical Characteristics." 0 Slew rate controlled 1 Not slew rate controlled SLRC1 controls the slew rate of signals on the following modules: QSPI, TouCAN_A, TouCAN_B. For the slew rate refer to Appendix F, "Electrical Characteristics." 0 Slew rate controlled 1 Not slew rate controlled 0:5 SLRC[0:5] SLRC2 controls the slew rate of signals on the QSCI in QSMCM . For the slew rate refer to Appendix F, "Electrical Characteristics." 0 Slew rate controlled 1 Not slew rate controlled SLRC3 controls the slew rate of signals on the following modules: MIOS14 except MPWM2/PPM_TX1 and MPWM3 signal. For the slew rate refer to Appendix F, "Electrical Characteristics." 0 Slew rate controlled 1 Not slew rate controlled SLRC4 controls the slew rate of the MIOS14 MPWM2 signal. For the slew rate refer to Appendix F, "Electrical Characteristics." 0 Slew rate controlled 1 Not slew rate controlled SLRC5 controls the slew rate of the MIOS14 MPWM3 signal. For the slew rate refer to Appendix F, "Electrical Characteristics." 0 Slew rate controlled 1 Not slew rate controlled MPC561/MPC563 Reference Manual, Rev. 1.2 2-22 Freescale Semiconductor Signal Descriptions Table 2-5. PDMCR Field Descriptions (continued) Bits Name 6 PRDS 7 SPRDS 8 Description PULL_DIS 15-31 -- 2.4 Disables weak pull-up/pull down devices enabled at the assertion of PORESET/TRST or HRESET. Signals affected by the SPRDS bit include the following: BDIP, TA, TS, TEA, RD/WR, BR, BG, BB, TSIZ, BI/STS, BURST, TDI, TMS, JCOMP, TCK. 0 Enable weak pull-up/pull down devices on pads controlled by this signal. 1 Disable weak pull-up/pull down devices on pads controlled by this signal. Refer to Table 2-14 for more information on SPRDS. T2CLK_PU Controls the pull-up on the TPU T2CLK signals. 0 Pull-ups are enabled if the T2CLK signals are defined as inputs 1 Pull-ups are disabled on the T2CLK signals 9:14 1 Disables weak pull-up/pull down devices enabled at the assertion of PORESET/TRST or HRESET. Signals affected by the PRDS bit include the following: * all SGPIO signals * all TPU3 signals 0 Enable weak pull-up/pull down devices on pads controlled by this signal. 1 Disable weak pull-up/pull down devices on pads controlled by this signal. Refer to Table 2-14 for more information on PRDS. Disables weak pull up-or-down devices enabled at the assertion of PORESET/TRST or HRESET. Signals affected by these bits include the following: * PULL_DIS0 (bit 9): all MIOS14 input signals * PULL_DIS1 (bit 10): all QSMCM input signals * PULL_DIS2 (bit 11): all QADC64E input signals, except ETRIG1 and ETRIG2 * PULL_DIS3 (bit 12): all TouCAN input signals * PULL_DIS4 (bit 13): Reserved * PULL_DIS5 (bit 14): ETRIG1 and ETRIG21 0 Enable weak pull-up/pull-down devices on pads controlled by this signal. 1 Disable weak pull-up/pull-down devices on pads controlled by this signal. Reserved This bit was RESERVED on the K27S mask set of MPC561. Pad Module Configuration Register (PDMCR2) The PDMCR2 controls alternate functionality of signals shared between different modules, as well as the pre-discharge circuitry to allow 5V friendliness on the data bus. MSB 0 1 Field PREDIS_ EN 2 3 -- 4 5 TCNC HRESET 6 7 8 9 MPI7 MPI8 MPI9 10 11 -- 12 13 14 PPMPAD 15 -- 0000_0000_0000_0000 Addr 0x2F C038 LSB 16 Field PPMV HRESET 17 18 -- 19 20 21 MDO6 MPI6 22 23 24 -- 25 26 27 28 29 PC PCS PCS PCS PCS SV 4EN 5EN 6EN 7EN 30 31 -- 0000_0000_0000_0000 Figure 2-3. Pads Module Configuration Register 2 (PDMCR2) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-23 Signal Descriptions Table 2-6. PDMCR2 Field Description Bits Name 0 PREDIS_ EN Description Enable for the Pre-discharge circuit to allow 5 volt external devices on the external data bus. 0 Bus pre-discharge disabled 1 Bus pre-discharge enabled Note: This bit is reserved in 66-MHz implementations. 1:3 -- Reserved 4:5 TCNC Controls the function on the following pads: TXD2/QGPO2/C_CNTX0, RXD2/QGPI2/C_CNRX0, MPIO32B11/C_CNRX0, MPIO32B12/C_CNTX0. Refer to Table 2-7. 6 MPI7 Controls the pad MPIO32B7/MPWM5. 0 MPIO32B7 function will be selected. 1 MPWM5 function will be selected. 7 MPI8 Controls the pad MPIO32B8/MPWM20. 0 MPIO32B8 function will be selected. 1 MPWM20 function will be selected. 8 MPI9 Controls the pad MPIO32B9/MPWM21. 0 MPIO32B9 function will be selected. 1 MPWM21 function will be selected. 11:13 PPMPAD 14:15 -- 16 PPMV 17:19 -- 20 MDO6 Selects the functionality of MDO6 0 The pad MPIO32B6/MPWM4/MDO6 will function as MDO6, and the pad MPWM18/MDO6 will function as MPWM18. 1 The pad MPWM18/MDO6 will function as MDO6, and the pad MPIO32B6/MPWM4/MDO6 will function according to MPI6 bit. This selection is enabled only if full port mode is implemented in the READI module, if full port mode is not selected then MPWM18/MDO6 will function as MPWM18, and MPIO32B6/MPWM4/MDO6 will function according to MPI6 bit. NOTE: It is recommended to use MPIO32B6/MPWM4/MDO6 for the Nexus port as MDO6 is enabled from reset. 21 MPI6 Controls the pad MPIO32B6/MPWM4/MDO6. 0 MPIO32B6 function will be selected. 1 MPWM4 function will be selected. This bit will be disabled if full port mode is enabled in the READI module, and MDO6 bit is logic `0'. 22:24 -- 25 PCSV Control the PPM module pads: MPIO32B14/PPM_RX0, MPIO32B15/PPM_TX0, MPWM2/PPM_TX1, MPWM3/PPM_RX1, MPIO32B10/PPM_TSYNC, MPIO32B13/PPM_TCLK. Refer to Table 2-8. Reserved Selects the voltage of the PPM pads. 0 The voltage will be 2.6 V. 1 The voltage will be 5 V. Reserved Reserved Selects the polarity of QSMCM module QSPI PCS signals in the PCS expanded mode. 0 Selects Active High. 1 Selects Active Low. MPC561/MPC563 Reference Manual, Rev. 1.2 2-24 Freescale Semiconductor Signal Descriptions Table 2-6. PDMCR2 Field Description (continued) Bits Name 26 PCS4EN1 Controls the pad B_T2CLK/PCS4. 0 B_T2CLK function will be selected. 1 PCS4 function will be selected. 27 PCS5EN Controls the pad A_T2CLK/PCS5. 0 A_T2CLK function will be selected. 1 PCS5 function will be selected. 28 PCS6EN Controls the pad ETRIG1/PCS6. 0 ETRIG1 function will be selected. 1 PCS6 function will be selected. 29 PCS7EN Controls the pad ETRIG2/PCS7. 0 ETRIG2 function will be selected. 1 PCS7 function will be selected. 30:31 -- 1 Description Reserved Refer to Table 2-9 for information regarding enhanced PCS functionality. Table 2-7. TCNC Pad Functionalities TCNC Values TXD2/QGPO2/ C_CNTX0 RXD2/QGPI2/ C_CNRX0 MPIO32B11/ C_CNRX0 MPIO32B12/ C_CNTX0 00 TXD2/QGPO2 RXD2/QGPI2 MPIO32B11 MPIO32B12 x1 TXD2/QGPO2 RXD2/QGPI2 C_CNRX0 C_CNTX0 10 C_CNTX0 C_CNRX0 MPIO32B11 MPIO32B12 Table 2-8. PPMPAD Pad Functionalities PPMPAD Values MPIO32B14/ PPM_RX0 MPIO32B15/ PPM_TX0 MPWM3/ PPM_RX1 MPWM2/ PPM_TX1 MPIO32B10/ PPM_TSYNC MPIO32B1/ PPM_TCLK x00 MPIO32B14 MPIO32B15 MPWM3 MPWM2 MPIO32B10 MPIO32B13 001 MPIO32B14 PPM_TX0 MPWM3 MPWM2 PPM_TSYNC PPM_TCLK 010 PPM_RX0 MPIO32B15 MPWM3 MPWM2 PPM_TSYNC PPM_TCLK 011 PPM_RX0 PPM_TX0 MPWM3 MPWM2 PPM_TSYNC PPM_TCLK 101 MPIO32B14 PPM_TX0 MPWM3 PPM_TX1 PPM_TSYNC PPM_TCLK 110 PPM_RX0 MPIO32B15 PPM_RX1 MPWM2 PPM_TSYNC PPM_TCLK 111 PPM_RX0 PPM_TX0 PPM_RX1 PPM_TX1 PPM_TSYNC PPM_TCLK Table 2-9. Enhanced PCS Functionality PCS_IN[3:0] PCS_OUT[7:0] IF PCSV = 0 PCS_OUT[7:0] IF PCSV = 1 0000 00000001 11111110 0001 00000010 11111101 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-25 Signal Descriptions Table 2-9. Enhanced PCS Functionality (continued) PCS_IN[3:0] PCS_OUT[7:0] IF PCSV = 0 PCS_OUT[7:0] IF PCSV = 1 0010 00000100 11111011 0011 00001000 11110111 0100 00010000 11101111 0101 00100000 11011111 0110 01000000 10111111 0111 10000000 01111111 1000 00000000 11111111 1001 RESERVED RESERVED 1010 1011 1100 1101 1110 1111 NOTE PCS_IN[3:0] are driven from the QSMCM module. PCS_OUT[7:0] values are driven by the corresponding PCS[7:0] pads. If all of the PCS enable bits PCS4EN, PCS5EN, PCS6EN and PCS7EN bits are zero, PCS[3:0] will be driven directly by the QSMCM module. If one or more of these enable bits is set, the enhanced PCS function is selected, and the enabled pads drive PCS_OUT[7:0] value, as shown in Table 2-9. Table 2-10 details the functionality of the A_T2CLK/PCS5 and B_T2CLK/PCS4 pads dependent on the values of PDMCR2[PCS5EN], PDMCR2[PCS4EN] and SHORT_REG [SH_T2CLK]. Also shown in this table is the internal connection of the TPU signals when the enhanced chip select function is used. Table 2-10. Enhanced PCS 4 & 5 Pad Function SHORT_REG A_T2CLK/PCS5 B_T2CLK/PCS4 [SH_T2CLK] PAD Function PAD Function A_T2CLK internal B_T2CLK internal TPU_A TPU_B Connection Connection PDMCR2 [PCS5EN] PDMCR2 [PCS4EN] 0 0 0 A_T2CLK B_T2CLK A_T2CLK/PCS5 Pad B_T2CLK/PCS4 Pad 0 0 1 A_T2CLK B_T2CLK A_T2CLK/PCS5 Pad A_T2CLK/PCS5 Pad 0 1 0 A_T2CLK PCS4 A_T2CLK/PCS5 Pad B_T2CLK Signal driven HI internally MPC561/MPC563 Reference Manual, Rev. 1.2 2-26 Freescale Semiconductor Signal Descriptions Table 2-10. Enhanced PCS 4 & 5 Pad Function SHORT_REG A_T2CLK/PCS5 B_T2CLK/PCS4 [SH_T2CLK] PAD Function PAD Function A_T2CLK internal B_T2CLK internal TPU_A TPU_B Connection Connection PDMCR2 [PCS5EN] PDMCR2 [PCS4EN] 0 1 1 A_T2CLK PCS4 A_T2CLK/PCS5 Pad A_T2CLK/PCS5 Pad 1 0 0 PCS5 B_T2CLK A_T2CLK Signal driven HI internally B_T2CLK/PCS4 Pad 1 0 1 PCS5 B_T2CLK A_T2CLK Signal B_T2CLK Signal driven HI internally driven HI internally by connection to A_T2CLK 1 1 0 PCS5 PCS4 A_T2CLK Signal B_T2CLK Signal driven HI internally driven HI internally 1 1 1 PCS5 PCS4 A_T2CLK Signal B_T2CLK Signal driven HI internally driven HI internally by connection to A_T2CLK 1. If PCS4/5EN = 1 then A/B_T2CLK into the module is pulled up internally (enabling Div/8 clock, in gate mode). 2. If only PCS4EN=1, then A_T2CLK can be driven into B_T2CLK if PPM_SHORT[SH_T2CLK] is set. 3. If only PCS5EN=1 then A_T2CLK will be pulled up, if PPM_SHORT[SH_T2CLK] is set, then, B_T2CLK will be high regardless of pin state. All of this is regardless of the Pull up/down state. Note: The PPM shorting function has higher priority logic. If shorting is selected, then A_T2CLK B_T2CLK. If A_T2CLK is selected as PCS then both A_T2CLK and B_T2CLK will be high regardless of B_T2CLK/PCS4 Pad state. Table 2-11 details the functionality of the ETRIG1/PCS6 and ETRIG2/PCS7 pads dependent on the values of PDMCR2[PCS6EN], PDMCR2[PCS7EN], SHORT_REG [SH_ET1] and SHORT_REG [SH_ET2]. Also shown in this table is the internal connection of the ETRIG signals when the enhanced chip select function is used. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-27 Signal Descriptions 2.5 MPC561/MPC563 Development Support Signal Sharing Table 2-11. Enhanced PCS 6 & 7 Pad Function PDMCR2 PDMCR2 PULL_ [PCS6EN] [PCS7EN] DIS5 SHORT_ SHORT_ ETRIG1/PCS6 ETRIG2/PCS7 REG REG PAD Function PAD Function [SH_ET1] [SH_ET2] Pad Pull-up ETRIG 1 internal connection ETRIG2 internal connection ETRIG1 ETRIG2 0 0 0 0 0 ETRIG1 ETRIG2 Enabled 0 0 0 1 1 ETRIG1 ETRIG2 Enabled A_TPUCH15 B_TPUCH15 0 0 1 0 0 ETRIG1 ETRIG2 Disabled 0 0 1 1 1 ETRIG1 ETRIG2 Disabled A_TPUCH15 B_TPUCH15 0 1 0 0 0 ETRIG1 PCS7 Enabled 0 1 0 1 1 ETRIG1 PCS7 Enabled A_TPUCH15 B_TPUCH15 0 1 1 0 0 ETRIG1 PCS7 Disabled 0 1 1 1 1 ETRIG1 PCS7 Disabled A_TPUCH15 B_TPUCH15 1 0 0 0 0 PCS6 ETRIG2 Enabled 1 0 0 1 1 PCS6 ETRIG2 Enabled A_TPUCH15 B_TPUCH15 1 0 1 0 0 PCS6 ETRIG2 Disabled 1 0 1 1 1 PCS6 ETRIG2 Disabled A_TPUCH15 B_TPUCH15 1 1 0 0 0 PCS6 PCS7 Enabled 1 1 0 1 1 PCS6 PCS7 Enabled A_TPUCH15 B_TPUCH15 1 1 1 0 0 PCS6 PCS7 Disabled 1 1 1 1 1 PCS6 PCS7 Disabled A_TPUCH15 B_TPUCH15 ETRIG1 ETRIG1 ETRIG1 PCS6 PCS6 PCS6 PCS6 ETRIG2 PCS7 PCS7 ETRIG2 ETRIG2 PCS7 PCS7 On the MPC561/MPC563, the JTAG, BDM, and READI (Nexus interface) signals are all shared. Only one set of signals can be active at a time. Table 2-12 shows the shared functions in the different modes. Table 2-12. MPC561/MPC563 Development Support Shared Signals Signal1 Direction JTAG BDM READI JCOMP/RSTI Input JCOMP 0 RSTI TCK/DSCK/MCKI Input TCK DSCK MCKI TDI/DSDI/MDI0 Input TDI DSDI MDI0 TDO/DSDO/MDO0 Output TDO DSDO MDO0 TMS/EVTI Input TMS -- EVTI 1 Only one set of signals are enabled at a time. MPC561/MPC563 Reference Manual, Rev. 1.2 2-28 Freescale Semiconductor Signal Descriptions Table 2-13. MPC561/MPC563 Mode Selection Options Signal State When Sampled Affect BDM Mode DSCK DSDI High SRESET negation BDM mode enabled Low SRESET negation BDM mode disabled High 8 clocks after SRESET Synchronous mode Low 8 clocks after SRESET Asynchronous mode Nexus Configuration EVTI MDI0 High RSTI negation READI module Disabled Low RSTI negation READI module Enabled High EVTI negation Full Port mode Low EVTI negation Reduced port mode JTAG Selection JCOMP 2.5.1 Low PORESET Nexus or BDM allowed High PORESET JTAG Mode Selected JTAG Mode Selection The MPC561/MPC563 has five JTAG signals. The test data input (TDI) and test data output (TDO) scan ports are used to scan instructions as well as data into the various scan registers for JTAG operations. The scan operation is controlled by the test access port (TAP) controller, which in turn is controlled by the test mode select (TMS) input sequence. The scan data is latched at the rising edge of the test clock (TCK). On the MPC561/MPC563, JTAG is used for boundary scan only. There is no access to internal MPC561/MPC563 circuitry. When JTAG mode is enabled, the READI module will be held inactive. See Figure 2-4 for JTAG mode selection. JTAG is entered by the following sequence of events: * Assert PORESET/TRST to reset the JTAG TAP controller * Hold JCOMP/RSTI high prior to PORESET/TRST negation and keep high as long as JTAG mode is required (The READI module will be held inactive since only one of the multiplexed functions JCOMP and RSTI can be asserted at the negation of PORESET/TRST). JTAG mode is exited by: * Drive JCOMP/RSTI low. NOTE PORESET/TRST and analog signals ANx, EXTAL, XTAL, and TDI/TDO/TMS/TCK are not in the JTAG scan path. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-29 Signal Descriptions PORESET/TRST JCOMP/RSTI JTAG Config JTAG On T JTAG Disabled Figure 2-4. Debug Mode Selection (JTAG) 2.5.2 BDM Mode Selection The MPC561/MPC563 has a 10 pin BDM port. See Figure 2-5 for BDM mode selection. The BDM mode is entered by the following sequence of events: * Hold DSCK high at reset negation (SRESET) * Configure DSDI to select BDM clock mode, within 8 clocks of reset negation BDM mode is exited by: * Reset the device by asserting PORESET/TRST or HRESET SRESET DSCK DSDI JCOMP/RSTI TMS/EVTI (low) (low) BDM Enable Configure BDM Enable Nexus BDM On Nexus Off T Figure 2-5. Debug Mode Selection (BDM) 2.5.3 Nexus Mode Selection The READI module signals support the Nexus (IEEE-ISTO 5001-1999) auxiliary port interface for debug. There are two modes available: full port mode and reduced port mode. Reduced port mode allows for a 1 bit input stream and a 2 bit output stream. Full port mode allows for a 2-bit input stream and an 8-bit output stream. If MDI0 is held high when Nexus mode is enabled, full port mode will be used during Nexus debug. If MDI0 is held low when Nexus mode is enabled, reduced port mode will be used. See Figure 2-6 for Nexus mode selection. The Nexus interface is entered by the following sequence of events: * Hold JCOMP/RSTI low while negating PORESET/TRST * Hold TMS/EVTI low to enable Nexus mode and configure TDI/DSDI/MDI0 for full or reduced port mode. Both of these should be done at least 4 clocks before driving JCOMP/RSTI high MPC561/MPC563 Reference Manual, Rev. 1.2 2-30 Freescale Semiconductor Signal Descriptions * Drive JCOMP/RSTI high Nexus mode is exited by: * Hold JCOMP/RSTI low to reset Nexus port * Hold TMS/EVTI high to disable Nexus mode at least 4 clocks before driving JCOMP/RSTI high * Drive JCOMP/RSTI high PORESET/TRST JCOMP/RSTI TMS/EVTI MDI0 T Enable and Configure Nexus Nexus On Nexus Off Figure 2-6. Debug Mode Selection (Nexus) 2.6 Reset State During reset, a 130-A (maximum) resistor "weakly pulls" all input signals, with the exception of the power-supply and clock-related signals, to a value based on conditions described in Appendix F, "Electrical Characteristics." In reset state, all I/O signals become inputs, and all outputs (except for CLKOUT, HRESET, and SRESET) are pulled only by the pull-up/pull-down. 2.6.1 Signal Functionality Configuration Out of Reset The reset configuration word (RCW) defines the post-reset functionality of some multiplexed signals. For details on these signals and how they are configured, refer to Section 7.5.2, "Hard Reset Configuration Word." The 2.6-V bus related signals have selectable output buffer drive strengths that are controlled by the COM0 bit in the USIU's system clock and reset control register (SCCR). The control is as follows: 0 = 2.6-V bus signals full drive (50-pF load) 1 = 2.6-V bus signals reduced drive (25-pF load) 2.6.2 Signal State During Reset While HRESET is asserted, the reset-configuration value is latched from the data bus into various bits on the part. The function of many signals depends upon the value latched. If the value on the data bus changes, then the function of various signals may also change. This is especially true if the reset configuration word (RCW) comes from the Flash, because the Flash does not drive the RCW until 256 clocks after the start of MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-31 Signal Descriptions HRESET. However, the signals must not cause any spurious conditions or consume an excessive amount of power during reset. To prevent these conditions, the signals need to have a defined reset state. Table 2-14 describes the reset state of the signals based on signal functionality. All signals are initialized to a "reset state" during reset. This state remains active until reset is negated or until software disables the pull-up or pull-down device based on the signal functionality. Upon assertion of the corresponding bits in the signal control registers and negation of reset, the signal acquires the functionality that was programmed. 2.6.3 Power-On Reset and Hard Reset Power-on reset and hard reset affect the functionality of the signals out of reset. (During soft reset, the functionality of the signals is unaltered.) Upon assertion of the power-on reset signal (PORESET/TRST) the functionality of the signal is not yet known to the RCPU. The weak pull-up or weak pull-down resistors are enabled. The reset configuration word configures the system, and towards the end of reset the signal functionality is known. Based upon the signal functionality, the pull-up or pull-down devices are either disabled immediately at the negation of reset or remain enabled, as shown in Table 2-14. Because hard reset can occur when a bus cycle is pending, the PDMCR bits that enable and disable the pull-up or pull-down resistors are set or reset synchronously to eliminate contention on the signals. (PORESET/TRST affects these bits asynchronously.) 2.6.4 2.6.4.1 Pull-Up/Pull-Down Pull-Up/Pull-Down Enable and Disable for 5-V Only and 2.6-V Only Signals The pull resistors are enabled and disabled by the corresponding bits in the PDMCR register in the USIU (see Table 2-14). When those bits are negated (logic 0), the pull resistors are enabled. When asserted (logic 1), the devices are disabled. 2.6.4.2 Pull-Down Enable and Disable for 5-V/2.6-V Multiplexed Signals The 5-V/2.6-V multiplexed pad does not have a pull-up device. The pull-down will be controlled by the corresponding bits in the PDMCR register. When this bit is negated, the pull-down is enabled, when asserted the pull-down will be disabled. NOTE All pull-up/pull-down devices are disabled when all the signals are forced to three state in JTAG mode. 2.6.4.3 Special Pull Resistor Disable Control Functionality (SPRDS) For the signals that support debug, opcode tracking, and bus control functionality, the pull resistors will be controlled by the SPRDS bit in the PDMCR register. During reset this signal will be synchronously used MPC561/MPC563 Reference Manual, Rev. 1.2 2-32 Freescale Semiconductor Signal Descriptions to enable the pull resistors in the pads. On negation of reset, based on which functionality is selected for the signals, this signal is set to disable the pull resistors, or is continued to be held in its reset state to indicate that the pulls are disabled only when the output driver is enabled. 2.6.4.4 Pull Device Select (PULL_SEL) The MIOS14 and the TPU signals have selectable pull-up or pull-down devices. The devices are controlled by the PULL_SEL signal. A high on the PULL_SEL signal enables pull-up devices on the MIOS14 and TPU signals. A low enables pull-down devices. Note that the pull devices can be disabled by the PULL_DIS0 (MIOS14) and PRDS (TPU) bits in the PDMCR register. See Section 2.3, "Pad Module Configuration Register (PDMCR)." 2.6.5 Signal Reset States Table 2-14 summarizes the reset states of all signals on the MPC561/MPC563. Note that PD refers to a weak pull-down, PU2.6 refers to a weak pull-up to 2.6 V, and PU5 refers to a weak pull-up to 5 V. All control of the weak-pull devices is in the pad module configuration register, described in Table 2-5. NOTE 2.6-V inputs are 5-V tolerant, but 2.6-V outputs are not. Do not connect 2.6-V outputs to a driver or pull-up greater than 3.1 V. NOTE Depending on the application, pins may require a pull-down resistor to avoid getting any command due to noise. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-33 Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 Reset State Hysteresi s Enabled? Function After HRESET, PORESET/TRST USIU ADDR[8:31]3/ 2.6 V No 50 ; 25 PD until reset negates4, 6 No SGPIOA[8:31] 5V Yes 50 ; 505 PD until PRDS is set No DATA[0:31]3/ 2.6 V No 50 ; 25 PD until reset negates6 No SGPIOD[0:31] 5V Yes 50:50 5 PD until PRDS is set No IRQ0 / 2.6 V No NA Yes SGPIOC07 / 2.6 V No 50 ; 25 PU2.6 until PRDS is set8 MDO4 7 2.6 V No 50 ; 25 IRQ1 / 2.6 V No NA PD until reset negates 6, 8 Yes RSV / 2.6 V No 50 ; 25 PD until reset negates 6 Yes SGPIOC1 3 5V Yes IRQ2 / 2.6 V No NA PD until reset negates 6, 8 Yes CR / 2.6 V No NA PD until reset negates 6, 8 No SGPIOC2 3 / 5V Yes MTS9 2.6 V No 50 ; 25 PD until reset negates 6 No IRQ3 / 2.6 V No NA PD until reset negates 6, 8 Yes KR / 2.6 V No 50 ; 25 PD when driver not enabled 4 No RETRY/ 2.6 V No 50 ; 25 PD when driver not enabled 4 No SGPIOC3 3 5V Yes 50 ; 50 5 PD until PRDS is set No Yes Controlled by SC bit in the reset config word. See Table 6-10. Controlled by SC bit in the reset config word. See Table 6-10. MDO4 if the Nexus (READI) port is enabled, IRQ0 otherwise. See Section 2.5. Yes 50 ; 50 5 PD until PRDS is set 50 ; 50 5 PD until PRDS is set IRQ1 Yes IRQ2 No IRQ3 MPC561/MPC563 Reference Manual, Rev. 1.2 2-34 Freescale Semiconductor Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 IRQ4 / 2.6 V No NA PD until reset negates 6, 8 Yes AT2 / 2.6 V No 50 ; 25 PD until reset negates 6, 8 No SGPIOC4 3 5V Yes IRQ510 / 2.6 V No NA SGPIOC5 7 / 2.6 V No 50 ; 25 MODCK111 2.6 V No IRQ[6:7] 10 / 2.6 V MODCK[2:3] 11 Reset State 50 ; 50 5 PD until PRDS is set Hysteresi s Enabled? Function After HRESET, PORESET/TRST IRQ4 Yes PU2.6 until reset negates Yes MODCK1 until reset negates, then IRQ5 PU2.6 until PRDS is set No NA PU2.6V until reset negates No No NA PU2.6 until SPRDS is set Yes 2.6 V No NA PU2.6 until reset negates No PULL_SEL 5V No NA PU5, external pull device required No PULL_SEL TSIZ[0:1] 7 2.6 V No 50 ; 25 PD when driver not enabled or until SPRDS is set No TSIZ[0:1] RD/WR 7 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set No RD/WR BURST 7 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set No BURST BDIP 7 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set No BDIP TS 7,12 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set No TS MODCK[2:3] until reset negates, then IRQ[6:7] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-35 Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 TA 7, 12 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set No TA TEA 7, 12 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set No TEA OE 7 2.6 V No 50 ; 25 PU2.6 until reset negates No OE RSTCONF / 2.6 V No N/A No RSTCONF until reset negates. TEXP 7, 11 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set BI 7, 12/ 2.6 V No 50 ; 25 STS 7 2.6 V No 50 ; 25 CS[0:3] 7 2.6 V No 50 ; 25 WE[0:3] 7/ 2.6 V No 50 ; 25 BE[0:3] 7/ 2.6 V No 50 ; 25 AT[0:3] 7 2.6 V No 50 ; 25 Reset State PU2.6 when driver not enabled or until SPRDS is set. Hysteresi s Enabled? Function After HRESET, PORESET/TRST No No No Controlled by DBGC in the reset configuration word. See Table 6-8. PU2.6 until reset negates No CS[0:3] PU2.6 when driver not enabled or until SPRDS is set No Controlled by bit ATWC (bit 12) of the reset configuration word. See Table 6-8. No No System Control PORESET/ 2.6 V No NA External pull-up required Yes TRST 11 2.6 V No NA HRESET 11, 12 2.6 V13 No SRESET 11, 12 2.6 V13 No PORESET/TRST 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set External pull-up required Yes HRESET 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set External pull-up required Yes SRESET Yes Development and Debug MPC561/MPC563 Reference Manual, Rev. 1.2 2-36 Freescale Semiconductor Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? SGPIOC6 3 / 5V Yes FRZ / 2.6 V No 50 ; 25 PD until reset negates No PTR 2.6 V No 50 ; 25 PD until reset negates No SGPIOC7 3/ 5V Yes IRQOUT / 2.6 V No 50 ; 25 PD until reset negates 6 No LWP0 2.6 V No 50 ; 25 PD until reset negates 6 No BG 7/ 2.6 V No 50 ; 25 No 2.6 V No 50 ; 25 2.6 V No 50 ; 25 PU2.6 when driver not enabled or until SPRDS is set BR 7/ 2.6 V No 50 ; 25 7/ 2.6 V No 50 ; 25 IWP2 7 2.6 V No 50 ; 25 2.6 V No 50 ; 25 VF2 7/ 2.6 V No 50 ; 25 7 2.6 V No 50 ; 25 IWP[0:1] 7/ 2.6 V No 50 ; 25 7 2.6 V No 50 ; 25 VF0 7/ 7 LWP1 VF1 BB 7, 12/ IWP3 VFLS[0:1] Drive Load (pF)2 Reset State 50 ; 50 5 PD until PRDS is set 50 ; 50 5 PD until PRDS is set PU2.6 when driver not enabled or until SPRDS is set PU2.6 when driver not enabled or until SPRDS is set PU2.6 until reset negates Hysteresi s Enabled? No Yes No Function After HRESET, PORESET/TRST PTR LWP0 Controlled by DBGC in reset config word. See Table 6-8. No No No Controlled by DBGC in reset config word. See Table 6-8. No No No Controlled by DBGC in reset config word. See Table 6-8. No No No Controlled by DBGC in the reset config word. See Table 6-8. JTAG/BDM/READI TMS / 2.6 V No NA EVTI 2.6 V No NA TDI / 2.6 V No NA DSDI / 2.6 V No NA MDI0 2.6 V No NA TCK / 2.6 V No NA DSCK / 2.6 V No NA MCKI 2.6 V No NA PU2.6 if in JTAG mode, otherwise PD until SPRDS is set14 No PU2.6 if in JTAG mode, otherwise PD until SPRDS is set 6 No PD until reset negates 6 No No No Yes Yes Yes TMS unless the Nexus (READI) port is enabled, then EVTI. See Section 2.5. DSDI unless the Nexus (READI) port (MDI0) or JTAG mode (TDI) is enabled. See Section 2.5. DSCK unless the Nexus (READI) port (MCKI) or JTAG mode (TCK) is enabled. See Section 2.5. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-37 Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 TDO 7 / 2.6 V No 50 ; 25 7 DSDO / 2.6 V No 50 ; 25 MDO0 7 2.6 V No 50 ; 25 JCOMP / 2.6 V No NA RSTI 2.6 V No NA Reset State PU2.6 until reset negates or the driver is enabled PD until SPRDS is set Hysteresi s Enabled? No Function After HRESET, PORESET/TRST No DSDO unless the Nexus (READI) port (MDO0) or JTAG mode (TDO) is enabled. See Section 2.5. No See Section 2.5. No No Clocks and PLL XTAL 11 2.6 V NA ; NA NA ; NA -- NA XTAL EXTAL 11 2.6 V NA ; NA NA ; NA -- NA EXTAL XFC 2.6 V NA ; NA NA ; NA -- NA XFC CLKOUT 7 2.6 V No 90; 50; 2515 -- No CLKOUT EXTCLK 11 2.6 V NA ; NA NA ; NA -- No EXTCLK 2.6 V / 5 V NA ; NA NA ; NA -- No ENGCLK (2.6 V) 2.6 V NA ; NA NA ; NA -- No ENGCLK 3/ BUCLK QSMCM PCS0 / 5V Yes 50 ; 50 SS / 5V Yes 50 ; 50 QGPIO0 5V Yes 50 ; 50 PCS[1:3]/ 5V Yes 50 ; 50 QGPIO[1:3] 5V Yes 50 ; 50 MISO / 5V Yes QGPIO4 5V Yes MOSI / 5V Yes QGPIO5 5V Yes SCK / 5V Yes QGPIO6 5V Yes TXD1 / 5V Yes 50 ; 50 QGPO1 5V Yes 50 ; 50 PU5 until PULL_DIS1 is set No QGPO0 No No PU5 until PULL_DIS1 is set No No 200 ; 50 5 PU5 until PULL_DIS1 is 200 ; 50 5 set No 200 ; 50 5 PU5 until PULL_DIS1 is 200 ; 50 5 set No 200 ; 50 5 PU5 until PULL_DIS1 is 200 ; 50 5 set No PU5 until PULL_DIS1 is set QGPIO[1:3] QGPIO4 No QGPIO5 No QGPIO6 No No QGPO1 No MPC561/MPC563 Reference Manual, Rev. 1.2 2-38 Freescale Semiconductor Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 TXD2 / 5V Yes 50 ; 50 QGPO2 / 5V Yes 50 ; 50 C_CNTX0 5V Yes 50 ; 50 RXD1 / 5V NA NA QGPI1 5V NA NA RXD2 / 5V NA NA QGPI2 / 5V NA NA C_CNRX0 5V NA NA Reset State PU5 until PULL_DIS1 is set Hysteresi s Enabled? No Function After HRESET, PORESET/TRST QGPO2 No No Must be driven or connected to a pull device No Must be driven or connected to a pull device No QGPI1 No QGPI2 No No MIOS14 MDA[11:15, 27:31] 5V Yes 50 ; 50 Pull device enabled until PULL_DIS0 is set16 Yes MDA[11:15,27:31] MPWM0 / 5V Yes 50 ; 50 Yes MDI1 2.6 V No NA Pull device enabled until PULL_DIS0 is set 16 MPWM0 unless the Nexus (READI) port is enabled, then MDI1. See Section 2.5. MPWM1 3 / 5V Yes 50 ; 50 Yes MDO2 2.6 V No 50 ; 25 Pull device enabled until PULL_DIS0 is set 16 No MPWM1 unless the Nexus (READI) port is enabled, then MDO2. See Section 2.5. MPWM23 / 5V Yes 50 ; 50 Yes MPWM2 2.6 V No 50 ; 25 PPM_TX1 5V Yes 50 ; 25 Pull device enabled until PULL_DIS0 is set 16 MPWM3/ 5V Yes 50 ; 50 Yes PPM_RX1 2.6 V No NA Pull device enabled until PULL_DIS0 is set 16 MPWM16 5V Yes 50 ; 50 Pull device enabled until PULL_DIS0 is set 16 Yes MPWM16 MPWM173 / 5V Yes 50 ; 50 Yes MDO3 2.6 V No 50 ; 25 Pull device enabled until PULL_DIS0 is set 16 MPWM17 unless the Nexus (READI) port is enabled. See Section 2.5. Yes No No MPWM3 Yes No MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-39 Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 MPWM[18:19]3 / 5V Yes 50 ; 50 MDO[6:7] 2.6 V No 50 ; 25 MPIO32B03 / 5V Yes VF0 / 2.6 V No 2.6 V No MDO1 3 Reset State Pull device enabled until PULL_DIS0 is set 16 Yes 50 ; 50 5 Pull device enabled until 50 ; 25 PULL_DIS0 is 16 50 ; 25 set. Yes 50 ; 50 5 MPIO32B1 / 5V Yes VF1/ 2.6 V No 50 ; 25 MCKO 2.6 V No 50 ; 25 MPIO32B23 / 5V Yes VF2 / 2.6 V No MSEI 2.6 V No Yes Yes VFLS0 / 2.6 V No 50 ; 25 MSEO 2.6 V No 50 ; 25 Yes VFLS1 2.6 V No MPIO32B53 / 5V Yes MDO5 2.6 V No MPIO32B63 / 5V Yes MPWM4 / 5V Yes MDO6 2.6 V Yes 50 ; 50 No No Pull device enabled until PULL_DIS0 is set16 Yes 50 ; 50 5 Pull device enabled until 50 ; 25 PULL_DIS0 is set 16 Yes 50 ; 50 5 Pull device enabled until 50 ; 50 PULL_DIS0 is 16 50 ; 25 set. Yes 50 ; 25 50 ; 50 5 MPIO32B[7:9] / 5V Yes MPWM[5, 20:21] 5V Yes MPIO32B103 / 5V Yes PPM_TSYNC 2.6 V No 5V Yes MPIO32B11 / 5V Yes 50 ; 50 C_CNRX0 5V Yes NA 50 ; 50 Pull device enabled until PULL_DIS0 is set 16 50 ; 50 5 Pull device enabled until 50 ; 25 PULL_DIS0 is 16 50 ; 50 set PU5 until PULL_DIS0 is set MPIO32B1 unless the Nexus (READI) port is enabled, then MCKO. See Section 2.5. MPIO32B2 unless the Nexus (READI) port is enabled, then MSEI. See Section 2.5. Yes Yes 50 ; 50 MPIO32B0 unless the Nexus (READI) port is enabled, then MDO1. See Section 2.5. No Pull device enabled until PULL_DIS0 is set.16 5 MPWM[18:19] No 50 ; 50 5 Pull device enabled until 50 ; 25 PULL_DIS0 is set.16 N/A 5V 5V No Yes 5 Function After HRESET, PORESET/TRST No Pull device enabled until PULL_DIS0 is set.16 MPIO32B33 / MPIO32B43 / Hysteresi s Enabled? No MPIO32B3 unless the Nexus (READI) port is enabled, then MSEO. See Section 2.5. No MPIO32B4 No No Yes MPIO32B5 unless the Nexus (READI) port is enabled, then MDO5. See Section 2.5. MPIO32B6 unless the Nexus (READI) port is enabled, then MDO6. See Section 2.5. No Yes MPIO32B[7:9] Yes Yes MPIO32B10 No Yes MPIO32B11 No MPC561/MPC563 Reference Manual, Rev. 1.2 2-40 Freescale Semiconductor Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? MPIO32B12 / 5V Yes C_CNTX0 5V Yes MPIO32B133 / 5V Yes PPM_TCLK 2.6 V No 5V Yes MPIO32B14 / 5V Yes PPM_RX0 2.6 V No 5V No MPIO32B153 / 5V Yes PPM_TX0 2.6 V No 5V Yes Drive Load (pF)2 Reset State Hysteresi s Enabled? 50 ; 50 5 PU5 until PULL_DIS0 is 50 ; 50 set Yes 50 ; 50 5 Pull device enabled until 50 ; 25 PULL_DIS0 is 16 50 ; 50 set Yes 50 ; 50 5 Pull device enabled until NA PULL_DIS0 is set 16 NA Yes 50 ; 50 5 Pull device enabled until 50 ; 25 PULL_DIS0 is 16 50 ; 50 set Function After HRESET, PORESET/TRST MPIO32B12 No MPIO32B13 No No MPIO32B14 Yes Yes Yes MPIO32B15 No No TPU_A / TPU_B 50 ; 50 5 Pull device enabled until PRDS is set 16 A_TPUCH[0:15 ] 5V Yes A_T2CLK / 5V Yes 50 ; 50 PCS5 5V Yes 50 ; 50 B_TPUCH[0:15 ] 5V Yes B_T2CLK / 5V Yes 50 ; 50 PCS4 5V Yes 50 ; 50 PU5 when driver not enabled or until T2CLK_PU is set 50 ; 50 5 Pull device enabled until PRDS is set 16 PU5 when driver not enabled or until T2CLK_PU is set Yes A_TPUCH[0:15] Yes A_T2CLK No Yes B_TPUCH[0:15] Yes B_T2CLK No QADC64E_A / QADC64E_B ETRIG[1:2] / 5V Yes N/A PD until PULL_DIS5 is set Yes PCS[6:7] 5V Yes 50 ; 50 PU5 until PULL_DIS1 is set Yes A_AN0 / 5V Yes NA A_ANw / 5V Yes A_PQB0 5V Yes PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set No ETRIG[1:2] A_AN0 No Yes MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-41 Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 A_AN1 / 5V Yes NA A_ANx / 5V Yes A_PQB1 5V Yes A_AN2 / 5V Yes A_ANy / 5V Yes A_PQB2 5V Yes A_AN3 / 5V Yes A_ANz / 5V Yes A_PQB3 5V Yes A_AN[48:51]/ 5V Yes A_PQB[4:7] 5V Yes A_AN[52:54] / 5V Yes A_MA[0:2] / 5V Yes A_PQA[0:2] 5V Yes A_AN[55:59]/ 5V Yes A_PQA[3:7] 5V Yes B_AN0 / 5V Yes B_ANw / 5V Yes B_PQB0 5V Yes B_AN1 / 5V Yes B_ANx / 5V Yes B_PQB1 5V Yes B_AN2 / 5V Yes B_ANy / 5V Yes B_PQB2 5V Yes Reset State PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set NA PU5 when driver not enabled or NA until 50 ; 50 5 PULL_DIS2 is set NA PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set NA PU5 when driver not enabled or 50 ; 50 5 until PULL_DIS2 is set NA PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set NA PU5 when driver not enabled or 50 ; 50 5 until PULL_DIS2 is set NA PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set NA PU5 when driver not enabled or NA until 50 ; 50 5 PULL_DIS2 is set NA PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set Hysteresi s Enabled? No Function After HRESET, PORESET/TRST A_AN1 No Yes No A_AN2 No Yes No A_AN3 No Yes No A_AN[48:51] Yes No A_AN[52:54] Yes Yes No A_AN[55:59] Yes No B_AN0 No Yes No B_AN1 No Yes No B_AN2 No Yes MPC561/MPC563 Reference Manual, Rev. 1.2 2-42 Freescale Semiconductor Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 B_AN3 / 5V Yes NA B_ANz / 5V Yes B_PQB3 5V Yes B_AN[48:51]/ 5V Yes B_PQB[4:7] 5V Yes B_AN[52:54]/ 5V Yes B_MA[0:2]/ 5V Yes B_PQA[0:2] 5V Yes B_AN[55:59]/ 5V Yes B_PQA[3:7] 5V Yes Reset State PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set NA PU5 when driver not enabled or 50 ; 50 5 until PULL_DIS2 is set NA PU5 when driver not enabled or NA until 5 PULL_DIS2 is 50 ; 50 set NA PU5 when driver not enabled or 50 ; 50 5 until PULL_DIS2 is set Hysteresi s Enabled? No Function After HRESET, PORESET/TRST B_AN3 No Yes No B_AN[48:51] Yes No B_AN[52:54] Yes Yes No B_AN[55:59] Yes TouCAN_A / TouCAN_B A_CNTX0 5V Yes 50 ; 50 17 PU5 until PULL_DIS3 is set No A_CNTX0 B_CNTX0 5V Yes 50 ; 50 17 PU5 until PULL_DIS3 is set No B_CNTX0 A_CNRX0 5V No NA PU5 until PULL_DIS3 is set Yes A_CNRX0 B_CNRX0 5V No NA PU5 until PULL_DIS3 is set Yes B_CNRX0 UC3F Flash EPEE18 2.6 V No -- PU2.6 No EPEE B0EPEE18 2.6 V No -- PU2.6 No B0EPEE UC3F Power Supplies VFLASH 18 5V -- -- -- -- VFLASH VDDF 18 2.6 V -- -- -- -- VDDF VSSF 18 0V -- -- -- -- VSSF MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-43 Signal Descriptions Table 2-14. MPC561/MPC563 Signal Reset State (continued) Signal List1 Voltage Slew Rate Controlled Option? Drive Load (pF)2 Reset State Hysteresi s Enabled? Function After HRESET, PORESET/TRST Global Power Supplies NVDDL 2.6 V -- -- -- -- NVDDL VDDH 5V -- -- -- -- VDDH VDD 2.6 V -- -- -- -- VDDI VSS 0V -- -- -- -- VSS KAPWR 11 2.6 V -- -- -- -- KAPWR IRAMSTBY19 2.6 V -- -- -- -- IRAMSTBY QVDDL 2.6 V -- -- -- -- QVDDL USIU Power Supplies VDDSYN 2.6 V -- -- -- -- VDDSYN VSSSYN 2.6 V -- -- -- -- VSSSYN QADC64E Power Supplies VRH 5V -- -- -- -- VRH VRL 0V -- -- -- -- VRL ALTREF 5V -- -- -- -- ALTREF VDDA 5V -- -- -- -- VDDA VSSA 0V -- -- -- -- VSSA 1 This column contains only the list of signals and should not be confused with the actual pin name. For actual pin names, see Appendix F, "Electrical Characteristics." 2 For 5-V outputs, the left hand value represents slew rate control off, and the right hand value represents slew rate control on. For 2.6-V outputs, the left hand value represents loads that are full drive, and the right hand value represents loads that are half drive. 3 Care should be taken that neither a pull-up to greater than 3.1 V or an external output that can drive greater than 3.1 V is connected to this pin while the 2.6-V driver is enabled. 4 Pull-up/pull-down is active when pin is defined as an input and/or during reset, therefore, output enable is negated. This also means that external pull-up/pull-down is NOT required unless specified. 5 For this 5-V output, a drive load of 200 pf is possible but with a rise/fall time of 300 ns. 6 During reset, the output enable to the pad driver is negated and the PD is active. After reset is negated, the PD is disabled. 7 2.6-V outputs cannot be connected to a pull-up or driver greater than 3.1 V. 8 This pin requires a pull-up to 2.6 V if interrupts are ever enabled for this IRQ input. 9 This signal also includes the MDO5 function on the K27S mask set of the MPC561. 10 The MODCK[1:3] are shared functions with IRQ[5:7]. If IRQ[5:7] are used as interrupts, the interrupt source should be removed during PORESET/TRST to insure the MODCK pins are in the correct state on the rising edge of PORESET/TRST. 11 These pins are powered by KAPWR (keep-alive power supply). Any pull-ups on these pins should pull-up to KAPWR. MPC561/MPC563 Reference Manual, Rev. 1.2 2-44 Freescale Semiconductor Signal Descriptions 12 An external pull-up is required in order to negate the signal in the appropriate time. This pin is 5-V tolerant. 14 This signal was PD only until SPRDS is set on mask set K27S of the MPC561. 15 These values represent full drive, half drive and quarter drive. 16 Whether the Pull device is a pull-up or a pull-down is determined by the state of the PULL_SEL signal. 17 For this 5-V output, a drive load of 200 pf is possible, but will have a rise/fall time of 100ns. 18 MPC563 only, no connection on MPC561. 19 IRAMSTBY is the input to an approximately 1.7V voltage regulator. It should be connected through a resistor to a standby power supply. 13 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 2-45 Signal Descriptions MPC561/MPC563 Reference Manual, Rev. 1.2 2-46 Freescale Semiconductor Chapter 3 Central Processing Unit The RISC processor (RCPU) used in the MPC500 family of microcontrollers integrates five independent execution units: an integer unit (IU), a load/store unit (LSU), a branch processing unit (BPU), a floating-point unit (FPU) and an integer multiplier divider (IMD). The RISC's use of simple instructions with rapid execution times yields high efficiency and throughput for PowerPC ISA-based systems. Most integer instructions execute in one clock cycle. Instructions can complete out of order for increased performance; however, the processor makes execution appear sequential. This section provides an overview of the RCPU. For a detailed description of this processor, refer to the RCPU Reference Manual. The following sections describe each block and sub-block. 3.1 RCPU Block Diagram Figure 3-1 provides a block diagram of the RCPU. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-1 Central Processing Unit RCPU FPU FPR History L-DATA FPR (32 X 64) Load/Store Floating Data Load/ Store Integer Data L-ADDR Load/ Store Address Control Bus Instruction Sequencer Instruction Pre-fetch Queue GPR History Branch Processor Unit GPR (32 X 32) I-ADDR Next Address Generation (4 slots/clock) IMUL/ IDIV Source Buses I-DATA ALU/ BFU Control Regs Write Back Bus 2 slots/clock Figure 3-1. RCPU Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 3-2 Freescale Semiconductor Central Processing Unit 3.2 RCPU Key Features Major features of the RCPU include: * High-performance microprocessor -- Single clock-cycle execution for many instructions * Five independent execution units and two register files -- Independent LSU for load and store operations -- BPU featuring static branch prediction -- A 32-bit integer unit (IU) -- Fully IEEE 754-compliant FPU for both single- and double-precision operations except as noted in Section 3.4.4, "Floating-Point Unit (FPU)," or refer to the RCPU Reference Manual. -- 32 general-purpose registers (GPRs) for integer operands -- 32 floating-point registers (FPRs) for single- or double-precision operands * Facilities for enhanced system performance -- Atomic memory references * In-system testability and debugging features * High instruction and data throughput -- Condition register (CR) look-ahead operations performed by BPU -- Branch-folding capability during execution (zero-cycle branch execution time) -- Programmable static branch prediction on unresolved conditional branches -- A pre-fetch queue that can hold up to four instructions, providing look-ahead capability -- Interlocked pipelines with feed-forwarding that control data dependencies in hardware * Class code compression model support -- Efficient use of internal Flash (MPC564) and external Flash (MPC562/MPC564) by increasing code density up to 100% 3.3 Instruction Sequencer The instruction sequencer provides centralized control over data flow between execution units and register files. It implements the basic instruction pipeline, fetches instructions from the memory system, issues them to available execution units, and maintains a state history that is used to back up the machine in the event of an exception. The instruction sequencer fetches instructions from the burst buffer controller into the instruction pre-fetch queue. The BPU extracts branch instructions from the pre-fetch queue and, using branch prediction on unresolved conditional branches, allows the instruction sequencer to fetch instructions from a predicted target stream while a conditional branch is evaluated. The BPU folds out branch instructions for unconditional or conditional branches unaffected by instructions in the execution stage. Instructions issued beyond a predicted branch do not complete execution until the branch is resolved, preserving the programming model of sequential execution. If branch prediction is incorrect, the instruction unit flushes all predicted path instructions, and instructions are issued from the correct path. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-3 Central Processing Unit Instruction Memory System 32 Instruction Buffer Instruction Address Generator 32 Branch Condition Evaluation Instruction Pre-fetch Queue Read Write Buses CC unit 32 Execution Units and Registers Files Figure 3-2. Sequencer Data Path 3.4 Independent Execution Units The PowerPC ISA architecture provides independent floating-point, integer, load/store, and branch processing execution units, making it possible to implement advanced features such as look-ahead operations. For example, since branch instructions do not depend on GPRs, branches can often be resolved early, eliminating stalls caused by taken branches. Table 3-1 summarizes the RCPU execution units. Table 3-1. RCPU Execution Units Unit Branch processing unit (BPU) Load/store unit (LSU) Description Includes the implementation of all branch instructions. Includes implementation of all load and store instructions, whether defined as part of the integer processor or the floating-point processor. MPC561/MPC563 Reference Manual, Rev. 1.2 3-4 Freescale Semiconductor Central Processing Unit Table 3-1. RCPU Execution Units (continued) Unit Description Integer unit (IU) Includes implementation of all integer instructions except load/store instructions. This module includes the GPRs (including GPR history and scoreboard) and the following subunits: the IMUL-IDIV, which includes the implementation of the integer multiply and divide instructions and the ALU-BFU, which includes implementation of all integer logic, add and subtract instructions, and bit field instructions. Floating-point unit (FPU) Includes the FPRs (including FPR history and scoreboard) and the implementation of all floating-point instructions except load/store floating-point instructions. The following sections describe these execution units in greater detail. 3.4.1 Branch Processing Unit (BPU) The BPU, located within the instruction sequencer, performs condition register look-ahead operations on conditional branches. The BPU looks through the instruction queue for a conditional branch instruction and attempts to resolve it early, achieving the effect of a zero-cycle branch in many cases. The BPU uses a bit in the instruction encoding to predict the direction of the conditional branch. Therefore, when it encounters an unresolved conditional branch instruction, the processor pre-fetches instructions from the predicted target stream until the conditional branch is resolved. The BPU uses a calculation feature to compute branch target addresses with three special-purpose, user-accessible registers: the link register (LR), the count register (CTR), and the condition register (CR). The BPU calculates the return pointer for a subroutine, then calls and saves it into the LR. The LR also contains the branch target address for the branch conditional to link register (bclrx) instruction. The CTR contains the branch target address for the branch conditional to count register (bcctrx) instruction. The contents of the LR and CTR can be copied to or from any GPR. Because the BPU uses dedicated registers rather than general-purpose or floating-point registers, execution of branch instructions is independent from execution of integer instructions. The CR bits indicate conditions that may result from the execution of relevant instructions. 3.4.2 Integer Unit (IU) The IU executes all integer processor instructions (except the integer storage access instructions) implemented by the load/store unit. The IU contains the following subunits: * The IMUL-IDIV unit, which implements the integer multiply and divide instructions * The Arithmetic Logic Unit (ALU)-BFU unit, which implements all integer logic, add, subtract, and bit-field instructions The IU also includes the integer exception register (XER) and the general-purpose register file. IMUL-IDIV and ALU-BFU are implemented as separate execution units. The ALU-BFU unit can execute one instruction per clock cycle. IMUL-IDIV instructions require multiple clock cycles to execute. IMUL-IDIV is pipelined for multiply instructions, so that consecutive multiply instructions can be issued MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-5 Central Processing Unit on consecutive clock cycles. Divide instructions are not pipelined; an integer divide instruction preceded or followed by an integer divide or multiply instruction results in a processor-pipeline stall. However, since IMUL-IDIV and ALU-BFU are implemented as separate execution units, an integer divide instruction preceded or followed by an ALU-BFU instruction does not cause a delay in the pipeline. 3.4.3 Load/Store Unit (LSU) The load/store unit handles all data transfer between the general-purpose register file and the internal load/store bus (L-bus). The load/store unit is implemented as an independent execution unit so that stalls in the memory pipeline do not stall the master instruction pipeline (unless there is a data dependency). The unit is fully pipelined so that memory instructions of any size may be issued on back-to-back cycles. There is a 32-bit wide data path between the load/store unit and the general-purpose register file. Single-word accesses can be achieved with an internal on-chip data RAM, resulting in a two-clock latency. Double-word accesses require two clocks, resulting in a three-clock latency. Since the L-bus is 32 bits wide, double-word transfers require two bus accesses. The load/store unit performs zero-fill for byte and half-word transfers and sign extension for half-word transfers. Addresses are formed by adding the source-one register operand specified by the instruction (or zero) to either a source-two register operand or to a 16-bit, immediate value embedded in the instruction. 3.4.4 Floating-Point Unit (FPU) The FPU contains a double-precision multiply array, the floating-point status and control register (FPSCR), and the FPRs. The multiply-add array allows the RCPU to efficiently implement floating-point operations such as multiply, multiply-add, and divide. The RCPU depends on a software envelope to fully implement the IEEE floating-point specification. Overflows, underflows, NaNs (not a number), and denormalized numbers cause floating-point assist exceptions that invoke a software routine to deliver (with hardware assistance) the correct IEEE result. To accelerate time-critical operations and make them more deterministic, the RCPU provides a mode of operation that avoids invoking a software envelope and attempts to deliver results in hardware that are adequate for most applications, if not in strict compliance with IEEE standards. In this mode, denormalized numbers, NaNs, and IEEE invalid operations are legitimate, returning default results rather than causing floating-point assist exceptions. 3.5 Levels of the PowerPC ISA Architecture The PowerPC ISA architecture consists of three levels: * User instruction set architecture (UISA) -- defines the base user-level instruction set, user-level registers, data types, floating-point exception model, memory models for a uniprocessor environment, and programming model for a uniprocessor environment. * Virtual environment architecture (VEA) -- describes the memory model for a multiprocessor environment, and describes other aspects of virtual environments. Implementations that conform to the VEA also adhere to the UISA, but may not necessarily adhere to the OEA. MPC561/MPC563 Reference Manual, Rev. 1.2 3-6 Freescale Semiconductor Central Processing Unit * Operating environment architecture (OEA) -- defines the memory-management model, supervisor-level registers, synchronization requirements, and the exception model. Implementations that conform to the OEA also adhere to the UISA and the VEA. Adherence to the PowerPC ISA architecture can be measured in terms of which of the levels are implemented. 3.6 RCPU Programming Model The PowerPC ISA architecture defines register-to-register operations for most computational instructions. Source operands for these instructions are accessed from the registers or are embedded in the instruction opcode. The three-register instruction format allows specification of a target register distinct from the two source operands. Load and store instructions transfer data between memory and on-chip registers. PowerPC ISA-compliant processors have two levels of privilege: supervisor mode (typically used by the operating environment) and user mode (used by the application software). The programming model incorporates 32 GPRs, special-purpose registers (SPRs), and several miscellaneous registers. Supervisor-level access is provided through the processor's exception mechanism. That is, when an exception is taken (whether automatically, because of an error or problem that needs to be serviced, or deliberately, as in the case of a trap instruction), the processor begins operating in supervisor mode. The access level is indicated by the privilege-level (PR) bit in the machine state register (MSR). Figure 3-3 illustrates the user-level and supervisor-level RCPU programming models and the three levels of the PowerPC ISA architecture. Note that registers such as the general-purpose registers (GPRs) are accessed through operands that are part of the instructions. Registers can be accessed explicitly through specific instructions such as move to special-purpose register (mtspr) or move from special-purpose register (mftspr), or implicitly as part of an instruction's execution. Some registers are accessed both explicitly and implicitly. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-7 Central Processing Unit SUPERVISOR MODEL OEA USER MODEL UISA Machine State Register FPR0 FPR1 MSR 0 31 Supervisor-Level SPRs FPR31 63 0 GPR0 GPR1 See Table 3-2 for list of supervisor-level SPRs. Condition Register CR 0 GPR31 0 31 31 0 Development Support SPRs 31 Floating-Point Status and Control Register See Table 3-3 for list of development-support SPRs. FPSCR 0 31 0 User-Level SPRs 31 Integer Exception Register (XER) Link Register (LR) Count Register (CTR) 31 0 USER MODEL VEA Time Base Facility (for Reading) Time Base Lower - Read (TBL) Time Base Upper - Read (TBU) Figure 3-3. RCPU Programming Model MPC561/MPC563 Reference Manual, Rev. 1.2 3-8 Freescale Semiconductor Central Processing Unit Table 3-2 lists the MPC561/MPC563 supervisor-level registers; refer also to Chapter 6, "System Configuration and Protection," Chapter 11, "L-Bus to U-Bus Interface (L2U)," and Chapter 4, "Burst Buffer Controller 2 Module," for more information. Table 3-2. Supervisor-Level SPRs SPR Number (Decimal) Special-Purpose Register 18 DAE/Source Instruction Service Register (DSISR) See Section 3.9.2, "DAE/Source Instruction Service Register (DSISR)," for bit descriptions. 19 Data Address Register (DAR) See Section 3.9.3, "Data Address Register (DAR)," for bit descriptions. 22 Decrementer Register (DEC) See Section 6.1.6, "Decrementer (DEC)." for bit descriptions. 26 Save and Restore Register 0 (SRR0) See Section 3.9.6, "Machine Status Save/Restore Register 0 (SRR0)," for bit descriptions. 27 Save and Restore Register 1 (SRR1) See Section 3.9.7, "Machine Status Save/Restore Register 1 (SRR1)," for bit descriptions. 80 External Interrupt Enable (EIE)1 See Section 3.9.10.1, "EIE, EID, and NRI Special-Purpose Registers." 81 External Interrupt Disable (EID)1 See Section 3.9.10.1, "EIE, EID, and NRI Special-Purpose Registers." 82 Non-Recoverable Interrupt (NRI)1 See Section 3.9.10.1, "EIE, EID, and NRI Special-Purpose Registers." 272 SPR General 0 (SPRG0)1 See Section 3.9.8, "General SPRs (SPRG0-SPRG3)," for bit descriptions. 273 SPR General 1 (SPRG1)1 See Section 3.9.8, "General SPRs (SPRG0-SPRG3)," for bit descriptions. 274 SPR General 2 (SPRG2) See Section 3.9.8, "General SPRs (SPRG0-SPRG3)," for bit descriptions. 275 SPR General 3 (SPRG3) See Section 3.9.8, "General SPRs (SPRG0-SPRG3)," for bit descriptions. 284 Time Base Lower - Write (TBL) See Section 6.1.7, "Time Base (TB)." 285 Time Base Upper - Write (TBU) See Section 6.1.7, "Time Base (TB)." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-9 Central Processing Unit Table 3-2. Supervisor-Level SPRs (continued) SPR Number (Decimal) Special-Purpose Register 287 Processor Version Register (PVR) See Table 3-14 for bit descriptions. 528 IMPU Global Region Attribute (MI_GRA)1 See Table 4-8 for bit descriptions. 536 L2U Region Attribute (L2U_GRA) See Table 11-10 for bit descriptions. 560 BBC Module Configuration Register (BBC_MCR)1 See Table 4-4 for bit descriptions. 568 L2U Module Configuration Register (L2U_MCR)1 See Table 11-7 for bit descriptions. 784 L2U Region Base Address Register 0 (L2U_RBA0)1 See Table 4-5 for bit descriptions. 785 IMPU Region Base Address Register 1 (MI_RBA1)1 See Table 4-5 for bits descriptions. 786 IMPU Region Base Address Register 2 (MI_RBA2)1 See Table 4-5 for bits descriptions. 787 IMPU Region Base Address Register 3 (MI_RBA3)1 See Table 4-5 for bits descriptions. 816 IMPU Region Attribute Register 0 (MI_RA0)1. See Table 4-6 for bits descriptions. 817 IMPU Region Attribute Register 1 (MI_RA1)1. See Table 4-6 for bits descriptions. 818 IMPU Region Attribute Register 2 (MI_RA2)1. See Table 4-6 for bits descriptions. 819 IMPU Region Attribute Register 3(MI_RA3)1. See Table 4-6 for bits descriptions. 792 L2U Region Base Address Register 0 (L2U_RBA0)1 See Table 11-8 for bit descriptions. 793 L2U Region Base Address Register 1 (L2U_RBA1)1 See Table 11-8 for bit descriptions. 794 L2U Region Base Address Register 2 (L2U_RBA2)1 See Table 11-8 for bit descriptions. 795 L2U Region Base Address Register 3 (L2U_RBA3)1 See Table 11-8 for bit descriptions. 824 L2U Region Attribute Register 0 (L2U_RA0)1 See Table 11-9 for bit descriptions. 825 L2U Region Attribute Register 1 (L2U_RA1)1 See Table 11-9 for bit descriptions. 826 L2U Region Attribute Register 2 (L2U_RA2)1 See Table 11-9 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 3-10 Freescale Semiconductor Central Processing Unit Table 3-2. Supervisor-Level SPRs (continued) SPR Number (Decimal) 1 Special-Purpose Register 827 L2U Region Attribute Register 3 (L2U_RA3)1 See Table 11-9 for bit descriptions. 1022 Floating-Point Exception Cause Register (FPECR)1 See Section 3.9.10.2, "Floating-Point Exception Cause Register (FPECR)," for bit descriptions. Implementation-specific SPR, not defined by the PowerPC ISA architecture. Table 3-3 lists the RCPU SPRs used for development support. Table 3-3. Development Support SPRs1 SPR Number (Decimal) Special-Purpose Register 144 Comparator A Value Register (CMPA) See Table 23-17 for bit descriptions. 145 Comparator B Value Register (CMPB) See Table 23-17 for bit descriptions. 146 Comparator C Value Register (CMPC) See Table 23-17 for bit descriptions. 147 Comparator D Value Register (CMPD) See Table 23-17 for bit descriptions. 148 Exception Cause Register (ECR) See Table 23-18 for bit descriptions. 149 Debug Enable Register (DER) See Table 23-19 for bit descriptions. 150 Breakpoint Counter A Value and Control (COUNTA) See Table 23-20 for bit descriptions. 151 Breakpoint Counter B Value and Control (COUNTB) See Table 23-21 for bit descriptions. 152 Comparator E Value Register (CMPE) See Table 23-22 for bit descriptions. 153 Comparator F Value Register (CMPF) See Table 23-22 for bit descriptions. 154 Comparator G Value Register (CMPG) See Table 23-23 for bit descriptions. 155 Comparator H Value Register (CMPH) See Table 23-23 for bit descriptions. 156 L-bus Support Comparators Control 1 (LCTRL1) See Table 23-24 for bit descriptions. 157 L-bus Support Comparators Control 2 (LCTRL2) See Table 23-25 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-11 Central Processing Unit Table 3-3. Development Support SPRs1 (continued) SPR Number (Decimal) 1 Special-Purpose Register 158 I-bus Support Control Register (ICTRL) See Table 23-26 for bit descriptions. 159 Breakpoint Address Register (BAR) See Table 23-28 for bit descriptions. 630 Development Port Data Register (DPDR) See Section 23.6.13, "Development Port Data Register (DPDR)," for bit descriptions. All development-support SPRs are implementation-specific. Unless otherwise noted, reserved fields should be written with a zero when written and return zero when read. An exception to this rule is XER[16:23]; see Section 3.7.5, "Integer Exception Register (XER)." These bits are set to the value written to them and return that value when read. 3.7 User Instruction Set Architecture (UISA) Register Set The UISA registers can be accessed by either user- or supervisor-level instructions. The general-purpose registers are accessed through instruction operands. 3.7.1 General-Purpose Registers (GPRs) Integer data is manipulated in the integer unit's thirty-two 32-bit GPRs, shown below. These registers are accessed as source and destination registers through operands in the instruction syntax. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 GPR0 GPR1 ... ... GPR31 Reset Unchanged Figure 3-4. General-Purpose Registers (GPRs) 3.7.2 Floating-Point Registers (FPRs) The PowerPC ISA architecture provides 32 64-bit FPRs. These registers are accessed as source and destination registers through operands in floating-point instructions. Each FPR supports the double-precision, floating-point format. Every instruction that interprets the contents of an FPR as a MPC561/MPC563 Reference Manual, Rev. 1.2 3-12 Freescale Semiconductor Central Processing Unit floating-point value does so using the double-precision floating-point format. Therefore, all floating-point numbers are stored in double-precision format. All floating-point arithmetic instructions operate on data located in FPRs and, with the exception of the compare instructions (which update the CR), place the result into an FPR. Information about the status of floating-point operations is placed into the floating-point status and control register (FPSCR) and in some cases, after the completion of the operation's writeback stage, into the CR. For information on how the CR is affected by floating-point operations, see Section 3.7.4, "Condition Register (CR)." MSB LSB 0 63 FPR0 FPR1 ... ... FPR31 Reset Unchanged Figure 3-5. Floating-Point Registers (FPRs) 3.7.3 Floating-Point Status and Control Register (FPSCR) The FPSCR controls the handling of floating-point exceptions and records status resulting from the floating-point operations. FPSCR[0:23] are status bits. FPSCR[24:31] are control bits. FPSCR[0:12] and FPSCR[21:23] are floating-point exception condition bits. These bits are sticky, except for the floating-point enabled exception summary (FEX) and floating-point invalid operation exception summary (VX). Once set, sticky bits remain set until they are cleared by an mcrfs, mtfsfi, mtfsf, or mtfsb0 instruction. Table 3-4 summarizes which bits in the FPSCR are sticky status bits, which are normal status bits, and which are control bits. Table 3-4. FPSCR Bit Categories Bits [0], [3:12], [21:23] [1:2], [13:20] [24:31] Type Status, sticky Status, not sticky Control FEX and VX are the logical ORs of other FPSCR bits. Therefore these two bits are not listed among the FPSCR bits directly affected by the various instructions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-13 Central Processing Unit MSB 0 1 2 Field FX FEX VX 3 4 5 6 OX UX ZX XX 7 13 14 15 VXSN VXISI VXIDI VXZDZ VXIMZ VXVC FR AN FI FPRF0 Reset 8 9 10 11 12 Unchanged LSB 16 Field 17 18 FPRF[1:4] 19 20 0 21 22 23 VX VX VXCVI SOFT SQRT Reset 24 25 26 27 28 29 VE OE UE ZE XE NI 30 31 RN Unchanged Figure 3-6. Floating-Point Status and Control Register (FPSCR) A listing of FPSCR bit settings is shown in Table 3-5. Table 3-5. FPSCR Bit Descriptions Bits Name Description 0 FX Floating-point exception summary. Every floating-point instruction implicitly sets FPSCR[FX] if that instruction causes any of the floating-point exception bits in the FPSCR to change from 0 to 1. The mcrfs instruction implicitly clears FPSCR[FX] if the FPSCR field containing FPSCR[FX] has been copied. The mtfsf, mtfsfi, mtfsb0, and mtfsb1 instructions can set or clear FPSCR[FX] explicitly. Sticky bit 1 FEX Floating-point enabled exception summary. This bit signals the occurrence of any of the enabled exception conditions. It is the logical OR of all the floating-point exception bits masked with their respective enable bits. The mcrfs instruction implicitly clears FPSCR[FEX] if the result of the logical OR described above becomes zero. The mtfsf, mtfsfi, mtfsb0, and mtfsb1 instructions cannot set or clear FPSCR[FEX] explicitly. Not sticky 2 VX Floating-point invalid operation exception summary. This bit signals the occurrence of any invalid operation exception. It is the logical OR of all of the invalid operation exceptions. The mcrfs instruction implicitly clears FPSCR[VX] if the result of the logical OR described above becomes zero. The mtfsf, mtfsfi, mtfsb0, and mtfsb1 instructions cannot set or clear FPSCR[VX] explicitly. Not sticky 3 OX Floating-point overflow exception. Sticky bit 4 UX Floating-point underflow exception. Sticky bit 5 ZX Floating-point zero divide exception. Sticky bit 6 XX Floating-point inexact exception. Sticky bit 7 VXSNAN Floating-point invalid operation exception for SNaN. Sticky bit 8 VXISI Floating-point invalid operation exception for - . Sticky bit 9 VXIDI Floating-point invalid operation exception for /. Sticky bit 10 VXZDZ Floating-point invalid operation exception for 0/0. Sticky bit 11 VXIMZ Floating-point invalid operation exception for x 0. Sticky bit MPC561/MPC563 Reference Manual, Rev. 1.2 3-14 Freescale Semiconductor Central Processing Unit Table 3-5. FPSCR Bit Descriptions (continued) Bits Name 12 VXVC 13 Description Floating-point invalid operation exception for invalid compare. Sticky bit FR Floating-point fraction rounded. The last floating-point instruction that potentially rounded the intermediate result incremented the fraction. Not sticky 14 FI Floating-point fraction inexact. The last floating-point instruction that potentially rounded the intermediate result produced an inexact fraction or a disabled exponent overflow. Not sticky [15:19] FPRF Floating-point result flags. This field is based on the value placed into the target register even if that value is undefined. Refer to Table 3-6 for specific bit settings. 15 Floating-point result class descriptor (C). Floating-point instructions other than the compare instructions may set this bit with the FPCC bits, to indicate the class of the result. 16-19 Floating-point condition code (FPCC). Floating-point compare instructions always set one of the FPCC bits to one and the other three FPCC bits to zero. Other floating-point instructions may set the FPCC bits with the C bit, to indicate the class of the result. Note that in this case the high-order three bits of the FPCC retain their relational significance indicating that the value is less than, greater than, or equal to zero. 16 Floating-point less than or negative (FL or <) 17 Floating-point greater than or positive (FG or >) 18 Floating-point equal or zero (FE or =) 19 Floating-point unordered or NaN (FU or ?) Not sticky 20 -- 21 VXSOFT Floating-point invalid operation exception for software request. This bit can be altered only by the mcrfs, mtfsfi, mtfsf, mtfsb0, or mtfsb1 instructions. The purpose of VXSOFT is to allow software to cause an invalid operation condition for a condition that is not necessarily associated with the execution of a floating-point instruction. For example, it might be set by a program that computes a square root if the source operand is negative. Sticky bit 22 VXSQRT Floating-point invalid operation exception for invalid square root. This guarantees that software can simulate fsqrt and frsqrte, and can provide a consistent interface to handle exceptions caused by square root operations. Sticky bit 23 VXCVI Floating-point invalid operation exception for invalid integer convert. Sticky bit 24 VE Floating-point invalid operation exception enable. -- 25 OE Floating-point overflow exception enable. -- 26 UE Floating-point underflow exception enable. This bit should not be used to determine whether denormalization should be performed on floating-point stores. -- 27 ZE Floating-point zero divide exception enable. -- 28 XE Floating-point inexact exception enable. -- Reserved -- MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-15 Central Processing Unit Table 3-5. FPSCR Bit Descriptions (continued) Bits Name Description 29 NI Non-IEEE mode bit. -- 30-31 RN Floating-point rounding control. 00 Round to nearest 01 Round toward zero 10 Round toward +infinity 11 Round toward -infinity -- Table 3-6 illustrates the floating-point result flags that correspond to FPSCR[15:19]. Table 3-6. Floating-Point Result Flags in FPSCR 3.7.4 Result Flags (Bits 15:19) C<>=? Result Value Class 10001 Quiet NaN 01001 - Infinity 01000 - Normalized number 11000 - Denormalized number 10010 - Zero 00010 + Zero 10100 + Denormalized number 00100 + Normalized number 00101 + Infinity Condition Register (CR) The condition register (CR) is a 32-bit register that reflects the result of certain operations and provides a mechanism for testing and branching. The bits in the CR are grouped into eight 4-bit fields: CR0 to CR7. MSB 0 Field Reset LSB 1 CR0 2 3 4 5 6 CR1 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 CR2 CR3 CR4 CR5 CR6 31 CR7 Unchanged Figure 3-7. Condition Register (CR) The CR fields can be set in the following ways: * Specified fields of the CR can be set by an instruction (mtcrf) to move to the CR from a GPR. * Specified fields of the CR can be moved from one CRx field to another with the mcrf instruction. * A specified field of the CR can be set by an instruction (mcrxr) to move to the CR from the XER. * Condition register logical instructions can be used to perform logical operations on specified bits in the condition register. * CR0 can be the implicit result of an integer operation. MPC561/MPC563 Reference Manual, Rev. 1.2 3-16 Freescale Semiconductor Central Processing Unit * A specified CR field can be the explicit result of an integer compare instruction. Instructions are provided to test individual CR bits. 3.7.4.1 Condition Register CR0 Field Definition In most integer instructions, when the CR is set to reflect the result of the operation (that is, when Rc = 1), and for addic., andi., and andis., the first three bits of CR0 are set by an algebraic comparison of the result to zero; the fourth bit of CR0 is copied from XER[SO]. For integer instructions, CR0[0:3] are set to reflect the result as a signed quantity. The EQ bit reflects the result as an unsigned quantity or bit string. The CR0 bits are interpreted as shown in Table 3-7. If any portion of the result (the 32-bit value placed into the destination register) is undefined, the value placed in the first three bits of CR0 is undefined. Table 3-7. Bit Settings for CR0 Field of CR CR0 Bit Description 0 Negative (LT). This bit is set when the result is negative. 1 Positive (GT). This bit is set when the result is positive (and not zero). 2 Zero (EQ). This bit is set when the result is zero. 3 Summary overflow (SO). This is a copy of the final state of XER[SO] at the completion of the instruction. 3.7.4.2 Condition Register CR1 Field Definition In all floating-point instructions when the CR is set to reflect the result of the operation (that is, when Rc = 1), the CR1 field (bits 4 to 7 of the CR) is copied from FPSCR[0:3] to indicate the floating-point exception status. For more information about the FPSCR, see Section 3.7.3, "Floating-Point Status and Control Register (FPSCR)." The bit settings for the CR1 field are shown in Table 3-8. Table 3-8. Bit Settings for CR1 Field of CR CR1 Bit Description 0 Floating-point exception (FX). This is a copy of the final state of FPSCR[FX] at the completion of the instruction. 1 Floating-point enabled exception (FEX).This is a copy of the final state of FPSCR[FEX] at the completion of the instruction. 2 Floating-point invalid exception (VX).This is a copy of the final state of FPSCR[VX] at the completion of the instruction. 3 Floating-point overflow exception (OX).This is a copy of the final state of FPSCR[OX] at the completion of the instruction. 3.7.4.3 Condition Register CRn Field -- Compare Instruction When a specified CR field is set by a compare instruction, the bits of the specified field are interpreted as shown in Table 3-9. A condition register field can also be accessed by the mfcr, mcrf, and mtcrf instructions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-17 Central Processing Unit Table 3-9. CRn Field Bit Settings for Compare Instructions 1 CRn Bit1 Description 0 Less than, floating-point less than (LT, FL). For integer compare instructions, (rA) < SIMM, UIMM, or (rB) (algebraic comparison) or (rA) SIMM, UIMM, or (rB) (logical comparison). For floating-point compare instructions, (frA) < (frB). 1 Greater than, floating-point greater than (GT, FG). For integer compare instructions, (rA) > SIMM, UIMM, or (rB) (algebraic comparison) or (rA) SIMM, UIMM, or (rB) (logical comparison). For floating-point compare instructions, (frA) > (frB). 2 Equal, floating-point equal (EQ, FE). For integer compare instructions, (rA) = SIMM, UIMM, or (rB). For floating-point compare instructions, (frA) = (frB). 3 Summary overflow, floating-point unordered (SO, FU). For integer compare instructions, this is a copy of the final state of XER[SO] at the completion of the instruction. For floating-point compare instructions, one or both of (frA) and (frB) is not a number (NaN). Here, the bit indicates the bit number in any one of the four-bit subfields, CR0-CR7 3.7.5 Integer Exception Register (XER) The integer exception register (XER), SPR 1, is a user-level, 32-bit register. MSB 0 LSB 1 2 3 4 Field SO OV CA Reset 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 -- Unchanged Addr 5 31 BYTES 00_0000_0000_0000_0000_0 Unchanged SPR 1 Figure 3-8. Integer Exception Register (XER) The bit descriptions for XER, shown in Table 3-10, are based on the operation of an instruction considered as a whole, not on intermediate results. For example, the result of the subtract from carrying (subfcx) instruction is specified as the sum of three values. This instruction sets bits in the XER based on the entire operation, not on an intermediate sum. In most cases, reserved fields in registers are ignored when written to and return zero when read. However, XER[16:23] are set to the value written to them and return that value when read. Table 3-10. Integer Exception Register Bit Descriptions Bits Name Description 0 SO Summary Overflow (SO). The summary overflow bit is set whenever an instruction sets the overflow bit (OV) to indicate overflow and remains set until software clears it. It is not altered by compare instructions or other instructions that cannot overflow. 1 OV Overflow (OV). The overflow bit is set to indicate that an overflow has occurred during execution of an instruction. Integer and subtract instructions having OE=1 set OV if the carry out of bit 0 is not equal to the carry out of bit 1, and clear it otherwise. The OV bit is not altered by compare instructions or other instructions that cannot overflow. MPC561/MPC563 Reference Manual, Rev. 1.2 3-18 Freescale Semiconductor Central Processing Unit Table 3-10. Integer Exception Register Bit Descriptions Bits Name Description 2 CA Carry (CA). In general, the carry bit is set to indicate that a carry out of bit 0 occurred during execution of an instruction. Add carrying, subtract from carrying, add extended, and subtract from extended instructions set CA if there is a carry out of bit 0, and clear it otherwise. The CA bit is not altered by compare instructions or other instructions that cannot carry, except that shift right algebraic instructions set the CA bit to indicate whether any `1' bits have been shifted out of a negative quantity. 3:24 -- Reserved 25:31 BYTES 3.7.6 This field specifies the number of bytes to be transferred by a Load String Word Indexed (lswx) or Store String Word Indexed (stswx) instruction. Link Register (LR) The link register (LR), SPR 8, supplies the branch target address for the branch conditional to link register (bclrx) instruction, and can be used to hold the logical address of the instruction that follows a branch and link instruction. Note that although the two least-significant bits can accept any values written to them, they are ignored when the LR is used as an address. Both conditional and unconditional branch instructions include the option of placing the effective address of the instruction after the branch instruction in the LR. This is done regardless of whether the branch is taken. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field Branch Address Reset Unchanged Addr SPR 8 31 Figure 3-9. Link Register (LR) 3.7.7 Count Register (CTR) The count register (CTR), SPR 9, is used to hold a loop count that can be decremented during execution of branch instructions with an appropriately coded BO field. If the value in CTR is 0 before being decremented, it is -1 afterward. The count register provides the branch target address for the branch conditional to count register (bcctrx) instructio MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field Loop Count Reset Unchanged Addr SPR 9 31 Figure 3-10. Count Register (CTR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-19 Central Processing Unit 3.8 VEA Register Set -- Time Base (TB) The virtual environment architecture (VEA) defines registers in addition to the UISA register set. The VEA register set can be accessed by all software with either user- or supervisor-level privileges. Refer to Section 6.1.7, "Time Base (TB)," for more information. 3.9 OEA Register Set The operating environment architecture (OEA) includes a number of SPRs and other registers that are accessible only by supervisor-level instructions. Some SPRs are RCPU-specific; some RCPU SPRs may not be implemented in other PowerPC ISA processors, or may not be implemented in the same way. 3.9.1 Machine State Register (MSR) The machine state register is a 32-bit register that defines the state of the processor. When an exception occurs, the contents of the MSR are loaded into SRR1, and the MSR is updated to reflect the exception-processing machine state. The MSR can also be modified by the mtmsr, sc, and rfi instructions. It can be read by the mfmsr instruction. 11 MSB 0 1 2 3 4 5 Field 6 7 8 9 10 11 12 -- SRESET 13 14 15 POW 0 ILE 0000_0000_0000_0000 LSB 16 Field EE 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 PR FP ME FE0 SE BE FE1 -- IP IR DR -- DCMPEN RI LE 1 SRESET 000 U 0000_0 ID12 000 X3 00 Figure 3-11. Machine State Register (MSR) 1 This bit is available only on code compression-enabled options of the MPC561/MPC563. The reset value is a reset configuration word value extracted from the internal bus line. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." 3 The reset value is defined by the equation "BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]". At HRESET the BBCMCR[EN_COMP] and BBCMCR[EXC_COMP] bits recieve their values from RCW bits 21 and 22. The BBCMCR does not change at SRESET. Thus the DCMPEN reset value may be different on SRESET and HRESET, if software changes these BBCMCR bits from their reset values. 2 Table 3-11 shows the bit definitions for the MSR. Table 3-11. Machine State Register Bit Descriptions Bits Name 0:12 -- 13 POW Description Reserved Power management enable. 0 Power management disabled (normal operation mode) 1 Power management enabled (reduced power mode) MPC561/MPC563 Reference Manual, Rev. 1.2 3-20 Freescale Semiconductor Central Processing Unit Table 3-11. Machine State Register Bit Descriptions (continued) Bits Name Description 14 -- Reserved 15 ILE Exception little-endian mode. When an exception occurs, this bit is copied into MSR[LE] to select the endian mode for the context established by the exception. Little-endian mode is not supported on the MPC561/MPC563. This bit should be cleared to 0 at all times. 0 The processor runs in big-endian mode during exception processing. 1 The processor runs in little-endian mode during exception processing. 16 EE External interrupt enable. Interrupts should only be negated while the EE bit is disabled (0). Software should disable interrupts (EE = 0) in the RCPU before clearing or masking any interrupt source from the USIU or external pins. For external interrupts, it is recommended that the edge-triggered interrupt scheme be used. See Section 6.1.4, "Enhanced Interrupt Controller." 0 The processor delays recognition of external interrupts and decrementer exception conditions. 1 The processor is enabled to take an external interrupt or the decrementer exception. 17 PR Privilege level. 0 The processor can execute both user- and supervisor-level instructions. 1 The processor can only execute user-level instructions. 18 FP Floating-point available. 0 The processor prevents dispatch of floating-point instructions, including floating-point loads, stores and moves. Floating-point enabled program exceptions can still occur and the FPRs can still be accessed. 1 The processor can execute floating-point instructions, and can take floating-point enabled exception type program exceptions. 19 ME Machine check enable. 0 Machine check exceptions are disabled. 1 Machine check exceptions are enabled. 20 FE0 Floating-point exception mode 0 (See Table 3-12.) 21 SE Single-step trace enable. 0 The processor executes instructions normally. 1 The processor generates a single-step trace exception when the next instruction executes successfully. When this bit is set, the processor dispatches instructions in strict program order. Successful execution means the instruction caused no other exception. 22 BE Branch trace enable. 0 No trace exception occurs when a branch instruction is completed. 1 Trace exception occurs when a branch instruction is completed. 23 FE1 Floating-point exception mode 1 (See Table 3-12). 24 -- Reserved 25 IP Exception prefix. The setting of this bit specifies the location of the exception vector table. 0 Exception vector table starts at the physical address 0x0000 0000. 1 Exception vector table starts at the physical address 0xFFF0 0000. 26 IR Instruction relocation. 0 Instruction address translation is off; the BBC IMPU does not check for address permission attributes. 1 Instruction address translation is on; the BBC IMPU checks for address permission attributes. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-21 Central Processing Unit Table 3-11. Machine State Register Bit Descriptions (continued) Bits Name 27 DR Data relocation. 0 Data address translation is off; the L2U DMPU does not check for address permission attributes. 1 Data address translation is on; the L2U DMPU checks for addressn permission attributes. 28 -- Reserved 29 Description DCMPEN Decompression On/Off. The reset value of this bit is (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]). Note: This bit should not be set for the MPC561/MPC563. 0 The RCPU runs in normal operation mode. 1 The RCPU runs in compressed mode. Note: MSR[DCMPEN] should not be changed by software by a direct MSR register write (MTMSR instruction). It can be changed only by the RFI instruction or by an exception. 30 RI Recoverable exception (for machine check and non-maskable breakpoint exceptions). 0 Machine state is not recoverable. 1 Machine state is recoverable. 31 LE Little-endian mode. This mode is not supported on MPC561/MPC563. This bit should be cleared to 0 at all times. 0 The processor operates in big-endian mode during normal processing. 1 The processor operates in little-endian mode during normal processing. The floating-point exception mode bits are interpreted as shown in Table 3-12. Table 3-12. Floating-Point Exception Mode Bits FE[0:1] Mode 00 Ignore exceptions mode. Floating-point exceptions do not cause the floating-point assist error handler to be invoked. 01, 10, 11 3.9.2 Floating-point precise mode. The system floating-point assist error handler is invoked precisely at the instruction that caused the enabled exception. DAE/Source Instruction Service Register (DSISR) The DSISR, SPR 18, identifies the cause of data access and alignment exceptions. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field DSISR Reset Unchanged Addr SPR 18 31 Figure 3-12. DAE/Source Instruction Service Register (DSISR) For more information about bit settings, see Section 3.15.4.2, "Machine Check Exception (0x0200)," Section 3.15.4.6, "Alignment Exception (0x00600)," and Section 3.15.4.15, "Implementation-Specific Data Protection Error Exception (0x1400)." MPC561/MPC563 Reference Manual, Rev. 1.2 3-22 Freescale Semiconductor Central Processing Unit 3.9.3 Data Address Register (DAR) After an alignment exception, the DAR, SPR 19, is set to the effective address of a load or store element. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field Data Address Reset Unchanged Addr SPR 19 31 Figure 3-13. Data Address Register (DAR) 3.9.4 Time Base Facility (TB) -- OEA Refer to Section 6.1.7, "Time Base (TB)," for information. 3.9.5 Decrementer Register (DEC) Refer to Section 6.1.6, "Decrementer (DEC)," for information. 3.9.6 Machine Status Save/Restore Register 0 (SRR0) The machine status save/restore register 0 (SRR0), SPR 26, identifies where instruction execution should resume when an rfi instruction is executed following an exception. It also holds the effective address of the instruction that follows the system call (sc) instruction. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field SRR0 Reset Undefined Addr SPR 26 31 Figure 3-14. Machine Status Save/Restore Register 0 (SRR0) When an exception occurs, SRR0 is set to point to an instruction such that all prior instructions have completed execution and no subsequent instruction has begun execution. The instruction addressed by SRR0 may not have completed execution, depending on the exception type. SRR0 addresses either the instruction causing the exception or the instruction immediately following. The instruction addressed can be determined from the exception type and status bits. 3.9.7 Machine Status Save/Restore Register 1 (SRR1) The machine status save/restore register 1 (SRR1), SPR 27, saves the machine status on exceptions and restores the machine status when an rfi instruction is executed. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-23 Central Processing Unit MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field SRR1 Reset Undefined Addr SPR 27 31 Figure 3-15. Machine Status Save/Restore Register 1 (SRR1) In general, when an exception occurs, SRR1[0:15] are loaded with exception-specific information, and MSR[16:31] are placed into SRR1[16:31]. 3.9.8 General SPRs (SPRG0-SPRG3) SPRG0-SPRG3, SPRs 272-275, are provided for general operating system use, such as fast-state saves and multiprocessor-implementation support. SPRG0-SPRG3 are shown below. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 SPRG0 SPRG1 SPRG2 SPRG3 Reset Unchanged Figure 3-16. SPRG0-SPRG3 -- General Special-Purpose Registers 0-3 Uses for SPRG0-SPRG3 are shown in Table 3-13. Table 3-13. Uses of SPRG0-SPRG3 Register Description SPRG0 Software may load a unique physical address in this register to identify an area of memory reserved for use by the exception handler. This area must be unique for each processor in the system. SPRG1 This register may be used as a scratch register by the exception handler to save the content of a GPR. That GPR then can be loaded from SPRG0 and used as a base register to save other GPRs to memory. SPRG2 This register may be used by the operating system as needed. SPRG3 This register may be used by the operating system as needed. MPC561/MPC563 Reference Manual, Rev. 1.2 3-24 Freescale Semiconductor Central Processing Unit 3.9.9 Processor Version Register (PVR) The PVR is a 32-bit, read-only register that identifies the version and revision level of the processor. The contents of the PVR can be copied to a GPR by the mfspr instruction. Read access to the PVR is available in supervisor mode only; write access is not provided. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field VERSION REVISION Reset 0000_0000_0000_0010 0000_0000_0010_0000 Addr 31 SPR 287 Figure 3-17. Processor Version Register (PVR) Table 3-14. Processor Version Register Bit Descriptions Bits Name Description 0:15 VERSION A 16-bit number that identifies the version of the PowerPC ISA processor. The RCPU value is 0x0002. 16:31 REVISION A 16-bit number that distinguishes between various releases of a particular version. The RCPU value is 0x0020. 3.9.10 Implementation-Specific SPRs The MPC561/MPC563 includes several implementation-specific SPRs that are not defined by the PowerPC ISA architecture. These registers, listed in Table 3-2 and Table 3-3, can be accessed by supervisor-level instructions only. 3.9.10.1 EIE, EID, and NRI Special-Purpose Registers The RCPU includes three implementation-specific SPRs that facilitate the software manipulation of the MSR[RI] and MSR[EE] bits: External Interrupt Enable (EIE), External Interrupt Disable (EID), and Non-recoverable Interrupt (NRI). Issuing the mtspr instruction with one of these registers as an operand causes the RI and EE bits to be set or cleared as shown in Table 3-15. Table 3-15. EIE, EID, AND NRI Registers SPR Number (Decimal) Mnemonic MSR[EE] MSR[RI] 80 EIE 1 1 81 EID 0 1 82 NRI 0 0 A read (mfspr) of any of these locations is treated as an unimplemented instruction, resulting in a software emulation exception. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-25 Central Processing Unit 3.9.10.2 Floating-Point Exception Cause Register (FPECR) The FPECR, SPR 1022, is a supervisor-level internal status and control register used by the user's floating-point assist software envelope. It contains four status bits that indicate whether the result of the operation is tiny and whether any of three source operands are denormalized. In addition, it contains one control bit to enable or disable SIE mode. This register must not be accessed by user code. MSB 0 1 2 3 4 5 6 7 8 Field SIE 9 10 11 12 13 14 26 27 28 29 30 15 -- SRESET 0000_0000_0000_0000 LSB 16 17 18 Field 19 20 21 22 23 24 25 -- SRESET DNC DNB DNA 31 TR 0000_0000_0000_0000 Addr SPR 1022 Figure 3-18. Floating-Point Exception Cause Register (FPECR) A listing of FPECR bit settings is shown in Table 3-16. Table 3-16. FPECR Bit Descriptions Bits Name Description 0 SIE 1:27 -- 28 DNC Source operand C denormalized status bit. 0 Source operand C is not denormalized 1 Source operand C is denormalized 29 DNB Source operand B denormalized status bit. 0 Source operand B is not denormalized 1 Source operand B is denormalized 30 DNA Source operand A denormalized status bit. 0 Source operand A is not denormalized 1 Source operand A is denormalized 31 TR Synchronized ignore exception mode control bit. 0 Disable SIE mode 1 Enable SIE mode Reserved Floating-point tiny result. 0 Floating-point result is not tiny 1 Floating-point result is tiny NOTE Software must insert a sync instruction before reading the FPECR. MPC561/MPC563 Reference Manual, Rev. 1.2 3-26 Freescale Semiconductor Central Processing Unit 3.9.10.3 Additional Implementation-Specific Registers Refer to the following sections for details on additional implementation-specific registers in the MPC561/MPC563: * Section 4.6, "BBC Programming Model" * Section 6.2.2.1.2, "Internal Memory Map Register (IMMR)" * Section 11.8, "L2U Programming Model" * Chapter 23, "Development Support" 3.10 Instruction Set All PowerPC ISA instructions are encoded as single words (32 bits) and are consistent among all instruction types. The fixed instruction length and consistent format simplify instruction pipelining and permit efficient decoding to occur in parallel with operand accesses. The PowerPC ISA instructions are divided into the following categories: * Integer instructions, which include computational and logical instructions -- Integer arithmetic instructions -- Integer compare instructions -- Integer logical instructions -- Integer rotate and shift instructions * Floating-point instructions, which include floating-point computational instructions, as well as instructions that affect the floating-point status and control register (FPSCR) -- Floating-point arithmetic instructions -- Floating-point multiply/add instructions -- Floating-point rounding and conversion instructions -- Floating-point compare instructions -- Floating-point status and control instructions * Load/store instructions., which include integer and floating-point load and store instructions -- Integer load and store instructions -- Integer load and store multiple instructions -- Floating-point load and store -- Primitives used to construct atomic memory operations (lwarx and stwcx. instructions) * Flow control instructions, which include branching instructions, condition register logical instructions, trap instructions, and other instructions that affect the instruction flow -- Branch and trap instructions -- Condition register logical instructions * Processor control instructions, which are used for synchronizing memory accesses. -- Move to/from SPR instructions -- Move to/from MSR MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-27 Central Processing Unit -- Synchronize -- Instruction synchronize NOTE This grouping of the instructions does not indicate which execution unit executes a particular instruction or group of instructions. Integer instructions operate on byte, half-word, and word operands. Floating-point instructions operate on single-precision (one word) and double-precision (one double word) floating-point operands. The PowerPC ISA architecture uses instructions that are four bytes long and word-aligned. It provides for byte, half-word, and word operand loads and stores between memory and a set of 32 GPRs. Computational instructions do not modify memory. To use a memory operand in a computation and then modify the same or another memory location, the memory contents must be loaded into a register, modified, and then written back to the target location with distinct instructions. PowerPC ISA-compliant processors follow the program flow when they are in the normal execution state. However, the flow of instructions can be interrupted directly by the execution of an instruction or by an asynchronous event. Either kind of exception may cause one of several components of the system software to be invoked. 3.10.1 Instruction Set Summary Table 3-17 provides a summary of RCPU instructions. Refer to the RCPU Reference Manual for a detailed description of the instruction set. Table 3-17. Instruction Set Summary Mnemonic Operand Syntax Name add (add. addo addo.) rD,rA,rB Add addc (addc. addco addco.) rD,rA,rB Add Carrying adde (adde. addeo addeo.) rD,rA,rB Add Extended addi rD,rA,SIMM Add Immediate addic rD,rA,SIMM Add Immediate Carrying addic. rD,rA,SIMM Add Immediate Carrying and Record addis rD,rA,SIMM Add Immediate Shifted addme (addme. addmeo addmeo.) rD,rA Add to Minus One Extended addze (addze. addzeo addzeo.) rD,rA Add to Zero Extended and (and.) rA,rS,rB AND andc (andc.) rA,rS,rB AND with Complement andi. rA,rS,UIMM AND Immediate andis. rA,rS,UIMM AND Immediate Shifted b (ba bl bla) target_addr Branch MPC561/MPC563 Reference Manual, Rev. 1.2 3-28 Freescale Semiconductor Central Processing Unit Table 3-17. Instruction Set Summary (continued) Mnemonic Operand Syntax Name bc (bca bcl bcla) BO,BI,target_addr Branch Conditional bcctr (bcctrl) BO,BI Branch Conditional to Count Register bclr (bclrl) BO,BI Branch Conditional to Link Register cmp crfD,L,rA,rB Compare cmpi crfD,L,rA,SIMM Compare Immediate cmpl crfD,L,rA,rB Compare Logical cmpli crfD,L,rA,UIMM Compare Logical Immediate cntlzw (cntlzw.) rA,rS Count Leading Zeros Word crand crbD,crbA,crbB Condition Register AND crandc crbD,crbA, crbB Condition Register AND with Complement creqv crbD,crbA, crbB Condition Register Equivalent crnand crbD,crbA,crbB Condition Register NAND crnor crbD,crbA,crbB Condition Register NOR cror crbD,crbA,crbB Condition Register OR crorc crbD,crbA, crbB Condition Register OR with Complement crxor crbD,crbA,crbB Condition Register XOR divw (divw. divwo divwo.) rD,rA,rB Divide Word divwu divwu. divwuo divwuo. rD,rA,rB Divide Word Unsigned eieio -- Enforce In-Order Execution of I/O eqv (eqv.) rA,rS,rB Equivalent extsb (extsb.) rA,rS Extend Sign Byte extsh (extsh.) rA,rS Extend Sign Half Word fabs (fabs.) frD,frB Floating Absolute Value fadd (fadd.) frD,frA,frB Floating Add (Double-Precision) fadds (fadds.) frD,frA,frB Floating Add Single fcmpo crfD,frA,frB Floating Compare Ordered fcmpu crfD,frA,frB Floating Compare Unordered fctiw (fctiw.) frD,frB Floating Convert to Integer Word fctiwz (fctiwz.) frD,frB Floating Convert to Integer Word with Round Toward Zero fdiv (fdiv.) frD,frA,frB Floating Divide (Double-Precision) fdivs (fdivs.) frD,frA,frB Floating Divide Single fmadd (fmadd.) frD,frA,frC,frB Floating Multiply-Add (Double-Precision) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-29 Central Processing Unit Table 3-17. Instruction Set Summary (continued) Mnemonic Operand Syntax Name fmadds (fmadds.) frD,frA,frC,frB Floating Multiply-Add Single fmr (fmr.) frD,frB Floating Move Register fmsub (fmsub.) frD,frA,frC,frB Floating Multiply-Subtract (Double-Precision) fmsubs (fmsubs.) frD,frA,frC,frB Floating Multiply-Subtract Single fmul (fmul.) frD,frA,frC Floating Multiply (Double-Precision) fmuls (fmuls.) frD,frA,frC Floating Multiply Single fnabs (fnabs.) frD,frB Floating Negative Absolute Value fneg (fneg.) frD,frB Floating Negate fnmadd (fnmadd.) frD,frA,frC,frB Floating Negative Multiply-Add (DoublePrecision) fnmadds (fnmadds.) frD,frA,frC,frB Floating Negative Multiply-Add Single fnmsub (fnmsub.) frD,frA,frC,frB Floating Negative Multiply-Subtract (Double-Precision) fnmsubs (fnmsubs.) frD,frA,frC,frB Floating Negative Multiply-Subtract Single frsp (frsp.) frD,frB Floating Round to Single fsub (fsub.) frD,frA,frB Floating Subtract (Double-Precision) fsubs (fsubs.) frD,frA,frB Floating Subtract Single isync -- Instruction Synchronize lbz rD,d(rA) Load Byte and Zero lbzu rD,d(rA) Load Byte and Zero with Update lbzux rD,rA,rB Load Byte and Zero with Update Indexed lbzx rD,rA,rB Load Byte and Zero Indexed lfd frD,d(rA) Load Floating-Point Double lfdu frD,d(rA) Load Floating-Point Double with Update lfdux frD,rA,rB Load Floating-Point Double with Update Indexed lfdx frD,rA,rB Load Floating-Point Double Indexed lfs frD,d(rA) Load Floating-Point Single lfsu frD,d(rA) Load Floating-Point Single with Update lfsux frD,rA,rB Load Floating-Point Single with Update Indexed lfsx frD,rA,rB Load Floating-Point Single Indexed lha rD,d(rA) Load Half-Word Algebraic lhau rD,d(rA) Load Half-Word Algebraic with Update lhaux rD,rA,rB Load Half-Word Algebraic with Update Indexed MPC561/MPC563 Reference Manual, Rev. 1.2 3-30 Freescale Semiconductor Central Processing Unit Table 3-17. Instruction Set Summary (continued) Mnemonic Operand Syntax Name lhax rD,rA,rB Load Half-Word Algebraic Indexed lhbrx rD,rA,rB Load Half-Word Byte-Reverse Indexed lhz rD,d(rA) Load Half-Word and Zero lhzu rD,d(rA) Load Half-Word and Zero with Update lhzux rD,rA,rB Load Hal-Word and Zero with Update Indexed lhzx rD,rA,rB Load Half-Word and Zero Indexed lmw rD,d(rA) Load Multiple Word lswi rD,rA,NB Load String Word Immediate lswx rD,rA,rB Load String Word Indexed lwarx rD,rA,rB Load Word and Reserve Indexed lwbrx rD,rA,rB Load Word Byte-Reverse Indexed lwz rD,d(rA) Load Word and Zero lwzu rD,d(rA) Load Word and Zero with Update lwzux rD,rA,rB Load Word and Zero with Update Indexed lwzx rD,rA,rB Load Word and Zero Indexed mcrf crfD,crfS Move Condition Register Field mcrfs crfD,crfS Move to Condition Register from FPSCR mcrxr crfD Move to Condition Register from XER mfcr rD Move from Condition Register mffs (mffs.) frD Move from FPSCR mfmsr rD Move from Machine State Register mfspr rD,SPR Move from Special Purpose Register mftb rD, TBR Move from Time Base mtcrf CRM,rS Move to Condition Register Fields mtfsb0 (mtfsb0.) crbD Move to FPSCR Bit 0 mtfsb1 (mtfsb1.) crbD Move to FPSCR Bit 1 mtfsf (mtfsf.) FM,frB Move to FPSCR Fields mtfsfi (mtfsfi.) crfD,IMM Move to FPSCR Field Immediate mtmsr rS Move to Machine State Register mtspr SPR,rS Move to Special Purpose Register mulhw (mulhw.) rD,rA,rB Multiply High Word mulhwu (mulhwu.) rD,rA,rB Multiply High Word Unsigned mulli rD,rA,SIMM Multiply Low Immediate MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-31 Central Processing Unit Table 3-17. Instruction Set Summary (continued) Mnemonic Operand Syntax Name mullw (mullw. mullwo mullwo.) rD,rA,rB Multiply Low nand (nand.) rA,rS,rB NAND neg (neg. nego nego.) rD,rA Negate nor (nor.) rA,rS,rB NOR or (or.) rA,rS,rB OR orc rA,rS,rB OR with Complement ori rA,rS,UIMM OR Immediate oris rA,rS,UIMM OR Immediate Shifted (orc.) rfi -- Return from Interrupt rlwimi (rlwimi.) rA,rS,SH,MB,ME Rotate Left Word Immediate then Mask Insert rlwinm (rlwinm.) rA,rS,SH,MB,ME Rotate Left Word Immediate then AND with Mask rlwnm (rlwnm.) rA,rS,rB,MB,ME Rotate Left Word then AND with Mask sc -- System Call slw (slw.) rA,rS,rB Shift Left Word sraw (sraw.) rA,rS,rB Shift Right Algebraic Word srawi (srawi.) rA,rS,SH Shift Right Algebraic Word Immediate srw (srw.) rA,rS,rB Shift Right Word stb rS,d(rA) Store Byte stbu rS,d(rA) Store Byte with Update stbux rS,rA,rB Store Byte with Update Indexed stbx rS,rA,rB Store Byte Indexed stfd frS,d(rA) Store Floating-Point Double stfdu frS,d(rA) Store Floating-Point Double with Update stfdux frS,rB Store Floating-Point Double with Update Indexed stfdx frS,rB Store Floating-Point Double Indexed stfiwx frS,rB Store Floating-Point as Integer Word Indexed stfs frS,d(rA) Store Floating-Point Single stfsu frS,d(rA) Store Floating-Point Single with Update stfsux frS,rB Store Floating-Point Single with Update Indexed stfsx frS,r B Store Floating-Point Single Indexed sth rS,d(rA) Store Half-Word MPC561/MPC563 Reference Manual, Rev. 1.2 3-32 Freescale Semiconductor Central Processing Unit Table 3-17. Instruction Set Summary (continued) Mnemonic Operand Syntax Name sthbrx rS,rA,rB Store Half-Word Byte-Reverse Indexed sthu rS,d(rA) Store Half-Word with Update sthux rS,rA,rB Store Half-Word with Update Indexed sthx rS,rA,rB Store Half-Word Indexed stmw rS,d(rA) Store Multiple Word stswi rS,rA,NB Store String Word Immediate stswx rS,rA,rB Store String Word Indexed stw rS,d(rA) Store Word stwbrx rS,rA,rB Store Word Byte-Reverse Indexed stwcx. rS,rA,rB Store Word Conditional Indexed stwu rS,d(rA) Store Word with Update stwux rS,rA,rB Store Word with Update Indexed stwx rS,rA,rB Store Word Indexed subf (subf. subfo subfo.) rD,rA,rB Subtract From subfc (subfc. subfco subfco.) rD,rA,rB Subtract from Carrying subfe (subfe. subfeo subfeo.) rD,rA,rB Subtract from Extended subfic rD,rA,SIMM Subtract from Immediate Carrying subfme (subfme. subfmeo subfmeo.) rD,rA Subtract from Minus One Extended subfze (subfze. subfzeo subfzeo.) rD,rA Subtract from Zero Extended sync -- Synchronize tw TO,rA,rB Trap Word twi TO,rA,SIMM Trap Word Immediate xor (xor.) rA,rS,rB XOR xori rA,rS,UIMM XOR Immediate xoris rA,rS,UIMM XOR Immediate Shifted Note: The dot (.) suffix on a mnemonic indicates that the CR register update is enabled. The o suffix on a mnemonic indicates that the overflow bit update in the XER is enabled. 3.10.2 Recommended Simplified Mnemonics To simplify assembly language coding, a set of alternative mnemonics is provided for some frequently used operations (such as no-op, load immediate, load address, move register, and complement register). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-33 Central Processing Unit For a complete list of simplified mnemonics, see the RCPU Reference Manual. Programs written to be portable across the various assemblers for the PowerPC ISA architecture should not assume the existence of mnemonics not described in that manual. 3.10.3 Calculating Effective Addresses The effective address (EA) is the 32-bit address computed by the processor when executing a memory access or branch instruction or when fetching the next sequential instruction. The PowerPC ISA architecture supports two simple memory addressing modes: * EA = (rA|0) + 16-bit offset (including offset = 0) (register indirect with immediate index) * EA = (rA|0) + rB (register indirect with index) These simple addressing modes allow efficient address generation for memory accesses. Calculation of the effective address for aligned transfers occurs in a single clock cycle. For a memory access instruction, if the sum of the effective address and the operand length exceeds the maximum effective address, the storage operand is considered to wrap around from the maximum effective address to effective address 0. Effective address computations for both data and instruction accesses use 32-bit unsigned binary arithmetic. A carry from bit 0 is ignored in 32-bit implementations. 3.11 Exception Model The PowerPC ISA exception mechanism allows the processor to change to supervisor state as a result of external signals, errors, or unusual conditions that arise in the execution of instructions. When exceptions occur, information about the state of the processor is saved to certain registers, and the processor begins execution at an address (exception vector) predetermined for each exception. Processing of exceptions occurs in supervisor mode. Although multiple exception conditions can map to a single exception vector, a more specific condition may be determined by examining a register associated with the exception -- for example, the DAE/source instruction service register (DSISR). Additionally, some exception conditions can be explicitly enabled or disabled by software. The PowerPC ISA architecture requires that exceptions be taken in program order; therefore, although a particular implementation may recognize exception conditions out of order, they are handled strictly in order with respect to the instruction stream. When an instruction-caused exception is recognized, any unexecuted instructions that appear earlier in the instruction stream, including any that have not yet entered the execute state, are required to complete before the exception is taken. For example, if a single instruction encounters multiple exception conditions, those exceptions are taken and handled sequentially. Likewise, exceptions that are asynchronous and precise are recognized when they occur, but are not handled until all instructions currently in the execute stage successfully complete execution and report their results. MPC561/MPC563 Reference Manual, Rev. 1.2 3-34 Freescale Semiconductor Central Processing Unit Note that exceptions can occur while an exception handler routine is executing, and multiple exceptions can become nested. It is up to the exception handler to save the appropriate machine state if it is desired that control be returned to the excepting program. In many cases, after the exception handler handles an exception, there is an attempt to execute the instruction that caused the exception. Instruction execution continues until the next exception condition is encountered. This method of recognizing and handling exception conditions sequentially guarantees that the machine state is recoverable and processing can resume without losing instruction results. To prevent the loss of state information, exception handlers must save the information stored in SRR0 and SRR1 soon after the exception is taken to prevent this information from being lost due to another exception being taken. 3.11.1 Exception Classes The RCPU exception classes are shown in Table 3-18. Table 3-18. RCPU Exception Classes 3.11.2 Class Exception Type Asynchronous, unordered Machine check System reset Asynchronous, ordered External interrupt Decrementer Synchronous (ordered, precise) Instruction-caused exceptions Ordered Exceptions In the RCPU, all exceptions except for reset, debug port non-maskable interrupts, and machine check exceptions are ordered. Ordered exceptions satisfy the following criteria: * Only one exception is reported at a time. If, for example, a single instruction encounters multiple exception conditions, those conditions are encountered sequentially. After the exception handler handles an exception, instruction execution continues until the next exception condition is encountered. * When the exception is taken, no program state is lost. 3.11.3 Unordered Exceptions Unordered exceptions may be reported at any time and are not guaranteed to preserve program state information. The processor can never recover from a reset exception. It can recover from other unordered exceptions in most cases. However, if a debug port non-maskable interrupt or machine check exception occurs during the servicing of a previous exception, the machine state information in SRR0 and SRR1 (and, in some cases, the DAR and DSISR) may not be recoverable; the processor may be in the process of saving or restoring these registers. To determine whether the machine state is recoverable, the RI (recoverable exception) bit in SRR1 can be read. During exception processing, the RI bit in the MSR is copied to SRR1 and then cleared. The MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-35 Central Processing Unit operating system should set the RI bit in the MSR at the end of each exception handler's prologue (after saving the program state) and clear the bit at the start of each exception handler's epilogue (before restoring the program state). Then, if an unordered exception occurs during the servicing of an exception handler, the RI bit in SRR1 will contain the correct value. 3.11.4 Precise Exceptions In the RCPU, all synchronous (instruction-caused) exceptions are precise. When a precise exception occurs, the processor backs the machine up to the instruction causing the exception. This ensures that the machine is in its correct architecturally-defined state. The following conditions exist at the point a precise exception occurs: 1. Architecturally, no instruction following the faulting instruction in the code stream has begun execution. 2. All instructions preceding the faulting instruction appear to have completed with respect to the executing processor. 3. SRR0 addresses either the instruction causing the exception or the immediately following instruction. Which instruction is addressed can be determined from the exception type and the status bits. 4. Depending on the type of exception, the instruction causing the exception may not have begun execution, may have partially completed, or may have completed execution. 3.11.5 Exception Vector Table The setting of the exception prefix (IP) bit in the MSR determines how exceptions are vectored. If the bit is cleared, the exception vector table begins at the physical address 0x0000 0000; if IP is set, the exception vector table begins at the physical address 0xFFF0 0000. Table 3-19 shows the exception vector offset of the first instruction of the exception handler routine for each exception type. NOTE In the MPC561/MPC563, the exception table can additionally be relocated by the BBC module to internal memory and reduce the total size required by the exception table (see Section 4.3, "Exception Table Relocation (ETR)." Table 3-19. Exception Vector Offset Table Vector Offset (hex) Exception Type Section 00000 Reserved -- 00100 System reset, NMI interrupt Section 3.15.4.1, "System Reset Exception and NMI (0x0100)" 00200 Machine Check Section 3.15.4.2, "Machine Check Exception (0x0200)" 00300 Data Storage Section 3.15.4.3, "Data Storage Exception (0x0300)" 00400 Reserved Instruction Storage1 00500 External Interrupt Section 3.15.4.5, "External Interrupt (0x0500)" MPC561/MPC563 Reference Manual, Rev. 1.2 3-36 Freescale Semiconductor Central Processing Unit Table 3-19. Exception Vector Offset Table (continued) 1 Vector Offset (hex) Exception Type Section 00600 Alignment Section 3.15.4.6, "Alignment Exception (0x00600)" 00700 Program Section 3.15.4.7, "Program Exception (0x0700)" 00800 Floating-Point Unavailable Section 3.15.4.8, "Floating-Point Unavailable Exception (0x0800)" 00900 Decrementer Section 3.15.4.9, "Decrementer Exception (0x0900)" 00A00 Reserved -- 00B00 Reserved -- 00C00 System call Section 3.15.4.10, "System Call Exception (0x0C00)" 00D00 Trace. Section 3.15.4.11, "Trace Exception (0x0D00)" 00E00 Floating-Point Assist Section 3.15.4.12, "Floating-Point Assist Exception (0x0E00)" 01000 Implementation-Dependent Software Emulation Section 3.15.4.13, "Implementation-Dependent Software Emulation Exception (0x1000)" 01100 Reserved -- 01200 Reserved -- 01300 Implementation-Dependent Instruction Protection Exception Section 3.15.4.14, "Implementation-Dependent Instruction Protection Exception (0x1300)" 01400 Implementation-Dependent Data Protection Error Section 3.15.4.15, "Implementation-Specific Data Protection Error Exception (0x1400)" 01500-01BFF Reserved -- 01C00 Implementation-Dependent Data Breakpoint Section 3.15.4.16, "Implementation-Dependent Debug Exceptions" 01D00 Implementation-Dependent Instruction Breakpoint Section 3.15.4.16, "Implementation-Dependent Debug Exceptions" 01E00 Implementation-Dependent Maskable External Breakpoint Section 3.15.4.16, "Implementation-Dependent Debug Exceptions" 01F00 Implementation-Dependent Non-Maskable External Breakpoint Section 3.15.4.16, "Implementation-Dependent Debug Exceptions" This exception will not be generated by hardware. 3.12 Instruction Timing The RCPU processor is pipelined. Because the processing of an instruction is broken into a series of stages, an instruction does not require the processor's full resources. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-37 Central Processing Unit The instruction pipeline in the MPC561/MPC563 has four stages: 1. The dispatch stage is implemented using a distributed mechanism. The central dispatch unit broadcasts the instruction to all units. In addition, scoreboard information (regarding data dependencies) is broadcast to each execution unit. Each execution unit decodes the instruction. If the instruction is not implemented, a program exception is taken. If the instruction is legal and no data dependency is found, the instruction is accepted by the appropriate execution unit, and the data found in the destination register is copied to the history buffer. If a data dependency exists, the machine is stalled until the dependency is resolved. 2. In the execute stage, each execution unit that has an executable instruction executes the instruction. (For some instructions, this occurs over multiple cycles.) 3. In the writeback stage, the execution unit writes the result to the destination register and reports to the history buffer that the instruction is completed. 4. In the retirement stage, the history buffer retires instructions in architectural order. An instruction retires from the machine if it completes execution with no exceptions and if all instructions preceding it in the instruction stream have finished execution with no exceptions. As many as six instructions can be retired in one clock. The history buffer maintains the correct architectural machine state. An exception is taken only when the instruction is ready to be retired from the machine (i.e., after all previously-issued instructions have already been retired from the machine). When an exception is taken, all instructions following the excepting instruction are canceled, (i.e., the values of the affected destination registers are restored using the values saved in the history buffer during the dispatch stage). Figure 3-19 shows basic instruction pipeline timing. FETCH i1 i2 DECODE i3 i1 i2 READ AND EXECUTE i1 i2 i1 WRITE BACK (TO DEST REG) L ADDRESS DRIVE i2 i1 store L DATA LOAD WRITE BACK BRANCH DECODE BRANCH EXECUTE load i1 i1 i1 Figure 3-19. Basic Instruction Pipeline Table 3-20 indicates the latency and blockage for each type of instruction. Latency refers to the interval from the time an instruction begins execution until it produces a result that is available for use by a MPC561/MPC563 Reference Manual, Rev. 1.2 3-38 Freescale Semiconductor Central Processing Unit subsequent instruction. Blockage refers to the interval from the time an instruction begins execution until its execution unit is available for a subsequent instruction. NOTE When the blockage equals the latency, it is not possible to issue another instruction to the same unit in the same cycle in which the first instruction is being written back. Table 3-20. Instruction Latency and Blockage 1 3.13 3.13.1 Instruction Type Precision Latency Blockage Floating-point multiply-add Double Single 7 6 7 6 Floating-point add or subtract Double Single 4 4 4 4 Floating-point multiply Double Single 5 4 5 4 Floating-point divide Double Single 17 10 17 10 Integer multiply -- 2 1 or 21 Integer divide -- 2 to 111 2 to 111 Integer load/store -- See note1 See note1 Refer to Section 7, "Instruction Timing," in the RCPU Reference Manual (RCPURM/AD) for details. User Instruction Set Architecture (UISA) Computation Modes The RCPU is a 32-bit implementation of the PowerPC ISA architecture. Any reference in the PowerPC ISA architecture books (UISA, VEA, OEA) regarding 64-bit implementations are not supported by the core. All registers except the floating-point registers are 32 bits wide. 3.13.2 Reserved Fields Reserved fields in instructions are described under the specific instruction definition sections. Unless otherwise noted, reserved fields should be written with a zero when written and return a zero when read. Thus, this type of invalid form instructions yield results of the defined instructions with the appropriate field zero. In most cases, the reserved fields in registers are ignored on write and return zeros for them on read on any control register implemented by the MPC561/MPC563. Exception to this rule are bits [16:23] of the fixed-point exception cause register (XER) and the reserved bits of the machine state register (MSR), which are set by the source value on write and return the value last set for it on read. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-39 Central Processing Unit 3.13.3 Classes of Instructions Non-optional instructions are implemented by the hardware. Optional instructions are executed by implementation-dependent code and any attempt to execute one of these commands causes the RCPU to take the implementation-dependent software emulation interrupt (offset 0x01000 of the vector table). Illegal and reserved instruction class instructions are supported by implementation- dependent code and, thus, the RCPU hardware generates the implementation-dependent software emulation interrupt. Invalid and preferred instruction forms treatment by the RCPU is described under the specific processor compliance sections. 3.13.4 Exceptions Invocation of the system software for any instruction-caused exception in the RCPU is precise, regardless of the type and setting. 3.13.5 Branch Processor The RCPU implements all the instructions defined for the branch processor in the UISA in the hardware. 3.13.6 Instruction Fetching The core fetches a number of instructions into its internal buffer (the instruction pre-fetch queue) prior to execution. If a program modifies the instructions it intends to execute, it should call a system library program to ensure that the modifications have been made visible to the instruction fetching mechanism prior to execution of the modified instructions. 3.13.7 Branch Instructions The core implements all the instructions defined for the branch processor by the UISA in the hardware. For performance of various instructions, refer to Table 3-20 of this manual. 3.13.7.1 Invalid Branch Instruction Forms Bits marked with z in the BO encoding definition are discarded by the MPC561/MPC563 decoding. Thus, these types of invalid form instructions yield results of the defined instructions with the z-bit zero. If the decrement and test CTR option is specified for the bcctr or bcctrl instructions, the target address of the branch is the new value of the CTR. Condition is evaluated correctly, including the value of the counter after decrement. 3.13.7.2 Branch Prediction The core uses the y bit to predict path for pre-fetch. Prediction is only done for not-ready branch conditions. No prediction is done for branches to the link or count register if the target address is not ready. Refer to the RCPU Reference Manual (conditional branch control) for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 3-40 Freescale Semiconductor Central Processing Unit 3.13.8 3.13.8.1 Fixed-Point Processor Fixed-Point Instructions The core implements the following instructions: * Fixed-point arithmetic instructions * Fixed-point compare instructions * Fixed-point trap instructions * Fixed-point logical instructions * Fixed-point rotate and shift instructions * Move to/from system register instructions All instructions are defined for the fixed-point processor in the UISA in the hardware. For performance of the various instructions, refer to Table 3-20. -- Move To/From System Register Instructions. Move to/from invalid special registers in which SPR0 = 1 yields invocation of the privilege instruction error interrupt handler if the processor is in problem state. For a list of all implemented special registers, refer to Table 3-2, and Table 3-3. -- Fixed-Point Arithmetic Instructions. If an attempt is made to perform any of the divisions in the divw[o][.] instruction (0x80000000 / -1, / 0), then the contents of rD are 0x80000000; if Rc =1, the contents of bits in CR field 0 are LT = 1, GT = 0, EQ = 0, and SO is set to the correct value. If an attempt is made to perform any of the divisions in the divw[o][.] instruction, / 0. In cmpi, cmp, cmpli, and cmpl instructions, the L-bit is applicable for 64-bit implementations. In 32-bit implementations, if L = 1 the instruction form is invalid. The core ignores this bit and therefore, the behavior when L = 1 is identical to the valid form instruction with L = 0 3.13.9 3.13.9.1 Floating-Point Processor General The RCPU implements all floating-point features as defined in the UISA, including the non-IEEE working mode. Some features require software assistance. For more information refer to the RCPU Reference Manual (Floating-point Load Instructions). 3.13.9.2 Optional Instructions The only optional instruction implemented by RCPU hardware is store floating-point as integer word indexed (stfiwx). An attempt to execute any other optional instruction causes an implementation dependent software emulation exception. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-41 Central Processing Unit 3.13.10 Load/Store Processor The load/store processor supports all of the 32-bit implementation fixed-point PowerPC ISA load/store instructions in the hardware. 3.13.10.1 Fixed-Point Load with Update and Store with Update Instructions For load with update and store with update instructions, when rA = 0, the EA is written into R0. For load with update instructions, when rA = rD, rA is boundedly undefined. 3.13.10.2 Fixed-Point Load and Store Multiple Instructions For these types of instructions, EA must be a multiple of four. If it is not, the system alignment error handler is invoked. For a lmw instruction (if rA is in the range of registers to be loaded), the instruction completes normally. rA is then loaded from the memory location as follows: rA MEM(EA+(rA-rD)*4, 4) 3.13.10.3 Fixed-Point Load String Instructions Load string instructions behave the same as load multiple instructions, with respect to invalid format in which rA is in the range of registers to be loaded. When rA is in range, it is updated from memory. 3.13.10.4 Storage Synchronization Instructions For these type of instructions, EA must be a multiple of four. If it is not, the system alignment error handler is invoked. 3.13.10.5 Floating-Point Load and Store With Update Instructions For Load and Store with update instructions, if rD = 0 then the EA is written into R0. 3.13.10.6 Floating-Point Load Single Instructions When the operand falls in the range of a single denormalized number, the floating-point assist interrupt handler is invoked. Refer to the RCPU Reference Manual (Floating-point Assist For Denormalized Operands) for complete description of handling denormalized floating-point numbers. 3.13.10.7 Floating-Point Store Single Instructions When the operand falls in the range of a single denormalized number, the floating-point assist interrupt handler is invoked. When the operand is ZERO it is converted to the correct signed ZERO in single-precision format. When the operand is between the range of single denormalized and double denormalized it is considered a programming error. The hardware will handle this case as if the operand was single denormalized. MPC561/MPC563 Reference Manual, Rev. 1.2 3-42 Freescale Semiconductor Central Processing Unit When the operand falls in the range of double denormalized numbers it is considered a programming error. The hardware will handle this case as if the operand was ZERO. The following check is done on the stored operand in order to determine whether it is a denormalized single-precision operand and invoke the floating-point assist interrupt handler: (frS[1:11] 0) AND (frS[1:11] 896) Eqn. 3-1 Refer to the RCPU Reference Manual (Floating-Point Assist for Denormalized Operands) for complete description of handling denormalized floating-point numbers. 3.13.10.8 Optional Instructions No optional instructions are supported. 3.14 3.14.1 Virtual Environment Architecture (VEA) Atomic Update Primitives Both the lwarx and stwcx instructions are implemented according to the PowerPC ISA architecture requirements. The MPC561/MPC563 does not provide support for snooping an external bus activity outside the chip. The provision is made to cancel the reservation inside the MPC561/MPC563 by using the CR and KR input signals. Internal buses are snooped for RCPU accesses, and the reservation mechanism can be used for multitask single master applications. 3.14.2 Effect of Operand Placement on Performance The load/store unit hardware supports all of the PowerPC ISA load/store instructions. An optimal performance is obtained for naturally aligned operands. These accesses result in optimal performance (one bus cycle) for up to four bytes in size and good performance (two bus cycles) for double precision floating-point operands. Unaligned operands are supported in hardware and are broken into a series of aligned transfers. The effect of operand placement on performance is as stated in the VEA, except for the case of 8-byte operands. In that case, since the RCPU uses a 32-bit wide data bus, the performance is good rather than optimal. 3.14.3 Storage Control Instructions The RCPU does not implement the following cache control instructions: icbi, dcbt, dcbi, dcbf, dcbz, dcbst, and dcbtst . 3.14.4 Instruction Synchronize (isync) Instruction The isync instruction causes a reflect which waits for all prior instructions to complete and then executes the next sequential instruction. Any instruction after an isync will see all effects of prior instructions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-43 Central Processing Unit 3.14.5 Enforce In-Order Execution of I/O (eieio) Instruction When executing an eieio instruction, the load/store unit will wait until all previous accesses have terminated before issuing cycles associated with load/store instructions following the eieio instruction. 3.14.6 Time Base A description of the time base register may be found in Chapter 6, "System Configuration and Protection," and in Chapter 8, "Clocks and Power Control." 3.15 Operating Environment Architecture (OEA) The MPC561/MPC563 has an internal memory space that includes memory-mapped control registers and internal memory used by various modules on the chip. This memory is part of the main memory as seen by the RCPU and can be accessed by an external system master. 3.15.1 3.15.1.1 Branch Processor Registers Machine State Register (MSR) The floating-point exception mode encoding in the RCPU is as shown in Table 3-21. : Table 3-21. Floating-Point Exception Mode Encoding Mode FE0 FE1 Ignore exceptions 0 0 Precise 0 1 Precise 1 0 Precise 1 1 The SF bit is reserved set to zero. The IP bit initial state after reset is set as programmed by the reset configuration as specified by the USIU characteristics. 3.15.1.2 Branch Processors Instructions The RCPU implements all the instructions defined for the branch processor in the UISA in the hardware. 3.15.2 3.15.2.1 * * Fixed-Point Processor Special Purpose Registers Unsupported Registers -- The following registers are not supported by the MPC561/MPC563: SDR, EAR, IBAT0U, IBAT0L, IBAT1U, IBAT1L, IBAT2U, IBAT2L, IBAT3U, IBAT3L, DBAT0U, DBAT0L, DBAT1U, DBAT1L, DBAT2L, DBAT3U, DBAT3L. Added Registers -- For a list of added special purpose registers, refer to Table 3-2, and Table 3-3. MPC561/MPC563 Reference Manual, Rev. 1.2 3-44 Freescale Semiconductor Central Processing Unit 3.15.3 Storage Control Instructions Storage control instructions mtsr, mtsrin, mfsr, mfsrin, dcbi, tlbie, tlbia, and tlbsync are not implemented by the MPC561/MPC563. 3.15.4 Exceptions The following paragraphs define the types of OEA exceptions. The exception table vector defines the offset value by exception type. Refer to Table 3-19. 3.15.4.1 System Reset Exception and NMI (0x0100) A system reset exception occurs when: * Any reset signal is asserted: PORESET, HRESET, or SRESET * An internal reset is requested, such as from the software watchdog timer Settings caused by reset as shown in Table 3-22. Table 3-22. Settings Caused by Reset Register Setting MSR IP depends on internal data bus configuration word; ME is unchanged. DCMPEN is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]). All other bits are cleared SRR0 Undefined SRR1 Undefined FPECR 0x0000 0000 ICTRL 0x0000 0000 LCTRL1 0x0000 0000 LCTRL2 0x0000 0000 COUNTA[16:31] 0x0000 0000 COUNTB[16:31] 0x0000 0000 A non-maskable interrupt (NMI) occurs when the IRQ0 is asserted and the following registers are set. Table 3-23. Register Settings following an NMI Register Name Bits Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the next instruction the processor executes if no interrupt conditions are present Save/Restore Register 1 (SRR1) 1:4 Cleared to 0 10:15 Cleared to 0 Other Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-45 Central Processing Unit Table 3-23. Register Settings following an NMI (continued) Register Name Bits Machine State Register (MSR) IP No change ME No change LE Bit is copied from ILE DCMPEN Other 1 Description This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 If the RCPU is in decompression on mode, SRR0 will contain a compressed address. Execution begins at physical address 0x0100 if the hard reset configuration word IP bit is cleared to 0. Execution begins at physical address 0xFFF0 0100 if the hard reset configuration word IP bit is set to 1. 3.15.4.2 Machine Check Exception (0x0200) A machine-check exception is assumed to be caused by one of the following conditions: * The accessed address does not exist. * A data error was detected. * A storage protection violation was detected by chip-select logic. MPC561/MPC563 Reference Manual, Rev. 1.2 3-46 Freescale Semiconductor Central Processing Unit When a machine-check exception occurs, the processor does one of the following: * Takes a machine check exception; * Enters the checkstop state; or * Enters debug mode. Which action is taken depends on the value of the MSR[ME] bit, whether or not debug mode was enabled at reset, and (if debug mode is enabled) the values of the CHSTPE (checkstop enable) and MCIE (machine check enable) bits in the debug enable register (DER). Table 3-24 summarizes the possibilities. When the processor is in the checkstop state, instruction processing is suspended and cannot be restarted without resetting the core. Table 3-24. Machine Check Exception Processor Actions MSR[ME] Debug Mode Enable CHSTPE MCIE Action Performed when Exception Detected 0 0 X X Enter checkstop state 1 0 X X Branch to machine-check exception handler 0 1 0 X Enter checkstop state 0 1 1 X Enter debug mode 1 1 X 0 Branch to machine-check exception handler 1 1 X 1 Enter debug mode An indication is sent to the USIU which may generate an automatic reset in this condition. Refer to Chapter 7, "Reset," for more details. The register settings for machine check exceptions are shown in Table 3-25. Table 3-25. Register Settings following a Machine Check Exception Register Name Bits Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that caused the interrupt Save/Restore Register 1 (SRR1) 02 MSR0 1 Set to 1 for instruction fetch-related errors and 0 for load/store-related errors 2:4 5:9 2 10:15 16:31 2 Cleared to 0 MSR[5:9] Cleared to 0 Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-47 Central Processing Unit Table 3-25. Register Settings following a Machine Check Exception (continued) Register Name Bits Machine State Register (MSR) IP No change ME No change LE Bit is copied from ILE DCMPEN Data/Storage Interrupt Status Register (DSISR)3 This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Other Cleared to 0 0:14 Cleared to 0 15:16 Set to bits [29:30] of the instruction if X-form and to 0b00 if D-form 17 Data Address Register (DAR)3 Description Set to bit 25 of the instruction if X-form and to Bit 5 if D-form 18:21 Set to bits [21:24] of the instruction if X-form and to bits [1:4] if D-form 22:31 Set to bits [6:15] of the instruction All Set to the effective address of the data access that caused the interrupt 1 If the exception occurs due to a data error caused by a Load/Store instruction and the processor in Decompression On mode, the SRR0 register will contain the address of the Load/Store instruction in compressed format. If the exception occurs due to an instruction fetch in Decompression On mode, the SRR0 register will contain an indeterminate value. 2 This bit is loaded from the corresponding bit in the MSR when an interrupt is taken. The appropriate bit in MSR is loaded from this bit when an RFI is executed. 3 DSISR and DAR registers are only updated when the machine check exception is caused by a data access violation. when a machine check exception is taken, instruction execution resumes at offset 0x0200 from the base address indicated by MSR[IP]. 3.15.4.3 Data Storage Exception (0x0300) A data storage exception is never generated by the RCPU. The software may branch to this location as a result of implementation-specific data storage protection error exception. 3.15.4.4 Instruction Storage Exception (0x0400) An instruction storage interrupt is never generated by them RCPU. The software may branch to this location as a result of an implementation-specific instruction storage protection error exception. 3.15.4.5 External Interrupt (0x0500) The external interrupt exception is taken on assertion of the internal IRQ line to the RCPU, that is driven by on-chip interrupt controller. The interrupt may be caused by the assertion of an external IRQ signal, by a USIU timer, or by an internal chip peripheral. Refer to Section 6.1.4, "Enhanced Interrupt Controller," for more information on the interrupt controller. MPC561/MPC563 Reference Manual, Rev. 1.2 3-48 Freescale Semiconductor Central Processing Unit The interrupt may be delayed by other higher priority exceptions or if the MSR[EE] bit is cleared when the exception occurs. MSR[EE] is automatically cleared by hardware to disable external interrupts when any exception is taken. Upon detecting an external interrupt, the processor assigns it to the instruction at the head of the history buffer (after retiring all instructions that are ready to retire). The enhanced interrupt controller mode is available for interrupt-driven applications on MPC561/MPC563. It allows the single external interrupt exception vector 0x500 to be split into up to 48 different vectors corresponding to 48 interrupt sources to speed up interrupt processing. It also supports a low priority source masking feature in hardware to handle nested interrupts more easily. See Section 6.1.4, "Enhanced Interrupt Controller," and Chapter 4, "Burst Buffer Controller 2 Module." The register settings for the external interrupt exception are shown in Table 3-26. Table 3-26. Register Settings following External Interrupt Register Bits Setting Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that the processor would have attempted to execute next if no interrupt conditions were present. Save/Restore Register 1 (SRR1) [0:15] Cleared to 0 [16:31] Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] Machine State Register (MSR) IP No change ME No change LE Set to value of ILE bit prior to the exception DCMPE This bit is set according to (BBCMCR[EN_COMP] AND N BBCMCR[EXC_COMP]) Other 1 Cleared to 0 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain an address in compressed format. When an external interrupt is taken, instruction execution resumes at offset 0x00500 from the physical base address indicated by MSR[IP]. 3.15.4.6 Alignment Exception (0x00600) The following conditions cause an alignment exception: * The operand of a floating-point load or store instruction is not word-aligned. * The operand of a load or store multiple instruction is not word-aligned. * The operand of lwarx or stwcx. is not word-aligned. Alignment exceptions use the SRR0 and SRR1 to save the machine state and the DSISR to determine the source of the exception. The register settings for alignment exceptions are shown in Table 3-27. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-49 Central Processing Unit Table 3-27. Register Settings for Alignment Exception Register Bits Save/Restore Register 0 (SRR0)1 Save/Restore Register 1 (SRR1) Machine State Register (MSR) Set to the effective address of the instruction that caused the exception. [0:15] Cleared to 0 [16:31] Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] IP No change ME No change LE Set to value of ILE bit prior to the exception DCMPEN Data/Storage Interrupt Status Register (DSISR) 1 Setting Description This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Other Cleared to 0 [0:11] Cleared to 0 [12:13] Cleared to 0 14 Cleared to 0 [15:16] For instructions that use register indirect with index addressing, set to bits [29:30] of the instruction. For instructions that use register indirect with immediate index addressing, cleared. 17 For instructions that use register indirect with index addressing, set to bit 25 of the instruction. For instructions that use register indirect with immediate index addressing, set to bit 5 of the instruction. [18:21] For instructions that use register indirect with index addressing, set to bits [21:24] of the instruction. For instructions that use register indirect with immediate index addressing, set to bits [1:4] of the instruction. [22:26] Set to bits [6:10] (source or destination) of the instruction. [27:31] Set to bits [11:15] of the instruction (rA). Set to either bits [11:15] of the instruction or to any register number not in the range of registers loaded by a valid form instruction, for lmw, lswi, and lswx instructions. Otherwise undefined. If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. MPC561/MPC563 Reference Manual, Rev. 1.2 3-50 Freescale Semiconductor Central Processing Unit NOTE For load or store instructions that use register indirect with index addressing, the DSISR can be set to the same value that would have resulted if the corresponding instruction uses register indirect with immediate index addressing had caused the exception. Similarly, for load or store instructions that use register indirect with immediate index addressing, DSISR can hold a value that would have resulted from an instruction that uses register indirect with index addressing. (If there is no corresponding instruction, no alternative value can be specified.) When an alignment exception is taken, instruction execution resumes at offset 0x00600 from the physical base address indicated by MSR[IP]. 3.15.4.7 Program Exception (0x0700) A program exception occurs when no higher priority exception exists and one or more of the following exception conditions, which correspond to bit settings in SRR1, occur during execution of an instruction: * System floating-point enabled exception -- A system floating-point enabled exception is generated when the following condition is met as a result of a move to FPSCR instruction, move to MSR (mtmsr) instruction, or return from interrupt (rfi) instruction: * (MSR[FE0] | MSR[FE1]) and- FPSCR[FEX] = 1. * Notice that in the RCPU implementation of the PowerPC ISA architecture, a program interrupt is not generated by a floating-point arithmetic instruction that results in the condition shown above; a floating-point assist exception is generated instead. * Privileged instruction -- A privileged instruction type program exception is generated by any of the following conditions: -- The execution of a privileged instruction (mfmsr, mtmsr, or rfi) is attempted and the processor is operating at the user privilege level (MSR[PR] = 1). -- The execution of mtspr or mfspr where SPR0 = 1 in the instruction encoding (indicating a supervisor-access register) and MSR[PR] = 1 (indicating the processor is operating at the user privilege level), provided the SPR instruction field encoding represents either: -- a valid internal-to-the-processor special-purpose register; or -- an external-to-the-processor special-purpose register (either valid or invalid). * Trap -- A trap type program exception is generated when any of the conditions specified in a trap instruction is met. The register settings for program exceptions are shown in Table 3-28. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-51 Central Processing Unit Table 3-28. Register Settings following Program Exception Register Bits Save/Restore Register 0 (SRR0)1 All Save/Restore Register 1 (SRR1)2 [0:10] Machine State Register (MSR) Setting Description Contains the effective address of the excepting instruction Cleared to 0 11 Set for a floating-point enabled program exception; otherwise cleared. 12 Cleared to 0. 13 Set for a privileged instruction program exception; otherwise cleared. 14 Set for a trap program exception; otherwise cleared. 15 Cleared to 0 if SRR0 contains the address of the instruction causing the exception, and set if SRR0 contains the address of a subsequent instruction. [16:31] Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI]. IP No change ME No change LE Set to value of ILE bit prior to the exception DCMPEN Other This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 1 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. 2 Only one of bits 11, 13, and 14 can be set. When a program exception is taken, instruction execution resumes at offset 0x0700 from the physical base address indicated by MSR[IP]. 3.15.4.8 Floating-Point Unavailable Exception (0x0800) A floating-point unavailable exception occurs when no higher priority exception exists, an attempt is made to execute a floating-point instruction (including floating-point load, store, and move instructions), and the floating-point available bit in the MSR is disabled, (MSR[FP] = 0). Table 3-29. Register Settings following a Floating-Point Unavailable Exception Register Bits Setting Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that caused the exception. Save/Restore Register 1 (SRR1) [0:15] Cleared to 0 [16:31] Loaded from MSR[16:31] MPC561/MPC563 Reference Manual, Rev. 1.2 3-52 Freescale Semiconductor Central Processing Unit Table 3-29. Register Settings following a Floating-Point Unavailable Exception (continued) Register Bits Machine State Register (MSR) IP No change ME No change LE Set to value of ILE bit prior to the exception DCMPEN Other 1 Setting Description This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. 3.15.4.9 Decrementer Exception (0x0900) A decrementer exception occurs when no higher priority exception exists, the decrementer register has completed decrementing, and MSR[EE] = 1. The decrementer exception request is canceled when the exception is handled. The decrementer register counts down, causing an exception (unless masked) when passing through zero. The decrementer implementation meets the following requirements: * Loading a GPR from the decrementer does not affect the decrementer. * Storing a GPR value to the decrementer replaces the value in the decrementer with the value in the GPR. * Whenever bit 0 of the decrementer changes from zero to one, an exception request is signaled. If multiple decrementer exception requests are received before the first can be reported, only one exception is reported. The occurrence of a decrementer exception cancels the request. * If the decrementer is altered by software and if bit 0 is changed from zero to one, an interrupt request is signaled. The register settings for the decrementer exception are shown in Table 3-30. Table 3-30. Register Settings Following a Decrementer Exception Register Bits Setting Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that the processor would have attempted to execute next if no exception conditions were present. Save/Restore Register 1 (SRR1) [0:15] Cleared to 0 [16:31] Loaded from MSR[16:31] Machine State Register (MSR) IP No change ME No change LE Set to value of ILE bit prior to the exception DCMPEN Other This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-53 Central Processing Unit 1 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. When a decrementer exception is taken, instruction execution resumes at offset 0x0900 from the physical base address indicated by MSR[IP]. 3.15.4.10 System Call Exception (0x0C00) A system call exception occurs when a system call instruction is executed. The effective address of the instruction following the sc instruction is placed into SRR0. MSR[16:31] are placed into SRR1[16:31], and SRR1[0:15] are set to undefined values. Then a system call exception is generated. The system call instruction is context synchronizing. That is, when a system call exception occurs, instruction dispatch is halted and the following synchronization is performed: 1. The exception mechanism waits for all instructions in execution to complete to a point where they report all exceptions they will cause. 2. The processor ensures that all instructions in execution complete in the context in which they began execution. 3. Instructions dispatched after the exception is processed are fetched and executed in the context established by the exception mechanism. Register settings are shown in Table 3-31. Table 3-31. Register Settings following a System Call Exception Register Setting Description 1 Save/Restore Register 0 (SRR0) All Save/Restore Register 1 (SRR1) [0:15] Undefined [16:31] Loaded from MSR[16:31] Machine State Register (MSR) IP No change ME No change LE Set to value of ILE bit prior to the exception DCMPEN Other 1 Set to the effective address of the instruction following the System Call instruction This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 If the exception occurs during a data access in Decompression On mode, the SRR0 register will contain the address of the Load/Store instruction in compressed format. If the exception occurs during an instruction fetch in decompression on mode, the SRR0 register will contain an indeterminate value. When a system call exception is taken, instruction execution resumes at offset 0x00C00 from the physical base address indicated by MSR[IP]. 3.15.4.11 Trace Exception (0x0D00) A trace interrupt occurs if MSR[SE] = 1 and any instruction except rfi is successfully completed or MSR[BE]= 1 and a branch is completed. Notice that the trace interrupt does not occur after an instruction that caused an interrupt (for instance, sc). Monitor/debugger software must change the vectors of other MPC561/MPC563 Reference Manual, Rev. 1.2 3-54 Freescale Semiconductor Central Processing Unit possible interrupt addresses to single-step such instructions. If this is unacceptable, other debug features can be used. Refer to Chapter 23, "Development Support," for more information. See Table 3-32 for Trace Exception register settings. Table 3-32. Register Settings following a Trace Exception Register Name Bits Save/Restore Register 0 (SRR0) All Set to the effective address of the instruction following the executed instruction Save/Restore Register 1 (SRR1) 1:4 Cleared to 0 10:15 Cleared to 0 Other Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] Machine State Register (MSR) IP No change ME No change LE Bit is copied from ILE DCMPEN Other 1 Description 1 This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. Execution resumes at offset 0x0D00 from the base address indicated by MSR[IP]. 3.15.4.12 Floating-Point Assist Exception (0x0E00) A floating point assist exception occurs when the following conditions are true: * A floating-point enabled exception condition is detected; * The corresponding floating-point enable bit in the FPSCR (floating point status and control register) is set (exception enabled); and * MSR[FE0] | MSR[FE1] = 1 These conditions are summarized in the following equation: (MSR[FE0] | MSR[FE1]) AND FPSCR[FEX] = 1 Note that when ((MSR[FE0] | MSR[FE1]) AND FPSCR[FEX]) is set as a result of move to FPSCR, move to MSR or rfi, a program exception is generated, rather than a floating-point assist exception. A floating point assist exception also occurs when a tiny result is detected and the floating point underflow exception is disabled (FPSCR[UE] = 0). The register settings for floating-point assist exceptions are shown in Table 3-33. Table 3-33. Register Settings following Floating-Point Assist Exceptions Register Name 1 Save/Restore Register 0 (SRR0) Bits Description All Set to the effective address of the instruction that caused the interrupt MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-55 Central Processing Unit Table 3-33. Register Settings following Floating-Point Assist Exceptions Register Name Bits Description Save/Restore Register 1 (SRR1) 1:4 10:15 Other Machine State Register (MSR) IP ME LE DCMPEN Cleared to 0 Cleared to 0 Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] No change No change Bit is copied from ILE This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 Other 1 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. When a floating-point exception is taken, instruction execution resumes at offset 0x0E00 from the base address indicated by MSR[IP]. 3.15.4.13 Implementation-Dependent Software Emulation Exception (0x1000) An implementation-dependent software emulation exception occurs in the following instances: * When executing any non-implemented instruction. This includes all illegal and unimplemented optional instructions and all floating-point instructions. * When executing a mtspr or mfspr instruction that specifies an un-implemented internal-to-the-processor SPR, regardless of the value of bit 0 of the SPR. * When executing a mtspr or mfspr that specifies an un-implemented external-to-the-processor register and SPR0 = 0 or MSR[PR] = 0 (no program interrupt condition). Table 3-34 shows the register settings set when a software emulation exception occurs. Table 3-34. Register Settings following a Software Emulation Exception Register Name Bits Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that caused the interrupt Save/Restore Register 1 (SRR1) 1:4 Cleared to 0 10:15 Cleared to 0 Other Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI]. MPC561/MPC563 Reference Manual, Rev. 1.2 3-56 Freescale Semiconductor Central Processing Unit Table 3-34. Register Settings following a Software Emulation Exception Register Name Bits Machine State Register (MSR) IP No change ME No change LE Bit is copied from ILE DCMPEN Other 1 Description This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain a compressed address. Execution resumes at offset 0x01000 from the base address indicated by MSR[IP]. 3.15.4.14 Implementation-Dependent Instruction Protection Exception (0x1300) The implementation-specific instruction storage protection error interrupt occurs in the following cases: * The fetch access violates storage protection and MSR[IR] = 1. * The fetch access is to guarded storage and MSR[IR] = 1. The register settings for instruction protection exceptions are shown in Table 3-35. Table 3-35. Register Settings following an Instruction Protection Exception Register Name Bits Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that caused the exception Save/Restore Register 1 (SRR1) 0:2 Cleared to 0 Machine State Register (MSR) 3 Set to 1 if the fetch access was to a guarded storage when MSR[IR] = 1, otherwise clear to 0 4 Set to 1 if the storage access is not permitted by the protection mechanism (IMPU in BBC) and MSR[IR] = 1; otherwise clear to 0 5:15 Cleared to 0 16:31 Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[IR] IP No change ME No change LE Bit is copied from ILE DCMPEN Other This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) Cleared to 0 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-57 Central Processing Unit 1 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain an indeterminate value. Execution resumes at offset 0x1300 from the base address indicated by MSR[IP]. 3.15.4.15 Implementation-Specific Data Protection Error Exception (0x1400) The implementation-specific data protection error exception occurs in the following case: * The data access violates the storage protection and MSR[DR]=1. See Chapter 11, "L-Bus to U-Bus Interface (L2U)." MPC561/MPC563 Reference Manual, Rev. 1.2 3-58 Freescale Semiconductor Central Processing Unit See Table 3-36 for data-protection-error exception register settings. Table 3-36. Register Settings Following a Data Protection Error Exception Register Name Bits Description Save/Restore Register 0 (SRR0)1 All Set to the effective address of the instruction that caused the exception Save/Restore Register 1 (SRR1) 0:15 Cleared to 0 Other Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI] Machine State Register (MSR) IP No change ME No change LE Bit is copied from ILE DCMPEN Data/Storage Interrupt Status Register (DSISR) Other Cleared to 0 0:3 Cleared to 0 4 Set to 1 if the storage access is not permitted by the protection mechanism. Otherwise cleared to 0 5 Cleared to 0 6 Set to 1 for a store operation and cleared to 0 for a load operation 7:31 Data Address Register (DAR) 1 This bit is set according to (BBCMCR[EN_COMP] AND BBCMCR[EXC_COMP]) All Cleared to 0 Set to the effective address of the data access that caused the exception If the exception occurs during a data access in Decompression On mode, the SRR0 register will contain the address of the Load/Store instruction in compressed format. When a data protection error exception is taken, instruction execution resumes at offset 0x1400 from the base address indicated by MSR[IP]. 3.15.4.16 Implementation-Dependent Debug Exceptions Implementation-dependent debug exceptions occur in the following cases: * When there is an internal breakpoint match (for more details, refer to Chapter 23, "Development Support." * When a peripheral breakpoint request is asserted to the RCPU. * When the development port request is asserted to the RCPU. Refer to Chapter 23, "Development Support," for details on how to generate the development port-interrupt request. See Table 3-37 for debug-exception register settings. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-59 Central Processing Unit Table 3-37. Register Settings Following a Debug Exception Register Name Bits Description Save/Restore Register 0 (SRR0)1 All For I-breakpoints, set to the effective address of the instruction that caused the interrupt. For L-breakpoint, set to the effective address of the instruction following the instruction that caused the interrupt. For development port maskable request or a peripheral breakpoint, set to the effective address of the instruction that the processor would have executed next if no interrupt conditions were present. If the development port request is asserted at reset, the value of SRR0 is undefined. Save/Restore Register 1 (SRR1) 1:4 Cleared to 0 10:15 Cleared to 0 Other Loaded from bits [16:31] of MSR. In the current implementation, bit 30 of the SRR1 is never cleared, except by loading a zero value from MSR[RI]. If the development port request is asserted at reset, the value of SRR1 is undefined. Machine State Register (MSR) IP No change ME No change LE Bit is copied from ILE DCMPE This bit is set according to (BBCMCR[EN_COMP] AND N BBCMCR[EXC_COMP]) Other 1 Cleared to 0 If the exception occurs during an instruction fetch in Decompression On mode, the SRR0 register will contain the instruction address in compressed format. For data breakpoint exceptions, the register shown in Table 3-38 is set. Table 3-38. Register Settings for Data Breakpoint Match Register Name BAR Bits Description Set to the effective address of the data access as computed by the instruction that caused the interrupt Execution resumes at offset from the base address indicated by MSR[IP] as follows: * 0x01C00 - For data breakpoint match * 0x01D00 - For instruction breakpoint match * 0x01E00 - For development port maskable request or a peripheral breakpoint * 0x01F00 - For development port non-maskable request 3.15.5 Partially Executed Instructions In general, the architecture permits instructions to be partially executed when an alignment or data storage interrupt occurs. In the core, instructions are not executed at all if an alignment interrupt condition is MPC561/MPC563 Reference Manual, Rev. 1.2 3-60 Freescale Semiconductor Central Processing Unit detected and data storage interrupt is never generated by the hardware. In the RCPU, the instruction can be partially executed only in the case of the load/store instructions that cause multiple accesses to the memory subsystem. These instructions are: * Multiple/string instructions * Unaligned load/store instructions In the last case, the store instruction can be partially completed if one of the accesses (except the first one) causes the data storage protection error. The implementation-specific data storage protection interrupt is taken in this case. For the update forms, the update register (rA) is not altered. 3.15.6 Timer Facilities Descriptions of the timebase and decrementer registers can be found in Chapter 6, "System Configuration and Protection," and in Chapter 8, "Clocks and Power Control." 3.15.7 Optional Facilities and Instructions Any other OEA optional facilities and instructions (except those that are discussed here) are not implemented by the RCPU hardware. Attempting to execute any of these instructions causes an implementation dependent software emulation interrupt to be taken. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 3-61 Central Processing Unit MPC561/MPC563 Reference Manual, Rev. 1.2 3-62 Freescale Semiconductor Chapter 4 Burst Buffer Controller 2 Module The burst buffer controller module (BBC) consists of four main functional parts: the bus interface unit (BIU), the instruction memory protection unit (IMPU), branch target buffer (BTB) and the instruction code decompressor unit (ICDU). See Figure 4-1. Information about decompression features of the BBC is found in Appendix A, "MPC562/MPC564 Compression Features." The BBC master BIU interfaces between the RCPU instruction port and the internal U-bus and can support burstable and non-burstable U-bus accesses. The IMPU allows the instruction memory to be divided into four regions with different protection attributes. The IMPU compares the attributes of the RCPU memory access request with the attributes of the appropriate region. If the access is allowed, the proper signals are sent to the BIU. If access to the memory region is disallowed because the region is protected, an interrupt is sent to the RCPU and the master BIU cancels U-bus access. The IMPU is able to relocate the RCPU exception vectors. The IMPU always maps the exception vectors into the internal memory space of the MPC561/MPC563. This feature is important for a multi-MPC561/MPC563 system, where, although the internal memories of some controllers are not shifted to the lower 4 Mbytes, they can still have their own internal exception vector tables with the same exception addresses issued by their RCPU cores. The IMPU also supports an MPC561/MPC563-enhanced interrupt controller by extending an exception vector's relocation mechanism to translate the RCPU external interrupt exception vector separately and splitting it into 48 different vectors, corresponding to the code generated by the interrupt controller. See also Section 6.1.4.4, "Enhanced Interrupt Controller Operation." The branch target buffer (BTB) improves the performance of the MPC561/MPC563 by holding and supplying previously accessed or decompressed instructions to the RCPU core. The BTB can be enabled in either decompression on or off mode. The ICDU provides decompressed instructions to RCPU in the decompression ON mode and contains a 2 Kbyte RAM (DECRAM) to hold decompression vocabularies. The DECRAM can serve as a general purpose RAM memory on the U-bus if code compression is not used. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-1 Burst Buffer Controller 2 Module BBC IMPU Registers Address Buffer To Addresses U-bus Slave Machine 32 30 BTB 32 IMPU Compression Address Decompressor Control Logic RCPU Core (Sequencer) Compress/ Uncompress Data 32 32 Data Buffer 1 x 32 DECRAM 2 Kbytes ICDU U-bus Data 32 / U-bus Sequencer Address Address and Data Buffers Control Pipelined and Burstable Access Control U-bus Master Machine BIU U-bus Controls L/U Interface SIU Interface Figure 4-1. BBC Module Block Diagram 4.1 4.1.1 * * Key Features BIU Key Features Supports pipelined and burstable and single accesses to internal and external memories Supports the decoupled interface with the RCPU instruction unit MPC561/MPC563 Reference Manual, Rev. 1.2 4-2 Freescale Semiconductor Burst Buffer Controller 2 Module * * * * * 4.1.2 * * * * * * * * * * * 4.1.3 Implements a parked master on the U-bus, resulting in zero clock delays for RCPU fetch accesses to the U-bus Fully utilizes the U-bus pipeline for fetch accesses Avoids undesirable delays through a tight interface with the L2U module (fully utilizing U-bus bandwidth and back-to-back accesses) Supports program trace and show cycles Supports a special attribute for debug port fetch accesses. IMPU Key Features There are four regions in which the base address and size can be programmed. Available region sizes include 2 Kbytes, 8 Kbytes, 16 Kbytes, 32 Kbytes, 64 Kbytes, 128 Kbytes, 256 Kbytes, 512 Kbytes, 1 Mbyte, 2 Mbytes, 4 Mbytes, 8 Mbytes, 16 Mbytes....4 Gbytes. Overlap between regions is allowed. Each of the four regions supports the following attributes: -- User/supervisor -- Guard attribute (causes an interrupt in case of speculative fetch attempt) -- Compressed/non-compressed (MPC562/MPC564 only) -- Regions are enabled or disabled in software. Global region entry declares the default access attributes for all memory areas not covered by the four regions: The RCPU gets the instruction storage protection exception generated upon -- An access violation of protection attributes -- A fetch from a guarded region. The RCPU MSR[IR] bit controls IMPU protection. Programming is performed by using the RCPU mtspr/mfspr instructions to/from implementation specific special-purpose registers. The IMPU supplies relocation addresses of all the exceptions within the internal memory space. The IMPU implements external interrupt vector splitting to reduce the external interrupt latency. There is a special reset exception vector for decompression on mode (MPC562/MPC564 only). ICDU Key Features The following are instruction code decompression unit key features of the MPC562/MPC564. See Appendix A, "MPC562/MPC564 Compression Features" for more information. * Instruction code on-line decompression based on "instruction classes" algorithm. * No need for address translation between compressed and non-compressed address spaces -- ICDU provides "next instruction address" to the RCPU * In most cases, instruction decompression takes one clock * Code decompression is pipelined: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-3 Burst Buffer Controller 2 Module * * -- No performance penalty during sequential program flow execution -- Minimal performance penalty due to change of program flow execution Two operation modes are available: decompression on and decompression off. Switch between compressed and non-compressed user application software parts is possible. Adaptive vocabularies scheme is supported; each user application can have its own optimum vocabularies. 4.1.4 * * * * * * DECRAM Key Features 2 Kbytes RAM for decompression vocabulary tables 2 clock read/write accesses when used as a U-bus general-purpose RAM 4 clock load/store accesses from the L-bus Byte, half-word (16-bit) or word (32-bit) read/write accesses and fetches Special access protection functions Low-power standby operation for data retention 4.1.5 * * * * Branch Target Buffer Key Features Consists of eight "branch target entries" (BTE). Each entry contains: -- A 32-bit register that stores the target of historical change of flow (COF) address -- Four RAM entries, 38 bits each, which hold up to four valid instruction OPCODES (32 bits). The six extra bits are used by ICDU in decompression on mode. -- A 32-bit register that stores the values used to calculate the address following the last valid instruction. FIFO removal policy management is implemented for the eight BTEs Software-controlled BTB enable/disable and invalidate User transparent (that is, no user management is required) 4.2 4.2.1 Operation Modes Instruction Fetch The BBC provides two instruction fetch modes: decompression off and decompression on. The operational modes are defined by RCPU MSR[DCMPEN] bit. If the bit is set, the mode is decompression on. Otherwise, it is in decompression off. 4.2.1.1 Decompression Off Mode In this mode, the BBC bus interface unit (BIU) module transfers fetch accesses from the RCPU to the U-bus. When a new access is issued by the RCPU, it is transferred in parallel to both the IMPU and the BIU. The IMPU compares the address of the access to its region programming. The BIU checks if the access can be immediately transferred to the U-bus, otherwise it requests the U-bus for the next clock. MPC561/MPC563 Reference Manual, Rev. 1.2 4-4 Freescale Semiconductor Burst Buffer Controller 2 Module The BIU may be programmed for burstable or non-burstable access. If the BIU is programmed for burstable access, the U-bus address phase transaction is accompanied by the burst request attribute. If burstable access is allowed by the U-bus slave, the BIU continues current access as burstable, otherwise current access is executed as a single access. If any protection violation is detected by the IMPU, the current U-bus access is aborted by the BIU and an exception is signaled to the RCPU. Show cycle, program trace and debug port access attributes accompanying the RCPU access are forwarded by the BIU along with the U-bus access. 4.2.1.2 Decompression On Mode See Appendix A, "MPC562/MPC564 Compression Features" for explanation of the decompression on mode. 4.2.2 Burst Operation of the BBC The BBC may initiate and handle burst accesses on the U-bus. The BBCMCR[BE] bit determines whether the BBC operates burst cycles or not. Burst requests are enabled when the BE bit is set. The BBC handles non-wrap-around bursts with up to 4 data beats on the internal U-bus. NOTE The burst operation in the MPC561/MPC563 is useful if a user system implements burstable memory devices on the external bus. Otherwise the mode will cause performance degradation when running code from external memory. When the RCPU runs in serialized mode it is recommended that bursts be disabled by the BBC to speed up MPC561/MPC563 operation. Burst operation for decompression on and in debug mode is disabled regardless of BBCMCR[BE] bit setting. The BBC burst should be turned off if the USIU burst feature is enabled. 4.2.3 Access Violation Detection Instruction memory protection is assigned on a regional basis. Default operation of IMPU is done on a global region. The IMPU has control registers which contain the following information: region protection on/off, region base address, size and access permissions. Protection logic is activated only if the RCPU MSR[IR] bit is set. During each fetch request from the RCPU core to instruction memory, the address is compared to a value in the region base address of enabled regions. Any address matching the specific region within its appropriate size as defined in the region attribute register sets a match indication. When more than one match indication occurs, the effective region is the region with the highest priority. Priority is determined by region number. The lowest region number has the highest priority and the global region has lowest priority. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-5 Burst Buffer Controller 2 Module When no match happens, the effective region is the global region. The region attribute registers contain the region protection fields: PP, G, and CMPR. The protection fields are compared to address attributes issued by the RCPU. If the access is permitted, the address is passed to the BIU and further to the U-bus. Whenever the IMPU detects access violation, the following actions are taken: 1. The request forwarded to the BIU is canceled 2. The RCPU is informed that the requested address caused an access violation by exception request. However, if the required address contains a show cycle attribute, the BIU delivers the access onto the U-bus to obtain program tracking. The exception vector (address) that the RCPU issues for this exception has a 0x1300 offset in the RCPU exception vector table. The access violation status is provided in the RCPU SRR1 special purpose register. The encoding of the status bits is as follows: * SRR1 [1] = 0 * SRR1 [3] = Guarded storage * SRR1 [4] = Protected storage or compression violation * SRR1 [10] = 0 Only one bit is set at a time. 4.2.4 Slave Operation The BBC is operating as a U-bus slave when the IMPU registers, decompressor RAM (DECRAM) or ICDU registers are accessed from the U-bus. The IMPU register programming is done using PowerPC ISA mtspr/mfspr instructions. The ICDU configuration registers (DCCRs) and DECRAM are mapped into the chip memory space and accessed by load/store instructions. DCCR and DECRAM accesses may be disabled by BBCMCR[DCAE]. Refer to Section 4.6.2.1, "BBC Module Configuration Register (BBCMCR)." 4.2.5 Reset Behavior Upon soft reset, the BBC switches to an idle state and all pending U-bus accesses are ignored, the ICDU internal queue is flushed and the IMPU switches to a disabled state where all memory space is accessible for both user and supervisor. Hard reset sets some of the fields and bits in the BBC configuration registers to their default reset state. Some bits in the BBCMCR register get their values from the reset configuration word. All the registers are reset using HRESET; SRESET alone has no effect on them. MPC561/MPC563 Reference Manual, Rev. 1.2 4-6 Freescale Semiconductor Burst Buffer Controller 2 Module NOTE Because HRESET resets the EN_COMP bit and the EXC_COMP bit but SRESET does not, there may be different behavior between HRESET and SRESET when both EN_COMP and EXC_COMP are set. Special care must be taken to ensure operation in a known mode whenever reset occurs. The reset states of these bits are determined by reset configuration words. The location of the reset vector is dependent on the value of the MSR[IP] bit in the RCPU. If MSR[IP] is set, the exception table relocation feature can be used. See Section 4.3.1, "ETR Operation." 4.2.6 Debug Operation Mode When the MPC561/MPC563 RCPU core is in debug mode, the BBC initiates non-burstable access to the debug port and ICDU is bypassed (i.e., instructions transmitted to the debug port must be non-compressed regardless of RCPU MSR[DCMPEN] bit state). 4.3 Exception Table Relocation (ETR) The BBC is able to relocate the exception addresses of the RCPU. The relocation feature always maps the exception addresses into the internal memory space of the MPC561/MPC563. See Figure 4-2. This feature is important in multi-MPC561/MPC563 systems, where, although the memory map in some was shifted to not be on the lower 4 Mbytes, their RCPU cores can still access their own exception handlers in their internal Flash in spite of several RCPUs issuing the same exception addresses. The relocation also saves wasted space between the exception table entries in the case where each exception entry contained only a branch instruction to the exception routine, which is located elsewhere. The exception vector table may be programmed to be located in four places in the MPC561/MPC563 internal memory space. The exception table relocation is supported in both decompression on and decompression off operation modes. The RESET routine vector is relocated differently in decompression on and in decompression off modes. This feature may be used by a software code compression tool to guarantee that a vocabulary table initialization routine is always executed before application code is running. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-7 Burst Buffer Controller 2 Module Exception Pointer by Core Internal Memory Structure 0 0 Decompression ON Y 100 N branch to... 8 branch to... 10 branch to... branch to... branch to... 200 branch to... branch to... 300 branch to... branch to... 400 500 branch to... B8 branch to... . . . . 600 700 1F00 Exception Table branch to... . . . . branch to... branch to... Free Memory Space 1FFC 1FFC Figure 4-2. Exception Table Entries Mapping 4.3.1 ETR Operation The exception vectors generated by the RCPU are 0x100 bytes apart from each other, starting at address 0x0000 0100 or 0xFFF0 0100, depending on the value of MSR[IP] bit in the RCPU. If the exception table relocation is disabled by the ETRE bit in the BBCMCR register, the BBC transfers the exception fetch address to the U-bus of the MPC561/MPC563 with no interference. In this case, normal PowerPC ISA exception addressing is implemented. If the exception table relocation is enabled, the BBC translates the exception vector into the exception relocation address as shown in Table 4-1. At that location, a branch instruction with absolute addressing (ba) must be placed. Each ba instruction branches to the required exception routine. These branch instructions should be successive in that region of memory. That way, a table of branch instructions is implemented. Executing the branch instruction causes the core to branch twice until it gets to the exception routine. Each exception relocation table entry occupies two words to support decompression on mode, where a branch instruction can be more than 32 bits long. The branch table can be located in four locations in the internal memory, the location is defined by BBCMCR[OERC] as shown in Table 4-2. MPC561/MPC563 Reference Manual, Rev. 1.2 4-8 Freescale Semiconductor Burst Buffer Controller 2 Module NOTE The 8 Kbytes allocated for the original PowerPC ISA exception table can be almost fully utilized. This is possible if the MPC561/MPC563 system memory is not mapped to the exception address space, (i.e., the addresses 0xFFF0 0000 to 0xFFF0 1FFF are not used). In such case, these 8 Kbytes can be fully utilized by the compiler, except for the lower 64 words (256 bytes) which are dedicated for the branch instructions. If the RCPU, while executing an exception, issues any address between two successive exception entries (e.g., 0xFFF0 0104), then the operation of the MPC561/MPC563 is not guaranteed if the ETR is enabled. In order to activate the exception table relocation feature, the following steps are required: 1. Set the RCPU MSR[IP] bit 2. Set the BBCMCR[ETRE] bit. See Section 4.6.2.1, "BBC Module Configuration Register (BBCMCR)," for programming details. The ETR feature can be activated from reset, by setting corresponding bits in the reset configuration word. . Table 4-1. Exception Addresses Mapping Original Address Issues by Core Mapped Address by Exception Table Relocation Logic Reserved 0xFFF0 0000 Page_Offset+0x000 System Reset 0xFFF0 0100 Name of Exception Compression disabled Compression enabled Page_Offset1+0x08 Page_Offset1+0x0B8 Machine Check 0xFFF0 0200 Page_Offset+0x010 Reserved 0xFFF0 0300 Page_Offset+0x018 Reserved 0xFFF0 0400 Page_Offset+0x020 External Interrupt2 0xFFF0 0500 Page_Offset+0x028 Alignment 0xFFF0 0600 Page_Offset+0x030 Program 0xFFF0 0700 Page_Offset+0x038 Floating Point unavailable 0xFFF0 0800 Page_Offset+0x040 Decrementer 0xFFF0 0900 Page_Offset+0x048 Reserved 0xFFF0 0A00 Page_Offset+0x050 Reserved 0xFFF0 0B00 Page_Offset+0x058 System Call 0xFFF0 0C00 Page_Offset+0x060 Trace 0xFFF0 0D00 Page_Offset+0x068 Floating Point Assist 0xFFF0 0E00 Page_Offset+0x070 Implementation Dependent Software Emulation 0xFFF0 1000 Page_Offset+0x080 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-9 Burst Buffer Controller 2 Module Table 4-1. Exception Addresses Mapping (continued) Original Address Issues by Core Mapped Address by Exception Table Relocation Logic Implementation Dependent Instruction Storage Protection Error 0xFFF0 1300 Page_Offset+0x098 Implementation Dependent Data Storage Protection Error 0xFFF0 1400 Page_Offset+0x0A0 Implementation Dependent Data Breakpoint 0xFFF0 1C00 Page_Offset+0x0E0 Implementation Dependent Instruction Breakpoint 0x0FFF 1D00 Page_Offset+0x0E8 Implementation Dependent Maskable External Breakpoint 0xFFF0 1E00 Page_Offset+0x0F0 Non-Maskable External Breakpoint 0xFFF0 1F00 Page_Offset+0x0F8 Name of Exception 1 2 Refer to Table 4-2. 0x500 is remapped if the EEIR feature is enabled. See Section 4.3.2, "Enhanced External Interrupt Relocation (EEIR)." Table 4-2. Exception Relocation Page Offset BBCMCR(OERC[0:1]) 1 2 4.3.2 Page Offset 0x0 + ISB offset1 Comments 0 0 0 0 1 0x1 0000 + ISB offset 64 Kbytes2 1 0 0x8 0000 + ISB offset 512 Kbytes 1 1 0x3F E000 + ISB offset L-bus (CALRAM) Address ISB offset is equal 4M * ISB (0x400000 * ISB), where ISB is value of bit field in USIU IMMR register. This offset is different from the MPC555. Enhanced External Interrupt Relocation (EEIR) The BBC also supports the enhanced external interrupt model of the MPC561/MPC563 which allows the removal of the interrupt requesting a source detection stage from the interrupt routine. The interrupt controller provides the interrupt vector to the BBC together with an interrupt request to the RCPU. When the RCPU acknowledges an interrupt request, it issues an external interrupt vector to the BBC. The BBC logic detects this address and replaces it with another address corresponding to the interrupt controller vector, which is defined by the highest priority interrupt request from a peripherial module or external interrupt request pin. See Figure 4-3. The external interrupt relocation table should be placed at the physical address defined in the external interrupt relocation table base address register. See Section 4.6.2.5, "External Interrupt Relocation Table MPC561/MPC563 Reference Manual, Rev. 1.2 4-10 Freescale Semiconductor Burst Buffer Controller 2 Module Base Address Register (EIBADR)." This is the base address of a branch table. See Table 6-4 and Figure 4-3. Each table entry must contain a branch absolute (ba) instruction to the first instruction of an interrupt service routine. Each table entry occupies two words (eight bytes) to support decompression on mode, where a branch instruction can be more than 32 bits long. The memory space allocated for the external interrupt relocation table is up to 2 Kbytes. If part of the external interrupt relocation table entry is not used, it may be utilized for another purpose such as instruction code space or data space. In order to activate the external interrupt relocation feature, the following steps are required: 1. Program the EIBADR register to the external interrupt branch table base address. See Section 4.6.2.5, "External Interrupt Relocation Table Base Address Register (EIBADR)." 2. Set the MSR[IP] bit. 3. Set the BBCMCR[EIR] bit. See Section 4.6.2.1, "BBC Module Configuration Register (BBCMCR)," for programming details. NOTE If both the enhanced external interrupt relocation and exception table relocation functions are activated simultaneously, the final external interrupt vector is defined by EEIR mechanism. When the EEIR function is activated, any branch instruction execution with the 0xFFF0 0500 target address may cause unpredictable program execution. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-11 Burst Buffer Controller 2 Module Internal Memory Structure EIBADR Branch absolute to handler Branch absolute to handler Branch absolute to handler External Interrupt 0x500 Relocation Table Interrupt Vector Offset 000 Base Address (EIBADR) External Interrupt Handlers Table External Interrupt Vector Relocator Translated Vectors Interrupt Pointer by Core Branch absolute to handler Interrupt Code from Interrupt Controller Branch absolute to handler Main code can start here Figure 4-3. External Interrupt Vectors Splitting 4.4 Decompressor RAM (DECRAM) Functionality Decompressor RAM (DECRAM) is a part of the ICDU. It occupies a 2-Kbyte physical RAM array block. It is mapped both in the ICDU internal address space and in the chip memory address space. It is a single port memory and may not be accessed simultaneously from the ICDU and U-bus. MPC561/MPC563 Reference Manual, Rev. 1.2 4-12 Freescale Semiconductor Burst Buffer Controller 2 Module U-bus Address U-bus Data Slave BIU ICDU Vocabulary Table (VT1) Array (1 Kbyte) Vocabulary Table (VT2) Array (1 Kbyte) DECRAM VT1 Data VT1 Address VT2 Data VT2 Address ICDU Control Logic Figure 4-4. DECRAM Interfaces Block Diagram 4.4.1 General-Purpose Memory Operation In the case of decompression off mode, the DECRAM can serve as a two-clock access general-purpose RAM for U-bus instruction fetches or four-clock access for read/write data operations. The base address of the DECRAM is 0x2F 8000. See Figure 4-6. The proper access rights to the DECRAM array may be defined by programming the R, D, and S bits of the BBCMCR register: * Read/write or read only * Instruction/data or data only * Supervisor/user or supervisor only MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-13 Burst Buffer Controller 2 Module U-bus access mode of the RAM is activated by the BBCMCR[DCAE] bit setting (see Section 4.6.2.1, "BBC Module Configuration Register (BBCMCR)"). In this mode the DECRAM can be accessed from the U-bus and cannot be accessed by the ICDU logic. In this mode: * The DECRAM supports word, half-word and byte operations. * The DECRAM is emulated to be 32 bits wide. For example: a load access from offset 0 in the DECRAM will deliver the concatenation of the first word in each of the DECRAM banks when RAM 1 contains the 16 LSB of the word and RAM 2 contains the 16 MSB. * Load accesses at any width are supplied with 32 bits of valid data. * The DECRAM communicates with the U-bus pipeline but does not support pipelined accesses to itself. If a store operation is second in the U-bus pipe, the store is carried out immediately and the U-bus acknowledgment is performed when the previous transaction in the pipe completes. * Burst access is not supported. NOTE Instructions running from the DECRAM should not also perform store operations to the DECRAM. 4.4.1.1 Memory Protection Violations The DECRAM module does not acknowledge U-bus accesses that violate the configuration defined in the BBCMCR. This causes the machine check exception for the internal RCPU or an error condition for the MPC561/MPC563 external master. 4.4.1.2 DECRAM Standby Operation Mode The bus interface and DECRAM control logic are powered by VDD supply. The memory array is supplied by a separate power pin (IRAMSTBY). 4.5 Branch Target Buffer The burst buffer controller contains a branch target buffer (BTB) to reduce the impact of branches on processor performance. Following is a summary of the BTB features: * Software controlled BTB enable/disable, inhibit, and invalidate * User transparent -- no user management required The BTB consists of eight branch target entries (BTE). Refer to Figure 4-5. All entries are managed as a fully associative cache. Each entry contains a tag and several data buffers related to this tag. 4.5.1 BTB Operation When the RCPU generates a change of flow (COF) address for instruction fetch, the BTB control logic compares it to the tag values currently stored in the tag register file where the following events can happen: MPC561/MPC563 Reference Manual, Rev. 1.2 4-14 Freescale Semiconductor Burst Buffer Controller 2 Module * * BTE Miss -- The target address and instruction code data will be stored in one of the BTE entries defined by its control logic. Up to four instructions and their corresponding addresses subsequent to the COF target instruction may be saved in each BTE entry. The number of valid instructions currently stored in the BTE entry is written into the VDC field of the current BTE entry. The valid flag is set at the end of this process. The entry to be replaced upon miss is chosen based on FIFO replacement method. Thus the BTB can support up to eight different branch target addresses in a program loop. BTE Hit -- When the target address of a branch matches one of the valid BTE entries, two activities take place in parallel: -- The BTB supplies all the valid instructions in the matched entry to the RCPU. -- The BIU starts to prefetch new instructions (and ICDU decompresses them in compressed mode) from the address following the last instruction that is stored in the matched BTB entry. The BBC will supply these new instructions to the RCPU after all the stored instructions in the matched BTB entry were delivered. In case of a BTB hit, the impact of instruction decompression latency (in compressed mode) is eliminated as well as a latency of instruction storage memory device. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-15 Burst Buffer Controller 2 Module BTE TAG Register File BTE Memory Array 32-bit Instruction Address Tag Register/Comparator Next Address VDC Hit V Instruction Buffers Tag Register/Comparator Next Address VDC Hit V Instruction Buffers Tag Register/Comparator Next Address VDC Hit V Instruction Buffers Tag Register/Comparator Next Address VDC Hit Tag Register/Comparator Next Address VDC Hit VDC Hit VDC Hit VDC Instruction Buffers V Tag Register/Comparator Next Address Instruction Buffers V Tag Register/Comparator Next Address Instruction Buffers V Tag Register/Comparator Next Address Instruction Buffers V Hit Instruction Buffers V BTB Hit Figure 4-5. BTB Block Diagram 4.5.1.1 BTB Invalidation Write access to any BBC special purpose register invalidates all BTB entries. NOTE To guarantee that the BTB does not contain instructions that may have been changed, the BTB contents should be invalidated any time instruction memory is modified. 4.5.1.2 BTB Enabling/Disabling The BTB operation may be enabled or disabled by programming the BTEE bit in the BBCMCR register. 4.5.1.3 BTB Inhibit Regions The BTB operation may be inhibited regarding some memory regions. The BTB caching is inhibited for a region if the BTBINH bit is set in the region attribute register (or global region attribute register). See MPC561/MPC563 Reference Manual, Rev. 1.2 4-16 Freescale Semiconductor Burst Buffer Controller 2 Module Section 4.6.2.3, "Region Attribute Registers (MI_RA[0:3])," and Section 4.6.2.4, "Global Region Attribute Register (MI_GRA)" for details. 4.6 BBC Programming Model 4.6.1 Address Map The BBC consists of three separately addressable sections within the internal chip address space: 1. BBC and IMPU control registers. These are mapped in the SPR registers area and may be programmed by using the RCPU mtspr/mfspr instructions. 2. Decompressor vocabulary RAM (DECRAM). The DECRAM array occupies the 2-Kbyte physical memory (8 Kbytes of the MPC561/MPC563 address space is allocated for DECRAM). 3. Decompressor class configuration registers (DCCR) block. It consists of 15 decompression class configuration registers. These registers are available for word wide read/write accesses through U-bus. The registers occupy a 64-byte physical block (8-Kbyte chip address space is allocated for the register block). 0x2F 8000 0x2F 87FF 0x2F 8800 DECRAM 2 Kbytes Reserved 0x2F 9FFF 0x2F A000 DCCR0 - DCCR15 0x2F A03F Figure 4-6. MPC561/MPC563 Memory Map 4.6.1.1 BBC Special Purpose Registers (SPRs) Table 4-3. BBC SPRs SPR Number (Decimal) Address for External Master Access (Hex) 528 0x2100 IMPU Global Region Attribute Register (MI_GRA). See Table 4-8 for bits descriptions. 529 0x2300 External Interrupt Relocation Table Base Address Register (EIBADR). See Table 4-9 for bits descriptions. 560 0x2110 BBC Module Configuration Register (BBCMCR). See Table 4-4 for bits descriptions Register Name MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-17 Burst Buffer Controller 2 Module Table 4-3. BBC SPRs (continued) SPR Number (Decimal) Address for External Master Access (Hex) 784 0x2180 IMPU Region Base Address Register 0 (MI_RBA0). See Table 4-5 for bits descriptions. 785 0x2380 IMPU Region Base Address Register 1 (MI_RBA1). See Table 4-5 for bits descriptions. 786 0x2580 IMPU Region Base Address Register 2 (MI_RBA2). See Table 4-5 for bits descriptions. 787 0x2780 IMPU Region Base Address Register 3 (MI_RBA3). See Table 4-5 for bits descriptions. 816 0x2190 IMPU Region Attribute Register 0 (MI_RA0). See Table 4-6 for bits descriptions. 817 0x2390 IMPU Region Attribute Register 1 (MI_RA1). See Table 4-6 for bits descriptions. 818 0x2590 IMPU Region Attribute Register 2 (MI_RA2). See Table 4-6 for bits descriptions. 819 0x2790 IMPU Region Attribute Register 3 (MI_RA3). See Table 4-6 for bits descriptions. Register Name All the above registers may be accessed in the supervisor mode only. An exception is internally generated by the RCPU if there is an attempt to access them in user mode. An external master receives a transfer error acknowledge when attempting to access a register in user mode. NOTE If one of these registers is written within 4 instructions of a branch target, the user application may crash. To prevent this, ensure that any instruction writing to these registers is preceded by 4 instructions that are not the target of any branch, and is followed by an isync instruction. 4.6.1.2 DECRAM and DCCR Block The DECRAM occupies addresses from 0x2F 8000 to 0x2F 87FF. The DCCR block occupies addresses from 0x2F A000 to 0x2F A03F. The address for non-implemented memory blocks is not acknowledged, and causes an error condition. MPC561/MPC563 Reference Manual, Rev. 1.2 4-18 Freescale Semiconductor Burst Buffer Controller 2 Module 4.6.2 BBC Register Descriptions 4.6.2.1 BBC Module Configuration Register (BBCMCR) , MSB Field 0 1 2 R D S 3 4 5 6 7 8 9 10 TEST HRESET 11 12 13 14 15 -- 0000_0000_0000_0000 LSB 16 Field HRESET 17 -- 18 BE 19 21 ETRE EIR ID192 000 20 0 22 23 1 EN_ EXC_COMP COMP1 ID212 ID222 Addr 24 25 26 DECOMP_SC_ OERC[0:1] BTEE EN1 ID212 ID(24:25)2 27 28 29 -- 30 31 DCAE TST 00_0000 SPR 560 Figure 4-7. BBC Module Configuration Register (BBCMCR) 1 MPC562/MPC564 only. 2 The reset value is a reset configuration word value extracted from the internal bus line. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." Table 4-4. BBCMCR Field Descriptions Bits Name Description 0 R Read Only. Any attempt to write to the DECRAM array while R is set is terminated with an error. This causes a machine check exception for RCPU. 0 DECRAM array is Readable and Writable. 1 DECRAM array is Read only. 1 D Data Only. The DECRAM array may be used for Instructions and Data or for Data storage only. Any attempt to load instructions from the DECRAM array, while D is set, is terminated with an error This causes a machine check exception for the RCPU. 0 DECRAM array holds Data and/or Instruction. 1 DECRAM array holds Data only. 2 S Supervisor Only. When the bit is set (S = 1), only a Supervisor program may access the DECRAM. If a Supervisor program is accessing the array, normal read/write operation will occur. If a User program is attempting to access the array, the access will be terminated with an error This causes a machine check exception for the RCPU. If S = 0, the RAM array is placed in Unrestricted Space and access by both Supervisor and User programs is allowed. 3:7 TEST 8:17 -- 18 BE1 These bits can be set in Factory test mode only. The User should treat these bits as reserved and always write as zeros. Reserved Burst Enable 0 Burst access is disabled. 1 Burst access is enabled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-19 Burst Buffer Controller 2 Module Table 4-4. BBCMCR Field Descriptions (continued) Bits Name Description 19 ETRE Exception Table Relocation Enable 0 Exception Table Relocation is off: BBC does NOT map exception addresses. 1 Exception Table Relocation is on: BBC maps exception addresses to a table holding branch instructions two memory words apart from each other. The reset value is taken from the reset configuration word bit 19. Note: On the MPC562/MPC564, do not put compressed code at addresses 0xFFF0 0000 to 0xFFFF FFFF if ETRE = 1. 20 EIR Enhanced External Interrupt Relocation Enable-- This bit activates the external interrupt relocation table mechanism. This bit is independent from the value of ETRE bit, but if EIR and ETRE are enabled, the mapping of external interrupt will be via EIR. 0 EIR function is disabled. 1 EIR function is active. 21 EN_COMP2 Enable Compression. This bit enables the operation of the MPC562/MPC564 in compression on mode. NOTE: For Rev A and later versions of the MPC563 and rev B and later of the MPC561, the default state is defined by bit 21 of the reset configuration word, and is writable. In earlier versions, the bit can only be set by the reset configuration word. 0 decompression on mode is disabled. 1 decompression on mode is enabled. The MPC561/MPC563 operates only in decompression off mode. The MPC562/MPC564 may operate with both decompression on and decompression off modes. 22 EXC_COMP2 Exception Compression. This bit determines the operation of the MPC562/MPC564 with exceptions. If this bit is set, the MPC562/MPC564 assumes that the all exception routine codes are compressed; otherwise it is assumed that all exception routine codes are not compressed. The reset value is determined by reset configuration word bit 22. 0 The RCPU assumes that exception routines are noncompressed. 1 The RCPU assumes that all exception routines are compressed. This bit has effects only when the EN_COMP bit is set. The MPC561/MPC563 operates only in decompression off mode. The MPC562/MPC564 may operate with both decompression on and decompression off modes. 23 DECOMP_SC_EN2 Decompression Show Cycle Enable. This bit determines the way the MPC562/MPC564 executes instruction show cycles. The reset value is determined by configuration word bit 21. For further details regarding show cycles execution in "Decompression ON" mode see Section 4.2.1.2, "Decompression On Mode." 0 Decompression Show Cycles do not include the bit pointer. 1 Decompression Show Cycles include the bit pointer information on the data bus. 24:25 OERC[0:1] Other Exceptions Relocation Control. These bits have effect only if ETRE was enabled; See details in Section 4.3.1, "ETR Operation." 00: offset 0 01 Offset 64 Kbytes 10 Offset 512 Kbytes 11 Offset to 0x003FE000 The reset value is determined by reset configuration word bits 24 and 25 26 BTEE1 Branch Target Entries Enable. This bit enables Branch Target Entries of BTB operation 0 BTE operation is disabled 1 BTE operation is enabled MPC561/MPC563 Reference Manual, Rev. 1.2 4-20 Freescale Semiconductor Burst Buffer Controller 2 Module Table 4-4. BBCMCR Field Descriptions (continued) 1 2 Bits Name 27:29 -- 30 DCAE 31 TST Description Reserved. NOTE: Bit 27 was BCMEE and should be written as 0. Decompressor Configuration Access Enable. This bit enables DECRAM and DCCR registers access from the U-bus master (i.e., RCPU, external master). 0 DECRAM and DCCR registers are locked. 1 DECRAM allows accesses from the U-bus only. DCAE bit should be set before vocabulary tables are loaded via the U-bus. Reserved for BBC Test Operations. BE and BTEE should not both be set at the same time, setting the BE bit disables the BTB. This bit is available on the MPC562/MPC564 only, software should write "0" to this bit for MPC561/MPC563. NOTE When writing to the BBCMCR register, the following instruction after mtspr BBCMCR, Rx should be ISYNC, to make sure that the programmed value will come into effect before any further action. 4.6.2.2 Region Base Address Registers (MI_RBA[0:3]) The following registers contain 32 bits and define the starting address of the protected regions. There is one register for each of four regions. , MSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 25 26 27 28 29 30 15 RA HRESET Unchanged LSB 16 17 Field HRESET 18 19 20 21 22 23 24 RA -- Undefined 0000_0000_0000 Addr 31 SPR 784 (MI_RBA0), SPR 785 (MI_RBA1), SPR 786 (MI_RBA2), SPR 787 (MI_RBA3) Figure 4-8. Region Base Address Register (MI_RBA[0:3]) Table 4-5. MI_RBA[0:3] Registers Bit Descriptions Bits Name Description 0:19 RA Region Base address. The RA field provides the base address of the region. The region base address should start on the memory block boundary for the corresponding region size, specified in the region attribute register MI_RA. 20:31 -- Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-21 Burst Buffer Controller 2 Module NOTE When the MPC562/MPC564 operates in decompression on mode, a minimum of four unused words MUST be left after the last instruction in any region. 4.6.2.3 Region Attribute Registers (MI_RA[0:3]) The following registers define protection attributes and size for four memory regions. , MSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 25 26 27 28 29 30 15 RS HRESET Unchanged LSB 16 17 Field 18 19 RS HRESET 21 PP Undefined Addr 20 22 23 -- 24 G 000 CMPR BTBINH Undefined 31 -- 000 SPR 816 (MI_RA0), SPR 817 (MI_RA1), SPR 818 (MI_RA2), 819 (MI_RA3) Figure 4-9. Region Attribute Register (MI_RA0[0:3]) Table 4-6. MI_RA[0:3] Registers Bit Descriptions Bits Name Description 0:19 RS Region size. For byte size by region, see Table 4-7. 20:21 PP1 Protection bits: 00 Supervisor -- No Access, User -- No Access. 01 Supervisor -- Fetch, User -- No Access. 1x Supervisor -- Fetch, User -- Fetch. 22:24 -- Reserved 25 G1 Guard attribute for region 0 Speculative fetch is not prohibited from region. Region is not guarded. 1 Speculative fetch is prohibited from guarded region. An exception will occur under such attempt. 26:27 CMPR2 Compressed Region. x0 The region in not restricted 01 Region is considered a non-compressed code region. Access to the region is allowed only in "Decompression Off" mode 11 Region is considered a compressed code region. Access to the region is allowed only in "Decompression On" mode 28 BTBINH BTB Inhibit region 0 BTB operation is not prohibited for current memory region 1 BTB operation is prohibited for current memory region. 29:31 -- Reserved 1 G and PP attributes perform similar protection activities on a region. The more protective attribute will be implied on the region if the attributes programming oppose each other. 2 This field is available only on the MPC562/MPC564. MPC561/MPC563 Reference Manual, Rev. 1.2 4-22 Freescale Semiconductor Burst Buffer Controller 2 Module Table 4-7. Region Size Programming Possible Values RS Field Value (Binary) 4.6.2.4 Size 0000_0000_0000_0000_0000 4 Kbytes 0000_0000_0000_0000_0001 8 Kbytes 0000_0000_0000_0000_0011 16 Kbytes 0000_0000_0000_0000_0111 32 Kbytes 0000_0000_0000_0000_1111 64 Kbytes 0000_0000_0000_0001_1111 128 Kbytes 0000_0000_0000_0011_1111 256 Kbytes 0000_0000_0000_0111_1111 512 Kbytes 0000_0000_0000_1111_1111 1 Mbyte 0000_0000_0001_1111_1111 2 Mbytes 0000_0000_0011_1111_1111 4 Mbytes 0000_0000_0111_1111_1111 8 Mbytes 0000_0000_1111_1111_1111 16 Mbytes 0000_0001_1111_1111_1111 32 Mbytes 0000_0011_1111_1111_1111 64 Mbytes 0000_0111_1111_1111_1111 128 Mbytes 0000_1111_1111_1111_1111 256 Mbytes 0001_1111_1111_1111_1111 512 Mbytes 0011_1111_1111_1111_1111 1 Gbyte 0111_1111_1111_1111_1111 2 Gbytes 1111_1111_1111_1111_1111 4 Gbytes Global Region Attribute Register (MI_GRA) The MI_GRA register defines protection attributes for memory region, not covered by MI_RB[0:3]/MI_RBA[0:3] registers. It also contains protection regions 0-3 enable bits. , MSB 0 1 2 3 4 5 6 7 8 9 Field ENR 0 ENR1 ENR2 ENR3 10 11 12 13 14 27 28 29 30 15 -- HRESET 0000_0000_0000_0000 LSB 16 17 Field HRESET Addr 18 -- 19 20 21 PP 22 23 24 -- 25 G 26 CMPR BTBINH 31 -- 0000_0000_0000_0000 SPR 528 Figure 4-10. Global Region Attribute Register (MI_GRA) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-23 Burst Buffer Controller 2 Module Table 4-8. MI_GRA Field Descriptions 1 Bits Name Description 0 ENR0 Enable IMPU Region 0 0 Region 0 is off. 1 Region 0 is on. 1 ENR1 Enable IMPU Region 1 0 Region 1 is off. 1 Region 1 is on. 2 ENR2 Enable IMPU Region 2 0 Region 2 is off. 1 Region 2 is on. 3 ENR3 Enable IMPU Region 3 0 Region 3 is off. 1 Region 3 is on. 4:19 -- Reserved 20:21 PP Protection Bits 00 Supervisor - No Access, User - No Access. 01 Supervisor - Fetch, User - No Access. 1x Supervisor - Fetch, User - Fetch. 22:24 -- Reserved 25 G Guard attribute for region 0 Fetch is not prohibited from region. Region is not guarded. 1 Fetch is prohibited from guarded region. An exception will occur under such attempt. 26:27 CMPR1 Compressed Region. x0 The region is not restricted 01 Region is considered a non-compressed code region Access to the region is allowed only in "Decompression Off" mode 11 Region is considered a compressed code region. Access to the region is allowed only in "Decompression On" mode 28 BTBINH BTB Inhibit region 0 BTB operation is not prohibited for current memory region 1 BTB operation is prohibited for current memory region. 29:31 -- Reserved This field is available only on the MPC562/MPC564. NOTE The MI_GRA register should be programmed to enable fetch access (PP and G bits) before RCPU MSR[IR] is set. MPC561/MPC563 Reference Manual, Rev. 1.2 4-24 Freescale Semiconductor Burst Buffer Controller 2 Module 4.6.2.5 External Interrupt Relocation Table Base Address Register (EIBADR) , MSB 0 LSB 1 2 Field HRESET 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 BA -- Unchanged 000_0000_0000 31 Figure 4-11. External Interrupt Relocation Table Base Address Register (EIBADR) Table 4-9. EIBADR External Interrupt Relocation Table Base Address Register Bit Descriptions Bits Name 0:20 BA External Interrupt Relocation Table Base Address bits [0:20] 21:31 -- Reserved. EIBADR must be set on a 4K page boundary. 4.6.3 Description Decompressor Class Configuration Registers See Section A.4, "Decompressor Class Configuration Registers (DCCR0-15)" for the registers of the ICDU. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 4-25 Burst Buffer Controller 2 Module MPC561/MPC563 Reference Manual, Rev. 1.2 4-26 Freescale Semiconductor Chapter 5 Unified System Interface Unit (USIU) Overview The unified system interface unit (USIU) of the MPC561/MPC563 consists of several functional modules that control system start-up, system initialization and operation, system protection, and the external system bus. The MPC561/MPC563 USIU functions include the following and are discussed in the designated chapters: * System configuration and protection with GPIO capability and an enhanced interrupt controller. Refer to Chapter 6, "System Configuration and Protection." * System reset monitoring and generation, refer to Chapter 7, "Reset." * Clock synthesis, power management, and debug support. Refer to Chapter 8, "Clocks and Power Control." * External bus interface (EBI), refer to Chapter 9, "External Bus Interface." * Memory controller that supports four memory banks. Refer to Chapter 10, "Memory Controller." The USIU provides system configuration and protection features that control the overall system configuration and supply various monitors and timers including the bus monitor, software watchdog timer, periodic interrupt timer, decrementer, time base, and real-time clock. Freeze support and low power stop is provided. The interrupt controller supports up to eight external interrupts, eight levels for all internal USIU interrupt sources and 32 levels for internal peripheral modules on the IMB bus. It has an enhanced mode of operation, which simplifies the MPC561/MPC563 interrupt structure and speeds up interrupt processing. Additionally, the USIU provides several pinout configurations that allow up to 64 general-purpose I/O, external 32-bit port that supports internal and external masters, and various debug functions. Reset logic for the MPC561/MPC563 provides soft and hard resets, checkstop and watchdog resets, and other types of reset. The reset status register (RSR) reflects the most recent source to cause a reset. The clock synthesizer generates the clock signals used by the USIU as well as the other modules and external devices. This circuitry can generate a system clock from a range of crystals, typically in the 4 MHz or 20 MHz range. The USIU supports various low-power modes. Each one supplies a different range of power consumption, functionality and wake-up time. Refer to Chapter 8, "Clocks and Power Control," for details. The EBI handles the transfer of information between the internal busses and the memory or peripherals in the external address space. The MPC561/MPC563 is designed to allow external bus masters to request and obtain mastership of the system bus, and if required access the on-chip memory and registers. Refer to Chapter 9, "External Bus Interface," for details. The memory controller module provides glueless interface to many types of memory devices and peripherals. It supports up to four memory banks. Refer to Chapter 10, "Memory Controller," for details. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 5-1 Unified System Interface Unit (USIU) Overview The USIU supports the internal Flash censorship mechanism on the MPC561/MPC563 to protect the Flash contents. Refer to Chapter 21, "CDR3 Flash (UC3F) EEPROM." It is not possible to operate the MPC561/MPC563 from the external world while the Flash is in censorship mode and in a censorship state. The internal Flash array will be either locked or accessible only after the entire array contents have been erased. The MPC561/MPC563 is in censored mode if one of the following events occurs: * booting from external memory * operating in peripheral mode or if accessed from an external master * operating in debug mode (BDM or Nexus) Figure 5-1 shows the USIU block diagram. USIU Memory Control Lines Memory Controller U-Bus U-bus Interface Address E-bus Interface E-Bus * * * * * * * * Configuration Registers Software Watchdog Bus Monitor Periodic Interrupt Timer and Decrementer Real-time Clock Debug Pin Multiplexing Interrupt Controller Sub bus Data Slave Interface SGPIO Clocks & Reset Figure 5-1. USIU Block Diagram 5.1 Memory Map and Registers Table 5-1 is an address map of the USIU registers and, unless otherwise noted, registers are 32 bits wide. The address shown for each register is relative to the base address of the MPC561/MPC563 internal memory map. The internal memory block can reside in one of eight possible 4 Mbyte memory spaces. See Figure 1-3 for details. MPC561/MPC563 Reference Manual, Rev. 1.2 5-2 Freescale Semiconductor Unified System Interface Unit (USIU) Overview Table 5-1. USIU Address Map Address Register 0x2F C000 USIU Module Configuration Register (SIUMCR) See Table 6-7 for bit descriptions. 0x2F C004 System Protection Control Register (SYPCR) See Table 6-15 for bit descriptions. 0x2F C008 Reserved 0x2F C00E1 Software Service Register (SWSR) See Table 6-16 for bit descriptions. 0x2F C010 Interrupt Pending Register (SIPEND). 0x2F C014 Interrupt Mask Register (SIMASK) See Section 6.2.2.2.4, "SIU Interrupt Mask Register (SIMASK)," for bit descriptions. 0x2F C018 Interrupt Edge Level Mask (SIEL) See Section 6.2.2.2.7, "SIU Interrupt Edge Level Register (SIEL)," for bit descriptions. 0x2F C01C Interrupt Vector (SIVEC) See Section 6.2.2.2.8, "SIU Interrupt Vector Register (SIVEC)," for bit descriptions. 0x2F C020 Transfer Error Status Register (TESR) See Table 6-17 for bit descriptions. 0x2F C024 USIU General-Purpose I/O Data Register (SGPIODT1) See Table 6-23 for bit descriptions. 0x2F C028 USIU General-Purpose I/O Data Register 2 (SGPIODT2) See Table 6-24 for bit descriptions. 0x2F C02C USIU General-Purpose I/O Control Register (SGPIOCR) See Table 6-25 for bit descriptions. 0x2F C030 External Master Mode Control Register (EMCR) See Table 6-13 for bit descriptions. 0x2F C038 Pads Module Configuration Register 2 (PDMCR2) See Table 2-6 for bit descriptions. 0x2F C03C Pads Module Configuration Register (PDMCR) See Table 2-5 for bit descriptions. 0x2F C040 Interrupt Pend2 Register (SIPEND2) See Section 6.2.2.2.2, "SIU Interrupt Pending Register 2 (SIPEND2)," for bit descriptions. 0x2F C044 Interrupt Pend3 Register (SIPEND3) See Section 6.2.2.2.3, "SIU Interrupt Pending Register 3 (SIPEND3)," for bit descriptions. 0x2F C048 Interrupt Mask2 Register (SIMASK2) See Section 6.2.2.2.5, "SIU Interrupt Mask Register 2 (SIMASK2)," for details. 0x2F C04C Interrupt Mask3 Register (SIMASK3) See Section 6.2.2.2.6, "SIU Interrupt Mask Register 3 (SIMASK3)," for details. 0x2F C050 Interrupt In-Service2 Register (SISR2) See Section 6.2.2.2.9, "Interrupt In-Service Registers (SISR2 and SISR3)," for details. 0x2F C054 Interrupt In-Service3 Register (SISR3) See Section 6.2.2.2.9, "Interrupt In-Service Registers (SISR2 and SISR3)," for details. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 5-3 Unified System Interface Unit (USIU) Overview Table 5-1. USIU Address Map (continued) Address 0x2F C0FC-0x2F C0FF Register Reserved Memory Controller Registers 0x2F C100 Base Register 0 (BR0) See Table 10-8 for bit descriptions. 0x2F C104 Option Register 0 (OR0) See Table 10-10 for bit descriptions. 0x2F C108 Base Register 1 (BR1) See Table 10-8 for bit descriptions. 0x2F C10C Option Register 1 (OR1) See Table 10-10 for bit descriptions. 0x2F C110 Base Register 2 (BR2) See Table 10-8 for bit descriptions. 0x2F C114 Option Register 2 (OR2) See Table 10-10 for bit descriptions. 0x2F C118 Base Register 3 (BR3) See Table 10-8 for bit descriptions. 0x2F C11C Option Register 3 (OR3) See Table 10-10 for bit descriptions. 0x2F C120-0x2F C13C Reserved 0x2F C140 Dual-Mapping Base Register (DMBR) See Table 10-11 for bit descriptions. 0x2F C144 Dual-Mapping Option Register (DMOR) See Table 10-12 for bit descriptions. 0x2F C148-0x2F C174 Reserved 0x2F C1781 0x2F C17A-0x2F C1FC Memory Status (MSTAT) See Table 10-7 for bit descriptions. Reserved System Integration Timers 0x2F C200 Time Base Status and Control (TBSCR) See Table 6-18 for bit descriptions. 0x2F C204 Time Base Reference 0 (TBREF0) See Section 6.2.2.4.3, "Time Base Reference Registers (TBREF0 and TBREF1)," for bit descriptions. 0x2F C208 Time Base Reference 1 (TBREF1) See Section 6.2.2.4.3, "Time Base Reference Registers (TBREF0 and TBREF1)," for bit descriptions. 0x2F C20C-0x2F C21C Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 5-4 Freescale Semiconductor Unified System Interface Unit (USIU) Overview Table 5-1. USIU Address Map (continued) Address Register 0x2F C220 Real-Time Clock Status and Control (RTCSC) See Table 6-19 for bit descriptions. 0x2F C224 Real-Time Clock (RTC) See Section 6.2.2.4.6, "Real-Time Clock Register (RTC)," for bit descriptions. 0x2F C228 Real-Time Alarm Seconds (RTSEC) -- Reserved 0x2F C22C Real-Time Alarm (RTCAL) See Section 6.2.2.4.7, "Real-Time Clock Alarm Register (RTCAL)," for bit descriptions. 0x2F C230-0x2F C23C Reserved 0x2F C240 PIT Status and Control (PISCR) See Table 6-20 for bit descriptions. 0x2F C244 PIT Count (PITC) See Table 6-21 for bit descriptions. 0x2F C248 PIT Register (PITR) See Table 6-22 for bit descriptions. 0x2F C24C-0x2F C27C Reserved Clocks and Reset 0x2F C280 System Clock Control Register (SCCR) See Table 8-9 for bit descriptions. 0x2F C284 PLL Low-Power and Reset Control Register (PLPRCR) See Table 8-11 for bit descriptions. 0x2F C2881 Reset Status Register (RSR) See Table 7-3 for bit descriptions. 0x2F C28C1 Change of Lock Interrupt Register (COLIR) See Table 8-12 for bit descriptions. 0x2F C2901 IRAMSTBY Control Register (VSRCR) See Table 8-13 for bit descriptions. 0x2F C294-0x2F C2FC Reserved System Integration Timer Keys 0x2F C300 Time Base Status and Control Key (TBSCRK) See Table 8-8 for bit descriptions. 0x2F C304 Time Base Reference 0 Key (TBREF0K) See Table 8-8 for bit descriptions. 0x2F C308 Time Base Reference 1 Key (TBREF1K) See Table 8-8 for bit descriptions. 0x2F C30C Time Base and Decrementor Key (TBK) See Table 8-8 for bit descriptions. 0x2F C310-0x2F C31C Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 5-5 Unified System Interface Unit (USIU) Overview Table 5-1. USIU Address Map (continued) Address Register 0x2F C320 Real-Time Clock Status and Control Key (RTCSCK) See Table 8-8 for bit descriptions. 0x2F C324 Real-Time Clock Key (RTCK) See Table 8-8 for bit descriptions. 0x2F C328 Real-Time Alarm Seconds Key (RTSECK) See Table 8-8 for bit descriptions. 0x2F C32C Real-Time Alarm Key (RTCALK) See Table 8-8 for bit descriptions. 0x2F C330-0x2F C33C Reserved 0x2F C340 PIT Status and Control Key (PISCRIK) See Table 8-8 for bit descriptions. 0x2F C344 PIT Count Key (PITCK) See Table 8-8 for bit descriptions. 0x2F C348-0x2F C37C Reserved Clocks and Reset Keys 0x2F C380 System Clock Control Key (SCCRK) See Table 8-8 for bit descriptions. 0x2F C384 PLL Low-Power and Reset Control Register Key (PLPRCRK) See Table 8-8 for bit descriptions. 0x2F C388 Reset Status Register Key (RSRK) See Table 8-8 for bit descriptions. 0x2F C38C-0x2F C3FC 1 5.1.1 Reserved 16-bit register. USIU Special-Purpose Registers Table 5-2 lists the MPC561/MPC563 special purpose registers (SPR) used by the USIU. These registers reside in an alternate internal memory space that can only be accessed with the mtspr and mfspr instructions, or from an external master (refer to Section 6.1.2, "External Master Modes," for details). All registers are 32 bits wide. NOTE RCPU special purpose registers cannot be accessed by an external master. Only SPRs in the USIU can be accessed by an external master. MPC561/MPC563 Reference Manual, Rev. 1.2 5-6 Freescale Semiconductor Unified System Interface Unit (USIU) Overview Table 5-2. USIU Special-Purpose Registers Internal Address[0:31] 1 Decimal Address spr[5:9]:spr[0:4]1 Register 0x2C00 Decrementer (DEC). See Section 3.9.5, "Decrementer Register (DEC)," for more information. 22 0x1880 Time Base Lower -- Read (TBL). See Section 6.2.2.4.2, "Time Base SPRs (TB)," for bit descriptions. 268 0x1A80 Time Base Upper -- Read (TBU). See Section 6.2.2.4.2, "Time Base SPRs (TB)," for bit descriptions. 269 0x3880 Time Base Lower -- Write (TBL). SeeSee Section 6.2.2.4.2, "Time Base SPRs (TB)," for bit descriptions. 284 0x3A80 Time Base Upper -- Write (TBU). See Section 6.2.2.4.2, "Time Base SPRs (TB)," for bit descriptions. 285 0x3D30 Internal Memory Mapping Register (IMMR). See Table 6-12 for bit descriptions. 638 Bits [0:17] and [28:31] are all 0. Table 5-3 shows the MPC561/MPC563 address format for special purpose register access. For an external master, accessing an MPC500 SPR, address bits [0:17] and [28:31] are compared to zeros to confirm that an SPR access is valid. See Section 6.1.2.1, "Operation in External Master Modes," for more details. . Table 5-3. Hex Address Format for SPR Cycles A[0:17] A[18:22] A[23:27] A[28:31] 0 spr5:9 spr0:4 0 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 5-7 Unified System Interface Unit (USIU) Overview MPC561/MPC563 Reference Manual, Rev. 1.2 5-8 Freescale Semiconductor Chapter 6 System Configuration and Protection The MPC561/MPC563 incorporateDMAes many system functions that normally must be provided in external circuits. In addition, it is designed to provide maximum system safeguards against hardware and software faults. The system configuration and protection sub-module provides the following features: * System Configuration (Section 6.1.1, "System Configuration")--The USIU allows the configuration of the system according to the particular requirements. The functions include control of show cycle operation, pin multiplexing, and internal memory map location. System configuration also includes a register containing part and mask number constants to identify the part in software. * External Master Modes Support (Section 6.1.2, "External Master Modes")--External master modes are special modes of operation that allow an alternate master on the external bus to access the internal modules for debugging and backup purposes. * General-Purpose I/O (Section 6.1.3, "USIU General-Purpose I/O ")--The USIU provides 64 pins for general-purpose I/O. The SGPIO pins are multiplexed with the address and data pins. * Enhanced Interrupt Controller (Section 6.1.4, "Enhanced Interrupt Controller")--The interrupt controller receives interrupt requests from a number of internal and external sources and directs them on a single interrupt-request line to the RCPU. * Bus Monitor (Section 6.1.5, "Hardware Bus Monitor")--The SIU provides a bus monitor to watch internal to external accesses. It monitors the transfer acknowledge (TA) response time for internal to external transfers. A transfer error acknowledge (TEA) is asserted if the TA response limit is exceeded. This function can be disabled. * Decrementer (Section 6.1.6, "Decrementer (DEC)")--The DEC is a 32-bit decrementing counter defined by the MPC500 architecture to provide a decrementer interrupt. This binary counter is clocked by the same frequency as the time base (also defined by the MPC561/MPC563 architecture). The period for the DEC when driven by a 4-MHz oscillator can be up to 4295 seconds, which is approximately 71.6 minutes. Refer to Table 6-6. * Time Base Counter (Section 6.1.7, "Time Base (TB)")--The TB is a 64-bit counter defined by the MPC500 architecture to provide a time base reference for the operating system or application software. The TB has four independent reference registers that can generate a maskable interrupt when the time-base counter reaches the value programmed in one of the four reference registers. The associated bit in the TB status register will be set for the reference register which generated the interrupt. * Real-Time Clock (Section 6.1.8, "Real-Time Clock (RTC)")--The RTC is used to provide time-of-day information to the operating system or application software. It is composed of a 45-bit counter and an alarm register. A maskable interrupt is generated when the counter reaches the value programmed in the alarm register. The RTC is clocked by the same clock as the PIT. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-1 System Configuration and Protection * * * * Periodic Interrupt Timer (Section 6.1.9, "Periodic Interrupt Timer (PIT)")--The SIU provides a timer to generate periodic interrupts for use with a real-time operating system or the application software. The PIT provides a period from 1 s to 4 seconds with a four-MHz crystal or 200 ns to 0.8 ms with a 20-MHz crystal. The PIT function can be disabled. Software Watchdog Timer (Section 6.1.10, "Software Watchdog Timer (SWT)")--The SWT asserts a reset or non-maskable interrupt, as selected by the system protection control register (SYPCR), if the software fails to service the SWT for a designated period of time (e.g., because the software is trapped in a loop or lost). After a system reset, this function is enabled with a maximum time-out period and asserts a system reset if the time-out is reached. The SWT can be disabled or its time-out period can be changed in the SYPCR. Once the SYPCR is written, it cannot be written again until a system reset. Freeze Support (Section 6.1.11, "Freeze Operation")--The SIU allows control of whether the SWT, PIT, TB, DEC, and RTC should continue to run during freeze mode. Low Power Stop (Section 6.1.12, "Low Power Stop Operation")--In low power modes, specific timers are frozen but others are not. Figure 6-1 shows a block diagram of the system configuration and protection logic. MPC561/MPC563 Reference Manual, Rev. 1.2 6-2 Freescale Semiconductor System Configuration and Protection Module Configuration Internal and External Interrupt Requests TA Interrupt Controller Bus Monitor TS Clock TEA Periodic Interrupt Timer Interrupt Software Watchdog Timer Interrupt or System Reset Decrementer Decrementer Exception Time Base Counter Interrupt Real-Time Clock Interrupt Figure 6-1. System Configuration and Protection Logic 6.1 System Configuration and Protection Features The system configuration and protection sub-module provides features described in the following sections. 6.1.1 System Configuration The SIU allows the configuration of the system according to the particular requirements. The functions include control of show cycle operation, pin multiplexing, and internal memory map location. System configuration also includes a register containing part and mask number constants to identify the part in software. System configuration registers include the SIU module configuration register (SIUMCR), and the internal memory mapping register (IMMR). Refer to Section 6.2.2, "System Configuration and Protection Registers," for register diagrams and bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-3 System Configuration and Protection 6.1.1.1 USIU Pin Multiplexing Some of the functions defined in the various sections of the USIU (external bus interface, memory controller, and general-purpose I/O) share pins. Table 6-1 summarizes how the pin functions of these multiplexed pins are assigned. . Table 6-1. USIU Pin Multiplexing Control Pin Name Multiplexing Controlled by: IRQ0 / SGPIOC0 / MDO4 IRQ1 / RSV / SGPIOC1 IRQ2 / CR / SGPIOC2 / MTS IRQ3 / KR / RETRY / SGPIOC3 IRQ4 / AT2 / SGPIOC4 IRQ5 / SGPIOC5 / MODCK1 IRQ6 / MODCK2 IRQ7 / MODCK3 At Power-On Reset: MODCK[1:3] Otherwise: Programmed in SIUMCR Note:MDO4 is controlled by READI enable. SGPIOC6 / FRZ / PTR SGPIOC7 / IRQOUT / LWP0 BG / VF0 / LWP1 BR / VF1 / IWP2 BB / VF2 / IWP3 IWP[0:1] / VFLS[0:1] BI / STS WE[0:3] / BE[0:3] / AT[0:3] TDI/DSDI / MDI0 TCK / DSCK / MCKI TDO / DSDO / MDO0 Programmed in SIUMCR and Hard Reset Configuration Note:MDIO, MCKI, and MDO0 are controlled by READI enable. DATA[0:31] / SGPIOD[0:31] ADDR[8:31] / SGPIOA[8:31] Programmed in SIUMCR RSTCONF /TEXP 6.1.1.2 At Power-On Reset: RSTCONF Otherwise: Programmed in SIUMCR Arbitration Support Two bits in the SIUMCR control USIU bus arbitration. The external arbitration (EARB) bit determines whether arbitration is performed internally or externally. If EARB is cleared (internal arbitration), the external arbitration request priority (EARP) bit determines the priority of an external master's arbitration request. The operation of the internal arbiter is described in Section 9.5.7.4, "Internal Bus Arbiter." 6.1.2 External Master Modes External master modes are special modes of operation that allow an alternative master on the external bus to access the internal modules for debugging and backup purposes. They provide access to the internal buses (U-bus and L-bus) and to the intermodule bus (IMB3). There are two external master modes: * Peripheral mode (enabled by setting PRPM in the external master control (EMCR) register) uses a special slave mechanism that shuts down the RCPU and an alternative master on the external bus can perform accesses to any internal bus slave. MPC561/MPC563 Reference Manual, Rev. 1.2 6-4 Freescale Semiconductor System Configuration and Protection * Slave mode (enabled by setting EMCR[SLVM] and clearing EMCR[PRPM]) enables an external master to access any internal bus slave while the RCPU is fully operational. Both modes can be enabled and disabled by software. In addition, peripheral mode can be selected from reset. The internal bus is not capable of providing priority between internal RCPU accesses and external master accesses. If the bandwidth of external master accesses is large, it is recommended that the system force gaps between external master accesses in order to avoid suspension of internal RCPU activity. The MPC561/MPC563 does not support burst accesses from an external master; only single accesses of 8, 16, or 32 bits can be performed. The MPC561/MPC563 asserts burst inhibit (BI) on any attempt to initiate a burst access to internal memory. The MPC561/MPC563 provides memory controller services for external master accesses (single and burst) to external memories. See Chapter 10, "Memory Controller," for details. 6.1.2.1 Operation in External Master Modes The external master modes are controlled by the EMCR register, which contains the internal bus attributes. The default attributes in the EMCR allow an external master to configure the EMCR with the required attributes and access internal registers. The external master must be granted external bus ownership in order to initiate the external master access. The SIU compares the address on the external bus to the allocated internal address space. If the address is within the internal space, the access is performed with the internal bus. The internal address space is determined according to IMMR[ISB] (see Section 6.2.2.1.2, "Internal Memory Map Register (IMMR)," for details). The external master access is terminated by the TA, TEA, or RETRY signal on the external bus. A deadlock situation might occur if an internal-to-external access is attempted on the internal bus while an external master access is initiated on the external bus. In this case, the SIU will assert RETRY on the external bus in order to relinquish and retry the external access until the internal access is completed. The internal bus will deny other internal accesses for the next eight clocks in order to complete the pending accesses and prevent additional internal accesses from being initiated on the internal bus. The SIU will also mask internal accesses to support consecutive external accesses if the delay between the external accesses is less than four clocks. The external master access and retry timings are described in Section 9.5.12, "Bus Operation in External Master Modes." The external master may access the internal MPC561/MPC563 special registers that are located outside the RCPU. To access one of these special purpose registers (see Section 5.1.1, "USIU Special-Purpose Registers"), EMCR[CONT] must be set and EMCR[SUPU] must be cleared. The external master can then access the special register when it is provided the address according to the MPC561/MPC563 address map. Only the first external master access that follows EMCR setting will be assigned to the special register map; any subsequent accesses will be directed to the normal address map. This is done in order to enable access to the EMCR again after the required MPC561/MPC563 special register access. Peripheral mode does not require external bus arbitration between the external master and the internal RCPU, since the internal RCPU is disabled. The BR and BB signals should be connected to ground, and the internal bus arbitration should be selected in order to prevent the "slave" MPC561/MPC563 from MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-5 System Configuration and Protection occupying the external bus. Internal bus arbitration is selected by clearing SIUMCR[EARB] (see Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR)"). 6.1.2.2 Address Decoding for External Accesses During an external master access, the USIU compares the external address with the internal address block to determine if MPC561/MPC563 operation is required. Since only 24 of the 32 internal address bits are available on the external bus, the USIU assigns zeros to the most significant address bits (ADDR[0:7]). The address compare sequence can be summarized as follows: * Normal external access. If EMCR[CONT] is cleared, the address is compared to the internal address map. Refer to Section 6.2.2.1.3, "External Master Control Register (EMCR)". -- MPC561/MPC563 special register external access. If EMCR[CONT] is set by the previous external master access, the address is compared to the MPC561/MPC563 special address range. See Section 5.1.1, "USIU Special-Purpose Registers," for a list of the SPRs in the USIU. -- Memory controller external access. If the first two comparisons do not match, the internal memory controller determines whether the address matches an address assigned to one of the regions. If it finds a match, the memory controller generates the appropriate chip select and attribute accordingly When trying to fetch an MPC561/MPC563 special register from an external master, the address might be aliased to one of the external devices on the external bus. If this device is selected by the MPC561/MPC563 internal memory controller, this aliasing does not occur since the chip select is disabled. If the device has its own address decoding or is being selected by external logic, this case is resolved. NOTE This section does not address slave accesses to internal resources. For internal resources, the accesses compare against ADDR[8:9] = ISB[1:2]. ISB0 must be cleared. 6.1.3 USIU General-Purpose I/O The USIU provides 64 general-purpose I/O (SGPIO) pins (See Table 6-2). The SGPIO pins are multiplexed with the address and data pins. In single-chip mode, where communicating with external devices is not required, all 64 SGPIO pins can be used. In multiple-chip mode, only eight SGPIO pins are available. Another configuration allows the use of the address bus for instruction show cycles while the data bus is dedicated to SGPIO functionality. The functionality of these pins is assigned by the single-chip (SC) bit in the SIUMCR. (See Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR).") SGPIO pins are grouped as follows: * Six groups of eight pins each, whose direction is set uniformly for the whole group * 16 single pins whose direction is set separately for each pin Table 6-2 describes the SGPIO signals, and all available configurations. The SGPIO registers are described in Section 6.2.2.5, "General-Purpose I/O Registers." MPC561/MPC563 Reference Manual, Rev. 1.2 6-6 Freescale Semiconductor System Configuration and Protection Table 6-2. SGPIO Configuration SGPIO Group Name 1 Individual Pin Control Direction Control Available Available Available Available When SC = 10 When SC = 00 When SC = 01 When SC = 11 (Single-Chip (32-bit Port (16-bit Port (Single-Chip Mode with Size Mode) Size Mode) Mode) Trace) SGPIOD[0:7] GDDR0 X X SGPIOD[8:15] GDDR1 X X SGPIOD[16:23] GDDR2 X X X X X X SGPIOD[24:31] X SDDRD[23:31] SGPIOC[0:7]1 X SDDRC[0:7] SGPIOA[8:15] GDDR3 X SGPIOA[16:23] GDDR4 X SGPIOA[24:31] GDDR5 X SGPIOC[0:7] is selected according to GPC and MLRC fields in SIUMCR. See Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR)." Figure 6-2 illustrates the functionality of the SGPIO. Read Path Internal Bus Read GPIO Read Register GPIO Write Register Write Write Path OE Clock Write SGPIO Pad Read Path of Write Operation Path of Read Operation SGPIO Circuitry Figure 6-2. Circuit Paths of Reading and Writing to SGPIO MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-7 System Configuration and Protection 6.1.4 Enhanced Interrupt Controller 6.1.4.1 * * * * * * Key Features Significant interrupt latency reduction from that of the MPC555. Simplified interrupt structure Up to 48 different interrupt requests Splitting of single external interrupt vector into up to 48 vectors, one for each source Automatic lower priority requests masking Full backward compatibility with MPC555/MPC556 (enhanced mode is software programmable.) 6.1.4.2 Interrupt Configuration An overview of the MPC561/MPC563 interrupt structure is shown in Figure 6-3. The interrupt controller receives interrupts from USIU internal sources, such as PIT, RTC, from the UIMB module (which has its own interrupt controller) or from the IMB3 bus (directly from IMB modules) and from external pins IRQ[0:7]. MPC561/MPC563 Reference Manual, Rev. 1.2 6-8 Freescale Semiconductor System Configuration and Protection DEC_IRQ to RCPU SWT I0 Level 7 U-bus INT Levels [0:7] Level 4 Level 3 Level 2 Level 1 Level 0 8 I6 I5 I4 I3 I2 I1 I0 NMI to RCPU Wake up from low-power mode 16 IRQOUT MUX UIMB Timers, Change of Lock SIUMCR [EICEN, LPMASKEN] LPMASKEN IMB3 Levels[0:7] ilbs[0:1] IMBIRQ Sequencer Enhanced Interrupt Controller Internal Bus IREQ to RCPU EICEN 48 SIVEC Level7 Level5 imb_irq [0:6] imb_irq [0:6] Level[0:6] Level 6 I7 NMI GEN Regular Interrupt Controller EDGE DET IRQ[0:7] Selector DEC 6 Offset in BBC/IMPU branch table USIU Figure 6-3. MPC561/MPC563 Interrupt Structure If programmed to generate an interrupt, the SWT and external pin IRQ0 always generate an NMI, non-maskable interrupt to the RCPU. NOTE The RCPU takes the system reset exception when an NMI is asserted, the external interrupt exception for any other asserted interrupt request, and the decrementer exception when the decrementer MSB changes from 0 to 1. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-9 System Configuration and Protection The decrementer interrupt request is not a part of the interrupt controller. Each one of the external pins IRQ[1:7] has its own dedicated assigned priority level. IRQ0 is also mapped, but it should be used only as a status bit indicating that IRQ0 was asserted and generated NMI interrupt. There are eight additional interrupt priority levels. Each one of the SIU internal interrupt sources, or any of the peripheral module interrupt sources can be assigned by software to any one of the eight interrupt priority levels. Thus, a very flexible interrupt scheme is implemented. The interrupt request signal generated by the interrupt controller is driven to the RPCU core and to the IRQOUT pin (optionally). This pin may be used in peripheral mode, when the RCPU is disabled, and the internal modules are accessed externally. The IMB interrupts are controlled by the UIMB. The IMB provides 32 interrupt levels, and any interrupt source could be configured to any IMB interrupt level. The UIMB contains a 32-bit register that holds the IMB interrupt requests, and maps them to the USIU eight interrupt levels. NOTE If one interrupt level was configured to more than one interrupt source, the software should read the UIPEND register in the UIMB module, and the particular status bits in order to identify which interrupt was asserted. The interrupt controller may be programmed to operate in two modes--a regular mode or an enhanced mode. 6.1.4.3 Regular Interrupt Controller Operation (MPC555/MPC556-Compatible Mode) In regular operation mode (default setting) the interrupt controller receives interrupt requests from internal sources, such as timers, PLL lock detector, IMB modules and from external pins IRQ[0:7]. All the internal interrupt sources may be programmed to drive one or more of eight U-bus interrupt level lines while the RCPU, upon receiving an interrupt request, has to read the USIU and UIMB status register in order to determine the interrupt source. The SIVEC register contains an 8-bit code representing the unmasked interrupt request which has the highest priority level. The priority between all interrupt sources for the regular interrupt controller operation is shown in Table 6-3. Table 6-3. Priority of Interrupt Sources--Regular Operation Number Priority Level Interrupt Source Description Offset in Branch Table (Hex) SIVEC Interrupt Code1 0 Highest EXT_IRQ0 0x0000 00000000 1 -- Level 0 0x0008 00000100 2 -- EXT_IRQ1 0x0010 00001000 3 -- Level 1 0x0018 00001100 4 -- EXT_IRQ2 0x0020 00010000 5 -- Level 2 0x0028 00010100 6 -- EXT_IRQ3 0x0030 00011000 7 -- Level 3 0x0038 00011100 MPC561/MPC563 Reference Manual, Rev. 1.2 6-10 Freescale Semiconductor System Configuration and Protection Table 6-3. Priority of Interrupt Sources--Regular Operation 1 Number Priority Level Interrupt Source Description Offset in Branch Table (Hex) SIVEC Interrupt Code1 8 -- EXT_IRQ4 0x0040 00100000 9 -- Level 4 0x0048 00100100 10 -- EXT_IRQ5 0x0050 00101000 11 -- Level 5 0x0058 00101100 12 -- EXT_IRQ6 0x0060 00110000 13 -- Level 6 0x0068 00110100 14 -- EXT_IRQ7 0x0070 00111000 15 Lowest Level 7 0x0078 00111100 This is the value in the 8 most significant bits of the SIVEC register (SIVEC[25:31]). Each interrupt request from external lines and from USIU internal interrupt sources in the case of its assertion will set a corresponding bit in SIPEND register. The individual SIPEND bits may be masked by clearing an appropriate bit in SIMASK register. 6.1.4.4 Enhanced Interrupt Controller Operation The enhanced interrupt controller operation may be turned on by setting the EICEN control bit in the SIUMCR register. In this mode the 32 IMB interrupt levels will be latched by USIU using eight IMB interrupt lines and two lines of ilbs via the time multiplexing scheme defined by the UIMB module. In addition to the IMB interrupt sources the external interrupts and timer interrupts are available in the same way as in the regular scheme. In this mode, the UIMB module does not drive U-bus interrupt level lines. Each interrupt request will set a corresponding bit in SIPEND2 or SIPEND3 registers. SIPEND2 an SIPEND3 may be masked by clearing an appropriate bit in SIMASK2 or SIMASK3 registers. The priority logic is provided in order to determine the highest unmasked interrupt request, and interrupt code is generated in the SIVEC register. See Table 6-4. NOTE If the enhanced interrupt controller is enabled, a delay is required prior to re-enabling interrupts. Before clearing an interrupt related register, clear the MSR[EE] bit (EE = 0). Expect a vector offset of 0x0 if an interrupt is cleared or disabled while MSR[EE] = 1. This vector should be handled as if no interrupt has occured, that is, perform an rfi instruction. After clearing an interrupt source, sufficient time must elapse before re-enabling the MSR[EE] bit (EE = 1). This time should take longer than the time needed for a load of the same register that was just cleared. To guarantee enough time, include this load instruction before the instruction that sets MSR[EE]. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-11 System Configuration and Protection Table 6-4. Priority of Interrupt Sources--Enhanced Operation Number Priority Level Interrupt Source Description Offset in Branch , Table (Hex)1 2 SIVEC Interrupt Code3 0 Highest (see note above)4 0x0000 00000000 1 -- Level 0 0x0008 00000100 2 -- IMB_IRQ 0 0x0010 00001000 3 -- IMB_IRQ 1 0x0018 00001100 4 -- IMB_IRQ 2 0x0020 00010000 5 -- IMB_IRQ 3 0x0028 00010100 6 -- EXT_IRQ2 0x0030 00011000 7 -- Level 1 0x0038 00011100 8 -- IMB_IRQ 4 0x0040 00100000 9 -- IMB_IRQ 5 0x0048 00100100 10 -- IMB_IRQ 6 0x0050 00101000 11 -- IMB_IRQ 7 0x0058 00101100 12 -- EXT_IRQ2 0x0060 00110000 13 -- Level 2 0x0068 00110100 14 -- IMB_IRQ 8 0x0070 00111000 15 -- IMB_IRQ 9 0x0078 00111100 16 -- IMB_IRQ 10 0x0080 01000000 17 -- IMB_IRQ 11 0x0088 01000100 18 -- EXT_IRQ3 0x0090 01001000 19 -- Level 3 0x0098 01001100 20 -- IMB_IRQ 12 0x00A0 01010000 21 -- IMB_IRQ 13 0x00A8 01010100 22 -- IMB_IRQ 14 0x00B0 01011000 23 -- IMB_IRQ 15 0x00B8 01011100 24 -- EXT_IRQ4 0x00C0 01100000 25 -- Level 4 0x00C8 01100100 26 -- IMB_IRQ 16 0x00D0 01101000 27 -- IMB_IRQ 17 0x00D8 01101100 28 -- IMB_IRQ 18 0x00E0 01110000 29 -- IMB_IRQ 19 0x00E8 01110100 30 -- EXT_IRQ5 0x00F0 01111000 31 -- Level 5 0x00F8 01111100 MPC561/MPC563 Reference Manual, Rev. 1.2 6-12 Freescale Semiconductor System Configuration and Protection Table 6-4. Priority of Interrupt Sources--Enhanced Operation (continued) Number Priority Level Interrupt Source Description Offset in Branch , Table (Hex)1 2 SIVEC Interrupt Code3 32 -- IMB_IRQ 20 0x0100 10000000 33 -- IMB_IRQ 21 0x0108 10000100 34 -- IMB_IRQ 22 0x0110 10001000 35 -- IMB_IRQ 23 0x0118 10001100 36 -- EXT_IRQ6 0x0120 10010000 37 -- Level 6 0x0128 10010100 38 -- IMB_IRQ 24 0x0130 10011000 39 -- IMB_IRQ 25 0x0138 10011100 40 -- IMB_IRQ 26 0x0140 10100000 41 -- IMB_IRQ 27 0x0148 10100100 42 -- EXT_IRQ7 0x0150 10101000 43 -- Level 7 0x0158 10101100 44 -- IMB_IRQ 28 0x0160 10110000 45 -- IMB_IRQ 29 0x0168 10110100 46 -- IMB_IRQ 30 0x0170 10111000 47 Lowest IMB_IRQ 31 0x0178 10111100 1 The branch table feature can be used only if the BBCMCR[EIR] is set. This offset is added to the table base address from the EIBDR register. 3 This is the value in the 8 most significant bits of the SIVEC register. 4 This vector is reserved and normally is not generated. It may be generated, if any other interrupt source disappears, before being acknowleged by the RCPU as a result of any change in the interrupt scheme, module stopping, masking interrupt sources in a module by application software while interrupts are enabled in the RCPU by setting MSR[EE]. 2 The value of the SIVEC register is supplied internally to the BBC module and can be used as an offset to the branch table start address for the external interrupt relocation feature. Thus a fast way to a specific interrupt source routine is provided without software overhead. The BBCMCR (see Section 4.6.2.1, "BBC Module Configuration Register (BBCMCR)") and EIBADR (see Section 4.6.2.5, "External Interrupt Relocation Table Base Address Register (EIBADR)") registers must be programmed to enable this feature in the BBC. Additionally, the SIPEND2 and SIPEND3 registers contain the information about all the interrupt requests that are asserted at a given time, so that software can always read them. NOTE When the enhanced interrupt controller is enabled the SIPEND and SIMASK registers are not used. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-13 System Configuration and Protection 6.1.4.4.1 Lower Priority Request Masking This feature (if enabled) simplifies the masking of lower priority interrupt requests when a request of certain priority is in service in applications that require interrupt nesting. The highest (pending) request is also masked by itself. The masking is accomplished in the following way. Upon asserting an interrupt request the BBC generates an acknowledge signal to notify the interrupt controller that the request and the branch table offset have been latched. The interrupt controller then sets a bit in the SISR register (interrupt in-service register), according to the asserted request. All other requests whose priority is lower than or equal to the one that is currently in-service, become masked. The mask remains set until the SISR bit is cleared by software (by the interrupt handler routine), writing a `1' value to the corresponding bit. The lower priority request masking diagram is presented in Figure 6-4. The lower priority request masking feature is disabled by HRESET and it may be enabled by setting the LPMASK_EN bit in the SIUMCR register. NOTE In the regular mode of the interrupt controller the lower priority request masking feature is not available. The feature must be activated only together with exception table relocation in the BBC module. From bit i - 1 Enable control bit (LPMASK_EN) To SIVEC generation SIPEND [i] To RCPU External interrupt request generation (OR between all the bits) SIMASK [i] IMPU acknowledge Reset by software Set SISR[i] Reset To bit i + 1 Figure 6-4. Lower Priority Request Masking--One Bit Diagram 6.1.4.4.2 Backward Compatibility with MPC555/MPC556 The enhanced interrupt controller is a feature that may be enabled according to a user's application using the EICEN control bit in SIUMCR register, which can be set and cleared at any time by software. If the bit is cleared, the default interrupt controller operation is available, as described in Section 6.1.4.3, "Regular Interrupt Controller Operation (MPC555/MPC556-Compatible Mode)." The regular operation is fully compatible with the interrupt controller already implemented in MPC555/MPC556. Figure 6-5 illustrates the interrupt controller functionality in the MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 6-14 Freescale Semiconductor System Configuration and Protection IRQ ...... ...... ...... ...... 8 SIEL External SIMASK 8 Synchronizer U-bus INT Levels[0:7] SIPEND Wake up from low-power mode 16 ...... From IMB: ilbs[0:1] 5 SISR3 S I V E C 5 (6 from 48) (Enables branch to the highest priority interrupt routine) SISR2 48 Encoder Enhanced Interrupt Controller Enabled 32 Sequencer IMB IRQ 8 SIPEND2 SIPEND3 IRQ[0:7] SIMASK2 SIMASK3 Priority Interrupt Vector (offset to branch table - to BBC) 0 MUX 1 Interrupt Request (to RCPU and IRQOUT pad) Figure 6-5. MPC561/MPC563 Interrupt Controller Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-15 System Configuration and Protection 6.1.4.5 Interrupt Overhead Estimation for Enhanced Interrupt Controller Mode The interrupt overhead consists of two main parts: * Storage of general and special purpose registers * Recognition of the interrupt source The interrupt overhead can increase latency, and decrease the overall system performance. The overhead of register saving time can be reduced by improving the operating system. The number of registers that should be saved can be reduced if each interrupt event has its own interrupt vector. This solution solves the interrupt source recognition overhead. Table 6-5 below illustrates the improvements. Only registers required for the recognition routine are considered to be saved in the calculations below. Recognition of module internal events/channels is out of the scope of the calculations. See also the typical interrupt handler flowchart in Figure 6-6. Table 6-5. Interrupt Latency Estimation for Three Typical Cases MPC561/MPC563 Architecture Without Using SIVEC MPC561/MPC563 Architecture Using Enhanced Interrupt Controller Features MPC561/MPC563 Architecture Using SIVEC Operation Details Interrupt propagation from request module to RCPU -- 8 clocks Store of some GPR and SPR--10 clocks Read SIPEND--4 clocks Read SIMASK--4 clocks SIPEND data processing -- 20 clocks (find first set, access to LUT in the Flash, branches) Read UIPEND--4 clocks UIPEND data processing--20 clocks (find first set, access to LUT in the Flash, branches) Interrupt propagation from request module to RCPU -- 8 clocks Store of some GPR and SPR --10 clocks Read SIVEC--4 clocks Branch to routine--10 clocks Read UIPEND--4 clocks UIPEND data processing -- 20 clocks (find first set, access to LUT in the Flash, branches) Notes: If there is a need to enable nesting of interrupts during source recognition procedure, at least 30 clocks should be added to the interrupt latency estimation To use this feature in compressed -- mode some undetermined latency is added to make a branch to compressed address of the routine. This latency is dependant on how the user code is implemented. Total: At Least 70-80 Clocks At Least 50-60 Clocks Interrupt propagation from request module to RCPU -- 6 clocks Store of some GPR and SPR--10 clocks Only one branch is executed to reach the interrupt handler routine of the device requesting interrupt servicing--2 clocks 20 Clocks NOTE Compiler and bus collision overhead are not included in the calculations. MPC561/MPC563 Reference Manual, Rev. 1.2 6-16 Freescale Semiconductor System Configuration and Protection . Start Saving the CPU context Masking lower priority requests Enabling Interrupt Handler body Clearing interrupt source Disabling interrupt Clearing in-service bit Clearing mask Restoring the CPU context Flow without lower priority masking enabled Flow with lower priority masking enabled RFI Figure 6-6. Typical Interrupt Handler Routine 6.1.5 Hardware Bus Monitor The bus monitor ensures that each bus cycle is terminated within a reasonable period of time. The USIU provides a bus monitor option to monitor internal to external bus accesses on the external bus. The monitor counts from transfer start to transfer acknowledge and from transfer acknowledge to transfer acknowledge within bursts. If the monitor times out, transfer error acknowledge (TEA) is asserted internally by the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-17 System Configuration and Protection MPC561/MPC563, and RCPU access is terminated with a data error, causing a machine check state or exception. The bus monitor timing bit in the system protection control register (SYPCR[BMT]) defines the bus monitor time-out period. The programmability of the time-out allows for variation in system peripheral response time. The timing mechanism is clocked by the external bus clock divided by eight. The maximum value is 2040 system clock cycles. SYPCR[BME] enables or disables the bus monitor. But regardless of the state of this bit the bus monitor is always enabled when freeze is asserted in debug mode. 6.1.6 Decrementer (DEC) The decrementer (DEC) is a 32-bit decrementing counter defined by the MPC561/MPC563 architecture to provide a decrementer interrupt. This binary counter is clocked by the same frequency as the time base (also defined by the MPC500 architecture). The operation of the time base and decrementer are therefore coherent. The DEC is clocked by the TMBCLK clock. The decrementer period is computed as follows: TDEC = 232 FTMBCLK The state of the DEC is not affected by any resets and should be initialized by software. The DEC runs continuously after power-up once the time base is enabled by setting the TBE bit of the TBSCR (see Table 6-18) (unless the clock module is programmed to turn off the clock). The decrementer continues counting while reset is asserted. Reading from the decrementer has no effect on the counter value. Writing to the decrementer replaces the value in the decrementer with the value in the GPR. Whenever bit 0 (the MSB) of the decrementer changes from zero to one, a decrementer exception occurs. If software alters the decrementer such that the content of bit 0 is changed to a value of 1, a decrementer exception occurs. A decrementer exception causes a decrementer interrupt request to be pending in the RCPU. When the decrementer exception is taken, the decrementer interrupt request is automatically cleared. Table 6-6 illustrates some of the periods available for the decrementer, assuming a 4-MHz or 20-MHz crystal, and TBS = 0 which selects TMBCLK division to 4. NOTE Time base must be enabled to use the decrementer. See Section 6.2.2.4.4, "Time Base Control and Status Register (TBSCR)," for more information. Table 6-6. Decrementer Time-Out Periods Count Value Time-Out @ 4 MHz Time-Out @ 20 MHz 0 1.0 s 0.2 s 9 10 s 2.0 s MPC561/MPC563 Reference Manual, Rev. 1.2 6-18 Freescale Semiconductor System Configuration and Protection Table 6-6. Decrementer Time-Out Periods (continued) Count Value Time-Out @ 4 MHz Time-Out @ 20 MHz 99 100 s 20 s 999 1.0 ms 200 s 9999 10.0 ms 2 ms 999999 1.0 s 200 ms 9999999 10.0 s 2.0 s 99999999 100.0 s 20 s 999999999 1000 s 200 s (hex) FFFFFFFF 4295 s 859 s Refer to Section 3.9.5, "Decrementer Register (DEC)," for more information. 6.1.7 Time Base (TB) The time base (TB) is a 64-bit free-running binary counter defined by the MPC500 architecture. The TB has two independent reference registers which can generate a maskable interrupt when the time base counter reaches the value programmed in one of the two reference registers. The period of the TB depends on the driving frequency. The TB is clocked by the TMBCLK clock. The period for the TB is: 64 2 T TB = -----------------------------F TMBCLK The state of TB is not affected by any resets and should be initialized by software. Reads and writes of the TB are restricted to special instructions. Separate special-purpose registers are defined in the MPC500 architecture for reading and writing the TB. For the MPC561/MPC563 implementation, it is not possible to read or write the entire TB in a single instruction. Therefore, the mttb and mftb instructions are used to move the lower half of the time base (TBL) while the mttbu and mftbu instructions are used to move the upper half (TBU). Two reference registers are associated with the time base: TBREF0 and TBREF1. A maskable interrupt is generated when the TB count reaches to the value programmed in one of the two reference registers. Two status bits in the time base control and status register (TBSCR) indicate which one of the two reference registers generated the interrupt. Refer to Section 6.2.2.4, "System Timer Registers," for diagrams and bit descriptions of TB registers. Refer to Section 3.9.4, "Time Base Facility (TB) -- OEA," and to the RCPU Reference Manual for additional information. 6.1.8 Real-Time Clock (RTC) The RTC is a 32-bit counter and pre-divider used to provide a time-of-day indication to the operating system and application software as show in Figure 6-7. It is clocked by the PITRTCLK clock. The counter MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-19 System Configuration and Protection is not affected by reset and operates in all low-power modes. It is initialized by software. The RTC can be programmed to generate a maskable interrupt when the time value matches the value programmed in its associated alarm register. It can also be programmed to generate an interrupt once a second. A control and status register is used to enable or disable the different functions and to report the interrupt source. NOTE PITRTCLK can be divided by 4 or 256. See Table 8-1 for default settings. FREEZE RTSEC PITRTCLK Clock Clock Disable Sec Interrupt Divide By 15625 MUX 32-bit Counter (RTC) Divide By 78125 Alarm Interrupt = 4-MHz/20-MHz crystal 32-bit Register (RTCAL) Figure 6-7. RTC Block Diagram 6.1.9 Periodic Interrupt Timer (PIT) The periodic interrupt timer consists of a 16-bit counter clocked by the PITRTCLK clock signal supplied by the clock module as shown in Figure 6-8. The 16-bit counter counts down to zero when loaded with a value from the PITC register. After the timer reaches zero, the PS bit is set and an interrupt is generated if the PIE bit is a logic one. The software service routine should read the PS bit and then write a zero to terminate the interrupt request. At the next input clock edge, the value in the PITC is loaded into the counter, and the process starts over again. When a new value is written into the PITC, the periodic timer is updated, the divider is reset, and the counter begins counting. If the PS bit is not cleared, an interrupt request is generated. The request remains pending until PS is cleared. If the PS bit is set again prior to being cleared, the interrupt remains pending until PS is cleared. Any write to the PITC stops the current countdown, and the count resumes with the new value in PITC. If the PISCR[PTE] bit is not set, the PIT is unable to count and retains the old count value. Reads of the PIT have no effect on the counter value. MPC561/MPC563 Reference Manual, Rev. 1.2 6-20 Freescale Semiconductor System Configuration and Protection PTE PITC (PISCR) (PISCR) 16-bit Modulus Counter Clock Disable PITRTCLK Clock PS (PISCR) PIT Interrupt PIE (PISCR) PITF (PISCR) Figure 6-8. PIT Block Diagram The timeout period is calculated as: PITC + 1 PITC + 1 PIT PERIOD = ----------------------------------- = ----------------------------------------------F PITRTCLK ExternalClock ----------------------------------------- 4 or 256 Solving this equation using a 4-MHz external clock and a pre-divider of 256 gives: PITC + 1 PIT PERIOD = -----------------------15625 This gives a range from 64 microseconds, with a PITC of 0x0000, to 4.19 seconds, with a PITC of 0xFFFF. When a 20-MHz crystal is used with a pre-divider of 256, the range is between 12.8 microseconds to 0.84 seconds. 6.1.10 Software Watchdog Timer (SWT) The software watchdog timer (SWT) prevents system lockout in case the software becomes trapped in loops with no controlled exit. The SWT is enabled after system reset to cause a system reset if it times out. The SWT requires a special service sequence to be executed on a periodic basis. If this periodic servicing action does not occur, the SWT times out and issues a reset or a non-maskable interrupt (NMI), depending on the value of the SWRI bit in the SYPCR register. The SWT can be disabled by clearing the SWE bit in the SYPCR. Once the SYPCR is written by software, the state of the SWE bit cannot be changed. The SWT service sequence consists of the following two steps: 1. Write 0x556C to the software service register (SWSR) 2. Write 0xAA39 to the SWSR The service sequence clears the watchdog timer and the timing process begins again. If any value other than 0x556C or 0xAA39 is written to the SWSR, the entire sequence must start over. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-21 System Configuration and Protection Although the writes must occur in the correct order prior to time-out, any number of instructions may be executed between the writes. This allows interrupts and exceptions to occur, if necessary, between the two writes. Not 0x556C/Don't Reload Reset 0x556C/Don't Reload State 0 Waiting for 0x556C State 1 Waiting for 0xAA39 0xAA39/Reload Not 0x556C/Don't Reload Not 0xAA39/Don't Reload Figure 6-9. SWT State Diagram Although most software disciplines support the watchdog concept, different systems require different time-out periods. For this reason, the software watchdog provides a selectable range for the time-out period. In Figure 6-10, the range is determined by the value in the SWTC field. The value held in the SWTC field is then loaded into a 16-bit decrementer clocked by the system clock. An additional divide by 2048 prescaler is used if necessary. The decrementer begins counting when loaded with a value from the software watchdog timing count field (SWTC). After the timer reaches 0x0, a software watchdog expiration request is issued to the reset or NMI control logic. Upon reset, the value in the SWTC is set to the maximum value and is again loaded into the software watchdog register (SWR), starting the process over. When a new value is loaded into the SWTC, the software watchdog timer is not updated until the servicing sequence is written to the SWSR. If the SWE is loaded with the value zero, the modulus counter does not count (i.e. SWTC is disabled). MPC561/MPC563 Reference Manual, Rev. 1.2 6-22 Freescale Semiconductor System Configuration and Protection SWSR Service Logic SWE (SYPCR) System Clock Clock Disable SWTC Divide By 2048 Reload MUX 16-bit SWR/Decrementer Rollover = 0 Reset or NMI FREEZE Time-out SWP (SYPCR) Figure 6-10. SWT Block Diagram 6.1.11 Freeze Operation When the FREEZE line is asserted, the clocks to the software watchdog, the periodic interrupt timer, the real-time clock, the time base counter, and the decrementer can be disabled. This is controlled by the associated bits in the control register of each timer. If programmed to stop during FREEZE assertion, the counters maintain their values while FREEZE is asserted. The bus monitor remains enabled regardless of this signal. 6.1.12 Low Power Stop Operation When the processor is set in a low-power mode (doze, sleep, or deep-sleep), the software watchdog timer is frozen. It remains frozen and maintains its count value until the processor exits this state and resumes executing instructions. The periodic interrupt timer, decrementer, and time base are not affected by these low-power modes. They continue to run at their respective frequencies. These timers are capable of generating an interrupt to bring the MCU out of these low-power modes. 6.2 Memory Map and Register Definitions This section provides the MPC561/MPC563 memory map, register diagrams and bit descriptions of the system configuration and protection registers. 6.2.1 Memory Map The MPC561/MPC563 internal memory space can be assigned to one of eight locations. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-23 System Configuration and Protection The internal memory map is organized as a single 4-Mbyte block. The user can assign this block to one of eight locations by programming the ISB field in the internal memory mapping register (IMMR). The eight possible locations are the first eight 4-Mbyte memory blocks starting with address 0x0000 0000. (Refer to Figure 6-11.) 0x0000 0000 0x003F FFFF 0x0040 0000 0X007F FFFF 0X0080 0000 0x00BF FFFF 0x00C0 0000 Internal 4-Mbyte Memory Block (Resides in one of eight locations) 0x00FF FFFF 0x0100 0000 0x013F FFFF 0x0140 0000 0x017F FFFF 0x0180 0000 0x01BF FFFF 0x01C0 0000 0x01FF FFFF 0xFFFF FFFF Figure 6-11. MPC561/MPC563 Memory Map 6.2.2 System Configuration and Protection Registers This section describes the MPC561/MPC563 registers. 6.2.2.1 System Configuration Registers System configuration registers include the SIUMCR, the IMMR, and the EMCR registers. MPC561/MPC563 Reference Manual, Rev. 1.2 6-24 Freescale Semiconductor System Configuration and Protection 6.2.2.1.1 SIU Module Configuration Register (SIUMCR) The SIUMCR contains bits which configure various features in the SIU module. The register contents are shown below. MSB 0 1 Field EARB 2 3 4 EARP 5 6 7 -- HRESET ID01 8 9 11 12 DBGC -- ATWC ID[9:10]1 ID111 ID121 27 28 LPMASK _EN BURST _EN DSHW 000_0000_0 Addr 10 13 14 GPC 15 DLK 000 0x2F C000 LSB 16 1 17 18 Field -- SC HRESET 0 ID[17:18]1 19 20 21 RCTX MLRC 22 23 -- 24 25 26 NOS EICEN MTSC HOW 29 30 31 -- 0_0000_0000_0000 The reset value is a reset configuration word value, extracted from the internal data bus line. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." Figure 6-12. SIU Module Configuration Register (SIUMCR) WARNING All SIUMCR fields which are controlled by the reset configuration word should not be changed by software while the corresponding functions are active. Table 6-7. SIUMCR Bit Descriptions Bits Name Description 0 EARB External arbitration 0 Internal arbitration is performed 1 External arbitration is assumed 1:3 EARP External arbitration request priority. This field defines the priority of an external master's arbitration request. This field is valid when EARB is cleared. Refer to Section 9.5.7.4, "Internal Bus Arbiter," for details. 4:7 -- 8 DSHW Data show cycles. This bit selects the show cycle mode to be applied to U-bus data cycles (data cycles to IMB modules and Flash EEPROM). This field is locked by the DLK bit. Note that instruction show cycles are programmed in the ICTRL and L-bus data show cycles are programmed in the L2UMCR. 0 Disable show cycles for all internal data cycles 1 Show address and data of all internal data cycles 9:10 DBGC Debug pins configuration. Refer to Table 6-8. 11 DBPC Reserved. 12 ATWC Address write type enable configuration. This bit configures the pins to function as byte write enables or address types for debugging purposes. 0 WE[0:3]/BE[0:3]/AT[0:3] functions as WE[0:3]/BE[0:3]1 1 WE[0:3]/BE[0:3]/AT[0:3] functions as AT[0:3] Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-25 System Configuration and Protection Table 6-7. SIUMCR Bit Descriptions (continued) Bits Name 13:14 GPC This bit configures the pins as shown in Table 6-9. 15 DLK Debug register lock 0 Normal operation 1 SIUMCR is locked and can be written only in test mode or when the internal freeze signal is asserted. 16 -- Reserved 17:18 SC Single-chip select. This field configures the functionality of the address and data buses. Changing the SC field while external accesses are performed is not supported. Refer to Table 6-10. 19 RCTX Reset configuration/timer expired. During reset the RSTCONF/TEXP pin functions as RSTCONF. After reset the pin can be configured to function as TEXP, the timer expired signal that supports the low-power modes. 0 RSTCONF/TEXP functions as RSTCONF 1 RSTCONF/TEXP functions as TEXP 20:21 MLRC Multi-level reservation control. This field selects between the functionality of the reservation logic and IRQ pins, refer to Table 6-11. 22:23 -- 24 MTSC 25 NOSHOW Instruction show cycles disabled. If the NOSHOW bit is set (1), then all instruction show cycles are NOT transmitted to the external bus. 26 EICEN Enhanced interrupt controller enable. See Section 6.1.4.4, "Enhanced Interrupt Controller Operation," for more information. 0 Enhanced interrupt controller operates in regular mode (compatible with MPC555/MPC556) 1 Enhanced interrupt controller is enabled 27 1 Description Reserved Memory transfer start control. 0 IRQ2/CR/SGPIOC2/MTS functions according to the MLRC bits setting 1 IRQ2/CR/SGPIOC2/MTS functions as MTS LPMASK_EN Low priority request masking enable. 0 Lower priority interrupt request masking is disabled 1 Lower priority interrupt request masking is enabled 28 BURST_EN 29:31 -- Burst enable. 0 Burst operation is enabled by the BBCMCR[BE]. Maximum burst length is fixed at 4 beats. 1 USIU initiated burst accesses on the external bus. Maximim burst length can be 4 or 8 beats and this may be programmed per memory region. Refer to Section 10.2.5, "Burst Support," for more information. Note: Do not assert TEA on the external bus for instruction fetch while SIUMCR[BURST_EN] = 1. Do not place code at the last 8 words of a memory controller region while SIUMCR[BURST_EN] = 1. Reserved WE/BE is selected per memory region by WEBS in the appropriate BR register in the memory controller. MPC561/MPC563 Reference Manual, Rev. 1.2 6-26 Freescale Semiconductor System Configuration and Protection Table 6-8. Debug Pins Configuration Pin Function DBGC IWP[0:1]/VFLS[0:1] BI/STS BG/VF0/LWP1 BR/VF1/IWP2 BB/VF2/IWP3 00 VFLS[0:1] BI BG BR BB 01 IWP[0:1] STS BG BR BB 10 VFLS[0:1] STS VF0 VF1 VF2 11 IWP[0:1] STS LWP1 IWP2 IWP3 Table 6-9. General Pins Configuration Pin Function GPC FRZ/PTR/SGPIOC6 IRQOUT/LWP0/SGPIOC7 00 PTR LWP0 01 SGPIOC6 SGPIOC7 10 FRZ LWP0 11 FRZ IRQOUT Table 6-10. Single-Chip Select Field Pin Configuration Pin Function SC DATA[0:15]/ SGPIOD[0:15] DATA[16:31] SGPIOD[16:31] ADDR[8:31]/ SGPIOA[8:31] 00 (multiple chip, 32-bit port size) DATA[0:15] DATA[16:31] ADDR[8:31] 01 (multiple chip, 16-bit port size DATA[0:15] SPGIOD[16:31] ADDR[8:31] 10 (single-chip with address show cycles for debugging) SPGIOD[0:15] SPGIOD[16:31] ADDR[8:31] 11 (single-chip) SPGIOD[0:15] SPGIOD[16:31] SPGIOA[8:31] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-27 System Configuration and Protection Table 6-11. Multi-Level Reservation Control Pin Configuration Pin Function MLRC IRQ0/ SGPIOC0/ MDO4 IRQ1/RSV/ SGPIOC1 IRQ2/CR/ SGPIOC2/MTS IRQ3/KR/ RETRY /SGPIOC3 IRQ4/AT2/ SGPIOC4 IRQ5/ SGPIOC5/MODCK11 00 IRQ0 IRQ1 IRQ22 IRQ3 IRQ4 IRQ5/MODCK1 KR/RETRY AT2 IRQ5/ MODCK1 SGPIOC3 SGPIOC4 SGPIOC5/MODCK1 KR/RETRY AT2 SGPIOC5/MODCK1 01 IRQ0 RSV CR 10 SGPIOC0 SGPIOC1 SGPIOC22 11 1 2 IRQ0 2 IRQ1 SGPIOC2 Operates as MODCK1 during reset. This is true if MTSC is reset to 0. Otherwise, IRQ2/CR/SGPIOC2/MTS will function as MTS. 2 6.2.2.1.2 Internal Memory Map Register (IMMR) The internal memory map register (IMMR) is a register located within the MPC561/MPC563 special register space. The IMMR contains identification of a specific device as well as the base for the internal memory map. Based on the value read from this register, software can deduce availability and location of any on-chip system resources. This register can be read by the mfspr instruction. The ISB field can be written by the mtspr instruction. The PARTNUM and MASKNUM fields are mask programmed and cannot be changed. MSB 0 1 2 Field HRESET 3 4 5 6 7 8 9 10 PARTNUM 11 12 13 14 15 MASKNUM 0 0 1 1 0 X1 X1 X1 16 17 18 19 20 21 22 23 Read-Only Fixed Value LSB Field HRESET Addr -- FLEN 0000 ID201 -- -- 00 ID232 24 25 26 27 28 29 30 31 -- ISB -- 0000 ID[28:30]1 0 SPR 638 1 The reset value is 101 for MPC561 and 110 for MPC563. reset value is a reset configuration word value extracted from the indicated bits of the internal data bus. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." 2 The Figure 6-13. Internal Memory Mapping Register (IMMR) MPC561/MPC563 Reference Manual, Rev. 1.2 6-28 Freescale Semiconductor System Configuration and Protection Table 6-12. IMMR Bit Descriptions Bits Name Description 0:7 PARTNUM This read-only field is mask programmed with a code corresponding to the part number of the part on which the SIU is located. It is intended to help factory test and user code which is sensitive to part changes. This changes when the part number changes. For example, it would change if any new module is added, if the size of any memory module is changed. It would not change if the part is changed to fix a bug in an existing module. The MPC561 has an ID of 0x35. The MPC563 has an ID of 0x36. 8:15 MASKNUM This read-only field is mask programmed with a code corresponding to the mask number of the part. It is intended to help factory test and user code which is sensitive to part changes. 16:19 -- 20 FLEN 21:22 -- Reserved 23 -- Reserved. This bit should be programmed to 0 at all times. 24:27 -- Reserved 28:30 ISB 31 -- 6.2.2.1.3 Reserved Flash enable is a read-write bit. The default state of FLEN is negated, meaning that the boot is performed from external memory. This bit can be set at reset by the reset configuration word. 0 On-chip Flash memory is disabled, and all internal cycles to the allocated Flash address space are mapped to external memory 1 On-chip Flash memory is enabled This read-write field defines the base address of the internal memory space. The initial value of this field can be configured at reset to one of eight addresses, and then can be changed to any value by software. Internal base addresses are as follows: 000 0x0000 0000 001 0x0040 0000 010 0x0080 0000 011 0x00C0 0000 100 0x0100 0000 101 0x0140 0000 110 0x0180 0000 111 0x01C0 0000 Reserved External Master Control Register (EMCR) The external master control register selects the external master modes and determines the internal bus attributes for external-to-internal accesses. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-29 System Configuration and Protection MSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 26 27 28 29 30 15 -- 0000_0000_0000_0000 HRESET Addr 0x2F C030 LSB 16 17 Field PRPM SLVM 1 HRESET ID16 1 0 18 19 20 -- SIZE 0 01 21 22 SUPU INST 0 1 23 24 -- 00 25 RESV CONT 1 1 -- 0 TRAC SIZEN 1 1 31 -- 00 The reset value is a reset configuration word value, extracted from the indicated internal data bus line. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." Figure 6-14. External Master Control Register (EMCR) Table 6-13. EMCR Bit Descriptions Bits Name Description 0:15 -- 16 PRPM Peripheral mode. In this mode, the internal RCPU core is shut off and an alternative master on the external bus can access any internal slave module. The reset value of this bit is determined by the reset configuration word bit 16. The bit can also be written by software. 0 Normal operation 1 Peripheral mode operation 17 SLVM Slave mode (valid only if PRPM = 0). In this mode, an alternative master on the external bus can access any internal slave module while the internal RCPU core is fully operational. If PRPM is set, the value of SLVM is a "don't care." 0 Normal operation 1 Slave mode 18 -- 19:20 SIZE Size attribute. If SIZEN = 1, the SIZE bits controls the internal bus attributes as follows: 00 Double word (8 bytes) 01 Word (4 bytes) 10 Half word (2 bytes) 11 Byte 21 SUPU Supervisor/user attribute. SUPU controls the supervisor/user attribute as follows: 0 Supervisor mode access permitted to all registers 1 User access permitted to registers designated "user access" 22 INST Instruction attribute. INST controls the internal bus instruction attribute as follows: 0 Instruction fetch 1 Operand or non-CPU access 23:24 -- 25 RESV Reserved Reserved Reserved Reservation attribute. RESV controls the internal bus reservation attribute as follows: 0 Storage reservation cycle 1 Not a reservation MPC561/MPC563 Reference Manual, Rev. 1.2 6-30 Freescale Semiconductor System Configuration and Protection Table 6-13. EMCR Bit Descriptions (continued) Bits Name 26 CONT 27 -- 28 TRAC Trace attribute. TRAC controls the internal bus program trace attribute as follows: 0 Program trace 1 Not program trace 29 SIZEN External size enable control bit. SIZEN determines how the internal bus size attribute is driven: 0 Drive size from external bus signals TSIZE[0:1] 1 Drive size from SIZE0, SIZE1 in EMCR 30:31 -- 6.2.2.2 Description Control attribute. CONT drives the internal bus control bit attribute as follows: 0 Access to MPC561/MPC563 control register, or control cycle access 1 Access to global address map Reserved Reserved SIU Interrupt Controller Registers The SIU interrupt controller contains the following registers: SIPEND, SIPEND2 and SIPEND3 (interrupt pending registers), SIMASK, SIMASK2 and SIMASK3 (interrupt mask registers), SIEL, SIVEC, SISR2 and SISR3. The SIPEND and SIMASK registers are used when the interrupt controller is configured for regular, MPC555/MPC556 compatible, operation. SIPEND2, SIPEND3, SIMASK2, SIMASK3, SISR2 and SISR3 registers are used only when the interrupt controller is operating in enhanced interrupt mode. SIPEND, SIPEND2 and SIPEND3 are 32-bit registers. Each bit in the register corresponds to an interrupt request. The bits associated with internal exceptions indicate, if set, that an interrupt service is requested. These bits reflect the status of the internal requesting device, and will be cleared when the appropriate actions are initiated by software in the device itself. Writing to these bits has no effect. The bits associated with the IRQ pins have a different behavior depending on the sensitivity defined for them in the SIEL register. When the IRQ is defined as a "level" interrupt the corresponding bit behaves in a manner similar to the bits associated with internal interrupt sources, (i.e., it reflects the status of the IRQ pin). This bit can not be changed by software, it will be cleared when the external signal is negated. When the IRQ is defined as an "edge" interrupt, if the corresponding bit is set, it indicates that a falling edge was detected on the line. The bit must be reset by software by writing a `1' to it. The following acronym definitions apply to the various bits implemented in the SIU interrupt controller registers. Table 6-14. SIU Interrupt Controller - Bit Acronym Definitions Name Description IRQn Interrupt Signal n Request LVLn Interrupt Level n Request IMBIRQn Intermodule Bus Interrupt Level n Request IRMn Interrupt Signal n Mask MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-31 System Configuration and Protection Table 6-14. SIU Interrupt Controller - Bit Acronym Definitions 6.2.2.2.1 Name Description LVMn Interrupt Level n Mask EDn Falling Edge Detect, Interrupt Signal n WMn Wakeup Mask, Interrupt Signal n SIU Interrupt Pending Register (SIPEND) MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Field IRQ0 LVL0 IRQ1 LVL1 IRQ2 LVL2 IRQ3 LVL3 IRQ4 LVL4 IRQ5 LVL5 IRQ6 LVL6 IRQ7 LVL7 SRESET 0000_0000_0000_0000 Addr 0x2F C010 LSB 16 17 18 19 20 21 22 23 Field 24 25 26 27 28 29 30 31 -- SRESET 0000_0000_0000_0000 Figure 6-15. SIU Interrupt Pending Register (SIPEND) 6.2.2.2.2 SIU Interrupt Pending Register 2 (SIPEND2) MSB 0 Field IRQ0 1 LVL0 2 3 4 IMB IMB IMB IRQ0 IRQ1 IRQ2 5 6 7 IMB IRQ3 IRQ1 LVL1 8 9 10 IMB IMB IMB IRQ4 IRQ5 IRQ6 11 12 13 IMB IRQ7 IRQ2 LVL2 27 28 29 14 15 IMB IMB IRQ8 IRQ9 0000_0000_0000_0000 SRESET Addr 0x2F C040 LSB 16 Field SRESET 17 18 19 20 21 22 23 24 25 26 30 31 IMB IMB IRQ3 LVL3 IMB IMB IMB IMB IRQ4 LVL4 IMB IMB IMB IMB IRQ5 LVL5 IRQ10 IRQ1 IRQ12 IRQ13 IRQ14 IRQ15 IRQ16 IRQ17 IRQ18 IRQ19 1 0000_0000_0000_0000 Figure 6-16. SIU Interrupt Pending Register 2 (SIPEND2) MPC561/MPC563 Reference Manual, Rev. 1.2 6-32 Freescale Semiconductor System Configuration and Protection 6.2.2.2.3 SIU Interrupt Pending Register 3 (SIPEND3) MSB 0 Field 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 IMB IMB IMB IMB IRQ LVL IMB IMB IMB IMB IRQ LVL IMB IMB IMB IMB IRQ20 IRQ21 IRQ22 IRQ23 6 6 IRQ24 IRQ25 IRQ26 IRQ27 7 7 IRQ28 IRQ29 IRQ30 IRQ31 SRESET 0000_0000_0000_0000 Addr 0x2F C044 LSB 16 17 Field 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -- SRESET 0000_0000_0000_0000 Figure 6-17. SIU Interrupt Pending Register 3 (SIPEND3) 6.2.2.2.4 SIU Interrupt Mask Register (SIMASK) SIMASK is a 32-bit read/write register. Each bit in the register corresponds to an interrupt request bit in the SIPEND register. SIMASK2 is a 32-bit read/write register. Each bit in the register corresponds to an interrupt request bit in the SIPEND2 register. SIMASK3 is a 32-bit read/write register. Each bit in the register corresponds to an interrupt request bit in the SIPEND3 register. When the bit is set, it enables the generation of an interrupt request to the RCPU. SIMASK, SIMASK2, SIMASK3 are updated by software and cleared upon reset. It is the responsibility of the software to determine which of the interrupt sources are enabled at a given time. NOTE Disable external interrupts in the core prior to changing any interrupt controller related register (SIMASK, SIPEND, SIEL, or SISR). Refer to MSR[EE] bit description in Table 3-11 and the note regarding special handling of the EIC in Section 6.1.4.4, "Enhanced Interrupt Controller Operation." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-33 System Configuration and Protection MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 Field IRM0 LVM0 IRM1 LVM1 IRM2 LVM2 IRM3 LVM3 IRM4 LVM4 IRM5 LVM5 IRM6 LVM6 IRM7 LVM7 0000_0000_0000_0000 SRESET Addr 0x2F C014 LSB 16 17 18 19 20 21 22 23 Field 25 26 27 28 29 30 31 -- SRESET 1 24 0000_0000_0000_0000 IRQ0 of the SIPEND register is not affected by the setting or clearing of the IRM0 bit of the SIMASK register. IRQ0 is a non-maskable interrupt. Figure 6-18. SIU Interrupt Mask Register (SIMASK) 6.2.2.2.5 SIU Interrupt Mask Register 2 (SIMASK2) MSB Field 0 1 IRQ01 LVL0 2 3 4 IMB IMB IMB IRQ0 IRQ1 IRQ2 5 6 7 IMB IRQ3 IRQ1 LVL1 8 9 10 IMB IMB IMB IRQ4 IRQ5 IRQ6 11 12 13 IMB IRQ7 IRQ2 LVL2 27 28 29 14 15 IMB IMB IRQ8 IRQ9 0000_0000_0000_0000 SRESET Addr 0x2F C048 LSB 16 Field SRESET 1 17 18 19 20 21 22 23 24 25 26 30 31 IMB IMB IRQ3 LVL3 IMB IMB IMB IMB IRQ4 LVL4 IMB IMB IMB IMB IRQ5 LVL5 IRQ10 IRQ1 IRQ12 IRQ13 IRQ14 IRQ15 IRQ16 IRQ17 IRQ18 IRQ19 1 0000_0000_0000_0000 IRQ0 of the SIPEND2 register is not affected by the setting or clearing of the IRQ0 bit of the SIMASK2 register. IRQ0 is a non-maskable interrupt Figure 6-19. SIU Interrupt Mask Register 2 (SIMASK2) MPC561/MPC563 Reference Manual, Rev. 1.2 6-34 Freescale Semiconductor System Configuration and Protection 6.2.2.2.6 SIU Interrupt Mask Register 3 (SIMASK3) MSB 0 Field 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 IMB IMB IMB IMB IRQ LVL IMB IMB IMB IMB IRQ LVL IMB IMB IMB IMB IRQ20 IRQ21 IRQ22 IRQ23 6 6 IRQ24 IRQ25 IRQ26 IRQ27 7 7 IRQ28 IRQ29 IRQ30 IRQ31 0000_0000_0000_0000 SRESET Addr 0x2F C04C LSB 16 17 18 19 20 21 22 23 Field 24 25 26 27 28 29 30 31 -- SRESET 0000_0000_0000_0000 Figure 6-20. SIU Interrupt Mask Register 3 (SIMASK3) 6.2.2.2.7 SIU Interrupt Edge Level Register (SIEL) The SIEL is a 32-bit read/write register. Each pair of bits corresponds to an external interrupt request. The EDx bit, if set, specifies that a falling edge in the corresponding IRQ line will be detected as an interrupt request. When the EDx bit is 0, a low logical level in the IRQ line will be detected as an interrupt request. The WMx (wake-up mask) bit, if set, indicates that an interrupt request detection in the corresponding line causes the MPC561/MPC563 to exit low-power mode. MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Field ED0 WM0 ED1 WM1 ED2 WM2 ED3 WM3 ED4 WM4 ED5 WM5 ED6 WM6 ED7 WM7 HRESET 0000_0000_0000_0000 Addr 0x2F C018 LSB 16 17 Field 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -- HRESET 0000_0000_0000_0000 Figure 6-21. SIU Interrupt Edge Level Register (SIEL) 6.2.2.2.8 SIU Interrupt Vector Register (SIVEC) The SIVEC is a 32-bit read-only register that contains an 8-bit code representing the unmasked interrupt source of the highest priority level. The SIVEC can be read as either a byte, half word, or word. When read as a byte, a branch table can be used in which each entry contains one instruction (branch). When read as a half-word, each entry can contain a full routine of up to 256 instructions. The interrupt code is defined such that its two least significant bits are 0, thus allowing indexing into the table. The two possible ways of the code usage are shown on Figure 6-23. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-35 System Configuration and Protection MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 Field INTERRUPT CODE -- Reset 0011_1100 0000_0000 Addr 13 14 29 30 15 0x2F C01C LSB 16 17 18 19 20 21 22 23 24 Field -- Reset 0000_0000_0000_0000 25 26 27 28 31 Figure 6-22. SIU Interrupt Vector Register (SIVEC) INTR:... Save state R3 @SIVEC R4 Base of branch table ... lbz RX, R3 (0)# load as byte add RX, RX, R4 mtsprCTR, RX bctr BASE b Routine1 BASE + 4 b Routine2 BASE + 8 b Routine3 BASE + C b Routine4 BASE +10 * BASE + n * INTR:... Save state R3 @SIVEC R4 Base of branch table ... lhz RX, R3 (0)# load as half add RX, RX, R4 mtspr CTR, RX bctr BASE BASE + 400 BASE + 800 BASE + C00 BASE +1000 BASE + n 1st Instruction of Routine1 * * 1st Instruction of Routine2 * * 1st Instruction of Routine3 * * 1st Instruction of Routine4 * * * * * * * * Figure 6-23. Example of SIVEC Register Usage for Interrupt Table Handling MPC561/MPC563 Reference Manual, Rev. 1.2 6-36 Freescale Semiconductor System Configuration and Protection 6.2.2.2.9 Interrupt In-Service Registers (SISR2 and SISR3) SISR2, SISR3 are 32-bit read/write registers. Each bit in the register corresponds to an interrupt request. A bit is set if: * There is a pending interrupt request (SIPEND2/3), that is not masked by (SIMASK2/3), and * The BBC/IMPU acknowledges interrupt request and latches SIVEC value. Once a bit is set, all requests with lower or equal priority become masked (i.e. they will not generate any interrupt request to the RCPU) until the bit is cleared. A bit is cleared by writing a `1' to it. Writing zero has no effect. MSB 0 1 Field IRQ0 2 LVL0 3 4 IMB IMB IMB IRQ0 IRQ1 IRQ2 5 6 7 IMB IRQ3 IRQ1 LVL1 SRESET 8 9 10 IMB IMB IMB IRQ4 IRQ5 IRQ6 11 12 13 IMB IRQ7 IRQ2 LVL2 27 28 29 14 15 IMB IMB IRQ8 IRQ9 0000_0000_0000_0000 Addr 0x2F C050 LSB 16 Field 17 18 19 20 21 22 23 24 25 26 30 31 IMB IMB IRQ3 LVL4 IMB IMB IMB IMB IRQ4 LVL4 IMB IMB IMB IMB IRQ5 LVL5 IRQ10 IRQ11 IRQ12 IRQ13 IRQ14 IRQ15 IRQ16 IRQ17 IRQ18 IRQ19 SRESET 0000_0000_0000_0000 Figure 6-24. Interrupt In-Service Register 2 (SISR2) MSB 0 Field 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 IMB IMB IMB IMB IRQ LVL IMB IMB IMB IMB IRQ LVL IMB IMB IMB IMB IRQ20 IRQ21 IRQ22 IRQ23 6 6 IRQ24 IRQ25 IRQ26 IRQ27 7 7 IRQ28 IRQ29 IRQ30 IRQ31 SRESET 0000_0000_0000_0000 Addr 0x2F C054 LSB 16 17 18 19 20 21 22 Field 23 24 25 26 27 28 29 30 31 -- SRESET 0000_0000_0000_0000 Figure 6-25. Interrupt In-Service Register 3 (SISR3) 6.2.2.3 6.2.2.3.1 System Protection Registers System Protection Control Register (SYPCR) The system protection control register (SYPCR) controls the system monitors, the software watchdog period, and the bus monitor timing. This register can be read at any time, but can be written only once after system reset. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-37 System Configuration and Protection MSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 26 27 28 29 30 15 SWTC 1111_1111_1111_1111 HRESET Addr 0x2F C004 LSB 16 17 18 19 Field HRESET 20 21 22 23 24 25 BMT BME -- 1111_1111 0 000 31 SWF SWE SWRI SWP 0 1 1 1 Figure 6-26. System Protection Control Register (SYPCR) Table 6-15. SYPCR Bit Descriptions Bits Name 0:15 SWTC 16:23 BMT Bus monitor timing. This field specifies the time-out period, in eight-system-clock resolution, of the bus monitor. BMT must be set to non zero even if the bus monitor is not enabled. 24 BME Bus monitor enable 0 Disable bus monitor 1 Enable bus monitor 25:27 -- 28 SWF Software watchdog freeze 0 Software watchdog continues to run while FREEZE is asserted 1 Software watchdog stops while FREEZE is asserted 29 SWE Software watchdog enable. Software should clear this bit after a system reset to disable the software watchdog timer. 0 Watchdog is disabled 1 Watchdog is enabled 30 SWRI Software watchdog reset/interrupt select 0 Software watchdog time-out causes a non-maskable interrupt to the RCPU 1 Software watchdog time-out causes a system reset 31 SWP Software watchdog prescale 0 Software watchdog timer is not prescaled 1 Software watchdog timer is prescaled by 2048 6.2.2.3.2 Description Software watchdog timer count. This field contains the count value of the software watchdog timer. Reserved Software Service Register (SWSR) The SWSR is the location to which the SWT servicing sequence is written. To prevent SWT time-out, a 0x556C followed by 0xAA39 should be written to this register. The SWSR can be written at any time but returns all zeros when read. MPC561/MPC563 Reference Manual, Rev. 1.2 6-38 Freescale Semiconductor System Configuration and Protection MSB LSB 0 1 2 3 4 5 6 7 8 9 Field SWSR Reset 0000_0000_0000_0000 Addr 0x2F C00E 10 11 12 13 14 15 Figure 6-27. Software Service Register (SWSR) Table 6-16. SWSR Bit Descriptions Bits Name Description 0:15 SWSR SWT servicing sequence is written to this register. To prevent SWT time-out, a 0x556C followed by 0xAA39 should be written to this register. The SWSR can be written at any time but returns all zeros when read. 6.2.2.3.3 Transfer Error Status Register (TESR) The transfer error status register contains a bit for each exception source generated by a transfer error. A bit set to logic 1 indicates what type of transfer error exception occurred since the last time the bits were cleared by reset or by the normal software status bit-clearing mechanism. NOTE These bits may be set due to canceled speculative accesses which do not cause an interrupt. The register has two identical sets of bit fields; one is associated with instruction transfers and the other with data transfers. MSB 0 1 2 3 4 5 6 7 8 9 Field -- Reset 0000_0000_0000_0000 Addr 0x2F C020 10 11 12 13 14 26 27 28 29 30 15 LSB 16 Field 17 -- 18 19 IEXT IBMT Reset 20 21 22 23 24 25 -- DEXT DBM 31 -- 0000_0000_0000_0000 Figure 6-28. Transfer Error Status Register (TESR) Table 6-17. TESR Bit Descriptions Bits Name Description 0:17 -- 18 IEXT Instruction external transfer error acknowledge. This bit is set if the cycle was terminated by an externally generated TEA signal when an instruction fetch was initiated. 19 IBMT Instruction transfer monitor time out. This bit is set if the cycle was terminated by a bus monitor time-out when an instruction fetch was initiated. Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-39 System Configuration and Protection Table 6-17. TESR Bit Descriptions (continued) Bits Name 20:25 -- 26 DEXT Data external transfer error acknowledge. This bit is set if the cycle was terminated by an externally generated TEA signal when a data load or store is requested by an internal master. 27 DBM Data transfer monitor time out. This bit is set if the cycle was terminated by a bus monitor time-out when a data load or store is requested by an internal master. 28:31 -- 6.2.2.4 Description Reserved Reserved System Timer Registers The following sections describe registers associated with the system timers. These facilities are powered by the KAPWR and can preserve their value when the main power supply is off. Refer to Section 8.2.3, "Pre-Divider," for details on the required actions needed in order to guarantee this data retention. A list of KAPWR registers affected by the key/lock mechanism is found in Table 8-8. 6.2.2.4.1 Decrementer Register (DEC) The 32-bit decrementer register is defined by the PowerPC architecture. The values stored in this register are used by a down counter to cause decrementer exceptions. The decrementer causes an exception whenever bit zero changes from a logic zero to a logic one. A read of this register always returns the current count value from the down counter. Contents of this register can be read or written to by the mfspr or the mtspr instruction. The decrementer register is reset by PORESET. HRESET and SRESET do not affect this register. The decrementer is powered by standby power and can continue to count when standby power is applied. Decrementer counts down the time base clock and the counting is enabled by TBE bit in TBCSR register Section 6.2.2.4.4, "Time Base Control and Status Register (TBSCR)." MSB LSB 0 31 Field PORESET DECREMENTING COUNTER 0000_0000_0000_0000_0000_0000_0000_0000 Unaffected HRESET SRESET Addr SPR 22 Figure 6-29. Decrementer Register (DEC) Refer to Section 3.9.5, "Decrementer Register (DEC)" for more information on this register. 6.2.2.4.2 Time Base SPRs (TB) The TB is a 64-bit register containing a 64-bit integer that is incremented periodically. There is no automatic initialization of the TB; the system software must perform this initialization. The contents of the MPC561/MPC563 Reference Manual, Rev. 1.2 6-40 Freescale Semiconductor System Configuration and Protection register may be written by the mttbl or the mttbu instructions, see Section 3.9.4, "Time Base Facility (TB) -- OEA." Refer to Section 3.8, "VEA Register Set -- Time Base (TB)' and Section 3.9.4, "Time Base Facility (TB) -- OEA" for more information on reading and writing the TBU and TBL registers. MSB LSB 0 Field 31 32 TBU PORESET 63 TBL Unaffected Addr SPR 269, SPR 268 Figure 6-30. Time Base (Reading) (TB) MSB LSB 0 Field 31 32 TBU PORESET 63 TBL Unaffected Addr SPR 285, SPR 284 Figure 6-31. Time Base (Writing) (TB) 6.2.2.4.3 Time Base Reference Registers (TBREF0 and TBREF1) Two reference registers (TBREF0 and TBREF1) are associated with the lower part of the time base (TBL). Each is a 32-bit read/write register. Upon a match between the contents of TBL and the reference register, a maskable interrupt is generated. MSB LSB 0 31 Field TBREF0 Reset Unaffected Addr 0x2F C204 Figure 6-32. Time Base Reference Register 0 (TBREF0) MSB LSB 0 31 Field TBREF1 Reset Unaffected Addr 0x2F C208 Figure 6-33. Time Base Reference Register 1 (TBREF1) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-41 System Configuration and Protection 6.2.2.4.4 Time Base Control and Status Register (TBSCR) The TBSCR is 16-bit read/write register. It controls the TB, decrementer count enable, and interrupt generation and is used for reporting the source of the interrupts. The register can be read anytime. A status bit is cleared by writing a one to it. (Writing a zero has no effect.) More than one bit can be cleared at a time. MSB 0 Field LSB 1 2 3 4 TBIRQ PORESET 5 6 7 8 9 10 REFA REFB 11 -- 12 13 14 15 REFAE REFBE TBF TBE 0000_0000_0000_0000 Addr 0x2F C200 Figure 6-34. Time Base Control and Status Register (TBSCR) Table 6-18. TBSCR Bit Descriptions Bits Name Description 0:7 TBIRQ Time base interrupt request. These bits determine the interrupt priority level of the time base. Refer to Section 6.1.4, "Enhanced Interrupt Controller" for interrupt level encoding. 8 REFA Reference A (TBREF0) interrupt status. 0 No match detected 1 TBREF0 value matches value in TBL 9 REFB Reference B (TBREF1) interrupt status. 0 No match detected 1 TBREF1 value matches value in TBL 10:11 -- 12 REFAE Reference A (TBREF0) interrupt enable. If this bit is set, the time base generates an interrupt when the REFA bit is set. 13 REFBE Reference B (TBREF1) interrupt enable. If this bit is set, the time base generates an interrupt when the REFB bit is set. 14 TBF Time base freeze. If this bit is set, the time base and decrementer stop while FREEZE is asserted. 15 TBE Time base enable 0 Time base and decrementer are disabled 1 Time base and decrementer are enabled 6.2.2.4.5 Reserved Real-Time Clock Status and Control Register (RTCSC) The RTCSC enables the different RTC functions and reports the source of the interrupts. The register can be read anytime. A status bit is cleared by writing a one to it. (Writing a zero does not affect a status bit's value.) More than one status bit can be cleared at a time. This register is locked after reset by default. Unlocking is accomplished by writing 0x55CC AA33 to its associated key register. See Section 8.8.3.2, "Keep-Alive Power Registers Lock Mechanism." MPC561/MPC563 Reference Manual, Rev. 1.2 6-42 Freescale Semiconductor System Configuration and Protection MSB LSB 0 1 Field 2 3 4 5 6 7 RTCIRQ 8 9 10 11 12 13 14 15 SEC ALR -- 4M SIE ALE RTF RTE 0000_0000_000 PORESET U Addr 000 U 0x2F C220 Figure 6-35. Real-Time Clock Status and Control Register (RTCSC) Table 6-19. RTCSC Bit Descriptions Bits Name 0:7 RTCIRQ 8 SEC Once per second interrupt. This status bit is set every second. It should be cleared by the software. 9 ALR Alarm interrupt. This status bit is set when the value of the RTC equals the value programmed in the alarm register. 10 -- Reserved 11 4M Real-time clock source 0 RTC assumes that it is driven by 20 MHz to generate the seconds pulse. 1 RTC assumes that it is driven by 4 MHz 12 SIE Second interrupt enable. If this bit is set, the RTC generates an interrupt when the SEC bit is set. 13 ALE Alarm interrupt enable. If this bit is set, the RTC generates an interrupt when the ALR bit is set. 14 RTF Real-time clock freeze. If this bit is set, the RTC stops while FREEZE is asserted. 15 RTE Real-time clock enable 0 RTC is disabled 1 RTC is enabled 6.2.2.4.6 Description Real-time clock interrupt request. Thee bits determine the interrupt priority level of the RTC. Refer to Section 6.1.4, "Enhanced Interrupt Controller" for interrupt level encoding. Real-Time Clock Register (RTC) The real-time clock register is a 32-bit read write register. It contains the current value of the real-time clock. A write to the RTC resets the seconds timer to zero. This register is locked after reset by default. Unlocking is accomplished by writing 0x55CC AA33 to its associated key register. See Section 8.8.3.2, "Keep-Alive Power Registers Lock Mechanism." MSB LSB 0 31 Field RTC Reset Unaffected Addr 0x2F C224 Figure 6-36. Real-Time Clock Register (RTC) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-43 System Configuration and Protection 6.2.2.4.7 Real-Time Clock Alarm Register (RTCAL) The RTCAL is a 32-bit read/write register. When the value of the RTC is equal to the value programmed in the alarm register, a maskable interrupt is generated. The alarm interrupt will be generated as soon as there is a match between the ALARM field and the corresponding bits in the RTC. The resolution of the alarm is 1 second. This register is locked after reset by default. Unlocking is accomplished by writing 0x55CC AA33 to its associated key register. See Section 8.8.3.2, "Keep-Alive Power Registers Lock Mechanism." MSB LSB 0 31 Field ALARM Reset Unaffected Addr 0x2F C22C Figure 6-37. Real-Time Clock Alarm Register (RTCAL) 6.2.2.4.8 Periodic Interrupt Status and Control Register (PISCR) The PISCR contains the interrupt request level and the interrupt status bit. It also contains the controls for the 16-bits to be loaded into a modulus counter. This register can be read or written at any time. MSB 0 LSB 1 2 Field 3 4 PIRQ PORESET 5 6 7 8 9 10 PS 11 12 -- 13 14 15 PIE PITF PTE 0000_0000_0000_0000 Addr 0x2F C240 Figure 6-38. Periodic Interrupt Status and Control Register (PISCR) Table 6-20. PISCR Bit Descriptions Bits Name Description 0:7 PIRQ 8 PS Periodic interrupt status. This bit is set if the PIT issues an interrupt. The PIT issues an interrupt after the modulus counter counts to zero. PS can be negated by writing a one to it. A write of zero has no affect. 9:12 -- Reserved 13 PIE 14 PITF PIT freeze. If this bit is set, the PIT stops while FREEZE is asserted. 15 PTE Periodic timer enable 0 PIT stops counting and maintains current value 1 PIT continues to decrement Periodic interrupt request. These bits determine the interrupt priority level of the PIT. Refer to Section 6.1.4, "Enhanced Interrupt Controller" for interrupt level encoding. Periodic interrupt enable. If this bit is set, the time base generates an interrupt when the PS bit is set. MPC561/MPC563 Reference Manual, Rev. 1.2 6-44 Freescale Semiconductor System Configuration and Protection 6.2.2.4.9 Periodic Interrupt Timer Count Register (PITC) The PITC register contains the 16-bits to be loaded in a modulus counter. This register is readable and writable at any time. MSB 0 1 2 3 4 5 6 7 8 Field PITC Reset Unaffected Addr 0x2F C244 9 10 11 12 13 14 25 26 27 28 29 30 15 LSB 16 17 18 19 20 21 22 23 24 Field -- Reset Unaffected 31 Figure 6-39. Periodic Interrupt Timer Count (PITC) Table 6-21. PITC Bit Descriptions Bits Name Description 0:15 PITC Periodic interrupt timing count. This field contains the 16-bit value to be loaded into the modulus counter that is loaded into the periodic timer. This register is readable and writable at any time. 16:31 -- 6.2.2.4.10 Reserved Periodic Interrupt Timer Register (PITR) The periodic interrupt register is a read-only register that shows the current value in the periodic interrupt down counter. Read or writing this register does not affect the register. MSB 0 1 2 3 4 5 6 7 8 Field PIT Reset Unaffected Addr 0x2F C248 9 10 11 12 13 14 25 26 27 28 29 30 15 LSB 16 17 18 19 20 21 22 23 24 Field -- Reset Unaffected 31 Figure 6-40. Periodic Interrupt Timer Register (PITR) Table 6-22. PIT Bit Descriptions Bits Name Description 0:15 PIT Periodic interrupt timing count--This field contains the current count remaining for the periodic timer. Writes have no effect on this field. 16:31 -- Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-45 System Configuration and Protection 6.2.2.5 General-Purpose I/O Registers 6.2.2.5.1 SGPIO Data Register 1 (SGPIODT1) MSB 0 1 2 Field 3 4 5 6 7 8 9 10 SGPIOD[0:7] 11 12 13 14 29 30 15 SGPIOD[8:15] Reset 0000_0000_0000_00001 Addr 0x2F C024 LSB 16 17 18 Field 20 21 22 23 24 25 26 SGPIOD[16:23] 27 28 31 SGPIOD[24:31] 0000_0000_0000_00001 Reset 1 19 If the device is configured NOT in full bus mode (i.e., SIUMCR[SC]=0b01, 0x10, or 0b11), the GPIO pins will be in input mode and this register will reflect the state of the pins. Figure 6-41. SGPIO Data Register 1 (SGPIODT1) Table 6-23. SGPIODT1 Bit Descriptions Bits Name Description 0:7 SGPIOD[0:7] SIU general-purpose I/O Group D[0:7]. This 8-bit register controls the data of general-purpose I/O pins SGPIOD[0:7]. The direction (input or output) of this group of pins is controlled by the GDDR0 bit in the SGPIO control register. 8:15 SGPIOD[8:15] SIU general-purpose I/O Group D[8:15]. This 8-bit register controls the data of general-purpose I/O pins SGPIOD[8:15]. The direction (input or output) of this group of pins is controlled by the GDDR1 bit in the SGPIO control register. 16:23 SGPIOD[16:23] SIU general-purpose I/O Group D[16:23]. This 8-bit register controls the data of the general-purpose I/O pins SGPIOD[16:23]. The direction (input or output) of this group of pins is controlled by the GDDR2 bit in the SGPIO control register 24:31 SGPIOD[24:31] SIU general-purpose I/O Group D[24:31]. This 8-bit register controls the data of the general-purpose I/O pins SGPIOD[24:31]. The direction of SGPIOD[24:31] is controlled by eight dedicated direction control signals SDDRD[24:31]. Each pin in this group can be configured separately as general-purpose input or output. MPC561/MPC563 Reference Manual, Rev. 1.2 6-46 Freescale Semiconductor System Configuration and Protection 6.2.2.5.2 SGPIO Data Register 2 (SGPIODT2) MSB 0 1 2 Field 3 4 5 6 7 8 9 10 11 SGPIOC[0:7] 12 13 14 29 30 15 SGPIOA[8:15] 1 Reset 0000_0000_0000_0000 Addr 0x2F C028 LSB 16 17 18 Field 20 21 22 23 24 25 26 SGPIOA[16:23] 27 28 31 SGPIOA[24:31] 1 Reset 1 19 0000_0000_0000_0000 If the device is configured NOT in full bus mode (i.e., SIUMCR[SC]=0b01, 0x10, or 0b11), the GPIO pins will be in input mode and this register will reflect the state of the pins. Figure 6-42. SGPIO Data Register 2 (SGPIODT2) Table 6-24. SGPIODT2 Bit Descriptions Bits Name Description 0:7 SGPIOC[0:7] SIU general-purpose I/O Group C[0:7]. This 8-bit register controls the data of the general-purpose I/O pins SGPIOC[0:7]. The direction of SGPIOC[0:7] is controlled by 8 dedicated direction control signals SDDRC[0:7] in the SGPIO control register. Each pin in this group can be configured separately as general-purpose input or output. 8:15 SGPIOA[8:15] SIU general-purpose I/O Group A[8:15]. This 8-bit register controls the data of the general-purpose I/O pins SGPIOA[8:15]. The GDDR3 bit in the SGPIO control register configures these pins as a group as general-purpose input or output. 16:23 SGPIOA [16:23] SIU general-purpose I/O Group A[16:23]. This 8-bit register controls the data of the general-purpose I/O pins SGPIOA[16:23]. The GDDR4 bit in the SGPIO control register configures these pins as a group as general-purpose input or output. 24:31 SGPIOA [24:31] SIU general-purpose I/O Group A[24:31]. This 8-bit register controls the data of the general-purpose I/O pins SGPIOA[24:31]. The GDDR5 bit in the SGPIO control register configures these pins as a group as general-purpose input or output. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 6-47 System Configuration and Protection 6.2.2.5.3 SGPIO Control Register (SGPIOCR) 1 MSB 0 1 2 Field 3 4 5 6 7 8 9 10 11 SDDRC[0:7] HRESET 12 13 14 28 29 30 15 -- 0000_0000_0000_0000 Addr 0x2F C02C LSB 16 17 18 19 20 21 22 23 Field GDDR GDDR GDDR GDDR GDDR GDDR 0 1 2 3 4 5 24 25 26 -- 27 31 SDDRD[24:31] 0000_0000_0000_0000 HRESET Figure 6-43. SGPIO Control Register (SGPIOCR) Table 6-25. SGPIOCR Bit Descriptions Bits Name Description 0:7 SDDRC[0:7] SGPIO data direction for SGPIOC[0:7]. Each SDDR bit zero to seven controls the direction of the corresponding SGPIOC pin zero to seven 8:15 -- 16 GDDR0 Group data direction for SGPIOD[0:7] 17 GDDR1 Group data direction for SGPIOD[8:15] 18 GDDR2 Group data direction for SGPIOD[16:23] 19 GDDR3 Group data direction for SGPIOA[8:15] 20 GDDR4 Group data direction for SGPIOA[16:23] 21 GDDR5 Group data direction for SGPIOA[24:31] 22:23 -- 24:31 SDDRD [24:31] Reserved Reserved SGPIO data direction for SGPIOD[24:31]. Each SDDRD bits 24:31 controls the direction of the corresponding SGPIOD pin [24:31]. Table 6-26 describes the bit values for data direction control. Table 6-26. Data Direction Control SDDR/GDDR Operation 0 SGPIO configured as input 1 SGPIO configured as output MPC561/MPC563 Reference Manual, Rev. 1.2 6-48 Freescale Semiconductor Chapter 7 Reset This section describes the MPC561/MPC563 reset sources, operation, control, and status. 7.1 Reset Operation The MPC561/MPC563 has several inputs to the reset logic which include the following: * Power-on reset * External hard reset pin (HRESET) * External soft reset pin (SRESET) * Loss of PLL lock * On-chip clock switch * Software watchdog reset * Checkstop reset * Debug port hard reset * Debug port soft reset * JTAG reset * Illegal bit change (ILBC) All of these reset sources are fed into the reset controller. The control logic determines the cause of the reset, synchronizes it, and resets the appropriate logic modules, depending on the source of the reset. The memory controller, system protection logic, interrupt controller, and parallel I/O pins are initialized only on hard reset. External soft reset initializes internal logic while maintaining system configuration. The reset status register (RSR) reflects the most recent source to cause a reset. 7.1.1 Power-On Reset The power-on reset pin, PORESET, is an active low input. In a system with power-down low-power mode, this pin should be activated only as a result of a voltage failure on the KAPWR pin. After detecting the assertion of PORESET, the MPC561/MPC563 enters the power-on reset state. During this state the MODCK[1:3] signals determine the oscillator frequency, PLL multiplication factor, and the PITRTCLK and TMBCLK clock sources. In addition, the MPC561/MPC563 asserts the SRESET and HRESET pins at the rising edge of PORESET. The PORESET pin should be asserted for a minimum time of 100,000 of clock oscillator cycles after a valid level has been reached on the KAPWR supply. After detecting the assertion of PORESET, the MPC561/MPC563 remains in the power-on reset state until the last of the following two events occurs: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-1 Reset * * The Internal PLL enters the lock state and the system clock is active. The PORESET pin is negated. If limp mode is enabled, the internal PLL is not required to be locked before the chip exits power-on reset. The internal MODCK[1:3] values are sampled at the rising edge of PORESET. After exiting the power-on reset state, the MPC561/MPC563 continues to drive the HRESET and SRESET pins for 512 system clock cycles. When the timer expires (after 512 cycles), the configuration is sampled from data bus pins, if required (see Section 7.5.1, "Hard Reset Configuration") and the MPC561/MPC563 stops driving the HRESET and SRESET pins. The PORESET pin has a glitch detector to ensure that low spikes of less than 20 ns are rejected. The internal PORESET signal asserts only if the PORESET pin asserts for more than 100 ns. 7.1.2 Hard Reset HRESET (hard reset) is an active low, bidirectional I/O pin. The MPC561/MPC563 can detect an external assertion of HRESET only if it occurs while the MPC561/MPC563 is not asserting HRESET. When the MPC561/MPC563 detects assertion of the external HRESET pin or a cause to assert the internal HRESET line is detected, the chip starts to drive the HRESET and SRESET for 512 cycles. When the timer expires (after 512 cycles) the configuration is sampled from data pins (refer to Section 7.5.1, "Hard Reset Configuration") and the chip stops driving the HRESET and SRESET pins. An external pull-up resistor should drive the HRESET and SRESET pins high. After detecting the negation of HRESET or SRESET, the MPC561/MPC563 waits 16 clock cycles before testing the presence of an external hard or soft reset. The HRESET pin has a glitch detector to ensure that low spikes of less than 20 ns are rejected. The internal HRESET will be asserted only if HRESET is asserted for more than 100 ns. The HRESET is an open collector type pin. 7.1.3 Soft Reset SRESET (soft reset) is an active low, bidirectional I/O pin. The MPC561/MPC563 can only detect an external assertion of SRESET if it occurs while the MPC561/MPC563 is not asserting SRESET. When the MPC561/MPC563 detects the assertion of external SRESET or a cause to assert the internal SRESET line, the chip starts to drive the SRESET for 512 cycles. When the timer expires (after 512 cycles) the debug port configuration is sampled from the DSDI and DSCK pins and the chip stops driving the SRESET pin. An external pull-up resistor should drive the SRESET pin high. After the MPC561/MPC563 detects the negation of SRESET, it waits 16 clock cycles before testing the presence of an external soft reset. The SRESET is an open collector type pin. 7.1.4 Loss of PLL Lock If the PLL detects a loss of lock, erroneous external bus operation will occur if synchronous external devices use the MPC561/MPC563 input clock. Erroneous operation could also occur if devices with a PLL MPC561/MPC563 Reference Manual, Rev. 1.2 7-2 Freescale Semiconductor Reset use the MPC561/MPC563 CLKOUT signal. This source of reset can be optionally asserted if the LOLRE bit in the PLL, low-power, and reset control register (PLPRCR) is set. The enabled PLL loss of lock event generates an internal hard reset sequence. Refer to Chapter 8, "Clocks and Power Control," for more information on loss of PLL lock. 7.1.5 On-Chip Clock Switch If the system clock is switched to the backup clock or switched from backup clock to another clock source an internal hard reset sequence is generated. Refer to Chapter 8, "Clocks and Power Control." 7.1.6 Software Watchdog Reset When the MPC561/MPC563 software watchdog counts to zero, a software watchdog reset is asserted. The enabled software watchdog event generates an internal hard reset sequence. 7.1.7 Checkstop Reset When the RCPU enters a checkstop state, and the checkstop reset is enabled (the CSR bit in the PLPRCR is set), a checkstop reset is asserted. The enabled checkstop event generates an internal hard reset sequence. Refer to the RCPU Reference Manual for more information. 7.1.8 Debug Port Hard Reset When the development port receives a hard reset request from the development tool, an internal hard reset sequence is generated. In this case the development tool must reconfigure the debug port. Refer to Chapter 23, "Development Support," for more information. 7.1.9 Debug Port Soft Reset When the development port receives a soft reset request from the development tool, an internal soft reset sequence is generated. In this case the development tool must reconfigure the debug port. Refer to Chapter 23, "Development Support," for more information. 7.1.10 JTAG Reset When the JTAG logic asserts the JTAG soft reset signal, an internal soft reset sequence is generated. Refer to Chapter 25, "IEEE 1149.1-Compliant Interface (JTAG)," for more information. 7.1.11 ILBC Illegal Bit Change When locked bits in the PLPRCR register are changed, an internal hard reset sequence is generated. Refer to Chapter 8, "Clocks and Power Control." 7.2 Reset Actions Summary Table 7-1 summarizes the action taken for each reset. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-3 Reset Table 7-1. Reset Action Taken for Each Reset Cause Reset Source Reset Logic and PLL States Reset Other System Clock HRESET Debug Port SRESET Internal Configuratio Module Pin Configuratio Pin Logic n Reset Reset Driven n Driven Reset Power-On Reset (PORESET) Yes Yes Yes Yes Yes Yes Yes Hard Reset (HRESET) Sources: * External Hard Reset * Loss of Lock * On-Chip Clock Switch * Illegal Low-Power Mode * Software Watchdog * Checkstop * Debug Port Hard Reset No Yes Yes Yes Yes Yes Yes Soft Reset (SRESET) Sources: * External Soft Reset * Debug Port Soft Reset * JTAG Reset No No No No Yes Yes Yes 7.3 Data Coherency During Reset The MPC561/MPC563 supports data coherency and avoids data corruption during reset. If a cycle is executing when any SRESET or HRESET source is detected, then the cycle will either complete or will not start before generating the corresponding reset control signal. There are reset sources, however, when the MPC561/MPC563 generates an internal reset due to special internal situations where this protection is not supported. See Section 7.4, "Reset Status Register (RSR)." In the case of large operand size (32 or 16 bits) transactions to a smaller port size, the cycle is split into two 16-bit or four 8-bit cycles. In this case, data coherency is assured and data will not be corrupted. In the case where the core executes an unaligned load/store cycle which is broken down into multiple cycles, data coherency is NOT assured between these cycles (i.e., data could be corrupted). Contention may occur if a write access is in progress to external memory and SRESET/HRESET is asserted and the external reset configuration word (RCW) is used. In this case, the external RCW drivers, usually activated by HRESET/SRESET lines, will drive the data bus together with the MPC561/MPC563. Thus the data in the RAM may be corrupted regardless of the data coherency mechanism in the MPC561/MPC563. Table 7-2. Reset Configuration Word and Data Corruption/Coherency Reset Driven HRESET Reset to Use for Data Coherency (EXT_RESET) Comments SRESET MPC561/MPC563 Reference Manual, Rev. 1.2 7-4 Freescale Semiconductor Reset Table 7-2. Reset Configuration Word and Data Corruption/Coherency (continued) Reset to Use for Data Coherency (EXT_RESET) Reset Driven SRESET HRESET HRESET & SRESET HRESET || SRESET 7.4 Comments Provided only one of them is driven into the MPC561/MPC563 at a time Reset Status Register (RSR) All of the reset sources are fed into the reset controller. The 16-bit reset status register (RSR) reflects the most recent source, or sources, of reset. (Simultaneous reset requests can cause more than one bit to be set at the same time.) This register contains one bit for each reset source. A bit set to logic one indicates the type of reset that occurred. Once set, individual bits in the RSR remain set until software clears them. Bits in the RSR can be cleared by writing a one to the bit. A write of zero has no effect on the bit. The register can be read at all times. The reset status register receives its default reset values during power-on reset. The RSR is powered by the KAPWR pin. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 Field EHRS ESRS LLRS SWRS CSRS DBHRS DBSRS JTRS OCCS ILBC GPOR GHRST GSRST PORESET HRESET 0 0000_0000_000 SRESET 0000_0000_0000 Addr 1 01 0000_0000 1 13 14 15 -- 1 1 000 1 1 000 1 000 0x2F C288 OCCS will be set (1) if limp mode is enabled (SCCR[LME]=1). Figure 7-1. Reset Status Register (RSR) Table 7-3. Reset Status Register Bit Descriptions Bits Name Description 0 EHRS1 External hard reset status 0 No external hard reset has occurred 1 An external hard reset has occurred 1 ESRS1 External soft reset status 0 No external soft reset has occurred 1 An external soft reset has occurred 2 LLRS Loss of lock reset status 0 No enabled loss-of-lock reset has occurred 1 An enabled loss-of-lock reset has occurred MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-5 Reset Table 7-3. Reset Status Register Bit Descriptions (continued) 1 Bits Name Description 3 SWRS Software watchdog reset status 0 No software watchdog reset has occurred 1 A software watchdog reset has occurred 4 CSRS Checkstop reset status 0 No enabled checkstop reset has occurred 1 An enabled checkstop reset has occurred 5 DBHRS Debug port hard reset status 0 No debug port hard reset request has occurred 1 A debug port hard reset request has occurred 6 DBSRS Debug port soft reset status 0 No debug port soft reset request has occurred 1 A debug port soft reset request has occurred 7 JTRS JTAG reset status 0 No JTAG reset has occurred 1 A JTAG reset has occurred 8 OCCS On-chip clock switch 0 No on-chip clock switch reset has occurred 1 An on-chip clock switch reset has occurred 9 ILBC Illegal bit change. This bit is set when the MPC561/MPC563 changes any of the following bits when they are locked: LPM[0:1], locked by the LPML bit MF[0:11], locked by the MFPDL bit DIVF[0:4], locked by the MFPDL bit 10 GPOR Glitch detected on PORESET pin. This bit is set when the PORESET pin is asserted for more than 20ns 0 No glitch was detected on the PORESET pin 1 A glitch was detected on the PORESET pin 11 GHRST Glitch detected on HRESET pin. This bit is set when the HRESET pin is asserted for more than 20ns 0 No glitch was detected on the HRESET pin 1 A glitch was detected on the HRESET pin 12 GSRST Glitch detected on SRESET pin. If the SRESET pin is asserted for more than 20ns the GHRST bit will be set. If an internal or external SRESET is generated the SRESET pin is asserted and the GSRST bit will be set. 0 No glitch was detected on SRESET pin 1 A glitch was detected on SRESET pin. 13:15 -- Reserved In the USIU RSR, if both EHRS and ESRS are set, the reset source is internal. The EHRS and ESRS bits in RSR register are set for any internal reset source in addition to external HRESET and external SRESET events. If both internal and external indicator bits are set, then the reset source is internal. MPC561/MPC563 Reference Manual, Rev. 1.2 7-6 Freescale Semiconductor Reset 7.5 7.5.1 Reset Configuration Hard Reset Configuration When a hard reset event occurs, the MPC561/MPC563 reconfigures its hardware system as well as the development port configuration. The logical value of the bits that determine its initial mode of operation, are sampled from the following: * The external data bus pins DATA[0:31] * An internal default constant (0x0000 0000) * An internal NVM register value (UC3FCFIG). Available on the MPC563/MPC564 only. If at the sampling time RSTCONF is asserted, then the configuration is sampled from the external data bus. If RSTCONF is negated and a valid NVM value exists (UC3FCFIG[HC]=0), then the configuration is sampled from the NVM register in the UC3F module. If RSTCONF is negated and no valid NVM value exists (UC3FCFIG[HC]=1), then the configuration word is sampled from the internal default (all zeros). HC will be "1" if the internal Flash is erased. Table 7-4 summarizes the reset configuration options. Table 7-4. Reset Configuration Options RSTCONF Has Configuration (HC) Internal Configuration Word 0 x DATA[0:31] pins 1 0 NVM Flash EEPROM register (UC3FCFIG) 1 1 Internal data word default (0x0000 0000) If the PRDS control bit in the PDMCR register is cleared and HRESET and RSTCONF are asserted, the MPC561/MPC563 pulls the data bus low with a weak resistor. The user can overwrite this default by driving the appropriate bit high. See Figure 7-2 for the basic reset configuration scheme. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-7 Reset Has Configuration (HC) Reset Config. Word 32 Flash 32 MUX 32 OE Dx (Data line) INT_RESET Data Coherency EXT_RESET (See Table 7-2) HRESET/SRESET RSTCONF Figure 7-2. Reset Configuration Basic Scheme During the assertion of the PORESET input signal, the chip assumes the default reset configuration. This assumed configuration changes if the input signal RSTCONF is asserted when the PORESET is negated or the CLKOUT starts to oscillate. To ensure that stable data is sampled, the hardware configuration is sampled every eight clock cycles on the rising edge of CLKOUT with a double buffer. The setup time required for the data bus is approximately 15 cycles (defined as Tsup in the following figures) and the maximum rise time of HRESET should be less than six clock cycles. In systems where an external reset configuration word and the TEXP output function are both required, RSTCONF should be asserted until SRESET is negated. Figure 7-3 to Figure 7-6 provide sample reset configuration timings. NOTE Timing diagrams in the following figures are not to scale. MPC561/MPC563 Reference Manual, Rev. 1.2 7-8 Freescale Semiconductor Reset CLKOUT PORESET Internal PORESET HRESET RSTCONF Tsup Internal data[0:31] Default RSTCONF Controlled Figure 7-3. Reset Configuration Sampling Scheme for "Short" PORESET Assertion, Limp Mode Disabled CLKOUT (Backup Clock) PORESET Internal PORESET 512 clocks HRESET Tsup RSTCONF Internal data(0:31) Default RSTCONF Controlled Figure 7-4. Reset Configuration Timing for "Short" PORESET Assertion, Limp Mode Enabled MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-9 Reset CLKOUT PORESET PLL lock Internal PORESET HRESET Tsup RSTCONF Internal data[0:31] Default RSTCONF Controlled Figure 7-5. Reset Configuration Timing for "Long" PORESET Assertion, Limp Mode Disabled 1 2 3 8 8 9 10 8 9 10 11 12 13 14 15 16 CLKOUT HRESET Maximum time of reset recognition (maximum rise time - up to 6 clocks) RSTCONF DATA Internal reset Reset Configuration Word Tsup = Minimum Setup time of reset recognition = 15 clocks Sample Data Configuration Sample Data Configuration Figure 7-6. Reset Configuration Sampling Timing Requirements MPC561/MPC563 Reference Manual, Rev. 1.2 7-10 Freescale Semiconductor Reset 7.5.2 Hard Reset Configuration Word (RCW) Following is the hard reset configuration word that is sampled from the internal data bus, data_sgpiod(0:31) on the negation of HRESET. If the external reset config word is selected (RSTCONF = 0), the internal data bus will reflect the state of external data bus. If the internal reset config word is selected and neither of the Flash reset config words are enabled (UC3FCFIG[HC] = 1), the internal data bus is internally driven with all zeros. The reset configuration word is not a register in the memory map. Most of the bits in the configuration are located in registers in the SIU. Refer to Table 7-5 for a detailed description of each control bit. MSB 0 1 Field EARB 2 3 4 IP BDRV BDIS 5 6 BPS[0:1] HRESET 7 8 -- 9 10 11 DBGC[0:1] -- 12 13 14 ATWC EBDF[0:1] 15 -- 0000_0000_0000_0000 LSB 16 17 Field PRPM HRESET 18 SC 19 20 ETRE FLEN 21 22 EN_ EXC_ COMP1 COMP1 23 -- 24 25 26 OERC 27 28 -- 29 ISB 30 31 DME 0000_0000_0000_0000 Figure 7-7. Reset Configuration Word (RCW) 1 Available only on the MPC562/MPC564, software should write "0" to this bit for MPC561/MPC563. Table 7-5. RCW Bit Descriptions Bits Name Description 0 EARB 1 IP Initial Interrupt Prefix -- This bit defines the initial value of MSR[IP] immediately after reset. MSR[IP] defines the Interrupt Table location. If IP is zero then the initial value of MSR[IP] is zero, If the IP is one, then the initial value of MSR[IP] is one. Default value is zero. See Table 3-11 for more information. 0 MSR[IP] = 0 after reset 1 MSR[IP] = 1 after reset 2 BDRV Bus Pins Drive Strength -- This bit determines the bus pins (address, data and control) driving capability to be either full or reduced drive. The bus default drive strength is full; Upon default, it also effects the CLKOUT drive strength to be full. See Table 6-7 for more information. BDRV controls the default state of COM1 in the SIUMCR. 0 Full drive 1 Reduced drive 3 BDIS Boot Disable -- If the BDIS bit is set, then memory controller is not activated after reset. If it is cleared then the memory controller bank 0 is active immediately after reset such that it matches any addresses. If a write to the OR0 register occurs after reset this bit definition is ignored. The default value is that the memory controller is enabled to control the boot with the CS0 pin. See Section 10.7, "Global (Boot) Chip-Select Operation," for more information. 0 Memory controller bank 0 is active and matches all addresses immediately after reset 1 Memory controller is not activated after reset. External Arbitration -- Refer to Section 9.5.7, "Arbitration Phase," for a detailed description of Bus arbitration. The default value is that internal arbitration hardware is used. 0 Internal arbitration is performed 1 External arbitration is assumed MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-11 Reset Table 7-5. RCW Bit Descriptions (continued) Bits Name Description 4:5 BPS Boot Port Size -- This field defines the port size of the boot device on reset (BR0[PS]). If a write to the OR0 register occurs after reset this field definition is ignored. See Table 10-5 and Table 10-8 for more information. 00 32-bit port (default) 01 8-bit port 10 16-bit port 11 Reserved 6:8 -- 9:10 Reserved. These bits must not be high in the reset configuration word. DBGC[0:1] Debug Pins Configuration -- See Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR)," for this field definition. The default value is that these pins function as: VFLS[0:1], BI, BR, BG and BB. See Table 6-8. 11 -- Reserved. 12 ATWC Address Type Write Enable Configuration -- The default value is that these pins function as WE pins. See Table 6-7. 0 WE[0:3]/BE[0:3]/AT[0:3] functions as WE[0:3]/BE[0:3] 1 WE[0:3]/BE[0:3]/AT[0:3] functions as AT[0:3] 13:14 EBDF External Bus Division Factor -- This field defines the initial value of the external bus frequency. The default value is that CLKOUT frequency is equal to that of the internal clock (no division). See Table 8-9. 151 -- 16 PRPM Peripheral Mode Enable -- This bit determines if the chip is in peripheral mode. A detailed description is in Table 6-13 The default value is no peripheral mode enabled. 17:18 SC Single Chip Select -- This field defines the mode of theMPC562/MPC564. See Table 6-10. 00 Extended chip, 32 bits data 01 Extended chip, 16 bits data 10 Single chip and show cycles (address) 11 Single chip 19 ETRE Exception Table Relocation Enable -- This field defines whether the Exception Table Relocation feature in the BBC is enabled or disabled; The default state for this field is disabled. For more details, see Table 4-4. 202,3 FLEN Flash Enable -- This field determines whether the on-chip Flash memory is enabled or disabled out of reset. The default state is disabled, which means that by default, the boot is from external memory. Refer to Table 6-12 for more details. 0 Flash disabled -- boot is from external memory 1 Flash enabled 21 EN_ COMP4 Enable Compression -- This bit enables the operation of the MPC562/MPC564 with compressed code. The default state is disabled. See Table 4-4 and Appendix A, "MPC562/MPC564 Compression Features." 22 EXC_ COMP4 Exception Compression -- This bit determines the operation of the MPC562/MPC564 with exceptions. If this bit is set, then the MPC562/MPC564 assumes that ALL the exception routines are in compressed code. The default indicates the exceptions are all non-compressed. See Table 4-4 and Appendix A, "MPC562/MPC564 Compression Features." 23 -- Reserved. This bit must be 0 in the reset configuration word. Reserved. This bit must not be high in the reset configuration word. MPC561/MPC563 Reference Manual, Rev. 1.2 7-12 Freescale Semiconductor Reset Table 7-5. RCW Bit Descriptions (continued) Bits Name Description 24:25 OERC 26:27 -- 28:30 ISB Internal Space Base Select -- This field defines the initial value of the ISB field in the IMMR register. A detailed description is in Table 6-12. The default state is that the internal memory map is mapped to start at address 0x0000_0000. This bit must not be high in the reset configuration word. 31 DME Dual Mapping Enable -- This bit determines whether Dual mapping of the internal Flash is enabled. For a detailed description refer to Table 10-11. The default state is that dual mapping is disabled. 0 Dual mapping disabled 1 Dual mapping enabled Other Exceptions Relocation Control -- These bits effect only if ETRE was enabled. See Table 4-2. Relocation offset: 00 Offset 0 01 Offset 64 Kbytes 10 Offset 512 Kbytes 11 Offset to 0x003F E000 Reserved 1 Bit 15 always comes from the internal Flash Reset Configuration Word (MPC563 only). This bit should not be set on the MPC561/MPC562. 3 This bit is HC if read from the internal Flash Reset Configuration Word. See Section 21.2.3.1, "Reset Configuration Word (UC3FCFIG)." 4 Available only on the MPC562/MPC564, software should write "0" to this bit for MPC561/MPC563. 2 7.5.3 Soft Reset Configuration When a soft reset event occurs, the MPC561/MPC563 reconfigures the development port. Refer to Chapter 23, "Development Support," for details. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 7-13 Reset MPC561/MPC563 Reference Manual, Rev. 1.2 7-14 Freescale Semiconductor Chapter 8 Clocks and Power Control The main timing reference for the MPC561/MPC563 can monitor any of the following: * An external crystal with a frequency of 4 or 20 MHz * An external frequency source with a frequency of 4 MHz * An external frequency source at the system frequency The system operating frequency is generated through a programmable phase-locked loop, the system PLL (SPLL). The SPLL runs at twice the system speed. The SPLL is programmable in integer multiples of the input frequency to generate the internal (VCO/2) operating frequency. A pre-divider before the SPLL enables the division of the high frequency crystal oscillator. The internal operating SPLL frequency should be at least 30 MHz. It can be divided by a power-of-two divider to generate the system operating frequencies. In addition to the system clock, the clocks submodule provides the following: * TMBCLK to the time base (TB) and decrementer (DEC) * PITRTCLK to the periodic interrupt timer (PIT) and real-time clock (RTC) The oscillator, TB, DEC, RTC, and the PIT are powered from the keep alive power supply (KAPWR) pin. This allows the counters to continue to increment/decrement at the oscillator frequency even when the main power to the MCU is off. While the power is off, the PIT may be used to signal the power supply IC to enable power to the system at specific intervals. This is the power-down wake-up feature. When the chip is not in power-down low-power mode, the KAPWR is powered to the same voltage value as the voltage of the I/O buffers and logic. The MPC561/MPC563 clock module consists of the main crystal oscillator, the SPLL, the low-power divider, the clock generator, the system low-power control block, and the limp mode control block. The clock module receives control bits from the system clock control register (SCCR), change of lock interrupt register (COLIR), the PLL low-power and reset-control register (PLPRCR), and the PLL. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-1 Clocks and Power Control Figure 8-1 is a functional block diagram of the clock unit. MODCK[1:3] XFC VDDSYN VSSSYN EXTCLK VCOOUT 2:1 MUX 2:1 MUX SPLL Lock GCLK2 TBCLK System Low Power Control 3:1 MUX (/4 or /16) Low Power Dividers (1/2N) Clock Drivers GCLK1 / GCLK2 System Clock GCLK1C / GCLK2C System Clock to RCPU and BBC CLKOUT Drivers ENGCLK TMBCLK Driver Backup Clock Oscillator Loss Detector 3:1 MUX /4 or /256 XTAL EXTAL TMBCLK RTC / PIT Clock and Driver PITRTCLK Main Clock Oscillator Figure 8-1. Clock Unit Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 8-2 Freescale Semiconductor Clocks and Power Control 8.1 System Clock Sources The system clock can be provided by the main system oscillator, an external clock input, or the backup clock (BUCLK) on-chip ring oscillator, see Figure 8-1. The main system oscillator uses either a 4-MHz or 20-MHz crystal to generate the PLL reference clock. When the main system oscillator output is the timing reference to the system PLL, skew elimination between the XTAL/EXTAL pins and CLKOUT is not guaranteed. There is also an on-chip crystal feedback resistor on the MPC561/MPC563; however, space should be reserved for an off-chip resistor to allow for future configurations. Figure 8-2 illustrates the main system oscillator crystal configuration. The external clock input (EXTCLK pin) can receive a clock signal from an external source. The clock frequency must be in the range of 3-5 MHz or, for 1:1 mode, at the system frequency of at least 15 MHz. When the external clock input is the timing reference to the system PLL, the skew between the EXTCLK pin and the CLKOUT is less than 1 ns. The backup clock on-chip ring oscillator allows the MPC561/MPC563 to function with a less precise clock. When operating from the backup clock, the MPC561/MPC563 is in limp mode. This enables the system to continue minimum functionality until the system is fixed. The BUCLK frequency is approximately 11 MHz for the MPC561/MPC563 (see Appendix F, "Electrical Characteristics" for the complete frequency range). For normal operation, at least one clock source (EXTCLK or main system oscillator) must be active. A configuration with both clock sources active is possible as well. At this configuration EXTCLK provides the system clock and main system oscillator provides the PITRTCLK. The input of an unused timing reference (EXTCLK or EXTAL) must be grounded. XTAL EXTAL 1 M CL 1 CL 1. Resistor is not currently required on the board but space should be available for its addition in the future. Figure 8-2. Main System Oscillator Crystal Configuration 8.2 System PLL The PLL allows the processor to operate at a high internal clock frequency using a low frequency clock input, a feature which offers two benefits: reduces the overall electromagnetic interference generated by the system, and the ability to oscillate at different frequencies reduces cost by eliminating the need to add an additional oscillator to a system. The PLL can perform the following functions: * Frequency multiplication * Skew elimination * Frequency division MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-3 Clocks and Power Control 8.2.1 Frequency Multiplication The PLL can multiply the input frequency by any integer between one and 4096. The multiplication factor depends on the value of the MF[0:11] bits in the PLPRCR register. While any integer value from one to 4096 can be programmed, the resulting VCO output frequency must be at least 15 MHz. The multiplication factor is set to a predetermined value during power-on reset as defined in Table 8-1. 8.2.2 Skew Elimination The PLL is capable of eliminating the skew between the external clock entering the chip (EXTCLK) and both the internal clock phases and the CLKOUT pin, making it useful for tight synchronous timings. Skew elimination is active only when the PLL is enabled and programmed with a multiplication factor of one or two (MF = 0 or 1). The timing reference to the system PLL is the external clock input (EXTCLK pin). 8.2.3 Pre-Divider A pre-divider before the phase comparator enables additional system clock resolution when the crystal oscillator frequency is 20 MHz. The division factor is determined by the DIVF[0:4] bits in the PLPRCR. 8.2.4 PLL Block Diagram As shown in Figure 8-3, the reference signal, OSCCLK, goes to the phase comparator. The phase comparator controls the direction (up or down) that the charge pump drives the voltage across the external filter capacitor (XFC). The direction depends on whether the feedback signal phase lags or leads the reference signal. The output of the charge pump drives the VCO. The output frequency of the VCO is divided down and fed back to the phase comparator for comparison with the reference signal, OSCCLK. The MF values, zero to 4095, are mapped to multiplication factors of one to 4096. Note that when the PLL is operating in 1:1 mode (refer to Table 8-1), the multiplication factor is one (MF = 0). The PLL output frequency is twice the maximum system frequency. This double frequency is needed to generate GCLK1 and GCLK2 clocks. On power-up, with a 4-MHz or 20-MHz crystal and the default MF settings, VCOOUT will be 40 MHz and the system clock will be 20 MHz. The equation for VCOOUT is: VCOOUT = OSCCLK x (MF + 1) x 2 DIVF + 1 NOTE When operating with the backup clock, the system clock (and CLKOUT) is one-half of the ring oscillator frequency, (i.e., the system clock is approximately 11 MHz). The time base and PIT clocks will be twice the system clock frequency. In the case of initial system power up, or if KAPWR is lost, an external circuit must assert power on reset (PORESET). Once KAPWR is valid, PORESET must be asserted long enough to allow the external oscillator to start up and stabilize for the device to come out of reset in normal (non limp) mode. MPC561/MPC563 Reference Manual, Rev. 1.2 8-4 Freescale Semiconductor Clocks and Power Control If limp mode is enabled (by the MODCK[1:3] pins), and PORESET is negated before the external oscillator has started up, the backup clock, BUCLK, will be used to clock the device. The device will start to run in limp mode. Software can then switch the clock mode from BUCLK to PLL. If an application requires that the device always comes out of reset in normal mode, PORESET should be asserted long enough for the external oscillator to start up. The maximum start-up time of an external oscillator is given in Appendix F, "Electrical Characteristics" and PORESET should be asserted for this time and at least an additional 100, 000 input clock cycles. If limp mode is disabled at reset, a short reset of at least 3 s is enough to obtain normal chip operation, because the BUCLK will not start. The system will wait for the external oscillator to start-up and stabilize. The PLL will begin to lock once PORESET has been negated, assuming stable KAPWR and VDDSYN power supplies and internal oscillator (or external clock). The PLL maximum lock time is determined by the input clock to the phase comparator. The PLL locks within 500 input clock cycles if the PLPRCR[MF] <= 4. The PLL locks within 1000 input clock cycles if PLPRCR[MF] >4. HRESET will be released 512 system clock cycles after the PLL locks. Whenever PORESET is asserted, the MF bits are set according to Table 8-1, and the division factor high frequency (DFNH) and division factor low frequency (DFNL) bits in SCCR are set to the value of 0 (/1 for DFNH and /2 for DFNL). XFC VDDSYN OSCCLK Division Factor DIVF[0:4] Feedback Phase Comparator Up Down VSSSYN Charge Pump VCO VCOOUT Clock Delay Multiplication Factor MF[0:11] Figure 8-3. System PLL Block Diagram 8.2.5 PLL Pins The following pins are dedicated to the PLL operation: * VDDSYN -- Drain voltage. This is the VDD dedicated to the analog PLL circuits. The voltage should be well-regulated and the pin should be provided with an extremely low impedance path to the VDD power rail. VDDSYN should be bypassed to VSSSYN by a 0.1 F capacitor located as close as possible to the chip package. * VSSSYN -- Source voltage. This is the VSS dedicated to the analog PLL circuits. The pin should be provided with an extremely low impedance path to ground. VSSSYN should be bypassed to VDDSYN by a 0.1 F capacitor located as close as possible to the chip package. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-5 Clocks and Power Control * 8.3 XFC -- External filter capacitor. XFC connects to the off-chip capacitor for the PLL filter. One terminal of the capacitor is connected to XFC, and the other terminal is connected to VDDSYN. -- The off-chip capacitor must have the following values: - 0 < MF + 1 < 4 (1130 x (MF + 1) - 80) pF - MF + 1 42100 x (MF + 1) pF Where MF = the value stored on MF[0:11]. This is one less than the desired frequency multiplication. System Clock During PLL Loss of Lock At reset, until the SPLL is locked, the SPLL output clock is disabled. During normal operation (once the PLL has locked), either the oscillator or an external clock source is generating the system clock. In this case, if loss of lock is detected and the LOLRE (loss of lock reset enable) bit in the PLPRCR is cleared, the system clock source continues to function as the PLL's output clock. The USIU timers can operate with the input clock to the PLL, so that these timers are not affected by the PLL loss of lock. Software can use these timers to measure the loss-of-lock period. If the timer reaches the user-preset software criterion, the MPC561/MPC563 can switch to the backup clock by setting the switch to backup clock (STBUC) bit in the SCCR, provided the limp mode enable (LME) bit in the SCCR is set. If loss of lock is detected during normal operation, assertion of HRESET (for example, if LOLRE is set) disables the PLL output clock until the lock condition is met. During hard reset, the STBUC bit is set as long as the PLL lock condition is not met and clears when the PLL is locked. If STBUC and LME are both set, the system clock switches to the backup clock (BUCLK), and the chip operates in limp mode until STBUC is cleared. Every change in the lock status of the PLL can generate a maskable interrupt. NOTE When the VCO is the system clock source, chip operation is unpredictable while the PLL is unlocked. Note further that a switch to the backup clock is possible only if the LME bit in the SCCR is set. 8.4 Low-Power Divider The output of the PLL is sent to a low-power divider block. (In limp mode the BUCLK is sent to a low-power divider block.) This block generates all other clocks in normal operation, but has the ability to divide the output frequency of the VCO before it generates the general system clocks sent to the rest of the MPC561/MPC563. The PLL VCOOUT is always divided by at least two. The purpose of the low-power divider block is to allow reduction and restoration of the operating frequencies of different sections of the MPC561/MPC563 without losing the PLL lock. Using the low-power divider block, full chip operation can still be obtained, but at a lower frequency. This is called gear mode. The selection and speed of gear mode can be changed at any time, with changes occurring immediately. MPC561/MPC563 Reference Manual, Rev. 1.2 8-6 Freescale Semiconductor Clocks and Power Control The low-power divider block is controlled in the system clock control register (SCCR). The default state of the low-power divider is to divide all clocks by one. Thus, for a 40-MHz system, the general system clocks are each 40 MHz. Whenever power-on reset is asserted, the MF bits are set according to Table 8-1, and the division factor high frequency (DFNH) and division factor low frequency (DFNL) bits in SCCR are set to the value of 0 (/1 for DFNH and /2 for DFNL). 8.5 Internal Clock Signals The internal clocks generated by the clocks module are shown in Figure 8-4. The clocks module also generates the CLKOUT and ENGCLK external clock signals. The PLL synchronizes these signals to each other. The PITRTCLK frequency and source are specified by the RTDIV and RTSEL bits in the SCCR. When the backup clock is functioning as the system clock, the backup clock is automatically selected as the time base clock source and is twice the MPC561/MPC563 system clock. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-7 Clocks and Power Control GCLK1 GCLK2 GCLK1_50 (EBDF = 00) GCLK2_50 (EBDF = 00) CLKOUT (EBDF = 00) GCLK1_50 (EBDF = 01) GCLK2_50 (EBDF = 01) CLKOUT (EBDF = 01) T1 T2 T3 T4 Figure 8-4. MPC561/MPC563 Clocks Note that GCLK1_50, GCLK2_50, and CLKOUT can have a lower frequency than GCLK1 and GCLK2. This is to enable the external bus operation at lower frequencies (controlled by EBDF in the SCCR). GCLK2_50 always rises simultaneously with GCLK2. When DFNH = 0, GCLK2_50 has a 50% duty cycle. With other values of DFNH or DFNL, the duty cycle is less than 50%. Refer to Figure 8-7. GCLK1_50 rises simultaneously with GCLK1. When the MPC561/MPC563 is not in gear mode, the falling edge of GCLK1_50 occurs in the middle of the high phase of GCLK2_50. EBDF determines the division factor between GCLK1/GCLK2 and GCLK1_50/GCLK2_50. During power-on reset, the MODCK1, MODCK2, and MODCK3 pins determine the clock source for the PLL and the clock drivers. These pins are latched on the positive edge of PORESET. Their values must be stable as long as this line is asserted. The configuration modes are shown in Table 8-1. MODCK1 specifies MPC561/MPC563 Reference Manual, Rev. 1.2 8-8 Freescale Semiconductor Clocks and Power Control the input source to the SPLL (main system oscillator or EXTCLK). MODCK1, MODCK2, and MODCK3 together determine the multiplication factor at reset and the functionality of limp mode. If the configuration of PITRTCLK and TMBCLK and the SPLL multiplication factor is to remain unchanged in power-down low-power mode, the MODCK signals should not be sampled at wake-up from this mode. In this case the PORESET pin should remain negated and HRESET should be asserted during the power supply wake-up stage. When MODCK1 is cleared, the output of the main oscillator is selected as the input to the SPLL. When MODCK1 is asserted, the external clock input (EXTCLK pin) is selected as the input to the SPLL. In all cases, the system clock frequency (freqgclk2) can be reduced by the DFNH[0:2] bits in the SCCR. Note that freqgclk2(max) occurs when the DFNH bits are cleared. The TBS bit in the SCCR selects the time base clock to be either the SPLL input clock or GCLK2. When the backup clock is functioning as the system clock, the backup clock is automatically selected as the time base clock source. The PITRTCLK frequency and source are specified by the RTDIV and RTSEL bits in the SCCR. When the backup clock is functioning as the system clock, the backup clock is automatically selected as the time base clock source. When the PORESET pin is negated (driven to a high value), the MODCK1, MODCK2, and MODCK3 values are not affected. They remain the same as they were defined during the most recent power-on reset. Table 8-1 shows the clock configuration modes during power-on reset (PORESET asserted). NOTE The MODCK[1:3] are shared functions with IRQ[5:7]. If IRQ[5:7] are used as interrupts, the interrupt source should be removed during PORESET to insure the MODCK pins are in the correct state on the rising edge of PORESET. Table 8-1. Reset Clocks Source Configuration Default Values after PORESET MODCK[1:3]1 000 001 010 011 SPLL Options LME RTSEL RTDIV MF + 1 PITCLK Division TMBCLK Division 0 0 0 1 4 4 Used for testing purposes. 16 Normal operation, PLL enabled. Main timing reference is crystal osc (20 MHz). Limp mode disabled. 4 Normal operation, PLL enabled. Main timing reference is crystal osc (4 MHz). Limp mode enabled. 16 Normal operation, PLL enabled. Main timing reference is crystal osc (20 MHz). Limp mode enabled. 0 1 1 0 0 0 1 1 1 1 5 1 256 256 256 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-9 Clocks and Power Control Table 8-1. Reset Clocks Source Configuration (continued) Default Values after PORESET MODCK[1:3]1 100 101 110 111 1 LME RTSEL RTDIV PITCLK Division MF + 1 SPLL Options TMBCLK Division Normal operation, PLL enabled. 1:1 Mode 0 0 1 1 1 1 1 1 1 1 256 5 16 4 Normal operation, PLL enabled. Main timing reference is EXTCLK (3-5 MHz). Limp mode disabled. 16 Normal operation, PLL enabled. 1:1 Mode Main timing reference is EXTCLK pin (>15MHz) Limp mode enabled. 256 1 256 Main timing reference is EXTCLK pin (>15MHz) Limp mode disabled. indicates MODCK pins value during power-on reset NOTE The reset value of the PLL pre-divider is one. The values of the PITRTCLK clock division and TMBCLK clock division can be changed by software. The RTDIV bit value in the SCCR register defines the division of PITRTCLK. All possible combinations of the TMBCLK divisions are listed in Table 8-2. Table 8-2. TMBCLK Divisions1 1 8.5.1 SCCR[TBS] MF + 1 TMBCLK Division 1 -- 16 0 1, 2 16 0 >2 4 To ensure correct operation of the time base, keep the system clock to time base clock ratio above 4 and always set SCCR[TBS] = 1 when running on the backup clock (limp mode). General System Clocks The general system clocks (GCLK1C, GCLK2C, GCLK1, GCLK2, GCLK1_50, and GCLK2_50) are the basic clock supplied to all modules and sub-modules on the MPC561/MPC563. GCLK1C and GCLK2C are supplied to the RCPU and to the BBC. GCLK1C and GCLK2C are stopped when the chip enters the doze-low power mode. GCLK1 and GCLK2 are supplied to the SIU and the clock module. The external bus clock GCLK2_50 is the same as CLKOUT. The general system clock defaults to VCO/2 = 20 MHz (assuming a 20-MHz system frequency) with default power-on reset MF values. MPC561/MPC563 Reference Manual, Rev. 1.2 8-10 Freescale Semiconductor Clocks and Power Control The general system clock frequency can be switched between different values. The highest operational frequency can be achieved when the system clock frequency is determined by DFNH (CSRC bit in the PLPRCR is cleared) and DFNH = 0 (division by one). The general system clock can be operated at a low frequency (gear mode) or a high frequency. The DFNL bits in SCCR define the low frequency. The DFNH bits in SCCR define the high frequency. The frequency of the general system clock can be changed dynamically with the system clock control register (SCCR), as shown in Figure 8-5. VCO/2 (e.g., 40 MHz) O DFNH Divider DFNH Normal O O General System Clock DFNL Divider DFNL O Low Power Figure 8-5. General System Clocks Select The frequency of the general system clock can be changed "on the fly" by software. The user may simply cause the general system clock to switch to its low frequency. However, in some applications, there is a need for a high frequency during certain periods. Interrupt routines, for example, may require more performance than the low frequency operation provides, but must consume less power than in maximum frequency operation. The MPC561/MPC563 provides a method to automatically switch between low and high frequency operation whenever one of the following conditions exists: * There is a pending interrupt from the interrupt controller. This option is maskable by the PRQEN bit in the SCCR. * The (POW) bit in the MSR is clear in normal operation. This option is maskable by the PRQEN bit in the SCCR. When neither of these conditions exists and the CSRC bit in PLPRCR is set, the general system clock switches automatically back to the low frequency. Abrupt changes in the divide ratio can cause linear changes in the operating currents of the MPC561/MPC563. When the multiplication factor (PLPRCR[MF]) for the PLL is changed, the PLL stops all internal clocks until the PLL adjusts to the new frequency. This includes stopping the clock to the watchdog timer, therefore SWT cannot reset the system during this period. When the clock stops, the current consumed by the device from VDD will fall; it will then rise sharply when the PLL turns on the PLL output clocks at the new frequency. These abrupt changes in the divide ratio can cause linear changes in the operating currents of the device. Insure that the proper power supply filtering is available to handle changes instantaneously. The gear modes (DFNH and DFNL) can be used to temporarily decrease the system frequency to minimize the demand on the power supply when the MF or DIVF multiply/divide ratio is changed. When the general system clock is divided, its duty cycle is changed. One phase remains the same (for example, 12.5 ns at 40 MHz) while the other becomes longer. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-11 Clocks and Power Control NOTE CLKOUT does not have a 50% duty cycle when the general system clock is divided. The CLKOUT wave form is the same as that of GCLK2_50. GCLK1 Divide by 1 GCLK2 Divide by 1 GCLK1 Divide by 2 GCLK2 Divide by 2 GCLK1 Divide by 4 GCLK2 Divide by 4 Figure 8-6. Divided System Clocks Timing Diagram The system clocks GCLK1 and GCLK2 frequency is: FREQsysmax FREQ sys = ------------------------------------------------------------------DFNH DFNL + 1 (2 )or ( 2 ) where FREQsysmax = VCOOUT/2 Therefore, the complete equation for determining the system clock frequency is: System Frequency= OSCCLK DIVF + 1 x (MF + 1) (2DNFH) or (2DFNL + 1) 2 x 2 MPC561/MPC563 Reference Manual, Rev. 1.2 8-12 Freescale Semiconductor Clocks and Power Control The clocks GCLK1_50 and GCLK2_50 frequency is: 1 FREQsysmax FREQ 50 = ------------------------------------------------------------------- x -------------------------EBDF +1 DFNH DFNL + 1 (2 )or ( 2 ) Figure 8-7 shows the timing of USIU clocks when DFNH = 1 or DFNL = 0. GCLK1 GCLK2 GCLK1_50 (EBDF = 00) GCLK2_50 (EBDF = 00) CLKOUT (EBDF = 00) GCLK1_50 (EBDF = 01) GCLK2_50 (EBDF = 01) CLKOUT (EBDF = 01) Figure 8-7. Clocks Timing For DFNH = 1 (or DFNL = 0) 8.5.2 Clock Out (CLKOUT) CLKOUT has the same frequency as the general system clock (GCLK2_50). Unlike the main system clock GCLK1/GCLK2 however, CLKOUT (and GCLK2_50) represents the external bus clock, and thus will be one-half of the main system clock if the external bus is running at half speed (EBDF = 0b01). The CLKOUT frequency (system frequency) defaults to VCO/2. CLKOUT can drive full, half, or quarter strength; it can also be disabled. The drive strength is controlled in the system clock and reset-control register (SCCR) by the COM[0:1] and CQDS bits. (See Section 8.11.1, "System Clock Control Register (SCCR)"). Disabling or decreasing the strength of CLKOUT can reduce power consumption, noise, and electromagnetic interference on the printed circuit board. When the PLL is acquiring lock, the CLKOUT signal is disabled and remains in the low state (provided that BUCS = 0). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-13 Clocks and Power Control 8.5.3 Engineering Clock (ENGCLK) ENGCLK is an output clock with a 50% duty cycle. Its frequency defaults to VCO/128, which is 1/64 of the main system frequency. ENGCLK frequency can be programmed to the main system frequency divided by a factor from one to 64, as controlled by the ENGDIV[0:5] bits in the SCCR. ENGCLK can drive full- or half-strength, or it can also be disabled (remaining in the high state). The drive strength is controlled by the EECLK[0:1] bits in the SCCR. Disabling ENGCLK can reduce power consumption, noise, and electromagnetic interference on the printed circuit board. NOTE The full strength ENGCLK setting (SCCR[EECLK]=0b01) selects a 5-V driver while the half-strength selection (SCCR[EECLK]=0b00) is a 2.6-V driver. When the PLL is acquiring lock, the ENGCLK signal is disabled and remains in the low state (provided that BUCS = 0). NOTE Skew elimination between CLKOUT and ENGCLK is not guaranteed. 8.6 Clock Source Switching For limp mode support, clock source switching is supported. If for any reason the clock source for the chip is not functioning, the option is to switch the system clock to the backup clock ring oscillator, BUCLK. This circuit consists of a loss-of-clock detector, which sets the LOCS status bit and LOCSS sticky bit in the PLPRCR. If the LME bit in the SCCR is set, whenever LOCS is asserted, the clock logic switches the system clock automatically to BUCLK and asserts hard reset to the chip. Switching the system clock to BUCLK is also possible by software setting the STBUC bit in SCCR. Switching from limp mode to normal system operation is accomplished by clearing STBUC and LOCSS bits. This operation also asserts hard reset to the chip. At HRESET assertion, if the PLL output clock is not valid, the BUCLK will be selected until software clears LOCSS bit in SCCR. At HRESET assertion, if the PLL output clock is valid, the system will switch to oscillator/external clock. If during HRESET the PLL loses lock or the clock frequency becomes slower than the required value, the system will switch to the BUCLK. After HRESET negation the PLL lock condition does not effect the system clock source selection. If the LME bit is clear, the switch to the backup clock is disabled and assertion of STBUC bit is ignored. If the chip is in limp mode, clearing the LME bit switches the system to normal operation and asserts hard reset to the chip. Figure 8-8 describes the clock switching control logic. Table 8-3 summarizes the status and control for each state. MPC561/MPC563 Reference Manual, Rev. 1.2 8-14 Freescale Semiconductor Clocks and Power Control LME = 1 poreset_b = 0 poreset_b = 0 1,BUCLK poreset_b = 1 LME = 1 else buclk_enable = 1 & hreset_b = 0 bu cl hr k_e es na et b _b le = =1 1 LME = 0 hreset_b = 0 LOCS=0 buclk_enable = 0 & hreset_b = 0 bu hreset_b = 1 hresert_b = 0 bu c hr lk_e es n et ab _b l e = =0 1 buclk_enable=0 & hreset_b=0 4, osc cl k as _en se ab rt l hr e = es 1 et _b 3,BUCLK hreset_b = 1 else 2,BUCLK 6,BULCK buclk_enable = 1 & hreset_b = 0 5, osc else Figure 8-8. Clock Source Switching Flow Chart NOTE buclk_enable = (STBUC | LOC) and LME lock indicates loss of lock status bit (LOCS) for all cases and loss of clock sticky bit (LOCSS) when state 3 is active. When buclk_enable is changed, the chip asserts HRESET to switch the system clock to BUCLK or PLL. At PORESET negation, if the PLL is not locked, the loss-of-clock sticky bit (LOCSS) is asserted, and the chip should operate with BUCLK. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-15 Clocks and Power Control The switching from state three to state four is accomplished by clearing the STBUC and LOCSS bits. If the switching is done when the PLL is not locked, the system clock will not oscillate until lock condition is met. Table 8-3. Status of Clock Source STATE PORESET HRESET LME LOCS (status) LOCSS (sticky) STBUC BUCS Chip Clock Source 1 0 0 1 0 0 0 1 BUCLK 2 1 0 1 0/1 0 0 1 BUCLK 1 x2 0/1 0/1 1 BUCLK 0 x2 0 0 Oscillator 2 1 3 4 1 2 1 1 1 0 0/1 5 1 1 0/1 0 x 0 0 Oscillator 6 1 0 1 0/1 1 0/1 1 BUCLK At least one of the two bits, LOCSS or BUCS, must be asserted (one) in this state. X = don't care. The default value of the LME bit is determined by MODCK[1:3] during assertion of the PORESET line. The configuration modes are shown in Table 8-1. 8.7 Low-Power Modes The LPM and other bits in the PLPRCR are encoded to provide one normal operating mode and four low-power modes. In normal and doze modes the system can be in high state with frequency defined by the DFNH bits, or in the low state with frequency defined by the DFNL bits. The normal-high operating mode is the state out of reset. This is also the state of the bits after the low-power mode exit signal arrives. There are four low-power modes: * Doze mode * Sleep mode * Deep-sleep mode * Power-down mode 8.7.1 Entering a Low-Power Mode Low-power modes are enabled by setting the MSR[POW] and clearing the SCCR[LPML]. Once enabled, a low-power mode is entered by setting the LPM bits to the appropriate value. This can be done only in one of the normal modes. The user cannot change the PLPRCR[LPM or CSRC] when the MCU is in doze mode. NOTE Higher than desired currents during low-power mode can be avoided by executing a mullw instruction before entering the low-power mode, i.e., anytime after reset and prior to entering the low-power mode. MPC561/MPC563 Reference Manual, Rev. 1.2 8-16 Freescale Semiconductor Clocks and Power Control Table 8-6 summarizes the control bit settings for the different clock power modes. Table 8-4. Power Mode Control Bit Settings 8.7.2 Power Mode LPM[0:1] CSRC TEXPS Normal-high 00 0 X Normal-low ("gear") 00 1 X Doze-high 01 0 X Doze-low 01 1 X Sleep 10 X X Deep-sleep 11 X 1 Power-down 11 X 0 Power Mode Descriptions Table 8-5 describes the clock frequency and chip functionality for each power mode. Table 8-5. Power Mode Descriptions 8.7.3 Power Pins that Need to be Powered-Up Operation Mode SPLL Clocks Functionality Normal-high Active Full frequency / 2DFNH Full functions not in use are shut off Normal-low ("gear") Active Full frequency / 2DFNL+1 Doze-high Active Full frequency / 2DFNH Doze-low Active Full frequency / 2DFNL+1 Sleep Active Not active Deep-sleep Not active Not active KAPWR, IRAMSTBY Power-down Not active Not active KAPWR, IRAMSTBY SRAM Standby Not active Not active All On All On Enabled: RTC, PIT, TB and DEC, controller Disabled: extended core (RCPU, BBC, FPU) KAPWR, VDDSYN, VDD, QVDDL, NVDDL, IRAMSTBY Enabled: RTC, PIT, TB and DEC KAPWR, VDDSYN, IRAMSTBY SRAM data retention KAPWR, VDDSYN, VDD, QVDDL, NVDDL, IRAMSTBY IRAMSTBY Exiting from Low-Power Modes Exiting from low-power modes occurs through an asynchronous interrupt or a synchronous interrupt generated by the interrupt controller. Any enabled asynchronous interrupt clears the LPM bits but does not change the PLPRCR[CSRC] bit. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-17 Clocks and Power Control The return to normal-high mode from normal-low, doze-high, low, and sleep mode is accomplished with the asynchronous interrupt. The sources of the asynchronous interrupt are: * Asynchronous wake-up interrupt from the interrupt controller * RTC, PIT, or time base interrupts (if enabled) * Decrementer exception The system responds quickly to asynchronous interrupts. The wake-up time from normal-low, doze-high, doze-low, and sleep mode caused by an asynchronous interrupt or a decrementer exception is only three to four clock cycles of maximum system frequency. In 40-MHz systems, this wake-up requires 75 to 100 ns. The asynchronous wake-up interrupt from the interrupt controller is level sensitive one. It will therefore be negated only after the reset of interrupt cause in the interrupt controller. The timers' (RTC, PIT, time base, or decrementer) interrupts indications set status bits in the PLPRCR (TMIST). The clock module considers this interrupt to be pending asynchronous interrupt as long as the TMIST is set. The TMIST status bit should be cleared before entering any low-power mode. Table 8-7 summarizes wake-up operation for each of the low-power modes. Table 8-6. Power Mode Wake-Up Operation Wake-up Method Return Time from Wake-up Event to Normal-High Normal-low ("gear") Software or Interrupt Doze-high Interrupt Asynchronous interrupts: 3-4 maximum system cycles Synchronous interrupts: 3-4 actual system cycles Doze-low Interrupt Sleep Interrupt 3-4 maximum system clocks Deep-sleep Interrupt < 500 Oscillator Cycles 125 s - 4 MHz 25 s - 20 MHz Power-down Interrupt < 500 oscillator cycles + power supply wake-up IRAMSTBY External Power-on sequence Operation Mode 8.7.3.1 Exiting from Normal-Low Mode In normal mode (as well as doze mode), if the PLPRCR[CSRC] bit is set, the system toggles between low frequency (defined by PLPRCR[DFNL]) and high frequency (defined by PLPRCR[DFNH]. The system switches from normal-low mode to normal-high mode if either of the following conditions is met: * An interrupt is pending from the interrupt controller; or * The MSR[POW] bit is cleared (power management is disabled). When neither of these conditions are met, the PLPRCR[CSRC] bit is set, and the asynchronous interrupt status bits are reset, the system returns to normal-low mode. MPC561/MPC563 Reference Manual, Rev. 1.2 8-18 Freescale Semiconductor Clocks and Power Control 8.7.3.2 Exiting from Doze Mode The system changes from doze mode to normal-high mode whenever an interrupt is pending from the interrupt controller. 8.7.3.3 Exiting from Deep-Sleep Mode The system switches from deep-sleep mode to normal-high mode if any of the following conditions is met: * An interrupt is pending from the interrupt controller * An interrupt is requested by the RTC, PIT, or time base * A decrementer exception In deep-sleep mode the PLL is disabled. The wake-up time from this mode is up to 500 PLL input frequency clocks. In one-to-one mode the wake-up time may be up to 100 PLL input frequency clocks. For a PLL input frequency of 4 MHz, the wake-up time is less than 125 s. 8.7.3.4 Exiting from Power-Down Mode Exit from power-down mode is accomplished through hard reset. External logic should assert HRESET in response to the TEXPS bit being set and TEXP pin being asserted. The TEXPS bit is set by an enabled RTC, PIT, time base, or decrementer interrupt. The hard reset should be asserted for no longer than the time it takes for the power supply to wake-up in addition to the PLL lock time. When the TEXPS bit is cleared (and the TEXP signal is negated), assertion of hard reset sets the bit, causes the pin to be asserted, and causes an exit from power-down low-power mode. Refer to Section 8.8.3, "Keep-Alive Power" for more information. 8.7.3.5 Low-Power Modes Flow Figure 8-9 shows the flow among the different power modes. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-19 Clocks and Power Control (MSR[POW]+Interrupt)+PLPRCR[CSRC] Software 1 Normal-Low LPM = 00, CSRC = 1 Software 1 Doze-Low LPM = 01, CSRC = 1 ((MSR[POW]+Interrupt))*CSRC3 Interrupt Wake-up: 3 - 4 SysFreq Clocks Software 1 Software 1 Software 1 Software 1 Doze-High LPM = 01, CSRC = 0/1 Asynchronous Interrupts Wake-up: 3 - 4 Sys Freqmax Clocks LPM = 00 CSRC = 0/1 Sleep Mode LPM = 10, CSRC = 0 Deep-Sleep Mode LPM = 11, CSRC = 0, TEXPS = 1 Power-Down Mode LPM = 11, CSRC = 0, TEXPS = 02 Normal High Mode Async. Wake-up or RTC/PIT/TB/DEC Interrupt Wake-up: 500 Input Frequency Clocks RTC/PIT/TB/DEC Interrupt followed by External Hard Reset Software 1 Hard Reset 1Software is active only in normal-high/low modes. TEXPS receives the zero value by writing one. Writing of zero has no effect on TEXPS. 3The switch from normal-high to normal-low is enable only if the conditions to asynchronous interrupt are cleared. 2 Figure 8-9. Low-Power Modes Flow Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 8-20 Freescale Semiconductor Clocks and Power Control 8.8 8.8.1 Basic Power Structure General Power Supply Definitions KAPWR and VSS power the following clock unit modules: oscillator, PITRTCLK and TMBCLK generation logic, timebase, decrementer, RTC, PIT, system clock control register (SCCR), low-power and reset-control register (PLPRCR), and reset status register (RSR). All other circuits are powered by the normal supply pins: VDD, QVDDL, NVDDL, VDDF, VDDSYN, VFLASH, VDDH and VSS. The power supply for each block is listed in Table 8-7. Table 8-7. Power Supplies Circuit CLKOUT SPLL (digital), System low-power control Internal logic Clock drivers Power Supply NVDDL/QVDDL SPLL (analog) VDDSYN Main oscillator Reset machine Limp mode mechanism Register control SCCR, PLLRCR and RSR PPC RTC, PIT, TB, and DEC KAPWR CALRAM, DPTRAM, DECRAM 1 IRAMSTBY/VDD1 Keep-alive power is supplied by IRAMSTBY, but run current is provided through VDD The following are the relations between different power supplies: * VDD = QVDDL = NVDDL = VDDSYN = VDDF = 2.6 V 0.1 V * KAPWR = VDD 0.2 V (during normal operation) * VDDH = VDDA = VFLASH = 5.0 5% * KAPWR = 2.6 0.1 V (during standby operation) * IRAMSTBY = current source > 50 A, < 1.75 mA (average) NOTE The power supply inputs VDD, QVDDL, NVDDL, VDDSYN, and VDDF should all be connected to the same 2.6-V power supply. The KAPWR power supply can be connected to a 2.6-V standby power supply. If KAPWR is not connected to a standby power supply, it should be connected to the same power supply as VDD. IRAMSTBY is the input to an approximately 1.7 volt regulator. It must be connected through a resistor to a standby power supply. The power supply inputs VDDH and VFLASH should be connected to the same 5.0-V supply. VDDA can be isolated from VDDH, but should be the same approximate voltage. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-21 Clocks and Power Control 8.8.2 Chip Power Structure The MPC561/MPC563 provides a wide range of possibilities for power supply connections. Figure 8-11 illustrates the different power supply sources for each of the basic units on the chip. 8.8.2.1 NVDDL This supplies the final output stage of the 2.6-V pad output drivers. 8.8.2.2 QVDDL This supplies all pad logic and pre-driver circuitry, except for the final output stage of the 2.6-V pad output drivers. 8.8.2.3 VDD VDD powers the internal logic of the MPC561/MPC563, nominally 2.6V. 8.8.2.4 VDDSYN, VSSSYN The charge pump and the VCO of the SPLL are fed by a separate 2.6-V power supply (VDDSYN) in order to improve noise immunity and achieve a high stability in its output frequency. VSSSYN provides an isolated ground reference for the PLL. 8.8.2.5 KAPWR The oscillator, time base counter, decrementer, periodic interrupt timer and the real-time clock are fed by the KAPWR rail. This allows the external power supply unit to disconnect all other sub-units of the MCU in low-power deep-sleep mode. The TEXP pin (fed by the same rail) can be used by the external power supply unit to switch between sources. The IRQ[6:7]/MODCK[2:3], IRQ5/MODCK1, XTAL, EXTAL, EXTCLK, PORESET, HRESET, SRESET, and RSTCONF/TEXP input pins are powered by KAPWR. Circuits, including pull-up resisters, driving these inputs should be powered by KAPWR. 8.8.2.6 VDDA, VSSA VDDA supplies power to the analog subsystems of the QADC64E_A and QADC64E_B modules; it is nominally 5.0 V. VSSA is the ground reference for the analog subsystems. 8.8.2.7 VFLASH VFLASH supplies the UC3F normal operating voltage. It is nominally 5.0 V. The MPC561 has no VFLASH signal. 8.8.2.8 VDDF, VSSF VDDF provides internal core voltage to the UC3F Flash module; it should be a nominal 2.6V. VSSF provides an isolated ground for the UC3F Flash module. The MPC561 has no VDDF or VSSF signal. MPC561/MPC563 Reference Manual, Rev. 1.2 8-22 Freescale Semiconductor Clocks and Power Control 8.8.2.9 VDDH VDDH provides power for the 5-V I/O operations. It is a nominal 5.0 V. 8.8.2.10 IRAMSTBY IRAMSTBY is the data retention power supply for all on-board RAM arrays (CALRAM, DPTRAM, DECRAM). It has a shunt regulator circuit of approximately 1.7 volts that diverts excess current to ground in order to regulate voltage on the IRAMSTBY power supply pin. Run current is supplied by normal VDD. IRAMSTBY must be connected to a positive power supply, via a register, and bypassed by a capacitor to ground (see Figure 8-10. The resistor should sized according to the following equations: (VSUPPLYMIN - 1.95 V) > 50 A RSUPPLY (VSUPPLYMAX - 1.35 V) <1.75 mA (average) RSUPPLY where VSUPPLYMIN is the lowest supply voltage and VSUPPLYMAX is the highest possible supply voltage. See note in the VSRMCR[ZOREG] bit description. VSUPPLY RSUPPLY IRAMSTBY CSUPPLY Figure 8-10. IRAMSTBY Regulator Circuit 8.8.2.11 VSS VSS provides the ground reference for the MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-23 Clocks and Power Control VDD VFLASH VDDF VDDA VSSA I/O IRAMSTBY VDDH CALRAM VDD FLASH* QADC Internal Logic Oscillator, PIT, RTC, TB, and DEC DPTRAM DECRAM PLL Clock Control TEXP KAPWR VDD NVDDL QVDDL Note: Flash is not implemented on the MPC561. VDDSYN Figure 8-11. Basic Power Supply Configuration 8.8.3 8.8.3.1 Keep-Alive Power Keep-Alive Power Configuration Figure 8-12 is an example of a switching scheme for an optimized low-power system. SW1 and SW2 can be unified in only one switch if VDDSYN and VDD/NVDDL/QVDDL are supplied by the same source. MPC561/MPC563 Reference Manual, Rev. 1.2 8-24 Freescale Semiconductor Clocks and Power Control SW1 O VDDSYN Main Power Supply 2.6 V O O VDD SW2 O MPC561/MPC563 TEXP Switch Logic IRAMSTBY Power Supply IRAMSTBY KAPWR 2.6-V Backup Power Supply Figure 8-12. External Power Supply Scheme The MPC561/MPC563 asserts the TEXP signal, if enabled, when the RTC or TB time value matches the value programmed in the associated alarm register or when the PIT or DEC value reaches zero. The TEXP signal is negated when the TEXPS status bit is written to one. The KAPWR power supply feeds the main crystal oscillator (OSCM). The condition for the main crystal oscillator stability is that the power supply value changes slowly. The maximum slope must be less than 5 mV per oscillation cycle ( > 200-300/freqoscm). 8.8.3.2 Keep-Alive Power Registers Lock Mechanism The USIU timer, clocks, reset, power, decrementer, and time base registers are powered by the KAPWR supply. When the main power supply is disconnected after power-down mode is entered, the value stored in any of these registers is preserved. If power-down mode is not entered before power disconnect, there is a chance of data loss in these registers. To minimize the possibility of data loss, the MPC561/MPC563 includes a key mechanism that ensures data retention as long as a register is locked. While a register is locked, writes to this register are ignored. Each of the registers in the KAPWR region have a key that can be in one of two states: open or locked. At power-on reset the following keys are locked by default: RTC, RTSEC, RTCAL, and RTCSC. All other registers are unlocked. Each key has an address associated with it in the internal map. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-25 Clocks and Power Control A write of 0x55CCAA33 to the associated key register changes the key to the open state. A write of any other data to this location changes the key to the locked state. The key registers are write-only. A read of the key register has undefined side effects and may be interpreted as a write that locks the associated register. Table 8-8 lists the registers powered by KAPWR and the associated key registers. Table 8-8. KAPWR Registers and Key Registers KAPWR Register Address or SPR Number Register Associated Key Register Address Register 0x2F C200 Time Base Status and Control (TBSCR) See Table 6-18 for bit descriptions. 0x2F C300 Time Base Status and Control Key (TBSCRK) 0x2F C204 Time Base Reference 0 (TBREF0) See Section 6.2.2.4.3, "Time Base Reference Registers (TBREF0 and TBREF1)" for bit descriptions. 0x2F C304 Time Base Reference 0 Key (TBREF0K) 0x2F C208 Time Base Reference 1 (TBREF1) See Section 6.2.2.4.3, "Time Base Reference Registers (TBREF0 and TBREF1) for bit descriptions. 0x2F C308 Time Base Reference 1 Key (TBREF1K) 0x2F C220 Real Time Clock Status and Control (RTCSC) See Table 6-19 for bit descriptions. This register is locked after reset by default. 0x2F C320 Real Time Clock Status and Control Key (RTCSCK) 0x2F C224 Real Time Clock (RTC) See Section 6.2.2.4.6, "Real-Time Clock Register (RTC)" for bit descriptions. This register is locked after reset by default. 0x2F C324 Real Time Clock Key (RTCK) 0x2F C228 Real Time Alarm Seconds (RTSEC) Reserved. This register is locked after reset by default. 0x2F C328 Real Time Alarm Seconds Key (RTSECK) 0x2F C22C Real Time Alarm (RTCAL) See Section 6.2.2.4.7, "Real-Time Clock Alarm Register (RTCAL)" for bit descriptions. This register is locked after reset by default. 0x2F C32C Real Time Alarm Key (RTCALK) 0x2F C240 PIT Status and Control (PISCR) See Table 6-20 for bit descriptions. 0x2F C340 PIT Status and Control Key (PISCRK) 0x2F C244 PIT Count (PITC) See Table 6-21 for bit descriptions. 0x2F C344 PIT Count Key (PITCK) 0x2F C280 System Clock Control Register (SCCR) See Table 8-9 for bit descriptions. 0x2F C380 System Clock Control Key (SCCRK) 0x2F C284 PLL Low-Power and Reset-Control Register (PLPRCR) See Table 8-11 for bit descriptions. 0x2F C384 PLL Low-Power and Reset-Control Register Key (PLPRCRK) MPC561/MPC563 Reference Manual, Rev. 1.2 8-26 Freescale Semiconductor Clocks and Power Control Table 8-8. KAPWR Registers and Key Registers (continued) KAPWR Register Address or SPR Number 0x2F C288 Associated Key Register Register Address Register Reset Status Register (RSR) See Table 7-3 for bit descriptions. 0x2F C388 Reset Status Register Key (RSRK) SPR 22 Decrementer See Section 3.9.5, "Decrementer Register (DEC)" for bit descriptions. 0x2F C30C Time Base and Decrementer Key (TBK) SPR 268, 269, 284, 285, Time Base See Section 6.2.2.4.2, "Time Base SPRs (TB)," for bit descriptions. Figure 8-13 illustrates the process of locking or unlocking a register powered by KAPWR. Power-On Reset (Valid for other registers) Open Write to the Key 0x55CCAA33 Write to the key other value Locked Power On Reset (Valid for RTC, RTSEC, RTCAL and RTCSC) Figure 8-13. Keep-Alive Register Key State Diagram 8.9 IRAMSTBY Supply Failure Detection A special circuit for IRAMSTBY supply failure detection is provided. In the case of supply failure detection, the dedicated sticky bits LVSRS in the VSRMCR register are asserted. Software can read or clear these bits. The user should enable the detector and then clear these bits. If any of the LVSR bits are read as one, then a power failure of IRAMSTBY has occurred. The circuit is capable of detecting supply failure below a voltage level to be determined. Also, enable/disable control bit for the IRAMSTBY detector may be used to disconnect the circuit and save the detector power consumption. 8.10 Power-Up/Down Sequencing Figure 8-14 and Figure 8-15 detail the power-up sequencing for MPC561/MPC563 during normal operation. Note that for each of the conditions detailing the voltage relationships the absolute bounds of the minimum and maximum voltage supply cannot be violated; that is, the value of VDDL cannot fall below 2.5 V or exceed 2.7 V, and the value of VDDH cannot fall below 4.75 V or exceed 5.25 V for normal operation. Power consumption during power up sequencing will be below the operating power consumption. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-27 Clocks and Power Control During the power down sequence PORESET needs to be asserted while VDD, NVDDL, and QVDDL are at a voltage greater than or equal to 2.5 V. Below this voltage the power supply chip can be turned off. If the turn-off voltage of the power supply chip is greater than 0.74 V for the 2.6-V supply and greater than 0.8 V for the 5-V supply, then the circuitry inside the MPC561/MPC563 will act as a load to the respective supply and will discharge the supply line down to these values. Since the 2.6-V logic represents a larger load to the supply chip, the 2.6-V supply line will decay faster than the 5-V supply line. Power On Operating See Note 1. Power Off See Note 2. VDDH VDD, NVVL, QVDDL KAPWR IRAMSTBY VDDA, VRH VDDSYN VFLASH (5 V) PORESET HRESET 1 2 3 4 5 VDDH QVDDL - 0.5 V VDDA can lag VDDH, and VDDSYN can lag QVDDL, but both must be at a valid level before resets are negated. If keep-alive functions are NOT used, then when system power is on: KAPWR = QVDDL 0.1 V; KAPWR 2.7 V If keep-alive functions ARE used, then KAPWR = QVDDL = NVDDL = 2.6 V 0.1 V when system power is on KAPWR = 2.6 V 0.1 V when system power is off. IRAMSTBY should be powered prior to the other supplies. If IRAMSTBY is powered at the same time as the other supplies, it should be allowed to stabilize before PORESET is negated. Normal system power is defined as QVDDL = VDD = VDDF = VDDSYN = KAPWR = 2.6 0.1 V and VDDA = VDDH = VFLASH = 5.0 0.25 V. Flash programming requirements are the same as normal system power. VFLASH should always be 5.0 0.25 V. Note: Flash is not implemented on the MPC561. Do not hold the 2.6-V supplies at ground while VDDH/VDDA is ramping to 5 V. If 5 V is applied before the 2.6-V supply, all 5-V outputs will be in indeterminate states until the 2.6-V supply reaches a level that allows reset to be distributed throughout the device If 5 V is applied before the 2.6-V supply, all 5-V outputs will be in indeterminate states until the 2.6-V supply reaches a level that allows reset to be distributed throughout the device Figure 8-14. No Standby, No KAPWR, All System Power-On/Off MPC561/MPC563 Reference Manual, Rev. 1.2 8-28 Freescale Semiconductor Clocks and Power Control No Battery Connect Battery Power On Operating Power Off No Battery VDDH VDD, NVVL, QVDDL KAPWR IRAMSTBY VDDA, VRH VDDSYN VFLASH (5 V) PORESET HRESET 1 2 3 4 5 VDDH QVDDL - 0.5 V VDDA can lag VDDH, and VDDSYN can lag QVDDL, but both must be at a valid level before resets are negated. If keep-alive functions are NOT used, then when system power is on: KAPWR = QVDDL 0.1 V; KAPWR 2.7 V If keep-alive functions ARE used, then KAPWR = QVDDL = NVDDL = 2.6 V 0.1 V when system power is on KAPWR = 2.6 V 0.1 V when system power is off. IRAMSTBY should be powered prior to the other supplies. If IRAMSTBY is powered at the same time as the other supplies, it should be allowed to stabilize before PORESET is negated. Normal system power is defined as QVDDL = VDD = VDDF = VDDSYN = KAPWR = 2.6 0.1 V and VDDA = VDDH = VFLASH = 5.0 0.25 V. Flash programming requirements are the same as normal system power. VFLASH should always be 5.0 0.25 V. Note: Flash is not implemented on the MPC561. Do not hold the 2.6-V supplies at ground while VDDH/VDDA is ramping to 5 V. If 5 V is applied before the 2.6-V supply, all 5-V outputs will be in indeterminate states until the 2.6-V supply reaches a level that allows reset to be distributed throughout the device If 5 V is applied before the 2.6-V supply, all 5-V outputs will be in indeterminate states until the 2.6-V supply reaches a level that allows reset to be distributed throughout the device Figure 8-15. Standby and KAPWR, Other Power-On/Off NOTE For more detailed information on power sequencing see Section F.8, "Power-Up/Down Sequencing." 8.11 8.11.1 Clocks Unit Programming Model System Clock Control Register (SCCR) The SPLL has a 32-bit control register, SCCR, which is powered by keep-alive power. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-29 Clocks and Power Control MSB 0 1 Field DBCT 2 COM PORESET 1 0 ID21 HRESET U 0 ID21 3 4 5 6 7 8 4 DCSLR MFPDL LPML TBS RTDIV 0000 1 9 10 12 13 14 15 STBUC CQDS PRQEN RTSEL BUCS EBDF[0:1] LME 1 0 EQ22 1 Unaffected Addr 11 1 0 Unaffected ID[13:14]1 EQ33 ID[13:14]1 U 0x2F C280 LSB 16 17 18 19 EECLK[0:1] PORESET 0 0 20 21 22 23 ENGDIV[0:5] 1 HRESET 1 1 1 24 25 -- 1 26 27 28 DFNL[0:2] 1 -- 29 30 31 DFNH[0:2] 0000_0000 Unaffected 0000_0000 1 The hard reset value is a reset configuration word value, extracted from the indicated internal data bus lines. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." 2 EQ2 = MODCK1 3 EQ3 = (MODCK1 AND MODCK2 AND MODCK3) | (MODCK1 AND MODCK2 AND MODCK3) | (MODCK1 AND MODCK2 AND MODCK3). See Table 8-1. 4 RTDIV will be 0 if MODCK[1:3] = 000. Figure 8-16. System Clock and Reset Control Register (SCCR) NOTE COM[1] bit default value is determined during by BDRV reset configuration bit; See Section 7.5.2, "Hard Reset Configuration Word (RCW)." Table 8-9. SCCR Bit Descriptions Bits Name Description 0 DBCT Disable backup clock for timers. The DBCT bit controls the timers clock source while the chip is in limp mode. If DBCT is set, the timers clock (TMBLCK, PITRCLK) source will not be the backup clock, even if the system clock source is the backup clock ring oscillator. The real-time clock source will be EXTAL or EXTCLK according to RTSEL bit (see description in bit 11 below), and the time base clocks source will be determined according to TBS bit and MODCK1. 0 If the chip is in limp mode, the timer clock source is the backup (limp) clock 1 The timer clock source is either the external clock or the crystal (depending on the current clock mode selected) 1:2 COM Clock Output Mode - The COM and CQDS bits control the output buffer strength of the CLKOUT and external bus pins. When both COM bits are set the CLKOUT pin is held in the high (1) state and external bus pins are driven at reduced drive. These bits can be dynamically changed without generating spikes on the CLKOUT and external bus pins. If CLKOUT pin is not connected to external circuits, set both bits (disabling CLKOUT) to minimize noise and power dissipation. The default value for COM[1] is determined by the BDRV bit in the reset configuration word. See Table 7-5. For CLKOUT control see Table 8-10. MPC561/MPC563 Reference Manual, Rev. 1.2 8-30 Freescale Semiconductor Clocks and Power Control Table 8-9. SCCR Bit Descriptions (continued) Bits Name Description 3 DCSLR Disable clock switching at loss of lock during reset. When DCSLR is clear and limp mode is enabled, the chip will switch automatically to the backup clock if the PLL losses lock during HRESET. When DCSLR is asserted, a PLL loss-of-lock event does not cause clock switching. If HRESET is asserted and DCSLR is set, the chip will not negate HRESET until the PLL acquires lock. 0 Enable clock switching if the PLL loses lock during reset 1 Disable clock switching if the PLL loses lock during reset 4 MFPDL MF and pre-divider lock. Setting this control bit disables writes to the MF and DIVF bits. This helps prevent runaway software from changing the VCO frequency and causing the SPLL to lose lock. In addition, to protect against hardware interference, a hardware reset will be asserted if these fields are changed while LPML is asserted. This bit is writable once after power-on reset. 0 MF and DIVF fields are writable 1 MF and DIVF fields are locked 5 LPML LPM lock. Setting this control bit disables writes to the LPM and CSRC control bits. In addition, for added protection, a hardware reset is asserted if any mode is entered other than normal-high mode. This protects against runaway software causing the MCU to enter low-power modes. (The MSR[POW] bit provides additional protection). LPML is writable once after power-on reset.) 0 LPM and CSRC bits are writable 1 LPM and CSRC bits are locked and hard reset will occur if the MCU is not in normal-high mode 6 TBS 7 RTDIV RTC (and PIT) clock divider. At power-on reset this bit is cleared if MODCK[1:3] are all low; otherwise the bit is set. 0 RTC and PIT clock divided by 4 1 RTC and PIT clock divided by 256 8 STBUC Switch to backup clock control. When software sets this bit, the system clock is switched to the on-chip backup clock ring oscillator, and the chip undergoes a hard reset. The STBUC bit is ignored if LME is cleared. 0 Do not switch to the backup clock ring oscillator 1 Switch to backup clock ring oscillator 9 CQDS Clock quarter drive strength -- The COM and CQDS bits control the output buffer strength of the CLKOUT, see Table 8-10. 10 PRQEN Power management request enable 0 Remains in the lower frequency (defined by DFNL) even if the power management bit in the MSR is reset (normal operational mode) or if there is a pending interrupt from the interrupt controller 1 Switches to high frequency (defined by DFNH) when the power management bit in the MSR is reset (normal operational mode) or there is a pending interrupt from the interrupt controller Time base source. 0 Source is OSCCLK divided by either 4 or 16 1 Source is system clock divided by 16 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-31 Clocks and Power Control Table 8-9. SCCR Bit Descriptions (continued) Bits Name Description 11 RTSEL RTC circuit input source select. At power-on reset RTSEL receives the value of the MODCK1 signal. Refer to Table 8-1. Note that if the chip is operating in limp mode (BUCS = 0), the RTSEL bit is ignored, and the backup clock is the clock source for the RT and PIT clocks 0 OSCM clock is selected as input to RTC and PIT 1 EXTCLK clock is selected as the RTC and PIT clock source 12 BUCS Backup clock status. This status bit indicates the current system clock source. When loss of clock is detected and the LME bit is set, the clock source is the backup clock and this bit is set. When the STBUC bit and LME bit are set, the system switches to the backup clock and BUCS is set. 0 System clock is not the backup clock 1 System clock is the backup clock 13:14 EBDF[0:1] External bus division factor. These bits define the frequency division factor between (GCLK1 and GCLK2) and (GCLK1_50 and GCLK2_50). CLKOUT is similar to GCLK2_50. The GCLK2_50 and GCKL1_50 are used by the external bus interface and controller in order to interface to the external system. The EBDF bits are initialized during hard reset using the hard reset configuration mechanism. 00 CLKOUT is GCKL2 divided by 1 01 CLKOUT is GCKL2 divided by 2 1x Reserved Note: If EBDF > 0, an external burst access with short setup timing will corrupt any USIU register load/store. Refer to Section 10.2.6, "Reduced Data Setup Time." 15 LME Limp mode enable. When LME is set, the loss-of-clock monitor is enabled and any detection of loss of clock will switch the system clock automatically to backup clock. It is also possible to switch to the backup clock by setting the STBUC bit. If LME is cleared, the option of using limp mode is disabled. The loss of clock detector is not active, and any write to STBUC is ignored. The LME bit is writable once, by software, after power-on reset, when the system clock is not backup clock (BUCS = 0). During power-on reset, the value of LME is determined by the MODCK[1:3] bits. (Refer to Table 8-1.) 0 Limp mode disabled 1 Limp mode enabled 16:17 EECLK[0:1] Enable engineering clock. This field controls the output buffer voltage of the ENGCLK pin. When both bits are set the ENGCLK pin is held in the high state. These bits can be dynamically changed without generating spikes on the ENGCLK pin. If ENGCLK is not connected to external circuits, set both bits (disabling ENGCLK) to minimize noise and power dissipation. For measurement purposes the backup clock (BUCLK) can be driven externally on the ENGCLK pin. 00 Engineering clock enabled, 2.6 V output buffer 01 Engineering clock enabled (slew rate controlled), 5 V output buffer 10 BUCLK is the output on the ENGCLK 2.6 V output buffer 11 Engineering clock disabled 18:23 ENGDIV[0:5] Engineering clock division factor. These bits define the frequency division factor between VCO/2 and ENGCLK. Division factor can be from 1 (ENGDIV = 000000) to 64 (ENGDIV = 111111). These bits can be read and written at any time. They are not affected by hard reset but are cleared during power-on reset. NOTE: If the engineering clock division factor is not a power of two, synchronization between the system and ENGCLK is not guaranteed. MPC561/MPC563 Reference Manual, Rev. 1.2 8-32 Freescale Semiconductor Clocks and Power Control Table 8-9. SCCR Bit Descriptions (continued) Bits Name 24 -- 25:27 DFNL[0:2] 28 -- 29:31 DFNH Description Reserved Division factor low frequency. The user can load these bits with the desired divide value and the CSRC bit to change the frequency. Changing the value of these bits does not result in a loss of lock condition. These bits are cleared by power-on or hard reset. Refer to Section 8.5.1, "General System Clocks" and Figure 8-5 for details on using these bits. 000 Divide by 2 001 Divide by 4 010 Divide by 8 011 Divide by 16 100 Divide by 32 101 Divide by 64 110 Reserved 111 Divide by 256 Reserved Division factor high frequency. These bits determine the general system clock frequency during normal mode. Changing the value of these bits does not result in a loss of lock condition. These bits are cleared by power-on or hard reset. The user can load these bits at any time to change the general system clock rate. Note that the GCLKs generated by this division factor are not 50% duty cycle (i.e. CLKOUT). 000 Divide by 1 001 Divide by 2 010 Divide by 4 011 Divide by 8 100 Divide by 16 101 Divide by 32 110 Divide by 64 111 Reserved Table 8-10. COM and CQDS Bits Functionality 8.11.2 COM[0:1] CQDS Function 00 x Clock Output Enabled Full-Strength Output Buffer, Bus pins full drive 01 0 Clock Output Enabled Half-Strength Output Buffer, Bus pins reduced drive 01 1 Clock Output Enabled Quarter-Strength Output Buffer, Bus pins reduced drive 10 x Clock Output Disabled, Bus pins full drive 11 x Clock Output Disabled, Bus pins reduced drive PLL, Low-Power, and Reset-Control Register (PLPRCR) The PLL, low-power, and reset-control register (PLPRCR) is a 32-bit register powered by the keep-alive power supply. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-33 Clocks and Power Control MSB 0 1 2 3 Field 4 5 6 7 8 9 10 11 12 13 14 15 MF -- LOCS LOCSS SPLS PORESET 0000_0000_0000 or 0000_0000_1000 0000 HRESET Unaffected Addr 0x2F C284 LSB 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Field SPLSS TEXPS TEXP_INV TMIST -- CSRC LPM CSR LOLRE -- PORESET 0 1 HRESET U 1 30 31 DIVF 00_0000_0000_0000 U 0 U 000 Unaffected -- Unaffected Figure 8-17. PLL, Low-Power, and Reset-Control Register (PLPRCR) Table 8-11. PLPRCR Bit Descriptions Bits Name Description 0:11 MF Multiplication factor bits. The output of the VCO is divided to generate the feedback signal to the phase comparator. The MF bits control the value of the divider in the SPLL feedback loop. The phase comparator determines the phase shift between the feedback signal and the reference clock. This difference results in either an increase or decrease in the VCO output frequency. The MF bits can be read and written at any time. However, this field can be write-protected by setting the MF and pre-divider lock (MFPDL) bit in the SCCR. Changing the MF bits causes the SPLL to lose lock. Also, the MF field should not be modified when entering or exiting from low power mode (LPM change), or when back-up clock is active. The normal reset value for the DFNH bits is zero (divide by 1). When the PLL is operating in one-to-one mode, the multiplication factor is set to x1 (MF = 0). 12 -- Reserved 13 LOCS Loss of clock status. When the oscillator or external clock source is not at the minimum frequency, the loss-of-clock circuit asserts the LOCS bit. This bit is cleared when the oscillator or external clock source is functioning normally. This bit is reset only on power-on reset. Writes to this bit have no effect. 0 No loss of oscillator is currently detected 1 Loss of oscillator is currently detected 14 LOCSS Loss of clock sticky. If, after negation of PORESET, the loss-of-clock circuit detects that the oscillator or external clock source is not at a minimum frequency, the LOCSS bit is set. LOCSS remains set until software clears it by writing a one to it. A write of zero has no effect on this bit. The reset value is determined during hard reset. The STBUC bit will be set provided the PLL lock condition is not met when HRESET is asserted, and cleared if the PLL is locked when HRESET is asserted. 0 No loss of oscillator has been detected 1 Loss of oscillator has been detected 15 SPLS System PLL lock status bit 0 SPLL is currently not locked 1 SPLL is currently locked MPC561/MPC563 Reference Manual, Rev. 1.2 8-34 Freescale Semiconductor Clocks and Power Control Table 8-11. PLPRCR Bit Descriptions (continued) Bits Name Description 16 SPLSS SPLL lock status sticky bit. An out-of-lock sets the SPLSS bit. The bit remains set until software clears it by writing a one to it. A write of zero has no effect on this bit. The bit is cleared at power-on reset. This bit is not affected due to a software initiated loss-of-lock (MF change and entering deep-sleep or power-down mode). The SPLSS bit is not affected by hard reset. 0 SPLL has remained in lock 1 SPLL has gone out of lock at least once (not due to software-initiated loss of lock) 17 TEXPS Timer expired status bit. This bit controls whether the chip negates the TEXP pin in deep-sleep mode, thus enabling external circuitry to switch off the VDD (power-down mode). When LPM = 11, CSRC = 0, and TEXPS is high, the TEXP pin remains asserted. When LPM = 11, CSRC = 0, and TEXPS is low, the TEXPS pin is negated. To enable automatic wake-up TEXPS is asserted when one of the following occurs: * The PIT is expired * The real-time clock alarm is set * The time base clock alarm is set * The decrementer exception occurs * The bit remains set until software clears it by writing a one to it. A write of zero has no effect on this bit. TEXPS is set by power-on or hard reset. 0 TEXP is negated in deep-sleep mode 1 TEXP pin remains asserted always 18 TEXP_INVP Timer Expired Pin Inversed Polarity - The TEX_INVP bit controls whether the polarity of the TEXP pin will be active high (normal default) or active low. 0 The TEXP pin is active high 1 The TEXP pin is active low 19 TMIST Timers interrupt status.TMIST is set when an interrupt from the RTC, PIT, TB or DEC occurs. The TMIST bit is cleared by writing a one to it. Writing a zero has no effect on this bit. The system clock frequency remains at its high frequency value (defined by DFNH) if the TMIST bit is set, even if the CSRC bit in the PLPRCR is set (DFNL enabled) and conditions to switch to normal-low mode do not exist. This bit is cleared during power-on or hard reset. 0 No timer expired event was detected 1 A timer expire event was detected 20 -- 21 CSRC 22:23 LPM Low-power mode select. These bits are encoded to provide one normal operating mode and four low-power modes. In normal and doze modes, the system can be in high state (frequency determined by the DFNH bits) or low state (frequency defined by the DFNL bits). The LPM field can be write-protected by setting the LPM and CSRC lock (LPML) bit in the SCCR Refer to Table 8-4 and Table 8-5. 24 CSR Checkstop reset enable. If this bit is set, then an automatic reset is generated when the RCPU signals that it has entered checkstop mode, unless debug mode was enabled at reset. If the bit is clear and debug mode is not enabled, then the USIU will not do anything upon receiving the checkstop signal from the RCPU. If debug mode is enabled, then the part enters debug mode upon entering checkstop mode. In this case, the RCPU will not assert the checkstop signal to the reset circuitry. This bit is writable once after soft reset. 0 No reset will occur when checkstop is asserted 1 Reset will occur when checkstop is asserted Reserved Clock source. This bit is cleared at hard reset. 0 General system clock is determined by the DFNH value 1 General system clock is determined by the DFNL value MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-35 Clocks and Power Control Table 8-11. PLPRCR Bit Descriptions (continued) Bits Name Description 25 LOLRE Loss of lock reset enable 0 Loss of lock does not cause HRESET assertion 1 Loss of lock causes HRESET assertion Note: if limp mode is enabled, use the COLIR feature instead of setting the LOLRE bit. See Section 8.11.3, "Change of Lock Interrupt Register (COLIR)." 26 -- 27:31 DIVF 8.11.3 Reserved The DIVF bits control the value of the pre-divider in the SPLL circuit. The DIVF bits can be read and written at any time. However, the DIVF field can be write-protected by setting the MF and pre-divider lock (MFPDL) bit in the SCCR. Changing the DIVF bits causes the SPLL to lose lock. Change of Lock Interrupt Register (COLIR) The COLIR is 16-bit read/write register. It controls the change of lock interrupt generation, and is used for reporting a loss of lock interrupt source. It contains the interrupt request level and the interrupt status bit. This register is readable and writable at any time. A status bit is cleared by writing a one (writing a zero does not affect a status bit's value). The COLIR is mapped into the MPC561/MPC563 USIU register map. MSB 0 LSB 1 Field 2 3 4 5 COLIRQ SRESET 6 7 8 9 10 COLIS -- COLIE 11 0000_0000_00 Addr 12 13 14 15 -- Unaffected 0x2F C28C Figure 8-18. Change of Lock Interrupt Register (COLIR) Table 8-12. COLIR Bit Descriptions Bits Name Description 0:7 COLIRQ Change of lock interrupt request level. These bits determine the interrupt priority level of the change of lock. To specify a certain level, the appropriate one of these bits should be set. 8 COLIS If set (1), the bit indicates that a change in the PLL lock status was detected. The PLL was locked and lost lock, or the PLL was unlocked and got locked. The bit should be cleared by writing a one. 9 -- 10 COLIE 11:15 -- Reserved Change of Lock Interrupt enable. If COLIE bit is asserted, an interrupt will be generated when the COLIS bit is asserted. 0 Change of lock Interrupt disable 1 Change of lock Interrupt enable Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 8-36 Freescale Semiconductor Clocks and Power Control 8.11.4 IRAMSTBY Control Register (VSRMCR) This register contains control bits for enabling or disabling the IRAMSTBY supply detection circuit. There are also four bits that indicate the failure detection. All four bits have the same function and are required to improve the detection capability in extreme cases. MSB 0 Field LSB 1 -- PORESET 2 3 4 5 LVSRS VSRDE Unaffected 0 Addr 6 1 7 8 9 10 LVDRS ZOREG U 11 12 13 14 15 -- 0_0000_0000 0x2F C290 U = Unaffected by reset Figure 8-19. IRAMSTBY Control Register (VSRMCR) 1 This bit is reserved on mask sets which implement bit 7 (ZOREG) Table 8-13. VSRMCR Bit Descriptions Bits Name 0 -- 1:4 LVSRS 5 VSRDE1 6 LVDRS Description Reserved Loss of IRAMSTBY sticky. These status bits indicate whether a IRAMSTBY supply failure occurred. In addition, when the power is turned on for the first time, IRAMSTBY rises and these bits are set. The LVSRS bits are cleared by writing them to ones. A write of zero has no effect on these bits. 0 No IRAMSTBY supply failure was detected 1 IRAMSTBY supply failure was detected IRAMSTBY detector disable. 0 IRAMSTBY detection circuit is enabled 1 IRAMSTBY detection circuit is disabled Loss of IRAMSTBY for DECRAM Sticky -- The status bit, dedicated especially for the BBC DECRAM, which indicates if there was IRAMSTBY supply failure. When the power is turned on for the first time, IRAMSTBY rises also and the bits will be asserted. The LVDECRAM bit can be cleared by writing ones to LVDECRAM. A write of zero has no effect on this bit. The bit may be used by application software, to decide if there is need to load decompression vocabularies during reset routine. 0 IRAMSTBY supply failure was not detected 1 IRAMSTBY supply failure was detected NOTE: The LVDRS bit is provided as a convenience for indicating that the DECRAM has lost power. It requires that the IRAMSTBY pins are connected to the same power supply. It actually only monitors the IRAMSTBY supply. This bit indicates the status of the internal IRAMSTBY supply. This bit is cleared by writing a 1 to it. 1 7 ZOREG2 8:15 -- 0 Internal IRAMSTBY zener regulator has not gone out of regulation 1 Internal IRAMSTBY zener regulator has gone out of regulation. Note: ZOREG may get set inadvertently if IRAMSTBY is not supplied with at least 150A. Reserved Removed on all parts that have the ZOREG bit. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 8-37 Clocks and Power Control 2 ZOREG is not in Rev 0 of the MPC561 but is in all later revisions. It is not in Rev 0 or 0A of the MPC563, but is in Rev A and later revisions. MPC561/MPC563 Reference Manual, Rev. 1.2 8-38 Freescale Semiconductor Chapter 9 External Bus Interface The MPC561/MPC563 external bus is a synchronous, burstable bus. Signals driven on this bus must adhere to the setup and hold time relative to the bus clock's rising edge. The bus has the ability to support multiple masters. The MPC561/MPC563 external bus interface architecture supports byte, half-word, and word operands allowing access to 8-, 16-, and 32-bit data ports through the use of synchronous cycles controlled by the size outputs (TSIZ0, TSIZ1). For accesses to 16- and 8-bit ports, the slave must be controlled by the memory controller. For more information, refer to Appendix F, "Electrical Characteristics." 9.1 Features The external bus interface features are listed below: * 32-bit address bus with transfer size indication (only 24 available on pins) * 32-bit data bus * Bus arbitration logic on-chip with external master support * Chip-select and wait state generation to support peripheral or static memory devices through the memory controller * Supports various memory (SRAM, EEPROM) types: synchronous and asynchronous, burstable and non-burstable * Supports non-wrap bursts with up to four data beats * Flash ROM programming support * Implements the PowerPC ISAarchitecture * Easy to interface to slave devices * Bus is synchronous (all signals are referenced to rising edge of bus clock) * Bus can operate at the same frequency as the internal RCPU core of MPC561/MPC563 or half the frequency. 9.2 Bus Transfer Signals The bus transfers information between the MPC561/MPC563 and external memory of a peripheral device. External devices can accept or provide 8, 16, and 32 data bits in parallel and must follow the handshake protocol described in this section. The maximum number of bits accepted or provided during a bus transfer is defined as the port width. The MPC561/MPC563 has non-multiplexed address and data buses. Control signals indicate the beginning and type of the cycle, as well as the address space and size of the transfer. The selected device MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-1 External Bus Interface then controls the length of the cycle with the signal(s) used to terminate the cycle. A strobe signal for the address lines indicates the validity of the address. The MPC561/MPC563 bus is synchronous with a synchronous support. The bus and control input signals must be timed to setup and hold times relative to the rising edge of the clock. Bus cycles can be completed in two clock cycles. For all inputs, the MPC561/MPC563 latches the level of the input during a sample window around the rising edge of the clock signal. This window is illustrated in Figure 9-1, where tsu and tho are the input setup and hold times, respectively. To ensure that an input signal is recognized on a specific rising edge of the clock, that input must be stable during the sample window. If an input makes a transition during the window time period, the level recognized by the MPC561/MPC563 is not predictable; however, the MPC561/MPC563 always resolves the latched level to either a logic high or low before using it. In addition to meeting input setup and hold times for deterministic operation, all input signals must obey the protocols described in this section. tho tsu Clock Signal Sample Window Figure 9-1. Input Sample Window 9.3 Bus Control Signals The MPC561/MPC563 initiates a bus cycle by driving the address, size, address type, cycle type, and read/write outputs. At the beginning of a bus cycle, TSIZ[0:1] are driven with the address type signals. TSIZ0 and TSIZ1 indicate the number of bytes remaining to be transferred during an operand cycle (consisting of one or more bus cycles). These signals are valid at the rising edge of the clock in which the transfer start (TS) signal is asserted. The read/write (RD/WR) signal determines the direction of the transfer during a bus cycle. Driven at the beginning of a bus cycle, RD/WR is valid at the rising edge of the clock in which TS is asserted. The logic level of RD/WR only changes when a write cycle is preceded by a read cycle or vice versa. The signal may remain low for consecutive write cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 9-2 Freescale Semiconductor External Bus Interface 24 1 1 2 4 Bus Interface ADDR[8:31] RD/WR BURST TSIZ[0:1] AT[0:3] 1 PTR 1 BDIP 1 TS 1 RSV 1 KR 1 CR 32 1 Address and Transfer Attributes Transfer Start Reservation Protocol DATA[0:31] Data BI / STS 1 TA 1 TEA 1 BR 1 BG 1 BB 1 RETRY Transfer Cycle Termination Arbitration Figure 9-2. MPC561/MPC563 Bus Signals 9.4 Bus Interface Signal Descriptions Table 9-1 describes each signal in the bus interface unit. More detailed descriptions can be found in subsequent subsections. The buses are described in big endian manner, which means that bit 0 is the most significant bit in a bus (MSB), and bit 31 is the least significant bit (LSB). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-3 External Bus Interface . Table 9-1. MPC561/MPC563 BIU Signals Signal Name Pins Active I/O Description Address and Transfer Attributes ADDR[8:31] Address bus 24 [8:31] High O Specifies the physical address of the bus transaction. I Driven by an external bus master when it owns the external bus. An input for testing purposes only. O Driven by the MPC561/MPC563 along with the address when it owns the external bus. Driven high indicates that a read access is in progress. Driven low indicates that a write access is in progress. I Driven by an external master when it owns the external bus. Driven high indicates that a read access is in progress. Driven low indicates that a write access is in progress. O Driven by the MPC561/MPC563 along with the address when it owns the external bus. Driven low indicates that a burst transfer is in progress. Driven high indicates that the current transfer is not a burst. I Driven by an external master when it owns the external bus. Driven low indicates that a burst transfer is in progress. Driven high indicates that the current transfer is not a burst. The MPC561/MPC563 does not support burst accesses to internal slaves. O Driven by the MPC561/MPC563 along with the address when it owns the external bus. Specifies the data transfer size for the transaction. I Driven by an external master when it owns the external bus. Specifies the data transfer size for the transaction. O Driven by the MPC561/MPC563 along with the address when it owns the external bus. Indicates additional type on the current transaction. I Only for testing purposes. O Driven by the MPC561/MPC563 along with the address when it owns the external bus. Indicates additional information about the address on the current transaction. I Only for testing purposes. O Driven by the MPC561/MPC563 along with the address when it owns the external bus. Indicates additional information about the address on the current transaction. I Only for testing purposes. RD/WR 1 HIgh Read/write BURST 1 Low Burst transfer TSIZ[0:1] 2 High Transfer size AT[0:3] 3 High Address type RSV 1 Low Reservation transfer PTR 1 High Program trace MPC561/MPC563 Reference Manual, Rev. 1.2 9-4 Freescale Semiconductor External Bus Interface Table 9-1. MPC561/MPC563 BIU Signals (continued) Signal Name Pins Active I/O Description O Driven by the MPC561/MPC563 when it owns the external bus. It is part of the burst protocol. When BDIP is asserted, the second beat in front of the current one is requested by the master. This signal is negated prior to the end of a burst to terminate the burst data phase early. I Driven by an external master when it owns the external bus. When BDIP is asserted, the second beat in front of the current one is requested by the master. This signal is negated prior to the end of a burst to terminate the burst data phase early. The MPC561/MPC563 does not support burst accesses to internal slaves. BDIP 1 Low Burst data in progress Transfer Start O Driven by the MPC561/MPC563 when it owns the external bus. Indicates the start of a transaction on the external bus. I Driven by an external master when it owns the external bus. It indicates the start of a transaction on the external bus or (in show cycle mode) signals the beginning of an internal transaction. TS 1 Low Transfer start Reservation Protocol CR 1 Low I Cancel reservation KR 1 Kill reservation Low I Each MPC500 CPU has its own CR signal. Assertion of CR instructs the bus master to clear its reservation; some other master has touched its reserved space. This is a pulsed signal. In case of a bus cycle initiated by a STWCX instruction issued by the RCPU to a non-local bus on which the storage reservation has been lost, this signal is used by the non-local bus interface to back-off the cycle. Refer to Section 9.5.10, "Storage Reservation" for details. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-5 External Bus Interface Table 9-1. MPC561/MPC563 BIU Signals (continued) Signal Name Pins Active I/O Description Data The data bus has the following byte lane assignments: Data Byte Byte Lane DATA[0:7] 0 DATA[8:15] 1 DATA[16:23] 2 DATA[24:31] 3 O DATA[0:31] 32 High Driven by the MPC561/MPC563 when it owns the external bus and it initiated a write transaction to a slave device. For single beat transactions, the byte lanes not selected for the transfer by ADDR[30:31] and TSIZ[0:1] do not supply valid data. Data bus In addition, the MPC561/MPC563 drives the DATA[0:31] when an external master owns the external bus and initiated a read transaction to an internal slave module. I Driven by the slave in a read transaction. For single beat transactions, the MPC561/MPC563 does not sample byte lanes that are not selected for the transfer by ADDR[30:31] and TSIZ[0:1]. In addition, an external master that owns the bus and initiated a write transaction to an internal slave module drives DATA[0:31]. Transfer Cycle Termination I TA 1 Low Transfer acknowledge O TEA Transfer error acknowledge 1 Driven by the slave device to which the current transaction was addressed. Indicates that the slave has received the data on the write cycle or returned data on the read cycle. If the transaction is a burst, TA should be asserted for each one of the transaction beats. Driven by the MPC561/MPC563 when the slave device is controlled by the on-chip memory controller or when an external master initiated a transaction to an internal slave module. I Driven by the slave device to which the current transaction was addressed. Indicates that an error condition has occurred during the bus cycle. O Driven by the MPC561/MPC563 when the internal bus monitor detected an erroneous bus condition, or when an external master initiated a transaction to an internal slave module and an internal error was detected. Low MPC561/MPC563 Reference Manual, Rev. 1.2 9-6 Freescale Semiconductor External Bus Interface Table 9-1. MPC561/MPC563 BIU Signals (continued) Signal Name BI / STS Pins 1 Active Low I/O Description I Burst Inhibit: Driven by the slave device to which the current transaction was addressed. Indicates that the current slave does not support burst mode. O Burst Inhibit: Driven by the MPC561/MPC563 when the slave device is controlled by the on-chip Memory Controller. The MPC561/MPC563 also asserts BI for any external master burst access to internal MPC561/MPC563 memory space. Special Transfer Start: Driven by the MPC561/MPC563 when it owns the external bus. Indicates the start of a transaction on the external bus or signals the beginning of an internal transaction in show cycle mode. Burst inhibit/ Special Transfer Start Arbitration BR 1 I When the internal arbiter is enabled, BR assertion indicates that an external master is requesting the bus. O Driven by the MPC561/MPC563 when the internal arbiter is disabled and the chip is not parked. Low Bus request O BG 1 Low Bus grant I O BB 1 Low Bus busy I When the internal arbiter is enabled, the MPC561/MPC563 asserts this signal to indicate that an external master may assume ownership of the bus and begin a bus transaction. The BG signal should be qualified by the master requesting the bus in order to ensure it is the bus owner: Qualified bus grant = BG & ~ BB When the internal arbiter is disabled, BG is sampled and properly qualified by the MPC561/MPC563 when an external bus transaction is to be executed by the chip. When the internal arbiter is enabled, the MPC561/MPC563 asserts this signal to indicate that it is the current owner of the bus. When the internal arbiter is disabled, the MPC561/MPC563 asserts this signal after the external arbiter has granted the ownership of the bus to the chip and it is ready to start the transaction. When the internal arbiter is enabled, the MPC561/MPC563 samples this signal to get indication of when the external master ended its bus tenure (BB negated). When the internal arbiter is disabled, the BB is sampled to properly qualify the BG line when an external bus transaction is to be executed by the chip. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-7 External Bus Interface Table 9-1. MPC561/MPC563 BIU Signals (continued) Signal Name Pins Active I/O I RETRY 1 Low O Retry 9.5 Description In the case of regular transaction, this signal is driven by the slave device to indicate that the MPC561/MPC563 must relinquish the ownership of the bus and retry the cycle. When an external master owns the bus and the internal MPC561/MPC563 bus initiates access to the external bus at the same time, this signal is used to cause the external master to relinquish the bus for one clock to solve the contention. Bus Operations This section provides a functional description of the system bus, the signals that control it, and the bus cycles provided for data transfer operations. It also describes the error conditions, bus arbitration, and reset operation. The MPC561/MPC563 generates a system clock output (CLKOUT). This output sets the frequency of operation for the bus interface directly. Internally, the MPC561/MPC563 uses a phase-lock loop (PLL) circuit to generate a master clock for all of the MPC561/MPC563 circuitry (including the bus interface) which is phase-locked to the CLKOUT output signal. All signals for the MPC561/MPC563 bus interface are specified with respect to the rising edge of the external CLKOUT and are guaranteed to be sampled as inputs or changed as outputs with respect to that edge. Since the same clock edge is referenced for driving or sampling the bus signals, the possibility of clock skew could exist between various modules in a system due to routing or the use of multiple clock lines. It is the responsibility of the system to handle any such clock skew problems that could occur. 9.5.1 Basic Transfer Protocol The basic transfer protocol defines the sequence of actions that must occur on the MPC561/MPC563 bus to perform a complete bus transaction. A simplified scheme of the basic transfer protocol is illustrated in Figure 9-3. Arbitration Address Transfer Data Transfer Termination Figure 9-3. Basic Transfer Protocol The basic transfer protocol provides for an arbitration phase and an address and data transfer phase. The address phase specifies the address for the transaction and the transfer attributes that describe the transaction. The data phase performs the transfer of data (if any is to be transferred). The data phase may transfer a single beat of data (four bytes or less) for nonburst operations, a 4-beat burst of data (4 x 4 bytes), an 8-beat burst of data (8 x 2 bytes) or a 16-beat burst of data (16 x 1 bytes). MPC561/MPC563 Reference Manual, Rev. 1.2 9-8 Freescale Semiconductor External Bus Interface 9.5.2 Single Beat Transfer During the data transfer phase, the data is transferred from master to slave (in write cycles) or from slave to master (on read cycles). During a write cycle, the master drives the data as soon as it can, but never earlier than the cycle following the address transfer phase. The master has to take into consideration the "one dead clock cycle" switching between drivers to avoid electrical contentions. The master can stop driving the data bus as soon as it samples the TA line asserted on the rising edge of the CLKOUT. During a read cycle, the master accepts the data bus contents as valid at the rising edge of the CLKOUT in which the TA signal is sampled/asserted. 9.5.2.1 Single Beat Read Flow The basic read cycle begins with bus arbitration, followed by the address transfer, then the data transfer. The handshakes illustrated in the following flow and timing figures (Figure 9-4, Figure 9-5, and Figure 9-6) are applicable to the fixed transaction protocol. Master Slave 1. Request bus (BR) 2. Receive bus grant (BG) from arbiter 3. Assert bus busy (BB) if no other master is driving bus 4. Assert transfer start (TS) 5. Drive address and attributes 1. Receive address 2. Return data 3. Assert transfer acknowledge (TA) Figure 9-4. Basic Flow Diagram of a Single Beat Read Cycle MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-9 External Bus Interface CLKOUT BR Receive bus grant and bus busy negated BG O O Assert BB, drive address and assert TS BB O ADDR[8:31] RD/WR TSIZ[0:1] BURST, BDIP TS O Data TA O Data is valid Figure 9-5. Single Beat Read Cycle - Basic Timing - Zero Wait States MPC561/MPC563 Reference Manual, Rev. 1.2 9-10 Freescale Semiconductor External Bus Interface CLKOUT BR Receive bus grant and bus busy negated BG O O assert BB, drive address and assert TS BB O ADDR[8:31] RD/WR TSIZ[0:1] BURST, BDIP TS O Data TA Wait state Data is valid Figure 9-6. Single Beat Read Cycle - Basic Timing - One Wait State 9.5.2.2 Single Beat Write Flow The basic write cycle begins with a bus arbitration, followed by the address transfer, then the data transfer. The handshakes are illustrated in the following flow and timing diagrams as applicable to the fixed transaction protocol. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-11 External Bus Interface Master Slave 1. Request bus (BR) 2. Receive bus grant (BG) from arbiter 3. Assert bus busy (BB) if no other master is driving bus 4. Assert transfer start (TS) 5. Drive address and attributes 1. Drive data 1. Assert transfer acknowledge (TA) 1. Interrupt data driving Figure 9-7. Basic Flow Diagram of a Single Beat Write Cycle MPC561/MPC563 Reference Manual, Rev. 1.2 9-12 Freescale Semiconductor External Bus Interface CLKOUT BR Receive bus grant and bus busy negated BG O O Assert BB, drive address and assert TS BB O ADDR[8:31] RD/WR TSIZ[0:1] BURST, BDIP TS O Data TA O Data is sampled by slave Figure 9-8. Single Beat Basic Write Cycle Timing - Zero Wait States MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-13 External Bus Interface CLKOUT BR Receive bus grant and bus busy negated BG O O Assert BB, drive address and assert TS BB O ADDR[8:31] RD/WR TSIZ[0:1] BURST, BDIP TS O Data TA Wait state O Data is sampled Figure 9-9. Single Beat Basic Write Cycle Timing - One Wait State 9.5.2.3 Single Beat Flow with Small Port Size The general case of single beat transfers assumes that the external memory has a 32-bit port size. The MPC561/MPC563 provides an effective mechanism for interfacing with 16-bit and 8-bit port size memories, allowing transfers to these devices when they are controlled by the internal memory controller. In this case, the MPC561/MPC563 attempts to initiate a transfer as in the normal case. If the bus interface receives a small port size (16 or 8 bits) indication before the transfer acknowledge to the first beat (through the internal memory controller), the MCU initiates successive transactions until the completion of the data transfer. Note that all the transactions initiated to complete the data transfer are considered to be part of an atomic transaction, so the MCU does not allow other unrelated master accesses or bus arbitration to intervene between the transfers. If any of the transactions except the first is re-tried during an access to a small port, then a machine-check exception is generated to the RCPU. MPC561/MPC563 Reference Manual, Rev. 1.2 9-14 Freescale Semiconductor External Bus Interface CLKOUT BR BG BB ADDR[0:1] ADDR + 2 ADDR RD/WR TSIZ[0:1] 10 00 BURST, BDIP TS STS Data1 ABCDEFGH EFGHEFGH TA 1. For an illustration of device connections on the data bus, see Figure 9-23. Figure 9-10. Single Beat 32-Bit Data Write Cycle Timing -- 16-Bit Port Size 9.5.3 Data Bus Pre-Discharge Mode Pre-discharge mode is provided for applications that use 3.3-V/5-V external memories while the MPC561/MPC563 data bus pads are optimized to 2.6-V memories, and cannot tolerate more than 3.1 V. When connecting 3.3-V devices to the E-bus, and performing read and write operations, this mode should be invoked in order to avoid long term reliability issues of the data pads. When the PDMCR2[PREDIS_EN] bit is set, the MPC561/MPC563 will discharge the bus during the address phase of any write cycle prior to the data phase. The data bus will be discharged from up to 5 V to a level which is suitable to the low voltage drivers. In most cases, the ORx[EHTR] bit of the relevant memory bank, should be set along with the PREDIS_EN bit in order to reserve sufficient time for the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-15 External Bus Interface memory to three-state the bus before the bus discharge is initiated. EHTR has a slight performance reduction impact since it adds a clock gap between some read and write cycles. NOTE EHTR also adds one idle clock for two consecutive read cycles from different memory banks. NOTE The pre-disharge will not occur, when using multiple processors with a common bus accessing an external device, if the processor that initiates a read is different from the processor that initiated the previous write. Perform a write to the external device to discharge the external bus, or read a value of 0x0 from the external device, prior to accessing another MCU on the same bus. 9.5.3.1 Operating Conditions Pre-discharge mode should be enabled in the following cases: * When external devices can charge the data bus to a higher voltage level than 3.1 volts * And when one or more of the following occurs: -- The MPC561/MPC563 uses write accesses to any external memory -- Data show cycles are enabled -- Instruction show cycles are enabled in code compression mode (MPC562/MPC564 only) NOTE In the case of code compression program tracking (3rd case above), the PREDIS_EN bit should only be set when program tracking is not required since pre-discharge mode overwrites the compression show cycles data. The user should not set PREDIS_EN bit when program tracking is required on development system, and set PREDIS_EN bit on the production version. EHTR can always be set to keep the same system performance during development, and production phases. 9.5.3.2 Initialization Sequence Systems that require pre-discharge operation should include the following steps: * Execute boot sequence * Set EHTR bit in all relevant memory banks during the memory controller initialization phase (configure ORx, and BRx) if it is required to extend the time between read cycles, and pre-discharge phase of write cycles. * Set PREDIS_EN in PDMCR2 register * Start to write data to external devices MPC561/MPC563 Reference Manual, Rev. 1.2 9-16 Freescale Semiconductor External Bus Interface Refer to Section 2.4, "Pad Module Configuration Register (PDMCR2)," and Section 10.9.4, "Memory Controller Option Registers (OR0-OR3)," for more information on PREDIS_EN, and EHTR configuration bits. CLKOUT ADDR[8:31] Read Cycle Write Cycle EHTR provides 1 clock gap to three-state data bus TS RD/WR TA OE Pre-discharge to low voltage Data Read Data Write Data Figure 9-11. Read Followed by Write when Pre-Discharge Mode is Enabled, and EHTR is Set 9.5.4 Burst Transfer The MPC561/MPC563 uses non-wrapping burst transfers to access operands of up to 32 bytes (eight words). A non-wrapping burst access stops accessing the external device when the word address is modulo four/eight. Burst configuration is determined by the value of BURST_EN in the SIUMCR register. See Chapter 5, "Unified System Interface Unit (USIU) Overview" for further details. The MPC561/MPC563 begins the access by supplying a starting address that points to one of the words in the array and requires the memory to sequentially drive or sample each word on the data bus. The selected slave device must internally increment ADDR28 and ADDR29 (and ADDR30 in the case of a 16-bit port slave device, and also ADDR31 in the case of an 8-bit port slave device) of the supplied address for each transfer, causing the address to reach a four/eight word boundary, and then stop. The address and transfer attributes supplied by the MPC561/MPC563 remain stable during the transfers. The selected device terminates each transfer by driving or sampling the word on the data bus and asserting TA. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-17 External Bus Interface The MPC561/MPC563 also supports burst-inhibited transfers for slave devices that are unable to support bursting. For this type of bus cycle, the selected slave device supplies or samples the first word the MPC561/MPC563 points to and asserts the burst-inhibit signal with TA for the first transfer of the burst access. The MPC561/MPC563 responds by terminating the burst and accessing the remainder of the 16-byte block. These remaining accesses use up to three read/write bus cycles (each one for a word) in the case of a 32-bit port width slave, up to seven read/write bus cycles in the case of a 16-bit port width slave, or up to fifteen read/write bus cycles in the case of a 8-bit port width slave. The general case of burst transfers assumes that the external memory has a 32-bit port size. The MPC561/MPC563 provides an effective mechanism for interfacing with 16-bit and 8-bit port size memories, allowing bursts transfers to these devices when they are controlled by the internal memory controller. In this case, the MPC561/MPC563 attempts to initiate a burst transfer as in the normal case. If the memory controller signals to the bus interface that the external device has a small port size (8 or 16 bits), and if the burst is accepted, the bus interface completes a burst of 16 or 8 beats respectively for four words. Eight words requires 32 or 16 beats. Each beat of the burst transfers only one or two bytes effectively. Note that this burst of 8 or 16 beats is considered an atomic transaction, so the MPC561/MPC563 does not allow other unrelated master accesses or bus arbitration to intervene between the transfers. 9.5.5 Burst Mechanism In addition to the standard bus signals, the MPC561/MPC563 burst mechanism uses the following signals: * The BURST signal indicates that the cycle is a burst cycle. * The burst data in progress (BDIP) signal indicates the duration of the burst data. * The burst inhibit (BI) signal indicates whether the slave is burstable. At the start of the burst transfer, the master drives the address, the address attributes, and the BURST signal to indicate that a burst transfer is being initiated, and asserts TS. If the slave is burstable, it negates the burst-inhibit (BI) signal. If the slave cannot burst, it asserts BI. For additional details, refer to Section 10.2.5, "Burst Support." During the data phase of a burst-write cycle, the master drives the data. It also asserts BDIP if it intends to drive the data beat following the current data beat. When the slave has received the data, it asserts TA to indicate to the master that it is ready for the next data transfer. The master again drives the next data and asserts or negates the BDIP signal. If the master does not intend to drive another data beat following the current one, it negates BDIP to indicate to the slave that the next data beat transfer is the last data of the burst-write transfer. BDIP has two basic timings: normal and late (see Figure 9-14 and Figure 9-15). In the late timing mode, assertion of BDIP is delayed by the number of wait states in the first data beat. This implies that for zero-wait-state cycles, BDIP assertion time is identical in normal and late modes. Cycles with late BDIP generation can occur only during cycles for which the memory controller generates TA internally. Refer to Chapter 10, "Memory Controller" for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 9-18 Freescale Semiconductor External Bus Interface In the MPC561/MPC563, no internal master initiates write bursts. The MPC561/MPC563 is designed to perform this kind of transaction in order to support an external master that is using the memory controller services. Refer to Section 10.8, "Memory Controller External Master Support." During the data phase of a burst-read cycle, the master receives data from the addressed slave. If the master needs more than one data beat, it asserts BDIP. Upon receiving the second-to-last data beat, the master negates BDIP. The slave stops driving new data after it receives the negation of the BDIP signal at the rising edge of the clock. Burst inputs (reads) in the MPC561/MPC563 are used only for instruction cycles. Data load cycles are not supported. Figures 9-12 through 9-21 are examples of various burst cycles, including illustrations of burst-read and burst-write cycles for both the 16- and 32-bit port sizes. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-19 External Bus Interface Master Slave 1. Request Bus (BR) 2. Receive bus grant (BG) from arbiter 3. Assert Bus Busy (BB) if No Other Master is Driving 4. Assert Transfer Start (TS) 5. Drive Address and Attributes 6. Drive BURST Asserted ADDR[28:29] mod 4 =? Receive Address =0 Assert BDIP Return Data Assert Transfer Acknowledge (TA) Receive Data =1 BDIP Asserted Assert BDIP Receive Data Assert BDIP Drive Last Data & Assert TA Return Data Assert Transfer Acknowledge (TA) BDIP Asserted No Drive Last Data & Assert TA Yes Negate Burst Data in Progress (BDIP) Return Data Assert Transfer Acknowledge (TA) BDIP Asserted Receive Data =4 No Yes Receive Data =3 Drive Last Data & Assert TA Yes Return Data Assert Transfer Acknowledge (TA) BDIP Asserted =2 No No Drive Last Data & Assert TA Yes MPC561/MPC563 Reference Manual, Rev. 1.2 9-20 Freescale Semiconductor External Bus Interface Figure 9-12. Basic Flow Diagram Of A Burst-Read Cycle CLKOUT BR BG BB ADDR[8:31] ADDR[28:31] = 0000 RD/WR TSIZ[0:1] 00 BURST TS Last Beat O Expects Another Data BDIP O O O Data No Data Expected TA O O Data is Valid O Data is Valid O Data is Valid Data is Valid Figure 9-13. Burst-Read Cycle - 32-Bit Port Size - Zero Wait State MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-21 External Bus Interface CLKOUT BR BG BB ADDR[8:31] ADDR[28:31] = 0000 RD/WR TSIZ[0:1] 00 BURST TS Last Beat O Expects Another Data BDIP Normal Late O O No Data Expected O Data TA O Wait State O Data is Valid O O Data is Valid Data is Valid Data is Valid Figure 9-14. Burst-Read Cycle - 32-Bit Port Size - One Wait State MPC561/MPC563 Reference Manual, Rev. 1.2 9-22 Freescale Semiconductor External Bus Interface CLKOUT BR BG BB ADDR[8:31] ADDR[28:31] = 0000 RD/WR TSIZ[0:1] 00 BURST TS Normal or Late BDIP Last Beat O Expects Another Data O O O O No Data Expected O Data TA Data is Valid O Data is Valid O Data is Valid Data is Valid Wait State Figure 9-15. Burst-Read Cycle - 32-Bit Port Size - Wait States Between Beats MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-23 External Bus Interface CLKOUT BR BG BB ADDR[8:31] ADDR[28:31] = 0000 RD/WR TSIZ[0:1] 00 BURST TS BDIP Data[0:15] TA Figure 9-16. Burst-Read Cycle - 16-Bit Port Size MPC561/MPC563 Reference Manual, Rev. 1.2 9-24 Freescale Semiconductor External Bus Interface External Master Slave 1. Request Bus (BR) 2. Receive Bus Grant (BG) from Arbiter 3. Assert Bus Busy (BB) if No Other Master is Driving 4. Assert Transfer Start (TS) 5. Drive Address and Attributes 6. Drive BURST Asserted 7. MTS Asserted (from MPC500 Device) Drive data Receive Address ADDR[28:29] mod 4 =? =0 Assert BDIP Drive Data =1 Assert BDIP Drive Data =2 Assert BDIP Sample Data Assert Transfer Acknowledge (TA) BDIP Asserted Don't Sample Next Data Yes Sample Data Assert Transfer Acknowledge (TA) BDIP Asserted No Don't Sample Next Data No Don't Sample Next Data Yes Sample Data Assert Transfer Acknowledge (TA) Drive Data BDIP Asserted =3 No Yes Negate Burst Data in Progress (BDIP) Sample Data Assert Transfer Acknowledge (TA) BDIP Asserted Stop Driving Data No Don't Sample Next Data Yes MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-25 External Bus Interface Figure 9-17. Basic Flow Diagram of a Burst-Write Cycle CLKOUT BR1 BG1 BB1 ADDR[8:31] ADDR[28:29] = 00 RD/WR1 TSIZ[0:1] 00 BURST1 TS1 MTS BDIP1 Will Drive Another Data O O Last Beat O O No Data Expected Data TA O O O O Data Data Data Data is Sampled is Sampled is Sampledis Sampled 1From external master Figure 9-18. Burst-Write Cycle, 32-Bit Port Size, Zero Wait States (Only for External Master Memory Controller Service Support) MPC561/MPC563 Reference Manual, Rev. 1.2 9-26 Freescale Semiconductor External Bus Interface CLKOUT BR BG BB ADDR[0:27] ADDR[28:29] 0 1 2 3 ADDR[30:31] RD/WR TSIZ[0:1] 00 BURST1 TS BDIP1 Data TA BI 1 BURST and BDIP will be asserted for one cycle if the RCPU core requests a burst, but the USIU splits it into a sequence of normal cycles. Figure 9-19. Burst-Inhibit Read Cycle, 32-Bit Port Size (Emulated Burst) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-27 External Bus Interface CLKOUT BR BG BB ADDR(0:29) n (n modulo 4 = 1) ADDR[30:31] RD/WR TSIZ[0:1] 00 BURST TS Expects Another Data BDIP O O Data TA BI Figure 9-20. Non-Wrap Burst with Three Beats MPC561/MPC563 Reference Manual, Rev. 1.2 9-28 Freescale Semiconductor External Bus Interface CLKOUT BR BG BB ADDR[0:29] ADDR[30:31] n (n modulo 4 = 3) 00 RD/WR TSIZ[0:1] 00 BURST TS Is Never Asserted BDIP First and Last Beat Data TA O DATA is Sampled Figure 9-21. Non-Wrap Burst with One Data Beat 9.5.6 Alignment and Packaging of Transfers The MPC561/MPC563 external bus requires natural address alignment: * Byte accesses allow any address alignment * Half-word accesses require address bit 31 to equal zero MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-29 External Bus Interface * * Word accesses require address bits 30 - 31 to equal zero Burst accesses require address bits 30 - 31 to equal zero The MPC561/MPC563 performs operand transfers through its 32-bit data port. If the transfer is controlled by the internal memory controller, the MPC561/MPC563 can support 8- and 16-bit data port sizes. The bus requires that the portion of the data bus used for a transfer to or from a particular port size be fixed. A 32-bit port resides on DATA[0:31], a 16-bit port must reside on DATA[0:15], and an 8-bit port must reside on DATA[0:7]. The MPC561/MPC563 always tries to transfer the maximum amount of data on all bus cycles. For a word operation, it always assumes that the port is 32 bits wide when beginning the bus cycle. In Figure 9-22, Figure 9-23, Table 9-2, and Table 9-3, the following conventions are used: * OP0 is the most-significant byte of a word operand and OP3 is the least-significant byte. * The two bytes of a half-word operand are either OP0 (most-significant) and OP1 or OP2 (most-significant) and OP3, depending on the address of the access. * The single byte of a byte-length operand is OP0, OP1, OP2, or OP3, depending on the address of the access. 0 31 OP0 OP1 OP0 OP1 OP2 OP3 OP2 OP3 Word Half-word OP0 OP1 Byte OP2 OP3 Figure 9-22. Internal Operand Representation MPC561/MPC563 Reference Manual, Rev. 1.2 9-30 Freescale Semiconductor External Bus Interface Figure 9-23 illustrates the device connections on the data bus. 0 31 OP0 OP1 DATA[0:7] OP2 DATA[8:15] OP0 OP1 OP0 OP1 OP2 OP3 Interface Output Register OP3 DATA[16:23] OP2 DATA[24:31] OP3 32-bit Port Size 16-bit Port Size OP0 OP1 8-bit Port Size OP2 OP3 Figure 9-23. Interface To Different Port Size Devices Table 9-2 lists the bytes required on the data bus for read cycles. Table 9-2. Data Bus Requirements For Read Cycles Address Transfer Size Byte Half-word Word 32-bit Port Size 16-bit Port Size 8-bit Port Size TSIZE [0:1] ADDR [30:31] DATA [0:7] DATA [8:15] DATA [16:23] DATA [24:31] DATA [0:7] DATA [8:15] DATA [0:7] 01 00 OP0 -- -- -- OP0 -- OP0 01 01 -- OP1 -- -- -- OP1 OP1 01 10 -- -- OP2 -- OP2 -- OP2 01 11 -- -- -- OP3 -- OP3 OP3 10 00 OP0 OP1 -- -- OP0 OP1 OP0 10 10 -- -- OP2 OP3 OP2 OP3 OP2 00 00 OP0 OP1 OP2 OP3 OP0 OP1 OP0 Note: "--" denotes a byte not required during that read cycle. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-31 External Bus Interface Table 9-3 lists the patterns of the data transfer for write cycles when the MPC561/MPC563 initiates an access. Table 9-3. Data Bus Contents for Write Cycles Address Transfer Size TSIZE[0:1] Byte Half-word Word External Data Bus Pattern ADDR [30:31] DATA [0:7] DATA [8:15] DATA [16:23] DATA [24:31] 01 00 OP0 -- -- -- 01 01 OP1 OP1 -- -- 01 10 OP2 -- OP2 -- 01 11 OP3 OP3 -- OP3 10 00 OP0 OP1 -- -- 10 10 OP2 OP3 OP2 OP3 00 00 OP0 OP1 OP2 OP3 Note: "--" denotes a byte not driven during that write cycle. 9.5.7 Arbitration Phase The external bus design provides for a single bus master at any one time, either the MPC561/MPC563 or an external device. One or more of the external devices on the bus can have the capability of becoming bus master for the external bus. Bus arbitration may be handled either by an external central bus arbiter or by the internal on-chip arbiter. In the latter case, the system is optimized for one external bus master besides the MPC561/MPC563. The arbitration configuration (external or internal) is set at system reset. Each bus master must have bus request (BR), bus grant (BG), and bus busy (BB) signals. The device that needs the bus asserts BR. The device then waits for the arbiter to assert BG. In addition, the new master must look at BB to ensure that no other master is driving the bus before it can assert BB to assume ownership of the bus. Any time the arbiter has taken the bus grant away from the master and the master wants to execute a new cycle, the master must re-arbitrate before a new cycle can be executed. The MPC561/MPC563, however, guarantees data coherency for access to a small port size and for decomposed bursts. This means that the MPC561/MPC563 will not release the bus before the completion of the transactions that are considered atomic. Figure 9-24 describes the basic protocol for bus arbitration. MPC561/MPC563 Reference Manual, Rev. 1.2 9-32 Freescale Semiconductor External Bus Interface Requesting Device Arbiter Request the Bus 1. Assert BR Grant Bus arbitration Acknowledge Bus Mastership 1. Wait for BB to be negated. 2. Assert BB to become next master 3. Negate BR Operate as Bus Master 1. Assert BG Terminate Arbitration 1. Negate BG (or keep asserted to park bus master 1. Perform data transfer Release Bus Mastership 1. Negate BB Figure 9-24. Bus Arbitration Flowchart 9.5.7.1 Bus Request The potential bus master asserts BR to request bus mastership. BR should be negated as soon as the bus is granted, the bus is not busy, and the new master can drive the bus. If more requests are pending, the master can keep asserting its bus request as long as needed. When configured for external central arbitration, the MPC561/MPC563 drives this signal when it requires bus mastership. When the internal on-chip arbiter is used, this signal is an input to the internal arbiter and should be driven by the external bus master. 9.5.7.2 Bus Grant The arbiter asserts BG to indicate that the bus is granted to the requesting device. This signal can be negated following the negation of BR or kept asserted for the current master to park the bus. When configured for external central arbitration, BG is an input signal to the MPC561/MPC563 from the external arbiter. When the internal on-chip arbiter is used, this signal is an output from the internal arbiter to the external bus master. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-33 External Bus Interface 9.5.7.3 Bus Busy BB assertion indicates that the current bus master is using the bus. New masters should not begin transfer until this signal is negated. The bus owner should not relinquish or negate this signal until the transfer is complete. To avoid contention on the BB line, the master should three-state this signal when it gets a logical one value. This requires the connection of an external pull-up resistor to ensure that a master that acquires the bus is able to recognize the BB line negated, regardless of how many cycles have passed since the previous master relinquished the bus. Refer to Figure 9-25. Master External Bus MPC500 Device (Slave 1) TS BB Slave 2 Figure 9-25. Master Signals Basic Connection MPC561/MPC563 Reference Manual, Rev. 1.2 9-34 Freescale Semiconductor External Bus Interface CLKOUT BR0 BG0 BR1 BG1 BB ADDR[8:31] and Attributes TS TA Master 0 "Turns On" and Drives Signals Master 0 Negates BB and "Turns Off" (Three-state Controls) Master 1 "Turns On" and Drives Signals Figure 9-26. Bus Arbitration Timing Diagram 9.5.7.4 Internal Bus Arbiter The MPC561/MPC563 can be configured at system reset to use the internal bus arbiter. In this case, the MPC561/MPC563 will be parked on the bus. The parking feature allows the MPC561/MPC563 to skip the bus request phase, and if BB is negated, assert BB and initiate the transaction without waiting for BG from the arbiter. The priority of the external device relative to the internal MPC561/MPC563 bus masters is programmed in the SIU module configuration register. If the external device requests the bus and the MPC561/MPC563 does not require it, or if the external device has higher priority than the current internal bus master, the MPC561/MPC563 grants the bus to the external device. Table 9-4 describes the priority mechanism used by the internal arbiter. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-35 External Bus Interface Table 9-4. Priority Between Internal and External Masters over External Bus1 1 2 Type Direction Priority Parked access2 Internal external 0 Instruction access Internal external 3 Data access Internal external 4 External access external external/internal EARP (could be programmed to 0 - 7) External master will be granted external bus ownership if EARP is greater than the internal access priority. Parked access is instruction or data access from the RCPU which is initiated on the internal bus without requesting it first in order to improve performance. Figure 9-27 illustrates the internal finite-state machine that implements the arbiter protocol. External Owner BG = 0 BB = three state BB = 1, BR = 1 BR BR =1 = 0 External Master Requests Bus MPC500 Device Internal Master With Higher Priority than the External Device Requires the Bus External Master Release Bus BB = 0 MPC500 Device Bus Wait BG = 1 BB = three state IDLE BG = 1 BB = three state MCU Needs the Bus BB = 1 MPC500 Device No Longer Needs the Bus MPC500 Device Owner BR = 0 External Device With Higher Priority than the Current Internal Bus Master Requests the Bus BG = 1 BB = 0 MPC500 Device Still Needs the Bus Figure 9-27. Internal Bus Arbitration State Machine MPC561/MPC563 Reference Manual, Rev. 1.2 9-36 Freescale Semiconductor External Bus Interface 9.5.8 Address Transfer Phase Signals Address transfer phase signals include the following: * Transfer start * Address bus * Transfer attributes Transfer attributes signals include RD/WR, BURST, TSIZ[0:1], AT[0:3], STS, and BDIP. With the exception of the BDIP, these signals are available at the same time as the address bus. 9.5.8.1 Transfer Start This signal (TS) indicates the beginning of a transaction on the bus addressing a slave device. This signal should be asserted by a master only after the ownership of the bus was granted by the arbitration protocol. This signal is asserted for the first cycle of the transaction only and is negated in successive clock cycles until the end of the transaction. The master should three-state this signal when it relinquishes the bus to avoid contention between two or more masters in this line. This situation indicates that an external pull-up resistor should be connected to the TS signal to avoid having a slave recognize this signal as asserted when no master drives it. Refer to Figure 9-25. 9.5.8.2 Address Bus The address bus consists of 32 bits, with ADDR0 the most significant bit and ADDR31 the least significant bit. Only 24 bits (ADDR[8:31]) are available external to the MPC561/MPC563. The bus is byte-addressable, so each address can address one or more bytes. The address and its attributes are driven on the bus with the transfer start signal and kept valid until the bus master receives the transfer acknowledge signal from the slave. To distinguish the individual byte, the slave device must observe the TSIZ signals. 9.5.8.3 Read/Write A high value on the RD/WR line indicates a read access. A low value indicates a write access. 9.5.8.4 Burst Indicator BURST is driven by the bus master at the beginning of the bus cycle along with the address to indicate that the transfer is a burst transfer. The MPC561/MPC563 supports a non-wrapping, 8-beat maximum (with 32-bit port), critical word first burst type. The maximum burst size is 32 bytes. For a 16-bit port, the burst includes 16 beats. For an 8-bit port, the burst includes 32 beats at most. NOTE 8- and 16-bit ports must be controlled by the memory controller. The actual size of the burst is determined by the address of the starting word of the burst. Refer to Table 9-5 and Table 9-6. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-37 External Bus Interface Table 9-5. 4 Word Burst Length and Order Starting Address ADDR[28:29] Burst Order (Assuming 32-bit Port Size) Burst Length in Words (Beats) Burst Length in Bytes 00 word 0 word 1 word 2 word 3 4 16 01 word 1 word 2 word 3 3 12 10 word 2 word 3 2 8 11 word 3 1 4 9.5.8.5 Comments BDIP never asserted Transfer Size The transfer size signals (TSIZ[0:1]) indicate the size of the requested data transfer. During each transfer, the TSIZ signals indicate how many bytes are remaining to be transferred by the transaction. The TSIZ signals can be used with BURST and ADDR[30:31] to determine which byte lanes of the data bus are involved in the transfer. For non-burst transfers, the TSIZ signals specify the number of bytes starting from the byte location addressed by ADDR[30:31]. In burst transfers, the value of TSIZ is always 00. Table 9-6. BURST/TSIZE Encoding 9.5.8.6 BURST TSIZ[0:1] Transfer Size Negated 01 Byte Negated 10 Half-word Negated 11 x Negated 00 Word Asserted 00 Burst (16 or 32 bytes) Address Types The address type (AT[0:3]), program trace (PTR), and reservation transfer (RSV) signals are outputs that indicate one of 16 address types. These types are designated as either a normal or alternate master cycle, user or supervisor, and instruction or data type. The address type signals are valid at the rising edge of the clock in which the special transfer start (STS) signal is asserted. A special use of the PTR and RSV signals is for the reservation protocol described in Section 9.5.10, "Storage Reservation." Refer to Section 9.5.14, "Show Cycle Transactions" for information on show cycles. Table 9-7 summarizes the pins used to define the address type. Table 9-8 lists all the definitions achieved by combining these pins. MPC561/MPC563 Reference Manual, Rev. 1.2 9-38 Freescale Semiconductor External Bus Interface Table 9-7. Address Type Pins Pin : Function STS 0 Special transfer 1 Normal transfer TS 0 Start of transfer 1 No transfer AT0 Must equal zero on MPC561/MPC563 AT1 0 Supervisor mode 1 User mode AT2 0 Instruction 1 Data AT3 Reservation/Program Trace PTR 0 Program trace 1 No program trace RSV 0 Reservation data 1 No reservation Table 9-8. Address Types Definition STS TS AT0 AT1 AT2 AT3 PTR RSV 1 x x x x x 1 1 No transfer 0 01 0 0 0 0 0 1 RCPU, normal instruction, program trace, supervisor mode 1 1 1 RCPU, normal instruction, supervisor mode 0 1 0 RCPU, reservation data, supervisor mode 1 1 1 RCPU, normal data, supervisor mode 0 0 1 RCPU, normal instruction, program trace, user mode 1 1 1 RCPU, normal instruction, user mode 0 1 0 RCPU, reservation data, user mode 1 1 1 RCPU, normal data, user mode 1 1 0 1 1 Address Space Definitions 1 ? ? ? 1 1 Reserved 0 0 0 0 0 1 RCPU, show cycle address instruction, program trace, supervisor mode 1 1 1 RCPU, show cycle address instruction, supervisor mode 0 1 0 RCPU, reservation show cycle data, supervisor mode 1 1 1 RCPU, show cycle data, supervisor mode 0 0 1 RCPU, show cycle address instruction, program trace, user mode 1 1 1 RCPU, show cycle address instruction, user mode 0 1 0 RCPU, reservation show cycle data, user mode 1 1 1 RCPU, show cycle data, user mode ? 1 1 Reserved 1 1 0 1 1 ? ? MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-39 External Bus Interface 1 Cases in which both TS and STS are asserted indicate normal cycles with the show cycle attribute. 9.5.8.7 Burst Data in Progress This signal is sent from the master to the slave to indicate that there is a data beat following the current data beat. The master uses this signal to give the slave advance warning of the remaining data in the burst. BDIP can also be used to terminate the burst cycle early. Refer to Section 9.5.4, "Burst Transfer" and Section 9.5.5, "Burst Mechanism" for more information. Refer to Section 10.9.3, "Memory Controller Base Registers (BR0-BR3)" for memory controller BDIP options. 9.5.9 Termination Signals The EBI uses three termination signals: * Transfer acknowledge (TA) * Burst inhibit (BI) * Transfer error acknowledge (TEA) 9.5.9.1 Transfer Acknowledge Transfer acknowledge (TA) indicates normal completion of the bus transfer. During a burst cycle, the slave asserts this signal with every data beat returned or accepted. 9.5.9.2 Burst Inhibit A slave sends the BI signal to the master to indicate that the addressed device does not have burst capability. If this signal is asserted, the master must transfer in multiple cycles and increment the address for the slave to complete the burst transfer. For a system that does not use the burst mode at all, this signal can be tied low permanently. Refer to Section 10.9.3, "Memory Controller Base Registers (BR0-BR3)" for BI options. 9.5.9.3 Transfer Error Acknowledge The TEA signal terminates a bus cycle under one or more bus error conditions. The current bus cycle must be aborted. This signal overrides any other cycle termination signals, such as transfer acknowledge. 9.5.9.4 Termination Signals Protocol The transfer protocol was defined to avoid electrical contention on lines that can be driven by various sources. To this end, a slave must not drive signals associated with the data transfer until the address phase is completed and it recognizes the address as its own. The slave must disconnect from signals immediately after it has acknowledged the cycle and no later than the termination of the next address phase cycle. This means that the termination signals must be connected to power through a pull-up resistor to avoid the situation in which a master samples an undefined value in any of these signals when no real slave is addressed. Refer to Figure 9-28 and Figure 9-29. MPC561/MPC563 Reference Manual, Rev. 1.2 9-40 Freescale Semiconductor External Bus Interface Slave 1 External Bus MCU Acknowledge Signals TA TEA Slave 2 Figure 9-28. Termination Signals Protocol Basic Connection CLKOUT ADDR[8:31] Slave 1 Slave 2 RD/WR TSIZ[0:1] TS Data TA, BI, TEA Slave 1 allowed to drive acknowledge signals Slave 1 negates acknowledge signals and turns off Slave 2 allowed to drive acknowledge signals Slave 2 negates acknowledge signals and turns off Figure 9-29. Termination Signals Protocol Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-41 External Bus Interface 9.5.10 Storage Reservation Reservation occurs when a master loads data from memory. The memory location must not be overwritten until the master finishes processing the data and writing the results back to the reserved location. The MPC561/MPC563 storage reservation protocol supports a multi-level bus structure. For each local bus, storage reservation is handled by the local reservation logic. The protocol tries to optimize reservation cancellation such that an MPC500 processor is notified of storage reservation loss on a remote bus only when it has issued a conditional storeword (stwcx) cycle to that address. That is, the reservation loss indication comes as part of the stwcx cycle. This method avoids the need to have very fast storage reservation loss indication signals routed from every remote bus to every MPC500 master. The storage reservation protocol makes the following assumptions: * Each processor has, at most, one reservation flag * lwarx sets the reservation flag * lwarx by the same processor clears the reservation flag related to a previous lwarx instruction and again sets the reservation flag * stwcx by the same processor clears the reservation flag * Store by the same processor does not clear the reservation flag * Some other processor (or other mechanism) store to the same address as an existing reservation clears the reservation flag * In case the storage reservation is lost, it is guaranteed that stwcx will not modify the storage The reservation protocol for a single-level (local) bus is illustrated in Figure 9-30. The protocol assumes that an external logic on the bus carries out the following functions: * Snoops accesses to all local bus slaves * Holds one reservation for each local master capable of storage reservations * Sets the reservation when that master issues a load and reserve request * Clears the reservation when some other master issues a store to the reservation address MPC561/MPC563 Reference Manual, Rev. 1.2 9-42 Freescale Semiconductor External Bus Interface MPC500 Device External Bus External Bus Interface Bus Master lwarx S Q R Enable external stwcx access AT[0:3], RSV, R/W, TS ADDR[0:29] CR Reservation Logic CR CLKOUT Figure 9-30. Reservation on Local Bus The MPC561/MPC563 samples the CR line at the rising edge of CLKOUT. When this signal is asserted, the reservation flag is reset (negated). The external bus interface (EBI) samples the logical value of the reservation flag prior to externally starting a bus cycle initiated by the RCPU stwcx instruction. If the reservation flag is set, the EBI begins with the bus cycle. If the reservation flag is reset, no bus cycle is initiated externally, and this situation is reported to the RCPU. The reservation protocol for a multi-level (local) bus is illustrated in Figure 9-31. The system describes the situation in which the reserved location is sited in the remote bus. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-43 External Bus Interface External Bus (Local Bus) External Bus Interface AT[0:3], RSV, R/W, TS MPC500 Device ADDR[0:29] Local Master Accesses with lwarx to Remove Bus Address KR Q Bus Interface S R A Master in the Remote Bus Write to the Reserved Location Remote Bus Figure 9-31. Reservation on Multi-level Bus Hierarchy In this case, the bus interface block implements a reservation flag for the local bus master. The reservation flag is set by the bus interface when a load with reservation is issued by the local bus master and the reservation address is located on the remote bus. The flag is reset (negated) when an alternative master on the remote bus accesses the same location in a write cycle. If the MPC561/MPC563 begins a memory cycle to the previously reserved address (located in the remote bus) as a result of an stwcx instruction, the following two cases can occur: * If the reservation flag is set, the buses interface acknowledges the cycle in a normal way * If the reservation flag is reset, the bus interface should assert the KR. However, the bus interface should not perform the remote bus write-access or abort it if the remote bus supports aborted cycles. In this case the failure of the stwcx instruction is reported to the RCPU. MPC561/MPC563 Reference Manual, Rev. 1.2 9-44 Freescale Semiconductor External Bus Interface 9.5.11 Bus Exception Control Cycles The MPC561/MPC563 bus architecture requires assertion of TA from an external device to signal that the bus cycle is complete. TA is not asserted in the following cases: * The external device does not respond * Various other application-dependent errors occur External circuitry can provide TEA when no device responds by asserting TA within an appropriate period of time after the MPC561/MPC563 initiates the bus cycle (it can be the internal bus monitor). This allows the cycle to terminate and the processor to enter exception-processing for the error condition (each one of the internal masters causes an internal interrupt under this situation). To properly control termination of a bus cycle for a bus error, TEA must be asserted at the same time or before TA is asserted. TEA should be negated before the second rising edge after it was sampled as asserted to avoid the detection of an error for the next initiated bus cycle. TEA is an open drain pin that allows the "wired-or" of any different sources of error generation. 9.5.11.1 Retrying a Bus Cycle When an external device asserts the RETRY signal during a bus cycle, the MPC561/MPC563 enters a sequence in which it terminates the current transaction, relinquishes the ownership of the bus, and retries the cycle using the same address, address attributes, and data (in the case of a write cycle). Figure 9-32 illustrates the behavior of the MPC561/MPC563 when the RETRY signal is detected as a termination of a transfer. As seen in this figure, in the case when the internal arbiter is enabled, the MPC561/MPC563 negates BB and asserts BG in the clock cycle following the retry detection. This allows any external master to gain bus ownership. In the next clock cycle, a normal arbitration procedure occurs again. As shown in the figure, the external master did not use the bus, so the MPC561/MPC563 initiates a new transfer with the same address and attributes as before. In Figure 9-33, the same situation is shown except that the MPC561/MPC563 is working with an external arbiter. In this case, in the clock cycle after the RETRY signal is detected asserted, BR is negated together with BB. One clock cycle later, the normal arbitration procedure occurs again. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-45 External Bus Interface CLKOUT BR BG (output) BB ADDR[8:31] Allow External Master to Gain the Bus ADDR ADDR RD/WR TSIZ[0:1] BURST TS Data TA RETRY (input) O Figure 9-32. Retry Transfer Timing - Internal Arbiter MPC561/MPC563 Reference Manual, Rev. 1.2 9-46 Freescale Semiconductor External Bus Interface CLKOUT BR (output) BG Allow External Master to Gain the Bus BB ADDR[8:31] ADDR ADDR RD/WR TSIZ[0:1] BURST TS Data TA RETRY (input) O Figure 9-33. Retry Transfer Timing - External Arbiter When the MPC561/MPC563 initiates a burst access, the bus interface recognizes the RETRY assertion as a retry termination only if it detects it before the first data beat was acknowledged by the slave device. When the RETRY signal is asserted as a termination signal on any data beat of the access after the first (being the first data beat acknowledged by a normal TA assertion), the MPC561/MPC563 recognizes RETRY as a transfer error acknowledge. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-47 External Bus Interface CLKOUT BR BG (output) Allow External Master to Gain the Bus BB ADDR[8:31] ADDR ADDR RD/WR TSIZ[0:1] BURST TS Data TA BI RETRY O If Asserted Will Cause Transfer Error Figure 9-34. Retry on Burst Cycle If a burst access is acknowledged on its first beat with a normal TA but with the BI signal asserted, the following single-beat transfers initiated by the MPC561/MPC563 to complete the 16-byte transfer recognizes the RETRY signal assertion as a transfer error acknowledge. In the case in which a small port size causes the MPC561/MPC563 to break a bus transaction into several small transactions, terminating any transaction with RETRY causes a transfer error acknowledge. See Section 9.5.2.3, "Single Beat Flow with Small Port Size." MPC561/MPC563 Reference Manual, Rev. 1.2 9-48 Freescale Semiconductor External Bus Interface 9.5.11.2 Termination Signals Protocol Summary Table 9-9 summarizes how the MPC561/MPC563 recognizes the termination signals provided by the slave device that is addressed by the initiated transfer. Table 9-9. Termination Signals Protocol 9.5.12 TEA TA RETRY Action Asserted X X Transfer error termination Negated Asserted X Normal transfer termination Negated Negated Asserted Retry transfer termination Bus Operation in External Master Modes When an external master takes ownership of the external bus and the MPC561/MPC563 is programmed for external master mode operation, the external master can access the internal space of the MPC561/MPC563 (see Section 6.1.2, "External Master Modes"). In external master mode, the external master owns the bus, and the direction of most of the bus signals is inverted, relative to its direction when the MPC561/MPC563 owns the bus. The external master gets ownership of the bus and asserts TS in order to initiate an external master access. The access is directed to the internal bus only if the input address matches the internal address space. The access is terminated with one of the followings outputs: TA, TEA, or RETRY. If the access completes successfully, the MPC561/MPC563 asserts TA, and the external master can proceed with another external master access or relinquish the bus. If an address or data error is detected internally, the MPC561/MPC563 asserts TEA for one clock. TEA should be negated before the second rising edge after it is sampled asserted in order to avoid the detection of an error for the next bus cycle initiated. TEA is an open drain pin, and the negation timing depends on the attached pull-up. The MPC561/MPC563 asserts the RETRY signal for one clock in order to retry the external master access. If the address of the external access does not match the internal memory space, the internal memory controller can provide the chip-select and control signals for accesses that belong to one of the memory controller regions. This feature is explained in Chapter 10, "Memory Controller." Figure 9-35 and Figure 9-36 illustrate the basic flow of read and write external master accesses. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-49 External Bus Interface External Master MPC500 Device 1. Request Bus (BR) 2. Receives Bus Grant (BG) From Arbiter 3. Asserts Bus Busy (BB) if No Other Master is Driving 4. Assert Transfer Start (TS) 5. Drives Address and Attributes 1. Receives Address Address in Internal Memory Map No Yes 1. Returns Data Memory Controller Asserts CSx If In Range 1. Asserts Transfer Acknowledge (TA) 1. Receives Data Figure 9-35. Basic Flow of an External Master Read Access MPC561/MPC563 Reference Manual, Rev. 1.2 9-50 Freescale Semiconductor External Bus Interface External Master MPC500 Device 1. Request Bus (BR) 2. Receives Bus Grant (BG) From Arbiter 3. Asserts Bus Busy (BB) if No Other Master is Driving 4. Assert Transfer Start (TS) 5. Drives Address and Attributes 1. Receives Address 1. Drives Data Address in Internal Memory Map No Yes Memory Controller Asserts CSx If In Range 1. Receives Data 1. Asserts Transfer Acknowledge (TA) Figure 9-36. Basic Flow of an External Master Write Access Figure 9-37, Figure 9-38, and Figure 9-39 describe read and write cycles from an external master accessing internal space in the MPC561/MPC563. NOTE The minimum number of wait states for such access is two clocks. The accesses in these figures are valid for both peripheral mode and slave mode. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-51 External Bus Interface CLKOUT BR (input) Use the Internal Arbiter Receive Bus Grant and Bus Busy Negated BG O O Assert BB, Drive Address and Assert TS BB O ADDR[8:31] RD/WR TSIZ[0:1] BURST BDIP TS (input) O Data TA (output) Minimum 2 Wait States O Data is valid Figure 9-37. Peripheral Mode: External Master Reads from MPC561/MPC563 (Two Wait States) MPC561/MPC563 Reference Manual, Rev. 1.2 9-52 Freescale Semiconductor External Bus Interface CLKOUT BR (input) Use the Internal Arbiter BG Receive Bus Grant and Bus Busy Negated O O Assert BB, Drive Address and Assert TS BB O ADDR[8:31] RD/WR TSIZ[0:1] BURST BDIP TS (input) O Data TA (output) O Minimum 2 Wait States Data is sampled Figure 9-38. Peripheral Mode: External Master Writes to MPC561/MPC563 (Two Wait States) 9.5.13 Contention Resolution on External Bus When the MPC561/MPC563 is in slave mode, external master access to the MPC561/MPC563 internal bus can be terminated with relinquish and retry in order to allow a pending internal-to-external access to be executed. The RETRY signal functions as an output that signals the external master to release the bus ownership and retry the access after one clock. Figure 9-39 describes the flow of an external master retried access. Figure 9-40 shows the timing when an external access is retried and a pending internal-to-external access follows. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-53 External Bus Interface External Master MPC500 Device 1. Request Bus (BR) 2. Receives Bus Grant (BG) from Arbiter 3. Asserts Bus Busy (BB) if No Other Master is Driving 4. Assert Transfer Start (TS) 5. Drives Address and Attributes 1. Assert Retry 1. Release Bus Request (BR) for One Clock and Request Bus (BR) Again 2. Wait Until Bus Busy Negated (No Other Master is Driving) 3. Assert Bus Busy (BB) 4. Assert Transfer Start (TS) 5. Drives Address and Attributes 1. Receives Address No Address in Internal Memory Map Yes Memory Controller Asserts CSx If In Range 1. Returns Data 1. Asserts Transfer Acknowledge (TA) 1. Receives Data Figure 9-39. Flow of Retry of External Master Read Access MPC561/MPC563 Reference Manual, Rev. 1.2 9-54 Freescale Semiconductor External Bus Interface CLKOUT BR BG (output) Allow Internal Access to Gain the Bus BB ADDR[8:31] ADDR (external) ADDR (internal) RD/WR TSIZ[0:1] BURST TS Data TA RETRY (output) O Note: the delay for the internal to external cycle may be one clock or greater. Figure 9-40. Retry of External Master Access (Internal Arbiter) 9.5.14 Show Cycle Transactions Show cycles are representations of RCPU accesses to internal devices of the MPC561/MPC563. These accesses are driven externally for emulation, visibility, and debugging purposes. A show cycle can have one address phase and one data phase, or just an address phase in the case of instruction show cycles. The cycle can be a write or a read access. The data for both the read and write accesses should be driven by the bus master. (This is different from normal bus read and write accesses.) The address and data of the show cycle must each be valid on the bus for one clock. The data phase must not require a transfer acknowledge to terminate the bus show cycle. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-55 External Bus Interface Show cycles are activated by properly setting the SIUMCR register bits. Refer to Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR)." Construction visibility is controlled by the ISCT_SER bits in the ICTRL register. Refer to Table 23-26. Data visibility is controlled by the LSHOW bits of the L2U_MCR register. Refer to Table 11-7. In a burst show cycle only the first data beat is shown externally. Refer to Table 9-8 for show cycle transaction encodings. Instruction show cycle bus transactions have the following characteristics (see Figure 9-41): * One clock cycle * Address phase only; in decompression on mode part of the compressed address is driven on data lines together with address lines. The external bus interface adds one clock delay between a read cycle and such show cycle. * STS assertion only (no TA assertion) The compressed address is driven on the external bus in the following manner: * ADDR[0:29] = the word base address; * DATA[0] = operating mode: -- 0 = decompression off mode; -- 1 = decompression on mode; * DATA[1:4] = bit pointer See Chapter 4, "Burst Buffer Controller 2 Module" and Appendix A, "MPC562/MPC564 Compression Features" for more details about decompression mode. MPC561/MPC563 Reference Manual, Rev. 1.2 9-56 Freescale Semiconductor External Bus Interface I CLKOUT PTR BB ADDR[8:31] ADDR2 ADDR1 RD/WR TSIZ[0:1] BURST TS STS Data (three-state) TA "Compressed" address on data lines "Normal" Non-Show Cycle Bus Transaction Instruction Show Cycle Bus Transaction Figure 9-41. Instruction Show Cycle Transaction Both read and write data show cycles have the following characteristics: (see Figure 9-42) * Two clock cycle duration * Address valid for two clock cycles * Data is valid only in the second clock cycle * STS signal only is asserted (no TA or TS) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 9-57 External Bus Interface CLKOUT BR (in) BG (out) BB ADDR[8:31] ADDR1 ADDR2 RD/WR TSIZ[0:1] BURST TS STS Data DATA1 DATA2 TA Read Data Show Cycle Bus Transaction Write Data Show Cycle Bus Transaction Figure 9-42. Data Show Cycle Transaction MPC561/MPC563 Reference Manual, Rev. 1.2 9-58 Freescale Semiconductor Chapter 10 Memory Controller The memory controller generates interface signals to support a glueless interface to external memory and peripheral devices. It supports four regions, each with its own programmed attributes. The four regions are controlled by four chip-select signals. Read and write strobes are also provided. The memory controller operates in parallel with the external bus interface to support external cycles. When an access to one of the memory regions is initiated, the memory controller takes ownership of the external signals and controls the access until its termination. Refer to Figure 10-1. ADDR[0:31] EBI Bus External Bus Interface DATA[0:31] Control Bus Internal Bus U-bus Interface WE[0:3]/BE[0:3] Memory Controller Bus Memory Controller OE CS[0:3] Figure 10-1. Memory Controller Function within the USIU 10.1 Overview The memory controller provides a glueless interface to external EPROM, static RAM (SRAM), Flash (EEPROM), and other peripherals. The general-purpose chip-selects are available on lines CS0 through CS3. CS0 also functions as the global (boot) chip-select for accessing the boot Flash EEPROM. The chip select allows zero to 30 wait states. Figure 10-2 is a block diagram of the MPC561/MPC563 memory controller. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-1 Memory Controller Internal Addresses [0:16], AT[0:2] Base Register Option Register 0 (BR0) 1 (BR1) 2 (BR2) Base Register 3 (BR3) Dual Mapping Base Register (DMBR) 0 (OR0) 1 (OR1) 2 (OR2) Option Register 3 (OR3) Dual Mapping Option Register (DMOR) Region Match Logic Attributes CS[0:3] Expired Wait State Counter Load General-Purpose WE/BE[0:3] Chip-Select Machine OE (GPCM) Figure 10-2. Memory Controller Block Diagram Most memory controller features are common to all four banks. (For features unique to the CS0 bank, refer to Section 10.7, "Global (Boot) Chip-Select Operation.") A full 32-bit address decode for each memory bank is possible with 17 bits having address masking. The full 32-bit decode is available, even if all 32 address bits are not MPC561/MPC563 signals connected to the external device. Each memory bank includes a variable block size of 32 Kbytes, 64 Kbytes and up to four Gbytes. Each memory bank can be selected for read-only or read/write operation. The access to a memory bank can be restricted to certain address type codes for system protection. The address type comparison occurs with a mask option as well. From 0 to 30 wait states can be programmed with TA generation. Four write-enable and byte-enable signals (WE/BE[0:3]) are available for each byte that is written to memory. An output enable (OE) signal is provided to eliminate external glue logic. A memory transfer start (MTS) strobe permits one master on a bus to access external memory through the chip selects on another. The memory controller functionality allows MPC561/MPC563-based systems to be built with little or no glue logic. A minimal system using no glue logic is shown in Figure 10-3. In this example CS0 is used for MPC561/MPC563 Reference Manual, Rev. 1.2 10-2 Freescale Semiconductor Memory Controller a 16-bit boot EPROM and CS1 is used for a 32-bit SRAM. The WE/BE[0:3] signals are used both to program the EPROM and to enable write access to various bytes in the RAM. Address Address CS0 CE OE OE WE/BE[0:1] Data [0:15] DATA[0:15] EPROM MPC500 Address CS1 CE WE/BE[0:3] WE/BE[0:3] [0:31] Data OE SRAM Figure 10-3. MPC561/MPC563 Simple System Configuration 10.2 Memory Controller Architecture The memory controller consists of a basic machine that handles the memory access cycle: the general-purpose chip-select machine (GPCM). When any of the internal masters request a new access to external memory, the address of the transfer (with 17 bits having a mask) and the address type (with three bits having a mask) are compared to each one of the valid banks defined in the memory controller. Refer to Figure 10-4. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-3 Memory Controller ............. Address Mask RBA15 RBA4 RBA3 RBA2 RBA1 RBA0 Base Address M0 M1 M2 M3 M4 M5 M6 M7 . . . . M16 M[0:16] A[0:16] cmp cmp cmp cmp cmpcmpcmp cmp cmp cmp cmp Match Figure 10-4. Bank Base Address and Match Structure When a match is found on one of the memory banks, its attributes are selected for the functional operation of the external memory access: * Read-only or read/write operations * Number of wait states for a single memory access, and for any beat in a burst access * Burst-inhibit indication. Internal burst requests are still possible during burst-inhibited cycles; the memory controller emulates the burst cycles * Port size of the external device Note that if more than one region matches the internal address supplied, then the lowest numbered region is selected to provide the attributes and the chip select. If the dual mapping region is matched, it has the highest priority (refer to Section 10.5, "Dual Mapping of the Internal Flash EEPROM Array"). 10.2.1 Associated Registers Status bits for each memory bank are found in the memory control status register (MSTAT). The MSTAT reports write-protect violations for all the banks. Each of the four memory banks has a base register (BR) and an option register (OR). The BRx and ORx registers contain the attributes specific to memory bank x. The base register contains a valid bit (V) that indicates the register information for that particular chip select is valid. 10.2.2 Port Size Configuration The memory controller supports dynamic bus sizing. Defined 8-bit ports can be accessed as odd or even bytes. Defined 16-bit ports, when connected to data bus lines zero to 15, can be accessed as odd bytes, even bytes, or even half-words. Defined 32-bit ports can be accessed as odd bytes, even bytes, odd half-words, even half-words, or words on word boundaries. The port size is specified by the PS bits in the base register. MPC561/MPC563 Reference Manual, Rev. 1.2 10-4 Freescale Semiconductor Memory Controller 10.2.3 Write-Protect Configuration The WP bit in each base register can restrict write access to its range of addresses. Any attempt to write this area results in the associated WPER bit being set in the MSTAT. If an attempt to access an external device results in a write-protect violation, the memory controller considers the access to be no match. No chip-select line is asserted externally, and the memory controller does not terminate the cycle. The external bus interface generates a normal cycle on the external bus. Since the memory controller does not acknowledge the cycle internally, the cycle may be terminated by external logic asserting TA or by the on-chip bus monitor asserting TEA. 10.2.4 Address and Address Space Checking The base address is written to the BRx. The address mask bits for the address are written to the OR. The address type access value, if desired, is written to the AT bits in the BRx. The ATM bits in the ORx can be used to mask this value. If address type checking is not desired, program the ATM bits to zero. Each time an external bus cycle access is requested, the address and address type are compared with each one of the banks. If a match is found, the attributes defined for this bank in its BRx and ORx are used to control the memory access. If a match is found in more than one bank, the lowest bank matched handles the memory access (e.g., bank zero is selected over bank one). NOTE When an external master accesses a slave on the bus, the internal AT[0:2] lines reaching the memory controller are forced to 100. 10.2.5 Burst Support The memory controller supports burst accesses of external burstable memory. To enable bursts, clear the burst inhibit (BI) bit in the appropriate base register. Burst support is for read only. Bursts can be four or eight beats depending on the value of the BURST_EN bit in the SIUMCR register and the BL bit in the BRx register. That is, the memory controller executes up to eight one-word accesses, but when a modulo eight limit is reached, the burst is terminated (even if fewer than eight words have been accessed). When the SIU initiates a burst access, if no match is found in any of the memory controller's regions then a burst access is initiated to the external bus. The termination of each beat for this access is externally controlled. To support different types of memory devices, the memory controller supports two types of timing for the BDIP signal: normal and late. NOTE The BDIP signal itself is controlled by the external bus interface logic. Refer to Figure 9-13 and Figure 9-14 in Chapter 9, "External Bus Interface." If the memory controller is used to support an external master accessing an external device with bursts, the BDIP input signal is used to indicate to the memory controller when the burst is terminated. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-5 Memory Controller For addition details, refer to Section 9.5.4, "Burst Transfer." 10.2.6 Reduced Data Setup Time In order to meet timing requirements when interfacing to external memories, the data setup time can be reduced. This mode can be selected by programming the BRx registers. Thus there is flexibility in how each region can be configured to operate. The operation mode will be determined dynamically according to a particular access type. This means that for a memory region with the reduced setup time mode enabled, the mode will automatically switch to disabled when there is no requirement for the reduced setup time, (e.g., a back-to-back load/store access). For a new access with burst length more than 1, the operation mode will be automatically switched back to the reduced setup time mode. Reduced setup time can be selected via the SST bit in BR[0:3]. See Section 10.9.3, "Memory Controller Base Registers (BR0-BR3)" for more details. If SCCR[EBDF] is greater than 0, however, an external burst access with reduced data setup time will corrupt a load/store to any USIU register. The reduced setup time mode may or may not have a performance impact, depending on the properties of the memory. Namely, there is always an additional empty cycle between two burst sequences. On the other hand, this additional cycle, under certain conditions, may be compensated for by reducing the number of cycles in initial data access and sequential burst beats. Table 10-1. Timing Requirements for Reduced Setup Time CPU Specification Memory Device Requirements Cycle time at 56 MHz = 17.9 ns Initial access time = 49 ns Short setup time = 3 ns Burst access time = 13 ns Normal setup time = 6 ns Additional delay arising from on-board wires and clock skew between internal clock and CLKOUT 10.2.6.1 Case 1: Normal Setup Time Initial access: Initial access time of memory + Data setup time of CPU + Delays = 49 + 6 + 1 = 56ns To derive the number of clocks required, divide by the system clock cycle time: 56 ---------- = 3.13 17.9 therefore 4 cycles are required Burst access: Burst access time of memory + Data setup time of CPU + Delays = 13 + 6 + 1 = 20ns The number of clocks required 20 = ---------- = 1.11 17.9 therefore 2 clocks are required. This case is illustrated in Figure 10-5. MPC561/MPC563 Reference Manual, Rev. 1.2 10-6 Freescale Semiconductor Memory Controller 10.2.6.2 Case 2: Short Setup Time Initial access: Enabling short setup time requires one clock cycle: Initial access time of memory + Data setup time of CPU + Delays = 49 + 3 + 1 = 53ns 53 The number of clocks required = ---------- = 2.96 + 1(SST Enable Clock) = 3.96 therefore 4 clocks are 17.9 required. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-7 Memory Controller Burst access: Burst access time of memory + Data setup time of CPU + Delays = 13 + 3 + 1 = 17ns 17 17.9 The number of clocks required = ---------- = 0.95 therefore 1 clock is required. This case is illustrated in Figure 10-6. 10.2.6.3 Summary of Short Setup Time With normal setup time and a 4-beat burst, a 4-2-2-2 burst cycle is required which is reduced to a 4-1-1-1 burst cycle with a short setup time. Short setup time creates a saving of three clock cycles with a 4-beat burst and can result in even better performance with an 8-beat burst, saving seven clock cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 10-8 Freescale Semiconductor Memory Controller CLKOUT BR BG BB ADDR[0:31] ADDR[28:31] = 0b0000 RD/WR TSIZ[0:1] 00 BURST TS Normal BDIP Late Last Beat Expects Another Data No Data Expected Data TA 1 2 3 4 1st Data Is Valid 5 6 2nd Data Is Valid 7 8 3rd Data Is Valid 9 10 4th Data Is Valid Figure 10-5. A 4-2-2-2 Burst Read Cycle (One Wait State Between Bursts) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-9 Memory Controller CLKOUT BR BG BB ADDR [0:31] ADDR[28:31] = 0000 RD/WR TSIZ[0:1] 00 BURST TS Last Beat Expects Another Data NO DATA EXPECTED BDIP Data TA 1 2 3 4 5 1st Data is Valid 6 2nd Data is Valid 7 3rd Data is Valid 4th Data is Valid Figure 10-6. 4 Beat Burst Read with Short Setup Time (Zero Wait State) NOTE An extra clock cycle is required to enable short set-up time, resulting in a 4-1-1-1 cycle. 10.3 Chip-Select Timing The general-purpose chip-select machine (GPCM) allows a glueless and flexible interface between the MPC561/MPC563 and external SRAM, EPROM, EEPROM, ROM peripherals. When an address and MPC561/MPC563 Reference Manual, Rev. 1.2 10-10 Freescale Semiconductor Memory Controller address type match the values programmed in the BR and OR for one of the memory controller banks, the attributes for the memory cycle are taken from the OR and BR registers. These attributes include the following fields: CSNT, ACS, SCY, BSCY, WP, TRLX, BI, PS, and SETA. Table 10-2 summarizes the chip-select timing options. Byte write and read-enable signals (WE/BE[0:3]) are available for each byte that is written to or read from memory. An output enable (OE) signal is provided to eliminate external glue logic for read cycles. Upon system reset, a global (boot) chip select is available. (Refer to Section 10.7, "Global (Boot) Chip-Select Operation" for more information on the global chip select.) This provides a boot ROM chip select before the system is fully configured. Table 10-2. Timing Attributes Summary Timing Attribute Bits/Fields Description Access speed TRLX The TRLX (timing relaxed) bit determines strobe timing to be fast or relaxed. Intercycle space time EHTR The EHTR (extended hold time on read accesses) bit is provided for devices that have long disconnect times from the data bus on read accesses. EHTR specifies whether the next cycle is delayed one clock cycle following a read cycle, to avoid data bus contentions. EHTR applies to all cycles following a read cycle except for another read cycle to the same region. Synchronous or asynchronous device ACS, CSNT The ACS (address-to-chip-select setup) and CSNT (chip-select negation time) bits cause the timing of the strobes to be the same as the address bus timing, or cause the strobes to have setup and hold times relative to the address bus. Wait states SCY, BSCY, SETA, TRLX From zero to 15 wait states can be programmed for any cycle that the memory controller generates. The transfer is then terminated internally. In simplest case, the cycle length equals (2 + SCY) clock cycles, where SCY represents the programmed number of wait states (cycle length in clocks). The number of wait states is doubled if the TRLX bit is set (2 + (SCY x 2)). When the SETA (external transfer acknowledge) bit is set, TA must be generated externally, so that external hardware determines the number of wait states. NOTE When a bank is configured for TA to be generated externally (SETA bit is set) and the TRLX is set, the memory controller requires the external device to provide at least one wait state before asserting TA to complete the transfer. In this case, the minimum transfer time is three clock cycles. The internal TA generation mode is enabled if the SETA bit in the OR register is cleared. However, if the TA signal is asserted externally at least two clock cycles before the wait states counter has expired, this assertion terminates the memory cycle. When SETA is cleared, it is forbidden to assert external TA less than two clocks before the wait states counter expires. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-11 Memory Controller 10.3.1 Memory Devices Interface Example Figure 10-7 describes the basic connection between the MPC561/MPC563 and a static memory device. In this case CSx is connected directly to the chip enable (CE) of the memory device. The WE/BE[0:3] lines are connected to the respective WE in the memory device where each WE/BE line corresponds to a different data byte. MPC5xx Memory Address Address CSx CE OE OE WE/BE WE Data Data Figure 10-7. GPCM-Memory Devices Interface In Figure 10-8, the CSx timing is the same as that of the address lines output. The strobes for the transaction are supplied by the OE and the WE/BE lines (if programmed as WE/BE). When the ACS bits in the corresponding ORx register = 00, CS is asserted at the same time that the address lines are valid. NOTE If CSNT is set, the WE signal is negated a quarter of a clock earlier than normal. MPC561/MPC563 Reference Manual, Rev. 1.2 10-12 Freescale Semiconductor Memory Controller Clock Address TS CSNT = 1, ACS = 00 TA CS WE/BE OE Data Note: In this and subsequent timing diagrams in this section, the data bus refers to a read cycle. In a write cycle, the data immediately follows TS. Figure 10-8. Memory Devices Interface Basic Timing (ACS = 00, TRLX = 0) 10.3.2 Peripheral Devices Interface Example Figure 10-9 illustrates the basic connection between the MPC561/MPC563 and an external peripheral device. In this case CSx is connected directly to the chip enable (CE) of the memory device and the R/W line is connected to the R/W in the peripheral device. The CSx line is the strobe output for the memory access. Peripheral MPC5xx Address CSx RD/WR Data Address CE RD/WR Data Figure 10-9. Peripheral Devices Interface MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-13 Memory Controller The CSx timing is defined by the setup time required between the address lines and the CE line. The memory controller allows specification of the CS timing to meet the setup time required by the peripheral device. This is accomplished through the ACS field in the base register. In Figure 10-10, the ACS bits are set to 0b11, so CSx is asserted half a clock cycle after the address lines are valid. CLOCK ACS = 11 Address CSNT = 1 TS TA CS RD/WR Data Figure 10-10. Peripheral Devices Basic Timing (ACS = 11, TRLX = 0) 10.3.3 Relaxed Timing Examples The TRLX field is provided for memory systems that need a more relaxed timing between signals. When TRLX is set and ACS = 0b00, the memory controller inserts an additional cycle between address and strobes (CS line and WE/OE). When TRLX and CSNT are both set in a write to memory, the strobe lines (WE/BE[0:3] and CS, if ACS = 0b00) are negated one clock earlier than in the regular case. NOTE In the case of a bank selected to work with external transfer acknowledge (SETA = 1) and TRLX = 1, the memory controller does not support external devices that provide TA to complete the transfer with zero wait states. The minimum access duration in this case equals three clock cycles. Figure 10-11 shows a read access with relaxed timing. Note the following: * Strobes (OE and CS) assertion time is delayed one clock relative to address (TRLX bit set effect). * Strobe (CS) is further delayed (half-clock) relative to address due to ACS field being set to 11. MPC561/MPC563 Reference Manual, Rev. 1.2 10-14 Freescale Semiconductor Memory Controller * Total cycle length = 5, is determined as follows: -- Two clocks for basic cycle -- SCY = 1 determines 1 wait state, which is multiplied by two due to TRLX being set (2 + (SCY x 2)). -- Extra clock is added due to TRLX effect on the strobes. CLOCK Address TS ACS = `00' & TRLX = `1' ACS = `11' & TRLX = `1' TA CS RD/WR WEBS = `1',Line Acts as BE in Read. WE/BE OE Data Figure 10-11. Relaxed Timing -- Read Access (ACS = 11, SCY = 1, TRLX = 1) Figure 10-12 through Figure 10-14 are examples of write accesses using relaxed timing. In Figure 10-12, note the following points: * Because TRLX is set, assertion of the CS and WE strobes is delayed by one clock cycle. * CS assertion is delayed an additional one quarter clock cycle because ACS = 10. * The total cycle length = three clock cycles, determined as follows: -- The basic memory cycle requires two clock cycles. -- An extra clock cycle is required due to the effect of TRLX on the strobes. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-15 Memory Controller CLOCK Address TS TA ACS = 10 ACS = 00 CS RD/WR WE/BE OE Data Figure 10-12. Relaxed Timing -- Write Access (ACS = 10, SCY = 0, CSNT = 0, TRLX = 1) In Figure 10-13, note the following: * Because the TRLX bit is set, the assertion of the CS and WE strobes is delayed by one clock cycle. * Because ACS = 11, the assertion of CS is delayed an additional half clock cycle. * Because CSNT = 1, WE is negated one clock cycle earlier than normal. (Refer to Figure 10-8.) The total cycle length is four clock cycles, determined as follows: -- The basic memory cycle requires two clock cycles. -- Two extra clock cycles are required due to the effect of TRLX on the assertion and negation of the CS and WE strobes. MPC561/MPC563 Reference Manual, Rev. 1.2 10-16 Freescale Semiconductor Memory Controller Clock Address TS ACS =11 ACS=00 & CSNT = 1 TA CS RD/WR WE/BE OE CSNT = 1 Data Figure 10-13. Relaxed Timing -- Write Access (ACS = 11, SCY = 0, CSNT = 1, TRLX = 1) In Figure 10-14, notice the following: * Because ACS = 0, TRLX being set does not delay the assertion of the CS and WE strobes. * Because CSNT = 1, WE/BE is negated one clock cycle earlier than normal. (Refer to Figure 10-8). * CS is not negated one clock cycle earlier, since ACS = 00. * The total cycle length is three clock cycles, determined as follows: -- The basic memory cycle requires two clock cycles. -- One extra clock cycle is required due to the effect of TRLX on the negation of the WE/BE strobes. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-17 Memory Controller Clock Address TS No Effect, ACS = 00 TA CS RD/WR WE/BE OE CSNT = 1 Data Figure 10-14. Relaxed Timing -- Write Access (ACS = 00, SCY = 0, CSNT = 1, TRLX = 1 10.3.4 Extended Hold Time on Read Accesses For devices that require a long disconnection time from the data bus on read accesses, the bit EHTR in the corresponding OR register can be set. In this case any MPC561/MPC563 access to the external bus following a read access to the referred memory bank is delayed by one clock cycle unless it is a read access to the same bank. Figure 10-15 through Figure 10-18 show the effect of the EHTR bit on memory controller timing. Figure 10-15 shows a write access following a read access. Because EHTR = 0, no extra clock cycle is inserted between memory cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 10-18 Freescale Semiconductor Memory Controller Clock Address TS TA CSx CSy RD/WR OE Tdt Data Figure 10-15. Consecutive Accesses (Write After Read, EHTR = 0) Figure 10-16 shows a write access following a read access when EHTR = 1. An extra clock is inserted between the cycles. For a write cycle following a read, this is true regardless of whether both accesses are to the same region. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-19 Memory Controller Clock Address TS TA CSx CSy RD/WR OE Tdt Data Extra Clock Before Next Cycle Starts. Long Tdt Allowed Figure 10-16. Consecutive Accesses (Write After Read, EHTR = 1) Figure 10-17 shows consecutive accesses from different banks. Because EHTR = 1 (and the accesses are to different banks), an extra clock cycle is inserted. MPC561/MPC563 Reference Manual, Rev. 1.2 10-20 Freescale Semiconductor Memory Controller Clock Address TS TA CSx CSy RD/WR OE Tdt Data Extra Clock Before Next Cycle Starts Long Tdt Allowed Figure 10-17. Consecutive Accesses (Read After Read From Different Banks, EHTR = 1) Figure 10-18 shows two consecutive read cycles from the same bank. Even though EHTR = 1, no extra clock cycle is inserted between the memory cycles. (In the case of two consecutive read cycles to the same region, data contention is not a concern.) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-21 Memory Controller Clock Address TS TA CSx CSy RD/WR OE Tdt Data Figure 10-18. Consecutive Accesses (Read After Read from Same Bank, EHTR = 1) 10.3.5 Summary of GPCM Timing Options Table 10-3 summarizes the different combinations of timing options. Table 10-3. Programming Rules for Timing Strobes WE/BE Address to OE CS Negated to WE/BE or Negated to Negated to Add/Data Add/Data Add/Data OE Asserted Invalid Invalid Invalid Total Number of Cycles TRLX Access Type ACS CSNT Address to CS Asserted 0 read 00 X 0 1/4 * clock 3/4 * clock X 1/4 * clock 2 + SCY 0 read 10 X 1/4 * clock 1/4 * clock 3/4 * clock X 1/4 * clock 2 + SCY 0 read 11 X 1/2 * clock 1/4 * clock 3/4 * clock X 1/4 * clock 2 + SCY 0 write 00 0 0 1/4 * clock 3/4 * clock 1/4 * clock X 2 + SCY 0 write 10 0 1/4 * clock 1/4 * clock 3/4 * clock 1/4 * clock X 2 + SCY 0 write 11 0 1/2 * clock 1/4 * clock 3/4 * clock 1/4 * clock X 2 + SCY 0 write 00 1 0 1/4 * clock 3/4 * clock 1/2 * clock X 2 + SCY 0 write 10 1 1/4 * clock 1/2 * clock 3/4 * clock 1/2 * clock X 2 + SCY MPC561/MPC563 Reference Manual, Rev. 1.2 10-22 Freescale Semiconductor Memory Controller Table 10-3. Programming Rules for Timing Strobes (continued) CSNT Address to CS Asserted Address to WE/BE OE CS Negated to WE/BE or Negated to Negated to Add/Data OE Add/Data Add/Data Invalid Asserted Invalid Invalid 11 1 1/2 * clock 1/2 * clock 3/4 * clock 1/2 * clock X 2 + SCY read 00 X 0 1/4 * clock 3/4 clock X 1/4 * clock 2+ 2 * SCY 1 read 10 X (1 + 1/4) * clock 1/4 * clock (1 + 3/4) * clock X 1/4 * clock 3+ 2 * SCY 1 read 11 X (1 + 1/2) * clock 1/4 * clock (1 + 3/4) * clock X 1/4 * clock 3+ 2 * SCY 1 write 00 0 0 1/4 * clock 3/4 clock 1/4 * clock X 2+ 2 * SCY 1 write 10 0 (1 + 1/4) * clock 1/4 * clock (1 + 3/4) * clock 1/4 * clock X 3+ 2 * SCY 1 write 11 0 (1 + 1/2) * clock 1/4 * clock (1 + 3/4) clock 1/4 * clock X 3+ 2 * SCY 1 write 00 1 0 1/4 * clock 3/4 clock (1 + 1/2) * clock X 3+ 2 * SCY 1 write 10 1 (1 + 1/4) * clock (1 + 1/2) * clock (1 + 3/4) clock (1 + 1/2) * clock X 4+ 2 * SCY 1 write 11 1 (1 + 1/2) * clock (1 + 1/2) * clock (1 + 3/4) clock (1 + 1/2) * clock X 4+ 2 * SCY TRLX Access Type ACS 0 write 1 Total Number of Cycles Note: Timing in this table refers to the typical timing only. Consult the electrical characteristics for exact worst-case timing values. 1/4 clock actually means 0 to 1/4 clock, 1/2 clock means 1/4 to 1/2 clock. Additional timing rules not covered in Table 10-3 include the following: * If SETA = 1, an external TA signal is required to terminate the cycle. * If TRLX = 1 and SETA = 1, the minimum cycle length = 3 clock cycles (even if SCY = 0000) * If TRLX = 1, the number of wait states = 2 SCY & 2 BSCY * ACS = 01 is not defined (reserved). * If EHTR = 1, an extra (idle) clock cycle is inserted between a read cycle and a following read cycle to another region, or between a read cycle and a following write cycle to any region. * If LBDIP = 1 (late BDIP assertion), the BDIP signal is asserted only after the number of wait states for the first beat in a burst have elapsed. See Figure 9-13 in Chapter 9, "External Bus Interface," as well as Section 9.5.5, "Burst Mechanism." NOTE The LBDIP/TBDIP function can operate only when the cycle termination is internal, using the number of wait states programmed in one of the ORx registers. The LBDIP/TBDIP function cannot be activated at the same time--results are unknown. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-23 Memory Controller 10.4 Write and Byte Enable Signals The GPCM determines the timing and value of the WE/BE signals if allowed by the port size of the accessed bank, the transfer size of the transaction and the address accessed. The functionality of the WE/BE[0:3] signals depends upon the value of the write enable/byte select (WEBS) bit in the corresponding BR register. Setting WEBS to 1 will enable these signals as BE, while clearing it to zero will enable them as WE. WE is asserted only during write access, while BE is asserted for both read and write accesses. The timing of the WE/BE signals remains the same in either case, and is determined by the TRLX, ACS and CSNT bits. The upper WE/BE (WE0/BE0) indicates that the upper eight bits of the data bus (D0-D7) contains valid data during a write/read cycle. The upper-middle write byte enable (WE1/BE1) indicates that the upper-middle eight bits of the data bus (D8-D15) contains valid data during a write/read cycle. The lower-middle write byte enable (WE2/BE2) indicates that the lower-middle eight bits of the data bus (D16-D23) contains valid data during a write/read cycle. The lower write/read enable (WE3/BE3) indicates that the lower eight bits of the data bus contains valid data during a write cycle. The write/byte enable lines affected in a transaction for 32-bit port (PS = 00), a 16-bit port (PS = 10) and a 8-bit port (PS = 01) are shown in Table 10-4. Table 10-4. Write Enable/Byte Enable Signals Function1 Address Transfer Size TSIZ A30 A31 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 HalfWord 1 0 0 0 1 0 1 0 Word 0 0 0 0 32-bit Port Size 16-bit Port Size WE0/ WE1/ WE2 WE3/ WE0/ WE1/ WE2/ BE0 BE1 BE2 BE3 BE0 BE1 BE2 X X X 8-bit Port Size WE3/ BE3 WE0 WE WE1 WE3/ 2 / /BE1 BE3 BE2 BE0 X X X Byte 1 X X X X X X X X X X X X X X X X X X X X X X X This table shows which write enables are asserted (indicated with an `X') for different combinations of port size and transfer size. 10.5 Dual Mapping of the Internal Flash EEPROM Array The internal Flash EEPROM (UC3F) module can be mapped to an external memory region controlled by the memory controller. Only one region can be programmed to be dual-mapped. When dual mapping is enabled (DME bit is set in the DMBR register) and when an internal address matches the dual-mapped address range (as programmed in the DMBR) with the cycle type matching the AT/ATM field in DMBR/DMOR registers, the following occurs: * The internal Flash memory does not respond to that address * The memory controller takes control of the external access MPC561/MPC563 Reference Manual, Rev. 1.2 10-24 Freescale Semiconductor Memory Controller * * The attributes for the access are taken from one of the base and option registers of the appropriate chip select The chip-select region selected is determined by the CS line select bit field (Section 10.9.5, "Dual-Mapping Base Register (DMBR)"). With dual mapping, aliasing of address spaces may occur. This happens when the region is dual-mapped into a region which is also mapped into one of the four regions available in the memory controller. If code or data is written to the dual-mapped region, care must be taken to avoid overwriting this code or data by normal accesses of the chip-select region. There is a match if: bus_address[0:16] == {0000000,ISB[0:2],0,BA[1:6]} Eqn. 10-1 where BA represents the bit field in the DMBR register. Eqn. 10-2 Care must also be taken to avoid overwriting "normal" CSx data with dual-mapped code or data. One way to avoid this situation is by disabling the chip-select region and enabling only the dual-mapped region (DMBR[DME] = 1, but BRx[V] = 0). Figure 10-19 illustrates the phenomenon. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-25 Memory Controller MPC5xx Memory Map Dual Mapping Physical External Memory CSx Dual-Map region Flash External CSx Figure 10-19. Aliasing Phenomenon Illustration NOTE The default state is to allow dual-mapping data accesses only; this means that dual mapping is possible only for data accesses on the internal bus. Also, the default state takes the lower 2 Mbytes of the MPC563 internal Flash memory. Hence, caution should be taken to change the dual-mapping setup before the first data access. Dual mapping is not supported for an external master when the memory controller serves the access; in such a case, the MPC561/MPC563 terminates the cycle by asserting TEA. 10.6 Dual Mapping of an External Flash Region The dual mapping feature also enables mapping of external memory to alternative memory regions controlled by the memory controller. When dual mapping is enabled and an external address matches a MPC561/MPC563 Reference Manual, Rev. 1.2 10-26 Freescale Semiconductor Memory Controller dual mapped address, and the cycle type matches AT/ATM field in DMBR/DMOR register, then the following occur: * The chip-select that is mapped to the access does not respond to that address (it remains negated) * The chip-select region selected is determined by the DMCS bit field in the DMBR register * The attributes for the access are taken from the corresponding chip select region Dual mapping can only be enabled over memory addresses in the range 0x0000 0000 through 0x000F FFFF. NOTE Internal Flash must be disabled to use dual mapping over an external memory. 10.7 Global (Boot) Chip-Select Operation Global (boot) chip-select operation allows address decoding for a boot ROM before system initialization. If the global chip-select feature is enabled then the memory controller is enabled from reset. The global chip select port size is programmable at system reset using RCW[BPS]. The global chip select does not provide write protection and responds to all address types, allowing a boot ROM to be located anywhere in the address space. The memory controller will operate in this boot mode until the first write to any chip select option register (ORx).The chip select signal can be programmed to continue decoding a range of addresses after this write, provided the preferred address range is first loaded into the chip select base register (BRx). After the first write to ORx, the global chip select can only be restarted with a system reset. Which chip-select line is used as the global chip select, and how it operates, is determined by the reset configuration parameters: * FLEN - Internal Flash enable (bit 20) * BDIS - Boot disable (bit 3) * DME - Dual mapping enable (bit 31) Table 10-6 summarizes global chip select operations for all combinations of values on these reset configuration word lines.In case 1, where FLEN, BDIS, DME = 0b000 (all cleared) at reset, CS0 is the global chip-select output. When the RCPU begins accessing memory after system reset, CS0 is asserted for every address, for accesses to both internal and external instructions and data. In case 2, where FLEN, BDIS, DME = 0b001 at reset, CS0 is asserted for all external address accesses (instructions and data) and for internal instruction accesses. However, CS3 is asserted for all internal data accesses. CS3 is used in this case to allow dual mapping of loads/stores to/from an alternative bank which is not the memory bank normally used for instructions/data. In this way CS3 can be used to allow load/store from a different memory bank from reset. DME can then be disabled as required. The global chip select feature is disabled by driving only the BDIS line of the RCW (FLEN, BDIS, DME = 0b010). This is shown in case 3 of Table 10-6. Table 10-5 shows the initial values of the "boot bank" in the memory controller. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-27 Memory Controller Table 10-5. Boot Bank Fields Values After Hard Reset 10.8 Field Value (Binary) PS RCW[4:5] BPS SST 0 BL 0 WP 0 SETA 0 BI 0b1 V CS0 = ID3 CS3 = ID20 & ID31 AM[0:16] 0 0000 0000 0000 0000 ATM[0:2] 000 CSNT 0 ACS[0:1] 00 EHTR 0 SCY[0:3] 0b1111 BSCY[0:2] 0b011 TRLX 0 Memory Controller External Master Support The memory controller in the MPC561/MPC563 supports accesses initiated by both internal and external bus masters to external memories. If the address of any master is mapped within the internal MPC561/MPC563 address space, the access will be directed to the internal device, and will be ignored by the memory controller. If the address is not mapped internally, but rather mapped to one of the memory controller regions, the memory controller will provide the appropriate chip select and strobes as programmed in the corresponding region (see Section 6.2.2.1.3, "External Master Control Register (EMCR)"). The MPC561/MPC563 supports only synchronous external bus masters. This means that the external master works with CLKOUT and implements the MPC561/MPC563 bus protocol to access a slave device. A synchronous master initiates a transfer by asserting TS. The ADDR[0:31] signals must be stable from the rising edge of CLKOUT during which TS is sampled, until the last TA acknowledges the transfer. Since the external master works synchronously with the MPC561/MPC563, only setup and hold times around the rising edge of CLKOUT are important. Once the TS is detected/asserted, the memory controller compares the address with each one of its defined valid banks to find a possible match. But, since the external address space is shorter than the internal space, the actual address that is used for comparing against the memory controller regions is in the format of: {00000000, bits [8:16] of the external address}. In the case where a match is found, the controls to the memory devices are generated and the transfer acknowledge indication (TA) is supplied to the master. MPC561/MPC563 Reference Manual, Rev. 1.2 10-28 Freescale Semiconductor Memory Controller Because it takes two clocks for the external address to be recognized and handled by the memory controller, the TS which is generated by the external master is ahead of the corresponding CS and strobes which are asserted by the memory controller. This 2-clock delay might cause problems in some synchronous memories. To overcome this, the memory controller generates the MTS (memory transfer start) strobe which can be used in the slave's memory instead of the external master's TS signal. As seen in Figure 10-20, the MTS strobe is synchronized to the assertion of CS by the memory controller so that the external memory can latch the external master's address correctly. To activate this feature, the MTSC bit must be set in the SIUMCR register. Use external logic to control devices that can have burst accesses from an external master. On the MPC563, when the external master accesses the internal Flash when it is disabled, the access is terminated with the transfer error acknowledge (TEA) signal asserted, and the memory controller does not support this access in any way. When the memory controller serves an external master, the BDIP signal becomes an input signal. This signal is watched by the memory controller to detect when the burst is terminated. Synchronous External Master TA TS BDIP Data ADDR BURST Memory MPC5xx TA TS MTS TS Address Address CSx CE OE OE WE/BE W BDIP BDIP Data Data BURST BURST NOTE: The memory controller's BDIP line is used as a burst_in_progress signal. Figure 10-20. Synchronous External Master Configuration for GPCM-Handled Memory Devices MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-29 Memory Controller Address Match & Compare Memory Device Access CLOCK ADDR[0:31] RD/WR BURST TSIZE TS MTS TA CS WE/BE OE Data Figure 10-21. Synchronous External Master Basic Access (GPCM Controlled) NOTE Because the MPC561/MPC563 has only 24 address signals, the eight most significant internal address lines are driven as 0b0000_0000, and so compared in the memory controller's regions. MPC561/MPC563 Reference Manual, Rev. 1.2 10-30 Freescale Semiconductor Memory Controller 10.9 Programming Model The registers in Table 10-6 are used to control the memory controller. Table 10-6. Memory Controller Address Map 10.9.1 Address Register 0x2F C100 Base Register Bank 0 (BR0) 0x2F C104 Option Register Bank 0 (OR0) 0x2F C108 Base Register Bank 1 (BR1) 0x2F C10C Option Register Bank 1 (OR1) 0x2F C110 Base Register Bank 2 (BR2) 0x2F C114 Option Register Bank 2 (OR2) 0x2F C118 Base Register Bank 3 (BR3) 0x2F C11C Option Register Bank 3 (OR3) 0x2F C120 -- 0x13F Reserved 0x2F C140 Dual-Mapping Base Register (DMBR) 0x2F C144 Dual-Mapping Option Register (DMOR) 0x2F C148 -- 0x2F C174 Reserved 0x2F C178 Memory Status Register (MSTAT) General Memory Controller Programming Notes 1. In the case of an external master that accesses an internal MPC561/MPC563 module (in slave or peripheral mode), if that slave device address also matches one of the memory controller's regions, the memory controller will not issue any CS for this access, nor will it terminate the cycle. Thus, this practice should be avoided. Be aware also that any internal slave access prevents memory controller operation. 2. If the memory controller serves an external master, then it can support accesses to 32-bit port devices only. This is because the MPC561/MPC563 external bus interface cannot initiate extra cycles to complete an access to a smaller port-size device as it does not own the external bus. 3. When the SETA bit in the base register is set, then the timing programming for the various strobes (CS, OE and WE/BE) may become meaningless. 4. When configuring a chip select for a memory region with the intent to access that region immediately after configuration, then an ISYNC instruction should be executed in order to ensure that the configuration takes effect before any accesses are initiated. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-31 Memory Controller 10.9.2 Memory Controller Status Registers (MSTAT) , MSB 0 LSB 1 2 3 Field 4 5 6 7 -- 8 9 10 11 12 13 WPER0 WPER1 WPER2 WPER3 HRESET 14 15 -- 0000_0000_0000_0000 Addr 0x2F C178 Figure 10-22. Memory Controller Status Register (MSTAT) Table 10-7. MSTAT Bit Descriptions Bits Name 0:7 -- 8:11 12:15 10.9.3 Description Reserved WPER0 - Write protection error for bank x. This bit is asserted when a write-protect error occurs for the WPER3 associated memory bank. A bus monitor (responding to TEA assertion) will, if enabled, prompt the read of this register if TA is not asserted during a write cycle. WPERx is cleared by writing one to the bit or by performing a system reset. Writing a zero has no effect on WPER. -- Reserved Memory Controller Base Registers (BR0-BR3) , MSB 0 1 2 3 4 5 6 7 8 Field 9 10 11 12 13 14 15 BA HRESET(BR0) Unchanged HRESET(BR[1:3]) Unchanged Addr 0x2F C100 (BR0); 0x2F C108 (BR1); 0x2F C110 (BR2); 0x2F C118 (BR3) LSB 16 BA HRESET(BR0) HRESET(BR[1:3]) 1 2 17 18 19 AT Unchanged 20 21 22 23 PS SST WP ID[4:5] 00 24 25 -- BL Undefined 26 27 28 29 WEBS TBDIP LBDIP SETA 0 Undefined 30 31 BI V 1 ID3 X2 Unchanged The reset value is determined by the value on the internal data bus during reset (reset-configuration word). See Table 10-9 for reset value. Figure 10-23. Memory Controller Base Registers 0-3 (BR0-BR3) MPC561/MPC563 Reference Manual, Rev. 1.2 10-32 Freescale Semiconductor Memory Controller Table 10-8. BR0-BR3 Bit Descriptions Bits Name Description 0:16 BA Base address. These bits are compared to the corresponding unmasked address signals among ADDR[0:16] to determine if a memory bank controlled by the memory controller is being accessed by an internal bus master. (The address types are also compared.) These bits are used in conjunction with the AM[0:16] bits in the OR. 17:19 AT Address type. This field can be used to require accesses of the memory bank to be limited to a certain address space type. These bits are used in conjunction with the ATM bits in the OR. Note that the address type field uses only AT[0:2] and does not need AT3 to define the memory type space. For a full definition of address types, refer to Section 9.5.8.6, "Address Types." 20:21 PS Port size 00 32-bit port 01 8-bit port 10 16-bit port 11 Reserved 22 SST Short Setup Time - This field specifies the setup time required for this memory region. 0 Normal setup time (like the MPC555) 1 Short Setup Time selected Note that an external burst access with short setup timing will corrupt any USIU register load/store if SCCR[EBDF] is not 0b00. Refer to Table 8-9. 23 WP Write protect. An attempt to write to the range of addresses specified in a base address register that has this bit set can cause the TEA signal to be asserted by the bus-monitor logic (if enabled), causing termination of this cycle. 0 Both read and write accesses are allowed 1 Only read accesses are allowed. The CSx signal and TA are not asserted by the memory controller on write cycles to this memory bank. WPER is set in the MSTAT register if a write to this memory bank is attempted 24 -- Reserved 25 BL Burst Length - This field specifies the maximum number of words that may comprise a burst access for this memory region. This field has an effect only in the case when the burst accesses are initiated by the USIU (SIUMCR[BURST_EN] =1). 0 Burst access of up to 4 words 1 Burst access of up to 8 words 26 WEBS Write-enable/byte-select. This bit controls the functionality of the WE/BE pads. 0 The WE/BE pads operate as WE 1 The WE/BE pads operate as BE 27 TBDIP Toggle-burst data in progress. TBDIP determines how long the BDIP strobe will be asserted for each data beat in the burst cycles. 28 LBDIP Late-burst-data-in-progress (LBDIP). This bit determines the timing of the first assertion of the BDIP signal in burst cycles. NOTE: Do not set both LBDIP and TBDIP bits in a region's base registers; behavior in such cases is unpredictable. 0 Normal timing for BDIP assertion (asserts one clock after negation of TS) 1 Late timing for BDIP assertion (asserts after the programmed number of wait states) 29 SETA External transfer acknowledge 0 TA generated internally by memory controller 1 TA generated by external logic. Note that programming the timing of CS/WE/OE strobes may have no meaning when this bit is set MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-33 Memory Controller Table 10-8. BR0-BR3 Bit Descriptions (continued) Bits Name Description 30 BI Burst inhibit 0 Memory controller drives BI negated (high). The bank supports burst accesses. 1 Memory controller drives BI asserted (low). The bank does not support burst accesses. NOTE: Following a system reset, the BI bit is set. 31 V Valid bit. When set, this bit indicates that the contents of the base-register and option-register pair are valid. The CS signal does not assert until the V-bit is set. NOTE: An access to a region that has no V-bit set may cause a bus monitor timeout. See Table 10-9 for the reset value of this bit in BR0. Table 10-9. BRx[V] Reset Value 10.9.4 Branch Register BRx[V] Reset Value BR0 ID3 BR1 0 BR2 0 BR3 ID20 & ID31 Memory Controller Option Registers (OR0-OR3) 1, MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 AM1 Field HRESET 0000_0000_0000_0000 Addr 0x2F C104 (OR0); 0x2F C10C (OR1); 0x2F C114 (OR2), 0x2F C11C (OR3) LSB 16 AM HRESET 1 17 18 ATM 19 20 CSNT 0000_0000 21 22 ACS 23 EHTR 24 25 26 27 28 SCY 1111 It is recommended that this field hold values that are the power of 2 minus 1 (e.g., 29 30 BSCY 0 23 - 1 31 TRLX 1 0 1 = 7 [0b111]). Figure 10-24. Memory Controller Option Registers 1-3 (OR0-OR3) MPC561/MPC563 Reference Manual, Rev. 1.2 10-34 Freescale Semiconductor Memory Controller Table 10-10. OR0-OR3 Bit Descriptions Bits Name Description 0:16 AM Address mask. This field allows masking of any corresponding bits in the associated base register. Masking the address bits independently allows external devices of different size address ranges to be used. Any clear bit masks the corresponding address bit. Any set bit causes the corresponding address bit to be used in comparison with the address signals. Address mask bits can be set or cleared in any order in the field, allowing a resource to reside in more than one area of the address map. This field can be read or written at anytime. Following a system reset, the AM bits are cleared in OR0. 17:19 ATM Address type mask. This field masks selected address type bits, allowing more than one address space type to be assigned to a chip-select. Any set bit causes the corresponding address type code bits to be used as part of the address comparison. Any cleared bit masks the corresponding address type code bit. Clear the ATM bits to ignore address type codes as part of the address comparison. Note that the address type field uses only AT[0:2] and does not need AT3 to define the memory type space. Following a system reset, the ATM bits are cleared in OR0. 20 CSNT 21:22 ACS 23 EHTR Extended hold time on read accesses. This bit, when asserted, inserts an idle clock cycle after a read access from the current bank and any MPC561/MPC563 write accesses or read accesses to a different bank. 0 Memory controller generates normal timing 1 Memory controller generates extended hold timing Following a system reset, the EHTR bits are cleared in OR0. 24:27 SCY Cycle length in clocks. This four-bit value represents the number of wait states inserted in the single cycle, or in the first beat of a burst, when the GPCM handles the external memory access. Values range from 0 (0b0000) to 15 (0b1111). This is the main parameter for determining the length of the cycle. The total cycle length may vary depending on the settings of other timing attributes. The total memory access length is (2 + SCY) x Clocks. If an external TA response is selected for this memory bank (by setting the SETA bit), then the SCY field is not used. Following a system reset, the SCY bits are set to 0b1111 in OR0. Chip-select negation time. Following a system reset, the CSNT bit is reset in OR0. 0 CS/WE are negated normally. 1 CS/WE are negated a quarter of a clock earlier than normal Following a system reset, the CSNT bit is cleared in OR0. Address to chip-select setup. Following a system reset, the ACS bits are reset in OR0. 00 CS is asserted at the same time that the address lines are valid. 01 Reserved 10 CS is asserted a quarter of a clock after the address lines are valid. 11 CS is asserted half a clock after the address lines are valid Following a system reset, the ACS bits are cleared in OR0. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-35 Memory Controller Table 10-10. OR0-OR3 Bit Descriptions (continued) Bits Name Description 28:30 BSCY Burst beats length in clocks. This field determines the number of wait states inserted in all burst beats except the first, when the GPCM starts handling the external memory access and thus using SCY[0:3] as the main parameter for determining the length of that cycle. The total cycle length may vary depending on the settings of other timing attributes. The total memory access length for the beat is (1 + BSCY) x Clocks. If an external TA response has been selected for this memory bank (by setting the SETA bit) then BSCY[0:3] are not used. 000 0-clock-cycle (1 clock per data beat) 001 1-clock-cycle wait states (2 clocks per data beat) 010 2-clock-cycle wait states (3 clocks per data beat) 011 3-clock-cycle wait states (4 clocks per data beat) 1xx Reserved Following a system reset, the BSCY bits are set to 0b011 in OR0. 31 TRLX Timing relaxed. This bit, when set, modifies the timing of the signals that control the memory devices during a memory access to this memory region. Relaxed timing multiplies by two the number of wait states determined by the SCY and BSCY fields. Refer to Section 10.3.5, "Summary of GPCM Timing Options," for a full list of the effects of this bit on signals timing. 0 Normal timing is generated by the GPCM. 1 Relaxed timing is generated by the GPCM Following a system reset, the TRLX bit is set in OR0. 10.9.5 Dual-Mapping Base Register (DMBR) , MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Field -- BA -- AT -- HRESET 0 Undefined 000 001 000 Addr 15 0x2F C140 LSB 16 17 18 19 Field 21 22 23 24 25 26 27 -- HRESET 1 20 28 29 30 DMCS ID201 0000_0000_0000_0 31 DME ID311 The reset value is a reset configuration word value extracted from the indicated internal data bus lines. Refer to Section 7.5.2, "Hard Reset Configuration Word (RCW)." Figure 10-25. Dual-Mapping Base Register (DMBR) Table 10-11. DMBR Bit Descriptions Bits Name Description 0 -- Reserved 1:6 BA Base address. BA field corresponds to address bits [11:16]. The base address field is compared (along with the address type field) to the address of the address bus to determine whether an address should be dual-mapped by one of the memory banks controlled by the memory controller. These bits are used in conjunction with the AM[11:16] bits in the DMOR. MPC561/MPC563 Reference Manual, Rev. 1.2 10-36 Freescale Semiconductor Memory Controller Table 10-11. DMBR Bit Descriptions Bits Name 7:9 -- Reserved 10:12 AT Address type. This field can be used to specify that accesses involving the memory bank are limited to a certain address space type. These bits are used in conjunction with the ATM bits in the OR. The default value at reset is to map data only. For a full definition of address types, refer to Section 9.5.8.6, "Address Types." 13:27 -- Reserved 28:30 DMCS Dual-mapping chip select. This field determines which chip-select signal is assigned for dual mapping. 000 CS0 001 CS1 010 CS2 011 CS3 1xx Reserved 31 DME Dual mapping enabled. This bit indicates that the contents of the dual-mapping registers and associated base and option registers are valid and enables the dual-mapping operation. The default value at reset comes from the internal data bus that reflects the reset configuration word. See Section 10.5, "Dual Mapping of the Internal Flash EEPROM Array," for more information. 0 Dual mapping is not active 1 Dual mapping is active 10.9.6 Description Dual-Mapping Option Register (DMOR) , MSB 0 Field 1 2 3 4 5 6 7 8 AM1 -- HRESET 9 10 -- 0000_0000_00 Addr 11 12 13 14 ATM -- 001 000 15 0x2F C144 LSB 16 17 Field HRESET 1 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -- 0000_0000_0000_0000 It is recommended that this field hold values that are the power of 2 minus 1 (e.g., 23 - 1 = 7 [0b111]). Figure 10-26. Dual-Mapping Option Register (DMOR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 10-37 Memory Controller Table 10-12. DMOR Bit Descriptions Bits Name Description 0 -- Reserved 1:6 AM Address mask. The address mask field of each option register provides for masking any of the corresponding bits in the associated base register. By masking the address bits independently, external devices of different size address ranges can be used. Any clear bit masks the corresponding address bit. Any set causes the corresponding address bit to be used in the comparison with the address signals. Address mask bits can be set or cleared in any order in the field, allowing a resource to reside in more than one area of the address map. This field can be read or written at any time. 7:9 -- Reserved 10:12 ATM 13:31 -- Address type mask. This field can be used to mask certain address type bits, allowing more than one address space type to be assigned to a chip select. Any set bit causes the corresponding address type code bits to be used as part of the address comparison. Any cleared bit masks the corresponding address type code bit. To instruct the memory controller to ignore address type codes as part of the address comparison, clear the ATM bits. NOTE: Following a system reset, the ATM bits are cleared in DMOR, except the ATM2 bit. This means that only data accesses are dual mapped. Refer to the address types definition in Table 9-8. Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 10-38 Freescale Semiconductor Chapter 11 L-Bus to U-Bus Interface (L2U) The L-bus to U-bus interface unit (L2U) provides an interface between the load/store bus (L-bus) and the unified bus (U-bus). The L2U module includes the data memory protection unit (DMPU), which provides protection for data memory accesses. The L2U is bidirectional. It allows load/store accesses not intended for the L-bus data RAM to go to the U-bus. It also allows code execution from the L-bus data RAM and read/write accesses from the U-bus to the L-bus. The L2U directs bus traffic between the L-bus and the U-bus. When transactions start concurrently on both buses, the L2U interface arbitrates to select which transaction is handled. The top priority is assigned to U-bus to L-bus accesses; lower priority is assigned to the load/store accesses by the RCPU. 11.1 * * * * * * 11.2 * * General Features Non-pipelined master and slave on U-bus -- Does not start two back-to-back accesses on the U-bus -- Supports U-bus pipelining -- Retries back-to-back accesses from U-bus masters Non-pipelined master and slave on the L-bus Generates module selects for L-bus memory-mapped resources within a programmable, contiguous block of storage Programmable data memory protection unit (DMPU) L-bus and U-bus snoop logic for the reservation protocol compatible with the PowerPC ISA architecture Show cycles for RCPU accesses to the CALRAM (none, all, writes) -- Protection for CALRAM accesses from the U-bus side (all accesses to the CALRAM from the U-bus side are blocked once the CALRAM protection bit is set) Data Memory Protection Unit Features Supports four memory regions whose base address and size can be programmed -- Available sizes are 4 Kbytes, 8 Kbytes, 16 Kbytes, 32 Kbytes, 64 Kbytes, 128 Kbytes, 256 Kbytes, 512 Kbytes, 1 Mbyte, 2 Mbytes, 4 Mbytes, 8 Mbytes, and 16 Mybtes -- Region must start on the specified region size boundary (modulo addressing) -- Overlap between regions is allowed Each of the four regions supports the following attributes: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-1 L-Bus to U-Bus Interface (L2U) * * * * * 11.3 - Access protection: user or supervisor - Guarded attribute: speculative or non-speculative - Enable/disable option - Read only option Supports a default global entry for memory space not covered by other regions: -- Default access protection -- Default guarded attribute Interrupt generated upon: -- Access violation -- Load from guarded region -- Write to read-only region The MSR[DR] bit (data relocate) controls DMPU protection on/off operation Programming is done using the mtspr/mfspr instructions to/from implementation-specific special purpose registers. No protection for accesses to the CALRAM module on the L-bus (CALRAM has its own protection options) L2U Block Diagram Figure 11-1 shows a block diagram of the L-bus to U-bus interface as implemented in the overall MPC561/MPC563 bus architecture. MPC561/MPC563 Reference Manual, Rev. 1.2 11-2 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) U-Bus Burst Buffer Controller MPC500 DMPU Core + FP L-Bus L-Bus Interface Reservation Control USIU E-Bus U-Bus Interface Address Decode L-Bus to U-Bus Interface UIMB Interface IMB3 Figure 11-1. L2U Bus Interface Block Diagram 11.4 Modes Of Operation The L2U module can operate in the following modes: * Normal mode * Reset operation * Peripheral mode * Factory test mode 11.4.1 Normal Mode In normal mode (master or slave) the L2U module acts as a bidirectional protocol translator. * In master mode the RCPU is fully operational, and there is no external master access to the U-bus. * Slave mode enables an external master to access any internal bus slave while the RCPU is fully operational. The L2U transfers load/store accesses from the RCPU to the U-bus and the read/write accesses by the U-bus master to the L-bus. In addition to the bus protocol translation, the L2U supports other functions such as show cycles, data memory protection, and MPC500 reservation protocol. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-3 L-Bus to U-Bus Interface (L2U) When a load to or store from the U-bus resource is issued by the RCPU, it is compared against the DMPU region access (address and attribute) comparators. If none of the access attributes are violated, the access is directed to the U-bus by the L2U module. If the DMPU detects an access violation, it informs the error status to the master initiating the cycle. When show cycles are enabled, accesses to all of the L-bus resources by the RCPU are made visible on the U-bus side by the L2U. The L2U is responsible for handling the effects of reservations on the L-bus and the U-bus. For the L-bus and the U-bus, the L2U detects reservation losses and updates the RCPU core with the reservation status. 11.4.2 Reset Operation While hard or soft reset is asserted on the U-bus, the L2U asserts the corresponding L-bus reset signals. Upon soft reset assertion, the L2U goes to an idle state and all pending accesses are ignored. Additionally, the L2U module control registers are not initialized on soft reset, keeping the system configuration unchanged. Upon assertion of hard reset, the L2U control registers are initialized to their reset states. The L2U also drives the reset configuration word from the U-bus to the L-bus upon hard reset. 11.4.3 Peripheral Mode In the peripheral mode of operation the RCPU is shut down and an alternative master on the external bus can perform accesses to any internal bus (U-bus and L-bus) slave. The external master can also access the internal MPC500 special registers that are located in the L2U module. In order to access one of these MPC500 registers the EMCR[CONT] bit in the USIU must be cleared. 11.4.4 Factory Test Mode Factory test mode is a special mode of operation that allows access to the internal modules for testing. This mode is not intended for general use and is not supported for normal applications. 11.5 Data Memory Protection The data memory protection unit (DMPU) in the L2U module provides access protection for the memory regions on the U-bus side from load/store accesses by the RCPU. (Only U-bus space is protected.) The DMPU does not protect MPC500 register accesses initiated by the RCPU on the L-bus. The user can assign up to four regions of access protection attributes and can assign global attributes to any space not included in the active regions. When it detects an access violation, the L2U generates an exception request to the CPU. A functional diagram of the DMPU is shown in Figure 11-2. MPC561/MPC563 Reference Manual, Rev. 1.2 11-4 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) Address Access Attribute Region0 Address and size Region1 Address and size Region2 Address and size Region0 protection/attribute Match Select Region1 protection/attribute Region2 protection/attribute Region3 protection/attribute Region3 Address and size Global protection/attribute Specific Error Interrupts to Core Region Protection/Attribute MSR[DR] Exception Logic Access Granted Figure 11-2. DMPU Basic Functional Diagram 11.5.1 Functional Description Data memory protection is assigned on a regional basis. Default manipulation of the DMPU is done on a global region. The DMPU has control registers that contain the following information: region protection on/off, region base address, region size, and the region's access permissions. Each region's protection attributes can be turned on or off by configuring the global region attribute register's enable attribute bit (L2U_GRA[ENRx]). During each load or store access from the RCPU to the U-bus, the address is compared to the value in the region base address register of each enabled region. Any access that matches the specific region within its appropriate size, as defined by the region attribute register's region size field (L2U_RAx[RS]), sets a match indication. When more than one match indication occurs, the effective region is the region with the highest priority. Priority is determined by region number; highest priority corresponds to the lowest region number, e.g. region 0 is highest priority, while region 3 is lowest. When no match occurs, the effective region is the global region, which has the lowest priority. The region attribute register also contains the region's protection fields. The protection field (PP) of the effective region is compared to the access attributes. If the attributes match, the access is permitted. When the access is permitted, a U-bus access may be generated according to the specific attribute of the effective region. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-5 L-Bus to U-Bus Interface (L2U) When the access by the RCPU is not permitted, the L2U module asserts a data memory storage exception to the RCPU. For speculative load/store accesses from the RCPU to a region marked as guarded (G bit of region attribute register is set), the L2U asks the RCPU to retry the L-bus cycle until either the access is not speculative, or is canceled by the RCPU. In the case of attempted accesses to a guarded region together with any other protection violation (no access), the L2U retries the access. The L2U handles this event as a data storage violation only when the access becomes non-speculative. Note that access protection is active only when the MPC500's MSR[DR] = 1. When MSR[DR] = 0, DMPU exceptions are disabled, all accesses are considered to be to a guarded memory area, and no speculative accesses are allowed. In this case, if the L-bus master [RCPU] initiates a non-CALRAM cycle (access through the L2U) that is marked speculative, the L2U asks the RCPU to retry the L-bus cycle until either the access is not speculative, or it is canceled by the RCPU Core. NOTE The programmer must not overlap the CALRAM memory space with any enabled region. Overlapping an enabled region with CALRAM memory space disables the L2U data memory protection for that region. If an enabled region overlaps with the L-bus space, the DMPU ignores all accesses to addresses within the L-bus space. If an enabled region overlaps with MPC500 register addresses, the DMPU ignores any access marked as an MPC500 access. 11.5.2 Associated Registers Table 11-1 shows registers that are used to control the DMPU of the L2U module. All the registers are special purpose registers that are accessed via the MPC500 mtspr/mfspr instructions. The registers are also accessed by an external master when EMCR[CONT] = 0. See Section 11.8, "L2U Programming Model," for register diagrams and bit descriptions. . Table 11-1. DMPU Registers Name Description L2U_RBA0 Region Base Address Register 0 L2U_RBA1 Region Base Address Register 1 L2U_RBA2 Region Base Address Register 2 L2U_RBA3 Region Base Address Register 3 L2U_RA0 Region Attribute Register 0 L2U_RA1 Region Attribute Register 1 L2U_RA2 Region Attribute Register 2 L2U_RA3 Region Attribute Register 3 L2U_GRA Global Region Attribute MPC561/MPC563 Reference Manual, Rev. 1.2 11-6 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) NOTE The appropriate DMPU registers must be programmed before the MSR[DR] bit is set. Otherwise, DMPU operation is not guaranteed. Program the region base address in the L2U_RBAx registers to the lower boundary of the region specified by the corresponding L2U_RAx[RS] field. If the region base address does not correspond to the boundary of the block size programmed in the L2U_RAx, the DMPU snaps the region base to the lower boundary of that block. For example, if the block size is programmed to 16 Kbytes for region zero (i.e., L2U_RA0[RS] = 0x3) and the region base address is programmed to 0x1FFF(i.e., L2U_RBA0[RBA] = 0x1), then the effective base address of region zero is 0x0. See Figure 11-3. 0x0000 0000 Region 0 (16 Kbytes) Resulting Region 0x0000 1FFF Actual Programmed Region 0x0000 3FFF 0x0000 5FFF Figure 11-3. Region Base Address Example External action is required to program only legal region sizes. The L2U does not check whether the value is legal. If an illegal region size is programmed, the region calculation may not be successful. 11.5.3 L-Bus Memory Access Violations All L-bus slaves have their own access protection logic. For consistency, all storage access violations have the same termination result. Thus access violations for load/store accesses started by the RCPU always have the same termination from all slaves: assertion of the data storage exception. All other L-bus masters cause machine check exceptions. 11.6 Reservation Support In general terms, a reservation activity is the process whereby a load and store instruction pair is accompanied by a reservation of the data, the goal being to achieve an atomic operation. If a bus master other than the one holding the reservation accesses the data (or some other specific condition occurs as described in Section 11.6.1, "Reservation Protocol") the reservation is lost and is indicated accordingly. The RCPU storage reservation protocol supports a multi-level bus structure. For each local bus, storage reservation is handled by the local reservation logic. The protocol tries to optimize reservation cancellation such that an MPC500 processor (RCPU) is notified of storage reservation loss on a remote bus (U-bus, IMB or external bus) only when it has issued a stwcx cycle to that address. That is, the reservation loss indication comes as part of the stwcx cycle. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-7 L-Bus to U-Bus Interface (L2U) 11.6.1 Reservation Protocol The reservation protocol operates under the following assumptions: * Each processor has at most 1 reservation flag * A lwarx instruction sets the reservation flag * Another lwarx instruction by same processor clears the reservation flag related to a previous lwarx instruction and sets again the reservation flag * A stwcx instruction by the same processor clears the reservation flag * A store instruction by the same processor does not clear the reservation flag * Some other processor (or other mechanism) store to an address with an existing reservation clears the reservation flag * In case the storage reservation is lost, it is guaranteed that stwcx will not modify the storage 11.6.2 L2U Reservation Support The L2U is responsible for handling the effects of reservations on the L-bus and the U-bus. For the L-bus and the U-bus, the L2U detects reservation losses. The reservation logic in the L2U performs the following functions: * Snoops accesses to all L-bus and U-bus slaves * Holds one reservation (address) for the core * Sets the reservation flag when the RPCU issues a load-with-reservation request The unit for reservation is one word. A byte or half-word store request by another master will clear the reservation flag. A load-with-reservation request by the RPCU updates the reservation address related to a previous load-with-reservation request and sets the reservation flag for the new location. A store-with-reservation request by the RPCU clears the reservation flag. A store request by the RPCU does not clear the flag. A store request by some other master to the reservation address clears the reservation flag. If the storage reservation is lost, it is guaranteed that a store-with-reservation request by the RPCU will not modify the storage. The L2U does not start a store-with-reservation cycle on the U-bus if the reserved location on the U-bus has been touched by another master. The L2U drives the reservation status back to the core. When the reserved location in the CALRAM on the L-bus is touched by an alternate master, on the following clock the L2U indicates to the RPCU that the reservation has been touched. On assertion of the cancel-reservation signal, the RCPU clears the internal reservation bit. If an stwcx cycle has been issued at the same time, the RCPU aborts the cycle. Software must check the CR0[EQ] bit to determine if the stwcx instruction completed successfully. Storage reservation is set regardless of the termination status (address or data phase) of the lwarx access. Storage reservation is cleared regardless of the data phase termination status of the stwcx access if the address phase is terminated normally. MPC561/MPC563 Reference Manual, Rev. 1.2 11-8 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) Storage reservation will be cleared regardless of the data phase termination status of the write requests by another master to the reserved address if the address phase of the write access is terminated normally on the destination (U-bus/L-bus) bus. If the programmable memory map of the part is modified between a lwarx and a stwcx instruction, the reservation is not guaranteed. 11.6.3 Reserved Location (Bus) and Possible Actions Once the RPCU core reserves a memory location, the L2U module is responsible for snooping the L-bus and U-bus for possible intrusion of the reserved location. Under certain circumstances, the L2U depends on the USIU or the UIMB to provide status of reservation on external bus and the IMB3 respectively. Table 11-2 lists all reservation protocol cases supported by the L2U snooping logic. Table 11-2. Reservation Snoop Support Reserved Location On Intruding Alternate Master L-bus L-master Request to cancel the reservation.1 U-master Request to cancel the reservation. L-master Block stwcx2 U-master Block stwcx L-master Block stwcx U-master Block stwcx U-bus External Bus Ext-master IMB3 Action Taken on stwcx cycle Transfer Status3 L-master Block stwcx U-master Block stwcx IMB3-master Transfer Status 1 If the RCPU tries to modify (stwcx) that location, the L2U does not have enough time to stop the write access from completing. In this case, the L2U will drive cancel-reservation signal back to the core as soon as it comes to know that the alternate master on the U-bus has touched the reserved location. 2 If the RCPU tries to modify (stwcx) that location, the L2U does not start the cycle on the U-bus and it communicates to the core that the current write has been aborted by the slave with no side effects. 3 If the RCPU tries to modify (stwcx) that location, the L2U runs a write-cycle-with-reservation request on the U-bus. The L2U samples the status of the reservation along with the U-bus cycle termination signals and it communicates to the core if the current write has been aborted by the slave with no side effects. 11.7 L-Bus Show Cycle Support The L2U module provides support for L-bus show cycles. L-bus show cycles are external visibility cycles that reflect activity on the L-bus that would otherwise not be visible to the external bus. L-bus show cycles are software controlled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-9 L-Bus to U-Bus Interface (L2U) 11.7.1 Programming Show Cycles L-bus show cycles are disabled during reset and must be configured by setting the LSHOW[0:1] bits in the L2U_MCR. Table 11-3 shows the configurations of the LSHOW[0:1] bits. Table 11-3. L2U_MCR LSHOW Modes 11.7.2 LSHOW Action 00 Disable L-bus show cycles 01 Show address and data of all L-bus space write cycles 10 Reserved (Disable L-bus show cycles) 11 Show address and data of all L-bus space read and write cycles Performance Impact When show cycles are enabled in the L2U module, there is a performance penalty on the L-bus. This occurs because the L2U module does not support more than one access being processed at any time. To ensure that only one access at a time is processed, and not lose an L-bus access that would have been show cycled, the L2U module will arbitrate for the L-bus whenever it is processing any access. This L-bus arbitration will prevent any other L-bus master from starting a cycle that might turn out to be a qualifiable L-bus show cycle. For L-bus show cycles, the minimum performance impact on the L-bus will be three clocks. This minimum impact assumes that the L-bus slave access is a 1-clock access, and the L2U module acquires immediate bus grant on the U-bus. The L2U has to wait two clocks before completing the show cycle on the U-Bus, thus using up five clocks for the complete process. A retried access on the L-bus (no address acknowledge) that qualifies to be show cycled, will be accepted when it is actually acknowledged. This will cause a 1-clock delay before an L-bus master can retry the access on the L-bus, because the L2U module will release L-bus one clock later. L2U asserts the internal bus request signal on the U-bus for a minimum of two clocks when starting a show cycle on the U-bus. 11.7.3 Show Cycle Protocol The L2U module behaves as both a master and a slave on the U-bus during show cycles. The L2U starts the U-bus transfer as a bus master and then completes the address phase and data phase of the cycle as a slave. The L2U follows U-bus protocol of in-order termination of the data phase. The USIU can control the start of show cycles on the U-bus by asserting the no-show cycle indicator. This will cause the L2U module to release the U-bus for at least one clock before retrying the show cycle. 11.7.4 L-Bus Write Show Cycle Flow The L2U performs the following sequence of actions for an L-bus-write show cycle. 1. Arbitrates for the L-bus to prevent any other L-bus cycles from starting MPC561/MPC563 Reference Manual, Rev. 1.2 11-10 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) 2. Latches the address and the data of the L-bus access, along with all address attributes 3. Waits for the termination of the L-bus access and latches the termination status (data error) 4. Arbitrate for the U-bus, and when granted, starts the U-bus access, asserting show cycle request on the U-bus, along with address, attributes and the write data. The L2U module provides address recognition and acknowledgment for the address phase. If the no-show cycle indicator from the U-bus is asserted, the L2U does not start the show cycle. The L2U module releases the U-bus until the no-show cycle indicator is negated and then arbitrates for the U-bus again. 5. When the L2U module has U-bus data bus grant, it drives the data phase termination handshakes on the U-bus. 6. Releases the L-bus 11.7.5 L-Bus Read Show Cycle Flow The L2U performs the following sequence of actions for an L-bus read show cycle. 1. Arbitrates for the L-bus to prevent any other L-bus cycle from starting 2. Latches the address of the L-bus access, along with all address attributes 3. Waits for the data phase termination on the L-bus and latches the read data, and the termination status from the L-bus 4. Arbitrates for the U-bus, and when granted, starts the U-bus access, asserting the show cycle request on the U-bus, along with address attributes. The L2U module provides address recognition/acknowledgment for the address phase. If the no-show cycle indicator from the U-bus is asserted, the L2U does not start the show cycle. The L2U module releases the U-bus until the no-show cycle indicator is negated and then arbitrates for the U-bus again. 5. When the L2U module has U-bus data bus grant, it drives the read data and the data phase termination handshakes on the U-bus 6. Release the L-bus. 11.7.6 Show Cycle Support Guidelines The following are the guidelines for L2U show cycle support: * The L2U module provides address and data for all qualifying L-bus cycles when the appropriate mode bits are set in the L2U_MCR. * The L2U-module-only provides show cycles L-bus activity that is not targeted for the U-bus or the L2U module internal registers, regardless of the termination status of such activity. * The L2U module does not provide show cycle access to any MPC500 special purpose register. * The L2U does not start a show cycle for an L-bus access that is retried. This decision to not start the show cycle causes a clock delay before the cycle can be retried, since the L2U module will have arbitrated away the L-bus immediately on detecting the show cycle, before the retry information is available. * The L2U module does not show cycle any L-bus activity that is aborted. * The L2U module does not access the U-bus if the USIU inhibits show cycle activity on the U-bus. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-11 L-Bus to U-Bus Interface (L2U) * The L2U does not provide show cycle for any L-bus addresses that fall in the L-bus CALRAM address space if the CALRAM protection [SP] bit is set in the L2U_MCR. Table 11-4 summarizes the L2U show cycle support. Table 11-4. L2U Show Cycle Support Chart Case Destination 1 L-bus Slave 2 L2U 4 3 1 U-bus/E-bus 4 L-bus LB ABORT 2 Comments No X Not show cycled [Cycle will be retried one clock later]3 X X Not show cycled X X Not show cycled 1 Yes No Show cycled slave1 Yes Yes Not show cycled [L-bus will be released next clock] L-bus slave 5 5 LB AACK 1 L-bus slave includes all address in the L-bus address space. X indicates don't care conditions. 3 There will be a 1-clock turnaround because the L-bus retry information is not available in time to negate the L-bus arbitration. 4 L2U indicates L2U registers. 5 U-bus/E-bus refers to all destinations through the L2U interface. 2 11.8 L2U Programming Model The L2U control registers control the L2U bus interface and the DMPU. They are accessible via the mtspr and mfspr instructions. They are also accessible by an external master when EMCR[CONT] bit is cleared. L2U control registers are accessible from both the L-bus side and the U-bus side in one clock cycle. As with all SPRs, L2U registers are accessible in supervisor mode only. Any unimplemented bits in L2U registers return 0's on a read, and the writes to those register bits are ignored. Table 11-5 shows L2U registers along with their SPR numbers and hexadecimal addresses that are used to access L2U registers during a peripheral mode access. . Table 11-5. L2U (PPC) Register Decode Name SPR # SPR[5:9] SPR[0:4] Address for External Master Access1 Access Description L2U_MCR 568 10001 11000 0x0000_3110 SUPR L2U Module Configuration Register L2U_RBA0 792 11000 11000 0x0000_3180 SUPR Region Base Address Register 0 L2U_RBA1 793 11000 11001 0x0000_3380 SUPR Region Base Address Register 1 L2U_RBA2 794 11000 11010 0x0000_3580 SUPR Region Base Address Register 2 L2U_RBA3 795 11000 11011 0x0000_3780 SUPR Region Base Address Register 3 L2U_RA0 824 11001 11000 0x0000_3190 SUPR Region Attribute Register 0 L2U_RA1 825 11001 11001 0x0000_3390 SUPR Region Attribute Register 1 MPC561/MPC563 Reference Manual, Rev. 1.2 11-12 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) Table 11-5. L2U (PPC) Register Decode (continued) 1 Name SPR # SPR[5:9] SPR[0:4] Address for External Master Access1 Access Description L2U_RA2 826 11001 11010 0x0000_3590 SUPR Region Attribute Register 2 L2U_RA3 827 11001 11011 0x0000_3790 SUPR Region Attribute Register 3 L2U_GRA 536 10000 11000 0x0000_3100 SUPR Global Region Attribute When EMCR[CONT] = 0, for external master access only. For these registers a bus cycle will be performed on the L-bus and the U-bus with the address as shown in Table 11-6. . 11.8.1 Table 11-6. Hex Address For SPR Cycles A[0:17] A[18:22] A[23:27] A[28:31] 0 spr[5:9] spr[0:4] 0 U-Bus Access The L2U registers are accessible from the U-bus side only if it is a supervisor mode data access and the register address is correct and it is indicated on the U-bus that it is a PPC register access. A user mode access, or an access marked as instruction, to L2U registers from the U-bus side will cause a data error on the U-bus. 11.8.2 Transaction Size All L2U registers are defined by MPC500 architecture as being 32-bit registers in normal mode. There is no MPC500 instruction to access either a half word or a byte of the special purpose register. All L2U registers are only word accessible (read and write) in peripheral mode. A half-word or byte access in peripheral mode will result in a word transaction. 11.8.3 L2U Module Configuration Register (L2U_MCR) The L2U module configuration register (L2U_MCR) is used to control the L2U module operation. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-13 L-Bus to U-Bus Interface (L2U) MSB 0 Field 1 SP 2 3 4 5 6 7 8 9 LSHOW 10 11 12 13 14 26 27 28 29 30 15 -- Reset 0000_0000_0000_0000 LSB 16 17 18 19 20 21 22 23 24 25 Field -- Reset 0000_0000_0000_0000 Addr SPR 568 31 Figure 11-4. L2U Module Configuration Register (L2U_MCR) Table 11-7. L2U_MCR Bit Descriptions Bits Name Description 0 SP CALRAM Protection (SP) bit is used to protect the CALRAM on the L-bus from U-bus accesses. Any attempt to set or clear the SP bit from the U-bus side has no affect. Once this bit is set, the L2U blocks all CALRAM accesses initiated by the U-bus masters and the access is terminated with a data error on the U-bus. If L-bus show cycles are enabled, setting this bit will disable L-bus CALRAM show cycles. 1:2 LSHOW LSHOW bits are used to configure the show cycle mode for cycles accessing the L-bus slave e.g. CALRAM 00 Disable show cycles 01 Show address and data of all L-bus space write cycles 10 Reserved 11 Show address and data of all L-bus space read and write cycles 3:31 -- 11.8.4 Reserved Region Base Address Registers (L2U_RBAx) The L2U region base address register (L2U_RBAx) defines the base address of a specific region protected by the data memory protection unit. There are four registers (x = 0...3), one for each supported region. MSB 0 1 2 3 4 5 6 7 8 Field RBA Reset Undefined 9 10 11 12 13 14 25 26 27 28 29 30 15 LSB 16 17 18 19 20 21 22 23 24 Field RBA -- Reset Undefined 0000_0000_0000 Addr 31 SPR 792-795 Figure 11-5. L2U Region x Base Address Register (L2U_RBAx) MPC561/MPC563 Reference Manual, Rev. 1.2 11-14 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) Table 11-8. L2U_RBAx Bit Descriptions Bits Name Description 0:19 RBA Region base address. The RBA field provides the base address of the region. The region base address should start on the block boundary for the corresponding block size attribute specified in the region attribute register (L2U_RAx). 20:31 -- 11.8.5 Reserved Region Attribute Registers (L2U_RAx) Each L2U region attribute register defines the protection attributes associated with a specific region protected by the data memory protection unit. There are four registers (x = 0...3), one for each supported region. MSB 0 1 2 3 Field 4 5 6 7 8 9 10 11 -- 12 13 14 28 29 30 15 RS Reset 0000_0000_0000_0000 LSB 16 17 Field 18 RS 19 20 21 22 PP 23 24 -- 25 26 27 G Reset 0000_0000_0000_0000 Addr SPR 824-827 31 -- Figure 11-6. L2U Region X Attribute Register (L2U_RAx) Table 11-9. L2U_RAx Bit Descriptions Bits Name Description 0:7 -- Reserved 8:19 RS Region size 0000_0000_0000 = 4 Kbytes 0000_0000_0001 = 8 Kbytes 0000_0000_0011 = 16 Kbytes 0000_0000_0111 = 32 Kbytes 0000_0000_1111 = 64 Kbytes 0000_0001_1111 = 128 Kbytes 0000_0011_1111 = 256 Kbytes 0000_0111_1111 = 512 Kbytes 0000_1111_1111 = 1 Mbyte 0001_1111_1111 = 2 Mbytes 0011_1111_1111 = 4 Mbytes 0111_1111_1111 = 8 Mbytes 1111_1111_1111 = 16 Mbytes MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-15 L-Bus to U-Bus Interface (L2U) Table 11-9. L2U_RAx Bit Descriptions (continued) Bits Name 20:21 PP Protection bits 00 No supervisor access, no user access 01 Supervisor read/write access, no user access 10 Supervisor read/write access, user read-only access 11 Supervisor read/write access, user read/write access 22:24 -- Reserved 25 G Guarded attribute 0 Not guarded from speculative accesses 1 Guarded from speculative accesses 26:31 -- Reserved 11.8.6 Description Global Region Attribute Register (L2U_GRA) The L2U global region attribute register (L2U_GRA) defines the protection attributes associated with the memory region which is not protected under the four DMPU regions. This register also provides enable/disable control for the four DMPU regions. MSB 0 1 2 3 4 5 6 7 8 9 Field ENR0 ENR1 ENR2 ENR3 10 11 12 13 14 26 27 28 29 30 15 -- Reset 0000_0000_0000_0000 LSB 16 Field 17 18 -- 19 20 21 PP 22 23 24 -- 25 G Reset 0000_0000_0000_0000 Addr SPR 536 31 -- Figure 11-7. L2U Global Region Attribute Register (L2U_GRA) Table 11-10. L2U_GRA Bit Descriptions Bits Name Description 0 ENR0 Enable attribute for region 0 0 Region attribute is off 1 Region attribute is on 1 ENR1 Enable attribute for region 1 0 Region attribute is off 1 Region attribute is on 2 ENR2 Enable attribute for region 2 0 Region attribute is off 1 Region attribute is on MPC561/MPC563 Reference Manual, Rev. 1.2 11-16 Freescale Semiconductor L-Bus to U-Bus Interface (L2U) Table 11-10. L2U_GRA Bit Descriptions (continued) Bits Name Description 3 ENR3 4:19 -- Reserved 20:21 PP Protection bits 00 No supervisor access, no user access 01 Supervisor read/write access, no user access 10 Supervisor read/write access, user read-only access 11 Supervisor read/write access, user read/write access 22:24 -- Reserved 25 G Guarded attribute 0 Not guarded from speculative accesses 1 Guarded from speculative accesses 26:31 -- Reserved Enable attribute for region 3 0 Region attribute is off 1 Region attribute is on MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 11-17 L-Bus to U-Bus Interface (L2U) MPC561/MPC563 Reference Manual, Rev. 1.2 11-18 Freescale Semiconductor Chapter 12 U-Bus to IMB3 Bus Interface (UIMB) The U-bus to IMB3 bus interface (UIMB) structure is used to connect the CPU internal unified bus (U-bus) to the intermodule bus 3 (IMB3). It controls bus communication between the U-bus and the IMB3. The UIMB interface (see Figure 12-1) consists of seven submodules that control bus interface timing, address decode, data multiplexing, intrasystem communication (interrupts), and clock generation to allow communication between U-bus and the IMB3. The seven submodules are: * U-bus interface * IMB3 interface * Address decoder * Data multiplexer * Interrupt synchronizer * Clock control * Scan control 12.1 * * * * * Features Provides complete interfacing between the U-bus and the IMB3: -- 15 bits (32 Kbytes) of address decode on IMB3 -- 32-bit data bus -- Read/write access to IMB3 module registers -- Interrupt synchronizer -- Monitoring of accesses to unimplemented addresses within UIMB interface address range -- Burst-inhibited accesses to the modules on IMB3 Support of 32-bit and 16-bit bus interface units (BIUs) for IMB3 modules Half and full speed operation of IMB3 bus with respect to U-bus Simple "slave only" U-bus interface implementation -- Transparent mode operation not supported -- Relinquish and retry not supported Supports scan control for modules on the IMB3 and on the U-bus NOTE Modules on the IMB3 bus can only be reset by SRESET. Some modules may have a module reset, as well. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 12-1 U-Bus to IMB3 Bus Interface (UIMB) WARNING The user should not perform instruction fetches from modules on the IMB3. 12.2 UIMB Block Diagram U-bus Interface U-bus Address Decode IMB3 Interface IMB3 Data Mux Scan Control Interrupt Synchronizer Clock Control Figure 12-1. UIMB Interface Module Block Diagram 12.3 Clock Module The clock module within the UIMB interface generates the IMB3 clock. The IMB3 clock is the main timing reference used within the IMB3 modules. The IMB3 clock is generated based on the STOP and HSPEED bits in the UIMB module configuration register (UMCR). If the STOP = 1, the IMB3 clock is not generated. If the STOP = 0 and the HSPEED = 0, the IMB3 clock is generated as the inversion of the internal system clock. This is the same frequency as the CLKOUT if SCCR[EBDF] = 0b00 - full speed external bus. (See Figure 12-2.) If the HSPEED = 1, then the IMB3 clock is one-half of the internal system frequency. (See Figure 12-3.) Table 12-1. STOP and HSPEED Bit Functionality STOP HSPEED Functionality 0 0 IMB3 bus frequency is the same as U-bus frequency. 0 1 IMB3 bus frequency is half that of the U-bus frequency. 1 X IMB3 clock is not generated. MPC561/MPC563 Reference Manual, Rev. 1.2 12-2 Freescale Semiconductor U-Bus to IMB3 Bus Interface (UIMB) CLKOUT IMB3 Clock Figure 12-2. IMB3 Clock - Full-Speed IMB3 Bus CLKOUT IMB3 Clock Figure 12-3. IMB3 Clock - Half-Speed IMB3 Bus Table 12-2 shows the number of system clock cycles that the UIMB requires to perform each type of bus cycle. It is assumed that the IMB3 is available to the UIMB at all times (fastest possible case). Table 12-2. Bus Cycles and System Clock Cycles Bus Cycle (from U-bus Transfer Start to U-bus Transfer Acknowledge) Number of System Clock Cycles Full Speed Half Speed Normal write 4 6 Normal read 4 6 Dynamically-sized write 6 10 Dynamically-sized read 6 10 NOTE The UIMB interface dynamically interprets the port size of the addressed module during each bus cycle, allowing bus transfers to and from 16-bit and 32-bit IMB3 modules. During a bus transaction, the slave module on the IMB3 signals its port size (16- or 32-bit) via an internal port size signal. 12.4 Interrupt Operation The interrupts from the modules on the IMB3 are propagated to the interrupt controller in the USIU through the UIMB interface. The UIMB interrupt synchronizer latches the interrupts from the modules on the IMB3 and drives them onto the U-bus, where they are latched by the USIU interrupt controller. 12.4.1 Interrupt Sources and Levels on IMB3 The IMB3 has eight interrupt lines. There can be a maximum of 32 levels of interrupts from the modules on IMB3 bus. A single module can be a source for more than one interrupt. For example, the QSMCM can generate two interrupts (one for QSCI1/QSCI2 and another for QSPI). In this case, the QSMCM has two interrupt sources. Each of these two sources can assert the interrupt on any of the 32 levels. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 12-3 U-Bus to IMB3 Bus Interface (UIMB) It is possible for multiple interrupt sources to assert the same interrupt level. To reduce the latency, it is a good practice for each interrupt source to assert an interrupt on a level on which no other interrupt source is mapped. 12.4.2 IMB3 Interrupt Multiplexing The IMB3 has 10 lines for interrupt support. Eight lines are for interrupts and two are for interrupt level byte select (ILBS). These lines will transfer the 32 interrupt levels to the interrupt synchronizer. A diagram of the interrupt flow is shown in Figure 12-4. UIPEND Register IMB3 Interrupt U-bus Interrupt Level[0:7] 8 [0:7] 8 [8:15] Byte Count Byte-enable to IMB3 Block Byte-enables 4 [16:23] U-bus Data[0:31] [24:31] 2 Figure 12-4. Interrupt Synchronizer Signal Flow Latching 32 interrupt levels using eight IMB3 interrupt lines is accomplished with a 4:1 time-multiplexing scheme. The UIMB drives two signals (ILBS[0:1]) with a multiplexer select code that tells all interrupting modules on the IMB3 about which group of signals to drive during the next clock. See Figure 12-5. 12.4.3 ILBS Sequencing The IMB3 interface drives the ILBS signals continuously, incrementing through a code sequence (0b00, 0b01, 0b10, 0b11) once every clock. The UMCR[IRQMUX] bits in the IMB3 module configuration register select which type of multiplexing the interrupt synchronizer will perform. The IRQMUX field can select time-multiplexing protocols for 8, 16, 24 or 32 interrupt sources. These protocols would take one, two, three or four clocks, respectively. Table 12-4 shows ILBS sequencing. Programming IRQMUX[0:1] to 0b00 disables time multiplexing. In this case the ILBS lines remain at 0b00 at all times. In this mode, no interrupts from IMB3 modules which assert on levels 8 through 31 are ever latched by the interrupt synchronizer. SRESET will not clear the IRQMUX bits, so time multiplexing will be enabled with the previous setup after SRESET is released. The timing for the scheme and the values of ILBS and the interrupt levels driven onto the IMB3 IRQ lines are shown in Figure 12-5. This scheme causes a maximum latency of four clocks and an average latency of two clocks before the interrupt request can reach the interrupt synchronizer. MPC561/MPC563 Reference Manual, Rev. 1.2 12-4 Freescale Semiconductor U-Bus to IMB3 Bus Interface (UIMB) IMB3 CLOCK ILBS [0:1] 00 IMB3 LVL[0:7] 01 10 11 00 01 LVL [0:7] LVL [8:15] LVL 16:23 LVL 24:31 LVL 0:7 10 11 Note: This diagram represents the ILBS behavior when IRQMUX[0:1] = 11 Figure 12-5. Time-Multiplexing Protocol for IRQ Signals Table 12-3. ILBS Signal Functionality ILBS[0:1] Description 00 IMB3 interrupt sources mapped onto 0:7 levels will drive interrupts onto IMB3 LVL[0:7] 01 IMB3 interrupt sources mapped onto 8:15 levels will drive interrupts onto IMB3 LVL[0:7] 10 IMB3 interrupt sources mapped onto 16:23 levels will drive interrupts onto IMB3 LVL[0:7] 11 IMB3 interrupt sources mapped onto 24:31 levels will drive interrupts onto IMB3 LVL[0:7] The IRQMUX bits determine how many levels of IMB3 interrupts are sampled. Refer to Table 12-4. Table 12-4. IRQMUX Functionality IRQMUX[0:1] 12.4.4 ILBS sequence Description 00 00, 00, 00..... Latch 0:7 IMB3 interrupt levels 01 00, 01, 00, 01.... Latch 0:15 IMB3 interrupt levels 10 00, 01, 10, 00, 01, 10,..... Latch 0:23 IMB3 interrupt levels 11 00, 01, 10, 11, 00, 01, 10, 11,.... Latch 0:31 IMB3 interrupt levels Interrupt Synchronizer The interrupt synchronizer latches the 32 levels of interrupts from the IMB3 bus into a register which can be read by the CPU or other U-bus master. Since there are only eight lines for interrupts on the IMB3 and 32 levels of interrupts are possible, the 32 interrupt levels are multiplexed onto eight IMB3 interrupt lines. Apart from latching these interrupts in the register (UIPEND), the interrupt synchronizer drives the interrupts onto the U-bus, where they are latched by the interrupt controller in the USIU. If IMB3 modules drive interrupts on any of the 24 levels (levels eight through 31), they will be latched in UIPEND in the UIMB. If any of the register bits 7 to 31 are set, then bit 7 will be set as well. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 12-5 U-Bus to IMB3 Bus Interface (UIMB) NOTE Software must poll this register to find out which of the levels 7 to 31 are asserted. The UIPEND register contains a status bit for each of the 32 interrupt levels. Each bit of the register is a read-only status bit, reflecting the current state of the corresponding interrupt signal. For each of the 32 interrupt levels, a corresponding bit of the UIPEND register is set. Figure 12-4 shows how the eight interrupt lines are connected to the UIPEND register to represent 32 levels of interrupts. Figure 12-6 shows the implementation of the interrupt synchronizer. UIPEND Register U-bus Interrupt Level[0:7] LVL[0:7] 8 7 LVL7 IMB3 LVL [0:7] OR LVL [8:31] 24 RESET State Machine 32 IMBCLOCK ILBS [0:1] U-bus Data[0:31] 4 Figure 12-6. Interrupt Synchronizer Block Diagram 12.5 Programming Model Table 12-5 lists the registers used for configuring and testing the UIMB module. The address offset shown in this table is from the start of the block reserved for UIMB registers. As shown in Figure 1-2, this block begins at offset 0x30 7F80 from the start of the MPC561/MPC563 internal memory map (the last 128-byte sub-block of the UIMB interface memory map). Table 12-5. UIMB Interface Register Map Access1 Base Address S 0x30 7F80 -- Register UIMB Module Configuration Register (UMCR) See Table 12-6 for bit descriptions. 0x30 7F84 -- 0x30 7F8F Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 12-6 Freescale Semiconductor U-Bus to IMB3 Bus Interface (UIMB) Table 12-5. UIMB Interface Register Map (continued) Access1 Base Address S/T 0x30 7F90 -- UIMB Test Control Register (UTSTCREG) Reserved 0x30 7F94 -- 0x30 7F9F Reserved S 1 Register 0x30 7FA0 Pending Interrupt Request Register (UIPEND) See Section 12.5.3, "Pending Interrupt Request Register (UIPEND)" for bit descriptions. S = Supervisor mode only; T = Test mode only Any word, half-word or byte access to a 32-bit location within the UIMB interface register decode block that is unimplemented (defined as reserved) causes the UIMB interface to assert a data error exception on the U-bus.The entire 32-bit location must be defined as reserved in order for a data error exception to be asserted. Unimplemented bits in a register return zero when read. 12.5.1 UIMB Module Configuration Register (UMCR) The UIMB module configuration register (UMCR) is accessible in supervisor mode only. MSB 0 Field STOP HRESET 1 2 3 4 5 6 7 8 9 10 IRQMUX HSPEED -- 00 1 0000_0000_0000 0 Addr 11 12 13 14 27 28 29 30 15 0x30 7F80 LSB 16 17 Field HRESET 18 19 20 21 22 23 24 25 26 31 -- 0000_0000_0000_0000 Figure 12-7. UIMB Module Configuration Register (UMCR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 12-7 U-Bus to IMB3 Bus Interface (UIMB) Table 12-6. UMCR Bit Descriptions Bits Name Description 0 STOP Stop enable. 0 Enable system clock for IMB3 bus 1 Disable IMB3 system clock To avoid complications at restart and data corruption, system software must stop each slave on the IMB3 before setting the STOP bit. Software must also ensure that all IMB3 interrupts have been serviced before setting this bit. 1:2 IRQMUX Interrupt request multiplexing. These bits control the multiplexing of the 32 possible interrupt requests onto the eight IMB3 interrupt request lines. 00 Disables the multiplexing scheme on the interrupt controller within this interface. What this means is that the IMB3 IRQ [0:7] signals are non-multiplexed, only providing 8 [0:7] interrupt request lines to the interrupt controller 01 Enables the IMB3 IRQ control logic to perform a 2-to-1 multiplexing to allow transferring of 16 [0:15] interrupt sources 10 Enables the IMB3 IRQ control logic to perform a 3-to-1 multiplexing to allow transferring of 24 [0:23]interrupt sources 11 Enables the IMB3 IRQ control logic to perform a 4-to-1 multiplexing to allow transferring of 32 [0:31] interrupt sources 3 HSPEED Half speed. The HSPEED bit controls the frequency at which the IMB3 runs with respect to the U-bus. This is a modify-once bit. Software can write the reset value of this bit any number of times. However, once logic 0 is written to this location, any attempt to rewrite this bit to a logic 1 will have no effect. 0 IMB3 frequency is the same as that of the U-bus 1 IMB3 frequency is one half that of the U-bus 4:31 -- 12.5.2 Reserved Test Control Register (UTSTCREG) The UTSTCREG register is used for factory testing only. 12.5.3 Pending Interrupt Request Register (UIPEND) The UIPEND register is a read-only status register which reflects the state of the 32 interrupt levels. The state of IRQ0 is shown in bit 0, the state of IRQ1 is shown in bit 1 and so on. This register is accessible only in supervisor mode. MPC561/MPC563 Reference Manual, Rev. 1.2 12-8 Freescale Semiconductor U-Bus to IMB3 Bus Interface (UIMB) MSB 0 1 2 3 4 5 6 7 8 9 Field LVL0 LVL1 LVL2 LVL3 LVL4 LVL5 LVL6 LVL7 LVL8 LVL9 10 11 12 13 14 15 LVL 10 LVL 11 LVL 12 LVL 13 LVL 14 LVL 15 0000_0000_0000_0000 HRESET Addr 0x30 7FA0 LSB 16 Field LVL 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 LVL 17 LVL 18 LVL 19 LVL 20 LVL 21 LVL 22 LVL 23 LVL 24 LVL 25 LVL 26 LVL 27 LVL 28 LVL 29 LVL 30 LVL 31 0000_0000_0000_0000 HRESET Figure 12-8. Pending Interrupt Request Register (UIPEND) Table 12-7. UIPEND Bit Descriptions Bits Name Description 0:31 LVLx Pending interrupt request level. Accessible only in supervisor mode. LVLx identifies the interrupt source as UIMB LVLx, where x is the interrupt number. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 12-9 U-Bus to IMB3 Bus Interface (UIMB) MPC561/MPC563 Reference Manual, Rev. 1.2 12-10 Freescale Semiconductor Chapter 13 QADC64E Legacy Mode Operation The two queued analog-to-digital converter (QADC) modules on MPC561/MPC563 devices are 10-bit, unipolar, successive approximation converters. The modules can be configured to operate in one of two modes, legacy mode (MPC555 compatible) and enhanced mode. This chapter describes how the modules operate in legacy mode, which is the default mode of operation. Refer to Chapter 14, "QADC64E Enhanced Mode Operation," for information regarding the QADC64E functionality in enhanced mode. For this revision of the QADC, the name QADC64E implies the enhanced version of the QADC module, not just enhanced mode of operation. For simplicity, the names QADC and QADC64E may be used interchangeably throughout this document. 13.1 QADC64E Block Diagram Figure 13-1 displays the major components of the QADC64E modules on the MPC561/MPC563. EXTERNAL Triggers EXTERNAL MUX Address Up to 16 ANALOG Input Signals REFERENCE ANALOG POWER Inputs Inputs ANALOG Input Multiplexor and DIGITAL Signal Functions DIGITAL CONTROL 10-bit ANALOG to DIGITAL CONVERTER Queues OF 10-BIT Conversion Command Words (CCW), 64 Entries BUS INTERFACE UNIT (BIU) 10-bit RESULT Table, 64 Entries 10-bit to 16-bit RESULT Alignment IMB3 Figure 13-1. QADC64E Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-1 QADC64E Legacy Mode Operation 13.2 Key Features and Quick Reference Diagrams This section gives an overview of the implementation of the two QADC64E modules on MPC561/MPC563. It can also be used as a quick reference guide while programming the modules. 13.2.1 * * * * * * * * * * * * * * Features of the QADC64E Legacy Mode Operation Internal sample and hold Directly supports up to four external multiplexers (for example the MC14051) Up to 41 analog input channels using QADC64E external multiplexing Programmable input sample time for various source impedances Minimum conversion time of 7 s (with typical QCLK frequency, 2 MHz) Two conversion command queues with a total of 64 entries Sub-queues possible using pause mechanism Queue complete and pause software interrupts available on both queues Queue pointers indicate current location for each queue Automated queue modes initiated by -- External edge trigger -- Periodic/Interval timer, within QADC64E module -- Software command -- External gated trigger (Queue 1 only) Single-scan or continuous-scan of queues 64 result registers in each QADC64E module Output readable in three formats -- Right-justified unsigned -- Left-justified signed -- Left-justified unsigned Unused analog channels on Port A can be used as digital input/output signals, unused analog channels on Port B can be used as digital input signals. The analog section includes input signals, an analog multiplexer, and the sample and hold circuits. The analog conversion is performed by the digital-to-analog converter (DAC) resistor-capacitor array and a high-gain comparator. The digital control section contains queue control logic to sequence the conversion process and interrupt generation logic. Also included are the periodic/interval timer, control and status registers, the conversion command word (CCW) table RAM, and the result table RAM. The bus interface unit (BIU) allows the QADC64E to operate with the applications software through the IMB3 environment. MPC561/MPC563 Reference Manual, Rev. 1.2 13-2 Freescale Semiconductor QADC64E Legacy Mode Operation 13.2.2 Memory Map The QADC64E occupies 1 Kbyte, or 512 16-bit entries, of address space. Ten 16-bit registers are control, port, and status registers, 64 16-bit entries are the CCW table, and 64 16-bit entries are the result table, and occupy 192 16-bit address locations because the result data is readable in three data alignment formats. Each QADC64E module on the MPC561/MPC563 has its own memory space. Table 13-1 shows the memory map for QADC64E module A, it occupies 0x30 4800 to 0x30 4BFF. Table 13-2 displays the memory map for module B. Module B has the same offset scheme starting at 0x30 4C00. QADC64E B occupies 0x30 4C00 to 0x30 4FFF. Z Address Table 13-1. QADC64E_A Address Map MSB 0 0x30 4800 LSB 1 2 3 4 5 STOP FRZ 0x30 4802 TEST MODE 0x30 4804 IRL1 6 7 8 9 LOC K FLI P SUPV 10 11 12 13 Module Config.1 Interrupt1 IRL2 PORTQA 0x30 4808 DDRQA PORTQB EMU X TR G 0x30 480C CIE1 PIE 1 SSE 1 MQ1 0x30 480E CIE2 PIE 2 SSE 2 MQ2 0x30 4810 CF1 PF1 CF2 PF2 TOR 1 TOR 2 0x30 4812 Port Data Port Direction 0x30 480A PSH PSA RESUM E QS CWPQ1 1 Control 0 BQ2 Control 2 CWP Status 0 CWPQ2 Status 1 Reserved 0x30 4A000x30 4A7F 0x30 4B80 0x30 4BFF PSL Control 1 0x30 48140x30 49FF 0x30 SIGN 4B000x30 4B7F Register 15 Test1 0x30 4806 0x30 4A800x30 4AFF 14 P BY P 0000 00 IST CHAN UNSIGNED RIGHT JUSTIFIED SIGNED LEFT JUSTIFIED UNSIGNED LEFT JUSTIFIED CCWs Results 00 0000 Results 00 0000 Results Registers are accessible only as supervisor data space MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-3 QADC64E Legacy Mode Operation Table 13-2. QADC64E_B Address Map Address 0x30 4C00 MSB LSB 0 1 STO P FRZ 2 3 0x30 4C02 TEST MODE 0x30 4C04 IRL1 4 7 8 9 LOC K FLI P SUPV 10 11 12 13 0x30 4C08 DDRQA Interrupt1 TRG PSH SSE 1 MQ1 0x30 4C0E CIE2 PIE 2 SSE 2 MQ2 0x30 4C10 PF1 CF2 PF2 TOR 1 PS A PSL Control 0 Control 1 RESUM E TOR 2 QS CWPQ1 0x30 4C12 Port Data Port Direction PIE 1 BQ2 Control 2 CWP Status 0 CWPQ2 Status 1 0x30 4C140x30 4DFF Reserved P 0x30 4E000x30 4E7F 0x30 4E800x30 4EFF BYP 0000 00 0x30 4F00- SIGN 0x30 4F7F 1Registers Register 15 Module Config.1 PORTQB 0x30 4C0C CIE1 0x30 4F80 0x30 4FFF 14 IRL2 PORTQA CF1 6 Test1 0x30 4C06 0x30 4C0A EMU X 5 IST CHAN UNSIGNED RIGHT JUSTIFIED SIGNED LEFT JUSTIFIED UNSIGNED LEFT JUSTIFIED CCWs Results 00 0000 Results 00 0000 Results are accessible only as supervisor data space Accesses to supervisor-only data space is permitted only when the bus master is operating in supervisor access mode. Assignable data space can be either restricted to supervisor-only access or unrestricted to both supervisor and user data space addresses. See Section 13.3.1.4, "Supervisor/Unrestricted Address Space." 13.2.3 Legacy and Enhanced Modes of Operation The QADC64E modules can be configured to operate in legacy or enhanced mode. Legacy mode is the default state out of reset. Configuring bits in the QADC64E module configuration register enables MPC561/MPC563 Reference Manual, Rev. 1.2 13-4 Freescale Semiconductor QADC64E Legacy Mode Operation enhanced mode. This will be described in Section 13.3.1.3, "Switching Between Legacy and Enhanced Modes of Operation." 13.2.4 Using the Queue and Result Word Table The heart of the QADC is its conversion command word (CCW) queues. This is where the module is programmed to convert a particular channel according to a particular requirement. The queues are created by writing CCWs into the CCW table in the register memory. The queues are controlled by the three control registers, and their status can be read from the two status registers. As conversions are completed the digital value is written into the result word table. Figure 13-2 shows the CCW queue and the result word table. Conversion Command Word (CCW) Table 00 Result Word Table A/D Converter Begin Queue 1 00 Channel Select, Sample, Hold, and Analog to Digital Conversion End of Queue 1 Begin Queue 2 BQ2 End of Queue 2 MSB 6 7 8 9 10 P BYP IST LSB 15 CHAN P = Pause Until Next Trigger BYP = Bypass Buffer Amplifier MSB 0 LSB 15 56 0 0 0 0 0 0 Result Right Justified, Unsigned Result Format 0 1 9 10 15 IST = Input Sample Time 0 0 0 0 0 0 S Result Left Justified, Signed Result Format CHAN = Channel Number and End_of_Queue Code 0 9 10 15 Result 0 0 0 0 0 0 Left Justified, Unsigned Result Format 10-bit Conversion Command Word (CCW) Format 10-bit Result is Software Readable in Three Different 16-bit Formats Figure 13-2. QADC64E Conversion Queue Operation 13.2.5 External Multiplexing The QADC can use from one to four 8-input external multiplexer chips to expand the number of analog signals that may be converted. The externally multiplexed channels are automatically selected from the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-5 QADC64E Legacy Mode Operation channel field of the conversion command word (CCW) table. External Multiplex mode is software selectable, by setting the EMUX bit of control register 0, QACR0. Figure 13-3 shows the maximum configuration of four external multiplexer chips connected to the QADC. The QADC provides three multiplexer address signals - MA[0], MA[1], MA[2] - to select one of the multiplexer chips. These outputs are the multiplexer control lines and they are connected to all external multiplexer chips. The analog output of each of the four multiplexer chips is connected to four separate QADC inputs - ANw, ANx, ANy, ANz. These signals are the first four signals of port B and each one can represent eight analog input channels. The QADC converts the proper input channel (ANw, ANx, ANy, ANz) by interpreting the channel number in the CCW. Refer to Table 13-3. AN[1] AN[3] AN[5] AN[7] AN[9] AN[11] AN[13] AN[15] MUX AN[16] AN[18] AN[20] AN[22] AN[24] AN[26] AN[28] AN[30] MUX AN[17] AN[19] AN[21] AN[23] AN[25] AN[27] AN[29] AN[31] MUX V RH VRL AN[0]/ANw/PQB[0] AN[1]/ANx/PQB[1] AN[2]/ANy/PQB[2] AN[3]/ANz/PQB[3] AN[48]/PQB[4] AN[49]/PQB[5] AN[50]/PQB[6] AN[51]/PQB[7] AN[52]/MA[0]/PQA[0] AN[53]/MA[1]/PQA[1] AN[54]/MA[2]/PQA[2] AN[55]/PQA[3] AN[56]/PQA[4] AN[57]PQA[5] AN[58]/PQA[6] AN[59]/PQA[7] ANALOG POWER ANALOG REFERENCES PORT B MUX V SSA V DDA PORT A AN[0] AN[2] AN[4] AN[6] AN[8] AN[10] AN[12] AN[14] QADC ANALOG MULTIPLEXER AND PORT LOGIC ANALOG CONVERTER DIGITAL CONTROL External Triggers: ETRIG1 ETRIG2 Figure 13-3. Example of External Multiplexing In the external multiplexed mode, four of the port B signals are redefined to each represent eight input channels. Refer to Table 13-3 for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 13-6 Freescale Semiconductor QADC64E Legacy Mode Operation I Table 13-3. Multiplexed Analog Input Channels Multiplexed Analog Input Channels ANw (AN[0]) 0, 2, 4, 6, 8, 10, 12, 14 ANx (AN[1]) 1, 3, 5, 7, 9, 11, 13, 15 ANy (AN[2]) 16, 18, 20, 22, 24, 26, 28, 30 ANz (AN[3]) 17, 19, 21, 23, 25, 27, 29, 31 Table 13-4 shows the total number of analog input channels supported with zero to four external multiplexer chips using one QADC module. Table 13-4. Analog Input Channels Number of Analog Input Channels Available Directly Connected + External Multiplexed = Total Channels No External MUX Chips One External MUX Chip Two External MUX Chips Three External MUX Chips Four External MUX Chips 16 20 27 34 41 NOTE: QADC64E External MUX Users If either QADC64E_A or QADC64E_B is in external multiplexing (EMUX) mode then the multiplexer address signal channels, AN[52:54] should not be programmed into queues. 13.3 Programming the QADC64E Registers The QADC64E has three global registers for configuring module operation: * Module configuration register (Section 13.3.1, "QADC64E Module Configuration Register (QADMCR)") * Interrupt register (Section 13.3.2, "QADC64E Interrupt Register (QADCINT)" * Test register (QADCTEST) for factory tests. The global registers are always defined to be in supervisor-only data space. Refer to Table 13-1 for the QADC64E_A address map and Table 13-2 for the QADC64E_B address map. See Section 13.3.1.4, "Supervisor/Unrestricted Address Space" for access modes of these registers. The remaining five registers in the control register block control the operation of the queuing mechanism, and provide a means of monitoring the operation of the QADC64E. * Control register 0 (QACR0) contains hardware configuration information (Section 13.3.5, "Control Register 0 (QACR0)") * Control register 1 (QACR1) is associated with queue 1 (Section 13.3.6, "Control Register 1 (QACR1)") * Control register 2 (QACR2) is associated with queue 2 (Section 13.3.7, "Control Register 2 (QACR2)") MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-7 QADC64E Legacy Mode Operation * Status registers (QASR0 and QASR1) provide visibility on the status of each queue and the particular conversion that is in progress (Section 13.3.8, "Status Registers (QASR0 and QASR1)") The CCW table follows the register block in the address map. There are 64 table entries to hold the desired analog conversion sequences. Each CCW table entry is 16-bits, with ten implemented bits in four fields. The final block of address space belongs to the result word table, which appears in three places in the memory map. Each result word table location holds one 10-bit conversion value. 13.3.1 QADC64E Module Configuration Register (QADMCR) The QADCMCR contains five implemented bits that control the operating modes of the QADC64E module. The configurable modes are freeze, stop and supervisor. The QADCMCR also implements a pair of bits that together select either legacy or enhanced mode for the QADC module, and lock that operating mode. . MSB 0 LSB 1 2 3 Field STOP FRZ SRESET 4 -- 0000_0000 Addr 5 6 7 8 9 10 11 LOCK FLIP SUPV 1 12 13 14 15 -- 000_0000 0x30 4800 (QADCMCR_A); 0x30 4C00 (QADCMCR_B) Figure 13-4. Module Configuration Register (QADCMCR) Table 13-5. QADCMCR Bit Descriptions Bits Name 0 STOP 1 FRZ 2:5 -- 6 LOCK 7 FLIP Description Stop Enable. Refer to Section 13.3.1.1, "Low Power Stop Mode," for more information. 0 = Disable stop mode 1 = Enable stop mode Freeze Enable. Refer to Section 13.3.1.2, "Freeze Mode," for more information. 0 = Ignores the IMB3 internal FREEZE signal 1 = Finish any conversion in progress, then freeze Reserved Lock/Unlock QADC Mode of operation as defined by FLIP bit. Refer to Section 13.3.1.3, "Switching Between Legacy and Enhanced Modes of Operation," for more information. 0 = QADC mode is locked 1 = QADC mode is unlocked and changeable using FLIP bit QADC Mode of Operation - The FLIP bit allows selection of the mode of operation of the QADC module, either legacy mode (default) or enhanced mode. This bit can only be written when the LOCK is set (unlocked). Refer to Section 13.3.1.3, "Switching Between Legacy and Enhanced Modes of Operation," for more information. 0 = Legacy mode enabled 1 = Enhanced mode enabled MPC561/MPC563 Reference Manual, Rev. 1.2 13-8 Freescale Semiconductor QADC64E Legacy Mode Operation Table 13-5. QADCMCR Bit Descriptions (continued) Bits Name Description 8 SUPV Supervisor/Unrestricted Data Space. Refer to Section 13.3.1.4, "Supervisor/Unrestricted Address Space," and Table 13-6 for more information. 0 = Only the module configuration register, test register, and interrupt register are designated as supervisor-only data space. Access to all other locations is unrestricted. 1 = All QADC64E registers and CCW/result tables are designated as supervisor-only data space. 9:15 -- 13.3.1.1 Reserved. Write as zeros. Low Power Stop Mode When the STOP bit in the QADCMCR is set, the QADC64E clock (QCLK) which clocks the A/D converter, is disabled and the analog circuitry is powered down. This results in a static, low power consumption, idle condition. The stop mode aborts any conversion sequence in progress. Because the bias currents to the analog circuits are turned off in stop mode, the QADC64E requires some recovery time (TSR in Appendix F, "Electrical Characteristics") to stabilize the analog circuits after the stop enable bit is cleared. In stop mode: * BIU state machine and logic do not shut down * The CCW and result is not reset and is not accessible * The module configuration register (QADCMCR), the interrupt register (QADCINT), and the test register (QADCTEST) are fully accessible and are not reset * The data direction register (DDRQA), port data register (PORTQA/PORTQB), and control register 0 (QACR0) are not reset and are read-only accessible * Control register 1 (QACR1), control register 2 (QACR2), and the status registers (QASR0 and QASR1) are reset and are read-only accessible * In addition, the periodic/interval timer is held in reset during stop mode If the STOP bit is clear, stop mode is disabled. 13.3.1.2 Freeze Mode Freeze mode occurs when the background debug mode is enabled in the USIU and a breakpoint is encountered. This is indicated by the assertion of the internal FREEZE line on the IMB3. The FRZ bit in the QADCMCR determines whether or not the QADC64E responds to an IMB3 internal FREEZE signal assertion. Freeze is very useful when debugging an application. When the internal FREEZE signal is asserted and the FRZ bit is set, the QADC64E finishes any conversion in progress and then freezes. Depending on when the FREEZE signal is asserted, there are three possible queue "freeze" scenarios: * When a queue is not executing, the QADC64E freezes immediately * When a queue is executing, the QADC64E completes the conversion in progress and then freezes MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-9 QADC64E Legacy Mode Operation * If, during the execution of the current conversion, the queue operating mode for the active queue is changed, or a queue 2 abort occurs, the QADC64E freezes immediately During freeze mode, both the analog clock, QCLK, and periodic/interval timer are held in reset. When the QADC64E enters the freeze mode while a queue is active, the current CCW location of the queue pointer is saved. During freeze, the analog clock, QCLK, is held in reset and the periodic/interval timer is held in reset. External trigger events that occur during the freeze mode are not captured. The BIU remains active to allow IMB3 access to all QADC64E registers and RAM. Although the QADC64E saves a pointer to the next CCW in the current queue, the software can force the QADC64E to execute a different CCW by writing new queue operating modes for normal operation. The QADC64E looks at the queue operating modes, the current queue pointer, and any pending trigger events to decide which CCW to execute when exiting freeze. If the FRZ bit is clear, the internal FREEZE signal is ignored. 13.3.1.3 Switching Between Legacy and Enhanced Modes of Operation The LOCK and FLIP bits of the QADCMCR register control the operating mode of the QADC64E modules. Out of reset, the QADC64E modules are in legacy mode (FLIP = 0) and the LOCK bit is clear, indicating that the module is locked in legacy mode. In order to change the value of the FLIP bit, the operating mode must first be unlocked, by setting the LOCK bit. Only then can the FLIP bit be changed. Finally, the LOCK bit must be cleared again to protect the state of the FLIP bit from future writes. 1. Write LOCK = 1 to unlock operating mode bit. 2. Modify the value of FLIP as required. -- FLIP = 0 Legacy mode enabled -- FLIP = 1 Enhanced mode enabled 3. Write LOCK = 0 and new FLIP bit value to preserve the value of FLIP bit * Example 1 Switching from legacy mode to enhanced mode -- QADCMCR = 0x280; LOCK =1, SUPV = 1 -- QADCMCR = 0x380; LOCK =1, write FLIP = 1, SUPV = 1 -- QADCMCR = 0x180; LOCK = 0, FLIP = 1, SUPV = 1 Subsequent writes to the FLIP bit will have no effect while LOCK = 0. * Example 2 Switching from enhanced mode to legacy mode -- QADCMCR = 0x280 or 0x380; LOCK = 1, SUPV =1 (Can write FLIP = x because value will not change) -- QADCMCR = 0x280; LOCK = 1, FLIP = 0, SUPV = 1 -- QADCMCR = 0x080; LOCK = 0, FLIP = 0, SUPV =1 13.3.1.4 Supervisor/Unrestricted Address Space The QADC64E memory map is divided into two segments: supervisor-only data space and assignable data space. Access to supervisor-only data space is permitted only when the software is operating in supervisor MPC561/MPC563 Reference Manual, Rev. 1.2 13-10 Freescale Semiconductor QADC64E Legacy Mode Operation access mode. Assignable data space can be either restricted to supervisor-only access or unrestricted to both supervisor and user data space accesses. The SUPV bit in the QADCMCR designates the assignable space as supervisor or unrestricted. The following information applies to accesses to address space located within the module's 16-bit boundaries and where the response is a bus error. See Table 13-6 for more information. * Attempts to read a supervisor-only data space when not in the supervisor access mode and SUPV = 1, causes the bus master to assert a bus error condition. No data is returned. If SUPV = 0, the QADC64E asserts a bus error condition and no data is returned. * Attempts to write to supervisor-only data space when not in the supervisor access mode and SUPV = 1, causes the bus master to assert a bus error condition. No data is written. If SUPV = 0, the QADC64E asserts a bus error condition and the register is not written. * Attempts to read unimplemented data space in the unrestricted access mode and SUPV = 1, causes the bus master to assert a bus error condition and no data is returned. In all other attempts to read unimplemented data space, the QADC64E causes a bus error condition and no data is returned. * Attempts to write unimplemented data space in the unrestricted access mode and SUPV = 1, causes the bus master to assert a bus error condition and no data is written. In all other attempts to write unimplemented data space, the QADC64E causes a bus error condition and no data is written. * Attempts to read assignable data space in the unrestricted access mode when the space is programmed as supervisor space causes the bus master to assert a bus error condition and no data is returned. * Attempts to write assignable data space in the unrestricted access mode when the space is programmed as supervisor space causes the bus master to assert a bus error condition and the register is not written. Table 13-6. QADC64E Bus Error Response S/U1 Mode SUPV Bit Supervisor-Only Register Supervisor/ Unrestricted Register Reserved/ Unimplemented Register U 0 QADC64E bus error2 Valid access4 QADC64E bus error2 U 1 Master bus error3 Master bus error3 Master bus error3 S 0 Valid access Valid access QADC64E bus error2 S 1 Valid access Valid access QADC64E bus error2 1 S/U = Supervisor/Unrestricted QADC64E bus error = Caused by QADC64E 3 Master bus error = Caused by bus master 4 Access to QADCTEST register will act as a reserved/unimplemented register unless in factory test mode 2 The bus master indicates the supervisor and user space access with the function code bits (FC[2:0]) on the IMB3. For privilege violations, refer to the Chapter 9, "External Bus Interface" to determine the consequence of a bus error cycle termination. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-11 QADC64E Legacy Mode Operation The supervisor-only data space segment contains the QADC64E global registers, which include the QADCMCR, the QADCTEST, and the QADCINT. The supervisor/unrestricted space designation for the CCW table, the result word table, and the remaining QADC64E registers is programmable. 13.3.2 QADC64E Interrupt Register (QADCINT) QADCINT specifies the priority level of QADC64E interrupt requests. The interrupt level for queue 1 and queue 2 may be different. The interrupt register is read/write accessible in supervisor data space only. The implemented interrupt register fields can be read and written, reserved bits read zero and writes have no effect. They are typically written once when the software initializes the QADC64E, and not changed afterwards. MSB LSB 0 1 Field 2 3 IRL1 4 5 6 7 8 9 10 11 IRL2 SRESET 12 13 14 15 -- 0000_0000_0000_0000 Addr 0x30 4804 (QADCINT_A); 0x30 4C04 (QADCINT_B) Figure 13-5. QADC Interrupt Register (QADCINT) Table 13-7. QADCINT Bit Descriptions Bit(s) Name Description 0:4 IRL1 Queue 1 Interrupt Request Level. The IRL1 field establishes the queue 1 interrupt request level. The 00000 state provides a level 0 interrupt, while 11111 provides a level 31 interrupt. All interrupts are presented on the IMB3. Interrupt level priority software determines which level has the highest priority request. 5:9 IRL2 Queue 2 Interrupt Request Level. The IRL2 field establishes the queue 2 interrupt request level. The 00000 state provides a level 0 interrupt, while 11111 provides a level 31 interrupt. All interrupts are presented on the IMB3. Interrupt level priority software determines which level has the highest priority request. 10:15 -- Reserved. The QADC64E conditionally generates interrupts to the bus master via the IMB3 IRQ signals. When the QADC64E sets a status bit assigned to generate an interrupt, the QADC64E drives the IRQ bus. The value driven onto IRQ[7:0] represents the interrupt level assigned to the interrupt source. Under the control of ILBS, each interrupt request level is driven during the time multiplexed bus during one of four different time slots, with eight levels communicated per time slot. No hardware priority is assigned to interrupts. Furthermore, if more than one source on a module requests an interrupt at the same level, the system software must assign a priority to each source requesting at that level. Figure 13-6 displays the interrupt levels on IRQ with ILBS. Refer to Chapter 12, "U-Bus to IMB3 Bus Interface (UIMB)," for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 13-12 Freescale Semiconductor QADC64E Legacy Mode Operation IMB3 CLOCK ILBS [1:0] 00 IMB3 IRQ [7:0] 01 10 11 00 01 IRQ 7:0 IRQ 15:8 IRQ 23:16 IRQ 31:24 IRQ 7:0 10 11 Figure 13-6. Interrupt Levels on IRQ with ILBS 13.3.3 Port Data Register (PORTQA and PORTQB) QADC64E ports A and B are accessed through two 8-bit port data registers (PORTQA and PORTQB) in each QADC64E. Port A signals are referred to as PQA[7:0] when used as 8-bit general-purpose digital input or output signals. It is configured as a digital input or digital output using the data direction register, DDRQA. When Port A is configured as an input, a read of the PORTQA register returns the actual PQA[7:0] signal values. When Port A is configured as an output, the contents of port register PQA are driven on the port A signals. Port A can also be used as analog inputs AN[59:52] and external multiplexer address outputs MA[2:0]. Port B signals are referred to as PQB[7:0] when used as 8-bit general-purpose digital input-only signals. Digital input signal states are read from the 8-bit PORTQB register. Port B can also be used as non-multiplexed analog inputs AN[51:48] and AN[3:0], and external multiplexer analog inputs, ANw, ANx, ANy, ANz. During a port data register read, the actual value of the signal is reported when its corresponding bit in the data direction register defines the signal to be an input. When the data direction bit specifies the signal to be an output, the content of the port data register is read. PORTQA and PORTQB are not initialized by reset. MSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 LSB 15 Field PQA PQA PQA PQA PQA PQA PQA PQA 7 6 5 4 3 2 1 0 PQB PQB PQB PQB PQB PQB PQB PQB 7 6 5 4 3 2 1 0 SRESET Unaffected Unaffected Addr (PORTQA) 0x30 4806 ; 0x30 4C06 (PORTQB) 0x30 4807, 0x30 4C07 ANALOG CHANNEL: AN5 9 AN5 8 AN5 AN5 7 6 AN5 5 AN5 AN5 4 3 AN5 2 AN5 1 AN5 0 AN4 9 AN4 8 AN3 AN2 AN1 AN0 MULTIPLEXED ADDRESS OUTPUTS: MA2 MA1 MA0 Figure 13-7. Port x Data Register (PORTQA and PORTQB) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-13 QADC64E Legacy Mode Operation MULTIPLEXED ANALOG INPUTS: ANz ANy ANx ANw Figure 13-7. Port x Data Register (PORTQA and PORTQB) Table 13-8. PORTQA, PORTQB Bit Descriptions Bits Name 0:7 PQA[7:0] Port A signals are referred to as PQA when used as an 8-bit input/output port. Port A can also be used for analog inputs (AN[59:52]), and external multiplexer address outputs (MA[2:0]). 8:15 PQB[7:0] Port B signals are referred to as PQB when used as an 8 input-only port. Port B can also be used for non-multiplexed (AN[51:48]/AN[3:0]) and multiplexed (ANz, ANy, ANx, ANw) analog inputs. 13.3.4 Description Port Data Direction Register (DDRQA) The port data direction register, DDRQA, is associated with port A digital input/output signals only. Any bit set in this register configures the corresponding signal as an output. Any bit cleared in this register configures the corresponding signal as an input. The software is responsible for ensuring that DDR bits are not set on signals used for analog inputs. When the DDR bit is set, thereby selecting the signal for analog conversion, the voltage sampled is that of the output digital driver as influenced by the load. NOTE Caution should be exercised when mixing digital and analog inputs. This should be isolated as much as possible. Rise and fall times should be as large as possible to minimize AC coupling effects. There are two special cases to consider for the digital I/O port operation. When QACR0[EMUX] is set, enabling external multiplexing, the data direction register settings are ignored for the bits corresponding to PORTQA[2:0], which are the three multiplexed address (MA[2:0]) output signals. The MA[2:0] signals are forced to be digital outputs, regardless of the data direction setting, and the multiplexed address outputs are driven. The data returned during a port data register read is the value of the multiplexed address latches which drive MA[2:0], regardless of the data direction setting. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 Field DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ A7 A6 A5 A4 A3 A2 A1 A0 SRESET Addr 12 13 14 15 -- 0000_0000_0000_0000 0x30 4808 (DDRQA_A); 0x30 4C08 (DDRQA_B) Figure 13-8. Port A Data Direction Register (DDRQA) 13.3.5 Control Register 0 (QACR0) Control Register 0 is used to define whether external multiplexing is enabled, assign external triggers to the conversion queues and to sets up the QCLK prescaler parameter field. All of the implemented control MPC561/MPC563 Reference Manual, Rev. 1.2 13-14 Freescale Semiconductor QADC64E Legacy Mode Operation register fields can be read or written but reserved fields read zero and writes have no effect. Typically, they are written once when software initializes the QADC64E and are not changed afterwards. MSB LSB 0 1 Field EMUX SRESET 0 2 3 4 5 6 7 8 9 10 11 12 13 14 -- TRG -- PSH PSA PSL 00 0 000 0_0001 0 011 Addr 15 0x30 480A (QACR0_A); 0x30 4C0A (QACR0_B) Figure 13-9. Control Register 0 (QACR0) Table 13-9. QACR0 Bit Descriptions Bits Name Description 0 EMUX Externally multiplexed mode. The EMUX bit configures the QADC64E for externally multiplexed mode, which affects the interpretation of the channel numbers and forces the MA[2:0] signals to be outputs. See Table 13-7 for more information. 0 Internally multiplexed, 16 possible channels 1 Externally multiplexed, 41 possible channels 1:2 -- 3 TRG 4:6 -- 7:11 PSH Prescaler clock high time. The PSH field selects the QCLK high time in the prescaler. PSH value plus 1 represents the high time in IMB3 clocks 12 PSA Note that this bit location is maintained for software compatibility with previous versions of the QADC64E. It serves no functional benefit in the MPC561/MPC563 and is not operational. 13:15 PSL Prescaler clock low time. The PSL field selects the QCLK low time in the prescaler. PSL value plus 1 represents the low time in IMB3 clocks Reserved Trigger assignment. TRG allows the software to assign the ETRIG[2:1] signals to queue 1 and queue 2. 0 ETRIG1 triggers queue 1; ETRIG2 triggers queue 2 1 ETRIG1 triggers queue 2; ETRIG2 triggers queue 1 Refer to Section 13.7.2, "External Trigger Input Signals." Reserved NOTE Details of how to calculate values for PSH, PSA, and PSL, as well as examples, are given in Section 13.5.5, "QADC64E Clock (QCLK) Generation." 13.3.6 Control Register 1 (QACR1) Control register 1 is the mode control register for the operation of queue 1. The application software defines the queue operating mode for the queue, and may enable a completion and/or pause interrupt. All of the control register fields are read/write data. However, the SSE1 bit always reads as zero. Most of the bits are typically written once when the software initializes the QADC64E, and not changed afterwards. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-15 QADC64E Legacy Mode Operation MSB 0 Field CIE1 LSB 1 2 3 4 PIE1 SSE1 5 6 7 8 9 10 11 MQ1 12 13 14 15 -- 0000_0000_0000_0000 SRESET Addr 0x30 480C (QACR1_A); 0x30 4C0C (QACR1_B) Figure 13-10. Control Register 1 (QACR1) Table 13-10. QACR1 Bit Descriptions Bits Name Description 0 CIE1 Queue 1 Completion Interrupt Enable. CIE1 enables an interrupt upon completion of queue 1. The interrupt request is initiated when the conversion is complete for the CCW in queue 1. 0 Disable the queue completion interrupt associated with queue 1 1 Enable an interrupt after the conversion of the sample requested by the last CCW in queue 1 1 PIE1 Queue 1 Pause Interrupt Enable. PIE1 enables an interrupt when queue 1 enters the pause state. The interrupt request is initiated when conversion is complete for a CCW that has the pause bit set. 0 Disable the pause interrupt associated with queue 1 1 Enable an interrupt after the conversion of the sample requested by a CCW in queue 1 which has the pause bit set 2 SSE1 Queue 1 Single-Scan Enable Bit. SSE1 enables a single-scan of queue 1 to start after a trigger event occurs. The SSE1 bit may be set to a one during the same write cycle when the MQ1 bits are set for one of the single-scan queue operating modes. The single-scan enable bit can be written as a one or a zero, but is always read as a zero. The SSE1 bit enables a trigger event to initiate queue execution for any single-scan operation on queue 1. The QADC64E clears the SSE1 bit when the single-scan is complete. Refer to Table 13-11 for more information. 0 Trigger events are not accepted for single-scan modes 1 Accept a trigger event to start queue 1 in a single-scan mode 3:7 MQ1 Queue 1 Operating Mode. The MQ1 field selects the queue operating mode for queue 1. Table 13-11 shows the bits in the MQ1 field which enable different queue 1 operating mode 8:15 -- Reserved Table 13-11. Queue 1 Operating Modes MQ1[3:7] Operating Modes 00000 Disabled mode, conversions do not occur 00001 Software triggered single-scan mode (started with SSE1) 00010 External trigger rising edge single-scan mode 00011 External trigger falling edge single-scan mode 00100 Interval timer single-scan mode: time = QCLK period x 27 00101 Interval timer single-scan mode: time = QCLK period x 28 00110 Interval timer single-scan mode: time = QCLK period x 29 00111 Interval timer single-scan mode: time = QCLK period x 210 MPC561/MPC563 Reference Manual, Rev. 1.2 13-16 Freescale Semiconductor QADC64E Legacy Mode Operation Table 13-11. Queue 1 Operating Modes (continued) MQ1[3:7] 13.3.7 Operating Modes 01000 Interval timer single-scan mode: time = QCLK period x 211 01001 Interval timer single-scan mode: time = QCLK period x 212 01010 Interval timer single-scan mode: time = QCLK period x 213 01011 Interval timer single-scan mode: time = QCLK period x 214 01100 Interval timer single-scan mode: time = QCLK period x 215 01101 Interval timer single-scan mode: time = QCLK period x 216 01110 Interval timer single-scan mode: time = QCLK period x 217 01111 External gated single-scan mode (started with SSE1) 10000 Reserved mode 10001 Software triggered continuous-scan mode 10010 External trigger rising edge continuous-scan mode 10011 External trigger falling edge continuous-scan mode 10100 Periodic timer continuous-scan mode: time = QCLK period x 27 10101 Periodic timer continuous-scan mode: time = QCLK period x 2 8 10110 Periodic timer continuous-scan mode: time = QCLK period x 2 9 10111 Periodic timer continuous-scan mode: time = QCLK period x 210 11000 Periodic timer continuous-scan mode: time = QCLK period x 211 11001 Periodic timer continuous-scan mode: time = QCLK period x 212 11010 Periodic timer continuous-scan mode: time = QCLK period x 21 11011 Periodic timer continuous-scan mode: time = QCLK period x 214 11100 Periodic timer continuous-scan mode: time = QCLK period x 215 11101 Periodic timer continuous-scan mode: time = QCLK period x 216 11110 Periodic timer continuous-scan mode: time = QCLK period x 217 11111 External gated continuous-scan mode Control Register 2 (QACR2) Control register 2 is the mode control register for the operation of queue 2. Software specifies the queue operating mode of queue 2, and may enable a completion and/or a pause interrupt. All control register fields are read/write data, except the SSE2 bit, which is readable only when the test mode is enabled. Most of the bits are typically written once when the software initializes the QADC64E, and not changed afterwards. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-17 QADC64E Legacy Mode Operation MSB LSB 0 Field CIE2 SRESET 1 2 PIE2 SSE2 0 0 Addr 0 3 4 5 6 7 8 9 10 11 12 13 MQ2 RESUME BQ2 0_0000 0 111_1111 14 15 0x30 480E (QACR2_A), 0x30 4C0E (QACR2_B) Figure 13-11. Control Register 2 (QACR2) Table 13-12. QACR2 Bit Descriptions Bits Name Description 0 CIE2 Queue 2 Completion Software Interrupt Enable. CIE2 enables an interrupt upon completion of queue 2. The interrupt request is initiated when the conversion is complete for the CCW in queue 2. 0 Disable the queue completion interrupt associated with queue 2 1 Enable an interrupt after the conversion of the sample requested by the last CCW in queue 2 1 PIE2 Queue 2 Pause Software Interrupt Enable. PIE2 enables an interrupt when queue 2 enters the pause state. The interrupt request is initiated when conversion is complete for a CCW that has the pause bit set. 0 Disable the pause interrupt associated with queue 2 1 Enable an interrupt after the conversion of the sample requested by a CCW in queue 2 which has the pause bit set 2 SSE2 Queue 2 Single-Scan Enable Bit. SSE2 enables a single-scan of queue 2 to start after a trigger event occurs. The SSE2 bit may be set to a one during the same write cycle when the MQ2 bits are set for one of the single-scan queue operating modes. The single-scan enable bit can be written as a one or a zero, but is always read as a zero. The SSE2 bit enables a trigger event to initiate queue execution for any single-scan operation on queue 2. The QADC64E clears the SSE2 bit when the single-scan is complete. Refer to Table 13-13 for more information. 0 Trigger events are not accepted for single-scan modes 1 Accept a trigger event to start queue 2 in a single-scan mode 3:7 MQ2 Queue 2 Operating Mode. The MQ2 field selects the queue operating mode for queue 2. Refer to Table 13-13 for more information. 8 RESUME 0 After suspension, begin executing with the first CCW in queue 2 or the current sub-queue 1 After suspension, begin executing with the aborted CCW in queue 2 MPC561/MPC563 Reference Manual, Rev. 1.2 13-18 Freescale Semiconductor QADC64E Legacy Mode Operation Table 13-12. QACR2 Bit Descriptions (continued) Bits Name Description 9:15 BQ2 Beginning of queue 2. The BQ2 field indicates the CCW location where queue 2 begins. To allow the length of queue 1 and queue 2 to vary, a programmable pointer identifies the CCW table location where queue 2 begins. The BQ2 field also serves as an end-of-queue condition for queue 1. Setting BQ2 beyond physical CCW table memory space allows queue 1 all 64 entries. Software defines the beginning of queue 2 by programming the BQ2 field in QACR2. BQ2 is usually programmed before or at the same time as the queue operating mode for queue 2 is selected. If BQ2 is 64 or greater, queue 2 has no entries, and the entire CCW table is dedicated to queue 1 and CCW63 is the end-of-queue 1. If BQ2 is zero, the entire CCW table is dedicated to queue 2. As a special case, when a queue operating mode for queue 1 is selected and a trigger event occurs for queue 1 with BQ2 set to zero, queue 1 execution is terminated after CCW0 is read. Conversions do not occur. The BQ2 pointer may be changed dynamically, to alternate between queue 2 scan sequences. A change in BQ2 after queue 2 has begun or if queue 2 has a trigger pending does not affect queue 2 until queue 2 is started again.For example, two scan sequences could be defined as follows: the first sequence starts at CCW10, with a pause after CCW11 and an EOQ programmed in CCW15; the second sequence starts at CCW16, with a pause after CCW17 and an EOQ programmed in CCW39. With BQ2 set to CCW10 and the continuous-scan mode selected, queue execution begins. When the pause is encountered in CCW11, a software interrupt routine can redefine BQ2 to be CCW16. Therefore, after the end-of-queue is recognized in CCW15, an internal retrigger event is generated and execution restarts at CCW16. When the pause software interrupt occurs again, software can change BQ2 back to CCW10. After the end-of-queue is recognized in CCW39, an internal retrigger event is created and execution now restarts at CCW10. If BQ2 is changed while queue 1 is active, the effect of BQ2 as an end-of-queue indication for queue 1 is immediate. However, beware of the risk of losing the end-of-queue 1 through moving BQ2. Recommend use of EOQ (chan63) to end queue 1. Note: Be sure to do a mode change when changing BQ2 and setting SSE2. Setting BQ2 first is recommended. Table 13-13 shows the bits in the MQ2 field that enable different queue 2 operating modes. Table 13-13. Queue 2 Operating Modes MQ2[3:7] Operating Modes 00000 Disabled mode, conversions do not occur 00001 Software triggered single-scan mode (started with SSE2) 00010 External trigger rising edge single-scan mode 00011 External trigger falling edge single-scan mode 00100 Interval timer single-scan mode: time = QCLK period x 27 00101 Interval timer single-scan mode: time = QCLK period x 28 00110 Interval timer single-scan mode: time = QCLK period x 29 00111 Interval timer single-scan mode: time = QCLK period x 210 01000 Interval timer single-scan mode: time = QCLK period x 211 01001 Interval timer single-scan mode: time = QCLK period x 212 01010 Interval timer single-scan mode: time = QCLK period x 213 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-19 QADC64E Legacy Mode Operation Table 13-13. Queue 2 Operating Modes (continued) MQ2[3:7] Operating Modes 01011 Interval timer single-scan mode: time = QCLK period x 214 01100 Interval timer single-scan mode: time = QCLK period x 215 01101 Interval timer single-scan mode: time = QCLK period x 216 01110 Interval timer single-scan mode: time = QCLK period x 217 01111 Reserved mode 10000 Reserved mode 10001 Software triggered continuous-scan mode 10010 External trigger rising edge continuous-scan mode 10011 External trigger falling edge continuous-scan mode 10100 Periodic timer continuous-scan mode: time = QCLK period x 27 10101 Periodic timer continuous-scan mode: time = QCLK period x 28 10110 Periodic timer continuous-scan mode: time = QCLK period x 29 10111 Periodic timer continuous-scan mode: time = QCLK period x 210 11000 Periodic timer continuous-scan mode: time = QCLK period x 211 11001 Periodic timer continuous-scan mode: time = QCLK period x 212 11010 Periodic timer continuous-scan mode: time = QCLK period x 213 11011 Periodic timer continuous-scan mode: time = QCLK period x 214 11100 Periodic timer continuous-scan mode: time = QCLK period x 215 11101 Periodic timer continuous-scan mode: time = QCLK period x 216 11110 Periodic timer continuous-scan mode: time = QCLK period x 217 11111 Reserved mode NOTE If BQ2 was assigned to the CCW that queue 1 is currently working on, then that conversion is completed before BQ2 takes effect. Each time a CCW is read for queue 1, the CCW location is compared with the current value of the BQ2 pointer to detect a possible end-of-queue condition. For example, if BQ2 is changed to CCW3 while queue 1 is converting CCW2, queue 1 is terminated after the conversion is completed. However, if BQ2 is changed to CCW1 while queue 1 is converting CCW2, the QADC64E would not recognize a BQ2 end-of-queue condition until queue 1 execution reached CCW1 again, presumably on the next pass through the queue. 13.3.8 Status Registers (QASR0 and QASR1) The status registers contains information about the state of each queue and the current A/D conversion. Except for the four flag bits (CF1, PF1, CF2, and PF2) and the two trigger overrun bits (TOR1 and TOR2), MPC561/MPC563 Reference Manual, Rev. 1.2 13-20 Freescale Semiconductor QADC64E Legacy Mode Operation all of the status register fields contain read-only data. The four flag bits and the two trigger overrun bits are cleared by writing a zero to the bit after the bit was previously read as a one. MSB 0 Field CF1 LSB 1 2 3 PF1 CF2 PF2 SRESET 4 5 6 TOR1 TOR2 7 8 9 10 QS 11 12 13 14 15 CWP 0000_0000_0000_0000 Addr 0x30 4810 (QASR0_A); 0x30 4C10 (QASR0_B) Figure 13-12. Status Register 0 (QASR0) Table 13-14. QASR0 Bit Descriptions Bits Name Description 0 CF1 Queue 1 Completion Flag. CF1 indicates that a queue 1 scan has been completed. The scan completion flag is set by the QADC64E when the input channel sample requested by the last CCW in queue 1 is converted, and the result is stored in the result table. The end-of-queue 1 is identified when execution is complete on the CCW in the location prior to that pointed to by BQ2, when the current CCW contains an end-of-queue code instead of a valid channel number, or when the currently completed CCW is in the last location of the CCW RAM. When CF1 is set and interrupts are enabled for that queue completion flag, the QADC64E asserts an interrupt request at the level specified by IRL1 in the interrupt register (QADCINT). The software reads the completion flag during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to the completion flag bit, when the bit was previously read as a one. Once set, only software or reset can clear CF1. CF1 is maintained by the QADC64E regardless of whether the corresponding interrupt is enabled. The software polls for CF1 bit to see if it is set. This allows the software to recognize that the QADC64E is finished with a queue 1 scan. The software acknowledges that it has detected the completion flag being set by writing a zero to the completion flag after the bit was read as a one. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-21 QADC64E Legacy Mode Operation Table 13-14. QASR0 Bit Descriptions (continued) Bits Name Description 1 PF1 Queue 1 Pause Flag. PF1 indicates that a queue 1 scan has reached a pause. PF1 is set by the QADC64E when the current queue 1 CCW has the pause bit set, the selected input channel has been converted, and the result has been stored in the result table. Once PF1 is set, the queue enters the paused state and waits for a trigger event to allow queue execution to continue. However, if the CCW with the pause bit set is the last CCW in a queue, the queue execution is complete. The queue status becomes idle, not paused, and both the pause and completion flags are set. Another exception occurs in software controlled mode, where the PF1 can be set but queue 1 never enters the pause state since queue 1 continues without pausing. When PF1 is set and interrupts are enabled for the corresponding queue, the QADC64E asserts an interrupt request at the level specified by IRL1 in the interrupt register. The software may read PF1 during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to PF1, when the bit was previously read as a one. Once set, only software or reset can clear PF1. In external gated single-scan and continuous-scan mode the definition of PF1 has been redefined. When the gate closes before the end-of-queue 1 is reached, PF1 becomes set to indicate that an incomplete scan has occurred.In single-scan mode, setting PF1 can be used to cause an interrupt and software can then determine if queue 1 should be enabled again. In either external gated mode, setting PF1 indicates that the results for queue 1 have not been collected during one scan (coherently). NOTE: If a pause in a CCW is encountered in external gated mode for either single-scan and continuous-scan mode, the pause flag will not set, and execution continues without pausing. This has allowed for the added definition of PF1 in the external gated modes. PF1 is maintained by the QADC64E regardless of whether the corresponding interrupts are enabled. The software may poll PF1 to find out when the QADC64E has reached a pause in scanning a queue.The software acknowledges that it has detected a pause flag being set by writing a zero to PF1 after the bit was last read as a one. 0 = queue 1 has not reached a pause (or gate has not closed before end-of-queue in gated mode) 1 = queue 1 has reached a pause (or gate closed before end-of-queue in gated mode) Refer to Table 13-15 for a summary of pause response in all scan modes. 2 CF2 Queue 2 Completion Flag. CF2 indicates that a queue 2 scan has been completed. CF2 is set by the QADC64E when the input channel sample requested by the last CCW in queue 2 is converted, and the result is stored in the result table. The end-of-queue 2 is identified when the current CCW contains an end-of-queue code instead of a valid channel number, or when the currently completed CCW is in the last location of the CCW RAM. When CF2 is set and interrupts are enabled for that queue completion flag, the QADC64E asserts an interrupt request at the level specified by IRL2 in the interrupt register (QADCINT). The software reads CF2 during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to the CF2 bit, when the bit was previously read as a one. Once set, only software or reset can clear CF2. CF2 is maintained by the QADC64E regardless of whether the corresponding interrupts are enabled. The software polls for CF2 to see if it is set. This allows the software to recognize that the QADC64E is finished with a queue 2 scan. The software acknowledges that it has detected the completion flag being set by writing a zero to the completion flag after the bit was read as a one. MPC561/MPC563 Reference Manual, Rev. 1.2 13-22 Freescale Semiconductor QADC64E Legacy Mode Operation Table 13-14. QASR0 Bit Descriptions (continued) Bits Name Description 3 PF2 Queue 2 Pause Flag. PF2 indicates that a queue 2 scan has reached a pause. PF2 is set by the QADC64E when the current queue 2 CCW has the pause bit set, the selected input channel has been converted, and the result has been stored in the result table. Once PF2 is set, the queue enters the paused state and waits for a trigger event to allow queue execution to continue. However, if the CCW with the pause bit set is the last CCW in a queue, the queue execution is complete. The queue status becomes idle, not paused, and both the pause and completion flags are set. Another exception occurs in software controlled mode, where the PF2 can be set but queue 2 never enters the pause state. When PF2 is set and interrupts are enabled for the corresponding queue, the QADC64E asserts an interrupt request at the level specified by IRL2 in the interrupt register. The software reads PF2 during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to PF2, when the bit was previously read as a one. Once set, only software or reset can clear PF2. PF2 is maintained by the QADC64E regardless of whether the corresponding interrupts are enabled. The software may poll PF2 to find out when the QADC64E has reached a pause in scanning a queue. The software acknowledges that it has detected a pause flag being set by writing a zero to PF2 after the bit was last read as a one. 0 queue 2 has not reached a pause 1 queue 2 has reached a pause Refer to Table 13-15 for a summary of pause response in all scan modes. 4 TOR1 Queue 1 Trigger Overrun. TOR1 indicates that an unexpected trigger event has occurred for queue 1. TOR1 can be set only while queue 1 is in the active state. A trigger event generated by a transition on the external trigger signal or by the periodic/interval timer may be captured as a trigger overrun. TOR1 cannot occur when the software initiated single-scan mode or the software initiated continuous-scan mode are selected. TOR1 occurs when a trigger event is received while a queue is executing and before the scan has completed or paused. TOR1 has no effect on the queue execution. After a trigger event has occurred for queue 1, and before the scan has completed or paused, additional queue 1 trigger events are not retained. Such trigger events are considered unexpected, and the QADC64E sets the TOR1 error status bit. An unexpected trigger event may be a system overrun situation, indicating a system loading mismatch. In external gated continuous-scan mode the definition of TOR1 has been redefined. In the case when queue 1 reaches an end-of-queue condition for the second time during an open gate, TOR1 becomes set. This is considered an overrun condition. In this case CF1 has been set for the first end-of-queue 1 condition and then TOR1 becomes set for the second end-of-queue 1 condition. For TOR1 to be set, software must not clear CF1 before the second end-of-queue 1. The software acknowledges that it has detected a trigger overrun being set by writing a zero to the trigger overrun, after the bit was read as a one. Once set, only software or reset can clear TOR1. 0 No unexpected queue 1 trigger events have occurred 1 At least one unexpected queue 1 trigger event has occurred (or queue 1 reaches an end-of-queue condition for the second time in gated mode) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-23 QADC64E Legacy Mode Operation Table 13-14. QASR0 Bit Descriptions (continued) Bits Name Description 5 TOR2 Queue 2 Trigger Overrun. TOR2 indicates that an unexpected trigger event has occurred for queue 2. TOR2 can be set when queue 2 is in the active, suspended, and trigger pending states. The TOR2 trigger overrun can only occur when using an external trigger mode or a periodic/interval timer mode. Trigger overruns cannot occur when the software initiated single-scan mode and the software initiated continuous-scan mode are selected. TOR2 occurs when a trigger event is received while queue 2 is executing, suspended, or a trigger is pending. TOR2 has no effect on the queue execution. A trigger event that causes a trigger overrun is not retained since it is considered unexpected. An unexpected trigger event may be a system overrun situation, indicating a system loading mismatch. The software acknowledges that it has detected a trigger overrun being set by writing a zero to the trigger overrun, after the bit was read as a one. Once set, only software or reset can clear TOR2. 0 No unexpected queue 2 trigger events have occurred 1 At least one unexpected queue 2 trigger event has occurred 6:9 QS Queue Status. The 4-bit read-only QS field indicates the current condition of queue 1 and queue 2. The following are the five queue status conditions: * Idle * Active * Paused * Suspended * Trigger pending The two most significant bits are associated primarily with queue 1, and the remaining two bits are associated with queue 2. Since the priority scheme between the two queues causes the status to be interlinked, the status bits are considered as one 4-bit field. Table 13-16 shows the bits in the QS field and how they affect the status of queue 1 and queue 2. Refer to Section 13.6, "Trigger and Queue Interaction Examples," which shows the 4-bit queue status field transitions in typical situations. 10:15 CWP Command Word Pointer. The CWP allows the software to know which CCW is executing at present, or was last completed. The command word pointer is a software read-only field, and write operations have no effect. The CWP allows software to monitor the progress of the QADC64E scan sequence. The CWP field is a CCW word pointer with a valid range of 0 to 63. When a queue enters the paused state, the CWP points to the CCW with the pause bit set. While in pause, the CWP value is maintained until a trigger event occurs on the same queue or the other queue. Usually, the CWP is updated a few clock cycles before the queue status field shows that the queue has become active. For example, software may read a CWP pointing to a CCW in queue 2, and the status field shows queue 1 paused, queue 2 trigger pending. When the QADC64E finishes the scan of the queue, the CWP points to the CCW where the end-of-queue (EOQ) condition was detected. Therefore, when the end-of-queue condition is a CCW with the EOQ code (channel 63), the CWP points to the CCW containing the EOQ. When the last CCW in a queue is in the last CCW table location (CCW63), and it does not contain the EOQ code, the end-of-queue is detected when the following CCW is read, so the CWP points to word CCW0. Finally, when queue 1 operation is terminated after a CCW is read that is defined as BQ2, the CWP points to the same CCW as BQ2. During the stop mode, the CWP is reset to zero, since the control registers and the analog logic are reset. When the freeze mode is entered, the CWP is unchanged; it points to the last executed CCW. MPC561/MPC563 Reference Manual, Rev. 1.2 13-24 Freescale Semiconductor QADC64E Legacy Mode Operation Table 13-15. Pause Response Scan Mode Q Operation PF Asserts? External Trigger Single-scan Pauses Yes External Trigger Continuous-scan Pauses Yes Periodic/Interval Timer Trigger Single-scan Pauses Yes Periodic/Interval Timer Continuous-scan Pauses Yes Software Initiated Single-scan Continues Yes Software Initiated Continuous-scan Continues Yes External Gated Single-scan Continues No External Gated Continuous-scan Continues No Table 13-16. Queue Status QS[9:6] Queue 1/Queue 2 States 0000 queue 1 idle, queue 2 idle 0001 queue 1 idle, queue 2 paused 0010 queue 1 idle, queue 2 active 0011 queue 1 idle, queue 2 trigger pending 0100 queue 1 paused, queue 2 idle 0101 queue 1 paused, queue 2 paused 0110 queue 1 paused, queue 2 active 0111 queue 1 paused, queue 2 trigger pending 1000 queue 1 active, queue 2 idle 1001 queue 1 active, queue 2 paused 1010 queue 1 active, queue 2 suspended 1011 queue 1 active, queue 2 trigger pending 1100 Reserved 1101 Reserved 1110 Reserved 1111 Reserved One or both queues may be in the idle state. When a queue is idle, CCWs are not being executed for that queue, the queue is not in the pause state, and there is not a trigger pending. The idle state occurs when a queue is disabled, when a queue is in a reserved mode, or when a queue is in a valid queue operating mode awaiting a trigger event to initiate queue execution. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-25 QADC64E Legacy Mode Operation A queue is in the active state when a valid queue operating mode is selected, when the selected trigger event has occurred, or when the QADC64E is performing a conversion specified by a CCW from that queue. Only one queue can be active at a time. Either or both queues can be in the paused state. A queue is paused when the previous CCW executed from that queue had the pause bit set. The QADC64E does not execute any CCWs from the paused queue until a trigger event occurs. Consequently, the QADC64E can service queue 2 while queue 1 is paused. Only queue 2 can be in the suspended state. When a trigger event occurs on queue 1 while queue 2 is executing, the current queue 2 conversion is aborted. The queue 2 status is reported as suspended. Queue 2 transitions back to the active state when queue 1 becomes idle or paused. A trigger pending state is required since both queues cannot be active at the same time. The status of queue 2 is changed to trigger pending when a trigger event occurs for queue 2 while queue 1 is active. In the opposite case, when a trigger event occurs for queue 1 while queue 2 is active, queue 2 is aborted and the status is reported as queue 1 active, queue 2 suspended. So due to the priority scheme, only queue 2 can be in the trigger pending state. There are two transition cases which cause the queue 2 status to be trigger pending before queue 2 is shown to be in the active state. When queue 1 is active and there is a trigger pending on queue 2, after queue 1 completes or pauses, queue 2 continues to be in the trigger pending state for a few clock cycles. The following are fleeting status conditions: * Queue 1 idle with queue 2 trigger pending * Queue 1 paused with queue 2 trigger pending Figure 13-13 displays the status conditions of the queue status field as the QADC64E goes through the transition from queue 1 active to queue 2 active. Queue 1 Queue 2 Active Idle Active Trigger Pending Idle (Paused) Trigger Pending Idle (Paused) Active Figure 13-13. QADC64E Queue Status Transition The queue status field is affected by the stop mode. Because all of the analog logic and control registers are reset, the queue status field is reset to queue 1 idle, queue 2 idle. MPC561/MPC563 Reference Manual, Rev. 1.2 13-26 Freescale Semiconductor QADC64E Legacy Mode Operation During the freeze mode, the queue status field is not modified. The queue status field retains the status it held prior to freezing. As a result, the queue status can show queue 1 active, queue 2 idle, even though neither queue is being executed during freeze. MSB LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Field -- CWPQ1 -- CWPQ2 SRESET 00 11_1111 00 11_1111 Addr 14 15 0x30 4812 (QASR1_A); 0x30 4C12 (QASR1_B) Figure 13-14. Status Register 1 (QASR1) Table 13-17. QASR1 Bit Descriptions Bits Name 0:1 -- 2:7 CWPQ1 8:9 -- 10:15 CWPQ2 13.3.9 Description Reserved Command Word Pointer for Q1 . CWPQ1 allows the software to know what CCW was last completed for queue 1. This field is a software read-only field, and write operations have no effect. CWPQ1 allows software to read the last executed CCW in queue 1, regardless of which queue is active. The CWPQ1 field is a CCW word pointer with a valid range of 0 to 63. In contrast to CWP, CPWQ1 is updated when the conversion result is written. When the QADC64E finishes a conversion in queue 1, both the result register is written and the CWPQ1 are updated. Finally, when queue 1 operation is terminated after a CCW is read that is defined as BQ2, CWP points to BQ2 while CWPQ1 points to the last CCW queue 1. During the stop mode, the CWPQ1 is reset to 63, since the control registers and the analog logic are reset. When the freeze mode is entered, the CWPQ1 is unchanged; it points to the last executed CCW in queue 1. Reserved Command Word Pointer for Q2. CWPQ2 allows the software to know what CCW was last completed for queue 2. This field is a software read-only field, and write operations have no effect. CWPQ2 allows software to read the last executed CCW in queue 2, regardless which queue is active. The CWPQ2 field is a CCW word pointer with a valid range of 0 to 63. In contrast to CWP, CPWQ2 is updated when the conversion result is written. When the QADC64E finishes a conversion in queue 2, both the result register is written and the CWPQ2 are updated. During the stop mode, the CWPQ2 is reset to 63, since the control registers and the analog logic are reset. When the freeze mode is entered, the CWP is unchanged; it points to the last executed CCW in queue 2. Conversion Command Word Table The conversion command word (CCW) table is a RAM, 64 words long on 16-bit address boundaries where 10-bits of each entry are implemented. A CCW can be programmed by the software to request a conversion of one analog input channel. The CCW table is written by software and is not modified by the QADC64E. Each CCW requests the conversion of an analog channel to a digital result. The CCW specifies the analog channel number, the input sample time, and whether the queue is to pause after the current CCW. The ten implemented bits of the CCW word are read/write data, where they may be written when the software initializes the QADC64E. The remaining 6-bits are unimplemented so these read as zeros, and write MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-27 QADC64E Legacy Mode Operation operations have no effect. Each location in the CCW table corresponds to a location in the result word table. When a conversion is completed for a CCW entry, the 10-bit result is written in the corresponding result word entry. The QADC64E provides 64 CCW table entries. The beginning of queue 1 is the first location in the CCW table. The first location of queue 2 is specified by the beginning of queue 2 pointer (BQ2) in QACR2. To dedicate the entire CCW table to queue 1, queue 2 is programmed to be in the disabled mode, and BQ2 is programmed to 64 or greater. To dedicate the entire CCW table to queue 2, queue 1 is programmed to be in the disabled mode, and BQ2 is specified as the first location in the CCW table.Figure 13-15 illustrates the operation of the queue structure. Conversion Command Word (CCW) Table 0x200 (ccw0)1 Result Word Table A/D Converter Begin Queue 1 Result 0 BQ2 End of Queue 1 Begin Queue 2 0x27E (ccw63)1 End of Queue 2 Channel Select, Sample, Hold, and Analog to Digital Conversion Result 63 0 P BYP IST CHAN P = Pause After Conversion BYP = Bypass Buffer Amplifier IST = Input Sample Time CHAN = Channel Number and End_of_Queue Code 10-bit Conversion Command Word (CCW) Format 15 Address Offsets 56 0x280-0x2FF1 Result Right Justified, Unsigned Result Format 0 0 0 0 0 0 0 S 9 10 15 0 0 0 0 0 0 Result Left Justified, Signed Result Format 0 9 10 0x300-0x37F1 S = Sign bit 15 Result 0 0 0 0 0 0 Left Justified, Unsigned Result Format 0x380-0x3FF1 10-bit Result is Software Readable in 3 Different 16-bit Formats Note 1: These offsets must be added to the module base address: A = 0x30 4800 or B = 0x30 4C00. Figure 13-15. QADC64E Conversion Queue Operation To prepare the QADC64E for a scan sequence, the software writes to the CCW table to specify the desired channel conversions. The software also establishes the criteria for initiating the queue execution by programming the queue operating mode. The queue operating mode determines what type of trigger event causes queue execution to begin. A "trigger event" is used to refer to any of the ways to cause the QADC64E to begin executing the CCWs in a queue or sub-queue. An "external trigger" is only one of the possible "trigger events." MPC561/MPC563 Reference Manual, Rev. 1.2 13-28 Freescale Semiconductor QADC64E Legacy Mode Operation A scan sequence may be initiated by the following: * A software command * Expiration of the periodic/interval timer * External trigger signal * External gated signal (queue 1 only) The software also specifies whether the QADC64E is to perform a single pass through the queue or is to scan continuously. When a single-scan mode is selected, the software selects the queue operating mode and sets the single-scan enable bit. When a continuous-scan mode is selected, the queue remains active in the selected queue operating mode after the QADC64E completes each queue scan sequence. During queue execution, the QADC64E reads each CCW from the active queue and executes conversions in three stages: * Initial sample - During initial sample, a buffered version of the selected input channel is connected to the sample capacitor at the input of the sample buffer amplifier. * Final sample - During the final sample period, the sample buffer amplifier is bypassed, and the multiplexer input charges the sample capacitor directly. Each CCW specifies a final input sample time of 2, 4, 8, or 16 cycles. * Resolution - When an analog-to-digital conversion is complete, the result is written to the corresponding location in the result word table. The QADC64E continues to sequentially execute each CCW in the queue until the end of the queue is detected or a pause bit is found in a CCW. When the pause bit is set in the current CCW, the QADC64E stops execution of the queue until a new trigger event occurs. The pause status flag bit is set, which may cause an interrupt to notify the software that the queue has reached the pause state. After the trigger event occurs, the paused state ends and the QADC64E continues to execute each CCW in the queue until another pause is encountered or the end of the queue is detected. The following indicate the end-of-queue condition: * The CCW channel field is programmed with 63 (0x3F) to specify the end of the queue * The end-of-queue 1 is implied by the beginning of queue 2, which is specified in the BQ2 field in QACR2 * The physical end of the queue RAM space defines the end of either queue When any of the end-of-queue conditions is recognized, a queue completion flag is set, and if enabled, an interrupt is issued to the software. The following situations prematurely terminate queue execution: * Because queue 1 is higher in priority than queue 2, when a trigger event occurs on queue 1 during queue 2 execution, the execution of queue 2 is suspended by aborting the execution of the CCW in progress, and the queue 1 execution begins. When queue 1 execution is completed, queue 2 conversions restart with the first CCW entry in queue 2 or the first CCW of the queue 2 sub-queue being executed when queue 2 was suspended. Alternately, conversions can restart with the aborted queue 2 CCW entry. The RESUME bit in QACR2 allows the software to select where queue 2 begins after suspension. By choosing to re-execute all of the suspended queue 2 queue and MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-29 QADC64E Legacy Mode Operation * * * * sub-queue CCWs, all of the samples are guaranteed to have been taken during the same scan pass. However, a high trigger event rate for queue 1 can prohibit the completion of queue 2. If this occurs, the software may choose to begin execution of queue 2 with the aborted CCW entry. Software can change the queue operating mode to disabled mode. Any conversion in progress for that queue is aborted. Putting a queue into the disabled mode does not power down the converter. Software can change the queue operating mode to another valid mode. Any conversion in progress for that queue is aborted. The queue restarts at the beginning of the queue, once an appropriate trigger event occurs. For low power operation, software can set the stop mode bit to prepare the module for a loss of clocks. The QADC64E aborts any conversion in progress when the stop mode is entered. When the freeze enable bit is set by software and the IMB3 internal FREEZE line is asserted, the QADC64E freezes at the end of the conversion in progress. When internal FREEZE is negated, the QADC64E resumes queue execution beginning with the next CCW entry. Refer to Section 13.5.7, "Configuration and Control Using the IMB3 Interface" for more information. MSB LSB 0 1 Field 2 3 -- Reset 4 5 6 7 P BYP 8 9 10 11 IST 12 13 14 15 CHAN[5:0] Unaffected Addr 0x30 4A00 - 0x30 4A7F, 0x30 4E00 - 0x30 4E7F Figure 13-16. Conversion Command Word Table (CCW) Table 13-18. CCW Bit Descriptions Bits Name Description 0:5 -- Reserved 6 P Pause. The pause bit allows the creation of sub-queues within queue 1 and queue 2. The QADC64E performs the conversion specified by the CCW with the pause bit set, and then the queue enters the pause state. Another trigger event causes execution to continue from the pause to the next CCW. 0 Do not enter the pause state after execution of the current CCW. 1 Enter the pause state after execution of the current CCW. 7 BYP Sample amplifier bypass. Setting BYP enables the amplifier bypass mode for a conversion, and subsequently changes the timing. Refer to Section 13.4.1.2, "Amplifier Bypass Mode Conversion Timing," for more information. 0 Amplifier bypass mode disabled. 1 Amplifier bypass mode enabled. MPC561/MPC563 Reference Manual, Rev. 1.2 13-30 Freescale Semiconductor QADC64E Legacy Mode Operation Table 13-18. CCW Bit Descriptions (continued) Bits Name Description 8:9 IST Input sample time. The IST field specifies the length of the sample window. Longer sample times permit more accurate A/D conversions of signals with higher source impedances, especially if BYP = 1. 00 QCKL period x 2 01 QCKL period x 4 10 QCKL period x 8 11 QCKL period x 16 10:15 CHAN Channel number. The CHAN field selects the input channel number corresponding to the analog input signal to be sampled and converted. The analog input signal channel number assignments and the signal definitions vary depending on whether the QADC64E is operating in multiplexed or non-multiplexed mode. The queue scan mechanism sees no distinction between an internally or externally multiplexed analog input. If CHAN specifies a reserved channel number (channels 32 to 47) or an invalid channel number (channels 4 to 31 in non-multiplexed mode), the low reference level (VRL) is converted. Programming the channel field to channel 63 indicates the end of the queue. Channels 60 to 62 are special internal channels. When one of these channels is selected, the sample amplifier is not used. The value of VRL, VRH, or (VRH - VRL)/2 is placed directly into the converter. Programming the input sample time to any value other than two for one of the internal channels has no benefit except to lengthen the overall conversion time. Table 13-19 shows the channel number assignments for non-multiplexed mode. Table 13-20 shows the channel number assignments for multiplexed mode. Table 13-19. Non-Multiplexed Channel Assignments and Signal Designations Non-multiplexed Input Signals Channel Number in CHAN Port Signal Name Analog Signal Name Other Functions Signal Type (I/O) Binary Decimal PQB0 PQB1 PQB2 PQB3 AN0 AN1 AN2 AN3 -- -- -- -- I I I I 000000 000001 000010 000011 0 1 2 3 -- -- PQB4 PQB5 -- -- AN48 AN49 Invalid Reserved -- -- -- -- I I 000100 to 011111 10XXXX 110000 110001 4 to 31 32 to 47 48 49 Port Signal Name Analog Signal Name Other Functions Signal Type (I/O) Binary Decimal PQB6 PQB7 PQA0 PQA1 AN50 AN51 AN52 AN53 -- -- -- -- I I I/O I/O 110010 110011 110100 110101 50 51 52 53 PQA2 PQA3 PQA4 PQA5 AN54 AN55 AN56 AN57 -- -- -- -- I/O I/O I/O I/O 110110 110111 111000 111001 54 55 56 57 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-31 QADC64E Legacy Mode Operation Table 13-19. Non-Multiplexed Channel Assignments and Signal Designations (continued) Non-multiplexed Input Signals Channel Number in CHAN PQA6 PQA7 -- -- AN58 AN59 VRL VRH -- -- -- -- I/O I/O I I 111010 111011 111100 111101 58 59 60 61 -- -- -- -- (VRH - VRL)/2 End of Queue Code -- -- 111110 111111 62 63 Table 13-20. Multiplexed Channel Assignments and Signal Designations Multiplexed Input Signals Channel Number in CHAN Port Signal Name Analog Signal Name Other Functions Signal Type (I/O) Binary Decimal PQB0 PQB1 PQB2 PQB3 ANw ANx ANy ANz -- -- -- -- I I I I 00xxx0 00xxx1 01xxx0 01xxx1 0 to 14 even 1 to 15 odd 16 to 30 even 17 to 31 odd -- PQB4 PQB5 PQB6 -- AN48 AN49 AN50 Reserved -- -- -- -- I I I 10xxxx 110000 110001 110010 32 to 47 48 49 50 PQB7 PQA0 PQA1 PQA2 AN51 -- -- -- -- MA0 MA1 MA2 I I/O I/O I/O 110011 110100 110101 110110 51 52 53 54 PQA3 PQA4 PQA5 PQA6 AN55 AN56 AN57 AN58 -- -- -- -- I/O I/O I/O I/O 110111 111000 111001 111010 55 56 57 58 PQA7 -- -- -- AN59 VRL VRH -- -- -- -- (VRH -VRL)/2 I/O I I -- 111011 111100 111101 111110 59 60 61 62 -- -- End of Queue Code -- 111111 63 The channel field is programmed for channel 63 to indicate the end of the queue. Channels 60 to 62 are special internal channels. When one of the special channels is selected, the sampling amplifier is not used. The value of VRL, VRH, or (VRH - VRL)/2 is placed directly onto the converter. Also for the internal special channels, programming any input sample time other than two has no benefit except to lengthen the overall conversion time. 13.3.10 Result Word Table The result word table is a RAM, 64 words long and 10 bits wide. An entry is written by the QADC64E after completing an analog conversion specified by the corresponding CCW table entry. Software can read MPC561/MPC563 Reference Manual, Rev. 1.2 13-32 Freescale Semiconductor QADC64E Legacy Mode Operation or write the result word table, but in normal operation, the software reads the result word table to obtain analog conversions from the QADC64E. Unimplemented bits are read as zeros, and write operations do not have any effect. See Figure 13-17 for a diagram of the result word table While there is only one result word table, the data can be accessed in three different data formats: * Right justified in the 16-bit word, with zeros in the higher order unused bits * Left justified, with the most significant bit inverted to form a sign bit, and zeros in the unused lower order bits * Left justified, with zeros in the lower order unused bits The left justified, signed format corresponds to a half-scale, offset binary, two's complement data format. The data is routed onto the IMB3 according to the selected format. The address used to access the table determines the data alignment format. All write operations to the result word table are right justified. MSB 0 LSB 1 2 Field SRESET 3 4 5 6 7 8 9 10 11 -- RESULT 0000_00 Undefined Addr 12 13 14 13 14 15 0x30 4A80-4AFF (RJURR_A); 0x30 4E80-4EFF (RJURR_B) Figure 13-17. Right Justified, Unsigned Result Format (RJURR) MSB LSB 0 Field 1 2 3 4 S1 5 6 7 8 9 10 11 12 RESULT -- Undefined SRESET Addr 15 00_0000 0x30 4B00-4B7F (LJSRR_A); 0x30 4F00-4F7F (LJSRR_B) Figure 13-18. Left Justified, Signed Result Format (LJSRR) 1 S = Sign bit. MSB 0 LSB 1 Field SRESET Addr 2 3 4 5 6 7 8 9 10 11 12 13 RESULT -- Undefined 00_0000 14 15 0x30 4B80-4BFF (LJURR_A); 0x30 4F80-4FFF (LJURR_B) Figure 13-19. Left Justified, Unsigned Result Register (LJURR) The three result data formats are produced by routing the RAM bits onto the data bus. The software chooses among the three formats by reading the result at the memory address which produces the desired data alignment. The result word table is read/write accessible by software. During normal operation, application software only needs to read the result table. Write operations to the table may occur during test or debug breakpoint operation. When locations in the CCW table are not used by an application, software could use the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-33 QADC64E Legacy Mode Operation corresponding locations in the result word table as scratch pad RAM, remembering that only 10 bits are implemented. The result alignment is only implemented for software read operations. Since write operations are not the normal use for the result registers, only one write data format is supported, which is right justified data. NOTE Some write operations, like bit manipulation, may not operate as expected because the hardware cannot access a true 16-bit value. 13.4 Analog Subsystem This section describes the QADC64E analog subsystem, which includes the front-end analog multiplexer and analog-to-digital converter. 13.4.1 Analog-to-Digital Converter Operation The analog subsystem consists of the path from the input signals to the A/D converter block. Signals from the queue control logic are fed to the multiplexer and state machine. The end of convert (EOC) signal and the successive-approximation register (SAR) are the result of the conversion. Figure 13-20 shows a block diagram of the QADC64E analog subsystem. BIAS STOP 2 Final . .. AN44 Buffer + AN59 Decoder - Sample CAP Array Equals CDAC Buffer AMP COMP. + 6 Sample Zero CONV. VRH RDAC (7 BIT) VRL 7 CDAC (4 BIT) CRH CRL 4 (one is offset) CHAN IST REF CCW Buffer State Mach, SAR and SAR Buffer WCCW EOS/EOC CLK Result 10 Data Bus Standard Converter Interface Figure 13-20. QADC64E Analog Subsystem Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 13-34 Freescale Semiconductor QADC64E Legacy Mode Operation 13.4.1.1 Conversion Cycle Times Total conversion time is made up of initial sample time, final sample time, and resolution time. Initial sample time refers to the time during which the selected input channel is coupled through the buffer amplifier to the sample capacitor. This buffer is used to quickly reproduce its input signal on the sample capacitor and minimize charge sharing errors. During the final sampling period the amplifier is bypassed, and the multiplexer input charges the sample capacitor array directly for improved accuracy. During the resolution period, the voltage in the sample capacitor is converted to a digital value and stored in the SAR. Initial sample time is fixed at two QCLK cycles. Final sample time can be 2, 4, 6, 8, or 16 QCLK cycles, depending on the value of the IST field in the CCW. Resolution time is ten QCLK cycles. Therefore, conversion time requires a minimum of 14 QCLK clocks (7 s with a 2.0-MHz QCLK). If the maximum final sample time period of 16 QCLKs is selected, the total conversion time is 28 QCLKs or 14 s (with a 2.0-MHz QCLK) Figure 13-21 illustrates the timing for conversions. BUFFER Final Sample Time Sample N cycles: Time 2 cycles (2, 4, 8, 16) Resolution Time 10 cycles QCLK Sample TIME Successive Approximation Resolution Sequence Figure 13-21. Conversion Timing 13.4.1.2 Amplifier Bypass Mode Conversion Timing If the amplifier bypass mode is enabled for a conversion by setting the amplifier bypass (BYP) bit in the CCW, the timing changes to that shown in Figure 13-22. The buffered sample time is eliminated, reducing the potential conversion time by two QCLKs. However, due to internal RC effects, a minimum final sample time of four QCLKs must be allowed. This results in no savings of QCLKs. When using the bypass mode, the external circuit should be of low source impedance, typically less than 10 k. Also, the loading effects of the external circuitry by the QADC64E need to be considered, since the benefits of the sample amplifier are not present. NOTE Because of internal RC time constants, a sample time of two QCLKs in bypass mode for high frequency operation is not recommended. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-35 QADC64E Legacy Mode Operation Sample Time N cycles: (2, 4, 8, 16) Resolution Time 10 cycles Sample Time Successive Approximation Resolution Sequence QCLK Figure 13-22. Bypass Mode Conversion Timing 13.4.2 Channel Decode and Multiplexer The internal multiplexer selects one of the 16 analog input signals for conversion. The selected input is connected to the sample buffer amplifier. The multiplexer also includes positive and negative stress protection circuitry, which prevents deselected channels from affecting the selected channel when current is injected into the deselected channels. Refer to Appendix F, "Electrical Characteristics," for specific current levels. 13.4.3 Sample Buffer Amplifier The sample buffer is used to raise the effective input impedance of the A/D converter, so that external components (higher bandwidth or higher impedance) are less critical to accuracy. The input voltage is buffered onto the sample capacitor to reduce crosstalk between channels. 13.4.4 Digital-to-Analog Converter (DAC) Array The digital to analog converter (DAC) array consists of binary-weighted capacitors and a resistor-divider chain. The reference voltages, VRH and VRL, are used by the DAC to perform ratiometric conversions. The DAC also converts the following three internal channels: * VRH -- Reference voltage high * VRL -- Reference voltage low * (VRH - VRL)/2 -- Reference voltage The DAC array serves to provide a mechanism for the successive approximation A/D conversion. Resolution begins with the most significant bit (MSB) and works down to the least significant bit (LSB). The switching sequence is controlled by the comparator and successive-approximation register (SAR) logic. * Sample capacitor -- The sample capacitor is employed to sample and hold the voltage to be converted. MPC561/MPC563 Reference Manual, Rev. 1.2 13-36 Freescale Semiconductor QADC64E Legacy Mode Operation 13.4.5 Comparator The comparator is used during the approximation process to sense whether the digitally selected arrangement of the DAC array produces a voltage level higher or lower than the sampled input. The comparator output feeds into the SAR which accumulates the A/D conversion result sequentially, beginning with the MSB. 13.4.6 Bias The bias circuit is controlled by the STOP signal to power-up and power-down all the analog circuits. 13.4.7 Successive Approximation Register The input of the successive approximation register (SAR) is connected to the comparator output. The SAR sequentially receives the conversion value one bit at a time, starting with the MSB. After accumulating the 10 bits of the conversion result, the SAR data is transferred to the appropriate result location, where it may be read from the IMB3 by user software. 13.4.8 State Machine The state machine receives the QCLK, RST, STOP, BYP, IST, CHAN[5:0], and START CONV signals, from which it generates all timing to perform an A/D conversion. The start convert (START CONV) signal indicates to the A/D converter that the desired channel has been sent to the MUX. IST indicates the desired sample time. BYP indicates whether to bypass the sample amplifier. The end of conversion (EOC) signal, notifies the queue control logic that a result is available for storage in the result RAM. 13.5 Digital Subsystem The digital control subsystem includes the control logic to sequence the conversion activity, the clock and periodic/interval timer, control and status registers, the conversion command word table RAM, and the result word table RAM. The central element for control of the QADC64E conversions is the 64-entry CCW table. Each CCW specifies the conversion of one input channel. Depending on the application, one or two queues can be established in the CCW table. A queue is a scan sequence of one or more input channels. By using a pause mechanism, sub-queues can be created in the two queues. Each queue can be operated using one of several different scan modes. The scan modes for queue 1 and queue 2 are programmed in QACR1 and QACR2 (control registers 1 and 2). Once a queue has been started by a trigger event (any of the ways to cause the QADC64E to begin executing the CCWs in a queue or sub-queue), the QADC64E performs a sequence of conversions and places the results in the result word table. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-37 QADC64E Legacy Mode Operation 13.5.1 Queue Priority Queue 1 has priority over queue 2 execution. The following cases show the conditions under which queue 1 asserts its priority: * When a queue is not active, a trigger event for queue 1 or queue 2 causes the corresponding queue execution to begin. * When queue 1 is active and a trigger event occurs for queue 2, queue 2 cannot begin execution until queue 1 reaches completion or the paused state. The status register records the trigger event by reporting the queue 2 status as trigger pending. Additional trigger events for queue 2, which occur before execution can begin, are captured as trigger overruns. * When queue 2 is active and a trigger event occurs for queue 1, the current queue 2 conversion is aborted. The status register reports the queue 2 status as suspended. Any trigger events occurring for queue 2 while queue 2 is suspended are captured as trigger overruns. Once queue 1 reaches the completion or the paused state, queue 2 begins executing again. The programming of the RESUME bit in QACR2 determines which CCW is executed in queue 2. Refer to Section 13.3.7, "Control Register 2 (QACR2)" for more information. * When simultaneous trigger events occur for queue 1 and queue 2, queue 1 begins execution and the queue 2 status is changed to trigger pending. 13.5.2 Paused Sub-Queues The pause feature can be used to divide queue 1 and/or queue 2 into multiple sub-queues. A sub-queue is defined by setting the pause bit in the last CCW of the sub-queue. Figure 13-23 shows the CCW format and an example of using pause to create sub-queues. Queue 1 is shown with four CCWs in each sub-queue and queue 2 has two CCWs in each sub-queue. MPC561/MPC563 Reference Manual, Rev. 1.2 13-38 Freescale Semiconductor QADC64E Legacy Mode Operation Conversion Command Word (CCW) Table 00 P 0 0 0 1 0 0 0 1 0 0 1 0 P 1 63 0 00 BEGIN Queue 1 PAUSE PAUSE Channel Select, Sample, P 0 0 BQ2 0 1 0 1 Result Word Table Hold, And END OF Queue 1 BEGIN Queue 2 PAUSE A/D Conversion PAUSE PAUSE PAUSE END OF Queue 2 63 QADC64E CQP Figure 13-23. QADC64E Queue Operation with Pause The queue operating mode selected for queue 1 determines what type of trigger event causes the execution of each of the sub-queues within queue 1. Similarly, the queue operating mode for queue 2 determines the type of trigger event required to execute each of the sub-queues within queue 2. For example, when the external trigger rising edge continuous-scan mode is selected for queue 1, and there are six sub-queues within queue 1, a separate rising edge is required on the external trigger signal after every pause to begin the execution of each sub-queue (refer to Figure 13-23). Refer to Section 13.5.4, "Scan Modes," for information on different scan modes. The choice of single-scan or continuous-scan applies to the full queue, and is not applied to each sub-queue. Once a sub-queue is initiated, each CCW is executed sequentially until the last CCW in the sub-queue is executed and the pause state is entered. Execution can only continue with the next CCW, which is the beginning of the next sub-queue. A sub-queue cannot be executed a second time before the overall queue execution has been completed. Refer to Section 13.3.7, "Control Register 2 (QACR2)," for more information. Trigger events which occur during the execution of a sub-queue are ignored, except that the trigger overrun flag is set. When a continuous-scan mode is selected, a trigger event occurring after the completion of the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-39 QADC64E Legacy Mode Operation last sub-queue (after the queue completion flag is set), causes the execution to continue with the first sub-queue, starting with the first CCW in the queue. When the QADC64E encounters a CCW with the pause bit set, the queue enters the paused state after completing the conversion specified in the CCW with the pause bit. The pause flag is set and a pause software interrupt may optionally be issued. The status of the queue is shown to be paused, indicating completion of a sub-queue. The QADC64E then waits for another trigger event to again begin execution of the next sub-queue. 13.5.3 Boundary Conditions The following are queue operation boundary conditions: * The first CCW in a queue contains channel 63, the end-of-queue (EOQ) code. The queue becomes active and the first CCW is read. The end-of-queue is recognized, the completion flag is set, and the queue becomes idle. A conversion is not performed. * BQ2 (beginning of queue 2) is set at the end of the CCW table (63) and a trigger event occurs on queue 2. Refer to Section 13.3.7, "Control Register 2 (QACR2)," for more information on BQ2. The end-of-queue condition is recognized, a conversion is performed, the completion flag is set, and the queue becomes idle. * BQ2 is set to CCW0 and a trigger event occurs on queue 1. After reading CCW0, the end-of-queue condition is recognized, the completion flag is set, and the queue becomes idle. A conversion is not performed. * BQ2 is set beyond the end of the CCW table (64 - 127) and a trigger event occurs on queue 2. The end-of-queue condition is recognized immediately, the completion flag is set, and the queue becomes idle. A conversion is not performed. NOTE Multiple end-of-queue conditions may be recognized simultaneously, although there is no change in the QADC64E behavior. For example, if BQ2 is set to CCW0, CCW0 contains the EOQ code, and a trigger event occurs on queue 1, the QADC64E reads CCW0 and detects both end-of-queue conditions. The completion flag is set and queue 1 becomes idle. Boundary conditions also exist for combinations of pause and end-of-queue. One case is when a pause bit is in one CCW and an end-of-queue condition is in the next CCW. The conversion specified by the CCW with the pause bit set completes normally. The pause flag is set. However, since the end-of-queue condition is recognized, the completion flag is also set and the queue status becomes idle, not paused. Examples of this situation include: * The pause bit is set in CCW5 and the EOQ code is in CCW6 * The pause is set in CCW63 * During queue 1 operation, the pause bit is set in CCW20 and BQ2 points to CCW21 Another pause and end-of-queue boundary condition occurs when the pause and an end-of-queue condition occur in the same CCW. Both the pause and end-of-queue conditions are recognized simultaneously. The end-of-queue condition has precedence so a conversion is not performed for the CCW MPC561/MPC563 Reference Manual, Rev. 1.2 13-40 Freescale Semiconductor QADC64E Legacy Mode Operation and the pause flag is not set. The QADC64E sets the completion flag and the queue status becomes idle. Examples of this situation are: * The pause bit is set in CCW10 and EOQ is programmed into CCW10 * During queue 1 operation, the pause bit set in CCW32, which is also BQ2 13.5.4 Scan Modes The QADC64E queuing mechanism allows the application to utilize different requirements for automatically scanning input channels. In single-scan mode, a single pass through a sequence of conversions defined by a queue is performed. In continuous-scan mode, multiple passes through a sequence of conversions defined by a queue are executed. The possible modes are: * Disabled and reserved mode * Single-scan modes -- Software initiated single-scan mode -- External trigger single-scan mode -- External gated single-scan mode -- Periodic/Interval timer single-scan mode * Continuous-scan modes -- Software initiated continuous-scan mode -- External trigger continuous-scan mode -- External gated continuous-scan mode -- Periodic/Interval timer continuous-scan mode The following paragraphs describe single-scan and continuous-scan operations. 13.5.4.1 Disabled Mode When the disabled mode is selected, the queue is not active. Trigger events cannot initiate queue execution. When both queue 1 and queue 2 are disabled, wait states are not encountered for IMB3 accesses of the RAM. When both queues are disabled, it is safe to change the QCLK prescaler values. 13.5.4.2 Reserved Mode Reserved mode allows for future mode definitions. When the reserved mode is selected, the queue is not active. It functions the same as disabled mode. CAUTION Do not use a reserved mode. Unspecified operations may result. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-41 QADC64E Legacy Mode Operation 13.5.4.3 Single-Scan Modes When the application software wants to execute a single pass through a sequence of conversions defined by a queue, a single-scan queue operating mode is selected. By programming the MQ field in QACR1 or QACR2, the following modes can be selected: * Software initiated single-scan mode * External trigger single-scan mode * External gated single-scan mode * Periodic/Interval timer single-scan mode NOTE Queue 2 cannot be programmed for external gated single-scan mode. In all single-scan queue operating modes, the software must also enable the queue to begin execution by writing the single-scan enable bit to a one in the queue's control register. The single-scan enable bits, SSE1 and SSE2, are provided for queue 1 and queue 2 respectively. Until the single-scan enable bit is set, any trigger events for that queue are ignored. The single-scan enable bit may be set to a one during the write cycle, which selects the single-scan queue operating mode. The single-scan enable bit is set through software, but will always read as a zero. Once set, writing the single-scan enable bit to zero has no effect. Only the QADC64E can clear the single-scan enable bit. The completion flag, completion interrupt, or queue status are used to determine when the queue has completed. After the single-scan enable bit is set, a trigger event causes the QADC64E to begin execution with the first CCW in the queue. The single-scan enable bit remains set until the queue is completed. After the queue reaches completion, the QADC64E resets the single-scan enable bit to zero. If the single-scan enable bit is written to a one or a zero by the software before the queue scan is complete, the queue is not affected. However, if the software changes the queue operating mode, the new queue operating mode and the value of the single-scan enable bit are recognized immediately. The conversion in progress is aborted and the new queue operating mode takes effect. In the software-initiated single-scan mode, the writing of a one to the single-scan enable bit causes the QADC64E to internally generate a trigger event and the queue execution begins immediately. In the other single-scan queue operating modes, once the single-scan enable bit is written, the selected trigger event must occur before the queue can start. The single-scan enable bit allows the entire queue to be scanned once. A trigger overrun is captured if a trigger event occurs during queue execution in an edge-sensitive external trigger mode or a periodic/interval timer mode. In the periodic/interval timer single-scan mode, the next expiration of the timer is the trigger event for the queue. After the queue execution is complete, the queue status is shown as idle. The software can restart the queue by setting the single-scan enable bit to a one. Queue execution begins with the first CCW in the queue. 13.5.4.3.1 Software Initiated Single-Scan Mode Software can initiate the execution of a scan sequence for queue 1 or 2 by selecting the software initiated single-scan mode, and writing the single-scan enable bit in QACR1 or QACR2. A trigger event is MPC561/MPC563 Reference Manual, Rev. 1.2 13-42 Freescale Semiconductor QADC64E Legacy Mode Operation generated internally and the QADC64E immediately begins execution of the first CCW in the queue. If a pause occurs, another trigger event is generated internally, and then execution continues without pausing. The QADC64E automatically performs the conversions in the queue until an end-of-queue condition is encountered. The queue remains idle until the software again sets the single-scan enable bit. While the time to internally generate and act on a trigger event is very short, software can momentarily read the status conditions, indicating that the queue is paused. The trigger overrun flag is never set while in the software initiated single-scan mode. The software initiated single-scan mode is useful in the following applications: * Allows software complete control of the queue execution * Allows the software to easily alternate between several queue sequences. 13.5.4.3.2 External Trigger Single-Scan Mode The external trigger single-scan mode is available on both queue 1 and queue 2. The software programs the polarity of the external trigger edge that is to be detected, either a rising or a falling edge. The software must enable the scan to occur by setting the single-scan enable bit for the queue. The first external trigger edge causes the queue to be executed one time. Each CCW is read and the indicated conversions are performed until an end-of-queue condition is encountered. After the queue is completed, the QADC64E clears the single-scan enable bit. Software may set the single-scan enable bit again to allow another scan of the queue to be initiated by the next external trigger edge. The external trigger single-scan mode is useful when the input trigger rate can exceed the queue execution rate. Analog samples can be taken in sync with an external event, even though the software is not interested in data taken from every edge. The software can start the external trigger single-scan mode and get one set of data, and at a later time, start the queue again for the next set of samples. When a pause bit is encountered during external trigger single-scan mode, another trigger event is required for queue execution to continue. Software involvement is not needed to enable queue execution to continue from the paused state. 13.5.4.3.3 External Gated Single-Scan Mode The QADC64E provides external gating for queue 1 only. When external gated single-scan mode is selected, the input level on the associated external trigger signal enables and disables queue execution. The polarity of the external gated signal is fixed so only a high level opens the gate and a low level closes the gate. Once the gate is open, each CCW is read and the indicated conversions are performed until the gate is closed. Software must enable the scan to occur by setting the single-scan enable bit for queue 1. If a pause in a CCW is encountered, the pause flag will not set, and execution continues without pausing. While the gate is open, queue 1 executes one time. Each CCW is read and the indicated conversions are performed until an end-of-queue condition is encountered. When queue 1 completes, the QADC64E sets the completion flag (CF1) and clears the single-scan enable bit. Software may set the single-scan enable bit again to allow another scan of queue 1 to be initiated during the next open gate. If the gate closes before queue 1 completes execution, the current CCW completes, execution of queue 1 stops, the single-scan enable bit is cleared, and the PF1 bit is set. Software can read the CWPQ1 to MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-43 QADC64E Legacy Mode Operation determine the last valid conversion in the queue. Software must set the single-scan enable bit again and should clear the PF1 bit before another scan of queue 1 is initiated during the next open gate. The start of queue 1 is always the first CCW in the CCW table. Since the condition of the gate is only sampled after each conversion during queue execution, closing the gate for a period less than a conversion time interval does not guarantee the closure will be captured. 13.5.4.3.4 Periodic/Interval Timer Single-Scan Mode Both queues can use the periodic/interval timer in a single-scan queue operating mode. The timer interval can range from 128- to 128-Kbyte QCLK cycles in binary multiples. When the periodic/ interval timer single-scan mode is selected and the software sets the single-scan enable bit in QACR1 or QACR2, the timer begins counting. When the time interval elapses, an internal trigger event is created to start the queue and the QADC64E begins execution with the first CCW. The QADC64E automatically performs the conversions in the queue until a pause or an end-of-queue condition is encountered. When a pause occurs, queue execution stops until the timer interval elapses again, and then queue execution continues. When the queue execution reaches an end-of-queue situation, the single-scan enable bit is cleared. Software may set the single-scan enable bit again, allowing another scan of the queue to be initiated by the periodic/interval timer. The periodic/interval timer generates a trigger event whenever the time interval elapses. The trigger event may cause the queue execution to continue following a pause, or may be considered a trigger overrun. Once the queue execution is completed, the single-scan enable bit must be set again to enable the timer to count again. Normally only one queue will be enabled for periodic/interval timer single-scan mode and the timer will reset at the end-of-queue. However, if both queues are enabled for either single-scan or continuous periodic/interval timer mode, the end-of-queue condition will not reset the timer while the other queue is active. In this case, the timer will reset when both queues have reached end-of-queue. See Section 13.5.6, "Periodic / Interval Timer" for a definition of periodic/interval timer reset conditions. The periodic/interval timer single-scan mode can be used in applications which need coherent results, for example: * When it is necessary that all samples are guaranteed to be taken during the same scan of the analog signals * When the interrupt rate in the periodic/interval timer continuous-scan mode would be too high * In sensitive battery applications, where the single-scan mode uses less power than the software initiated continuous-scan mode 13.5.4.4 Continuous-Scan Modes When the application software wants to execute multiple passes through a sequence of conversions defined by a queue, a continuous-scan queue operating mode is selected. By programming the MQ1 field in QACR1 or the MQ2 field in QACR2, the following software initiated modes can be selected: * Software initiated continuous-scan mode MPC561/MPC563 Reference Manual, Rev. 1.2 13-44 Freescale Semiconductor QADC64E Legacy Mode Operation * * * External trigger continuous-scan mode External gated continuous-scan mode Periodic/interval timer continuous-scan mode When a queue is programmed for a continuous-scan mode, the single-scan enable bit in the queue control register does not have any meaning or effect. As soon as the queue operating mode is programmed, the selected trigger event can initiate queue execution. In the case of the software-initiated continuous-scan mode, the trigger event is generated internally and queue execution begins immediately. In the other continuous-scan queue operating modes, the selected trigger event must occur before the queue can start. A trigger overrun is captured if a trigger event occurs during queue execution in the external trigger continuous-scan mode and the periodic/interval timer continuous-scan mode. After the queue execution is complete, the queue status is shown as idle. Since the continuous-scan queue operating modes allow the entire queue to be scanned multiple times, software involvement is not needed to enable queue execution to continue from the idle state. The next trigger event causes queue execution to begin again, starting with the first CCW in the queue. NOTE Coherent samples are guaranteed. The time between consecutive conversions has been designed to be consistent. However, there is one exception. For queues that end with a CCW containing EOQ code (channel 63), the last queue conversion to the first queue conversion requires 1 additional CCW fetch cycle. Therefore continuous samples are not coherent at this boundary. In addition, the time from trigger to first conversion cannot be guaranteed since it is a function of clock synchronization, programmable trigger events, queue priorities, and so on. 13.5.4.4.1 Software Initiated Continuous-Scan Mode When the software initiated continuous-scan mode is programmed, the trigger event is generated automatically by the QADC64E. Queue execution begins immediately. If a pause is encountered, another trigger event is generated internally, and then execution continues without pausing. When the end-of-queue is reached, another internal trigger event is generated, and queue execution begins again from the beginning of the queue. While the time to internally generate and act on a trigger event is very short, software can momentarily read the status conditions, indicating that the queue is idle. The trigger overrun flag is never set while in the software-initiated continuous-scan mode. The software initiated continuous-scan mode keeps the result registers updated more frequently than any of the other queue operating modes. The software can always read the result table to get the latest converted value for each channel. The channels scanned are kept up to date by the QADC64E without software involvement. Software can read a result value at any time. The software initiated continuous-scan mode may be chosen for either queue, but is normally used only with queue 2. When the software initiated continuous-scan mode is chosen for queue 1, that queue operates MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-45 QADC64E Legacy Mode Operation continuously and queue 2, being lower in priority, never gets executed. The short interval of time between a queue 1 completion and the subsequent trigger event is not sufficient to allow queue 2 execution to begin. The software initiated continuous-scan mode is a useful choice with queue 2 for converting channels that do not need to be synchronized to anything, or for the slow-to-change analog channels. Interrupts are normally not used with the software initiated continuous-scan mode. Rather, the software reads the latest conversion result from the result table at any time. Once initiated, software action is not needed to sustain conversions of channel. 13.5.4.4.2 External Trigger Continuous-Scan Mode The QADC64E provides external trigger signals for both queues. When the external trigger software initiated continuous-scan mode is selected, a transition on the associated external trigger signal initiates queue execution. The polarity of the external trigger signal is programmable, so that the software can select a mode which begins queue execution on the rising or falling edge. Each CCW is read and the indicated conversions are performed until an end-of-queue condition is encountered. When the next external trigger edge is detected, the queue execution begins again automatically. Software initialization is not needed between trigger events. When a pause bit is encountered in external trigger continuous-scan mode, another trigger event is required for queue execution to continue. Software involvement is not needed to enable queue execution to continue from the paused state. Some applications need to synchronize the sampling of analog channels to external events. There are cases when it is not possible to use software initiation of the queue scan sequence, since interrupt response times vary. 13.5.4.4.3 External Gated Continuous-Scan Mode The QADC64E provides external gating for queue 1 only. When external gated continuous-scan mode is selected, the input level on the associated external trigger signal enables and disables queue execution. The polarity of the external gated signal is fixed so a high level opens the gate and a low level closes the gate. Once the gate is open, each CCW is read and the indicated conversions are performed until the gate is closed. When the gate opens again, the queue execution automatically begins again from the beginning of the queue. Software initialization is not needed between trigger events. If a pause in a CCW is encountered, the pause flag will not set, and execution continues without pausing. The purpose of external gated continuous-scan mode is to continuously collect digitized samples while the gate is open and to have the most recent samples available. It is up to the programmer to ensure that the queue is large enough so that a maximum gate open time will not reach an end-of-queue. However it is useful to take advantage of a smaller queue in the manner described in the next paragraph. In the event that the queue completes before the gate closes, a completion flag will be set and the queue will roll over to the beginning and continue conversions until the gate closes. If the gate remains open and the completion flag is not cleared, when the queue completes a second time the trigger overrun flag will be set and the queue will roll-over again. The queue will continue to execute until the gate closes or the mode is disabled. MPC561/MPC563 Reference Manual, Rev. 1.2 13-46 Freescale Semiconductor QADC64E Legacy Mode Operation If the gate closes before queue 1 completes execution, the current CCW completes execution of queue 1 stops and QADC64E sets the PF1 bit to indicate an incomplete queue. Software can read the CWPQ1 to determine the last valid conversion in the queue. In this mode, if the gate opens again, execution of queue 1 begins again. The start of queue 1 is always the first CCW in the CCW table. Since the condition of the gate is only sampled after each conversion during queue execution, closing the gate for a period less than a conversion time interval does not guarantee the closure will be captured. 13.5.4.4.4 Periodic/Interval Timer Continuous-Scan Mode The QADC64E includes a dedicated periodic/interval timer for initiating a scan sequence on queue 1 and/or queue 2. Software selects a programmable timer interval ranging from 128 to 128 Kbytes times the QCLK period in binary multiples. The QCLK period is prescaled down from the IMB3 MCU clock. When a periodic/interval timer continuous-scan mode is selected for queue 1 and/or queue 2, the timer begins counting. After the programmed interval elapses, the timer generated trigger event starts the appropriate queue. Meanwhile, the QADC64E automatically performs the conversions in the queue until an end-of-queue condition or a pause is encountered. When a pause occurs, the QADC64E waits for the periodic interval to expire again, then continues with the queue. Once end-of-queue has been detected, the next trigger event causes queue execution to begin again with the first CCW in the queue. The periodic/interval timer generates a trigger event whenever the time interval elapses. The trigger event may cause the queue execution to continue following a pause or queue completion, or may be considered a trigger overrun. As with all continuous-scan queue operating modes, software action is not needed between trigger events. Since both queues may be triggered by the periodic/interval timer, see Section 13.5.6, "Periodic / Interval Timer" for a summary of periodic/interval timer reset conditions. Software enables the completion interrupt when using the periodic/interval timer continuous-scan mode. When the interrupt occurs, the software knows that the periodically collected analog results have just been taken. The software can use the periodic interrupt to obtain non-analog inputs as well, such as contact closures, as part of a periodic look at all inputs. 13.5.5 QADC64E Clock (QCLK) Generation Figure 13-24 is a block diagram of the clock subsystem. The QCLK provides the timing for the A/D converter state machine which controls the timing of the conversion. The QCLK is also the input to a 17-stage binary divider which implements the periodic/interval timer. To retain the specified analog conversion accuracy, the QCLK frequency (FQCLK) must be within the tolerance specified in Appendix F, "Electrical Characteristics." Before using the QADC64E, the software must initialize the prescaler with values that put the QCLK within the specified range. Though most software applications initialize the prescaler once and do not change it, write operations to the prescaler fields are permitted. For software compatibility with earlier versions of QADC64E, the definition of PSL, PSH, and PSA have been maintained. However, the requirements on minimum time and minimum low time no longer exist. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-47 QADC64E Legacy Mode Operation NOTE A change in the prescaler value while a conversion is in progress is likely to corrupt the result from any conversion in progress. Therefore, any prescaler write operation should be done only when both queues are in the disabled modes. Reset QCLK Zero Detect 5 IMB3 Clock (FSYS) 5-Bit Down Counter 5 Load PSH 3 Prescaler Rate Selection (From Control Register 0): One's Complement Compare High Time Cycles (PSH) Low Time Cycles (PSL) QCLK Clock Generate Set QCLK 3 QADC64E Clock (FSYS/ 2 to FSYS//40 ) 2 Input Sample Time from (CCW) A/D Converter State Machine SAR Control SAR 10 Binary Counter 27 28 29 210 211212213214 215216217 Queue 1 & 2 Timer Mode Rate Selection 8 PERIODIC/INTERVAL Timer Select 2 Periodic / Interval Trigger Event for Q1 AND Q2 Figure 13-24. QADC64E Clock Subsystem Functions To accommodate wide variations of the main MCU clock frequency (IMB3 clock -- fSYS), QCLK is generated by a programmable prescaler which divides the MCU IMB3 clock to a frequency within the specified QCLK tolerance range. To allow the A/D conversion time to be maximized across the spectrum of IMB3 clock frequencies, the QADC64E prescaler permits the frequency of QCLK to be software selectable. It also allows the duty cycle of the QCLK waveform to be programmable. The software establishes the basic high phase of the QCLK waveform with the PSH (prescaler clock high time) field in QACR0, and selects the basic low phase of QCLK with the prescaler clock low time (PSL) field. The combination of the PSH and PSL parameters establishes the frequency of the QCLK. MPC561/MPC563 Reference Manual, Rev. 1.2 13-48 Freescale Semiconductor QADC64E Legacy Mode Operation NOTE The guideline for selecting PSH and PSL is select is to maintain approximately 50% duty cycle. So for prescaler values less then 16, or PSH ~= PSL. For prescaler values greater than 16 keep PSL as large as possible. Figure 13-24 shows that the prescaler is essentially a variable pulse width signal generator. A 5-bit down counter, clocked at the IMB3 clock rate, is used to create both the high phase and the low phase of the QCLK signal. At the beginning of the high phase, the 5-bit counter is loaded with the 5-bit PSH value. When the zero detector finds that the high phase is finished, the QCLK is reset. A 3-bit comparator looks for a one's complement match with the 3-bit PSL value, which is the end of the low phase of the QCLK. The PSA bit was maintained for software compatibility, but has no effect on QADC64E. The following equations define QCLK frequency: High QCLK Time = (PSH + 1) / fSYS Low QCLK Time = (PSL + 1) / fSYS FQCLK= 1 / (High QCLK Time + Low QCLK Time) Where: * PSH = 0 to 31, the prescaler QCLK high cycles in QACR0 * PSL = 0 to 7, the prescaler QCLK low cycles in QACR0 * fSYS = IMB3 clock frequency * FQCLK = QCLK frequency The following are equations for calculating the QCLK high/low phases in Example 1: High QCLK Time = (19 + 1) / 56 x 106 = 357 ns Low QCLK Time = (7 + 1) / 56 x 106 = 143 ns FQCLK = 1/(357 + 143) = 2 MHz The following are equations for calculating the QCLK high/low phases in Example 2: High QCLK Time = (11 + 1) / 40 x 106 = 300 ns Low QCLK Time = (7 + 1) / 40 x 106 = 200 ns FQCLK = 1/(300 + 200) = 2 MHz The following are equations for calculating the QCLK high/low phases in Example 3: High QCLK Time = (7 + 1) / 32 x 106 = 250 ns Low QCLK Time = (7 + 1) / 32 x 106 = 250 ns FQCLK = 1/(250 + 250) = 2 MHz Figure 13-25 and Table 13-21 show examples of QCLK programmability. The examples include conversion times based on the following assumption: * Input sample time is as fast as possible (IST = 0, 2 QCLK cycles). Figure 13-25 and Table 13-21 also show the conversion time calculated for a single conversion in a queue. For other MCU IMB3 clock frequencies and other input sample times, the same calculations can be made. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-49 QADC64E Legacy Mode Operation IMB3 CLOCK FSYS QCLK EXAMPLES 56 MHz EX1 40 MHz EX2 32 MHz EX3 30 CYCLES QADC64E QCLK EX Figure 13-25. QADC64E Clock Programmability Examples Table 13-21. QADC64E Clock Programmability Control Register 0 Information Input Sample Time (IST) =0b00 Example Number Frequency PSH PSA PSL QCLK (MHz) Conversion Time (s) 1 56 MHz 19 0 7 2.0 7.0 2 40 MHz 11 0 7 2.0 7.0 3 32 MHz 7 0 7 2.0 7.0 NOTE PSA is maintained for software compatibility but has no functional benefit to this version of the module. The MCU IMB3 clock frequency is the basis of the QADC64E timing. The QADC64E requires that the IMB3 clock frequency be at least twice the QCLK frequency. The QCLK frequency is established by the combination of the PSH and PSL parameters in QACR0. The 5-bit PSH field selects the number of IMB3 clock cycles in the high phase of the QCLK wave. The 3-bit PSL field selects the number of IMB3 clock cycles in the low phase of the QCLK wave. Example 1 in Table 13-21 shows that when the PSH = 19, the QCLK remains high for 20 cycles if the IMB3 clock and with PSL = 7 the QCLK remains low for 8 IMB3 clock cycles. Example 2 shows that when PSH = 11, QCLK is high for 12 IMB3 clock cycles and with PSL = 7, QCLK is low for 8 IMB3 clock cycles. Finally, example 3 shows that with PSH = 7 and PSL = 7, QCLK alternates between high and low every 8 IMB3 cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 13-50 Freescale Semiconductor QADC64E Legacy Mode Operation 13.5.6 Periodic / Interval Timer The on-chip periodic/interval timer can be used to generate trigger events at a programmable interval, initiating execution of queue 1 and/or queue 2. The periodic/interval timer stays reset under the following conditions: * Both queue 1 and queue 2 are programmed to any mode which does not use the periodic/interval timer * IMB3 system reset or the master reset is asserted * Stop mode is selected * Freeze mode is selected NOTE Interval timer single-scan mode does not use the periodic/interval timer until the single-scan enable bit is set. The following two conditions will cause a pulsed reset of the periodic/interval timer during use: * A queue 1 operating mode change to a mode which uses the periodic/interval timer, even if queue 2 is already using the timer * A queue 2 operating mode change to a mode which uses the periodic/interval timer, provided queue 1 is not in a mode which uses the periodic/interval timer * Roll over of the timer During the low power stop mode, the periodic timer is held in reset. Since low power stop mode causes QACR1 and QACR2 to be reset to zero, a valid periodic or interval timer mode must be written after stop mode is exited to release the timer from reset. When the IMB3 internal FREEZE line is asserted and a periodic or interval timer mode is selected, the timer counter is reset after the conversion in progress completes. When the periodic or interval timer mode has been enabled (the timer is counting), but a trigger event has not been issued, the freeze mode takes effect immediately, and the timer is held in reset. When the internal FREEZE line is negated, the timer counter starts counting from the beginning. Refer to Section 13.5.7, "Configuration and Control Using the IMB3 Interface," for more information. 13.5.7 Configuration and Control Using the IMB3 Interface The QADC64E module communicates with other microcontroller modules via the IMB3. The QADC64E bus interface unit (BIU) coordinates IMB3 activity with internal QADC64E bus activity. This section describes the operation of the BIU, IMB3 read/write accesses to QADC64E memory locations, module configuration, and general-purpose I/O operation. 13.5.7.1 QADC64E Bus Interface Unit The BIU is designed to act as a slave device on the IMB3. The BIU has the following functions: * Respond with the appropriate bus cycle termination * Supply IMB3 interface timing to all internal module signals MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-51 QADC64E Legacy Mode Operation BIU components consist of: * IMB3 buffers * Address match and module select logic * The BIU state machine * Clock prescaler logic * Data bus routing logic * Interface to the internal module data bus NOTE Normal accesses from the IMB3 to the QADC64E require two clocks. However, if the CPU tries to access table locations while the QADC64E is accessing them, the QADC64E produces IMB3 wait states. From one to four IMB3 wait states may be inserted by the QADC64E in the process of reading and writing. 13.5.7.2 QADC64E Bus Accessing The QADC64E supports 8-bit, 16-bit, and 32-bit data transfers, at even and odd addresses. Coherency of results read (ensuring that all results read were taken consecutively in one scan) is not guaranteed. For example, if a read of two consecutive 16-bit locations in a result area is made, the QADC64E could change one 16-bit location in the result area between the bus cycles. There is no holding register for the second 16-bit location. All read and write accesses that require more than one 16-bit access to complete occur as two or more independent bus cycles. Depending on bus master protocol, these accesses could include misaligned and 32-bit accesses. Figure 13-26 shows the three bus cycles which are implemented by the QADC64E. The following paragraphs describe how the three types of accesses are used, including misaligned 16-bit and 32-bit accesses. MPC561/MPC563 Reference Manual, Rev. 1.2 13-52 Freescale Semiconductor QADC64E Legacy Mode Operation W Intermodule Bus QADC Location R W R Byte 0 Byte 1 Byte 0 Byte 1 8-bit Access of an Even Address (ISIZ = 01, A0 = 0) W Intermodule Bus QADC Location R W R Byte 0 Byte 1 Byte 0 Byte 1 8-bit Access of an Odd Address (ISIZ = 01, A0 = 1; OR ISIZ = 10, A0 = 1) W Intermodule Bus QADC Location R W R BYTE 0 BYTE 1 BYTE 0 BYTE 1 16-Bit Aligned Access (ISIZ = 10, A0 = 0) QADC64E Bus CYC ACC Figure 13-26. Bus Cycle Accesses Byte access to an even address of a QADC64E location is shown in the top illustration of Figure 13-26. In the case of write cycles, byte 1 of the register is not disturbed. In the case of a read cycle, the QADC64E provides both byte 0 and byte 1. Byte access to an odd address of a QADC64E location is shown in the center illustration of Figure 13-26. In the case of write cycles, byte 0 of the register is not disturbed. In the case of read cycles, the QADC64E provides both byte 0 and byte 1. 16-bit accesses to an even address read or write byte 0 and byte 1 as shown in the lowest illustration of Figure 13-26. The full 16 bits of data is written to and read from the QADC64E location with each access. 16-bit accesses to an odd address require two bus cycles; one byte of two different 16-bit QADC64E locations is accessed. The first bus cycle is treated by the QADC64E as an 8-bit read or write of an odd address. The second cycle is an 8-bit read or write of an even address. The QADC64E address space is organized into 16-bit even address locations, so a 16-bit read or write of an odd address obtains or provides the lower half of one QADC64E location, and the upper half of the following QADC64E location. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-53 QADC64E Legacy Mode Operation 32-bit accesses to an even address require two bus cycles to complete the access, and two full 16-bit QADC64E locations are accessed. The first bus cycle reads or writes the addressed 16-bit QADC64E location and the second cycle reads or writes the following 16-bit location. 32-bit accesses to an odd address require three bus cycles. Portions of three different QADC64E locations are accessed. The first bus cycle is treated by the QADC64E as an 8-bit access of an odd address, the second cycle is a 16-bit aligned access, and the third cycle is an 8-bit access of an even address. The QADC64E address space is organized into 16-bit even address locations, so a 32-bit read or write of an odd address provides the lower half of one QADC64E location, the full 16-bit content of the following QADC64E location, and the upper half of the third QADC64E location. 13.6 Trigger and Queue Interaction Examples This section contains examples describing queue priority and conversion timing schemes. 13.6.1 Queue Priority Schemes Since there are two conversion command queues and only one A/D converter, there is a priority scheme to determine which conversion is to occur. Each queue has a variety of trigger events that are intended to initiate conversions, and they can occur asynchronously in relation to each other and other conversions in progress. For example, a queue can be idle awaiting a trigger event, a trigger event can have occurred but the first conversion has not started, a conversion can be in progress, a pause condition can exist awaiting another trigger event to continue the queue, and so on. The following paragraphs and figures outline the prioritizing criteria used to determine which conversion occurs in each overlap situation. NOTE The situations in Figure 13-27 through Figure 13-45 are labeled S1 through S19. In each diagram, time is shown increasing from left to right. The execution of queue 1 and queue 2 (Q1 and Q2) is shown as a string of rectangles representing the execution time of each CCW in the queue. In most of the situations, there are four CCWs (labeled C1 to C4) in both queue 1 and queue 2. In some of the situations, CCW C2 is presumed to have the pause bit set, to show the similarities of pause and end-of-queue as terminations of queue execution. Trigger events are described in Table 13-22. Table 13-22. Trigger Events Trigger Events T1 Events that trigger queue 1 execution (external trigger, software initiated single-scan enable bit, or completion of the previous continuous loop) T2 Events that trigger queue 2 execution (external trigger, software initiated single-scan enable bit, timer period/interval expired, or completion of the previous continuous loop) MPC561/MPC563 Reference Manual, Rev. 1.2 13-54 Freescale Semiconductor QADC64E Legacy Mode Operation When a trigger event causes a CCW execution in progress to be aborted, the aborted conversion is shown as a ragged end of a shortened CCW rectangle. The situation diagrams also show when key status bits are set. Table 13-23 describes the status bits. Table 13-23. Status Bits Bit Function CF Flag Set when the end of the queue is reached PF Flag Set when a queue completes execution up through a pause bit Trigger Overrun Error (TOR) Set when a new trigger event occurs before the queue is finished serving the previous trigger event Below the queue execution flows are three sets of blocks that show the status information that is made available to the software. The first two rows of status blocks show the condition of each queue as: * Idle * Active * Pause * Suspended (queue 2 only) * Trigger pending The third row of status blocks shows the 4-bit QS status register field that encodes the condition of the two queues. Two transition status cases, QS = 0011 and QS = 0111, are not shown because they exist only very briefly between stable status conditions. The first three examples in Figure 13-27 through Figure 13-29 (S1, S2, and S3) show what happens when a new trigger event is recognized before the queue has completed servicing the previous trigger event on the same queue. In situation S1 (Figure 13-27), one trigger event is being recognized on each queue while that queue is still working on the previously recognized trigger event. The trigger overrun error status bit is set, and otherwise, the premature trigger event is ignored. A trigger event that occurs before the servicing of the previous trigger event is completed does not disturb the queue execution in progress. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-55 QADC64E Legacy Mode Operation T1 Q1: T1 C1 C2 C3 TOR1 C4 T2 CF1 Q2: T2 C1 C2 C3 TOR2 IDLE Q1 IDLE 0000 QS CF2 IDLE ACTIVE Q2 C4 IDLE ACTIVE 1000 0000 0010 0000 QADC S1 Figure 13-27. CCW Priority Situation 1 In situation S2 (Figure 13-27), more than one trigger event is recognized before servicing of a previous trigger event is complete, the trigger overrun bit is again set, but otherwise, the additional trigger events are ignored. After the queue is complete, the first newly detected trigger event causes queue execution to begin again. When the trigger event rate is high, a new trigger event can be seen very soon after completion of the previous queue, leaving software little time to retrieve the previous results. Also, when trigger events are occurring at a high rate for queue 1, the lower priority queue 2 channels may not get serviced at all. T1 T1 Q1: C1 T1 C2 T1 C3 T1 C4 C1 C2 C3 TOR1TOR1TOR1 CF1 C4 CF1 T2 T2 T2 Q2: C1 C2 C3 C4 TOR2TOR2 Q1 IDLE ACTIVE IDLE ACTIVE IDLE Q2 QS IDLE 1000 1000 CF2 0000 ACTIVE IDLE 0010 0000 QADC S2 Figure 13-28. CCW Priority Situation 2 Situation S3 (Figure 13-28) shows that when the pause feature is in use, the trigger overrun error status bit is set the same way, and that queue execution continues unchanged. MPC561/MPC563 Reference Manual, Rev. 1.2 13-56 Freescale Semiconductor QADC64E Legacy Mode Operation T1 Q1: T1 C1 T1 C2 T1 C3 TOR1 PF1 T2 Q2: T2 C1 C4 TOR1 CF1 T2 C2 T2 C3 TOR2 PF2 Q1 IDLE 0000 TOR2 CF2 PAUSE ACTIVE 1000 0100 IDLE ACTIVE PAUSE IDLE Q2 QS ACTIVE 0110 C4 0101 ACTIVE IDLE 0010 0000 0001 1001 QADC S3 Figure 13-29. CCW Priority Situation 3 The next two situations consider trigger events that occur for the lower priority queue 2, while queue 1 is actively being serviced. Situation S4 (Figure 13-30) shows that a queue 2 trigger event that is recognized while queue 1 is active is saved, and as soon as queue 1 is finished, queue 2 servicing begins. T1 Q1: C1 C2 C3 C4 CF1 T2 C1 Q2: C2 C3 C4 CF2 Q1 IDLE IDLE Q2 QS 0000 IDLE ACTIVE 1000 TRIGGERED ACTIVE IDLE 1011 0010 0000 QADC S4 Figure 13-30. CCW Priority Situation 4 Situation S5 (Figure 13-31) shows that when multiple queue 2 trigger events are detected while queue 1 is busy, the trigger overrun error bit is set, but queue 1 execution is not disturbed. Situation S5 also shows that the effect of queue 2 trigger events during queue 1 execution is the same when the pause feature is in use in either queue. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-57 QADC64E Legacy Mode Operation T1 Q1: T1 C1 C2 C3 T2 T2 T2 T2 PF1 Q2: C1 Q2 QS IDLE 1000 1011 ACTIVE CF2 IDLE ACTIVE ACTIVE PAUSE TRIG 0101 1001 1011 0110 C4 TOR2 PAUSE TRIG 0000 C3 PF2 ACTIVE IDLE CF1 C2 TOR2 Q1 C4 ACTIVE IDLE 0010 0000 QADC S5 Figure 13-31. CCW Priority Situation 5 The remaining situations, S6 through S11, show the impact of a queue 1 trigger event occurring during queue 2 execution. Queue 1 is higher in priority the conversion taking place in queue 2 is aborted, so that there is not a variable latency time in responding to queue 1 trigger events. In situation S6 (Figure 13-32), the conversion initiated by the second CCW in queue 2 is aborted just before the conversion is complete, so that queue 1 execution can begin. Queue 2 is considered suspended. After queue 1 is finished, queue 2 starts over with the first CCW, when the RES (resume) control bit is set to 0. Situation S7 (Figure 13-33) shows that when pause operation is not in use with queue 2, queue 2 suspension works the same way. T1 Q1: T1 C1 C2 C3 C4 T2 PF1 Q2: C1 CF1 C1 C2 RESUME=0 C2 C3 C4 CF2 Q1 Q2 QS IDLE ACTIVE PAUSE IDLE 0000 ACTIVE ACTIVE ACTIVE SUSPEND 1000 0100 0110 1010 IDLE ACTIVE 0010 IDLE 0000 QADC S6 Figure 13-32. CCW Priority Situation 6 MPC561/MPC563 Reference Manual, Rev. 1.2 13-58 Freescale Semiconductor QADC64E Legacy Mode Operation T1 Q1: T1 C1 C2 T2 Q2: C3 PF1 C1 C2 C4 T2 C1 CF1 C3 C2 C3 C4 PF2 IDLE Q1 ACTIVE CF2 PAUSE Q2 IDLE ACTIVE SUSPEND QS 0000 0010 1010 RESUME=0 IDLE ACTIVE ACTIVE PAUSEACT SUSPEND ACTIVE IDLE 0101 0110 0010 0000 0110 1010 QADC S7 Figure 13-33. CCW Priority Situation 7 Situations S8 and S9 (Figure 13-34 and Figure 13-35) repeat the same two situations with the resume bit set to a one. When the RES bit is set, following suspension, queue 2 resumes execution with the aborted CCW, not the first CCW in the queue. T1 Q1: T1 C1 C2 C3 T2 PF1 Q2: C1 C4 CF1 C2 C2 RESUME=1 C3 C4 CF2 Q1 IDLE PAUSE IDLE Q2 QS ACTIVE 0000 ACTIVE ACTIVE ACTIVE SUSPEND 1000 0100 0110 1010 IDLE ACTIVE IDLE 0010 0000 QADC S8 Figure 13-34. CCW Priority Situation 8 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-59 QADC64E Legacy Mode Operation T1 Q1: T1 C1 C2 T2 Q2: C3 PF1 C1 C1 C2 C4 T2 CF1 C3 C2 C4 C4 PF2 ACTIVE IDLE Q1 Q2 IDLE ACTIVE QS 0000 0010 RESUME=1 CF2 IDLE ACTIVE PAUSE IDLE SUSPEND ACT PAUSE ACTIVE SUSPEND ACT 0110 0110 0101 1010 1010 0000 0010 QADC S9 Figure 13-35. CCW Priority Situation 9 Situations S10 and S11 (Figure 13-36 and Figure 13-37) show that when an additional trigger event is detected for queue 2 while the queue is suspended, the trigger overrun error bit is set, the same as if queue 2 were being executed when a new trigger event occurs. Trigger overrun on queue 2 thus permits the software to know that queue 1 is taking up so much QADC64E time that queue 2 trigger events are being lost. T1 T1 Q1: ACTIVE C1 C2 T2 Q2: T2 C1 ACTIVE C3 C4 PF1 T2 C1 C2 C2 TOR2 IDLE Q1 Q2 IDLE QS 0000 ACTIVE ACTIVE SUSPEND 0010 1010 T2 CF1 C3 C3 PF2 PAUSE 0101 0110 IDLE ACTIVE 1010 RESUME=0 CF2 TOR2 ACTIVE PAUS ACT SUSPEND 0110 C4 ACTIVE IDLE 0010 0000 QADC S10 Figure 13-36. CCW Priority Situation 10 MPC561/MPC563 Reference Manual, Rev. 1.2 13-60 Freescale Semiconductor QADC64E Legacy Mode Operation T1 C1 Q1: T2 Q2: T1 C2 T2 C1 PF1 C2 IDLE Q2 IDLE QS 0000 T2 ACTIVE SUSPEND 0010 1010 CF1 C4 C4 TOR2 PF2 ACTIVE C4 T2 C3 C2 TOR2 Q1 C3 CF2 IDLE ACTIVE PAUSE RESUME=1 ACT PAUSE ACTIVE SUSPEND ACT IDLE 0110 0101 0000 0110 1010 0010 QADC S11 Figure 13-37. CCW Priority Situation 11 The above situations cover normal overlap conditions that arise with asynchronous trigger events on the two queues. An additional conflict to consider is that the freeze condition can arise while the QADC64E is actively executing CCWs. The conventional use for the freeze mode is for software/hardware debugging. When the CPU background debug mode is enabled and a breakpoint occurs, the freeze signal is issued, which can cause peripheral modules to stop operation. When freeze is detected, the QADC64E completes the conversion in progress, unlike queue 1 suspending queue 2. After the freeze condition is removed, the QADC64E continues queue execution with the next CCW in sequence. Trigger events that occur during freeze are not captured. When a trigger event is pending for queue 2 before freeze begins, that trigger event is remembered when the freeze is passed. Similarly, when freeze occurs while queue 2 is suspended, after freeze, queue 2 resumes execution as soon as queue 1 is finished. Situations 12 through 19 (Figure 13-38 to Figure 13-45) show examples of all of the freeze situations. FREEZE T1 Q1: C1 C2 C3 C4 CF1 QADC S12 Figure 13-38. CCW Freeze Situation 12 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-61 QADC64E Legacy Mode Operation FREEZE T2 Q2: C1 C2 C3 C4 QADC S13 CF2 Figure 13-39. CCW Freeze Situation 13 (TRIGGERS IGNORED) FREEZE T1 T1 T1 Q1: C1 C2 C3 C4 QADC S14 T2 T2 CF1 Figure 13-40. CCW Freeze Situation 14 (Triggers Ignored) FREEZE T2 T2 T2 Q2: C1 C2 C3 C4 T1 T1 QADC S15 CF2 Figure 13-41. CCW Freeze Situation 15 (Triggers Ignored) FREEZE T1 Q1: C1 T1 T1 C2 C3 PF1 C4 CF1 QADC S16 Figure 13-42. CCW Freeze Situation 16 MPC561/MPC563 Reference Manual, Rev. 1.2 13-62 Freescale Semiconductor QADC64E Legacy Mode Operation (Triggers Ignored) FREEZE T2 T2 Q2: C1 T2 C2 C3 C4 PF2 CF2 QADC S17 Figure 13-43. CCW Freeze Situation 17 FREEZE T1 Q1: C1 C2 C3 C4 T2 CF1 Q2: C1 C2 C3 C4 (Trigger Captured, Response Delayed After Freeze) CF2 QADC S18 Figure 13-44. CCW Freeze Situation 18 FREEZE T1 Q1: C1 C2 C3 C4 T2 Q2: C1 CF1 C2 C3 C4 C4 CF2 QADC S19 Figure 13-45. CCW Freeze Situation 19 13.6.2 Conversion Timing Schemes This section contains some conversion timing examples. Example 1 below shows the timing for basic conversions where the following is assumed: * Q1 begins with CCW0 and ends with CCW3 * CCW0 has pause bit set * CCW1 does not have pause bit set * External trigger rise-edge for Q1 * CCW4 = BQ2 and Q2 is disabled MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-63 QADC64E Legacy Mode Operation * Q1 RES shows relative result register updates Conversion time is >= 14 QCLKS Time between triggers QCLK Trig1 EOC QS CWP CWPQ1 Q1 RES 0 4 LAST 8 4 8 CCW1 CCW0 LAST CCW0 CCW2 CCW1 R0 R1 Figure 13-46. External Trigger Mode (Positive Edge) Timing with Pause Recall QS = 0 => Queues disabled; QS = 8 => Q1 active, Q2 disabled; QS= 4 => Q1 paused, Q2 disabled. A time separator was provided between the triggers and end of conversion (EOC). The relationship to QCLK displayed is not guaranteed. CWPQ1 and CWPQ2 typically lag CWP and only match CWP when the associated queue is inactive. Another way to view CWPQ1 and CWPQ2 is that these registers update when EOC triggers the result register to be written. When the pause bit is set (CCW0), please note that CWP does not increment until triggered. When the pause is not set (CCW1), the CWP increments with EOC. The conversion results Q1 RES(x) show the result associated with CCW(x). So that R0 represents the result associated with CCW0. Example 2 below shows the timing for conversions in gated mode single-scan with the same assumptions as example 1 except: * No pause bits set in any CCW * External trigger gated single-scan mode for Q1 * Single-scan bit is set When the gate closes and opens again the conversions start with the first CCW in Q1. When the gate closes the active conversion completes before the queue goes idle. When Q1 completes both the CF1 bit sets and the SSE bit clears. MPC561/MPC563 Reference Manual, Rev. 1.2 13-64 Freescale Semiconductor QADC64E Legacy Mode Operation Trig1 (gate) EOC QS CWP CWPQ1 8 0 LAST CCW0 LAST LAST Q1 RES SSE 0 8 CCW1 CCW0 0 CCW1 CCW2 CCW3 CCW0 CCW1 CCW0 CCW1 CCW2 CCW3 R0 R1 R0 R1 R2 R3 Software must set SSE CF1 PF1 Software must clear PF1 Figure 13-47. Gated Mode, Single-Scan Timing Example 3 below shows the timing for conversions in gated continuous-scan mode with the same assumptions in the amended definition for the PF bit in this mode to reflect the condition that a gate closing occurred before the queue completed is a proposal under consideration at this time as example 2. NOTE At the end of Q1,the completion flag CF1 sets and the queue restarts. Also, note that if the queue starts a second time and completes, the trigger overrun flag TOR1 sets. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-65 QADC64E Legacy Mode Operation Trig1 (gate) EOC 8 0 QS LAST CWP CWPQ1 Q1 RES CCW0 CCW1 CCW2 CCW3 CCW0 CCW3 CCW0 LAST CCW0 CCW1 CCW2 CCW3 CCW2 CCW3 R0 R1 R2 R3 R2 R3 XX CF1 TOR1 Q restart Q restart Figure 13-48. Gated Mode, Continuous Scan Timing 13.7 QADC64E Integration Requirements The QADC64E requires accurate, noise-free input signals for proper operation. This section discusses the design of external circuitry to maximize QADC64E performance. The QADC64E uses the external signals shown in Figure 13-1. There are 16 channel signals that can also be used as general-purpose digital input signals, 8 of which can be configured as either digital input or output signals. 13.7.1 Port Digital Input/Output Signals The 16 port signals on the QADC64E module can be used as analog inputs. Port A signals can be configured as digital input or digital output signals and Port B signals can be used as 8-bit digital input signals. Port A signals are referred to as PQA[7:0] when used as a bidirectional 8-bit digital input/output port. These eight signals may be used for general-purpose digital input signals or push-pull digital output signals. Port B signals are referred to as PQB[7:0] when used as digital input signals. Port A and B signals are connected to a digital input synchronizer during reads and may be used as general purpose digital inputs when the applied voltages meet high voltage input (VIH) and low voltage input (VIL) requirements. Refer to Appendix F, "Electrical Characteristics," for more information on voltage requirements. MPC561/MPC563 Reference Manual, Rev. 1.2 13-66 Freescale Semiconductor QADC64E Legacy Mode Operation Port A signals are configured as inputs or outputs by programming the port data direction register, DDRQA. The digital input signal states are read from the port data register, PORTQA, when the port data direction register specifies that the signals are inputs. The digital data in the port data register is driven onto the port A signals when the corresponding bit in the port data direction register specifies that the signals are outputs. Refer to Appendix B, "Internal Memory Map," for more information. Since the outputs are configured as push-pull drivers, external pull-up provisions are not necessary when the output is used to drive another integrated circuit. 13.7.2 External Trigger Input Signals The QADC64E uses two external trigger signals (ETRIG[2:1]). Each of the two input external trigger signals is associated with one of the scan queues, queue 1 or queue 2 The assignment of ETRIG[2:1] to a queue is made in the QACR0 register by the TRG bit. When TRG=0, ETRIG[1] triggers queue 1 and ETRIG[2] triggers queue 2. When TRG=1, ETRIG[1] triggers queue 2 and ETRIG[2] triggers queue 1. NOTE The ETRIG[2:1] pins on the MPC561/MPC563 are multiplexed with the PCS[7:6] pins. 13.7.3 Analog Power Signals VDDA and VSSA signals supply power to the analog subsystems of the QADC64E module. Dedicated power is required to isolate the sensitive analog circuitry from the normal levels of noise present on the digital power supply. Refer to Appendix F, "Electrical Characteristics," for more information. The analog supply signals (VDDA and VSSA) define the limits of the analog reference voltages (VRH and VRL) and of the analog multiplexer inputs. Figure 13-49 is a diagram of the analog input circuitry. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-67 QADC64E Legacy Mode Operation VDDA VRH Sample AMP S/H RC DAC Comparator 16 Channels CP VSSA VRL QADC64E 16CH SAMPLE AMP Figure 13-49. Equivalent Analog Input Circuitry Since the sample amplifier is powered by VDDA and VSSA, it can accurately transfer input signal levels up to but not exceeding VDDA and down to but not below VSSA. If the input signal is outside of this range, the output from the sample amplifier is clipped. In addition, VRH and VRL must be within the range defined by VDDA and VSSA. As long as VRH is less than or equal to VDDA and VRL is greater than or equal to VSSA and the sample amplifier has accurately transferred the input signal, resolution is ratiometric within the limits defined by VRL and VRH. If VRH is greater than VDDA, the sample amplifier can never transfer a full-scale value. If VRL is less than VSSA, the sample amplifier can never transfer a zero value. Figure 13-50 shows the results of reference voltages outside the range defined by VDDA and VSSA. At the top of the input signal range, VDDA is 10 mV lower than VRH. This results in a maximum obtainable 10-bit conversion value of 0x3FE. At the bottom of the signal range, VSSA is 15 mV higher than VRL, resulting in a minimum obtainable 10-bit conversion value of three. MPC561/MPC563 Reference Manual, Rev. 1.2 13-68 Freescale Semiconductor QADC64E Legacy Mode Operation 3FF 10-Bit Result (Hexadecimal) 3FE 3FD 3FC 3FB 3FA 8 7 6 5 4 3 2 1 0 .010 .020 .030 5.100 5.110 5.120 Input in Volts (V RH = 5.120, VRL = 0 V) 5.130 QADC64E CLIPPING Figure 13-50. Errors Resulting from Clipping 13.7.3.1 Analog Supply Filtering and Grounding Two important factors influencing performance in analog integrated circuits are supply filtering and grounding. Generally, digital circuits use bypass capacitors on every VDD/VSS signal pair. This applies to analog sub-modules also. The distribution of power and ground is equally important. Analog supplies should be isolated from digital supplies as much as possible. This necessity stems from the higher performance requirements often associated with analog circuits. Therefore, deriving an analog supply from a local digital supply is not recommended. However, if for economic reasons digital and analog power are derived from a common regulator, filtering of the analog power is recommended in addition to the bypassing of the supplies already mentioned. For example, an RC low pass filter could be used to isolate the digital and analog supplies when generated by a common regulator. If multiple high precision analog circuits are locally employed (i.e., two A/D converters), the analog supplies should be isolated from each other as sharing supplies introduces the potential for interference between analog circuits. Grounding is the most important factor influencing analog circuit performance in mixed signal systems (or in stand-alone analog systems). Care must be taken to not introduce additional sources of noise into the analog circuitry. Common sources of noise include ground loops, inductive coupling, and combining digital and analog grounds together inappropriately. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-69 QADC64E Legacy Mode Operation The problem of how and when to combine digital and analog grounds arises from the large transients which the digital ground must handle. If the digital ground is not able to handle the large transients, the current from the large transients can return to ground through the analog ground. It is the excess current overflowing into the analog ground which causes performance degradation by developing a differential voltage between the true analog ground and the microcontroller's ground signal. The end result is that the ground observed by the analog circuit is no longer true ground and often ends in skewed results. Two similar approaches designed to improve or eliminate the problems associated with grounding excess transient currents involve star-point ground systems. One approach is to star-point the different grounds at the power supply origin, thus keeping the ground isolated. Refer to Figure 13-51. Another approach is to star-point the different grounds near the analog ground signal on the microcontroller by using small traces for connecting the non-analog grounds to the analog ground. The small traces are meant only to accommodate DC differences, not AC transients. NOTE This star-point scheme still requires adequate grounding for digital and analog subsystems in addition to the star-point ground. Other suggestions for PCB layout in which the QADC64E is employed include: * Analog ground must be low impedance to all analog ground points in the circuit. * Bypass capacitors should be as close to the power signals as possible. The analog ground should be isolated from the digital ground. This can be done by cutting a separate ground plane for the analog ground * Non-minimum traces should be utilized for connecting bypass capacitors and filters to their corresponding ground/power points. * Distance for trace runs should be minimized where possible MPC561/MPC563 Reference Manual, Rev. 1.2 13-70 Freescale Semiconductor QADC64E Legacy Mode Operation Digital Power Supply Analog Power Supply PGND +5V VDDA +5V VSSA AGND VRL VRH +5V VSS QADC64E VDD PCB Figure 13-51. Star-Ground at the Point of Power Supply Origin 13.7.4 Analog Reference Signals VRH and VRL are the dedicated input signals for the high and low reference voltages. Separating the reference inputs from the power supply signals allows for additional external filtering, which increases reference voltage precision and stability, and subsequently contributes to a higher degree of conversion accuracy. No A/D converter can be more accurate than its analog reference. Any noise in the reference can result in at least that much error in a conversion. The reference for the QADC64E, supplied by signals VRH, and VRL, should be low-pass filtered from its source to obtain a noise-free, clean signal. In many cases, simple capacitive bypassing may sufficed. In extreme cases, inductors or ferrite beads may be necessary if noise or RF energy is present. Series resistance is not advisable since there is an effective DC current requirement from the reference voltage by the internal resistor string in the RC DAC array. External resistance may introduce error in this architecture under certain conditions. Any series devices in the filter network should contain a minimum amount of DC resistance. 13.7.5 Analog Input Signals Analog inputs should have low AC impedance at the signals. Low AC impedance can be realized by placing a capacitor with good high frequency characteristics at the input signal of the part. Ideally, that capacitor should be as large as possible (within the practical range of capacitors that still have good high frequency characteristics). This capacitor has two effects: * It helps attenuate any noise that may exist on the input. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-71 QADC64E Legacy Mode Operation * It sources charge during the sample period when the analog signal source is a high-impedance source. Series resistance can be used with the capacitor on an input signal to implement a simple RC filter. The maximum level of filtering at the input signals is application dependent and is based on the bandpass characteristics required to accurately track the dynamic characteristics of an input. Simple RC filtering at the signal may be limited by the source impedance of the transducer or circuit supplying the analog signal to be measured. Refer to Section 13.7.5.3, "Error Resulting from Leakage," for more information. In some cases, the size of the capacitor at the signal may be very small. Figure 13-52 is a simplified model of an input channel. Refer to this model in the following discussion of the interaction between the external circuitry and the circuitry inside the QADC64E. Source RSRC External Filter RF Internal Circuit Model S1 S2 S3 AMP CSAMP VSRC CF VI CP VSRC =Source Voltage RSRC = Source Impedance RF = Filter Impedance CF = Filter Capacitor CP = Internal Parasitic Capacitance CSAMP = Sample Capacitor VI = Internal Voltage Source during Sample and Hold QADC64E Sample AMP Model Figure 13-52. Electrical Model of an A/D Input Signal In Figure 13-52, RF, RSRC and CF comprise the external filter circuit. CP is the internal parasitic capacitor. CSAMP is the capacitor array used to sample and hold the input voltage. VI is an internal voltage source used to provide charge to CSAMP during sample phase. The following paragraphs provide a simplified description of the interaction between the QADC64E and the external circuitry. This circuitry is assumed to be a simple RC low-pass filter passing a signal from a source to the QADC64E input signal. The following simplifying assumptions are made: * The external capacitor is perfect (no leakage, no significant dielectric absorption characteristics, etc.) * All parasitic capacitance associated with the input signal is included in the value of the external capacitor * Inductance is ignored MPC561/MPC563 Reference Manual, Rev. 1.2 13-72 Freescale Semiconductor QADC64E Legacy Mode Operation * The "on" resistance of the internal switches is 0 and the "off" resistance is infinite 13.7.5.1 Analog Input Considerations The source impedance of the analog signal to be measured and any intermediate filtering should be considered whether external multiplexing is used or not. Figure 13-53 shows the connection of eight typical analog signal sources to one QADC64E analog input signal through a separate multiplexer chip. Also, an example of an analog signal source connected directly to a QADC64E analog input channel is displayed. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-73 QADC64E Legacy Mode Operation Analog Signal Source RSOURCE2 ~ Filtering and Interconnect Typical Mux Chip (MC54HC4051, MC74HC4051, MC54HC4052, MC74HC4052, MC54HC4053, etc.) QADC64E R FILTER2 0.01 F1 C SOURCE RSOURCE2 ~ CFILTER C MUXIN R FILTER2 0.01 F1 C SOURCE RSOURCE2 CFILTER C MUXIN R FILTER2 ~ 0.01 F1 ~ Interconnect C SOURCE RSOURCE2 CFILTER C MUXIN R FILTER2 0.01 F1 C SOURCE RSOURCE2 RMUXOUT CMUXOUT CPCB CFILTER C MUXIN R FILTER2 RSOURCE2 0.01 F CSAMP CIN = CP + CSAMP ~ CSOURCE CP 1 CFILTER C MUXIN R FILTER2 ~ C SOURCE RSOURCE2 0.01 F1 CFILTER C MUXIN R FILTER2 ~ CSOURCE RSOURCE2 0.01 F1 CFILTER C MUXIN R FILTER2 ~ 0.01 F1 C SOURCE ~ RSOURCE2 C SOURCE CFILTER C MUXIN R FILTER2 0.01 F1 CFILTER CP CSAMP CPCB QADC64E EXT MUX EX 1 Typical Value 2 RFILTER typically 10KW-20KW Figure 13-53. External Multiplexing of Analog Signal Sources MPC561/MPC563 Reference Manual, Rev. 1.2 13-74 Freescale Semiconductor QADC64E Legacy Mode Operation 13.7.5.2 Settling Time for the External Circuit The values for RSRC, RF and CF in the external circuitry determine the length of time required to charge CF to the source voltage level (VSRC). At time t = 0, VSRC changes in Figure 13-52 while S1 is open, disconnecting the internal circuitry from the external circuitry. Assume that the initial voltage across CF is zero. As CF charges, the voltage across it is determined by the following equation, where t is the total charge time: -t ---------------------------------------------------------- (R + R )C F SRC F V CF = V SRC 1 - e Eqn. 13-1 As t approaches infinity, VCF will equal VSRC. (This assumes no internal leakage.) With 10-bit resolution, 1/2 of a count is equal to 1/2048 full-scale value. Assuming worst case (VSRC = full scale), Table 13-24 shows the required time for CF to charge to within 1/2 of a count of the actual source voltage during 10-bit conversions. Table 13-24 is based on the RC network in Figure 13-52. NOTE The following times are completely independent of the A/D converter architecture (assuming the QADC64E is not affecting the charging). Table 13-24. External Circuit Settling Time to 1/2 LSB (10-Bit Conversions) Filter Capacitor (CF) Source Resistance (RF + RSRC) 100 1 k 10 k 100 k 1 F 760 s 7.6 ms 76 ms 760 ms .1 F 76 s 760 s 7.6 ms 76 ms .01 F 7.6 s 76 s 760 s 7.6 ms .001 F 760 ns 7.6 s 76 s 760 s 100 pF 76 ns 760 ns 7.6 s 76 s The external circuit described in Table 13-24 is a low-pass filter. A user interested in measuring an AC component of the external signal must take the characteristics of this filter into account. 13.7.5.3 Error Resulting from Leakage A series resistor limits the current to a signal, therefore input leakage acting through a large source impedance can degrade A/D accuracy. The maximum input leakage current is specified in Appendix F, "Electrical Characteristics." Input leakage is greater at higher operating temperatures. In the temperature range from 125 C to 50 C, the leakage current is halved for every 8 - 12 C reduction in temperature. Assuming VRH - VRL = 5.12 V, one count (assuming 10-bit resolution) corresponds to 5 mV of input voltage. A typical input leakage of 200 nA acting through 10 k of external series resistance results in an error of 0.4 count (2.0 mV). If the source impedance is 100 k and a typical leakage of 100 nA is present, an error of two counts (10 mV) is introduced. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-75 QADC64E Legacy Mode Operation In addition to internal junction leakage, external leakage (e.g., if external clamping diodes are used) and charge sharing effects with internal capacitors also contribute to the total leakage current. Table 13-25 illustrates the effect of different levels of total leakage on accuracy for different values of source impedance. The error is listed in terms of 10-bit counts. CAUTION Leakage from the part below 200 nA is obtainable only within a limited temperature range. Table 13-25. Error Resulting from Input Leakage (IOFF) Source Impedance 13.7.5.4 Leakage Value (10-bit Conversions) 100 nA 200 nA 500 nA 1000 nA 1 k -- -- 0.1 counts 0.2 counts 10 k 0.2 counts 0.4 counts 1 counts 2 counts 100 k 2 counts 4 count 10 counts 20 counts Accommodating Positive/Negative Stress Conditions Positive or negative stress refers to conditions which exceed nominally defined operating limits. Examples include applying a voltage exceeding the normal limit on an input (for example, voltages outside of the suggested supply/reference ranges) or causing currents into or out of the signal which exceed normal limits. QADC64E specific considerations are voltages greater than VDDA, VRH or less than VSSA applied to an analog input which cause excessive currents into or out of the input. Refer to Appendix F, "Electrical Characteristics," to for more information on exact magnitudes. Either stress condition can potentially disrupt conversion results on neighboring inputs. Parasitic devices, associated with CMOS processes, can cause an immediate disruptive influence on neighboring signals. Common examples of parasitic devices are diodes to substrate and bipolar devices with the base terminal tied to substrate (VSSI/VSSA ground). Under stress conditions, current injected on an adjacent signal can cause errors on the selected channel by developing a voltage drop across the selected channel's impedances. Figure 13-54 shows an active parasitic bipolar NPN transistor when an input signal is subjected to negative stress conditions. Figure 13-55 shows positive stress conditions can activate a similar PNP transistor. VSTRESS + I RSTRESS INJN ANn Signal Under Stress 10K RSELECTED IIN Parasitic Device ANn+1 VIN Adjacent signal QADC64E PAR Figure 13-54. Input Signal Subjected to Negative Stress MPC561/MPC563 Reference Manual, Rev. 1.2 13-76 Freescale Semiconductor QADC64E Legacy Mode Operation VSTRESS + I RSTRESS INJP ANn Signal Under Stress 10K RSELECTED IIN VDDA PARASITIC DEVICE ANn+1 VIN Adjacent signal QADC64E PAR Figure 13-55. Input Signal Subjected to Positive Stress The current into the signal (IINJN or IINJP) under negative or positive stress is determined by the following equations: where: - ( V STRESS - V BE ) I INJN = -----------------------------------------------------R STRESS Eqn. 13-2 V STRESS - V EB - V DDA I INJP = ---------------------------------------------------------------------R STRESS Eqn. 13-3 VSTRESS = Adjustable voltage source VEB = Parasitic PNP emitter/base voltage (refer to VNEGCLAMP in Appendix F, "Electrical Characteristics") VBE = Parasitic NPN base/emitter voltage (refer to VNEGCLAMP in Appendix F, "Electrical Characteristics") RSTRESS = Source impedance (10-k resistor in Figure 13-54 and Figure 13-55 on stressed channel) RSELECTED = Source impedance on channel selected for conversion The current into (IIN) the neighboring signal is determined by the KN (current coupling ratio) of the parasitic bipolar transistor (KN << 1). The IIN can be expressed by the following equation: IIN = - KN * IINJ where IINJ is either IINJN or IINJP. A method for minimizing the impact of stress conditions on the QADC64E is to strategically allocate QADC64E inputs so that the lower accuracy inputs are adjacent to the inputs most likely to see stress conditions. Also, suitable source impedances should be selected to meet design goals and minimize the effect of stress conditions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 13-77 QADC64E Legacy Mode Operation MPC561/MPC563 Reference Manual, Rev. 1.2 13-78 Freescale Semiconductor Chapter 14 QADC64E Enhanced Mode Operation The two queued analog-to-digital converter (QADC) modules on the MPC561/MPC563 devices are 10-bit, unipolar, successive approximation converters. The modules can be configured to operate in one of two modes, legacy mode (for MPC555 compatibility) and enhanced mode. This chapter describes how the module operates in enhanced mode. Refer to Chapter 13, "QADC64E Legacy Mode Operation," for information regarding the QADC64E functionality in legacy mode. For this revision of the QADC, the name QADC64E implies the enhanced version of the QADC64 module, not just enhanced mode of operation. For simplicity, the names QADC and QADC64E may be used interchangeably throughout this document. 14.1 QADC64E Block Diagram Figure 14-1 displays the major components of the QADC64E modules on the MPC561/MPC563. EXTERNAL Triggers EXTERNAL MUX Address Up to 16 ANALOG Input Signals REFERENCE Inputs ANALOG POWER Inputs ANALOG Input Multiplexor and DIGITAL Signal Functions DIGITAL CONTROL 10-bit ANALOG to DIGITAL CONVERTER Queues OF 10-BIT Conversion Command Words (CCW), 64 Entries 10-bit RESULT Table, 64 Entries BUS INTERFACE UNIT (BIU) 10-bit to 16-bit RESULT Alignment IMB3 Figure 14-1. QADC64E Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-1 QADC64E Enhanced Mode Operation 14.2 Key Features and Quick Reference Diagrams This section gives an overview of the implementation of the two QADC64E modules on the MPC561/MPC563. It can also be used for a quick reference while programming the modules. 14.2.1 * * * * * * * * * * * * * * * * Features of the QADC64E Enhanced Mode Operation Internal sample and hold Directly supports up to four external multiplexers (for example, the MC14051) Up to 41 analog input channels using QADC64 external multiplexing Programmable input sample time for various source impedances Minimum conversion time of 7s (with typical QCLK frequency, 2 MHz) Two conversion command queues with a total of 64 entries Sub-queues possible using pause mechanism Queue complete and pause software interrupts available on both queues Queue pointers indicate current location for each queue Automated queue modes initiated by -- External edge trigger -- Periodic/Interval timer, within QADC64E module -- Software command -- External gated trigger (queue 1 only) Single-scan or continuous-scan of queues 64 result registers in each QADC64E module Output readable in three formats -- Right-justified unsigned -- Left-justified signed -- Left-justified unsigned Unused analog channels can be used as digital input/output signals Modulus prescaler can divide the system clock for the converter by two to 128 Alternate reference input, with control in the conversion command word (CCW) The analog section includes input signals, an analog multiplexer, and the sample and hold circuits. The analog conversion is performed by the digital-to-analog converter (DAC) resistor-capacitor array and a high-gain comparator. The digital control section contains queue control logic to sequence the conversion process and interrupt generation logic. Also included are the periodic/interval timer, control and status registers, the conversion command word (CCW) table RAM, and the result table RAM. The bus interface unit (BIU) allows the QADC64E to operate with the applications software through the IMB3 environment. MPC561/MPC563 Reference Manual, Rev. 1.2 14-2 Freescale Semiconductor QADC64E Enhanced Mode Operation 14.2.2 Memory Map The QADC64E occupies one Kbyte, or 512 16-bit entries, of address space. Ten 16-bit registers are control, port, and status registers, 64 16-bit entries are the CCW table, and 64 16-bit entries are the result table, and occupy 192 16-bit address locations because the result data is readable in three data alignment formats. Each QADC64E module on MPC561/MPC563 has its own memory space. Table 14-1 shows the memory map for QADC64E module A, it occupies 0x30 4800 to 0x30 4BFF. Table 14-2 shows the memory map for QADC64E module B. Module B has the same offset scheme starting at 0x30 4C00. QADC64E_B occupies 0x30 4C00 to 0x30 4FFF. Table 14-1. QADC64E_A Address Map Address MSB LSB 0 0x30 4800 1 2 3 4 5 STOP FRZ 0x30 4802 TEST MODE 0x30 4804 IRL1 6 7 8 LOC K FLI P SUP V 10 11 12 13 14 Register 15 Module Config.1 Test1 Interrupt1 IRL2 0x30 4806 PORTQA PORTQB Port Data 0x30 4808 DDRQA DDRQB Port Direction 0x30 480A EMU X TRG 0x30 480C CIE1 PIE 1 SSE 1 MQ1 0x30 480E CIE2 PIE 2 SSE 2 MQ2 0x30 4810 CF1 PF1 CF2 QCLK PRESCALER RES UME 0x30 4B00- SIGN 0x30 4B7F 0x30 4B80 0x30 4BFF BQ2 P RE F 0000 00 Control 2 CWP Status 0 CWPQ2 Status 1 RESERVED 0x30 4A000x30 4A7F 0x30 4A800x30 4AFF QS CWPQ1 0x30 48140x30 49FF Control 0 Control 1 PF2 TOR1 TOR2 0x30 4812 1 9 Reserved IST CHAN UNSIGNED RIGHT JUSTIFIED SIGNED LEFT JUSTIFIED UNSIGNED LEFT JUSTIFIED CCWs Results 00 0000 Results 00 0000 Results Registers are accessible only as supervisor data space. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-3 QADC64E Enhanced Mode Operation Table 14-2. QADC64E_B Address Map Address MSB 0 0x30 4C00 LSB 1 2 3 4 5 STOP FRZ 0x30 4C02 TEST MODE 0x30 4C04 IRL1 7 8 LOC K FLI P SUPV 9 10 11 12 13 14 Register 15 Module Config.1 Test IRL2 Interrupt 0x30 4C06 PORTQA PORTQB Port Data 0x30 4C08 DDRQA DDRQB Port Direction 0x30 4C0A EMUX TR G QCLK PRESCALER 0x30 4C0C CIE1 PIE 1 SSE1 MQ1 0x30 4C0E CIE2 PIE 2 SSE2 MQ2 0x30 4C10 CF1 PF1 CF2 P 0x30 4E800x30 4EFF 0x30 4F80 0x30 4FFF QS BQ2 Control 2 CWP Status 0 CWPQ2 Status 1 Reserved 0x30 4E000x30 4E7F 0x30 4F000x30 4F7F RESU ME CWPQ1 0x30 4C140x30 4DFF Reserved RE F 0000 00 SIGN Control 0 Control 1 PF2 TOR TOR2 1 0x30 4C12 1 6 IST CHAN CCWs UNSIGNED RIGHT JUSTIFIED SIGNED LEFT JUSTIFIED UNSIGNED LEFT JUSTIFIED Results 00 0000 Results 00 0000 Results Registers are accessible only as supervisor data space Accesses to supervisor-only data space is permitted only when the bus master is operating in supervisor access mode. Assignable data space can be either restricted to supervisor-only access or unrestricted to both supervisor and user data space addresses. See Section 14.3.1.4, "Supervisor/Unrestricted Address Space." 14.2.3 Legacy and Enhanced Modes of Operation The QADC64E modules can be configured to operate in Legacy or Enhanced mode. Legacy mode is the default state out of reset. The QADC64E modules are configured for Enhanced mode by a series of writes MPC561/MPC563 Reference Manual, Rev. 1.2 14-4 Freescale Semiconductor QADC64E Enhanced Mode Operation to the LOCK and FLIP bits of the module configuration register. This will be described in Section 14.3.1.3, "Switching Between Legacy and Enhanced Modes of Operation." 14.2.4 Using the Queue and Result Word Table The heart of the QADC is its conversion command word (CCW) queues. This is where the module is programmed to convert a particular channel according to a particular requirement. The queues are created by writing CCWs into the CCW table in the register memory. The queues are controlled by the three control registers, and their status can be read from the two status registers. As conversions are completed the digital value is written into the result word table. Figure 14-2 shows the CCW queue and the result word table. Conversion Command Word (CCW) Table 0x200 (CCW0) Begin Queue 1 BQ2 End of Queue 1 Begin Queue 2 0x27E (CCW63) End of Queue 2 msb 6 Result Word Table A/D Converter 7 8 Channel Select, Sample, Hold, and Analog to Digital Conversion Result 63 lsb 15 9 P REF IST Result 0 CHAN P = Pause Until Next Trigger msb 0 lsb 15 Address Offsets: 0x280-0x2FF1 Result Right Justified, Unsigned Result Format 0 0 0 0 0 0 0 1 REF = Use Alternate Reference Voltage 78 78 15 IST = Input Sample Time 0 0 0 0 0 0 S Result Left Justified, Signed Result Format CHAN = Channel Number and End_of_Queue Code 0 78 0x300-0x37F1 S = Sign bit 15 Result 0 0 0 0 0 0 Left Justified, Unsigned Result Format 0x380-0x3FF1 10-bit Result is Software Readable in Three Different 16-bit Formats 10-bit Conversion Command Word (CCW) Format NOTE 1: These offsets must be added to the module base address: A = 0x30 4800 or B = 0x30 4C00 Figure 14-2. CCW Queue and Result Table Block Diagram 14.2.5 External Multiplexing The QADC can use from one to four 8-input external multiplexer chips to expand the number of analog signals that may be converted. The externally multiplexed channels are automatically selected from the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-5 QADC64E Enhanced Mode Operation channel field of the conversion command word (CCW) table. External Multiplex mode is software selectable, by setting the EMUX bit of control register 0 (QACR0). Figure 14-3 shows the maximum configuration of four external multiplexer chips connected to the QADC. The QADC provides three multiplexer address signals - MA0, MA1, MA2 - to select one of the multiplexer chips. These outputs are the multiplexer control lines and they are connected to all external multiplexer chips. The analog output of each of the four multiplexer chips is connected to four separate QADC inputs - ANw, ANx, ANy, ANz. These signals are the first four signals of port B and each one can represent eight analog input channels. The QADC converts the proper input channel (ANw, ANx, ANy, ANz) by interpreting the channel number in the CCW. Refer to Table 14-3. AN8 AN9 AN10 AN11 AN12 AN13 AN14 AN15 MUX AN16 AN17 AN18 AN19 AN20 AN21 AN22 AN23 MUX AN24 AN25 AN26 AN27 AN28 AN29 AN30 AN31 MUX AN44/ANw/PQB0 AN45/ANx/PQB1 AN46/ANy/PQB2 AN47/ANz/PQB3 AN48/PQB4 AN49/PQB5 AN50/PQB6 AN51/PQB7 AN52/MA0/PQA0 AN53/MA1/PQA1 AN54/MA2/PQA2 AN55/PQA3 AN56/PQA4 AN57/PQA5 AN58/PQA6 AN59/PQA7 ANALOG POWER ANALOG REFERENCES PORT B MUX V SSA V DDA AltRef V RH VRL PORT A AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 QADC ANALOG MULTIPLEXER AND PORT LOGIC ANALOG CONVERTER DIGITAL CONTROL External Triggers: ETRIG1 ETRIG2 Figure 14-3. Example of External Multiplexing I Table 14-3. Multiplexed Analog Input Channels Multiplexed Analog Input Channels ANw (AN44) 0 through 7 ANx (AN45) 8 through 15 ANy (AN46) 16 through 23 ANz (AN47) 24 through 31 MPC561/MPC563 Reference Manual, Rev. 1.2 14-6 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-4 shows the total number of analog input channels supported with zero to four external multiplexer chips using one QADC module. Table 14-4. Analog Input Channels Number of Analog Input Channels Available Directly Connected + External Multiplexed = Total Channels No External MUX Chips One External MUX Chip Two External MUX Chips Three External MUX Chips Four External MUX Chips 16 20 27 34 41 NOTE: QADC64E External MUX Users If a QADC64E module is in external multiplexing (EMUX) mode then the multiplexer address signal channels AN[52:54] should not be programmed into queues. 14.3 Programming the QADC64E Registers The QADC64E has three global registers for configuring module operation. * The module configuration register, QADCMCR (Section 14.3.1, "QADC64E Module Configuration Register") * The interrupt register, QADCINT (Section 14.3.2, "QADC64E Interrupt Register") * The test register, QADCTEST. This register is used for factory test only. These global registers are always defined to be in supervisor-only data space. Refer to Table 14-1 for the QADC64E_A Address Map and Table 14-2 for QADC64E_B Address Map. See Section 14.3.1.4, "Supervisor/Unrestricted Address Space" for access modes for these registers. The remaining five registers in the control register block control the operation of the queuing mechanism, and provide a means of monitoring the operation of the QADC64E. * Control register 0 (QACR0) contains hardware configuration information (Section 14.3.5, "Control Register 0") * Control register 1 (QACR1) is associated with queue 1 (Section 14.3.6, "Control Register 1") * Control register 2 (QACR2) is associated with queue 2 (Section 14.3.7, "Control Register 2") * Status registers (QASR0 and QASR1) provide visibility on the status of each queue and the particular conversion that is in progress (Section 14.3.8, "Status Registers (QASR0 and QASR1)") The Conversion Command Word (CCW) table contains 64 entries to hold the software programmable analog conversion sequences. Each CCW table entry is a 16-bit entry, though only 10 bits are used. The final block of address space belongs to the result word table, which appears in three places in the memory map. Each result word table location holds one 10-bit conversion value. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-7 QADC64E Enhanced Mode Operation 14.3.1 QADC64E Module Configuration Register The QADCMCR contains fields and bits that control freeze and stop modes, operating mode of the QADC64E module, determine the privilege level required to access most registers and master/slave operation. . MSB 0 LSB 1 2 3 Field STOP FRZ SRESET 4 5 -- 0000_0000 Addr 6 7 8 9 10 11 LOCK FLIP SUPV 1 12 13 14 15 -- 000_0000 0x30 4800 (QADCMCR_A); 0x30 4C00 (QADCMCR_B) Figure 14-4. Module Configuration Register (QADCMCR) Table 14-5. QADCMCR Bit Descriptions Bits Name 0 STOP 1 FRZ 2:5 -- 6 LOCK 7 FLIP QADC Mode of Operation. The FLIP bit allows selection of the mode of operation of the QADC module, either Legacy Mode (default) or Enhanced Mode. This bit can only be written when the LOCK is set (unlocked). Refer to Section 14.3.1.3, "Switching Between Legacy and Enhanced Modes of Operation" for more information. 0 Legacy Mode enabled 1 Enhanced Mode enabled 8 SUPV Supervisor/Unrestricted Data Space. Refer to Section 14.3.1.4, "Supervisor/Unrestricted Address Space" and Table 14-6 for more information. 0 Only the module configuration register, test register, and interrupt register are designated as supervisor-only data space. Access to all other locations is unrestricted. 1 All QADC64E registers and CCW/result tables are designated as supervisor-only data space. 9:15 -- 14.3.1.1 Description Stop Enable. Refer to Section 14.3.1.1, "Low Power Stop Mode" for more information. 0 Disable stop mode 1 Enable stop mode Freeze Enable. Refer to Section 14.3.1.2, "Freeze Mode" for more information. 0 Ignores the IMB3 internal FREEZE signal 1 Finish any conversion in progress, then freeze Reserved Lock/Unlock QADC Mode of operation as defined by FLIP bit. Refer to Section 14.3.1.3, "Switching Between Legacy and Enhanced Modes of Operation" for more information. 0 QADC mode is locked 1 QADC mode is unlocked and changeable using FLIP bit Reserved. Low Power Stop Mode When the STOP bit in the QADCMCR is set, the QADC64E clock (QCLK) which clocks the A/D converter, is disabled and the analog circuitry is powered down. This results in a static, low power consumption, idle condition. The stop mode aborts any conversion sequence in progress. Because the bias currents to the analog circuits are turned off in stop mode, the QADC64E requires some recovery time (TSR in Appendix F: Electricl Characteristics) to stabilize the analog circuits after the stop enable bit is cleared. MPC561/MPC563 Reference Manual, Rev. 1.2 14-8 Freescale Semiconductor QADC64E Enhanced Mode Operation In stop mode: * BIU state machine and logic do not shut down * The CCW and Result RAM is not reset and is not accessible * The module configuration register (QADCMCR), the interrupt register (QADCINT), and the test register (QADCTEST) are fully accessible and are not reset * The data direction register (DDRQA), port data register (PORTQA/PORTQB), and control register 0 (QACR0) are not reset and are read-only accessible * Control register 1 (QACR1), control register 2 (QACR2), and the status registers (QASR0 and QASR1) are reset and are read-only accessible * In addition, the periodic/interval timer is held in reset during stop mode If the STOP bit is clear, stop mode is disabled. 14.3.1.2 Freeze Mode Freeze mode occurs when background debug mode is enabled in the USIU and a breakpoint is encountered. This is indicated by the assertion of the internal FREEZE line on the IMB3. The FRZ bit in the QADCMCR determines whether or not the QADC64E responds to an IMB3 internal FREEZE signal assertion. Freeze is very useful when debugging an application. When the internal FREEZE signal is asserted and the FRZ bit is set, the QADC64E finishes any conversion in progress and then freezes. Depending on when the FREEZE signal is asserted, there are three possible queue "freeze" scenarios: * When a queue is not executing, the QADC64E freezes immediately * When a queue is executing, the QADC64E completes the conversion in progress and then freezes * If, during the execution of the current conversion, the queue operating mode for the active queue is changed, or a queue 2 abort occurs, the QADC64E freezes immediately During freeze mode, both the analog clock, QCLK, and periodic/interval timer are held in reset. When the QADC64E enters the freeze mode while a queue is active, the current CCW location of the queue pointer is saved. During freeze, the analog clock, QCLK, is held in reset and the periodic/interval timer is held in reset. External trigger events that occur during the freeze mode are not captured. The BIU remains active to allow IMB3 access to all QADC64E registers and RAM. Although the QADC64E saves a pointer to the next CCW in the current queue, the software can force the QADC64E to execute a different CCW by writing new queue operating modes for normal operation. The QADC64E looks at the queue operating modes, the current queue pointer, and any pending trigger events to decide which CCW to execute when exiting freeze. If the FRZ bit is clear, the internal FREEZE signal is ignored. 14.3.1.3 Switching Between Legacy and Enhanced Modes of Operation The LOCK and FLIP bits of the QADCMCR register control the operating mode of the QADC64E modules. Out of reset, the QADC64E modules are in legacy mode (FLIP = 0) and the LOCK bit is clear, MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-9 QADC64E Enhanced Mode Operation indicating that the module is locked in legacy mode. In order to change the value of the FLIP bit, the operating mode must first be unlocked by setting the LOCK bit. Only then can the FLIP bit be changed. Finally, the LOCK bit must be cleared again to protect the state of the FLIP bit from future writes. 1. Write LOCK = 1 to unlock operating mode bit. 2. Modify the value of FLIP as required. -- FLIP = 0 legacy mode enabled -- FLIP = 1 enhanced mode enabled 3. Write LOCK = 0 and new FLIP bit value to preserve the value of FLIP bit * Example 1: switching from legacy mode to enhanced mode -- QADCMCR = 0x280; LOCK =1, SUPV = 1 -- QADCMCR = 0x380; LOCK =1, write FLIP = 1, SUPV = 1 -- QADCMCR = 0x180; LOCK = 0, FLIP = 1, SUPV = 1 Subsequent writes to the FLIP bit will have no effect while LOCK = 0. * Example 2: switching from enhanced mode to legacy mode -- QADCMCR = 0x280 or 0x380; LOCK = 1, SUPV =1 (Can write FLIP = x since value will not change) -- QADCMCR = 0x280; LOCK = 1, FLIP = 0, SUPV = 1 -- QADCMCR = 0x080; LOCK = 0, FLIP = 0, SUPV =1 14.3.1.4 Supervisor/Unrestricted Address Space The QADC64E memory map is divided into two segments: supervisor-only data space and assignable data space. Access to supervisor-only data space is permitted only when the software is operating in supervisor access mode. Assignable data space can be either restricted to supervisor-only access or unrestricted to both supervisor and user data space accesses. The SUPV bit in the QADCMCR designates the assignable space as supervisor or unrestricted. The following information applies to accesses to address space located within the module's 16-bit boundaries and where the response is a bus error. See Table 14-6 for more information. * Attempts to read a supervisor-only data space when not in the supervisor access mode and SUPV = 1, causes the bus master to assert a bus error condition. No data is returned. If SUPV = 0, the QADC64E asserts a bus error condition and no data is returned. * Attempts to write to supervisor-only data space when not in the supervisor access mode and SUPV = 1, causes the bus master to assert a bus error condition. No data is written. If SUPV = 0, the QADC64E asserts a bus error condition and the register is not written. * Attempts to read unimplemented data space in the unrestricted access mode and SUPV = 1, causes the bus master to assert a bus error condition and no data is returned. In all other attempts to read unimplemented data space, the QADC64E causes a bus error condition and no data is returned. * Attempts to write unimplemented data space in the unrestricted access mode and SUPV= 1, causes the bus master to assert a bus error condition and no data is written. In all other MPC561/MPC563 Reference Manual, Rev. 1.2 14-10 Freescale Semiconductor QADC64E Enhanced Mode Operation * * attempts to write unimplemented data space, the QADC64E causes a bus error condition and no data is written. Attempts to read assignable data space in the unrestricted access mode when the space is programmed as supervisor space causes the bus master to assert a bus error condition and no data is returned. Attempts to write assignable data space in the unrestricted access mode when the space is programmed as supervisor space causes the bus master to assert a bus error condition and the register is not written. Table 14-6. QADC64E Bus Error Response S/U1 Mode SUPV Bit Supervisor-Only Register Supervisor/ Unrestricted Register Reserved/ Unimplemented Register U 0 QADC64E bus error2 Valid access4 QADC64E bus error2 U 1 Master bus error3 Master bus error3 Master bus error3 S 0 Valid access Valid access QADC64E bus error2 S 1 Valid access Valid access QADC64E bus error2 1 S/U = Supervisor/Unrestricted QADC64E bus error = Caused by QADC64E 3 Master bus error = Caused by bus master 4 Access to QADCTEST register will act as a reserved/unimplemented register unless in factory test mode 2 The bus master indicates the supervisor and user space access with the function code bits (FC[2:0]) on the IMB3. For privilege violations, refer to Chapter 9, "External Bus Interface" to determine the consequence of a bus error cycle termination. The supervisor-only data space segment contains the QADC64E global registers, which include the QADCMCR, QADCINT and QADCTEST. The supervisor/unrestricted space designation for the CCW table, the result word table and the remaining QADC64E registers is programmable. 14.3.2 QADC64E Interrupt Register QADCINT specifies the priority level of QADC64E interrupt requests. The interrupt level for queue 1 and queue 2 may be different. The interrupt register is read/write accessible in supervisor data space only. The implemented interrupt register fields can be read and written, reserved bits read zero and writes have no effect. They are typically written once when the software initializes the QADC64E, and not changed afterwards. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-11 QADC64E Enhanced Mode Operation MSB LSB 0 1 Field 2 3 4 5 6 IRL1 7 8 9 10 11 IRL2 12 13 14 15 -- 0000_0000_0000_0000 SRESET Addr 0x30 4804 (QADCINT_A); 0x30 4C04 (QADCINT_B) Figure 14-5. QADC Interrupt Register (QADCINT) Table 14-7. QADCINT Bit Descriptions Bits Name Description 0:4 IRL1 Queue 1 Interrupt Request Level. The IRL1 field establishes the queue 1 interrupt request level. The 00000 state provides a level 0 interrupt while 11111 provides a level 31 interrupt. All interrupts are presented on the IMB3. Interrupt level priority software determines which level has the highest priority request. 5:9 IRL2 Queue 2 Interrupt Request Level. The IRL2 field establishes the queue 2 interrupt request level. The 00000 state provides a level 0 interrupt while 11111 provides a level 31 interrupt. All interrupts are presented on the IMB3. Interrupt level priority software determines which level has the highest priority request. 10:15 -- Reserved. The QADC64E conditionally generates interrupts to the bus master via the IMB3 IRQ signals. When the QADC64E sets a status bit assigned to generate an interrupt, the QADC64E drives the IRQ bus. The value driven onto IRQ[7:0] represents the interrupt level assigned to the interrupt source. Under the control of ILBS, each interrupt request level is driven during the time multiplexed bus during one of four different time slots, with eight levels communicated per time slot. No hardware priority is assigned to interrupts. Furthermore, if more than one source on a module requests an interrupt at the same level, the system software must assign a priority to each source requesting at that level. Figure 14-6 displays the interrupt levels on IRQ with ILBS. Refer to Chapter 12, "U-Bus to IMB3 Bus Interface (UIMB)" for more information. IMB3 CLOCK ILBS [1:0] 00 IMB3 IRQ [7:0] 01 10 11 00 01 IRQ 7:0 IRQ 15:8 IRQ 23:16 IRQ 31:24 IRQ 7:0 10 11 Figure 14-6. Interrupt Levels on IRQ with ILBS 14.3.3 Port Data Register QADC64E ports A and B are accessed through two 8-bit port data registers, PORTQA and PORTQB. MPC561/MPC563 Reference Manual, Rev. 1.2 14-12 Freescale Semiconductor QADC64E Enhanced Mode Operation Port A signals are referred to as PQA[7:0] when used as 8-bit general-purpose digital input or output signals. It is configured as a digital input or digital output using the data direction register, DDRQA. When Port A is configured as an input, a read of the PORTQA register returns the actual PQA[7:0] signal values. When Port A is configured as an output, the contents of port register PQA are driven on the port A signals. Port A can also be used as analog inputs AN[59:52] and external multiplexer address outputs MA[2:0]. Port B signals are referred to as PQB[7:0] when used as 8-bit general-purpose digital input or output signals. It is configured as a digital input or digital output using the data direction register, DDRQB. When Port B is configured as an input, a read of the PORTQB register returns the actual PQB[7:0] signal values. When Port B is configured as an output, the contents of port register PQB are driven on the port B signals. Port B can also be used as non-multiplexed analog inputs AN[51:44]. In external multiplexed mode four signals can be used as multiplexer analog inputs, ANw, ANx, ANy, ANz. During a port data register read, the actual value of the signal is reported when its corresponding bit in the data direction register defines the signal to be an input. When the data direction bit specifies the signal to be an output, the content of the port data register is read. PORTQA and PORTQB are not initialized by reset.. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Field PQA7 PQA6 PQA5 PQA4 PQA3 PQA2 PQA1 PQA0 PQB7 PQB6 PQB5 PQB4 PQB3 PQB2 PQB1 PQB0 SRESET Addr Undefined Undefined (PORTQA) 0x30 4806; 0x30 4C06 (PORTQB) 0x30 4807; 0x30 4C07 ANALOG CHANNEL: AN59 AN58 AN57 AN56 AN55 AN54 AN53 AN52 AN51 AN50 AN49 AN48 AN47 AN46 AN45 AN44 MULTIPLEXED ADDRESS OUTPUTS: MA2 MA1 MA0 MULTIPLEXED ANALOG INPUTS: ANz ANy ANx ANw Figure 14-7. Port A Data Register (PORTQA), Port B Data Register (PORTQB) Table 14-8. PORTQA, PORTQB Bit Descriptions Bits Name 0:7 PQA[7:0] Port A signals are referred to as PQA when used as an 8-bit input/output port. Port A can also be used for analog inputs (AN[59:52]), and external multiplexer address outputs (MA[2:0]). 8:15 PQB[7:0] Port B signals are referred to as PQB when used as an 8-bit input/output port. Port B can also be used for non-mulitplexed (AN[51:44]) and multiplexed (ANz, ANy, ANx, ANw) analog inputs. 14.3.4 Description Port Data Direction Register The port data direction registers (DDRQA and DDRQB) are associated with the Port A and Port B digital I/O signals. Refer to Appendix F, "Electrical Characteristics," for more information. Any bit set to one in this register configures the corresponding signal as an output. Any bit cleared to zero in this register MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-13 QADC64E Enhanced Mode Operation configures the corresponding signal as an input. The software is responsible for ensuring that DDR bits are not set to one on signals used for analog inputs. When the DDR bit is set to one and the signal is selected for analog conversion, the voltage sampled is that of the output digital driver as influenced by the load. NOTE Caution should be exercised when mixing digital and analog inputs. This should be isolated as much as possible. Rise and fall times should be as large as possible to minimize AC coupling effects. There are two special cases to consider for the digital I/O port operation. When QACR0[EMUX] bit is set, enabling external multiplexing, the data direction register settings are ignored for the bits corresponding to PORTQA[2:0], which are the three multiplexed address output signals, MA[2:0]. The MA[2:0] signals are forced to be digital outputs, regardless of the data direction setting, and the multiplexed address outputs are driven. The data returned during a port data register read is the value of the multiplexed address latches which drive MA[2:0], regardless of the data direction setting. MSB LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Field DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ DDQ A7 A6 A5 A4 A3 A2 A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 SRESET 0000_0000_0000_0000 Addr 0x30 4808 (DDRQA_A); 0x30 4C08 (DDRQA_B); 0x30 4809 (DDRQB_A); 0x30 4C09 (DDRQB_B) Figure 14-8. Portx Data Direction Register (DDRQA and DDRQB) 14.3.5 Control Register 0 Control Register 0 defines whether external multiplexing is enabled, assigns external triggers to the conversion queues and sets up the QCLK prescaler parameter field. All of the implemented control register fields can be read or written but reserved fields read zero and writes have no effect. Typically, they are written once when software initializes the QADC64E and are not changed afterwards. MSB 0 Field SRESET Addr LSB 1 -- EMUX 0 2 0 3 4 5 0 7 8 9 10 11 -- TRG 0 6 0 0 0 12 13 14 15 1 1 PRESCALER 0 0 0 0 1 0 0 0x30 480A (QACR0_A); 0x30 4C0A (QACR0_B) Figure 14-9. Control Register 0 (QACR0) MPC561/MPC563 Reference Manual, Rev. 1.2 14-14 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-9. QACR0 Bit Descriptions Bits Name Description 0 EMUX Externally Multiplexed Mode. The EMUX bit allows the software to select the externally multiplexed mode, which affects the interpretation of the channel numbers and forces the MA0, MA1 and MA2 signals to be outputs. 0 Internally multiplexed, 16 possible channels 1 Externally multiplexed, up to 41 possible channels See Table 14-4 for more information. 1:2 -- 3 TRG 4:8 -- 9:15 Reserved Trigger Assignment. The TRG bit allows the software to assign the ETRIG[2:1] signals to queue 1 and queue 2. 0 ETRIG1 triggers queue 1, ETRIG2 triggers queue 2 1 ETRIG1 triggers queue 2, ETRIG2 triggers queue 1 Refer to Section 14.6.2, "External Trigger Input Signals." Reserved PRESCALER Prescaler Value. The PRESCALER value determines the QCLK frequency (fQCLK). Refer to Appendix F, "Electrical Characteristics," for more information on the QADC64E operating clock frequency (fQCLK) values. fQCLK can range from 2-to-128 system clock cycles (fSYSCLK). To keep fQCLK within the specified range, the value of PRESCALER+1 is the fSYSCLK divisor. Refer to Section 14.4.5, "QADC64E Clock (QCLK) Generation" for more information on selecting a PRESCALER value. Table 14-10 displays the bits in PRESCALER field which enable a range of QCLK frequencies Table 14-10. Prescaler fSYSCLK Divide-by Values Prescaler [6:0] fSYSCLK Div Prescaler [6:0] fSYSCLK Div Prescaler [6:0] fSYSCLK Div Prescaler [6:0] fSYSCLK Div 0000000 2 0100000 33 1000000 65 1100000 97 0000001 2 0100001 34 1000001 66 1100001 98 0000010 3 0100010 35 1000010 67 1100010 99 0000011 4 0100011 36 1000011 68 1100011 100 0000100 5 0100100 37 1000100 69 1100100 101 0000101 6 0100101 38 1000101 70 1100101 102 0000110 7 0100110 39 1000110 71 1100110 103 0000111 8 0100111 40 1000111 72 1100111 104 0001000 9 0101000 41 1001000 73 1101000 105 0001001 10 0101001 42 1001001 74 1101001 106 0001010 11 0101010 43 1001010 75 1101010 107 0001011 12 0101011 44 1001011 76 1101011 108 0001100 13 0101100 45 1001100 77 1101100 109 0001101 14 0101101 46 1001101 78 1101101 110 0001110 15 0101110 47 1001110 79 1101110 111 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-15 QADC64E Enhanced Mode Operation Table 14-10. Prescaler fSYSCLK Divide-by Values (continued) 14.3.6 Prescaler [6:0] fSYSCLK Div Prescaler [6:0] fSYSCLK Div Prescaler [6:0] fSYSCLK Div Prescaler [6:0] fSYSCLK Div 0001111 16 0101111 48 1001111 80 1101111 112 0010000 17 0110000 49 1010000 81 1110000 113 0010001 18 0110001 50 1010001 82 1110001 114 0010010 19 0110010 51 1010010 83 1110010 115 0010011 20 0110011 52 1010011 84 1110011 116 0010100 21 0110100 53 1010100 85 1110100 117 0010101 22 0110101 54 1010101 86 1110101 118 0010110 23 0110110 55 1010110 87 1110110 119 0010111 24 0110111 56 1010111 88 1110111 120 0011000 25 0111000 57 1011000 89 1111000 121 0011001 26 0111001 58 1011001 90 1111001 122 0011010 27 0111010 59 1011010 91 1111010 123 0011011 28 0111011 60 1011011 92 1111011 124 0011100 29 0111100 61 1011100 93 1111100 125 0011101 30 0111101 62 1011101 94 1111101 126 0011110 31 0111110 63 1011110 95 1111110 127 0011111 32 0111111 64 1011111 96 1111111 128 Control Register 1 Control register 1 is the mode control register for the operation of queue 1. The applications software defines the queue operating mode for the queue, and may enable a completion and/or pause interrupt. All of the control register fields are read/write data. However, the SSE1 bit always reads as zero unless the test mode is enabled. Most of the bits are typically written once when the software initializes the QADC64E, and not changed afterwards. MSB 0 Field CIE1 SRESET Addr LSB 1 2 PIE1 SSE1 3 4 5 6 7 8 9 10 11 MQ1 12 13 14 15 -- 0000_0000_0000_0000 0x30 480C (QACR1_A); 0x30 4C0C (QACR1_B) Figure 14-10. Control Register 1 (QACR1) MPC561/MPC563 Reference Manual, Rev. 1.2 14-16 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-11. QACR1 Bit Descriptions Bits Name Description 0 CIE1 Queue 1 Completion Interrupt Enable. CIE1 enables an interrupt upon completion of queue 1. The interrupt request is initiated when the conversion is complete for the CCW in queue 1. 0 Disable the queue completion interrupt associated with queue 1 1 Enable an interrupt after the conversion of the sample requested by the last CCW in queue 1 1 PIE1 Queue 1 Pause Interrupt Enable. PIE1 enables an interrupt when queue 1 enters the pause state. The interrupt request is initiated when conversion is complete for a CCW that has the pause bit set. 0 Disable the pause interrupt associated with queue 1 1 Enable an interrupt after the conversion of the sample requested by a CCW in queue 1 which has the pause bit set 2 SSE1 Queue 1 Single-Scan Enable Bit. SSE1 enables a single-scan of queue 1 to start after a trigger event occurs. The SSE1 bit may be set to a one during the same write cycle when the MQ1 bits are set for one of the single-scan queue operating modes. The single-scan enable bit can be written as a one or a zero, but is always read as a zero. The SSE1 bit enables a trigger event to initiate queue execution for any single-scan operation on queue 1. The QADC64E clears the SSE1 bit when the single-scan is complete. Refer to Table 14-12 for more information. 0 Trigger events are not accepted for single-scan modes 1 Accept a trigger event to start queue 1 in a single-scan mode 3:7 MQ1 Queue 1 Operating Mode. The MQ1 field selects the queue operating mode for queue 1. Table 14-12 shows the bits in the MQ1 field which enable different queue 1 operating mode 8:15 -- Reserved Table 14-12. Queue 1 Operating Modes MQ1[3:7] Operating Modes 00000 Disabled mode, conversions do not occur 00001 Software triggered single-scan mode (started with SSE1) 00010 External trigger rising edge single-scan mode 00011 External trigger falling edge single-scan mode 00100 Interval timer single-scan mode: time = QCLK period x 27 00101 Interval timer single-scan mode: time = QCLK period x 28 00110 Interval timer single-scan mode: time = QCLK period x 29 00111 Interval timer single-scan mode: time = QCLK period x 210 01000 Interval timer single-scan mode: time = QCLK period x 211 01001 Interval timer single-scan mode: time = QCLK period x 212 01010 Interval timer single-scan mode: time = QCLK period x 213 01011 Interval timer single-scan mode: time = QCLK period x 214 01100 Interval timer single-scan mode: time = QCLK period x 215 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-17 QADC64E Enhanced Mode Operation Table 14-12. Queue 1 Operating Modes (continued) MQ1[3:7] 14.3.7 Operating Modes 01101 Interval timer single-scan mode: time = QCLK period x 216 01110 Interval timer single-scan mode: time = QCLK period x 217 01111 External gated single-scan mode (started with SSE1) 10000 Reserved mode 10001 Software triggered continuous-scan mode 10010 External trigger rising edge continuous-scan mode 10011 External trigger falling edge continuous-scan mode 10100 Periodic timer continuous-scan mode: time = QCLK period x 27 10101 Periodic timer continuous-scan mode: time = QCLK period x 28 10110 Periodic timer timer continuous-scan mode: time = QCLK period x 29 10111 Periodic timer continuous-scan mode: time = QCLK period x 210 11000 Periodic timer continuous-scan mode: time = QCLK period x 211 11001 Periodic timer continuous-scan mode: time = QCLK period x 212 11010 Periodic timer continuous-scan mode: time = QCLK period x 21 11011 Periodic timer continuous-scan mode: time = QCLK period x 214 11100 Periodic timer continuous-scan mode: time = QCLK period x 215 11101 Periodic timer continuous-scan mode: time = QCLK period x 216 11110 Periodic timer continuous-scan mode: time = QCLK period x 217 11111 External gated continuous-scan mode Control Register 2 Control register 2 is the mode control register for the operation of queue 2. Software specifies the queue operating mode of queue 2, and may enable a completion and/or a pause interrupt. All control register fields are read/write data, except the SSE2 bit, which is readable only when the test mode is enabled. Most of the bits are typically written once when the software initializes the QADC64E, and not changed afterwards. MSB 0 Field CIE2 SRESET Addr 0 LSB 1 2 PIE2 SSE2 0 0 3 4 5 6 7 8 9 10 11 12 13 MQ2 RESUME BQ2 0_0000 0 111_1111 14 15 0x30 480E (QACR2_A), 0x30 4C0E (QACR2_B) Figure 14-11. Control Register 2 (QACR2) MPC561/MPC563 Reference Manual, Rev. 1.2 14-18 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-13. QACR2 Bit Descriptions Bits Name Description 0 CIE2 Queue 2 Completion Software Interrupt Enable. CIE2 enables an interrupt upon completion of queue 2. The interrupt request is initiated when the conversion is complete for the CCW in queue 2. 0 Disable the queue completion interrupt associated with queue 2 1 Enable an interrupt after the conversion of the sample requested by the last CCW in queue 2 1 PIE2 Queue 2 Pause Software Interrupt Enable. PIE2 enables an interrupt when queue 2 enters the pause state. The interrupt request is initiated when conversion is complete for a CCW that has the pause bit set. 0 Disable the pause interrupt associated with queue 2 1 Enable an interrupt after the conversion of the sample requested by a CCW in queue 2 which has the pause bit set 2 SSE2 Queue 2 Single-Scan Enable Bit. SSE2 enables a single-scan of queue 2 to start after a trigger event occurs. The SSE2 bit may be set to a one during the same write cycle when the MQ2 bits are set for one of the single-scan queue operating modes. The single-scan enable bit can be written as a one or a zero, but is always read as a zero. The SSE2 bit enables a trigger event to initiate queue execution for any single-scan operation on queue 2. The QADC64E clears the SSE2 bit when the single-scan is complete. Refer to Table 14-14 for more information. 0 Trigger events are not accepted for single-scan modes 1 Accept a trigger event to start queue 2 in a single-scan mode 3:7 MQ2 Queue 2 Operating Mode. The MQ2 field selects the queue operating mode for queue 2. Refer to Table 14-14 for more information. 8 RESUME 0 After suspension, begin executing with the first CCW in queue 2 or the current sub-queue 1 After suspension, begin executing with the aborted CCW in queue 2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-19 QADC64E Enhanced Mode Operation Table 14-13. QACR2 Bit Descriptions (continued) Bits Name Description 9:15 BQ2 Beginning of queue 2. The BQ2 field indicates the CCW location where queue 2 begins. To allow the length of queue 1 and queue 2 to vary, a programmable pointer identifies the CCW table location where queue 2 begins. The BQ2 field also serves as an end-of-queue condition for queue 1. Setting BQ2 beyond physical CCW table memory space allows queue 1 all 64 entries. Software defines the beginning of queue 2 by programming the BQ2 field in QACR2. BQ2 is usually programmed before or at the same time as the queue operating mode for queue 2 is selected. If BQ2 is 64 or greater, queue 2 has no entries, and the entire CCW table is dedicated to queue 1 and CCW63 is the end-of-queue 1. If BQ2 is zero, the entire CCW table is dedicated to queue 2. As a special case, when a queue operating mode for queue 1 is selected and a trigger event occurs for queue 1 with BQ2 set to zero, queue 1 execution is terminated after CCW0 is read. Conversions do not occur. The BQ2 pointer may be changed dynamically, to alternate between queue 2 scan sequences. A change in BQ2 after queue 2 has begun or if queue 2 has a trigger pending does not affect queue 2 until queue 2 is started again.For example, two scan sequences could be defined as follows: the first sequence starts at CCW10, with a pause after CCW11 and an EOQ programmed in CCW15; the second sequence starts at CCW16, with a pause after CCW17 and an EOQ programmed in CCW39. With BQ2 set to CCW10 and the continuous-scan mode selected, queue execution begins. When the pause is encountered in CCW11, a software interrupt routine can redefine BQ2 to be CCW16. Therefore, after the end-of-queue is recognized in CCW15, an internal retrigger event is generated and execution restarts at CCW16. When the pause software interrupt occurs again, software can change BQ2 back to CCW10. After the end-of-queue is recognized in CCW39, an internal retrigger event is created and execution now restarts at CCW10. If BQ2 is changed while queue 1 is active, the effect of BQ2 as an end-of-queue indication for queue 1 is immediate. However, beware of the risk of losing the end-of-queue 1 through moving BQ2. Recommend use of EOQ (chan63) to end queue 1. Note: Be sure to do a mode change when changing BQ2 and setting SSE2. Setting BQ2 first is recommended. Table 14-14 shows the bits in the MQ2 field which enable different queue 2 operating modes. Table 14-14. Queue 2 Operating Modes MQ2[3:7] Operating Modes 00000 Disabled mode, conversions do not occur 00001 Software triggered single-scan mode (started with SSE2) 00010 External trigger rising edge single-scan mode 00011 External trigger falling edge single-scan mode 00100 Interval timer single-scan mode: time = QCLK period x 27 00101 Interval timer single-scan mode: time = QCLK period x 28 00110 Interval timer single-scan mode: time = QCLK period x 29 00111 Interval timer single-scan mode: time = QCLK period x 210 01000 Interval timer single-scan mode: time = QCLK period x 211 01001 Interval timer single-scan mode: time = QCLK period x 212 MPC561/MPC563 Reference Manual, Rev. 1.2 14-20 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-14. Queue 2 Operating Modes (continued) MQ2[3:7] Operating Modes 01010 Interval timer single-scan mode: time = QCLK period x 213 01011 Interval timer single-scan mode: time = QCLK period x 214 01100 Interval timer single-scan mode: time = QCLK period x 215 01101 Interval timer single-scan mode: time = QCLK period x 216 01110 Interval timer single-scan mode: time = QCLK period x 217 01111 Reserved mode 10000 Reserved mode 10001 Software triggered continuous-scan mode 10010 External trigger rising edge continuous-scan mode 10011 External trigger falling edge continuous-scan mode 10100 Periodic timer continuous-scan mode: time = QCLK period x 27 10101 Periodic timer continuous-scan mode: time = QCLK period x 28 10110 Periodic timer continuous-scan mode: time = QCLK period x 29 10111 Periodic timer continuous-scan mode: time = QCLK period x 210 11000 Periodic timer continuous-scan mode: time = QCLK period x 211 11001 Periodic timer continuous-scan mode: time = QCLK period x 212 11010 Periodic timer continuous-scan mode: time = QCLK period x 213 11011 Periodic timer continuous-scan mode: time = QCLK period x 214 11100 Periodic timer continuous-scan mode: time = QCLK period x 215 11101 Periodic timer continuous-scan mode: time = QCLK period x 216 11110 Periodic timer continuous-scan mode: time = QCLK period x 217 11111 Reserved mode NOTE If BQ2 was assigned to the CCW that queue 1 is currently working on, then that conversion is completed before BQ2 takes effect. Each time a CCW is read for queue 1, the CCW location is compared with the current value of the BQ2 pointer to detect a possible end-of-queue condition. For example, if BQ2 is changed to CCW3 while queue 1 is converting CCW2, queue 1 is terminated after the conversion is completed. However, if BQ2 is changed to CCW1 while queue 1 is converting CCW2, the QADC64E would not recognize a BQ2 end-of-queue condition until queue 1 execution reached CCW1 again, presumably on the next pass through the queue. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-21 QADC64E Enhanced Mode Operation 14.3.8 Status Registers (QASR0 and QASR1) The status registers contains information about the state of each queue and the current A/D conversion. Except for the four flag bits (CF1, PF1, CF2, and PF2) and the two trigger overrun bits (TOR1 and TOR2), all of the status register fields contain read-only data. The four flag bits and the two trigger overrun bits are cleared by writing a zero to the bit after the bit was previously read as a one. MSB 0 Field CF1 LSB 1 2 3 PF1 CF2 PF2 SRESET 4 5 6 TOR1 TOR2 7 8 9 10 QS 11 12 13 14 15 CWP 0000_0000_0000_0000 Addr 0x30 4810 (QASR0_A); 0x30 4C10 (QASR0_B) Figure 14-12. Status Register 0 (QASR0) Table 14-15. QASR0 Bit Descriptions Bits Name Description 0 CF1 Queue 1 Completion Flag. CF1 indicates that a queue 1 scan has been completed. The scan completion flag is set by the QADC64E when the input channel sample requested by the last CCW in queue 1 is converted, and the result is stored in the result table. The end-of-queue 1 is identified when execution is complete on the CCW in the location prior to that pointed to by BQ2, when the current CCW contains an end-of-queue code instead of a valid channel number, or when the currently completed CCW is in the last location of the CCW RAM. When CF1 is set and interrupts are enabled for that queue completion flag, the QADC64E asserts an interrupt request at the level specified by IRL1 in the interrupt register (QADCINT). The software reads the completion flag during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to the completion flag bit, when the bit was previously read as a one. Once set, only software or reset can clear CF1. CF1 is maintained by the QADC64E regardless of whether the corresponding interrupt is enabled. The software polls for CF1 bit to see if it is set. This allows the software to recognize that the QADC64E is finished with a queue 1 scan. The software acknowledges that it has detected the completion flag being set by writing a zero to the completion flag after the bit was read as a one. MPC561/MPC563 Reference Manual, Rev. 1.2 14-22 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-15. QASR0 Bit Descriptions (continued) Bits Name Description 1 PF1 Queue 1 Pause Flag. PF1 indicates that a queue 1 scan has reached a pause. PF1 is set by the QADC64E when the current queue 1 CCW has the pause bit set, the selected input channel has been converted, and the result has been stored in the result table. Once PF1 is set, the queue enters the paused state and waits for a trigger event to allow queue execution to continue. However, if the CCW with the pause bit set is the last CCW in a queue, the queue execution is complete. The queue status becomes idle, not paused, and both the pause and completion flags are set. Another exception occurs in software controlled mode, where the PF1 can be set but queue 1 never enters the pause state since queue 1 continues without pausing. When PF1 is set and interrupts are enabled for the corresponding queue, the QADC64E asserts an interrupt request at the level specified by IRL1 in the interrupt register. The software may read PF1 during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to PF1, when the bit was previously read as a one. Once set, only software or reset can clear PF1. In external gated single-scan and continuous-scan mode the definition of PF1 has been redefined. When the gate closes before the end-of-queue 1 is reached, PF1 becomes set to indicate that an incomplete scan has occurred.In single-scan mode, setting PF1 can be used to cause an interrupt and software can then determine if queue 1 should be enabled again. In either external gated mode, setting PF1 indicates that the results for queue 1 have not been collected during one scan (coherently). NOTE: If a pause in a CCW is encountered in external gated mode for either single-scan and continuous-scan mode, the pause flag will not set, and execution continues without pausing. This has allowed for the added definition of PF1 in the external gated modes. PF1 is maintained by the QADC64E regardless of whether the corresponding interrupts are enabled. The software may poll PF1 to find out when the QADC64E has reached a pause in scanning a queue.The software acknowledges that it has detected a pause flag being set by writing a zero to PF1 after the bit was last read as a one. 0 = queue 1 has not reached a pause (or gate has not closed before end-of-queue in gated mode) 1 = queue 1 has reached a pause (or gate closed before end-of-queue in gated mode) Refer to Table 14-16 for a summary of pause response in all scan modes. 2 CF2 Queue 2 Completion Flag. CF2 indicates that a queue 2 scan has been completed. CF2 is set by the QADC64E when the input channel sample requested by the last CCW in queue 2 is converted, and the result is stored in the result table. The end-of-queue 2 is identified when the current CCW contains an end-of-queue code instead of a valid channel number, or when the currently completed CCW is in the last location of the CCW RAM. When CF2 is set and interrupts are enabled for that queue completion flag, the QADC64E asserts an interrupt request at the level specified by IRL2 in the interrupt register (QADCINT). The software reads CF2 during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to the CF2 bit, when the bit was previously read as a one. Once set, only software or reset can clear CF2. CF2 is maintained by the QADC64E regardless of whether the corresponding interrupts are enabled. The software polls for CF2 to see if it is set. This allows the software to recognize that the QADC64E is finished with a queue 2 scan. The software acknowledges that it has detected the completion flag being set by writing a zero to the completion flag after the bit was read as a one. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-23 QADC64E Enhanced Mode Operation Table 14-15. QASR0 Bit Descriptions (continued) Bits Name Description 3 PF2 Queue 2 Pause Flag. PF2 indicates that a queue 2 scan has reached a pause. PF2 is set by the QADC64E when the current queue 2 CCW has the pause bit set, the selected input channel has been converted, and the result has been stored in the result table. Once PF2 is set, the queue enters the paused state and waits for a trigger event to allow queue execution to continue. However, if the CCW with the pause bit set is the last CCW in a queue, the queue execution is complete. The queue status becomes idle, not paused, and both the pause and completion flags are set. Another exception occurs in software controlled mode, where the PF2 can be set but queue 2 never enters the pause state. When PF2 is set and interrupts are enabled for the corresponding queue, the QADC64E asserts an interrupt request at the level specified by IRL2 in the interrupt register. The software reads PF2 during an interrupt service routine to identify the interrupt request. The interrupt request is cleared when the software writes a zero to PF2, when the bit was previously read as a one. Once set, only software or reset can clear PF2. PF2 is maintained by the QADC64E regardless of whether the corresponding interrupts are enabled. The software may poll PF2 to find out when the QADC64E has reached a pause in scanning a queue. The software acknowledges that it has detected a pause flag being set by writing a zero to PF2 after the bit was last read as a one. 0 queue 2 has not reached a pause 1 queue 2 has reached a pause Refer to Table 14-16 for a summary of pause response in all scan modes. 4 TOR1 Queue 1 Trigger Overrun. TOR1 indicates that an unexpected trigger event has occurred for queue 1. TOR1 can be set only while queue 1 is in the active state. A trigger event generated by a transition on the external trigger signal or by the periodic/interval timer may be captured as a trigger overrun. TOR1 cannot occur when the software initiated single-scan mode or the software initiated continuous-scan mode are selected. TOR1 occurs when a trigger event is received while a queue is executing and before the scan has completed or paused. TOR1 has no effect on the queue execution. After a trigger event has occurred for queue 1, and before the scan has completed or paused, additional queue 1 trigger events are not retained. Such trigger events are considered unexpected, and the QADC64E sets the TOR1 error status bit. An unexpected trigger event may be a system overrun situation, indicating a system loading mismatch. In external gated continuous-scan mode the definition of TOR1 has been redefined. In the case when queue 1 reaches an end-of-queue condition for the second time during an open gate, TOR1 becomes set. This is considered an overrun condition. In this case CF1 has been set for the first end-of-queue 1 condition and then TOR1 becomes set for the second end-of-queue 1 condition. For TOR1 to be set, software must not clear CF1 before the second end-of-queue 1. The software acknowledges that it has detected a trigger overrun being set by writing a zero to the trigger overrun, after the bit was read as a one. Once set, only software or reset can clear TOR1. 0 No unexpected queue 1 trigger events have occurred 1 At least one unexpected queue 1 trigger event has occurred (or queue 1 reaches an end-of-queue condition for the second time in gated mode) MPC561/MPC563 Reference Manual, Rev. 1.2 14-24 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-15. QASR0 Bit Descriptions (continued) Bits Name Description 5 TOR2 Queue 2 Trigger Overrun. TOR2 indicates that an unexpected trigger event has occurred for queue 2. TOR2 can be set when queue 2 is in the active, suspended, and trigger pending states. The TOR2 trigger overrun can only occur when using an external trigger mode or a periodic/interval timer mode. Trigger overruns cannot occur when the software initiated single-scan mode and the software initiated continuous-scan mode are selected. TOR2 occurs when a trigger event is received while queue 2 is executing, suspended, or a trigger is pending. TOR2 has no effect on the queue execution. A trigger event that causes a trigger overrun is not retained since it is considered unexpected. An unexpected trigger event may be a system overrun situation, indicating a system loading mismatch. The software acknowledges that it has detected a trigger overrun being set by writing a zero to the trigger overrun, after the bit was read as a one. Once set, only software or reset can clear TOR2. 0 No unexpected queue 2 trigger events have occurred 1 At least one unexpected queue 2 trigger event has occurred 6:9 QS Queue Status. The 4-bit read-only QS field indicates the current condition of queue 1 and queue 2. The following are the five queue status conditions: * Idle * Active * Paused * Suspended * Trigger pending The two most significant bits are associated primarily with queue 1, and the remaining two bits are associated with queue 2. Since the priority scheme between the two queues causes the status to be interlinked, the status bits are considered as one 4-bit field. Table 14-17 shows the bits in the QS field and how they affect the status of queue 1 and queue 2. Refer to Section 14.5, "Trigger and Queue Interaction Examples," which shows the 4-bit queue status field transitions in typical situations. 10:15 CWP Command Word Pointer. The CWP allows the software to know which CCW is executing at present, or was last completed. The command word pointer is a software read-only field, and write operations have no effect. The CWP allows software to monitor the progress of the QADC64E scan sequence. The CWP field is a CCW word pointer with a valid range of 0 to 63. When a queue enters the paused state, the CWP points to the CCW with the pause bit set. While in pause, the CWP value is maintained until a trigger event occurs on the same queue or the other queue. Usually, the CWP is updated a few clock cycles before the queue status field shows that the queue has become active. For example, software may read a CWP pointing to a CCW in queue 2, and the status field shows queue 1 paused, queue 2 trigger pending. When the QADC64E finishes the scan of the queue, the CWP points to the CCW where the end-of-queue condition was detected. Therefore, when the end-of-queue condition is a CCW with the EOQ code, the CWP points to the CCW containing the EOQ. When the last CCW in a queue is in the last CCW table location (CCW63), and it does not contain the EOQ code, the end-of-queue is detected when the following CCW is read, so the CWP points to word CCW0. Finally, when queue 1 operation is terminated after a CCW is read that is defined as BQ2, the CWP points to the same CCW as BQ2. During the stop mode, the CWP is reset to zero, since the control registers and the analog logic are reset. When the freeze mode is entered, the CWP is unchanged; it points to the last executed CCW. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-25 QADC64E Enhanced Mode Operation Table 14-16. Pause Response Scan Mode Q Operation PF Asserts? External Trigger Single-scan Pauses Yes External Trigger Continuous-scan Pauses Yes Periodic/Interval Timer Trigger Single-scan Pauses Yes Periodic/Interval Timer Continuous-scan Pauses Yes Software Initiated Single-scan Continues Yes Software Initiated Continuous-scan Continues Yes External Gated Single-scan Continues No External Gated Continuous-scan Continues No Table 14-17. Queue Status QS[9:6] Queue 1/Queue 2 States 0000 queue 1 idle, queue 2 idle 0001 queue 1 idle, queue 2 paused 0010 queue 1 idle, queue 2 active 0011 queue 1 idle, queue 2 trigger pending 0100 queue 1 paused, queue 2 idle 0101 queue 1 paused, queue 2 paused 0110 queue 1 paused, queue 2 active 0111 queue 1 paused, queue 2 trigger pending 1000 queue 1 active, queue 2 idle 1001 queue 1 active, queue 2 paused 1010 queue 1 active, queue 2 suspended 1011 queue 1 active, queue 2 trigger pending 1100 Reserved 1101 Reserved 1110 Reserved 1111 Reserved One or both queues may be in the idle state. When a queue is idle, CCWs are not being executed for that queue, the queue is not in the pause state, and there is not a trigger pending. The idle state occurs when a queue is disabled, when a queue is in a reserved mode, or when a queue is in a valid queue operating mode awaiting a trigger event to initiate queue execution. MPC561/MPC563 Reference Manual, Rev. 1.2 14-26 Freescale Semiconductor QADC64E Enhanced Mode Operation A queue is in the active state when a valid queue operating mode is selected, when the selected trigger event has occurred, or when the QADC64E is performing a conversion specified by a CCW from that queue. Only one queue can be active at a time. Either or both queues can be in the paused state. A queue is paused when the previous CCW executed from that queue had the pause bit set. The QADC64E does not execute any CCWs from the paused queue until a trigger event occurs. Consequently, the QADC64E can service queue 2 while queue 1 is paused. Only queue 2 can be in the suspended state. When a trigger event occurs on queue 1 while queue 2 is executing, the current queue 2 conversion is aborted. The queue 2 status is reported as suspended. Queue 2 transitions back to the active state when queue 1 becomes idle or paused. A trigger pending state is required since both queues cannot be active at the same time. The status of queue 2 is changed to trigger pending when a trigger event occurs for queue 2 while queue 1 is active. In the opposite case, when a trigger event occurs for queue 1 while queue 2 is active, queue 2 is aborted and the status is reported as queue 1 active, queue 2 suspended. So due to the priority scheme, only queue 2 can be in the trigger pending state. There are two transition cases which cause the queue 2 status to be trigger pending before queue 2 is shown to be in the active state. When queue 1 is active and there is a trigger pending on queue 2, after queue 1 completes or pauses, queue 2 continues to be in the trigger pending state for a few clock cycles. The following are fleeting status conditions: * Queue 1 idle with queue 2 trigger pending * Queue 1 paused with queue 2 trigger pending Figure 14-13 displays the status conditions of the queue status field as the QADC64E goes through the transition from queue 1 active to queue 2 active. Queue 1 Queue 2 Active Idle Active Trigger Pending Idle (Paused) Trigger Pending Idle (Paused) Active QADC64E QUEUE STATUS Figure 14-13. Queue Status Transition The queue status field is affected by the stop mode. Since all of the analog logic and control registers are reset, the queue status field is reset to queue 1 idle, queue 2 idle. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-27 QADC64E Enhanced Mode Operation During the freeze mode, the queue status field is not modified. The queue status field retains the status it held prior to freezing. As a result, the queue status can show queue 1 active, queue 2 idle, even though neither queue is being executed during freeze. MSB LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Field -- CWPQ1 -- CWPQ2 SRESET 00 11_1111 00 11_1111 Addr 14 15 0x30 4812 (QASR1_A); 0x30 4C12 (QASR1_B) Figure 14-14. Status Register 1 (QASR1) Table 14-18. QASR1 Bit Descriptions Bits Name 0:1 -- 2:7 CWPQ1 8:9 -- 10:15 CWPQ2 14.3.9 Description Reserved Command Word Pointer for Q1 . CWPQ1 allows the software to know what CCW was last completed for queue 1. This field is a software read-only field, and write operations have no effect. CWPQ1 allows software to read the last executed CCW in queue 1, regardless of which queue is active. The CWPQ1 field is a CCW word pointer with a valid range of 0 to 63. In contrast to CWP, CPWQ1 is updated when the conversion result is written. When the QADC64E finishes a conversion in queue 1, both the result register is written and the CWPQ1 are updated. Finally, when queue 1 operation is terminated after a CCW is read that is defined as BQ2, CWP points to BQ2 while CWPQ1 points to the last CCW queue 1. During the stop mode, the CWPQ1 is reset to 63, since the control registers and the analog logic are reset. When the freeze mode is entered, the CWPQ1 is unchanged; it points to the last executed CCW in queue 1. Reserved Command Word Pointer for Q2 . CWPQ2 allows the software to know what CCW was last completed for queue 2. This field is a software read-only field, and write operations have no effect. CWPQ2 allows software to read the last executed CCW in queue 2, regardless which queue is active. The CWPQ2 field is a CCW word pointer with a valid range of 0 to 63. In contrast to CWP, CPWQ2 is updated when the conversion result is written. When the QADC64E finishes a conversion in queue 2, both the result register is written and the CWPQ2 are updated. During the stop mode, the CWPQ2 is reset to 63, since the control registers and the analog logic are reset. When the freeze mode is entered, the CWP is unchanged; it points to the last executed CCW in queue 2. Conversion Command Word Table The conversion command word (CCW) table is a RAM, 64 words long on 16-bit address boundaries where 10-bits of each entry are implemented. A CCW can be programmed by the software to request a conversion of one analog input channel. The CCW table is written by software and is not modified by the QADC64E. Each CCW requests the conversion of an analog channel to a digital result. The CCW specifies the analog channel number, the input sample time, and whether the queue is to pause after the current CCW. The ten implemented bits of the CCW word are read/write data, where they may be written when the software MPC561/MPC563 Reference Manual, Rev. 1.2 14-28 Freescale Semiconductor QADC64E Enhanced Mode Operation initializes the QADC64E. The remaining 6-bits are unimplemented so these read as zeros, and write operations have no effect. Each location in the CCW table corresponds to a location in the result word table. When a conversion is completed for a CCW entry, the 10-bit result is written in the corresponding result word entry. The QADC64E provides 64 CCW table entries. The beginning of queue 1 is the first location in the CCW table. The first location of queue 2 is specified by the beginning of queue 2 pointer (BQ2) in QACR2. To dedicate the entire CCW table to queue 1, queue 2 is programmed to be in the disabled mode, and BQ2 is programmed to 64 or greater. To dedicate the entire CCW table to queue 2, queue 1 is programmed to be in the disabled mode, and BQ2 is specified as the first location in the CCW table Figure 14-15 illustrates the operation of the queue structure. Conversion Command Word (CCW) Table 0x200 (CCW0)1 Begin Queue 1 BQ2 End of Queue 1 Begin Queue 2 0x27E (CCW63)1 End of Queue 2 msb 6 Result Word Table A/D Converter 7 8 Channel Select, Sample, Hold, and Analog to Digital Conversion Result 63 lsb 15 9 P REF IST Result 0 CHAN P = Pause Until Next Trigger REF = Use Alternate Reference Voltage msb 0 78 lsb 15 Address Offsets: 0x280-0x2FF1 Result Right Justified, Unsigned Result Format 0 0 0 0 0 0 0 1 78 15 IST = Input Sample Time 0 0 0 0 0 0 S Result Left Justified, Signed Result Format CHAN = Channel Number and End_of_Queue Code 0 78 15 Result 0 0 0 0 0 0 Left Justified, Unsigned Result Format 10-bit Conversion Command Word (CCW) Format 0x300-0x37F1 S = Sign bit 0x380-0x3FF1 10-bit Result is Software Readable in Three Different 16-bit Formats NOTE 1: These offsets must be added to the module base address: A = 0x30 4800 or B = 0x30 4C00 Figure 14-15. QADC64E Conversion Queue Operation To prepare the QADC64E for a scan sequence, the software writes to the CCW table to specify the desired channel conversions. The software also establishes the criteria for initiating the queue execution by programming the queue operating mode. The queue operating mode determines what type of trigger event causes queue execution to begin. A "trigger event" is used to refer to any of the ways to cause the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-29 QADC64E Enhanced Mode Operation QADC64E to begin executing the CCWs in a queue or sub-queue. An "external trigger" is only one of the possible "trigger events." A scan sequence may be initiated by the following: * A software command * Expiration of the periodic/interval timer * External trigger signal * External gated signal (queue 1 only) The software also specifies whether the QADC64E is to perform a single pass through the queue or is to scan continuously. When a single-scan mode is selected, the software selects the queue operating mode and sets the single-scan enable bit. When a continuous-scan mode is selected, the queue remains active in the selected queue operating mode after the QADC64E completes each queue scan sequence. During queue execution, the QADC64E reads each CCW from the active queue and executes conversions in three stages: * Initial sample * Final sample * Resolution During initial sample, a buffered version of the selected input channel is connected to the sample capacitor at the input of the sample buffer amplifier. During the final sample period, the sample buffer amplifier is bypassed, and the multiplexer input charges the sample capacitor directly. Each CCW specifies a final input sample time of two or 16 QCLK cycles. When an analog-to-digital conversion is complete, the result is written to the corresponding location in the result word table. The QADC64E continues to sequentially execute each CCW in the queue until the end of the queue is detected or a pause bit is found in a CCW. When the pause bit is set in the current CCW, the QADC64E stops execution of the queue until a new trigger event occurs. The pause status flag bit is set, which may cause an interrupt to notify the software that the queue has reached the pause state. After the trigger event occurs, the paused state ends and the QADC64E continues to execute each CCW in the queue until another pause is encountered or the end of the queue is detected. The following indicate the end-of-queue condition: * The CCW channel field is programmed with 63 (0x3F) to specify the end of the queue * The end-of-queue 1 is implied by the beginning of queue 2, which is specified in the BQ2 field in QACR2 * The physical end of the queue RAM space defines the end of either queue When any of the end-of-queue conditions is recognized, a queue completion flag is set, and if enabled, an interrupt is issued to the software. The following situations prematurely terminate queue execution: * Since queue 1 is higher in priority than queue 2, when a trigger event occurs on queue 1 during queue 2 execution, the execution of queue 2 is suspended by aborting the execution of the CCW in progress, and the queue 1 execution begins. When queue 1 execution is completed, queue 2 MPC561/MPC563 Reference Manual, Rev. 1.2 14-30 Freescale Semiconductor QADC64E Enhanced Mode Operation * * * * conversions restart with the first CCW entry in queue 2 or the first CCW of the queue 2 sub-queue being executed when queue 2 was suspended. Alternately, conversions can restart with the aborted queue 2 CCW entry. The RESUME bit in QACR2 allows the software to select where queue 2 begins after suspension. By choosing to re-execute all of the suspended queue 2 queue and sub-queue CCWs, all of the samples are guaranteed to have been taken during the same scan pass. However, a high trigger event rate for queue 1 can prohibit the completion of queue 2. If this occurs, the software may choose to begin execution of queue 2 with the aborted CCW entry. Software can change the queue operating mode to disabled mode. Any conversion in progress for that queue is aborted. Putting a queue into the disabled mode does not power down the converter. Software can change the queue operating mode to another valid mode. Any conversion in progress for that queue is aborted. The queue restarts at the beginning of the queue, once an appropriate trigger event occurs. For low power operation, software can set the stop mode bit to prepare the module for a loss of clocks. The QADC64E aborts any conversion in progress when the stop mode is entered. When the freeze enable bit is set by software and the IMB3 internal FREEZE line is asserted, the QADC64E freezes at the end of the conversion in progress. When internal FREEZE is negated, the QADC64E resumes queue execution beginning with the next CCW entry. Refer to Section 14.4.7, "Configuration and Control Using the IMB3 Interface" for more information. MSB 0 LSB 1 Field 2 3 4 -- Reset 5 6 7 8 P REF IST 9 10 11 12 13 14 15 CHAN[6:0] Unaffected Addr 0x30 4A00 - 0x30 4A7F, 0x30 4E00 - 0x30 4E7F Figure 14-16. Conversion Command Word Table (CCW) Table 14-19. CCW Bit Descriptions Bits Name Description 0:5 -- Reserved 6 P Pause. The pause bit allows software to create sub-queues within queue 1 and queue 2. The QADC64E performs the conversion specified by the CCW with the pause bit set, and then the queue enters the pause state. Another trigger event causes execution to continue from the pause to the next CCW. 0 Do not enter the pause state after execution of the current CCW 1 Enter the pause state after execution of the current CCW NOTE: The pause bit will not cause the queue to pause in the software controlled modes or external gated modes. 7 REF Alternate Reference Enabled. Setting REF high in the CCW enables the use of an alternate reference. 0 VRH is used as high reference 1 AltRef signal is used as the high reference MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-31 QADC64E Enhanced Mode Operation Table 14-19. CCW Bit Descriptions (continued) Bits Name Description 8 IST Input Sample Time. The IST field allows software to specify the length of the sample window. Provision is made to vary the input sample time, through software control, to offer flexibility in the source impedance of the circuitry providing the QADC64E analog channel inputs. Longer sample times permit more accurate A/D conversions of signals with higher source impedances. The programmable sample time can also be used to increase the time interval between conversions to adjust the queue execution time or the sampling rate. 0 QCLK period x 2 1 QCLK period x 8 9:15 CHAN[6:0] Channel Number. The CHAN field selects the input channel number. The software programs the channel field of the CCW with the channel number corresponding to the analog input signal to be sampled and converted. The analog input signal channel number assignments and the signal definitions vary depending on whether the multiplexed or non-multiplexed mode is used by the application. As far as the queue scanning operations are concerned, there is no distinction between an internally or externally multiplexed analog input. Refer to Section 14.2.5, "External Multiplexing" for more information on external multiplexing. Table 14-20 and Table 14-21 show the channel number assignments Table 14-20. QADC64E_A Multiplexed Channel Assignments and Signal Designations Channel Number in CCW CHAN Field Multiplexed Input Signals Port Signal Name Analog Signal Name Other Functions / Descriptions Signal Type Binary Decimal ANw/A_PQB0 AN00 to AN07 -- Input 0000000 to 0000111 0 to 7 ANx/A_PQB1 AN08 to AN15 -- Input 0001000 to 0001111 8 to 15 ANy/A_PQB2 AN16 to AN23 -- Input 0010000 to 0010111 16 to 23 ANz/A_PQB3 AN24 to AN31 -- Input 0011000 to 0011111 24 to 31 -- RESERVED -- -- 0100000 to 0101001 32 to 41 -- RESERVED -- -- 0101010 42 -- RESERVED -- -- 0101011 43 A_PQB0 A_PQB1 A_PQB2 A_PQB3 AN44 AN45 AN46 AN47 ANw ANx ANy ANz Input/Output Input/Output Input/Output Input/Output 0101100 0101101 0101110 0101111 44 45 46 47 A_PQB4 A_PQB5 A_PQB6 A_PQB7 AN48 AN47 AN50 AN51 -- -- -- -- Input/Output Input/Output Input/Output Input/Output 0110000 0110001 0110010 0110011 48 49 50 51 MPC561/MPC563 Reference Manual, Rev. 1.2 14-32 Freescale Semiconductor QADC64E Enhanced Mode Operation Table 14-20. QADC64E_A Multiplexed Channel Assignments and Signal Designations (continued) Channel Number in CCW CHAN Field Multiplexed Input Signals Port Signal Name Analog Signal Name Other Functions / Descriptions Signal Type Binary Decimal A_PQA0 A_PQA1 A_PQA2 A_PQA3 AN52 AN53 AN54 AN55 MA0 MA1 MA2 -- Input/Output Input/Output Input/Output Input/Output 0110100 0110101 0110110 0110111 52 53 54 55 A_PQA4 A_PQA5 A_PQA6 A_PQA7 AN56 AN57 AN58 AN59 -- -- -- -- Input/Output Input/Output Input/Output Input/Output 0111000 0111001 0111010 0111011 56 57 58 59 VRL VRH/ALTREF1 -- Low Ref High Ref -- -- -- (VRH - VRL)/2 Input Input -- 0111100 0111101 0111110 60 61 62 -- -- End of Queue Code -- 0111111 63 -- RESERVED -- -- 1011000 to 1111110 64 to 127 1 Whichever is selected in the CCW. Table 14-21. QADC64E_B Multiplexed Channel Assignments and Signal Designations Channel Number in CCW CHAN Field Multiplexed Input Signals Port Signal Name Analog Signal Name Other Functions / Descriptions Signal Type Binary Decimal ANw/B_PQB0 AN0 to AN7 -- Input 0000000 to 0000111 0 to 7 ANx/B_PQB1 AN8 to AN15 -- Input 0001000 to 0001111 8 to 15 ANy/B_PQB2 AN16 to AN23 -- Input 0010000 to 0010111 16 to 23 ANz/B_PQB3 AN24 to AN31 -- Input 0011000 to 0011111 24 to 31 -- RESERVED -- -- 0100000 to 0101001 32 to 41 -- RESERVED -- -- 0101010 42 -- RESERVED -- -- 0101011 43 B_PQB0 B_PQB1 B_PQB2 B_PQB3 AN44 AN45 AN46 AN47 ANw ANx ANy ANz Input/Output Input/Output Input/Output Input/Output 0101100 0101101 0101110 0101111 44 45 46 47 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-33 QADC64E Enhanced Mode Operation Table 14-21. QADC64E_B Multiplexed Channel Assignments and Signal Designations (continued) Channel Number in CCW CHAN Field Multiplexed Input Signals Port Signal Name Analog Signal Name Other Functions / Descriptions Signal Type Binary Decimal B_PQB4 B_PQB5 B_PQB6 B_PQB7 AN48 AN47 AN50 AN51 -- -- -- -- Input/Output Input/Output Input/Output Input/Output 0110000 0110001 0110010 0110011 48 49 50 51 B_PQA0 B_PQA1 B_PQA2 B_PQA3 AN52 AN53 AN54 AN55 MA0 MA1 MA2 -- Input/Output Input/Output Input/Output Input/Output 0110100 0110101 0110110 0110111 52 53 54 55 B_PQA4 B_PQA5 B_PQA6 B_PQA7 AN56 AN57 AN58 AN59 -- -- -- -- Input/Output Input/Output Input/Output Input/Output 0111000 0111001 0111010 0111011 56 57 58 59 VRL VRH/ALTREF1 -- Low Ref High Ref -- -- -- (VRH - VRL)/2 Input Input -- 0111100 0111101 0111110 60 61 62 -- -- End of Queue Code -- 0111111 63 -- RESERVED -- -- 1011000 to 1111111 64 to 127 1 Whichever is selected in the CCW. The channel field is programmed for channel 63 to indicate the end of the queue. Channels 60 to 62 are special internal channels. When one of the special channels is selected, the sampling amplifier is not used. The value of VRL, VRH, or (VRH - VRL)/2 is placed directly onto the converter. Also for the internal special channels, programming any input sample time other than two has no benefit except to lengthen the overall conversion time. 14.3.10 Result Word Table The result word table is a RAM, 64 words long and 10 bits wide. An entry is written by the QADC64E after completing an analog conversion specified by the corresponding CCW table entry. Software can read or write the result word table, but in normal operation, the software reads the result word table to obtain analog conversions from the QADC64E. Unimplemented bits are read as zeros, and write operations do not have any effect. See Figure 14-15 for a diagram of the result word table While there is only one result word table, the data can be accessed in three different data formats: * Right justified in the 16-bit word, with zeros in the higher order unused bits * Left justified, with the most significant bit inverted to form a sign bit, and zeros in the unused lower order bits * Left justified, with zeros in the lower order unused bits MPC561/MPC563 Reference Manual, Rev. 1.2 14-34 Freescale Semiconductor QADC64E Enhanced Mode Operation The left justified, signed format corresponds to a half-scale, offset binary, two's complement data format. The data is routed onto the IMB3 according to the selected format. The address used to access the table determines the data alignment format. All write operations to the result word table are right justified. MSB 0 LSB 1 2 Field SRESET 3 4 5 6 7 8 9 10 11 -- RESULT 0000_00 Undefined Addr 12 13 14 13 14 15 0x30 4A80-4AFF (RJURR_A); 0x30 4E80-4EFF (RJURR_B) Figure 14-17. Right Justified, Unsigned Result Format (RJURR) MSB LSB 0 Field 1 2 3 4 S1 5 6 7 8 9 10 11 12 RESULT -- Undefined SRESET Addr 15 00_0000 0x30 4B00-4B7F (LJSRR_A); 0x30 4F00-4F7F (LJSRR_B) Figure 14-18. Left Justified, Signed Result Format (LJSRR) 1 S = Sign bit. MSB 0 LSB 1 Field SRESET Addr 2 3 4 5 6 7 8 9 10 11 12 13 RESULT -- Undefined 00_0000 14 15 0x30 4B80-4BFF (LJURR_A); 0x30 4F80-4FFF (LJURR_B) Figure 14-19. Left Justified, Unsigned Result Register (LJURR) The three result data formats are produced by routing the RAM bits onto the data bus. The software chooses among the three formats by reading the result at the memory address which produces the desired data alignment. The result word table is read/write accessible by software. During normal operation, applications software only needs to read the result table. Write operations to the table may occur during test or debug breakpoint operation. When locations in the CCW table are not used by an application, software could use the corresponding locations in the result word table as scratch pad RAM, remembering that only 10 bits are implemented. The result alignment is only implemented for software read operations. Since write operations are not the normal use for the result registers, only one write data format is supported, which is right justified data. NOTE Some write operations, like bit manipulation, may not operate as expected because the hardware cannot access a true 16-bit value. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-35 QADC64E Enhanced Mode Operation 14.3.10.1 Analog Subsystem This section describes the QADC64E analog subsystem, which includes the front-end analog multiplexer and analog-to-digital converter. 14.3.11 Analog-to-Digital Converter Operation The analog subsystem consists of the path from the input signals to the A/D converter block. Signals from the queue control logic are fed to the multiplexer and state machine. The end of convert (EOC) signal and the successive-approximation register (SAR) are the result of the conversion. Figure 14-20 shows a block diagram of the QADC64E analog subsystem. BIAS STOP 2 Final . .. AN44 Buffer + AN59 Decoder - Sample CAP Array Equals CDAC Buffer AMP COMP. + 7 Sample Zero ALTREF CONV. RDAC (7 BIT) VRH VRL 7 CDAC (4 BIT) CRH CRL 4 (one is offset) CHAN IST REF CCW Buffer State Mach, SAR and SAR Buffer WCCW EOS/EOC CLK Result 10 Data Bus Standard Converter Interface Figure 14-20. QADC64E Analog Subsystem Block Diagram 14.3.11.1 Conversion Cycle Times Total conversion time is made up of initial sample time, final sample time, and resolution time. Initial sample time refers to the time during which the selected input channel is coupled through the buffer amplifier to the sample capacitor. This buffer is used to quickly reproduce its input signal on the sample capacitor and minimize charge sharing errors. During the final sampling period the amplifier is bypassed, and the multiplexer input charges the sample capacitor array directly for improved accuracy. During the resolution period, the voltage in the sample capacitor is converted to a digital value and stored in the SAR. Initial sample time is fixed at two QCLK cycles. Final sample time can be two or eight QCLK cycles, depending on the value of the IST field in the CCW. Resolution time is ten QCLK cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 14-36 Freescale Semiconductor QADC64E Enhanced Mode Operation Therefore, conversion time requires a minimum of 14 QCLK clocks (seven s with a 2.0-MHz QCLK). If the maximum final sample time period of 8 QCLKs is selected, the total conversion time is 20 QCLKs (10 s with a 2.0-MHz QCLK) Figure 14-21 illustrates the timing for conversions. Resolution ("Conv") "Buffer" "Final" Sample Sample Time Time N cycles: 2 cycles (2 or 8) Time 10 cycles QCLK Sample Time Successive Approximation Resolution Sequence Figure 14-21. Conversion Timing 14.3.12 Channel Decode and Multiplexer The internal multiplexer selects one of the 16 analog input signals for conversion. The selected input is connected to the sample buffer amplifier. The multiplexer also includes positive and negative stress protection circuitry, which prevents deselected channels from affecting the selected channel when current is injected into the deselected channels. Refer to Appendix F, "Electrical Characteristics," for specific current levels. 14.3.13 Sample Buffer Amplifier The sample buffer is used to raise the effective input impedance of the A/D converter, so that external components (higher bandwidth or higher impedance) are less critical to accuracy. The input voltage is buffered onto the sample capacitor to reduce crosstalk between channels. 14.3.14 Digital to Analog Converter (DAC) Array The digital to analog converter (DAC) array consists of binary-weighted capacitors and a resistor-divider chain. The reference voltages, VRH and VRL, are used by the DAC to perform ratiometric conversions. The DAC also converts the following three internal channels: * VRH -- Reference voltage high * VRL -- Reference voltage low * (VRH - VRL)/2 -- Reference voltage The DAC array serves to provide a mechanism for the successive approximation A/D conversion. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-37 QADC64E Enhanced Mode Operation Resolution begins with the most significant bit (MSB) and works down to the least significant bit (LSB). The switching sequence is controlled by the comparator and successive-approximation register (SAR) logic. * Sample Capacitor -- The sample capacitor is employed to sample and hold the voltage to be converted. 14.3.15 Comparator The comparator is used during the approximation process to sense whether the digitally selected arrangement of the DAC array produces a voltage level higher or lower than the sampled input. The comparator output feeds into the SAR which accumulates the A/D conversion result sequentially, beginning with the MSB. 14.3.16 Bias The bias circuit is controlled by the STOP signal to power-up and power-down all the analog circuits. 14.3.17 Successive Approximation Register The input of the successive approximation register (SAR) is connected to the comparator output. The SAR sequentially receives the conversion value one bit at a time, starting with the MSB. After accumulating the 10 bits of the conversion result, the SAR data is transferred to the appropriate result location, where it may be read from the IMB3 by user software. 14.3.18 State Machine The state machine receives the QCLK, RST, STOP, IST, CHAN[6:0], and START CONV signals, from which it generates all timing to perform an A/D conversion. The start conversion signal (START CONV) indicates to the A/D converter that the desired channel has been sent to the multiplexor. IST indicates the desired sample time. The end of conversion (EOC) signal notifies the queue control logic that a result is available for storage in the result RAM. 14.4 Digital Subsystem The digital control subsystem includes the control logic to sequence the conversion activity, the clock and periodic/interval timer, control and status registers, the conversion command word table RAM, and the result word table RAM. The central element for control of the QADC64E conversions is the 64-entry CCW table. Each CCW specifies the conversion of one input channel. Depending on the application, one or two queues can be established in the CCW table. A queue is a scan sequence of one or more input channels. By using a pause mechanism, sub queues can be created in the two queues. Each queue can be operated using one of several different scan modes. The scan modes for queue 1 and queue 2 are programmed in QACR1 and QACR2 (control registers 1 and 2). Once a queue has been started by a trigger event (any of the ways to cause the QADC64E to begin executing the CCWs in a queue or sub-queue), the QADC64E performs a sequence of conversions and places the results in the result word table. MPC561/MPC563 Reference Manual, Rev. 1.2 14-38 Freescale Semiconductor QADC64E Enhanced Mode Operation 14.4.1 Queue Priority Queue 1 has priority over queue 2 execution. The following cases show the conditions under which queue 1 asserts its priority: * When a queue is not active, a trigger event for queue 1 or queue 2 causes the corresponding queue execution to begin. * When queue 1 is active and a trigger event occurs for queue 2, queue 2 cannot begin execution until queue 1 reaches completion or the paused state. The status register records the trigger event by reporting the queue 2 status as trigger pending. Additional trigger events for queue 2, which occur before execution can begin, are captured as trigger overruns. * When queue 2 is active and a trigger event occurs for queue 1, the current queue 2 conversion is aborted. The status register reports the queue 2 status as suspended. Any trigger events occurring for queue 2 while queue 2 is suspended are captured as trigger overruns. Once queue 1 reaches the completion or the paused state, queue 2 begins executing again. The programming of the RESUME bit in QACR2 determines which CCW is executed in queue 2. Refer to Section 14.3.7, "Control Register 2" for more information. * When simultaneous trigger events occur for queue 1 and queue 2, queue 1 begins execution and the queue 2 status is changed to trigger pending. 14.4.2 Sub-Queues That are Paused The pause feature can be used to divide queue 1 and/or queue 2 into multiple sub-queues. A sub-queue is defined by setting the pause bit in the last CCW of the sub-queue. Figure 14-22 shows the CCW format and an example of using pause to create sub-queues. Queue 1 is shown with four CCWs in each sub-queue and queue 2 has two CCWs in each sub-queue. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-39 QADC64E Enhanced Mode Operation CONVERSION COMMAND WORD (CCW) TABLE P 00 0 0 0 1 0 0 0 1 0 00 BEGIN Queue 1 PAUSE PAUSE P 0 0 BQ2 0 1 0 1 0 1 0 P 1 63 0 RESULT WORD TABLE END OF Queue 1 BEGIN Queue 2 PAUSE Channel Select Sample, Hold and A/D Conversion PAUSE PAUSE PAUSE END OF Queue 2 63 QADC64E CQP Figure 14-22. QADC64E Queue Operation With Pause The queue operating mode selected for queue 1 determines what type of trigger event causes the execution of each of the sub-queues within queue 1. Similarly, the queue operating mode for queue 2 determines the type of trigger event required to execute each of the sub-queues within queue 2. NOTE When the external trigger rising edge continuous-scan mode is selected for queue 1, and there are six sub-queues within queue 1, a separate rising edge is required on the external trigger signal after every pause to begin the execution of each sub-queue (refer to Figure 14-22). Refer to Section 14.4.4, "Scan Modes" for information on different scan modes. The choice of single-scan or continuous-scan applies to the full queue, and is not applied to each sub-queue. Once a sub-queue is initiated, each CCW is executed sequentially until the last CCW in the sub-queue is executed and the pause state is entered. Execution can only continue with the next CCW, which is the beginning of the next sub-queue. A sub-queue cannot be executed a second time before the overall queue execution has been completed. Refer to Section 14.3.7, "Control Register 2" for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 14-40 Freescale Semiconductor QADC64E Enhanced Mode Operation Trigger events which occur during the execution of a sub-queue are ignored, except that the trigger overrun flag is set. When a continuous-scan mode is selected, a trigger event occurring after the completion of the last sub-queue (after the queue completion flag is set), causes the execution to continue with the first sub-queue, starting with the first CCW in the queue. When the QADC64E encounters a CCW with the pause bit set, the queue enters the paused state after completing the conversion specified in the CCW with the pause bit. The pause flag is set and a pause software interrupt may optionally be issued. The status of the queue is shown to be paused, indicating completion of a sub-queue. The QADC64E then waits for another trigger event to again begin execution of the next sub-queue. 14.4.3 Boundary Conditions The following are queue operation boundary conditions: * The first CCW in a queue contains channel 63, the end-of-queue (EOQ) code. The queue becomes active and the first CCW is read. The end-of-queue is recognized, the completion flag is set, and the queue becomes idle. A conversion is not performed. * BQ2 (beginning of queue 2) is set at the end of the CCW table (63) and a trigger event occurs on queue 2. Refer to Section 14.3.7, "Control Register 2" for more information on BQ2. The end-of-queue condition is recognized, a conversion is performed, the completion flag is set, and the queue becomes idle. * BQ2 is set to CCW0 and a trigger event occurs on queue 1. After reading CCW0, the end-of-queue condition is recognized, the completion flag is set, and the queue becomes idle. A conversion is not performed. * BQ2 is set beyond the end of the CCW table (64 - 127) and a trigger event occurs on queue 2. The end-of-queue condition is recognized immediately, the completion flag is set, and the queue becomes idle. A conversion is not performed. NOTE Multiple end-of-queue conditions may be recognized simultaneously, although there is no change in the QADC64E behavior. For example, if BQ2 is set to CCW0, CCW0 contains the EOQ code, and a trigger event occurs on queue 1, the QADC64E reads CCW0 and detects both end-of-queue conditions. The completion flag is set and queue 1 becomes idle. Boundary conditions also exist for combinations of pause and end-of-queue. One case is when a pause bit is in one CCW and an end-of-queue condition is in the next CCW. The conversion specified by the CCW with the pause bit set completes normally. The pause flag is set. However, since the end-of-queue condition is recognized, the completion flag is also set and the queue status becomes idle, not paused. Examples of this situation include: * The pause bit is set in CCW5 and the EOQ code is in CCW6 * The pause is set in CCW63 * During queue 1 operation, the pause bit is set in CCW20 and BQ2 points to CCW21 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-41 QADC64E Enhanced Mode Operation Another pause and end-of-queue boundary condition occurs when the pause and an end-of-queue condition occur in the same CCW. Both the pause and end-of-queue conditions are recognized simultaneously. The end-of-queue condition has precedence so a conversion is not performed for the CCW and the pause flag is not set. The QADC64E sets the completion flag and the queue status becomes idle. Examples of this situation are: * The pause bit is set in CCW10 and EOQ is programmed into CCW10 * During queue 1 operation, the pause bit set in CCW32, which is also BQ2 14.4.4 Scan Modes The QADC64E queuing mechanism allows the application to utilize different requirements for automatically scanning input channels. In single-scan mode, a single pass through a sequence of conversions defined by a queue is performed. In continuous-scan mode, multiple passes through a sequence of conversions defined by a queue are executed. The possible modes are: * Disabled and reserved mode * Single-scan modes -- Software initiated single-scan mode -- External trigger single-scan mode -- External gated single-scan mode -- Periodic/Interval timer single-scan mode * Continuous-scan modes -- Software initiated continuous-scan mode -- External trigger continuous-scan mode -- External gated continuous-scan mode -- Periodic/Interval timer continuous-scan mode 14.4.4.1 Disabled Mode When the disabled mode is selected, the queue is not active. Trigger events cannot initiate queue execution. When both queue 1 and queue 2 are disabled, wait states are not encountered for IMB3 accesses of the RAM. When both queues are disabled, it is safe to change the QCLK prescaler values. 14.4.4.2 Reserved Mode Reserved mode allows for future mode definitions. When the reserved mode is selected, the queue is not active. It functions the same as disabled mode. WARNING Do not use a reserved mode. Unspecified operations may result. MPC561/MPC563 Reference Manual, Rev. 1.2 14-42 Freescale Semiconductor QADC64E Enhanced Mode Operation 14.4.4.3 Single-Scan Modes When the application software wants to execute a single pass through a sequence of conversions defined by a queue, a single-scan queue operating mode is selected. By programming the MQ field in QACR1 or QACR2, the following modes can be selected: * Software initiated single-scan mode * External trigger single-scan mode * External gated single-scan mode * Periodic/Interval timer single-scan mode NOTE Queue 2 cannot be programmed for external gated single-scan mode. In all single-scan queue operating modes, the software must also enable the queue to begin execution by writing the single-scan enable bit to a one in the queue's control register. The single-scan enable bits, SSE1 and SSE2, are provided for queue 1 and queue 2 respectively. Until the single-scan enable bit is set, any trigger events for that queue are ignored. The single-scan enable bit may be set to a one during the write cycle, which selects the single-scan queue operating mode. The single-scan enable bit is set through software, but will always read as a zero. Once set, writing the single-scan enable bit to zero has no effect. Only the QADC64E can clear the single-scan enable bit. The completion flag, completion interrupt, or queue status are used to determine when the queue has completed. After the single-scan enable bit is set, a trigger event causes the QADC64E to begin execution with the first CCW in the queue. The single-scan enable bit remains set until the queue is completed. After the queue reaches completion, the QADC64E resets the single-scan enable bit to zero. If the single-scan enable bit is written to a one or a zero by the software before the queue scan is complete, the queue is not affected. However, if the software changes the queue operating mode, the new queue operating mode and the value of the single-scan enable bit are recognized immediately. The conversion in progress is aborted and the new queue operating mode takes effect. In the software-initiated single-scan mode, the writing of a one to the single-scan enable bit causes the QADC64E to internally generate a trigger event and the queue execution begins immediately. In the other single-scan queue operating modes, once the single-scan enable bit is written, the selected trigger event must occur before the queue can start. The single-scan enable bit allows the entire queue to be scanned once. A trigger overrun is captured if a trigger event occurs during queue execution in an edge-sensitive external trigger mode or a periodic/interval timer mode. In the periodic/interval timer single-scan mode, the next expiration of the timer is the trigger event for the queue. After the queue execution is complete, the queue status is shown as idle. The software can restart the queue by setting the single-scan enable bit to a one. Queue execution begins with the first CCW in the queue. 14.4.4.3.1 Software Initiated Single-Scan Mode Software can initiate the execution of a scan sequence for queue 1 or 2 by selecting the software initiated single-scan mode, and writing the single-scan enable bit in QACR1 or QACR2. A trigger event is MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-43 QADC64E Enhanced Mode Operation generated internally and the QADC64E immediately begins execution of the first CCW in the queue. If a pause occurs, another trigger event is generated internally, and then execution continues without pausing. The QADC64E automatically performs the conversions in the queue until an end-of-queue condition is encountered. The queue remains idle until the software again sets the single-scan enable bit. While the time to internally generate and act on a trigger event is very short, software can momentarily read the status conditions, indicating that the queue is paused. The trigger overrun flag is never set while in the software initiated single-scan mode. The software initiated single-scan mode is useful in the following applications: * Allows software complete control of the queue execution * Allows the software to easily alternate between several queue sequences. 14.4.4.3.2 External Trigger Single-Scan Mode The external trigger single-scan mode is available on both queue 1 and queue 2. The software programs the polarity of the external trigger edge that is to be detected, either a rising or a falling edge. The software must enable the scan to occur by setting the single-scan enable bit for the queue. The first external trigger edge causes the queue to be executed one time. Each CCW is read and the indicated conversions are performed until an end-of-queue condition is encountered. After the queue is completed, the QADC64E clears the single-scan enable bit. Software may set the single-scan enable bit again to allow another scan of the queue to be initiated by the next external trigger edge. The external trigger single-scan mode is useful when the input trigger rate can exceed the queue execution rate. Analog samples can be taken in sync with an external event, even though the software is not interested in data taken from every edge. The software can start the external trigger single-scan mode and get one set of data, and at a later time, start the queue again for the next set of samples. When a pause bit is encountered during external trigger single-scan mode, another trigger event is required for queue execution to continue. Software involvement is not needed to enable queue execution to continue from the paused state. 14.4.4.3.3 External Gated Single-Scan Mode The QADC64E provides external gating for queue 1 only. When external gated single-scan mode is selected, the input level on the associated external trigger signal enables and disables queue execution. The polarity of the external gated signal is fixed so only a high level opens the gate and a low level closes the gate. Once the gate is open, each CCW is read and the indicated conversions are performed until the gate is closed. Software must enable the scan to occur by setting the single-scan enable bit for queue 1. If a pause in a CCW is encountered, the pause flag will not set, and execution continues without pausing. While the gate is open, queue 1 executes one time. Each CCW is read and the indicated conversions are performed until an end-of-queue condition is encountered. When queue 1 completes, the QADC64E sets the completion flag (CF1) and clears the single-scan enable bit. Software may set the single-scan enable bit again to allow another scan of queue 1 to be initiated during the next open gate. If the gate closes before queue 1 completes execution, the current CCW completes, execution of queue 1 stops, the single-scan enable bit is cleared, and the PF1 bit is set. Software can read the CWPQ1 to MPC561/MPC563 Reference Manual, Rev. 1.2 14-44 Freescale Semiconductor QADC64E Enhanced Mode Operation determine the last valid conversion in the queue. Software must set the single-scan enable bit again and should clear the PF1 bit before another scan of queue 1 is initiated during the next open gate. The start of queue 1 is always the first CCW in the CCW table. Since the condition of the gate is only sampled after each conversion during queue execution, closing the gate for a period less than a conversion time interval does not guarantee the closure will be captured. 14.4.4.3.4 Periodic/Interval Timer Single-Scan Mode Both queues can use the periodic/interval timer in a single-scan queue operating mode. The timer interval can range from 128- to 128-Kbyte QCLK cycles in binary multiples. When the periodic/ interval timer single-scan mode is selected and the software sets the single-scan enable bit in QACR1 or QACR2 , the timer begins counting. When the time interval elapses, an internal trigger event is created to start the queue and the QADC64E begins execution with the first CCW. The QADC64E automatically performs the conversions in the queue until a pause or an end-of-queue condition is encountered. When a pause occurs, queue execution stops until the timer interval elapses again, and then queue execution continues. When the queue execution reaches an end-of-queue situation, the single-scan enable bit is cleared. Software may set the single-scan enable bit again, allowing another scan of the queue to be initiated by the periodic/interval timer. The periodic/interval timer generates a trigger event whenever the time interval elapses. The trigger event may cause the queue execution to continue following a pause, or may be considered a trigger overrun. Once the queue execution is completed, the single-scan enable bit must be set again to enable the timer to count again. Normally only one queue will be enabled for periodic/interval timer single-scan mode and the timer will reset at the end-of-queue. However, if both queues are enabled for either single-scan or continuous periodic/interval timer mode, the end-of-queue condition will not reset the timer while the other queue is active. In this case, the timer will reset when both queues have reached end-of-queue. See Section 14.4.6, "Periodic/Interval Timer," for a definition of periodic/interval timer reset conditions. The periodic/interval timer single-scan mode can be used in applications which need coherent results, for example: * When it is necessary that all samples are guaranteed to be taken during the same scan of the analog signals * When the interrupt rate in the periodic/interval timer continuous-scan mode would be too high * In sensitive battery applications, where the single-scan mode uses less power than the software initiated continuous-scan mode 14.4.4.4 Continuous-Scan Modes When the application software wants to execute multiple passes through a sequence of conversions defined by a queue, a continuous-scan queue operating mode is selected. By programming the MQ1 field in QACR1 or the MQ2 field in QACR2, the following software initiated modes can be selected: * Software initiated continuous-scan mode * External trigger continuous-scan mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-45 QADC64E Enhanced Mode Operation * * External gated continuous-scan mode Periodic/interval timer continuous-scan mode When a queue is programmed for a continuous-scan mode, the single-scan enable bit in the queue control register does not have any meaning or effect. As soon as the queue operating mode is programmed, the selected trigger event can initiate queue execution. In the case of the software-initiated continuous-scan mode, the trigger event is generated internally and queue execution begins immediately. In the other continuous-scan queue operating modes, the selected trigger event must occur before the queue can start. A trigger overrun is captured if a trigger event occurs during queue execution in the external trigger continuous-scan mode and the periodic/interval timer continuous-scan mode. After the queue execution is complete, the queue status is shown as idle. Since the continuous-scan queue operating modes allow the entire queue to be scanned multiple times, software involvement is not needed to enable queue execution to continue from the idle state. The next trigger event causes queue execution to begin again, starting with the first CCW in the queue. NOTE Coherent samples are guaranteed. The time between consecutive conversions has been designed to be consistent. However, there is one exception. For queues that end with a CCW containing EOQ code (channel 63), the last queue conversion to the first queue conversion requires 1 additional CCW fetch cycle. Therefore continuous samples are not coherent at this boundary. In addition, the time from trigger to first conversion cannot be guaranteed since it is a function of clock synchronization, programmable trigger events, queue priorities, and so on. 14.4.4.4.1 Software Initiated Continuous-Scan Mode When the software initiated continuous-scan mode is programmed, the trigger event is generated automatically by the QADC64E. Queue execution begins immediately. If a pause is encountered, another trigger event is generated internally, and then execution continues without pausing. When the end-of-queue is reached, another internal trigger event is generated, and queue execution begins again from the beginning of the queue. While the time to internally generate and act on a trigger event is very short, software can momentarily read the status conditions, indicating that the queue is idle. The trigger overrun flag is never set while in the software-initiated continuous-scan mode. The software initiated continuous-scan mode keeps the result registers updated more frequently than any of the other queue operating modes. The software can always read the result table to get the latest converted value for each channel. The channels scanned are kept up to date by the QADC64E without software involvement. Software can read a result value at any time. The software initiated continuous-scan mode may be chosen for either queue, but is normally used only with queue 2. When the software initiated continuous-scan mode is chosen for queue 1, that queue operates MPC561/MPC563 Reference Manual, Rev. 1.2 14-46 Freescale Semiconductor QADC64E Enhanced Mode Operation continuously and queue 2, being lower in priority, never gets executed. The short interval of time between a queue 1 completion and the subsequent trigger event is not sufficient to allow queue 2 execution to begin. The software initiated continuous-scan mode is a useful choice with queue 2 for converting channels that do not need to be synchronized to anything, or for the slow-to-change analog channels. Interrupts are normally not used with the software initiated continuous-scan mode. Rather, the software reads the latest conversion result from the result table at any time. Once initiated, software action is not needed to sustain conversions of channel. 14.4.4.4.2 External Trigger Continuous-Scan Mode The QADC64E provides external trigger signals for both queues. When the external trigger software initiated continuous-scan mode is selected, a transition on the associated external trigger signal initiates queue execution. The polarity of the external trigger signal is programmable, so that the software can select a mode which begins queue execution on the rising or falling edge. Each CCW is read and the indicated conversions are performed until an end-of-queue condition is encountered. When the next external trigger edge is detected, the queue execution begins again automatically. Software initialization is not needed between trigger events. When a pause bit is encountered in external trigger continuous-scan mode, another trigger event is required for queue execution to continue. Software involvement is not needed to enable queue execution to continue from the paused state. Some applications need to synchronize the sampling of analog channels to external events. There are cases when it is not possible to use software initiation of the queue scan sequence, since interrupt response times vary. 14.4.4.4.3 External Gated Continuous-Scan Mode The QADC64E provides external gating for queue 1 only. When external gated continuous-scan mode is selected, the input level on the associated external trigger signal enables and disables queue execution. The polarity of the external gated signal is fixed so a high level opens the gate and a low level closes the gate. Once the gate is open, each CCW is read and the indicated conversions are performed until the gate is closed. When the gate opens again, the queue execution automatically begins again from the beginning of the queue. Software initialization is not needed between trigger events. If a pause in a CCW is encountered, the pause flag will not set, and execution continues without pausing. The purpose of external gated continuous-scan mode is to continuously collect digitized samples while the gate is open and to have the most recent samples available. It is up to the programmer to ensure that the queue is large enough so that a maximum gate open time will not reach an end-of-queue. However it is useful to take advantage of a smaller queue in the manner described in the next paragraph. In the event that the queue completes before the gate closes, a completion flag will be set and the queue will roll over to the beginning and continue conversions until the gate closes. If the gate remains open and the completion flag is not cleared, when the queue completes a second time the trigger overrun flag will be set and the queue will roll-over again. The queue will continue to execute until the gate closes or the mode is disabled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-47 QADC64E Enhanced Mode Operation If the gate closes before queue 1 completes execution, the current CCW completes execution of queue 1 stops and QADC64E sets the PF1 bit to indicate an incomplete queue. Software can read the CWPQ1 to determine the last valid conversion in the queue. In this mode, if the gate opens again, execution of queue 1 begins again. The start of queue 1 is always the first CCW in the CCW table. Since the condition of the gate is only sampled after each conversion during queue execution, closing the gate for a period less than a conversion time interval does not guarantee the closure will be captured. 14.4.4.4.4 Periodic/Interval Timer Continuous-Scan Mode The QADC64E includes a dedicated periodic/interval timer for initiating a scan sequence on queue 1 and/or queue 2. Software selects a programmable timer interval ranging from 128 to 128 Kbytes times the QCLK period in binary multiples. The QCLK period is prescaled down from the IMB3 MCU clock. When a periodic/interval timer continuous-scan mode is selected for queue 1 and/or queue 2, the timer begins counting. After the programmed interval elapses, the timer generated trigger event starts the appropriate queue. Meanwhile, the QADC64E automatically performs the conversions in the queue until an end-of-queue condition or a pause is encountered. When a pause occurs, the QADC64E waits for the periodic interval to expire again, then continues with the queue. Once end-of-queue has been detected, the next trigger event causes queue execution to begin again with the first CCW in the queue. The periodic/interval timer generates a trigger event whenever the time interval elapses. The trigger event may cause the queue execution to continue following a pause or queue completion, or may be considered a trigger overrun. As with all continuous-scan queue operating modes, software action is not needed between trigger events. Since both queues may be triggered by the periodic/interval timer, see Section 14.4.6, "Periodic/Interval Timer" for a summary of periodic/interval timer reset conditions. Software enables the completion interrupt when using the periodic/interval timer continuous-scan mode. When the interrupt occurs, the software knows that the periodically collected analog results have just been taken. The software can use the periodic interrupt to obtain non-analog inputs as well, such as contact closures, as part of a periodic look at all inputs. 14.4.5 QADC64E Clock (QCLK) Generation Figure 14-23 is a block diagram of the clock subsystem. The QCLK provides the timing for the A/D converter state machine which controls the timing of the conversion. The QCLK is also the input to a 17-stage binary divider which implements the periodic/interval timer. To retain the specified analog conversion accuracy, the QCLK frequency (FQCLK) must be within the tolerance specified in Appendix F, "Electrical Characteristics." Before using the QADC64E, the software must initialize the prescaler with values that put the QCLK within the specified range. Though most software applications initialize the prescaler once and do not change it, write operations to the prescaler fields are permitted. MPC561/MPC563 Reference Manual, Rev. 1.2 14-48 Freescale Semiconductor QADC64E Enhanced Mode Operation WARNING A change in the prescaler value while a conversion is in progress is likely to corrupt the result from any conversion in progress. Therefore, any prescaler write operation should be done only when both queues are in the disabled modes. Clock Generate System Clock (FSYS) QCLK Prescaler Rate Selection (from Control Register 0) QADC Clock ( FSYS / /2 to FSYS / /40 ) SAR Control SAR[9:0] A/D Converter State Machine Input Sample Time (From CCW) Binary Counter 27 28 29 210 211 212 213 214 215 216 217 QUEUE 1 & 2 Timer Mode Rate Selection 8 Periodic / interval Timer Select 2 Periodic/interval Trigger Event for Q1 and Q2 QADC CLOCK BLOCK Figure 14-23. QADC64E Clock Subsystem Functions The MCU system clock frequency (IMB3 system clock - fSYSCLK) is the basis of the QADC64E timing. QCLK is generated by a software selectable prescaler that divides fSYSCLK thus allowing the A/D conversion time to be maximized across fSYSCLK. The software establishes the frequency of QCLK waveform by setting the PRESCALER field in the QACR0 register. When the value of PRESCALER > 0 the resulting frequency of QCLK is calculated using the following formula: fQCLK = fSYSCLK / (PRESCALER + 1) The QADC64E requires that fSYSCLK be at least twice fQCLK. Therefore if the value in the PRESCALER field is set to Zero, the resulting QCLK frequency is calculated to be: fQCLK = fSYSCLK / 2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-49 QADC64E Enhanced Mode Operation Table 14-22. QADC64E Clock Programmability Control Register 0 Information 14.4.6 Input Sample Time (IST) =0 Example Number Frequency PRESCALER QCLK (MHz) Conversion Time (s) 1 20 MHz 0x09 2.0 7.0 2 40 MHz 0x13 2.0 7.0 3 56 MHz 0x1B 2.0 7.0 Periodic/Interval Timer The on-chip periodic/interval timer can be used to generate trigger events at a programmable interval, initiating execution of queue 1 and/or queue 2. The periodic/interval timer stays reset under the following conditions: * Both queue 1 and queue 2 are programmed to any mode which does not use the periodic/interval timer * IMB3 system reset or the master reset is asserted * Stop mode is selected * Freeze mode is selected NOTE Interval timer single-scan mode does not use the periodic/interval timer until the single-scan enable bit is set. The following two conditions will cause a pulsed reset of the periodic/interval timer during use: * A queue 1 operating mode change to a mode which uses the periodic/interval timer, even if queue 2 is already using the timer * A queue 2 operating mode change to a mode which uses the periodic/interval timer, provided queue 1 is not in a mode which uses the periodic/interval timer * Roll over of the timer During the low power stop mode, the periodic timer is held in reset. Since low power stop mode causes QACR1 and QACR2 to be reset to zero, a valid periodic or interval timer mode must be written after stop mode is exited to release the timer from reset. When the IMB3 internal FREEZE line is asserted and a periodic or interval timer mode is selected, the timer counter is reset after the conversion in progress completes. When the periodic or interval timer mode has been enabled (the timer is counting), but a trigger event has not been issued, the freeze mode takes effect immediately, and the timer is held in reset. When the internal FREEZE line is negated, the timer counter starts counting from the beginning. Refer to Section 14.4.7, "Configuration and Control Using the IMB3 Interface" for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 14-50 Freescale Semiconductor QADC64E Enhanced Mode Operation 14.4.7 Configuration and Control Using the IMB3 Interface The QADC64E module communicates with other microcontroller modules via the IMB3. The QADC64E bus interface unit (BIU) coordinates IMB3 activity with internal QADC64E bus activity. This section describes the operation of the BIU, IMB3 read/write accesses to QADC64E memory locations, module configuration, and general-purpose I/O operation. 14.4.7.1 QADC64E Bus Interface Unit The BIU is designed to act as a slave device on the IMB3. The BIU has the following functions: to respond with the appropriate bus cycle termination, and to supply IMB3 interface timing to all internal module signals. BIU components consist of * IMB3 buffers * Address match and module select logic * The BIU state machine * Clock prescaler logic * Data bus routing logic * Interface to the internal module data bus NOTE Normal accesses from the IMB3 to the QADC64E require two clocks. However, if the CPU tries to access table locations while the QADC64E is accessing them, the QADC64E produces IMB3 wait states. From one to four IMB3 wait states may be inserted by the QADC64E in the process of reading and writing. 14.4.7.2 QADC64E Bus Accessing The QADC64E supports 8-bit, 16-bit, and 32-bit data transfers, at even and odd addresses. Coherency of results read (ensuring that all results read were taken consecutively in one scan) is not guaranteed. For example, if a read of two consecutive 16-bit locations in a result area is made, the QADC64E could change one 16-bit location in the result area between the bus cycles. There is no holding register for the second 16-bit location. All read and write accesses that require more than one 16-bit access to complete occur as two or more independent bus cycles. Depending on bus master protocol, these accesses could include misaligned and 32-bit accesses. Figure 14-24 shows the three bus cycles which are implemented by the QADC64E. The following paragraphs describe how the three types of accesses are used, including misaligned 16-bit and 32-bit accesses. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-51 QADC64E Enhanced Mode Operation W Intermodule Bus QADC Location R W R Byte 0 Byte 1 Byte 0 Byte 1 8-bit Access of an Even Address (ISIZ = 01, A0 = 0) W Intermodule Bus QADC Location R W R Byte 0 Byte 1 Byte 0 Byte 1 8-bit Access of an Odd Address (ISIZ = 01, A0 = 1; OR ISIZ = 10, A0 = 1) W Intermodule Bus QADC Location R W R BYTE 0 BYTE 1 BYTE 0 BYTE 1 16-Bit Aligned Access (ISIZ = 10, A0 = 0) QADC64E Bus CYC ACC Figure 14-24. Bus Cycle Accesses Byte access to an even address of a QADC64E location is shown in the top illustration of Figure 14-24. In the case of write cycles, byte 1 of the register is not disturbed. In the case of a read cycle, the QADC64E provides both byte 0 and byte 1. Byte access to an odd address of a QADC64E location is shown in the center illustration of Figure 14-24. In the case of write cycles, byte 0 of the register is not disturbed. In the case of read cycles, the QADC64E provides both byte 0 and byte 1. 16-bit accesses to an even address read or write byte 0 and byte 1 as shown in the lowest illustration of Figure 14-24. The full 16 bits of data is written to and read from the QADC64E location with each access. 16-bit accesses to an odd address require two bus cycles; one byte of two different 16-bit QADC64E locations is accessed. The first bus cycle is treated by the QADC64E as an 8-bit read or write of an odd address. The second cycle is an 8-bit read or write of an even address. The QADC64E address space is organized into 16-bit even address locations, so a 16-bit read or write of an odd address obtains or provides the lower half of one QADC64E location, and the upper half of the following QADC64E location. MPC561/MPC563 Reference Manual, Rev. 1.2 14-52 Freescale Semiconductor QADC64E Enhanced Mode Operation 32-bit accesses to an even address require two bus cycles to complete the access, and two full 16-bit QADC64E locations are accessed. The first bus cycle reads or writes the addressed 16-bit QADC64E location and the second cycle reads or writes the following 16-bit location. 32-bit accesses to an odd address require three bus cycles. Portions of three different QADC64E locations are accessed. The first bus cycle is treated by the QADC64E as an 8-bit access of an odd address, the second cycle is a 16-bit aligned access, and the third cycle is an 8-bit access of an even address. The QADC64E address space is organized into 16-bit even address locations, so a 32-bit read or write of an odd address provides the lower half of one QADC64E location, the full 16-bit content of the following QADC64E location, and the upper half of the third QADC64E location. 14.5 Trigger and Queue Interaction Examples This section contains examples describing queue priority and conversion timing schemes. 14.5.1 Queue Priority Schemes Since there are two conversion command queues and only one A/D converter, there is a priority scheme to determine which conversion is to occur. Each queue has a variety of trigger events that are intended to initiate conversions, and they can occur asynchronously in relation to each other and other conversions in progress. For example, a queue can be idle awaiting a trigger event, a trigger event can have occurred but the first conversion has not started, a conversion can be in progress, a pause condition can exist awaiting another trigger event to continue the queue, and so on. The following paragraphs and figures outline the prioritizing criteria used to determine which conversion occurs in each overlap situation. NOTE The situations in Figure 14-25 through Figure 14-43 are labeled S1 through S19. In each diagram, time is shown increasing from left to right. The execution of queue 1 and queue 2 (Q1 and Q2) is shown as a string of rectangles representing the execution time of each CCW in the queue. In most of the situations, there are four CCWs (labeled C1 to C4) in both queue 1 and queue 2. In some of the situations, CCW C2 is presumed to have the pause bit set, to show the similarities of pause and end-of-queue as terminations of queue execution. Trigger events are described in Table 14-23. Table 14-23. Trigger Events Trigger Events T1 Events that trigger queue 1 execution (external trigger, software initiated single-scan enable bit, or completion of the previous continuous loop) T2 Events that trigger queue 2 execution (external trigger, software initiated single-scan enable bit, timer period/interval expired, or completion of the previous continuous loop) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-53 QADC64E Enhanced Mode Operation When a trigger event causes a CCW execution in progress to be aborted, the aborted conversion is shown as a ragged end of a shortened CCW rectangle. The situation diagrams also show when key status bits are set. Table 14-24 describes the status bits. Table 14-24. Status Bits Bit Function CF Flag Set when the end of the queue is reached PF Flag Set when a queue completes execution up through a pause bit Trigger Overrun Error (TOR) Set when a new trigger event occurs before the queue is finished serving the previous trigger event Below the queue execution flows are three sets of blocks that show the status information that is made available to the software. The first two rows of status blocks show the condition of each queue as: * Idle * Active * Pause * Suspended (queue 2 only) * Trigger pending The third row of status blocks shows the 4-bit QS status register field that encodes the condition of the two queues. Two transition status cases, QS = 0011 and QS = 0111, are not shown because they exist only very briefly between stable status conditions. The first three examples in Figure 14-25 through Figure 14-27 (S1, S2, and S3) show what happens when a new trigger event is recognized before the queue has completed servicing the previous trigger event on the same queue. In situation S1 (Figure 14-25), one trigger event is being recognized on each queue while that queue is still working on the previously recognized trigger event. The trigger overrun error status bit is set, and otherwise, the premature trigger event is ignored. A trigger event which occurs before the servicing of the previous trigger event is through does not disturb the queue execution in progress. MPC561/MPC563 Reference Manual, Rev. 1.2 14-54 Freescale Semiconductor QADC64E Enhanced Mode Operation T1 T1 C1 Q1: C2 C3 C4 TOR1 T2 CF1 Q2: T2 C1 C2 C3 TOR2 IDLE Q1 IDLE 0000 QS CF2 IDLE ACTIVE Q2 C4 IDLE ACTIVE 1000 0000 0000 0010 QADC S1 Figure 14-25. CCW Priority Situation 1 In situation S2 (Figure 14-25), more than one trigger event is recognized before servicing of a previous trigger event is complete, the trigger overrun bit is again set, but otherwise, the additional trigger events are ignored. After the queue is complete, the first newly detected trigger event causes queue execution to begin again. When the trigger event rate is high, a new trigger event can be seen very soon after completion of the previous queue, leaving software little time to retrieve the previous results. Also, when trigger events are occurring at a high rate for queue 1, the lower priority queue 2 channels may not get serviced at all. T1 Q1: T1 C1 T1 C2 T1 C3 T1 C4 TOR1 TOR1 TOR1 C1 C2 C3 CF1 C4 T2 CF1 Q2: C1 T2 T2 C2 C3 TOR2 TOR2 Q1 IDLE ACTIVE 1000 1000 CF2 IDLE ACTIVE IDLE Q2 QS IDLE C4 0000 ACTIVE IDLE 0010 0000 QADC S2 Figure 14-26. CCW Priority Situation 2 Situation S3 (Figure 14-26) shows that when the pause feature is in use, the trigger overrun error status bit is set the same way, and that queue execution continues unchanged. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-55 QADC64E Enhanced Mode Operation T1 Q1: T1 C1 T1 C2 TOR1 C3 PF1 T2 Q2: T2 C1 IDLE IDLE Q2 QS T2 PF2 C4 TOR2 PAUSE 0101 CF2 IDLE ACTIVE 0110 0100 T2 C3 ACTIVE 1000 0000 CF1 C2 PAUSE ACTIVE C4 TOR1 TOR2 Q1 T1 ACTIVE IDLE 0010 0000 0001 1001 QADC S3 Figure 14-27. CCW Priority Situation 3 The next two situations consider trigger events that occur for the lower priority queue 2, while queue 1 is actively being serviced. Situation S4 (Figure 14-28) shows that a queue 2 trigger event that is recognized while queue 1 is active is saved, and as soon as queue 1 is finished, queue 2 servicing begins. T1 Q1: C1 C2 C3 C4 CF1 T2 C1 C2 C3 C4 Q2: CF2 Q1 IDLE IDLE Q2 QS 0000 IDLE ACTIVE 1000 TRIGGERED ACTIVE IDLE 1011 0010 0000 QADC S4 Figure 14-28. CCW Priority Situation 4 Situation S5 (Figure 14-29) shows that when multiple queue 2 trigger events are detected while queue 1 is busy, the trigger overrun error bit is set, but queue 1 execution is not disturbed. Situation S5 also shows that the effect of queue 2 trigger events during queue 1 execution is the same when the pause feature is in use in either queue. MPC561/MPC563 Reference Manual, Rev. 1.2 14-56 Freescale Semiconductor QADC64E Enhanced Mode Operation T1 T1 Q1: C1 C2 T2 T2 C3 T2 T2 PF1 Q2: C1 IDLE IDLE Q2 QS 0000 1000 C3 ACTIVE 1011 0110 CF2 ACTIVE ACTIVE PAUSE TRIG C4 TOR2 PF2 ACTIVE CF1 C2 TOR2 Q1 C4 IDLE TRIG PAUSE ACTIVE IDLE 0010 0000 0101 1001 1011 QADC S5 Figure 14-29. CCW Priority Situation 5 The remaining situations, S6 through S11, show the impact of a queue 1 trigger event occurring during queue 2 execution. Queue 1 is higher in priority the conversion taking place in queue 2 is aborted, so that there is not a variable latency time in responding to queue 1 trigger events. In situation S6 (Figure 14-30), the conversion initiated by the second CCW in queue 2 is aborted just before the conversion is complete, so that queue 1 execution can begin. Queue 2 is considered suspended. After queue 1 is finished, queue 2 starts over with the first CCW, when the RES (resume) control bit is set to 0. Situation S7 (Figure 14-31) shows that when pause operation is not in use with queue 2, queue 2 suspension works the same way. T1 Q1: T1 C1 C2 C3 C4 RESUME=0 T2 PF1 CF1 Q2: C1 C1 C2 C2 C3 C4 CF2 Q1 IDLE PAUSE ACTIVE IDLE Q2 QS ACTIVE 0000 1000 0100 0110 ACTIVE ACTIVE SUSPEND 1010 IDLE ACTIVE 0010 IDLE 0000 QADC S6 Figure 14-30. CCW Priority Situation 6 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-57 QADC64E Enhanced Mode Operation T1 Q1: T1 C1 C2 T2 Q2: C3 PF1 C1 C2 C4 T2 C1 CF1 C3 C2 C3 C4 CF2 PF2 IDLE Q1 ACTIVE Q2 IDLE ACTIVE QS 0000 0010 PAUSE SUSPEND ACTIVE IDLE ACTIVE PAUSE ACT SUSPEND 0110 1010 RESUME=0 1010 0101 0110 ACTIVE IDLE 0010 0000 QADC S7 Figure 14-31. CCW Priority Situation 7 Situations S8 and S9 (Figure 14-32 and Figure 14-33) repeat the same two situations with the resume bit set to a one. When the RES bit is set, following suspension, queue 2 resumes execution with the aborted CCW, not the first CCW in the queue. T1 Q1: T1 C1 C2 C3 C4 T2 PF1 Q2: RESUME=1 CF1 C1 C2 C2 C3 C4 CF2 Q1 Q2 QS IDLE PAUSE ACTIVE IDLE 0000 ACTIVE 1000 0100 0110 ACTIVE ACTIVE SUSPEND 1010 IDLE ACTIVE IDLE 0010 0000 QADC S8 Figure 14-32. CCW Priority Situation 8 MPC561/MPC563 Reference Manual, Rev. 1.2 14-58 Freescale Semiconductor QADC64E Enhanced Mode Operation T1 Q1: T1 C1 C2 T2 Q2: C3 PF1 C1 C1 C2 C4 T2 CF1 C4 C3 C2 C4 CF2 PF2 ACTIVE IDLE Q1 Q2 IDLE ACTIVE QS 0000 0010 ACT PAUSE 0110 0101 1010 IDLE ACTIVE PAUSE SUSPEND RESUME=1 ACTIVE SUSPEND ACT IDLE 0110 1010 0010 0000 QADC S9 Figure 14-33. CCW Priority Situation 9 Situations S10 and S11 (Figure 14-34 and Figure 14-35) show that when an additional trigger event is detected for queue 2 while the queue is suspended, the trigger overrun error bit is set, the same as if queue 2 were being executed when a new trigger event occurs. Trigger overrun on queue 2 thus permits the software to know that queue 1 is taking up so much QADC64E time that queue 2 trigger events are being lost. T1 Q1: T2 Q2: T1 ACTIVE C1 C2 T2 C1 ACTIVE C3 C4 PF1 T2 C1 C2 C2 TOR2 IDLE Q1 ACTIVE Q2 IDLE ACTIVE QS 0000 0010 SUSPEND 1010 T2 0110 1010 RESUME=0 CF2 IDLE ACTIVE PAUSE ACT SUSPEND 0101 C4 TOR2 PAUSE 0110 C3 C3 PF2 ACTIVE CF1 ACTIVE IDLE 0010 0000 QADC S10 Figure 14-34. CCW Priority Situation 10 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-59 QADC64E Enhanced Mode Operation T1 T1 C1 Q1: T2 Q2: C2 T2 C1 PF1 C2 IDLE IDLE ACTIVE QS 0000 0010 C3 RESUME=1 C4 CF2 TOR2 IDLE ACTIVE ACT PAUSE ACTIVE 0110 0101 1010 CF1 C4 PAUSE SUSPEND C4 T2 PF2 ACTIVE Q2 T2 C2 TOR2 Q1 C3 0110 SUSPEND 1010 ACT IDLE 0010 0000 QADC S11 Figure 14-35. CCW Priority Situation 11 The above situations cover normal overlap conditions that arise with asynchronous trigger events on the two queues. An additional conflict to consider is that the freeze condition can arise while the QADC64E is actively executing CCWs. The conventional use for the freeze mode is for software/hardware debugging. When the CPU background debug mode is enabled and a breakpoint occurs, the freeze signal is issued, which can cause peripheral modules to stop operation. When freeze is detected, the QADC64E completes the conversion in progress, unlike queue 1 suspending queue 2. After the freeze condition is removed, the QADC64E continues queue execution with the next CCW in sequence. Trigger events that occur during freeze are not captured. When a trigger event is pending for queue 2 before freeze begins, that trigger event is remembered when the freeze is passed. Similarly, when freeze occurs while queue 2 is suspended, after freeze, queue 2 resumes execution as soon as queue 1 is finished. Situations 12 through 19 (Figure 14-36 to Figure 14-43) show examples of all of the freeze situations. FREEZE T1 Q1: C1 C2 C3 C4 CF1 QADC S12 Figure 14-36. CCW Freeze Situation 12 MPC561/MPC563 Reference Manual, Rev. 1.2 14-60 Freescale Semiconductor QADC64E Enhanced Mode Operation FREEZE T2 Q2: C1 C2 C3 C4 QADC S13 CF2 Figure 14-37. CCW Freeze Situation 13 (TRIGGERS IGNORED) FREEZE T1 T1 T1 C1 Q1: C2 C3 C4 QADC S14 T2 T2 CF1 Figure 14-38. CCW Freeze Situation 14 (TRIGGERS IGNORED) FREEZE T2 Q2: T2 T2 C1 C2 C3 C4 T1 T1 QADC S15 CF2 Figure 14-39. CCW Freeze Situation 15 (TRIGGERS IGNORED) FREEZE T1 Q1: T1 C1 T1 C2 C3 PF1 C4 CF1 QADC S16 Figure 14-40. CCW Freeze Situation 16 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-61 QADC64E Enhanced Mode Operation (TRIGGERS IGNORED) FREEZE T2 T2 Q2: C1 T2 C2 C3 PF2 C4 CF2 QADC S17 Figure 14-41. CCW Freeze Situation 17 FREEZE T1 Q1: C1 C2 C3 C4 T2 CF1 (TRIGGER CAPTURED, RESPONSE DELAYED AFTER FREEZE) Q2: C1 C2 C3 C4 CF2 QADC S18 Figure 14-42. CCW Freeze Situation 18 FREEZE T1 Q1: C1 C2 C3 C4 T2 Q2: CF1 C1 C2 C3 C4 C4 CF2 QADC S19 Figure 14-43. CCW Freeze Situation 19 14.5.2 Conversion Timing Schemes This section contains some conversion timing examples. Example 1 below shows the timing for basic conversions where the following is assumed: * Q1 begins with CCW0 and ends with CCW3 * CCW0 has pause bit set * CCW1 does not have pause bit set * External trigger rise-edge for Q1 * CCW4 = BQ2 and Q2 is disabled MPC561/MPC563 Reference Manual, Rev. 1.2 14-62 Freescale Semiconductor QADC64E Enhanced Mode Operation * Q1 RES shows relative result register updates Conversion time is >= 14 QCLKS Time between triggers QCLK Trig1 EOC QS CWP CWPQ1 0 4 LAST 8 4 8 CCW1 CCW0 LAST CCW0 CCW2 CCW1 R0 Q1 RES R1 Figure 14-44. External Trigger Mode (Positive Edge) Timing with Pause Recall QS = 0 => Queues disabled; QS = 8 => Q1 active, Q2 disabled; QS= 4 => Q1 paused, Q2 disabled. A time separator was provided between the triggers and end of conversion (EOC). The relationship to QCLK displayed is not guaranteed. CWPQ1 or CWPQ2 typically lag CWP and only match CWP when the associated queue is inactive. Another way to view CWPQ1(2) is that these registers update when EOC triggers the result register to be written. When the pause bit is set (CCW0), please note that CWP does not increment until triggered. When the pause is not set (CCW1), the CWP increments with EOC. The conversion results Q1 RES(x) show the result associated with CCW(x). So that R0 represents the result associated with CCW0. Example 2 below shows the timing for conversions in gated mode single-scan with the same assumptions as example 1 except: * No pause bits set in any CCW * External trigger gated single-scan mode for Q1 * Single-scan bit is set When the gate closes and opens again the conversions start with the first CCW in Q1. When the gate closes the active conversion completes before the queue goes idle. When Q1 completes both the CF1 bit sets and the SSE bit clears. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-63 QADC64E Enhanced Mode Operation Trig1 (gate) EOC QS CWP CWPQ1 Q1 RES SSE 8 0 LAST 0 CCW0 LAST LAST 8 CCW1 CCW0 0 CCW1 CCW2 CCW3 CCW0 CCW1 CCW0 CCW1 CCW2 CCW3 R0 R1 R0 R1 R2 R3 Software must set SSE CF1 PF1 Software must clear PF1 Figure 14-45. Gated Mode, Single-Scan Timing Example 3 below shows the timing for conversions in gated continuous-scan mode with the same assumptions in the amended definition for the PF bit in this mode to reflect the condition that a gate closing occurred before the queue completed is a proposal under consideration at this time as example 2. NOTE At the end of Q1,the completion flag CF1 sets and the queue restarts. Also, note that if the queue starts a second time and completes, the trigger overrun flag TOR1 sets. MPC561/MPC563 Reference Manual, Rev. 1.2 14-64 Freescale Semiconductor QADC64E Enhanced Mode Operation Trig1 (gate) EOC 8 0 QS LAST CCW0 CCW1 CCW2 CCW3 CCW0 CCW3 CCW0 CWPQ1 LAST CCW0 CCW1 CCW2 CCW3 CCW2 CCW3 Q1 RES XX CWP R0 R1 R2 R3 R2 R3 CF1 TOR1 Q restart Q restart Figure 14-46. Gated Mode, Continuous Scan Timing 14.6 QADC64E Integration Requirements The QADC64E requires accurate, noise-free input signals for proper operation. This section discusses the design of external circuitry to maximize QADC64E performance. The QADC64E uses the external signals shown in Figure 14-1. There are 16 channel signals that can also be used as general-purpose digital input/output signals. With external multiplexing MPC561/MPC563 can support 41 analog inputs. In addition, there are three analog reference signals and two analog submodule power signals, shared by each QADC64E module. 14.6.1 Port Digital Input/Output Signals The sixteen port signals can be used as analog inputs, or as a bidirectional 16-bit digital input/output port. Port A signals are referred to as PQA[7:0] when used as a bidirectional 8-bit digital input/output port. These eight signals may be used for general-purpose digital input signals or push-pull digital output signals. Port B signals are referred to as PQB[7:0] and operate the same as Port A. Port A and B signals are connected to a digital input synchronizer during reads and may be used as general purpose digital inputs when the applied voltages meet high voltage input (VIH) and low voltage input (VIL) requirements. Refer to Appendix F, "Electrical Characteristics," for more information on voltage requirements. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-65 QADC64E Enhanced Mode Operation Each port A or B signal is configured as an input or output by programming the port data direction register (DDRQA or DDRQB). The digital input signal states are read by the software in the upper half of the port data register when the port data direction register specifies that the signals are inputs. The digital data in the port data register is driven onto the port A or B signals when the corresponding bit in the port data direction register specifies output. Refer to Appendix B, "Internal Memory Map" for more information. Since the outputs are configured as push-pull drivers, external pull-up provisions are not necessary when the output is used to drive another integrated circuit. 14.6.2 External Trigger Input Signals The QADC64E uses two external trigger signals (ETRIG[2:1]). Each of the two input external trigger signals is associated with one of the scan queues, queue 1 or queue 2 The assignment of ETRIG[2:1] to a queue is made in the QACR0 register by the TRG bit. When TRG=0, ETRIG1 triggers queue 1 and ETRIG2 triggers queue 2. When TRG=1, ETRIG1 triggers queue 2 and ETRIG2 triggers queue 1. 14.6.3 Analog Power Signals VDDA and VSSA signals supply power to the analog subsystems of the QADC64E module. Dedicated power is required to isolate the sensitive analog circuitry from the normal levels of noise present on the digital power supply. Refer to Appendix F, "Electrical Characteristics," for more information. The analog supply signals (VDDA and VSSA) define the limits of the analog reference voltages (VRH and VRL) and of the analog multiplexer inputs. Figure 14-47 is a diagram of the analog input circuitry. VDDA VRH SAMPLE AMP S/H RC DAC Comparator 16 CHANNELS CP VSSA VRL QADC64E 16CH SAMPLE AMP Figure 14-47. Equivalent Analog Input Circuitry MPC561/MPC563 Reference Manual, Rev. 1.2 14-66 Freescale Semiconductor QADC64E Enhanced Mode Operation Since the sample amplifier is powered by VDDA and VSSA, it can accurately transfer input signal levels up to but not exceeding VDDA and down to but not below VSSA. If the input signal is outside of this range, the output from the sample amplifier is clipped. In addition, VRH and VRL must be within the range defined by VDDA and VSSA. As long as VRH is less than or equal to VDDA and VRL is greater than or equal to VSSA and the sample amplifier has accurately transferred the input signal, resolution is ratiometric within the limits defined by VRL and VRH. If VRH is greater than VDDA, the sample amplifier can never transfer a full-scale value. If VRL is less than VSSA, the sample amplifier can never transfer a zero value. Figure 14-48 shows the results of reference voltages outside the range defined by VDDA and VSSA. At the top of the input signal range, VDDA is 10 mV lower than VRH. This results in a maximum obtainable 10-bit conversion value of 0x3FE. At the bottom of the signal range, VSSA is 15 mV higher than VRL, resulting in a minimum obtainable 10-bit conversion value of three. 3FF 10-Bit Result (Hexadecimal) 3FE 3FD 3FC 3FB 3FA 8 7 6 5 4 3 2 1 0 .010 .020 .030 5.100 5.110 5.120 Input in Volts (VRH = 5.12 V, VRL = 0 V) 5.130 QADC64E Clipping Figure 14-48. Errors Resulting from Clipping 14.6.3.1 Analog Supply Filtering and Grounding Two important factors influencing performance in analog integrated circuits are supply filtering and grounding. Generally, digital circuits use bypass capacitors on every VDD/VSS signal pair. This applies to analog sub-modules also. The distribution of power and ground is equally important. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-67 QADC64E Enhanced Mode Operation Analog supplies should be isolated from digital supplies as much as possible. This necessity stems from the higher performance requirements often associated with analog circuits. Therefore, deriving an analog supply from a local digital supply is not recommended. However, if for economic reasons digital and analog power are derived from a common regulator, filtering of the analog power is recommended in addition to the bypassing of the supplies already mentioned. NOTE An RC low pass filter could be used to isolate the digital and analog supplies when generated by a common regulator. If multiple high precision analog circuits are locally employed (i.e., two A/D converters), the analog supplies should be isolated from each other as sharing supplies introduces the potential for interference between analog circuits. Grounding is the most important factor influencing analog circuit performance in mixed signal systems (or in stand-alone analog systems). Close attention must be paid not to introduce additional sources of noise into the analog circuitry. Common sources of noise include ground loops, inductive coupling, and combining digital and analog grounds together inappropriately. The problem of how and when to combine digital and analog grounds arises from the large transients which the digital ground must handle. If the digital ground is not able to handle the large transients, the current from the large transients can return to ground through the analog ground. It is the excess current overflowing into the analog ground which causes performance degradation by developing a differential voltage between the true analog ground and the microcontroller's ground signal. The end result is that the ground observed by the analog circuit is no longer true ground and often ends in skewed results. Two similar approaches designed to improve or eliminate the problems associated with grounding excess transient currents involve star-point ground systems. One approach is to star-point the different grounds at the power supply origin, thus keeping the ground isolated. Refer to Figure 14-49. MPC561/MPC563 Reference Manual, Rev. 1.2 14-68 Freescale Semiconductor QADC64E Enhanced Mode Operation Digital Power Supply Analog Power Supply QADC64E PGND +5V VDDA +5V VSSA AGND VRL VRH +5V VSS VDD PCB Figure 14-49. Star-Ground at the Point of Power Supply Origin Another approach is to star-point the different grounds near the analog ground signal on the microcontroller by using small traces for connecting the non-analog grounds to the analog ground. The small traces are meant only to accommodate DC differences, not AC transients. NOTE This star-point scheme still requires adequate grounding for digital and analog subsystems in addition to the star-point ground. Other suggestions for PCB layout in which the QADC64E is employed include: * Analog ground must be low impedance to all analog ground points in the circuit. * Bypass capacitors should be as close to the power signals as possible. * The analog ground should be isolated from the digital ground. This can be done by cutting a separate ground plane for the analog ground. * Non-minimum traces should be utilized for connecting bypass capacitors and filters to their corresponding ground/power points. * Distance for trace runs should be minimized where possible. 14.6.4 Analog Reference Signals VRH and VRL are the dedicated input signals for the high and low reference voltages. Separating the reference inputs from the power supply signals allows for additional external filtering, which increases reference voltage precision and stability, and subsequently contributes to a higher degree of conversion accuracy. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-69 QADC64E Enhanced Mode Operation The AltRef signal may be selected through the CCW as the high reference for a conversion. This allows for the ability to "zoom" in on a portion of the convertible range with the full 10 bits. Refer to Table 14-19. No A/D converter can be more accurate than its analog reference. Any noise in the reference can result in at least that much error in a conversion. The reference for the QADC64E, supplied by signals VRH, AltRef, and VRL, should be low-pass filtered from its source to obtain a noise-free, clean signal. In many cases, simple capacitive bypassing may sufficed. In extreme cases, inductors or ferrite beads may be necessary if noise or RF energy is present. Series resistance is not advisable since there is an effective DC current requirement from the reference voltage by the internal resistor string in the RC DAC array. External resistance may introduce error in this architecture under certain conditions. Any series devices in the filter network should contain a minimum amount of DC resistance. 14.6.5 Analog Input Signals Analog inputs should have low AC impedance at the signals. Low AC impedance can be realized by placing a capacitor with good high frequency characteristics at the input signal of the part. Ideally, that capacitor should be as large as possible (within the practical range of capacitors that still have good high frequency characteristics). This capacitor has two effects: * It helps attenuate any noise that may exist on the input. * It sources charge during the sample period when the analog signal source is a high-impedance source. Series resistance can be used with the capacitor on an input signal to implement a simple RC filter. The maximum level of filtering at the input signals is application dependent and is based on the bandpass characteristics required to accurately track the dynamic characteristics of an input. Simple RC filtering at the signal may be limited by the source impedance of the transducer or circuit supplying the analog signal to be measured. Refer to Section 14.6.5.3, "Error Resulting from Leakage" for more information. In some cases, the size of the capacitor at the signal may be very small. Figure 14-50 is a simplified model of an input channel. Refer to this model in the following discussion of the interaction between the external circuitry and the circuitry inside the QADC64E. MPC561/MPC563 Reference Manual, Rev. 1.2 14-70 Freescale Semiconductor QADC64E Enhanced Mode Operation Source RSRC External Filter Internal Circuit Model S1 RF S2 S3 AMP CSAMP VSRC CF VI CP VSRC = Source Voltage RSRC = Source Impedance RF = Filter Impedance CF = Filter Capacitor CP = Internal Parasitic Capacitance CSAMP= Sample Capacitor VI = Internal Voltage Source During Sample and Hold QADC64E Sample AMP Model Figure 14-50. Electrical Model of an A/D Input Signal In Figure 14-50, RF, RSRC and CF comprise the external filter circuit. CP is the internal parasitic capacitor. CSAMP is the capacitor array used to sample and hold the input voltage. VI is an internal voltage source used to provide charge to CSAMP during sample phase. The following paragraphs provide a simplified description of the interaction between the QADC64E and the external circuitry. This circuitry is assumed to be a simple RC low-pass filter passing a signal from a source to the QADC64E input signal. The following simplifying assumptions are made: * * * * The external capacitor is perfect (no leakage, no significant dielectric absorption characteristics, etc.) All parasitic capacitance associated with the input signal is included in the value of the external capacitor Inductance is ignored The "on" resistance of the internal switches is 0 and the "off" resistance is infinite 14.6.5.1 Analog Input Considerations The source impedance of the analog signal to be measured and any intermediate filtering should be considered whether external multiplexing is used or not. Figure 14-51 shows the connection of eight typical analog signal sources to one QADC64E analog input signal through a separate multiplexer chip. Also, an example of an analog signal source connected directly to a QADC64E analog input channel is displayed. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-71 QADC64E Enhanced Mode Operation Analog Signal Source Filtering and Interconnect RSOURCE2 ~ R Typical Mux Chip (MC54HC4051, MC74HC4051, MC54HC4052, MC74HC4052, MC54HC4053, etc.) Interconnect QADC64E 2 FILTER 0.01 F1 CSOURCE 2 RSOURCE ~ R C FILTER FILTER2 CMUXIN 0.01 F1 CSOURCE 2 RSOURCE C R FILTER2FILTER CMUXIN ~ R 0.01 F1 CSOURCE R SOURCE2 ~ MUXOUT C2FILTER R FILTER CMUXIN C 0.01 F1 CSOURCE 2 RSOURCE MUXOUT CFILTER R FILTER2 C PCB C P CMUXIN C SAMP CIN = CP + CSAMP ~ CSOURCE 2 R SOURCE 0.01 F 1 CFILTER R FILTER2 CMUXIN ~ CSOURCE R SOURCE2 0.01 F1 R ~ CSOURCE 2 RSOURCE ~ CFILTER 2 FILTER CMUXIN 0.01 F1 R C FILTER 2 FILTER CMUXIN 0.01 F1 CSOURCE C FILTER RSOURCE2 C MUXIN R FILTER2 ~ CSOURCE 0.01 F1 CFILTER CPCB CP CSAMP QADC64E EXT MUX EX Figure 14-51. External Multiplexing of Analog Signal Sources MPC561/MPC563 Reference Manual, Rev. 1.2 14-72 Freescale Semiconductor QADC64E Enhanced Mode Operation 14.6.5.2 Settling Time for the External Circuit The values for RSRC, RF and CF in the external circuitry determine the length of time required to charge CF to the source voltage level (VSRC). At time t = 0, VSRC changes in Figure 14-50 while S1 is open, disconnecting the internal circuitry from the external circuitry. Assume that the initial voltage across CF is zero. As CF charges, the voltage across it is determined by the following equation, where t is the total charge time: As t approaches infinity, VCF will equal VSRC. (This assumes no internal leakage.) With 10-bit resolution, 1/2 of a count is equal to 1/2048 full-scale value. Assuming worst case (VSRC = full scale), Table 14-25 shows the required time for CF to charge to within 1/2 of a count of the actual source voltage during 10-bit conversions. Table 14-25 is based on the RC network in Figure 14-50. NOTE The following times are completely independent of the A/D converter architecture (assuming the QADC64E is not affecting the charging). Table 14-25. External Circuit Settling Time to 1/2 LSB (10-Bit Conversions) Filter Capacitor (CF) Source Resistance (RF + RSRC) 100 1 k 10 k 100 k 1 F 760 s 7.6 ms 76 ms 760 ms .1 F 76 s 760 s 7.6 ms 76 ms .01 F 7.6 s 76 s 760 s 7.6 ms .001 F 760 ns 7.6 s 76 s 760 s 100 pF 76 ns 760 ns 7.6 s 76 s The external circuit described in Table 14-25 is a low-pass filter. A user interested in measuring an AC component of the external signal must take the characteristics of this filter into account. 14.6.5.3 Error Resulting from Leakage A series resistor limits the current to a signal, therefore input leakage acting through a large source impedance can degrade A/D accuracy. The maximum input leakage current is specified in Appendix F, "Electrical Characteristics." Input leakage is greater at higher operating temperatures. In the temperature range from 125 C to 50 C, the leakage current is halved for every 8 - 12 C reduction in temperature. Assuming VRH - VRL = 5.12 V, one count (assuming 10-bit resolution) corresponds to 5 mV of input voltage. A typical input leakage of 200 nA acting through 10 k of external series resistance results in an error of 0.4 count (2.0 mV). If the source impedance is 100 k and a typical leakage of 100 nA is present, an error of two counts (10 mV) is introduced. In addition to internal junction leakage, external leakage (e.g., if external clamping diodes are used) and charge sharing effects with internal capacitors also contribute to the total leakage current. Table 14-26 illustrates the effect of different levels of total leakage on accuracy for different values of source impedance. The error is listed in terms of 10-bit counts. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-73 QADC64E Enhanced Mode Operation WARNING Leakage from the part below 200 nA is obtainable only within a limited temperature range. Table 14-26. Error Resulting From Input Leakage (IOFF) Leakage Value (10-bit Conversions) Source Impedance 14.6.5.4 100 nA 200 nA 500 nA 1000 nA 1 k -- -- 0.1 counts 0.2 counts 10 k 0.2 counts 0.4 counts 1 counts 2 counts 100 k 2 counts 4 count 10 counts 20 counts Accommodating Positive/Negative Stress Conditions Positive or negative stress refers to conditions which exceed nominally defined operating limits. Examples include applying a voltage exceeding the normal limit on an input (for example, voltages outside of the suggested supply/reference ranges) or causing currents into or out of the signal which exceed normal limits. QADC64E specific considerations are voltages greater than VDDA, VRH or less than VSSA applied to an analog input which cause excessive currents into or out of the input. Refer to Appendix F, "Electrical Characteristics," to for more information on exact magnitudes. Either stress condition can potentially disrupt conversion results on neighboring inputs. Parasitic devices, associated with CMOS processes, can cause an immediate disruptive influence on neighboring signals. Common examples of parasitic devices are diodes to substrate and bipolar devices with the base terminal tied to substrate (VSSI/VSSA ground). Under stress conditions, current injected on an adjacent signal can cause errors on the selected channel by developing a voltage drop across the selected channel's impedances. Figure 14-52 shows an active parasitic bipolar NPN transistor when an input signal is subjected to negative stress conditions. Figure 14-53 shows positive stress conditions can activate a similar PNP transistor. VSTRESS RSTRESS + IINJN 10K RSELECTED IIN ANn Signal Under Stress PARASITIC DEVICE ANn+1 Adjacent Signal VIN QADC64E PAR Figure 14-52. Input Signal Subjected to Negative Stress MPC561/MPC563 Reference Manual, Rev. 1.2 14-74 Freescale Semiconductor QADC64E Enhanced Mode Operation VSTRESS RSTRESS IINJP + 10K RSELECTED IIN ANn Signal Under Stress VDDA PARASITIC DEVICE ANn+1 Adjacent Signal VIN QADC64E PAR Figure 14-53. Input Signal Subjected to Positive Stress The current into the signal (IINJN or IINJP) under negative or positive stress is determined by the following equations: where: - ( V STRESS - V BE ) I INJN = -----------------------------------------------------R STRESS Eqn. 14-1 V STRESS - V EB - V DDA I INJP = ---------------------------------------------------------------------R STRESS Eqn. 14-2 VSTRESS = Adjustable voltage source VEB = Parasitic PNP emitter/base voltage (refer to VNEGCLAMP in Appendix F, "Electrical Characteristics") VBE = Parasitic NPN base/emitter voltage (refer to VNEGCLAMP in Appendix F, "Electrical Characteristics")) RSTRESS = Source impedance (10-k resistor in Figure 14-52 and Figure 14-53 on stressed channel) RSELECTED = Source impedance on channel selected for conversion The current into (IIN) the neighboring signal is determined by the KN (current coupling ratio) of the parasitic bipolar transistor (KN << 1). The IIN can be expressed by the following equation: IIN = - KN * IINJ where IINJ is either IINJN or IINJP. A method for minimizing the impact of stress conditions on the QADC64E is to strategically allocate QADC64E inputs so that the lower accuracy inputs are adjacent to the inputs most likely to see stress conditions. Also, suitable source impedances should be selected to meet design goals and minimize the effect of stress conditions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 14-75 QADC64E Enhanced Mode Operation MPC561/MPC563 Reference Manual, Rev. 1.2 14-76 Freescale Semiconductor Chapter 15 Queued Serial Multi-Channel Module The MPC561/MPC563 contains one queued serial multi-channel module (QSMCM). The QSMCM provides three serial communication interfaces: the queued serial peripheral interface (QSPI) and two serial communications interfaces (SCI/UART). These submodules communicate with the CPU via a common slave bus interface unit (SBIU). The QSPI is a full-duplex, synchronous serial interface for communicating with peripherals and other MCUs. It is enhanced from the original SPI in the QSMCM (queued serial module) to include a total of 160 bytes of queue RAM to accommodate more receive, transmit, and control information. The duplicate, independent SCIs are full-duplex universal asynchronous receiver transmitter (UART) serial interface. The original QSM SCI is enhanced by the addition of an SCI, a common external baud clock source, receive and transmit buffers on one SCI. The SCIs are fully compatible with the SCI systems found on other Freescale MCUs. The dual, independent SCI, DSCI, submodule is used to communicate with external devices and other MCUs via an asynchronous serial bus. The DSCI has all of the capabilities of previous SCI systems as well as several significant new features. The following paragraphs describe the features, pins, programming model (memory map), registers, and the transmit and receive operations of the DSCI. The SBIU provides an interface between the QSMCM module and the intermodule bus (IMB3). 15.1 Block Diagram Figure 15-1 shows the major components of the QSMCM. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-1 Queued Serial Multi-Channel Module IMB3* MISO/QGPIO4 SBIU MOSI/QGPIO5 SCK/QGPIO6 PCS0/SS/QGPIO0 SBIU Bus QSPI 7 Port QS QSPI QUEUE RAM DSCI SCI1 DSCI PCS1/QGPIO1 2 PCS2/QGPIO2 PCS3/QGPIO3 TXD1/QGPO1 RXD1/QGPI1 Receive and Transmit Queue TXD2/QGPO2 SCI2 2 RXD2/QGPI2 Note: SBIU bus and interface to IMB3 are each 16 bits wide. Figure 15-1. QSMCM Block Diagram 15.2 Key Features Standard SPI features are listed below, followed by a list of the additional features offered on the QSPI: * Full-duplex, three-wire synchronous transfers * Half-duplex, two-wire synchronous transfers * Master or slave operation on the SPI bus * Programmable master bit rates * Programmable clock polarity and phase * End-of-transmission interrupt flag * Master-master mode fault flag * Easily interfaces to simple expansion parts (A/D converters, EEPROMS, display drivers, etc.) QSPI-enhanced features are as follows: * Programmable Queue -- up to 32 preprogrammed transfers * Programmable Peripheral Chip-Selects -- four pins select up to 16 SPI chips * Wraparound Transfer Mode -- for autoscanning of serial A/D (or other) peripherals, with no CPU overhead * Programmable Transfer Length -- from 8-16 bits inclusive MPC561/MPC563 Reference Manual, Rev. 1.2 15-2 Freescale Semiconductor Queued Serial Multi-Channel Module * * * * Programmable Transfer Delay -- from 0.6 s to 0.3 s (at 28 MHz) Programmable Queue Pointer Continuous Transfer Mode -- up to 256 bits Optional on-chip expanded QSPI chip selects Standard SCI features are listed below, followed by a list of additional features offered. Standard SCI two-wire system features: * Standard nonreturn-to-zero (NRZ) mark/space format * Advanced error detection mechanism (detects noise duration up to 1/16 of a bit-time) * Full-duplex operation * Software selectable word length (8- or 9-bit words) * Separate transmitter and receiver enable bits * May be interrupt driven * Four separate interrupt enable bits * Two independent operating SCI modules Standard SCI receiver features: * Receiver wakeup function (idle or address mark bit) * Idle-line detect * Framing, noise, and overrun error detect * Receive data register full flag Standard SCI transmitter features: * Transmit data register empty flag * Transmit complete flag * Send break QSMCM-additional SCI features: * 13-bit programmable baud-rate modulus counter * Even/odd parity generation and detection * Two idle-line detect modes * Receiver active flag QSMCM-enhanced SCI features: * 16 register receive buffer on one SCI * 16 register transmit buffer on one SCI 15.2.1 MPC561/MPC563 QSMCM Details The QSMCM module has an identical function to the MPC555. The MUXing of the pins is controlled by the QPAPCS3 bit in the QSMCM pin assignment register (PQSPAR). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-3 Queued Serial Multi-Channel Module 15.3 Memory Maps The QSMCM memory maps, shown in Table 15-1 and Table 15-2, includes the global registers, the QSPI and dual SCI control and status registers, and the QSPI RAM. The QSMCM memory map can be divided into supervisor-only data space and assignable data space. The address offsets shown are from the base address of the QSMCM module. Refer to Figure 1-4 for a diagram of the MPC561/MPC563 internal memory map. Table 15-1. QSMCM Register Map Access1 Address MSB2 LSB 0 15 S 0x30 5000 QSMCM Module Configuration Register (QSMCMMCR) See Table 15-7 for bit descriptions. T 0x30 5002 QSMCM Test Register (QTEST) S 0x30 5004 Dual SCI Interrupt Level (QDSCI_IL) See Table 15-5 for bit descriptions. Reserved S 0x30 5006 Reserved Queued SPI Interrupt Level (QSPI_IL) See Table 15-6 for bit descriptions. S/U 0x30 5008 SCI1Control Register 0 (SCC1R0) See Table 15-24 for bit descriptions. S/U 0x30 500A SCI1Control Register 1 (SCC1R1) See Table 15-25 for bit descriptions. S/U 0x30 500C SCI1 Status Register (SC1SR) See Table 15-26 for bit descriptions. S/U 0x30 500E SCI1 Data Register (SC1DR) See Table 15-27 for bit descriptions. S/U 0x30 5010 Reserved S/U 0x30 5012 Reserved S/U 0x30 5014 Reserved S/U 0x30 5016 QSMCM Pin Assignment Register (PQSPAR) See Table 15-10 for bit descriptions. S/U 0x30 5018 QSPI Control Register 0 (SPCR0) See Table 15-13 for bit descriptions. S/U 0x30 501A QSPI Control Register 1 (SPCR1) See Table 15-15 for bit descriptions. S/U 0x30 501C QSPI Control Register 2 (SPCR2) See Table 15-16 for bit descriptions. S/U 0x30 501E QSMCM Port Q Data Register (PORTQS) See Section 15.5.1, "Port QS Data Register (PORTQS)," for bit descriptions. QSPI Control Register 3 (SPCR3) See Table 15-17 for bit descriptions. QSMCM Data Direction Register (DDRQS) See Table 15-11 for bit descriptions. QSPI Status Register (SPSR) See Table 15-18 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 15-4 Freescale Semiconductor Queued Serial Multi-Channel Module Table 15-1. QSMCM Register Map (continued) Access1 Address MSB2 LSB 15 0 S/U 0x30 5020 SCI2 Control Register 0 (SCC2R0) S/U 0x30 5022 SCI2 Control Register 1 (SCC2R1) S/U 0x30 5024 SCI2 Status Register (SC2SR) S/U 0x30 5026 SCI2 Data Register (SC2DR) S/U 0x30 5028 QSCI1 Control Register (QSCI1CR) See Table 15-32 for bit descriptions. S/U 0x30 502A QSCI1 Status Register (QSCI1SR) See Table 15-33 for bit descriptions. S/U 0x30 502C - 0x30 504A Transmit Queue Locations (SCTQ) S/U 0x30 504C - 0x30 506A Receive Queue Locations (SCRQ) S/U 0x30 506C - 0x30 513F3 Reserved S/U 0x30 5140 - 0x30 517F Receive Data RAM (REC.RAM) S/U 0x30 5180 - 0x30 51BF Transmit Data RAM (TRAN.RAM) S/U 0x30 51C0 - 0x30 51DF Command RAM (COMD.RAM) 1 S = Supervisor access only S/U = Supervisor access only or unrestricted user access (assignable data space). 2 8-bit registers, such as SPCR3 and SPSR, are on 8-bit boundaries. 16-bit registers such as SPCR0 are on 16-bit boundaries. 3 Note that QRAM offsets have been changed from the original (modular family) QSMCM. The supervisor-only data space segment contains the QSMCM global registers. These registers define parameters needed by the QSMCM to integrate with the MCU. Access to these registers is permitted only when the CPU is operating in supervisor mode. Assignable data space can be either restricted to supervisor-only access or unrestricted to both supervisor and user accesses. The supervisor (SUPV) bit in the QSMCM module configuration register (QSMCMMCR) designates the assignable data space as either supervisor or unrestricted. If SUPV is set, then the space is designated as supervisor-only space. Access is then permitted only when the CPU is operating in supervisor mode. If SUPV is clear, both user and supervisor accesses are permitted. To clear SUPV, the CPU must be in supervisor mode. The QSMCM assignable data space segment contains the control and status registers for the QSPI and SCI submodules, as well as the QSPI RAM. All registers and RAM can be accessed on byte (8-bits), half-word (16-bits), and word (32-bit) boundaries. Word accesses require two consecutive IMB3 bus cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-5 Queued Serial Multi-Channel Module 15.4 QSMCM Global Registers The QSMCM global registers contain system parameters used by the QSPI and dual SCI submodules for interfacing to the CPU and the intermodule bus. The global registers are listed in Table 15-2. Table 15-2. QSMCM Global Registers Access1 Address 2 MSB LSB 15 0 S 0x30 5000 QSMCM Module Configuration Register (QSMCMMCR) See Table 15-4 for bit descriptions. T 0x30 5002 QSMCM Test Register (QTEST) S 0x30 5004 Dual SCI Interrupt Level (QDSCI_IL) See Table 15-5 for bit descriptions. Reserved S 0x30 5006 Reserved Queued SPI Interrupt Level (QSPI_IL) See Table 15-6 for bit descriptions. 1 S = Supervisor access only S/U = Supervisor access only or unrestricted user access (assignable data space). 2 8-bit registers reside on 8-bit boundaries. 16-bit registers reside on 16-bit boundaries. 15.4.1 Low-Power Stop Operation When the STOP bit in QSMCMMCR is set, the IMB3 clock input to the QSMCM is disabled and the module enters a low-power operating state. QSMCMMCR is the only register guaranteed to be readable while STOP is asserted. The QSPI RAM is not readable in low-power stop mode. However, writes to RAM or any register are guaranteed valid while STOP is asserted. STOP can be written by the CPU and is cleared by reset. System software must bring each submodule to an orderly stop before setting STOP to avoid data corruption. The SCI receiver and transmitter should be disabled after transfers in progress are complete. The QSPI can be halted by setting the HALT bit in SPCR3 and then setting STOP after the HALTA flag is set in SPSR. 15.4.2 Freeze Operation The FRZ1 bit in QSMCMMCR determines how the QSMCM responds when the IMB3 FREEZE signal is asserted. FREEZE is asserted when the CPU enters background debug mode. Setting FRZ1 causes the QSPI to halt on the first transfer boundary following FREEZE assertion. FREEZE causes the SCI1 transmit queue to halt on the first transfer boundary following FREEZE assertion. 15.4.3 Access Protection The SUPV bit in the QMCR defines the assignable QSMCM registers as either supervisor-only data space or unrestricted data space. When the SUPV bit is set, all registers in the QSMCM are placed in supervisor-only space. For any access from within user mode, the IMB3 address acknowledge (AACK) signal is asserted and a bus error is generated. MPC561/MPC563 Reference Manual, Rev. 1.2 15-6 Freescale Semiconductor Queued Serial Multi-Channel Module Because the QSMCM contains a mix of supervisor and user registers, AACK is asserted for either supervisor or user mode accesses, and the bus cycle remains internal. If a supervisor-only register is accessed in user mode, the module responds as if an access had been made to an unauthorized register location, and a bus error is generated. 15.4.4 QSMCM Interrupts The interrupt structure of the IMB3 supports a total of 32 interrupt levels that are time multiplexed on the IRQB[0:7] lines as seen in Figure 15-2. IMB3 CLOCK ILBS[0:1] IMB3 IRQ[7:0] 00 01 10 11 00 01 IRQ 7:0 IRQ 15:8 IRQ 23:16 IRQ 31:24 IRQ 7:0 10 11 Figure 15-2. QSMCM Interrupt Levels In this structure, all interrupt sources place their asserted level on a time multiplexed bus during four different time slots, with eight levels communicated per slot. The ILBS[0:1] signals indicate which group of eight are being driven on the interrupt request lines. Table 15-3. Interrupt Levels ILBS[0:1] Levels 00 0:7 01 8:15 10 16:23 11 24:31 The QSMCM module is capable of generating one of the 32 possible interrupt levels on the IMB3. The levels that the interrupt will drive can be programmed into the interrupt request level (ILDSCI and ILQSPI) bits located in the interrupt configuration register (QDSCI_IL and QSPI_IL). This value determines which interrupt signal (IRQB[0:7]) is driven onto the bus during the programmed time slot. Figure 15-3 shows a block diagram of the interrupt hardware. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-7 Queued Serial Multi-Channel Module 2 ILBS[0:1] 5 SCI1 and 2 Int Lev Reg. [4:0] 5 QSPI[4:0] Int Lev Reg. [4:0] SCI_1 Interrupt Interrupt Level Encoder SCI_2 Interrupt QSPI Interrupt 8 8 Interrupt Level Decoder 8 IRQ[7:0] Figure 15-3. Interrupt Hardware Block Diagram 15.4.5 QSPI Interrupt Generation 15.4.6 QSMCM Configuration Register (QSMCMMCR) The QSMCMMCR contains parameters for interfacing to the CPU and the intermodule bus. This register can be modified only when the CPU is in supervisor mode. MSB 0 Field STOP SRESET Addr 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 FRZ1 -- SUPV -- 0 00_0000 1 000_0000 13 14 15 0x30 5000 Figure 15-4. QSMCM Configuration Register (QSMCMMCR) MPC561/MPC563 Reference Manual, Rev. 1.2 15-8 Freescale Semiconductor Queued Serial Multi-Channel Module Table 15-4. QSMCMMCR Bit Descriptions Bits Name 0 STOP Stop enable. Refer to Section 15.4.1, "Low-Power Stop Operation." 0 Normal clock operation 1 Internal clocks stopped 1 FRZ1 Freeze1 bit. Refer to Section 15.4.2, "Freeze Operation." 0 Ignore the FREEZE signal 1 Halt the QSMCM (on transfer boundary) 2:7 -- 8 SUPV 9:11 -- Reserved 12:15 -- Reserved. These bits are used for the IARB (interrupt arbitration ID) field in QSM implementations that use hardware interrupt arbitration. 15.4.7 Description Reserved Supervisor / Unrestricted. Refer to Section 15.4.3, "Access Protection." 0 Assigned registers are unrestricted (user access allowed) 1 Assigned registers are restricted (only supervisor access allowed) QSMCM Test Register (QTEST) The QTEST register is used for factory testing of the MCU. 15.4.8 QSMCM Interrupt Level Registers (QDSCI_IL, QSPI_IL) The QDSCI_ILI and QSPI_IL registers determine the interrupt level requested by the QSMCM. The two SCI submodules (DSCI) share a 5-bit interrupt level field, ILDSCI. The QSPI uses a separate field, ILQSPI. The level value is used to determine which interrupt is serviced first when two or more modules or external peripherals simultaneously request an interrupt. The user can select among 32 levels. This register can be accessed only when the CPU is in supervisor mode. MSB LSB 0 Field 1 2 3 -- 4 5 6 7 8 9 ILDSCI SRESET 10 11 12 13 14 15 -- 0000_0000_0000_0000 Addr 0x30 5004 Figure 15-5. QSM2 Dual SCI Interrupt Level Register (QDSCI_IL) Table 15-5. QDSCI_IL Bit Descriptions Bits Name 0:2 -- 3:7 ILDSCI 8:15 -- Description Reserved Interrupt level of Dual SCIs 00000lowest interrupt level request (level 0) 11111highest interrupt level request (level 31) Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-9 Queued Serial Multi-Channel Module MSB LSB 0 1 2 3 4 Field 5 6 7 8 9 10 11 -- 12 13 14 15 ILQSPI 0000_0000_0000_0000 SRESET Addr 0x30 5006 Figure 15-6. QSPI_IL -- QSPI Interrupt Level Register Table 15-6. QSPI_IL Bit Descriptions 15.5 Bits Name 0:10 -- 11:15 ILQSPI Description Reserved Interrupt level of SPI 00000lowest interrupt level request (level 0) 11111highest interrupt level request (level 31) QSMCM Pin Control Registers Table 15-7 lists the three QSMCM pin control registers. Table 15-7. QSMCM Pin Control Registers Address Register 0x30 5014 QSMCM Port Data Register (PORTQS) See Section 15.5.1, "Port QS Data Register (PORTQS) for bit descriptions. 0x30 5016 PORTQS Pin Assignment Register (PQSPAR) See Table 15-10 for bit descriptions. 0x30 5017 PORTQS Data Direction Register (DDRQS) See Table 15-10 for bit descriptions. The QSMCM uses 11 pins. These pins, when not being used by the serial sub-systems, form a parallel port on the MCU. The port QS pin assignment register (PQSPAR) governs the usage of QSPI pins. Clearing a bit assigns the corresponding pin to general-purpose I/O; setting a bit assigns the pin to the QSPI. PQSPAR does not affect operation of the SCI. When the SCIx transmitter is disabled, TXDx is a discrete output; when the SCIx receiver is disabled, RXDx is a discrete input. When the SCIx transmitter or receiver is enabled, the associated TXDx or RXDx pin is assigned its SCI function. The port QS data direction register (DDRQS) determines whether QSPI pins are inputs or outputs. Clearing a bit makes the corresponding pin an input; setting a bit makes the pin an output. DDRQS affects both QSPI function and I/O function. Table 15-8 summarizes the effect of DDRQS bits on QSPI pin function. DDRQS does not affect SCI pin function. TXDx pins are always outputs, and RXDx pins are always inputs, regardless of whether they are functioning as SCI pins or as PORTQS pins. MPC561/MPC563 Reference Manual, Rev. 1.2 15-10 Freescale Semiconductor Queued Serial Multi-Channel Module The port QS data register (PORTQS) latches I/O data. PORTQS writes drive pins defined as outputs. PORTQS reads return data present on the pins. To avoid driving undefined data, write the first data to PORTQS before configuring DDRQS. Table 15-8. Effect of DDRQS on QSPI Pin Function QSMCM Pin Mode DDRQS Bit Master MISO DDQS0 Slave Master MOSI DDQS1 Slave SCK1 Master Slave DDQS2 Master DDQS3 PCS0/SS Slave Master PCS[1:3] DDQS[4:6] Slave 1 15.5.1 Bit State Pin Function 0 Serial data input to QSPI 1 Disables data input 0 Disables data output 1 Serial data output from QSPI 0 Disables data output 1 Serial data output from QSPI 0 Serial data input to QSPI 1 Disables data input -- Clock output from QSPI -- Clock input to QSPI 0 Assertion causes mode fault 1 Chip-select output 0 QSPI slave select input 1 Disables slave select input 0 Disables chip-select output 1 Chip-select output 0 Inactive 1 Inactive SCK/QGPIO6 is a digital I/O pin unless the SPI is enabled (SPE set in SPCR1), in which case it becomes the QSPI serial clock SCK. Port QS Data Register (PORTQS) PORTQS determines the actual input or output value of a QSMCM port pin if the pin is defined as general-purpose input or output. All QSMCM pins can be used as general-purpose input and/or output. When the SCIx transmitter is disabled, TXDx is a discrete output; when the SCIx receiver is disabled, RXDx is a discrete input. Writes to this register affect the pins defined as outputs; reads of this register return the actual value of the pins. NOTE The PORTQS register can be written either as a half-word (16-bit) or as 2 individual bytes (8-bit). This allows the SCI GPIO pin data to written separately than the QSPI GPIO pin values. This allows either the SCI pins or the QSPI pins to be used independently as GPIO. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-11 Queued Serial Multi-Channel Module MSB 0 Field SRESET LSB 1 2 -- 0000 3 4 5 6 7 QDR QDT QDR QDT XD2 XD2 XD1 XD1 0 1 0 1 Addr 8 9 0 QDP CS3 0 0 10 11 12 13 14 15 QDP QDP QDPC QDS QDM QDM CS2 CS1 S0 CK OSI ISO 0 0 0 0 0 0 0x30 5014 Figure 15-7. PORTQS -- Port QS Data Register 15.5.2 PORTQS Pin Assignment Register (PQSPAR) PQSPAR determines which of the QSPI pins, with the exception of the SCK pin, are used by the QSPI submodule, and which pins are available for general-purpose I/O. Pins may be assigned on a pin-by-pin basis. If the QSPI is disabled, the SCK pin is automatically assigned its general-purpose I/O function (QGPIO6). QSPI pins designated by PQSPAR as general-purpose I/O pins are controlled only by PQSDDR and PQSPDR; the QSPI has no effect on these pins. PQSPAR does not affect the operation of the SCI submodule. Table 15-9 summarizes the QSMCM pin functions. Table 15-9. QSMCM Pin Functions PORTQS Function QSMCM Function Alternate Function QGPI2 RXD2 C_CNRX0 QGPO2 TXD2 C_CNTX0 QGPI1 RXD1 -- QGPO1 TXD1 -- QGPIO6 SCK -- QGPIO5 MOSI -- QGPIO4 MISO -- QGPIO3 PCS3 -- QGPIO2 PCS2 -- QGPIO1 PCS1 -- QGPIO0 PCS0 -- MPC561/MPC563 Reference Manual, Rev. 1.2 15-12 Freescale Semiconductor Queued Serial Multi-Channel Module MSB LSB 0 Field -- 1 2 3 4 5 QPAPC QPAPC QPAPC QPAPC S3 S2 S1 S0 -- 6 7 8 9 10 QPAMOSI QPAMISO 11 12 13 14 15 DDRQS* 0000_0000_0000_0000 SRESET Addr 0x30 5016 Note: See bit descriptions in Table 15-11 Figure 15-8. PORTQS Pin Assignment Register (PQSPAR) Table 15-10. PQSPAR Bit Descriptions Bits Name 0 -- 1 QPAPCS3 0 Pin is assigned QGPIO3 1 Pin is assigned PCS3 function 2 QPAPCS2 0 Pin is assigned QGPIO2 1 Pin is assigned PCS2 function 3 QPAPCS1 0 Pin is assigned QGPIO3 1 Pin is assigned PCS1 function 4 QPAPCS0 0 Pin is assigned QGPIO0 1 Pin is assigned PCS0 function 5 -- 6 QPAMOSI 0 Pin is assigned QGPIO5 1 Pin is assigned MOSI function 7 QPAMISO 0 Pin is assigned QGPIO4 1 Pin is assigned MISO function 8:15 DDRQS 15.5.3 Description Reserved Reserved PORSTQS data direction register. See Section 15.5.3, "PORTQS Data Direction Register (DDRQS)," on page 15-13. PORTQS Data Direction Register (DDRQS) DDRQS assigns QSPI pin as an input or an output regardless of whether the QSPI submodule is enabled or disabled. All QSPI pins are configured during reset as general-purpose inputs. This register does not affect SCI operation. The TXD1 and TXD2 remain output pinsdedicated to the SCI submodules, and the RXD1and RXD2 pins remain input pins dedicated to the SCI submodules. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-13 Queued Serial Multi-Channel Module MSB 0 Field LSB 1 2 3 4 5 6 7 PQSPAR* 8 -- 9 10 11 12 13 14 15 QDDP QDDP QDDP QDDP QDDSCK QDDMOSI QDDMISO CS3 CS2 CS1 CS0 0000_0000_0000_0000 SRESET Addr 0x30 5016 Note: See bit descriptions in Table 15-10 Figure 15-9. PORTQS Data Direction Register (DDRQS) Table 15-11. DDRQS Bit Descriptions 15.6 Bits Name Description 0:7 PQSPAR 8 -- 9 QDDPCS3 QSPI pin data direction for the pin PCS3 0 Pin direction is input 1 Pin direction is output 10 QDDPCS2 QSPI pin data direction for the pin PCS2 0 Pin direction is input 1 Pin direction is output 11 QDDPCS1 QSPI pin data direction for the pin PCS1 0 Pin direction is input 1 Pin direction is output 12 QDDPCS0 QSPI pin data direction for the pin PCS0 0 Pin direction is input 1 Pin direction is output 13 QDDSCK QSPI pin data direction for the pin SCK 0 Pin direction is input 1 Pin direction is output 14 QPDMOSI QSPI pin data direction for the pin MOSI 0 Pin direction is input 1 Pin direction is output 15 QPDMISO QSPI pin data direction for the pin MISO 0 Pin direction is input 1 Pin direction is output PORTSQS pin assignment register. See Section 15.5.2, "PORTQS Pin Assignment Register (PQSPAR)." Reserved Queued Serial Peripheral Interface The queued serial peripheral interface (QSPI) is used to communicate with external devices through a synchronous serial bus. The QSPI is fully compatible with SPI systems found on other Freescale products, but has enhanced capabilities. The QSPI can perform full duplex three-wire or half duplex two-wire transfers. Several transfer rates, clocking, and interrupt-driven communication options are available. Figure 15-10 is a block diagram of the QSPI. MPC561/MPC563 Reference Manual, Rev. 1.2 15-14 Freescale Semiconductor Queued Serial Multi-Channel Module Queue Control Block Queue Pointer Comparator 4 A D D R E S S Done 4 End Queue Pointer R E G I S T E R Control Logic Status Register 160-Byte QSPI RAM Control Registers 4 Delay Counter Chip Select 4 Command Rx Data Tx Data Programmable Logic Array MSB LSB 8/16-bit Shift Register Rx / Tx Data Register M S M S MOSI MISO PCS0/SS 2 PCS[2:1] Baud Rate Generator SCK QSPI Block Figure 15-10. QSPI Block Diagram Serial transfers of eight to 16 bits can be specified. Programmable transfer length simplifies interfacing to devices that require different data lengths. An inter-transfer delay of approximately 0.8 to 204 s (using a 40-MHz IMB3 clock) can be programmed. The default delay is 17 clocks (0.425 s at 40 MHz). Programmable delay simplifies the interface to devices that require different delays between transfers. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-15 Queued Serial Multi-Channel Module A dedicated 160-byte RAM is used to store received data, data to be transmitted, and a queue of commands. The CPU can access these locations directly. This allows serial peripherals to be treated like memory-mapped parallel devices. The command queue allows the QSPI to perform up to 32 serial transfers without CPU intervention. Each queue entry contains all the information needed by the QSPI to independently complete one serial transfer. A pointer identifies the queue location containing the data and command for the next serial transfer. Normally, the pointer address is incremented after each serial transfer, but the CPU can change the pointer value at any time. Support for multiple-tasks can be provided by segmenting the queue. The QSPI has four peripheral chip-select pins. The chip-select signals simplify interfacing by reducing CPU intervention. If the chip-select signals are externally decoded, 16 independent select signals can be generated. Wrap-around mode allows continuous execution of queued commands. In wraparound mode, newly received data replaces previously received data in the receive RAM. Wrap-around mode can simplify the interface with A/D converters by continuously updating conversion values stored in the RAM. Continuous transfer mode allows transfer of an uninterrupted bit stream. From 8 to 512 bits can be transferred without CPU intervention. Longer transfers are possible, but minimal intervention is required to prevent loss of data. A standard delay of 17 IMB3 clocks (0.8 s with a 40-MHz IMB3 clock) is inserted between the transfer of each queue entry. 15.6.1 QSPI Registers The QSPI memory map, shown in Table 15-12, includes the QSMCM global and pin control registers, four QSPI control registers (SPCR[0:3]), the status register (SPSR), and the QSPI RAM. Registers and RAM can be read and written by the CPU. The memory map can be divided into supervisor-only data space and assignable data space. The address offsets shown are from the base address of the QSMCM module. Refer to Figure 1-4 for a diagram of the MPC561/MPC563 internal memory map. Table 15-12. QSPI Register Map Access1 Address 2 MSB LSB 0 15 S/U 0x30 5018 QSPI Control Register 0 (SPCR0) See Table 15-13 for bit descriptions. S/U 0x30 501A QSPI Control Register 1 (SPCR1) See Table 15-15 for bit descriptions. S/U 0x30 501C QSPI Control Register 2 (SPCR2) See Table 15-16 for bit descriptions. S/U 0x30 501E/ 0x30 501F QSPI Control Register 3 (SPCR3) QSPI Status Register (SPSR) See Table 15-17 for bit descrip- See Table 15-18 for bit descriptions. tions. S/U 0x30 5140 - 0x30 517F Receive Data RAM (32 half-words) MPC561/MPC563 Reference Manual, Rev. 1.2 15-16 Freescale Semiconductor Queued Serial Multi-Channel Module Table 15-12. QSPI Register Map (continued) Access1 Address 2 MSB LSB 0 15 S/U 0x30 5180 - 0x30 51BF Transmit Data RAM (32 half-words) S/U 0x30 51C0 - 0x30 51DF Command RAM (32 bytes) 1 S = Supervisor access only S/U = Supervisor access only or unrestricted user access (assignable data space). 2 Eight-bit registers, such as SPCR3 and SPSR, are on 8-bit boundaries. 16-bit registers such as SPCR0 are on 16-bit boundaries. To ensure proper operation, set the QSPI enable bit (SPE) in SPCR1 only after initializing the other control registers. Setting this bit starts the QSPI. Rewriting the same value to a control register does not affect QSPI operation with the exception of writing NEWQP in SPCR2. Rewriting the same value to these bits causes the RAM queue pointer to restart execution at the designated location. Before changing control bits, the QSPI should be halted. Writing a different value into a control register other than SPCR2 while the QSPI is enabled may disrupt operation. SPCR2 is buffered, preventing any disruption of the current serial transfer. After the current serial transfer is completed, the new SPCR2 value becomes effective. 15.6.1.1 QSPI Control Register 0 (SPCR0) SPCR0 contains parameters for configuring the QSPI before it is enabled. The CPU has read/write access to SPCR0, but the QSPI has read access only. SPCR0 must be initialized before QSPI operation begins. Writing a new value to SPCR0 while the QSPI is enableddisrupts operation. MSB 0 LSB 1 Field MSTR WOMQ SRESET 0 Addr 0 2 3 4 BITS 0000 5 6 7 8 9 10 CPOL CPHA 0 1 11 12 13 14 15 SPBR 0000_0100 0x30 5018 Figure 15-11. QSPI Control Register 0 (SPCR0) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-17 Queued Serial Multi-Channel Module Table 15-13. SPCR0 Bit Descriptions Bits Name Description 0 MSTR Master/slave mode select 0 QSPI is a slave device and only responds to externally generated serial transfers. 1 QSPI is the system master and can initiate transmission to external SPI devices. 1 WOMQ Wired-OR mode for QSPI pins. This bit controls the QSPI pins regardless of whether they are used as general-purpose outputs or as QSPI outputs, and regardless of whether the QSPI is enabled or disabled. 0 Pins designated for output by DDRQS operate in normal mode. 1 Pins designated for output by DDRQS operate in open drain mode. 2:5 BITS Bits per transfer. In master mode, when BITSE is set in a command RAM byte, BITS determines the number of data bits transferred. When BITSE is cleared, eight bits are transferred regardless of the value in BITS. In slave mode, the BITS field always determines the number of bits the QSPI will receive during each transfer before storing the received data. Data transfers from 8 to 16 bits are supported. Illegal (reserved) values default to eight bits.Table 15-14 shows the number of bits per transfer. 6 CPOL Clock polarity. CPOL is used to determine the inactive state of the serial clock (SCK). It is used with CPHA to produce a desired clock/data relationship between master and slave devices. 0 The inactive state of SCK is logic zero. 1 The inactive state of SCK is logic one. 7 CPHA Clock phase. CPHA determines which edge of SCK causes data to change and which edge causes data to be captured. CPHA is used with CPOL to produce a desired clock/data relationship between master and slave devices. 0 Data is captured on the leading edge of SCK and changed on the trailing edge of SCK. 1 Data is changed on the leading edge of SCK and captured on the trailing edge of SCK 8:15 SPBR Serial clock baud rate. The QSPI uses a modulus counter to derive the SCK baud rate from the MCU IMB3 clock. Baud rate is selected by writing a value from 2 to 255 into SPBR. The following equation determines the SCK baud rate: f SYS SCK Baud Rate = -------------------------2 x SPBR Refer to Section 15.6.5.2, "Baud Rate Selection" for more information. Table 15-14. Bits Per Transfer Bits[3:0] Bits per Transfer 0000 16 0001 to 0111 Reserved (defaults to 8) 1000 8 1001 9 1010 10 MPC561/MPC563 Reference Manual, Rev. 1.2 15-18 Freescale Semiconductor Queued Serial Multi-Channel Module Table 15-14. Bits Per Transfer (continued) 15.6.1.2 Bits[3:0] Bits per Transfer 1011 11 1100 12 1101 13 1110 14 1111 15 QSPI Control Register 1 (SPCR1) SPCR1 enables the QSPI and specifies transfer delays. The CPU has read/write access to SPCR1, but the QSPI has read access only to all bits except SPE. SPCR1 must be written last during initialization because it contains SPE. The QSPI automatically clears this bit after it completes all serial transfers or when a mode fault occurs. Writing a new value to SPCR1 while the QSPI is enabled disrupts operation. MSB 0 Field SRESET LSB 1 2 3 4 5 6 7 8 9 10 11 12 SPE DSCKL DTL 0 000_0100 0000_0100 Addr 13 14 15 0x30 501A Figure 15-12. SPCR1 -- QSPI Control Register Table 15-15. SPCR1 Bit Descriptions Bits Name 0 SPE 1:7 DSCKL Description QSPI enable. Refer to Section 15.6.4.1, "Enabling, Disabling, and Halting the SPI. 0 = QSPI is disabled. QSPI pins can be used for general-purpose I/O. 1 = QSPI is enabled. Pins allocated by PQSPAR are controlled by the QSPI. Delay before SCK. When the DSCK bit is set in a command RAM byte, this field determines the length of the delay from PCS valid to SCK transition. The following equation determines the actual delay before SCK: DSCKL PCS to SCK Delay = -------------------f SYS where DSCKL equals is in the range of 1 to 127. Refer to Section 15.6.5.3, "Delay Before Transfer for more information. 8:15 DTL Length of delay after transfer. When the DT bit is set in a command RAM byte, this field determines the length of the delay after a serial transfer. The following equation is used to calculate the delay: 32XDTL Delay after Transfer = ----------------------f SYS where DTL is in the range of 1 to 255. A zero value for DTL causes a delay-after-transfer value of 8192 / fSYS (204.8 s with a 40-MHz IMB3 clock). Refer to Section 15.6.5.4, "Delay After Transfer for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-19 Queued Serial Multi-Channel Module 15.6.1.3 QSPI Control Register 2 (SPCR2) SPCR2 contains QSPI queue pointers, wraparound mode control bits, and an interrupt enable bit. The CPU has read/write access to SPCR2, but the QSPI has read access only. Writes to this register are buffered. New SPCR2 values become effective only after completion of the current serial transfer. Rewriting NEWQP in SPCR2 causes execution to restart at the designated location. Reads of SPCR2 return the current value of the register, not the buffer. MSB 0 LSB 1 2 Field SPIFIE WREN WRTO SRESET 3 4 5 6 7 8 ENDQP 9 10 11 -- 12 13 14 15 NEWQP 0000_0000_0000_0000 Addr 0x30 501C Figure 15-13. SPCR2 -- QSPI Control Register 2 Table 15-16. SPCR2 Bit Descriptions Bits Name 0 SPIFIE SPI finished interrupt enable. Refer to Section 15.6.4.2, "QSPI Interrupts." 0 QSPI interrupts disabled 1 QSPI interrupts enabled 1 WREN Wrap enable. Refer to Section 15.6.5.8, "Master Wraparound Mode." 0 Wraparound mode disabled. 1 Wraparound mode enabled. 2 WRTO Wrap to. When wraparound mode is enabled and after the end of queue has been reached, WRTO determines which address the QSPI executes next. The end of queue is determined by an address match with ENDQP. 0 Wrap to pointer address 0x0 1 Wrap to address in NEWQP 3:7 ENDQP Ending queue pointer. This field determines the last absolute address in the queue to be completed by the QSPI. After completing each command, the QSPI compares the queue pointer value of the just-completed command with the value of ENDQP. If the two values match, the QSPI sets SPIF to indicate it has reached the end of the programmed queue. Refer to Section 15.6.4, "QSPI Operation" for more information. 8:10 -- 11:15 NEWQP 15.6.1.4 Description Reserved New queue pointer value. This field contains the first QSPI queue address. Refer to Section 15.6.4, "QSPI Operation" for more information. QSPI Control Register 3 (SPCR3) SPCR3 contains the loop mode enable bit, halt and mode fault interrupt enable, and the halt control bit. The CPU has read/write access to SPCR3, but the QSPI has read access only. SPCR3 must be initialized before QSPI operation begins. Writing a new value to SPCR3 while the QSPI is enabled disrupts operation. MPC561/MPC563 Reference Manual, Rev. 1.2 15-20 Freescale Semiconductor Queued Serial Multi-Channel Module MSB 0 LSB 1 2 Field 3 4 -- 5 6 7 8 9 10 LOOPQ HMIE HALT 11 12 13 14 15 SPSR* 0000_0000_0000_0000 SRESET Addr 0x30 501E Note: See bit descriptions in Table 15-18 Figure 15-14. SPCR3 -- QSPI Control Register 3 Table 15-17. SPCR3 Bit Descriptions Bits Name 0:4 -- 5 LOOPQ 6 HMIE HALTA and MODF interrupt enable. HMIE enables interrupt requests generated by the HALTA status flag or the MODF status flag in SPSR. 0 HALTA and MODF interrupts disabled. 1 HALTA and MODF interrupts enabled. 7 HALT Halt QSPI. When HALT is set, the QSPI stops on a queue boundary. It remains in a defined state from which it can later be restarted. Refer to Section 15.6.4.1, "Enabling, Disabling, and Halting the SPI." 0 QSPI operates normally. 1 QSPI is halted for subsequent restart. 8:15 SPSR See Table 15-18 for bit descriptions. 15.6.1.5 Description Reserved QSPI loop mode. LOOPQ controls feedback on the data serializer for testing. 0 Feedback path disabled. 1 Feedback path enabled. QSPI Status Register (SPSR) The SPSR contains information concerning the current serial transmission. Only the QSPI can set bits in this register. To clear status flags, the CPU reads SPSR with the flags set and then writes the SPSR with zeros in the appropriate bits. Writes to CPTQP have no effect. MSB 0 LSB 1 Field SRESET Addr 1 See 2 3 4 SPCR31 5 6 7 8 9 10 SPIF MODF HALTA 11 12 13 14 15 CPTQP 0000_0000_0000_0000 0x30 501E (SPSR)2 bit descriptions in Table 15-17 can be accessed as an 8-bit register at location 0x30 501F or 0x30 541F. 2 SPSR Figure 15-15. QSPI Status Register (SPSR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-21 Queued Serial Multi-Channel Module Table 15-18. SPSR Bit Descriptions Bits Name 0:7 SPCR3 8 SPIF 9 MODF Mode fault flag. The QSPI asserts MODF when the QSPI is in master mode (MSTR = 1) and the SS input pin is negated by an external driver. Refer to Section 15.6.8, "Mode Fault" for more information. 0 Normal operation 1 Another SPI node requested to become the network SPI master while the QSPI was enabled in master mode (SS input taken low). 10 HALTA Halt acknowledge flag. HALTA is set when the QSPI halts in response to setting the HALT bit in SPCR3. HALTA is also set when the IMB3 FREEZE signal is asserted, provided the FRZ1 bit in the QSMCMMCR is set. To prevent undefined operation, no modification should be made to any QSPI control registers or RAM while the QSPI is halted. If HMIE in SPCR3 is set the QSPI sends interrupt requests to the CPU when HALTA is asserted. 0 QSPI is not halted. 1 QSPI is halted 11:15 CPTQP Completed queue pointer. CPTQP points to the last command executed. It is updated when the current command is complete. When the first command in a queue is executing, CPTQP contains either the reset value 0x0 or a pointer to the last command completed in the previous queue. If the QSPI is halted, CPTQP may be used to determine which commands have not been executed. The CPTQP may also be used to determine which locations in the receive data segment of the QSPI RAM contain valid received data. 15.6.2 Description See bit descriptions in Table 15-17. QSPI finished flag. SPIF is set after execution of the command at the address in ENDQP in SPCR2. If wraparound mode is enabled (WREN = 1), the SPIF is set, after completion of the command defined by ENDQP, each time the QSPI cycles through the queue. 0 QSPI is not finished 1 QSPI is finished QSPI RAM The QSPI contains a 160-byte block of dual-ported static RAM that can be accessed by both the QSPI and the CPU. Because of this dual access capability, up to two wait states may be inserted into CPU access time if the QSPI is in operation. The size and type of access of the QSPI RAM by the CPU affects the QSPI access time. The QSPI allows byte, half-word, and word accesses. Only word accesses of the RAM by the CPU are coherent because these accesses are an indivisible operation. If the CPU makes a coherent access of the QSPI RAM, the QSPI cannot access the QSPI RAM until the CPU is finished. However, a word or misaligned word access is not coherent because the CPU must break its access of the QSPI RAM into two parts, which allows the QSPI to access the QSPI RAM between the two accesses by the CPU. The RAM is divided into three segments: receive data RAM, transmit data RAM, and command data RAM. Receive data is information received from a serial device external to the MCU. Transmit data is information stored for transmission to an external device. Command data defines transfer parameters. Figure 15-16 shows RAM organization. MPC561/MPC563 Reference Manual, Rev. 1.2 15-22 Freescale Semiconductor Queued Serial Multi-Channel Module 0x30 5140 or 0x30 5540 0x30 517F or 0x30 557F RR0 RR1 RR2 0x30 5180 or 0x30 5580 TR0 TR1 TR2 0x30 51C0 or 0x30 55C0 CR0 CR1 CR2 Receive RAM Transmit RAM Command RAM RRD RRE RRF TRD TRE TRF CRD CRE CRF 0x30 51BF oe 0x30 55BF 0x30 51DF or 0x30 55DF Half-Word Half-Word Byte Figure 15-16. QSPI RAM 15.6.2.1 Receive RAM Data received by the QSPI is stored in this segment, to be read by the CPU. Data stored in the receive RAM is right-justified, (i.e., the least significant bit is always in the right-most bit position within the word regardless of the serial transfer length). Unused bits in a receive queue entry are set to zero by the QSPI upon completion of the individual queue entry. The CPU can access the data using byte, half-word, or word addressing. The CPTQP value in SPSR shows which queue entries have been executed. The CPU uses this information to determine which locations in receive RAM contain valid data before reading them. 15.6.2.2 Transmit RAM Data that is to be transmitted by the QSPI is stored in this segment. The CPU normally writes one word of data into this segment for each queue command to be executed. If the corresponding peripheral, such as a serial input port, is used solely to input data, then this segment does not need to be initialized. Data must be written to transmit RAM in a right-justified format. The QSPI cannot modify information in the transmit RAM. The QSPI copies the information to its data serializer for transmission. Information remains in transmit RAM until overwritten. 15.6.2.3 Command RAM Command RAM is used by the QSPI in master mode. The CPU writes one byte of control information to this segment for each QSPI command to be executed. The QSPI cannot modify information in command RAM. Command RAM consists of 32 bytes. Each byte is divided into two fields. The peripheral chip-select field, enables peripherals for transfer. The command control field provides transfer options. A maximum of 32 commands can be in the queue. These bytes are assigned an address from 0x00 to 0x1F. Queue execution by the QSPI proceeds from the address in NEWQP through the address in ENDQP. (Both of these fields are in SPCR2.) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-23 Queued Serial Multi-Channel Module MSB LSB 0 1 2 3 4 5 6 7 CONT BITSE DT DSCK PCS3 PCS2 PCS1 PCS01 -- -- -- -- -- -- -- -- CONT BITSE DT DSCK PCS3 PCS2 PCS1 PCS01 Command Control Peripheral Chip Select The PCS0 bit represents the dual-function PCS0/SS. Figure 15-17. CR[0:F] -- Command RAM 0x30 51C0, 0x30 51DF 1 Table 15-19. Command RAM Bit Descriptions Bits Name 0 CONT Continue 0 Control of chip selects returned to PORTQS after transfer is complete. 1 Peripheral chip selects remain asserted after transfer is complete. 1 BITSE Bits per transfer enable 0 Eight bits 1 Number of bits set in BITS field of SPCR0. 2 DT 3 DSCK 4:7 Description Delay after transfer 0 Delay after transfer is 17 / fSYS. 1 SPCR1 DTL[7:0] specifies delay after transfer PCS valid to SCK. PCS to SCK Delay 0 PCS valid to SCK delay is one-half SCK. 1 SPCR1 DSCKL[6:0] specifies delay from PCS valid to SCK. PCS[3:0] Peripheral chip selects. Use peripheral chip-select bits to select an external device for serial data transfer. More than one peripheral chip select may be activated at a time, and more than one peripheral chip can be connected to each PCS pin, provided proper fanout is observed. PCS0 shares a pin with the slave select (SS) signal, which initiates slave mode serial transfer. If SS is taken low when the QSPI is in master mode, a mode fault occurs. Refer to Section 15.6.5, "Master Mode Operation" for more information on the command RAM. 15.6.3 QSPI Pins Seven pins are associated with the QSPI. When not needed by the QSPI, they can be configured for general-purpose I/O. Table 15-20 identifies the QSPI pins and their functions. Register DDRQS determines whether the pins are designated as input or output. The user must initialize DDRQS for the QSPI to function correctly. MPC561/MPC563 Reference Manual, Rev. 1.2 15-24 Freescale Semiconductor Queued Serial Multi-Channel Module Table 15-20. QSPI Pin Functions Pin Names Mnemonic Mode Master in slave out MISO Master Slave Serial data input to QSPI Serial data output from QSPI Master out slave in MOSI Master Slave Serial data output from QSPI Serial data input to QSPI Serial clock SCK1 Master Slave Clock output from QSPI clock Input to QSPI Peripheral chip selects PCS[1:3] Master Outputs select peripheral(s) Peripheral chip select2 Slave select3 PCS0 / SS Master Slave Output selects peripheral(s) Input selects the QSPI SS Master May cause mode fault Slave select4 Function 1 All QSPI pins (except SCK) can be used as general-purpose I/O if they are not used by the QSPI while the QSPI is operating. SCK can only be used for general-purpose I/O if the QSPI is disabled. 2 An output (PCS0) when the QSPI is in master mode. 3 An input (SS) when the QSPI is in slave mode. 4 An input (SS) when the QSPI is in master mode; useful in multimaster systems. 15.6.4 QSPI Operation The QSPI uses a dedicated 160-byte block of static RAM accessible by both the QSPI and the CPU to perform queued operations. The RAM is divided into three segments: 32 command control bytes, 64 transmit data bytes, and 64 receive data bytes. Once the CPU has set up a queue of QSPI commands, written the transmit data segment with information to be sent, and enabled the QSPI, the QSPI operates independently of the CPU. The QSPI executes all of the commands in its queue, sets a flag indicating completion, and then either interrupts the CPU or waits for CPU intervention. QSPI RAM is organized so that one byte of command data, one word of transmit data, and one word of receive data correspond to each queue entry, 0x0 to 0x2F. The CPU initiates QSPI operation by setting up a queue of QSPI commands in command RAM, writing transmit data into transmit RAM, then enabling the QSPI. The QSPI executes the queued commands, sets a completion flag (SPIF), and then either interrupts the CPU or waits for intervention. There are four queue pointers. The CPU can access three of them through fields in QSPI registers. The new queue pointer (NEWQP), contained in SPCR2, points to the first command in the queue. An internal queue pointer points to the command currently being executed. The completed queue pointer (CPTQP), contained in SPSR, points to the last command executed. The end queue pointer (ENDQP), contained in SPCR2, points to the final command in the queue. The internal pointer is initialized to the same value as NEWQP. During normal operation, the command pointed to by the internal pointer is executed, the value in the internal pointer is copied into CPTQP, the internal pointer is incremented, and then the sequence repeats. Execution continues at the internal pointer address unless the NEWQP value is changed. After each command is executed, ENDQP and CPTQP are MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-25 Queued Serial Multi-Channel Module compared. When a match occurs, the SPIF flag is set and the QSPI stops and clears SPE, unless wraparound mode is enabled. At reset, NEWQP is initialized to 0x0. When the QSPI is enabled, execution begins at queue address 0x0 unless another value has been written into NEWQP. ENDQP is initialized to 0x0 at reset but should be changed to the last queue entry before the QSPI is enabled. NEWQP and ENDQP can be written at any time. When NEWQP changes, the internal pointer value also changes. However, if NEWQP is written while a transfer is in progress, the transfer is completed normally. Leaving NEWQP and ENDQP set to 0x0 transfers only the data in transmit RAM location 0x0. 15.6.4.1 Enabling, Disabling, and Halting the SPI The SPE bit in the SPCR1 enables or disables the QSPI submodule. Setting SPE causes the QSPI to begin operation. If the QSPI is a master, setting SPE causes the QSPI to begin initiating serial transfers. If the QSPI is a slave, the QSPI begins monitoring the PCS0/SS pin to respond to the external initialization of a serial transfer. When the QSPI is disabled, the CPU may use the QSPI RAM. When the QSPI is enabled, both the QSPI and the CPU have access to the QSPI RAM. The CPU has both read and write access to all 160 bytes of the QSPI RAM. The QSPI can read-only the transmit data segment and the command control segment and can write-only the receive data segment of the QSPI RAM. The QSPI turns itself off automatically when it is finished by clearing SPE. An error condition called mode fault (MODF) also clears SPE. This error occurs when PCS0/SS is configured for input, the QSPI is a system master (MSTR = 1), and PCS0/SS is driven low externally. Setting the HALT bit in SPCR3 stops the QSPI on a queue boundary. The QSPI halts in a known state from which it can later be restarted. When HALT is set, the QSPI finishes executing the current serial transfer (up to 16 bits) and then halts. While halted, if the command control bit (CONT of the QSPI RAM) for the last command was asserted, the QSPI continues driving the peripheral chip select pins with the value designated by the last command before the halt. If CONT was cleared, the QSPI drives the peripheral chip-select pins to the value in register PORTQS. If HALT is set during the last command in the queue, the QSPI completes the last command, sets both HALTA and SPIF, and clears SPE. If the last queue command has not been executed, asserting HALT does not set SPIF or clear SPE. QSPI execution continues when the CPU clears HALT. To stop the QSPI, assert the HALT bit in SPCR3, then wait until the HALTA bit in SPSR is set. SPE can then be safely cleared, providing an orderly method of shutting down the QSPI quickly after the current serial transfer is completed. The CPU can disable the QSPI immediately by clearing SPE. However, loss of data from a current serial transfer may result and confuse an external SPI device. 15.6.4.2 QSPI Interrupts The QSPI has three possible interrupt sources but only one interrupt vector. These sources are SPIF, MODF, and HALTA. When the CPU responds to a QSPI interrupt, the interrupt cause must ascertained by reading the SPSR. Any interrupt that was set may then be cleared by writing to SPSR with a zero in the bit position corresponding to the interrupt source. MPC561/MPC563 Reference Manual, Rev. 1.2 15-26 Freescale Semiconductor Queued Serial Multi-Channel Module The SPIFIE bit in SPCR2 enables the QSPI to generate an interrupt request upon assertion of the SPIF status flag. Because it is buffered, the value written to SPIFIE applies only upon completion of the queue (the transfer of the entry indicated by ENDPQ). Thus, if a single sequence of queue entries is to be transferred (i.e., no WRAP), then SPIFIE should be set to the desired state before the first transfer. If a sub-queue is to be used, the same CPU write that causes a branch to the sub-queue may enable or disable the SPIF interrupt for the sub-queue. The primary queue retains its own selected interrupt mode, either enabled or disabled. The SPIF interrupt must be cleared by clearing SPIF. Subsequent interrupts may then be prevented by clearing SPIFIE. Clearing SPIFIE does not immediately clear an interrupt already caused by SPIF. 15.6.4.3 QSPI Flow The QSPI operates in either master or slave mode. Master mode is used when the MCU initiates data transfers. Slave mode is used when an external device initiates transfers. Switching between these modes is controlled by MSTR in SPCR0. Before entering either mode, appropriate QSMCM and QSPI registers must be initialized properly. In master mode, the QSPI executes a queue of commands defined by control bits in each command RAM queue entry. Chip-select pins are activated, data is transmitted from the transmit RAM and received by the receive RAM. In slave mode, operation proceeds in response to SS pin assertion by an external SPI bus master. Operation is similar to master mode, but no peripheral chip selects are generated, and the number of bits transferred is controlled in a different manner. When the QSPI is selected, it automatically executes the next queue transfer to exchange data with the external device correctly. Although the QSPI inherently supports multi-master operation, no special arbitration mechanism is provided. A mode fault flag (MODF) indicates a request for SPI master arbitration. System software must provide arbitration. Note that unlike previous SPI systems, MSTR is not cleared by a mode fault being set nor are the QSPI pin output drivers disabled. The QSPI and associated output drivers must be disabled by clearing SPE in SPCR1. Figure 15-18 shows QSPI initialization. Figure 15-19 through Figure 15-23 show QSPI master and slave operation. The CPU must initialize the QSMCM global and pin registers and the QSPI control registers before enabling the QSPI for either mode of operation. The command queue must be written before the QSPI is enabled for master mode operation. Any data to be transmitted should be written into transmit RAM before the QSPI is enabled. During wraparound operation, data for subsequent transmissions can be written at any time. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-27 Queued Serial Multi-Channel Module Begin Initialize QSMCM Global Registers Initialize PQSPAR, PORTQS, and DDRQS in this Order QSPI Initialization Initialize QSPI Control Registers Initialize QSPI RAM Enable QSPI Y MSTR = 1 ? N A2 A1 Figure 15-18. Flowchart of QSPI Initialization Operation MPC561/MPC563 Reference Manual, Rev. 1.2 15-28 Freescale Semiconductor Queued Serial Multi-Channel Module QSPI Cycle Begins (Master Mode) A1 Is QSPI Disabled? Y N Has NEWQP Been Written? Y Working Queue Pointer Changed to NEWQP N Read Command Control and Transmit Data From RAM Using Queue Pointer Address Assert Peripheral Chip Select(s) Is PCS To SCK Delay Programmed? Y Execute Programmed Delay N Execute Standard Delay Execute Serial Transfer Store Received Data In RAM Using Queue Pointer Address B1 Figure 15-19. Flowchart of QSPI Master Operation (Part 1) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-29 Queued Serial Multi-Channel Module B1 Write Queue Pointer To CPTQP Status Bits Is Continue Bit Asserted? Y N Negate Peripheral Chip Selects Is Delay After Transfer Asserted? Y Execute Programmed Delay N Execute Standard Delay C1 Figure 15-20. Flowchart of QSPI Master Operation (Part 2) MPC561/MPC563 Reference Manual, Rev. 1.2 15-30 Freescale Semiconductor Queued Serial Multi-Channel Module C1 Is this the Last Command in the Queue? Y Assert SPIF Status Flag N Is Interrupt Enable Bit SPIFIE Set? Y Request Interrupt N Increment Working Queue Pointer Is Wrap Enable Bit Set? Y Reset Working Queue Pointer to NEWQP or 0x0000 N Disable QSPI A1 Is HALT Or FREEZE Asserted? Y Halt QSPI and Set HALTA N Is Interrupt Enable Bit HMIE Set? Y Request Interrupt N Is HALT Or FREEZE Asserted? Y N A1 Figure 15-21. Flowchart of QSPI Master Operation (Part 3) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-31 Queued Serial Multi-Channel Module QSPI Cycle Bgins (Slave Mode A2 Is QSPI Disabled? Y N Has NEWQP Been Written? Y Queue Pointer Changed to NEWQP N Read Transmit Data From RAM Using Queue Pointer Address Is Slave Select Pin Asserted? Y N Execute Serial Transfer When SCK Received Store Received Data In RAM Using Queue Pointer Address Write Queue Pointer to CPTQP Status Bits B2 Figure 15-22. Flowchart of QSPI Slave Operation (Part 1) MPC561/MPC563 Reference Manual, Rev. 1.2 15-32 Freescale Semiconductor Queued Serial Multi-Channel Module C2 Is this the Last Command in the Queue? Y Set SPIF Status Flag N Is Interrupt Enable Bit SPIFIE Set? Y Request Interrupt N Is Wrap Enable Bit Asserted? Increment Working Queue Pointer Y Reset Working Queue Pointer To NEWQP or 0x0000 N Disable QSPI A2 Is HALT or FREEZE Asserted? Y Halt QSPI and Set HALTA N Is Interrupt Enable Bit HMIE Set? Y Request Interrupt N Is HALT Or FREEZE Asserted? Y N A2 QSPI SLV2 FLOW6 Figure 15-23. Flowchart of QSPI Slave Operation (Part 2) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-33 Queued Serial Multi-Channel Module Normally, the SPI bus performs synchronous bidirectional transfers. The serial clock on the SPI bus master supplies the clock signal SCK to time the transfer of data. Four possible combinations of clock phase and polarity can be specified by the CPHA and CPOL bits in SPCR0. Data is transferred with the most significant bit first. The number of bits transferred per command defaults to eight, but can be set to any value from eight to sixteen bits by writing a value into the BITS field in SPCR0 and setting BITSE in command RAM. Typically, SPI bus outputs are not open drain unless multiple SPI masters are in the system. If needed, the WOMQ bit in SPCR0 can be set to provide wired-OR, open drain outputs. An external pull-up resistor should be used on each output line. WOMQ affects all QSPI pins regardless of whether they are assigned to the QSPI or used as general-purpose I/O. 15.6.5 Master Mode Operation Setting the MSTR bit in SPCR0 selects master mode operation. In master mode, the QSPI can initiate serial transfers, but cannot respond to externally initiated transfers. When the slave select input of a device configured for master mode is asserted, a mode fault occurs. Before QSPI operation begins, PQSPAR must be written to assign the necessary pins to the QSPI. The pins necessary for master mode operation are MISO, MOSI, SCK, and one or more of the chip-select pins. MISO is used for serial data input in master mode, and MOSI is used for serial data output. Either or both may be necessary, depending on the particular application. SCK is the serial clock output in master mode and must be assigned to the QSPI for proper operation. The PORTQS data register must next be written with values that make the QGPIO6/SCK (bit 13 QDSCK of PORTQS) and QGPIO[3:0]/PCS[3:0] (bits 12:9 QDPCS[3:0] of PORTQS) outputs inactive when the QSPI completes a series of transfers. Pins allocated to the QSPI by PQSPAR are controlled by PORTQS when the QSPI is inactive. PORTQS I/O pins driven to states opposite those of the inactive QSPI signals can generate glitches that momentarily enable or partially clock a slave device. For example, if a slave device operates with an inactive SCK state of logic one (CPOL = 1) and uses active low peripheral chip-select PCS0, the QDSCK and QDPCS0 bits in PORTQS must be set to 0b11. If QDSCK and QDPCS0 = 0b00, falling edges will appear on QGPIO6/SCK and GPIO0/PCS0 as the QSPI relinquishes control of these pins and PORTQS drives them to logic zero from the inactive SCK and PCS0 states of logic one. Before master mode operation is initiated, QSMCM register DDRQS is written last to direct the data flow on the QSPI pins used. Configure the SCK, MOSI and appropriate chip-select pins PCS[3:0] as outputs. The MISO pin must be configured as an input. After pins are assigned and configured, write appropriate data to the command queue. If data is to be transmitted, write the data to transmit RAM. Initialize the queue pointers as appropriate. QSPI operation is initiated by setting the SPE bit in SPCR1. Shortly after SPE is set, the QSPI executes the command at the command RAM address pointed to by NEWQP. Data at the pointer address in transmit RAM is loaded into the data serializer and transmitted. Data that is simultaneously received is stored at the pointer address in receive RAM. MPC561/MPC563 Reference Manual, Rev. 1.2 15-34 Freescale Semiconductor Queued Serial Multi-Channel Module When the proper number of bits have been transferred, the QSPI stores the working queue pointer value in CPTQP, increments the working queue pointer, and loads the next data for transfer from transmit RAM. The command pointed to by the incremented working queue pointer is executed next, unless a new value has been written to NEWQP. If a new queue pointer value is written while a transfer is in progress, that transfer is completed normally. When the CONT bit in a command RAM byte is set, PCS pins are continuously driven to specified states during and between transfers. If the chip-select pattern changes during or between transfers, the original pattern is driven until execution of the following transfer begins. When CONT is cleared, the data in register PORTQS is driven between transfers. The data in PORTQS must match the inactive states of SCK and any peripheral chip-selects used. When the QSPI reaches the end of the queue, it sets the SPIF flag. If the SPIFIE bit in SPCR2 is set, an interrupt request is generated when SPIF is asserted. At this point, the QSPI clears SPE and stops unless wraparound mode is enabled. 15.6.5.1 Clock Phase and Polarity In master mode, data transfer is synchronized with the internally-generated serial clock SCK. Control bits, CPHA and CPOL, in SPCR0, control clock phase and polarity. Combinations of CPHA and CPOL determine upon which SCK edge to drive outgoing data from the MOSI pin and to latch incoming data from the MISO pin. 15.6.5.2 Baud Rate Selection Baud rate is selected by writing a value from two to 255 into the SPBR field in SPCR0. The QSPI uses a modulus counter to derive the SCK baud rate from the MCU IMB3 clock. The following expressions apply to the SCK baud rate: f SYS SCK Baud Rate = ---------------------2xSPBR Eqn. 15-1 or f SYS SPBR = ----------------------------------------------------------------------2xSCK Baud Rate Desired Eqn. 15-2 Giving SPBR a value of zero or one disables the baud rate generator. SCK is disabled and assumes its inactive state. At reset, the SCK baud rate is initialized to one eighth of the IMB3 clock frequency. Table 15-21 provides some example SCK baud rates with a 40-MHz IMB3 clock. Table 15-21. Example SCK Frequencies with a 40-MHz IMB3 Clock Division Ratio SPBR Value SCK Frequency 4 2 10.00 MHz 6 3 6.67 MHz 8 4 5.00 MHz MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-35 Queued Serial Multi-Channel Module Table 15-21. Example SCK Frequencies with a 40-MHz IMB3 Clock (continued) 15.6.5.3 Division Ratio SPBR Value SCK Frequency 14 7 2.86 MHz 28 14 1.43 MHz 58 29 689 kHz 280 140 143 kHz 510 255 78.43 kHz Delay Before Transfer The DSCK bit in each command RAM byte inserts either a standard (DSCK = 0) or user-specified (DSCK = 1) delay from chip-select assertion until the leading edge of the serial clock. The DSCKL field in SPCR1 determines the length of the user-defined delay before the assertion of SCK. The following expression determines the actual delay before SCK when DSCKL is in the range of 1-127: DSCKL PCS to SCK Delay = -------------------f SYS Eqn. 15-3 NOTE A zero value for DSCKL causes a delay of 128 IMB3 clocks, which equals 3.2 s for a 40-MHz IMB3 clock. Because of design limits, a DSCKL value of one defaults to the same timing as a value of two. When DSCK equals zero, DSCKL is not used. Instead, the PCS valid-to-SCK transition is one-half the SCK period. 15.6.5.4 Delay After Transfer Delay after transfer can be used to provide a peripheral deselect interval. A delay can also be inserted between consecutive transfers to allow serial A/D converters to complete conversion. Writing a value to the DTL field in SPCR1 specifies a delay period. The DT bit in each command RAM byte determines whether the standard delay period (DT = 0) or the specified delay period (DT = 1) is used. The following expression is used to calculate the delay: 32xDTL Delay after Transfer = --------------------f SYS where DTL is in the range from one to 255. A zero value for DTL causes a delay-after-transfer value of 8192 / IMB3 clock frequency (204.8 s with a 40-MHz IMB3 clock). If DT is zero in a command RAM byte, a standard delay is inserted. 17 Standard Delay after Transfer = ------------f SYS MPC561/MPC563 Reference Manual, Rev. 1.2 15-36 Freescale Semiconductor Queued Serial Multi-Channel Module Delay after transfer can be used to provide a peripheral deselect interval. A delay can also be inserted between consecutive transfers to allow serial A/D converters to complete conversion. Adequate delay between transfers must be specified for long data streams because the QSPI requires time to load a transmit RAM entry for transfer. Receiving devices need at least the standard delay between successive transfers. If the IMB3 clock is operating at a slower rate, the delay between transfers must be increased proportionately. 15.6.5.5 Transfer Length There are two transfer length options. The user can choose a default value of eight bits, or a programmed value from eight (0b1000) to 16 (0b0000) bits, inclusive. Reserved values (from 0b0001 to 0b0111) default to eight bits. The programmed value must be written into the BITS field in SPCR0. The BITSE bit in each command RAM byte determines whether the default value (BITSE = 0) or the BITS value (BITSE = 1) is used. 15.6.5.6 Peripheral Chip Selects Peripheral chip-select signals are used to select an external device for serial data transfer. Chip-select signals are asserted when a command in the queue is executed. Signals are asserted at a logic level corresponding to the value of the PCS[3:0] bits in each command byte. More than one chip-select signal can be asserted at a time, and more than one external device can be connected to the PCS pins, provided proper fanout is observed. PCS0 shares a pin with the slave select SS signal, which initiates slave mode serial transfer. If SS is taken low when the QSPI is in master mode, a mode fault occurs. To configure a peripheral chip select, set the appropriate bit in the PQSPAR, then configure the chip-select pin as an output by setting the appropriate bit in DDRQS. The value of the bit in PORTQS that corresponds to the chip-select pin determines the base state of the chip-select signal. If the base state is zero, chip-select assertion must be active high (PCS bit in command RAM must be set); if base state is one, assertion must be active low (PCS bit in command RAM must be cleared). PORTQS bits are cleared during reset. If no new data is written to PORTQS before pin assignment and configuration as an output, the base state of chip-select signals is zero and chip-select pins are configured for active-high operation. 15.6.5.7 Optional Enhanced Peripheral Chip Selects The MPC561/MPC563 have an optional on-chip decoder for the peripheral chip selects. It is enabled if any of the PCS[4:7]EN bits are enabled in the PDMCR2 register (see Table 2-6). The decode translates the normal PCS[0:3] chip selects into a 1 of 8 decode. The polarity of the new PCS outputs can be selected by the state of the PCSV bit in the PDMCR2. See Table 15-22. Table 15-22. PCS Enhanced Functionality PCS_IN[3:0] PCS_OUT[7:0] IF PCSV = 0 PCS_OUT[7:0] IF PCSV = 1 0000 00000001 11111110 0001 00000010 11111101 0010 00000100 11111011 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-37 Queued Serial Multi-Channel Module Table 15-22. PCS Enhanced Functionality (continued) PCS_IN[3:0] PCS_OUT[7:0] IF PCSV = 0 PCS_OUT[7:0] IF PCSV = 1 0011 00001000 11110111 0100 00010000 11101111 0101 00100000 11011111 0110 01000000 10111111 0111 10000000 01111111 1000 00000000 11111111 RESERVED RESERVED 1001 1010 1011 1100 1101 1110 1111 NOTE PCS_IN[3:0] is driven from QSMCM module. PCS_OUT[7:0] will be driven from the pads to the pins. If the bits PCS4EN, PCS5EN, PCS6EN, PCS7EN are negated (logic 0), PCS_OUT[3:0] will be the same as PCS_IN[3:0]. The design assumes that if one of these enable bits is set, PCS function is selected in QSMCM module. 15.6.5.8 Master Wraparound Mode Wraparound mode is enabled by setting the WREN bit in SPCR2. The queue can wrap to pointer address 0x0 or to the address pointed to by NEWQP, depending on the state of the WRTO bit in SPCR2. In wraparound mode, the QSPI cycles through the queue continuously, even while the QSPI is requesting interrupt service. SPE is not cleared when the last command in the queue is executed. New receive data overwrites previously received data in receive RAM. Each time the end of the queue is reached, the SPIF flag is set. SPIF is not automatically reset. If interrupt-driven QSPI service is used, the service routine must clear the SPIF bit to end the current interrupt request. Additional interrupt requests during servicing can be prevented by clearing SPIFIE, but SPIFIE is buffered. Clearing it does not end the current request. Wraparound mode is exited by clearing the WREN bit or by setting the HALT bit in SPCR3. Exiting wraparound mode by clearing SPE is not recommended, as clearing SPE may abort a serial transfer in progress. The QSPI sets SPIF, clears SPE, and stops the first time it reaches the end of the queue after WREN is cleared. After HALT is set, the QSPI finishes the current transfer, then stops executing commands. After the QSPI stops, SPE can be cleared. MPC561/MPC563 Reference Manual, Rev. 1.2 15-38 Freescale Semiconductor Queued Serial Multi-Channel Module 15.6.6 Slave Mode Clearing the MSTR bit in SPCR0 selects slave mode operation. In slave mode, the QSPI is unable to initiate serial transfers. Transfers are initiated by an external SPI bus master. Slave mode is typically used on a multi-master SPI bus. Only one device can be bus master (operate in master mode) at any given time. Before QSPI operation is initiated, QSMCM register PQSPAR must be written to assign necessary pins to the QSPI. The pins necessary for slave mode operation are MISO, MOSI, SCK, and PCS0/SS. MISO is used for serial data output in slave mode, and MOSI is used for serial data input. Either or both may be necessary, depending on the particular application. SCK is the serial clock input in slave mode and must be assigned to the QSPI for proper operation. Assertion of the active-low slave select signal SS initiates slave mode operation. Before slave mode operation is initiated, DDRQS must be written to direct data flow on the QSPI pins used. Configure the MOSI, SCK and PCS0/SS pins as inputs. The MISO pin must be configured as an output. After pins are assigned and configured, write data to be transmitted into transmit RAM. Command RAM is not used in slave mode, and does not need to be initialized. Set the queue pointers, as appropriate. When SPE is set and MSTR is clear, a low state on the slave select PCS0/SS pin begins slave mode operation at the address indicated by NEWQP. Data that is received is stored at the pointer address in receive RAM. Data is simultaneously loaded into the data serializer from the pointer address in transmit RAM and transmitted. Transfer is synchronized with the externally generated SCK. The CPHA and CPOL bits determine upon which SCK edge to latch incoming data from the MISO pin and to drive outgoing data from the MOSI pin. Because the command RAM is not used in slave mode, the CONT, BITSE, DT, DSCK, and peripheral chip-select bits have no effect. The PCS0/SS pin is used only as an input. The SPBR, DT and DSCKL fields in SPCR0 and SPCR1 bits are not used in slave mode. The QSPI drives neither the clock nor the chip-select pins and thus cannot control clock rate or transfer delay. Because the BITSE option is not available in slave mode, the BITS field in SPCR0 specifies the number of bits to be transferred for all transfers in the queue. When the number of bits designated by BITS[3:0] has been transferred, the QSPI stores the working queue pointer value in CPTQP, increments the working queue pointer, and loads new transmit data from transmit RAM into the data serializer. The working queue pointer address is used the next time PCS0/SS is asserted, unless the RCPU writes to NEWQP first. The QSPI shifts one bit for each pulse of SCK until the slave select input goes high. If SS goes high before the number of bits specified by the BITS field is transferred, the QSPI resumes operation at the same pointer address the next time SS is asserted. The maximum value that the BITS field can have is 16. If more than 16 bits are transmitted before SS is negated, pointers are incremented and operation continues. The QSPI transmits as many bits as it receives at each queue address, until the BITS value is reached or SS is negated. SS does not need to go high between transfers as the QSPI transfers data until reaching the end of the queue, whether SS remains low or is toggled between transfers. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-39 Queued Serial Multi-Channel Module When the QSPI reaches the end of the queue, it sets the SPIF flag. If the SPIFIE bit in SPCR2 is set, an interrupt request is generated when SPIF is asserted. At this point, the QSPI clears SPE and stops unless wraparound mode is enabled. Slave wraparound mode is enabled by setting the WREN bit in SPCR2. The queue can wrap to pointer address 0x0 or to the address pointed to by NEWQP, depending on the state of the WRTO bit in SPCR2. Slave wraparound operation is identical to master wraparound operation. 15.6.6.1 Description of Slave Operation After reset, the QSMCM registers and the QSPI control registers must be initialized as described above. Although the command control segment is not used, the transmit and receive data segments may, depending upon the application, need to be initialized. If meaningful data is to be sent out from the QSPI, the data to the transmit data should be written to the segment before enabling the QSPI. If SPE is set and MSTR is not set, a low state on the slave select (PCS0/SS) pin commences slave mode operation at the address indicated by NEWQP. The QSPI transmits the data found in the transmit data segment at the address indicated by NEWQP, and the QSPI stores received data in the receive data segment at the ad-dress indicated by NEWQP. Data is transferred in response to an external slave clock input at the SCK pin. Because the command control segment is not used, the command control bits and peripheral chip-select codes have no effect in slave mode operation. The QSPI does not drive any of the four peripheral chip-selects as outputs. PCS0/SS is used as an input. Although CONT cannot be used in slave mode, a provision is made to enable receipt of more than 16 data bits. While keeping the QSPI selected (PCS0/SS is held low), the QSPI stores the number of bits, designated by BITS, in the current receive data segment address, increments NEWQP, and continues storing the remaining bits (up to the BITS value) in the next receive data segment address. As long as PCS0/SS remains low, the QSPI continues to store the incoming bit stream in sequential receive data segment addresses, until either the value in BITS is reached or the end-of-queue address is used with wraparound mode disabled. When the end of the queue is reached, the SPIF flag is asserted, optionally causing an interrupt. If wraparound mode is disabled, any additional incoming bits are ignored. If wraparound mode is enabled, storing continues at either address 0x0 or the address of NEWQP, depending on the WRTO value. When using this capability to receive a long incoming data stream, the proper delay between transfers must be used. The QSPI requires time, approximately 0.425 s with a 40-MHz IMB3 clock, to prefetch the next transmit RAM entry for the next transfer. Therefore, a baud rate may selected that provides at least a 0.6-s delay between successive transfers to ensure no loss of incoming data. If the IMB3 clock is operating at a slower rate, the delay between transfers must be increased proportionately. Because the BITSE option in the command control segment is no longer available, BITS sets the number of bits to be transferred for all transfers in the queue until the CPU changes the BITS value. As mentioned above, until PCS0/SS is negated (brought high), the QSPI continues to shift one bit for each pulse of SCK. If PCS0/SS is negated before the proper number of bits (according to BITS) is received, the next time the MPC561/MPC563 Reference Manual, Rev. 1.2 15-40 Freescale Semiconductor Queued Serial Multi-Channel Module QSPI is selected it resumes storing bits in the same receive-data segment address where it left off. If more than 16 bits are transferred before negating the PCS0/SS, the QSPI stores the number of bits indicated by BITS in the current receive data segment address, then increments the address and continues storing as described above. NOTE PCS0/SS does not necessarily have to be negated between transfers. Once the proper number of bits (designated by BITS) are transferred, the QSPI stores the received data in the receive data segment, stores the internal working queue pointer value in CPTQP, increments the internal working queue pointer, and loads the new transmit data from the transmit data segment into the data serializer. The internal working queue pointer address is used the next time PCS0/SS is asserted, unless the CPU writes to the NEWQP first. The DT and DSCK command control bits are not used in slave mode. As a slave, the QSPI does not drive the clock line nor the chip-select lines and, therefore, does not generate a delay. In slave mode, the QSPI shifts out the data in the transmit data segment. The trans-mit data is loaded into the data serializer (refer to Figure 15-1) for transmission. When the PCS0/SS pin is pulled low the MISO pin becomes active and the serializer then shifts the 16 bits of data out in sequence, most significant bit first, as clocked by the incoming SCK signal. The QSPI uses CPHA and CPOL to determine which incoming SCK edge the MOSI pin uses to latch incoming data, and which edge the MISO pin uses to drive the data out. The QSPI transmits and receives data until reaching the end of the queue (defined as a match with the address in ENDQP), regardless of whether PCS0/SS remains selected or is toggled between serial transfers. Receiving the proper number of bits causes the received data to be stored. The QSPI always transmits as many bits as it receives at each queue address, until the BITS value is reached or PCS0/SS is negated. 15.6.7 Slave Wraparound Mode When the QSPI reaches the end of the queue, it always sets the SPIF flag, whether wraparound mode is enabled or disabled. An optional interrupt to the CPU is gen-erated when SPIF is asserted. At this point, the QSPI clears SPE and stops unless wraparound mode is enabled. A description of SPIFIE bit can be found in 15.6.1.3 QSPI Control Register 2 (SPCR2). In wraparound mode, the QSPI cycles through the queue continuously. Each time the end of the queue is reached, the SPIF flag is set. If the CPU fails to clear SPIF, it remains set, and the QSPI continues to send interrupt requests to the CPU (assuming SPIFIE is set). The user may avoid causing CPU interrupts by clearing SPIFIE. As SPIFIE is buffered, clearing it after the SPIF flag is asserted does not immediately stop the CPU interrupts, but only prevents future interrupts from this source. To clear the current interrupt, the CPU must read QSPI register SPSR with SPIF asserted, followed by a write to SPSR with zero in SPIF (clear SPIF). Execution continues in wraparound mode even while the QSPI is requesting interrupt service from the CPU. The internal working queue pointer is incremented to the next address and the commands are MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-41 Queued Serial Multi-Channel Module executed again. SPE is not cleared by the QSPI. New receive data overwrites previously received data located in the receive data segment. Wraparound mode is properly exited in two ways: * The CPU may disable wrap-around mode by clearing WREN. The next time end of the queue is reached, the QSPI sets SPIF, clears SPE, and stops. * The CPU sets HALT. This second method halts the QSPI after the current transfer is completed, allowing the CPU to negate SPE. The CPU can immediately stop the QSPI by clearing SPE; however, this method is not recommended, as it causes the QSPI to abort a serial transfer in process. 15.6.8 Mode Fault MODF is asserted by the QSPI when the QSPI is the serial master (MSTR = 1) and the slave select (PCS0/SS) input pin is pulled low by an external driver. This is possible only if the PCS0/SS pin is configured as input by QDDR. This low input to SS is not a normal operating condition. It indicates that a multimaster system conflict may exist, that another MCU is requesting to become the SPI network master, or simply that the hardware is incorrectly affecting PCS0/SS. SPE in SPCR1 is cleared, disabling the QSPI. The QSPI pins revert to control by QPDR. If MODF is set and HMIE in SPCR3 is asserted, the QSPI generates an interrupt to the CPU. The CPU may clear MODF by reading SPSR with MODF asserted, followed by writing SPSR with a zero in MODF. After correcting the mode fault problem, the QSPI can be re-enabled by asserting SPE. The PCS0/SS pin may be configured as a general-purpose output instead of input to the QSPI. This inhibits the mode fault checking function. In this case, MODF is not used by the QSPI. 15.7 Serial Communication Interface The dual, independent, serial communication interface (DSCI) communicates with external devices through an asynchronous serial bus. The two SCI modules are functionally equivalent, except that the SCI1 also provides 16-deep queue capabilities for the transmit and receive operations. The SCIs are fully compatible with other Freescale SCI systems. The DSCI has all of the capabilities of previous SCI systems as well as several significant new features. Figure 15-24 is a block diagram of the SCI transmitter. Figure 15-25 is a block diagram of the SCI receiver. MPC561/MPC563 Reference Manual, Rev. 1.2 15-42 Freescale Semiconductor Queued Serial Multi-Channel Module (WRITE-ONLY) Stop 10 (11)-Bit TX Shift Register Start SCxDR TX Buffer Transmitter Baud Rate Clock Pin Buffer And Control TxD SCCxR1 CONTROL Register 1 0 15 SCxSR STATUS Register 0 TIE TCIE 15 TDRE TC RDRF RAF IDLE OR NF FE PF LOOPS WOMS ILT PT PE M WAKE TIE TCIE RIE ILIE TE RE RWU SBK Transmitter Control Logic Open Drain Output Mode Enable Parity Generator Force Pin Direction (Out) BREAK--JAM 0's TRANSFER Tx Buffer SHIFT Enable JAM Enable PREAMBLE--JAM 1's SIZE 8/9 H (8) 7 6 5 4 3 2 1 0 L TDRE TC Internal Data Bus SCI Rx Requests SCI Interrupt Request Figure 15-24. SCI Transmitter Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-43 Queued Serial Multi-Channel Module RxD Pin Buffer Data Recovery 10 (11)-Bit RX Shift Register Start /16 Stop Receiver Baud Rate Clock H (8) 7 6 5 4 3 2 1 0 L MSB All Ones Parity Detect 0 LOOPS WOMS ILT PT PE M WAKE TIE TCIE RIE ILIE TE RE RWU SBK Wake-up Logic 15 SCCxR1 CONTROL Register 1 0 SCxDR RX Buffer TDRE TC RDRF RAF IDLE OR NF FE PF (READ-ONLY) 15 SCI TX Requests SCxSR STATUS Register 0 SCI Interrupt Request Internal Data Bus Figure 15-25. SCI Receiver Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 15-44 Freescale Semiconductor Queued Serial Multi-Channel Module 15.7.1 SCI Registers The SCI programming model includes the QSMCM global and pin control registers and the DSCI registers. The DSCI registers, listed in Table 15-23, consist of five control registers, three status registers, and 34 data registers. All registers may be read or written at any time by the CPU. Rewriting the same value to any DSCI register does not disrupt operation; however, writing a different value into a DSCI register when the DSCI is running may disrupt operation. To change register values, the receiver and transmitter should be disabled with the transmitter allowed to finish first. The status flags in register SCxSR can be cleared at any time. Table 15-23. SCI Registers Address Name Usage 0x30 5008 SCC1R0 SCI1 Control Register 0 See Table 15-24 for bit descriptions. 0x30 500A SCC1R1 SCI1 Control Register 1 See Table 15-25 for bit descriptions. 0x30 500C SC1SR SCI1 Status Register See Table 15-26 for bit descriptions. 0x30 500E (non-queue mode only SC1DR SCI1 Data Register Transmit Data Register (TDR1)* Receive Data Register (RDR1)* See Table 15-27 for bit descriptions. 0x30 5020 SCC2R0 SCI2 Control Register 0 0x30 5022 SCC2R1 SCI2 Control Register 1 0x30 5024 SC2SR SCI2 Status Register 0x30 5026 SC2DR SCI2 Data Register Transmit Data Register (TDR2)* Receive Data Register (RDR2)* 0x30 5028 QSCI1CR QSCI1 Control Register Interrupts, wrap, queue size and enables for receive and transmit, QTPNT. See Table 15-32 for bit descriptions. 0x30 502A QSCI1SR QSCI1 Status Register OverRun error flag, queue status flags, QRPNT, and QPEND. See Table 15-33 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-45 Queued Serial Multi-Channel Module Table 15-23. SCI Registers 0x30 502C -- 0x30 504A QSCI1 Transmit Queue QSCI1 Transmit Queue Data locations (on Memory Area half-word boundary) 0x30 504C-6A QSCI1 Receive Queue QSCI1 Receive Queue Data locations (on Memory Area half-word boundary) *Reads access the RDRx; writes access the TDRx. During SCIx initialization, two bits in the SCCxR1 should be written last: the transmitter enable (TE) and receiver enable (RE) bits, which enable SCIx. Registers SCCxR0 and SCCxR1 should both be initialized at the same time or before TE and RE are asserted. A single half-word write to SCCxR1 can be used to initialize SCIx and enable the transmitter and receiver. 15.7.2 SCI Control Register 0 (SCCxR0) SCCxR0 contains the SCIx baud rate selection field and two bits controlling the clock source. The baud rate must be set before the SCI is enabled. The CPU can read and write SCCxR0 at any time. Changing the value of SCCxR0 bits during a transfer operation can disrupt the transfer. Before changing register values, allow the SCI to complete the current transfer, then disable the receiver and transmitter. MSB 0 Field OTHR SRESET 0 LSB 1 2 LNKBD -- SCxBR 0 0 0_0000_0000_0100 Addr 3 4 5 6 7 8 9 10 11 12 13 14 15 0x30 5008; 0x30 5020 Figure 15-26. SCCxR0 -- SCI Control Register 0 Table 15-24. SCCxR0 Bit Descriptions Bits Name Description 0 OTHR This bit is reserved and should always be programmed to 0. 1 LNKBD This bit is reserved and should always be programmed to 0. 2 -- 3:15 SCxBR Reserved SCI baud rate. The SCI baud rate is programmed by writing a 13-bit value to this field. Writing a value of zero to SCxBR disables the baud rate generator. Baud clock rate is calculated as follows: f SYS SCI Baud Rate = -----------------------------32xSCxBR where SCxBR is in the range of 1 to 8191. Refer to Section 15.7.7.3, "Baud Clock," for more information. MPC561/MPC563 Reference Manual, Rev. 1.2 15-46 Freescale Semiconductor Queued Serial Multi-Channel Module 15.7.3 SCI Control Register 1 (SCCxR1) SCCxR1 contains SCIx configuration parameters, including transmitter and receiver enable bits, interrupt enable bits, and operating mode enable bits. The CPU can read or write this register at any time. The SCI can modify the RWU bit under certain circumstances. Changing the value of SCCxR1 bits during a transfer operation can disrupt the transfer. Before changing register values, allow the SCI to complete the current transfer, then disable the receiver and transmitter. MSB LSB 0 Field 1 -- 2 3 LOOPS WOMS ILT 4 5 6 PT PE M 7 8 9 10 WAKE TIE TCIE RIE SRESET 0000_0000_0000_0000 Addr 0x30 500A; 0x30 5022 11 12 ILIE TE 13 14 15 RE RWU SBK Figure 15-27. SCI Control Register 1 (SCCxR1) Table 15-25. SCCxR1 Bit Descriptions Bits Name Description 0 -- 1 LOOPS Loop mode 0 Normal SCI operation, no looping, feedback path disabled. 1 SCI test operation, looping, feedback path enabled. 2 WOMS Wired-OR mode for SCI Pins 0 If configured as an output, TXD is a normal CMOS output. 1 If configured as an output, TXD is an open drain output. 3 ILT Idle-line detect type. Refer to Section 15.7.7.9, "Idle-Line Detection." 0 Short idle-line detect (start count on first one). 1 Long idle-line detect (start count on first one after stop bit(s)). 4 PT Parity type. Refer to Section 15.7.7.4, "Parity Checking." 0 Even parity. 1 Odd parity. 5 PE Parity enable. Refer to Section 15.7.7.4, "Parity Checking. 0 SCI parity disabled. 1 SCI parity enabled. 6 M Mode select. Refer to Section 15.7.7.2, "Serial Formats." 0 10-bit SCI frame. 1 11-bit SCI frame. 7 WAKE 8 TIE 9 TCIE Reserved Wakeup by address mark. Refer to Section 15.7.7.10, "Receiver Wake-Up." 0 SCI receiver awakened by idle-line detection. 1 SCI receiver awakened by address mark (last bit set). Transmit interrupt enable 0 SCI TDRE interrupts disabled. 1 SCI TDRE interrupts enabled. Transmit complete interrupt enable 0 SCI TC interrupts disabled. 1 SCI TC interrupts enabled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-47 Queued Serial Multi-Channel Module Table 15-25. SCCxR1 Bit Descriptions (continued) Bits Name 10 RIE Receiver interrupt enable 0 SCI RDRF and OR interrupts disabled. 1 SCI RDRF and OR interrupts enabled. 11 ILIE Idle-line interrupt enable 0 SCI IDLE interrupts disabled. 1 SCI IDLE interrupts enabled. 12 TE Transmitter enable 0 SCI transmitter disabled (TXD pin can be used as general-purpose output) 1 SCI transmitter enabled (TXD pin dedicated to SCI transmitter). 13 RE Receiver Enable 0 SCI receiver disabled (RXD pin can be used as general-purpose input). 1 SCI receiver enabled (RXD pin is dedicated to SCI receiver). 14 RWU Receiver wakeup. Refer to Section 15.7.7.10, "Receiver Wake-Up." 0 Normal receiver operation (received data recognized). 1 Wakeup mode enabled (received data ignored until receiver is awakened). 15 SBK Send break 0 Normal operation. 1 Break frame(s) transmitted after completion of current frame. 15.7.4 Description SCI Status Register (SCxSR) SCxSR contains flags that show SCI operating conditions. These flags are cleared either by SCIx hardware or by a read/write sequence. The sequence consists of reading the SCxSR (either the upper byte, lower byte, or the entire half-word) with a flag bit set, then reading (or writing, in the case of flags TDRE and TC) the SCxDR (either the lower byte or the half-word). The contents of the two 16-bit registers SCxSR and SCxDR appear as upper and lower half-words, respectively, when the SCxSR is read into a 32-bit register. An upper byte access of SCxSR is meaningful only for reads. Note that a word read can simultaneously access both registers SCxSR and SCxDR. This action clears the receive status flag bits that were set at the time of the read, but does not clear the TDRE or TC flags. To clear TC, the SCxSR read must be followed by a write to register SCxDR (either the lower byte or the half-word). The TDRE flag in the status register is read-only. If an internal SCI signal for setting a status bit comes after the CPU has read the asserted status bits but before the CPU has read or written the SCxDR, the newly set status bit is not cleared. Instead, SCxSR must be read again with the bit set and SCxDR must be read or written before the status bit is cleared. NOTE None of the status bits are cleared by reading a status bit while it is set and then writing zero to that same bit. Instead, the procedure outlined above must be followed. Note further that reading either byte of SCxSR causes all 16 bits to be accessed, and any status bits already set in either byte are armed to clear on a subsequent read or write of SCxDR. MPC561/MPC563 Reference Manual, Rev. 1.2 15-48 Freescale Semiconductor Queued Serial Multi-Channel Module MSB 0 LSB 1 2 3 7 8 -- TDRE TC 0000_000 1 1 Field SRESET Addr 4 5 6 9 10 RDRF RAF 0 0 11 12 13 14 15 IDLE OR NF FE PF 0 0 0 0 0 0x30 500C; 0x30 5024 Figure 15-28. SCIx Status Register (SCxSR) Table 15-26. SCxSR Bit Descriptions Bits Name Description 0:6 -- 7 TDRE Transmit data register empty. TDRE is set when the byte in TDRx is transferred to the transmit serial shifter. If this bit is zero, the transfer is yet to occur and a write to TDRx will overwrite the previous value. New data is not transmitted if TDRx is written without first clearing TDRE. 0 Transmit data register still contains data to be sent to the transmit serial shifter. 1 A new character can now be written to the transmit data register. For transmit queue operation, this bit should be ignored by software. 8 TC Transmit complete. TC is set when the transmitter finishes shifting out all data, queued preambles (mark/idle-line), or queued breaks (logic zero). 0 SCI transmitter is busy. 1 SCI transmitter is idle. For transmit queue operation, TC is cleared when SCxSR is read with TC set, followed by a write to SCTQ[0:15]. 9 RDRF 10 RAF Receiver active flag. RAF indicates whether the receiver is busy. This flag is set when the receiver detects a possible start bit and is cleared when the chosen type of idle line is detected. RAF can be used to reduce collisions in systems with multiple masters. 0 SCI receiver is idle. 1 SCI receiver is busy. 11 IDLE Idle line detected. IDLE is set when the receiver detects an idle-line condition (reception of a minimum of 10 or 11 consecutive ones as specified by ILT in SCCxR1). This bit is not set by the idle-line condition when RWU in SCCxR1 is set. Once cleared, IDLE is not set again until after RDRF is set (after the line is active and becomes idle again). If a break is received, RDRF is set, allowing a subsequent idle line to be detected again. Under certain conditions, the IDLE flag may be set immediately following the negation of RE in SCCxR1. System designs should ensure this causes no detrimental effects. 0 SCI receiver did not detect an idle-line condition. 1 SCI receiver detected an idle-line condition. For receiver queue operation, IDLE is cleared when SCxSR is read with IDLE set, followed by a read of SCRQ[0:15]. Reserved Receive data register full. RDRF is set when the contents of the receive serial shifter are transferred to register RDRx. If one or more errors are detected in the received word, the appropriate flag(s) (NF, FE, or PF) are set within the same clock cycle. 0 Receive data register is empty or contains previously read data. 1 Receive data register contains new data. For receiver queue operation, this bit should be ignored by software. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-49 Queued Serial Multi-Channel Module Table 15-26. SCxSR Bit Descriptions (continued) Bits Name Description 12 OR Overrun error. OR is set when a new byte is ready to be transferred from the receive serial shifter to register RDRx, and RDRx is already full (RDRF is still set). Data transfer is inhibited until OR is cleared. Previous data in RDRx remains valid, but additional data received during an overrun condition (including the byte that set OR) is lost. Note that whereas the other receiver status flags (NF, FE, and PF) reflect the status of data already transferred to RDRx, the OR flag reflects an operational condition that resulted in a loss of data to RDRx. 0 RDRF is cleared before new data arrives. 1 RDRF is not cleared before new data arrives. 13 NF Noise error flag. NF is set when the receiver detects noise on a valid start bit, on any of the data bits, or on the stop bit(s). It is not set by noise on the idle line or on invalid start bits. Each bit is sampled three times for noise. If the three samples are not at the same logic level, the majority value is used for the received data value, and NF is set. NF is not set until the entire frame is received and RDRF is set. Although no interrupt is explicitly associated with NF, an interrupt can be generated with RDRF, and the interrupt handler can check NF. 0 No noise detected in the received data. 1 Noise detected in the received data. For receiver queue operation NF is cleared when SCxSR is read with NF set, followed by a read of SCRQ[0:15]. 14 FE Framing error. FE is set when the receiver detects a zero where a stop bit (one) was expected. A framing error results when the frame boundaries in the received bit stream are not synchronized with the receiver bit counter. FE is not set until the entire frame is received and RDRF is set. Although no interrupt is explicitly associated with FE, an interrupt can be generated with RDRF, and the interrupt handler can check FE. 0 No framing error detected in the received data. 1 Framing error or break detected in the received data. 15 PF Parity error. PF is set when the receiver detects a parity error. PF is not set until the entire frame is received and RDRF is set. Although no interrupt is explicitly associated with PF, an interrupt can be generated with RDRF, and the interrupt handler can check PF. 0 No parity error detected in the received data. 1 Parity error detected in the received data. 15.7.5 SCI Data Register (SCxDR) The SCxDR consists of two data registers located at the same address. The receive data register (RDRx) is a read-only register that contains data received by the SCI serial interface. Data is shifted into the receive serial shifter and is transferred to RDRx. The transmit data register (TDRx) is a write-only register that contains data to be transmitted. Data is first written to TDRx, then transferred to the transmit serial shifter, where additional format bits are added before transmission. MPC561/MPC563 Reference Manual, Rev. 1.2 15-50 Freescale Semiconductor Queued Serial Multi-Channel Module MSB 0 LSB 1 2 Field SRESET 3 4 5 6 7 8 9 10 11 12 13 14 15 -- R8/T8 R7/T7 R6/T6 R5/T5 R4/T4 R3/T3 R2/T2 R1/T1 R0/T0 0000_000 Undefined Addr 0x30 500E Figure 15-29. SCI Data Register (SCxDR) Table 15-27. SCxDR Bit Descriptions Bits Name 0:6 -- 7:15 R[8:0]/ T[8:0] 15.7.6 Description Reserved R[7:0]/T[7:0] contain either the eight data bits received when SCxDR is read, or the eight data bits to be transmitted when SCxDR is written. R8/T8 are used when the SCI is configured for nine-bit operation (M = 1). When the SCI is configured for 8-bit operation, R8/T8 have no meaning or effect. Accesses to the lower byte of SCxDR triggers the mechanism for clearing the status bits or for initiating transmissions whether byte, half-word, or word accesses are used. SCI Pins The RXD1 and RXD2 pins are the receive data pins for the SCI1 and SCI2, respectively. TXD1 and TXD2 are the transmit data pins for the two SCI modules. The pins and their functions are listed in Table 15-28. Table 15-28. SCI Pin Functions 15.7.7 Pin Names Mnemonic Mode Function Receive Data RXD1, RXD2 Receiver disabled Receiver enabled General purpose input Serial data input to SCI Transmit Data TXD1, TXD2 Transmitter disabled Transmitter enabled General purpose output Serial data output from SCI SCI Operation The SCI can operate in polled or interrupt-driven mode. Status flags in SCxSR reflect SCI conditions regardless of the operating mode chosen. The TIE, TCIE, RIE, and ILIE bits in SCCxR1 enable interrupts for the conditions indicated by the TDRE, TC, RDRF, and IDLE bits in SCxSR, respectively. 15.7.7.1 Definition of Terms Bit-time Start bit Stop bit The time required to transmit or receive one bit of data, which is equal to one cycle of the baud frequency. One bit-time of logic zero that indicates the beginning of a data frame. A start bit must begin with a one-to-zero transition and be preceded by at least three receive time samples of logic one. One bit-time of logic one that indicates the end of a data frame. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-51 Queued Serial Multi-Channel Module Frame Data frame Idle frame Break frame 15.7.7.2 A complete unit of serial information. The SCI can use 10-bit or 11-bit frames. A start bit, a specified number of data or information bits, and at least one stop bit. A frame that consists of consecutive ones. An idle frame has no start bit. A frame that consists of consecutive zeros. A break frame has no stop bits. Serial Formats All data frames must have a start bit and at least one stop bit. Receiving and transmitting devices must use the same data frame format. The SCI provides hardware support for both 10-bit and 11-bit frames. The M bit in SCCxR1 specifies the number of bits per frame. The most common data frame format for NRZ (non-return to zero) serial interfaces is one start bit, eight data bits (Lsb first), and one stop bit (ten bits total). The most common 11-bit data frame contains one start bit, eight data bits, a parity or control bit, and one stop bit. Ten-bit and 11-bit frames are shown in Table 15-29. Table 15-29. Serial Frame Formats 10-bit Frames SCCxR1 Bits Start Data Parity/Control STOP M PE 1 7 -- 2 0 0 1 7 1 1 0 1 1 8 -- 1 0 0 11-Bit Frames 1 SCCxR1 Bits Start Data Parity/Control STOP M PE 1 8 -- 21 1 1 1 8 1 1 1 1 1 9 -- 1 1 0 The MSB data bit can also serve as a second STOP bit. By setting this bit permanently to one, communication with other SCIs requiring two STOP bits could be accommodated. 15.7.7.3 Baud Clock The SCI baud rate is programmed by writing a 13-bit value to the SCxBR field in SCI control register zero (SCCxR0). The baud rate is derived from the MCU IMB3 clock by a modulus counter. Writing a value of zero to SCxBR[12:0] disables the baud rate generator. The baud rate is calculated as follows: f SYS SCI Baud Rate = -----------------------------32xSCxBR or Eqn. 15-4 MPC561/MPC563 Reference Manual, Rev. 1.2 15-52 Freescale Semiconductor Queued Serial Multi-Channel Module f SYS SCxBR = -----------------------------------------------------------------------32xSCI Baud Rate Desired where SCxBR is in the range {1, 2, 3, ..., 8191}. The SCI receiver operates asynchronously. An internal clock is necessary to synchronize with an incoming data stream. The SCI baud rate generator produces a receive time sampling clock with a frequency 16 times that of the SCI baud rate. The SCI determines the position of bit boundaries from transitions within the received waveform, and adjusts sampling points to the proper positions within the bit period. Table 15-30 shows possible baud rates for a 40-MHz IMB3 clock. The maximum baud rate with this IMB3 clock speed is 1250 Kbaud. Table 15-30. Examples of SCIx Baud Rates1 Nominal Baud Rate Actual Baud Rate Percent Error Value of SCxBR 1,250,000.00 57,600.00 38,400.00 32,768.00 28,800.00 19,200.00 14,400.00 9,600.00 4,800.00 2,400.00 1,200.00 600.00 300.00 1,250,000.00 56,818.18 37,878.79 32,894.74 29,069.77 19,230.77 14,367.81 9,615.38 4,807.69 2,399.23 1,199.62 600.09 299.98 0.00 -1.36 -1.36 0.39 0.94 0.16 -0.22 0.16 0.16 -0.03 -0.03 0.02 -0.01 1 22 33 38 43 65 87 130 260 521 1042 2083 4167 1These 15.7.7.4 rates are based on a 40-MHz IMB3 clock. Parity Checking The PT bit in SCCxR1 selects either even (PT = 0) or odd (PT = 1) parity. PT affects received and transmitted data. The PE bit in SCCxR1 determines whether parity checking is enabled (PE = 1) or disabled (PE = 0). When PE is set, the MSB of data in a frame (i.e., the bit preceding the stop bit) is used for the parity function. For transmitted data, a parity bit is generated. For received data, the parity bit is checked. When parity checking is enabled, the PF bit in the SCI status register (SCxSR) is set if a parity error is detected. Enabling parity affects the number of data bits in a frame, which can in turn affect frame size. Table 15-31 shows possible data and parity formats. Table 15-31. Effect of Parity Checking on Data Size M PE Result 0 0 8 data bits 0 1 7 data bits, 1 parity bit MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-53 Queued Serial Multi-Channel Module Table 15-31. Effect of Parity Checking on Data Size 15.7.7.5 M PE Result 1 0 9 data bits 1 1 8 data bits, 1 parity bit Transmitter Operation The transmitter consists of a serial shifter and a parallel data register (TDRx) located in the SCI data register (SCxDR). The serial shifter cannot be directly accessed by the CPU. The transmitter is double-buffered, which means that data can be loaded into the TDRx while other data is shifted out. The TE bit in SCCxR1 enables (TE = 1) and disables (TE = 0) the transmitter. The shifter output is connected to the TXD pin while the transmitter is operating (TE = 1, or TE = 0 and transmission in progress). Wired-OR operation should be specified when more than one transmitter is used on the same SCI bus. The WOMS bit in SCCxR1 determines whether TXD is an open drain (wired-OR) output or a normal CMOS output. An external pull-up resistor on TXD is necessary for wired-OR operation. WOMS controls TXD function, regardless of whether the pin is used by the SCI or as a general-purpose output pin. Data to be transmitted is written to SCxDR, then transferred to the serial shifter. Before writing to TDRx, the transmit data register empty (TDRE) flag in SCxSR should be checked. When TDRE = 0, the TDRx contains data that has not been transferred to the shifter. Writing to SCxDR again overwrites the data. If TDRE = 1, then TDRx is empty, and new data may be written to TDRx, clearing TDRE. As soon as the data in the transmit serial shifter has shifted out and if a new data frame is in TDRx (TDRE = 0), then the new data is transferred from TDRx to the transmit serial shifter and TDRE is set automatically. An interrupt may optionally be generated at this point. The transmission complete (TC) flag in SCxSR shows transmitter shifter state. When TC = 0, the shifter is busy. TC is set when all shifting operations are completed. TC is not automatically cleared. The processor must clear it by first reading SCxSR while TC is set, then writing new data to SCxDR, or writing to SCTQ[0:15] for transmit queue operation. The state of the serial shifter is checked when the TE bit is set. If TC = 1, an idle frame is transmitted as a preamble to the following data frame. If TC = 0, the current operation continues until the final bit in the frame is sent, then the preamble is transmitted. The TC bit is set at the end of preamble transmission. The SBK bit in SCCxR1 is used to insert break frames in a transmission. A non-zero integer number of break frames are transmitted while SBK is set. Break transmission begins when SBK is set, and ends with the transmission in progress at the time either SBK or TE is cleared. If SBK is set while a transmission is in progress, that transmission finishes normally before the break begins. To ensure the minimum break time, toggle SBK quickly to one and back to zero. The TC bit is set at the end of break transmission. After break transmission, at least one bit-time of logic level one (mark idle) is transmitted to ensure that a subsequent start bit can be detected. If TE remains set, after all pending idle, data and break frames are shifted out, TDRE and TC are set and TXD is held at logic level one (mark). MPC561/MPC563 Reference Manual, Rev. 1.2 15-54 Freescale Semiconductor Queued Serial Multi-Channel Module When TE is cleared, the transmitter is disabled after all pending idle, data, and break frames are transmitted. The TC flag is set, and control of the TXD pin reverts to PQSPAR and DDRQS. Buffered data is not transmitted after TE is cleared. To avoid losing data in the buffer, do not clear TE until TDRE is set. Some serial communication systems require a mark on the TXD pin even when the transmitter is disabled. Configure the TXD pin as an output, then write a one to either QDTX1 or QDTX2 of the PORTQS register. See Section 15.5.1, "Port QS Data Register (PORTQS)." When the transmitter releases control of the TXD pin, it reverts to driving a logic one output. To insert a delimiter between two messages, to place non-listening receivers in wake-up mode between transmissions, or to signal a re-transmission by forcing an idle-line, clear and then set TE before data in the serial shifter has shifted out. The transmitter finishes the transmission, then sends a preamble. After the preamble is transmitted, if TDRE is set, the transmitter marks idle. Otherwise, normal transmission of the next sequence begins. Both TDRE and TC have associated interrupts. The interrupts are enabled by the transmit interrupt enable (TIE) and transmission complete interrupt enable (TCIE) bits in SCCxR1. Service routines can load the last data frame in a sequence into SCxDR, then terminate the transmission when a TDRE interrupt occurs. Two SCI messages can be separated with minimum idle time by using a preamble of 10 bit-times (11 if a 9-bit data format is specified) of marks (logic ones). Follow these steps: 1. Write the last data frame of the first message to the TDRx 2. Wait for TDRE to go high, indicating that the last data frame is transferred to the transmit serial shifter 3. Clear TE and then set TE back to one. This queues the preamble to follow the stop bit of the current transmission immediately. 4. Write the first data frame of the second message to register TDRx In this sequence, if the first data frame of the second message is not transferred to TDRx prior to the finish of the preamble transmission, then the transmit data line (TXDx pin) marks idle (logic one) until TDRx is written. In addition, if the last data frame of the first message finishes shifting out (including the stop bit) and TE is clear, TC goes high and transmission is considered complete. The TXDx pin reverts to being a general-purpose output pin. 15.7.7.6 Receiver Operation The receiver can be divided into two segments. The first is the receiver bit processor logic that synchronizes to the asynchronous receive data and evaluates the logic sense of each bit in the serial stream. The second receiver segment controls the functional operation and the interface to the CPU including the conversion of the serial data stream to parallel access by the CPU. 15.7.7.7 Receiver Bit Processor The receiver bit processor contains logic to synchronize the bit-time of the incoming data and to evaluate the logic sense of each bit. To accomplish this an RT clock, which is 16 times the baud rate, is used to sample each bit. Each bit-time can thus be divided into 16 time periods called RT1-RT16. The receiver MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-55 Queued Serial Multi-Channel Module looks for a possible start bit by watching for a high-to-low transition on the RXDx pin and by assigning the RT time labels appropriately. When the receiver is enabled by writing RE in SCCxR1 to one, the receiver bit pro-cessor logic begins an asynchronous search for a start bit. The goal of this search is to gain synchronization with a frame. The bit-time synchronization is done at the beginning of each frame so that small differences in the baud rate of the receiver and transmitter are not cumulative. SCIx also synchronizes on all one-to-zero transitions in the serial data stream, which makes SCIx tolerant to small frequency variations in the received data stream. The sequence of events used by the receiver to find a start bit is listed below. 1. Sample RXDx input during each RT period and maintain these samples in a serial pipeline that is three RT periods deep. 2. If RXDx is low during this RT period, go to step 1. 3. If RXDx is high during this RT period, store sample and proceed to step 4. 4. If RXDx is low during this RT period, but not high for the previous three RT periods (which is noise only), set an internal working noise flag and go to step 1, since this transition was not a valid start bit transition. 5. If RXDx is low during this RT period and has been high for the previous three RT periods, call this period RT1, set RAF, and proceed to step 6. 6. Skip RT2 but place RT3 in the pipeline and proceed to step 7. 7. Skip RT4 and sample RT5. If both RT3 and RT5 are high (RT1 was noise only), set an internal working noise flag. Go to step 3 and clear RAF. Otherwise, place RT5 in the pipeline and proceed to step 8. 8. Skip RT6 and sample RT7. If any two of RT3, RT5, or RT7 is high (RT1 was noise only), set an internal working noise flag. Go to step 3 and clear RAF. Otherwise, place RT7 in the pipeline and proceed to step 9. 9. A valid start bit is found and synchronization is achieved. From this point on until the end of the frame, the RT clock will increment starting over again with RT1 on each one-to-zero transition or each RT16. The beginning of a bit-time is thus defined as RT1 and the end of a bit-time as RT16. Upon detection of a valid start bit, synchronization is established and is maintained through the reception of the last stop bit, after which the procedure starts all over again to search for a new valid start bit. During a frame's reception, SCIx resynchronizes the RT clock on any one-to-zero transitions. Additional logic in the receiver bit processor determines the logic level of the received bit and implements an advanced noise-detection function. During each bit-time of a frame (including the start and stop bits), three logic-sense samples are taken at RT8, RT9, and RT10. The logic sense of the bit-time is decided by a majority vote of these three samples. This logic level is shifted into register RDRx for every bit except the start and stop bits. If RT8, RT9, and RT10 do not all agree, an internal working noise flag is set. Additionally for the start bit, if RT3, RT5, and RT7 do not all agree, the internal working noise flag is set. If this flag is set for any of the bit-times in a frame, the NF flag in SCxSR is set concurrently with the RDRF flag in SCxSR when the data is transferred to register RDRx. The user must determine if the data received with NF set is valid. Noise on the RXDx pin does not necessarily corrupt all data. MPC561/MPC563 Reference Manual, Rev. 1.2 15-56 Freescale Semiconductor Queued Serial Multi-Channel Module The operation of the receiver bit processor is shown in Figure 15-30. This example demonstrates the search for a valid start bit and the synchronization procedure as outlined above. The possibilities of noise durations greater than one bit-time are not considered in this examples. Perceived Start Bit Actual Start Bit 1 1 1 1 1 1 1 1 1 R T 1 * R T 1 * R T 1 * R T 1 * R T 1 * R T 1 * R T 1 * R T 1 * 0 0 0 0 0 LSB 0 0 R R R R R R R R R R R T T T T T T T T T T T 1 1 2 3 4 5 6 7 8 9 1 * 0 R T 1 1 R T 1 2 R T 1 3 R T 1 4 * Restart RT Clock R T 1 5 R R R R T T T T 1 1 2 3 6 * Figure 15-30. Start Search Example 15.7.7.8 Receiver Functional Operation The RE bit in SCCxR1 enables (RE = 1) and disables (RE = 0) the receiver. The receiver contains a receive serial shifter and a parallel receive data register (RDRx) located in the SCI data register (SCxDR). The serial shifter cannot be directly accessed by the CPU. The receiver is double-buffered, allowing data to be held in the RDRx while other data is shifted in. Receiver bit processor logic drives a state machine that determines the logic level for each bit-time. This state machine controls when the bit processor logic is to sample the RXD pin and also controls when data is to be passed to the receive serial shifter. A receive time clock is used to control sampling and synchronization. Data is shifted into the receive serial shifter according to the most recent synchronization of the receive time clock with the incoming data stream. From this point on, data movement is synchronized with the MCU IMB3 clock. Operation of the receiver state machine is detailed in the Queued Serial Module Reference Manual. The number of bits shifted in by the receiver depends on the serial format. However, all frames must end with at least one stop bit. When the stop bit is received, the frame is considered to be complete, and the received data in the serial shifter is transferred to the RDRx. The receiver data register flag (RDRF) is set when the data is transferred. The stop bit is always a logic one. If a logic zero is sensed during this bit-time, the FE flag in SCxSR is set. A framing error is usually caused by mismatched baud rates between the receiver and transmitter or by a significant burst of noise. Note that a framing error is not always detected; the data in the expected stop bit-time may happen to be a logic one. Noise errors, parity errors, and framing errors can be detected while a data stream is being received. Although error conditions are detected as bits are received, the noise flag (NF), the parity flag (PF), and the framing error (FE) flag in SCxSR are not set until data is transferred from the serial shifter to the RDRx. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-57 Queued Serial Multi-Channel Module RDRF must be cleared before the next transfer from the shifter can take place. If RDRF is set when the shifter is full, transfers are inhibited and the overrun error (OR) flag in SCxSR is set. OR indicates that the RDRx needs to be serviced faster. When OR is set, the data in the RDRx is preserved, but the data in the serial shifter is lost. When a completed frame is received into the RDRx, either the RDRF or OR flag is always set. If RIE in SCCxR1 is set, an interrupt results whenever RDRF is set. The receiver status flags NF, FE, and PF are set simultaneously with RDRF, as appropriate. These receiver flags are never set with OR because the flags apply only to the data in the receive serial shifter. The receiver status flags do not have separate interrupt enables, since they are set simultaneously with RDRF and must be read at the same time as RDRF. When the CPU reads SCxSR and SCxDR in sequence, it acquires status and data, and also clears the status flags. Reading SCxSR acquires status and arms the clearing mechanism. Reading SCxDR acquires data and clears SCxSR. 15.7.7.9 Idle-Line Detection During a typical serial transmission, frames are transmitted isochronically and no idle time occurs between frames. Even when all the data bits in a frame are logic ones, the start bit provides one logic zero bit-time during the frame. An idle line is a sequence of contiguous ones equal to the current frame size. Frame size is determined by the state of the M bit in SCCxR1. The SCI receiver has both short and long idle-line detection capability. Idle-line detection is always enabled. The idle-line type (ILT) bit in SCCxR1 determines which type of detection is used. When an idle-line condition is detected, the IDLE flag in SCxSR is set. For short idle-line detection, the receiver bit processor counts contiguous logic one bit-times whenever they occur. Short detection provides the earliest possible recognition of an idle-line condition, because the stop bit and contiguous logic ones before and after it are counted. For long idle-line detection, the receiver counts logic ones after the stop bit is received. Only a complete idle frame causes the IDLE flag to be set. In some applications, software overhead can cause a bit-time of logic level one to occur between frames. This bit-time does not affect content, but if it occurs after a frame of ones when short detection is enabled, the receiver flags an idle line. When the ILIE bit in SCCxR1 is set, an interrupt request is generated when the IDLE flag is set. The flag is cleared by reading SCxSR and SCxDR in sequence. For receiver queue operation, IDLE is cleared when SCxSR is read with IDLE set, followed by a read of SCRQ[0:15]. IDLE is not set again until after at least one frame has been received (RDRF = 1). This prevents an extended idle interval from causing more than one interrupt. 15.7.7.10 Receiver Wake-Up The receiver wake-up function allows a transmitting device to direct a transmission to a single receiver or to a group of receivers by sending an address frame at the start of a message. Hardware activates each receiver in a system under certain conditions. Resident software must process address information and enable or disable receiver operation. MPC561/MPC563 Reference Manual, Rev. 1.2 15-58 Freescale Semiconductor Queued Serial Multi-Channel Module A receiver is placed in wake-up mode by setting the RWU bit in SCCxR1. While RWU is set, receiver status flags and interrupts are disabled. Although the software can clear RWU, it is normally cleared by hardware during wake-up. The WAKE bit in SCCxR1 determines which type of wake-up is used. When WAKE = 0, idle-line wake-up is selected. When WAKE = 1, address-mark wake-up is selected. Both types require a software-based device addressing and recognition scheme. Idle-line wake-up allows a receiver to sleep until an idle line is detected. When an idle line is detected, the receiver clears RWU and wakes up. The receiver waits for the first frame of the next transmission. The data frame is received normally, transferred to the RDRx, and the RDRF flag is set. If software does not recognize the address, it can set RWU and put the receiver back to sleep. For idle-line wake-up to work, there must be a minimum of one frame of idle line between transmissions. There must be no idle time between frames within a transmission. Address mark wake-up uses a special frame format to wake up the receiver. When the MSB of an address-mark frame is set, that frame contains address information. The first frame of each transmission must be an address frame. When the MSB of a frame is set, the receiver clears RWU and wakes up. The data frame is received normally, transferred to the RDRx, and the RDRF flag is set. If software does not recognize the address, it can set RWU and put the receiver back to sleep. Address mark wake-up allows idle time between frames and eliminates idle time between transmissions. However, there is a loss of efficiency because of an additional bit-time per frame. 15.7.7.11 Internal Loop Mode The LOOPS bit in SCCxR1 controls a feedback path in the data serial shifter. When LOOPS is set, the SCI transmitter output is fed back into the receive serial shifter. TXD is asserted (idle line). Both transmitter and receiver must be enabled before entering loop mode. 15.8 15.8.1 SCI Queue Operation Queue Operation of SCI1 for Transmit and Receive The SCI1 serial module allows for queueing on transmit and receive data frames. In the standard mode, in which the queue is disabled, the SCI1 operates as previously defined (i.e., transmit and receive operations done via SC1DR). However, if the SCI1 queue feature is enabled (by setting the QTE and/or QRE bits within QSCI1CR) a set of 16 entry queues is allocated for the receive and/or transmit operation. Through software control the queue is capable of continuous receive and transfer operations within the SCI1 serial unit. 15.8.2 Queued SCI1 Status and Control Registers The SCI1 queue uses the following registers: * QSCI1 control register (QSCI1CR, address offset 0x28) * QSCI1 status register (QSCI1SR, address offset 0x2A) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-59 Queued Serial Multi-Channel Module 15.8.2.1 QSCI1 Control Register (QSCI1CR) MSB LSB 0 1 Field 2 3 QTPNT 4 5 6 7 QTHFI QBHFI QTHEI QBHEI SRESET 8 9 -- QTE 10 11 QRE QTWE 12 13 14 15 QTSZ 0000_0000_0000_0000 Addr 0x30 5028 Figure 15-31. QSCI1 Control Register (QSCI1CR) Table 15-32. QSCI1CR Bit Descriptions Bits Name Description 0:3 QTPNT Queue transmit pointer. QTPNT is a 4-bit counter used to indicate the next data frame within the transmit queue to be loaded into the SC1DR. This feature allows for ease of testability. This field is writable in test mode only; otherwise it is read-only. 4 QTHFI Receiver queue top-half full interrupt. When set, QTHFI enables an SCI1 interrupt whenever the QTHF flag in QSCI1SR is set. The interrupt is blocked by negating QTHFI. This bit refers to the queue locations SCRQ[0:7]. 0 QTHF interrupt inhibited 1 Queue top-half full (QTHF) interrupt enabled 5 QBHFI Receiver queue bottom-half full interrupt. When set, QBHFI enables an SCI1 interrupt whenever the QBHF flag in QSCI1SR is set. The interrupt is blocked by negating QBHFI. This bit refers to the queue locations SCRQ[8:15]. 0 QBHF interrupt inhibited 1 Queue bottom-half full (QBHF) interrupt enabled 6 QTHEI Transmitter queue top-half empty interrupt. When set, QTHEI enables an SCI1 interrupt whenever the QTHE flag in QSCI1SR is set. The interrupt is blocked by negating QTHEI. This bit refers to the queue locations SCTQ[0:7]. 0 QTHE interrupt inhibited 1 Queue top-half empty (QTHE) interrupt enabled 7 QBHEI Transmitter queue bottom-half empty interrupt. When set, QBHEI enables an SCI1 interrupt whenever the QBHE flag in QSCI1SR is set. The interrupt is blocked by negating QBHEI. This bit refers to the queue locations SCTQ[8:15]. 0 QBHE interrupt inhibited 1 Queue bottom-half empty (QBHE) interrupt enabled 8 -- 9 QTE Reserved Queue transmit enable. When set, the transmit queue is enabled and the TDRE bit should be ignored by software. The TC bit is redefined to indicate when the entire queue is finished transmitting. When clear, the SCI1 functions as described in the previous sections and the bits related to the queue (Section 5.5 and its subsections) should be ignored by software with the exception of QTE. 0 Transmit queue is disabled 1 Transmit queue is enabled MPC561/MPC563 Reference Manual, Rev. 1.2 15-60 Freescale Semiconductor Queued Serial Multi-Channel Module Table 15-32. QSCI1CR Bit Descriptions (continued) Bits Name Description 10 QRE Queue receive enable. When set, the receive queue is enabled and the RDRF bit should be ignored by software. When clear, the SCI1 functions as described in the previous sections and the bits related to the queue (Section 5.5 and its subsections) should be ignored by software with the exception of QRE. 0 Receive queue is disabled 1 Receive queue is enabled 11 QTWE Queue transmit wrap enable. When set, the transmit queue is allowed to restart transmitting from the top of the queue after reaching the bottom of the queue. After each wrap of the queue, QTWE is cleared by hardware. 0 Transmit queue wrap feature is disabled 1 Transmit queue wrap feature is enabled 12:15 QTSZ Queue transfer size. The QTSZ bits allow programming the number of data frames to be transmitted. From 1 (QTSZ = 0b0000) to 16 (QTSZ = 0b1111) data frames can be specified. QTSZ is loaded into QPEND initially or when a wrap occurs. 15.8.2.2 QSCI1 Status Register (QSCI1SR) MSB LSB 0 1 Field 2 3 -- SRESET 4 5 6 7 8 QOR QTHF QBHF QTHE QBHE 000 0 Addr 1 1 1 1 9 10 11 12 13 14 QRPNT QPEND 0000 0000 15 0x30 502A Figure 15-32. QSCI1 Status Register (QSCI1SR) Table 15-33. QSCI1SR Bit Descriptions Bits Name Description 0:2 -- 3 QOR Receiver queue overrun error. The QOR is set when a new data frame is ready to be transferred from the SC1DR to the queue and the queue is already full (QTHF or QBHF are still set). Data transfer is inhibited until QOR is cleared. Previous data transferred to the queue remains valid. Additional data received during a queue overrun condition is not lost provided the receive queue is re-enabled before OR (SC1SR) is set. The OR flag is set when a new data frame is received in the shifter but the data register (SC1DR) is still full. The data in the shifter that generated the OR assertion is overwritten by the next received data frame, but the data in the SC1DR is not lost. 0 The queue is empty before valid data is in the SC1DR 1 The queue is not empty when valid data is in the SC1DR 4 QTHF Receiver queue top-half full. QTHF is set when the receive queue locations SCRQ[0:7] are completely filled with new data received via the serial shifter. QTHF is cleared when register QSCI1SR is read with QTHF set, followed by a write of QTHF to zero. 0 The queue locations SCRQ[0:7] are partially filled with newly received data or is empty 1 The queue locations SCRQ[0:7] are completely full of newly received data Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-61 Queued Serial Multi-Channel Module Table 15-33. QSCI1SR Bit Descriptions (continued) Bits Name Description 5 QBHF Receiver queue bottom-half full. QBHF is set when the receive queue locations SCRQ[8:15] are completely filled with new data received via the serial shifter. QBHF is cleared when register QSCI1SR is read with QBHF set, followed by a write of QBHF to zero. 0 The queue locations SCRQ[8:15] are partially filled with newly received data or is empty 1 The queue locations SCRQ[8:15] are completely full of newly received data 6 QTHE Transmitter queue top-half empty. QTHE is set when all the data frames in the transmit queue locations SCTQ[0:7] have been transferred to the transmit serial shifter. QTHE is cleared when register QSCI1SR is read with QTHE set, followed by a write of QTHE to zero. 0 The queue locations SCTQ[0:7] still contain data to be sent to the transmit serial shifter 1 New data may now be written to the queue locations SCTQ[0:7] 7 QBHE Transmitter queue bottom-half empty. QBHE is set when all the data frames in the transmit queue locations SCTQ[8:15] has been transferred to the transmit serial shifter. QBHE is cleared when register QSCI1SR is read with QBHE set, followed by a write of QBHE to zero. 0 The queue locations SCTQ[8:15] still contain data to be sent to the transmit serial shifter 1 New data may now be written to the queue locations SCTQ[8:15] 8:11 QRPNT Queue receive pointer. QRPNT is a 4-bit counter used to indicate the position where the next valid data frame will be stored within the receive queue. This field is writable in test mode only; otherwise it is read-only. 12:15 QPEND Queue pending. QPEND is a 4-bit decrementer used to indicate the number of data frames in the queue that are awaiting transfer to the SC1DR. This field is writable in test mode only; otherwise it is read-only. From 1 (QPEND = 0b0000) to 16 (or done, QPEND = 1111) data frames can be specified. 15.8.3 QSCI1 Transmitter Block Diagram The block diagram of the enhancements to the SCI transmitter is shown in Figure 15-33. MPC561/MPC563 Reference Manual, Rev. 1.2 15-62 Freescale Semiconductor Queued Serial Multi-Channel Module SCI Interrupt Request QBHE QTHE Queue STATUS QPEND[0:3] QTWE QBHEI QTSZ[0:3] QTHEI QTE Queue CONTROL Queue Control Logic 4-bits SCTQ0 SC1DR Tx Buffer 9-bit 16:1 MUX SCI1 Non-Queue Operation SCTQ1 Data bus 10 (11) - Bit Tx Shift Register START Transmitter Baud Rate Clock STOP SCTQ15 TxD H (8) 7 6 5 4 3 2 1 0 L Figure 15-33. Queue Transmitter Block Enhancements 15.8.4 * * * * QSCI1 Additional Transmit Operation Features Available on a single SCI channel (SCI1) implemented by the queue transmit enable (QTE) bit set by software. When enabled, (QTE = 1) the TDRE bit should be ignored by software and the TC bit is redefined (as described later). When the queue is disabled (QTE = 0), the SCI functions in single buffer transfer mode where the queue size is set to one (QTSZ = 0000), and TDRE and TC function as previously defined. Locations SCTQ[0:15] can be used as general purpose 9-bit registers. All other bits pertaining to the queue should be ignored by software. Programmable queue up to 16 transmits (SCTQ[0:15]) which may allow for infinite and continuous transmits. Available transmit wrap function to prevent message breaks for transmits greater than 16. This is achieved by the transmit wrap enable (QTWE) bit. When QTWE is set, the hardware is allowed to MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-63 Queued Serial Multi-Channel Module * * * * * * * restart transmitting from the top of the queue (SCTQ0). After each wrap, QTWE is cleared by hardware. -- Transmissions of more than 16 data frames must be performed in multiples of 16 (QTSZ = 0b1111) except for the last set of transmissions. For any single non-continuous transmissions of 16 or less or the last transmit set composed of 16 or fewer data frames, programming of QTSZ to the corresponding value of 16 or less where QTWE = 0 is allowed. Interrupt generation when the top half (SCTQ[0:7]) of the queue has been emptied (QTHE) and the bottom half (SCTQ[8:15]) of the queue has been emptied (QBHE). This may allow for uninterrupted and continuous transmits by indicating to the CPU that it can begin refilling the queue portion that is now emptied. -- The QTHE bit is set by hardware when the top half is empty or the transmission has completed. The QTHE bit is cleared when the QSCI1SR is read with QTHE set, followed by a write of QTHE to zero. -- The QBHE bit is set by hardware when the bottom half is empty or the transmission has completed. The QBHE bit is cleared when the QSCI1SR is read with QBHE set, followed by a write of QBHE to zero. -- In order to implement the transmit queue, QTE must be set (QSCI1CR), TE must be set (SCC1R1), QTHE must be cleared (QSCI1SR), and TDRE must be set (SC1SR). Enable and disable options for the interrupts QTHE and QBHE as controlled by QTHEI and QBHEI respectfully. Programmable 4-bit register queue transmit size (QTSZ) for configuring the queue to any size up to 16 transfers at a time. This value may be rewritten after transmission has started to allow for the wrap feature. 4-bit status register to indicate the number of data transfers pending (QPEND). This register counts down to all 0's where the next count rolls over to all 1's. This counter is writable in test mode; otherwise it is read-only. 4-bit counter (QTPNT) is used as a pointer to indicate the next data frame within the transmit queue to be loaded into the SC1DR. This counter is writable in test mode; otherwise it is read-only. A transmit complete (TC) bit re-defined when the queue is enabled (QTE = 1) to indicate when the entire queue (including when wrapped) is finished transmitting. This is indicated when QPEND = 1111 and the shifter has completed shifting data out. TC is cleared when the SCxSR is read with TC = 1 followed by a write to SCTQ[0:15]. If the queue is disabled (QTE = 0), the TC bit operates as originally designed. When the transmit queue is enabled (QTE = 1), writes to the transmit data register (SC1DR) have no effect. MPC561/MPC563 Reference Manual, Rev. 1.2 15-64 Freescale Semiconductor Queued Serial Multi-Channel Module 15.8.5 QSCI1 Transmit Flow Chart Implementing the Queue Refers to Action Performed in Parallel TE=0, TC=1, TDRE=1 QTE=0, QTPNT=0, QTWE=0 QTHEI=0, QTHE=1 QBHEI=0, QBHE=1 Reset QTE=1, TE=1 TDRE=1, QTHE=0? Set QTE=1 Set QTHEI, QBHEI Write QTSZ=n Clear QTHE, TC Write SCTQ[0:n] Set TE Hardware Software No Yes Load QPEND with QTSZ, Reset QTPNT to 0000 No QTE, TE=1? Yes Load TDR (SC1DR) With SCTQ[QTPNT] Shift Data Out(TDRE=1) Write QTSZ for Wrap Clear QTHE Possible Set of QTWE Decrement QPEND, Increment QTPNT Yes QTPNT=1000? Clear QBHE No Set QTHE Yes QBHE=0? Yes Set QBHE QTPNT = 1111? No no No QPEND = 1111 yes Clear QTWE Yes QTWE = 1 & QTHE = 0? no Set QTHE, QBHE Clear QTE MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-65 Queued Serial Multi-Channel Module Figure 15-34. Queue Transmit Flow Reset Configure the Transmit Flow for First Use of the Queue. Enable Queue Interrupt QTHEI = 1, If Transmitting Greater than 16 Data Frames, Enable Queue Interrupt QBHEI = 1 Write QTSZ=n for First Pass Use of the Queue Read Status Register with TC = 1, Write SCTQ[0:n] (Clears TC) Read Status Register with QTHE=1 Write QTHE = 0 (and QBHE if Transmitting More than 8 Data Frames) Set QTE and TE = 1 Yes QTHE = 1? No To Wrap, Write New QTSZ=n Set QTWE (Previous QTSZ Must Have Equaled 16) Read QTHE=1, Write QTHE=0 Write New Data SCTQ[0:7] No QBHE = 1? If Finished Transmitting, Then Clear QTE and/or TE DONE Yes If Transmitting Greater Than 8 Data Frames on Wrap Read QBHE=1,Write QBHE=0 Write New Data to SCTQ[8:15] If Finished Transmitting, Then Clear QTE and/or TE DONE Figure 15-35. Queue Transmit Software Flow MPC561/MPC563 Reference Manual, Rev. 1.2 15-66 Freescale Semiconductor Queued Serial Multi-Channel Module 15.8.6 Example QSCI1 Transmit for 17 Data Bytes Figure 15-36 below shows a transmission of 17 data frames. The bold type indicates the current value for QTPNT and QPEND. The italic type indicates the action just performed by hardware. Regular type indicates the actions that should be performed by software before the next event. Transmit Queue Enabled QTSZ=1111 (16 Data Frames) 1 2 QTHE Interrupt Received QTSZ=1111 (16 Data Frames) QTPNT 0000 QPEND 1111 QTPNT 0000 SCTQ0 QPEND 1111 0111 SCTQ7 1000 0111 SCTQ7 1000 0111 1000 SCTQ8 0111 0000 1111 SCTQ15 0000 1000 1111 SCTQ8 SCTQ15 SCTQ0 Write New QTSZ for When Wrap Occurs 3 QTSZ=0 (16+1=17),Set QTWE, Clear QTHE Write SCTQ0 for 17th Transfer QBHE Interrupt Received (Wrap Occurred) QTSZ=0000 (1 Data Frame) QTPNT QPEND 0000 0000 SCTQ0 0001 1111 0111 SCTQ7 1000 SCTQ8 1111 SCTQ15 Data to be transferred Available register space Load QPEND with QTSZ (0) Clear QTWE Reset QTPNT Figure 15-36. Queue Transmit Example for 17 Data Bytes MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-67 Queued Serial Multi-Channel Module 15.8.7 Example SCI Transmit for 25 Data Bytes Figure 15-37 below is an example of a transmission of 25 data frames. MPC561/MPC563 Reference Manual, Rev. 1.2 15-68 Freescale Semiconductor Queued Serial Multi-Channel Module 1 2 Transmit Queue Enabled QTSZ=1111 (16 Data Frames) QTPNT 0000 SCTQ0 0111 SCTQ7 1000 SCTQ8 1111 SCTQ15 QPEND 1111 QTHE Interrupt Received QTSZ=1111 (16 Data Frames) QTPNT 0000 SCTQ0 QPEND 1111 0111 SCTQ7 1000 0111 1000 SCTQ8 0111 0000 1111 SCTQ15 0000 1000 Write QTSZ = 8 (16 + 9 = 25) Write SCTQ [0:7] for 8 More Data Frames Set QTWE Clear QTHE Data to be Transferred 3 QBHE Interrupt Received (Wrap Occurred) QTSZ=1000 (9 Data Frames) QTPNT 0000 SCTQ0 0111 SCTQ7 1000 SCTQ8 4 QTHE Interrupt Received QTSZ=1000 (9 Data Frames) QTPNT 0000 SCTQ0 QPEND 1000 0001 0111 SCTQ7 0001 0000 1000 SCTQ8 0000 QPEND 1000 1001 1111 SCTQ15 1111 Available Register Space 1111 SCTQ15 Load QPEND with QTSZ Clear QTWE Reset QTPNT Write SCTQ8 Clear QBHE Figure 15-37. Queue Transmit Example for 25 Data Frames MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-69 Queued Serial Multi-Channel Module 15.8.8 QSCI1 Receiver Block Diagram STOP Receiver Baud Rate Clock START The block diagram of the enhancements to the SCI receiver is shown below in Figure 15-38. 10 (11) - Bit Rx Shift Register H (8) 7 6 5 4 3 2 1 0 L RxD SCRQ0 16:1 Mux SCxDR Rx BUFFER SCI1 Non-Queue Operation SCRQ1 Data Bus SCRQ15 4-bits Queue Control QOR QBHF QTHF QRPNT[0:3] QRE QBHFI QTHFI Queue Control Logic Queue Status SCI Interrupt Request Figure 15-38. Queue Receiver Block Enhancements 15.8.9 QSCI1 Additional Receive Operation Features Additional QSCI1 features include: * Available on a single SCI channel (SCI1) implemented by the queue receiver enable (QRE) bit set by software. When the queue is enabled, software should ignore the RDRF bit. * When the queue is disabled (QRE = 0), the SCI functions in single buffer receive mode (as originally designed) and RDRF and OR function as previously defined. Locations SCRQ[0:15] can MPC561/MPC563 Reference Manual, Rev. 1.2 15-70 Freescale Semiconductor Queued Serial Multi-Channel Module * * * * * * * * * * * * be used as general purpose 9-bit registers. Software should ignore all other bits pertaining to the queue. Only data that has no errors (FE and PF both false) is allowed into the queue. The status flags FE and PF, if set, reflect the status of data not allowed into the queue. The receive queue is disabled until the error flags are cleared via the original SCI mechanism and the queue is re-initialized. The pointer QRPNT indicates the queue location where the data frame would have been stored. Queue size capable to receive up to 16 data frames (SCRQ[0:15]) which may allow for infinite and continuous receives. Interrupt generation can occur when the top half (SCRQ[0:7]) of the queue has been filled (QTHF) and the bottom half (SCRQ[8:15]) of the queue has been filled (QBHF). This may allow for uninterrupted and continuous receives by indicating to the CPU to start reading the queue portion that is now full. -- The QTHF bit is set by hardware when the top half is full. The QTHF bit is cleared when the SCxSR is read with QTHF set, followed by a write of QTHF to zero. -- The QBHF bit is set by hardware when the bottom half is full. The QBHF bit is cleared when the SCxSR is read with QBHF set, followed by a write of QBHF to zero. In order to implement the receive queue, the following conditions must be met: QRE must be set (QSCI1CR); RE must be set (SCC1R1); QOR and QTHF must be cleared (QSCI1SR); and OR, PF, and FE must be cleared (SC1SR). Enable and disable options for the interrupts QTHF and QBHF as controlled by the QTHFI and QBHFI, respectfully. 4-bit counter (QRPNT) is used as a pointer to indicate where the next valid data frame will be stored. A queue overrun error flag (QOR) to indicate when the queue is already full when another data frame is ready to be stored into the queue (similar to the OR bit in single buffer mode). The QOR bit can be set for QTHF = 1 or QBHF = 1, depending on where the store is being attempted. The queue can be exited when an idle line is used to indicate when a group of serial transmissions is finished. This can be achieved by using the ILIE bit to enable the interrupt when the IDLE flag is set. The CPU can then clear QRE and/or RE allowing the receiver queue to be exited. For receiver queue operation, IDLE is cleared when SC1SR is read with IDLE set, followed by a read of SCRQ[0:15]. For receiver queue operation, NF is cleared when the SC1SR is read with NF set, followed by a read of SCRQ[0:15]. When noise occurs, the data is loaded into the receive queue, and operation continues unaffected. However, it may not be possible to determine which data frame in the receive queue caused the noise flag to be asserted. The queue is successfully filled (16 data frames) if error flags (FE and PF) are clear, QTHF and QBHF are set, and QRPNT is reset to all zeroes. QOR indicates that a new data frame has been received in the data register (SC1DR), but it cannot be placed into the receive queue due to either the QTHF or QBHF flag being set (QSCI1SR). Under this condition, the receive queue is disabled (QRE = 0). Software may service the receive queue and clear the appropriate flag (QTHF, QBHF). Data is not lost provided that the receive queue is re-enabled before OR (SC1SR) is set, which occurs when a new data frame is received in the shifter MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-71 Queued Serial Multi-Channel Module but the data register (SC1DR) is still full. The data in the shifter that generated the OR assertion is overwritten by the next received data frame, but the data in the SC1DR is not lost. MPC561/MPC563 Reference Manual, Rev. 1.2 15-72 Freescale Semiconductor Queued Serial Multi-Channel Module 15.8.10 QSCI1 Receive Flow Chart Implementing the Queue Refers to Action Performed In Parallel RE=0, QRWE=0 QRPNT=0000 QRE=0, QOR=0 QTHF=1, QBHF=1 QTHFI=0, QBHFI=0 Reset QRE/RE=1 QTHF/QOR=0 FE/PE/OR=0 Set QRE Set QTHFI, QBHFI Clear QTHF, QBHF Set RE Hardware Software No Yes Reset QRPNT to 0000 Clear QRE No QRE, RE=1? Yes No RDRF=1? Yes No FE, PE = 0? Yes QRPNT=8 & QBHF QRPNT=0 & QTHF Yes Set QOR No Load RX Data to SCRQ[QRPNT], Increment QRPNT Clear QTHF Yes QRPNT = 1000? Set QTHF No Clear QBHF Yes Set QBHF QRPNT = 0000? No Figure 15-39. Queue Receive Flow MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-73 Queued Serial Multi-Channel Module 15.8.11 QSCI1 Receive Queue Software Flow Chart Reset Configure the Receive Queue Enable Queue Interrupts QTHFI, QBHFI = 1, Read Status Register with QTHF & QBHF = 1, Write QTHF & QBHF = 0 FunctionCan Be Used To Indicate When a Group Of Serial Transmissions Is Finished Enable ILIE=1 to Detect An Idle Line Set QRE and RE = 1 QTHF=1? Yes No QBHF = 1? Yes No IDLE = 1? Read Status Register With QTHF = 1 Read SCRQ[0:7] Write QTHF = 0 Yes Read Status Register With QBHF = 1 Read SCRQ[8:15] Write QBHF = 0 No Clear QRE and/or RE To Exit the Queue DONE Figure 15-40. Queue Receive Software Flow MPC561/MPC563 Reference Manual, Rev. 1.2 15-74 Freescale Semiconductor Queued Serial Multi-Channel Module 15.8.12 Example QSCI1 Receive Operation of 17 Data Frames Figure 15-41 shows an example receive operation of 17 data frames. The bold type indicates the current value for the QRPNT. Action of the queue may be followed by starting at the top of the figure and going left to right and then down the page. 1 Receive Queue Enabled QRPNT 0000 QTHF Interrupt Received 2 QRPNT 0000 SCRQ0 SCRQ0 Data Received Available Space 0111 SCRQ7 1000 SCRQ8 1111 SCRQ15 0111 SCRQ7 1000 SCRQ8 1111 SCRQ15 Read SCSR and SCRQ[0:7] Clear QTHF 3 QBHF Interrupt Received QRPNT 0000 4 IDLE Interrupt Received QRPNT 0000 SCRQ0 SCRQ0 0001 0111 SCRQ7 1000 SCRQ8 1111 SCRQ15 Read SCRQ[8:15] Clear QBHF 0111 SCRQ7 1000 SCRQ8 1111 SCRQ15 Read SCRQ0 Clear QRE/RE Figure 15-41. Queue Receive Example for 17 Data Bytes MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 15-75 Queued Serial Multi-Channel Module MPC561/MPC563 Reference Manual, Rev. 1.2 15-76 Freescale Semiconductor Chapter 16 CAN 2.0B Controller Module The MPC561/MPC563 contains three CAN 2.0B controller modules (TouCAN). Each TouCAN is a communication controller that implements the Controller Area Network (CAN) protocol, an asynchronous communications protocol used in automotive and industrial control systems. It is a high speed (one Mbit/sec), short distance, priority based protocol that can run over a variety of mediums (for example, fiber optic cable or an unshielded twisted pair of wires). The TouCAN supports both the standard and extended identifier (ID) message formats specified in the CAN protocol specification, revision 2.0, part B. The third TouCAN has its signals muxed with MIOS14 GPIO or QSMCM SCI2 signals. These signals are configured as GPIO inputs at reset and must be changed to TouCAN signals in the MIOS before enabling the TouCAN. Each TouCAN module contains 16 message buffers that are used for transmit and receive functions. It also contains message filters, which are used to qualify the received message IDs when comparing them to the receive buffer identifiers. Figure 16-1 shows a block diagram of a TouCAN module. Control Transmitter 16 Rx/Tx Message Buffers 16-bit Counter Receiver CNTX0 CNRX0 Slave Bus Interface Unit IMB Figure 16-1. TouCAN Block Diagram 16.1 Features Each TouCAN module provides these features: * Full implementation of CAN protocol specification, version 2.0 A/B -- Standard data and remote frames (up to 109 bits long) -- Extended data and remote frames (up to 127 bits long) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-1 CAN 2.0B Controller Module * * * * * * * * * * * * * * * * * * 16.2 -- Zero to eight bytes data length -- Programmable bit rate up to one Mbit/sec 16 Rx/Tx message buffers of 0-8 bytes data length Content-related addressing No read/write semaphores required Three programmable mask registers: global (for message buffers 0 through 13), special for message buffer 14, and special for message buffer 15 Programmable transmit-first scheme: lowest ID or lowest buffer number "Time stamp", based on 16-bit free-running timer Global network time, synchronized by a specific message Programmable I/O modes Maskable interrupts Independent of the transmission medium (external transceiver is assumed) Open network architecture Multimaster concept High immunity to EMI Short latency time for high-priority messages Low power sleep mode with programmable wakeup on bus activity Outputs have open drain drivers Support for SAE J1939 and SAE J2284 Support for DeviceNetTM and Smart Distributed System External Signals Each TouCAN module interface to the external CAN bus consists of two signals: CNTX0 which transmits serial data, and CNRX0 which receives serial data. MPC561/MPC563 Reference Manual, Rev. 1.2 16-2 Freescale Semiconductor CAN 2.0B Controller Module CAN Station 1 CAN Station 2 CAN Station n MPC56x CAN System CAN Controller (TouCAN) CNTX0 CNRX0 Transceiver Transceiver Transceiver Figure 16-2. Typical CAN Network Each CAN station is connected physically to the CAN bus through an external transceiver. The transceiver provides the transmit drive, waveshaping, and receive/compare functions required for communicating on the CAN bus. It can also provide protection against damage to the TouCAN caused by a defective CAN bus or a defective CAN station. 16.2.1 TouCAN Signal Sharing The CNTX0 and CNRX0 signals of TouCAN_A and TouCAN_B are available at all times. The CNTX0 and CNRX0 signals of TouCAN_C are shared with MIOS14 GPIO signals (MPIO32B11, MPIO32B12) or QSMCM SCI2 signals (TXD2/QGPO2, RXD2/QGPI2). The signal functions for these signals are controlled by the PDMCR2[TCNC] register. NOTE Only one function can be enabled on a signal at a time. 16.3 TouCAN Architecture The TouCAN module uses a flexible design that allows each of its 16 message buffers to be designated either a transmit (Tx) buffer or a receive (Rx) buffer. In addition, to reduce the CPU overhead required for message handling, each message buffer is assigned an interrupt flag bit to indicate that the transmission or reception completed successfully. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-3 CAN 2.0B Controller Module 16.3.1 Tx/Rx Message Buffer Structure Figure 16-3 displays the extended (29-bit) ID message buffer structure. MSB 0 0x0 LSB L 7 8 Time Stamp 0x2 11 12 15 Code ID[28-18] Length SRR IDE 0x4 CONTROL/STATUS ID[17-15] ID[14-0] RTR ID_LOW 0x6 Data Byte 0 Data Byte 1 0x8 Data Byte 2 Data Byte 3 0xA Data Byte 4 Data Byte 5 0xC Data Byte 6 Data Byte 7 0xE ID_HIGH Reserved Figure 16-3. Extended ID Message Buffer Structure Figure 16-4 displays the standard (11-bit) ID message buffer structure. MSB 0 0x0 LSB L 7 8 Time Stamp 0x2 12 Code ID[28:18] 0x4 11 15 Length RTR 0 0 0 CONTROL/STATUS 0 16-bit Time Stamp ID_LOW 0x6 Data Byte 0 Data Byte 1 0x8 Data Byte 2 Data Byte 3 0xA Data Byte 4 Data Byte 5 0xC Data Byte 6 Data Byte 7 0xE ID_HIGH Reserved Figure 16-4. Standard ID Message Buffer Structure 16.3.1.1 Common Fields for Extended and Standard Format Frames Table 16-1 describes the message buffer fields that are common to both extended and standard identifier format frames. Table 16-1. Common Extended/Standard Format Frames Field Description Time Stamp Contains a copy of the high byte of the free running timer, which is captured at the beginning of the identifier field of the frame on the CAN bus. Code Refer to Table 16-2 and Table 16-3. MPC561/MPC563 Reference Manual, Rev. 1.2 16-4 Freescale Semiconductor CAN 2.0B Controller Module Table 16-1. Common Extended/Standard Format Frames (continued) Field Description Length (Rx) Length (in bytes) of the Rx data stored in offset 0x6 through 0xD of the buffer.This field is written by the TouCAN module, copied from the DLC (data length code) field of the received frame. Length (Tx) Length (in bytes) of the data to be transmitted, located in offset 0x6 through 0xD of the buffer. This field is written by the CPU and is used as the DLC field value. If RTR (remote transmission request) = 1, the frame is a remote frame and will be transmitted without data field, regardless of the value in Tx length. Data This field can store up to eight data bytes for a frame. For Rx frames, the data is stored as it is received from the bus. For Tx frames, the CPU provides the data to be transmitted within the frame. Reserved The CPU controls access to this word entry field (16 bits). Table 16-2. Message Buffer Codes for Receive Buffers Rx Code Before Rx New Frame 1 Description 0b0000 NOT ACTIVE -- message buffer is not active. 0b0100 EMPTY -- message buffer is active and empty. 0b0010 FULL -- message buffer is full. 0b0110 OVERRUN -- addtional frame was received into a full buffer before the CPU read the first one. 0b0XY11 BUSY -- message buffer is now being filled with a new receive frame. This condition will be cleared within 20 cycles. Rx Code After Rx New Frame Comment -- -- 0b0010 -- 0b0110 If a CPU read occurs before the new frame, new receive code is 0010. 0b0010 An empty buffer was filled (XY was 10). 0b0110 A full/overrun buffer was filled (Y was 1). For Tx message buffers, upon read, the BUSY bit should be ignored. Table 16-3. Message Buffer Codes for Transmit Buffers 1 Description Code After Successful Transmission RTR Initial Tx Code x 0b1000 Message buffer not ready for transmit. 0 0b1100 Data frame to be transmitted once, unconditionally. 0b1000 1 0b1100 Remote frame to be transmitted once, and message buffer becomes an Rx message buffer for data frames. 0b0100 0 0b10101 Data frame to be transmitted only as a response to a remote frame, always. 0b1010 0 0b1110 Data frame to be transmitted only once, unconditionally, and then only as a response to remote frame, always. 0b1010 -- When a matching remote request frame is detected, the code for such a message buffer is changed to be 0b1110. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-5 CAN 2.0B Controller Module 16.3.1.2 Fields for Extended Format Frames Table 16-4 describes the message buffer fields used only for extended identifier format frames. Table 16-4. Extended Format Frames Field Description ID[28:18]/[17:15] Contains the 14 most significant bits of the extended identifier, located in the ID_HIGH word of the message buffer. Substitute Remote Request (SRR) Contains a fixed recessive bit, used only in extended format. Should be set to one for Tx buffers. It will be stored as received on the CAN bus for Rx buffers. ID Extended (IDE) If extended format frame is used, this field should be set to one. If zero, standard format frame should be used. ID[14:0] Bits [14:0] of the extended identifier, located in the ID_LOW word of the message buffer. Remote Transmission Request (RTR) This bit is located in the least significant bit of the ID_LOW word of the message buffer 0 Data Frame 1 Remote Frame 16.3.1.3 Fields for Standard Format Frames Table 16-5 describes the message buffer fields used only for standard identifier format frames. Table 16-5. Standard Format Frames Field Description 16-bit Time Stamp The ID_LOW word, which is not needed for standard format, is used in a standard format buffer to store the 16-bit value of the free-running timer which is captured at the beginning of the identifier field of the frame on the CAN bus. ID[28:18] RTR This bit is located in the ID_HIGH word of the message buffer; 0 Data Frame 1 Remote Frame RTR/SRR Bit Treatment 16.3.1.4 Contains bits [28:18] of the identifier, located in the ID_HIGH word of the message buffer. The four least significant bits in this register (corresponding to the IDE bit and ID[17:15] for an extended identifier message) must all be written as logic zeros to ensure proper operation of the TouCAN. If the TouCAN transmits this bit as a one and receives it as a zero, an "arbitration loss" is indicated. If the TouCAN transmits this bit as a zero and receives it as a one, a bit error is indicated. If the TouCAN transmits a value and receives a matching response, a successful bit transmission is indicated. Serial Message Buffers To allow double buffering of messages, the TouCAN has two shadow buffers called serial message buffers. The TouCAN uses these two buffers for buffering both received messages and messages to be transmitted. Only one serial message buffer is active at a time, and its function depends upon the operation of the TouCAN at that time. These buffers are not accessible or visible to the user. MPC561/MPC563 Reference Manual, Rev. 1.2 16-6 Freescale Semiconductor CAN 2.0B Controller Module 16.3.1.5 Message Buffer Activation/Deactivation Mechanism Each message buffer must be activated once it is configured for the desired operation. A buffer is activated by writing the appropriate code to the control/status word for that buffer. Once the buffer is activated, it will start the normal transmit and receive processes. A buffer is deactivated by writing the appropriate deactivation code to the control/status word for that buffer. A buffer is typically deactivated to reconfigure the buffer (for example to change the buffer's function from Rx to Tx or Tx to Rx). The buffer should also be deactivated before changing a receive buffer's message identifier or before loading a new message to be transmitted into a transmit buffer. For more details on activation and deactivation of message buffers and the effects on message buffer operation, refer to Section 16.4, "TouCAN Operation." 16.3.1.6 Message Buffer Lock/Release/Busy Mechanism In addition to the activation/deactivation mechanism, the TouCAN also uses a lock/release/busy mechanism to ensure data coherency during the receive process. The mechanism includes a lock status for each message buffer and uses the two serial message buffers to facilitate frame transfers within the TouCAN. Reading the control/status word of a receive message buffer triggers the lock for that buffer. While locked, a received message cannot be transferred into that buffer from one of the serial message buffers. If a message transfer between the message buffer and a serial message buffer is in progress when the control/status word is read, the BUSY status is indicated in the code field, and the lock is not activated. The user can release the lock on a message buffer in one of two ways. Reading the control/status word of another message buffer locks that buffer, releasing the previously locked buffer. A global release can also be performed on any locked message buffer by reading the free-running timer. Once a lock is released, any message transfers between a serial message buffer and a message buffer that were delayed due to that buffer being locked will take place. For more details on the message buffer locking mechanism, and the effects on message buffer operation, refer to Section 16.4, "TouCAN Operation." 16.3.2 Receive Mask Registers The receive mask registers are used as acceptance masks for received frame IDs. The following masks are defined: * A global mask, used for receive buffers 0-13 * Two separate masks for buffers 14 and 15 The value of the mask registers should not be changed during normal operation. If the mask register data is changed after the masked identifier of a received message is matched to a locked message buffer, that message will be transferred into that message buffer once it is unlocked, regardless of whether that message's masked identifier still matches the receive buffer identifier. Table 16-6 shows mask bit values. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-7 CAN 2.0B Controller Module Table 16-6. Receive Mask Register Bit Values Mask Bit Values 0 The corresponding incoming ID bit is "don't care" 1 The corresponding ID bit is checked against the incoming ID bit to see if a match exists Table 16-7 shows mask examples for normal and extended messages. Refer to Section 16.7, "Programming Model" for more information on Rx mask registers. Table 16-7. Mask Examples for Normal/Extended Messages 1 2 3 4 5 6 7 16.3.3 Message Buffer (MB)/Mask Base ID ID[28:18] IDE Extended ID ID[17:0] Match MB2 11111111000 0 -- -- MB3 11111111000 1 010101010101010101 -- MB4 00000011111 0 -- -- MB5 00000011101 1 010101010101010101 -- MB14 11111111000 1 010101010101010101 -- Rx Global Mask 11111111110 111111100000000001 -- Rx Message In 11111111001 1 010101010101010101 31 11111111001 0 -- 22 11111111001 1 010101010101010100 --3 01111111000 0 -- --4 01111111000 1 010101010101010101 --5 111111100000000000 -- Rx 14 Mask 01111111111 Rx Message In 10111111000 1 010101010101010101 --6 01111111000 1 010101010101010101 147 Match for extended format (MB3). Match for standard format (MB2). No match for MB3 because of ID0. No match for MB2 because of ID28. No match for MB3 because of ID28, match for MB14. No match for MB14 because of ID27. Match for MB14. Bit Timing The TouCAN module uses three 8-bit registers to set up the bit timing parameters required by the CAN protocol. Control registers one and two (CANCTRL1, CANCTRL2) contain the PROPSEG, PSEG1, PSEG2, and the RJW fields that allow configuration of the bit timing parameters. The prescaler divide register (PRESDIV) allows selection of the ratio used to derive the serial clock (S-clock) from the system clock. The time quanta clock operates at the S-clock frequency. Table 16-8 provides examples of system clock, CAN bit rate, and S-clock bit timing parameters, and Figure 16-5 shows the relationship between MPC561/MPC563 Reference Manual, Rev. 1.2 16-8 Freescale Semiconductor CAN 2.0B Controller Module the system clock and the CAN bit segments. Refer to Section 16.7, "Programming Model," for more information on the bit timing registers. SYSTEM CLOCK Baud Rate Prescaler (PRESDIV) S-CLOCK TIME QUANTUM SS PROPSEG Transmit point SS PSEG1 PSEG2 Sample point Nominal bit time (NBT) SYNC_SEG Figure 16-5. Relationship between System Clock and CAN Bit Segments A bit is divided into four separate non-overlapping time segments called SYNC_SEG, PROPSEG, PSEG1, and PSEG2. These are illustrated in Figure 16-5. The period of the nominal bit time (NBT) is the sum of the segment durations: t NBT = t SYNC_SEG + t PROPSEG + t PSEG1 + t PSEG2 The sample point indicated in Figure 16-5 is the position of the actual sample point if a single sample per bit is selected (CANCTRL1[SAMP] bit = 0). If three samples per bit are selected, the sample point indicated in Figure 16-5 marks the position of the final sample. Table 16-8. Example System Clock, CAN Bit Rate, and S-Clock Frequencies System Clock Frequency (MHz) CAN Bit Rate (MHz) Possible S-Clock Frequency (MHz) Possible Number of Time Quanta/Bit PRESDIV Value + 1 56 1 56 56 1 40 1 40 40 1 25 1 25 25 1 20 1 10, 20 10, 20 2, 1 16 1 8, 16 8, 16 2, 1 56 0.500 56 118 1 40 0.500 40 80 1 25 0.500 25 50 1 20 0.500 1, 2, 2.5 2, 4, 5 20, 10, 8 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-9 CAN 2.0B Controller Module Table 16-8. Example System Clock, CAN Bit Rate, and S-Clock Frequencies (continued) System Clock Frequency (MHz) CAN Bit Rate (MHz) Possible S-Clock Frequency (MHz) Possible Number of Time Quanta/Bit PRESDIV Value + 1 16 0.500 1, 2 2, 4 16, 8 56 0.125 1, 2 8, 16 56, 28 40 0.125 1, 2 8, 16 40, 20 25 0.125 1, 1.25, 2.5 8,10, 20 25, 20,10 20 0.125 1, 2, 2.5 8, 16, 20 20, 10, 8 16 0.125 1, 2 8,16 16, 8 16.3.3.1 Configuring the TouCAN Bit Timing The following considerations must be observed when programming bit timing functions. * If the programmed PRESDIV value results in a single system clock per one time quantum, then the PSEG2 field in CANCTRL2 register must not be programmed to zero. * If the programmed PRESDIV value results in a single system clock per one time quantum, then the information processing time (IPT) equals three time quanta; otherwise it equals two time quanta. If PSEG2 equals two, then the TouCAN transmits one time quantum late relative to the scheduled sync segment. * If the prescaler and bit timing control fields are programmed to values that result in fewer than 10 system clock periods per CAN bit time and the CAN bus loading is 100%, then any time the rising edge of a start-of-frame (SOF) symbol transmitted by another node occurs during the third bit of the intermission between messages, the TouCAN may not be able to prepare a message buffer for transmission in time to begin its own transmission and arbitrate against the message which transmitted the early SOF. * The TouCAN bit time must be programmed to be greater than or equal to nine system clocks, or correct operation is not guaranteed.The duration of the synchronization segment, SYNC_SEG, is not programmable and is fixed at one time quantum. 16.3.4 Error Counters The TouCAN has two error counters, the transmit (Tx) error counter and the receive (Rx) error counter. Refer to Section 16.7, "Programming Model," for more information on error counters. The rules for increasing and decreasing these counters are described in the CAN protocol, and are fully implemented in the TouCAN. Each counter has the following features: * Eight-bit up/down-counter * Increment by eight (Rx error counter also increments by one) * Decrement by one * Avoid decrement when equal to zero * Rx error counter reset to a value between 119 and 127 inclusive, when the TouCAN transitions from error passive to error active MPC561/MPC563 Reference Manual, Rev. 1.2 16-10 Freescale Semiconductor CAN 2.0B Controller Module * * * Following reset, both counters reset to zero Detect values for error passive, bus off and error active transitions Cascade usage of Tx error counter with an additional internal counter to detect the 128 occurrences of 11 consecutive recessive bits necessary to transition from bus off into error active. Both counters are read-only (except in test/freeze/halt modes). The TouCAN responds to any bus state as described in the CAN protocol, transmitting an error active or error passive flag, delaying its transmission start time (error passive) and avoiding any influence on the bus when in the bus off state. The following are the basic rules for TouCAN bus state transitions: * If the value of the Tx error counter or Rx error counter increments to a value greater than or equal to 128, the fault confinement state (FCS[1:0]) field in the error status register is updated to reflect an error passive state. * If the TouCAN is in an error passive state, and either the Tx error counter or Rx error counter decrements to a value less than or equal to 127 while the other error counter already satisfies this condition, the FCS[1:0] field in the error status register is updated to reflect an error active state. * If the value of the Tx error counter increases to a value greater than 255, the FCS[1:0] field in the error status register is updated to reflect a bus off state, and an interrupt may be issued. The value of the Tx error counter is reset to zero. * If the TouCAN is in the bus off state, the Tx error counter and an additional internal counter are cascaded to count 128 occurrences of 11 consecutive recessive bits on the bus. To do this, the Tx error counter is first reset to zero, and then the internal counter begins counting consecutive recessive bits. Each time the internal counter counts 11 consecutive recessive bits, the Tx error counter is incremented by one and the internal counter is reset to zero. When the Tx error counter reaches the value of 128, the FCS[1:0] field in the error status register is updated to be error active, and both error counters are reset to zero. Any time a dominant bit is detected following a stream of less than 11 consecutive recessive bits, the internal counter resets itself to zero but does not affect the Tx error counter value. * If only one node is operating in a system, the Tx error counter is incremented with each message it attempts to transmit, due to the resulting acknowledgment errors. However, acknowledgment errors never cause the TouCAN to change from the error passive state to the bus off state. * If the Rx error counter increments to a value greater than 127, it stops incrementing, even if more errors are detected while being a receiver. After the next successful message reception, the counter is reset to a value between 119 and 127, to enable a return to the error active state. The three basic states and the transition behavior of the CAN controller are shown in Figure 16-6. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-11 CAN 2.0B Controller Module (TX Error 127 AND RX Error 127) Error Passive Error Active Normal State (TX Error > 127 OR RX Error > 127) AND (TX Error < 255) 128 Occurences of 11 consecutive recessive bits, Tx Error and Rx Error are reset to 0. TX Error > 255 Bus Off Figure 16-6. CAN Controller State Diagram 16.3.5 Time Stamp The value of the free-running 16-bit timer is sampled at the beginning of the identifier field on the CAN bus. For a message being received, the time stamp is stored in the time stamp entry of the receive message buffer at the time the message is written into that buffer. For a message being transmitted, the time stamp entry is written into the transmit message buffer once the transmission has completed successfully. The free-running timer can optionally be reset upon the reception of a frame into message buffer 0. This feature allows network time synchronization to be performed. 16.4 TouCAN Operation The basic operation of the TouCAN can be divided into four areas: * Reset * Initialization of the module * Transmit message handling * Receive message handling Example sequences for performing each of these processes is given in the following paragraphs. 16.4.1 TouCAN Reset The TouCAN can be reset in two ways: * Hard reset of the module via SRESET. * Soft reset of the module, using the SOFTRST bit in the module configuration register MPC561/MPC563 Reference Manual, Rev. 1.2 16-12 Freescale Semiconductor CAN 2.0B Controller Module Following the negation of reset, the TouCAN is not synchronized with the CAN bus, and the HALT, FRZ, and FRZACK bits in the module configuration register are set. In this state, the TouCAN does not initiate frame transmissions or receive any frames from the CAN bus. The contents of the message buffers are not changed following reset. Any configuration change or initialization requires that the TouCAN be frozen by either the assertion of the HALT bit in the module configuration register or by reset. 16.4.2 TouCAN Initialization Initialization of the TouCAN includes the initial configuration of the message buffers and configuration of the CAN communication parameters following a reset, as well as any reconfiguration which may be required during operation. The following is a general initialization sequence for the TouCAN: 1. Initialize all operation modes a) Initialize the transmit and receive pin modes in CANCTRL0 b) Initialize the bit timing parameters PROPSEG, PSEGS1, PSEG2, and RJW in CANCTRL1 and CANCTRL2 c) Select the S-clock rate by programming the PRESDIV register d) Select the internal arbitration mode (LBUF bit in CANCTRL1) 2. Initialize message buffers a) The control/status word of all message buffers must be written either as an active or inactive message buffer. b) All other entries in each message buffer should be initialized as required 3. Initialize mask registers for acceptance mask as required 4. Initialize TouCAN interrupt handler a) Initialize the interrupt configuration register (CANICR) with a specific request level b) Set the required mask bits in the IMASK register (for all message buffer interrupts), in CANCTRL0 (for bus off and error interrupts), and in CANMCR for the WAKE interrupt 5. Negate the HALT bit in the module configuration register. At this point, the TouCAN attempts to synchronize with the CAN bus NOTE In both the transmit and receive processes, the first action in preparing a message buffer must be to deactivate the buffer by setting its code field to the proper value. This step is mandatory to ensure data coherency. 16.4.3 Transmit Process The transmit process includes preparation of a message buffer for transmission, as well as the internal steps performed by the TouCAN to decide which message to transmit. This involves loading the message and ID to be transmitted into a message buffer and then activating that buffer as an active transmit buffer. Once this is done, the TouCAN performs all additional steps necessary to transmit the message onto the CAN bus. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-13 CAN 2.0B Controller Module The user should prepare or change a message buffer for transmission by executing the following steps. 1. Write the control/status word to hold the transmit buffer inactive (code = 0b1000) 2. Write the ID_HIGH and ID_LOW words 3. Write the data bytes 4. Write the control/status word (active Tx code, Tx length) NOTE Steps 1 and 4 are mandatory to ensure data coherency. Once an active transmit code is written to a transmit message buffer, that buffer begins participating in an internal arbitration process as soon as the receiver senses that the CAN bus is free, or at the inter-frame space. If there are multiple messages awaiting transmission, this internal arbitration process selects the message buffer from which the next frame is transmitted. When this process is over and a message buffer is selected for transmission, the frame from that message buffer is transferred to the serial message buffer for transmission. The TouCAN transmits no more than eight data bytes, even if the transmit length contains a value greater than eight. At the end of a successful transmission, the value of the free-running timer (which was captured at the beginning of the identifier field on the CAN bus), is written into the time stamp field in the message buffer. The code field in the control/status word of the message buffer is updated and a status flag is set in the IFLAG register. 16.4.3.1 Transmit Message Buffer Deactivation Any write access to the control/status word of a transmit message buffer during the process of selecting a message buffer for transmission immediately deactivates that message buffer, removing it from the transmission process. If the transmit message buffer is deactivated while a message is being transferred from it to a serial message buffer, the message is not transmitted. If the transmit message buffer is deactivated after the message is transferred to the serial message buffer, the message is transmitted, but no interrupt is requested, and the transmit code is not updated. If a message buffer containing the lowest ID is deactivated while that message is undergoing the internal arbitration process to determine which message should be sent, then that message may not be transmitted. 16.4.3.2 Reception of Transmitted Frames The TouCAN receives a frame it has transmitted if an empty message buffer with a matching identifier exists. 16.4.4 Receive Process During the receive process, the following events occur: MPC561/MPC563 Reference Manual, Rev. 1.2 16-14 Freescale Semiconductor CAN 2.0B Controller Module * * * The user configures the message buffers for reception The TouCAN transfers received messages from the serial message buffers to the receive message buffers with matching IDs The user retrieves these messages The user should prepare or change a message buffer for frame reception by executing the following steps. 1. Write the control/status word to hold the receive buffer inactive (code = 0b0000) 2. Write the ID_HIGH and ID_LOW words 3. Write the control/status word to mark the receive message buffer as active and empty NOTE Steps 1 and 3 are mandatory for data coherency. Once these steps are performed, the message buffer functions as an active receive buffer and participates in the internal matching process, which takes place every time the TouCAN receives an error-free frame. In this process, all active receive buffers compare their ID value to the newly received one. If a match is detected, the following actions occur: 1. The frame is transferred to the first (lowest entry) matching receive message buffer 2. The value of the free-running timer (captured at the beginning of the identifier field on the CAN bus) is written into the time stamp field in the message buffer 3. The ID field, data field, and Rx length field are stored 4. The code field is updated 5. The status flag is set in the IFLAG register The user should read a received frame from its message buffer in the following order: 1. Control/status word (mandatory, as it activates the internal lock for this buffer) 2. ID (optional, since it is needed only if a mask was used) 3. Data field word(s) 4. Free-running timer (optional, as it releases the internal lock) If the free running timer is not read, that message buffer remains locked until the read process starts for another message buffer. Only a single message buffer is locked at a time. When a received message is read, the only mandatory read operation is that of the control/status word. This ensures data coherency. If the BUSY bit is set in the message buffer code, the CPU should defer accessing that buffer until this bit is negated. Refer to Table 16-2. NOTE The user should check the status of a message buffer by reading the status flag in the IFLAG register and not by reading the control/status word code field for that message buffer. This prevents the buffer from being locked inadvertently. Because the received identifier field is always stored in the matching receive message buffer, the contents of the identifier field in a receive message buffer may change if one or more of the ID bits are masked. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-15 CAN 2.0B Controller Module 16.4.4.1 Receive Message Buffer Deactivation Any write access to the control/status word of a receive message buffer during the process of selecting a message buffer for reception immediately deactivates that message buffer, removing it from the reception process. If a receive message buffer is deactivated while a message is being transferred into it, the transfer is halted and no interrupt is requested. If this occurs, that receive message buffer may contain mixed data from two different frames. The CPU should not write data into a receive message buffer. If this occurs while a message is being transferred from a serial message buffer, the control/status word will reflect a full or overrun condition, but no interrupt is requested. 16.4.4.2 Locking and Releasing Message Buffers The lock/release/busy mechanism is designed to guarantee data coherency during the receive process. The following examples demonstrate how the lock/release/busy mechanism affects TouCAN operation: 1. Reading a control/status word of a message buffer triggers a lock for that message buffer. A new received message frame which matches the message buffer cannot be written into this message buffer while it is locked. 2. To release a locked message buffer, the CPU either locks another message buffer by reading its control/status word or globally releases any locked message buffer by reading the free-running timer. 3. If a receive frame with a matching ID is received during the time the message buffer is locked, the receive frame is not immediately transferred into that message buffer, but remains in the serial message buffer. There is no indication when this occurs. 4. When a locked message buffer is released, if a frame with a matching identifier exists within the serial message buffer, then this frame is transferred to the matching message buffer. 5. If two or more receive frames with matching IDs are received while a message buffer with a matching ID is locked, the last received frame with that ID is kept within the serial message buffer, while all preceding ones are lost. There is no indication when this occurs. 6. If the control/status word of a receive message buffer is read while a frame is being transferred from a serial message buffer, the BUSY code is indicated. The user should wait until this code is cleared before continuing to read from the message buffer to ensure data coherency. In this situation, the read of the control/status word does not lock the message buffer. Polling the control/status word of a receive message buffer can lock it, preventing a message from being transferred into that buffer. If the control/status word of a receive message buffer is read, it should be followed by a read of the control/status word of another buffer, or by a read of the free-running timer, to ensure that the locked buffer is unlocked. MPC561/MPC563 Reference Manual, Rev. 1.2 16-16 Freescale Semiconductor CAN 2.0B Controller Module 16.4.5 Remote Frames The remote frame is a message frame that is transmitted to request a data frame. The TouCAN can be configured to transmit a data frame automatically in response to a remote frame, or to transmit a remote frame and then wait for the responding data frame to be received. To transmit a remote frame, a message buffer is initialized as a transmit message buffer with the RTR bit set to one. Once this remote frame is transmitted successfully, the transmit message buffer automatically becomes a receive message buffer, with the same ID as the remote frame that was transmitted. When the TouCAN receives a remote frame, it compares the remote frame ID to the IDs of all transmit message buffers programmed with a code of 1010. If there is an exact matching ID, the data frame in that message buffer is transmitted. If the RTR bit in the matching transmit message buffer is set, the TouCAN transmits a remote frame as a response. A received remote frame is not stored in a receive message buffer. It is only used to trigger the automatic transmission of a frame in response. The mask registers are not used in remote frame ID matching. All ID bits (except RTR) of the incoming received frame must match for the remote frame to trigger a response transmission. 16.4.6 Overload Frames The TouCAN does not initiate overload frame transmissions unless it detects the following conditions on the CAN bus: * A dominant bit is the first or second bit of intermission * A dominant bit is the seventh (last) bit of the end-of-frame (EOF) field in receive frames * A dominant bit is the eighth (last) bit of the error frame delimiter or overload frame delimiter 16.5 Special Operating Modes The TouCAN module has three special operating modes: * Debug mode * Low-power stop mode * Auto power save mode 16.5.1 Debug Mode Debug mode is entered when the FRZ1 bit in CANMCR is set and one of the following events occurs: * The HALT bit in the CANMCR is set; or * The IMB3 FREEZE line is asserted Once entry into debug mode is requested, the TouCAN waits until an intermission or idle condition exists on the CAN bus, or until the TouCAN enters the error passive or bus off state. Once one of these conditions exists, the TouCAN waits for the completion of all internal activity. Once this happens, the following events occur: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-17 CAN 2.0B Controller Module * * * * * The TouCAN stops transmitting or receiving frames The prescaler is disabled, thus halting all CAN bus communication The TouCAN ignores its Rx signals and drives its Tx signals as recessive The TouCAN loses synchronization with the CAN bus and the NOTRDY and FRZACK bits in CANMCR are set The CPU is allowed to read and write the error counter registers After engaging one of the mechanisms to place the TouCAN in debug mode, the FRZACK bit must be set before accessing any other registers in the TouCAN; otherwise unpredictable operation may occur. To exit debug mode, the IMB3 FREEZE line must be negated or the HALT bit in CANMCR must be cleared. Once debug mode is exited, the TouCAN resynchronizes with the CAN bus by waiting for 11 consecutive recessive bits before beginning to participate in CAN bus communication. 16.5.2 Low-Power Stop Mode Before entering low-power stop mode, the TouCAN waits for the CAN bus to be in an idle state, or for the third bit of intermission to be recessive. The TouCAN then waits for the completion of all internal activity (except in the CAN bus interface) to be complete. Then the following events occur: * The TouCAN shuts down its clocks, stopping most internal circuits, thus achieving maximum power savings * The bus interface unit continues to operate, allowing the CPU to access the module configuration register * The TouCAN ignores its Rx signals and drives its Tx signals as recessive * The TouCAN loses synchronization with the CAN bus, and the STOPACK and NOTRDY bits in the module configuration register are set To exit low-power stop mode: * Reset the TouCAN either by asserting one of the IMB3 reset lines or by asserting the SOFTRST bit CANMCR * Clear the STOP bit in CANMCR * The TouCAN module can optionally exit low-power stop mode via the self wake mechanism. If the SELFWAKE bit in CANMCR was set at the time the TouCAN entered stop mode, then upon detection of a recessive to dominant transition on the CAN bus, the TouCAN clears the STOP bit in CANMCR and its clocks begin running. When the TouCAN is in low-power stop mode, a recessive to dominant transition on the CAN bus causes the WAKEINT bit in the error and status register (ESTAT) to be set. This event generates an interrupt if the WAKEMSK bit in CANMCR is set. Consider the following notes regarding low-power stop mode: MPC561/MPC563 Reference Manual, Rev. 1.2 16-18 Freescale Semiconductor CAN 2.0B Controller Module * * * * * * * * * * When the self wake mechanism is activated, the TouCAN tries to receive the frame that woke it up. (It assumes that the dominant bit detected is a start-of-frame bit.) It will not arbitrate for the CAN bus at this time. If the STOP bit is set while the TouCAN is in the bus off state, then the TouCAN enters low-power stop mode and stops counting recessive bit times. The count continues when STOP is cleared. To place the TouCAN in low-power stop mode with the self wake mechanism engaged, write to CANMCR with both STOP and SELFWAKE set, and then wait for the TouCAN to set the STOPACK bit. To take the TouCAN out of low-power stop mode when the self wake mechanism is enabled, write to CANMCR with both STOP and SELFWAKE clear, and then wait for the TouCAN to clear the STOPACK bit. The SELFWAKE bit should not be set after the TouCAN has already entered low-power stop mode. If both STOP and SELFWAKE are set and a recessive to dominant edge immediately occurs on the CAN bus, the TouCAN may never set the STOPACK bit, and the STOP bit will be cleared. To prevent old frames from being sent when the TouCAN awakes from low-power stop mode via the self wake mechanism, disable all transmit sources, including transmit buffers configured for remote request responses, before placing the TouCAN in low-power stop mode. If the TouCAN is in debug mode when the STOP bit is set, the TouCAN assumes that debug mode should be exited. As a result, it tries to synchronize with the CAN bus, and only then does it await the conditions required for entry into low-power stop mode. Unlike other modules, the TouCAN does not come out of reset in low-power stop mode. The basic TouCAN initialization procedure should be executed before placing the module in low-power stop mode. (Refer to Section 16.4.2, "TouCAN Initialization.") If the TouCAN is in low-power stop mode with the self wake mechanism engaged and is operating with a single system clock per time quantum, there can be extreme cases in which the TouCAN would wake-up on a recessive to dominant edge which may not conform to the CAN protocol. TouCAN synchronization is shifted one time quantum from the wake-up event. This shift lasts until the next recessive-to-dominant edge, which resynchronizes the TouCAN to be in conformance with the CAN protocol. The same holds true when the TouCAN is in auto power save mode and awakens on a recessive to dominant edge. 16.5.3 Auto Power Save Mode Auto power save mode enables normal operation with optimized power savings. Once the auto power save (APS) bit in CANMCR is set, the TouCAN looks for a set of conditions in which there is no need for the clocks to be running. If these conditions are met, the TouCAN stops its clocks, thus saving power. The following conditions activate auto power save mode: * No Rx/Tx frame in progress * No transfer of Rx/Tx frames to and from a serial message buffer, and no Tx frame awaiting transmission in any message buffer * No CPU access to the TouCAN module MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-19 CAN 2.0B Controller Module * The TouCAN is not in debug mode, low-power stop mode, or the bus off state While its clocks are stopped, if the TouCAN senses that any one of the aforementioned conditions is no longer true, it restarts its clocks. The TouCAN then continues to monitor these conditions and stops or restarts its clocks accordingly. 16.6 Interrupts The TouCAN can generate one interrupt level to be passed to the CPU. This level is programmed into the priority level bits in the interrupt configuration register (CANICR). This value determines which interrupt signal is driven onto the bus when an interrupt is requested. Each one of the 16 message buffers can be an interrupt source, if its corresponding IMASK bit is set. There is no distinction between transmit and receive interrupts for a particular buffer. Each of the buffers is assigned a bit in the IFLAG register. An IFLAG bit is set when the corresponding buffer completes a successful transmission/reception. An IFLAG bit is cleared when the CPU reads IFLAG while the associated bit is set, and then writes it back as zero (and no new event of the same type occurs between the read and the write actions). The other three interrupt sources (bus off, error and wake up) act in the same way, and have flag bits located in the error and status register (ESTAT). The bus off and error interrupt mask bits (BOFFMSK and ERRMSK) are located in CANCTRL0, and the wake up interrupt mask bit (WAKEMSK) is located in the module configuration register. Refer to Section 16.7, "Programming Model," for more information on these registers. The TouCAN module is capable of generating one of the 32 possible interrupt levels on the IMB3. The 32 interrupt levels are time multiplexed on the IMB3 IRQ[0:7] lines. All interrupt sources place their asserted level on a time multiplexed bus during four different time slots, with eight levels communicated per slot. The ILBS[0:1] signals indicate which group of eight are being driven on the interrupt request lines. Table 16-9. Interrupt Levels ILBS[0:1] Levels 00 0:7 01 8:15 10 16:23 11 24:31 The level that the TouCAN will drive onto internal IRQ[7:0] signals is programmed in the three Interrupt Request Level (IRL) bits located in the interrupt configuration register. The two ILBS bits in the ICR register determine on which slot the TouCAN should drive its interrupt signal. Under the control of ILBS, each interrupt request level is driven during the time multiplexed bus during one of four different time slots, with eight levels communicated per time slot. No hardware priority is assigned to interrupts. Furthermore, if more than one source on a module requests an interrupt at the same level, the system software must assign a priority to each source requesting at that level. Figure 16-7 displays the interrupt levels on IRQ with ILBS. MPC561/MPC563 Reference Manual, Rev. 1.2 16-20 Freescale Semiconductor CAN 2.0B Controller Module IMB3 CLOCK ILBS [1:0] 00 IMB3 IRQ [7:0] 01 10 11 00 01 IRQ 7:0 IRQ 15:8 IRQ 23:16 IRQ 31:24 IRQ 7:0 10 11 Figure 16-7. Interrupt Levels on IRQ with ILBS 16.7 Programming Model Table 16-10 shows the TouCAN address map. The lowercase "x" appended to each register name represents "A", "B" or "C" for the TouCAN_A, TouCAN_B, or TouCAN_C module, respectively. Refer to Figure 1-4 to locate each TouCAN module in the MPC561/MPC563 address map. The column labeled "Access" indicates the privilege level at which the CPU must be operating to access the register. A designation of "S" indicates that supervisor mode is required. A designation of "S/U" indicates that the register can be programmed for either supervisor mode access or unrestricted access. The address space for each TouCAN module is split, with 128 bytes starting at the base address, and an extra 256 bytes starting at the base address +128. The upper 256 are fully used for the message buffer structures. Of the lower 128 bytes, some are not used. Registers with bits marked as "reserved" should always be written as logic 0. Typically, the TouCAN control registers are programmed during system initialization, before the TouCAN becomes synchronized with the CAN bus. The configuration registers can be changed after synchronization by halting the TouCAN module. This is done by setting the HALT bit in the TouCAN module configuration register (CANMCR). The TouCAN responds by asserting CANMCR[NOTRDY]. Additionally, the control registers can be modified while the MCU is in background debug mode. NOTE The TouCAN has no hard-wired protection against invalid bit/field programming within its registers. Specifically, no protection is provided if the programming does not meet CAN protocol requirements. Table 16-10. TouCAN Register Map Access Address MSB LSB 0 15 S 0x30 7080(A) 0x30 7480(B) 0x30 7880(C) TouCAN Module Configuration Register (CANMCR_x) See Table 16-11 for bit descriptions. S 0x30 7082(A) 0x30 7482(B) 0x30 7882(C) TouCAN Test Register (CANTCR_x) . MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-21 CAN 2.0B Controller Module Table 16-10. TouCAN Register Map (continued) Access MSB Address LSB 0 15 S 0x30 7084(A) 0x30 7484(B) 0x30 7884(C) TouCAN Interrupt Register (CANICR_x) See Table 16-12 for bit descriptions. S/U 0x30 7086(A) 0x30 7486(B) 0x30 7886(C) Control Register 0 (CANCTRL0_x) Control Register 1 (CANCTRL1_x) See Table 16-13 for bit descriptions. See Table 16-16 for bit descriptions. S/U 0x30 7088(A) 0x30 7488(B) 0x30 7888(C) Control and Prescaler Control Register 2 (CANCTRL2_x) Divider Register (PRESDIV_x) See Table 16-18 for bit descriptions. See Table 16-17 for bit descriptions. S/U 0x30 708A(A) 0x30 748A(B) 0x30 788A(C) Free-Running Timer Register (TIMER_x) See Table 16-19 for bit descriptions. -- 0x30 708C - 0x30 708E(A) 0x30 748C - 0x30 748E(B) 0x30 788C - 0x30 788E(C) Reserved S/U 0x30 7090(A) 0x30 7490(B) 0x30 7890(C) Receive Global Mask - High (RXGMSKHI_x) See Table 16-20 for bit descriptions. S/U 0x30 7092(A) 0x30 7492(B) 0x30 7892(C) Receive Global Mask - Low (RXGMSKLO_x) See Table 16-20 for bit descriptions. S/U 0x30 7094(A) 0x30 7494(B) 0x30 7894(C) Receive Buffer 14 Mask - High (RX14MSKHI_x) See Section 16.7.10, "Receive Buffer 14 Mask Registers (RX14MSKHI, RX14MSKLO)," for bit descriptions. S/U 0x30 7096(A) 0x30 7496(B) 0x30 7896(C) Receive Buffer 14 Mask - Low (RX14MSKLO_x) See Section 16.7.10, "Receive Buffer 14 Mask Registers (RX14MSKHI, RX14MSKLO)," for bit descriptions. S/U 0x30 7098(A) 0x30 7498(B) 0x30 7898(C) Receive Buffer 15 Mask - High (RX15MSKHI_x) See Section 16.7.11, "Receive Buffer 15 Mask Registers (RX15MSKHI, RX15MSKLO)," for bit descriptions. S/U 0x30 709A(A) 0x30 749A(B) 0x30 789A(C) Receive Buffer 15 Mask - Low (RX15MSKLO_x) See Section 16.7.11, "Receive Buffer 15 Mask Registers (RX15MSKHI, RX15MSKLO)," for bit descriptions. -- 0x30 709C - 0x30 709E(A) 0x30 749C- 0x30 749E(B) 0x30 789C - 0x30 789E(C) Reserved S/U 0x30 70A0(A) 0x30 74A0(B) 0x30 78A0(C) Error and Status Register (ESTAT_x) See Table 16-23 for bit descriptions. S/U 0x30 70A2(A) 0x30 74A2(B) 0x30 78A2(C) Interrupt Masks (IMASK_x) See Table 16-26 for bit descriptions. S/U 0x30 70A4(A) 0x30 74A4(B) 0x30 78A4(C) Interrupt Flags (IFLAG_x) See Table 16-27 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 16-22 Freescale Semiconductor CAN 2.0B Controller Module Table 16-10. TouCAN Register Map (continued) Access MSB Address LSB 0 15 S/U 0x30 70A6(A) 0x30 74A6(B) 0x30 78A6(C) Receive Error Counter (RXECTR_x) Transmit Error Counter (TXECTR_x) See Table 16-28 for bit descriptions. See Table 16-28 for bit descriptions S/U 0x30 7100 -- 0x30 710F(A) 0x30 7500 -- 0x30 750F(B) 0x30 7900 -- 0x30 790F(C) MBUFF01 TouCAN X Message Buffer 0. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7110 -- 0x30 711F(A) 0x30 7510 -- 0x30 751F(B) 0x30 7910 -- 0x30 791F(C) MBUFF1 1 TouCAN X Message Buffer 1. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7120 -- 0x30 712F(A) 0x30 7520 -- 0x30 752F(B) 0x30 7920 -- 0x30 792F(C) MBUFF2 1 TouCAN X Message Buffer 2. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7130 -- 0x30 713F(A) 0x30 7530 -- 0x30 753F(B) 0x30 7930 -- 0x30 793F(C) MBUFF3 1 TouCAN X Message Buffer 3. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7140 -- 0x30 714F(A) 0x30 7540 -- 0x30 754F(B) 0x30 7940 -- 0x30 794F(C) MBUFF4 1 TouCAN X Message Buffer 4. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7150 -- 0x30 715F(A) 0x30 7550 -- 0x30 755F(B) 0x30 7950 -- 0x30 795F(C) MBUFF5 1 TouCAN X Message Buffer 5. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7160 -- 0x30 716F(A) 0x30 7560 -- 0x30 756F(B) 0x30 7960 -- 0x30 796F(C) MBUFF6 1 TouCAN X Message Buffer 6. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x307170 -- 0x30717F(A) 0x30 7570 -- 0x30 757F(B) 0x30 7970 -- 0x30 797F(C) MBUFF7 1 TouCAN X Message Buffer 7. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7180 -- 0x30 718F(A) 0x30 7580 -- 0x30 758F(B) 0x30 7980 -- 0x30 798F(C) MBUFF8 1 TouCAN X Message Buffer 8. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 7190 -- 0x30 719F(A) 0x30 7590 -- 0x30 759F(B) 0x30 7990 -- 0x30 799F(C) MBUFF9 1 TouCAN X Message Buffer 9. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 71A0 -- 0x30 71AF(A) 0x30 75A0 -- 0x30 75AF(B) 0x30 79A0 -- 0x30 79AF(C) MBUFF10 1 TouCAN X Message Buffer 10. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 71B0 -- 0x30 71BF(A) 0x30 75B0 -- 0x30 75BF(B) 0x30 79B0 -- 0x30 79BF(C) MBUFF11 1 TouCAN X Message Buffer 11. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 71C0 -- 0x30 71CF(A) 0x30 75C0 -- 0x30 75CF(B) 0x30 79C0 -- 0x30 79CF(C) MBUFF12 1 TouCAN X Message Buffer 12. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 71D0 -- 0x30 71DF(A) 0x30 75D0 -- 0x30 75DF(B) 0x30 79D0 -- 0x30 79DF(C) MBUFF13 1 TouCAN X Message Buffer 13. See Figure 16-3 and Figure 16-4 for message buffer definitions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-23 CAN 2.0B Controller Module Table 16-10. TouCAN Register Map (continued) Access MSB Address LSB 0 1 15 S/U 0x30 71E0 -- 0x30 71EF(A) 0x30 75E0 -- 0x30 75EF(B) 0x30 79E0 -- 0x30 79EF(C) MBUFF14 1 TouCAN X Message Buffer 14. See Figure 16-3 and Figure 16-4 for message buffer definitions. S/U 0x30 71F0 -- 0x30 71FF(A) 0x30 75F0 -- 0x30 75FF(B) 0x30 79F0 -- 0x30 79FF(C) MBUFF15 1 TouCAN X Message Buffer 15. See Figure 16-3 and Figure 16-4 for message buffer definitions. The last word of each of the MBUFF arrays (address 0x....E) is reserved and may cause an RCPU exception if read. TouCAN_A, B, and C Addresses: 0x30 7100, 0x30 7500 , 0x30 7900 0x30 7102, 0x30 7502 , 0x30 7902 0x30 7104, 0x30 7504 , 0x30 7904 Control/Status ID High ID Low Message Buffer 0 0x30 7106, 0x30 7506 , 0x30 7906 8-byte Data Field 0x30 710D, 0x30 750D , 0x30 790D 0x30 710E, 0x30 750E, 0x30 790E Reserved 0x30 7110, 0x30 7510 , 0x30 7910 Message Buffers 1 - 15 , 0x30 79FF 0x30 71FF, 0x30 75FF TouCAN Message Buffer Map Figure 16-8. TouCAN Message Buffer Memory Map MPC561/MPC563 Reference Manual, Rev. 1.2 16-24 Freescale Semiconductor CAN 2.0B Controller Module 16.7.1 TouCAN Module Configuration Register (CANMCR) MSB LSB 0 1 2 Field STOP FRZ -- 3 4 5 6 7 8 9 HALT NOT WAKE SOFT FRZ SUPV SELF RDY MSK RST ACK WAKE 10 11 APS STOP ACK 12 13 14 15 -- 0101_1001_1000_0000 SRESET Addr 0x30 7080 (CANMCR_A); 0x30 7480 (CANMCR_B); 0x30 7880 (CANMCR_C) Figure 16-9. TouCAN Module Configuration Register (CANMCR) Table 16-11. CANMCR Bit Descriptions Bits Name Description 0 STOP Low-power stop mode enable. The STOP bit may only be set by the CPU. It may be cleared either by the CPU or by the TouCAN, if the SELFWAKE bit is set. Before asserting the STOP Mode, the CPU should disable all interrupts in the TOUCAN, otherwise it may be interrupted while in STOP mode upon a non wake-up condition. WAKE-INT can still be enabled by setting WAKEMSK. 0 Enable TouCAN clocks 1 Disable TouCAN clocks 1 FRZ FREEZE assertion response. When FRZ = 1, the TouCAN can enter debug mode when the IMB3 FREEZE line is asserted or the HALT bit is set. Clearing this bit field causes the TouCAN to exit debug mode. Refer to Section 16.5.1, "Debug Mode" for more information. 0 TouCAN ignores the IMB3 FREEZE signal and the HALT bit in the module configuration register. 1 TouCAN module enabled to enter debug mode. 2 -- 3 HALT Halt TouCAN S-Clock. Setting the HALT bit has the same effect as assertion of the IMB3 FREEZE signal on the TouCAN without requiring that FREEZE be asserted. This bit is set to one after reset. It should be cleared after initializing the message buffers and control registers. TouCAN message buffer receive and transmit functions are inactive until this bit is cleared. When HALT is set, write access to certain registers and bits that are normally read-only is allowed. 0 The TouCAN operates normally 1 TouCAN enters debug mode if FRZ = 1 4 NOTRDY TouCAN not ready. This bit indicates that the TouCAN is either in low-power stop mode or debug mode. This bit is read-only and is set only when the TouCAN enters low-power stop mode or debug mode. It is cleared once the TouCAN exits either mode, either by synchronization to the CAN bus or by the self wake mechanism. 0 TouCAN has exited low-power stop mode or debug mode. 1 TouCAN is in low-power stop mode or debug mode. 5 WAKEMSK Reserved Wakeup interrupt mask. The WAKEMSK bit enables wake-up interrupt requests. 0 Wake up interrupt is disabled 1 Wake up interrupt is enabled MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-25 CAN 2.0B Controller Module Table 16-11. CANMCR Bit Descriptions (continued) Bits Name Description 6 SOFTRST Soft reset. When this bit is asserted, the TouCAN resets its internal state machines (sequencer, error counters, error flags, and timer) and the host interface registers (CANMCR, CANICR, CANTCR, IMASK, and IFLAG). The configuration registers that control the interface with the CAN bus are not changed (CANCTRL[0:2] and PRESDIV). Message buffers and receive message masks are also not changed. This allows SOFTRST to be used as a debug feature while the system is running. Setting SOFTRST also clears the STOP bit in CANMCR. After setting SOFTRST, allow one complete bus cycle to elapse for the internal TouCAN circuitry to completely reset before executing another access to CANMCR. The TouCAN clears this bit once the internal reset cycle is completed. 0 Soft reset cycle completed 1 Soft reset cycle initiated 7 FRZACK TouCAN disable. When the TouCAN enters debug mode, it sets the FRZACK bit. This bit should be polled to determine if the TouCAN has entered debug mode. When debug mode is exited, this bit is negated once the TouCAN prescaler is enabled. This is a read-only bit. 0 The TouCAN has exited debug mode and the prescaler is enabled 1 The TouCAN has entered debug mode, and the prescaler is disabled 8 SUPV Supervisor/user data space. The SUPV bit places the TouCAN registers in either supervisor or user data space. 0 Registers with access controlled by the SUPV bit are accessible in either user or supervisor privilege mode 1 Registers with access controlled by the SUPV bit are restricted to supervisor mode 9 SELFWAKE Self wake enable. This bit allows the TouCAN to wake up when bus activity is detected after the STOP bit is set. If this bit is set when the TouCAN enters low-power stop mode, the TouCAN will monitor the bus for a recessive to dominant transition. If a recessive to dominant transition is detected, the TouCAN immediately clears the STOP bit and restarts its clocks. If a write to CANMCR with SELFWAKE set occurs at the same time a recessive-to-dominant edge appears on the CAN bus, the bit will not be set, and the module clocks will not stop. The user should verify that this bit has been set by reading CANMCR. Refer to Section 16.5.2, "Low-Power Stop Mode" for more information on entry into and exit from low-power stop mode. 0 Self wake disabled 1 Self wake enabled 10 APS Auto power save. The APS bit allows the TouCAN to automatically shut off its clocks to save power when it has no process to execute, and to automatically restart these clocks when it has a task to execute without any CPU intervention. 0 Auto power save mode disabled; clocks run normally 1 Auto power save mode enabled; clocks stop and restart as needed 11 STOPACK Stop acknowledge. When the TouCAN is placed in low-power stop mode and shuts down its clocks, it sets the STOPACK bit. This bit should be polled to determine if the TouCAN has entered low-power stop mode. When the TouCAN exits low-power stop mode, the STOPACK bit is cleared once the TouCAN's clocks are running. 0 The TouCAN is not in low-power stop mode and its clocks are running 1 The TouCAN has entered low-power stop mode and its clocks are stopped 12:15 -- Reserved. These bits are used for the IARB (interrupt arbitration ID) field in TouCAN implementations that use hardware interrupt arbitration. MPC561/MPC563 Reference Manual, Rev. 1.2 16-26 Freescale Semiconductor CAN 2.0B Controller Module 16.7.2 TouCAN Test Configuration Register CANTCR -- TouCAN Test Configuration Register0x30 7082, 0x30 7482, 0x30 7882 This register is used for factory test only. 16.7.3 TouCAN Interrupt Configuration Register (CANICR) MSB LSB 0 1 Field 2 3 4 5 -- 6 7 8 IRL SRESET 9 10 11 12 ILBS 14 15 -- 0000_0000_00 Addr 13 00_1111 0x30 7084 (CANICR_A); 0x30 7484 (CANICR_B); 0x30 7884 (CANICR_C) Figure 16-10. TouCAN Interrupt Configuration Register (CANICR) Table 16-12. CANICR Bit Descriptions Bits Name 0:4 -- Reserved 5:7 IRL Interrupt request level. When the TouCAN generates an interrupt request, this field determines which of the interrupt request signals is asserted. 8:9 ILBS 10:15 -- 16.7.4 Description Interrupt level byte select. This field selects one of four time-multiplexed slots during which the interrupt request is asserted. The ILBS and IRL fields together select one of 32 effective interrupt levels. 00 Levels 0 to7 01 Levels 8 to 15 10 Levels 16 to 23 11 Levels 24 to 31 Reserved Control Register 0 (CANCTRL0) MSB 0 LSB 1 2 Field BOFFMSK ERRMSK SRESET Addr 3 -- 4 5 RXMODE 6 7 8 TXMODE 9 10 11 12 13 14 15 CANCTRL1 0000_0000_0000_0000 0x30 7086 (CANCTRL0_A); 0x30 7486 (CANCTRL0_B); 0x30 7886 (CANCTRL0_C) Figure 16-11. Control Register 0 (CANCTRL0) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-27 CAN 2.0B Controller Module Table 16-13. CANCTRL0 Bit Descriptions Bits Name Description 0 BOFFMSK Bus off interrupt mask. The BOFF MASK bit provides a mask for the bus off interrupt. 0 Bus off interrupt disabled 1 Bus off interrupt enabled 1 ERRMSK Error interrupt mask. The ERRMSK bit provides a mask for the error interrupt. 0 Error interrupt disabled 1 Error interrupt enabled 2:3 -- 4:5 RXMODE Receive signal configuration control. These bits control the configuration of the CNRX0 signals. Refer to Table 16-14. 6:7 TXMODE Transmit signal configuration control. This bit field controls the configuration of the CNTX0 signals. Refer to Table 16-15. 8:15 CANCTRL1 Reserved See Table 16-16 and Section 16.7.5, "Control Register 1 (CANCTRL1)." Table 16-14. Rx MODE[1:0] Configuration Signal RX1 RX0 X 0 0 CNRX0 signal is interpreted as a dominant bit 1 CNRX0 signal is interpreted as a recessive bit X 1 0 CNRX0 signal is interpreted as a recessive bit 1 CNRX0 signal is interpreted as a dominant bit CNRX0 Receive Signal Configuration Table 16-15. Transmit Signal Configuration TXMODE[1:0] 1 2 16.7.5 TransmitSignal Configuration 00 Full CMOS1; positive polarity (CNTX0 = 0 is a dominant level) 01 Full CMOS1; negative polarity (CNTX0 = 1 is a dominant level) 1X Open drain2; positive polarity Full CMOS drive indicates that both dominant and recessive levels are driven by the chip. Open drain drive indicates that only a dominant level is driven by the chip. During a recessive level, the CNTX0 signal is disabled (three stated), and the electrical level is achieved by external pull-up/pull-down devices. The assertion of both Tx mode bits causes the polarity inversion to be cancelled (open drain mode forces the polarity to be positive). Control Register 1 (CANCTRL1) MSB 0 Field SRESET Addr LSB 1 2 3 4 CANCTRL0 5 6 7 8 9 SAMP -- 10 11 TSYNC LBUF 12 -- 13 14 15 PROPSEG 0000_0000_0000_0000 0x30 7086 (CANCTRL1_A); 0x30 7486 (CANCTRL1_B); 0x30 7886 (CANCTRL1_C) Figure 16-12. Control Register 1 (CANCTRL1) MPC561/MPC563 Reference Manual, Rev. 1.2 16-28 Freescale Semiconductor CAN 2.0B Controller Module Table 16-16. CANCTRL1 Bit Descriptions Bits Name 0:7 CANCTRL0 8 SAMP 9 -- 10 TSYNC 11 LBUF 12 -- 13:15 PROPSEG 16.7.6 Description See Table 16-13 Sampling mode. The SAMP bit determines whether the TouCAN module will sample each received bit one time or three times to determine its value. 0 One sample, taken at the end of phase buffer segment one, is used to determine the value of the received bit. 1 Three samples are used to determine the value of the received bit. The samples are taken at the normal sample point and at the two preceding periods of the S-clock. Reserved Timer synchronize mode. The TSYNC bit enables the mechanism that resets the free-running timer each time a message is received in message buffer zero. This feature provides the means to synchronize multiple TouCAN stations with a special "SYNC" message (global network time). 0 Timer synchronization disabled. 1 Timer synchronization enabled. Note: there can be a bit clock skew of four to five counts between different TouCAN modules that are using this feature on the same network. Lowest buffer transmitted first. The LBUF bit defines the transmit-first scheme. 0 Message buffer with lowest ID is transmitted first. 1 Lowest numbered buffer is transmitted first. Reserved Propagation segment time. PROPSEG defines the length of the propagation segment in the bit time. The valid programmed values are zero to seven. The propagation segment time is calculated as follows: Propagation Segment Time = (PROPSEG + 1) Time Quanta where 1 Time Quantum = 1 Serial Clock (S-Clock) Period Prescaler Divide Register (PRESDIV) MSB 0 Field SRESET Addr LSB 1 2 3 4 5 6 7 8 9 10 PRESDIV 11 12 13 14 15 CANCTRL2 0000_0000_0000_0000 0x30 7088 (PRESDIV_A); 0x30 7488 (PRESDIV_B); 0x30 7888 (PRESDIV_C) Figure 16-13. Prescaler Divide Register MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-29 CAN 2.0B Controller Module Table 16-17. PRESDIV Bit Descriptions Bits Name Description 0:7 PRESDIV Prescaler divide factor. PRESDIV determines the ratio between the system clock frequency and the serial clock (S-clock). The S-clock is determined by the following calculation: f SYS S-clock = -----------------------------------Eqn. 16-1 PRESDIV + 1 The reset value of PRESDIV is 0x00, which forces the S-clock to default to the same frequency as the system clock. The valid programmed values are 0 through 255. 8:15 16.7.7 CANCTRL2 See Table 16-18. Control Register 2 (CANCTRL2) MSB 0 LSB 1 Field 2 3 4 PRESDIV SRESET 5 6 7 8 9 10 RJW 11 PSEG1 12 13 14 15 PSEG2 0000_0000_0000_0000 Addr 0x30 7088 (CANCTRL2_A); 0x30 7488 (CANCTRL2_B); 0x30 7888 (CANCTRL2_C) Figure 16-14. Control Register 2 (CANCTRL2) Table 16-18. CANCTRL2 Bit Descriptions Bits Name Description 0:7 PRESDIV 8:9 RJW Resynchronization jump width. The RJW field defines the maximum number of time quanta a bit time may be changed during resynchronization. The valid programmed values are zero through three. The resynchronization jump width is calculated as follows: Resynchronizaton Jump Width = (RJW + 1) Time Quanta 10:12 PSEG1 PSEG1[2:0] -- Phase buffer segment 1. The PSEG1 field defines the length of phase buffer segment one in the bit time. The valid programmed values are zero through seven. The length of phase buffer segment 1 is calculated as follows: Phase Buffer Segment 1 = (PSEG1 + 1) Time Quanta 13:15 PSEG2 PSEG2 -- Phase Buffer Segment 2. The PSEG2 field defines the length of phase buffer segment two in the bit time. The valid programmed values are zero through seven. The length of phase buffer segment two is calculated as follows: Phase Buffer Segment 2 = (PSEG2 + 1) Time Quanta See Table 16-17. MPC561/MPC563 Reference Manual, Rev. 1.2 16-30 Freescale Semiconductor CAN 2.0B Controller Module 16.7.8 Free Running Timer (TIMER) MSB LSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 15 TIMER SRESET 0000_0000_0000_0000 Addr 0x30 708A (TIMER_A); 0x30 748A (TIMER_B); 0x30 788A (TIMER_C) Figure 16-15. Free Running Timer Register (TIMER) Table 16-19. TIMER Bit Descriptions Bits Name Description 0:15 TIMER The free running timer counter can be read and written by the CPU. The timer starts from zero after reset, counts linearly to 0xFFFF, and wraps around. The timer is clocked by the TouCAN bit-clock. During a message, it increments by one for each bit that is received or transmitted. When there is no message on the bus, it increments at the nominal bit rate. The timer value is captured at the beginning of the identifier field of any frame on the CAN bus. The captured value is written into the "time stamp" entry in a message buffer after a successful reception or transmission of a message. 16.7.9 Receive Global Mask Registers (RXGMSKHI, RXGMSKLO) MSB 0 1 2 3 4 5 6 7 8 9 10 Field MID MID MID MID MID MID MID MID MID MID MID 28 27 26 25 24 23 22 21 20 19 18 SRESET 1 Addr 1 1 1 1 1 1 1 1 1 1 11 12 0 1 0 1 13 14 15 MID MID MID 17 16 15 1 1 1 0x30 7090 (RxGMSKHI_A); 0x30 7490 (RxGMSKHI_B); 0x30 7890 (RxGMSKHI_C); 0x30 7092 (RxGMSKLO_A); 0x30 7492 (RxGMSKLO_B); 0x30 7892 (RxGMSKLO_C) LSB 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field MID MID MID MID MID MID MID MID MID MID MID MID MID MID MID 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SRESET 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 31 0 0 Figure 16-16. Receive Global Mask Register: High (RXGMSKHI), Low (RXGMSKLO) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-31 CAN 2.0B Controller Module Table 16-20. RXGMSKHI, RXGMSKLO Bit Descriptions Bits Name Description 0:31 MIDx The receive global mask registers use four bytes. The mask bits are applied to all receive-identifiers, excluding receive-buffers 14 and 15, which have their own specific mask registers. Base ID mask bits MID[28:18] are used to mask standard or extended format frames. Extended ID bits MID[17:0] are used to mask only extended format frames. The RTR/SRR bit of a received frame is never compared to the corresponding bit in the message buffer ID field. However, remote request frames (RTR = 1) once received, are never stored into the message buffers. RTR mask bit locations in the mask registers (bits 11 and 31) are always zero, regardless of any write to these bits. The IDE bit of a received frame is always compared to determine if the message contains a standard or extended identifier. Its location in the mask registers (bit 12) is always one, regardless of any write to this bit. 16.7.10 Receive Buffer 14 Mask Registers (RX14MSKHI, RX14MSKLO) The receive buffer 14 mask registers have the same structure as the receive global mask registers and are used to mask buffer 14. MSB 0 1 2 3 4 5 6 7 8 9 10 Field MID2 MID2 MID2 MID2 MID2 MID2 MID2 MID2 MID2 MID1 MID1 8 7 6 5 4 3 2 1 0 9 8 SRESET 1 Addr 1 1 1 1 1 1 1 1 1 1 11 12 0 1 0 1 13 14 15 MID MID MID 17 16 15 1 1 1 0x30 7094 (Rx14MSKHI_A); 0x30 7494 (Rx14MSKHI_B); 0x30 7894 (Rx14MSKHI_C); 0x30 7096 (Rx14MSKLO_A); 0x30 7496 (Rx14MSKLO_B); 0x30 7896 (Rx14MSKLO_C) LSB 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field MID1 MID1 MID1 MID1 MID1 MID9 MID8 MID7 MID6 MID5 MID4 MID3 MID2 MID MID 4 3 2 1 0 1 0 SRESET 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 31 0 0 Figure 16-17. Receive Buffer 14 Mask Registers: High (RX14MSKHI), Low (RX14MSKLO) Table 16-21. RX14MSKHI, RX14MSKLO Field Descriptions Bits Name Description 0:31 MIDx The receive buffer 14 mask registers use 4 bytes. Base ID mask bits MID[28:18] are used to mask standard or extended format frames. Extended ID bits MID[17:0] are used to mask only extended format frames. The RTR/SRR bit of a received frame is never compared to the corresponding bit in the message buffer ID field. However, remote request frames (RTR = 1) once received, are never stored into the message buffers. RTR mask bit locations in the mask registers (bits 11 and 31) are always zero, regardless of any write to these bits. The IDE bit of a received frame is always compared to determine if the message contains a standard or extended identifier. Its location in the mask registers (bit 12) is always one, regardless of any write to this bit. MPC561/MPC563 Reference Manual, Rev. 1.2 16-32 Freescale Semiconductor CAN 2.0B Controller Module 16.7.11 Receive Buffer 15 Mask Registers (RX15MSKHI, RX15MSKLO) The receive buffer 15 mask registers have the same structure as the receive global mask registers and are used to mask buffer 15. MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 0 1 Field MID MID MID MID MID MID MID MID MID MID MID 28 27 26 25 24 23 22 21 20 19 18 1 SRESET Addr 1 1 1 1 1 1 1 1 1 1 13 14 15 MID MID MID 17 16 15 1 1 1 0x30 7098 (Rx15MSKHI_A); 0x30 7498 (Rx15MSKHI_B); 0x30 7898 (Rx14MSKHI_C); 0x30 709A (Rx14MSKLO_A); 0x30 749A (Rx14MSKLO_B); 0x30 789A (Rx14MSKLO_C) LSB 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Field MID MID MID MID MID MID MID MID MID MID MID MID MID MID MID 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 SRESET 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 Figure 16-18. Receive Buffer 15 Mask Registers: High (RX15MSKHI), Low (RX15MSKLO) Table 16-22. RX15MSKHI, RX15MSKLO Field Descriptions Bits Name Description 0:31 MIDx The receive buffer 14 mask registers use 4 bytes. Base ID mask bits MID[28:18] are used to mask standard or extended format frames. Extended ID bits MID[17:0] are used to mask only extended format frames. The RTR/SRR bit of a received frame is never compared to the corresponding bit in the message buffer ID field. However, remote request frames (RTR = 1) once received, are never stored into the message buffers. RTR mask bit locations in the mask registers (bits 11 and 31) are always zero, regardless of any write to these bits. The IDE bit of a received frame is always compared to determine if the message contains a standard or extended identifier. Its location in the mask registers (bit 12) is always one, regardless of any write to this bit. 16.7.12 Error and Status Register (ESTAT) MSB 0 Field LSB 1 BIT ERR 2 3 4 5 6 7 8 9 10 ACK CRC FORM STUFF TX RX IDLE TX/RX ERR ERR ERR ERR WARN WARN SRESET Addr 11 FCS 12 -- 13 14 15 BOFF ERR WAKE INT INT INT 0000_0000_0000_0000 0x30 70A0 (ESTAT_A); 0x30 74A0 (ESTAT_B); 0x30 78A0 (ESTAT_C) Figure 16-19. Error and Status Register (ESTAT) This register reflects various error conditions, general status, and has the enable bits for three of the TouCAN interrupt sources. The reported error conditions are those which have occurred since the last time the register was read. A read clears these bits to zero. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-33 CAN 2.0B Controller Module Table 16-23. ESTAT Bit Descriptions Bits Name Description 0:1 BITERR Transmit bit error. The BITERR[1:0] field is used to indicate when a transmit bit error occurs. Refer to Table 16-24. NOTE: The transmit bit error field is not modified during the arbitration field or the ACK slot bit time of a message, or by a transmitter that detects dominant bits while sending a passive error frame. 2 ACKERR Acknowledge error. The ACKERR bit indicates whether an acknowledgment has been correctly received for a transmitted message. 0 No ACK error was detected since the last read of this register 1 An ACK error was detected since the last read of this register 3 CRCERR Cyclic redundancy check error. The CRCERR bit indicates whether or not the CRC of the last transmitted or received message was valid. 0 No CRC error was detected since the last read of this register 1 A CRC error was detected since the last read of this register 4 FORMERR Message format error. The FORMERR bit indicates whether or not the message format of the last transmitted or received message was correct. 0 No format error was detected since the last read of this register 1 A format error was detected since the last read of this register 5 STUFFERR Bit stuff error. The STUFFERR bit indicates whether or not the bit stuffing that occurred in the last transmitted or received message was correct. 0 No bit stuffing error was detected since the last read of this register 1 A bit stuffing error was detected since the last read of this register 6 TXWARN Transmit error status flag. The TXWARN status flag reflects the status of the TouCAN transmit error counter. 0 Transmit error counter < 96 1 Transmit error counter 96 7 RXWARN Receiver error status flag. The RXWARN status flag reflects the status of the TouCAN receive error counter. 0 Receive error counter < 96 1 Receive error counter 96 8 IDLE 9 TX/RX Transmit/receive status. The TX/RX bit indicates when the TouCAN module is transmitting or receiving a message. TX/RX has no meaning when IDLE = 1. 0 The TouCAN is receiving a message if IDLE = 0 1 The TouCAN is transmitting a message if IDLE = 0 10:11 FCS Fault confinement state. The FCS[1:0] field describes the state of the TouCAN. Refer to Table 16-25. If the SOFTRST bit in CANMCR is asserted while the TouCAN is in the bus off state, the error and status register is reset, including FCS[1:0]. However, as soon as the TouCAN exits reset, FCS[1:0] bits will again reflect the bus off state. Refer to Section 16.3.4, "Error Counters" for more information on entry into and exit from the various fault confinement states. 12 -- Idle status. The IDLE bit indicates when there is activity on the CAN bus. 0 The CAN bus is not idle 1 The CAN bus is idle Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 16-34 Freescale Semiconductor CAN 2.0B Controller Module Table 16-23. ESTAT Bit Descriptions (continued) Bits Name Description 13 BOFFINT Bus off interrupt. The BOFFINT bit is used to request an interrupt when the TouCAN enters the bus off state. 0 No bus off interrupt requested 1 When the TouCAN state changes to bus off, this bit is set, and if the BOFFMSK bit in CANCTRL0 is set, an interrupt request is generated. This interrupt is not requested after reset. 14 ERRINT Error Interrupt. The ERRINT bit is used to request an interrupt when the TouCAN detects a transmit or receive error. 0 No error interrupt request 1 If an event which causes one of the error bits in the error and status register to be set occurs, the error interrupt bit is set. If the ERRMSK bit in CANCTRL0 is set, an interrupt request is generated. To clear this bit, first read it as a one, then write as a zero. Writing a one has no effect. 15 WAKEINT Wake interrupt. The WAKEINT bit indicates that bus activity has been detected while the TouCAN module is in low-power stop mode. 0 No wake interrupt requested 1 When the TouCAN is in low-power stop mode and a recessive to dominant transition is detected on the CAN bus, this bit is set. If the WAKEMSK bit is set in CANMCR, an interrupt request is generated. Table 16-24. Transmit Bit Error Status BITERR[1:0] 00 Bit Error Status No transmit bit error 01 At least one bit sent as dominant was received as recessive 10 At least one bit sent as recessive was received as dominant 11 Not used Table 16-25. Fault Confinement State Encoding FCS[1:0] Bus State 00 Error active 01 Error passive 1X Bus off 16.7.13 Interrupt Mask Register (IMASK) MSB 0 LSB 1 Field SRESET Addr 2 3 4 5 6 7 8 9 10 IMASKH 11 12 13 14 15 IMASKL 0000_0000_0000_0000 0x30 70A2 (IMASK_A); 0x30 74A2 (IMASK_B); 0x30 78A2 (IMASK_C) Figure 16-20. Interrupt Mask Register (IMASK) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-35 CAN 2.0B Controller Module Table 16-26. IMASK Bit Descriptions Bits Name Description 0:7, 8:15 IMASKH, IMASKL IMASK contains two 8-bit fields, IMASKH and IMASKL. IMASK can be accessed with a 16-bit read or write, and IMASKH and IMASKL can be accessed with byte reads or writes. IMASK contains one interrupt mask bit per buffer. It allows the CPU to designate which buffers will generate interrupts after successful transmission/reception. Setting a bit in IMASK enables interrupt requests for the corresponding message buffer. 16.7.14 Interrupt Flag Register (IFLAG) MSB 0 LSB 1 2 Field 3 4 5 6 7 8 9 10 IFLAGH 11 12 13 14 15 IFLAGL SRESET 0000_0000_0000_0000 Addr 0x30 70A4 (IFLAG_A); 0x30 74A4 (IFLAG_B); 0x30 78A4 (IFLAG_C) Figure 16-21. Interrupt Flag Register (IFLAG) Table 16-27. IFLAG Bit Descriptions Bits Name Description 0:7, 8:15 IFLAGH, IFLAGL IFLAG contains two 8-bit fields, IFLAGH and IFLAGL. IFLAG can be accessed with a 16-bit read or write, and IFLAGH and IFLAGL can be accessed with byte reads or writes. IFLAG contains one interrupt flag bit per buffer. Each successful transmission/reception sets the corresponding IFLAG bit and, if the corresponding IMASK bit is set, an interrupt request will be generated. To clear an interrupt flag, first read the flag as a one, and then write it as a zero. Should a new flag setting event occur between the time that the CPU reads the flag as a one and writes the flag as a zero, the flag is not cleared. This register can be written to zeros only. 16.7.15 Error Counters (RXECTR, TXECTR) MSB 0 LSB 1 2 Field 4 5 6 7 8 9 10 RXECTR SRESET Addr 3 11 12 13 14 15 TXECTR 0000_0000_0000_0000 0x30 70A6 (RxECTR_A/TxECTR_A); 0x30 74A6 (RxECTR_B/TxECTR_B); 0x30 78A6 (TxECTR_C/TxECTR_C) Figure 16-22. Receive Error Counter (RXECTR), Transmit Error Counter (TXECTR) Table 16-28. RXECTR, TXECTR Bit Descriptions Bits Name 0:7, 8:15 RXECTR, TXECTR Description Both counters are read only, except when the TouCAN is in test or debug mode. MPC561/MPC563 Reference Manual, Rev. 1.2 16-36 Freescale Semiconductor CAN 2.0B Controller Module MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 16-37 CAN 2.0B Controller Module MPC561/MPC563 Reference Manual, Rev. 1.2 16-38 Freescale Semiconductor Chapter 17 Modular Input/Output Subsystem (MIOS14) The modular I/O system (MIOS) consists of a library of flexible I/O and timer functions including I/O port, counters, input capture, output compare, pulse and period measurement, and PWM. Because the MIOS14 is composed of submodules, it is easily configurable for different kinds of applications. The MIOS14 is composed of the following submodules: * One MIOS14 bus interface submodule (MBISM) * One MIOS14 counter prescaler submodule (MCPSM) * Six MIOS14 modulus counter submodules (MMCSM) * 10 MIOS14 double action submodules (MDASM) * 12 MIOS14 pulse-width modulation submodules (MPWMSM) * One MIOS14 16-bit parallel port I/O submodule (MPIOSM) * Two interrupt request submodules (MIRSM) 17.1 Block Diagram Figure 17-1 is a block diagram of the MIOS14. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-1 Modular Input/Output Subsystem (MIOS14) Channel and I/O Signals: MDA12 MDA11 MDA31 MDA30 PWM17 PWM16 MDA14 MDA13 MDA28 MDA27 PWM19 PWM18 Channel and I/O Signals: CB7 CB6 CB24 CB23 CB22 CB8 16-Bit Counter Bus Set MDASM 11 Double Action MDA11 MDASM12 Double Action MDA12 MDASM13 Double Action MDA13 MDASM14 Double Action MDA14 L MMCSM8 C Modulus Counter MDASM15 Double Action MDA15 L MMCSM22 C Modulus Counter MDASM 27 Double Action MDA27 MDASM28 Double Action MDA28 MDASM29 Double Action MDA29 MDASM30 Double Action MDA30 MDASM31 Double Action MDA31 PWMSM0 PWM MPWM0 L MMCSM6 C Modulus Counter L MMCSM7 C Modulus Counter L MMCSM23 C Modulus Counter L MMCSM24 C Modulus Counter 6xPWMSM Modular I/O Bus (MIOB) (To all submodules) Bus Interface Unit Submodule IMB3 Bus PWMSM5 PWM MPWM5 MPWMSM16 PWM MPWM16 6xPWMSM MIRSM0/1 Interrupt Submodules MCPSM Counter Prescaler PWMSM21 PWM MPWM21 MPIO32B0 MPIOSM32 MPIO32B15 Figure 17-1. MPC561/MPC563 MIOS14 Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 17-2 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) 17.2 MIOS14 Key Features The basic features of the MIOS14 are as follows: * Modular architecture at the silicon implementation level * Disable capability in each submodule to allow power saving when its function is not needed * Six 16-bit counter buses to allow action submodules to use counter data * When not used for timing functions, every channel signal can be used as a port signal: I/O, output only or input only, depending on the channel function. * Submodules' signal status bits reflect the status of the signal * MIOS14 counter prescaler submodule (MCPSM): -- Centralized counter clock generator -- Programmable 4-bit modulus down-counter -- Wide range of possible division ratios: 2 through 16 -- Count inhibit under software control * MIOS14 modulus counter submodule (MMCSM): -- Programmable 16-bit modulus up-counter with built-in programmable 8-bit prescaler clocked by MCPSM output. -- Maximum increment frequency of the counter: - Clocked by the internal MCPSM output: fSYS / 2 - Clocked by the external signal: fSYS / 4 -- Flag setting and possible interrupt generation on overflow of the up-counter -- Time counter on internal clock with interrupt capability after a pre-determined time -- Optional signal usable as an external event counter (pulse accumulator) with overflow and interrupt capability after a pre-determined number of external events. -- Usable as a regular free-running up-counter -- Capable of driving a dedicated 16-bit counter bus to provide timing information to action submodules (the value driven is the contents of the 16-bit up-counter register) -- Optional signal to externally force a load to the counter with modulus value * MIOS14 double action submodule (MDASM): -- Versatile 16-bit dual action unit allowing two events to occur before software intervention is required -- Six software selectable modes allowing the MDASM to perform pulse width and period measurements, PWM generation, single input capture and output compare operations as well as port functions -- Software selection of one of the six possible 16-bit counter buses used for timing operations -- Flag setting and possible interrupt generation after MDASM action completion -- Software selection of output pulse polarity -- Software selection of totem-pole or open-drain output -- Software readable output signal status MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-3 Modular Input/Output Subsystem (MIOS14) * * -- Possible use of signal as I/O port when MDASM function is not needed MIOS14 pulse width modulation submodule (MPWMSM): -- Output pulse width modulated (PWM) signal generation with no software involvement -- Built-in 8-bit programmable prescaler clocked by the MCPSM -- PWM period and pulse width values provided by software: - Double-buffered for glitch-free period and pulse width changes - Two-cycle minimum output period/pulse-width increment (50 ns @ 40 MHz) - 50% duty-cycle output maximum frequency: 10 MHz - Up to 16 bits output pulse width resolution - Wide range of periods: * 16 bits of resolution: period range from 3.27 ms (with 50-ns steps) to 6.71 s (with 102.4 s steps) * Eight bits of resolution: period range from 12.8 s (with 50-ns steps) to 26.2 ms (with 102.4-s steps) - Wide range of frequencies: * Maximum output frequency at fSYS = 40 MHz with 16 bits of resolution and divide-by-2 prescaler selection: 305 Hz (3.27 ms) * Minimum output frequency at fSYS = 40 MHz with 16 bits of resolution and divide-by-4096 prescaler selection: 0.15 Hz (6.7 s) * Maximum output frequency at fSYS = 40 MHz with eight bits of resolution and divide-by-2 prescaler selection: 78125 Hz (12.8 s) * Minimum output frequency at fSYS = 40 MHz with 8 bits of resolution and divide-by-4096 prescaler selection: 38.14 Hz (8.2 ms) -- Programmable duty cycle from 0% to 100% -- Possible interrupt generation after every period -- Software selectable output pulse polarity -- Software readable output signal status -- Possible use of signal as I/O port when PWM function is not needed MIOS14 16-bit parallel port I/O submodule (MPIOSM): -- Up to 16 parallel I/O signals per MPIOSM -- Uses four 16-bit registers in the address space, one for data and one for direction and two reserved -- Simple data direction register (DDR) concept for selection of signal direction 17.2.1 Submodule Numbering, Naming, and Addressing A block is a group of four 16-bit registers. Each of the blocks within the MIOS14 addressing range is assigned a block number. The first block is located at the base address of the MIOS14. The blocks are numbered sequentially starting from 0. MPC561/MPC563 Reference Manual, Rev. 1.2 17-4 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Every submodule instantiation is also assigned a number. The number of a given submodule is the block number of the first block of this submodule. A submodule is assigned a name made of its acronym followed by its submodule number. For example, if submodule number 18 were an MPWMSM, it would be named MPWMSM18. This numbering convention does not apply to the MBISM, the MCPSM, and the MIRSMs. The MBISM and the MCPSM are unique in the MIOS14 and do not need a number. The MIRSMs are numbered incrementally starting from zero. The MIOS14 base address is defined at the chip level and is referred to as the "MIOS14 base address." The MIOS14 addressable range is four Kbytes. The base address of a given implemented submodule within the MIOS14 is the sum of the base address of the MIOS14 and the submodule number multiplied by eight. Refer to Table 17-1. This does not apply to the MBISM, the MCPSM and the MIRSMs. For these submodules, refer to the MIOS14 memory map in Figure 17-2. 17.2.2 Signal Naming Convention In Figure 17-2, MDASM signals have a prefix MDA, MPWMSM signals have a prefix of MPWM and the port signals have a prefix of MPIO. The modulus counter clock and load signals are multiplexed with MDASM signals. The MIOS14 input and output signal names are composed of five fields according to the following convention: * "M" * * * (optional) * (optional) The signal prefix and suffix for the different MIOS14 submodules are as follows: * MMCSM: -- submodule short_prefix: "MC" -- signal attribute suffix: C for the clock signal -- signal attribute suffix: L for the load signal -- For example, an MMCSM placed as submodule number n would have its corresponding input clock pin named MMCnC and its input load pin named MMCnL. MMC6C is input on MDA11 and MMC22C is input on MDA13. The MMC6L is input on MDA12 and MMC22C is input on MDA14. * MDASM: -- submodule short_prefix: "DA" -- signal attribute suffix: none MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-5 Modular Input/Output Subsystem (MIOS14) * * -- For example a MDASM placed as submodule number n would have its corresponding channel I/O signal named MDAn MPWMSM: -- submodule short_prefix: "PWM" -- signal attribute suffix: none -- For example a MPWMSM placed as submodule number n would have its corresponding channel I/O signal named MPWMn MPIOSM: -- submodule short_prefix: "PIO" -- signal attribute suffix: B -- For example a MPIOSM placed as submodule number n would have its corresponding I/O signals named MPIOnB0 to MPIOnB15 for bit-0 to bit-15, respectively. In the MIOS14, some signals are multiplexed between submodules using the same signal names for the inputs and outputs which are connected as shown in Table 17-1. 17.3 MIOS14 Configuration The complete MIOS14 submodule and signal configuration is shown in Table 17-1. Table 17-1. MIOS14 Configuration Description Connected to: CBA CBB CBC CBD Output Signal Name Alternate Signal Name PWM, I/O MPWM0 MPWM0 MDI1 0x30 6008 PWM, I/O MPWM1 MPWM1 MDO2 2 0x30 6010 PWM, I/O MPWM2 MPWM2 PPM_TX1 0 3 0x30 6018 PWM, I/O MPWM3 MPWM3 PPM_RX1 4 0 4 0x30 6020 PWM, I/O MPWM4 MPWM4 MDO6/ MPIO32B6 PWMSM 5 0 5 0x30 6028 PWM, I/O MPWM5 MPWM5 MPIO32B7 MMCSM 6 0 6 0x30 6030 MIRS M No. MIRSM Bit Position Base Address Offset 0 0 0 0x30 6000 PWMSM 1 0 1 PWMSM 2 0 PWMSM 3 PWMSM SubModule Type Bloc k No. PWMSM MMCSM 7 BSL0= 0 BSL1= 0 BSL0= BSL0= 1 BSL0=0 1 BSL1= BSL1=1 BSL1= 1 0 CB6 CB7 0 7 0x30 6038 Signal Function Input Signal Name Clock In MDA11 Load In MDA12 Clock In MDA30 MPC561/MPC563 Reference Manual, Rev. 1.2 17-6 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-1. MIOS14 Configuration Description (continued) Connected to: SubModule Type MMCSM Bloc k No. CBA BSL0= 0 BSL1= 0 CBB CBC CBD BSL0= BSL0= 1 BSL0=0 1 BSL1= BSL1=1 BSL1= 1 0 8 CB8 MIRS M No. 0 MIRSM Bit Position 8 Base Address Offset 0x30 6040 Signal Function Input Signal Name Load In MDA31 Clock In MPWM 16 Load In MPWM 17 Output Signal Name Alternate Signal Name MDO3 Reserve d 9-10 MDASM 11 CB6 CB22 CB7 CB8 0 11 0x30 6058 Channel I/O MDA11 MDA11 MDASM 12 CB6 CB22 CB7 CB8 0 12 0x30 6060 Channel I/O MDA12 MDA12 MDASM 13 CB6 CB22 CB23 CB24 0 13 0x30 6068 Channel I/O MDA13 MDA13 MDASM 14 CB6 CB22 CB23 CB24 0 14 0x30 6070 Channel I/O MDA14 MDA14 MDASM 15 CB6 CB22 CB23 CB24 0 15 0x30 6078 Channel I/O MDA15 MDA15 PWMSM 16 1 0 0x30 6080 PWM, I/O MPWM 16 MPWM 16 PWMSM 17 1 1 0x30 6088 PWM, I/O MPWM 17 MPWM 17 MDO3 PWMSM 18 1 2 0x30 6090 PWM, I/O MPWM 18 MPWM 18 MDO6 PWMSM 19 1 3 0x30 6098 PWM, I/O MPWM 19 MPWM 19 MDO7 PWMSM 20 1 4 0x30 60A0 PWM, I/O MPWM 20 MPWM 20 MPIO32B8 PWMSM 21 1 5 0x30 60A8 PWM, I/O MPWM 21 MPWM 21 MPIO32B9 MMCSM 22 1 6 0x30 60B0 Clock In MDA13 Load In MDA14 Clock In MDA27 Load In MDA28 Clock In MPWM 18 MMCSM MMCSM 23 24 CB22 CB23 1 CB24 1 7 8 0x30 60B8 0x30 60C0 MDO6 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-7 Modular Input/Output Subsystem (MIOS14) Table 17-1. MIOS14 Configuration Description (continued) Connected to: SubModule Type Bloc k No. CBA BSL0= 0 BSL1= 0 CBB CBC CBD BSL0= BSL0= 1 BSL0=0 1 BSL1= BSL1=1 BSL1= 1 0 MIRS M No. MIRSM Bit Position Base Address Offset Signal Function Input Signal Name Load In MPWM 19 Output Signal Name Alternate Signal Name MDO7 Reserve d 25-2 6 MDASM 27 CB6 CB22 CB23 CB24 1 11 0x30 60D8 Channel I/O MDA27 MDA27 MDASM 28 CB6 CB22 CB23 CB24 1 12 0x30 60E0 Channel I/O MDA28 MDA28 MDASM 29 CB6 CB22 CB7 CB8 1 13 0x30 60E8 Channel I/O MDA29 MDA29 MDASM 30 CB6 CB22 CB7 CB8 1 14 0x30 60F0 Channel I/O MDA30 MDA30 MDASM 31 CB6 CB22 CB7 CB8 1 15 0x30 60F8 Channel I/O MDA31 MDA31 MPIOS M 32 0x30 6100 GPIO MPIO32 B0 MPIO32 B0 VF0 /MDO1 GPIO MPIO32 B1 MPIO32 B1 VF1 /MCKO GPIO MPIO32 B2 MPIO32 B2 VF2 /MSEI GPIO MPIO32 B3 MPIO32 B3 VFLS0 /MSEO GPIO MPIO32 B4 MPIO32 B4 VFLS1 GPIO MPIO32 B5 MPIO32 B5 MDO5 GPIO MPIO32 B6 MPIO32 B6 MPWM4/ MDO6 GPIO MPIO32 B7 MPIO32 B7 MPWM5 GPIO MPIO32 B8 MPIO32 B8 MPWM20 GPIO MPIO32 B9 MPIO32 B9 MPWM21 GPIO MPIO32 B10 MPIO32 B10 PPM_ TSYNC GPIO MPIO32 B11 MPIO32 B11 C_CNRX0 MPC561/MPC563 Reference Manual, Rev. 1.2 17-8 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-1. MIOS14 Configuration Description (continued) Connected to: SubModule Type Bloc k No. CBA BSL0= 0 BSL1= 0 CBB CBC CBD BSL0= BSL0= 1 BSL0=0 1 BSL1= BSL1=1 BSL1= 1 0 MIRS M No. MIRSM Bit Position Base Address Offset Reserve d 33255 MBISM 256 Reserve d 257 MCPSM 258 Reserve d 259383 MIRSM0 384391 0x30 6C00 MIRSM1 392399 0x30 6C40 Reserve d 400511 17.3.1 Input Signal Name Output Signal Name Alternate Signal Name GPIO MPIO32 B12 MPIO32 B12 C_CNTX0 GPIO MPIO32 B13 MPIO32 B13 PPM_TCL K GPIO MPIO32 B14 MPIO32 B14 PPM_RX0 GPIO MPIO32 B15 MPIO32 B15 PPM_TX0 Signal Function 0x30 6800 0x30 6810 MIOS14 Signals The MIOS14 requires 34 signals: 10 MDASM signals, 8 dedicated MPWMSM signals, 12 dedicated MPIOSM signals and 4 signals are shared between the MPWMSM and MPIOSM. The required signal function on shared signals is chosen using the PDMCR2 register in the USIU. The usage of all MIOS14 signals is shown in the block diagram of Figure 17-1 and in the configuration description of Table 17-1. 17.3.2 MIOS14 Bus System The internal bus system within the MIOS14 is called the modular I/O bus (MIOB). The MIOB makes communications possible between any submodule and the IMB3 bus master through the MBISM. The MIOB is divided into three dedicated buses: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-9 Modular Input/Output Subsystem (MIOS14) * * * The read/write and control bus The request bus The counter bus set 17.3.3 Read/Write and Control Bus The read/write and control bus (RWCB) allows read and write data transfers to and from any I/O submodule through the MBISM. It includes signals for data and addresses as well as control signals. The control signals allow 16-bit simple synchronous single master accesses and supports fast or slow master accesses. 17.3.4 Request Bus The request bus (RQB) provides interrupt request signals along with I/O submodule identification and priority information to the MBISM. NOTE Some submodules do not generate interrupts and are therefore independent of the RQB. 17.3.5 Counter Bus Set The 16-bit counter bus set (CBS) is a set of six 16-bit counter buses. The CBS makes it possible to transfer information between submodules. Typically, counter submodules drive the CBS, while action submodules process the data on these buses. Note, however, that some submodules are self-contained and therefore independent of the counter bus set. 17.4 MIOS14 Programming Model The address space of the MIOS14 consist of 4 Kbytes starting at the base address of the module (0x306000). The overall address map organization is shown in Figure 17-2. All MIOS14 unimplemented locations within the addressable range, return a logic 0 when accessed. In addition, the internal TEA (transfer error acknowledge) signal is asserted. All unused bits within MIOS14 registers return a 0 when accessed. 17.4.1 Bus Error Support A bus error signal is generated when access to an unimplemented or reserved 16-bit register is attempted, or when a priviledge violation occurs. A bus error is generated under any of the following conditions: * Attempted access to unimplemented 16-bit registers within the decoded register block boundary. * Attempted user access to supervisor registers * Attempted access to test registers when not in test mode * Attempted write to read-only registers MPC561/MPC563 Reference Manual, Rev. 1.2 17-10 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) 17.4.2 Wait States The MIOS14 does not generate wait states. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-11 Modular Input/Output Subsystem (MIOS14) MPWMSM0 MPWMSM1 MPWMSM2 MPWMSM3 MPWMSM4 MPWMSM5 MMCSM6 MMCSM7 MMCSM8 MDASM11 MDASM12 MDASM13 MDASM14 MDASM15 MPWMSM16 MPWMSM17 MPWMSM18 MPWMSM19 MPWMSM20 MPWMSM21 MMCSM22 MMCSM23 MMCSM24 MDASM27 MDASM28 MDASM29 MDASM30 MDASM31 MPIOSM32 Base Address 0x30 6000 Channels Supervisor/ Unrestricted Reserved 0x30 6800 0x30 6810 MBISM MCPSM Supervisor Reserved 0x30 6C40 Supervisor MIRSM0 MIRSM1 Reserved Submodules 31 to 16 0x30 6FFF Submodules 15 to 0 MIOS14SR0 0x30 6C00 Reserved MIOS1ER0 MIOS14RPR0 0x30 6000 0x30 6008 0x30 6010 0x30 6018 0x30 6020 0x30 6028 0x30 6030 0x30 6038 0x30 6040 0x30 6058 0x30 6060 0x30 6068 0x30 6070 0x30 6078 0x30 6080 0x30 6088 0x30 6090 0x30 6098 0x30 60A0 0x30 60A8 0x30 60B0 0x30 60B8 0x30 60C0 0x30 60D8 0x30 60E0 0x30 60E8 0x30 60F0 0x30 60F8 0x30 6100 0x30 6C00 0x30 6C02 0x30 6C04 0x30 6C06 Reserved MIOS1LVL0 0x30 6C30 Reserved MIOS14SR1 0x30 6C40 0x30 6C42 Reserved MIOS14ER1 0x30 6C44 MIOS14RPR1 0x30 6C46 Reserved MIOS14LVL1 0x30 6C70 Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 17-12 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Figure 17-2. MIOS14 Memory Map 17.5 MIOS14 I/O Ports Each signal of each submodule can be used as an input, output, or I/O port: Table 17-2. MIOS14 I/O Ports 17.6 Submodule Number of Pins per Module Type MPIOSM 16 I/O MMCSM 2 I MDASM 1 I/O MPWMSM 1 I/O MIOS14 Bus Interface Submodule (MBISM) The MIOS14 bus interface submodule (MBISM) is used as an interface between the MIOB (modular I/O bus) and the IMB3. It allows the CPU to communicate with the MIOS14 submodules. 17.6.1 MIOS14 Bus Interface (MBISM) Registers Table 17-3 is the address map for the MBISM submodule. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 0x30 6800 MIOS14 Test and Signal Control Register (MIOS14TPCR) 0x30 6802 MIOS14 Vector Register (MIOS14VECT) -Reserved 0x30 6804 MIOS14 Module-Version Number Register (MIOS14VNR) 0x30 6806 MIOS14 Module Control Register (MIOS14MCR) 0x30 6808 Reserved 0x30 680A Reserved 0x30 680C Reserved 0x30 680E Reserved 13 14 15 Figure 17-3. MBISM Registers 17.6.1.1 MIOS14 Test and Signal Control Register (MIOS14TPCR) This register is used for MIOS14 factory testing and to control the VF and VFLS Signal usage. Control of other multiplexed functions is in the PDMCR2 register. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-13 Modular Input/Output Subsystem (MIOS14) MSB LSB 0 1 2 3 4 5 6 7 Field TEST 8 9 10 11 12 13 -- SRESET 14 15 VF VFLS 0000_0000_0000_0000 Addr 0x30 6800 Figure 17-4. Test and Signal Control Register (MIOS14TPCR) Table 17-3. MIOS14TPCR Bit Descriptions Bits Name 0 TEST 1:13 -- Reserved 14 VF VF Pin Multiplex -- This bit controls the function of the VF pins (VF0/MPIO32B0, VF1/MPIO32B1, VF2/MPIO32B2) 0 = MIOS14 General-Purpose I/O is selected (MPIO32B0, MPIO32B1, MPIO32B2) 1 = VF function is selected (VF[0:2]) 15 VFLS 17.6.1.2 Description Test -- This bit is used for MIOS14 factory testing and should always be programmed to a 0. VFLS Pin Multiplex -- This bit controls the function of the VFLS signals (VFLS0/MPIO32B3, VFLS1/MPIO32B4) 0 = MIOS14 General-Purpose I/O is selected (MPIO32B3, MPIO32B4) 1 = VFLS function is selected (VFLS[0:1]) MIOS14 Vector Register (MIOS14VECT) This register is reserved and is shown for information purposes only. MSB LSB 0 1 2 3 Field 4 5 6 7 8 9 -- 10 11 12 13 VECT SRESET 14 15 -- 0000_0000_0000_0000 Addr 0x30 6802 Figure 17-5. Vector Register (MIOS14VECT) 17.6.1.3 MIOS14 Module and Version Number Register (MIOS14VNR) This read-only register contains the hard-coded values of the module and version number. MSB 0 Field LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VN1 MN Reset Unaffected Addr 0x30 6804 Figure 17-6. MIOS14 Module/Version Number Register (MIOS14VNR) 1 This field contains the revision level of the MIOS module and may change with different revisions of the device. MPC561/MPC563 Reference Manual, Rev. 1.2 17-14 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-4. MIOS14VNR Bit Descriptions Bits Name 0:7 MN Module number = 0x0E on the MPC561/MPC563 8:15 VN Version number. May change with different revisions of the device. 17.6.1.4 Description MIOS14 Module Configuration Register (MIOS14MCR) The MIOS14MCR register is a collection of read/write stop, freeze, reset, and supervisor bits, as well as interrupt arbitration number bits. These bits are detailed in Table 17-5. MSB 0 LSB 1 Field STOP RSV 2 3 FRZ RST SRESET 4 5 6 -- 7 8 9 10 11 SUPV 12 13 14 15 -- 0000_0000_0000_0000 Addr 0x30 6806 Figure 17-7. Module Configuration Register (MIOS14MCR) Table 17-5. MIOS14MCR Bit Descriptions Bits Name Description 0 STOP Stop enable -- The STOP bit, while asserted, activates the MIOB freeze signal regardless of the state of the IMB3 FREEZE signal. The MIOB freeze signal is further validated in some submodules with internal freeze enable bits in order for the submodule to be stopped. The MBISM continues to operate to allow the CPU access to the submodule's registers. The MIOB freeze signal remains active until reset or until the STOP bit is written to zero by the CPU (via the IMB3). The STOP bit is cleared by reset. 0 Allows MIOS14 operation. 1 Selectively stops MIOS14 operation. 1 -- 2 FRZ Freeze enable -- The FRZ bit, while asserted, activates the MIOB freeze signal only when the IMB3 FREEZE signal is active. The MIOB freeze signal is further validated in some submodules with internal freeze enable bits in order for the submodule to be frozen. The MBISM continues to operate to allow the CPU access to the submodule's registers. The MIOB freeze signal remains active until the FRZ bit is written to zero or the IMB3 FREEZE signal is negated. The FRZ bit is cleared by reset. 0 Ignores the FREEZE signal on the IMB3, allows MIOS14 operation. 1 Selectively stops MIOS14 operation when the FREEZE signal appears on the IMB3. 3 RST Module reset -- The RST bit is always read as 0 and can be written to 1. When the RST bit is written to 1 operation of the MIOS14 completely stops and resets all the values in the submodule. This completely stops the operation of the MIOS14 and reset all the values in the submodules registers that are affected by reset. This bit provides a way of resetting the complete MIOS14 module regardless of the reset state of the CPU. The RST bit is cleared by reset. 0 Writing a 0 to RST has no effect. 1 Reset the MIOS14 submodules. 4:7 -- Reserved Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-15 Modular Input/Output Subsystem (MIOS14) Table 17-5. MIOS14MCR Bit Descriptions (continued) Bits Name Description 8 SUPV Supervisor data space selector -- The SUPV bit tells if the address space from 0x30 6000 to 0x30 67FF in the MIOS14 is accessed at the supervisor privilege level (See Figure 17-2). When cleared, these addresses are accessed at the unrestricted privilege level. The SUPV bit is cleared by reset. 0 Unrestricted Data Space. 1 Supervisor Data Space. 9:15 -- 17.7 Reserved. These bits are used for the IARB (interrupt arbitration ID) field in MIOS14 implementations that use hardware interrupt arbitration. These bits are not used on MPC561/MPC563. MIOS14 Counter Prescaler Submodule (MCPSM) The MIOS14 counter prescaler submodule (MCPSM) divides the MIOS14 clock (fSYS) to generate the counter clock. It is designed to provide all the submodules with the same division of the main MIOS14 clock (division of fSYS). It uses a 4-bit modulus counter. The clock signal is prescaled by loading the value of the clock prescaler register into the prescaler counter every time it overflows. This allows all prescaling factors between 2 and 16. Counting is enabled by asserting MCPSMSCR[PREN]. The counter can be stopped at any time by negating this bit, thereby stopping all submodules using the output of the MCPSM (counter clock). A block diagram of the MCPSM is given in Figure 17-8. The following sections describe the MCPSM in detail. fSYS Dec. CP0 Clock Prescaler Register CP1 4-bit Decrementer CP2 Overflow = 1? Counter Clock CP3 Enable MCPSMSCR Load PREN Figure 17-8. MCPSM Block Diagram 17.7.1 * MCPSM Features Centralized counter clock generator MPC561/MPC563 Reference Manual, Rev. 1.2 17-16 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) * * * Programmable 4-bit modulus down-counter Wide range of possible division ratios: 2 through 16 Count inhibit under software control 17.7.1.1 MCPSM Signal Functions The MCPSM has no associated external signals. 17.7.1.2 * * * Modular I/O Bus (MIOB) Interface The MCPSM is connected to all the signals in the read/write and control bus, to allow data transfer from and to the MCPSM registers, and to control the MCPSM in the different possible situations. The MIOS14 counter prescaler submodule does not use any 16-bit counter bus. The MIOS14 counter prescaler submodule does not use the request bus. 17.7.2 Effect of RESET on MCPSM When the RESET signal is asserted, all the bits in the MCPSM status and control register are cleared. NOTE The MCPSM is still disabled after the RESET signal is negated and counting must be explicitly enabled by asserting MCPSMSCR[PREN]. 17.7.3 MCPSM Registers The privilege level to access to the MCPSM registers is supervisor only. 17.7.3.1 MCPSM Registers Organization Table 17-6. MCPSM Register Address Map Address Register 0x30 6810 Reserved 0x30 6812 Reserved 0x30 6814 Reserved 0x30 6816 MCPSM Status/Control Register (MCPSMSCR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-17 Modular Input/Output Subsystem (MIOS14) 17.7.3.2 MCPSM Status/Control Register (MCPSMSCR) MSB 0 LSB 1 2 3 4 5 6 Field PREN FREN 7 8 9 10 11 12 -- SRESET 13 14 15 PSL3:0 0000_0000_0000_0000 Addr 0x30 6816 Figure 17-9. MCPSM Status/Control Register (MCPSMSCR) Table 17-7. MCPSMSCR Bit Descriptions Bits Name Description 0 PREN Prescaler enable bit -- This active high read/write control bit enables the MCPSM counter. The PREN bit is cleared by reset. 0 MCPSM counter disabled. 1 MCPSM counter enabled. 1 FREN Freeze bit -- This active high read/write control bit when set make possible a freeze of the MCPSM counter if the MIOB freeze line is activated. NOTE: This line is active when MIOS14MCR[STOP] is set or when MIOS14MCR[FREN] and the IMB3 FREEZE line are set. When the MCPSM is frozen, it stops counting. Then when the FREN bit is reset or when the freeze condition on the MIOB is negated, the counter restarts from where it was before freeze. The FREN bit is cleared by reset. 0 MCPSM counter not frozen. 1 MCPSM counter frozen if MIOB freeze active. 2:11 -- 12:15 PSL[3:0] Reserved Clock prescaler -- This 4-bit read/write data register stores the modulus value for loading into the clock prescaler. The new value is loaded into the counter on the next time the counter equals one or when disabled (PREN =0). Table 17-8. Clock Prescaler Setting PSL[3:0] Value Divide Ratio Hex Binary 0x0 0b0000 16 0x1 0b0001 No counter clock output 0x2 0b0010 2 0x3 0b0011 3 ... ... ... 0xE 0b1110 14 0xF 0b1111 15 NOTE If the binary value 0b0001 is entered in PSL[3:0], the output signal is stuck at zero, no clock is output. MPC561/MPC563 Reference Manual, Rev. 1.2 17-18 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) 17.8 MIOS14 Modulus Counter Submodule (MMCSM) The MMCSM is a versatile counter submodule capable of performing complex counting and timing functions, including modulus counting, in a wide range of applications. The MMCSM may also be configured as an event counter, allowing the overflow flag to be set after a predefined number of events (internal clocks or external events), or as a time source for other submodules. NOTE The MMCSM can also operate as a free running counter by loading the modulus value of zero. The main components of the MMCSM are an 8-bit prescaler counter, an 8-bit prescaler register, a 16-bit up-counter register, a 16-bit modulus latch register, counter loading and interrupt flag generation logic. The contents of the modulus latch register is transferred to the counter under the following three conditions: 1. When an overflow occurs 2. When an appropriate transition occurs on the external load signal 3. When the program writes to the counter register. In this case, the value is first written into the modulus register and immediately transferred to the counter. Software can also write a value to the modulus register for later loading into the counter with one of the two first criteria. A software control register selects whether the clock input to the counter is one of the prescaler outputs or the corresponding input signal. The polarity of the external input signal is also programmable. The following sections describe the MMCSM in detail. A block diagram of the MMCSM is shown in Figure 17-10. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-19 Modular Input/Output Subsystem (MIOS14) 16-bit Counter Bus 8-bit Clock Prescaler Counter Clock Clock input signal (MMCnC) Edge Clock Clock Clock Detect Select Enable Request Bus Flag PINC CP7 - CP0 8-bit Prescale Mod.Register Modulus Load signal (MMCnL) FREN MMCSMCNT 16-bit Up-Counter Reg. Load Edge Detect PINL CLS0 CLS1 EDGN EDGP Overflow Load Control MMCSMML 16-bit Modulus Latch Reg. MIOB Figure 17-10. MMCSM Block Diagram 0xFFFF Modulus Value Two's Complement Counter Reload Figure 17-11. MMCSM Modulus Up-Counter 17.8.1 * * * MMCSM Features Programmable 16-bit modulus up-counter with a built-in programmable 8-bit prescaler clocked by MCPSM Maximum increment frequency of the counter: -- clocked by the internal MCPSM output: fSYS / 2 -- clocked by the external signal: fSYS / 4 Flag setting and possible interrupt generation on overflow of the up-counter register MPC561/MPC563 Reference Manual, Rev. 1.2 17-20 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) * * * * * * Time counter on internal clock with interrupt capability after a pre-determined time External event counter (pulse accumulator) with overflow and interrupt capability after a pre-determined number of external events Usable as a regular free-running up-counter Capable of driving a dedicated 16-bit counter bus to provide timing information to action submodules (the value driven is the contents of the 16-bit up-counter register) Optional signal for counting external events Optional signal to externally force a load of the modulus counter 17.8.1.1 MMCSM Signal Functions The MMCSM has two dedicated external signals. An external modulus load signal (MMCnL) allows the modulus value stored in the modulus latch register (MMCSMML) to be loaded into the up-counter register (MMCSMCNT) at any time. Both rising and falling edges of the load signal may be used, according to the EDGEP and EDGEN bit settings in the MMCSMSCR. An external event clock signal (MMCnC) can be selected as the clock source for the up-counter register (MMCSMCNT) by setting the appropriate value in the CLS bit field of the status/control register (MMCSMSCR). Either rising or falling edge may be used according to the setting of these bits. When the external clock source is selected, the MMCSM is in the event counter mode. The counter can simply counts the number of events occurring on the input signal. Alternatively, the MMCSM can be programmed to generate an interrupt when a predefined number of events have been counted; this is done by presetting the counter with the two's complement value of the desired number of events. 17.8.2 MMCSM Prescaler The built-in prescaler consists of an 8-bit modulus counter, clocked by the MCPSM output. It is loaded with an 8-bit value every time the counter overflows or whenever the prescaler output is selected as the clock source. This 8-bit value is stored in the MMCSMSCR[CP]. The prescaler overflow signal is used to clock the MMCSM up-counter. This allows the MMCSMCNT to be incremented at the MCPSM output frequency divided by a value between 1 and 256. 17.8.3 * * * Modular I/O Bus (MIOB) Interface The MMCSM is connected to all the signals in the read/write and control bus, to allow data transfer from and to the MMCSM registers, and to control the MMCSM in the different possible situations. The MMCSM drives a dedicated 16-bit counter bus with the value currently in the up-counter register The MMCSM uses the request bus to transmit the FLAG line to the interrupt request submodule (MIRSM). A flag is set when an overflow has occurred in the up-counter register. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-21 Modular Input/Output Subsystem (MIOS14) 17.8.4 Effect of RESET on MMCSM When the RESET signal is asserted, only the FREN, EDGP, EDGN, and CLS bits in the MMCSMSCR are cleared. The clock prescaler CP, PINC, and PINL bits in the same register are not cleared. * The PINC and PINL bits in the MMCSMSCR always reflect the state of the appropriate external pins. * The MMCSM is disabled after reset and must be explicitly enabled by selecting a clock source using the CLS bits. The MMCSMCNT and the MMCSMML, together with the clock prescaler register bits, must be initialized by software, because they are undefined after a hardware reset. A modulus value must be written to the MMCSMCNT (which also writes into the MMCSMML) before the MMCSMSCR is written to. The latter access initializes the clock prescaler. 17.8.5 MMCSM Registers The privilege level to access to the MMCSM registers depends on the MIOS14MCR SUPV bit. The privilege level is unrestricted after SRESET and can be changed to supervisor by software. 17.8.5.1 MMCSM Register Organization Table 17-9. MMCSM Address Map Address Register MMCSM6 0x30 6030 MMCSM6 Up-Counter Register (MMCSMCNT) See Table 17-10 for bit descriptions. 0x30 6032 MMCSM6 Modulus Latch Register (MMCSMML) See Table 17-11 for bit descriptions. 0x30 6034 MMCSM6 Status/Control Register Duplicated (MMCSMSCRD) See Section 17.8.5.5, "MMCSM Status/Control Register (MMCSMSCR)" for bit descriptions. 0x30 6036 MMCSM6 Status/Control Register (MMCSMSCR). See Table 17-12 for bit descriptions. MMCSM7 0x30 6038 MMCSM7 Up-Counter Register (MMCSMCNT) 0x30 603A MMCSM7 Modulus Latch Register (MMCSMML) 0x30 603C MMCSM7 Status/Control Register Duplicated (MMCSMSCRD) 0x30 603E MMCSM7 Status/Control Register (MMCSMSCR) MMCSM8 0x30 6040 MMCSM8 Up-Counter Register (MMCSMCNT) 0x30 6042 MMCSM8 Modulus Latch Register (MMCSMML) 0x30 6044 MMCSM8 Status/Control Register Duplicated (MMCSMSCRD) 0x30 6046 MMCSM8 Status/Control Register (MMCSMSCR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-22 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-9. MMCSM Address Map (continued) Address Register MMCSM22 0x30 60B0 MMCSM22 Up-Counter Register (MMCSMCNT) 0x30 60B2 MMCSM22 Modulus Latch Register (MMCSMML) 0x30 60B4 MMCSM22 Status/Control Register Duplicated (MMCSMSCRD) 0x30 60B6 MMCSM22 Status/Control Register (MMCSMSCR) MMCSM23 0x30 60B8 MMCSM23 Up-Counter Register (MMCSMCNT) 0x30 60BA MMCSM23 Modulus Latch Register (MMCSMML) 0x30 60BC MMCSM23 Status/Control Register Duplicated (MMCSMSCRD) 0x30 60BE MMCSM23 Status/Control Register (MMCSMSCR) MMCSM24 0x30 60C0 MMCSM24 Up-Counter Register (MMCSMCNT) 0x30 60C2 MMCSM24 Modulus Latch Register (MMCSMML) 0x30 60C4 MMCSM24 Status/Control Register Duplicated (MMCSMSCRD) 0x30 60C6 MMCSM24 Status/Control Register (MMCSMSCR) 17.8.5.2 MMCSM Up-Counter Register (MMCSMCNT) MSB 0 LSB 1 Field 2 3 4 5 6 7 8 9 10 11 12 13 14 15 CNT SRESET Undefined Addr 0x30 6030, 0x30 6038, 0x30 6040, 0x30 60B0, 0x30 60B8, 0x30 60C0 Figure 17-12. MMCSM Up-Counter Register (MMCSMCNT) Table 17-10. MMCSMCNT Bit Descriptions Bits Name 0:15 CNT Description Counter value -- These bits are read/write data bits representing the 16-bit value of the up-counter. It contains the value that is driven onto the 16-bit counter bus. Note: Writing to MMCSMCNT simultaneously writes to MMCSMML. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-23 Modular Input/Output Subsystem (MIOS14) 17.8.5.3 MMCSM Modulus Latch Register (MMCSMML) MSB LSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 15 ML SRESET Undefined Addr 0x30 6032, 0x30 603A, 0x30 6042, 0x30 60B2, 0x30 60BA, 0x30 60C2 Figure 17-13. MMCSM Modulus Latch Register (MMCSMML) Table 17-11. MMCSMML Bit Descriptions Bits Name Description 0:15 ML Modulus latches -- These bits are read/write data bits containing the 16-bit modulus value to be loaded into the up-counter. The value loaded in this register must be the one's complement of the desired modulus count. The up-counter increments from this one's complement value up to 0xFFFF to get the correct number of steps before an overflow is generated to reload the modulus value into the up-counter. 17.8.5.4 MMCSM Status/Control Register (MMCSMSCRD) (Duplicated) The MMCSMSCRD and the MMCSMSCR are the same registers accessed at two different addresses. Reading or writing to one of these two addresses has exactly the same effect. The duplication of the SCR register allows coherent 32-bit accesses when using a RCPU. WARNING The user should not write directly to the address of the MMCSMSCRD. This register's address may be reserved for future use and should not be accessed by the software to ensure future software compatibility. 17.8.5.5 MMCSM Status/Control Register (MMCSMSCR) The status/control register (SCR) is a collection of read-only signal status bits, read/write control bits and an 8-bit read/write data register, as detailed below. MSB 0 Field PINC SRESET Addr LSB 1 2 3 4 PINL FREN EDGN EDGP 5 6 CLS 7 8 9 -- 10 11 12 13 14 15 CP Undefined 0x30 6036, 0x30 603E, 0x30 6046, 0x30 60B6, 0x30 60BE, 0x30 60C6 Figure 17-14. MMCSM Status/Control Register (MMCSMSCR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-24 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-12. MMCSMSCR Bit Descriptions Bits Name Description 0 PINC Clock input signal status bit -- This read-only status bit reflects the logic state of the clock input signal MMCnC (MDA11, MDA13, MDA27, MDA30, PWM16, and PWM18). 1 PINL Modulus load input signal status bit -- This read-only status bit reflects the logic state of the modulus load signal MMCnL (MDA12, MDA14, MDA28, MDA31, PWM17, and PWM19). 2 FREN Freeze enable -- This active high read/write control bit enables the MMCSM to recognize the MIOB freeze signal. 3 EDGN Modulus load falling-edge sensitivity -- This active high read/write control bit sets falling-edge sensitivity for the MMCnL signal, such that a high-to-low transition causes a load of the MMCSMCNT. 4 EDGP Modulus load rising-edge sensitivity This active high read/write control bit sets rising-edge sensitivity for the MMCnL signal, such that a low-to-high transition causes a load of the MMCSMCNT. See Table 17-13 for details about edge sensitivity. 5:6 CLS Clock select -- These read/write control bits select the clock source for the modulus counter. Either the rising edge or falling edge of the clock signal on the MMCnC signal may be selected, as well as, the internal MMCSM prescaler output or disable mode (no clock source). See Table 17-14 for details about the clock selection. 7 -- Reserved 8:15 CP Clock prescaler -- This 8-bit data field is also accessible as an 8-bit data register. It stores the two's complement of the modulus value to be loaded into the built-in 8-bit clock prescaler. The new value is loaded into the prescaler counter on the next counter overflow, or upon setting the CLS1 -- CLS0 bits for selecting the clock prescaler as the clock source. Table 17-15 gives the clock divide ratio according to the value of CP. Table 17-13. MMCSMCNT Edge Sensitivity EDGN EDGP Edge Sensitivity 1 1 MMCSMCNT load on rising and falling edges 1 0 MMCSMCNT load on falling edges 0 1 MMCSMCNT load on rising edges 0 0 None (disabled) Table 17-14. MMCSMCNT Clock Signal CLS Clocking Selected 11 MMCSM clock prescaler 10 Clock signal rising-edge 01 Clock signal falling-edge 00 None (disable) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-25 Modular Input/Output Subsystem (MIOS14) Table 17-15. Prescaler Values 17.9 Prescaler Value (CP in Hex) MIOS14 Prescaler Clock Divided By FF 1 FE 2 FD 3 FC 4 FB 5 FA 6 F9 7 F8 8 ...... ........ 02 254 (2^8 -2) 01 255 (2^8 -1) 00 256 (2^8) MIOS14 Double Action Submodule (MDASM) The MIOS14 double action submodule (MDASM) is a function included in the MIOS14 library. It is a versatile 16-bit dual action submodule capable of performing two event operations before software intervention is required. It can perform two event operations such as PWM generation and measurement, input capture, output compare, etc. The MDASM is composed of two timing channels (A and B), an output flip-flop, an input edge detector and some control logic. All control and status bits are contained in the MDASM status and control register. The following sections describe the MDASM in detail. A block diagram of the MDASM is shown in Figure 17-15. MPC561/MPC563 Reference Manual, Rev. 1.2 17-26 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) 4 X 16-bit Counter buses Counter Bus Set Counter bus select BSL1 BSL0 16-bit comparator A FORCA FORCB WOR Output flip-flop Output buffer 16-bit Register A PIN I/O signal EDPOL Edge detect 16-bit Register B1 Register B FLAG 16-bit Register B2 16-bit comparator B MODE3 MODE2 MODE1 MODE0 Request Bus Control register bits MIO Bus Figure 17-15. MDASM Block Diagram 17.9.1 * * * * * * * MDASM Features Versatile 16-bit dual action unit allowing up to two events to occur before software intervention is required Six software selectable modes allowing the MDASM to perform pulse width and period measurements, PWM generation, single input capture and output compare operations as well as port functions Software selection of one of the four possible 16-bit counter buses used for timing operations Flag setting and possible interrupt generation after MDASM action completion Software selection of output pulse polarity Software selection of totem-pole or open-drain output Software readable output signal status MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-27 Modular Input/Output Subsystem (MIOS14) 17.9.1.1 MDASM Signal Functions The MDASM has one dedicated external signal. This signal is used in input or in output depending on the selected mode. When in input, it allows the MDASM to perform input capture, input pulse width measurement and input period measurement. When in output, it allows output compare, single shot output pulse, single output compare and output port bit operations as well as output pulse width modulation. NOTE In disable mode, the signal becomes a high impedance input and the input level on this signal is reflected by the state of the PIN bit in the MDASMSCR register. 17.9.2 MDASM Description The MDASM contains two timing channels A and B associated with the same input/output signal. The dual action submodule is so called because its timing channel configuration allows two events (input capture or output compare) to occur before software intervention is required. Six operating modes allow the software to use the MDASM's input capture and output compare functions to perform pulse width measurement, period measurement, single pulse generation and continuous pulse width generation, as well as standard input capture and output compare. The MDASM can also work as a single I/O signal. See Table 17-16 for details. Channel A comprises one 16-bit data register and one 16-bit comparator. Channel B also consists of one 16-bit data register and one 16-bit comparator, however, internally, channel B has two data registers B1 and B2, and the operating mode determines which register is accessed by the software: * In the input modes (IPWM, IPM and IC), registers A and B2 are used to hold the captured values; in these modes, the B1 register is used as a temporary latch for channel B. * In the output compare modes (OCB and OCAB), registers A and B2 are used to define the output pulse; register B1 is not used in these modes. * In the output pulse width modulation mode (OPWM), registers A and B1 are used as primary registers and hidden register B2 is used as a double buffer for channel B. Register contents are always transferred automatically at the correct time so that the minimum pulse (measurement or generation) is just one 16-bit counter bus count. The A and B data registers are always read/write registers, accessible via the MIOB. In the input modes, the edge detect circuitry triggers a capture whenever a rising or falling edge (as defined by the EDPOL bit) is applied to the input signal. The signal on the input signal is Schmitt triggered and synchronized with the MIOS14 CLOCK. In the disable mode (DIS) and in the input modes, the PIN bit reflects the state present on the input signal (after being Schmitt triggered and synchronized). In the output modes the PIN bit reflects the value present on the output flip-flop. The output flip-flop is used in output modes to hold the logic level applied to the output signal. MPC561/MPC563 Reference Manual, Rev. 1.2 17-28 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) The 16-bit counter bus selector is common to all input and output functions; it connects the MDASM to one of the four 16-bit counter buses available to that submodule instance and is controlled in software by the 16-bit counter bus selector bits BSL0 and BSL1 in the MDASMSCR register. 17.9.3 MDASM Modes of Operation The mode of operation of the MDASM is determined by the mode select bits MODE[0:3] in the MDASMSCR register (see Table 17-16). Table 17-16. MDASM Modes of Operation MODE[0:3] Mode Description of Mode 0000 DIS 0001 IPWM 0010 IPM 0011 IC 0100 OCB Output compare, flag line activated on B compare -- Generate leading and trailing edges of an output pulse. 0101 OCAB Output compare, flag line activated on A and B compare -- Generate leading and trailing edges of an output pulse. 1xxx OPWM Output pulse width modulation -- Generate continuous PWM output with 7, 9, 11, 12, 13, 14, 15 or 16 bits of resolution. Disabled -- Input signal is high impedance; PIN gives state of the input signal. Input pulse width measurement -- Capture on the leading edge and the trailing edge of an input pulse. Input period measurement -- Capture two consecutive rising/falling edges. Input capture -- Capture when the designated edge is detected. To avoid spurious interrupts, and to make sure that the FLAG line is activated according to the newly selected mode, the following sequence of operations should be adopted when changing mode: 1. Disable MDASM interrupts (by resetting the enable bit in the relevant MIRSM) 2. Change mode (via disable mode) 3. Reset the corresponding FLAG bit in the relevant MIRSM 4. Re-enable MDASM interrupts (if desired) NOTE When changing between output modes, it is not necessary to follow this procedure, as in these modes the FLAG bit merely indicates to the software that the compare value can be updated. However changing modes without passing via the disable mode does not guarantee the subsequent functionality. 17.9.3.1 Disable (DIS) Mode The disable mode is selected by setting MODE[0:3] to 0b0000. In this mode, all input capture and output compare functions of the MDASM are disabled and the FLAG line is maintained inactive, but the input port signal function remains available. The associated signal becomes a high impedance input and the input level on this signal is reflected by the state of the PIN bit in the MDASMSCR register. All control bits remain accessible, allowing the software to prepare for future MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-29 Modular Input/Output Subsystem (MIOS14) mode selection. Data registers A and B are accessible at consecutive addresses. Writing to data register B stores the same value in registers B1 and B2. WARNING When changing modes, it is imperative to go through the DIS mode. Failure to do this could lead to invalid and unexpected output compare or input capture results, and to flags being set incorrectly. 17.9.3.2 Input Pulse Width Measurement (IPWM) Mode IPWM mode is selected by setting MODE[0:3] to 0b0001. This mode allows the width of a positive or negative pulse to be determined by capturing the leading edge of the pulse on channel B and the trailing edge of the pulse on channel A; successive captures are done on consecutive edges of opposite polarity. The edge sensitivity is selected by the EDPOL bit in the MDASMSCR register. This mode also allows the software to determine the logic level on the input signal at any time by reading the PIN bit in the MDASMSCR register. The channel A input capture function remains disabled until the first leading edge triggers the first input capture on channel B (refer to Figure 17-16). When this leading edge is detected, the count value of the 16-bit counter bus selected by the BSL[1:0] bits is latched in the 16-bit data register B1; the FLAG line is not activated. When the next trailing edge is detected, the count value of the 16-bit counter bus is latched into the 16-bit data register A and, at the same time, the FLAG line is activated and the contents of register B1 are transferred to register B2. Reading data register B returns the value in register B2. If subsequent input capture events occur while the FLAG bit is set in the corresponding MIRSM, data registers A and B will be updated with the latest captured values and the FLAG line will remain active. If a 32-bit coherent operation is in progress when the trailing edge is detected, the transfer from B1 to B2 is deferred until the coherent operation is completed. Operation of the MDASM then continues on channels B and A as previously described. The input pulse width is calculated by subtracting the value in data register B from the value in data register A. Figure 17-16 provides an example of how the MDASM can be used for input pulse width measurement. MPC561/MPC563 Reference Manual, Rev. 1.2 17-30 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Mode selection; EDPOL = 1 (Channel A capture on falling edge, Channel B capture on rising edge) Rising Edge Trigger Input signal Falling Edge Trigger Rising Edge Trigger Pulse 1 Falling Edge Trigger Pulse 2 FLAG reset by software FLAG reset by software Flag set 0x1400 0x1525 Flag set FLAG bit 16-bit 0x0500 Counter Bus Register A 0xxxxx 0x1100 0x1000 2 1 0xxxxx Rising Edge Trigger 0x1100 0x16A0 2 1 0x1100 0x1525 0x1525 0x1400 0x1400 0x16A0 B1 is an internal register, not accessible to software Register B1 0xxxxx 0x1000 0x1000 3 3 Register B2 0xxxxx 0xxxxx 0x1000 0x1000 Pulse 1 = Reg A- Reg B = 0x0100 0x1400 0x1400 Pulse 2 = Reg A- Reg B = 0x0125 Figure 17-16. Input Pulse Width Measurement Example 17.9.3.3 Input Period Measurement (IPM) Mode IPM mode is selected by setting MODE[0:3] to 0b0010. This mode allows the period of an input signal to be determined by capturing two consecutive rising edges or two consecutive falling edges; successive input captures are done on consecutive edges of the same polarity. The edge sensitivity is defined by the EDPOL bit in the MDASMSCR register. This mode also allows the software to determine the logic level on the input signal at any time by reading the PIN bit in the MDASMSCR register (refer to Figure 17-17). When the first edge having the selected polarity is detected, the 16-bit counter bus value is latched into the 16-bit data register A. Data in register B1 is transferred to data register B2 and the data in register A is transferred to register B1. On this first capture the FLAG line is not activated, and the value in register B2 is meaningless. On the second and subsequent captures, the FLAG line is activated when the data in register A is transferred to register B1. When the second edge of the same polarity is detected, the counter bus value is latched into data register A, the data in register B1 is transferred to data register B2, the FLAG line is activated to signify that the beginning and end points of a complete period have been captured, and finally the data in register A is transferred to register B1. This sequence of events is repeated for each subsequent capture. Reading data register B returns the value in register B2. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-31 Modular Input/Output Subsystem (MIOS14) If a 32-bit coherent operation is in progress when an edge (except for the first edge) is detected, the transfer of data from B1 to B2 is deferred until the coherent operation is completed. At any time, the input level present on the input signal can be read on the PIN bit. The input pulse period is calculated by subtracting the value in data register B from the value in data register A. Figure 17-17 provides an example of how the MDASM can be used for input period measurement. Mode selection; EDPOL = 0 (Channel A capture on rising edge) Rising Edge Trigger Rising Edge Trigger Rising Edge Trigger Input signal Flag set FLAG reset by software FLAG reset bysoftwa re Flag set FLAG bit 16-bit Counter Bus 0x0500 0x1000 0x1100 1 0xxxxx 0x1000 0x1000 0xxxxx 0xxxxx 2 Register B2 0xxxxx 0x1525 0x1400 3 0x1400 2 Flag set 0x0400 0x16A0 1 1 Register A 0xxxxx 0x1000 0x1000 Internal Register, not accessible to 3 software Register B1 0x1400 0x1400 0x16A0 3 0x1400 0x16A0 2 Flag set 0x1000 Period = Reg A -Reg B 0x1400 Period = Reg A -Reg B Figure 17-17. Input Period Measurement Example 17.9.3.4 Input Capture (IC) Mode IC mode is selected by setting MODE[0:3] to 0b0011. This mode is identical to the input period measurement mode (IPM) described above, with the exception that the FLAG line is also activated at the occurrence of the first detected edge of the selected polarity. In this mode the MDASM functions as a standard input capture function. In this case the value latched in channel B can be ignored. Figure 17-18 provides an example of how the MDASM can be used for input capture. MPC561/MPC563 Reference Manual, Rev. 1.2 17-32 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Mode selection; EDPOL = 0 (Channel A capture on rising edge) Rising Edge Trigger Rising Edge Trigger Rising Edge Trigger Input signal FLAG reset by software Flag set Flag set FLAG reset by software FLAG reset by software Flag set FLAG bit 16-bit Counter Bus 0x0500 0x1000 0x1100 0x1400 0x1525 0x16A0 Register A 0xxxxx 0x1000 Internal Register, not accessible to software 0x1000 0x1400 0x1400 0x16A0 Register B1 0xxxxx 0x1000 0x1000 0x1400 0x1400 0x16A0 Register B2 (Ignored) 0xxxxx 0xxxxx 0xxxxx 0x1000 0x1000 0x1400 Figure 17-18. MDASM Input Capture Example 17.9.3.5 Output Compare (OCB and OCAB) Modes Output compare mode (either OCA or OCB) is selected by setting MODE[0:3] to 0b010x. The MODE0 controls the activation criteria for the FLAG line, (i.e., when a compare occurs only on channel B or when a compare occurs on either channel). This mode allows the MDASM to perform four different output functions: * Single-shot output pulse (two edges), with FLAG line activated on the second edge * Single-shot output pulse (two edges), with FLAG line activated on both edges * Single-shot output transition (one edge) * Output port signal, with output compare function disabled In this mode the leading and trailing edges of variable width output pulses are generated by calculated output compare events occurring on channels A and B, respectively. OC mode may also be used to perform a single output compare function, or may be used as an output port bit. In this mode, channel B is accessed via register B2. A write to register B2 writes the same value to register B1 even though the contents of B1 are not used in this mode. Both channels work together to generate one `single shot' output pulse signal. Channel A defines the leading edge of the output pulse, while channel B defines the trailing edge of the pulse. FLAG line activation can be done when a match occurs on channel B only or when a compare occurs on either channel (as defined by the MODE0 in the MDASMSCR register). When this mode is first selected, (i.e., coming from disable mode, both comparators are disabled). Each comparator is enabled by writing to its data register; it remains enabled until the next successful comparison is made on that channel, whereupon it is disabled. The values stored in registers A and B are compared with the count value on the selected 16-bit counter bus when their corresponding comparators are enabled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-33 Modular Input/Output Subsystem (MIOS14) The output flip-flop is set when a match occurs on channel A. The output flip-flop is reset when a match occurs on channel B. The polarity of the output signal is selected by the EDPOL bit. The output flip-flop level can be obtained at any time by reading the PIN bit. If subsequent enabled output compares occur on channels A and B, the output pulses continue to be output, regardless of the state of the FLAG bit. At any time, the FORCA and FORCB bits allow the software to force the output flip-flop to the level corresponding to a comparison on channel A or B, respectively. NOTE The FLAG line is not affected by these `force' operations. Totem pole or open-drain output circuit configurations can be selected using the WOR bit in the MDASMSCR register. NOTE If both channels are loaded with the same value, the output flip-flop provides a logic zero level output and the flag bit is still set on the match. NOTE 16-bit counter bus compare only occurs when the 16-bit counter bus is updated. 17.9.3.5.1 Single Shot Output Pulse Operation The single shot output pulse operation is selected by writing the leading edge value of the desired pulse to data register A and the trailing edge value to data register B. A single pulse will be output at the desired time, thereby disabling the comparators until new values are written to the data registers. To generate a single shot output pulse, the OCB mode should be used to only generate a flag on the B match. In this mode, registers A and B2 are accessible to the user software (at consecutive addresses). Figure 17-19 provides an example of how the MDASM can be used to generate a single output pulse. MPC561/MPC563 Reference Manual, Rev. 1.2 17-34 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Mode selection; MODE0 = 0 A Event B Event Output signal Reoccurrences of the timer count do not trigger the output pulse unless r egisters A and B have been written again. FLAG reset by software FLAG bit 16-bit 0x0500 Counter Bus Write to A and B 0x1000 0x1100 0x0000 0x1000 0x1100 Register A 0x1000 0x1000 Internal Register, not accessible to software 0x1000 0x1000 0x1000 0x1000 Register B1 0xxxxx 0xxxxx 0xxxxx 0xxxxx 0xxxxx 0xxxxx Register B2 0x1100 0x1100 0x1100 0x1100 0x1100 0x1100 Figure 17-19. Single Shot Output Pulse Example 17.9.3.5.2 Single Output Compare Operation The single output compare operation is selected by writing to only one of the two data registers (A or B), thus enabling only one of the comparators. Following the first successful match on the enabled channel, the output level is fixed and remains at the same level indefinitely with no further software intervention being required. To generate a single output compare, the OCAB mode should be used to generate a flag on both the A and the B match. NOTE In this mode, registers A and B2 are accessible to the user software (at consecutive addresses). Figure 17-20 provides an example of how the MDASM can be used to perform a single output compare. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-35 Modular Input/Output Subsystem (MIOS14) Mode selection; MODE0 = 1 A Event Output signal F LAG reset by software B Event Reoccurences of the timer count do not trigger a response unless registers A or B have been written again. FLAG reset by software FLAG bit 16-bit Counter Bus 0x0500 Write to A 0x1000 0x1100 0x1000 Write to B 0x1100 0x1000 Register A 0x1000 0x1000 Internal Register, not accessible to software 0x1000 0x1000 0x1000 0x1000 Register B1 0xxxxx 0xxxxx 0xxxxx 0xxxxx 0xxxxx 0xxxxx Register B2 0xxxxx 0xxxxx 0xxxxx 0x1100 0x1100 0x1100 Figure 17-20. Single Shot Output Transition Example 17.9.3.5.3 Output Port Bit Operation The output port bit operation is selected by leaving both channels disabled, (i.e., by writing to neither register A nor B). The EDPOL bit alone controls the output value. The same result can be achieved by keeping EDPOL at zero and using the FORCA and FORCB bits to obtain the desired output level. 17.9.3.6 Output Pulse Width Modulation (OPWM) Mode OPWM mode is selected by setting MODE[0:3] to 1xxx. The MODE[1:3] bits allow some of the comparator bits to be masked. This mode allows pulse width modulated output waveforms to be generated, with eight selectable frequencies. Frequencies are only relevant as such if the counter bus is driven by a counter as a time reference. Both channels (A and B) are used to generate one PWM output signal on the MDASM signal. Channel B is accessed via register B1. Register B2 is not accessible. Channels A and B define respectively the leading and trailing edges of the PWM output pulse. The value in register B1 is transferred to register B2 each time a match occurs on either channel A or B. NOTE A FORCA or FORCB does not cause a transfer from B1 to B2. The value loaded in register A is compared with the value on the 16-bit counter bus each time the counter bus is updated. When a match on A occurs, the FLAG line is activated and the output flip-flop is set. The value loaded in register B2 is compared with the value on the 16-bit counter bus each time the counter bus is updated. When a match occurs on B, the output flip-flop is reset. MPC561/MPC563 Reference Manual, Rev. 1.2 17-36 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) NOTE If both channels are loaded with the same value, when a simultaneous match on A and B occurs, the submodule behaves as if a simple match on B had occurred except for the FLAG line which is activated. The output flip-flop is reset and the value in register B1 is transferred to register B2 on the match. The polarity of the PWM output signal is selected by the EDPOL bit. The output flip-flop level can be obtained at any time by reading the PIN bit. If subsequent compares occur on channels A and B, the PWM pulses continue to be output, regardless of the state of the FLAG bit. At any time, the FORCA and FORCB bits allow the software to force the output flip-flop to the level corresponding to a comparison on A or B respectively. Note that the FLAG line is not activated by the FORCA and FORCB operations. WARNING Data registers A and B must be loaded with the values needed to produce the desired PWM output pulse. NOTE 16-bit counter bus compare only occurs when the 16-bit counter bus is updated. Figure 17-21 provides an example of how the MDASM can be used for pulse width modulation. EDPOL = 0 A Compare B Compare Output signal A Compare Flag reset by software B Compare Flag reset by software FLAG bit 0x1000 16-bit Counter Bus Write 0x1000 to A Write 0x1800 to B1 0x1100 0x1800 0x0000 0x1000 0x1700 Write to B1 Write to B1 Register A 0x1000 0x1000 0x1000 0x1000 0x1000 0x1000 Register B1 0x1800 0x1500 0x1500 0x1700 0x1700 0x1700 0x1500 0x1500 0x1700 0x1700 Register B2 0x1800 0x1800 Internal Register, not accessible to software Figure 17-21. MDASM Output Pulse Width Modulation Example To generate PWM output pulses of different frequencies, the 16-bit comparator can have some of its bits masked. This is controlled by bits MODE2, MODE1and MODE0. The frequency of the PWM output (fPWM) is given by the following equation (assuming the MDASM is connected to a 16-bit counter bus used as time reference and fSYS is the frequency of the MIOS14 CLOCK): MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-37 Modular Input/Output Subsystem (MIOS14) fPWM = fSYS NMCPSM * NCOUNTER * NMDASM where: * NMCPSM is the overall MCPSM clock divide ratio (2, 3, 4,...,16). * NCOUNTER is the divide ratio of the prescaler of the counter (used as a time reference) that drives the 16-bit counter bus. * NMDASM is the maximum count reachable by the counter when using n bits of resolution (this count is equal to 2n). A few examples of frequencies and resolutions that can be obtained are shown in Table 17-17. Table 17-17. MDASM PWM Example Output Frequencies/Resolutions at fSYS = 40 MHz 1 Resolution (bits) NMCPSM NCOUNTER NMDASM PWM output frequency (Hz)1 16 16 256 65536 0.15 16 2 1 65536 305.17 15 16 256 32768 0.29 15 2 1 32768 610.35 14 16 256 16384 0.59 14 2 1 16384 1 220.70 13 16 256 8192 1.19 13 2 1 8192 2 441.41 12 16 256 4096 2.38 12 2 1 4096 4 882.81 11 16 256 2048 4.77 11 2 1 2048 9 765.63 9 16 256 512 19.07 9 2 1 512 39 062.50 7 16 256 128 76.29 7 2 1 128 156 250 This information is valid only if the MDASM is connected to an MMCSM operating as a free-running counter. When using 16 bits of resolution on the comparator (MODE[2:0] = 0b000), the output can vary from a 0% duty cycle up to a duty cycle of 65535/65536. In this case it is not possible to have a 100% duty cycle. In cases where 16-bit resolution is not needed, it is possible to have a duty cycle ranging from 0% to 100%. Setting bit 15 of the value stored in register B to one results in the output being `always set'. Clearing bit 15 (to zero) allows normal comparisons to occur and the normal output waveform is obtained. Changes to and from the 100% duty cycle are done synchronously on an A or B match, as are all other width changes. MPC561/MPC563 Reference Manual, Rev. 1.2 17-38 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) In the OPWM mode, the WOR bit selects whether the output is totem pole driven or open-drain. 17.9.4 * * * Modular I/O Bus (MIOB) Interface The MDASM is connected to all the signals in the read/write and control bus, to allow data transfer from and to the MDASM registers, and to control the MDASM in the different possible situations. The MDASM is connected to four 16-bit counter buses available to that submodule instance, so that the MDASM can select by software which one to use. The MDASM uses the request bus to transmit the FLAG line to the interrupt request submodule (MIRSM). 17.9.5 Effect of RESET on MDASM When the reset signal is asserted, the MDASM registers are reset according to the values specified in Section 17.9.6, "MDASM Registers." 17.9.6 MDASM Registers The privilege level to access the MDASM registers depends on the MIOS14MCR[SUPV]. The privilege level is unrestricted after reset and can be changed to supervisor by software. 17.9.6.1 MDASM Registers Organization The MDASM register map comprises four 16-bit register locations. As shown in below, the register block contains four MDASM registers. Note that the MDASMSCRD is the duplication of the MDASMSCR. This is done to allow 32-bit aligned accesses. WARNING The user should not write directly to the address of the MDASMSCRD. This register's address may be reserved for future use and should not be accessed by the software to ensure future software compatibility. All unused bits return zero when read by the software. All register addresses in this section are specified as offsets from the base address of the MDASM. Table 17-18. MDASM Address Map Address Register MDASM11 0x30 6058 MDASM11 Data A Register (MDASMAR) See Section 17.9.6.2, "MDASM Data A (MDASMAR) Register" for bit descriptions. 0x30 605A MDASM11 Data B Register (MDASMBR) See Section 17.9.6.3, "MDASM Data B (MDASMBR) Register" for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-39 Modular Input/Output Subsystem (MIOS14) Table 17-18. MDASM Address Map (continued) Address Register 0x30 605C MDASM11 Status/Control Register Duplicated (MDASMSCRD) See Table 17-21 for bit descriptions. 0x30 605E MDASM11 Status/Control Register (MDASMSCR) See Table 17-21 for bit descriptions. MDASM12 0x30 6060 MDASM12 Data A Register (MDASMAR) 0x30 6062 MDASM12 Data B Register (MDASMBR) 0x30 6064 MDASM12 Status/Control Register Duplicated (MDASMSCRD) 0x30 6066 MDASM12 Status/Control Register (MDASMSCR) MDASM13 0x30 6068 MDASM13 Data A Register (MDASMAR) 0x30 606A MDASM13 Data B Register (MDASMBR) 0x30 606C MDASM13 Status/Control Register Duplicated (MDASMSCRD) 0x30 606E MDASM13 Status/Control Register (MDASMSCR) MDASM14 0x30 6070 MDASM14 Data A Register (MDASMAR) 0x30 6072 MDASM14 Data B Register (MDASMBR) 0x30 6074 MDASM14 Status/Control Register Duplicated (MDASMSCRD) 0x30 6076 MDASM14 Status/Control Register (MDASMSCR) MDASM15 0x30 6078 MDASM15 Data A Register (MDASMAR) 0x30 607A MDASM15 Data B Register (MDASMBR) 0x30 607C MDASM15 Status/Control Register Duplicated (MDASMSCRD) 0x30 607E MDASM15 Status/Control Register (MDASMSCR) MDASM27 0x30 60D8 MDASM27 Data A Register (MDASMAR) 0x30 60DA MDASM27 Data B Register (MDASMBR) 0x30 60DC MDASM27 Status/Control Register Duplicated (MDASMSCRD) 0x30 60DE MDASM27 Status/Control Register (MDASMSCR) MDASM28 0x30 60E0 MDASM28 Data A Register (MDASMAR) 0x30 60E2 MDASM28 Data B Register (MDASMBR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-40 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-18. MDASM Address Map (continued) Address Register 0x30 60E4 MDASM28 Status/Control Register Duplicated (MDASMSCRD) 0x30 60E6 MDASM28 Status/Control Register (MDASMSCR) MDASM29 0x30 60E8 MDASM29 Data A Register (MDASMAR) 0x30 60EA MDASM29 Data B Register (MDASMBR) 0x30 60EC MDASM29 Status/Control Register Duplicated (MDASMSCRD) 0x30 60EE MDASM29 Status/Control Register (MDASMSCR) MDASM30 0x30 60F0 MDASM30 Data A Register (MDASMAR) 0x30 60F2 MDASM30 Data B Register (MDASMBR) 0x30 60F4 MDASM30 Status/Control Register Duplicated (MDASMSCRD) 0x30 60F6 MDASM30 Status/Control Register (MDASMSCR) MDASM31 17.9.6.2 0x30 60F8 MDASM31 Data A Register (MDASMAR) 0x30 60FA MDASM31 Data B Register (MDASMBR) 0x30 60FC MDASM31 Status/Control Register Duplicated (MDASMSCRD) 0x30 60FE MDASM31 Status/Control Register (MDASMSCR) MDASM Data A (MDASMAR) Register MSB 0 LSB 1 Field SRESET Addr 2 3 4 5 6 7 8 9 10 11 12 13 14 15 AR Undefined 0x30 6058, 0x30 6060, 0x30 6068, 0x30 6070, 0x30 6078, 0x30 60D8, 0x30 60E0, 0x30 60E8, 0x30 60F0, 0x30 60F8 Figure 17-22. MDASM Data A Register (MDASMAR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-41 Modular Input/Output Subsystem (MIOS14) Table 17-19. MDASMAR Bit Descriptions Bits Name Description 0:15 AR MDASMAR is the data register associated with channel A; its use varies with the different modes of operation: DIS mode: MDASMAR can be accessed to prepare a value for a subsequent mode selection. IPWM mode: MDASMAR contains the captured value corresponding to the trailing edge of the measured pulse. IPM and IC modes: MDASMAR contains the captured value corresponding to the most recently detected dedicated edge (rising or falling edge). OCB and OCAB modes: MDASMAR is loaded with the value corresponding to the leading edge of the pulse to be generated. Writing to MDASMAR in the OCB and OCAB modes also enables the corresponding channel A comparator until the next successful comparison. OPWM mode: MDASMAR is loaded with the value corresponding to the leading edge of the PWM pulse to be generated. NOTE: In IC, IPM, or IPWM mode, when a read to register A or B occurs at the same time as a counter bus capture into that register and the counter bus is changing value, then the counter bus capture to that register is delayed. 17.9.6.3 MDASM Data B (MDASMBR) Register MSB 0 Field SRESET Addr LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 BR Undefined 0x30 605A, 0x30 6062, 0x30 606A, 0x30 6072, 0x30 607A, 0x30 60DA, 0x30 60E2, 0x30 60EA, 0x30 60F2, 0x30 60FA Figure 17-23. MDASM DataB Register (MDASMBR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-42 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-20. MDASMBR Bit Descriptions Bits Nam e 0:15 BR 17.9.6.4 Description MDASMBR is the data register associated with channel B; its use varies with the different modes of operation. Writing to register B always writes to B1 and, depending on the mode selected, sometimes to B2. Reading register B either reads B1 or B2 depending on the mode selected. In the DIS mode, MDASMBR can be accessed to prepare a value for a subsequent mode selection. In this mode, register B1 is accessed in order to prepare a value for the OPWM mode. Unused register B2 is hidden and cannot be read, but is written with the same value when register B1 is written. In the IPWM mode, MDASMBR contains the captured value corresponding to the leading edge of the measured pulse. In this mode, register B2 is accessed; buffer register B1 is hidden and is not readable. In the IPM and IC modes, MDASMBR contains the captured value corresponding to the previously dedicated edge (rising or falling edge). In this mode, register B2 is accessed; buffer register B1 is hidden and is not readable. In the OCB and OCAB modes, MDASMBR is loaded with the value corresponding to the trailing edge of the pulse to be generated. Writing to MDASMBR in the OCB and OCAB modes also enables the corresponding channel B comparator until the next successful comparison. In this mode, register B2 is accessed; buffer register B1 is hidden and is not readable. In the OPWM mode, MDASMBR is loaded with the value corresponding to the trailing edge of the PWM pulse to be generated. In this mode, register B1 is accessed; buffer register B2 is hidden and cannot be accessed. NOTE: In IC, IPM, or IPWM mode, when a read to register A or B occurs at the same time as a counter bus capture into that register and the counter bus is changing value, then the counter bus capture to that register is delayed. MDASM Status/Control Register (MDASMSCRD) (Duplicated) The MDASMSCRD and the MDASMSCR are the same registers accessed at two different addresses. Reading or writing to one of these two addresses has exactly the same effect. WARNING The user should not write directly to the address of the MDASMSCRD. This register's address may be reserved for future use and should not be accessed by the software to ensure future software compatibility. The duplication of the SCR register allows coherent 32-bit accesses when using an RCPU. 17.9.6.5 MDASM Status/Control Register (MDASMSCR) The status and control register gathers a read only bit reflecting the status of the MDASM signal as well as read/write bits related to its control and configuration. The signal input status bit reflects the status of the corresponding signal when in input mode. When in output mode, the PIN bit only reflects the status of the output flip-flop. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-43 Modular Input/Output Subsystem (MIOS14) MSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 15 Field PIN WOR FREN SRESET Addr LSB -- -- EDPOL FORCA FORCB -- BSL -- MODE 000_0000_0000_0000 0x30 605E, 0x30 6066, 0x30 606E, 0x30 6076, 0x30 607E, 0x30 60DE, 0x30 60E6, 0x30 60EE, 0x30 60F6, 0x30 60FE Figure 17-24. MDASM Status/Control Register (MDASMSCR) Table 17-21. MDASMSCR Bit Descriptions Bits Name Description 0 PIN 1 WOR Wired-OR bit -- In the DIS, IPWM, IPM and IC modes, the WOR bit is not used; reading this bit returns the value that was previously written. In the OCB, OCAB and OPWM modes, the WOR bit selects whether the output buffer is configured for open-drain or totem pole operation. When open-drain mode is selected, the EDPOL bit is not used; writing to EDPOL will have no effect on the output voltage. 1 Output buffer is open-drain. 0 Output buffer is totem pole. The WOR bit is cleared by reset. 2 FREN Freeze enable bit -- This active high read/write control bit enables the MDASM to recognize the MIOB freeze signal. 1 = The MDASM is frozen if the MIOB freeze line is active. 0 = The MDASM is not frozen even if the MIOB freeze line is active. The FREN is cleared by reset. 3 -- 4 EDPOL Polarity bit -- In the DIS mode, this bit is not used; reading it returns the last value written. In the IPWM mode, this bit is used to select the capture edge sensitivity of channels A and B. 1 Channel A captures on a falling edge. Channel B captures on a rising edge. 0 Channel A captures on a rising edge. Channel B captures on a falling edge. In the IPM and IC modes, the EDPOL bit is used to select the input capture edge sensitivity of channel A. 1 Channel A captures on a falling edge. 0 Channel A captures on a rising edge. In the OCB, OCAB and OPWM modes, the EDPOL bit is used to select the voltage level on the output signal. If open-drain mode is selected via the WOR bit, the EDPOL bit is disabled and writing to it will have no effect on the output voltage. 1 The complement of the output flip-flop logic level appears on the output signal: a match on channel A resets the output signal; a match on channel B sets the output signal. 0 The output flip-flop logic level appears on the output signal: a match on channel A sets the output signal, a match on channel B resets the output signal. The EDPOL bit is cleared by reset. 5 FORCA Force A bit -- In the OCB, OCAB and OPWM modes, the FORCA bit allows the software to force the output flip-flop to behave as if a successful comparison had occurred on channel A (except that the FLAG line is not activated). Writing a one to FORCA sets the output flip-flop; writing a zero to it has no effect. In the DIS, IPWM, IPM and IC modes, the FORCA bit is not used and writing to it has no effect. FORCA is cleared by reset and is always read as zero. Writing a one to both FORCA and FORCB simultaneously resets the output flip-flop. Pin Input Status -- The pin input status bit reflects the status of the corresponding bit. Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 17-44 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-21. MDASMSCR Bit Descriptions (continued) Bits Name Description 6 FORCB Force B bit -- In the OCB, OCAB and OPWM modes, the FORCB bit allows the software to force the output flip-flop to behave as if a successful comparison had occurred on channel B (except that the FLAG line is not activated). Writing a one to FORCB resets the output flip-flop; writing a zero to it has no effect. In the DIS, IPWM, IPM and IC modes, the FORCB bit is not used and writing to it has no effect. FORCB is cleared by reset and is always read as zero. Writing a one to both FORCA and FORCB simultaneously resets the output flip-flop. 7:8 -- 9:10 BSL 11 -- 12:15 MODE Reserved Bus select bits -- These bits are used to select which of the six 16-bit counter buses is used by the MDASM. Each MDASM instance has four possible counter buses that may be connected. See Table 17-23 for more information. NOTE: Unconnected counter buses inputs are grounded. Reserved Mode select bits -- The four mode select bits select the mode of operation of the MDASM. To avoid spurious interrupts, it is recommended that MDASM interrupts are disabled before changing the operating mode. The mode select bits are cleared by reset. NOTE: The reserved modes should not be set; if these modes are set, the MDASM behavior is undefined. Table 17-22. MDASM Mode Selects MDASM Control Register Bits Bits of Resolution Counter Bus Bits Ignored 0000 -- -- DIS - Disabled 0001 16 -- IPWM - Input pulse width measurement 0010 16 -- IPM - Input period measurement 0011 16 -- IC - Input capture 0100 16 -- OCB - Output compare, flag on B compare 0101 16 -- OCAB - Output compare, flag on A and B compare 0110 -- -- Reserved 0111 -- -- Reserved 1000 16 -- OPWM - Output pulse width modulation 1001 15 0 OPWM - Output pulse width modulation 1010 14 0,1 OPWM - Output pulse width modulation 1011 13 0-2 OPWM - Output pulse width modulation 1100 12 0-3 OPWM - Output pulse width modulation 1101 11 0-4 OPWM - Output pulse width modulation MODE MDASM Mode of Operation MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-45 Modular Input/Output Subsystem (MIOS14) Table 17-22. MDASM Mode Selects (continued) MDASM Control Register Bits Bits of Resolution Counter Bus Bits Ignored 1110 9 0-6 OPWM - Output pulse width modulation 1111 7 0-8 OPWM - Output pulse width modulation MODE MDASM Mode of Operation Table 17-23. MDASM Counter Bus Selection Connected to: SubModule Type Block Number MDASM CBA CBB CBC CBD BSL0=0 BSL1=0 BSL0=1 BSL1=0 BSL0=0 BSL1=1 BSL0=1 BSL1=1 11 CB6 CB22 CB7 CB8 MDASM 12 CB6 CB22 CB7 CB8 MDASM 13 CB6 CB22 CB23 CB24 MDASM 14 CB6 CB22 CB23 CB24 MDASM 15 CB6 CB22 CB23 CB24 MDASM 27 CB6 CB22 CB23 CB24 MDASM 28 CB6 CB22 CB23 CB24 MDASM 29 CB6 CB22 CB7 CB8 MDASM 30 CB6 CB22 CB7 CB8 MDASM 31 CB6 CB22 CB7 CB8 17.10 MIOS14 Pulse Width Modulation Submodule (MPWMSM) The MIOS14 pulse width modulation submodule (MPWMSM) is a function included in the MIOS14 library. It allows pulse width modulated signals to be generated over a wide range of frequencies, independently of other MIOS14 output signals and with no software intervention. The output pulse width can vary from 0% to 100%. The minimum pulse width is twice the minimum MIOS14 CLOCK period (i.e., the minimum pulse width is 50 ns when fSYS is 40 MHz). The MWPMSM can run in a double-buffered mode, to avoid spurious update. The following sections describe the MPWMSM in detail. A block diagram of the MPWMSM is shown in Figure 17-25. MPC561/MPC563 Reference Manual, Rev. 1.2 17-46 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) PS7 - PS0 Counter Clock 8- bit Prescaler FREN (Ncount) EN TRSP 16-bit Down Counter MPWMCNTR = 0x0001 16-bit <= Comparator EN POL Output Flip-Flop Output Buffer PIN DDR Output Logic Output Logic Output Signal LOAD Pulse Width Register MPWMPULR2 Next Period Register MPWMPERR Next Pulse Width Register MPWMPULR1 FLAG Request Bus Submodule bus Figure 17-25. MPWMSM Block Diagram 17.10.1 MPWMSM Terminology Terminology used in the MIOS14 pulse width modulation submodule includes the following: Bits of resolution The MPWMSM contains a 16-bit modulus down-counter that counts from the desired loaded value to 0x0001. The term "bits of resolution" is used in this document to indicate the size of the equivalent free running binary counter. To cover the worst case, the number of bits is rounded to the lower number. For example, if the counter is preset with a value between 128 and 255, it is said to have seven bits of resolution. If it is preset with a value between 256 and 511, it is said to have eight bits of resolution, and so on. Resolution The term "resolution" is used in this document to define the minimum MPWMSM output increment in time units. 17.10.2 MPWMSM Features * * Output pulse width modulated (PWM) signal generation with no software intervention Built-in 8-bit programmable prescaler clocked by the MCPSM MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-47 Modular Input/Output Subsystem (MIOS14) * * * * * * PWM period and pulse width values provided by software: -- Double-buffered for glitch-free period and pulse width changes -- Minimum output period/pulse-width increment: 50 ns (assuming fSYS = 40 MHz) -- Maximum 50% duty-cycle output frequency: 10 MHz (assuming fSYS = 40 MHz) -- Up to 16 bits of resolution for the output pulse width -- Wide range of periods - 16 bits of resolution: period range from 3.27 ms (with 50-ns steps) to 6.71 s (with 102.4 s steps) - Eight bits of resolution: period range from 12.8 s (with 50-ns steps) to 26.2 ms (with 102.4-s steps) -- Wide range of frequencies - Maximum output frequency at fSYS = 40 MHz with 16 bits of resolution and divide-by-2 prescaler selection: 305 Hz (3.27 ms.) - Minimum output frequency at fSYS = 40 MHz with 16 bits of resolution and divide-by-4096 prescaler selection: 0.15 Hz (6.7 s.) - Maximum output frequency at fSYS = 40 MHz with 8 bits of resolution and divide-by-2 prescaler selection: 78125 Hz (12.8 s.) - Minimum output frequency at fSYS = 40 MHz with 8 bits of resolution and divide-by-4096 prescaler selection: 38.15 Hz (26.2 ms.) Programmable duty cycle from 0% to 100% Possible interrupt generation at start of every period Software selectable output pulse polarity Software readable output signal status Possible use of signal as I/O port when PWM function is not needed 17.10.3 MPWMSM Description The purpose of the MPWMSM is to create a variable pulse width output signal at a wide range of frequencies, independently of other MIOS14 output signals. The MPWMSM includes its own counter, and thus does not use the MIOS14 counter bus set. However the MPWMSM uses the prescaled clock bus that originates in the MIOS14 counter prescaler submodule (MCPSM). The MPWMSM pulse width can vary from 0% to 100%, with up to 16 bits of resolution. The finest output resolution is the MIOS14 CLOCK period multiplied by two (for a MIOS14 CLOCK with fSYS = 40 MHz, the finest output pulse width resolution is 50 ns). With the full 16 bits of resolution and the MCPSM set to divide by two, the period of the output signal can range from 3.276 ms to 6.71 s (assuming fSYS = 40 MHz). By reducing the amount of bits of resolution, the output signal period can be reduced. For example, the period can be as fast as 204.8 s (4882 Hz) with 12 bits of resolution, as fast as 12.8 s (78.125 KHz) with eight bits of resolution, and as fast as 3.2 s (312.5 KHz) with six bits of resolution (still assuming a fSYS = 40 MHz and the MCPSM set to divide by two). The MPWMSM is composed of: MPC561/MPC563 Reference Manual, Rev. 1.2 17-48 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) * * * * * * * * An output flip-flop with output buffer and polarity control An input/output signal with data direction control An 8-bit prescaler and clock selection logic A 16-bit down-counter (MPWMCNTR) A register to hold the next period values (MPWMPERR) Two registers to hold the current and next pulse width values (MPWMPULR) A less-than or equal comparator A status and control register (MPWMSCR) 17.10.3.1 Clock Selection The MPWMSM contains an 8-bit prescaler clocked by the output signal from the MIOS14 counter prescaler submodule (fSYS/2 to fSYS/16). The MPWMSM clock selector allows the choice, by software, of one of 256 divide ratios which give to the MPWMSM a large choice of frequencies available for the down-counter. The MPWMSM down-counter is thus capable of counting with a clock frequency ranging from fSYS/2 to fSYS/4096. Switching the MPWMSM from disable to enable will reload the value of MPWMSCR[CP] into the 8-bit prescaler counter. 17.10.3.2 Counter A 16-bit down-counter in the MPWMSM provides the time reference for the output signal. The counter is software writable. When writing to the counter (i.e., at the MPWMCNTR address), it also writes to the MPWMPERR register. When in transparent mode (TRSP = 1), writing to the MPWMPERR will also write to the counter. The down-counter is readable at anytime. The value loaded in the down-counter corresponds to the period of the output signal. When the MPWMSM is enabled, the counter begins counting. As long as it is enabled, the counter counts down freely. The counter counts at the rate established by the prescaler. When the count down reaches 0x0001, the load operation is executed and the value in the MPWMPERR register is loaded in the MPWMCNTR register, (i.e., the counter). Then the counter restarts to count down from that value. 17.10.3.3 Period Register The period section is composed of a 16-bit data register (MPWMPERR). The software establishes the period of the output signal in register MPWMPERR. When the MPWMSM is running in transparent mode, the period value in register MPWMPERR is immediately transferred to the counter on a write to the MPWMPERR. When the MPWMSM is running in double-buffered mode, the period value in register MPWMPERR can be changed at any time without affecting the current period of the output signal. The new value of MPWMPERR will be transferred to the counter only when the counter reaches the value of 0x0001 and generates a load signal. Period values of 0x0000, 0x0001, and 0x0002 are MPWMSM special cases: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-49 Modular Input/Output Subsystem (MIOS14) * * * The value 0x0000 in the period register, causes the counter to act like a free running counter. This condition creates a period of 65536 PWM clock periods. The value 0x0001 in the period register will always cause a period match to occur and the counter will never decrement below 0x0001. This condition is defined as a period of "1" PWM clock count. The output flip-flop is always set unless MPWMPULR = 0x0000, when the output flip-flop is always reset. Refer to Section 17.10.3.5, "Duty Cycles (0% and 100%)" for details about 0% and 100% duty cycles. Writing value 0x0002 in the period register causes a period match to occur every two clock periods. The counter decrements from 0x0002 to 0x0001, and then it is initialized back to 0x0002. This condition is defined as a period of 2 clock counts. Note that the value 0x0002 loaded in the period register and a value of 0x0001 in the pulse width register is the condition to obtain the maximum possible output frequency for a given clock period. The relationship between the output frequency obtained (FPWMO) and the MIOS14 CLOCK frequency (fSYS), the MCPSM clock divide ratio (NMCPSM), the counter divide ratio (NMPWMSM) and the value loaded in the counter (VCOUNTER) is given by the following equation: fPWMO = fSYS NMCPSM * NMPWMSM * VCOUNTER 17.10.3.4 Pulse Width Registers The pulse width section is composed of two 16-bit data registers (MPWMPULR1 and MPWMPULR2). Only MPWMPULR1 is accessible by software. The software establishes the pulse width of the MPWMSM output signal in MPWMPULR1. MPWMPULR2 is used as a double buffer of MPWMPULR1. When the MPWMSM is running in transparent mode, the pulse width value in MPWMPULR1 is immediately transferred in MPWMPULR2 so that the new value takes effect immediately. NOTE When the MPWMSM is in disable mode, writing to MPWMPULR1 will write automatically to MPWMPULR2. When the MPWMSM is not running in double-buffered mode, the pulse width value in MPWMPULR1 can be changed at any time without affecting the current pulse width of the output signal. The new value in MPWMPULR1 will be transferred to MPWMPULR2 only when the down-counter reaches the value of 0x0001. When the counter first reaches the value in MPWMPULR2, the output flip-flop is set. The output is reset when the counter reaches 0x0001. The pulse width match starts the width of the output signal, it does not affect the counter. MPWMPULR1 is software readable and writable at any time. The MPWMSM does not modify the content of MPWMPULR1. The PWM output pulse width can be as wide as one period minus one MPWMSM clock count: (i.e., MPWMPULR2 = MPWMPERR -- [one MPWMSM clock count]). At the other end of the pulse width range, MPWMPULR2 can contain 0x0001 to create a pulse width of one PWM clock count. MPC561/MPC563 Reference Manual, Rev. 1.2 17-50 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) For example, with 0x00FF in the counter and 0x0002 in MPWMPULR2, the period is 255 PWM clock count and the pulse width is 2 PWM clock counts. For a given system clock frequency, with a given counter divide ratio and clock selection divide ratio, the output pulse width is given by the following equation: N MCPSM N MPWMSM V MPWMB2 Pulse_Width = --------------------------------------------------------------------------------------------------------f SYS where VMPWMB2 is the value in the register B2 In such conditions, the minimum output pulse width that can be obtained is given by: N MCPSM N MPWMSM Minimum_Pulse_Width = ------------------------------------------------------------------f SYS and the maximum pulse width by: Bit_of_Resolution N MCPSM N MPWMSM ( 2 - 1) Maximum_Pulse_Width = ----------------------------------------------------------------------------------------------------------------------------------------f SYS 17.10.3.5 Duty Cycles (0% and 100%) The 0% and 100% duty cycles are special cases to give flexibility to the software to create a full range of outputs. The "always set" and "always clear" conditions of the output flip-flop are established by the value in register MPWMPULR2. These boundary conditions are generated by software, just like another pulse. When the PWM output is being used to generate an analog level, the 0% and 100% represent the full scale values. The 0% output is created with a 0x0000 in register MPWMPULR2, which prevents the output flip-flop from ever being set. The 100% output is created when the content of register MPWMPULR2 is equal to or greater than the content of register MPWMPERR. Thus, the width register match occurs on counter reload. The state sequencer provides the timing to ensure that the first appearance of a 100% value in register MPWMPULR2 causes a glitchless always-set condition of the output flip-flop when TRSP = `0'. NOTE Even if the output is forced to 100%, the 16-bit up counter continues its counting and that output changes to or from the 100% value are done synchronously to the selected period. NOTE When a PWM output period is selected to be 65536 PWM clocks by loading 0x0000 in the period register, it is not possible to have an 100% duty cycle output signal. In this case, the maximum duty cycle available is of 65535/65536. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-51 Modular Input/Output Subsystem (MIOS14) 17.10.3.6 Pulse/Frequency Range Table Table 17-24 summarizes the frequency and minimum pulse width values that can be obtained respectively with divide-by-1 and divide-by-256 MPWMSM clock prescaler options, while using a MIOS14 CLOCK frequency of 40 MHz, and for each MCPSM clock divide ratios. Table 17-24. PWM Pulse/Frequency Ranges (in Hz) Using /1 or /256 Option (40 MHz) Minimum Pulse Width Bits of Resolution 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 With /1 Option 50 ns/2 305 610 1220 2441 4882 9765 19.5 K 39K 78K 156K 312K 625K 1250 K 2500 K 5000 K 10000 K 75 ns/3 203 407 814 1628 3255 6510 13K 26K 52K 104K 208K 416K 833 K 1666 K 3333 K 6666K 100 ns/4 152 305 610 1220 2441 4882 9765 19.5 K 39K 78K 156K 312K 625 K 1250 K 2500 K 5000K 125 ns/5 122 244 488 976 1953 3906 7812 15.6 K 31.3 K 62.5K 125K 250K 500 K 1000 K 2000 K 4000K 150 ns/6 101 203 407 814 1628 3255 6510 13K 26K 833K 1666 K 3333K 175 ns/7 87.2 174 348 697 1395 2790 5580 11.1 K 22.3 K 357K 714K 1428 K 2857K 200 ns/8 76.3 152 305 610 1220 2441 4882 9765 19.5 K 312 K 625K 1250 K 2500K 225 ns/9 67.8 135 271 542 1085 2170 4340 8680 17.3 K 277K 555K 1111 K 2222K 250 ns/10 61 122 244 488 976 1953 3906 7812 15.K 31.3K 62.5 125K 250 K 500 K 1000 K K 2000K 275 ns/11 55.5 111 222 443 887 1775 3551 7102 14.2 K 300 ns/12 50.8 101 203 407 814 1628 3255 6510 13K 26K 52K 104K 208 K 416K 833 K 1666 K 325 ns/13 46.9 93.9 187 375 751 1502 3004 6009 12K 24K 48K 96.1 K 192 K 384K 769 K 1538 K 350 ns/14 43.6 87.2 174 348 697 1395 2790 5580 11.1 K 22.3 K 44.6 K 89.3 K 178 K 357K 714 K 1428K 375 ns/15 40.7 81.4 162 325 651 1302 2604 5208 10.4 K 20.8 K 41.6 K 83.3 K 166 K 333K 666 K 1333 K 400 ns/16 38.1 76.3 152 305 610 1220 2441 4882 9765 19.5K 39K 78K 156K 312K 625K 1250K 12.8 s/512 1.192 2.384 4.768 9.536 19.07 38.14 76.29 152.5 305.1 610.3 1220 2441 4882 9765 19.5K 39K 19.2 s/768 0.794 1.589 3.178 6.357 12.71 25.43 50.86 101.7 203.4 406.9 813. 8 3255 6510 26K 52K 104K 208K 416 K 44.6K 89.3 178K K 39K 78K 156 K 34.7K 69.4 138K K 28.4K 56.8 113K 227 K K 454K 909 K 1818 K With /256 Option 1627 13 K MPC561/MPC563 Reference Manual, Rev. 1.2 17-52 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-24. PWM Pulse/Frequency Ranges (in Hz) Using /1 or /256 Option (40 MHz) (continued) Minimum Pulse Width Bits of Resolution 5 4 3 2 1 1220 2441 4882 9765 19.5K 244.1 488. 2 976. 5 1953 3906 7812 15.6K 38.4 s /1536 0.397 0.795 1.589 3.179 6.358 12.71 25.43 50.86 101.7 203.5 406. 9 813. 8 1627 3255 6510 13K 44.8 s /1792 0.34 0.681 1.362 2.724 5.449 10.89 21.80 43.59 87.19 174.4 348. 8 697. 5 1395 2790 5580 11.1K 51.2 s /2048 0.298 0.596 1.192 2.384 4.768 9.536 19.07 38.14 76.29 152.5 305. 1 610. 3 1220 2441 4882 9765 57.6 s /2304 0.264 0.529 1.059 2.119 4.238 8.477 16.95 33.90 67.81 135.6 271. 2 542. 5 1085 2170 4340 8680 244. 1 488. 2 976.5 1953 3906 7812 70.4 s /2816 0.216 0.433 0.867 1.734 3.468 6.936 13.87 27.74 55.48 110.9 221. 9 443. 9 887.8 1775 3551 7102 76.8 s /3072 0.198 0.397 0.795 1.589 3.179 6.358 12.71 25.43 50.86 101.7 203. 5 406. 9 813.8 1627 3255 6510 83.2 s /3328 0.183 0.366 0.733 1.467 2.934 5.869 11.74 23.47 46.95 187. 8 375. 6 751.2 1502 3004 6009 89.6 s /3584 0.170 0.340 0.681 1.362 2.724 5.449 10.89 21.80 43.59 87.19 174. 4 348. 8 697.5 1395 2790 5580 96 s/3840 0.159 0.318 0.636 1.271 2.543 5.086 10.17 20.34 40.69 81.38 162. 8 325. 5 651 1302 2604 5208 25.6 s /1024 16 15 14 13 12 11 10 9 8 7 6 0.596 1.192 2.384 4.768 9.536 19.07 38.14 76.29 152.5 305.1 610. 3 32 s/1280 0.476 0.953 1.907 3.814 7.629 15.24 30.51 61.03 122 64 s/2560 0.238 0.476 0.953 1.907 3.814 7.629 15.24 30.51 61.03 122 93.9 17.10.3.7 MPWMSM Status and Control Register (SCR) One register is used to initialize the MPWMSM and monitor its operation. Control bits are included to allow the software to enable the PWM generator, establish the output signal polarity, select the counter clock rate and set the glitch-free mode. A status bit is included to allow the software to read the state of the output signal. 17.10.3.8 MPWMSM Interrupt A valid MPWMSM interrupt is recognized when a pulse occurs on the flag line to set the flag bit and the interrupt enable bit is set for the corresponding level in the MIRSM (Refer to Section 17.12, "MIOS14 Interrupts," Section 17.12.1, "MIOS14 Interrupt Structure" and Section 17.12.2, "MIOS14 Interrupt Request Submodule (MIRSM)" for details about interrupts). A set flag pulse is generated at the start of every period. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-53 Modular Input/Output Subsystem (MIOS14) The flag bit is a status bit which indicates, when set, that the output period has started and that registers MPWMPERR and MPWMPULR1 are available for updates when in double-buffered mode. The level of the resulting interrupt is determined in the MIRSM. 17.10.3.9 MPWMSM Port Functions The MPWMSM has one dedicated I/O external signal. The output flip-flop is the basic output of the MPWMSM. Except when the pulse width is at 100% or 0%, the output flip-flop is reset at the beginning of each period and is set at the beginning of the designated pulse width until the end of the period. As a software option, the polarity of the signal presented to the output signal may be the state of the output flip-flop or the inverse of the output flip-flop. The MPWMSM is connected to an external, input/output signal. When in the disabled mode, the POL bit (polarity) and the DDR bit (data direction) in the SCR register allow the MPWMSM to be used as an I/O port. 17.10.3.10 MPWMSM Data Coherency Byte accesses to MPWMPULR and MPWMPERR are supported, but are not recommended as the transfer from the primary registers to the secondary registers are done as a 16-bit word transfer. For most MPWMSM operations, 16-bit accesses are sufficient and long word accesses (32-bit) are treated as two 16-bit accesses, with one exception -- a long word write to the period/pulse width registers. In this case, if the long word write takes place within the PWM period, there is no visible effect on the output signal and the new values stored in MPWMPERR and MPWMPULR are ready to be loaded into the buffer registers at the start of the next period. If, however, the long word write coincides with the end of the period, then the transfer of values from the primary to the secondary registers is delayed until the end of the next period; during this period the previous values are used for the period and width. This feature enables updates of the period and pulse-width values without getting erroneous pulses. 17.10.4 Modular Input/Output Bus (MIOS14) Interface The MPWMSM is connected to all the signals in the read/write and control bus, to allow data transfer from and to the MPWMSM registers, and to control the MPWMSM in the different possible situations. * The MPWMSM is not using any of the 16-bit counter buses. * The MPWMSM uses the request bus to transmit to the request submodule. 17.10.5 Effect of RESET on MPWMSM The MPWMSM is affected by reset according to what is described in the section related to register description. The MPWMPERR, MPWMPULR, and MPWMCNTR registers, together with the clock prescaler register bits, must be initialized by software, since they are undefined after hardware reset. MPC561/MPC563 Reference Manual, Rev. 1.2 17-54 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) A value must be written to the MPWMCNTR (which writes the same value into the MPWMPERR) and a pulse width value written to MPWMPULR, before the MPWMSCR is written to. The latter access initializes the clock prescaler. 17.10.6 MPWMSM Registers The privilege level to access to the MPWMSM registers depends on the MIOS14MCR[SUPV]. The privilege level is unrestricted after reset and can be change to supervisor by software. 17.10.6.1 MPWMSM Registers Organization The MPWMSM register map comprises four 16-bit register locations, as shown in Table 17-25. All unused bits return zero when read by the software. All register addresses in this section are specified as offsets from the base address of the MPWMSM. Table 17-25. MPWMSM Address Map Address Register MPWMSM0 0x30 6000 MPWMSM0 Period Register (MPWMPERR) See Table 17-26 for bit descriptions. 0x30 6002 MPWMSM0 Pulse Register (MPWMPULR) See Table 17-27 for bit descriptions. 0x30 6004 MPWMSM0 Count Register (MPWMCNTR) See Table 17-28 for bit descriptions. 0x30 6006 MPWMSM0 Status/Control Register (MPWMSCR) See Table 17-29 for bit descriptions. MPWMSM1 0x30 6008 MPWMSM1 Period Register (MPWMPERR) 0x30 600A MPWMSM1 Pulse Register (MPWMPULR) 0x30 600C MPWMSM1 Count Register (MPWMCNTR) 0x30 600E MPWMSM1 Status/Control Register (MPWMSCR) MPWMSM2 0x30 6010 MPWMSM2 Period Register (MPWMPERR) 0x30 6012 MPWMSM2 Pulse Register (MPWMPULR) 0x30 6014 MPWMSM2 Count Register (MPWMCNTR) 0x30 6016 MPWMSM2 Status/Control Register (MPWMSCR) MPWMSM3 0x30 6018 MPWMSM3 Period Register (MPWMPERR) 0x30 601A MPWMSM3 Pulse Register (MPWMPULR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-55 Modular Input/Output Subsystem (MIOS14) Table 17-25. MPWMSM Address Map (continued) Address Register 0x30 601C MPWMSM3 Count Register (MPWMCNTR) 0x30 601E MPWMSM3 Status/Control Register (MPWMSCR) MPWMSM4 0x30 6020 MPWMSM4 Period Register (MPWMPERR) 0x30 6022 MPWMSM4 Pulse Register (MPWMPULR) 0x30 6024 MPWMSM4 Count Register (MPWMCNTR) 0x30 6026 MPWMSM4 Status/Control Register (MPWMSCR) MPWMSM5 0x30 6028 MPWMSM5 Period Register (MPWMPERR) 0x30 602A MPWMSM5 Pulse Register (MPWMPULR) 0x30 602C MPWMSM5 Count Register (MPWMCNTR) 0x30 602E MPWMSM5 Status/Control Register (MPWMSCR) MPWMSM16 0x30 6080 MPWMSM16 Period Register (MPWMPERR) 0x30 6082 MPWMSM16 Pulse Register (MPWMPULR) 0x30 6084 MPWMSM16 Count Register (MPWMCNTR) 0x30 6086 MPWMSM16 Status/Control Register (MPWMSCR) MPWMSM17 0x30 6088 MPWMSM17 Period Register (MPWMPERR) 0x30 608A MPWMSM17 Pulse Register (MPWMPULR) 0x30 608C MPWMSM17 Count Register (MPWMCNTR) 0x30 608E MPWMSM17 Status/Control Register (MPWMSCR) MPWMSM18 0x30 6090 MPWMSM18 Period Register (MPWMPERR) 0x30 6092 MPWMSM18 Pulse Register (MPWMPULR) 0x30 6094 MPWMSM18 Count Register (MPWMCNTR) 0x30 6096 MPWMSM18 Status/Control Register (MPWMSCR) MPWMSM19 0x30 6098 MPWMSM19 Period Register (MPWMPERR) 0x30 609A MPWMSM19 Pulse Register (MPWMPULR) 0x30 609C MPWMSM19 Count Register (MPWMCNTR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-56 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-25. MPWMSM Address Map (continued) Address 0x30 609E Register MPWMSM19 Status/Control Register (MPWMSCR) MPWMSM20 0x30 60A0 MPWMSM20 Period Register (MPWMPERR) 0x30 60A2 MPWMSM20 Pulse Register (MPWMPULR) 0x30 60A4 MPWMSM20 Count Register (MPWMCNTR) 0x30 60A6 MPWMSM20 Status/Control Register (MPWMSCR) MPWMSM21 0x30 60A8 MPWMSM21 Period Register (MPWMPERR) 0x30 60AA MPWMSM21 Pulse Register (MPWMPULR) 0x30 60AC MPWMSM21 Count Register (MPWMCNTR) 0x30 60AE MPWMSM21 Status/Control Register (MPWMSCR) 17.10.6.2 MPWMSM Period Register (MPWMPERR) The period register contains the binary value corresponding to the period to be generated. MSB 0 LSB 1 Field 2 3 4 5 6 7 8 9 10 11 12 13 14 15 PER SRESET Undefined Addr 0x30 6000, 0x30 6008, 0x30 6010, 0x30 6018, 0x30 6020, 0x30 6028, 0x30 6080, 0x30 6088, 0x30 6090, 0x30 6098, 0x30 60A0, 0x30 60A8 Figure 17-26. MPWMSM Period Register (MPWMPERR) Table 17-26. MPWMPERR Bit Descriptions Bits Name 0:15 PER Description Period. These bits contain the binary value corresponding to the period to be generated. 17.10.6.3 MPWMSM Pulse Width Register (MPWMPULR) The pulse width register contains the binary value of the pulse width to be generated. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-57 Modular Input/Output Subsystem (MIOS14) MSB LSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 15 PUL SRESET Undefined Addr 0x30 6002, 0x30 600A, 0x30 6012, 0x30 601A, 0x30 6022, 0x30 602A, 0x30 6082, 0x30 608A, 0x30 6092, 0x30 609A, 0x30 60A2, 0x30 60AA Figure 17-27. MPWMSM Pulse Width Register (MPWMPULR) Table 17-27. MPWMPULR Bit Descriptions Bits Name 0:15 PUL Description Pulse width. These bits contain the binary value of the pulse width to be generated. 17.10.6.4 MPWMSM Counter Register (MPWMCNTR) The counter register reflects the actual value of the MPWMSM counter. This register is writable only through the period register (PWMPERR). Writes to the counter register will write the same value to the period register. MSB LSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 15 CNT SRESET Undefined Addr 0x30 6004, 0x30 600C, 0x30 6014, 0x30 601C, 0x30 6024, 0x30 602C, 0x30 6084, 0x30 608C, 0x30 6094, 0x30 609C, 0x30 60A4, 0x30 60AC Figure 17-28. MPWMSM Counter Register (MPWMCNTR) Table 17-28. MPWMCNTR Bit Descriptions Bits Name 0:15 CNT Description Counter. These bits reflect the actual value of the MPWMSM counter. 17.10.6.5 MPWMSM Status/Control Register (MPWMSCR) The status and control register gathers read only bits reflecting the status of the MPWMSM signal as well as read/write bits related to its control and configuration. MSB 0 Field PIN SRESET U LSB 1 2 3 4 DDR FREN TRSP POL 000_00 5 EN 6 7 8 9 10 11 -- 12 13 14 15 CP Undefined Addr 0x30 6004, 0x30 600C, 0x30 6014, 0x30 601C, 0x30 6024, 0x30 602C, 0x30 6084, 0x30 608C, 0x30 6094, 0x30 609C, 0x30 60A4, 0x30 60AC Figure 17-29. MPWMSM Status/Control Register (MPWMSCR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-58 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-29. MPWMSCR Bit Descriptions Bits Name Description 0 PIN Pin input status bit -- The PIN bit reflects the state present on the MPWMSM signal. The software can thus monitor the pin state. The PIN bit is a read-only bit. Writing to the PIN bit has no effect. 1 DDR Data direction register -- The DDR bit indicates the direction for the signal when the PWM function is not used (disable mode). 0 signal is in input. 1 signal is in output. The DDR bit is cleared by reset. Table 17-30 lists the different uses for the polarity (POL) bit, the enable (EN) bit and the data direction register (DDR) bit. 2 FREN Freeze enable bit -- This active high read/write control bit enables the MPWMSM to recognize the freeze signal on the MIOB. 0 MPWMSM not frozen even if the MIOB freeze line is active. 1 MPWMSM frozen if the MIOB freeze line is active. The FREN is cleared by reset. 3 TRSP Transparent mode -- The TRSP bit indicates that the MPWMSM is in transparent mode. In transparent mode, when the software writes to either the MPWMPERR or MPWMPULR1 register the value written is immediately transferred to the counter or register MPWMPULR2 respectively. 0 Double-buffered mode. 1 Transparent mode. The TRSP bit is cleared by reset. 4 POL Output polarity control bit -- The POL bit works in conjunction with the EN bit and controls whether the MPWMSM drives the signal with the direct or the inverted value of the output flip-flop. Table 17-30 lists the different uses for the polarity (POL) bit, the enable (EN) bit and the data direction register (DDR) bit. 5 EN Enable PWM signal generation -- The EN bit defines whether the MPWMSM generates a PWM signal or is used as an I/O channel: 0 PWM generation disabled (signal can be used as I/O). 1 PWM generation enabled (the signal is in output mode). Each time the submodule is enabled, the value of CP is loaded into the prescaler. The EN bit is cleared by reset. 6:7 -- Reserved 8:15 CP Clock prescaler -- This 8-bit read/write data register stores the modulus value for loading into the built-in 8-bit clock prescaler. The value loaded defines the divide ratio for the signal that clocks the MPWMSM. The new value is loaded into the prescaler counter on the prescaler counter overflow, or upon the EN bit of the MPWMSCR being set. Table 17-31 gives the clock divide ratio according to the value of CP. . Table 17-30. PWMSM Output Signal Polarity Selection Control Bits POL EN DDR Signal Direction Signal State Periodic Edge Variable Edge Optional InterruptIon 0 0 0 Input INPUT -- -- -- 0 0 1 Output Always Low -- -- -- 0 1 X Output High Pulse Falling Edge Rising Edge Falling Edge 1 0 0 Input INPUT -- -- -- MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-59 Modular Input/Output Subsystem (MIOS14) Table 17-30. PWMSM Output Signal Polarity Selection (continued) 1 0 1 Output Always High -- -- -- 1 1 X Output Low Pulse Rising Edge Falling Edge Rising Edge Table 17-31. Prescaler Values Prescaler Value (CP in Hex) MCPSM Divide Ratio: FF 1 FE 2 FD 3 FC 4 FB 5 FA 6 F9 7 F8 8 ...... ........ 02 254 (2^8 -2) 01 255 (2^8 -1) 00 256 (2^8) 17.11 MIOS14 16-bit Parallel Port I/O Submodule (MPIOSM) The MIOS14 parallel port I/O submodule (MPIOSM) is a function included in the MIOS14 library in order to provide the required port I/O capability. The MPIOSM can operate without the involvement of other MIOS14 submodules. Each implemented MPIOSM provides I/O capability for up to 16 signals. The following sections describe the MPIOSM in detail. A block diagram of one bit of the MPIOSM is shown in Figure 17-30. The MPIOSM contains 16 such blocks. MIOS14 Bus (MIOB) Data Direction Register I/O Signal Data Register Output Driver Input Figure 17-30. MPIOSM 1-Bit Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 17-60 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) 17.11.1 MPIOSM Features * * * * A submodule of the MIOS14 library Uses two 16-bit registers in the address space Up to 16 bidirectional parallel input/output signals Simple DDR (data direction register) concept for signal direction selection 17.11.2 MPIOSM Signal Functions Table 17-32 shows the MPIOSM I/O signal functions according to the setting of the DDR when writing to or reading from the DR. Table 17-32. MPIOSM I/O Signal Function Operation Performed DDR I/O Signal Function Write 0 The I/O signal is in input mode. Data is written into the DR. Write 1 Data is written into the DR and output to the I/O signal. Read 0 The I/O signal is in input mode. The state of the I/O signal is read. Read 1 The I/O signal is in an output mode. The DR is read. 17.11.3 MPIOSM Description 17.11.3.1 MPIOSM Port Function A MIOS14 parallel port I/O submodule can handle up to 16 input/output signals. The number of I/O signals is determined at the time of silicon implementation. The MPIOSM has two 16-bit registers: the data register (DR) and the data direction register (DDR). Each signal of the MPIOSM may be programmed as an input or an output, determined by the state of the corresponding bit in the DDR. The data direction register can be written to or read by the processor. During the programmed output state, a read of the data register reads the value of the output data latch and not the I/O signal. See Figure 17-30 and Table 17-32. During reset, all MPIOSM signals are configured as inputs. The contents of the data register are undefined after reset. As a general practice, it is recommended to write a value in the data register before configuring its corresponding I/O signal as an output. 17.11.3.2 Non-Bonded MPIOSM Pads A non-bonded MPIOSM pad reads `0' when it is configured as an input. When configured as an output, it indicates the current state of the output data latch. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-61 Modular Input/Output Subsystem (MIOS14) 17.11.4 Modular I/O Bus (MIOB) Interface * * * The MPIOSM is connected to all the signals in the read/write and control bus, to allow data transfer from and to the MPIOSM registers, and to control the MPIOSM in the different possible situations. The MPIOSM does not use the counter bus set and is therefore not connected to it. The MPIOSM does not generate any interrupts and is therefore not connected to this bus. 17.11.5 Effect of RESET on MPIOSM When the RESET signal is asserted, all the DDR bits are cleared. The data bits are undefined after reset. 17.11.6 MPIOSM Testing No special test logic has been implemented in this submodule. To be flexible while selecting the number of implemented signals, the test patterns are implemented in a bit per bit modular fashion. 17.11.7 MPIOSM Registers The privilege level to access to the MPIOSM registers depends on the MIOS14MCR[SUPV]. The privilege level is unrestricted after reset and can be change to supervisor by software. 17.11.8 MPIOSM Register Organization MSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 LSB 15 0x30 6100 MPIOSM Data Register (MPIOSMDR) 0x30 6102 MPIOSM Data Direction Register (MPIOSMDDR) 0x30 6104 Reserved 0x30 6106 Reserved Figure 17-31. MPIOSM -- Register Organization 17.11.8.1 MPIOSM Data Register (MPIOSMDR) MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Field Data Data Data Data Data Data Data Data Data Data Data Data Data Data Data Data 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SRESET Addr Undefined 0x30 6100 Figure 17-32. MPIOSM Data Register (MPIOSMDR) MPC561/MPC563 Reference Manual, Rev. 1.2 17-62 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-33. MPIOSMDR Bit Descriptions Bits Name 15:0 DATA15- DATA0 Description These bits are read/write data bits that define the value to be driven to the pad in output mode, for each implemented I/O signal of the MPIOSM. The Msb is 15, Lsb is 0. 17.11.8.2 MPIOSM Data Direction Register (MPIOSMDDR) MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Field DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR DDR 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SRESET 0000_0000_0000_0000 Addr 0x30 6100 Figure 17-33. MPIOSM Data Direction Register (MPIOSMDDR) Table 17-34. MPIOSMDDR Bit Descriptions Bits Name 0:15 DDR15- DDR0 Description These bits are read/write data bits that define the data direction status for each implemented I/O signal of the MPIOSM 0 = corresponding signal is input. 1 = corresponding signal is output. 17.12 MIOS14 Interrupts This section describes the interrupt functions of the MIOS14 and its submodules and how these interrupts are passed to the CPU via the peripheral bus. Interrupt requests from the MIOS14 are treated as exceptions by the CPU and are dealt with by the CPU's exception processing routines. For a more detailed description of exception processing in the relevant microprocessors, please refer Chapter 3, "Central Processing Unit" and to the RCPU Reference Manual. 17.12.1 MIOS14 Interrupt Structure The MIOS14 and its submodules are capable of generating interrupts on different levels to be transmitted to the CPU via the peripheral bus. Inside the MIOS14, all the information required for requesting and servicing the interrupts are treated in two different sections: * The interrupt request submodules (MIRSM) * The interrupt control section (ICS) of the MBISM The MIRSM gathers in service request flags from each group of up to 16 submodules and transfers those requests to the MIOS14 interrupt control section (ICS). Figure 17-34 shows a block diagram of the whole interrupt architecture. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-63 Modular Input/Output Subsystem (MIOS14) Submodule 15 MIRSM0 Submodule 0 (flags) MBISM Status register Interrupt Control Enable register IRQ Pend. register Submodule 31 MIRSM1 Submodule 16 (flags) Status register Enable register IRQ Pend. register IMB3 NOTE: Submodules 9, 10, 25, and 26 are reserved on the MPC561, MPC562, MPC563, and MPC564. Figure 17-34. MIOS14 Interrupt Structure 17.12.2 MIOS14 Interrupt Request Submodule (MIRSM) Each submodule that is capable of generating an interrupt can assert a flag line when an event occurs. On MPC561/MPC563 each MIRSM serves 14 submodules. Each MIRSM includes: * One 16-bit status register (for the flags) * One 16-bit enable register for each implemented level * One 16-bit IRQ pending register for each implemented level One bit position in each of the above registers is associated with one submodule. MPC561/MPC563 Reference Manual, Rev. 1.2 17-64 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) NOTE If a submodule in a group of 16 cannot generate interrupts, then its corresponding flag bit in the status register is inactive and is read as zero. When an event occurs in a submodule that activates a flag line, the corresponding flag bit in the status register is set. The status register is read/write, but a flag bit can be reset only if it has previously been read as a one. Writing a "one" to a flag bit has no effect. When the software intends to clear only one flag bit within a status register, the software must write an all-ones 16-bit value except for the bit position to be cleared which is a zero. The enable register is initialized by the software to indicate whether each interrupt request is enabled for the levels defined in the ICS. NOTE In the case of multiple requests levels implementation in the same MIOS14, it is possible to enable interrupts at more than one different levels for the same submodule. It is the responsibility of the software to manage this. Each bit in the IRQ pending register is the result of a logical "AND" between the corresponding bits in the status and in the enable registers. If a flag bit is set and the level enable bit is also set, then the IRQ pending bit is set, and the information is transferred to the interrupt control section that is in charge of sending the corresponding level to the CPU. The IRQ pending register is read only. NOTE When the enable bit is not set for a particular submodule, the corresponding status register bit is still set when the corresponding flag is set. This allows the traditional software approach of polling the flag bits to see which ones are set. The status register makes flag polling easy, since up to 16 flag bits are contained in one register. The submodule number of an interrupting source defines the corresponding MIRSM number and the bit position in the status registers. To find the MIRSM number and bit position of an interrupting source, proceed as follow: 1. Divide the interrupting submodule number by 16 2. The integer result of the division gives the MIRSM number 3. The reminder of the division gives the bit position 17.12.3 MIRSM0 Interrupt Registers 17.12.3.1 Interrupt Status Register (MIOS14SR0) This register contains the flag bits that are raised when the submodules generate an interrupt. Each bit corresponds to a given submodule. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-65 Modular Input/Output Subsystem (MIOS14) MSB LSB 0 Field FLG 15 1 2 3 4 FLG 14 FLG 13 FLG 12 FLG 11 5 6 7 -- 8 9 10 11 12 13 14 15 FLG FLG FLG FLG FLG FLG FLG FLG FLG 8 7 6 5 4 3 2 1 0 SRESET Undefined Addr 0x30 6C00 Figure 17-35. Interrupt Status Register (MIOS14SR0) Table 17-35. MIOS14SR0 Bit Description Bits 0:4 Name Description FLG15:11 Flag Bits -- MDASM flag bits [15:11] 5:6 -- Reserved 7:9 FLG8:6 Flag Bits -- MMCSM flag bits [8:6] 10:15 FLG5:0 Flag Bits -- PWMSM flag bits [5:0] 17.12.3.2 Interrupt Enable Register (MIOS14ER0) This register contains the interrupt enable bits for the submodules. Each bit corresponds to a given submodule. MSB 0 LSB 1 2 3 4 Field EN15 EN14 EN13 EN12 EN11 SRESET 5 6 -- 7 8 9 10 11 12 13 14 15 EN8 EN7 EN6 EN5 EN4 EN3 EN2 EN1 EN0 0000_0000_0000_0000 Addr 0x30 6C04 Figure 17-36. Interrupt Enable Register (MIOS14ER0) Table 17-36. MIOS14ER0 Bit Descriptions Bits 0:4 Name Description EN15:11 Enable Bits -- MDASM enable bits [15:11] 5:6 -- Reserved 7:9 EN8:6 Enable Bits -- MMCSM enable bits [8:6] 10:15 EN5:0 Enable Bits -- PWMSM enable bits [5:0] 17.12.3.3 Interrupt Request Pending Register (MIOS14RPR0) This register is a read only register that contains the interrupt pending bits for the submodules. Each bit corresponds to a given submodule. When one of these bits is set, it means that a submodule raised its flag and the corresponding enable was set. MPC561/MPC563 Reference Manual, Rev. 1.2 17-66 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) As this register is read only, a write to this register has no other effect than generating a bus error if the bus error option is selected. MSB LSB 0 1 2 3 4 5 Field IRP15 IRP14 IRP13 IRP12 IRP1 6 7 -- SRESET 8 9 10 11 12 13 14 15 IRP8 IRP7 IRP6 IRP5 IRP4 IRP3 IRP2 IRP1 IRP0 0000_0000_0000_0000 Addr 0x30 6C06 Figure 17-37. Interrupt Request Pending Register (MIOS14RPR0) Table 17-37. MIOS14PR0 Bit Descriptions Bits 0:4 Name Description IRP15:1 Pending Bits -- MDASM pending bits [15:11] 1 5:6 -- Reserved 7:9 IRP8:6 Pending Bits -- MMCSM pending bits [8:6] 10:15 IRP5:0 Pending Bits -- PWMSM pending bits [5:0] 17.12.4 MIRSM1 Interrupt Registers 17.12.4.1 Interrupt Status Register (MIOS14SR1) This register contains the flag bits that are raised when the submodules generate an interrupt. Each bit corresponds to a given submodule. MSB LSB 0 Field FLG 31 1 2 3 4 FLG 30 FLG 29 FLG 28 FLG 27 5 6 -- 7 8 9 10 11 12 13 14 15 FLG FLG FLG FLG FLG FLG FLG FLG FLG 24 23 22 21 20 19 18 17 16 0000_0000_0000_0000 SRESET Addr 0x30 6C40 Figure 17-38. Interrupt Status Register (MIOS14SR1) Table 17-38. MIOS14SR1 Bit Descriptions Bits Name Description 0:4 FLG31:27 5:6 -- 7:9 FLGL24:22 Flag Bits-- MMCSM flag bits [24:22] 10:15 FLG21:16 Flag Bits -- PWMSM flag bits [21:16] Flag Bits -- MDASM flag bits [31:27] Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-67 Modular Input/Output Subsystem (MIOS14) 17.12.4.2 Interrupt Enable Register (MIOS14ER1) This register contains the interrupt enable bits for the submodules. Each bit corresponds to a given submodule. MSB Field LSB 0 1 2 3 4 EN 31 EN 30 EN 29 EN 28 EN 27 5 6 -- SRESET 7 8 9 10 11 12 13 14 15 EN 24 EN 23 EN 22 EN 21 EN 20 EN 19 EN 18 EN 17 EN 16 0000_0000_0000_0000 Addr 0x30 6C44 Figure 17-39. Interrupt Enable Register (MIOS14ER1) Table 17-39. MIOS14ER1 Bit Descriptions Bits Name Description 0:4 EN31:27 5:6 -- 7:9 EN24:22 Enable Bits -- MMCSM enable bits [24:22] 10:15 EN21:16 Enable Bits -- PWMSM enable bits [21:16] Enable Bits -- MDASM enable bits [31:27] Reserved 17.12.4.3 Interrupt Request Pending Register (MIOS14RPR1) This register is a read only register that contains the interrupt pending bits for the submodules. Each bit corresponds to a given submodule. When one of these bits is set, it means that a submodule raised its flag and the corresponding enable was set. As this register is read only, a write to this register has no other effect than generating a bus error if the bus error option is selected. MSB Field LSB 0 1 2 3 4 IRP 31 IRP 30 IRP 29 IRP 28 IRP 27 5 6 -- 7 8 9 10 11 12 13 14 15 IRP 24 IRP 23 IRP 22 IRP 21 IRP 20 IRP 19 IRP 18 IRP 17 IRP 16 SRESET Undefined Addr 0x30 6C46 Figure 17-40. Interrupt Request Pending Register (MIOS14RPR1) Table 17-40. MIOS14RPR1 Bit Descriptions Bits Name 0:4 IRP31:27 5:6 -- Description Pending Bits -- MDASM pending bits [31:27] Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 17-68 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) Table 17-40. MIOS14RPR1 Bit Descriptions (continued) Bits Name Description 7:9 IRP24:22 Pending Bits -- MMCSM pending bits [24:22] 10:15 IRP21:16 Pending Bits -- PWMSM pending bits [21:16] 17.12.5 Interrupt Control Section (ICS) The interrupt control section delivers the interrupt level to the CPU. The interrupt control section adapts the characteristics of the MIOB request bus to the characteristics of the interrupt structure of the IMB3. When at least one of the flags is set on an enabled level, the ICS receives a signal from the corresponding IRQ pending register. This signal is the result of a logical "OR" between all the bits of the IRQ pending register. The signal received from the IRQ pending register is associated with the interrupt level register within the ICS. This level is coded on five bits in this register: three bits represent one of eight levels and the two other represent the four time multiplex slots. According to this level, the ICS sets the correct IRQ[7:0] lines with the correct ILBS[1:0] time multiplex lines on the peripheral bus. The CPU is then informed as to which of the thirty-two interrupt levels is requested. Based on the interrupt level requested, the software must determine which submodule requested the interrupt. The software may use a find-first-one type of instruction to determine, in the concerned MIRSM, which of the bits is set. The CPU can then serve the requested interrupt. 17.12.6 MBISM Interrupt Registers Table 17-41 shows the MBISM interrupt registers. Table 17-41. MBISM Interrupt Registers Address Map Address Register 0x30 6C30 MIOS14 Interrupt Level Register 0 (MIOS14LVL0) See Table 17-42 for bit descriptions. 0x30 6C70 MIOS14 Interrupt Level Register 1 (MIOS14LVL1) See Table 17-43 for bit descriptions. 17.12.6.1 MIOS14 Interrupt Level Register 0 (MIOS14LVL0) This register contains the interrupt level that applies to the submodules numbers 15 to zero. MSB 0 LSB 1 Field SRESET Addr 2 -- 3 4 5 6 LVL 7 8 9 10 11 12 TM 13 14 15 -- 0000_0000_0000_0000 0x30 6C30 Figure 17-41. MIOS14 Interrupt Level Register 0 (MIOS14LVL0) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-69 Modular Input/Output Subsystem (MIOS14) Table 17-42. MIOS14LVL0 Bit Descriptions Bits Name Description 0:4 -- 5:7 LVL Interrupt request level. This field represents one of eight possible levels. 8:9 TM Time multiplexing. This field determines the multiplexed time slot 10:15 -- Reserved Reserved 17.12.6.2 MIOS14 Interrupt Level Register 1 (MIOS14LVL1) This register contains the interrupt level that applies to the submodules number 15 to zero. MSB 0 LSB 1 Field 2 -- SRESET 3 4 5 6 LVL 7 8 9 10 11 12 TM 13 14 15 -- 0000_0000_0000_0000 Addr 0x30 6C70 Figure 17-42. MIOS14 Interrupt Level Register 1 (MIOS14LVL1) Table 17-43. MIOS14LVL1 Bit Descriptions Bits Name Description 0:4 -- 5:7 LVL Interrupt request level. This field represents one of eight possible levels. 8:9 TM Time multiplexing. This field determines the multiplexed time slot. 10:15 -- Reserved Reserved 17.13 MIOS14 Function Examples The versatility of the MIOS14 timer architecture is based on multiple counters and capture/compare channel units interconnected on 16-bit counter buses. This section includes some typical application examples to show how the submodules can be interconnected to form timing functions. The diagrams used to illustrate these examples show only the blocks utilized for that function. To illustrate the timing range of the MIOS14 in different applications, many of the following paragraphs include time intervals quoted in microseconds and seconds. The assumptions used are that fSYS is at 40 MHz with minimum overall prescaling (50 ns cycle) and with the maximum overall prescaling (32 s cycle). For other fSYS clock cycle rates and prescaler choices, the times mentioned in these paragraphs scale appropriately. 17.13.1 MIOS14 Input Double Edge Pulse Width Measurement To measure the width of an input pulse, the MIOS14 double action submodule (MDASM) has two capture registers so that only one interrupt is needed after the second edge. The software can read both edge MPC561/MPC563 Reference Manual, Rev. 1.2 17-70 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) samples and subtract them to get the pulse width. The leading edge sample is double latched so that the software has the time of one full period of the input signal to read the samples to be sure that nothing is lost. Depending on the prescaler divide ratio, pulse width from 50 ns to 6.7 s can be measured. Note that a software option is provided to also generate an interrupt after the first edge. In the example shown in Figure 17-43, a counter submodule is used as the time-base for a MDASM configured in the input pulse width measurement mode. When the leading edge (programmed for being either rising or falling) of the input signal occurs, the state of the 16-bit counter bus is saved in register B1. When the trailing edge occurs, the 16-bit counter bus is latched into register A and the content of register B1 is transferred to register B2. This operation leaves register B1 free for the next leading edge to occur on the next clock cycle. When enabled, an interrupt is provided after the trailing edge, to notify the software that pulse width measurement data is available for a new pulse. After the trailing edge, the software has one cycle time of the input signal to obtain the values for each edge. When software attention is not needed for every pulse, the interrupt can be disabled. The software can read registers A and B2 coherently (using a 32-bit read instruction) at any time, to get the latest edge measurements. The software work is less than half that needed with a timer that requires the software to read one edge and save the value and then wait for the second edge. MIOS14 Double Action Submodule in IPWM mode (MOD3-MOD0 = 0b0001) MIOS14 Modulus Counter Submodule Two 16-bit Counter Buses From Prescaler or Pin Input Signal 16-bit Register A Bus Select Clock Select Edge Detect 16-bit Up-Counter 16-bit Register B1 16-bit Register B2 Submodule Bus Input Capture Interrupt on Trailing Edge Figure 17-43. MIOS14 Example: Double Capture Pulse Width Measurement 17.13.2 MIOS14 Input Double Edge Period Measurement Two samples are available to the software from an MIOS14 double action submodule for period measurement. The software can read the previous and the current edge samples and subtract them. As with pulse width measurement, the software can be sure not to miss samples by ensuring that the interrupt response time is faster than the fastest input period. Alternately, when the software is just interested in the latest period measurement, one 32-bit coherent read instruction can get both the current and the previous samples. Depending on the prescaler divide ratio, period times can be measured from 50 ns to 6.7 s. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-71 Modular Input/Output Subsystem (MIOS14) Figure 17-44 shows a counter submodule and a DASM combination as an example of period measurement. The software designates whether the rising or falling edge of the input signal is to be used for the measurements. When the edge is detected, the state of the 16-bit counter bus is stored in register A and the content of register B1 is transferred to register B2. After register B2 is safely latched, the content of register A is transferred to register B1. This procedure gives the software coherent current and previous samples in registers A and B2 at all times. An interrupt is available for the cases where the software needs to be aware of each new sample. Note that a software option is provided to also generate an interrupt after the first edge. MIOS14 Double Action Submodule in IPM mode (MOD3-MOD0 = 0b0010) MIOS14 Modulus Counter Submodule Input From Prescaler or Pin Bus Select Signal Edge 16-bit Register A Clock Select 16-bit Up-Counter Detect Two 16-bit Counter Buses 16-bit Register B1 16-bit Register B2 Submodule Bus Input Capture Interrupt on Designated Edge Figure 17-44. MIOS14 Example: Double Capture Period Measurement 17.13.3 MIOS14 Double Edge Single Output Pulse Generation Software can initialize the MIOS14 to generate both the rising and the falling edge of an output pulse. With a MDASM, pulses as narrow as 50 ns can be generated since software action is not needed between the edges. Pulses as long as 2.1 s can be generated. When an interrupt is desired, it can be selected to occur on every edge or only after the second edge. Figure 17-45 shows how a counter submodule and a MDASM can be used to generate both edges of a single output pulse. The software puts the compare value for one edge in register A and the other one in register B2. The MDASM automatically creates both edges and the pulse can be selected by software to be a high-going or a low-going. After the trailing edge, the MDASM stops to await further commands from the software. Note that a single edge output can be generated by writing to only one register. MPC561/MPC563 Reference Manual, Rev. 1.2 17-72 Freescale Semiconductor Modular Input/Output Subsystem (MIOS14) MIOS14 Double Action Submodule in OCB mode (MOD3 - MOD0 = 0b0100) MIOS14 Modulus Counter Submodule Two 16-bit Counter Buses From Prescaler or Pin Clock Select 16-bit Register A Output Signal 16-bit Compare A Bus Select 16-bit Up-Counter 16-bit Compare B 16-bit Register B2 Submodule Bus Output Flip-Flop Output Compare Interrupt on Trailing Edge Figure 17-45. MIOS14 Example: Double Edge Output Compare 17.13.4 MIOS14 Output Pulse Width Modulation with MDASM Output waveforms can be generated with any duty cycle without software involvement. The software sets up a MDASM with the compare times for the rising and falling edges and they are automatically repeated. The software does not need to respond to interrupts to generate continuous pulses. The frequency may be selected as the frequency of a free-running counter time-base, times a binary multiplier selected in the MDASM. Multiple PWM outputs can be created from multiple MDASMs and share one counter submodule, provided that the frequencies of all of the output signals are a binary multiple of the time-base and that the counter submodule is operating in a free-running mode. Each MDASM has a software selectable "don't care" on high-order bits of the time-base comparison so that the frequency of one output can be a binary multiple of another signal. Masking the time-base serves to multiply the frequency of the time-base by a binary number to form the frequency of the output waveform. The duty cycle can vary from one cycle to 64-Kbyte cycles. The frequency can range from 0.48 Hz to 156 KHz, though the resolution decreases at the higher frequencies to as low as seven bits. The generation of output square wave signals is of course the special case where the high and low times are equal. When an MMCSM is used to drive the time-base, the modulus value is the period of the output PWM signal. Figure 17-46 shows such an example. The polarity of the leading edge of an output waveform is programmable for a rising or a falling edge. The software selects the period of the output signal by programming the MMCSM with a modulus value. The leading edge compare value is written into register A by software and the trailing edge time is written into register B1. When the leading edge value is reached, the content of register B1 is transferred to register B2, to form the next trailing edge value. Subsequent changes to the output pulse width are made by writing a new time into register B1. Updates to the pulse width are always synchronized to the leading edge of the waveform. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 17-73 Modular Input/Output Subsystem (MIOS14) It is typical to use the pulse width modulation mode of the MDASM without interrupts, although an interrupt can be enabled to occur on the leading edge. When the output is an unchanging repetitive waveform, the MDASM continuously generates the signal without any software intervention. When the software needs to change the pulse width, a new trailing edge time is written to the MDASM. The output is changed on the next full pulse. When the software needs to change the output at a regular rate, such as an acceleration curve, the leading edge interrupt gives the software one period time to update the new trailing edge time. MIOS14 Double Action Submodule in OCAB mode (MOD3 - MOD0 = 0b0101) MIOS14 Modulus Counter Submodule From Prescaler or Pin 16-bit Register A Output Pin 16-bit Compare A Clock Select Modulus Control 16-bit Up-Counter Bus Select Load Output Flip-Flop 16-bit Compare B Modulus Register Two 16-bit Counter Buses 16-bit Register B2 Output Compare Interrupt on Leading Edge 16-bit Register B1 Submodule Bus Figure 17-46. MIOS14 Example: Pulse Width Modulation Output 17.13.5 MIOS14 Input Pulse Accumulation Counting the number of pulses on an input signal is another capability of the MIOS14. Pulse accumulation uses an MMCSM. Since the counters in the counter submodules are software accessible, pulse accumulation does not require the use of an action submodule. The pulse accumulation can operate continuously, interrupting only on binary overflow of the 16-bit counter. When an MMCSM is used, an interrupt can instead be created when the pulse accumulation reaches a preprogrammed value. To do that, the two's complement of the value is put in the modulus register and the interrupt occurs when the counter overflows. MPC561/MPC563 Reference Manual, Rev. 1.2 17-74 Freescale Semiconductor Chapter 18 Peripheral Pin Multiplexing (PPM) Module The peripheral pin multiplexing (PPM) module has two main functions. The first function allows the PPM to act as a parallel-to-serial communications module. Using the PPM in this way can reduce the number of signals required to connect the MPC561/MPC563 to an external device or devices. The second function allows the PPM to short internal signals thus giving increased access to multiple functions multiplexed on the same device signal. See Figure 18-1 for a comparison of the MPC555 N-Signal I/O and the MPC561/MPC563 PPM I/O. 18.1 * * * * * * * Key Features Synchronous serial interface between MCU and an external device Four internal parallel data sources can be multiplexed through the PPM -- TPU3_A: 16 channels -- TPU3_B: 16 channels -- MIOS: 12 PWM channels, four MDA channels -- Internal GPIO: 16 general-purpose inputs, 16 general-purpose outputs Software configurable stream size -- One 16-bit transmit stream and one 16-bit receive stream -- Two parallel 8-bit transmit streams and two parallel 8-bit receive streams Software configurable clock (PPM_TCLK) based on system clock Software selectable clock modes -- Serial peripheral interface (SPI) mode -- Time division multiplexing (TDM) mode Software selectable operation modes -- Continuous mode - Continuously transmit/receive data through PPM -- Start-transmit-receive (STR) mode - transmit/receive only when STR mode selected Software configurable internal module shorting of the following signals: -- TouCAN_A[A_CNRX0, A_CNTX0] to TouCAN_B[B_CNRX0, B_CNTX0] and/or TouCAN_C[C_CNRX0, C_CNTX0] -- TouCAN_B[B_CNRX0, B_CNTX0] to TouCAN_C[C_CNRX0, C_CNTX0] -- A_TPUCH0 to B_TPUCH0 -- A_TPUCH1 to B_TPUCH1 -- A_TPUCH15 to ETRIG1 -- B_TPUCH15 to ETRIG2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-1 Peripheral Pin Multiplexing (PPM) Module -- A_T2CLK to B_T2CLK N data signals 6 signals (maximum 4 data signals) 0 1 TCLK External Device MPC555 TSYNC MPC561/ MPC563 External Device TX1 RX1 N=31 TX0 RX0 PPM TX/RX Protocol Parallel TX/RX Protocol Figure 18-1. N-Signal I/O Compared with PPM I/O 18.2 Programming Model The PPM occupies 100 bytes of address space, arranged as 50 16-bit entries. All registers must be read or written through half-word (16-bit) accesses. Reserved register addresses return zeros when read and cannot be written to. Table 18-1 shows the memory map for the PPM module. Table 18-1. PPM Memory Map Access Register Name Address Usage S1 PPMMCR 0x30 5C00 Module Configuration Register T2 PPMTCR 0x30 5C02 Test Configuration Register S/U3 PPMPCR 0x30 5C04 PPM Control Register S1 TX_CONFIG_1 0x30 5C06 TX Output Configuration S1 TX_CONFIG_2 0x30 5C08 TX Output Configuration -- Reserved 0x30 5C0A -- 0x30 5C0C -- S1 RX_CONFIG_1 0x30 5C0E RX Input Configuration S1 RX_CONFIG_2 0x30 5C10 RX Input Configuration -- Reserved 0x30 5C12 -- Reserved 0x30 5C14 -- S/U RX_DATA 0x30 5C16 Receives data from RX_SHIFTER on SAMP[0:2] update rate -- Reserved 0x30 5C18 -- -- 3 MPC561/MPC563 Reference Manual, Rev. 1.2 18-2 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module Table 18-1. PPM Memory Map (continued) Access Register Name Address Usage S/U3 RX_SHIFTER 0x30 5C1A Data is shifted in from signals PPM_RX[0:1] -- Reserved 0x30 5C1C -- S/U TX_DATA 0x30 5C1E Data to be transmitted on PPM_TX[0:1] -- Reserved 0x30 5C20 -- S/U3 GPDO 0x30 5C22 General Purpose Data Out S/U3 GPDI 0x30 5C24 General Purpose Data In S/U3 SHORT_REG 0x30 5C26 Enables shorting of internal signals S/U3 SHORT_CH_REG 0x30 5C28 Enables shorting of transmit data channels S/U3 SCALE_TCLK_REG 0x30 5C2A Establishes frequency of TCLK -- Reserved 0x30 5C2C - 0x30 5C7F -- 3 1 Only accessible in Supervisor Mode. This register is accessible in Test Mode only. Reads/Writes to this register when not in Test Mode will return TEA (bus error access). 3 Accessible in Supervisor Mode and User Mode (when PPMMCR[SUPV]=0). 2 18.3 Functional Description In order to reduce the number of signals on the devices, many signals have multiple functions and each signal must be configured for access to any of these functions. The PPM module is designed to increase the availability of MPC561/MPC563 signal multiplexed functions. It can do this is two ways: * By implementing a parallel-to-serial communication protocol, * By implementing internal signal shorting. 18.3.1 PPM Parallel-to-Serial Communication Protocol The PPM communication sub-modules, PPM_MUX and PPM_SHIFTER, transfer data between the MPC561/MPC563 and external devices. The PPM reduces the number of connections between devices by allowing certain internal modules of the MCU to transmit and receive data serially, where without PPM those internal modules would have to transmit and receive data in parallel. Data is routed through the PPM using internal multiplexers. Communication between the internal modules and the PPM remains a parallel connection, but the PPM connects to external devices by a serial link. The PPM can be configured for different data transfer rates and data formats. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-3 Peripheral Pin Multiplexing (PPM) Module PPM Module SYSCLK IMB3 interface Clock Generator SYSCLK PPM_REGS Clock GPIO (GPDO, GPDI) TCLK and Update Clock Generator TPU3_A Channel_TX[15:0] TPU3_B PPM_TCLK PPM_MUX PPM_TSYNC Channel_RX[15:0] MIOS PPM_SHIFTER PPM_TX[0:1] PPM_RX[0:1] PPM_SHORT Figure 18-2. Block Diagram of PPM Module 18.3.1.1 Internal Multiplexing In the MPC561/MPC563 devices, the PPM module supports multiplexing of four modules: TPU3_A, TPU3_B, MIOS and GPIO registers, internal to the PPM. Internal multiplexers route data between the MCU internal modules and the external device through the PPM. Four configuration registers, TX_CONFIG_1, TX_CONFIG_2, RX_CONFIG_1 and RX_CONFIG_2, control these internal multiplexers. By programming the configuration registers the PPM multiplexers select which internal module will drive data out of the PPM and which will receive data from the PPM. The TX_CONFIG and RX_CONFIG registers allocate two bits to control each of the 16 internal multiplexers. During transmit operations, the TX_CONFIG registers determine which internal module's data will be sampled and routed to the transmit sample-and-shift register, TX_DATA. During receive operations, data in the receive sample-and-shift register, RX_SHIFTER, is routed to the internal module specified by the value of the RX_CONFIG registers, or in the case where GPDI is the destination, data is routed directly from PPM_RX[0:1]. Refer to Figure 18-4. MPC561/MPC563 Reference Manual, Rev. 1.2 18-4 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module A_TPUCH0 B_TPUCH0 MPWM0 GPDO15 * * ** * * TX_CONFIG[CH0] TX_SHIFTER PPM_TX[0:1] CH15 * TX_CONFIG[CH15] * * CH0 A_TPUCH15 B_TPUCH15 MDA14 GPDO0 Figure 18-3. Internal Multiplexer Mechanism for Transmit Data A_TPUCH0 B_TPUCH0 MPWM0 * * *** RX_CONFIG[CH0] RX_SHIFTER CH15 * * * CH0 * * * CH0 RX_CONFIG[CH15] A_TPUCH15 B_TPUCH15 MDA14 PPM_RX[0:1] * RX_DATA CH15 RX_CONFIG[CHx] GPDI CH15 * * * CH0 Figure 18-4. Internal Multiplexer Mechanism for Received Data 18.3.1.2 PPM Clocks The PPM module generates and outputs two clock signals, PPM_TCLK and PPM_TSYNC. The PPM_TCLK and PPM_TSYNC clocks are the basis for all PPM communication functions; single data bits are transmitted and received on PPM_TCLK cycles, one PPM_TSYNC clock cycle defines a single 16-bit word transmit/receive cycle. The PPM can be configured to transfer data in one of two clock modes, SPI and TDM. Figure 18-5 shows examples of PPM_TCLK in SPI and TDM modes. The frequency of PPM_TCLK is a function of the system clock (SYSCLK) and is programmable using the MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-5 Peripheral Pin Multiplexing (PPM) Module SCALE_TCLK_REG. The transmit signals, PPM_TX, will stay high as long as PPM_TSYNC is high (equal to "1" in Figure 18-5). SYSCLK PPM_TCLK1 PPM_TCLK2 PPM_TCLK2 PPM_TSYNC PPM_TX "1" PPM_RX CHANNEL0 CHANNEL0 CHANNEL1 CHANNEL2 CHANNEL1 CHANNEL2 PPM_TCLK1 -- TCLK in TDM Mode PPM_TCLK2 -- TCLK in SPI Mode PPM_CLK2 -- TCLK in SPI Mode, with inverted SPI clock polarity enabled fTCLK = (fSYSCLK/2*N) where N is the value in SCALE_TCLK_REG (see Section 18.4.12, " Scale Transmit Clock Register (SCALE_TCLK_REG) Shading of PPM_RX signifies value is unknown Figure 18-5. PPM Clocks and Serial Data Signals Complete transmit and receive cycles are based on the PPM_TSYNC clock. A cycle begins on the rising edge of PPM_TSYNC, which goes high for one PPM_TCLK cycle. The transmit signals, PPM_TX[0:1], will stay high as long as PPM_TSYNC is high (equal to "1" in Figure 18-6). Data bits start to transmit on the falling edge of PPM_TSYNC. In receive mode, valid data starts to shift into RX_SHIFTER on the falling edge of PPM_TSYNC. PPM_TSYNC stays low until the contents of TX_DATA have been shifted out and/or 16 bits have been shifted into RX_SHIFTER. One data bit is transferred every PPM_TCLK cycle. MPC561/MPC563 Reference Manual, Rev. 1.2 18-6 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module SYSCLK PPM_TCLK One Cycle PPM_TSYNC "1" PPM_TX PPM_RX CH0 CH1 CH2 CH0 CH1 CH2 CH3 CH3 CH[K] CH[K] "1" CH0 CH0 Shading of PPM_RX signifies value is unknown Figure 18-6. One Transmit and Receive Cycle in SPI Mode 18.3.1.3 PPM Control Settings As data is transferred through the PPM module it must be sampled at a rate which guarantees its validity. This sample rate is a multiple of PPM_TCLK and is defined by the SAMP[0:2] field of the PPMPCR register. For transmit operations, the sample rate is the rate at which TX_DATA receives data from the internal modules. For receive operations, it is the rate at which the internal modules read RX_SHIFTER. The register RX_DATA is updated from RX_SHIFTER on completed receive (PPM_TSYNC) cycles. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-7 Peripheral Pin Multiplexing (PPM) Module SYSCLK PPM_TCLK(1) Update(1) SYSCLK PPM_TCLK(2) Update(2) Update(3) Update(4) PPM_TCLK(1) = SYSCLK/4 Update(1) every PPM_TCLK(1)clock PPM_TCLK(2) = SYSCLK/2 Update(2) every PPM_TCLK(2) clock Update(3) every second PPM_TCLK(2) clock Update(4) every fourth PPM_TCLK(2) clock Figure 18-7. Examples Of Several TCLK Frequencies and Sample Rates The PPM Module has two data transmit signals, PPM_TX[0:1], and two data receive signals, PPM_RX[0:1]. The amount of data transferred on these signals depends on the setting in PPMPCR[OP_16_8]. If the PPM is configured to transfer data in 16 PPM_TCLK cycles per 16-bit word then all data in TX_DATA[0:15] is transmitted on the PPM_TX0 signal, and all data is received into RX_SHIFTER[0:15] from PPM_RX0. If the PPM is configured to transfer data in eight PPM_TCLK cycles per 16-bit word then the eight bits will transfer on each of the data transfer signals. NOTE Care must be taken when setting the sample rate with respect to the OP_16_8 bit setting. For example if the PPM is transferring data on an 8-clock cycle, then setting the sample rate to every 16 clocks will result in lost data. In SPI mode the phase and polarity of PPM_TCLK is selectable by programming bits in the PPMPCR register. PPM_TCLK can have normal polarity (active high) or inverted polarity (active low). There are two clock phases available: valid data can be latched on the transition of PPM_TCLK from its active edge to inactive edge, or valid data can be latched on the transition of PPM_TCLK from its inactive edge to active edge. See Section 18.4.2, "PPM Control Register (PPMPCR)" for more information on SPI mode PPM_TCLK settings. MPC561/MPC563 Reference Manual, Rev. 1.2 18-8 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module 18.3.2 PPM Signal Short Functionality The MPC561/MPC563 devices have many modules that multiplex their functions onto shared signals. In order to access those functions, the signals must be configured appropriately. However, choosing one function can be at the cost of another function. The PPM makes more functions available simultaneously by creating internal shorts that can activate functions that would otherwise require an external signal. Internal signal shorts are enabled using the PPM short register, SHORT_REG. 18.3.2.1 TouCAN Shorting There are three TouCAN modules on the MPC561/MPC563 devices. Using the PPM it is possible to internally short the CNRX0 and CNTX0 signals of these three modules to increase message buffer capacity. Three bits of the SHORT_REG register (SH_TCAN[0:2]), are allocated to enable four combinations of shorting between the TouCAN modules. See Table 18-8 for information on these bit descriptions. When one TouCAN module is shorted to another, the CANRX signals and the CANTX signals of both modules are shorted internally. Both modules continue to operate as normal but all transmit and receive operations are done using only one pair of CANRX and CANTX signals. The CANRX and CANTX signals of the other module are no longer under the control of the TouCAN module. The C_TouCAN signals C_CNTX0 and C_CNRX0 are multiplexed signals. When C_TouCAN is shorted with one or two other TouCAN modules, C_TouCAN no longer has control of these signals and so they can be configured for another of the available functions. Refer to Chapter 2, "Signal Descriptions," for more information. Also see Figure 18-24. 18.3.2.2 TPU Shorting There are two TPU3 modules on the MPC561/MPC563 devices. Using the PPM, it is possible to internally short channel A_TPUCH0 with B_TPUCH0 and channel A_TPUCH1 with B_TPUCH1. Two bits of the SHORT_CH register (SH_TPU[1:0]) control the internal shorting. The input/output enable states of the TPU channels themselves determine the effect that the short bits have on the TPU modules' operation. See Table 18-9 for information on SHORT_CH[SH_TPU] bit descriptions. The PPM only controls the internal shorting of TPU3 channels TPUCH0 and TPUCH1. TPU channels are configured for input and output by the TPU ROM functions defined for them. Refer to Appendix D, "TPU3 ROM Functions" for further information, and see Figure 18-25. If TPU_A and TPU_B channel 0 are shorted via SHORT_CH[SH_TPU] and one is set to ouput while the other is set to input, then the data from the output channel will not appear on the pin of the input channel. This holds true if TPU_A and TPU_B channel 1 are shorted via SHORT_CH[SH_TPU]. Connect an external device to the pin of the module that has the channel function set to output. 18.3.2.3 ETRIG1 and ETRIG2 Each of the two QADC64E modules on the MPC561/MPC563 has an external trigger input signal that can be used to trigger analog to digital conversions. Using the PPM, these external trigger inputs can be sourced internally. Control for these short functions is found in SHORT_REG[SH_ET1] and MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-9 Peripheral Pin Multiplexing (PPM) Module SHORT_REG[SH_ET2]. ETRIG1 can be shorted to A_TPUCH15 and ETRIG2 can be shorted to B_TPUCH15. Since the ETRIG1 and ETRIG2 signals are shared with PCS6 and PCS7 respectively, the PPM shorting will allow both ETRIG and PCS functions to be available. By setting up A_TPUCH15 and/or B_TPUCH15 as output signals, enabling a short to ETRIG1 and/or ETRIG2 and sending a trigger signal from the TPU channels, the QADC64E can be successfully triggered, leaving the ETRIG signals free to be configured for PCS functions. 18.3.2.4 T2CLK Each of the two TPU modules has an input clock, T2CLK. The A_T2CLK and B_T2CLK signals are shared with PCS4 and PCS5 respectively. The T2CLK signals can be shorted internally by SHORT_REG[SH_T2CLK] so that only one signal needs to be input to the device, leaving the other signal free for PCS functionality. 18.3.3 PPM Module Pad Configuration The PPM module has six pads associated with it, four I/O pads PPM_RX[0:1] and PPM_TX[0:1] and two clock outputs PPM_TCLK and PPM_TSYNC. All six PPM signals are multiplexed with MIOS signals. In order to be able to access the PPM functions the signals must be configured appropriately. PPM pad control is done in the PDMCR2 register. As well as enabling signal functions, this register can configure the PPM pads for 2.6-V or 5-V operation. Refer to Chapter 2, "Signal Descriptions," for more details. 18.4 PPM Registers 18.4.1 Module Configuration Register (PPMMCR) MSB 0 Field STOP SRESET Addr LSB 1 2 3 4 RESERVED 5 6 7 8 9 10 SUPV 11 12 13 14 15 RESERVED 0000_0000_0000_0000 0x30 5C00 Figure 18-8. Module Configuration Register (PPMMCR) MPC561/MPC563 Reference Manual, Rev. 1.2 18-10 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module Table 18-2. PPMMCR Bit Descriptions Bits Name Description 0 STOP Stop Mode Enable. When the STOP bit is set and the PPM enters Stop Mode, the PPM module clocks will be stopped. The PPM will only respond to accesses to the PPMMCR register. The STOP bit can only be set when the PPM is disabled, (i.e., PPMPCR[ENTX] = 0 and PPMPCR[ENRX] = 0). Writing to the STOP bit while either TX or RX is enabled will result in a TEA (bus error access). 0 PPM clocks enabled 1 PPM clock disabled - PPM in Stop Mode. 1:7 -- 8 SUPV 9:15 -- 18.4.1.1 Reserved Supervisor/User Data Space. The SUPV bit places the PPM registers in either Supervisor or User Data Space. 0 Access to PPMMCR, TX_CONFIG1/2, RX_CONFIG1/2 is restricted to supervisor-only. Access to all other PPM registers is unrestricted. 1 All PPM registers are accessible in supervisor-only data space. Reserved Entering Stop Mode The PPM module cannot, and should not, be put into stop mode while either the transmit or receive operation is enabled in PPMPCR[ENTX] and/or PPMPCR[ENRX]. Furthermore, it should not be put into stop mode if it is operating in continuous mode. In this case it should be switched to single transfer mode first. The following steps should be taken to ensure that stop mode is entered safely and without loss of data: 1. If the PPM is operating in continous mode -- switch to single transfer mode by clearing PPMPCR[CM]=0. 2. If the PPM is enabled for transmit or receive -- set PPMPCR[STR] (TDM or SPI mode) -- Disable both PPMPCR[ENTX] and PPMPCR[ENRX] -- Wait until PPMPCR[STR] is cleared by the PPM module. This will be done when the next data frame has been sent or received. 3. If the PPM is not enabled for transmit or receive -- Clear PPMPCR[STR] if necessary 4. Set PPMMCR[STOP] When PPMMCR[STOP] is set, the PPM module enters stop mode and the PPM module clocks will be stopped. While in stop mode, none of the PPM registers will be accessible, except for the PPMPCR register. If the STOP bit is clear, stop mode is disabled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-11 Peripheral Pin Multiplexing (PPM) Module 18.4.2 PPM Control Register (PPMPCR) MSB 0 LSB 1 2 Field SAMP[0:2] 3 4 5 OP_16_8 ENRX ENTX SRESET 6 7 8 9 10 SPI STR CI CP CM 11 12 13 14 15 RESERVED 0000_0000_0000_0000 Addr 0x30 5C04 Figure 18-9. PPM Control Register (PPMPCR) Table 18-3. PPMPCR Bit Descriptions Bits Name Description SAMP[0:2] The Sample rate is the rate at which the data registers are sampled, with respect to the frequency of TCLK. For transmit, SAMP[0:2] is the rate at which data from the TX_DATA register is sampled. For receive, SAMP[0:2] is the rate at which data is sampled from RX_DATA. Refer to Table 18-4 for SAMP[0:2] settings. 3 OP_16_8 This bit describes how the 16 data bits will be transmitted and received. Both transmit and receive are effected by this bit setting. 0 16 TCLK Cycles per word. All 16 bits of TX_DATA[0:15] will transmit on PPM_TX0. All 16 bits of RX_SHIFTER[0:15] are received from PPM_RX0. 1 8 TCLK Cycles per word. TX_DATA[0:7] will transmit on PPM_TX1, TX_DATA[8:15] will transmit on PPM_TX_0. RX_SHIFTER[0:7] are received from PPM_RX1, RX_SHIFTER[8:15] are received from PPM_RX0. 4 ENRX1 PPM Receive (RX) data enable. 0 RX Disabled 1 RX Enabled 5 ENTX2 PPM Transmit (TX) data enable. 0 TX Disabled 1 TX Enabled 6 SPI SPI mode enable. 0 TDM mode enabled 1 SPI mode enabled 7 STR Start-Transmit-Receive bit. When this bit is set and SPI mode is enabled, the PPM module will start to transmit and/or receive one frame of data. The STR bit will then be cleared automatically by the PPM. Refer to Table 18-5. 0 PPM has completed transmitting and/or receiving one data frame. 1 PPM will transmit and/or receive one data frame. 8 CI Clock Invert. This bit defines the polarity of TCLK clock in both SPI and TDM modes. 0 Normal clock polarity - active high clocks selected 1 Inverted clock - active low clocks selected CP Clock Phase. This bit selects one of two fundamentally different transfer formats. Refer to figures Figure 18-12 and Figure 18-13. 0 Valid data can be latched on the transition of TCLK from inactive phase to active phase. 1 Valid data can be latched on the transition of TCLK from active phase to inactive phase. 0:2 9 MPC561/MPC563 Reference Manual, Rev. 1.2 18-12 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module Table 18-3. PPMPCR Bit Descriptions (continued) Bits Name Description 10 CM Continuous Mode. 0 Non-continuous mode (default). Transmit and/or receive one data frame when STR = 1. (STR will be automatically cleared by the PPM after the transfer of one data frame.) 1 Data will continuously be transmitted and/or received as long as Transmit and Receive are enabled. Refer to Table 18-5 for more information. Note: Ensure PPMPCR[STR]=0 when setting PPMPCR[CM]=1 11:15 -- Reserved 1 Enable RX. (a) If ENRX is disabled, no data will shift into the PPM. (b) If ENRX is asserted while ENTX=1, the first data bit received will be the data that is transmitted from the PPM, and not RX0. See Figure 18-10. To receive the first data frame correctly, ENRX and ENTX should be set simultaneously. 2 Enable TX. (a) If ENTX is disabled, no data will shift out of the PPM and the PPM output signals, PPM_TX0 and PPM_TX1 will be high. (b) If ENTX is asserted while ENRX = 1, the first data bits transmitted out of the PPM will be the data that was received into the PPM. See Figure 18-11. To transmit the first data frame correctly, set ENTX and ENRX simultaneously. Table 18-4. SAMP[0:2] Bit Settings SAMP[0:2] Sample Rate 000 Every TCLK 001 Every 2 TCLK 010 Every 4 TCLK 011 Every 8 TCLK 100 - 111 Every 16 TCLK MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-13 Peripheral Pin Multiplexing (PPM) Module ENRX PPM_TCLK One Cycle PPM_TSYNC PPM_TX "1" CH0 CH1 PPM_RX CH2 CH3 CH[K] CH2 CH3 CH[K] "1" CH0 CH0 Figure 18-10. Set ENRX While ENTX = 1 . ENTX PPM_TCLK One Cycle PPM_TSYNC PPM_TX "1" PPM_RX CH0 CH1 CH2 CH3 CH[K] CH2 CH3 CH[K] "1" CH0 CH0 Figure 18-11. Set ENTX while ENRX = 1 MPC561/MPC563 Reference Manual, Rev. 1.2 18-14 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module PPM_TCLK CI = 0 PPM_TCLK CI = 1 DATA PPM_TSYNC Figure 18-12. SPI Transfer Format with CP = 0 PPM_TCLK CI = 0 PPM_TCLK CI = 1 DATA PPM_TSYNC Figure 18-13. SPI Transfer Format with CP = 1 Table 18-5. PPMPCR[CM] and PPMPCR[STR] Bit Operation 18.4.3 PPMPCR[CM] PPMPCR[STR] Result 0 1 One data frame transmitted and/or received through PPM. 0 0 Transfer of one data frame completed. 1 X Continuously transmit and/or receive data frames through PPM. X X CM and STR will only effect PPM transmit/receive when PPM is configured for SPI mode. In TDM mode transmit/receive will be continuous regardless of the values of CM and STR bits. Transmit Configuration Registers (TX_CONFIG_1 and TX_CONFIG_2) The two transmit configuration registers control which internal modules will transmit data through the PPM. Each of the configuration registers contains eight separate 2-bit wide bit fields. Each of the 16 fields controls a multiplexer that selects a 1-bit channel from an internal module to the PPM transmit data register. See Table 18-6 for more information on channel control and setting the channel values. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-15 Peripheral Pin Multiplexing (PPM) Module TX_CONFIG_1 and TX_CONFIG_2 can only be written while PPM transmit mode is disabled (PPMPCR[ENTX] = 0). While transmit is enabled these registers read as 0x00 and writing them will return TEA (bus error access). MSB 0 Field LSB 1 2 CH7 3 4 CH6 5 6 CH5 7 8 CH4 SRESET 9 10 CH3 11 12 CH2 13 14 CH1 15 CH0 0000_0000_0000_0000 Addr 0x30 5C06 Figure 18-14. Transmit Configuration Register 1 (TX_CONFIG_1) MSB 0 Field LSB 1 2 CH15 3 CH14 4 5 CH13 6 7 CH12 SRESET 8 9 CH11 10 11 CH10 12 13 CH9 14 15 CH8 0000_0000_0000_0000 Addr 0x30 5C08 Figure 18-15. Transmit Configuration Register 2 (TX_CONFIG_2) 18.4.4 Receive Configuration Registers (RX_CONFIG_1 and RX_CONFIG_2) The two receive configuration registers control which internal modules will receive data from the PPM. Each of the configuration registers contains eight separate 2-bit wide bit fields. Each of the 16 fields controls a multiplexer that selects a 1-bit channel from the PPM data receive register to an internal module. See Table 18-6 for more information on channel control and setting the channel values. RX_CONFIG_1 and RX_CONFIG_2 can only be written while PPM receive mode is disabled (PPMPCR[ENRX] = 0). While receive mode is enabled these registers read as 0x00 and writing them will return TEA (bus error access). MSB 0 Field SRESET Addr LSB 1 CH7 2 3 CH6 4 5 CH5 6 7 CH4 8 9 10 CH3 11 12 CH2 13 CH1 14 15 CH0 0000_0000_0000_0000 0x30 5C0E Figure 18-16. Receive Configuration Register 1 (RX_CONFIG_1) MPC561/MPC563 Reference Manual, Rev. 1.2 18-16 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module MSB 0 Field LSB 1 2 CH15 3 CH14 4 5 CH13 6 7 8 CH12 9 10 CH11 11 CH10 12 13 CH9 14 15 CH8 0000_0000_0000_0000 SRESET Addr 0x30 5C10 Figure 18-17. Receive Configuration Register 2 (RX_CONFIG_2) NOTE Channel 0 is transmitted first. Channel 0 is received first. Table 18-6. Configuration Register (TX and RX) Channel Settings TX/RX_CONFIG Channel Number 18.4.5 Channel Values 00 01 10 11 0 GPIO15 A_TPUCH0 B_TPUCH0 MPWM0 1 GPIO14 A_TPUCH1 B_TPUCH1 MPWM1 2 GPIO13 A_TPUCH2 B_TPUCH2 MPWM2 3 GPIO12 A_TPUCH3 B_TPUCH3 MPWM3 4 GPIO11 A_TPUCH4 B_TPUCH4 MPWM4 5 GPIO10 A_TPUCH5 B_TPUCH5 MPWM5 6 GPIO9 A_TPUCH6 B_TPUCH6 MPWM16 7 GPIO8 A_TPUCH7 B_TPUCH7 MPWM17 8 GPIO7 A_TPUCH8 B_TPUCH8 MPWM18 9 GPIO6 A_TPUCH9 B_TPUCH9 MPWM19 10 GPIO5 A_TPUCH10 B_TPUCH10 MPWM20 11 GPIO4 A_TPUCH11 B_TPUCH11 MPWM21 12 GPIO3 A_TPUCH12 B_TPUCH12 MDA11 13 GPIO2 A_TPUCH13 B_TPUCH13 MDA12 14 GPIO1 A_TPUCH14 B_TPUCH14 MDA13 15 GPIO0 A_TPUCH15 B_TPUCH15 MDA14 Receive Data Register (RX_DATA) RX_DATA receives data from the RX_SHIFTER register. It is updated from RX_SHIFTER at the end of a receive cycle (i.e., rising edge of PPM_TSYNC). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-17 Peripheral Pin Multiplexing (PPM) Module MSB 0 LSB 1 2 3 4 5 6 Field 7 8 9 10 11 12 13 14 15 RX_DATA 0000_0000_0000_0000 SRESET Addr 0x30 5C16 Figure 18-18. Receive Data Register (RX_DATA) 18.4.6 Receive Shift Register (RX_SHIFTER) RX_SHIFTER receives data serially from the PPM input signals PPM_RX[0:1] (depending on the value of PPMPCR[OP_16_8]). Data bits are shifted in on every PPM_TCLK cycle. Data in the RX_SHIFTER register is delivered directly to the MPC561/MPC563 internal modules with no wait time. MSB 0 LSB 1 2 3 4 5 6 Field 7 8 9 10 11 12 13 14 15 RX_SHIFTER SRESET 0000_0000_0000_0000 Addr 0x30 5C1A Figure 18-19. Receive Shifter Register (RX_SHIFTER) 18.4.7 Transmit Data Register (TX_DATA) TX_DATA contains data from the internally multiplexed modules that is to be transmitted from the PPM module on the PPM_TX[1:0] signals (depending on the value in PPMPCR[OP_16_8]). Data bits are transmitted serially (shifted out) on each PPM_TCLK cycle. The data is shifted out least significant bit (LSB) first, therefore TX_DATA15 first, TX_DATA0 last. MSB 0 Field SRESET Addr LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 TX_DATA 0000_0000_0000_0000 0x30 5C1E Figure 18-20. Transmit Data Register (TX_DATA) 18.4.8 General-Purpose Data Out (GPDO) GPDO is an internal register whose data can be transmitted serially through the PPM. By default, the transmit configuration registers are set to transmit from this register. The value in GPDO[0:15] is written into TX_DATA[0:15]. MPC561/MPC563 Reference Manual, Rev. 1.2 18-18 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module MSB LSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 15 GPDO 0000_0000_0000_0000 SRESET Addr 0x30 5C22 Figure 18-21. General Purpose Data Out Register (GPDO) 18.4.9 General-Purpose Data In (GPDI) GPDI is an internal register that receives data directly from the PPM input signals, PPM_TX[0:1]. By default, the receive configuration registers are set to direct received data from RX_DATA[0:15] to the GPDI[0:15] register. MSB LSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 15 GPDI SRESET 0000_0000_0000_0000 Addr 0x30 5C24 Figure 18-22. General Purpose Data In Register (GPDI) 18.4.10 Short Register (SHORT_REG) SHORT_REG allows the shorting of certain internal signals in the MPC561/MPC563 devices. This feature allows functions, whose internal signals are multiplexed on external signals, to be accessible simultaneously. MSB 0 LSB 1 2 3 4 5 6 7 8 Field SH_TCAN[2:0] SH_TPU[1:0] RESERVED SH_ET1 SH_ET2 SH_T2CLK SRESET Addr 9 10 11 12 13 14 15 RESERVED 0000_0000_0000_0000 0x30 5C26 Figure 18-23. Short Register (SHORT_REG) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-19 Peripheral Pin Multiplexing (PPM) Module Table 18-7. SHORT_REG Bit Descriptions Bits Name Description 0:2 SH_TCAN[2:0] Short TouCAN modules. These three bits determine which TouCAN modules are internally shorted. See Table 18-8 for a description of the effects of these bit settings. 3:4 SH_TPU[1:0] Short TPU3 modules. The channels A_TPUCH0 and B_TPUCH0 can be internally shorted by the SH_TPU0. Channels A_TPUCH1 and B_TPUCH1 can be internally shorted by SH_TPU1. The effect of the internal shorts depends on the input/output enable control for the TPU channels themselves. See Table 18-9 for more information on bit settings for TPU shorting. 5 -- 6 SH_ET1 Short ETRIG1. This bit enables an internal short between ETRIG1 and A_TPUCH15. 0 Short disabled 1 Short ETRIG1 to A_TPUCH15 enabled 7 SH_ET2 Short ETRIG2. This bit enables an internal short between ETRIG2 and B_TPUCH15. 0 Short disabled 1 Short ETRIG2 to B_TPUCH15 enabled 8 SH_T2CLK 9:15 -- Reserved Short T2CLK. This bit enables a short between A_T2CLK and B_T2CLK. 0 Short disabled 1 Short A_T2CLK and B_T2CLK enabled. A_T2CLK then takes the input clock. Reserved Table 18-8. SHORT_REG[SH_TCAN] Bit Settings SH_TCAN2 SH_TCAN1 SH_TCAN0 0 0 0 No Short 0 0 1 No Short 0 1 0 No Short 0 1 1 1 0 0 1 0 1 Effects On TouCAN Modules TouCAN_C[C_CNRX0, C_CNTX0] shorted to TouCAN_B[B_CNRX0, B_CNTX0] Both modules communicate via B_CNTX0, B_CNRX0. No Short TouCAN_C[C_CNRX0, C_CNTX0] shorted to TouCAN_A[A_CNRX0, A_CNTX0] Both modules communicate via A_CNTX0, A_CNRX0. MPC561/MPC563 Reference Manual, Rev. 1.2 18-20 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module Table 18-8. SHORT_REG[SH_TCAN] Bit Settings SH_TCAN2 SH_TCAN1 SH_TCAN0 Effects On TouCAN Modules TouCAN_B[B_CNRX0, B_CNTX0] shorted to TouCAN_A[A_CNRX0, A_CNTX0]. 1 1 0 Both modules communicate via A_CNTX0, A_CNRX0. See Figure 18-24 for example of this bit setting 1 1 1 TouCAN_B[B_CNRX0, B_CNTX0] and TouCAN_C[C_CNRX0, C_CNTX0] shorted to TouCAN_A[A_CNRX0, A_CNTX0] All modules communicate via A_CNTX0, A_CNRX0. MPC561/MPC563 A_CNTX0 CAN TouCAN_A TRANSCEIVER A_CNRX0 B_CNTX0 CAN TouCAN_B TRANSCEIVER B_CNRX0 Figure 18-24. Example of TouCAN Internal Short with SH_TCAN = 0b110 . Table 18-9. SHORT_REG[SH_TPU] Bit Settings SH_TPU0 A_TPUCH0 B_TPUCH0 Effect on TPU3 Modules 1 Input Input 1 Input Output Output data on B_TPUCH0 will be the input to A_TPUCH0 1 Output Input Output on A_TPUCH0 will be the input data to B_TPUCH0 1 Output Output No Short 0 X X No Short Data on pad A_TPUCH0 will be the input to A_TPUCH0 and B_TPUCH0 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-21 Peripheral Pin Multiplexing (PPM) Module Table 18-9. SHORT_REG[SH_TPU] Bit Settings SH_TPU1 A_TPUCH1 B_TPUCH1 Effect on TPU3 Modules 1 Input Input 1 Input Output Output data on B_TPUCH1 will be the input to A_TPUCH1 1 Output Input Output on A_TPUCH1 will be the input data to B_TPUCH1 1 Output Output No Short 0 X X No Short Data on pad A_TPUCH1 will be the input to A_TPUCH1 and B_TPUCH1 MPC561/MPC563 Pad TPU_A TPU_B A_CH A_TPUCH B_TPUCH B_CH Pad Figure 18-25. Short Between TPU Channels 18.4.11 Short Channels Register (SHORT_CH_REG) SHORT_CH_REG allows the shorting of transmit channels from the PPM using the bit field SHORT[7:0]. The PPM normally transmits data by right-shifting TX_DATA at the rate of one bit per PPM_TCLK cycle, TX_DATA15 first. Shorts can be enabled for transmit data bits TX_DATA[1, 3, 5, 7, 9, 11, 13, and 15]. Where a short is enabled for any of these transmit data bits, that bit will be transmitted for two PPM_TCLK cycles, during its own bit time and the bit time of the following transmit data bit. EXAMPLE If SHORT_CHx = 1, transmit TX_DATAx during TX_DATAx bit time and repeat TX_DATAx during TX_DATA[x-1] bit time. MPC561/MPC563 Reference Manual, Rev. 1.2 18-22 Freescale Semiconductor Peripheral Pin Multiplexing (PPM) Module MSB 0 LSB 1 2 Field 3 4 5 6 7 8 9 10 RESERVED 11 12 13 14 15 SHORT_CH[7:0] 0000_0000_0000_0000 SRESET Addr 0x30 5C28 Figure 18-26. Short Channels Register (SHORT_CH_REG) Table 18-10. SHORT_CH_REG Bit Descriptions Bits Name 0:7 -- Description Reserved Each bit of this field will short a specified pair of channels. Where a pair of channels are shorted, the data for the shorted channel will be transmitted twice. Bit 8:17 SHORT_CH[7:0 ] Channel Shorted Re-transmit (bit time) SHORT_CH[x] = 0 No short -- SHORT_CH7 = 1 TX_DATA1 to TX_DATA0 TX_DATA1 in TX_DATA0 SHORT_CH6 = 1 TX_DATA3 to TX_DATA2 TX_DATA3 in TX_DATA2 SHORT_CH5 = 1 TX_DATA5 to TX_DATA4 TX_DATA5 in TX_DATA4 SHORT_CH4 = 1 TX_DATA7 to TX_DATA6 TX_DATA7 in TX_DATA6 SHORT_CH3 = 1 TX_DATA9 to TX_DATA8 TX_DATA9 in TX_DATA8 SHORT_CH2 = 1 TX_DATA11 to TX_DATA10 TX_DATA11 in TX_DATA10 SHORT_CH1 = 1 TX_DATA13 to TX_DATA12 TX_DATA13 in TX_DATA12 SHORT_CH0 = 1 TX_DATA15 to TX_DATA14 TX_DATA15 in TX_DATA14 Refer to Table 18-11 for examples that illustrate the effects of enabling SHORT_CH[7:0] bits. Table 18-11. Examples of the SHORT_CH Bits Register Name Register Contents Comments Example 1 SHORT_CH_REG 0x0000 SHORT_CH[7:0] = 0x00, therefore no shorts enabled TX_DATA[0:15] 0x1234 0b 0001 0010 0011 0100 Data transmitted 0x1234 Normal transmission. Example 2 SHORT_CH_REG 0x00F0 SHORT_CH[7:4] = 1, therefore TX_DATA[1, 3, 5, 7] are enabled for re-transmission. TX_DATA[0:15] 0x1234 0b 0001 0010 0011 0100 Underlines show bits to be re-transmitted MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 18-23 Peripheral Pin Multiplexing (PPM) Module Table 18-11. Examples of the SHORT_CH Bits (continued) Register Name Register Contents Data transmitted 0x3034 Comments 0b 0011 0000 0011 0100 Example 3 18.4.12 SHORT_CH_REG 0x00FF SHORT_CH[7:0] = 1, therefore bits (TX_DATA[1, 3, 5, 7, 9, 11, 13, 15] are enabled for re-transmission. TX_DATA[0:15] 0x1234 0b 0001 0010 0011 0100 Underlines show bits to be re-transmitted Data transmitted 0x303C 0b 0011 0000 0011 1100 Scale Transmit Clock Register (SCALE_TCLK_REG) SCALE_TCLK_REG is used to set the rate of the PPM_TCLK that provides the timing for data transfer into and out of the PPM module. The PPM_TCLK frequency is derived from the system clock, FSYSCLK. PPM_TCLK is software programmable using the following formula: FPPM_TCLK = FSYSCLK / (2 * SCT[6:0]) The range of PPM_TCLK frequencies available is: Table 18-12. SCALE_TCLK Frequencies Minimum Maximum FSYSCLK/256 FSYSCLK/2 MSB LSB 0 1 Field 2 3 4 5 6 7 8 9 10 11 RESERVED SRESET 12 13 14 15 SCT[6:0] 0000_0000_0000_0000 Addr 0x30 5C2A Figure 18-27. Scale Transmit Clock Register (SCALE_TCLK_REG) Table 18-13. SCALE_TCLK_REG Bit Descriptions Bits Name 0:8 -- 9:15 SCT[6:0] Description Reserved Determines the frequency of PPM_TCLK. * SCT[6:0] = 0 FSYSCLK /256 * SCT[6:0] = 1 to 127 FSYSCLK / (2 * SCT[6:0]) Writing to SCT[6:0] while the PPM is enabled will cause an irregular PPM cycle to occur. MPC561/MPC563 Reference Manual, Rev. 1.2 18-24 Freescale Semiconductor Chapter 19 Time Processor Unit 3 The time processor unit 3 (TPU3), an enhanced version of the original TPU, is an intelligent, semi-autonomous microcontroller designed for timing control. The TPU3 is fully compatible to the TPU2. Operating simultaneously with the CPU, the two TPU3 modules process micro-instructions, schedule and process real-time hardware events, perform input and output, and access shared data without CPU intervention. Consequently, for each timer event, the CPU setup and service times are minimized or eliminated. The MPC561/MPC563 contains two independent TPU3s: TPU_A and TPU_B. These two TPU3 modules are memory mapped as shown in Table 19-1. . Table 19-1. TPU Memory Map TPU Address TPU_A 0x30 4000--0x30 43FF TPU_B 0x30 4400--0x30 47FF Figure 19-1 is a simplified block diagram of a single TPU3. Host Interface Control IMB3 Channel System Config Development Support and Test Channel Control Parameter RAMDATA Service Requests Scheduler TCR1 T2CLK Signal Timer Channels Channel 0 Channel 1 TCR2 Pins Microengine Data Control Store Control and Data Execution Unit Channel 15 Figure 19-1. TPU3 Block Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-1 Time Processor Unit 3 19.1 Overview The TPU3 can be viewed as a special-purpose microcomputer that performs a programmable series of two operations, match and capture. Each occurrence of either operation is called an event. A programmed series of events is called a function. TPU functions replace software functions that would require CPU interrupt service. The microcode ROM TPU3 functions that are available in the MPC561/MPC563 are described in Appendix D, "TPU3 ROM Functions." 19.2 TPU3 Components The TPU3 consists of two 16-bit time bases, 16 independent timer channels, a task scheduler, a microengine, and a host interface. In addition, a dual-ported parameter RAM (DPTRAM) is used to pass parameters between the module and the CPU. 19.2.1 Time Bases Two 16-bit counters provide reference time bases for all output-compare and input-capture events. Prescalers for both time bases are controlled by the CPU via bit fields in the TPU3 module configuration register (TPUMCR) and TPU module configuration register two (TPUMCR2). Timer count registers TCR1 and TCR2 provide access to the current counter values. TCR1 and TCR2 can be read by TPU microcode but are not directly available to the CPU. The TCR1 clock is always derived from the system clock. The TCR2 clock can be derived from the system clock or from an external input via theT2CLK clock pin. The duration between active edges on the T2CLK clock pin must be at least nine system clocks. 19.2.2 Timer Channels The TPU3 has 16 independent channels, each connected to an MCU pin. The channels have identical hardware and are functionally equivalent in operation. Each channel consists of an event register and pin control logic. The event register contains a 16-bit capture register, a 16-bit compare/match register, and a 16-bit greater-than-or-equal-to comparator. The direction of each pin, either output or input, is determined by the TPU microengine. Each channel can either use the same time base for match and capture, or can use one time base for match and the other for capture. 19.2.3 Scheduler When a service request is received, the scheduler determines which TPU3 channel is serviced by the microengine. A channel can request service for one of four reasons: for host service, for a link to another channel, for a match event, or for a capture event. The host system assigns each active channel one of three priorities: high, middle, or low. When multiple service requests are received simultaneously, a priority-scheduling mechanism grants service based on channel number and assigned priority. MPC561/MPC563 Reference Manual, Rev. 1.2 19-2 Freescale Semiconductor Time Processor Unit 3 19.2.4 Microengine The microengine is composed of a control store and an execution unit. Control-store ROM holds the microcode for each factory-masked time function. When assigned to a channel by the scheduler, the execution unit executes microcode for a function assigned to that channel by the CPU. Microcode can also be executed from the dual-port RAM (DPTRAM) module instead of the control store. The DPTRAM allows emulation and development of custom TPU microcode without the generation of a microcode ROM mask. Refer to Section 19.3.6, "Emulation Support" for more information. 19.2.5 Host Interface The host interface registers allow communication between the CPU and the TPU3, both before and during execution of a time function. The registers are accessible from the IMB through the TPU3 bus interface unit. Refer to Section 19.4, "Programming Model" for register bit/field definitions and address mapping. 19.2.6 Parameter RAM Parameter RAM occupies 256 bytes at the top of the system address map. Channel parameters are organized as 128 16-bit words. Channels zero through 15 each have eight parameters. The parameter RAM address map in Section 19.4.15, "TPU3 Parameter RAM," shows how parameter words are organized in memory. The CPU specifies function parameters by writing to the appropriate RAM address. The TPU3 reads the RAM to determine channel operation. The TPU3 can also store information to be read by the CPU in the parameter RAM. Detailed descriptions of the parameters required by each time function are beyond the scope of this manual. Refer to the TPU Reference Manual (TPURM/AD), included in the TPU Literature Package (TPULITPAK/D) for more information. 19.3 TPU Operation All TPU3 functions are related to one of the two 16-bit time bases. Functions are synthesized by combining sequences of match events and capture events. Because the primitives are implemented in hardware, the TPU3 can determine precisely when a match or capture event occurs, and respond rapidly. An event register for each channel provides for simultaneous match/capture event occurrences on all channels. When a match or input capture event requiring service occurs, the affected channel generates a service request to the scheduler. The scheduler determines the priority of the request and assigns the channel to the microengine at the first available time. The microengine performs the function defined by the content of the control store or emulation RAM, using parameters from the parameter RAM. 19.3.1 Event Timing Match and capture events are handled by independent channel hardware. This provides an event accuracy of one time-base clock period, regardless of the number of channels that are active. An event normally causes a channel to request service. The time needed to respond to and service an event is determined by which channels and the number of channels requesting service, the relative priorities of the channels requesting service, and the microcode execution time of the active functions. Worst-case event service MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-3 Time Processor Unit 3 time (latency) determines TPU3 performance in a given application. Latency can be closely estimated. For more information, refer to the TPU Reference Manual (TPURM/AD). 19.3.2 Channel Orthogonality Most timer systems are limited by the fixed number of functions assigned to each pin. All TPU3 channels contain identical hardware and are functionally equivalent in operation, so that any channel can be configured to perform any time function. Any function can operate on the calling channel, and, under program control, on another channel determined by the program or by a parameter. The user controls the combination of time functions. 19.3.3 Interchannel Communication The autonomy of the TPU3 is enhanced by the ability of a channel to affect the operation of one or more other channels without CPU intervention. Interchannel communication can be accomplished by issuing a link service request to another channel, by controlling another channel directly, or by accessing the parameter RAM of another channel. 19.3.4 Programmable Channel Service Priority The TPU3 provides a programmable service priority level to each channel. Three priority levels are available. When more than one channel of a given priority requests service at the same time, arbitration is accomplished according to channel number. To prevent a single high-priority channel from permanently blocking other functions, other service requests of the same priority are performed in channel order after the lowest-numbered, highest-priority channel is serviced (i.e. round-robin). 19.3.5 Coherency For data to be coherent, all available portions of the data must be identical in age, or must be logically related. As an example, consider a 32-bit counter value that is read and written as two 16-bit words. The 32-bit value is read-coherent only if both 16-bit portions are updated at the same time, and write-coherent only if both portions take effect at the same time. Parameter RAM hardware supports coherent access of two adjacent 16-bit parameters. The host CPU must use a long-word operation to guarantee coherency. 19.3.6 Emulation Support Although factory-programmed time functions can perform a wide variety of control tasks, they may not be ideal for all applications. The TPU3 provides emulation capability that allows the development of new time functions. Emulation mode is entered by setting the EMU bit in TPUMCR. In emulation mode, an auxiliary bus connection is made between the DPTRAM and the TPU3, and access to DPTRAM via the intermodule bus is disabled. A 9-bit address bus, a 32-bit data bus, and control lines transfer information between the modules. To ensure exact emulation, DPTRAM module access timing remains consistent with access timing of the TPU microcode ROM control store. To support changing TPU application requirements, Freescale has established a TPU function library. The function library is a collection of TPU functions written for easy assembly in combination with each other MPC561/MPC563 Reference Manual, Rev. 1.2 19-4 Freescale Semiconductor Time Processor Unit 3 or with custom functions. Refer to Freescale Programming Note, Using the TPU Function Library and TPU Emulation Mode (TPUPN00/D) for information about developing custom functions and accessing the TPU function library. Refer to General TPU C Functions for the MPC500 Family (AN2360/D) for more information about TPU functions in general and the TPU Literature Package (TPULITPAK/D) for more information about specific functions. 19.3.7 TPU3 Interrupts Each of the TPU3 channels can generate an interrupt service request. Interrupts for each channel must be enabled by writing to the appropriate control bit in the channel interrupt enable register (CIER). The channel interrupt status register (CISR) contains one interrupt status flag per channel. Time functions set the flags. Setting a flag bit causes the TPU3 to make an interrupt service request if the corresponding channel interrupt enable bit is set. The TPU3 can generate one of 32 possible interrupt request levels on the IMB3. The value driven onto IRQ[7:0] represents the interrupt level programmed in the IRL field of the TPU interrupt configuration register (TICR). Under the control of the ILBS bits in the ICR, each interrupt request level is driven during one of four different time-multiplexed time slots, with eight levels communicated per time slot. No hardware priority is assigned to interrupts. Furthermore, if more than one source on a module requests an interrupt at the same level, the system software must assign a priority to each source requesting at that level. Figure 19-2 displays the interrupt level scheme. IMB3 CLOCK ILBS[1:0] IMB3 IRQ[7:0] 00 01 10 11 00 01 IRQ 7:0 IRQ 15:8 IRQ 23:16 IRQ 31:24 IRQ 7:0 10 11 Figure 19-2. TPU3 Interrupt Levels 19.3.8 Prescaler Control for TCR1 Timer count register 1 (TCR1) is clocked from the output of a prescaler. The following fields control TCR1: * The PSCK and TCR1P fields in TPUMCR * The DIV2 field in TPUMCR2 * The EPSCKE and EPSCK fields in TPUMCR3. The rate at which TCR1 is incremented is determined as follows: * The user selects either the standard prescaler (by clearing the enhanced prescaler enable bit, EPSCKE, in TPUMCR3) or the enhanced prescaler (by setting EPSCKE). -- If the standard prescaler is selected (EPSCKE = 0), then the PSCK bit determines whether the standard prescaler divides the system clock input by 32 (PSCK = 0) or 4 (PSCK = 1) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-5 Time Processor Unit 3 -- If the enhanced prescaler is selected (EPSCKE = 1), the EPSCK bits select a value by which the system clock is divided. The lowest frequency for TCR1 clock is system clock divided by 64x8. The highest frequency for TCR1 clock is system clock divided by two (2x1). See Table 19-2 and Table 19-3. Table 19-2. Enhanced TCR1 Prescaler Divide Values EPSCK Value Divide System Clock By 0x00 2 0x01 4 0x02 6 0x03 8 0x04, 0x05,...0x1d 10,12,...60 0x1e 62 0x1f 64 -- The output of either the standard prescaler or the enhanced prescaler is then divided by 1, 2, 4, or 8, depending on the value of the TCR1P field in the TPUMCR. Table 19-3. TCR1 Prescaler Values TCR1P Value Divide by 0b00 1 0b01 2 0b10 4 0b11 8 -- If the TPUMCR2[DIV2] bit is one, the TCR1 counter increments at a rate of the internal clock divided by two. If DIV2 is zero, the TCR1 increment rate is defined by the output of the TCR1 prescaler (which, in turn, takes as input the output of either the standard or enhanced prescaler). Figure 19-3 shows a diagram of the TCR1 prescaler control block. MPC561/MPC563 Reference Manual, Rev. 1.2 19-6 Freescale Semiconductor Time Processor Unit 3 System Clock Prescaler 4, 32 Enhanced Prescaler 2,4,6,...64 PSCK Mux TCR1 Prescaler 1,2,4,8 TCR1 EPSCKE DIV2 Figure 19-3. TCR1 Prescaler Control 19.3.9 Prescaler Control for TCR2 Timer count register 2 (TCR2), like TCR1, is clocked from the output of a prescaler. The T2CG (TCR2 clock/gate control) bit and the T2CSL (TCR2 counter clock edge) bit in TPUMCR determine T2CR2 pin functions. Refer to Table 19-4. Table 19-4. TCR2 Counter Clock Source T2CSL T2CG TCR2 Clock 0 0 Rise transition T2CLK 0 1 Gated system clock 1 0 Fall transition T2CLK 1 1 Rise and fall transition T2CLK The function of the T2CG bit is shown in Figure 19-4. When T2CG is set, the external T2CLK pin functions as a gate of the DIV8 clock (the TPU3 system clock divided by eight). In this case, when the external TCR2 pin is low, the DIV8 clock is blocked, preventing it from incrementing TCR2. When the external TCR2 pin is high, TCR2 is incremented at the frequency of the DIV8 clock. When T2CG is cleared, an external clock from the TCR2 pin, which has been synchronized and fed through a digital filter, increments TCR2. The duration between active edges on the T2CLK clock pin must be at least nine system clocks. TPUMCR3[TCR2PSCK2] and TPUMCR[TCR2] determine how the clock source is divided to provide the output, see Table 19-5. Figure 19-4 illustrates the TCR2 pre-divider and pre-scaler control. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-7 Time Processor Unit 3 TCR2 Pin Clock Source Mux Control CLOCK DIV8 Pre-divider Prescaler TCR2 Prescaler TCR2 TCR2PSCK2 Figure 19-4. TCR2 Prescaler Control Table 19-5 is a summary of prescaler output (assuming a divide-by-one value for the pre-divider prescaler). Table 19-5. TCR2 Prescaler Control Internal Clock Divide Ratio External Clock Divide Ratio TCR2 Value 19.4 TCR2PSCK2 = 0 TCR2PSCK2 = 1 TCR2PSCK2 = 0 TCR2PSCK2 = 1 0b00 8 8 1 1 0b01 16 24 2 3 0b10 32 56 4 7 0b11 64 120 8 15 Programming Model The TPU3 memory map contains three groups of registers: * System configuration registers * Channel control and status registers * Development support and test verification registers All registers except the channel interrupt status register (CISR) must be read or written by means of half-word (16-bit) or word (32-bit) accesses. The address space of the TPU3 memory map occupies 512 bytes. Unused registers within the 512-byte address space return zeros when read. Table 19-6 shows the TPU3 address map. Table 19-6. TPU3 Register Map Address Register 0x30 4000(TPU_A) 0x30 4400(TPU_B) TPU3 Module Configuration Register (TPUMCR) See Table 19-7 for bit descriptions. 0x30 4002(TPU_A) 0x30 4402(TPU_B) TPU3 Test Configuration Register (TCR) 0x30 4004(TPU_A) 0x30 4404(TPU_B) Development Support Control Register (DSCR) See Table 19-8 for bit descriptions. 0x30 4006(TPU_A) 0x30 4406(TPU_B) Development Support Status Register (DSSR) See Table 19-9 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 19-8 Freescale Semiconductor Time Processor Unit 3 Table 19-6. TPU3 Register Map (continued) Address Register 0x30 4008(TPU_A) 0x30 4408(TPU_B) TPU3 Interrupt Configuration Register (TICR) See Table 19-10 for bit descriptions. 0x30 400A(TPU_A) 0x30 440A(TPU_B) Channel Interrupt Enable Register (CIER) See Table 19-11 for bit descriptions. 0x30 400C(TPU_A) 0x30 440C(TPU_B) Channel Function Selection Register 0 (CFSR0) See Table 19-12 for bit descriptions. 0x30 400E(TPU_A) 0x30 440E(TPU_B)) Channel Function Selection Register 1 (CFSR1) See Table 19-12 for bit descriptions. 0x30 4010(TPU_A) 0x30 4410(TPU_B) Channel Function Selection Register 2 (CFSR2) See Table 19-12 for bit descriptions. 0x30 4012(TPU_A) 0x30 4412(TPU_B) Channel Function Selection Register 3 (CFSR3) See Table 19-12 for bit descriptions. 0x30 4014(TPU_A) 0x30 4414(TPU_B) Host Sequence Register 0 (HSQR0) See Table 19-13 for bit descriptions. 0x30 4016(TPU_A) 0x30 4416(TPU_B) Host Sequence Register 1 (HSQR1) See Table 19-13 for bit descriptions. 0x30 4018(TPU_A) 0x30 4418(TPU_B) Host Service Request Register 0 (HSRR0) See Table 19-14 for bit descriptions. 0x30 401A(TPU_A) 0x30 441A(TPU_B)) Host Service Request Register 1 (HSRR1) See Table 19-14 for bit descriptions. 0x30 401C(TPU_A) 0x30 441C(TPU_B) Channel Priority Register 0 (CPR0) See Table 19-15 for bit descriptions. 0x30 401E(TPU_A) 0x30 441E(TPU_B)) Channel Priority Register 1 (CPR1) See Table 19-15 for bit descriptions. 0x30 4020(TPU_A) 0x30 4420(TPU_B) Channel Interrupt Status Register (CISR) See Table 19-17 for bit descriptions. 0x30 4022(TPU_A) 0x30 4422(TPU_B) Link Register (LR) 0x30 4024(TPU_A) 0x30 4424(TPU_B) Service Grant Latch Register (SGLR) 0x30 4026(TPU_A) 0x30 4426(TPU_B) Decoded Channel Number Register (DCNR) 0x30 4028(TPU_A) 0x30 4428(TPU_B) TPU Module Configuration Register 2 (TPUMCR2) See Table 19-18 for bit descriptions. 0x30 402A(TPU_A) 0x30 442A(TPU_B) TPU Module Configuration 3 (TPUMCR3) See Table 19-21 for bit descriptions. 0x30 402C(TPU_A) 0x30 442C(TPU_B) Internal Scan Data Register (ISDR) 0x30 402E(TPU_A) 0x30 442E(TPU_B) Internal Scan Control Register (ISCR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-9 Time Processor Unit 3 Table 19-6. TPU3 Register Map (continued) Address Register 0x30 4100 - 0x30 410F(TPU_A) 0x30 4500 - 0x30 450F(TPU_B) Channel 0 Parameter Registers 0x30 4110 - 0x30 411F(TPU_A) 0x30 4510 - 0x30 451F(TPU_B) Channel 1 Parameter Registers 0x30 4120 - 0x30 412F(TPU_A) 0x30 4520 - 0x30 452F(TPU_B) Channel 2 Parameter Registers 0x30 4130 - 0x30 413F(TPU_A) 0x30 4530 - 0x30 453F(TPU_B) Channel 3 Parameter Registers 0x30 4140 - 0x30 414F(TPU_A) 0x30 4540 - 0x30 454F(TPU_B) Channel 4 Parameter Registers 0x30 4150 - 0x30 415F(TPU_A) 0x30 4550 - 0x30 455F(TPU_B) Channel 5 Parameter Registers 0x30 4160 - 0x30 416F(TPU_A) 0x30 4560 - 0x30 456F(TPU_B) Channel 6 Parameter Registers 0x30 4170 - 0x30 417F(TPU_A) 0x30 4570 - 0x30 457F(TPU_B) Channel 7 Parameter Registers 0x30 4180 - 0x30 418F(TPU_A) 0x30 4580 - 0x30 458F(TPU_B) Channel 8 Parameter Registers 0x30 4190 - 0x30 419F(TPU_A) 0x30 4590 - 0x30 459F(TPU_B) Channel 9 Parameter Registers 0x30 41A0 - 0x30 41AF(TPU_A) 0x30 45A0 - 0x30 45AF(TPU_B) Channel 10 Parameter Registers 0x30 41B0 - 0x30 41BF(TPU_A) 0x30 45B0 - 0x30 45BF(TPU_B) Channel 11 Parameter Registers 0x30 41C0 - 0x30 41CF(TPU_A) Channel 12 Parameter Registers 0x30 45C0 - 0x30 45CF(TPU_B) 0x30 41D0 - 0x30 41DF(TPU_A) Channel 13 Parameter Registers 0x30 45D0 - 0x30 45DF(TPU_B) 0x30 41E0 - 0x30 41EF(TPU_A) 0x30 45E0 - 0x30 45EF(TPU_B) Channel 14 Parameter Registers 0x30 41F0 - 0x30 41FF(TPU_A) 0x30 45F0 - 0x30 45FF(TPU_B) Channel 15 Parameter Registers MPC561/MPC563 Reference Manual, Rev. 1.2 19-10 Freescale Semiconductor Time Processor Unit 3 19.4.1 TPU Module Configuration Register (TPUMCR) MSB 0 Field STOP SRESET LSB 1 2 3 4 TCR1P TCR2P 00 00 0 Addr 5 6 7 8 9 10 11 12 EMU T2CG STF SUPV PSCK TPU3 T2CSL 0 0 0 1 0 1 0 13 14 15 -- 0000 0x30 4000(TPU_A), 0x30 4400 (TPU_B) Figure 19-5. TPUMCR -- TPU Module Configuration Register Table 19-7. TPUMCR Bit Description Bits Name Description 0 STOP Low-power stop mode enable. If the STOP bit in TPUMCR is set, the TPU3 shuts down its internal clocks, shutting down the internal microengine. TCR1 and TCR2 cease to increment and retain the last value before the stop condition was entered. The TPU3 asserts the stop flag (STF) in TPUMCR to indicate that it has stopped. 0 Enable TPU3 clocks 1 Disable TPU3 clocks 1:2 TCR1P Timer Count Register 1 prescaler control. TCR1 is clocked from the output of a prescaler. The prescaler divides its input by 1, 2, 4, or 8. This is a write-once field unless the PWOD bit in TPUMCR3 is set. 00 Divide by 1 01 Divide by 2 10 Divide by 4 11 Divide by 8 Refer to Section 19.3.8, "Prescaler Control for TCR1" for more information. 3:4 TCR2P Timer Count Register 2 prescaler control. TCR2 is clocked from the output of a prescaler. The prescaler divides this input by 1, 2, 4, or 8. This is a write-once field unless the PWOD bit in TPUMCR3 is set. 00 Divide by 1 01 Divide by 2 10 Divide by 4 11 Divide by 8 Refer to Section 19.3.9, "Prescaler Control for TCR2" for more information. 5 EMU Emulation control. In emulation mode, the TPU3 executes microinstructions from DPTRAM exclusively. Access to the DPTRAM via the IMB3 is blocked, and the DPTRAM is dedicated for use by the TPU3. After reset, this bit can be written only once. 0 TPU3 and DPTRAM operate normally 1 TPU3 and DPTRAM operate in emulation mode1 6 T2CG TCR2 clock/gate control 0 TCR2 pin used as clock source for TCR2 1 TCR2 pin used as gate of DIV8 clock for TCR2 Refer to Section 19.3.9, "Prescaler Control for TCR2" for more information. 7 STF 8 SUPV Stop flag. 0 TPU3 is operating normally 1 TPU3 is stopped (STOP bit has been set) Supervisor data space 0 Assignable registers are accessible from user or supervisor privilege level 1 Assignable registers are accessible from supervisor privilege level only MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-11 Time Processor Unit 3 Table 19-7. TPUMCR Bit Description (continued) 1 Bits Name Description 9 PSCK Standard prescaler clock. Note that this bit has no effect if the extended prescaler is selected (EPSCKE = 1). 0 fSYS / 32 is input to TCR1 prescaler, if standard prescaler is selected 1 fSYS / 4 is input to TCR1 prescaler, if standard prescaler is selected 10 TPU3 TPU3 enable. The TPU3 enable bit provides compatibility with the TPU. If running TPU code on the TPU3, the microcode size should not be greater than 2 Kbytes and the TPU3 enable bit should be cleared to zero. The TPU3 enable bit is write-once after reset. The reset value is one, meaning that the TPU3 will operate in TPU3 mode. 0 TPU mode; zero is the TPU reset value 1 TPU3 mode; one is the TPU3 reset value NOTE: The programmer should not change this value unless necessary when developing custom TPU microcode. 11 T2CSL TCR2 counter clock edge. This bit and the T2CG control bit determine the clock source for TCR2. Refer to Section 19.3.9, "Prescaler Control for TCR2" for details. 12:15 -- Reserved. These bits are used for the IARB (interrupt arbitration ID) field in TPU3 implementations that use hardware interrupt arbitration. If all TPUs connected to a DPTRAM are stopped, the DPTRAM is accessible. 19.4.2 Development Support Control Register (DSCR) This register is accessible only when the TPU is in test mode; see Section 19.4.14, "Factory Test Registers." MSB 0 LSB 1 Field HOT4 2 3 -- SRESET 4 5 6 BLC CLKS 7 8 FRZ 9 10 11 12 13 14 15 CCL BP BC BH BL BM BT 0000_0000_0000_0000 Addr 0x30 4004 (TPU_A), 0x30_4404 (TPU_B) Figure 19-6. DSCR -- Development Support Control Register Table 19-8. DSCR Bit Descriptions Bits Name 0 HOT4 1:4 -- 5 BLC 6 CLKS Description Hang On T4 1 0 Exit wait on T4 state caused by assertion of HOT4 1 Enter wait on T4 state Reserved Branch Latch Control 0 Latch conditions into branch condition register before exiting halted state 1 Do not latch conditions into branch condition register before exiting the halted state or during the time-slot transition period Stop clocks (to TCRs) 0 Do not stop TCRs 1 Stop TCRs during the halted state MPC561/MPC563 Reference Manual, Rev. 1.2 19-12 Freescale Semiconductor Time Processor Unit 3 Table 19-8. DSCR Bit Descriptions (continued) 1 Bits Name Description 7:8 FRZ FREEZE assertion response. The FRZ bits specify the TPU microengine response to the IMB3 FREEZE signal 00 Ignore freeze 01 Reserved 10 Freeze at end of current microcycle 11 Freeze at next time-slot boundary 9 CCL Channel Conditions Latch. CCL controls the latching of channel conditions match recognition latch (MRL) and transition detect latch (TDL) when the CHAN register is written. Refer to the TPU Reference Manual (TPURM/AD) for further information. 0 Only the pin state condition of the new channel is latched as a result of the write CHAN register microinstruction 1 Pin state, MRL, and TDL conditions of the new channel are latched as a result of a write CHAN register microinstruction 10 BP Breakpoint enable for microprogram counter (PC) 0 Breakpoint not enabled 1 Break if PC equals PC breakpoint register 11 BC Channel breakpoint enable 0 Breakpoint not enabled 1 Break if CHAN register equals channel breakpoint register at beginning of state or when CHAN is changed through microcode 12 BH Host service breakpoint enable 0 Breakpoint not enabled 1 Break if host service latch is asserted at beginning of state 13 BL Link service breakpoint enable 0 Breakpoint not enabled 1 Break if link service latch is asserted at beginning of state 14 BM MRL breakpoint enable 0 Breakpoint not enabled 1 Break if MRL is asserted at beginning of state 15 BT TDL breakpoint enable 0 Breakpoint not enabled 1 Break if TDL is asserted at beginning of state T4 is one of the four basic timers (T1, T2, T3 & T4) used for microengine timing. 19.4.3 Development Support Status Register (DSSR) This register is accessible only when the TPU is in test mode; see Section 19.4.14, "Factory Test Registers." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-13 Time Processor Unit 3 MSB 0 LSB 1 2 3 Field 4 5 6 7 -- 8 9 10 11 12 13 BKPT PCBK CHBK SRBK TPUF 14 15 -- 0000_0000_0000_0000 SRESET Addr 0x30 4006 (TPU_A), 0x30 4406 (TPU_B) Figure 19-7. DSSR -- Development Support Status Register Table 19-9. DSSR Bit Descriptions Bits Name 0:7 -- 8 BKPT Breakpoint asserted flag. If an internal breakpoint caused the TPU3 to enter the halted state, the TPU3 asserts the BKPT signal on the IMB and sets the BKPT flag. BKPT remains set until the TPU3 recognizes a breakpoint acknowledge cycle, or until the IMB FREEZE signal is asserted. 9 PCBK Microprogram Counter (PC) breakpoint flag. PCBK is asserted if a breakpoint occurs because of a PC register match with the PC breakpoint register. PCBK is negated when the BKPT flag is cleared. 10 CHBK Channel register breakpoint flag. CHBK is asserted if a breakpoint occurs because of a CHAN register match with the CHAN register breakpoint register. CHBK is negated when the BKPT flag is cleared. 11 SRBK Service request breakpoint flag. SRBK is asserted if a breakpoint occurs because of any of the service request latches being asserted along with their corresponding enable flag in the development support control register. SRBK is negated when the BKPT flag is cleared. 12 TPUF TPU3 FREEZE flag. TPUF is set whenever the TPU3 is in a halted state as a result of FREEZE being asserted. This flag is automatically negated when the TPU3 exits the halted state because of FREEZE being negated. 13:15 -- 19.4.4 Description Reserved Reserved TPU3 Interrupt Configuration Register (TICR) MSB 0 Field SRESET Addr LSB 1 2 -- 3 4 5 6 CIRL 7 8 9 10 11 ILBS 12 13 14 15 -- 0000_0000_0000_0000 0x30 4008 (TPU_A), 0x30 4408 (TPU_B) Figure 19-8. TICR -- TPU3 Interrupt Configuration Register MPC561/MPC563 Reference Manual, Rev. 1.2 19-14 Freescale Semiconductor Time Processor Unit 3 Table 19-10. TICR Bit Description Bits Name 0:4 -- 5:7 CIRL Channel interrupt request level. This three-bit field specifies the interrupt request level for all channels. This field is used in conjunction with the ILBS field to determine the request level of TPU3 interrupts. 8:9 ILBS Interrupt level byte select. This field and the CIRL field determine the level of TPU3 interrupt requests. 00 IRQ[0:7] selected 01 IRQ[8:15] selected 10 IRQ[16:23] selected 11 IRQ[24:31] selected 10:15 -- 19.4.5 Description Reserved Reserved. Note that bits 10:11 represent channel interrupt base vector (CIBV) bits in some TPU3 implementations. Channel Interrupt Enable Register (CIER) The channel interrupt enable register (CIER) allows the CPU to enable or disable the ability of individual TPU3 channels to request interrupt service. Setting the appropriate bit in the register enables a channel to make an interrupt service request; clearing a bit disables the interrupt. MSB Field LSB 0 1 2 3 4 5 CH 15 CH 14 CH 13 CH 12 CH 11 CH 10 6 7 8 9 10 11 12 13 14 15 CH 9 CH 8 CH 7 CH 6 CH 5 CH 4 CH 3 CH 2 CH 1 CH 0 0000_0000_0000_0000 SRESET Addr 0x30 400A (TPU_A), 0x30 440A (TPU_B) Figure 19-9. CIER -- Channel Interrupt Enable Register Table 19-11. CIER Bit Descriptions Bits Name 0:15 CH[15:0] 19.4.6 Description Channel interrupt enable/disable 0 Channel interrupts disabled 1 Channel interrupts enabled NOTE: The MSB (bit 0) represents CH15, and the LSB (bit 15) represents CH0. Channel Function Select Registers (CFSRn) Encoded 4-bit fields within the channel function select registers specify one of 16 time functions to be executed on the corresponding channel. Encodings for predefined functions are found in Table D-1 and Table D-2. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-15 Time Processor Unit 3 MSB LSB 0 1 Field 2 3 4 5 CH 15 6 7 8 9 CH 14 10 11 12 13 CH 13 14 15 CH 12 0000_0000_0000_0000 SRESET Addr 0x30 400C (TPU_A), 0x30 440C (TPU_B) Figure 19-10. CFSR0 -- Channel Function Select Register 0 MSB LSB 0 1 Field 2 3 4 5 CH 11 6 7 8 9 CH 10 SRESET 10 11 12 13 CH 9 14 15 CH 8 0000_0000_0000_0000 Addr 0x30 400E (TPU_A), 0x30 440E (TPU_B) Figure 19-11. CFSR1 -- Channel Function Select Register 1 MSB 0 LSB 1 Field 2 3 4 5 CH 7 6 7 8 9 CH 6 SRESET 10 11 12 13 CH 5 14 15 CH 4 0000_0000_0000_0000 Addr 0x30 4010 (TPU_A), 0x30 4410 (TPU_B) Figure 19-12. CFSR2 -- Channel Function Select Register 2 MSB 0 Field LSB 1 2 CH 3 SRESET 3 4 5 6 7 8 CH 2 9 10 11 CH 1 12 13 14 15 CH 0 0000_0000_0000_0000 Addr 0x30 4012 (TPU_A), 0x30 4412 (TPU_B) Figure 19-13. CFSR3 -- Channel Function Select Register 3 Table 19-12. CFSRn Bit Descriptions Name CH[15:0] 19.4.7 Description Encoded time function for each channel. Encoded four-bit fields in the channel function select registers specify one of 16 time functions to be executed on the corresponding channel. Host Sequence Registers (HSQRn) The host sequence field selects the mode of operation for the time function selected on a given channel. The meaning of the host sequence bits depends on the time function specified. See Appendix D, "TPU3 ROM Functions," for definitions of the host service request bits for the predefined TPU ROM functions. MPC561/MPC563 Reference Manual, Rev. 1.2 19-16 Freescale Semiconductor Time Processor Unit 3 MSB LSB 0 Field 1 2 CH 15 3 4 CH 14 5 6 CH 13 7 8 CH 12 9 10 CH 11 11 12 CH 10 13 14 CH 9 15 CH 8 0000_0000_0000_0000 SRESET Addr 0x30 4014 (TPU_A), 0x30 4414 (TPU_B) Figure 19-14. HSQR0 -- Host Sequence Register 0 MSB LSB 0 Field 1 2 CH 7 3 4 CH 6 5 6 CH 5 7 8 CH 4 SRESET 9 10 CH 3 11 CH 2 12 13 CH 1 14 15 CH 0 0000_0000_0000_0000 Addr 0x30 4016 (TPU_A), 0x30 4416 (TPU_B) Figure 19-15. HSQR1 -- Host Sequence Register 1 Table 19-13. HSQRn Bit Descriptions Name Description CH[15:0] Encoded host sequence. The host sequence field selects the mode of operation for the time function selected on a given channel. The meaning of the host sequence bits depends on the time function specified. 19.4.8 Host Service Request Registers (HSRRn) The host service request field selects the type of host service request for the time function selected on a given channel. The meaning of the host service request bits is determined by time function microcode. See Appendix D, "TPU3 ROM Functions," the TPU Reference Manual and the Freescale TPU Literature Package for more information. MSB LSB 0 Field 1 2 CH 15 3 4 CH 14 5 6 CH 13 SRESET 7 8 CH 12 9 CH 11 10 11 12 CH 10 13 14 CH 9 15 CH 8 0000_0000_0000_0000 Addr 0x30 4018 (TPU_A), 0x30 4418 (TPU_B) Figure 19-16. HSRR0 -- Host Service Request Register 0 MSB 0 Field LSB 1 CH 7 SRESET Addr 2 3 CH 6 4 5 CH 5 6 7 CH 4 8 9 CH 3 10 11 CH 2 12 13 CH 1 14 15 CH 0 0000_0000_0000_0000 0x30 401A (TPU_A), 0x30 441A (TPU_B) Figure 19-17. HSRR1 -- Host Service Request Register 1 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-17 Time Processor Unit 3 Table 19-14. HSSRn Bit Descriptions Name Description CH[15:0] Encoded type of host service. The host service request field selects the type of host service request for the time function selected on a given channel. The meaning of the host service request bits depends on the time function specified. A host service request field cleared to 0b00 signals the host that service is completed by the microengine on that channel. The host can request service on a channel by writing the corresponding host service request field to one of three non-zero states. The CPU must monitor the host service request register until the TPU3 clears the service request to 0b00 before any parameters are changed or a new service request is issued to the channel. 19.4.9 Channel Priority Registers (CPRx) The channel priority registers (CPR1, CPR2) assign one of three priority levels to a channel or disable the channel. See Appendix D, "TPU3 ROM Functions," for more information. MSB LSB 0 Field 1 CH 15 2 3 4 CH 14 5 6 CH 13 7 CH 12 SRESET 8 9 CH 11 10 11 CH 10 12 13 14 CH 9 15 CH 8 0000_0000_0000_0000 Addr 0x30 401C (TPU_A), 0x30 441C (TPU_B) Figure 19-18. CPR0 -- Channel Priority Register 0 MSB LSB 0 Field 1 CH 7 2 3 4 CH 6 5 6 CH 5 SRESET 7 CH 4 8 9 CH 3 10 11 CH 2 12 13 CH 1 14 15 CH 0 0000_0000_0000_0000 Addr 0x30 401E (TPU_A), 0x30 441E (TPU_B) Figure 19-19. CPR1 -- Channel Priority Register 1 Table 19-15. CPRn Bit Description Name CH[15:0] Description Encoded channel priority levels. Table 19-16 indicates the number of time slots guaranteed for each channel priority encoding. Table 19-16. Channel Priorities CHx[1:0] Service Guaranteed Time Slots 00 Disabled -- 01 Low 1 out of 7 10 Middle 2 out of 7 11 High 4 out of 7 MPC561/MPC563 Reference Manual, Rev. 1.2 19-18 Freescale Semiconductor Time Processor Unit 3 19.4.10 Channel Interrupt Status Register (CISR) The channel interrupt status register (CISR) contains one interrupt status flag per channel. Time functions specify via microcode when an interrupt flag is set. Setting a flag causes the TPU3 to make an interrupt service request if the corresponding CIER bit is set. To clear a status flag, read CISR, then write a zero to the appropriate bit. NOTE CISR is the only TPU3 register that can be accessed on a byte basis. MSB LSB 0 Field CH 15 1 2 3 4 5 CH 14 CH 13 CH 12 CH 11 CH 10 6 7 8 9 10 11 12 13 14 15 CH 9 CH 8 CH 7 CH 6 CH 5 CH 4 CH 3 CH 2 CH 1 CH 0 0000_0000_0000_0000 SRESET Addr 0x30 4020 (TPU_A), 0x30 4420 (TPU_B) Figure 19-20. CISR -- Channel Interrupt Status Register Table 19-17. CISR Bit Descriptions Bits Name 0:15 CH[15:0] Description Channel interrupt status 0 Channel interrupt not asserted 1 Channel interrupt asserted 19.4.11 TPU3 Module Configuration Register 2 (TPUMCR2) MSB LSB 0 1 2 Field 3 -- 4 5 6 7 8 9 DIV2 SOFTRST 10 ETBANK 11 12 FPSCK 13 14 15 T2CF DTPU 0000_0000_0000_0000 SRESET Addr 0x30 4028 (TPU_A), 0x30 4428 (TPU_B) Figure 19-21. TPUMCR2 -- TPU Module Configuration Register 2 Table 19-18. TPUMCR2 Bit Descriptions Bits Name 0:6 -- 7 DIV2 Description Reserved Divide by 2 control. When asserted, the DIV2 bit, along with the TCR1P bit and the PSCK bit in the TPUMCR, determines the rate of the TCR1 counter in the TPU3. If set, the TCR1 counter increments at a rate of two system clocks. If negated, TCR1 increments at the rate determined by control bits in the TCR1P and PSCK fields. 0 TCR1 increments at rate determined by control bits in the TCR1P and PSCK fields of the TPUMCR register 1 Causes TCR1 counter to increment at a rate of the system clock divided by two MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-19 Time Processor Unit 3 Table 19-18. TPUMCR2 Bit Descriptions (continued) Bits 8 Name Description SOFT RST Soft reset. The TPU3 performs an internal reset when both the SOFT RST bit in the TPUMCR2 and the STOP bit in TPUMCR are set. The CPU must write zero to the SOFT RST bit to bring the TPU3 out of reset. The SOFT RST bit must be asserted for at least nine clocks. 0 Normal operation 1 Puts TPU3 in reset until bit is cleared NOTE: Do not attempt to access any other TPU3 registers when this bit is asserted. When this bit is asserted, it is the only accessible bit in the register. 9:10 ETBANK Entry table bank select. This field determines the bank where the microcoded entry table is situated. After reset, this field is 0b00. This control bit field is write once after reset. ETBANK is used when the microcode contains entry tables not located in the default bank 0. To execute the ROM functions on this MCU, ETBANK[1:0] must be 00. Refer to Table 19-19. NOTE: This field should not be modified by the programmer unless necessary because of custom microcode. 11:13 FPSCK 14 T2CF T2CLK pin filter control. When asserted, the T2CLK input pin is filtered with the same filter clock that is supplied to the channels. This control bit is write once after reset. 0 Uses fixed four-clock filter 1 T2CLK input pin filtered with same filter clock that is supplied to the channels 15 DTPU Disable TPU3 pins. When the disable TPU3 control pin is asserted, pin TP15 is configured as an input disable pin. When the TP15 pin value is zero, all TPU3 output pins are three-stated, regardless of the pins function. The input is not synchronized. This control bit is write once after reset. 0 TP15 functions as normal TPU3 channel 1 TP15 pin configured as output disable pin. When TP15 pin is low, all TPU3 output pins are in a high-impedance state, regardless of the pin function. Filter prescaler clock. The filter prescaler clock control bit field determines the ratio between system clock frequency and minimum detectable pulses. The reset value of these bits is zero, defining the filter clock as four system clocks. Refer to Table 19-20. Table 19-19. Entry Table Bank Location ETBANK Bank 00 0 01 1 10 2 11 3 Table 19-20. System Clock Frequency/Minimum Guaranteed Detected Pulse Filter Control Divide By 20 MHz 33 MHz 40 MHz 56 MHz 000 4 200 ns 121 ns 100 ns 71 ns 001 8 400 ns 242 ns 200 ns 143 ns 010 16 800 ns 485 ns 400 ns 286 ns 011 32 1.6 s 970 ns 800 ns 571 ns 100 64 3.2 s 1.94 s 1.60 s 1.14 s MPC561/MPC563 Reference Manual, Rev. 1.2 19-20 Freescale Semiconductor Time Processor Unit 3 Table 19-20. System Clock Frequency/Minimum Guaranteed Detected Pulse 101 128 6.4 s 3.88 s 3.20 s 2.29 s 110 256 12.8 s 7.76 s 6.40 s 4.57 s 111 512 25.6 s 15.51 s 12.80 s 9.14 s 19.4.12 TPU Module Configuration Register 3 (TPUMCR3) MSB 0 LSB 1 2 Field 3 4 -- SRESET 5 6 7 PWOD 8 9 TCR2PSCK2 EPSCKE 10 11 12 -- 13 14 15 EPSCK 0000_0000_0000_0000 Addr 0x30 402A (TPU_A), 0x30 442A (TPU_B) Figure 19-22. TPUMCR3 -- TPU Module Configuration Register 3 Table 19-21. TPUMCR3 Bit Descriptions Bits Name 0:6 -- Description Reserved 7 PWOD Prescaler write-once disable bit. The PWOD bit does not lock the EPSCK field and the EPSCKE bit. 0 Prescaler fields in MCR are write-once 1 Prescaler fields in MCR can be written anytime 8 TCR2PSCK 2 TCR2 prescaler 2 0 Prescaler clock source is divided by one. 1 Prescaler clock is divided. See divider definitions in Table 19-5. 9 EPSCKE Enhanced pre-scaler enable 0 Disable enhanced prescaler (use standard prescaler) 1 Enable enhanced prescaler. System clock will be divided by the value in EPSCK field. 10 -- Reserved EPSCK Enhanced prescaler value that will be loaded into the enhanced prescaler counter. Prescaler value(EPSCK + 1) x 2. Refer to Section 19.3.8, "Prescaler Control for TCR1," for details. 11:15 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-21 Time Processor Unit 3 19.4.13 SIU Test Register (SIUTST) MSB 0 1 2 3 4 5 6 7 Field TPU_DBG 8 9 10 11 12 13 14 25 26 27 28 29 30 15 -- SRESET 0000_0000_0000_0000 Addr 0x2F_C3FC LSB 16 17 18 19 20 21 22 Field 23 24 31 -- SRESET 0000_0000_0000_0000 Figure 19-23. SIUTST -- SIU Test Register Table 19-22. SIUTST Bit Descriptions Bits Name Description 0 TPU_DBG This enables the test features of the TPU for use by TPU debuggers. It should only be enabled while debugging TPU microcode. 0 TPU debugging is disabled 1 TPU debug is enabled 1:31 -- Reserved, always clear to 0. 19.4.14 Factory Test Registers Table 19-23 shows registers that are used for factory test only.The TPU Development Support registers are also used by TPU debuggers. They can only be used if the TPU is put into its test mode. Table 19-23. Registers Used for Factory Test Only Address Name TPU_A TPU_B Link Register (LR) 0x30 4022 0x30 4422 Service Grant Latch Register (SGLR) 0x30 4024 0x30 4424 Decoded Channel Number Register (DCNR) 0x30 4026 0x30 4426 Internal Scan Data Register (ISDR) 0x30 402C 0x30 442C Internal Scan Control Register (ISCR) 0x30 402E 0x30 442E TPU3 Test Configuration Register (TCR) 0x30 4002 0x30 4402 Development Support Control Register (DSCR) 0x30 4004 0x30_4404 Development Support Status Register (DSSR) 0x30 4006 0x30 4406 MPC561/MPC563 Reference Manual, Rev. 1.2 19-22 Freescale Semiconductor Time Processor Unit 3 19.4.15 TPU3 Parameter RAM The channel parameter registers are organized as one hundred 16-bit words of RAM. Channels 0 to 15 have eight parameters. The parameter registers constitute a shared work space for communication between the CPU and the TPU3. The TPU3 can only access data in the parameter RAM. Refer to Table 19-24. Table 19-24. Parameter RAM Address Offset Map Channe l Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Parameter 0 1 2 3 4 5 6 7 0x30 4100(A) 0x30 4500(B)) 0x30 4110(A) 0x30 4510(B) 0x30 4120(A) 0x30 4520(B) 0x30 4130(A) 0x30 4530(B) 0x30 4140(A) 0x30 4540(B) 0x30 4150(A) 0x30 4550(B) 0x30 4160(A) 0x30 4560(B) 0x30 4170(A) 0x30 4570(B) 0x30 4180(A) 0x30 4580(B) 0x30 4190(A) 0x30 4590(B) 0x30 41A0(A) 0x30 45A0(B) 0x30 41B0(A) 0x30 45B0(B) 0x30 41C0(A) 0x30 45C0(B) 0x30 41D0(A) 0x30 45D0(B) 0x30 41E0(A) 0x30 45E0(B) 0x30 41F0(A) 0x30 45F0(B) 0x30 4102A(A) 0x30 4502(B) 0x30 4112(A) 0x30 4512(B) 0x30 4122(A) 0x30 4522(B) 0x30 4132(A) 0x30 4532(B) 0x30 4142(A) 0x30 4542(B) 0x30 4152(A) 0x30 4552(B) 0x30 4162(A) 0x30 4562(B) 0x30 4172(A) 0x30 4572(B) 0x30 4182(A) 0x30 4582(B) 0x30 4192(A) 0x30 4592(B) 0x30 41A2(A) 0x30 45A2(B) 0x30 41B2(A) 0x30 45B2(B) 0x30 41C2(A) 0x30 45C2(B) 0x30 41D2(A) 0x30 45D2(B) 0x30 41E2(A) 0x30 45E2(B) 0x30 41F2(A) 0x30 45F2(B) 0x30 4104(A) 0x30 4504(B) 0x30 4114(A) 0x30 4514(B) 0x30 4124(A) 0x30 4524(B) 0x30 4134(A) 0x30 4534(B) 0x30 4144(A) 0x30 4544(B) 0x30 4154(A) 0x30 4554(B) 0x30 4164(A) 0x30 4564(B) 0x30 4174(A) 0x30 4574(B) 0x30 4184(A) 0x30 4585(B) 0x30 4194(A) 0x30 4594(B) 0x30 41A4(A) 0x30 45A4(B) 0x30 41B4(A) 0x30 45B4(B) 0x30 41C4(A) 0x30 45C4(B) 0x30 41D4(A) 0x30 45D4(B) 0x30 41E4(A) 0x30 45E4(B) 0x30 41F4(A) 0x30 45F4(B) 0x30 4106(A) 0x30 4506(B) 0x30 4116(A) 0x30 4516(B) 0x30 4126(A) 0x30 4526(B) 0x30 4136(A) 0x30 4536(B) 0x30 4146(A) 0x30 4546(B) 0x30 4156(A) 0x30 4556(B) 0x30 4166(A) 0x30 4566(B) 0x30 4176(A) 0x30 4576(B) 0x30 4186(A) 0x30 4586(B) 0x30 4196(A) 0x30 4596(B) 0x30 41A6(A) 0x30 45A6(B) 0x30 41B6(A) 0x30 45B6(B) 0x30 41C6(A) 0x30 45C6(B) 0x30 41D6(A) 0x30 45D6(B) 0x30 41E6(A) 0x30 45E6(B) 0x30 41F6(A) 0x30 45F6(B) 0x30 4108(A) 0x30 4508(B) 0x30 4118(A) 0x30 4518(B) 0x30 4128(A) 0x30 4528(B) 0x30 4138(A) 0x30 4538(B) 0x30 4148(A) 0x30 4548(B) 0x30 4158(A) 0x30 4558(B) 0x30 4168(A) 0x30 4568(B) 0x30 4178(A) 0x30 4578(B) 0x30 4188(A) 0x30 4588(B) 0x30 4198(A) 0x30 4598(B) 0x30 41A8(A) 0x30 45A8(B) 0x30 41B8(A) 0x30 45B8(B) 0x30 41C8(A) 0x30 45C8(B) 0x30 41D8(A) 0x30 45D8(B) 0x30 41E8(A) 0x30 45E8(B) 0x30 41F8(A) 0x30 45F8(B) 0x30 410A(A) 0x30 450A(B) 0x30 411A(A) 0x30 451A(B) 0x30 412A(A) 0x30 452A(B) 0x30 413A(A) 0x30 453A(B) 0x30 414A(A) 0x30 454A(B) 0x30 415A(A) 0x30 455A(B) 0x30 416A(A) 0x30 456A(B) 0x30 417A(A) 0x30 457A(B) 0x30 418A(A) 0x30 458A(B) 0x30 419A(A) 0x30 459A(B) 0x30 41AA(A) 0x30 45AA(B) 0x30 41BA(A) 0x30 45BA(B) 0x30 41CA(A) 0x30 45CA(B) 0x30 41DA(A) 0x30 45DA(B) 0x30 41EA(A) 0x30 45EA(B) 0x30 41FA(A) 0x30 45FA(B) 0x30 410C(A) 0x30 450C(B) 0x30 411C(A) 0x30 451C(B) 0x30 412C(A) 0x30 452C(B)) 0x30 413C(A) 0x30 453C(B) 0x30 414C(A) 0x30 454C(B) 0x30 415C(A) 0x30 455C(B) 0x30 416C(A) 0x30 456C(B) 0x30 417C(A) 0x30 457C(B) 0x30 418C(A) 0x30 458C(B) 0x30 419C(A) 0x30 459C(B) 0x30 41AC(A) 0x30 45AC(B) 0x30 41BC(A) 0x30 45BC(B) 0x30 41CC(A) 0x30 45CC(B) 0x30 41DC(A) 0x30 45DC(B) 0x30 41EC(A) 0x30 45EC(B) 0x30 41FC(A) 0x30 45FC(B) 0x30 410E(A) 0x30 450E(B) 0x30 411E(A) 0x30 451E(B) 0x30 412E(A) 0x30 452E(B) 0x30 413E(A) 0x30 453E(B) 0x30 414E(A) 0x30 454E(B) 0x30 415E(A) 0x30 455E(B) 0x30 416E(A) 0x30 456E(B) 0x30 417E(A) 0x30 457E(B) 0x30 418E(A) 0x30 458E(B) 0x30 419E(A) 0x30 459E(B) 0x30 41AE(A) 0x30 45AE(B) 0x30 41BE(A) 0x30 45BE(B) 0x30 41CE(A) 0x30 45CE(B) 0x30 41DE(A) 0x30 45DE(B) 0x30 41EE(A) 0x30 45EE(B) 0x30 41FE(A) 0x30 45FE(B) 19.5 Time Functions Descriptions of the MPC561/MPC563 pre-programmed time functions are shown in Appendix D, "TPU3 ROM Functions." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 19-23 Time Processor Unit 3 MPC561/MPC563 Reference Manual, Rev. 1.2 19-24 Freescale Semiconductor Chapter 20 Dual-Port TPU3 RAM (DPTRAM) The dual-port RAM (DPTRAM) module with TPU3 microcode storage support consists of a control register block and an 8-Kbyte array of static RAM, which can be used either as a microcode storage for TPU3 or as a general-purpose memory. The MPC561/MPC563 has one DPTRAM module. The module serves two TPU3 modules (A and B). The DPTRAM module acts as a common memory on the IMB3 and allows the transfer of data to the two TPU3 modules. Therefore, the DPTRAM interface includes an IMB3 bus interface and two TPU3 interfaces. When the DPTRAM is being used in microcode mode, the array is only accessible to the TPU3 via a separate local bus, and not via the IMB3. In the MPC561/MPC563, the DPTRAM base address register (RAMBAR) must be set to a particular value to fit into the IMB memory map of the part. The DPTRAM RAMBAR register must be programmed to 0xFFA0. The DPTRAM module is powered by VDD in normal operation. The entire array may be used as standby RAM if standby power is supplied via the IRAMSTBY pin of the MPC561/MPC563. IRAMSTBY must be supplied by an external source. The DPTRAM may also be used as the microcode control store for up to two TPU3 modules when placed in a special emulation mode. In this mode the DPTRAM array may only be accessed by either or both of the TPU3 units simultaneously via separate emulation buses, and not via the IMB3. The DPTRAM contains a multiple input signature calculator (MISC) in order to provide RAM data corruption checking. The MISC reads the DPTRAM address and generates a 32-bit data-dependent signature. This signature can then be checked by the host. NOTE The RCPU cannot perform instruction fetches from any module on the IMB3 (including the DPTRAM). Only data accesses are permitted. 20.1 * * * * Features Eight Kbytes of static RAM Accessible by the CPU only if neither TPU3 is in emulation mode Low-power stop operation -- Entered by setting the STOP bit in the DPTMCR -- Does not enter low-power state while in TPU3 emulation mode for protection TPU3 microcode mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 20-1 Dual-Port TPU3 RAM (DPTRAM) * * * * 20.2 -- The DPTRAM array acts as a microcode storage for the TPU3 module. This provides a means of executing TPU3 code out of DPTRAM instead of TPU3 ROM. Includes built in check logic which scans the array contents and calculates the DPTRAM signature IMB3 bus interface Two TPU3 interface units Byte, half-word, or word accessible DPTRAM Configuration Block Diagram TPU3 TPU3 DPTRAM IMB3 IMB3 IMB3 IMB3 Local Bus DPTRAM Local Bus TPU3 TPU3 TPU3 Emulation Mode RAM Mode Figure 20-1. DPTRAM Configuration 20.3 Programming Model The DPTRAM module consists of two separately addressable sections. The first is a set of memory-mapped control and status registers used for configuration (DPTMCR, RAMBAR, MISRH, MISRL, MISCNT) and testing (DPTTCR) of the DPTRAM array. The second section is the array itself. All DPTRAM module control and status registers are located in supervisor data space. User read or write attempts will result in a bus error. When the TPU3 is using the RAM array for microcode control storage, none of these control registers has any effect on the operation of the RAM array. All addresses within the 64-byte control block will respond when accessed properly. Unimplemented addresses will return zeros for read accesses. Likewise, unimplemented bits within registers will return zero when read and will not be affected by write operations. Table 20-1 shows the DPTRAM control and status registers. The addresses shown are offsets from the internal system base address (see Section 6.2.2.1.2, "Internal Memory Map Register (IMMR)"). Refer to Figure 1-3 to locate the DPTRAM control block in the MPC561/MPC563 address map. MPC561/MPC563 Reference Manual, Rev. 1.2 20-2 Freescale Semiconductor Dual-Port TPU3 RAM (DPTRAM) Table 20-1. DPTRAM Register Map R/W Access Address Register Reset Value Supervisor R/W 0x30 0000 DPT RAM Module Configuration Register (DPTRMCR) See Table 20-2 for bit descriptions. 0x0100 Test 0x30 0002 Test Configuration Register (DPTTCR) 0x0000 Supervisor R/W 0x30 0004 RAM Base Address Register (RAMBAR) See Table 20-3 for bit descriptions. 0x0001 Supervisor Read Only 0x30 0006 Multiple Input Signature Register High (MISRH) See Section 20.3.4, "MISR High (MISRH) and MISR Low Registers (MISRL)" for bit descriptions. 0x0000 Supervisor Read Only 0x30 0008 Multiple Input Signature Register Low (MISRL) See Section 20.3.4, "MISR High (MISRH) and MISR Low Registers (MISRL)" for bit descriptions. 0x0000 Supervisor Read Only 0x30 000A Multiple Input Signature Counter (MISCNT) See Section 20.3.5, "MISC Counter (MISCNT)" for bit descriptions. Last memory address The DPTRAM array occupies an 8-Kbyte block. In the MPC561/MPC563, the array must be located at the address 0x30 2000. Refer to Figure 1-3 and Figure 20-2. 0x30 2000 DPTRAM Array (8 Kbytes) 0x30 3FFF Figure 20-2. DPTRAM Memory Map 20.3.1 DPTRAM Module Configuration Register (DPTMCR) This register defines the basic configuration of the DPTRAM module. The DPTMCR contains bits to configure the DPTRAM module for stop operation and for proper access privileges to the array. The register also contains the MISC control bits. MSB 0 LSB 1 Field STOP SRESET 0 Addr 2 3 4 5 -- MISF Undefined 0 6 7 8 9 MISEN RASP 0 1 10 11 12 13 14 15 -- 0000_0000 0x30 0000 Figure 20-3. DPT Module Configuration Register (DPTMCR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 20-3 Dual-Port TPU3 RAM (DPTRAM) Table 20-2. DPTMCR Bit Settings Bits Name Description 0 STOP Low power stop (sleep) mode 0 DPTRAM clocks running 1 DPTRAM clocks shut down Only the STOP bit in the DPTMCR may be accessed while the STOP bit is asserted. Accesses to other DPTRAM registers may result in unpredictable behavior. Note also that the STOP bit should be set and cleared independently of the other control bits in this register to guarantee proper operation. Changing the state of other bits while changing the state of the STOP bit may result in unpredictable behavior. Refer to Section 20.4.4, "Stop Operation" for more information. 1:4 -- 5 MISF Multiple input signature flag. MISF is readable at any time. This flag bit should be polled by the host to determine if the MISC has completed reading the DPTRAM. If MISF is set, the host should read the MISRH and MISRL registers to obtain the DPTRAM signature. 0 First signature not ready 1 MISC has read entire DPTRAM. Signature is latched in MISRH and MISRL and is ready to be read. 6 MISEN Multiple input signature enable. MISEN is readable and writable at any time. The MISC will only operate when this bit is set and the MPC561/MPC563 is in TPU3 emulation mode. When enabled, the MISC will continuously cycle through the DPTRAM addresses, reading each and adding the contents to the MISR. In order to save power, the MISC can be disabled by clearing the MISEN bit. 0 MISC disabled 1 MISC enabled 7 RASP RAM area supervisor/user program/data. The DPTRAM array may be placed in supervisor or unrestricted Space. When placed in supervisor space, (RASP = 1), only a supervisor may access the array. If a supervisor program is accessing the array, normal read/write operation will occur. If a user program is attempting to access the array, the access will be ignored and the address may be decoded externally. 0 Both supervisor and user access to DPTRAM allowed 1 Supervisor access only to DPTRAM allowed 8:15 -- 20.3.2 Reserved Reserved. These bits are used for the IARB (interrupt arbitration ID) field in TPU3 implementations that use hardware interrupt arbitration. DPTRAM Test Register (DPTTCR) DPTTCR (test register, address 0x30 0002) is used only during factory testing of the MPC561/MPC563, and, if written, will generate a bus error. 20.3.3 RAM Base Address Register (RAMBAR) The RAMBAR register is used to specify the 16 MSBs of the starting DPTRAM array location in the memory map. In order to be accessible in the MPC561/MPC563 memory map, this register must be programed to 0xFFA0. This register can be written only once after a reset. This prevents runaway software from inadvertently re-mapping the array. Since the locking mechanism is triggered by the first write after reset, the base MPC561/MPC563 Reference Manual, Rev. 1.2 20-4 Freescale Semiconductor Dual-Port TPU3 RAM (DPTRAM) address of the array should be written in a single operation. Writing only one half of the register will prevent the other half from being written. MSB Field LSB 0 1 2 3 4 5 6 7 8 9 10 11 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 SRESET 12 13 14 -- RAMDS 0000_0000_0000_000 Addr 15 1 0x30 0004 Figure 20-4. RAM Array Base Address Register (RAMBAR) Table 20-3. RAMBAR Bit Settings Bits Name 0:11 A[8:19] 12:14 -- 15 RAMDS 20.3.4 Description DPTRAM array base address. These bits specify the 11 high-order bits of the 24-bit base address of the DPTRAM array. This allows the array to be placed on a 8-Kbyte boundary anywhere in the memory map. Do not overlap the DPTRAM array memory map with other modules on the chip. On the MPC561/MPC563 the value 0xFFA0 must be used for DPTRAM 6 Kbyte. Reserved. (Bit 12 represents A[20] in DPTRAM implementations that require it.) RAM disabled. RAMDS is a read-only status bit. The DPTRAM array is disabled after a master reset because the RAMBAR register may be incorrect. When the array is disabled, it will not respond to any addresses on the IMB3. Access to the DPTRAM control register block is not affected when the array is disabled. RAMDS is cleared by the DPTRAM module when a base address is written to the array address field of RAMBAR. RAMDS = 0: DPTRAM enabled RAMDS = 1: DPTRAM disabled MISR High (MISRH) and MISR Low Registers (MISRL) The MISRH and MISRL together contain the 32-bit RAM signature calculated by the MISC. These registers are read-only and should be read by the host when the MISF bit in the MCR is set. Exiting TPU3 emulation mode results in the reset of both MISRH and MISRL. MSB Field LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 D31 D30 D29 D28 D27 D26 D25 D24 D23 D22 D21 D20 D19 D18 D17 D16 SRESET Addr 0000_0000_0000_0000 0x30 0006 Figure 20-5. Multiple Input Signature Register High (MISRH) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 20-5 Dual-Port TPU3 RAM (DPTRAM) MSB Field LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 0000_0000_0000_0000 SRESET Addr 0x30 0008 Figure 20-6. Multiple Input Signature Register Low (MISRL) 20.3.5 MISC Counter (MISCNT) The MISCNT contains the address of the current MISC memory access. This register is read-only. Note that the naming of the A[31:0] bits represents little-endian bit encoding. Exiting TPU3 emulation mode or clearing the MISEN bit in the DPTMCR results in the reset of this register. MSB 0 Field LSB 1 -- 2 3 4 5 6 7 8 9 10 11 12 13 14 15 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 SRESET Last Memory Address Addr 0x30 000A Figure 20-7. MISC Counter (MISCNT) 20.4 DPTRAM Operation The DPTRAM module has several modes of operation. The following sections describe DPTRAM operation in each of these modes. 20.4.1 Normal Operation In normal operation, read or write data accesses of 8-, 16-, or 32-bits are supported. Also, in normal operation, neither TPU3 accesses the array, nor do they have any effect on the operation of the DPTRAM module. 20.4.2 Standby Operation The DPTRAM array uses a separate power supply IRAMSTBY to provide power to the DPTRAM array during a power-down phase. In order to guarantee valid DPTRAM data during power-down, external low voltage inhibit circuitry (external to the MPC561/MPC563) must be designed to force the RESET pin of the MPC561/MPC563 into the active state before VDD drops below its normal limit. This is necessary to inhibit spurious writes to the DPTRAM during power-down. MPC561/MPC563 Reference Manual, Rev. 1.2 20-6 Freescale Semiconductor Dual-Port TPU3 RAM (DPTRAM) 20.4.3 Reset Operation When a synchronous reset occurs, a bus master is allowed to complete the current access. Thus a write bus cycle (byte, half word, or word) that is in progress when a synchronous reset occurs will be completed without error. Once a write already in progress has been completed, further writes to the DPTRAM array are inhibited. If a reset is generated by an asynchronous reset such as the loss of clocks or software watchdog time-out, the contents of the DPTRAM array are not guaranteed. (Refer to Chapter 7, "Reset" for a description of MPC561/MPC563 reset sources, operation, control, and status.) Reset will also reconfigure some of the fields and bits in the DPTRAM control registers to their default reset state. See the description of the control registers to determine the effect of reset on these registers. 20.4.4 Stop Operation Setting DPTMCR[STOP] causes the module to enter its lowest power-consuming state. The DPTMCR can still be written to allow the STOP control bit to be cleared. In stop mode, the DPTRAM array cannot be read or written. All data in the array is retained The BIU continues operating to allow the CPU to access the STOP bit in the DPTMCR. The system clock remains stopped until the STOP bit is cleared or the DPTRAM module is reset. The STOP bit is initialized to logical zero during reset. Only the STOP bit in the DPTMCR can be accessed while the STOP bit is asserted. Accesses to other DPTRAM registers may result in unpredictable behavior. The DPTRAM will not enter stop mode if one of the TPUs is in emulation mode using DPTRAM (i.e., TPUMCR[EMU] = 1) 20.4.5 Freeze Operation The FREEZE line on the IMB3 has no effect on the DPTRAM module. When the freeze line is set, the DPTRAM module will operate in its current mode of operation. If the DPTRAM module is not disabled, (RAMDS = 0), it may be accessed via the IMB3. If the DPTRAM array is being used by the TPU3 in emulation mode, the DPTRAM will still be able to be accessed by the TPU3 microengine. 20.4.6 TPU3 Emulation Mode Operation To emulate TPU3 time functions, store in the RAM array the microinstructions required for all time functions. Storing microinstructions must be done with the DPTRAM in its normal operating mode and accessible from the IMB3. After the time functions are stored in the array, place one or both of the TPU3 units in emulation mode. The RAM array is then controlled by the TPU3 units and disconnected from the IMB3. To use the DPTRAM for microcode accesses, set the EMU bit in the corresponding TPU3 module configuration register. Through the auxiliary buses, the TPU3 units can access word instructions simultaneously at a rate of up to 56 MHz. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 20-7 Dual-Port TPU3 RAM (DPTRAM) When the DPTRAM array is being used by one or two of the TPU3 units, all accesses via the IMB3 are disabled. The control registers have no effect on the RAM array. The contents of the RAM are validated using a multiple input signature calculator (MISC). MISC reads of the RAM are performed only when the MPC561/MPC563 is in emulation mode and the MISC is enabled (MISEN = 1 in the DPTMCR). Refer to Section 19.3.6, "Emulation Support" for more information in TPU3 and DPTRAM operation in emulation mode. 20.5 Multiple Input Signature Calculator (MISC) The integrity of the DPTRAM data is ensured through the use of a MISC. The DPTRAM data is read in reverse address order and a unique 32-bit signature is generated based on the output of these reads. MISC reads are performed when one of the TPU3 modules does not request back-to-back accesses to the DPTRAM provided that the MISEN bit in the DPTMCR is set. The MISC generates the DPTRAM signature based on the following polynomial: 2 22 31 G(x) = 1 + x + x + x + x Eqn. 20-1 After the entire DPTRAM has been read and a signature has been calculated, the MISC sets the MISF bit in the DPTMCR. The host should poll this bit and enter a handling routine when the bit is found to be set. The signature should then be read from the MISRH and MISRL registers and the host determines if it matches the predetermined signature. The MISRH and MISRL registers are updated each time the MISC completes reading the entire DPTRAM regardless of whether or not the previous signature has been read or not. This ensures that the host reads the most recently generated signature. The MISC can be disabled by clearing the MISEN bit in the DPTMCR. NOTE The reset state of the DPTMCR[MISEN] is disabled. MPC561/MPC563 Reference Manual, Rev. 1.2 20-8 Freescale Semiconductor Chapter 21 CDR3 Flash (UC3F) EEPROM The MPC563 U-bus CDR3 (UC3F) EEPROM module is designed for use in embedded microcontroller (MCU) applications targeted for high-speed read performance and high-density byte count requirements. The MPC563 has one Flash module of 512 Kbytes but the MPC561 has no internal Flash; this chapter, therefore, applies only to the MPC563. The UC3F array uses a single transistor Flash bit cell and is configured for a module of 512 Kbytes (524,288 bytes) of non-volatile memory (NVM). The UC3F module is divided into eight 64-Kbyte (65,536-byte) array blocks. Two blocks of the UC3F module memory map may be subdivided into two smaller blocks: a 48-Kbyte (49,152-byte) block and a 16-Kbyte (16,384-byte) block, or a 16-Kbyte block and a 48-Kbyte block. The primary function of the UC3F EEPROM module is to serve as electrically programmable and erasable NVM to store program instructions and/or data. It is a class of non-volatile solid state silicon memory device consisting of an array of isolated elements, an electrical means for selectively adding and removing charge to the elements, and a means of selectively sensing the stored charge in the elements. When power is removed from the device, the stored charge of the isolated elements will be retained. The UC3F EEPROM module is arranged into two major sections as shown in Figure 21-1. The first section is the UC3F array used to store system program and data. The second section is the memory interface (MI) that controls operation of the UC3F array. The MI also serves as the interface between the UC3F array and a bus interface unit (BIU) which connects the UC3F array to the U-bus. NOTE If the Flash arrays are disabled in the IMMR register (FLEN=0), then neither the UC3F array or the UC3F control registers are accessible. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-1 CDR3 Flash (UC3F) EEPROM U-Bus Bus Interface Unit (BIU) Memory Interface (MI) Data Mux EPEE Register Block B0EPEE Read Control Read Page Buffer 0 Read Page Buffer 1 Pgm Data Latch Program/Erase Control Column Decode VFLASH VDDF VSSF Block 0 (16 Kbytes + 48 Kbytes) Block 1 (48 Kbytes + 16 Kbytes) Row Decode Internal Timer Address Latch Program/Erase Voltage Generation Block 2 (64 Kbytes) Block 3 (64 Kbytes) Block 4 (64 Kbytes) Block 5 (64 Kbytes) Block 6 (64 Kbytes) Block 7 (64 Kbytes) UC3F Array Core Figure 21-1. Block Diagram for a 512 Kbyte UC3F Module Configuration The UC3F EEPROM module array is divided into array blocks to allow for independent erase, address attributes restrictions, and protection from program and erase for each array block. The size of a large array block in the UC3F module is fixed at 64 Kbytes. The size of a subdivided large block becomes the original large array block size minus 16 Kbytes (64 Kbytes - 16 Kbytes = 48 Kbytes). The size of the small block, which is the remainder of the large block, is always 16 Kbytes. The total UC3F EEPROM array is distributed into eight large blocks, two of which contain small blocks. Information is transferred to the UC3F EEPROM by long-word (64 bits), word (32 bits), half-word (16 bits), or byte (8 bits). To improve system performance, each array read access retrieves 32 bytes of information. These 32 bytes may be copied into one of two read page buffers aligned to the low order addresses. The two read page buffers are independently updated by page management logic contained in the BIU which interfaces to the UC3F EEPROM module. MPC561/MPC563 Reference Manual, Rev. 1.2 21-2 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM To prevent unnecessary page accesses from the array, the UC3F memory interface (MI) monitors the incoming address to determine if the required information is in one of the two read page buffers. This strategy allows the UC3F array to have an off page access and an on page access. In normal operation, write accesses to the UC3F array are not recognized except during program and erase operations. The UC3F EEPROM uses an embedded hardware algorithm to program and erase the UC3F array. Special control logic is included to guard against accidental program or erase by requiring a specific series of read and write accesses to the UC3F control registers. External inputs provide a hardware protection mechanism to prevent accidental program and erase of UC3F array blocks. The hardware algorithm automatically performs all necessary applications of high voltage pulses and verify reads of the UC3F array to ensure that all bits are programmed and erased with sufficient margin to guarantee data integrity and reliability. 21.0.1 * * * * * * * * * * * * * Features of the CDR3 Flash EEPROM (UC3F) High density single transistor Flash bit cell -40 to 125 C ambient temperature operating range -- -40 to 85 C on the suffix C device 2.5-V to 2.7-V VDDF operating range and 4.75-V to 5.25-V VFLASH operating range Shadow information stored in special Flash NVM shadow locations 512 Kbytes using 64-Kbyte blocks -- Two 16-Kbyte small blocks Array block restriction control for small and large blocks -- Erase by array blocks -- Array protection for program and erase operations -- Array block assignment of supervisor or supervisor/user space -- Array block assignment of data or instruction/data space Internal 64-bit data path architecture Page mode read -- Retains two independent read page buffers -- Read page size of 32 bytes (8 words). Word (32-bit) programming Embedded hardware program and erase algorithm -- Uses internal oscillator to time program and erase pulses. Pulses are timed independently of system clock frequency -- Automatically performs margin reads External Flash program or erase enable inputs for block 0 or entire Flash array (B0EPEE and EPEE) Low power disable via an external signal or UC3F register bit Censor mode for Flash memory array access restriction with a user bypass for unrestricted array access MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-3 CDR3 Flash (UC3F) EEPROM 21.1 UC3F Interface The UC3F module contains a memory interface (MI) and an array core. The MI controls access of the array core and register block in the UC3F module. The interface signals to the UC3F module consist of address inputs, data inputs, data outputs, a simple set of control signals for read and write operations, a set of register selects, and a set of register outputs which are used by the BIU. Three required supply pins power the module: VDDF, VSSF, and VFLASH. The UC3F module is a fully asynchronous module and does not require a clock input for operation. All required clocks are generated internally using an internal oscillator, external test clock input, or internal delay circuits. 21.1.1 External Interface The UC3F EEPROM module uses external pins to provide power supplies. These pins are listed in Table 21-1. . Table 21-1. UC3F External Interface Signals Mnemoni c I/O Type Description VDDF Power Pin UC3F power supply VSSF Ground Pin UC3F ground VFLASH Power Pin EPEE External Program/Eras e EPEE pin status The EPEE bit monitors the state of the external program/erase enable (EPEE) input. The UC3F module samples the EPEE input when EHV is asserted and holds that sampled state until EHV is negated. B0EPEE Block 0 External Program/Eras e Block 0 EPEE pin status The B0EM bit monitors the state of Block 0 EPEE, B0EPEE, input. The UC3F module samples the B0EPEE input when EHV is asserted and holds that sampled value until EHV is negated. If B0EM = 1 when EHV is asserted, high voltage operations such as program or erase are enabled for either small block 0 or the lowest numbered block of the UC3F array regardless of the state of EPEE. If B0EM = 0 when EHV is asserted, high voltage operations are disabled for small block 0 or the lowest numbered block of the UC3F array regardless of the state of EPEE. Comments To reduce noise in the read path no other circuits should be connected to the UC3F VDDF supply pin.This VDD pin must be isolated from all other VDD pins inside the device. The specified voltage range during operation is 2.6 V 0.1 V. To reduce noise in the read path no other circuits should be connected to the UC3F VSSF supply. This VSS pin must be isolated from all other VSS pins inside the device. UC3F 5-V power supply VFLASH provides a 5-V supply to the UC3F module which is used for read, program, and erase operations. VFLASH must be in the range of 4.75 V to 5.25 V (5 V 5%) during operation. MPC561/MPC563 Reference Manual, Rev. 1.2 21-4 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM 21.2 Programming Model The UC3F EEPROM module consists of a control register block, an addressable shadow row implemented in Flash, and an addressable main Flash memory array. The control registers are used to configure, program, erase and exercise the UC3F shadow row and Flash array. 21.2.1 UC3F EEPROM Control Registers These supervisor-level control registers are used to control UC3F EEPROM module operation. On reset, the registers are loaded with default reset information. Several bits of the UC3F control registers are special Flash NVM registers which retain their state when power is removed from the UC3F EEPROM. These special NVM registers are identified in the individual register field and control bit descriptions. 21.2.1.1 Register Addressing The UC3F module control registers, shown in Table 21-2, are selected with individual register selects generated from the BIU. As such, each Flash module that is designed using the UC3F EEPROM module may uniquely define the addressing of the control register block. Table 21-2. UC3F Register Programming Model Address 21.2.1.2 Register 0x2F C800 Module Configuration (UC3FMCR) 0x2F C804 Extended Module Configuration (UC3FMCRE) 0x2F C808 High Voltage Control (UC3FCTL) 0x2F C80C Reserved UC3F EEPROM Configuration Register (UC3FMCR) The UC3F module configuration register is used to configure the operation and access restrictions of the UC3F array and shadow row. MSB 0 1 Field STOP LOCK HRESET 0 1 2 3 4 -- FIC SIE 0 0 0 5 6 7 8 9 10 ACCESS CENSOR 0 Addr 11 11 11 12 13 14 15 1 SUPV 1 1 1 1 1 1 1 24 25 26 27 28 29 30 31 1 1 1 0x2F C800 LSB 16 17 18 Field HRESET 19 20 21 22 23 DATA 0 1 Reset 0 0 0 PROTECT 0 0 0 0 1 1 1 1 1 state determined by NVM registers. These bits will be set to 01 by the factory. Figure 21-2. UC3F EEPROM Configuration Register (UC3FMCR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-5 CDR3 Flash (UC3F) EEPROM Table 21-3. UC3FMCR Bit Descriptions Bits Name Description 0 STOP Array stop control. Writes to the STOP bit have no effect while in program or erase operation (SES = 1). The STOP bit is always readable whenever the registers are enabled. When STOP = 1, the reset state of STOP is 1 and the UC3F array is disabled; internal circuits are switched into a low power state. The STOP bit may be used to implement low power standby modes or power management schemes. The UC3FMCR remains readable and writable when STOP = 1 so that the STOP bit may be deasserted. Attempts to program or erase the array while STOP = 1 have no effect. SES cannot be set to 1 when STOP = 1. When STOP = 0, the reset state of STOP is 0 and the UC3F array is enabled for accesses. All registers that were disabled with STOP = 1 are now enabled. A STOP recovery time of 1 s is required for biases in the UC3F array to reach their appropriate states to resume normal operation. Operations to the UC3F array should be delayed for at least 1s after clearing the STOP bit. 0 = UC3F array is enabled 1 = UC3F array is disabled (low-power mode) 1 LOCK1 Lock control. The default reset state of LOCK is 1. This enables writing of all fields in the Flash registers. Once the LOCK bit has been asserted (LOCK = 0) in normal operating mode, the write-lock can only be disabled again by a reset. When the device is in background debug mode and CSC = 0, the LOCK bit may be written from a 0 to a 1. When the LOCK control bit is cleared to 0, the write-locked register bits: FIC, SUPV, SBSUPV[0:1], DATA, SBDATA, PROTECT, SBPROTECT, and SBEN[0:1] are locked. Writes to these bits while LOCK = 0 will have no effect. LOCK can be written to 0 once after reset when UC3FCTL[CSC] = 0 to allow protection of the write-locked register bits after initialization. WARNING: If the lock protection mechanism is enabled (LOCK = 0) before PROTECT and SBPROTECT are cleared, the device must use background debug mode to program or erase the UC3F EEPROM. 2 -- 3 FIC Force information censorship. The default reset state of FIC is normal censorship operation (FIC = 0). The FIC bit is write protected by the LOCK bit and the UC3FCTL[CSC] bit. Writes will have no effect if LOCK = 0 or CSC = 1. Once FIC is set (FIC = 1), it cannot be cleared except by a reset. The FIC bit can be read whenever the registers are enabled. The FIC bit is a censorship emulation mode used to aid in the development of custom techniques for controlling the ACCESS bit without setting CENSOR[0:1] to the information censorship state. Using FIC to force information censorship allows testing of the hardware and software for setting ACCESS without setting CENSOR[0:1] = 11 and risk permanently setting the device into an unusable information censorship state. 0 = normal uc3f censorship operation 1 = forces the uc3f into information censorship mode 4 SIE Shadow information enable. The default reset state of SIE is 0. The SIE bit is write protected in program operation (SES = 1 and PE = 0). The SIE bit can be read whenever the registers are enabled. When SIE = 1, normal array accesses are disabled, and the two shadow information rows are enabled. Array accesses are directed to the shadow row while SIE = 1. When an array location is read in this mode, only the lower 6 address bits are used to select which 64 bytes of the 512-byte shadow row are read. The upper address bits are not used for shadow row decoding. The read page buffer address monitor is reset whenever SIE is modified making the next UC3F array access an off page access. 0 = normal array access 1 = disables normal array access and selects the shadow information rows Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 21-6 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM Table 21-3. UC3FMCR Bit Descriptions (continued) Bits Name Description 5 ACCESS Enable uncensored access. A censored access to the UC3F EEPROM is any access where the device is in the censored mode. The default reset state is ACCESS is a 0 so that FIC and CENSOR[0:1] control the state of censorship to the UC3F EEPROM array. All accesses to the UC3F EEPROM array is allowed if ACCESS = 1. ACCESS can be read whenever the registers are enabled. ACCESS provides a method to bypass the UC3F EEPROM module censorship. 0 Censored - UC3F array access allowed only if the censorship state is no censorship 1 Allows all UC3F array access 6:7 8:15 CENSOR Censor accesses. The CENSOR[0:1] bits are implemented using non-volatile register bits or CAM cells. The reset state of CENSOR[0:1] is user defined by the contents stored in the NVM register bits. CENSOR is not writable but the NVM register's data can be set or cleared to the desired reset state. Reading CENSOR while setting or clearing with the high voltage applied (CSC = 1 and HVS = 1) will return 0's. 00 cleared censorship, UC3F array access allowed only if device is in uncensored mode 01 no censorship, all UC3F array accesses allowed 10 no censorship, all UC3F array accesses allowed 11 information censorship, UC3F array access allowed only if device is in uncensored mode SUPV Supervisor space. The SUPV bits are used to assign supervisor space restrictions for each block of the UC3F array. The index for the SUPV bit field is used to determine block assignment. For example, SUPV[0] is used for the supervisor space assignment of array block 0, while SUPV[4] is used for array block 4 Supervisor space assignment. Array block M is mapped into supervisor address space when SUPV[M] = 1, and only supervisor accesses are allowed to array block M. If SUPV[M] = 0, then array block M is mapped into unrestricted address space which allows both supervisor and user accesses to array block M. The SUPV bits are not actually used in the UC3F EEPROM module but are used by the BIU to determine access restrictions to UC3F array on a blockwise basis. The block addresses are decoded in the BIU to determine which array block is selected, and the selected block's SUPV bit is compared with the address space attributes to determine validity of an array access. When the small block function is enabled, the enabled small block portion of an array block is not controlled by the SUPV bit corresponding to the array block containing that small block. This particular small block is controlled by the appropriate SBSUPV bit while the remainder of that array block is controlled by its SUPV bit. 0 array block M is placed in unrestricted address space 1 array block M is placed in supervisor address space MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-7 CDR3 Flash (UC3F) EEPROM Table 21-3. UC3FMCR Bit Descriptions (continued) Bits Name Description 16:23 DATA Data space. The DATA bits are write protected by LOCK and CSC. Writes to DATA have no effect if LOCK = 0 or CSC = 1. The DATA bits may be read whenever the registers are enabled. Each array block of the UC3F EEPROM may be mapped into data or data and instruction address space. When array block M is mapped into data address space (DATA[M] = 1), only data accesses will be allowed. When array block M is mapped into both Data and Instruction address space (DATA[M] = 0), both data and instruction accesses will be allowed. The DATA bits are not actually used in the UC3F EEPROM module but are used by the BIU to determine access restrictions to UC3F array on a blockwise basis. The block addresses are decoded in the BIU to determine which array block is selected, and the selected block's DATA bit is compared with the address space attributes to determine validity of an array access. When the small block function is enabled, the enabled small block portion of an array block is not controlled by the DATA bit corresponding to the array block containing that small block. This particular small block is controlled by the appropriate SBDATA bit while the remainder of that array block is controlled by its DATA bit. 0 array block M is placed in both data and instruction address spaces 1 array block M is placed in data address space 24:31 1 PROTECT Block protect. Each array block of the UC3F EEPROM can be individually protected from program or erase operation. The contents of array block M are protected from program or erase by setting PROTECT[M] = 1. The UC3F will perform all program and erase interlocks and complete the program or erase sequence, but the program and erase voltages are not applied to locations within the protected array block(s), blocks whose corresponding PROTECT bit is set to 1. By setting PROTECT[M] = 0, array block M is enabled for program and erase operation, and its contents may be altered by programming or erasing. When the small block function is enabled, the enabled small block portion of an array block is not controlled by the PROTECT bit corresponding to the array block containing that small block. This particular small block is controlled by the appropriate SBPROTECT bit while the remainder of that array block is controlled by its PROTECT bit. 0 array block M is unprotected 1 array block M is protected Note that the LOCK bit is in a different bit location on the MPC563 than in the MPC555. It was at bit 0 of CMFMCR. 21.2.1.3 UC3F EEPROM Extended Configuration Register (UC3FMCRE) The UC3FMCRE is an extended module configuration register used for configuring the small block functions. In addition, 16 bits of the UC3FMCRE are used to provide a source for module identification. MPC561/MPC563 Reference Manual, Rev. 1.2 21-8 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM MSB 0 Field HRESET 1 2 SBEN 0 0 3 4 5 SBSUPV SBDATA 1 0 1 0 6 7 8 SBPROTECT 1 Addr 1 9 10 11 12 -- 13 14 15 BIU 1 1 24 25 00_0000 0x2F C804 LSB 16 Field HRESET 17 18 MEMSIZ 1 0 1 19 20 BLK MAP 1 0 21 22 23 27 28 29 30 31 1 SBLKL 1 26 FLASHID 0 0_0000_0000 1 The value of FLASHID could change to show a revision of the UC3F module. Figure 21-3. UC3FMCRE-- UC3F EEPROM Extended Configuration Register Table 21-4. UC3FMCRE Bit Descriptions Bits Name Description 0:1 SBEN Small block enable. When SBEN[M]=0, the corresponding small block M behaves logically as if the small block is still part of the larger host block. In addition, the small block protect bit (SBPROTECT[M]), the small block supervisor bit (SBSUPV[M]), the small block data bit (SBDATA[M]), and the small block BLOCK bit (SBBLOCK[M]) corresponding to small block M have no effect. The corresponding small block is controlled by the same protect, supervisor, data, and block bits that control its host block. When SBEN[M] = 1, the corresponding small block M can be programmed and erased independently of its host block. The corresponding small block protect bit, the small block supervisor bit, the small block data bit, and the small block bit are enabled by SBEN. For example: when SBEN[0] = 0, Small Block 0 (16 Kbytes) and the residual block (48 Kbytes) contained in the host block of Small Block 0 are programmed and erased as if the two blocks are one large array block (64 Kbytes). When SBEN[0] = 1, small block 0 and the residual block contained in the host block of small block 0 behave as two separate blocks, i.e. small block 0 and the residual block in small block 0's host block can be programmed and erased independently of each other. 0 small block M behaves as part of the host block 1 small block M functions independent of host block 2:3 SBSUPV Small block supervisor space. Each small array block of the UC3F EEPROM may be mapped into supervisor or unrestricted address space. When small array block M is mapped into supervisor address space, SBSUPV[M] = 1, only supervisor accesses are allowed. When small block M is mapped to unrestricted address space, SBSUPV[M] = 0, both supervisor and user accesses are allowed. If SBEN[M] = 0, the corresponding small block M is logically part of the host block and SBSUPV[M] has no effect. Instead, the corresponding SUPV[M] bit will be used to determine if the small block is mapped to Supervisor or Unrestricted address space. Like the SUPV[0:7] bits, the SBSUPV bits are not actually used in the UC3F EEPROM module but are used by the BIU to determine access restrictions to the UC3F array. Block addresses are decoded in the BIU to determine which small array block is selected, and the selected small block's SBSUPV bit is compared with the address space attributes to determine validity of an array access. 0 small block M is placed in unrestricted address space 1 small block M is placed in supervisor address space MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-9 CDR3 Flash (UC3F) EEPROM Table 21-4. UC3FMCRE Bit Descriptions (continued) Bits Name Description 4:5 SBDATA Small block data space. Each small array block of the UC3F EEPROM may be mapped into data or both data and instruction address space. When a small array block is mapped into data address space, SBDATA[M] = 1, only data accesses will be allowed. When a small array block is mapped into both data and instruction address space, SBDATA[M] = 0, both data and instruction accesses will be allowed. If SBEN[M] = 0, the corresponding small block M is logically part of the host block and SBDATA[M] has no effect. Instead, the corresponding DATA[M] bit will be used to determine if the small block is mapped to Data or to both Data and Instruction address space. Like the DATA bits, the SBDATA bits are not actually used in the UC3F EEPROM module but are used by the BIU to determine access restrictions to the UC3F array. Block addresses are decoded in the BIU to determine which small array block is selected, and the selected small block's SBDATA bit is compared with the address space attributes to determine validity of an array access. 0 small block M is placed in both Data and Instruction address spaces 1 small block M is placed in Data address space 6:7 SBPROTEC Small block protect. Each small block of the UC3F EEPROM can be individually protected from T program or erase operation. The UC3F will perform all program and erase interlocks and even complete the program or erase sequence, but the program and erase voltages are not applied to locations within the protected small block(s). 0 small block M is unprotected 1 small block M is protected 8:9 -- 10:15 BIU 16:18 MEMSIZ Reserved BIU configuration bits. These register bits are reserved for BIU functionality and are strictly outputs from the UC3F EEPROM. Memory size. The MEMSIZ field is used to indicate the UC3F array size. The MEMSIZ bits are read only and writes have no effect. 000 UC3F array is 64 Kbytes 001 UC3F array is 128 Kbytes 010 UC3F array is 192 Kbytes 011 UC3F array is 256 Kbytes 100 unused 101 UC3F array is 512 Kbytes 110 unused 111 unused The Flash module on the MPC563 is 512 Kbytes. 19 BLK Block size. The BLK bit is used to indicate the array block size used in the UC3F array. The BLK bit is read only and writes have no effect. 0 array block size is 32 Kbytes 1 block size is 64 Kbytes NOTE: All blocks are 64 Kbytes (i.e. BLK is always set) 20 MAP Array address mapping. The MAP bit is used to indicate the UC3F array address mapping within a 2N address space. The MAP bit is read only and writes have no effect. The MAP bit is more useful when the UC3F array is a non-2N size. When MAP = 0, the UC3F array is mapped to the bottom (starting at address 0) of the 2N space in which the array resides. For modules with 2N array sizes, the MAP bit is always set to 0. When MAP = 1, the UC3F array is mapped to the top (ending at address all $F's) of the 2N space in which the array resides. 0 UC3F array is mapped to bottom of 2N address space 1 UC3F array is mapped to top of 2N address space MPC561/MPC563 Reference Manual, Rev. 1.2 21-10 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM Table 21-4. UC3FMCRE Bit Descriptions (continued) Bits Name Description 21:22 SBLKL Small block location code. There are three possible locations for the small blocks: 1) a small block may be placed in the lowest numbered host block and the highest numbered host blocks, 2) a small block may be placed in the lowest numbered host block and the second lowest numbered host block, and 3) a small block may be placed in the second highest numbered host block and the highest numbered host block. 00 unused 01 small blocks are part of the two highest numbered blocks of the UC3F array 10 small blocks are part of the two lowest numbered blocks of the UC3F array 11 small blocks are part of the lowest and highest numbered blocks of the UC3F array 23:31 FLASHID 21.2.1.4 Flash module identification code. The FLASHID value is assigned by Freescale and used internally for tracking purposes. The FLASHID field is read only and writes have no effect. UC3F EEPROM High Voltage Control Register (UC3FCTL) The UC3F EEPROM high voltage control register is used to control the program and erase operations of the UC3F EEPROM module. MSB 0 1 2 3 4 5 6 7 8 Field HVS PEGOOD PEFI EPEE B0EM HRESET 0 0 0 X1 9 10 11 12 13 -- X2 14 15 SBBLOCK 000_0000_0000 Addr 0x2F C808 LSB 16 17 Field 18 19 20 21 BLOCK HRESET 22 23 24 25 -- CSC 26 27 -- 28 29 HSUS PE 30 31 SES EHV 0000_0000_0000_0000 1 Value is set by the current status of the EPEE pin. 2 Value is set by the current status of the B0EPEE pin. Figure 21-4. UC3F EEPROM High Voltage Control Register (UC3FCTL) Table 21-5. UC3FCTL Bit Descriptions Bits Name Description 0 HVS High voltage status. The HVS bit is for status only, and writes to HVS have no effect. During a program or erase operation, HVS is set (HVS = 1) to indicate when high voltage operations are in progress. The HVS bit will negate itself when the program or erase operation completes successfully, EHV negates during program or erase to terminate the program/erase operation, HSUS is asserted to suspend the program/erase operation, resetting the module, or the internal hardware program/erase controller times out. 0 no program or erase of the UC3F array or shadow information or CENSOR bits in progress 1 program or erase of the UC3F array or shadow information or CENSOR bits in progress MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-11 CDR3 Flash (UC3F) EEPROM Table 21-5. UC3FCTL Bit Descriptions (continued) Bits 1 Name Description PEGOOD Program/erase operation result. The PEGOOD bit is for status only. At the completion of a program or erase operation using the embedded hardware algorithm, the hardware algorithm will change the state of the PEGOOD bit to reflect whether or not the program or erase operation was successful. Note: PEGOOD will be set under the following conditions: * No failure occurred * No program or erase operation was requested (i.e., the Flash was protected) The PEGOOD bit is only valid after the hardware program/erase algorithm has cleared HVS. PEGOOD is reset when either EHV is asserted or SES is cleared. See Figure 21-5 for a timing diagram of when PEGOOD is valid. 0 program or erase operation failed 1 program or erase operation was successful 2 PEFI Program/erase fail indicator. The PEFI bit is a status qualifier for the PEGOOD bit and is valid for the same times that PEGOOD is valid. In the event of an erase failure which returns PEGOOD = 0, the PEFI bit provides diagnostic information for the cause of the erase failure. If PEFI = 0, the erase failure occurred during the preprogramming step of the erase operation. If PEFI = 1, the erase failure occurred during the actual erase or APDE steps of the erase operation. In the event of a program failure which returns PEGOOD = 0, the PEFI bit indicates a program failure by reading as a 0. The PEFI bit should never return a 1 for a program failure. NOTE: The PEFI bit is meaningful only while PEGOOD is valid and PEGOOD = 0. PEFI is valid after HVS negates and prior to the assertion of EHV or negation of SES. 0 Program operation failed if PEGOOD = 0 1 Erase operation failed if PEGOOD = 0 3 EPEE EPEE pin status. The EPEE bit monitors the state of the external program/erase enable (EPEE) input. The UC3F module samples the EPEE input when EHV is asserted and holds that sampled state until EHV is negated. 0 high voltage operations are not possible 1 high voltage operations are possible 4 B0EM Block 0 EPEE pin status. The B0EM bit monitors the state of the Block 0 EPEE, B0EPEE, input. The UC3F module samples the B0EPEE input when EHV is asserted and holds that sampled value until EHV is negated. If B0EM = 1 when EHV is asserted, high voltage operations such as program or erase are enabled for either small block 0 or the lowest numbered block of the UC3F array regardless of the state of EPEE. If B0EM = 0 when EHV is asserted, high voltage operations are disabled for small block 0 or the lowest numbered block of the UC3F array regardless of the state of EPEE. 0 High voltage operations are not possible for block 0 or lowest numbered block 1 High voltage operations are possible for block 0 or lowest numbered block. 5:13 -- 14:15 Reserved SBBLOCK Small block program and erase select. The SBBLOCK bits are write-protected by the SES bit. SBBLOCK selects the UC3F EEPROM small array blocks for program and erase operation. When programming, only those blocks intended to be enabled for programming should have their corresponding BLOCK[M] or SBBLOCK[M] bit set. 0 Small block M is not selected for program or erase 1 Small Block M is selected for program or erase MPC561/MPC563 Reference Manual, Rev. 1.2 21-12 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM Table 21-5. UC3FCTL Bit Descriptions (continued) Bits Name Description 16:23 BLOCK Block program and erase select. The BLOCK bits are write protected by the SES bit. BLOCK selects the UC3F EEPROM array blocks for program and erase operation. All the blocks may be selected for program or erase operation at once. The UC3F EEPROM configuration along with BLOCK determine which array blocks that may be programmed. The UC3F EEPROM array blocks that are enabled to be programmed by the program operation are the blocks whose corresponding BLOCK bit is set to 1. For example, if array blocks 2 and 5 are enabled for programming, BLOCK[2] and BLOCK[5] must be set to 1 while BLOCK[0], BLOCK[1], BLOCK[3], BLOCK[4], BLOCK[6], and BLOCK[7] are set to 0. The UC3F EEPROM configuration along with BLOCK determine the blocks that will be erased simultaneously. All array blocks whose corresponding BLOCK bits are set will be erased during the erase operation. For example, if BLOCK = 00100111, then array blocks 2, 5, 6, and 7 get erased when an erase operation is performed. 0 Array block M is not selected for program or erase 1 Array block M is selected for program or erase 24 -- 25 CSC 26:27 -- 28 HSUS Program/erase suspend. Setting the HSUS bit during an embedded hardware algorithm program or erase operation will force the UC3F EEPROM to suspend the current program or erase. The UC3F EEPROM will maintain all information necessary to resume the suspended operation. Array reads are possible while HSUS = 1. However, array reads must be done to locations that are not being affected by the program/erase operation that is currently being suspended. The UC3F EEPROM will NOT prevent read accesses to those locations. Reads to those locations will result in UNKNOWN data. Writes to the HSUS bit only have effect while EHV = 1. The HSUS bit is write locked by EHV = 0. 0 Hardware program/erase behaves normally 1 Any current hardware program/erase is suspended 29 PE Program or erase select. The PE bit is write protected by the SES bit. PE configures the UC3F EEPROM for programming or erasing. When PE = 0, the array is configured for programming and if SES = 1 the SIE bit will be write locked. When PE = 1, the array is configured for erasing and SES will not write lock the SIE bit. 0 Configure for program operation 1 Configure for erase operation Reserved Censor set or clear. The CSC bit is write protected by the SES bit. CSC configures the UC3F EEPROM for setting or clearing CENSOR. If CSC = 1 then CENSOR is configured for setting if PE = 0 or clearing if PE = 1. When the CSC bit is set, the following bits in the UC3FMCR register are write-locked: LOCK, FIC, ACCESS, SUPV, DATA, and PROTECT. 0 Configure for normal operation 1 Configure to set or clear the CENSOR bits Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-13 CDR3 Flash (UC3F) EEPROM Table 21-5. UC3FCTL Bit Descriptions (continued) Bits Name Description 30 SES Start-end program or erase sequence. The SES bit is write protected by the STOP, HVS, and EHV bits. The SES bit is used to signal the start and end of a program or erase sequence. At the start of a program or erase sequence, SES is set. This will lock STOP, PROTECT, SBPROTECT, BLOCK, SBBLOCK, SBEN, CSC, and PE. If PE = 0 and SES = 1, SIE will be write locked. At this point, the UC3F EEPROM is ready to receive either the programming writes or the erase interlock write. NOTE: The erase interlock write is a write to any UC3F EEPROM array location after SES is set and PE = 1. If PE = 0 and SES = 1, writes to the UC3F array are programming writes. The first programming write sets the address of the location to be programmed, and the data written is captured into the program data latch for programming into the UC3F array. All programming writes after the first programming write update the program data latch but do not change the address to be programmed. At the end of the program or erase operation, the SES bit must be cleared to return to normal operation and release the STOP, PROTECT, SBPROTECT, BLOCK, SBBLOCK, CSC, SBEN, and PE bits. 0 UC3F EEPROM not configured for program or erase operation 1 Configure UC3F EEPROM for program or erase operation 31 EHV Enable high voltage. EHV can be asserted only after the SES bit has been asserted and a valid programming write(s) or erase hardware interlock write has occurred. If an attempt is made to assert EHV when SES is negated, or if a valid programming write or erase hardware interlock write has not occurred since SES was asserted, EHV will remain negated. The external program or erase enable pin (EPEE) and EHV are used to control the application of the program or erase voltage to the UC3F EEPROM module. High voltage operations to the UC3F EEPROM array, special shadow locations or FLASH NVM registers can occur only if EHV = 1 and EPEE = 1. Only after the correct hardware and software interlocks have been applied to the UC3F EEPROM can EHV be set. Once EHV is set, SES cannot be changed and attempts to read the array will not be acknowledged. Clearing EHV during a program or erase operation will safely terminate the high voltage operation. If EHV is cleared while using the embedded hardware program/erase algorithm, the program/erase routine will abort the operation and exit normally. 0 Program or erase pulse disabled 1 Program or erase pulse enabled SES EHV HVS PEGOOD PEGOOD Valid Time PEGOOD Valid Time Figure 21-5. PEGOOD Valid Time MPC561/MPC563 Reference Manual, Rev. 1.2 21-14 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM 21.2.2 UC3F EEPROM Array Addressing The UC3F array is divided into eight blocks, 64 Kbytes in size, which may be independently erased. Two blocks are host to a 16-Kbyte small block. Seventeen bits of address are used to decode locations in the UC3F array. The read control logic in the UC3F EEPROM module decodes the upper 14 bits of that address to determine if the desired data is currently stored in one of the two read page buffers. If the data is already present in one of the two read page buffers, a read operation is not completed to the UC3F array core, and 64 bits of data are transferred from the appropriate read page buffer to the BIU. This type of array read access is an on-page read. In the event that the read control logic determines that the desired data is not contained within one of the read page buffers, a read access to the UC3F array core is completed and 32 bytes of data are transferred from the array core. Only the addressed 64 bits of data will be transferred to the BIU. This type of array read access is an off-page read. The BIU contains logic to implement the read page buffer update and replacement scheme to transfer the 32 bytes of data into the appropriate read page buffer. If the read page update and replacement scheme contains a random access mode that does not update the read page buffers, the 32 bytes of data retrieved from the UC3F array core will not be transferred into either read page buffer. The BIU is expected to contain page update logic for controlling the updating of the read page buffers. Write accesses to the UC3F array have no effect except during program and erase operation. 21.2.3 UC3F EEPROM Shadow Row The UC3F EEPROM module contains a special shadow row that is used to hold reset configuration data and user data. See Figure 21-6. The shadow row is accessed by setting UC3FMCR[SIE] = 1 and performing normal array accesses. Upon transitioning SIE (a 1-to-0 or 0-to-1 transition), the read page match decode circuit is reset so that the next array access is an off-page access. The shadow row contains 512 bytes which are addressed for read accesses using the low order row and read page addresses. The shadow row is implemented in the lowest numbered block of the array. In the case of a UC3F array configuration which also has a small block in the lowest numbered block of the array, the shadow row is contained in the small block. If SBEN[0] = 1 in this array configuration, the shadow row is treated as part of small block 0. SBPROTECT[0] and SBBLOCK[0] are used to control program and erase operation of the shadow row. If SBEN[0] = 0 in this array configuration, the shadow row is treated as part of the host block. The corresponding PROTECT and BLOCK bits are used to control program and erase operation of the shadow row. NOTE A module cannot read its own shadow row. On the MPC563 the program accessing the Flash shadow row must be executing from external memory or from internal SRAM. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-15 CDR3 Flash (UC3F) EEPROM 0x00 0x03 0x04 Reset Configuration Word Reserved for Future Applications 0x0F 0x10 General-Use Shadow Information 0x1FF Figure 21-6. Shadow Information 21.2.3.1 Reset Configuration Word (UC3FCFIG) The UC3F EEPROM reset configuration word is implemented in the first word (ADDR[23:29] = 0x00) of the special shadow locations. The reset configuration word along with the rest of the shadow information words is located in supervisor data address space. The purpose of the reset configuration word is to provide the system with an alternative internal source for the reset configuration. Note that with the exception of bit 20, the bits in the UC3FCFIG are identical to those in the USIU hard reset configuration word. The reset state of UC3FCFIG is user programmable. MSB 0 1 2 3 4 Field EARB IP BDRV BDIS 5 6 BPS[0:1] 7 8 -- 9 10 11 12 13 14 15 DBGC[0:1] -- ATWC EBDF[0:1] IWS Reset Unchanged1 Addr 0x03 LSB 16 Field PRPM Reset 17 18 SC 19 20 ETRE HC 21 22 23 24 25 EN_COMP2 EXC_COMP2 -- OERC 26 27 -- 28 29 ISB 30 31 DME Unchanged1 1 Programmed by the user. only on the MPC564 3 When UC3FMCR[SIE] = 1, UC3FCFIG is the first word of the shadow row. 2 Available Figure 21-7. Hard Reset Configuration Word (UC3FCFIG) MPC561/MPC563 Reference Manual, Rev. 1.2 21-16 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM Table 21-6. RCW Bit Descriptions Bits Name Description 0 EARB 1 IP Initial interrupt prefix -- This bit defines the initial value of the MSR[IP] immediately after reset. The MSR[IP] bit defines the Interrupt Table location. 0 MSR[IP] = 0 after reset 1 MSR[IP] = 1 after reset The default value is 0. See Table 3-11 for more information. 2 BDRV Bus pins drive strength -- This bit determines the bus pins' (address, data, and control) driving capability to be either full or reduced drive. The bus default drive strength is full; upon default, it also causes the CLKOUT drive strength to be full. See Table 6-7 for more information. BDRV controls the default state of COM[1] in the SIUMCR. 0 Full drive 1 Reduced drive 3 BDIS Boot disable -- If the BDIS bit is set, then memory controller is not activated after reset. If it is cleared then the memory controller bank 0 is active immediately after reset such that it matches any addresses. If a write to the OR0 register occurs after reset this bit definition is ignored. The default value is that the memory controller is enabled to control the boot with the CS0 pin. See Section 10.7, "Global (Boot) Chip-Select Operation" for more information. 0 Memory controller bank 0 is active and matches all addresses immediately after reset 1 Memory controller is not activated after reset. 4:5 BPS Boot port size -- This field defines the port size of the boot device on reset (BR0[PS]). If a write to the OR0 register occurs after reset this field definition is ignored. See Table 10-5 and Table 10-8 for more information. 00 32-bit port (default) 01 8-bit port 10 16-bit port 11 Reserved 6:8 -- 9:10 DBGC[0:1] 11 -- 12 ATWC Address type write enable configuration -- The default value is that these pins function as WE pins. 0 WE[0:3]/BE[0:3]/AT[0:3] functions as WE[0:3]/BE[0:3] 1 WE[0:3]/BE[0:3]/AT[0:3] functions as AT[0:3] See Table 6-7. 13:14 EBDF External bus division factor -- This field defines the initial value of the external bus frequency. The default value is that CLKOUT frequency is equal to that of the internal clock (no division). See Table 8-9. 15 IWS Interlock write select -- This bit determines which interlock write operation should be used during the clear censorship operation. IWS always comes from the UC3FCFIG, it will never use the external reset configuration word (RSTCONF=0) or the default internal reset configuration word (RSTCONF=1 and HC=1). 0 Interlock write is a write to any UC3F array location 1 Interlock write is a write to the UC3FMCR register. External arbitration -- Refer to Section 9.5.7, "Arbitration Phase" for a detailed description of Bus arbitration. The default value is that internal arbitration hardware is used. 0 Internal arbitration is performed 1 External arbitration is assumed Reserved. These bits must not be high in the reset configuration word. Debug pins configuration -- See Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR)" for this field definition. The default value is that these pins function as: VFLS[0:1], BI, BR, BG and BB. See Table 6-8. Reserved. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-17 CDR3 Flash (UC3F) EEPROM Table 21-6. RCW Bit Descriptions (continued) 1 Bits Name Description 16 PRPM Peripheral mode enable -- This bit determines if the chip is in peripheral mode. A detailed description is in Table 6-13. The default value is no peripheral mode enabled. 17:18 SC 19 ETRE 20 HC Single chip select -- This field defines the mode of the MPC563. 00 Extended chip, 32 bits data 01 Extended chip, 16 bits data 10 Single chip and show cycles (address) 11 Single chip See Table 6-10. Exception table relocation enable -- This field defines whether the Exception Table Relocation feature in the BBC is enabled or disabled. The default state for this field is disabled. For more details, see Table 4-4. Has configuration - This bit determines if the Flash Reset Configuration word is valid. 0 The Flash shadow row contains a valid Reset Configuration Word 1 The Flash shadow row does not contain a valid Reset Configuration Word 21 EN_COMP1 Enable compression -- This bit enables the operation of the MPC564 with compressed code. See Table 4-4. 22 EXC_COMP Exception compression -- This bit determines the operation of the MPC564 with exceptions. 1 0 indicates the exceptions are all non-compressed. See Table 4-4. 1 the MPC564 assumes that ALL the exception routines are in compressed code. 23 -- Reserved. This bit must be programmed low in the reset configuration word. 24:25 OERC 26:27 -- 28:30 ISB Internal space base select -- This field defines the initial value of the ISB field in the IMMR register. A detailed description is in Table 6-12. The default state is that the internal memory map is mapped to start at address 0x0000_0000. This bit must not be high in the reset configuration word. 31 DME Dual mapping enable -- This bit determines whether Dual mapping of the internal Flash is enabled. For a detailed description refer to Table 10-11. The default state is that dual mapping is disabled. 0 Dual mapping disabled 1 Dual mapping enabled Other exceptions relocation control -- These bits effect only if ETRE was enabled. Relocation offset: 00 Offset 0 01 Offset 64 Kbytes 10 Offset 512 Kbytes 11 Offset to 0x003F E000 See Table 4-2. Reserved This bit is available only on the MPC564. During reset, the has configuration bit (HC) and the USIU configure the UC3F EEPROM module to provide UC3FCFIG. If HC = 0 and the USIU requests internal configuration during reset the reset configuration word will be provided by UC3FCFIG. The default reset state of the UC3FCFIG after an erase operation of the UC3F module is no configuration word available (HC = 1). MPC561/MPC563 Reference Manual, Rev. 1.2 21-18 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM 21.2.4 UC3F EEPROM 512-Kbyte Array Configuration Figure 21-8, the array configuration diagram, shows the UC3F configuration for the MPC563 512-Kbyte arrays. UC3F 16 Kbytes* Block 0 Block 1 Small Block 0 48 Kbytes 48 Kbytes 16 Kbytes Block 2 64 Kbytes Block 3 64 Kbytes Block 4 64 Kbytes Block 5 64 Kbytes Block 6 64 Kbytes Block 7 64 Kbytes Small Block 1 Note: The shading indicates the shadow row. Figure 21-8. 512-Kbyte Array Configuration 21.3 UC3F Operation The following sections describe the operation of the UC3F EEPROM during various operational modes. The primary function of the UC3F EEPROM module is to serve as electrically erasable and programmable non-volatile memory for embedded application in microcontrollers. 21.3.1 Reset The device signals a reset to the UC3F EEPROM by asserting the reset signal. A reset is the highest priority operation for the UC3F EEPROM and terminates all other operations. The UC3F EEPROM module uses reset to initialize register bits to their default reset value. If the UC3F EEPROM is in program or erase operation (UC3FCTL[EHV] = 1 and UC3FCTL[SES] = 1) and a reset is issued, the module will perform the needed interlocks to disable the high voltage without damage to the high voltage circuits. Reset terminates any other mode of operation and forces the UC3F EEPROM module to a state ready to receive accesses. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-19 CDR3 Flash (UC3F) EEPROM During power up and power down periods, it is assumed that the reset signal is asserted to prevent accidental program/erase disturb of the UC3F array. 21.3.2 Register Read and Write Operation The UC3F EEPROM control registers are accessible for read or write operation at all times while the device is powered up and enabled except during reset. 21.3.3 Array Read Operation The UC3F EEPROM array is available for a read operation under most conditions while the device is powered up. Reads of the array are not allowed in the following instances: * During reset--When in information or cleared censorship with ACCESS = 0 * While the UC3F EEPROM is disabled--See Section 21.3.10, "Disabled," for more information on disabling the UC3F EEPROM * While the UC3F EEPROM is in STOP mode--See Section 21.3.9, "Stop Operation," for more information on STOP mode * While high voltage is applied to the array during program and erase operation --HVS = 1 or EHV = 1 and not suspended The address of an incoming read access is compared to the address for which data is currently held in the read page buffers. If the data corresponding to the read address is currently held in one of the two read page buffers, the data is fetched from the appropriate read page buffer. A data fetch from a read page buffer is an on-page read operation Section 21.3.3.1, "Array On-Page Read Operation." If the data is not contained in one of the read page buffers, 32 bytes of information is fetched from the UC3F array, and the addressed data is driven onto the data bus. A data fetch from the UC3F array is an off-page read operation. NOTE After setting/clearing UC3FCTL[HSUS], reset, programming writes, erase interlock write, setting EHV, clearing SES or setting/clearing SIE, the page buffers may not contain valid information. The UC3F forces an off-page read before an on-page read can be accomplished to ensure data coherency. For information regarding how the two read page buffers in the UC3F EEPROM are associated to array blocks, refer to Section 21.2.2, "UC3F EEPROM Array Addressing." The UC3F module is configured as a page mode memory. The UC3F module uses an internal address comparator to monitor incoming addresses to determine if the addressed information is stored in a read page buffer. When the address comparator determines that the requested information is not stored in a read page buffer, an array off-page read operation retrieves 32 bytes of data from the Flash array and transfers the addressed data to the data bus. In the MPC563, the UC3F module contains two 32-byte read page buffers. In the module, one buffer is dedicated to the most recently accessed instruction fetches and the other read page buffer is dedicated to the most recently loaded data access. MPC561/MPC563 Reference Manual, Rev. 1.2 21-20 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM 21.3.3.1 Array On-Page Read Operation An internal address comparator is used to determine if addressed information is stored in a read page buffer. If the address of a read access matches data contained in a read page buffer, that addressed data is transferred from the read page buffer to the data bus. An off-page read access to transfer data from the Flash array to the data bus is not performed in this case. 21.3.4 Shadow Row Select Read Operation The normal array is accessed when the SIE register bit in the UC3FMCR = 0. When SIE = 1, reads to the array access the shadow information row. 21.3.5 Array Program/Erase Interlock Write Operation The only valid writes to the UC3F array are program or erase interlock writes. In the case of program interlock writes, the address of the write determines the location to be programmed while the data written is transferred to the program data latches to be programmed into the array. Address and data written during an erase interlock write is a "don't care" and is not stored anywhere. 21.3.6 High Voltage Operations There are two fundamental high voltage operations, program and erase. Program changes a UC3F array bitcell from a logic 1 state to a logic 0 state and is a selective operation performed on up to 32 bits at a time. Erase changes a UC3F array bitcell from a logic 0 state to a logic 1 state and is a bulk operation performed on one block or multiple blocks of the UC3F array. 21.3.6.1 Overview of Program/Erase Operation The embedded hardware program/erase algorithm relies on an internal state machine to perform the program and erase sequences. The embedded hardware algorithm uses an internal oscillator to control the high voltage pulse duration and hardware control logic. The embedded hardware algorithm is also responsible for performing all margin reads and applying high voltage pulses to ensure each bit is programmed or erased with sufficient margin. Upon successful program or erase operation, the program/erase hardware control logic terminates the program or erase operation with a pass status (PEGOOD = 1). The program/erase control logic will time out in the event that the maximum program or erase time is exceeded and return a fail status (PEGOOD = 0). 21.3.7 Programming To modify the charge stored in an isolated element of the UC3F bit from a logic 1 state to a logic 0 state, a programming operation is required. This programming operation applies the required voltages to change the charge state of the selected bits without changing the logic state of any other bits in the UC3F array. The program operation cannot change the logic 0 state to a logic 1 state; this transition must be done by the erase operation. Programming uses a program data latch to store the data to be programmed and an address latch to store the word address to be programmed. The UC3F Array may be programmed by byte (8 bits), half-word (16 bits), or word (32 bits). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-21 CDR3 Flash (UC3F) EEPROM Blocks of the UC3F EEPROM that are protected (PROTECT[M] = 1, SBEN[N] = 1 and SBPROTECT[N] = 1) will not be programmed. Also, if EPEE = 0, no programming voltages will be applied to the array. If B0EPEE = 0, no programming voltages will be applied to block 0 or small block 0 depending on the state of SBEN[0] and the configuration of the array. 21.3.7.1 Program Sequence The UC3F EEPROM module requires a sequence of writes to the high voltage control register (UC3FCTL) and to the program data latch in order to enable the high voltage to the array or shadow information for program operation. The required hardware program sequence follows. 1. Write PROTECT[0:7] and SBPROTECT[0:1] to disable protection on blocks to be programmed. 2. Write BLOCK[0:7] and SBBLOCK[0:1] to select the array blocks to be programmed, SES = 1 and PE = 0 in the UC3FCTL register. NOTE BLOCK[0:7] and SBBLOCK[0:1] in conjunction with SBEN[0:1] determine which blocks/small blocks in the array are enabled for programming operation. Just because a BLOCK or SBBLOCK bit is enabled (set to 1), no programming can occur in the corresponding block/small block unless the programming operation specifically targets an address location within that block/small block to program. If BLOCK or SBBLOCK is not set to 1, no address locations in that corresponding block or small block can be programmed. 3. Programming write -- A successful write to the array location to be programmed. This write updates the program data latch with the information to be programmed. In addition, the addressof the first programming write is latched in the UC3F memory interface block. All accesses of the array after the first write are to the same address regardless of the address provided. Thus the locations accessed after the first programming write are limited to the location to be programmed. The last write to the program data latch is saved for programming. NOTE If a byte of the program data latch has not received a programming write, no programming voltages will be applied to the corresponding byte in the array. Once EHV has been set, writes to the program data latch are disabled until EHV is cleared to 0. 4. Write EHV = 1 in the UC3FCTL register. NOTE The values of the EPEE and B0EPEE inputs are latched with the assertion of EHV to determine the array protection state for the program operation. It is assumed that the EPEE and B0EPEE inputs are setup prior to the assertion of EHV. 5. Read the UC3FCTL register until HVS = 0. 6. Read the UC3FCTL, confirm PEGOOD = 1. MPC561/MPC563 Reference Manual, Rev. 1.2 21-22 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM 7. Write EHV = 0. WARNING Writing EHV = 0 before HVS = 0 causes the current program sequence to ABORT. The location for which the program sequence was aborted may not have been programmed with sufficient margins. The block containing that location must be erased and reprogrammed before that block of the UC3F array may be used reliably. 8. If more information needs to be programmed go to step 3. 9. Write SES = 0 in the UC3FCTL register. T3 S2 T1 S3 T7 T2 Reset T4 T6 S1 S4 T8 T5 T9 S5 T10 Figure 21-9. Program State Diagram Table 21-7. Program Interlock State Descriptions State S1 Mode Normal Operation: Normal array reads and register accesses. The block protect information can be modified. Next State S2 Transition Requirement T2 Write PE = 0, SES = 1. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-23 CDR3 Flash (UC3F) EEPROM Table 21-7. Program Interlock State Descriptions (continued) Next State State Mode S2 First Program Hardware Interlock Write: Normal read operation still occurs. The array will accept programming writes. Accesses to the registers are normal register accesses. A write to UC3FCTL cannot change EHV at this time.If the write is to a register no data will be stored in the program data latch and the UC3F remains in state S2. S1 T1 Write SES = 0 or a reset. S3 T3 Hardware Interlock. A successful write to any UC3F array location. This programming write will latch the selected word of data into the program data latch and the address is latched to select the location that will be programmed. Once a bit has been written then it remains in the program data latch until another write over-writes that data or a write of SES = 0. If the write is to a register no data will be stored in the program data latch and the UC3F remains in state S2. Expanded Program Hardware Interlock Operation: Programming writes are accepted so that data may be programmed. These writes may be to any UC3F array location. The location to be programmed is determined from the address initially written to on the first program interlock write. The program data latch may be updated on any program interlock writes which occur in this state. Accesses to the registers are normal register accesses. A write to UC3FCTL can change EHV. If the write is to a register no data will be stored in the program data latch. S1 T6 Write SES = 0 or a reset. S4 T4 Write EHV = 1. Program Operation: High voltage is applied to the array or shadow information to program the UC3F bit cells, and program margin reads are automatically performed by the internal program control logic. No further programming writes will be accepted. During programming, the array will not respond to any access. Accesses to the registers are allowed. A write to UC3FCTL can change EHV or HSUS only. S1 T5 Reset. S2 T7 Write EHV = 0. S5 T8 Write HSUS = 1 or disable the UC3F module. Program Suspend Operation: The program operation is suspended to either read the array or disable the module. Once HVS reads as a 0, the program operation is suspended. Normal reads to the array can be performed if the module is enabled; read accesses to the location being programmed returns indeterminate data. S1 T10 Reset. S4 T9 Write HSUS = 0 or re-enable the UC3F module. S3 S4 S5 21.3.7.2 Transition Requirement Program Shadow Information Programming the shadow information uses the same procedure as programming the array except that SIE must be set to a 1 prior to initiating the programming sequence. Only the lowermost addresses are used to encode words that get programmed in the shadow row. The shadow information is physically located in MPC561/MPC563 Reference Manual, Rev. 1.2 21-24 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM lowest numbered block and will also be located in small block 0 if the lowest numbered block hosts a small block in the implemented configuration. 21.3.7.3 Program Suspend The program operation may be suspended to allow read accesses to the array. Setting the HSUS bit in the UC3FCTL to a 1 while PE = 0, EHV = 1, and HVS = 1 forces the array into a program suspend state. The deassertion of the HVS bit (HVS = 0) signifies that the program operation has been successfully suspended. The HVS bit should negate within 10s of asserting the HSUS bit. While in program suspend mode, normal read accesses may be performed to the UC3F array or shadow information words. Reads to the array location targeted for program return indeterminate data since only a partial programming operation may have been performed. The program operation may be resumed by setting HSUS = 0. NOTE Repeated suspending of a program operation to fetch array contents may extend the program operation. The internal program hardware may only resume the program operation at predefined steps of the internal program hardware sequence; interrupting the program operation on a high frequency basis may cause the internal program hardware to delay completion of the current step and delay advancement to the next step of the internal program hardware sequence. Frequent suspend/resume operations (more than approximately once per millisecond) may also cause program or erase timeouts, and are not recommended. 21.3.8 Erasing To modify the charge stored in an isolated element of the UC3F bit from a logic 0 state to a logic 1 state, an erase operation is required. In the UC3F EEPROM, erase is a bulk operatBlockion that affects the stored charge of all the isolated elements in an array block. To make the UC3F module block-erasable, the array is divided into blocks that are physically isolated from each other. Each of the array blocks may be erased in isolation or in any combination. The UC3F array block size is fixed for all blocks in the module at 64 Kbytes and the module is comprised of eight blocks. Two of these blocks may be further subdivided into two small blocks. Array blocks of the UC3F EEPROM that are protected (PROTECT[M] = 1 or (SBEN[M] = 1 & SBPROTECT[M] = 1)) will not be erased. Also, if EPEE = 0 or B0EPEE = 0, no erase voltages will be applied to the array or the block corresponding to block 0 or small block 0 if SBEN[0] = 1. The embedded program/erase algorithm first pre-programs all bits in blocks selected for erase prior to actually erasing the selected blocks. The array blocks selected for erase operation are determined by BLOCK[0:7], SBBLOCK[0:1] in conjunction with SBEN[0:1], and the array configuration. If multiple blocks are selected for erase, the embedded erase hardware algorithm serially erases each array block until all of the selected blocks are erased. For instance, if BLOCK[0:7] = 0x78 and SBEN[0:1] = 0b00, then blocks 1, 2, 3, and 4 are selected for erase. The embedded erase hardware algorithm first erases block 1 and then erases block 2 followed MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-25 CDR3 Flash (UC3F) EEPROM by blocks 3 and 4. The total erase time for this example is the block erase time, TERASE, multiplied by four since four blocks are erased. In addition, the preprogramming time to program all locations in blocks 1, 2, 3, and 4 to a "0" state needs to be considered when determining the total erase time. The preprogramming time is dependent on the data already stored in the Flash array before beginning the erase operation. 21.3.8.1 Erase Sequence The UC3F EEPROM module requires a sequence of writes to the high voltage control register (UC3FCTL) and an erase interlock write in order to enable high voltage to the array and shadow information for erase operation. The required hardware algorithm erase sequence follows. 1. Write PROTECT[0:7] and SBPROTECT[0:1] to disable protect for the blocks to be erased. 2. Write BLOCK[0:7] and SBBLOCK[0:1] to select the blocks to be erased, PE = 1 and SES = 1 in the UC3FCTL register. NOTE BLOCK[0:7] and SBBLOCK[0:1] in conjunction with SBEN[0:1] determine which blocks are selected for erase. Blocks whose BLOCK bits or enabled small blocks whose SBBLOCK bits are set (equal to 1) get erased when an erase operation is performed. 3. Execute an erase interlock write to any UC3F array location. 4. Write EHV = 1 in the UC3FCTL register. NOTE The values of the EPEE and B0EPEE inputs are latched with the assertion of EHV to determine the array protection state for the erase operation. It is assumed that the EPEE and B0EPEE inputs are setup prior to the assertion of EHV. 5. Read the UC3FCTL register until HVS = 0. WARNING Writing EHV = 0 before HVS = 0 causes the current erase sequence to ABORT. All blocks being erased must go through another erase sequence before the UC3F EEPROM can be used reliably. 6. Read the UC3FCTL register. Confirm PEGOOD =1. 7. Write EHV = 0 in the UC3FCTL register. 8. Write SES =0 in the UC3FCTL register. MPC561/MPC563 Reference Manual, Rev. 1.2 21-26 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM T3 T7 S2 T1 S3 T2 Reset T4 T6 S1 S4 T8 T5 T9 S5 T10 Figure 21-10. Erase State Diagram Table 21-8. Erase Interlock State Descriptions State Mode Next State Transition Requirement S1 Normal Operation: Normal array reads and register accesses. The Block protect information can be modified. S2 T2 Write PE = 1, SES = 1. S2 Erase Hardware Interlock Write: Normal read operation still occurs. The UC3F will accept the erase hardware interlock write. This write may be to any UC3F array location. Accesses to the registers are normal register accesses. A write to UC3FCTL cannot set EHV at this time. A write to the register is not an erase hardware interlock write and the UC3F remains in state S2. S1 T1 Write SES = 0 or a reset. S3 T3 Hardware Interlock A successful write to any UC3F array location is the erase interlock write. If the write is to a register the erase hardware interlock write has not been done and the UC3F remains in state S2. High voltage write enable Accesses to the registers are normal register accesses. A write to UC3FCTL can change SES or EHV. S1 T6 Write SES = 0 or a reset. S4 T4 Write EHV = 1. Erase Operation: High voltage is applied to the array blocks to erase the UC3F bit cells, and erase margin reads are automatically performed by the embedded erase control logic. During erase the array will not respond to any address. Accesses to the registers are allowed. A write to UC3FCTL can change EHV or HSUS only. S1 T5 Reset. S2 T7 Write EHV = 0. S5 T8 Write HSUS = 1 or disable the UC3F module. S3 S4 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-27 CDR3 Flash (UC3F) EEPROM Table 21-8. Erase Interlock State Descriptions (continued) State Mode S5 Erase Suspend Operation: The erase operation is suspended to either read the array or disable the module. Once HVS reads as a 0, the erase operation is suspended. Normal reads to the array can be performed if the module is enabled; read accesses to locations in blocks being erased return indeterminate data. 21.3.8.2 Next State Transition Requirement S1 T10 Reset. S4 T9 Write HSUS = 0 or re-enable the UC3F module. Erasing Shadow Information Words The shadow information words are erased with either the lowest numbered block or small block 0, depending on the array configuration and the state of SBEN[0]. If the lowest numbered block in the array does not host a small block, then the shadow information words are erased with the lowest numbered block. If the lowest numbered block hosts a small block, then the shadow information words may get erased with small block 0. If SBEN[0] = 0 for this array configuration, then the shadow information words get erased with the lowest numbered block. If SBEN[0] = 1 for this same array configuration, then the shadow information words get erased with small block 0 only. 21.3.8.3 Erase Suspend The erase operation may be suspended to allow read accesses to the array. Setting the HSUS bit in the UC3FCTL to a 1 while EHV=1 and HVS=1 forces the array into an erase suspend state. The deassertion of the HVS bit (HVS = 0) signifies that the erase operation has been successfully suspended. The HVS bit should negate within 10 ms of asserting the HSUS bit. While in erase suspend mode, normal read accesses may be performed to the UC3F array or shadow information words. Reads to the array block or blocks targeted for erase return indeterminate data since only a partial erase operation has been performed. The erase operation may be resumed by setting HSUS = 0. NOTE Repeated suspending of an erase operation to fetch array contents may severely extend the erase operation. The internal erase hardware may only resume the erase operation at predefined steps of the internal erase hardware sequence; interrupting the erase operation on a high frequency basis may cause the internal erase hardware to delay completion of the current step and delay advancement to the next step of the internal erase hardware sequence. 21.3.9 Stop Operation The UC3F EEPROM goes into a low power operation, or stop operation, while STOP = 1. When the STOP bit is set, only the control registers can be accessed on the UC3F EEPROM module. The UC3F EEPROM array may not be programmed, erased or read while STOP = 1. MPC561/MPC563 Reference Manual, Rev. 1.2 21-28 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM With STOP = 1, the UC3F module enters a low power state by shutting down internal timers and bias generators. A stop recovery time of 1 s is required when clearing the STOP bit to exit stop operation. The BIU should allow 1 s following the negation of the STOP bit so that internal bias generators used by the array may recover to normal levels prior to initiating any UC3F array accesses. NOTE The UC3F cannot be stopped while the array is being programmed or erased since the STOP bit is write locked by SES = 1. 21.3.10 Disabled The UC3F module can be disabled by clearing the FLEN bit in the IMMR register (see Section 6.2.2, "System Configuration and Protection Registers"). While disabled, the UC3F module is completely shut down. The register block and array are not accessible in this mode, and all circuits which draw any DC power are disabled to eliminate power consumption. In addition,the module can be disabled by setting the STOP bit in the UC3FMCR register (see Section 21.2.1.2, "UC3F EEPROM Configuration Register (UC3FMCR)"). If the UC3F module is disabled while programming or erasing, the HSUS bit in the UC3FCTL register is asserted (HSUS = 1) to suspend the current program or erase operation. When the UC3F module is re-enabled, the suspended program or erase operation may be resumed by writing the HSUS bit to a 0. NOTE While there should be no harmful side effects resulting from disabling the UC3F module while in program or erase operation, it is not recommended that program or erase operation be suspended in this manner. When disabled, the power used by the UC3F is reduced to leakage levels; otherwise, the UC3F module is enabled for accesses. For example, recovering from a stop operation (STOP = 1), there is a recovery time of 1 s for internal biases to reach to operating levels. 21.3.11 Censored Accesses and Non-Censored Accesses The UC3F EEPROM has a censorship mechanism which provides for several censorship states. The censorship mechanism is used to increase restrictions in accessing Flash data. Four bits in UC3FMCR are used to configure the UC3F censorship state. These bits are: * ACCESS--Enables a UC3F EEPROM to bypass the censorship. * FIC--Overrides CENSOR[0:1] to force information censorship. * CENSOR[0:1]--Determine the censorship state of the UC3F. The device has two relevant modes used by the UC3F EEPROM to select the type of censorship. The first mode, which is uncensored mode, provides no censorship. In uncensored mode the ACCESS and CENSOR[0:1] bits are irrelevant. The second mode, censored mode, enables the UC3F EEPROM to exercise censorship based on the state of ACCESS, FIC, and CENSOR[0:1]. The device will enter censored mode only if one of following events occurs: * booting from external memory MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-29 CDR3 Flash (UC3F) EEPROM * * * operating in peripheral mode or upon any access by an external master operating in debug mode (BDM or Nexus) booting from internal SRAM In censored mode, a UC3F EEPROM may disallow accesses to the array. If censored mode is entered by any means then the UC3F EEPROM will exercise censorship according to Table 21-9. . Table 21-9. Censorship States ACCESS FIC CENSOR[0:1] Description 0 0 11 Information censorship, No UC3F array accesses allowed. 0 0 01 or 10 0 0 00 Cleared censorship, No UC3F array accesses allowed. 0 1 XX Emulated censorship, No UC3F array accesses allowed. 1 X XX No censorship, UC3F array accesses allowed. No censorship, UC3F array accesses allowed. While the device remains in the uncensored mode, ACCESS may be set to allow the device to enter censored mode and still access the UC3F array. ACCESS may not be set while the device is in censored mode but may be cleared. MPC561/MPC563 Reference Manual, Rev. 1.2 21-30 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM . Table 21-10. Censorship Modes and Censorship Status Mode Censored ACCESS Uncensored 0 FIC 1 0 1 0 CENSOR[0:1] 00 01 or 10 11 00, 01, or 10 11 UC3F EEPROM Status #1 #2 #3 #4 #5 0 1 0 1 1 0 1 #10 #11 00, 01, 10 or 11 #6 #7 #8 #9 Indicates that the UC3F array cannot be accessed. 1. ACCESS cannot be changed. FIC can be set. UC3F array cannot be accessed. CENSOR[0:1] can be set. CENSOR[0:1] cannot be cleared. 2. ACCESS cannot be changed. FIC can be set. UC3F array can be accessed. CENSOR[0:1] can be set. CENSOR[0:1] can be cleared. 3. ACCESS cannot be changed. FIC can be set. UC3F array cannot be accessed. CENSOR[0:1] cannot be cleared unless IWS = 1. 4. ACCESS cannot be changed. FIC cannot be changed. UC3F array cannot be accessed. CENSOR[0:1] can be set. CENSOR[0:1] cannot be cleared unless IWS = 1. 5. ACCESS cannot be changed. FIC cannot be changed. UC3F array cannot be accessed. CENSOR[0:1] cannot be cleared unless IWS = 1. 6. ACCESS can be cleared. FIC can be set. UC3F array can be accessed. CENSOR[0:1] can be changed. 7. ACCESS can be cleared. FIC cannot be changed. UC3F array can be accessed. CENSOR[0:1] can be changed. 8. ACCESS can be changed. FIC can be set. UC3F array can be accessed. CENSOR[0:1] can be changed. 9. ACCESS can be changed. FIC cannot be changed. UC3F array can be accessed. CENSOR[0:1] cannot be changed unless IWS = 1. 10. ACCESS can be changed. FIC can be set. UC3F array can be accessed. CENSOR[0:1] can be changed. 11. ACCESS can be changed. FIC cannot be changed. UC3F array can be accessed. CENSOR[0:1] can be changed. The only way CENSOR[0:1] can be changed is by setting or clearing the FLASH NVM fuses. In the information censorship state, CENSOR[0:1] must be cleared to the cleared censorship state before CENSOR[0:1] can be put into the no censorship state. While clearing CENSOR[0:1] the entire UC3F array is erased. Thus the information stored in the UC3F array is made invalid while clearing CENSOR[0:1]. 21.3.11.1 Setting and Clearing Censor The value of each bit in CENSOR[0:1] is determined by the state of an NVM CAM cell. The NVM CAM cell is not writable but instead may be set or cleared. Reading CENSOR[0:1] while setting or clearing with the high voltage applied (CSC = 1 and EHV = 1) will return 0's. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-31 CDR3 Flash (UC3F) EEPROM 21.3.11.2 Setting Censor The set operation changes the state in an NVM CAM cell from a 0 to a 1. This set operation can be done without changing the contents of the UC3F array. The required sequence to set one or both of the bits in CENSOR[0:1] follows. 1. Write CSC = 1, PE = 0 and SES = 1 in the UC3FCTL register 2. Write a 1 to the CENSOR bit(s) to be set 3. Write EHV = 1 in the UC3FCTL register 4. Read the UC3FCTL register until HVS = 0 5. Read the UC3FCTL register. Confirm PEGOOD = 1 6. Write EHV = 0 in the UC3FCTL register 7. Write SES = 0 and CSC = 0 21.3.11.3 Clearing Censor The clear operation changes the state of the CENSOR[0:1] bits from a 1 to a 0 by erasing the CAM cells. This clear operation can be done only while erasing the entire UC3F array and shadow information. The required sequence to clear CENSOR follows. Clear CENSOR[0:1] 1. Write PROTECT[0:7] = 0x00 to enable the entire array for erase. If SBEN[M] = 1, then SBPROTECT[M] must also be cleared to 0. 2. Write BLOCK[0:7] = 0xFF, CSC = 1, PE = 1 and SES = 1 in the UC3FCTL register. If SBEN[M] = 1, then SBBLOCK[M] must also be set to 1. 3. Do an erase interlock write. On the UC3F module, the erase interlock write can be performed in one of two ways, depending on the value of the UC3FCFIG bit 15, IWS. If IWS = 0, a valid erase interlock write is a write to any valid array location. This is subject to any censorship conditions that might apply. If IWS = 1, a valid erase interlock write can be a write to any valid array location or a write to the UC3FCMCR register. When the IWS = 1, the CENSOR[0:1] bits can always be cleared in the UC3F flash EEPROM status states #3, #4 and #5 from Table 21-10. The erase interlock write is only valid if all blocks of the array are selected for erase and not protected. BLOCK[0:7] and SBBLOCK[0:1] set to 1, as well as PROTECT[0:7] and SBPROTECT[0:1] set to 0, are required for a valid erase interlock write during the clear censor operation. 4. Write EHV = 1 in the UC3FCTL register. MPC561/MPC563 Reference Manual, Rev. 1.2 21-32 Freescale Semiconductor CDR3 Flash (UC3F) EEPROM NOTE The values of the EPEE and B0EPEE inputs are latched with the assertion of EHV to determine the array protection state for the clear censor operation. It is assumed that the EPEE and B0EPEE inputs are setup prior to the assertion of EHV. If EPEE and B0EPEE are not enabled for erase, the CENSOR[0:1] bits may not be cleared. 5. 6. 7. 8. Read the UC3FCTL register until HVS = 0. Read the UC3FCTL register. Confirm PEGOOD = 1. Write EHV = 0 in the UC3FCTL register. Write SES = 0 and CSC = 0. 21.3.11.4 Switching The UC3F EEPROM Censorship There are three states of censorship that CENSOR[0:1] can select. These are--cleared censorship, no censorship (two states) and information censorship. These three states, state values, transitions, and state of censorship are shown in Figure 21-11. Information Censorship Data Data CENSOR[0:1] = 11 T2 Data T4 No Censorship CENSOR[0:1] = 01 Data CENSOR[0:1] = 10 T3 Data T1 Cleared Censorship Data CENSOR[0:1] = 00 T3 Data T3 Unknown Figure 21-11. Censorship States and Transitions MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 21-33 CDR3 Flash (UC3F) EEPROM CENSOR[0:1] transitions are listed as follows: 1. Cleared censorship to no censorship, T1 Set CENSOR[0] or CENSOR[1]. 2. No censorship to information censorship, T2 Set CENSOR[0] and CENSOR[1]. 3. Information censorship, no censorship or unknown to cleared censorship, T3 Clear CENSOR[0:1]. This is done only while the entire UC3F array is erased. 4. Cleared censorship to information censorship, T4 Set both CENSOR[0] and CENSOR[1]. 21.3.12 Background Debug Mode or Freeze Operation While in background debug mode, the UC3F should respond normally to accesses except that LOCK is writable. See the LOCK bit in Table 21-3. MPC561/MPC563 Reference Manual, Rev. 1.2 21-34 Freescale Semiconductor Chapter 22 CALRAM Operation The calibration static random access memory (CALRAM) module provides the MPC561/MPC563 with a general purpose memory that may be read from or written to as either bytes, half-words, or words. In addition to this, a portion of the CALRAM, called the overlay region, can be used for calibration. Calibration in this context is defined as overlaying portions of the U-bus Flash with a portion of the CALRAM array. During normal Flash access, the RISC central processing unit (RPCU) reads data from U-bus Flash (through L-bus and L2U) as shown in Figure 22-1. During calibration access, instead of Flash providing the data, the overlay regions of CALRAM provide the data to the RPCU. 22.1 Features Standard CALRAM features are listed below: * One-clock accesses -- Two-cycle access for power savings * Byte, half-word (16-bits), or word (32-bit) read/write accesses * Each 8-Kbyte block has individual protection control bits. * Low power standby operation for data retention Special overlay features are: * Eight overlay regions; each can be programmed to be 4-, 16-, 32-, 64-, 128-, 256-, or 512-bytes long * Each overlay region size can be forced to 4 bytes long * Data driven from the CALRAM module for overlay access has the same timing as the data that would have come from the U-bus Flash * Overlay is for data read from the U-bus Flash space and does not affect instruction fetches from the Flash * Overlay block is naturally aligned -- For example, 128-byte block is 128-byte aligned * Normal access to overlaid portion of CALRAM array can be made to generate an error (machine check) if so configured MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-1 CALRAM Operation 22.2 CALRAM Block Diagram JTAG Flash BBC U-BUS E-Bus USIU READI RPCU + FP L-Bus L2U Interface UIMB Interface 32-Kbytes CALRAM 28-Kbyte SRAM (Non Overlay) 4-Kbyte Overlay Figure 22-1. System Block Diagram 22.3 CALRAM Memory Map The MPC561/MPC563 chip internal memory map is shown in Figure 22-2. The CALRAM module is divided into two sections. * Control section: -- Includes all the registers in the CALRAM module * Array sub-region: -- Contains memory arrays TheMPC561/MPC563 contains one CALRAM module -- a 32-Kbyte memory at address 0x3F 8000 - 0x3F FFFF as shown in Figure 22-1 and Figure 22-2. In addition, the module is assigned 16 32-bit register address spaces: 12 implemented and four unimplemented registers. The 12 implemented registers are: one module configuration register (CRAMMCR), one register reserved for factory test, eight region base address (CRAM_RBAx) registers, one overlay configuration register (CRAMOVLCR), and one ownership trace register (CALRAM_OTR) to support a separate module called READI. Refer to Chapter 24, "READI Module." MPC561/MPC563 Reference Manual, Rev. 1.2 22-2 Freescale Semiconductor CALRAM Operation 0x00 0000 UC3F A Flash1 512 Kbytes 0x07 FFFF 0x37 FFFF 0x38 0000 0x38 003F CALRAM Registers 0x3F 6FFF 0x3F 8000 CALRAM (32 Kbytes) 0x3F FFFF 1NOTE: Available on MPC563 only Figure 22-2. MPC561/MPC563 Memory Map with CALRAM Address Ranges When the normal device power (VDD) is off, portions of the CALRAM array can be powered by separate power supply sources (IRAMSTBY) as shown in Figure 22-3, thus allowing the data to be retained. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-3 CALRAM Operation 0x3F 8000 RAM 4K A8 0x3F 9000 RAM 4K A7 0x3F A000 RAM 4K A6 0x3F B000 RAM 4K A5 0x3F C000 CALRAM IRAMSTBY (Non-Overlay Standby RAM) RAM 4K A4 0x3F D000 RAM 4K A3 0x3F E000 RAM 4K A2 0x3F F000 RAM 4K A1 IRAMSTBY (Overlay portion of Standby RAM) 0x3F FFFF Figure 22-3. Standby Power Supply Configuration for CALRAM Array 22.4 Modes of Operation The CALRAM module has the following modes of operation: * Reset * One-cycle * Two-cycle * Standby * Stop * Overlay MPC561/MPC563 Reference Manual, Rev. 1.2 22-4 Freescale Semiconductor CALRAM Operation 22.4.1 Reset Reset configures the CALRAM module and resets some of the bits in the CALRAM registers to their default reset state. Some register bits are unaffected by reset. See section Section 22.5, "Programming Model." 22.4.2 One-Cycle Mode The CALRAM registers and array may be accessed for reads or writes as byte, (aligned) half-word, or word. This mode is the default mode of operation and, as the name suggests, the access time to the array and the internal registers for reads and writes is one cycle. Thus the one-cycle mode is used for high performance although it consumes more power than the two cycle mode. 22.4.2.1 CALRAM Access/Privilege Violations Each 8-Kbyte CALRAM array can be assigned read-only, data-only, or supervisor-only privilege if data relocate (DR) bit in the MSR is set. All CALRAM registers are assigned supervisor-only and data-only privilege. A privilege violation causes an error. See section Section 22.5.1, "CALRAM Module Configuration Register (CRAMMCR)." An attempt to access any of the four unimplemented reserved registers (of the 16 register spaces) causes an error and returns 0's on the data bus for a read access. If an error condition occurs due to privilege violation or an attempt to access unimplemented portions of array or register space, then the type of the error generated depends on whether the access generating the error was initiated by the RCPU core or by a non-RCPU bus master. If the error causing access was initiated by the RCPU core, a data storage interrupt (DSI) is generated. If the access was initiated by a non-RCPU bus master, a machine check exception is generated. Also, a write access that generates an error does not corrupt the data in an array or a register. Similarly, a read access that generates an error does not drive the data on the L-bus from the array or the register, instead it drives 0's. Also, aborted accesses maintain data integrity. Aborted writes do not corrupt data in register/array, and aborted reads do not drive the requested data on L-bus. 22.4.3 Two-Cycle Mode In this mode, the CALRAM module takes two cycles to complete an access and consumes less power than in one-cycle mode. It follows the normal one-cycle mode operation except that the accesses are completed one cycle later. This mode is selected by setting the 2CY bit in the CRAMMCR register. 22.4.4 Standby Operation/Keep-Alive Power The registers and control logic for the CALRAM module are powered by VDD. The memory array is also supplied by VDD during normal operation; however, when the VDD is off, the CALRAM array is backed up by a switched source (IRAMSTBY) that is also known as standby power. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-5 CALRAM Operation 22.4.5 Stop Operation The low power stop mode for this module is entered by setting the disable bit (DIS) in the CRAMMCR register. Reads from and writes to the array during this mode will generate an error. When the disable bit (DIS) is cleared, the module returns to normal function. 22.4.6 Overlay Mode Operation For a microcontroller used as a controller for an engine (or other electromechanical device), various parameters stored in the Flash memory may need to be changed in order to properly tune (calibrate) the engine. Because Flash memory may not be readily programmed during normal operation of an embedded controller, portions of the CALRAM array can be overlayed onto the U-bus Flash memory. By allowing the CALRAM module to overlay portions of Flash memory, parameters normally stored in the Flash may be tweaked and changed with a development tool both during normal operation and prior to programming a final, more precise version of the Flash memory. The overlay is for read-only data and does not affect instruction fetches from the Flash. The data for any L-bus address which falls in the overlay region of the U-bus Flash will be driven by the CALRAM on the L-bus. The CALRAM also indicates to the L2U to block the data from the Flash to be driven onto the L-bus. As far as the RCPU core is concerned, the timing of data coming from the CALRAM appears to be the same as that from the Flash. 22.4.6.1 Overlay Mode Configuration Each CALRAM module contains eight overlay regions, each of which is 512 bytes long as shown in Figure 22-4. All overlay regions of a module are contiguous and each starts at the least significant address of the region and can increment all the way up to 512 bytes as shown in Figure 22-5. As described in section Section 22.5.2, "CALRAM Region Base Address Registers (CRAM_RBAx)", CRAM_RBAx registers allow the programming of the base addresses RBA[11:29] of the U-bus Flash regions and the RGN_SIZE[0:4] to be overlaid. Note that each region can also be individually disabled by writing 0000 to RGN_SIZE[0:3]. If the programmed base address is not naturally aligned with respect to the RGN_SIZE field, the least significant bits of the base address fields can be considered 0's in order to make the starting address naturally aligned. In an RBA register, RGN_SIZE[0:3] ={0101} select the size to be 128 bytes, and even if CRAM_RBAx [25:29] are not all 0's, they will be considered as 0's so that the address becomes 128-byte naturally aligned. MPC561/MPC563 Reference Manual, Rev. 1.2 22-6 Freescale Semiconductor CALRAM Operation 0x3F 8000 Non-Overlay Region 28 Kbytes 0x3F F000 0x3F F400 0x3F F800 0x3F FC00 0x3F FFFF Overlay 0 Overlay 2 Overlay 4 Overlay 6 Overlay 1 Overlay 3 Overlay 5 Overlay 7 Overlay Region 4-Kbyte Figure 22-4. CALRAM Array When programming the CRAM_RBAx registers, the CALRAM can be put in overlay mode by setting the OVL bit in the CALRAM overlay configuration register (CRAMOVL) as described in section Section 22.5.3, "CALRAM Overlay Configuration Register (CRAM_OVLCR)." For example, Figure 22-5 shows that overlay regions 0, 4, and 5 have their entire region of 512 bytes mapped to regions in the Flash as specified by CRAM_RBA0, CRAM_RBA4, and CRAM_RBA5. Overlay region 1 is partially mapped to a region in Flash as specified by the CRAM_RBA1. If the region size of 256 bytes is selected for overlay region 1, for example, then the enabled portion of overlay region 1 will occupy address 0x3F F200 to 0x3F F2FF. The rest of overlay region 1 from 0x3F F300 to 0x3F F3FF is available for normal (non-overlay) array access. Overlay regions 2, 3, 6, and 7 are disabled for overlay and hence can be used, in their entirety, for normal (non-overlay) array accesses. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-7 CALRAM Operation 0x3F 8000 Non-Overlay Region 28 Kbytes 0x3F F000 Overlay 0 Overlay 1 Overlay 2 Overlay 3 0x3F F800 Overlay 4 Overlay 5 0x3F FC00 0x3F FFFF Overlay 6 Overlay 7 0x3F F400 Overlay Region 4-Kbyte 0x00 0000 UC3F Flash 512 Kbytes 1-Mbyte U-Bus Flash 0x07 FFFF CALRAM Normal Array Access CALRAM Overlay Access U-Bus Flash Figure 22-5. CALRAM Module Overlay Map of Flash (CLPS = 0) Figure 22-6 illustrates the address spaces occupied by the two CALRAM modules available in MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 22-8 Freescale Semiconductor CALRAM Operation 0x3F 8000 CALRAM (28-Kbyte Non-Overlay Area) 32-Kbyte CALRAM 0x3F F000 CALRAM 4-Kbyte Overlay Area 0x3F FFFF Figure 22-6. CALRAM Address Map (CLPS = 0) If the CLPS bit in OVLCR register is set, then each of the eight region sizes is forced to be 4 bytes long as shown in Figure 22-7, regardless of the value programmed in the RGN_SIZE field. These 32 bytes occupy contiguous address space in CALRAM, for example, from 0x3F FFE0 to 0x3F FFFF. The remainder (4 Kbytes - 32 bytes) is not only available for normal array access but also contiguous with a 28-Kbyte non-overlay array. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-9 CALRAM Operation Non-Overlay Region 28 Kbytes L-Bus CALRAM Array (4 Kbytes - 32 bytes) Available For Non-Overlay Use Overlay 0 Overlay 7 Overlay Region 4-Kbyte Overlay of 32 bytes (each is 4 bytes long) U-bus Flash (Each overlay is 4 bytes long and must be 4-byte aligned) CALRAM Normal Array Access CALRAM Overlay Access U-bus Flash Figure 22-7. CALRAM Module Overlay Map of Flash (CLPS = 1) Figure 22-8 shows the overlay regions when the CLPS bit is set for CALRAM in MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 22-10 Freescale Semiconductor CALRAM Operation 0x3F 8000 CALRAM (28-Kbyte Non-Overlay Area) 0x3F F000 32-Kbyte CALRAM 4 Kbytes -- 32 bytes Available for NonOverlay Use 0x3F FFFF 32-byte Overlay Area (0x3F FFE0 -- 0x3F FFFF) Figure 22-8. CALRAM Address Map (CLPS = 1) The values programmed in the RBAx registers are unaffected by reset. See Section 22.5.2, "CALRAM Region Base Address Registers (CRAM_RBAx)" for details. On reset, it is not necessary to reprogram the RABx registers. In such cases, the calibration mode can be re-entered simply by setting the OVL bit. 22.4.6.2 Priority of Overlay Regions When the address matches to more than one enabled portion of the overlay region, the effective region is the region with the highest priority. Priority is determined by the region number; the highest priority assigned to the lowest region number. The benefit from this priority feature is that by storing the parameters in eight overlay regions, it overlays all eight regions onto the same 512-byte Flash region, and enables the overlay feature. Upon observing system performance with a set of parameters, the next set of parameters can be selected by simply disabling the highest priority region. This "observing and disabling the highest priority region" loop can continue until all regions are disabled. This allows moving from one set of parameters to another with MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-11 CALRAM Operation minimal amount of reprogramming efforts. Table 22-1. Priorities of Overlay Regions 22.4.6.3 Module/Region Number Priority CALRAM/region 0 Highest CALRAM/region 1 . CALRAM/region 2 . CALRAM/region 3 . CALRAM/region 4 . CALRAM/region 5 . CALRAM/region 6 . CALRAM/region 7 Lowest Normal (Non-Overlay) Access to Overlay Regions If overlay is enabled and CRAMOVLCR[DERR] is set, then any normal L-bus array access that falls within any of the eight enabled overlay regions generates a machine-check exception; otherwise the access terminates normally without asserting data error. The L-bus write accesses cause the data to be written regardless of whether the DERR bit is set or not. For example, if overlay region 1 is programmed such that it is enabled and its region size is 256 bytes, then any L-bus access to address in the range of 0x3F F200 - 0x3F F2FF generates machine check exception if the DERR bit is set in CRAMOVLCR register. The other portion of region 1 from 0x3F F300 to 0x3F F3FF can be used as normal (non-overlay) array. 22.4.6.4 Calibration Write Cycle Flow Write accesses to the overlaid U-bus Flash regions are ignored completely by the CALRAM module. 22.5 Programming Model The following section describes the CALRAM programmer's model. The CALRAM has one register (CRAMMCR) for configuring the CALRAM array and one register dedicated to factory test. In addition, there are eight 32-bit region base address registers for calibration purposes and a 32-bit overlay configuration register. The region base address registers hold the base address for the Flash region and region size that need to be overlaid by the CALRAM. The overlay configuration register provides three bits (OVL, DERR, and CLSP) that are needed for overlay configuration. The CALRAM ownership trace register (CRAM_OTR) is provided to support a separate module called a READI module. Access to all CALRAM registers requires the bus master to be in supervisor data mode. On a privilege violation, the register is not accessed and the access generates an error. Table 22-2 shows the register address map for the MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 22-12 Freescale Semiconductor CALRAM Operation Table 22-2. CALRAM Control Registers Address Register 0x38 0000 CRAMMCR 0x38 0004 for factory test 0x38 0008 CRAM_RBA0 0x38 000C CRAM_RBA1 0x38 0010 CRAM_RBA2 0x38 0014 CRAM_RBA3 0x38 0018 CRAM_RBA4 0x38 001C CRAM_RBA5 0x38 0020 CRAM_RBA6 0x38 0024 CRAM_RBA7 0x38 0028 CRAMOVLCR 0x38 002C CRAMOTR/READI_OTR 0x38 0030 Reserved 0x38 0034 Reserved 0x38 0038 Reserved 0x38 003C Reserved Any unimplemented bits in CALRAM registers return 0's on a read and writes to these bits are ignored. 22.5.1 CALRAM Module Configuration Register (CRAMMCR) The module configuration register (CRAMMCR) contains bits that allow the CALRAM to be configured for normal RAM accesses. MSB 0 Field LCK 1 2 DIS 2CY 3 4 5 6 7 8 9 10 11 12 13 14 15 -- 0000_0000_0000_0000 SRESET Addr 0x38 0000 LSB 16 17 Field 18 -- SRESET 19 20 21 22 23 24 25 26 27 28 29 30 31 R0 D0 S0 R1 D1 S1 R2 D2 S2 R3 D3 S3 0000_0000_0000_0000 Figure 22-9. CALRAM Module Configuration Register (CRAMMCR) A brief description of each bit is provided in Table 22-3 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-13 CALRAM Operation Table 22-3. CRAMMCR Bit Descriptions Bits Name Description 0 LCK Write protection -- This bit is designed to lock out writes to the CRAMMCR. While LCK = 0 the register can be written repeatedly without restriction. If LCK = 1, the register does not accept writes (i.e., the value of the register remains unchanged, but the cycle terminates normally.) In normal mode, this bit can only be set once and can only be cleared by reset. 0 writes to the CRAMMCR are unrestricted 1 writes to the CRAMMCR are ignored In freeze mode, only the LCK bit may be written to zero if it was previously set. 1 DIS Array disable -- When set, this bit disables the CALRAM array. In this mode, all reads and writes to the CALRAM array are ignored and a bus error is generated. The CALRAM responds to register access while DIS = 1. This is a low power mode for the module, since all internal functions will be disabled. The module can be re-enabled by writing the DIS bit back to a zero. Reset will also re-enable the module. 0 CALRAM module array access is enabled 1 CALRAM module array access is disabled 2 2CY Two cycle mode -- When set, this bit puts the CALRAM into a two cycle access mode operation for CALRAM register accesses as well as array accesses. This mode provides power savings by using the first cycle to decode any L-bus access for an address match to where the array resides. 0 CALRAM module in one-cycle operation 1 CALRAM module in two-cycle operation 3:19 -- Reserved 20 R0 Read-only/read-write privilege -- If the data relocate (DR) bit is set in Machine Status Register (MSR in RCPU) and R0 is also set, then write accesses are terminated with an error. If DR bit is 0, both reads and writes to the array block is allowed regardless of the value programmed in R0. This bit controls the highest 8-Kbyte block (lowest address) of CALRAM in the associated array. Likewise, R1, R2, and R3 control three other 8-Kbyte blocks in the same manner. See Table 22-4 for control bit address ranges. R0 = 0 and DR = 0 readable and writable (array 8-Kbyte block) R0 = 0 and DR = 1 readable and writable (array 8-Kbyte block) R0 = 1and DR = 0 readable and writable (array 8-Kbyte block) R0 = 1 and DR = 1 read only (array 8-Kbyte block) 21 D0 Data-only/data-instruction privilege (Data type assignment) -- If the data relocate (DR) bit is set in Machine Status Register (MSR) and D0 is also set, then any access attempting to fetch an instruction from the array block generates an error. If DR bit is 0, both data read and instruction fetch from the array block is allowed, regardless of the value programmed in D0. This bit controls the highest 8-Kbyte block (lowest address) of CALRAM in the associated array. Likewise, D1, D2, and D3 control three other 8-Kbyte blocks in the same manner. See Table 22-4 for control bit address ranges. D0 = 0 and DR = 0 data and/or Instruction (array 8-Kbyte block) D0 = 0 and DR = 1 data and/or Instruction (array 8-Kbyte block) D0 = 1 and DR = 0 data and/or Instruction (array 8-Kbyte block) D0 = 1 and DR = 1 data only (array 8-Kbyte block) MPC561/MPC563 Reference Manual, Rev. 1.2 22-14 Freescale Semiconductor CALRAM Operation Table 22-3. CRAMMCR Bit Descriptions (continued) Bits Name Description 22 S0 Supervisor-only/supervisor-user privilege (Space assignment) -- If the data relocate (DR) bit is set in Machine Status Register (MSR) and S0 is also set, then any access to the array block by a user program generates an error. If DR bit is 0, both user and supervisor program can access the array block, regardless of the value programmed in S0. The CALRAM array may be placed in supervisor or unrestricted space. This bit controls the highest 8-Kbyte block (lowest address) of CALRAM in the associated array. Likewise, S1, S2, and S3 control other three blocks in the same manner. See Table 22-4 for control bit address ranges. S0 = 0 and DR = 0 both user and supervisor access allowed (array 8-Kbyte block) S0 = 0 and DR = 1 both user and supervisor access allowed (array 8-Kbyte block) S0 = 1 and DR = 0 both user and supervisor access allowed (array 8-Kbyte block) S0 = 1 and DR = 1 only supervisor access allowed (array 8-Kbyte block) 23 R1 Same as R0 except for address ranges shown on Table 22-4. 24 D1 Same as D0 except for address ranges shown on Table 22-4. 25 S1 Same as S0 except for address ranges shown on Table 22-4. 26 R2 Same as R0 except for address ranges shown on Table 22-4. 27 D2 Same as D0 except for address ranges shown on Table 22-4. 28 S2 Same as S0 except for address ranges shown on Table 22-4. 29 R3 Same as R0 except for address ranges shown on Table 22-4. 30 D3 Same as D0 except for address ranges shown on Table 22-4. 31 S3 Same as S0 except for address ranges shown on Table 22-4. Table 22-4. CRAMMCR Privilege Bit Assignment for 8-Kbyte Array Blocks 22.5.2 Bit Selection Address Block (Relative) R0, D0, and S0 0xXXXX 0000 - 0xXXXX 1FFF R1, D1, and S1 0xXXXX 2000 - 0xXXXX 3FFF R2, D2, and S2 0xXXXX 4000 - 0xXXXX 5FFF R3, D3, and S3 0xXXXX 6000 - 0xXXXX 7FFF CALRAM Region Base Address Registers (CRAM_RBAx) The region base address register defines the base address of a region on the U-bus Flash memory space that will be overlaid by a portion of the CALRAM memory space and the region size. Because eight such regions in the Flash can be overlaid by the CALRAM, eight such registers (x = 0, 1, 2, 7) are provided. The CRAM_RBAx[11:29] provides the base address (starting address) of the of the U-bus Flash region to be overlaid and the CRAM_RBAx[0:3] provides size corresponding to the region. See Table 22-6 for details. The RGN_SIZE[0] is reserved and should never be programmed to a one, because the MPC563 has only 512 Kbytes of Flash, and CRAM_RBAx[11] and CRAM_RBAx[12] should never be programmed to a one. Also, note that if CRAM_OVLCR[CLPS] is set, each of the eight sizes are forced MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-15 CALRAM Operation to be four bytes, regardless of the value programmed in the RGN_SIZE[0:3] field. See Section 22.5.3, "CALRAM Overlay Configuration Register (CRAM_OVLCR)" for details. The implemented bits of CRAM_RBAx bits are unaffected by reset (hard reset). The diagram below shows one such register, CRAM_RBA0, which provides the base address of overlay region 0. MSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Field RGN_SIZE -- RBA SRESET Unaffected 0000_000 Unaffected Addr 14 15 0x38 0008-0x38 0024 LSB 16 17 18 19 20 21 Field SRESET 22 23 24 25 26 27 28 29 30 31 RBA -- Unaffected 00 Figure 22-10. CALRAM Region Base Address Register (CRAM_RBAx) Table 22-5. CRAM_RBAx Bit Descriptions Bits 0:3 1 Name Description RGN_SIZ These bits define the size of the overlay region. See Table 22-6 for sizes. E 4:10 -- 11:29 RBA 30:31 -- Reserved The region base address defines the starting address of the memory to be overlayed.1 Reserved The overlay match address will include ISB in its comparison. The overlay can only be in the range of the ISB internal space. Table 22-6. RGN_SIZE Encoding RGN_SIZE Number of Overlay Bytes 0000 Overlay block disabled 0001 Overlay block is 4 bytes 0010 Overlay block is 16 bytes 0011 Overlay block is 32 bytes 0100 Overlay block is 64 bytes 0101 Overlay block is 128 bytes 0110 Overlay block is 256 bytes 0111 Overlay block is 512 bytes 1xxx Reserved Note: The overlay size of 8 bytes cannot be selected MPC561/MPC563 Reference Manual, Rev. 1.2 22-16 Freescale Semiconductor CALRAM Operation 22.5.3 CALRAM Overlay Configuration Register (CRAM_OVLCR) MSB 0 1 2 3 4 5 6 7 8 Field OVL DERR CLPS 9 10 11 12 13 14 26 27 28 29 30 15 -- SRESET 0000_0000_0000_0000 Addr 0x38 0028 LSB 16 17 18 19 20 Field 21 22 23 24 25 31 -- SRESET 0000_0000_0000_0000 Figure 22-11. CALRAM Overlay Configuration Register (CRAM_OVLCR) Table 22-7. CRAMOVLCR Bit Descriptions Bits Name 0 OVL 1 DERR Data error 0 CALRAM module will not generate machine check exception due to normal L-bus array access to the enabled portion overlay region even if overlay is enabled 1 CALRAM module will generate machine check exception due to normal L-bus array access to the enabled portion of overlay region even if overlay is enabled 2 CLPS Collapse the total overlay region from 4 Kbytes to 32 bytes; that is, the size is forced to be four bytes for each for the eight regions regardless of the values programmed in CRAM_RBAx[0:3]; these bits are also referred to as RGN_SIZE[0:3]. 0 Overlay region of four Kbytes; region size as specified by CRAM_RBAx[0:3]. 1 Overlay region of 32 bytes; each region size is four bytes long regardless of the values in CRAM_RBAx[0:3]. 3:31 -- 22.5.4 Description Overlay enable -- When set, the CALRAM overlay mode operation is enabled. In this mode CALRAM allows eight programmable sections (four to 512 bytes) of the on-chip U-bus Flash memory module to be overlaid by sections of the CALRAM. 0 CALRAM module overlay is disabled 1 CALRAM module overlay is enabled Reserved CALRAM Ownership Trace Register (CRAM_OTR) This register is provided to support a separate module called READI. Refer to Chapter 24, "READI Module." The reads from this register will return 0's. NOTE CRAM_OTR is also defined as READI_OTR. See Section 24.6.1.1, "User-Mapped Register (OTR)." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 22-17 CALRAM Operation MSB 0 1 2 3 4 5 Field 6 7 8 9 10 11 12 13 14 26 27 28 29 30 15 Ownership Trace Register 0000_0000_0000_0000 SRESET Addr 0x38 002C LSB 16 Field SRESET 17 18 19 20 21 22 23 24 25 31 Ownership Trace Register 0000_0000_0000_0000 Figure 22-12. CALRAM Ownership Trace Register (CRAM_OTR) MPC561/MPC563 Reference Manual, Rev. 1.2 22-18 Freescale Semiconductor Chapter 23 Development Support The visibility and controllability requirements of emulators and bus analyzers are in opposition to the trend of modern microcomputers and microprocessors where many bus cycles are directed to internal resources and are not visible externally. In order to enhance the development tool visibility and controllability, some of the development support functions are implemented in silicon. These functions include program flow tracking, internal watchpoint, breakpoint generation, and emulation while in debug mode. This section covers program flow tracking support, breakpoint/watchpoint support, development system interface support (debug mode) and software monitor debugger support. These features allow efficiency in debugging systems based on the MPC561/MPC563. 23.1 Program Flow Tracking The mechanism described in this section allows tracking of program instruction flow with almost no performance degradation. The information provided may be compressed and captured externally and then parsed by a post-processing program using the microarchitecture defined below. The program instructions flow is visible on the external bus when the MPC561/MPC563 is programmed to operate in serial mode and show all fetch cycles on the external bus. This mode is selected by programming the ISCT_SER (instruction fetch show cycle control) field in the I-bus support control register (ICTRL), as shown in Table 23-26. In this mode, the processor is fetch serialized, and all internal fetch cycles appear on the external bus. Processor performance is, therefore, much lower than when working in regular mode. These features, together with the fact that most fetch cycles are performed internally (e.g., from the I-cache), increase performance but make it very difficult to provide the real program trace. In order to reconstruct a program trace, the program code and the following additional information from the MCU are needed: * A description of the last fetched instruction (stall, sequential, branch not taken, branch direct taken, branch indirect taken, exception taken) * The addresses of the targets of all indirect flow change. Indirect flow changes include all branches using the link and count registers as the target address, all exceptions, and rfi, mtmsr and mtspr (to some registers) because they may cause a context switch. * The number of instructions canceled each clock Instructions are fetched sequentially until branches (direct or indirect) or exceptions appear in the program flow or some stall in execution causes the machine not to fetch the next address. Instructions may be architecturally executed, or they may be canceled in some stage of the machine pipeline. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-1 Development Support The following sections define how this information is generated and how it should be used to reconstruct the program trace. The issue of data compression that could reduce the amount of memory needed by the debug system is also mentioned. 23.1.1 Program Trace Cycle To allow visibility of the events happening in the machine a few dedicated pins are used and a special bus cycle attribute, program trace cycle, is defined. The program trace cycle attribute is attached to all fetch cycles resulting from indirect flow changes. When program trace recording is needed, make sure these cycles are visible on the external bus. The VSYNC indication, when asserted, forces all fetch cycles marked with the program trace cycle attribute to be visible on the external bus even if their data is found in one of the internal devices. To enable the external hardware to properly synchronize with the internal activity of the CPU, the assertion and negation of VSYNC forces the machine to synchronize. The first fetch after this synchronization is marked as a program trace cycle and is visible on the external bus. For more information on the activity of the external hardware during program trace refer to Section 23.1.4, "External Hardware." In order to keep the pin count of the chip as low as possible, VSYNC is not implemented as one of the chip's external pins. It is asserted and negated using the serial interface implemented in the development port. For more information on this interface refer to Section 23.4, "Development Port." Forcing the CPU to show all fetch cycles marked with the program trace cycle attribute can be done either by asserting the VSYNC pin (as mentioned above) or by programming the fetch show cycle bits in the instruction support control register, ICTRL. For more information refer to Section 23.1.5, "Instruction Fetch Show Cycle Control." When the VSYNC indication is asserted, all fetch cycles marked with the program trace cycle attribute are made visible on the external bus. These cycles can generate regular bus cycles (address phase and data phase) when the instructions reside only in one of the external devices. Or, they can generate address-only cycles when the instructions reside in one of the internal devices (internal memory, etc.). When VSYNC is asserted, some performance degradation is expected due to the additional external bus cycles. However, since this performance degradation is expected to be very small, it is possible to program the machine to show all indirect flow changes. In this way, the machine will always perform the additional external bus cycles and maintain exactly the same behavior both when VSYNC is asserted and when it is negated. For more information refer to Section 23.6.10, "L-Bus Support Control Register 2." The status pins are divided into two groups and one special case listed in the following sections. 23.1.1.1 Instruction Queue Status Pins -- VF [0:2] Instruction queue status pins denote the type of the last fetched instruction or how many instructions were flushed from the instruction queue. These status pins are used for both functions because queue flushes only happen in clocks that there is no fetch type information to be reported. Possible instruction types are defined in Table 23-1. MPC561/MPC563 Reference Manual, Rev. 1.2 23-2 Freescale Semiconductor Development Support Table 23-1. VF Pins Instruction Encodings VF[0:2] 1 2 Instruction Type VF Next Clock Will Hold 000 None More instruction type information 001 Sequential More instruction type information 010 Branch (direct or indirect) not taken More instruction type information 011 VSYNC was asserted/negated and therefore the next instruction will be marked with the indirect change-of-flow attribute More instruction type information 100 Exception taken -- the target will be marked with the Queue flush information1 indirect change-of-flow attribute 101 Branch indirect taken, rfi, mtmsr, isync and in some Queue flush information1 cases mtspr to CMPA-F, ICTRL, ECR, or DER -- the target will be marked with the indirect change-of-flow attribute2 110 Branch direct taken Queue flush information1 111 Branch (direct or indirect) not taken Queue flush information1 Unless next clock VF=111. See below. The sequential instructions listed here affect the machine in a manner similar to indirect branch instructions. Refer to Section 23.1.3, "Sequential Instructions Marked as Indirect Branch." Table 23-2 shows VF[0:2] encodings for instruction queue flush information. Table 23-2. VF Pins Queue Flush Encodings VF[0:2] 1 23.1.1.2 Queue Flush Information 000 0 instructions flushed from instruction queue 001 1 instruction flushed from instruction queue 010 2 instructions flushed from instruction queue 011 3 instructions flushed from instruction queue 100 4 instructions flushed from instruction queue 101 5 instructions flushed from instruction queue 110 Reserved 111 Instruction type information1 Refer to Table 23-1. History Buffer Flushes Status Pins-- VFLS [0:1] The history buffer flushes status pins denote how many instructions are flushed from the history buffer this clock due to an exception.Table 23-3 shows VFLS encodings. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-3 Development Support Table 23-3. VFLS Pin Encodings VFLS[0:1] 23.1.1.3 History Buffer Flush Information 00 0 instructions flushed from history queue 01 1 instruction flushed from history queue 10 2 instructions flushed from history queue 11 Used for debug mode indication (FREEZE). Program trace external hardware should ignore this setting. Queue Flush Information Special Case There is one special case when although queue flush information is expected on the VF pins, (according to the last value on the VF pins), regular instruction type information is reported. The only instruction type information that can appear in this case is VF = 111, branch (direct or indirect) NOT taken. Since the maximum queue flushes possible is five, it is easy to identify this special case. 23.1.2 Program Trace when in Debug Mode When entering debug mode an interrupt/exception taken is reported on the VF pins, (VF = 100) and a cycle marked with the program trace cycle is made visible externally. When the CPU is in debug mode, the VF pins equal `000' and the VFLS pins equal `11'. For more information on debug mode refer to Section 23.3, "Development System Interface." If VSYNC is asserted/negated while the CPU is in debug mode, this information is reported as the first VF pins report when the CPU returns to regular mode. If VSYNC was not changed while in debug mode. the first VF pins report will be of an indirect branch taken (VF = 101), suitable for the rfi instruction that is being issued. In both cases the first instruction fetch after debug mode is marked with the program trace cycle attribute and therefore is visible externally. 23.1.3 Sequential Instructions Marked as Indirect Branch There are cases when non-branch (sequential) instructions may effect the machine in a manner similar to indirect branch instructions. These instructions include rfi, mtmsr, isync and mtspr to CMPA-F, ICTRL, ECR and DER. These instructions are marked by the CPU as indirect branch instructions (VF = 101) and the following instruction address is marked with the same program trace cycle attribute as if it were an indirect branch target. Therefore, when one of these special instructions is detected in the CPU, the address of the following instruction is visible externally. In this way the reconstructing software is able to evaluate correctly the effect of these instructions. 23.1.4 External Hardware When program trace is needed, the external hardware needs to sample the status pins (VF and VFLS) each clock cycle and the address of all cycles marked with the program trace cycle attribute. MPC561/MPC563 Reference Manual, Rev. 1.2 23-4 Freescale Semiconductor Development Support Program trace can be used in various ways. Below are two examples of how program trace can be used: * Back trace -- Back trace is useful when a record of the program trace before some event occurred is needed. An example of such an event is some system failure. In case back trace is needed the external hardware should start sampling the status pins (VF and VFLS) and the address of all cycles marked with the program trace cycle attribute immediately when reset is negated. If show cycles is programmed out of reset to show all, all cycles marked with program trace cycle attribute are visible on the external bus. VSYNC should be asserted sometime after reset and negated when the programmed event occurs. If no show is programmed for show cycles, make sure VSYNC is asserted before the Instruction show cycles programming is changed from show all. Note that in case the timing of the programmed event is unknown it is possible to use cyclic buffers. After VSYNC is negated the trace buffer will contain the program flow trace of the program executed before the programmed event occurred. * Window trace -- Window trace is useful when a record of the program trace between two events is needed. In case window trace is needed the VSYNC pin should be asserted between these two events. After the VSYNC pin is negated the trace buffer will contain information describing the program trace of the program executed between the two events. 23.1.4.1 Synchronizing the Trace Window to the CPU Internal Events The assertion/negation of VSYNC is done using the serial interface implemented in the development port. In order to synchronize the assertion/negation of VSYNC to an internal event of the CPU, it is possible to use the internal breakpoints together with debug mode. This method is available only when debug mode is enabled. For more information on debug mode refer to Section 23.3, "Development System Interface." The following is an example of steps that enable synchronization of the trace window to the CPU internal events: 1. Enter debug mode, either immediately out of reset or using the debug mode request 2. Program the hardware to break on the event that marks the start of the trace window using the control registers defined in Section 23.2, "Watchpoints and Breakpoints Support" 3. Enable debug mode entry for the programmed breakpoint in the debug enable register (DER). See Section 23.6.13, "Development Port Data Register (DPDR)") 4. Return to the regular code run (see Section 23.3.1.6, "Exiting Debug Mode") 5. The hardware generates a breakpoint when the programmed event is detected and the machine enters debug mode (see Section 23.3.1.2, "Entering Debug Mode") 6. Program the hardware to break on the event that marks the end of the trace window 7. Assert VSYNC 8. Return to the regular code run. The first report on the VF pins is a VSYNC (VF = 011). 9. The external hardware starts sampling the program trace information upon the report on the VF pins of VSYNC 10. The hardware generates a breakpoint when the programmed event is detected and the machine enters debug mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-5 Development Support 11. Negate VSYNC 12. Return to the regular code run (issue an rfi). The first report on the VF pins is a VSYNC (VF = 011) 13. The external hardware stops sampling the program trace information upon the report on the VF pins of VSYNC 23.1.4.2 Detecting the Trace Window Start Address When using back trace, latching the value of the status pins (VF and VFLS), and the address of the cycles marked as program trace cycle, should start immediately after the negation of reset. The start address is the first address in the program trace cycle buffer. When using window trace, latching the value of the status pins (VF and VFLS), and the address of the cycles marked as program trace cycle, should start immediately after the first VSYNC is reported on the VF pins. The start address of the trace window should be calculated according to first two VF pins reports. Assuming that VF1 and VF2 are the two first VF pins reports and T1 and T2 are the two addresses of the first two cycles marked with the program trace cycle attribute that were latched in the trace buffer, use the following table to calculate the trace window start address. Table 23-4. Detecting the Trace Buffer Start Point VF1 VF2 Starting point Description 011 VSYNC 001 sequential T1 VSYNC asserted followed by a sequential instruction. The start address is T1 011 VSYNC 110 branch direct taken T1 - 4 + offset (T1 - 4) 011 VSYNC 101 branch indirect taken T2 23.1.4.3 VSYNC asserted followed by a taken direct branch. The start address is the target of the direct branch VSYNC asserted followed by a taken indirect branch. The start address is the target of the indirect branch Detecting the Assertion/Negation of VSYNC Since the VF pins are used for reporting both instruction type information and queue flush information, the external hardware must take special care when trying to detect the assertion/negation of VSYNC. When VF = 011 it is a VSYNC assertion/negation report only if the previous VF pins value was one of the following values: 000, 001, or 010. 23.1.4.4 Detecting the Trace Window End Address The information on the status pins that describes the last fetched instruction and the last queue/history buffer flushes, changes every clock. Cycles marked as program trace cycle are generated on the external bus only when possible (when the SIU wins the arbitration over the external bus). Therefore, there is some delay between the information reported on the status pins that a cycle marked as program trace cycle will be performed on the external bus and the actual time that this cycle can be detected on the external bus. When VSYNC is negated (through the serial interface of the development port), the CPU delays the report of the of the assertion/negation of VSYNC on the VF pins (VF = 011) until all addresses marked with the program trace cycle attribute were visible externally. Therefore, the external hardware should stop MPC561/MPC563 Reference Manual, Rev. 1.2 23-6 Freescale Semiconductor Development Support sampling the value of the status pins (VF and VFLS), and the address of the cycles marked as program trace cycle immediately after the VSYNC report on the VF pins. The last two instructions reported on the VF pins are not always valid. Therefore at the last stage of the reconstruction software, the last two instructions should be ignored. 23.1.4.5 Compress In order to store all the information generated on the pins during program trace (five bits per clock + 30 bits per show cycle) a large memory buffer may be needed. However, since this information includes events that were canceled, compression can be very effective. External hardware can be added to eliminate all canceled instructions and report only on branches (taken and not taken), indirect flow change, and the number of sequential instructions after the last flow change. 23.1.5 Instruction Fetch Show Cycle Control Instruction fetch show cycles are controlled by the bits in the ICTRL and the state of VSYNC. The following table defines the level of fetch show cycles generated by the CPU. For information on the fetch show cycles control bits refer to Table 23-5. Table 23-5. Fetch Show Cycles Control VSYNC ISCTL Instruction Fetch Show Cycle Control Bits X 00 All fetch cycles X 01 All change of flow (direct & indirect) X 10 All indirect change of flow 0 11 No show cycles are performed 1 11 All indirect change of flow Show Cycles Generated NOTE A cycle marked with the program trace cycle attribute is generated for any change in the VSYNC state (assertion or negation). 23.2 Watchpoints and Breakpoints Support Watchpoints, when detected, are reported to the external world on dedicated pins but do not change the timing and the flow of the machine. Breakpoints, when detected, force the machine to branch to the appropriate exception handler. The RCPU supports internal watchpoints, internal breakpoints, and external breakpoints. Internal watchpoints are generated when a user programmable set of conditions are met. Internal breakpoints can be programmed to be generated either as an immediate result of the assertion of one of the internal watchpoints, or after an internal watchpoint is asserted for a user programmable times. Programming a certain internal watchpoint to generate an internal breakpoint can be done either in MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-7 Development Support software, by setting the corresponding software trap enable bit, or on the fly using the serial interface implemented in the development port to set the corresponding development port trap enable bit. External breakpoints can be generated by any of the peripherals of the system, including those found on the MPC561/MPC563 or externally, and also by an external development system. Peripherals found on the external bus use the serial interface of the development port to assert the external breakpoint. In the RCPU, as in other RISC processors, saving/restoring machine state on the stack during exception handling, is done mostly in software. When the software is in the middle of saving/restoring machine state, MSR[RI] is cleared. Exceptions that occur and that are handled by the RCPU when MSR[RI] is clear result in a non-restartable machine state. For more information refer to Section 3.13.4, "Exceptions." In general, breakpoints are recognized in the RCPU is only when MSR[RI] is set, which guarantees machine restartability after a breakpoint. In this working mode breakpoints are said to be masked. There are cases when it is desired to enable breakpoints even when MSR[RI] is clear, with the possible risk of causing a non-restartable machine state. Therefore internal breakpoints have also a programmable non-masked mode, and an external development system can also choose to assert a non-maskable external breakpoint. Watchpoints are not masked and therefore always reported on the external pins, regardless of the value of MSR[RI]. The counters, although counting watchpoints, are part of the internal breakpoints logic and therefore are not decremented when the RCPU is operating in the masked mode and MSR[RI] is clear. Figure 23-1 shows the watchpoint and breakpoint support of the RCPU. MPC561/MPC563 Reference Manual, Rev. 1.2 23-8 Freescale Semiconductor Development Support Development System OR External Peripherals Internal Peripherals Maskable Breakpoint Development Non-maskable Breakpoint Port Development Port Trap Enable Bits X X Software trap Enable Bits LCTRL2 Breakpoint to CPU (Non-masked Control Bit) MSR[RI] MSR Internal Watchpoints Logic Watchpoints Counters X bit wise AND X bit wise OR To Watchpoint Pins Figure 23-1. Watchpoint and Breakpoint Support in the CPU 23.2.1 Internal Watchpoints and Breakpoints This section describes the internal breakpoints and watchpoints support of the RCPU. For information on external breakpoints support refer to Section 23.3, "Development System Interface." Internal breakpoint and watchpoint support is based on eight comparators comparing information on instruction and load/store cycles, two counters, and two AND-OR logic structures. The comparators perform compare on the Instruction address (I-address), on the load/store address (L-address) and on the load/store data (L-data). The comparators are able to detect the following conditions: equal, not equal, greater than, less than (greater than or equal and less than or equal are easily obtained from these four conditions; for more information refer to Section 23.2.1.6, "Generating Six Compare Types"). Using the AND-OR logic structures "in range" and "out of range" detections (on address and on data) are supported. Using the counters, it is possible to program a breakpoint to be recognized after an event was detected a predefined number of times. The L-data comparators can operate on fix point data of load or store. When operating on fix point data the L-data comparators are able to perform compare on bytes, half-words and words and can treat numbers either as signed or as unsigned values. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-9 Development Support The comparators generate match events. The match events enter the instruction AND-OR logic where the instruction watchpoints and breakpoint are generated. The instruction watchpoints, when asserted, may generate the instruction breakpoint. Two of them may decrement one of the counters. If one of the instruction watchpoints expires in a counter that is counting, the instruction breakpoint is asserted. The instruction watchpoints and the load/store match events (address and data) enter the load/store AND-OR logic where the load/store watchpoints and breakpoint are generated. The load/store watchpoints, when asserted, may generate the load/store breakpoint or they may decrement one of the counters. When a counter that is counting one of the load/store watchpoints expires, the load/store breakpoint is asserted. Watchpoints progress in the machine and are reported on retirement. Internal breakpoints progress in the machine until they reach the top of the history buffer when the machine branches to the breakpoint exception routine. In order to enable the use of the breakpoint features without adding restrictions on the software, the address of the load/store cycle that generated the load/store breakpoint is not stored in the DAR (data address register), like other load/store type exceptions. In case of a load/store breakpoint, the address of the load/store cycle that generated the breakpoint is stored in an implementation-dependent register called the BAR (breakpoint address register). Key features of internal watchpoint and breakpoint support are: * Four I-address comparators (each supports equal, not equal, greater than, less than) * Two L-address comparators (each supports equal, not equal, greater than, less than) including least significant bits masking according to the size of the bus cycle for the byte and half-word working modes. Refer to Section 23.2.1.2, "Byte and Half-Word Working Modes." * Two L-data comparators (each supports equal, not equal, greater than, less than) including byte, half-word and word operating modes and four byte mask bits for each comparator. Can be used for fix point data. Match is detected only on the valid part of the data bus (according to the cycle's size and the two address least significant bits). * No internal breakpoint/watchpoint matching support for unaligned words and half-words * The L-data comparators can be programmed to treat fix point numbers as signed values or as unsigned values * Combine comparator pairs to detect in and out of range conditions (including either signed or unsigned values on the L-data) * A programmable AND-OR logic structure between the four instruction comparators results with five outputs, four instruction watchpoints and one instruction breakpoint * A programmable AND-OR logic structure between the four instruction watchpoints and the four load/store comparators results with three outputs, two load/store watchpoints and one load/store breakpoint * Five watchpoint pins, three for the instruction and two for the load/store * Two dedicated 16-bit down counters. Each can be programmed to count either an instruction watchpoint or an load/store watchpoint. Only architecturally executed events are counted, (count up is performed in case of recovery). MPC561/MPC563 Reference Manual, Rev. 1.2 23-10 Freescale Semiconductor Development Support * * * * * * * * * * * On the fly trap enable programming of the different internal breakpoints using the serial interface of the development port (refer to Section 23.4, "Development Port"). Software control is also available. Watchpoints do not change the timing of the machine Internal breakpoints and watchpoints are detected on the instruction during instruction fetch Internal breakpoints and watchpoints are detected on the load/store during load/store bus cycles Both instruction and load/store breakpoints and watchpoints are handled and reported on retirement. Breakpoints and watchpoints on recovered instructions (as a result of exceptions, interrupts or miss prediction) are not reported and do not change the timing of the machine. Instructions with instruction breakpoints are not executed. The machine branches to the breakpoint exception routine BEFORE it executes the instruction. Instructions with load/store breakpoints are executed. The machine branches to the breakpoint exception routine AFTER it executes the instruction. The address of the access is placed in the BAR (breakpoint address register). Load/store multiple and string instructions with load/store breakpoints first finish execution (all of it) and then the machine branches to the breakpoint exception routine. Load/store data compare is done on the load/store, AFTER swap in store accesses and BEFORE swap in load accesses (as the data appears on the bus). Internal breakpoints may operate either in masked mode or in non-masked mode. Both "go to x" and "continue" working modes are supported for the instruction breakpoints. 23.2.1.1 Restrictions There are cases when the same watchpoint can be detected more than once during the execution of a single instruction, e.g. a load/store watchpoint is detected on more than one transfer when executing a load/store multiple/string or a load/store watchpoint is detected on more than one byte when working in byte mode. In all these cases only one watchpoint of the same type is reported for a single instruction. Similarly, only one watchpoint of the same type can be counted in the counters for a single instruction. Because watchpoint events are reported upon the retirement of the instruction that caused the event, and more than one instruction can retire from the machine in one clock, consequent events may be reported in the same clock. Moreover the same event, if detected on more than one instruction (e.g., tight loops, range detection), in some cases will be reported only once. Note that the internal counters count correctly in these cases. Do not put a breakpoint on an mtspr instruction that accesses the ICTRL register when ICTRL[IFM] = 1 because this causes unpredictable behavior. 23.2.1.2 Byte and Half-Word Working Modes The CPU watchpoints and breakpoints support enables detection of matches on bytes and half-words even when accessed using a load/store instruction of larger data widths, for example when loading a table of bytes using a series of load word instructions. In order to use this feature, program the byte mask for each of the L-data comparators and to write the needed match value to the correct half-word of the data MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-11 Development Support comparator when working in half-word mode and to the correct bytes of the data comparator when working in byte mode. Since bytes and half-words can be accessed using a larger data width instruction, it is impossible to predict the exact value of the L-address lines when the requested byte/half-word is accessed, (e.g., if the matched byte is byte two of the word and it is accessed using a load word instruction), the L-address value will be of the word (byte zero). Therefore, the CPU masks the two least-significant bits of the L-address comparators whenever a word access is performed and the least-significant bit whenever a half-word access is performed. Address range is supported only when aligned according to the access size. (See Section 23.2.1.3, "Examples"). 23.2.1.3 * * Examples A fully supported scenario: -- Looking for: Data size: Byte Address: 0x00000003 Data value: greater than 0x07 and less than 0x0c -- Programming options: One L-address comparator = 0x00000003 and program for equal One L-data comparator = 0x00000007 and program for greater than One L-data comparator = 0x0000000c and program for less than Both byte masks = 0xe Both L-data comparators program to byte mode -- Result: The event will be correctly detected regardless of the load/store instruction the compiler chooses for this access A fully supported scenario: -- Looking for: Data size: half-word Address: greater than 0x00000000 and less than 0x0000000c Data value: greater than 0x4e204e20 and less than 0x9c409c40 -- Programming option: One L-address comparator = 0x00000000 and program for greater than One L-address comparator = 0x0000000c and program for less than One L-data comparator = 0x4e204e20 and program for greater than One L-data comparator = 0x9c409c40 and program for less than Both byte masks = 0x0 Both L-data comparators program to half-word mode -- Result: The event will be correctly detected as long as the compiler does not use a load/store instruction with data size of byte. MPC561/MPC563 Reference Manual, Rev. 1.2 23-12 Freescale Semiconductor Development Support * A partially supported scenario: -- Looking for: Data size: half-word Address: greater than or equal 0x00000002 and less than 0x0000000e Data value: greater than 0x4e204e20 and less than 0x9c409c40 -- Programming option: One L-address comparator = 0x00000001 and program for greater than One L-address comparator = 0x0000000e and program for less than One L-data comparator = 0x4e204e20 and program for greater than One L-data comparator = 0x9c409c40 and program for less than Both byte masks = 0x0 Both L-data comparators program to half-word mode or to word mode -- Result: The event will be correctly detected if the compiler chooses a load/store instruction with data size of half-word. If the compiler chooses load/store instructions with data size greater than half-word (word, multiple), there might be some false detections. These can be ignored only by the software that handles the breakpoints. The following figure illustrates this partially supported scenario. Possible false detect on these half-words when using word/multiple 0x0000_0000 0x0000_0004 0x0000_0008 0x0000_000C 0x0000_0010 Figure 23-2. Partially Supported Watchpoint/Breakpoint Example 23.2.1.4 Context Dependent Filter The CPU can be programmed to either recognize internal breakpoints only when the recoverable interrupt bit in the MSR is set (masked mode) or it can be programmed to always recognize internal breakpoints (non-masked mode). When the CPU is programmed to recognize internal breakpoints only when MSR[RI] = 1, it is possible to debug all parts of the code except when the machine status save/restore registers (SRR0 and SRR1), DAR (data address register) and DSISR (data storage interrupt status register) are busy and, therefore, MSR[RI] = 0, (in the prologues and epilogues of interrupt/exception handlers). When the CPU is programmed always to recognize internal breakpoints, it is possible to debug all parts of the code. However, if an internal breakpoint is recognized when MSR[RI] = 0 (SRR0 and SRR1 are busy), the machine enters into a non-restartable state. For more information refer to Section 3.13.4, "Exceptions." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-13 Development Support When working in the masked mode, all internal breakpoints detected when MSR[RI] = 0 are lost. Watchpoints detected in this case are not counted by the debug counters. Watchpoints detected are always reported on the external pins, regardless of the value of MSR[RI]. Out of reset, the CPU is in masked mode. Programming the CPU to be in non-masked mode is done by setting the BRKNOMSK bit in the LCTRL2 register. Refer to Section 23.6.10, "L-Bus Support Control Register 2." The BRKNOMSK bit controls all internal breakpoints (I-breakpoints and L-breakpoints). 23.2.1.5 Ignore First Match In order to facilitate the debugger utilities "continue" and "go from x", the ignore first match option is supported for instruction breakpoints. When an instruction breakpoint is first enabled (as a result of the first write to the instruction support control register or as a result of the assertion of MSR[RI] when operating in the masked mode), the first instruction will not cause an instruction breakpoint if the ignore first match (IFM) bit in the instruction support control register (ICTRL) is set (used for "continue"). When the IFM bit is clear, every matched instruction can cause an instruction breakpoint (used for "go from x"). This bit is set by the software and cleared by the hardware after the first instruction breakpoint match is ignored. Load/store breakpoints and all counter generated breakpoints (instruction and load/store) are not affected by this mode. 23.2.1.6 Generating Six Compare Types Using the four compare types mentioned above (equal, not equal, greater than, less than) it is possible to generate also two more compare types: greater than or equal and less than or equal. * Generating the greater than or equal compare type can be done by using the greater than compare type and programming the comparator to the needed value minus 1. * Generating the less than or equal compare type can be done by using the less than compare type and programming the comparator to the needed value plus 1. This method does not work for the following boundary cases: * Less than or equal of the largest unsigned number (1111...1) * Greater than or equal of the smallest unsigned number (0000...0) * Less than or equal of the maximum positive number when in signed mode (0111...1) * Greater than or equal of the maximum negative number when in signed mode (1000...) These boundary cases need no special support because they all mean `always true' and can be programmed using the ignore option of the load/store watchpoint programming (refer to Section 23.2, "Watchpoints and Breakpoints Support"). 23.2.2 Instruction Support There are four instruction address comparators A,B,C, and D. Each is 30 bits long, generating two output signals: equal and less than. These signals are used to generate one of the following four events: equal, not equal, greater than, less than. MPC561/MPC563 Reference Manual, Rev. 1.2 23-14 Freescale Semiconductor Development Support The instruction watchpoints and breakpoint are generated using these events and according to user programming. Note that using the OR option enables "out of range" detect. Table 23-6. Instruction Watchpoints Programming Options Name Description Programming Options IWP0 First instruction watchpoint Comparator A Comparators (A&B) IWP1 Second instruction watchpoint Comparator B Comparator (A | B) IWP2 Third instruction watchpoint Comparator C Comparators (C&D) IWP3 Fourth instruction watchpoint Comparator D Comparator (C | D) Compare Type Control Bits Comparator A eq lt Compare Type Logic Comparator B lt Comparator C eq lt Compare Type Logic I-Watchpoint 0 A Compare Type Logic B I-Watchpoint 1 (A & B) Events Generator eq (A | B) C D AND-OR Logic (C & D) I-Watchpoint 2 I-Watchpoint 3 (C | D) I-Breakpoint Comparator D eq lt Compare Type Logic Figure 23-3. Instruction Support General Structure MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-15 Development Support 23.2.2.1 Load/Store Support There are two load/store address comparators E, and F. Each compares the 32 address bits and the cycle's attributes (read/write). The two least-significant bits are masked (ignored) whenever a word is accessed and the least-significant bit is masked whenever a half-word is accessed. (For more information refer to Section 23.2.1.2, "Byte and Half-Word Working Modes"). Each comparator generates two output signals: equal and less than. These signals are used to generate one of the following four events (one from each comparator): equal, not equal, greater than, less than. There are two load/store data comparators (comparators G,H) each is 32 bits wide and can be programmed to treat numbers either as signed values or as unsigned values. Each data comparator operates as four independent byte comparators. Each byte comparator has a mask bit and generates two output signals: equal and less than, if the mask bit is not set. Therefore, each 32 bit comparator has eight output signals. These signals are used to generate the "equal and less than" signals according to the compare size programmed (byte, half-word, word). When operating in byte mode all signals are significant, when operating in half-word mode only four signals from each 32 bit comparator are significant. When operating in word mode only two signals from each 32 bit comparator are significant. From the new "equal and less than" signals and according to the compare type programmed one of the following four match events are generated: equal, not equal, greater than, less than. Therefore, from the two 32-bit comparators eight match indications are generated: Gmatch[0:3], Hmatch[0:3]. According to the lower bits of the address and the size of the cycle, only match indications that were detected on bytes that have valid information are validated, the rest are negated. Note that if the cycle executed has a smaller size than the compare size (e.g., a byte access when the compare size is word or half-word) no match indication will be asserted. Using the match indication signals four load/store data events are generated in the following way. Table 23-7. Load/Store Data Events Event Function1 Event Name 1 G (Gmatch0 | Gmatch1 | Gmatch2 | Gmatch3) H (Hmatch0 | Hmatch1 | Hmatch2 | Hmatch3) (G&H) ((Gmatch0 & Hmatch0) | (Gmatch1 & Hmatch1) | (Gmatch2 & Hmatch2) | (Gmatch3 & Hmatch3)) (G | H) ((Gmatch0 | Hmatch0) | (Gmatch1 | Hmatch1) | (Gmatch2 | Hmatch2) | (Gmatch3 | Hmatch3)) `&' denotes a logical AND, `|' denotes a logical OR The four load/store data events together with the match events of the load/store address comparators and the instruction watchpoints are used to generate the load/store watchpoints and breakpoint according to the programming. MPC561/MPC563 Reference Manual, Rev. 1.2 23-16 Freescale Semiconductor Development Support Table 23-8. Load/Store Watchpoints Programming Options Name Description LWP0 First Load/store watchpoint LWP1 Second Load/store watchpoint Instruction Events Programming Options L-address Events Programming Options L-data Events Programming Options IWP0, IWP1, IWP2, IWP3, ignore instruction events Comparator E Comparator F Comparators (E&F) Comparators (E | F) ignore L-addr events Comparator G Comparator H Comparators (G&H) Comparators (G | H) ignore L-data events IWP0, IWP1, IWP2, IWP3, ignore instruction events Comparator E Comparator F Comparators (E&F) Comparators (E | F) ignore I-addr events Comparator G Comparator H Comparators (G&H) Comparators (G | H) ignore L-data events Note that when programming the load/store watchpoints to ignore L-addr events and L-data events, it does not reduce the load/store watchpoints detection logic to be instruction watchpoint detection logic since the instruction must be a load/store instruction for the load/store watchpoint event to trigger. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-17 Type Logic AND-OR Logic Compare Type (G&H) H lt eq lt eq lt lt eq lt eq lt lt Byte 0 Byte 1 Byte 2 Byte 3 Byte Mask lt eq eq Comparator H lt lt eq Size Logic lt eq Comparator G eq lt eq Compare Type Logic eq Compare Type Logic Size Logic Compare Size Byte Mask Byte Qualifier Logic lt eq eq Compare Type Byte Qualifier Logic lt eq Valid 3 Valid 2 Valid 1 Valid 0 lt eq add(30:31) Events Generator lt eq Data Cycle Size Compare Size (G | H) Instruction Watchpoints G lt Comparator E eq Events Generator (E | F) (E&F) F E L-breakpoint Control bits L-watchpoint 1 Type Logic lt Comparator F eq L-watchpoint 0 Development Support Byte 0 Byte 1 Byte 2 Byte 3 Figure 23-4. Load/Store Support General Structure MPC561/MPC563 Reference Manual, Rev. 1.2 23-18 Freescale Semiconductor Development Support 23.2.3 Watchpoint Counters There are two 16-bit watchpoint counters. Each counter is able to count one of the instruction watchpoints or one of the load/store watchpoints. Both generate the corresponding breakpoint when they reach ZERO. When working in the masked mode, the counters do not count watchpoints detected when MSR[RI] = 0. See Section 23.2.1.4, "Context Dependent Filter." The counters value when counting watchpoints programmed on the actual instructions that alter the counters, are not predictable. Reading values from the counters when they are active, must be synchronized by inserting a sync instruction before the actual read is performed. NOTE When programmed to count instruction watchpoints, the last instruction which decrements the counter to ZERO is treated like any other instruction breakpoint in the sense that it is not executed and the machine branches to the breakpoint exception routine BEFORE it executes this instruction. As a side effect of this behavior, the value of the counter inside the breakpoint exception routine equals ONE and not ZERO as might be expected. When programmed to count load/store watchpoints, the last instruction which decrements the counter to ZERO is treated like any other load/store breakpoint in the sense that it is executed and the machine branches to the breakpoint exception routine AFTER it executes this instruction. Therefore, the value of the counter inside the breakpoint exception routine equals ZERO. 23.2.3.1 Trap Enable Programming The trap enable bits can be programmed by regular software (only if MSR[PR] = 0) using the mtspr instruction or "on the fly" using the special development port interface. For more information refer to section Section 23.4.6.5, "Development Port Serial Communications -- Trap Enable Mode." The value used by the breakpoints generation logic is the bit wise OR of the software trap enable bits, (the bits written using the mtspr) and the development port trap enable bits (the bits serially shifted using the development port). All bits, the software trap enable bits and the development port trap enable bits, can be read from ICTRL and the LCTRL2 using mfspr. For the exact bits placement refer to Section 23.6.10, "L-Bus Support Control Register 2" and to Section 23.6.10, "L-Bus Support Control Register 2." 23.3 Development System Interface When debugging an existing system, it is sometimes desirable to be able to do so without the need to insert any changes in the existing system. In some cases it is not desired, or even impossible, to add load to the lines connected to the existing system. The development system interface of the CPU supports such a configuration. The development system interface of the CPU uses a dedicated serial port (the development port) and, therefore, does not need any of the regular system interfaces. Controlling the activity of the system from the development port is done when the CPU is in the debug mode. The development port is a relatively MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-19 Development Support economical interface (three pins) that allows the development system to operate in a lower frequency than the frequency of the CPU. Note that it is also possible to debug the CPU using monitor debugger software, for more information refer to Section 23.5, "Software Monitor Debugger Support." Debug mode is a state where the CPU fetches all instructions from the development port. In addition, when in debug mode, data can be read from the development port and written to the development port. This allows memory and registers to be read and modified by a development tool (emulator) connected to the development port. For protection purposes, two possible working modes are defined: debug mode enable and debug mode disable. These working modes are selected only during reset. For more information refer to Section 23.3.1.1, "Debug Mode Enable vs. Debug Mode Disable." The user can work in debug mode starting from reset or the CPU can be programmed to enter debug mode as a result of a predefined list of events. These events include all possible interrupts and exceptions in the CPU system, including the internal breakpoints, together with two levels of development port requests (masked and non-masked) and one peripheral breakpoint request that can be generated by any one of the peripherals of the system (including internal and external modules). Each event can be programmed either to be treated as a regular interrupt that causes the machine to branch to its interrupt vector, or to be treated as a special interrupt that causes debug mode entry. When in debug mode an rfi instruction will return the machine to its regular work mode. The debugger tool should issue an isync instruction to the debug port prior to any other instructions when the CPU enters debug mode after running code. The relationship between the debug mode logic to the rest of the CPU chip is shown in Figure 23-5. MPC561/MPC563 Reference Manual, Rev. 1.2 23-20 Freescale Semiconductor Development Support SIU/ EBI CPU Core ECR 32 DER Internal Bus 32 VFLS, FRZ Development Port Control Logic 9 DPIR DPDR TECR BKPT, TE, VSYNC EXT BUS Development Port Support Logic 35 DSCK Development Port Shift Register DSDI DSDO Figure 23-5. Functional Diagram of MPC561/MPC563 Debug Mode Support The development port provides a full duplex serial interface for communications between the internal development support logic of the CPU and an external development tool. The development port can operate in two working modes: the trap enable mode and the debug mode. The trap enable mode is used in order to shift into the CPU internal development support logic the following control signals: 1. Instruction trap enable bits, used for on the fly programming of the instruction breakpoint 2. Load/store trap enable bits, used for on the fly programming of the load/store breakpoint 3. Non-maskable breakpoint, used to assert the non-maskable external breakpoint 4. Maskable breakpoint, used to assert the maskable external breakpoint 5. VSYNC, used to assert and negate VSYNC In debug mode the development port controls also the debug mode features of the CPU. For more information Section 23.4, "Development Port." 23.3.1 Debug Mode Support The debug mode of the CPU provides the development system with the following basic functions: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-21 Development Support * * * * * * * * * Gives an ability to control the execution of the processor and maintain control on it under all circumstances. The development port is able to force the CPU to enter to the debug mode even when external interrupts are disabled. It is possible to enter debug mode immediately out of reset thus allowing debugging of a ROM-less system. It is possible to selectively define, using an enable register, the events that will cause the machine to enter into the debug mode. When in debug mode detect the reason upon which the machine entered debug mode by reading a cause register. Entering into the debug mode in all regular cases is restartable in the sense that it is possible to continue to run the regular program from the location where it entered the debug mode. When in debug mode all instructions are fetched from the development port but load/store accesses are performed on the real system memory. Data Register of the development port is accessed using mtspr and mfspr instructions via special load/store cycles. (This feature together with the last one enables easy memory dump & load). Upon entering debug mode, the processor gets into the privileged state (MSR[PR] = 0). This allows execution of any instruction, and access to any storage location. An OR signal of all exception cause register (ECR) bits (ECR_OR) enables the development port to detect pending events while already in debug mode. An example is the ability of the development port to detect a debug mode access to a non existing memory space. Figure 23-6 illustrates the debug mode logic implemented in the CPU. MPC561/MPC563 Reference Manual, Rev. 1.2 23-22 Freescale Semiconductor Development Support 5 Decoder Event . . . . . . . . . . . .. . . . 0 32 32 0 Debug Enable Register Exception Cause Register (DER) (ECR) . . . . . . . . . . . .. . . . Event valid . . . . . . . . . . . .. . . . rfi Reset Set Freeze Q ECR_OR Debug Mode Enable Internal Debug Mode Signal Figure 23-6. Debug Mode Logic 23.3.1.1 Debug Mode Enable vs. Debug Mode Disable For protection purposes two possible working modes are defined: debug mode enable and debug mode disable. These working modes are selected only during reset. See Figure 23-7 for BDM mode selection. Debug mode is enabled by asserting DSCK during reset. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-23 Development Support The debug interface is enabled by: * holding JCOMP/RSTI low while HRESET is asserted and then entering BDM (DSCK=high at HRESET negation) or * configuring READI to be disabled (EVTI=high at RSTI negation) and then entering BDM (DSCK=high at HRESET negation) The state of this pin is sampled three clocks before the negation of SRESET. NOTE Because SRESET negation is done by an external pull up resistor any reference here to SRESET negation time refers to the time the MPC561/MPC563 releases SRESET. If the actual negation is slow due to a large resistor, set up time for the debug port signals should be set accordingly. If the DSCK pin is sampled negated, debug mode is disabled until a subsequent reset when the DSCK pin is sampled in the asserted state. When debug mode is disabled the internal watchpoint/breakpoint hardware will still be operational and may be used by a software monitor program for debugging purposes. When debug mode is disabled, all development support registers (see list in Table 23-14) are accessible to the supervisor code (MSR[PR] = 0) and can be used by a monitor debugger software. However, the processor never enters debug mode and, therefore, the exception cause register (ECR) and the debug enable register (DER) are used only for asserting and negating the freeze signal. For more information on the software monitor debugger support refer to Section 23.5, "Software Monitor Debugger Support." When debug mode is enabled, all development support registers are accessible only when the CPU is in debug mode. Therefore, even supervisor code that may be still under debug cannot prevent the CPU from entering debug mode. The development system has full control of all development support features of the CPU through the development port. Refer to Table 23-16. PORESET (Low) JCOMP/RSTI Configuration T JTAG disabled READI Disabled/ BDM can be enabled/entered Figure 23-7. BDM Mode Selection 23.3.1.2 Entering Debug Mode Entering debug mode can be a result of a number of events. All events have a programmable enable bit to selectively decide which events result in debug mode entry and which in regular interrupt handling. MPC561/MPC563 Reference Manual, Rev. 1.2 23-24 Freescale Semiconductor Development Support Entering debug mode is also possible immediately out of reset, thus allowing the debugging of even a ROM-less system. Using this feature is possible by special programming of the development port during reset. If the DSCK pin continues to be asserted following SRESET negation (after enabling debug mode) the processor will take a breakpoint exception and go directly to debug mode instead of fetching the reset vector. To avoid entering debug mode following reset, the DSCK pin must be negated no later than seven clock cycles after SRESET negates. In this case, the processor will jump to the reset vector and begin normal execution. When entering debug mode immediately after reset, bit 31 (development port interrupt) of the exception cause register (ECR) is set. CLK OUT 0 1 2 3 4 5 8 9 10 11 12 13 14 15 16 17 SRESET DSCK DSCK asserts high while SRESET is asserted to enable debug mode operation. DSCK asserts high following SRESET negation to enable debug mode immediately. Figure 23-8. Debug Mode Reset Configuration When debug mode is disabled all events result in regular interrupt handling. The internal freeze signal is asserted whenever an enabled event occurs, regardless if debug mode is enabled or disabled. The internal freeze signal is connected to all relevant internal modules. These modules can be programmed to stop all operations in response to the assertion of the freeze signal. Refer to Section 23.5.1, "Freeze Indication." The freeze indication is negated when exiting debug mode. Refer to Section 23.3.1.6, "Exiting Debug Mode." The following list contains the events that can cause the CPU to enter debug mode. Each event results in debug mode entry if debug mode is enabled and the corresponding enable bit is set. The reset values of the enable bits allow, in most cases, the use of the debug mode features without the need to program the debug enable register (DER). For more information refer to Section 23.6.13, "Development Port Data Register (DPDR)." * NMI exception as a result of the assertion of the IRQ0_B pin. For more information refer to Section 3.15.4.1, "System Reset Exception and NMI (0x0100)." * Check stop. Refer to Section 23.3.1.3, "Check Stop State and Debug Mode," for more information. * Machine check exception * Implementation specific instruction protection error MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-25 Development Support * * * * * * * * * * * * * * Implementation specific data protection error External interrupt, recognized when MSR[EE] = 1 Alignment interrupt Program interrupt Floating point unavailable exception Floating point assist exception Decrementer exception, recognized when MSR[EE] = 1 System call exception Trace, asserted when in single trace mode or when in branch trace mode (refer to Section 3.15.4.11, "Trace Exception (0x0D00)") Implementation dependent software emulation exception Instruction breakpoint, when breakpoints are masked (BRKNOMSK bit in the LCTRL2 is clear) recognized only when MSR[RI] = 1, when breakpoints are not masked (BRKNOMSK bit in the LCTRL2 is set) always recognized Load/store breakpoint, when breakpoints are masked (BRKNOMSK bit in the LCTRL2 is cleared) recognized only when MSR[RI] = 1, when breakpoints are not masked (BRKNOMSK bit in the LCTRL2 is set) always recognized Peripherals breakpoint, from the development port, internal and external modules. are recognized only when MSR[RI] = 1. Development port non-maskable interrupt, as a result of a debug station request. Useful in some catastrophic events like an endless loop when MSR[RI] = 0. As a result of this event the machine may enter a non-restartable state, for more information refer to Section 3.13.4, "Exceptions." The processor enters into the debug mode state when at least one of the bits in the exception cause register (ECR) is set, the corresponding bit in the debug enable register (DER) is enabled and debug mode is enabled. When debug mode is enabled and an enabled event occurs, the processor waits until its pipeline is empty and then starts fetching the next instructions from the development port. For information on the exact value of machine status save/restore registers (SRR0 and SRR1) refer to Section 3.13.4, "Exceptions." When the processor is in debug mode the freeze indication is asserted thus allowing any peripheral that is programmed to do so to stop. The fact that the CPU is in debug mode is also broadcast to the external world using the value b11 on the VFLS pins. NOTE The freeze signal can be asserted by software when debug mode is disabled. The development port should read the value of the exception cause register (ECR) in order to get the cause of the debug mode entry. Reading the exception cause register (ECR) clears all its bits. 23.3.1.3 Check Stop State and Debug Mode The CPU enters the check stop state if the machine check interrupt is disabled (MSR[ME] = 0) and a machine check interrupt is detected. However, if a machine check interrupt is detected when MSR[ME] = MPC561/MPC563 Reference Manual, Rev. 1.2 23-26 Freescale Semiconductor Development Support 0, debug mode is enabled and the check stop enable bit in the debug enable register (DER) is set, the CPU enters debug mode rather then the check stop state. The different actions taken by the CPU when a machine check interrupt is detected are shown in the following table. Table 23-9. Check Stop State and Debug Mode 1 2 MSR[ME] Debug Mode Enable CHSTPE1 MCIE2 0 0 X X Enter the check stop state 0x2000_0000 1 0 X X Branch to the machine check interrupt 0x1000_0000 0 1 0 X Enter the check stop state 0x2000_0000 0 1 1 X Enter Debug Mode 0x2000_0000 1 1 X 0 Branch to the machine check interrupt 0x1000_0000 1 1 X 1 Enter Debug Mode 0x1000_0000 Action Performed by the CPU when Detecting a Machine Check Interrupt Exception Cause Register (ECR) Value Check stop enable bit in the debug enable register (DER) Machine check interrupt enable bit in the debug enable register (DER) 23.3.1.4 Saving Machine State upon Entering Debug Mode If entering debug mode was as a result of any load/store type exception, and therefore the DAR (data address register) and DSISR (data storage interrupt status register) have some significant value, these two registers must be saved before any other operation is performed. Failing to save these registers may result in loss of their value in case of another load/store type exception inside the development software. Since exceptions are treated differently when in debug mode (refer to Section 23.3.1.5, "Running in Debug Mode"), there is no need to save machine status save/restore zero register (SRR0) and machine status save/restore one register (SRR1). 23.3.1.5 Running in Debug Mode When running in debug mode all fetch cycles access the development port regardless of the actual address of the cycle. All load/store cycles access the real memory system according to the cycle's address. The data register of the development port is mapped as a special control register therefore it is accessed using mtspr and mfspr instructions via special load/store cycles (refer to Section 23.6.13, "Development Port Data Register (DPDR)"). Exceptions are treated differently when running in debug mode. When already in debug mode, upon recognition of an exception, the exception cause register (ECR) is updated according to the event that caused the exception, a special error indication (ecr_or) is asserted for one clock cycle to report to the development port that an exception occurred and execution continues in debug mode without any change in SRR0 and SRR1. ECR_OR is asserted before the next fetch occurs to allow the development system to detect the excepting instruction. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-27 Development Support Not all exceptions are recognized when in debug mode. Breakpoints and watchpoints are not generated by the hardware when in debug mode (regardless of the value of MSR[RI]). Upon entering debug mode MSR[EE] is cleared by the hardware thus forcing the hardware to ignore external and decrementer interrupts. WARNING Setting the MSR[EE] bit while in debug mode, (by the debug software), is strictly forbidden. The reason for this restriction is that the external interrupt event is a level signal, and since the CPU only reports exceptions while in debug mode but do not treat them, the CPU does not clear the MSR[EE] bit and, therefore, this event, if enabled, is recognized again every clock cycle. When the ecr_or signal is asserted the development station should investigate the exception cause register (ECR) in order to find out the event that caused the exception. Since the values in SRR0 and SRR1 do not change if an exception is recognized while already in debug mode, they only change once when entering debug mode, saving them when entering debug mode is not necessary. 23.3.1.6 Exiting Debug Mode The rfi instruction is used to exit from debug mode in order to return to the normal processor operation and to negate the freeze indication. The development system may monitor the freeze status to make sure the MPC561/MPC563 is out of debug mode. It is the responsibility of the software to read the exception cause register (ECR) before performing the rfi. Failing to do so will force the CPU to immediately re-enter to debug mode and to re-assert the freeze indication in case an asserted bit in the interrupt cause register (ECR) has a corresponding enable bit set in the debug enable register (DER). 23.4 Development Port The development port provides a full duplex serial interface for communications between the internal development support logic including debug mode and an external development tool. The relationship of the development support logic to the rest of the CPU chip is shown in Figure 23-5. The development port support logic is shown as a separate block for clarity. It is implemented as part of the SIU module. 23.4.1 Development Port Pins The following development port pin functions are provided: 1. Development serial clock (DSCK) 2. Development serial data in (DSDI) 3. Development serial data out (DSDO) MPC561/MPC563 Reference Manual, Rev. 1.2 23-28 Freescale Semiconductor Development Support 23.4.2 Development Serial Clock The development serial clock (DSCK) is used to shift data into and out of the development port shift register. At the same time, the new most significant bit of the shift register is presented at the DSDO pin. In all further discussions references to the DSCK signal imply the internal synchronized value of the clock. The DSCK input must be driven either high or low at all times and not allowed to float. A typical target environment would pull this input low with a resistor. The clock may be implemented as a free running clock or as gated clock. As discussed in section Section 23.4.6.5, "Development Port Serial Communications -- Trap Enable Mode" and section Section 23.4.6.8, "Development Port Serial Communications -- Debug Mode," the shifting of data is controlled by ready and start signals so the clock does not need to be gated with the serial transmissions. The DSCK pin is also used at reset to enable debug mode and immediately following reset to optionally cause immediate entry into debug mode following reset. 23.4.3 Development Serial Data In Data to be transferred into the development port shift register is presented at the development serial data in (DSDI) pin by external logic. To be sure that the correct value is used internally. When driven asynchronous (synchronous) with the system clock, the data presented to DSDI must be stable a setup time before the rising edge of DSCK (CLKOUT) and a hold time after the rising edge of DSCK (CLKOUT). The DSDI pin is also used at reset to control the overall chip configuration mode and to determine the development port clock mode. See section Section 23.4.6.4, "Development Port Serial Communications -- Clock Mode Selection" for more information. 23.4.4 Development Serial Data Out The debug mode logic shifts data out of the development port shift register using the development serial data out (DSDO) pin. All transitions on DSDO are synchronous with DSCK or CLKOUT depending on the clock mode. Data will be valid a setup time before the rising edge of the clock and will remain valid a hold time after the rising edge of the clock. Refer to Table 23-12 for DSDO data meaning. 23.4.5 Freeze Signal The freeze indication means that the processor is in debug mode (i.e., normal processor execution of user code is frozen). On the MPC561/MPC563, the freeze state can be indicated by three different pins. The FRZ signal is generated synchronously with the system clock. This indication may be used to halt any off-chip device while in debug mode as well as a handshake means between the debug tool and the debug port. The internal freeze status can also be monitored through status in the data shifted out of the debug port. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-29 Development Support 23.4.5.1 SGPIO6/FRZ/PTR Signal The SGPIOC6/FRZ/PTR signal powers up as the PTR function and its function is controlled by the GPC bits in the SIUMCR. 23.4.5.2 IWP[0:1]/VFLS[0:1] Signals The power-up state of IWP[0:1]/VFLS[0:1] is controlled by setting the SIUMCR[DBGC]; see Table 6-8. They can also be set via the reset configuration word (See Section 7.5.2, "Hard Reset Configuration Word (RCW)"). The FRZ state is indicated by the value 0b11 on the VFLS[0:1] signals. 23.4.5.3 VFLS[0:1]/MPIO32B[3:4] Signals The VFLS[0:1]/MPIO32B[3:4] signals power up as the MPIO32B[3:4] function and their function can be changed via the VFLS bit in the MIOS14TPCR register. The FRZ state is indicated by the value 0b11 on the VFLS[0:1] signals. 23.4.6 Development Port Registers The development port consists logically of the three registers: development port instruction register (DPIR), development port data register (DPDR), and trap enable control register (TECR). These registers are physically implemented as two registers, development port shift register and trap enable control register. The development port shift register acts as both the DPIR and DPDR depending on the operation being performed. It is also used as a temporary holding register for data to be stored into the TECR. These registers are discussed below in more detail. 23.4.6.1 Development Port Shift Register The development port shift register is a 35-bit shift register. Instructions and data are shifted into it serially from DSDI using DSCK (or CLKOUT depending on the debug port clock mode, refer to Section 23.4.6.4, "Development Port Serial Communications -- Clock Mode Selection") as the shift clock. These instructions or data are then transferred in parallel to the CPU, the trap enable control register (TECR). When the processor enters debug mode it fetches instructions from the DPIR which causes an access to the development port shift register. These instructions are serially loaded into the shift register from DSDI using DSCK (or CLKOUT) as the shift clock. In a similar way, data is transferred to the CPU by moving it into the shift register which the processor reads as the result of executing a "move from special purpose register DPDR" instruction. Data is also parallel-loaded into the development port shift register from the CPU by executing a "move to special purpose register DPDR" instruction. It is then shifted out serially to DSDO using DSCK (or CLKOUT) as the shift clock. 23.4.6.2 Trap Enable Control Register The trap enable control register is a 9-bit register that is loaded from the development port shift register. The contents of the control register are used to drive the six trap enable signals, the two breakpoint signals, and the VSYNC signal to the CPU. The "transfer data to trap enable control register" commands will cause the appropriate bits to be transferred to the control register. MPC561/MPC563 Reference Manual, Rev. 1.2 23-30 Freescale Semiconductor Development Support The trap enable control register is not accessed by the CPU, but instead supplies signals to the CPU. The trap enable bits, VSYNC bit, and the breakpoint bits of this register are loaded from the development port shift register as the result of trap enable mode transmissions. The trap enable bits are reflected in ICTRL and LCTRL2 special registers. See Section 23.6.10, "L-Bus Support Control Register 2" and Section 23.6.10, "L-Bus Support Control Register 2." 23.4.6.3 Development Port Registers Decode The development port shift register is selected when the CPU accesses DPIR or DPDR. Accesses to these two special purpose registers occur in debug mode and appear on the internal bus as an address and the assertion of an address attribute signal indicating that a special purpose register is being accessed. The DPIR register is read by the CPU to fetch all instructions when in debug mode and the DPDR register is read and written to transfer data between the CPU and external development tools. The DPIR and DPDR are pseudo registers. Decoding either of these registers will cause the development port shift register to be accessed. The debug mode logic knows whether the CPU is fetching instructions or reading or writing data. If what the CPU is expecting and what the register receives from the serial port do not match (instruction instead of data) the mismatch is used to signal a sequence error to the external development tool. 23.4.6.4 Development Port Serial Communications -- Clock Mode Selection All of the serial transmissions are clock transmissions and are therefore synchronous communications. However, the transmission clock may be either synchronous or asynchronous with the system clock (CLKOUT). The development port allows the selection of two methods for clocking the serial transmissions. The first method allows the transmission to occur without being externally synchronized with CLKOUT, in this mode a serial clock DSCK must be supplied to the MPC561/MPC563. The other communication method requires a data to be externally synchronized with CLKOUT. The first clock mode is called "asynchronous clock" since the input clock (DSCK) is asynchronous with CLKOUT. To be sure that data on DSDI is sampled correctly, transitions on DSDI must occur a setup time ahead and a hold time after the rising edge of DSCK. This clock mode allows communications with the port from a development tool which does not have access to the CLKOUT signal or where the CLKOUT signal has been delayed or skewed. Refer to the timing diagram in Figure 23-9. The second clock mode is called "synchronous self clock". It does not require an input clock. Instead the port is timed by the system clock. The DSDI input is required to meet setup and hold time requirements with respect to CLKOUT rising edge. The data rate for this mode is always the same as the system clock. Refer to the timing diagram in Figure 23-10. The selection of clock or self clock mode is made at reset. The state of the DSDI input is latched eight clocks after SRESET negates. If it is latched low, asynchronous clock mode is enabled. If it is latched high then synchronous self clock mode is enabled. Since DSDI is used to select the development port clocking scheme, it is necessary to prevent any transitions on DSDI during this time from being recognized as the start of a serial transmission. The port will not begin scanning for the start bit of a serial transmission until 16 clocks after the negation of SRESET. If DSDI is asserted 16 clocks after SRESET negation, the port will wait until DSDI is negated to begin scanning for the start bit. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-31 Development Support DSCK DSDI DSDO START READY MODE CNTRL DI<0> DI DI DI S<0> S<1> DO<0> DO DO DO Debug Port detects the "start" bit on DSDI and follows the "ready" bit with two status bits and 7 or 32 output data bits. Development Tool drives the "start" bit on DSDI (after detecting "ready" bit on DSDO when in debug mode). The "start" bit is immediately followed by a mode bit and a control bit and then 7 or 32 input data bits. Debug Port drives "ready" bit onto DSDO when ready for a new transmission. Note: DSCK and DSDI transitions are not required to be synchronous with CLKOUT. Figure 23-9. Asynchronous Clock Serial Communications 1 CLKOUT DI DI DI DI START MODECNTRLDI<0> DI<1> DI< DSDI DSDO READY S<0> S<1> DO DO <0 > <1 > DO DO DO DO Debug Port detects the "start" bit on DSDI and follows the "ready" bit with two status bits and 7 or 32 output data bits. Development Tool drives the "start" bit on DSDI (after detecting "ready" bit on DSDO when in debug mode). The "start" bit is immediately followed by a mode bit and a control bit and then 7 or 32 input data bits. Debug Port drives "ready" bit onto DSDO when CPU starts a read of DPIR or DPDR. Figure 23-10. Synchronous Self Clock Serial Communication MPC561/MPC563 Reference Manual, Rev. 1.2 23-32 Freescale Semiconductor Development Support CLKOUT 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 SRESET DSDI CLKEN DSDI negates following SRESET negation to enable clocked mode. Internal clock enable signal asserts 8 clocks after SRESET negation if DSDI is negated. This enables clocked mode. First Start bit detected after DSDI negation (self clocked mode) Figure 23-11. Enabling Clock Mode Following Reset 23.4.6.5 Development Port Serial Communications -- Trap Enable Mode When not in debug mode the development port starts communications by setting DSDO (the MSB of the 35-bit development port shift register) low to indicate that all activity related to the previous transmission are complete and that a new transmission may begin. The start of a serial transmission from an external development tool to the development port is signaled by a start bit. A mode bit in the transmission defines the transmission as either a trap enable mode transmission or a debug mode transmission. If the mode bit is set the transmission will only be 10 bits long and only seven data bits will be shifted into the shift register. These seven bits will be latched into the TECR. A control bit determines whether the data is latched into the trap enable and VSYNC bits of the TECR or into the breakpoints bits of the TECR. 23.4.6.6 Serial Data into Development Port -- Trap Enable Mode The development port shift register is 35 bits wide but trap enable mode transmissions only use the start/ready bit, a mode/status bit, a control/status bit, and the seven least significant data bits. The encoding of data shifted into the development port shift register (through the DSDI pin) is shown in Table 23-10 and Table 23-11 below: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-33 Development Support Table 23-10. Trap Enable Data Shifted into Development Port Shift Register 1st Start Mode Contro l 2nd 3rd 4th 1st - - - - - - Instruction- - - - - - 2nd - - Data- - VSYNC Function Watchpoint Trap Enables 1 1 0 0 = disabled; 1 = enabled Transfer Data to Trap Enable Control Register Table 23-11. Debug Port Command Shifted Into Development Port Shift Register Start Mode Contro l 1 1 1 Extended Opcode x x Major Opcode Function 00000 NOP 00001 Hard Reset request 00010 Soft Reset request 0 x 00011 Reserved 1 0 00011 End Download procedure 1 1 00011 Start Download procedure x x 00100... 11110 Reserved x 0 11111 Negate Maskable breakpoint. x 1 11111 Assert Maskable breakpoint. 0 x 11111 Negate Non Maskable breakpoint. 1 x 11111 Assert Non Maskable breakpoint. The watchpoint trap enables and VSYNC functions are described in section Section 23.2, "Watchpoints and Breakpoints Support" and section Section 23.1, "Program Flow Tracking." The debug port command function allows the development tool to either assert or negate breakpoint requests, reset the processor, activate or deactivate the fast down-load procedure. 23.4.6.7 Serial Data Out of Development Port -- Trap Enable Mode In trap enable mode the only response out of the development port is "sequencing error." Data that can come out of the development port is shown in Table 23-12. "Valid data from CPU" and "CPU interrupt" status cannot occur in trap enable mode. MPC561/MPC563 Reference Manual, Rev. 1.2 23-34 Freescale Semiconductor Development Support Table 23-12. Status / Data Shifted Out of Development Port Shift Register Data Ready Status [0:1] Bit 0 1 2 (0) 0 0 (0) 0 1 (0) 1 0 (0) 1 1 Bit 1 Data Freeze status1 Function Bits 2:31 or 2:6 -- (Depending on Input Mode) Download Procedure in progress2 Valid Data from CPU 1's Sequencing Error 1's CPU Interrupt 1's Null The "Freeze" status is set to (1) when the CPU is in debug mode and to (0) otherwise. The "Download Procedure in progress" status is asserted (0) when Debug port in the Download procedure and is negated (1) otherwise. When not in debug mode the sequencing error encoding indicates that the transmission from the external development tool was a debug mode transmission. When a sequencing error occurs the development port will ignore the data shifted in while the sequencing error was shifting out. It will be treated as a NOP function. Finally, the null output encoding is used to indicate that the previous transmission did not have any associated errors. When not in debug mode, ready will be asserted at the end of each transmission. If debug mode is not enabled and transmission errors can be guaranteed not to occur, the status output is not needed. 23.4.6.8 Development Port Serial Communications -- Debug Mode When in debug mode the development port starts communications by setting DSDO low to indicate that the CPU is trying to read an instruction from DPIR or data from DPDR. When the CPU writes data to the port to be shifted out the ready bit is not set. The port waits for the CPU to read the next instruction before asserting ready. This allows duplex operation of the serial port while allowing the port to control all transmissions from the external development tool. After detecting this ready status the external development tool begins the transmission to the development port with a start bit (logic high) on the DSDI pin. 23.4.6.9 Serial Data Into Development Port In debug mode the 35 bits of the development port shift register are interpreted as a start/ready bit, a mode/status bit, a control/status bit, and 32 bits of data. All instructions and data for the CPU are transmitted with the mode bit cleared indicating a 32-bit data field. The encoding of data shifted into the development port shift register (through the DSDI pin) is shown below in Table 23-13. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-35 Development Support Table 23-13. Debug Instructions / Data Shifted into Development Port Shift Register Instruction / Data (32 Bits) Start Mode Control Function Bits 0:6 1 Bits 7:31 1 0 0 CPU Instruction Transfer Instruction to CPU 1 0 1 CPU Data Transfer Data to CPU 1 1 0 Trap enable1 Does not exist Transfer data to Trap Enable Control Register 1 1 1 0011111 Does not exist Negate breakpoint requests to the CPU. 1 1 1 0 Does not exist NOP Refer to Table 23-10 Data values in the last two functions other than those specified are reserved. All transmissions from the debug port on DSDO begin with a "0" or "ready" bit. This indicates that the CPU is trying to read an instruction or data from the port. The external development tool must wait until it sees DSDO go low to begin sending the next transmission. The control bit differentiates between instructions and data and allows the development port to detect that an instruction was entered when the CPU was expecting data and vice versa. If this occurs a sequence error indication is shifted out in the next serial transmission. The trap enable function allows the development tool to transfer data to the trap enable control register. The debug port command function allows the development tool to either negate breakpoint requests, reset the processor, activate or deactivate the fast down load procedure. The NOP function provides a null operation for use when there is data or a response to be shifted out of the data register and the appropriate next instruction or command will be determined by the value of the response or data shifted out. 23.4.6.10 Serial Data Out of Development Port The encoding of data shifted out of the development port shift register in debug mode (through the DSDO pin) is the same as for trap enable mode and is shown in Table 23-12. Valid data encoding is used when data has been transferred from the CPU to the development port shift register. This is the result of an instruction to move the contents of a general purpose register to the debug port data register (DPDR). The valid data encoding has the highest priority of all status outputs and will be reported even if an interrupt occurs at the same time. Since it is not possible for a sequencing error to occur and also have valid data there is no priority conflict with the sequencing error status. Also, any interrupt that is recognized at the same time that there is valid data is not related to the execution of an MPC561/MPC563 Reference Manual, Rev. 1.2 23-36 Freescale Semiconductor Development Support instruction. Therefore, a valid data status will be output and the interrupt status will be saved for the next transmission. The sequencing error encoding indicates that the inputs from the external development tool are not what the development port and/or the CPU was expecting. Two cases could cause this error: 1. The processor was trying to read instructions and there was data shifted into the development port, or 2. The processor was trying to read data and there was instruction shifted into the development port. The port will terminate the read cycle with a bus error. This bus error will cause the CPU to signal that an interrupt (exception) occurred. Since a status of sequencing error has a higher priority than exception, the port will report the sequencing error first, and the CPU interrupt on the next transmission. The development port will ignore the command, instruction, or data shifted in while the sequencing error or CPU interrupt is shifted out. The next transmission after all error status is reported to the port should be a new instruction, trap enable or command (possibly the one that was in progress when the sequencing error occurred). The interrupt-occurred encoding is used to indicate that the CPU encountered an interrupt during the execution of the previous instruction in debug mode. Interrupts may occur as the result of instruction execution (such as unimplemented opcode or arithmetic error), because of a memory access fault, or from an unmasked external interrupt. When an interrupt occurs the development port will ignore the command, instruction, or data shifted in while the interrupt encoding was shifting out. The next transmission to the port should be a new instruction, trap enable or debug port command. Finally, the null encoding is used to indicate that no data has been transferred from the CPU to the development port shift register. 23.4.6.11 Fast Download Procedure The download procedure is used to download a block of data from the debug tool into system memory. This procedure can be accomplished by repeating the following sequence of transactions from the development tool to the debug port for the number of data words to be down loaded: INIT: Save RX, RY RY <- Memory Block address- 4 ... repeat: mfspr RX, DPDR DATA word to be moved to memory stwu RX, 0x4(RY) until here ... Restore RX,RY Figure 23-12. Download Procedure Code Example MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-37 Development Support For large blocks of data this sequence may take significant time to complete. The "fast download procedure" of the debug port may be used to reduce this time. This time reduction is achieved by eliminating the need to transfer the instructions in the loop to the debug port. The only transactions needed are those required to transfer the data to be placed in system memory. Figure 23-13 and Figure 23-14 illustrate the time benefit of the "fast download procedure". External Transaction MFSPR DATA STWU Internal Activity Figure 23-13. Slow Download Procedure Loop External Transaction DATA Internal Activity Figure 23-14. Fast Download Procedure Loop The sequence of the instructions used in the "fast download procedure" is the one illustrated in Figure 23-12 with RX = r31 and RY = r30. This sequence is repeated infinitely until the "end download procedure" command is issued to the debug port. Note that, the internal general purpose register 31 is used for temporary storage data value. Before beginning the "fast download procedure" by the "start download procedure command", The value of the first memory block address, - 4, must be written to the general purpose register 30. To end a download procedure, an "end download procedure" command should be issued to the debug port, and then, additional DATA transaction should be sent by the development tool. This data word will NOT be placed into the system memory, but it is needed to stop the procedure gracefully. 23.5 Software Monitor Debugger Support When in debug mode disable, a software monitor debugger can make use of all of the development support features defined in the CPU. When debug mode is disabled all events result in regular interrupt handling, i.e. the processor resumes execution in the corresponding interrupt handler. The exception cause register (ECR) and the debug enable register (DER) only influence the assertion and negation of the freeze signal. 23.5.1 Freeze Indication The internal freeze signal is connected to all relevant internal modules. These modules can be programmed to stop all operations in response to the assertion of the freeze signal. In order to enable a software monitor debugger to broadcast the fact that the debug software is now executed, it is possible to assert and negate the internal freeze signal also when debug mode is disabled. MPC561/MPC563 Reference Manual, Rev. 1.2 23-38 Freescale Semiconductor Development Support The assertion and negation of the freeze signal when in debug mode disable is controlled by the exception cause register (ECR) and the debug enable register (DER) as described in Figure 23-6. In order to assert the freeze signal the software needs to program the relevant bits in the debug enable register (DER). In order to negate the freeze line the software needs to read the exception cause register (ECR) in order to clear it and perform an rfi instruction. If the exception cause register (ECR) is not cleared before the rfi is performed the freeze signal is not negated. Therefore it is possible to nest inside a software monitor debugger without affecting the value of the freeze line although rfi may be performed a few times. Only before the last rfi the software needs to clear the exception cause register (ECR). The above mechanism enables the software to accurately control the assertion and the negation of the freeze signal. 23.6 Development Support Registers Table 23-14 lists the registers used for development support in SPR number order, and the register sections, Section 23.6.2, "Comparator A-D Value Registers (CMPA-CMPD)" through Section 23.6.13, "Development Port Data Register (DPDR)," follow the same SPR order. The registers are accessed with the mtspr and mfspr instructions. Table 23-14. Development Support Programming Model SPR Number (Decimal) Name 144 Comparator A Value Register (CMPA) See Table 23-17 for bit descriptions. 145 Comparator B Value Register (CMPB) See Table 23-17 for bit descriptions. 146 Comparator C Value Register (CMPC) See Table 23-17 for bit descriptions. 147 Comparator D Value Register (CMPD) See Table 23-17 for bit descriptions. 148 Exception Cause Register (ECR) See Table 23-18 for bit descriptions. 149 Debug Enable Register (DER) See Table 23-19 for bit descriptions. 150 Breakpoint Counter A Value and Control Register (COUNTA) See Table 23-20 for bit descriptions. 151 Breakpoint Counter B Value and Control Register (COUNTB) See Table 23-21 for bit descriptions. 152 Comparator E Value Register (CMPE) See Table 23-22 for bit descriptions. 153 Comparator F Value Register (CMPF) See Table 23-22 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-39 Development Support Table 23-14. Development Support Programming Model (continued) SPR Number (Decimal) 23.6.1 Name 154 Comparator G Value Register (CMPG) See Table 23-23 for bit descriptions. 155 Comparator H Value Register (CMPH) See Table 23-23 for bit descriptions. 156 L-Bus Support Control Register 1 (LCTRL1) See Table 23-24 for bit descriptions. 157 L-Bus Support Control Register 2 (LCTRL2) See Table 23-25 for bit descriptions. 158 I-Bus Support Control Register (ICTRL) See Table 23-26 for bit descriptions. 159 Breakpoint Address Register (BAR) See Table 23-28 for bit descriptions. 630 Development Port Data Register (DPDR) See Section 23.6.13, "Development Port Data Register (DPDR)" for bit descriptions. Register Protection Table 23-15 and Table 23-16 summarize protection features of development support registers during read and write accesses, respectively. Table 23-15. Development Support Registers Read Access Protection MSR[PR] Debug Mode Enable In Debug Mode 0 0 X Read is performed. ECR is cleared when read. Reading DPDR yields indeterminate data. 0 1 0 Read is performed. ECR is not cleared when read. Reading DPDR yields indeterminate data. 0 1 1 Read is performed. ECR is cleared when read. 1 X X Program exception is generated. Read is not performed. ECR is not cleared when read. Result MPC561/MPC563 Reference Manual, Rev. 1.2 23-40 Freescale Semiconductor Development Support Table 23-16. Development Support Registers Write Access Protection MSR[PR] Debug Mode Enable In Debug Mode 0 0 X Write is performed. Write to ECR is ignored. Writing to DPDR is ignored. 0 1 0 Write is not performed. Writing to DPDR is ignored. 0 1 1 Write is performed. Write to ECR is ignored. 1 X X Write is not performed. Program exception is generated. 23.6.2 Result Comparator A-D Value Registers (CMPA-CMPD) MSB 0 1 2 3 4 5 6 7 8 Field CMPA-D Reset Unaffected 9 10 11 12 13 14 25 26 27 28 29 30 15 LSB 16 17 18 19 20 21 22 23 24 Field CMPAD Reset Unaffected Addr SPR144-SPR147 31 Figure 23-15. Comparator A-D Value Register (CMPA-CMPD) Table 23-17. CMPA-CMPD Bit Descriptions Bits Mnemonic 0:31 CMPA-D Description Address bits to be compared Note: These registers are unaffected by reset. 23.6.3 Exception Cause Register (ECR) The ECR indicates the cause of entry into debug mode. All bits are set by the hardware and cleared when the register is read when debug mode is disabled, or if the processor is in debug mode. Attempts to write to this register are ignored. When the hardware sets a bit in this register, debug mode is entered only if debug mode is enabled and the corresponding mask bit in the DER is set. All bits are cleared to zero following reset. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-41 Development Support MSB 0 1 2 Field -- RST CHSTP 3 4 MCE 5 -- 6 7 8 9 10 11 EXTI ALE PRE FPUVE DECE 12 -- 13 14 15 SYSE TR FPASE 29 30 0000_0000_0000_0000 SRESET LSB 16 17 Field -- SEE 18 19 20 21 -- ITLBER -- DTLBER SRESET 22 23 24 25 26 27 -- 28 LBRK IBRK EBRK 31 DPI 0000_0000_0000_0000 Addr SPR 148 Figure 23-16. Exception Cause Register (ECR) Table 23-18. ECR Bit Descriptions Bits Name Description 0 -- 1 RST 2 CHSTP 3 MCE 4:5 -- 6 EXTI External interrupt bit. Set when the external interrupt is asserted. 7 ALE Alignment exception bit. Set when the alignment exception is asserted. 8 PRE Program exception bit. Set when the program exception is asserted. 9 FPUVE Floating point unavailable exception bit. Set when the program exception is asserted. 10 DECE Decrementer exception bit. Set when the decrementer exception is asserted. 11:12 -- 13 SYSE 14 TR 15 FPASE 16 -- 17 SEE 18 -- 19 ITLBER 20 -- 21 DTLBER Reserved Reset interrupt bit. This bit is set when the system reset pin is asserted. Checkstop bit. Set when the processor enters checkstop state. Machine check interrupt bit. Set when a machine check exception (other than one caused by a data storage or instruction storage error) is asserted. Reserved Reserved System call exception bit. Set when the system call exception is asserted. Trace exception bit. Set when in single-step mode or when in branch trace mode. Floating point assist exception bit. Set when the floating point assist exception occurs. Reserved Software emulation exception. Set when the software emulation exception is asserted. Reserved Implementation specific instruction protection error This bit is set as a result of an instruction protection error. Results in debug mode entry if debug mode is enabled and the corresponding enable bit is set. Reserved Implementation specific data protection error This bit is set as a result of an data protection error. Results in debug mode entry if debug mode is enabled and the corresponding enable bit is set. MPC561/MPC563 Reference Manual, Rev. 1.2 23-42 Freescale Semiconductor Development Support Table 23-18. ECR Bit Descriptions (continued) Bits Name 22:27 -- 28 LBRK L-bus breakpoint exception bit. This bit is set as a result of the assertion of a load/store breakpoint. Results in debug mode entry if debug mode is enabled and the corresponding enable bit is set. 29 IBRK I-bus breakpoint exception bit. This bit is set as a result of the assertion of an Instruction breakpoint. Results in debug mode entry if debug mode is enabled and the corresponding enable bit is set. 30 EBRK External breakpoint exception bit. Set when an external breakpoint is asserted (by an on-chip IMB or L-bus module, or by an external device or development system through the development port). This bit is set as a result of the assertion of an external breakpoint. Results in debug mode entry if debug mode is enabled and the corresponding enable bit is set. 31 DPI 23.6.4 Description Reserved Development port interrupt bit. Set by the development port as a result of a debug station non-maskable request or when debug mode is entered immediately out of reset. Debug Enable Register (DER) This register enables selectively masking the events that may cause the processor to enter into debug mode. MSB 0 1 2 3 4 5 Field -- SRESET 0 0 1 0 16 17 18 19 20 21 -- SEEE -- ITLBERE -- DTLBERE RSTE CHSTPE MCEE -- 6 7 8 9 10 11 EXTIE ALEE PREE FPUVEE DECEE 12 -- 0000_0000_0 13 14 15 SYSEE TRE FPASE 0 1 0 29 30 LSB Field SRESET 22 23 24 25 26 -- 0000_0000_0000 Addr 27 28 31 LBRKE IBRKE EBRKE 1 1 1 DPIE 1 SPR 149 Figure 23-17. Debug Enable Register (DER) Table 23-19. DER Bit Descriptions Bits Name Description 0:1 -- 1 RSTE 2 CHSTPE Checkstop enable bit 0 Debug mode entry disabled 1 Debug mode entry enabled (reset value) 3 MCEE Machine check exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled Reserved Reset enable 0 Debug entry is disabled (reset value) 1 Debug entry is enabled MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-43 Development Support Table 23-19. DER Bit Descriptions (continued) Bits Name Description 4:5 -- 6 EXTIE External interrupt enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 7 ALEE Alignment exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 8 PREE Program exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 9 FPUVEE Floating point unavailable exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 10 DECEE Decrementer exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 11:12 -- 13 SYSEE System call exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 14 TRE Trace exception enable bit 0 Debug mode entry disabled 1 Debug mode entry enabled (reset value) 15 FPASEE Floating point assist exception enable bit. 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled 16 -- 17 SEEE 18 -- 19 ITLBERE 20 -- 21 DTLBERE 22:27 -- 28 LBRKE Reserved Reserved Reserved Software emulation exception enable bit 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled Reserved Implementation specific instruction protection error enable bit. 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled Reserved Implementation specific data protection error enable bit. 0 Debug mode entry disabled (reset value) 1 Debug mode entry enabled Reserved Load/store breakpoint enable bit. 0 Debug mode entry disabled 1 Debug mode entry enabled (reset value) MPC561/MPC563 Reference Manual, Rev. 1.2 23-44 Freescale Semiconductor Development Support Table 23-19. DER Bit Descriptions (continued) 23.6.5 Bits Name Description 29 IBRKE Instruction breakpoint interrupt enable bit. 0 Debug mode entry disabled 1 Debug mode entry enabled (reset value) 30 EBRKE External breakpoint interrupt enable bit (development port, internal or external modules). 0 Debug mode entry disabled 1 Debug mode entry enabled (reset value) 31 DPIE Development port interrupt enable bit 0 Debug mode entry disabled 1 Debug mode entry enabled (reset value) Breakpoint Counter A Value and Control Register MSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 25 26 27 28 29 30 15 CNTV SRESET Unaffected LSB 16 17 18 19 20 21 Field 22 23 24 -- SRESET 31 CNTC 0000_0000_0000_0000 Addr SPR 150 Figure 23-18. Breakpoint Counter A Value and Control Register (COUNTA) Table 23-20. Breakpoint Counter A Value and Control Register (COUNTA) Bits Name 0:15 CNTV 16:29 -- 30:31 CNTC Description Counter preset value Reserved Counter source select 00 not active (reset value) 01 I-bus first watchpoint 10 L-bus first watchpoint 11 Reserved Note: COUNTA[16:31] are cleared following reset; COUNTA[0:15] are unaffected by reset. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-45 Development Support 23.6.6 Breakpoint Counter B Value and Control Register MSB 0 1 2 3 4 5 6 7 Field 8 9 10 11 12 13 14 25 26 27 28 29 30 15 CNTV SRESET Unaffected LSB 16 17 18 19 20 21 Field 22 23 24 -- SRESET 31 CNTC 0000_0000_0000_0000 Addr SPR 151 Figure 23-19. Breakpoint Counter B Value and Control Register (COUNTB) Table 23-21. Breakpoint Counter B Value and Control Register (COUNTB) Bits Name 0:15 CNTV 16:29 -- 30:31 CNTC Description Counter preset value Reserved Counter source select 00 not active (reset value) 01 I-bus second watchpoint 10 L-bus second watchpoint 11Reserved Note: COUNTB[16:31] are cleared following reset; COUNTB[0:15] are unaffected by reset. 23.6.7 Comparator E-F Value Registers (CMPE-CMPF) MSB 0 LSB 1 2 3 4 5 6 7 8 Field 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 CMPE-F SRESET Unaffected Addr SPR 152, SPR 153 Figure 23-20. Comparator E-F Value Registers (CMPE-CMPF) Table 23-22. CMPE-CMPF Bit Descriptions Bits Mnemonic 0:31 CMPE-F Description Address bits to be compared Note: These registers are unaffected by reset. MPC561/MPC563 Reference Manual, Rev. 1.2 23-46 Freescale Semiconductor Development Support 23.6.8 Comparator G-H Value Registers (CMPG-CMPH) MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field 31 CMPG-H SRESET Unaffected Addr SPR 154, SPR 155 Figure 23-21. Comparator G-H Value Registers (CMPG-CMPH) Table 23-23. CMPG-CMPH Bit Descriptions Bits Mnemonic 0:31 CMPG-H Description Data bits to be compared Note: These registers are unaffected by reset. 23.6.9 L-Bus Support Control Register 1 MSB 0 1 Field 2 3 CTE 4 5 6 CTF 7 8 9 10 CTG SRESET 11 12 CTH 13 CRWE 14 15 CRWF 0000_0000_0000_0000 LSB 16 Field 17 18 CSG 19 CSH SRESET 20 21 22 SUSG SUSH 23 24 25 26 CGBMSK 27 28 29 CHBMSK 30 31 UNUSED 0000_0000_0000_0000 Addr SPR 156 Figure 23-22. L-Bus Support Control Register 1 (LCTRL) Table 23-24. LCTRL1 Bit Descriptions Bits Mnemonic Description 0:2 CTE Compare type, comparator E 3:5 CTF Compare type, comparator F 6:8 CTG Compare type, comparator G 9:11 CTH Compare type, comparator H 12:13 CRWE Select match on read/write of comparator E 14:15 CRWF Select match on read/write of comparator F Function 0xx 100 101 110 111 not active (reset value) equal less than greater than not equal 0X don't care (reset value) 10 match on read 11 match on write MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-47 Development Support Table 23-24. LCTRL1 Bit Descriptions (continued) Bits Mnemonic Description Function 16:17 CSG Compare size, comparator G 18:19 CSH Compare size, comparator H 20 SUSG Signed/unsigned operating mode for comparator G 21 SUSH Signed/unsigned operating mode for comparator H 22:25 CGBMSK 26:29 CHBMSK 30:31 -- 00 reserved 01 word 10 half word 11 byte (Must be programmed to word for floating point compares) 0 unsigned 1 signed (Must be programmed to signed for floating point compares) Byte mask for 1st L-data comparator 0000 all bytes are not masked 0001 the last byte of the word is masked Byte mask for 2nd L-data . comparator . . 1111 all bytes are masked Reserved -- Note: LCTRL1 is cleared following reset. 23.6.10 L-Bus Support Control Register 2 MSB 0 Field LW0EN 1 2 LW0IA 3 LW0 IADC 4 5 LW0LA 6 LW0 LADC SRESET 7 8 LW0LD 9 10 LW0 LW1 LDDC EN 11 12 LW1IA 13 LW1 IADC 14 15 LW1LA 0000_0000_0000_0000 LSB 16 Field SRESET Addr LW1 LADC 17 18 LW1LD 19 20 LW1 BRK LDDC NOMSK 21 22 23 24 25 26 -- 27 28 29 30 31 DLW0 DLW1 SLW0 SLW1 EN EN EN EN 0000_0000_0000_0000 SPR 157 Figure 23-23. L-Bus Support Control Register 2 (LCTRL2) MPC561/MPC563 Reference Manual, Rev. 1.2 23-48 Freescale Semiconductor Development Support Table 23-25. LCTRL2 Bit Descriptions Bits Name Description 0 LW0EN 1st L-bus watchpoint enable bit 0 watchpoint not enabled (reset value) 1 watchpoint enabled 1:2 LW0IA 1st L-bus watchpoint I-addr watchpoint selection 00 first I-bus watchpoint 01 second I-bus watchpoint 10 third I-bus watchpoint 11 fourth I-bus watchpoint 3 LW0IADC 4:5 LW0LA 6 LW0LADC 7:8 LW0LD 9 LW0LDDC 10 LW1EN 2nd L-bus watchpoint enable bit 0 watchpoint not enabled (reset value) 1 watchpoint enabled 11:12 LW1IA 2nd L-bus watchpoint I-addr watchpoint selection 00 first I-bus watchpoint 01 second I-bus watchpoint 10 third I-bus watchpoint 11 fourth I-bus watchpoint 13 LW1IADC 1st L-bus watchpoint care/don't care I-addr events 0 Don't care 1 Care 1st L-bus watchpoint L-addr events selection 00 match from comparator E 01 match from comparator F 10 match from comparators (E&F) 11 match from comparators (E | F) 1st L-bus watchpoint care/don't care L-addr events 0 Don't care 1 Care 1st L-bus watchpoint L-data events selection 00 match from comparator G 01 match from comparator H 10 match from comparators (G&H) 11 match from comparators (G | H) 1st L-bus watchpoint care/don't care L-data events 0 Don't care 1 Care 2nd L-bus watchpoint care/don't care I-addr events 0 Don't care 1 Care MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-49 Development Support Table 23-25. LCTRL2 Bit Descriptions (continued) Bits Name Description 14:15 LW1LA 16 LW1LADC 17:18 LW1LD 19 LW1LDDC 20 BRKNOMSK 21:27 -- 28 DLW0EN Development port trap enable selection of the 1st L-bus watchpoint (read only bit) 0 trap disabled (reset value) 1 trap enabled 29 DLW1EN Development port trap enable selection of the 2nd L-bus watchpoint (read only bit) 0 trap disabled (reset value) 1 trap enabled 30 SLW0EN Software trap enable selection of the 1st L-bus watchpoint 0 trap disabled (reset value) 1 trap enabled 31 SLW1EN Software trap enable selection of the 2nd L-bus watchpoint 0 trap disabled (reset value) 1 trap enabled 2nd L-bus watchpoint L-addr events selection 00 match from comparator E 01 match from comparator F 10 match from comparators (E&F) 11 match from comparators (E | F) 2nd L-bus watchpoint care/don't care L-addr events 0 Don't care 1 Care 2nd L-bus watchpoint L-data events selection 00 match from comparator G 01 match from comparator H 10 match from comparators (G&H) 11 match from comparator (G | H) 2nd L-bus watchpoint care/don't care L-data events 0 Don't care 1 Care Internal breakpoints non-mask bit 0 masked mode; breakpoints are recognized only when MSR[RI]=1 (reset value) 1 non-masked mode; breakpoints are always recognized Reserved Note: LCTRL2 is cleared following reset. For each watchpoint, three control register fields (LWxIA, LWxLA, LWxLD) must be programmed. For a watchpoint to be asserted, all three conditions must be detected. MPC561/MPC563 Reference Manual, Rev. 1.2 23-50 Freescale Semiconductor Development Support 23.6.11 I-Bus Support Control Register (ICTRL) MSB 0 1 Field 2 3 CTA 4 5 6 7 CTB 8 9 CTC SRESET 10 11 CTD 12 13 IWP0 14 15 IWP1 0000_0000_0000_0000 1 16 1 7 Field IWP2 18 9 IWP3 LSB 20 21 22 23 24 25 26 27 28 29 30 31 SIWP0 SIWP1 SIWP2 SIWP3 DIWP0 DIWP1 DIWP2 DIWP3 IFM ISCT_SER1 EN EN EN EN EN EN EN EN 0000_0000_0000_0000 SRESET Addr SPR 158 Figure 23-24. I-Bus Support Control Register (ICTRL) 1 Changing the instruction show cycle programming starts to take effect only from the second instruction after the actual mtspr to ICTRL. If the processor aborts a fetch of the target of a direct branch (due to an exception), the target is not always visible on the external pins. Program trace is not affected by this phenomenon. Table 23-26. ICTRL Bit Descriptions Function Bits Mnemonic Description Non-compressed mode1 0xx = not active (reset value) 100 = equal 101 = less than 110 = greater than 111 = not equal Compressed Mode2 0:2 CTA Compare type of comparator A 1xx = not active 000 = equal (reset value) 001 = less than 010 = greater than 011 = not equal 3:5 CTB Compare type of comparator B 6:8 CTC Compare type of comparator C 9:11 CTD Compare type of comparator D 12:13 IWP0 I-bus 1st watchpoint programming 0x = not active (reset value) 10 = match from comparator A 11 = match from comparators (A&B) 14:15 W1 I-bus 2nd watchpoint programming 0x = not active (reset value) 10 = match from comparator B 11 = match from comparators (A | B) 16:17 IWP2 I-bus 3rd watchpoint programming 0x = not active (reset value) 10 = match from comparator C 11 = match from comparators (C&D) 18:19 IWP3 I-bus 4th watchpoint programming 0x = not active (reset value) 10 = match from comparator D 11 = match from comparators (C | D) 0x = not active (reset value) 10 = match from comparator D 11 = match from comparators (C | D) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-51 Development Support Table 23-26. ICTRL Bit Descriptions (continued) Function Bits Mnemonic Description Non-compressed mode1 1 20 SIWP0EN Software trap enable selection of 0 = trap disabled (reset value) the 1st I-bus watchpoint 1 = trap enabled 21 SIWP1EN Software trap enable selection of the 2nd I-bus watchpoint 22 SIWP2EN Software trap enable selection of the 3rd I-bus watchpoint 23 SIWP3EN Software trap enable selection of the 4th I-bus watchpoint 24 DIWP0EN Development port trap enable selection of the 1st I-bus watchpoint (read only bit) 25 DIWP1EN Development port trap enable selection of the 2nd I-bus watchpoint (read only bit) 26 DIWP2EN Development port trap enable selection of the 3rd I-bus watchpoint (read only bit) 27 DIWP3EN Development port trap enable selection of the 4th I-bus watchpoint (read only bit) 28 IFM 29:31 ISCT_SER Compressed Mode2 0 = trap disabled (reset value) 1 = trap enabled Ignore first match, only for I-bus breakpoints 0 = Do not ignore first match, used for "go to x" (reset value) 1 = Ignore first match (used for "continue") RCPU serialize control and Instruction fetch show cycle These bits control serialization and instruction fetch show cycles. See Table 23-27 for the bit definitions. NOTE: Changing the instruction show cycle programming starts to take effect only from the second instruction after the actual mtspr to ICTRL. Refer to Appendix A, "MPC562/MPC564 Compression Features," for code compression-specific functionality. MPC562/MPC564 only. 2 Table 23-27. ISCT_SER Bit Descriptions Serialize Control (SER) Instruction Fetch (ISCTL) 0 00 RCPU is fully serialized and show cycles will be performed for all fetched instructions (reset value) 0 01 RCPU is fully serialized and show cycles will be performed for all changes in the program flow 0 10 RCPU is fully serialized and show cycles will be performed for all indirect changes in the program flow 0 11 RCPU is fully serialized and no show cycles will be performed for fetched instructions Functions Selected MPC561/MPC563 Reference Manual, Rev. 1.2 23-52 Freescale Semiconductor Development Support Table 23-27. ISCT_SER Bit Descriptions Serialize Control (SER) Instruction Fetch (ISCTL) 1 00 Illegal. This mode should not be selected. 1 01 RCPU is not serialized (normal mode) and show cycles will be performed for all changes in the program flow 1 10 RCPU is not serialized (normal mode) and show cycles will be performed for all indirect changes in the program flow 1 11 RCPU is not serialized (normal mode) and no show cycles will be performed for fetched instructions Functions Selected 23.6.12 Breakpoint Address Register (BAR) MSB 0 LSB 1 2 3 4 5 6 7 8 Field 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 BARV SRESET Unaffected Addr SPR 159 Figure 23-25. Breakpoint Address Register (BAR) Table 23-28. BAR Bit Descriptions Bits Mnemonic 0:31 BARV[0:31] Description The address of the load/store cycle that generated the breakpoint 23.6.13 Development Port Data Register (DPDR) This 32-bit special purpose register physically resides in the development port logic. It is used for data interchange between the core and the development system. An access to this register is initiated using mtspr and mfspr (SPR 630) and implemented using a special bus cycle on the internal bus. MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Field Data Reset Unaffected Addr SPR 630 31 Figure 23-26. Development Port Data Register (DPDR) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 23-53 Development Support MPC561/MPC563 Reference Manual, Rev. 1.2 23-54 Freescale Semiconductor Chapter 24 READI Module The READI module provides real-time development capabilities for RCPU-based MCUs in compliance with the Nexus IEEE-ISTO 5001-1999. This module provides development support capabilities for MCUs in single chip mode, without requiring address and data signals for internal visibility. The development features supported are program trace, data trace, watchpoint trace, ownership trace, run-time access to the MCU's internal memory map, and access to RCPU internal registers during halt, via the auxiliary port. The auxiliary port, along with RCPU development features (such as background debug mode and watchpoints) supports all software and hardware development in single chip mode. The auxiliary port, along with (on-chip) calibration RAM, allows calibration variable acquisition and calibration constant tuning in single chip mode, for automotive powertrain development systems. NOTE In this section the bit numbering in the register definitions of tool mapped registers follows the Nexus IEEE-ISTO 5001 - 1999 bit numbering convention of MSB = bit 31 and LSB = bit 0, unlike the MPC500 standard (MSB = bit 0 and LSB = bit 31). The bit description tables list the bit numbering and Nexus bit numbering. 24.1 Features Summary The READI module is compliant with Class 3 of the IEEE-ISTO 5001-1999. The following features are implemented: * Program trace via branch trace messaging (BTM). Branch trace messaging displays program flow discontinuities (direct and indirect branches, exceptions etc.), allowing the development tool to interpolate what transpires between the discontinuities. Thus static code may be traced. * Data trace via data write messaging (DWM) and data read messaging (DRM). This provides the capability for the development tool to trace reads and/or writes to (selected) internal memory resources. Data trace also allows for calibration variable acquisition in automotive powertrain development systems. -- Two data trace windows with programmable address range and access attributes. Data trace windowing reduces the requirements on the auxiliary port bandwidth by constraining the number of trace locations. * Ownership trace via ownership trace messaging (OTM). OTM facilitates ownership trace by providing visibility of which process ID or operating system task is activated. An ownership trace message is transmitted to indicate when a new process/task is activated, allowing development tools to trace process/task flow. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-1 READI Module * * * * * * * * Run-time access to on-chip memory map and MPC500 special purpose registers (SPRs) via the READI read/write access protocol. This feature supports accesses for runtime internal visibility, calibration constant acquisition and tuning, and external rapid prototyping for powertrain automotive development systems. Watchpoint messaging via the auxiliary port Nine or 16 full-duplex auxiliary signal interface for medium and high visibility throughput -- One of two modes selected during reset: full port mode (FPM) and reduced port mode (RPM). - FPM comprises 16 signals and RPM comprises nine signals -- Auxiliary output port - One MCKO (message clock out) signal - Two or eight MDO (message data out) signals - One MSEO (message start/end out) signal -- Auxiliary input port - One MCKI (message clock in) signal - One or two MDI (message data in) signals - One MSEI (message start/end in) signal - One EVTI (event in) signal - One RSTI (reset in) signal All features configurable and controllable via the auxiliary port Security features for production environment Support of existing RCPU development access protocol via the auxiliary port READI module can be reset independent of system reset Parametrics: -- Two bits are downloaded per clock in full port mode. For example, with input clock running at 28 MHz, this translates to a download rate of 56 Mbits/s. -- One bit is downloaded per clock in reduced port mode. For example, with input clock running at 28 MHz, this translates to a download rate of 28 Mbits/s. -- Eight bits are uploaded per clock in full port mode. For example, with system clock running at 56 MHz, this translates to a upload rate of 448 Mbits/s. -- Two bits are uploaded per clock in reduced port mode. For example, with system clock running at 56 MHz, this translates to a upload rate of 112 Mbits/s. 24.1.1 Functional Block Diagram The functional block diagram of the READI module is shown in Figure 24-1. MPC561/MPC563 Reference Manual, Rev. 1.2 24-2 Freescale Semiconductor U-bus Brkpt_ out U-bus Snoop READI Module Program Trace Encoding Message L-bus Ownership Trace Encoding R/W Access Control Registers Signal Interface Message Out MDO[0:1] or MDO[0:7] Formatter MSEO Signal Interface Message In MDI[0] or MDO[0:1] MSEI Formatter EVTI RSTI MCKI RCPU Development Access USIU Watchpoint Capture RCPU USIU MCKO L-bus Snoop L-bus Data Trace Encoding L-bus Master L-bus L-bus Snoop Queues Security Figure 24-1. READI Functional Block Diagram 24.2 Modes of Operation The various operating modes of the READI module are: 1. Reset 2. Secure 3. Normal 4. Disabled 24.2.1 Reset Configuration The READI reset configuration is explained in Section 24.7.6, "READI Reset Configuration." MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-3 READI Module 24.2.2 Security Security is provided via the UC3F censorship mechanism. If a UC3F array is in censored mode, reads or writes to the UC3F will not be allowed (RCPU will not be able to fetch instructions from the UC3F) once any of the following cases are detected: * Program trace and/or data trace are enabled * Read/write access is attempted (can be to any address location) * RCPU development access is enabled. 24.2.3 Normal Normal operation of the READI module allows for developement support features to be available. These features include control of the device, access to registers, and the ability to perform data or instruction trace. 24.2.4 Disabled If EVTI is negated at negation of RSTI, the READI module will be disabled. No trace output will be provided, and output auxiliary port will be three-stated. Any message sent by the tool is ignored. 24.3 Parametrics With 32-deep message queues, throughput numbers were calculated for the following benchmark codes [assuming full port mode]: * For an example benchmark which had 10.9% direct branches, 2.5% indirect branches, 10.4% data writes, and 19.3% data reads, approximately 20% of total data trace accesses will be traced. * For another example benchmark which had 9.8% direct branches, 2.8% indirect branches, 6.6% data writes, and 18.3% data reads, approximately 27% of total data trace accesses will be traced. NOTE The queue is only 16 messages deep on revisions prior to Rev. D of the MPC561 and is 16 deep in Rev. B and earlier versions of the MPC563. For reduced port mode, the data trace feature should not be used, or used sparingly, so as not to cause queue overruns. 24.4 Messages The READI module implements messaging via the auxiliary port according to the IEEE-ISTO 5001 1999. Messaging will be implemented via transfer codes (TCODEs) on the auxiliary port. The TCODE number for the message identifies the transfer format (the number and/or size of packets to be transferred) and the purpose of each packet. Public messages outlined in Table 24-1 are supported by READI. MPC561/MPC563 Reference Manual, Rev. 1.2 24-4 Freescale Semiconductor READI Module . Table 24-1. Public Messages TCODE Number 1 Message Name 1 Device ID. Refer to Section 24.6.1.3, "Device ID Register (DID)." 2 Ownership Trace Message. Refer to Section 24.13.1, "Ownership Trace Messaging." 3 Program Trace -- Direct Branch Message. Refer to Section 24.8.2.1, "Direct Branch Messages." 4 Program Trace -- Indirect Branch Message. Refer to Section 24.8.2.2, "Indirect Branch Messages." 5 Data Trace -- Data Write Message. Refer to Section 24.9.2.1, "Data Write Message." 6 Data Trace -- Data Read Message. Refer to Section 24.9.2.2, "Data Read Message." 8 Error Message. Refer to Table 24-20. 10 (0x0A) Program Trace Correction. Refer to Section 24.8.2.3, "Correction Messages." 11 (0x0B Program Trace -- Direct Branch Synchronization Message. Refer to Section 24.8.2.4.1, "Direct Branch Synchronization Message." 12 (0x0C) Program Trace -- Indirect Branch Synchronization Message. Refer to Section 24.8.2.4.2, "Indirect Branch Synchronization Message." 13 (0x0D) Data Trace -- Data Write Synchronization Message. Refer to Section 24.9.2.4, "Data Write Synchronization Message." 14 (0x0E) Data Trace -- Data Read Synchronization Message. Refer to Section 24.9.2.5, "Data Read Synchronization Messaging." 15 (0x0F) Watchpoint Message. Refer to Section 24.12.1, "Watchpoint Messaging." 16 (0x10) Auxiliary Access -- Device Ready for Upload/Download Message. Refer to Section 24.6.2, "Accessing Memory-Mapped Locations Via the Auxiliary Port." 17 (0x11) Auxiliary Access -- Upload Request (Tool Requests Information) Message. Refer to Section 24.6.3, "Accessing READI Tool Mapped Registers Via the Auxiliary Port." 18 (0x12) Auxiliary Access -- Download Request (Tool Provides Information) Message. Refer to Section 24.6.2, "Accessing Memory-Mapped Locations Via the Auxiliary Port." 19 (0x13) Auxiliary Access -- Upload/Download Information (Device/Tool Provides Information) Message. Refer to Section 24.6.3, "Accessing READI Tool Mapped Registers Via the Auxiliary Port." 27 (0x1B) Program Trace1 - Resource Full Message. Refer to Section 24.8.2.4.5, "Resource Full Message." 1 This message is not available on the MPC561 prior to revision D and is not available on the MPC563 revision B and earlier. Table 24-2. Vendor-Defined Messages TCODE Number Message Name 56 (0x38) RCPU Development Access -- DSDI Data (Tool Provides Information) Message 57 (0x39) RCPU Development Access -- DSDO Data (Device Provides Information) Message 58 (0x3A) RCPU Development Access -- BDM Status (Device Provides Information) Message 59 (0x3B) Program Trace -- Indirect Branch Message With Compressed Code. Available in MPC562/MPC564 only. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-5 READI Module Table 24-2. Vendor-Defined Messages (continued) TCODE Number Message Name 60 (0x3C) Program Trace -- Direct Branch Synchronization Message With Compressed Code. Available in MPC562/MPC564 only. 61 (0x3D) Program Trace -- Indirect Branch Synchronization Message With Compressed Code. Available in MPC562/MPC564 only. Vendor-defined messages outlined in Table 24-2 are also supported by READI. 24.5 Terms and Definitions Table 24-3. Terms and Definitions Term Auxiliary Port Description Refers to IEEE-ISTO 5001 auxiliary port. Branch Trace Messaging External visibility of addresses for taken branches and exceptions, and the number of (BTM) sequential instructions executed between each taken branch. BDM Background Debug Mode. Compressed Code Mode Current instruction stream is fetching compressed code. Available in MPC562/MPC564 only. Calibration Constants Performance related constants which must be tuned for automotive powertrain and disk drive applications. Calibration Variables Intermediate calculations which must be visible during the calibration or tuning process to enable accurate tuning of calibration constants. Data Read Message (DRM) External visibility of data reads to internal memory-mapped resources. Data Write Message (DWM) External visibility of data writes to internal memory-mapped resources. Data Trace Messaging (DTM) External visibility of how data flows through the embedded system. May include DRM and/or DWM. Download Tool sends information to the device Field Number of bits representing single piece of information FPM Full Port Mode. This is the default full port mode for READI. IEEE-ISTO 5001 IEEE-ISTO 5001, formerly known as Global Embedded Processor Debug Interface Standard. Worldwide web documentation at http://www.nexus5001.org/. Halt RCPU is in freeze state (typically in debug mode) Instruction Fetch The process of reading the instruction data received from the instruction memory. Instruction Issue The process of driving valid instruction bits inside the processor. The instruction is decoded by each execution unit, and the appropriate execution unit prepares to execute the instruction during the next clock cycle. MPC561/MPC563 Reference Manual, Rev. 1.2 24-6 Freescale Semiconductor READI Module Table 24-3. Terms and Definitions (continued) Term Description Instruction Taken An instruction is taken after it has been issued and recognized by the appropriate execution unit. All resources to perform the instruction are ready, and the processor begins to execute it. Instruction Retire Completion of the instruction issue, execution and writeback stages. An instruction is ready to be retired if it completes without generating an exception and all instructions ahead of it in history buffer have completed without generating an exception. ICTRL Instruction bus support control register (Refer to Table 23.6.11) Ownership Trace Message (OTM) Visibility of process/function that is currently executing. Public Messages Messages on the auxiliary signals for accomplishing common visibility and controllability requirements e.g. DRM and DWM. RCPU Processor that implements the PowerPC-based architecture used in the Freescale MPC500 family of microcontrollers. READI Real time Embedded Applications Development Interface. READI signals Refers to IEEE-ISTO 5001 auxiliary port. RPM Reduced Port Mode. This is the reduced port mode for READI. run-time RCPU is executing program code in normal mode Sequential Instruction Any instruction other than a flow-control instruction or isync. Snooping Monitoring addresses driven by a bus master to detect the need for coherency actions. Standard The phrase "according to the standard" implies according the IEEE-ISTO 5001 - 1999. Superfield One or more message "fields" delimited by MSEO/MSEI assertion/negation. The information transmitted between "start-message" and "end-packet" states. Show Cycle An internal access (e.g., to an internal memory) reflected on the external bus using a special cycle (marked with a dedicated transfer code). For an internal memory "hit," an address-only bus cycle is generated; for an internal memory "miss," a complete bus cycle is generated. Transfer Code (TCODE) Message header that identifies the number and/or size of packets to be transferred, and how to interpret each of the packets. TCK / DSCK / MCKI Multiplexed signal: JTAG Clock or Development Port Clock. MCKI is a READI signal on the MPC561/MPC563 TDI / DSDI / MDI0 Multiplexed signal: JTAG Data In or Development Port Serial Data In. MDI0 is a READI signal on the MPC561/MPC563. TDO / DSDO / MDO0 Multiplexed signal: JTAG Data Out or Development Port Serial Data Out. MDO0 is a READI signal on the MPC561/MPC563 Upload Device sends information to the tool. VSYNC Internal RCPU signal VF Internal RCPU signal which indicates instruction queue status. VFLS Internal RCPU signal which indicates history buffer flush status. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-7 READI Module 24.6 Programming Model The READI registers do not follow the recommendations of the IEEE-ISTO 5001 - 1999, but are loosely based on the 0.9 release of the standard. See http://www.nexus5001.org/. READI registers are classified into two categories: user-mapped register and tool-mapped registers. User-mapped register (a memory-mapped register): * Ownership trace register Tool-mapped registers (registers which can be accessed only through the development tool and are not memory mapped): * * * * * * * * Device ID register Development control register Mode control register 4-bit User base address register Read/write access register Upload/download information register Data trace attributes register 1 Data trace attributes register 2 24.6.1 Register Map READI registers are accessible via the auxiliary port. They can be classified into two categories: user-mapped registers and tool-mapped registers. 24.6.1.1 User-Mapped Register (OTR) The operating system writes the ID for the current task/process in the single user-mapped register, the READI ownership trace (OTR) register. Table 24-4 shows the location of the register bits. Their functions are explained below. The current task/process (CTP) field is updated by the operating system software to provide task/process ID information. The OTR register can only be accessed by supervisor data attributes. Only CPU writes to this register will be transmitted. This register is not accessible via the auxiliary port download request message. NOTE This is the only READI register that is reset by HRESET. MPC561/MPC563 Reference Manual, Rev. 1.2 24-8 Freescale Semiconductor READI Module MSB 0 1 2 3 4 5 6 Field 7 8 9 10 11 12 13 14 26 27 28 29 30 15 Current Task Process (CTP) 0000_0000_0000_0000 HRESET Addr 0x38 002C LSB 16 17 18 19 20 21 22 Field 23 24 25 31 Current Task Process (CTP) HRESET 0000_0000_0000_0000 Figure 24-2. READI Ownership Trace Register (OTR) Table 24-4. OTR Bit Descriptions Bits Name 0:31 CTP 24.6.1.2 Description READI ownership trace register, write only. Tool-Mapped Registers Table 24-5 defines READI registers that are not memory mapped and can only be accessed through the development tool. Their corresponding access opcodes are also defined. . Table 24-5. Tool-Mapped Register Space 1 24.6.1.3 Access Opcode Register Access Type 8 (0x08) Device ID Register (DID) Read Only 10 (0x0A) Development Control Register (DC) Read Only 11(0x0B) Mode Control Register (MC)1 Read/Write1 13 (0x0D) User Base Address Register (UBA) Read Only 15 (0x0F) Read/Write Access Register (RWA) Read/Write 16 (0x10) Upload/Download Information Register (UDI) Read/Write 20 (0x14) Data Trace Attributes Register 1 (DTA1) Read/Write 21 (0x15) Data Trace Attributes Register 2 (DTA2) Read/Write Not available on all revisions. Refer to the device errata for the version of silicon in use. Device ID Register (DID) Accessing the DID register provides key attributes to the development tool concerning the MCU. This information is also transmitted via the auxiliary output port upon exit of READI reset (RSTI), if EVTI is asserted at RSTI negation. Table 24-6 gives the bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-9 READI Module MSB 31 30 29 28 27 26 25 24 23 22 21 20 19 18 Field REV MDC PN RSTI --1 0000_10 00_0011 Addr 17 16 0x08 LSB 15 14 Field 2 12 11 10 9 8 7 6 PN 2 RSTI 1 13 0XXX 5 4 3 2 1 0 MID -- 0000_0001_110 1 The default value depends on the revision of the device. XXX = 0b101 for MPC561/MPC562 and XXX = 0b110 for MPC563/MPC564. Figure 24-3. READI Device ID Register Table 24-6. DID Bit Descriptions 1 RCPU Bits Nexus Bits Name 0:3 31:28 REV 4:9 27:22 MDC1 READI Manufacturer Design Center. This field identifies the manufacturer's design center. The MPC561/MPC563 has a value of 0x02. 10:19 21:12 PN1 READI Part Number. This part number identification field. The MPC561/MPC562 field value is 0x35, and MPC563/MPC564 value is 0x36. 20:30 11:1 MID READI Manufacturer ID. This field identifies the manufacturer of the device, Freescale's ID is 0x0E. The value of this register for the MPC561 prior to Revision D silicon is 0x1C, and the value for the MPC563 prior to Revision B and earlier silicon is 0x1C. 31 0 -- Description READI version number. This field contains the revision level of the device. Reserved The IEEE-ISTO 5001-1999 defines these two fields as a single combined field. 24.6.1.4 Development Control Register (DC) The DC register is used for basic development control of the READI module. Table 24-7 shows the location of register bits. MSB Field RSTI Address LSB 7 6 5 DOR DME -- 4 3 2 TM 1 0 EC 0000_0000 0x0A Figure 24-4. READI Development Control (DC) Register MPC561/MPC563 Reference Manual, Rev. 1.2 24-10 Freescale Semiconductor READI Module Table 24-7. DC Bit Descriptions 1 RCPU Bits Nexus Bits Name Description 0 7 DOR1 READI Debug Mode Entry Out-of-reset Field can be configured to enable or disable debug mode entry out of reset. 0 Debug Mode Not Entered Out-of-Reset 1 Debug Mode Entered Out-of-Reset 1 6 DME1 READI Debug Mode Enable Field can be configured to enable or disable debug mode. 0 Debug Mode Disabled 1 Debug Mode Enabled 2 5 DPA Reserved 3:5 4:2 TM READI Trace Mode Field can be configured to enable BTM, DTM, and OTM. Any or all types of trace may be enabled. 000 No Trace 1xx BTM Branch Trace Messaging Enabled x1x DTM Data Trace Messaging Enabled xx1 OTM Ownership Trace Messaging Enabled 6:7 1:0 EC READI EVTI Control Field can be configured for synchronization and breakpoint generation. If the EC is equal to 0b00, asserting EVTI will cause the next program and data trace message to be a synchronization message (providing program and data trace are enabled). If the EC field is equal to 0b01, a breakpoint will be generated. If the field is configured to one of the reserved states, its action reverts to that of the default state. NOTE: The EVTI signal is level sensitive when EC is configured for breakpoint generation. This implies that as long as EVTI assertion is continued (with EC set to 0b01), the READI module will continue requesting a breakpoint. The user must detect breakpoint generation and negate the EVTI signal appropriately. 00 EVTI for program and data trace synchronization 01 EVTI for breakpoint generation 1x No Action The DOR and DME fields in the DC register can only be modified when system reset is asserted, or reset (to default state) when the READI module is reset by the assertion of RSTI. Table 24-8 describes the DC register fields with the mode configurations for RCPU development access. Table 24-8. RCPU Development Access Modes 24.6.1.5 DOR DME RCPU Development Access through READI x 0 Non-debug mode access of RCPU development through READI. 0 1 Debug mode is enabled through READI (RCPU is still in normal mode, out of reset) 1 1 Debug mode is enabled through READI and entered out-of-reset. Debug mode entry causes RCPU to halt. Mode Control Register (MC) The MC register is used to select different modes of the READI module. Table 24-7 shows the location of register bits. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-11 READI Module NOTE The MC register is not available prior to Revision D of the MPC561 and is not available in Revision B and earlier versions of the MPC563. Prior revisions have only the default features. MSB LSB 7 Field 6 QTST 5 4 3 -- RSTI 2 1 0 PTM QFM PTSM 0000_0000 Address 0x0B Figure 24-5. READI Mode Control (MC) Register Table 24-9. MC Bit Descriptions RCPU Bits Nexus Bits Name 0 7 QTST Enables a factory test mode for structural testing of the queue. This bit can only be written in factory test mode. When set, no trace messages are queued. Users should always write this bit as a 0. 5 2 PTM The Program Trace Mode (PTM) bit enables an enhanced method of program trace. This mode allows program trace to work with the ISCTL bits of the ICTRL register set to any value except 3. The value of 2 is recommended for optimal processor performance. The drawback of this mode is direct branch messages are never syncronizing so sync requests must be held until the next indirect branch. 0 Legacy Program Trace Mode 1 Enhanced Program Trace Mode 6 1 QFM The Queue Flush Mode (QFM) bit selects if information in the queue is discarded or transmitted at the time of an overrun. Discarding information allows trace to resume quicker after an overrun, but makes it difficult to find the cause of the overrun. 0 Information in the queue is removed 1 Trace is stopped until the queue empties. 7 0 PTSM The Program Trace Sync Mode (PTSM) indicates if the program trace messages contain the I-CNT packet. 0 Program trace message do not contain the I-CNT packet. 1 Program trace message contain the I-CNT packet. 24.6.1.6 Description User Base Address Register (UBA) The UBA register defines the memory map address for the OT register. Table 24-10 gives a description of the register bits. MPC561/MPC563 Reference Manual, Rev. 1.2 24-12 Freescale Semiconductor READI Module MSB 31 30 29 28 27 26 25 24 23 22 Field UBA RSTI 0000_0000_0011_1000 Addr 0x0D 21 20 19 18 17 5 4 3 2 1 16 LSB 15 14 13 12 11 10 9 8 7 6 Field UBA RSTI 0000_0000_0010_1100 0 Figure 24-6. READI User Base Address Register Table 24-10. UBA Bit Descriptions RCPU Bits Nexus Bits Name 0:31 31:0 UBA 24.6.1.7 Description The user base address (UBA) field defines the memory map address for the OT register. The MPC561/MPC563 user base address is 0x38002C. The UBA register is read-only by the development tool. Read/Write Access Register (RWA) The RWA register provides DMA-like access to memory-mapped locations, MPC500 special purpose registers, and READI tool mapped registers. Table 24-11 shows the location of register bits. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-13 READI Module MSB 79 Field 78 77 76 75 74 73 72 SC 71 70 68 67 66 65 64 53 52 51 50 49 48 RWAD RSTI 0000_0000_0000_0000 Addr 0x0F 63 69 62 61 60 Field 59 58 57 56 55 54 RWAD RSTI RW SZ WD 0000_0000_0000_0000 47 46 45 44 43 42 41 40 39 38 Field WD RSTI 0000_0000_0000_0000 31 30 29 28 27 26 25 24 23 22 Field WD RSTI 0000_0000_0000_0000 37 36 35 34 33 32 21 20 19 18 17 16 PRV MAP LSB 15 14 13 12 11 10 9 8 7 6 Field CNT RSTI 0000_0000_0000_0000 5 4 3 2 1 0 Figure 24-7. READI Read/Write Access Register Table 24-11. RWA Read/Write Access Bit Descriptions RCPU Bits Nexus Bits Name Description 0 79 SC The start complete (SC) field is set when a read or write access is initiated. The device will clear the SC bit once the read or write access completes. During a block access, if the SC bit is reset, the access will terminate. 0 Access complete 1 Start access 1:25 78:54 RWAD Read/write address (RWAD) bits are used to identify the address of internal memory-mapped resources to be accessed, or the lowest address (i.e., lowest unsigned value) for a block move (CNT > 0). The address range for a block move is from RWAD to RWAD + CNT. NOTE: The RWD field of the UDI register is shared with the WD field of the RWA register. 26 53 RW The read/write (RW) field can be configured to allow selection of a read or a write access. 0 Read access 1 Write access MPC561/MPC563 Reference Manual, Rev. 1.2 24-14 Freescale Semiconductor READI Module Table 24-11. RWA Read/Write Access Bit Descriptions (continued) RCPU Bits Nexus Bits Name Description 27:28 52:51 SZ The word size (SZ) field can be configured to allow 32-bit, 16-bit, or 8-bit read/write accesses. If the field is configured to one of the reserved states, its action reverts to that of the default state. 00 32-bit 01 16-bit 10 8-bit 11 Reserved 29:60 50:19 WD Write data (WD) bits contain the data to be written. For a read access, the data stored is a don't care. 61:62 18:17 PRV The Privilege Attribute Field can be configured to select different read/write access attributes. 00 User Data 01 User Instruction 10 Supervisor Data 11 Supervisor Instruction 63 16 MAP The Map Select Field can be configured to allow access to multiple memory maps. The primary processor memory map (MAP equal to 0b0) is designated as the default. The secondary memory map (MAP equal to 0b1) can be set to select the MPC500 special purpose registers. 0 Primary memory map 1 Secondary memory map (PPC Special Purpose Registers) 64:79 15:0 CNT The Access Count Field can be configured to indicate the number of accesses of word size (defined in SZ field). The CNT value is used to increment the specified address in the RWAD field for block read/write accesses. For a single read/write access, the CNT value should equal to 0x0000. A 64-Kbyte block read/write access can be performed by configuring the CNT bits as 0xFFFF. If a user wants to terminate a block read or write access which has not completed, the CNT bits should be reset. 24.6.1.8 Upload/Download Information Register (UDI) The UDI register, a 34-bit register, is used to store the data to be written for block write access, and the data read for read (single and block) accesses. Table 24-12 gives a description of the register bits. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-15 READI Module MSB 33 32 31 30 29 28 27 26 25 24 23 Field RWD RSTI 0000_0000_0000_0000_0 Addr 0x10 22 21 20 19 18 17 5 4 3 2 1 0 LSB 16 15 14 13 12 11 10 9 8 7 6 Field RWD ERR DV RSTI 000_0000_0000_0000 0 0 Figure 24-8. READI Upload/Download Information Register Table 24-12. UDI Bit Descriptions RCPU Bits Nexus Bits Name 0:31 33:2 RWD The Read/Write Data Field is used to store data for read accesses and block write accesses. It can contain three sizes of data. Refer to Table 24-13, Table 24-14 and Table 24-9 for details. 32 1 ERR The Error Field is used to determine the status of the read or write access. Refer to Table 24-13 and Table 24-14 for details. 0 Read or write access has not been completed. 1 Read or write access has completed. NOTE: The ERR field is read-only. 33 0 DV The Data Valid Field is used to determine the status of the read or write access. Refer to Table 24-13 and Table 24-14 for details. 0 No error has occurred. 1 Access error occurred. NOTE: The DV field is read-only. Description Table 24-13. Read Access Status ERR DV Status 0 0 Read access has not yet completed 0 1 Read access has completed and no access error occurred 1 0 Access error occurred 1 1 Not allowed Table 24-14. Write Access Status ERR DV Status 0 0 Write access has completed and no access error occurred 1 0 Write access error occurred (Error Message sent out) 0 1 Write access has not yet completed 1 1 Not allowed MPC561/MPC563 Reference Manual, Rev. 1.2 24-16 Freescale Semiconductor READI Module . LSB 8 bit Reserved - Read as Zeros 16 bit Reserved - Read as Zeros 32 bit MS Byte MS Byte LS Byte ERR DV LS Byte ERR DV LS Byte ERR DV Figure 24-9. RWD Field Configuration NOTE The RWD field of the UDI register is shared with the WD field of the RWA register. 24.6.1.9 Data Trace Attributes 1 and 2 Registers (DTA1 and DTA2) The DTA1 and DTA2 registers allow data trace messaging (DTM) to be restricted to reads, writes or both for a user programmable address range. Two DTA registers allow two address ranges to be selected for DTM. Refer to Table 24-15 for register bit descriptions. MSB 47 46 45 44 43 42 41 40 39 38 Field DTEA RSTI 0000_0000_0000_0000 Addr 0x14 (DTA1), 0x15 (DTA2) 31 30 29 Field 28 27 26 25 24 23 22 37 36 35 34 33 32 21 20 19 18 17 16 3 2 1 DTEA DTSA RSTI 0000_0000_0000_0000 LSB 15 14 13 12 11 10 9 8 7 6 5 4 0 Field DTSA TA RSTI 0000_0000_0000_00 00 Figure 24-10. READI Data Trace Attributes 1 Register (DTA1) READI Data Trace Attributes 2 Register (DTA2) Table 24-15. DTA 1 AND 2 Bit Descriptions RCPU Bits Nexus Bits Name 0:22 47:25 DTEA1 Description The Read/Write End Field defines the end address for the address range. Refer to Table 24-16. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-17 READI Module Table 24-15. DTA 1 AND 2 Bit Descriptions (continued) 1 RCPU Bits Nexus Bits Name 23:45 24:2 DTSA1 46:47 1:0 TA Description The Read/Write Start Field defines the starting address for the address range. Refer to Table 24-16. The Read/Write Trace Field can be configured to allow enabling or disabling data read and/or data write traces. 00 Disable data read and data write trace x1 Enable data read trace 1x Enable data write trace Data trace range start and end addresses must be word-aligned. Table 24-16. Data Trace Values Programmed Values DTSA < DTEA Range Selected DTSA DTSA > DTEA Invalid Range DTSA = DTEA Word at DTSA DTEA NOTE There is no way to distinguish between off-core MPC500 special purpose register (SPR) map and normal memory map accesses via the defined address range control. If data trace ranges are set up such that the off-core MPC500 SPR map falls within active ranges, then accesses to these off-core MPC500 SPRs will be traced, and the messages will not be distinguishable from accesses to normal memory map space. Off-core MPC500 SPRs typically exist in the 8- to 16-Kbyte lowest memory block (0x2000 - 0x3FF0). If data or peripherals are mapped to this space, load/stores to MPC500 SPRs will be indistinguishable from data or peripheral accesses. 24.6.2 Accessing Memory-Mapped Locations Via the Auxiliary Port The control and status information is accessed via the four auxiliary access public messages: device ready for upload/download, upload request (tool requests information), download request (tool provides information), and upload/download information (device/tool provides information). To write control or status to memory-mapped locations the following sequence would be required. 1. The tool confirms that the device is ready (so as to not cancel an ongoing read write access). The tool transmits the download request public message (TCODE 18) which contains write attributes, write data, and target address. 2. The tool waits for device ready for upload/download (TCODE 16) message before initiating next access. MPC561/MPC563 Reference Manual, Rev. 1.2 24-18 Freescale Semiconductor READI Module To read control or status from memory-mapped locations the following sequence would be required. 1. The tool confirms that the device is ready. The tool transmits the download request public message (TCODE 18) which contains read attributes and target address. 2. When device reads data it transmits upload/download information message (TCODE 19) containing read data. Device is now ready for next access. For a block write to memory-mapped locations the following sequence would be required. 1. The tool confirms that the device is ready. The tool transmits the download request public message (TCODE 18) which contains block write attributes, first write data, and target address. 2. The tool waits for device ready for upload/download message (TCODE 16). When it is transmitted by device, tool transmits upload/download information message (TCODE 19) containing next write data. This step is repeated until all data is written For a block read from memory-mapped locations the following sequence would be required. 1. The tool confirms that the device is ready. The tool transmits the download request public message (TCODE 18) which contains block read attributes and target address. 2. The tool waits for upload/download information message (TCODE 19) from device, which contains read data. This step is repeated until all data is read. Refer to Section 24.10, "Read/Write Access," for more details on read/write access protocol. 24.6.3 Accessing READI Tool Mapped Registers Via the Auxiliary Port To write control or status data to READI tool mapped registers the following sequence would be required. 1. The tool confirms that the device is ready. The tool transmits the download request message (TCODE 18) which contains write data, and register opcode. 2. The tool waits for device ready for upload/download message (TCODE 16) before initiating next access. To read control or status from READI tool mapped registers the following sequence would be required 1. The tool confirms that the device is ready. The tool transmits the upload request message (TCODE 17) which contains the target opcode. 2. When device reads data it transmits upload/download information message (TCODE 19) containing read data. Device is now ready for next access. Refer to Section 24.10, "Read/Write Access," for more details on read/write access protocol. 24.6.4 Partial Register Updates Registers may be updated via the auxiliary port using the download request message with the message containing only N (where N is less than register width) most-significant bits of the register. In such cases the bits not transmitted will be reset to 0b0. The bits transmitted will be aligned such that the last bit transmitted will be the most significant bit of the register. Therefore a message size that is divisible by the input port size should be transmitted. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-19 READI Module 24.6.5 Programming Considerations The following programing guidelines are recommended for users of the READI features. 24.6.5.1 Program Trace Guidelines Program trace via BTM is not supported during BDM. For program trace synchronization to work, the ICTRL register (Refer to Table 23.6.11)must be programmed such that show cycles will be performed for all changes in the program flow (ISCTL field = 0b01) or the PTM bit in the READI MC register must be set and the ISCTL field in the ICTRL register must not equal 0b11. NOTE The user must program the ICTRL for change of flow show cycles or the PTM bit in the READI MC register early in the reset vector, before any branches, otherwise trace is not guaranteed. If BDM is enabled, the ICTRL register cannot be modified through the program and can only be modified through RCPU development access. To get the best performance from the system, PTM should be set to 1 and ISCTL should be set to 0b10. It is also recommended that the USIU be programmed to ignore instruction show cycles (so as to not impact U-bus performance). See Section 6.2.2.1.1, "SIU Module Configuration Register (SIUMCR)." To correctly trace program execution using BTM, the READI module must be enabled prior to release of system reset. If the READI module is enabled (EVTI asserted, RSTI negated) after the RCPU has started execution of the program, the trace cannot be guaranteed. Refer to Figure 24-16 for further details. 24.6.5.2 Compressed Code Mode Guidelines To display data on instruction show cycles, the BBC must be enabled. BBCMCR[DECOMP_SC_EN] (refer to Section 4.6.2.1, "BBC Module Configuration Register (BBCMCR)") must be set when decompression is enabled. This will allow READI to track the compressed code. BBCMCR[DECOMP_SC_EN] should not be set if there is no intention to use compressed code, as it will degrade U-bus performance. Refer to Appendix A, "MPC562/MPC564 Compression Features" for MPC562/MPC564 compression information. The ICTRL register must be programmed such that a show cycle will be performed for all changes in the program flow (ISCTL field = 0b01), or the PTM bit must be set and ISCTL must be set to a value other than 0b11. (See Table 23-26.) 24.7 Signal Interface This section details information regarding the READI signals and signal protocol. MPC561/MPC563 Reference Manual, Rev. 1.2 24-20 Freescale Semiconductor READI Module 24.7.1 Functional Description The READI signal interface provides the function of transmitting messages from the message queues to the external tools. The signal interface also provides the control for timing and logic for formatting the messages. 24.7.1.1 Signals Implemented The READI module implements one MCKO, MCKI, EVTI, RSTI, MSEO, and MSEI signal. It also implements one or two MDI and two or eight MDO signals. The input signals are synchronized to the MCKI input clock and the output signals are synchronized to the free running MCKO output clock. The MCKI input clock should be synchronised to the MCKO ouput clock to ensure correct message reception. The READI signal definition is outlined in Table 24-17. NOTE MCKI clock frequency has to be less than or equal to one half of MCKO clock frequency. Table 24-17. Description of READI Signals IEEE-ISTO 5001 Signal Name Input/ Output MCKO Output Message Clock-Out (MCKO) is a free-running output clock to development tools for timing of MDO and MSEO signal functions. MCKO is the same as the MCU system clock. MDO[7:0] or MDO[1:0] Output Message Data Out (MDO[7:0] or MDO[1:0]) are output signals used for uploading OTM, BTM, DTM, and Read/Write Accesses. External latching of MDO will occur on rising edge of MCKO. Eight signals are implemented. MDO[7:0] are used in full port mode, MDO[1:0] are used in reduced port mode. MSEO Output Message Start/End Out (MSEO) is an output signal which indicates when a message on the MDO signals has started, when a variable length packet has ended, and when the message has ended. 1 MSEO signal is implemented. External latching of MSEO will occur on rising edge of MCKO. MCKI Input Message Clock-In (MCKI) is a input clock from development tools for timing of MDI and MSEI signal functions. MCKI frequency has to be less than or equal to one half of MCKO frequency. MDI[1:0] or MDI0 Input Message Data In (MDI[1:0] or MDI[0]) are input signals used for downloading configuration information, writes to user resources, etc. Internal latching of MDI will occur on rising edge of MCKI. Two signals are implemented on the MPC561/MPC563. MDI[1:0] are used in full port mode, MDI[0] only is used in reduced port mode. MSEI Input Message Start/End In (MSEI) is an input signal which indicates when a message on the MDI signals has started, when a variable length packet has ended, and when the message has ended. 1 MSEI signal is implemented. Internal latching of MSEI will occur on rising edge of MCKI. EVTI Input Event In (EVTI) -- The EVTI signal is level sensitive when configured for breakpoint generation, otherwise it is edge sensitive. RSTI Input Reset In (RSTI). Description of Signal MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-21 READI Module 24.7.2 Functional Block Diagram Figure 24-11 depicts the functional block diagram of the signal interface. . Trace messages from Queue Watchpoint message Auxiliary messages RCPU Dev. Port message R/W Access message MUX BUF Output Formatter BUF MDO[7:0] Signal Interface Control Unit Input Formatter MDI[1:0] MCKO MSEO MCKI MSEI EVTI RSTI Invalid Message Data to READI Registers Control Data Figure 24-11. Functional Diagram of Signal Interface The signal interface is responsible for handshaking with the message queue and registers. It is also responsible for requesting new messages from the message queue. A message is always requested from the message queue if the message queue is not empty, the message buffer is available and a higher priority message is not requesting to be transmitted. The rate at which data is removed from the queue depends on the average message length, the number of MDO signals, and the MCKO clocking rate. 24.7.3 Message Priority Message formatting is performed in the signal interface block. The following priority scheme is implemented for messages sent to the signal output formatter block, with 1 being the highest priority and 5 being the lowest priority: 1. Invalid message 2. READI register access handshakes (device ready/download information) 3. Watchpoint messages 4. Read/write access message 5. RCPU development access message MPC561/MPC563 Reference Manual, Rev. 1.2 24-22 Freescale Semiconductor READI Module 6. Queued messages (program trace, data trace, and ownership trace) 24.7.4 Signal Protocol The protocol for the MCU receiving and transmitting messages via the auxiliary signals will be accomplished with the MSEI and MSEO signal functions respectively. The MSEI signal will provide the protocol for the MCU receiving messages, and the MSEO signal will provide the protocol for the MCU transmitting messages. The MSEI/MSEO protocol is illustrated in Table 24-18. Table 24-18. MSEI/MSEO Protocol Operation MSEO/MSEI State Idle "1"s at all clocks Start Two "1"s followed by one "0" Active "0"s at all clocks during transmission of a message End of variable length packet "0" followed by "1" End of packet and message "0" followed by two or more "1"s MSEI/MSEO are used to signal the end of variable-length packets and messages. They are not required to indicate end of fixed length packets. MSEI/MSEO are sampled on the rising edge of MCKI and MCKO respectively. Fixed width fields can be concatenated before variable length fields without regard to the individual fields starting or ending at message N bit boundaries. Variable width fields must end at message N bit boundaries (where N is MDI/MDO signals). Figure 24-12 shows the basic relation between the MDO and MSEO signals, and packet structure. MDO and MSEO are sampled on the rising edge of MCKO. MCKO MSEO MDO[7:0] 00000100 00000001 00110100 00000101 TCODE = 4 Number of Sequential Instructions since last taken branch = 4 Relative Address = 0x534 00000000 Don't care data (idle clock) Figure 24-12. Auxiliary Signal Packet Structure for Program Trace Indirect Branch Message MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-23 READI Module Figure 24-13 illustrates the state diagram for MSEI/MSEO transfers. In the End Message state, data on MDI/O is ignored. MSE=1 READI Reset Idle MDI/O: Ignored MSE =1 End Message MDI/O: Data on MDI/O is ignored MSE =0 Start Message MSE=0 MDI/O: Valid MSE=1 MSE=0 MSE =1 MSE=1 Normal Transfer End Packet MDI/O: Valid MDI/O: Valid MSE=0 MSE represents MSEI/MSEO MDI/O represents MDO/MDI MSE =0 Figure 24-13. MSEI/MSEO Transfers 24.7.5 Messages Public messages outlined in Table 24-19 are supported by READI. Table 24-19. Public Messages Supported Message Name Device ID Ownership Trace Message Minimum Maximu Packet m Packet Size Size (bits) (bits) Packet Type Packet Description 6 6 Fixed TCODE number = 1 32 32 Fixed Device ID information 6 6 Fixed TCODE number = 2 32 32 Fixed Task/Process ID tag Direction From Device From Device MPC561/MPC563 Reference Manual, Rev. 1.2 24-24 Freescale Semiconductor READI Module Table 24-19. Public Messages Supported (continued) Message Name Program Trace -- Direct Branch Message Program Trace -- Indirect Branch Message Data Trace -- Data Write Message Data Trace -- Data Read Message Error Message1 Program Trace Correction Message Program Trace -- Direct Branch Synchronization Message (PTSM = 0) Program Trace -- Direct Branch Synchronization2 Message (PTSM = 1) Program Trace -- Indirect Branch Synchronization Message (PTSM = 0) Minimum Maximu Packet m Packet Size Size (bits) (bits) Packet Type Packet Description 6 6 Fixed TCODE number = 3 1 8 Variable 6 6 Fixed 1 8 Variable number of sequential instructions executed since last taken branch 1 23 Variable unique portion of the target address for taken branches and exceptions 6 6 Fixed 1 25 Variable unique portion of the data write address 8 32 Variable data write value (8, 16, 32 bits) 6 6 Fixed 1 25 Variable unique portion of the data read address 8 32 Variable data read value (8, 16, 32 bits) 6 6 Fixed TCODE number = 8 5 5 Fixed error code 6 6 Fixed TCODE number = 10 (0xA) 1 8 Variable 6 6 Fixed 1 1 Variable number of program trace messages cancelled 1 23 Variable full target address 6 6 Fixed 1 8 Variable number of sequential instructions executed since last taken branch 1 23 Variable full target address 6 6 Fixed 1 1 Variable number of program trace messages cancelled 1 23 Variable full target address number of sequential instructions executed since last taken branch TCODE number = 4 TCODE number = 5 TCODE number = 6 correcting the number of instructions in the trace TCODE number = 11 (0xB) TCODE number = 11 (0xB) TCODE number = 12 (0xC) Direction From Device From Device From Device From Device From Device From Device From Device From Device From Device MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-25 READI Module Table 24-19. Public Messages Supported (continued) Message Name Program Trace -- Indirect Branch Synchronization2 Message (PTSM = 1) Minimum Maximu Packet m Packet Size Size (bits) (bits) Packet Type Packet Description Direction 6 6 Fixed 1 8 Variable number of sequential instructions executed since last taken branch 1 23 Variable full target address 6 6 Fixed 1 1 Variable number of messages canceled 1 25 Variable full target address 8 32 Variable data write value (8, 16, 32 bits) 6 6 Fixed 1 1 Variable number of messages canceled 1 25 Variable full target address 8 32 Variable data read value (8, 16, 32 bits) 6 6 Fixed TCODE number = 15 (0xF) 6 6 Fixed number indicating watchpoint source Auxiliary Access -- Device Ready for Upload/Download Message 6 6 Fixed TCODE number = 16 (0x10) From Device Auxiliary Access -- Upload Request Message 6 6 Fixed TCODE number = 17 (0x11) 8 8 Fixed opcode to enable selected configuration, status or data upload from MCU From Tool Auxiliary Access -- Download Request Message 6 6 Fixed TCODE number = 18 (0x12) 8 8 Fixed opcode to enable selected configuration or data download to MCU 8 80 Variable Depending upon opcode selected for download, information to be downloaded to device will vary. 6 6 Fixed 8 80 Variable Data Trace -- Data Write Synchronization Message Data Trace -- Data Read Synchronization Message Watchpoint Message Auxiliary Access -- Upload/Download Information Message TCODE number = 12 (0xC) From Device TCODE number = 13 (0xD) From Device TCODE number = 14 (0xE) From Device TCODE number = 19 (0x13) 1). For an access, depending on word size selected (SZ field in RWA register), variable-length packets of information (10, 18, or 34 bits) will be uploaded/downloaded from/to device. 2). Depending upon opcode selected for upload from internal READI registers, information to be uploaded to the device will vary. From Device From Tool From Device / Tool MPC561/MPC563 Reference Manual, Rev. 1.2 24-26 Freescale Semiconductor READI Module Table 24-19. Public Messages Supported (continued) Minimum Maximu Packet m Packet Size Size (bits) (bits) Message Name Resource Full Message2 1 2 Packet Type 6 6 Fixed 1 4 Variable Packet Description TCODE number = 27 (0x1B) resource code Direction From Device Refer to Table 24-20 for the error message codes. Not available on the MPC561 prior to revision D and not available on MPC563 revision B and earlier. Table 24-20. Error Message Codes Error Code 1 Description 00000 Ownership trace overrun1 00001 Program trace overrun1 00010 Data trace overrun1 00011 Read/write access error 00100 Invalid message 00101 Invalid access opcode 00110 Watchpoint overrun 00111 Program/data/ownership trace overrun 01000-10111 Reserved 11000-11111 Vendor Defined This error message is not available on the MPC561 prior to revision D and is not available on the MPC563 revision B and earlier. Vendor-defined messages outlined in Table 24-21 are also supported by READI. Table 24-21. Vendor-Defined Messages Supported TCODE Name Dev Port Access -- DSDI Data Message Dev Port Access --DSDO Data Message Dev Port Access -- BDM Status Message Minimum Maximum Packet Size Packet Size (bits) (bits) Packet Type Fixed Packet Description 6 6 TCODE number = 56 (0x38) 10 35 6 6 10 35 6 6 Fixed TCODE number = 58 (0x3A) 1 1 Fixed BDM status Variable BDM Development Serial Data In (DSDI) Fixed TCODE number = 57 (0x39) Variable BDM Development Serial Data Out (DSDO) Direction From Tool From Device From Device MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-27 READI Module Table 24-21. Vendor-Defined Messages Supported (continued) TCODE Name Packet Type 6 1 8 6 6 1 23 6 6 Fixed TCODE number = 60 (0x3C) 6 6 Fixed Bit address 1 23 6 6 1 8 6 6 1 23 Program Trace -- Indirect Branch Synchronization Message With Compressed Code1 (PTSM = 0) 6 6 Fixed TCODE number = 61 (0x3D) 6 6 Fixed Bit address 1 23 Program Trace -- Direct Branch Synchronization Message With Compressed Code (PTSM = 1) 6 6 1 8 6 6 1 23 Program Trace -- Direct Branch Synchronization Message With Compressed Code1 (PTSM = 0) Program Trace -- Direct Branch Synchronization Message With Compressed Code1 (PTSM = 1) Fixed Packet Description 6 Program Trace -- Indirect Branch Message With Compressed Code1 1 Minimum Maximum Packet Size Packet Size (bits) (bits) Direction TCODE number = 59 (0x3B) Variable Number of sequential instructions executed since last taken branch Fixed From Device Bit address Variable Unique portion of the target address for taken branches and exceptions (compressed code) From Device Variable Current instruction address Fixed TCODE number = 60 (0x3C) Variable number of sequential instructions executed since last taken branch Fixed From Device Bit Address Variable Current instruction address From Device Variable Current instruction address Fixed TCODE number = 61 (0x3D) Variable number of sequential instructions executed since last taken branch Fixed From Device Bit Address Variable Current instruction address This message is provided only for the MPC562/MPC564. 24.7.5.1 Message Formats Message formatting is performed in the signal interface block. Raw messages read from the message queue are independent of the number of MDO signals implemented. Table 24-22 shows the various message formats that the signal interface formatter has to encounter. MPC561/MPC563 Reference Manual, Rev. 1.2 24-28 Freescale Semiconductor READI Module NOTE For variable length fields, the transmitted size of the field is determined as the bits from the least significant bit to the most significant non-zero valued bit, (i.e., most significant 0 value bits are not transmitted). Table 24-22. Message Field Sizes1,2 Message TCODE Field # 1 Field # 2 Field # 3 Max Size3 Min. Size4 Device ID 1 Fixed = 32 NA NA 38 bits 38 bits Ownership Trace Message 2 Fixed = 32 NA NA 38 bits 38 bits Program Trace -- Direct Branch Message 3 Variable Max = 8 Min = 1 NA NA 14 bits 7 bits Program Trace -- Indirect Branch Message 4 Variable Max = 8 Min = 1 Variable Max = 23 Min = 1 NA 37 bits 8 bits Data Trace -- Data Write Message 5 Variable Max = 25 Min = 1 Variable Max = 32 Min = 8 NA 63 bits 15 bits Data Trace -- Data Read Message 6 Variable Max = 25 Min = 1 Variable Max = 32 Min = 8 NA 63 bits 15 bits Error Message5 8 Fixed = 5 NA NA 11 bits 11 bits Program Trace Correction Message 10 (0xA) Variable Max = 8 Min = 1 NA NA 14 bits 7 bits Program Trace -- Direct Branch Synchronization Message (PTSM = 0) 11 (0xB) Variable Max = 1 Min = 1 Variable Max = 23 Min = 1 NA 30 bits 8 bits Program Trace -- Direct Branch Synchronization Message (PTSM = 1) 11 (0xB) Variable Max = 8 Min = 1 Variable Max = 23 Min = 1 NA 37 bits 8 bits Program Trace -- Indirect Branch Synchronization Message (PTSM = 0) 12 (0xC) Variable Max = 1 Min = 1 Variable Max = 23 Min = 1 NA 30 bits 8 bits Program Trace -- Indirect Branch Synchronization Message (PTSM = 1) 12 (0xC) Variable Max = 8 Min = 1 Variable Max = 23 Min = 1 NA 37 bits 8 bits MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-29 READI Module Table 24-22. Message Field Sizes1,2 (continued) Max Size3 Min. Size4 Variable Max = 32 Min = 8 64 bits 16 bits Variable Max = 32 Min = 8 64 bits 16 bits NA 12 bits 12 bits NA NA 6 bits 6 bits Fixed = 8 NA NA 14 bits 14 bits 18 (0x12) Fixed = 8 Variable Max = 80 Min = 8 NA 94 bits 22 bits Auxiliary Access -- Upload/Download Information (Device/Tool provides Information) Message 19 (0x13) Variable Max = 80 Min = 8 NA NA 86 bits 14 bits Resource Full Message6 27 (0x1B) Variable Max = 4 Min =1 NA NA 10 bits 7 bits Dev Port Access -- DSDI Data (Tool Provides Information) Message 56 (0x38) Variable Max = 35 Min = 10 NA NA 41 bits 16 bits Dev Port Access -- DSDO Data (Device Provides Information) Message 57 (0x39) Variable Max = 35 Min = 10 NA NA 41 bits 16 bits Dev Port Access --BDM Status (Device Provides Information) Message 58 (0x3A) Fixed = 1 NA NA 7 bits 7 bits Program Trace -- Indirect Branch Message With Compressed Code 59 (0x3B) Variable Max = 8 Min = 1 Variable Min = 1 Max = 23 43 bits 14 bits Program Trace -- Direct Branch Synchronization Message With Compressed Code (PTSM = 0) 7 60 (0x3C) Fixed = 6 NA 35 bits 13 bits Message TCODE Field # 1 Field # 2 Data Trace -- Data Write Synchronization Message 13 (0xD) Variable Max = 1 Min = 1 Variable Max = 25 Min = 1 Data Trace -- Data Read Synchronization Message 14 (0xE) Variable Max = 1 Min = 1 Variable Max = 25 Min = 1 Watchpoint Message 15 (0xF) Fixed = 6 NA Auxiliary Access -- Device Ready for Upload/Download Message 16 (0x10) NA Auxiliary Access -- Upload Request (Tool requests information) Message 17 (0x11) Auxiliary Access --Download Request (Tool provides Information) Message Fixed = 6 Variable Max = 23 Min = 1 Field # 3 MPC561/MPC563 Reference Manual, Rev. 1.2 24-30 Freescale Semiconductor READI Module Table 24-22. Message Field Sizes1,2 (continued) Message TCODE Field # 1 Program Trace -- Direct Branch Synchronization Message With Compressed Code (PTSM = 1) 5 60 (0x3C) Variable Max = 8 Min = 1 Program Trace-- Indirect Branch Synchronization Message With Compressed Code (PTSM = 0) 5 61 (0x3D) Fixed = 6 Program Trace-- Indirect Branch Synchronization Message With Compressed Code (PTSM = 1) 5 61 (0x3D) Variable Max = 8 Min = 1 1 2 3 4 5 6 7 Field # 2 Fixed = 6 Variable Max = 23 Min = 1 Fixed = 6 Max Size3 Min. Size4 Variable Min = 1 Max = 23 43 bits 14 bits NA 35 bits 13 bits Variable Min = 1 Max = 23 43 bits 14 bits Field # 3 The double edges indicate that MSEO/MSEI is asserted to indicate the start of a message or negated to indicate the end of a message. Refer to Figure 24-14. The shaded edges indicate super fields that can hold information delimited via MSEO/MSEI assertion followed by MSEO/MSEI negation. Maximum information size. The actual number of bits transmitted is dependant on the number of MDO signals. Minimum information size. The actual number of bits transmitted is dependent on the number of MDO signals. Refer to Table 24-20. Not available prior to Rev. D of the MPC561 and is not available in Rev. B and earlier versions of the MPC563 Only available on MPC562/MPC564 The maximum message length is 94 bits. The maximum number of fields is three, excluding the TCODE itself. 24.7.5.2 * * * * * Rules of Messages A variable sized field within a message must end on a port boundary. A variable sized field may start within a port boundary only when following a fixed length packet. Super fields must end on a port boundary (2-, 4-, or 8-bit boundaries depending on whether the device receives or sends messages, and the port size configured). When a variable length field is sized such that it does not end on a port boundary, it is necessary to extend and zero fill the remaining bits after the highest-order bit so that it can end on a port boundary. A data field within a data trace message must be 8, 16, 24, or 32 bits in length. The field containing the TCODE number is always transferred out first, followed by subsequent fields of information. Within a field, the lowest significant bits are shifted out first. Figure 24-14 shows the transmission sequence of a message which is made up of a TCODE (a fixed-length field) and a variable length field (FIELD 1), together making a super field. Every instance of a fixed length field followed by a variable field is a super field. Figure 24-14, for example, shows two super fields. The only exception to MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-31 READI Module this rule are the development port access messages. See Section 24.14.1, "RCPU Development Access Messaging," for further details. 1 2 TCODE (6 bits) Msb 3 FIELD #1 (Var) Lsb Msb 4 FIELD #2 Lsb Msb Super Field FIELD #3 (Var) Lsb Msb Lsb Super Field MSEx Figure 24-14. Transmission Sequence of Messages 24.7.5.3 Branch Trace Message Examples The following are examples of branch trace messages. 24.7.5.3.1 Example of Indirect Branch Message Table 24-23 illustrates an example of how the indirect branch public message is transmitted. The example uses a 4-bit output port. Note that T0, I0, and A0 are the least significant bits where: Tx = TCODE number (fixed) Ix = Number of sequential instructions (variable) Ax = Unique portion of the address (variable) NOTE During clock 7, the tool should ignore data on MDO signals. MPC561/MPC563 Reference Manual, Rev. 1.2 24-32 Freescale Semiconductor READI Module Table 24-23. Indirect Branch Message Clock 24.7.5.3.2 MDO[3:0] MSEO 3 2 1 0 1 Idle 0 X X X X 1 Idle (or end of last message) 1 T3 T2 T1 T0 0 Start Message 2 I1 I0 T5 T4 0 Normal Transfer 3 I5 I4 I3 I2 0 Normal Transfer 4 0 0 I7 I6 1 End Packet 5 A3 A2 A1 A0 0 Normal Transfer 6 A7 A6 A5 A4 1 End Packet 7 0 0 0 0 1 End Message 8 T3 T2 T1 T0 0 Start Message Example of Direct Branch Message Table 24-24 is an example of the minimum transmission of any message containing a variable length field (three clocks). The example uses a 4-bit output port. Note that T0, and I0 are the least significant bits where: Tx = TCODE number (fixed) Ix = Number of sequential instructions (variable) NOTE During clock 3, the tool should ignore data on MDO signals. Table 24-24. Direct Branch Message Clock 24.7.5.4 MDO[3:0] MSEO 3 2 1 0 1 Idle 1 T3 T2 T1 T0 0 Start Message 2 I1 I0 T5 T4 1 End Packet 3 0 0 0 0 1 End Message Non-Temporal Ordering of Transmitted Messages Trace messages sent out may not be in the sequence they actually occurred. The traces are monitored on the internal buses and these traces are captured as they occur and are sent out in the order they were captured and processed. BTMs are in sequence and DTMs are in sequence, however, temporal order of DTMs interleaved with BTMs may not be accurate with regard to logical flow of code. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-33 READI Module 24.7.6 READI Reset Configuration The READI reset configuration information is received via EVTI and MDI0 to enable or disable the READI module and select the port size. EVTI and MDI0 are sampled synchronously at the negation of RSTI. Reset configuration information must be valid on EVTI and MDI0 at least four clocks prior to the negation of RSTI. If EVTI is sampled asserted at negation of RSTI, the READI module will be enabled. This is illustrated in Figure 24-15. READI control and status information will be reset and the auxiliary output port will be three-stated, when RSTI is asserted. System reset will not reset the READI control and status information and not three-state the auxiliary output port. Port size configuration is selected via the value of MDI0 at the negation of RSTI. Table 24-25 describes the READI reset configuration options. Table 24-25. READI Reset Configuration Options EVTI MDI [0] Configuration 1 X Module Disabled. All outputs three-stated. 0 1 Module Enabled, Default Full Port Configuration 2 MDI, 8 MDO 0 0 Module Enabled, Reduced Port Configuration 1 MDI, 2 MDO RSTI has a pull-down resistor in the pads. If the auxiliary port is not connected to a tool, READI module will be in reset state and not drive the auxiliary output port. System Clock RSTI EVTI EVTI is sampled at the negation of RSTI. Because EVTI is asserted, the READI module is enabled. Reset configuration information must be valid on EVTI at least 4 system clocks prior to RSTI negation. Figure 24-15. READI Module Enabled MPC561/MPC563 Reference Manual, Rev. 1.2 24-34 Freescale Semiconductor READI Module After the HRESET negation, the device will start executing the reset instruction sequence user program. In this user program, set the ISCTL field = 0b01 in the ICTRL register. Also the USIU should be programmed to ignore instruction showcycles to avoid impacting U-bus performance. HRESET (Tool drives) EVTI (Tool drives) 1 EVTI must be asserted 4 system clocks prior to the negation of RSTI to enable READI module. RSTI (Tool drives) Tool negates HRESET 4 16 clocks after receiving device ready message. MSEO Device sends out 2 DID message after negation of RSTI DID Message TCODE=1 MDO MSEI MDI Tool sends in DC message with desired program trace mode enabled. (BDM can also be enabled through. 3 DC register configuration. See note.) Do not send an input message until at least 2 MCKI after READI is enabled, or wait until the DID message is received from the READI module. Device Ready TCODE=16 DC Message TCODE=18 NOTE: If background debug mode (BDM) is enabled, the ICTRL register cannot be modified through user program. This register can only be accessed through the development port. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-35 READI Module Figure 24-16. Enabling Program Trace Out of System Reset 24.7.7 READI Signals The READI signals support Nexus (IEEE-ISTO 5001-1999) auxiliary port interface for debug. There are two modes available, full port mode and reduced port mode. Reduced port mode allows for a 1 bit input stream and a 2 bit output stream. Full port mode allows for a 2 bit input stream and an 8 bit output stream. See Figure 24-11 for READI mode selection. Steps to Enter READI (Nexus) mode: 1. Negate PORESET while holding JCOMP/RSTI low. 2. Configure TMS/EVTI and TDI/DSDI/MDI[0] while JCOMP/RSTI is low. (EVTI = low to enable Nexus) 3. Negate JCOMP/RSTI. 4. If MDI[0] is high at JCOMP/RSTI negation, then full port mode is enabled otherwise Reduced mode is selected. To exit READI mode: 1. Reassert JCOMP/RSTI to disable READI. PORESET JCOMP/RSTI JTAG disabled READI-Config READI READI-Config READI TMS/EVTI MDI0 T Figure 24-17. READI Mode Selection 24.7.7.1 Reset Configuration for Debug Mode To enable RCPU development access via the READI signals, the reset sequence outlined below should be used: * Assert READI reset (RSTI), event-in (EVTI) and system reset (HRESET) * Negate RSTI * Upon negation of RSTI, tool should configure the DOR, DME, and DPA fields in the DC register to desired setting. * Tool negates HRESET at least 16 system clocks after receiving the device ready message Refer to Figure 24-84 for further details. MPC561/MPC563 Reference Manual, Rev. 1.2 24-36 Freescale Semiconductor READI Module 24.7.7.2 Reset Configuration for Non-Debug Mode Refer to Section 24.7.7.1, "Reset Configuration for Debug Mode," for details on reset configuration for non-debug mode. The only difference between non-debug mode reset configuration and debug mode reset configuration are the values of the DOR and DME fields in the DC register. 24.7.7.3 Secure Mode Refer to Section 24.2.2, "Security," for further details. 24.7.7.4 Disabled Mode If EVTI is negated at negation of RSTI, the READI module will be disabled. No trace output will be provided, and output auxiliary signals will be three-stated. This is illustrated in Figure 24-18. System Clock RSTI EVTI EVTI is sampled at the negation of RSTI. Since EVTI is negated, the READI module is disabled. Reset configuration information must be valid on EVTI at least 4 clocks prior to RSTI negation. Figure 24-18. READI Module Disabled 24.7.7.5 * * * Guidelines for Transmitting Input Messages An error message is sent out when an invalid TCODE is detected by the signal input formatter. Refer to Section 24.10.8.2, "Invalid Message," for further details. An error message is sent out when an invalid access opcode is detected in auxiliary input messages by the signal input formatter. Refer to Section 24.10.8.3, "Invalid Access Opcode," for further details. If the TCODE is valid, then READI will expect that the correct number of packets have been received and no further checking will be performed. If the number of packets received by READI is not correct, READI response is not defined, unless the message is a download request message (refer to Section 24.6.4, "Partial Register Updates," for further details). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-37 READI Module 24.8 Program Trace This section details the program trace mechanism supported by READI for the RCPU. Program trace is implemented via branch trace messaging (BTM) as per the IEEE-ISTO 5001-1999 definition. 24.8.1 Branch Trace Messaging Branch trace messaging facilitates program trace by providing the following types of information: * Messaging for taken direct branches includes how many sequential instructions were executed since the last taken branch or exception. Direct (or indirect) branches not taken are counted as sequential instructions. * Messaging for taken indirect branches and exceptions includes how many sequential instructions were executed since the last taken branch or exception and the unique portion of the branch target address or exception vector address. * For some mispredicted branches and exception occurrences, program trace correction messages correct the number of instructions since last taken branch as transmitted in prior BTM message. 24.8.1.1 RCPU Instructions that Cause BTM Messages The following RCPU instructions, when executed, cause indirect branch messages to be encoded: 1. Taken branch relative to link or counter registers 2. Context switching sequential instructions 3. Exception taken (error/interrupts) The following RCPU instruction, when executed, causes direct branch messages to be encoded: 1. Taken direct branch instructions 24.8.2 BTM Message Formats BTM messages are of five types -- direct, indirect, correction, synchronization, and error. 24.8.2.1 Direct Branch Messages Direct branches (conditional or unconditional) are all taken branches whose destination is fixed in the instruction opcode. The program trace direct branch message has the following format: [1 - 8 bits] [6 bits] TCODE (3) Sequence Count Max Length = 14 bits Min Length = 7 bits Figure 24-19. Direct Branch Message Format MPC561/MPC563 Reference Manual, Rev. 1.2 24-38 Freescale Semiconductor READI Module 24.8.2.2 Indirect Branch Messages Indirect branches include interrupts, exceptions, and all taken branches whose destination is determined at run time. For the RCPU, certain sequential instructions are tagged with the indirect change-of-flow attribute because these instruction affect the machine in a similar manner to true indirect change-of-flow instructions. These instructions are the rfi, isync, mtmsr and certain mtspr (to CMPA - CMPF, ICTRL, ECR and DER) The program trace indirect branch message has the following format: [1 - 8 bits] [6 bits] [1 - 23 bits] Sequence Count TCODE (4) Relative Address Max Length = 37 bits Min Length = 8 bits Figure 24-20. Indirect Branch Message Format For compressed code support, six additional bits indicate the starting bit address within the word of the compressed instruction. The program trace indirect branch with compressed code message has the format shown in Figure 24-21. The format of the bit address field is shown in Figure 24-22. The bit definitions are shown in Table 24-26. NOTE On the MPC562/MPC564, the bit pointer should be multiplied by 2 (shift left on bit) for the actual starting bit position. [6 bits] [6 bits] [1-8 bits] TCODE (59) Sequence Count [1-23 bits] Bit Pointer Relative Address Max Length = 40 bits Min Length = 14 bits Figure 24-21. Indirect Branch Message Format with Compressed Code MSB 5 4 3 2 Bit Pointer LSB 0 1 Reserved Figure 24-22. Bit Pointer Format with Compressed Code Table 24-26. Bit Pointer Format RCPU Bits Nexus Bits Name 4:5 0:1 -- Reserved (Unused) 0:3 2:5 BP Bit pointer. This value is 1/2 of the actual bit position on which the instruction starts. Description MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-39 READI Module 24.8.2.3 Correction Messages In case of a mispredicted branch or an exception, a program trace correction message may also be sent indicating a number which corrects the number of instructions (not messages) in the trace. In the case of a synchronizing branch trace message getting corrected due to a misprediction or an exception, the next branch trace message will be a synchronizing message. Table 24-27 illustrates an example of a program trace correction message in case of a mispredicted branch. NOTE In case of a mispredicted branch, the correction count is always 1 and the sequential instruction count is reset to 1 (to denote the not-taken branch as a sequential instruction), after the program trace correction message is sent. This is because a mispredicted branch is considered to be a sequential instruction. Table 24-28 illustrates an example of a program trace correction message in case of an exception. NOTE In case of an exception, the sequential instruction count is reset to 0, after the program trace correction message is sent. Table 24-27. Program Trace Correction Due to a Mispredicted Branch Time Processor State 1 Sequential Instruction 2 Sequential Instruction 3 Sequential Instruction 4 Sequential Instruction 5 Sequential Instruction 6 Direct Branch Instruction 7 Sequential Instruction 8 Sequential Instruction 9 Sequential Instruction 10 Sequential Instruction 11 Indirect Branch Instruction (mispredicted taken) 12 Sequential Instruction 13 Sequential Instruction Message sent Direct Branch Message TCODE = 3 Number of sequential instructions executed since last taken branch = 5 Indirect Branch Message TCODE = 4 Number of sequential instructions executed since last taken branch = 4 Unique portion of the target address MPC561/MPC563 Reference Manual, Rev. 1.2 24-40 Freescale Semiconductor READI Module Table 24-27. Program Trace Correction Due to a Mispredicted Branch (continued) Time Processor State 14 Sequential Instruction 15 Branch Correction 16 Sequential Instruction 17 Sequential Instruction 18 Indirect Branch Instruction (predicted taken) Message sent Program Trace Correction Message TCODE = 10 Number of instructions to rewind from trace = 1 Indirect Branch Message TCODE = 4 Number of sequential instructions executed since last valid taken branch = 3 Unique portion of the target address At Time 11, the Indirect Branch is mispredicted taken. At Time 15, branch correction occurs due to the mispredicted branch which was taken at Time 11. A program trace correction message is sent out correcting the number of instructions in the trace (1). Sequential instruction which occurred at Time 12, 13, and 14 respectively are not included in the correction count because the tool is not aware that they occurred (they were not transmitted out). At Time 18, the Indirect Branch Message indicates that 3 sequential instructions were executed since trace correction (this includes the mispredicted branch instruction which is considered to be a sequential instruction). Table 24-28. Program Trace Correction Due to an Exception Time Processor State 1 Sequential Instruction 2 Sequential Instruction 3 Sequential Instruction 4 Direct Branch Instruction 5 Sequential Instruction 6 Sequential Instruction 7 Sequential Instruction 8 Sequential Instruction 9 Indirect Branch Instruction 10 Sequential Instruction 11 Sequential Instruction Message sent Direct Branch Message TCODE = 3 Number of sequential instructions executed since last taken branch = 3 Indirect Branch Message TCODE = 4 Number of sequential instructions executed since last taken branch = 4 Unique portion of the target address MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-41 READI Module Table 24-28. Program Trace Correction Due to an Exception (continued) Time Processor State Message sent 12 Indirect Branch Instruction Indirect Branch Message TCODE = 4 Number of sequential instructions executed since last taken branch = 2 Unique portion of the target address 13 Sequential Instruction 14 16 Exception due to instruction at Time Program Trace Correction Message 8 TCODE = 10 Number of instructions to rewind from trace =5 Indirect Branch Instruction Indirect Branch Message TCODE = 4 Number of sequential instructions executed since last taken branch = 0 Unique portion of the target address At Time 8, the Sequential instruction that causes an exception is issued. At Time 14, the instruction issued at Time 8 causes an exception. A Program Trace Correction Message is sent out correcting the number of instructions in the trace (5). The sequential instruction that occurred at Time 13 is not included in the correction count because the tool is not aware that it occurred (it was not transmitted out). Note: The sequential instruction at Time 8 did not retire and is included in the correction number. The program trace correction message has the following format: [6 bits] TCODE (10) [1 - 8 bits] Number of instructions to rewind from trace Max Length = 14 bits Min Length = 7 bits Figure 24-23. Program Trace Correction Message Format 24.8.2.4 Synchronization Messages A program trace synchronization message is transmitted via the auxiliary port (provided program trace is enabled) for the following conditions: * Initial program trace message upon exit of any system reset will be a synchronization message. * Upon exit of sleep, deep-sleep and low power down mode, the first BTM will be a synchronization message. * Initial program trace message upon exit of background debug mode. Upon exiting BDM, the next BTM will be a synchronization message. * When BTM is enabled, the first BTM will be a synchronization message. * After 255 program trace messages have been queued without synchronization, the next BTM will be a synchronization message. MPC561/MPC563 Reference Manual, Rev. 1.2 24-42 Freescale Semiconductor READI Module * * * * * * Upon assertion of an event In (EVTI) signal. If the READI module is not disabled, an EVTI assertion will cause the next BTM to be a synchronization message (provided the EC field is 0b00 in the DC register). Upon occurrence of a watchpoint, the next BTM will be a synchronization message (provided program trace is enabled). Occurrence of queue overrun. A program trace overrun error occurs when a trace message cannot be queued due to the queue being full. This causes the message queue to be flushed, and an error message is placed as the first message in the queue. The error code within the error message will indicate that program/data/ownership trace overrun has occurred. The next BTM will be a synchronization message. Sequential instruction count overflow. When the sequential instruction counter reaches its maximum count (up to 256 sequential instructions may be executed), the next BTM will be a program trace synchronization message.The sequential instruction counter is reset. Upon entering or exiting code compression mode, the next BTM will be a synchronization message. The next change-of-flow instruction fetch following VSYNC will be a synchronization message. Program trace synchronization messages provide the full address (without leading zeros) and ensure that development tools fully synchronize with program trace regularly. Synchronization messages provide a reference address for subsequent BTMs, in which only the unique portion of the program trace address is transmitted. NOTE For program trace synchronization to work, the ICTRL register (refer to Table 23.6.11) must be programmed such that show cycle will be performed for all changes in the program flow (ISCTL field = 01) if the PTM bit is set to 0. If the PTM bit is set to 1, ISCTL can be programmed to any value except no show cycles (ISCTL field = 11). It is also recommended that the USIU be programmed to ignore instruction show cycles so as to not impact U-bus performance; set SIUMCR[NOSHOW]. Synchronization will only occur at changes in program flow boundaries, and cannot be forced by the READI module. Synchronizations on errors, overflows, as well as periodic synchronizations will not be deterministic to the nearest instruction, but to the next taken change in program flow. The start of program trace (enabled via any means) will be also deferred to the next change in program flow. Program trace synchronization messages are of the following types: * Direct branch * Indirect branch * Direct branch with compressed code * Indirect branch with compressed code * Resource full MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-43 READI Module 24.8.2.4.1 Direct Branch Synchronization Message The program trace direct branch synchronization message has the following formats depending on how the PTSM bit in the MC register is configured: [6 bits] TCODE (11) [1 bit] Messages Cancelled [1 - 23 bits] Full target address Max Length = 30 bits Min Length = 8 bits Figure 24-24. Direct Branch Synchronization Message Format (PTSM = 0) [6 bits] TCODE (12) [1 - 23 bits] [1-8 bits] Messages Cancelled Full target address Max Length = 37 bits Min Length = 8 bits Figure 24-25. Direct Branch Synchronization Message Format (PTSM = 1) 24.8.2.4.2 Indirect Branch Synchronization Message The program trace indirect branch synchronization message has the following formats depending on the setting of MC[PTSM]: [6 bits] TCODE (12) [1 - 23 bits] [1 bit] Messages Cancelled Full target address Max Length = 30 bits Min Length = 8 bits Figure 24-26. Indirect Branch Synchronization Message Format (PTSM = 0) [6 bits] TCODE (12) [1 - 23 bits] [1-8 bits] Messages Cancelled Full target address Max Length = 37 bits Min Length = 8 bits Figure 24-27. Indirect Branch Synchronization Message Format (PTSM = 1) 24.8.2.4.3 Direct Branch Synchronization Message With Compressed Code For compressed code support, six additional bits indicate the starting bit address within the word of the compressed instruction. The program trace direct branch synchronization with compressed code message has the following formats depending on the setting of MC[PTSM]: MPC561/MPC563 Reference Manual, Rev. 1.2 24-44 Freescale Semiconductor READI Module [6 bits] [1 - 23 bits] [6 bits] Bit address TCODE (60) Full target address Max Length = 35 bits Min Length = 13 bits Figure 24-28. Direct Branch Synchronization Message Format with Compressed Code (PTSM = 0) [6 bits] TCODE (60) [1-8 bits] Sequence Count [6 bits] Bit address [1 - 23 bits] Full target address Max Length = 43 bits Min Length = 14 bits Figure 24-29. Direct Branch Synchronization Message Format with Compressed Code (PTSM = 1) 24.8.2.4.4 Indirect Branch Synchronization Message with Compressed Code For compressed code support, six additional bits indicate the starting bit address within the word of the compressed instruction. The program trace indirect branch synchronization with compressed code message has the following formats depending on the setting of MC[PTSM]: : [6 bits] [1 - 23 bits] [6 bits] TCODE (61) Bit Pointer Full target address Max Length = 35 bits Min Length = 13 bits Figure 24-30. Indirect Branch Synchronization Message Format with Compressed Code (PTSM - 0) : [6 bits] TCODE (60) [1-8 bits] Sequence Count [6 bits] Bit Pointer [1 - 23 bits] Full target address Max Length = 43 bits Min Length = 14 bits Figure 24-31. Indirect Branch Synchronization Message Format with Compressed Code (PTSM = 1) Bit pointer format is shown in Figure 24-22 and bit address format is described in Table 24-26. 24.8.2.4.5 Resource Full Message When more than 256 instructions have run without a branch being taken a program trace resource full message will be generated that indicates the maximum I-CNT value has been reached. The I-CNT field has a maximum width of 8 bits. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-45 READI Module The total instruction count can be found by adding 256 for each program trace full message received to the sequence count of the direct or indirect branch trace message that follows the resource full message. The program trace full message has the following format: [1 - 8 bits] [6 bits] TCODE (27) Resource Code Max Length = 10 bits Min Length = 7 bits Figure 24-32. Program Trace Full Message Format At this time, the program trace sequential count full code is the only defined option for this message. Table 24-29. Resource Codes Error Code 0000 Program Trace Sequential Count Full 0001-1111 24.8.2.5 Description Vendor Defined or Reserved Error Messages Branch trace error messages are explained within applicable functional areas, such as data trace, watchpoint, and program trace sections of this chapter. 24.8.2.6 Relative Addressing The relative address feature is compliant with the IEEE-ISTO 5001 - 1999 recommendations, and is designed to reduce the number of bits transmitted for addresses of indirect branch messages. The address transmitted is relative to the address of the previous branch trace message. It is generated by XORing the new address with the previous address, and then using only the results up to the most significant `1' in the result. To recreate this address, an XOR of the (most-significant 0-padded) message address with the previously decoded address gives the current address. Figure 24-33 shows how a relative address is generated and how it can be used to recreate the original address. MPC561/MPC563 Reference Manual, Rev. 1.2 24-46 Freescale Semiconductor READI Module Previous Address (A1) = 0x0003 FC01, New Address (A2) = 0x0003 F365 Message Generation: A1 = 0000 0000 0000 0011 1111 1100 0000 0001 + A2 = 0000 0000 0000 0011 1111 0011 0110 0101 M1 = 0000 0000 0000 0000 0000 1111 0110 0100 Address Message (M1) = 1111 0110 0100 Address Re-Creation: A1 + M1 = A2 + A1 = 0000 0000 0000 0011 1111 1100 0000 0000 M1 = 0000 0000 0000 0000 0000 1111 0110 0100 A2 = 0000 0000 0000 0011 1111 0011 0110 0101 Figure 24-33. Relative Address Generation and Re-Creation 24.8.3 Queue Overflow Program Trace Error Message A trace overrun error occurs when a trace message cannot be queued due to the queue being full, provided program trace is enabled. The overrun error causes the message queue to be flushed, and an error message to be queued. The error code within the error message indicates that either a program/data/ownership trace overrun error has occurred or that only a program trace overrun has occurred. The next BTM will be a synchronization message. Refer to Table 24-20. The error message has the following format: [6 bits] TCODE (8) [5 bits] Error Code (0b0 0000, 0b0 0001, 0b0 0010, 0b0 0111) Length = 11 bits Figure 24-34. Error Message (Queue Overflow) Format 24.8.4 24.8.4.1 Branch Trace Message Operation BTM Capture and Encoding Algorithm BTM is accomplished by capturing instruction fetch information from the U-bus and instruction execution information from the RCPU (VF and VFLS signals), and combining them to generate program trace messages. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-47 READI Module 24.8.4.2 Instruction Fetch Snooping Instruction fetches are snooped on the U-bus. There is a one-to-one correspondence between instruction fetches marked with the U-bus program trace attribute and the indication of RCPU VF signal (only 3, 4, 5, and 6) between two synchronization events. Since U-bus program trace attribute occurs after the indication of VF, it is latched and paired with the nearest (previous) unpaired VF (3, 4, 5, and 6) indication to determine the instruction address. For all other VF indications, except 3, 4, 5, and 6, it is not possible to determine the instruction address. 24.8.4.3 Instruction Execution Tracking Instruction execution tracking is performed by capturing the RCPU VF and VFLS signals, and decoding them to infer the state of the processor. The RCPU VF signals indicate two classifications of information: * The current instruction type which is being loaded into the RCPU instruction queue. For further details refer to the RCPU Reference Manual. * The number of instructions which are currently being flushed from the RCPU instruction queue. For further details refer to the RCPU Reference Manual. 24.8.4.4 Instruction Flush Cases The various conditions under which the RCPU may signal instruction flushes of the RCPU prefetch queue or RCPU history buffer are: 1. A taken branch (direct, indirect, interrupt or exception) will cause the instruction prefetch queue (which contains instructions from the now old stream) to be flushed, and fetching will start from the branch target stream. The sequential instruction count will be updated to reflect this. 2. A mispredicted branch will cause instructions fetched from the new stream to be flushed, and fetching will resume from the old stream. It will also require a program trace message to be cancelled and the trace to be corrected. 3. An exception can cause cancellation of multiple taken branches which may require cancelling multiple program trace messages. 24.8.5 Branch Trace Message Queueing READI implements a queue 16 or 32 messages deep (depending on the silicon version) for program trace, data trace, and ownership trace messages. Messages that enter the queue are transmitted via the output auxiliary port in the order in which they are queued. NOTE If multiple trace messages need to be queued at the same time, program trace messages will have the highest priority unless the data trace buffers are full, in which case the data trace messages are given temporary higher priority than the program trace messages. MPC561/MPC563 Reference Manual, Rev. 1.2 24-48 Freescale Semiconductor READI Module 24.8.6 BTM Timing Diagrams MCKO MSEO 00000011 MDO[7:0] 0001 0010 00000000 Don't care data (idle clock) TCODE = 3 Number of Sequential Instructions since last taken branch = 72 Figure 24-35. Direct Branch Message MCKO MSEO MDO[7:0] 00000100 00000001 00110100 00000101 TCODE = 4 Number of Sequential Instructions since last taken branch = 4 Relative Address = 0x534 00000000 Don't care data (idle clock) Figure 24-36. Indirect Branch Message MCKO MSEO MDO[7:0] 00111011 00000001 10000011 00001100 00000001 00000000 TCODE = 59 (0x3B) Number of Sequential Instructions since last taken branch = 4 Bit Address = 3 Relative Address = 0x432 Don't care data (idle clock) Figure 24-37. Indirect Branch Message with Compressed Code MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-49 READI Module MCKO MSEO MDO[7:0] 01001010 00010000 00000000 TCODE = 10 (0xA) Number of instructions corrected in trace= 65 Don't care data (idle clock) Figure 24-38. Program Trace Correction Message MCKO MSEO MDO[7:0] 11001000 00000001 TCODE = 8 Error Code = 0b00111 (Program/Data/Ownership trace overrun) 00000000 Don't care data (idle clock) Figure 24-39. Error Message (Program/Data/Ownership Trace Overrun) MCKO MSEO MDO[7:0] 00001011 00000000 00100000 01000011 TCODE = 11 (0xB) Number of messages cancelled = 0 Full target address = 0x654320 01100101 00000000 Don't care data (idle clock) Figure 24-40. Direct Branch Synchronization Message MPC561/MPC563 Reference Manual, Rev. 1.2 24-50 Freescale Semiconductor READI Module MCKO MSEO 00001100 00000000 00100000 01000011 MDO[7:0] TCODE = 12 (0xC) Number messages cancelled = 0 Full target address = 0x654320 01100101 00000000 Don't care data (idle clock) Figure 24-41. Indirect Branch Synchronization Message MCKO MSEO MDO[7:0] 01111100 01000010 10000110 11001010 TCODE = 60 (0x5C) Bit address = 9 Full target address = 0xCA864 00000000 Don't care data (idle clock) Figure 24-42. Direct Branch Synchronization Message with Compressed Code MCKO MSEO MDO[7:0] 01111101 01000010 10000110 11001010 TCODE = 61 (0x5D) Bit address = 9 Full target address = 0xCA864 00000000 Don't care data (idle clock) Figure 24-43. Indirect Branch Synchronization Message with Compressed Code 24.8.7 Program Trace Guidelines Refer to Section 24.6.5.1, "Program Trace Guidelines," for further details. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-51 READI Module 24.9 Data Trace This section details the data trace mechanism supported by READI. Data trace is implemented via data write messaging (DWM) and data read messaging (DRM), as per the IEEE-ISTO 5001 - 1999. 24.9.1 Data Trace for the Load/Store Bus (L-Bus) The L-bus allows the RCPU to perform loads and stores, and the L2U to read and write the L-bus resources. Snooping for data trace on the L-bus requires the READI module to handle the full range of L-bus cycles. This includes various cases of pipelining and aborted cycles. Data trace requires snooping the L-bus cycles, and storing the information for qualifying accesses (based on enabled features and matching target addresses). The READI module traces all data accesses that meet the selected range and attributes. This includes all RCPU initiated accesses and all L-bus accesses. L-bus data cycles can have data sizes of 8, 16, or 32 bits.The READI module supports all three data sizes. In full port mode, 16-bit accesses shift out 24 bits of data so the tool can differentiate them from 8-bit accesses. NOTE In early versions of the READI module, 8-bit data cannot be differentiated from 16-bit data when the 8 MSBs are set to zero. See the device mask set errata list for customer information. 24.9.2 Data Trace Message Formats Data trace messages are of five types: * Data write * Data read * Data write synchronization * Data read synchronization * Error message 24.9.2.1 Data Write Message The data write message contains the data write value and the address of the target location, relative to the previous data trace message. The data write message has the following format: [6 bits] TCODE (5) [1 to 25 bits] Relative Address [8, 16, or 32 bits] Data Value Max Length = 63 bits Min Length = 15 bits Figure 24-44. Data Write Message Format MPC561/MPC563 Reference Manual, Rev. 1.2 24-52 Freescale Semiconductor READI Module 24.9.2.2 Data Read Message The data read message contains the data read value and the address of the target location, relative to the previous data trace message. The data read message has the following format: [6 bits] [1 to 25 bits] TCODE (6) Relative Address [8, 16, 24, or 32 bits] Data Value Max Length = 63 bits Min Length = 15 bits Figure 24-45. Data Read Message Format 24.9.2.3 Data Trace Synchronization Messages A data trace synchronization message shall be transmitted via the auxiliary port (provided data trace is enabled) for the following conditions: * Initial data trace message upon exit of any system reset will be a synchronization message. * Upon exit of sleep, deep-sleep and low power down mode, the first data trace message will be a synchronization message. * Initial data trace message upon exit of background debug mode. Upon exiting BDM, the next data trace message will be a synchronization message. * When data trace is enabled, the first data trace message will be a synchronization message. * After 255 data trace messages have been queued without synchronization, the next data trace message will be a synchronization message. * Upon assertion of an event In (EVTI) signal. If the READI module is not disabled at reset, when EVTI asserts, if the EC field is 0b00 in the DC register, the next data trace message will be a synchronization message. * Upon occurrence of a watchpoint, the next data trace message will be a synchronization message. * Occurrence of queue overrun. A data trace overrun error occurs when a trace message cannot be queued due to the queue being full (provided data trace is enabled). This causes the message queue to be flushed, and an error message is placed as the first message in the queue. The error code within the error message indicates that program/data/ownership trace overrun has occurred. The next data trace message will be a synchronization message. Data trace synchronization messages provide the full address (without leading zeros) and ensure that development tools fully synchronize with data trace regularly. Synchronization messages provide a reference address for subsequent DTMs, in which only the unique portion of the data trace address is transmitted. Data trace synchronization messages are of two types: * Data write * Data read MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-53 READI Module 24.9.2.4 Data Write Synchronization Message The data write synchronization message has the following format: [6 bits] TCODE (13) [1 bit] [1 to 25 bits] Messages Cancelled [8, 16, or 32 bits] Data Value Full target address Max Length = 64 bits Min Length = 16 bits Figure 24-46. Data Write Synchronization Message Format 24.9.2.5 Data Read Synchronization Messaging The data read synchronization message has the following format: [6 bits] TCODE (14) [1 bit] [1 to 25 bits] Messages Cancelled [8, 16, or 32 bits] Full target address Data Value Max Length = 64 bits Min Length = 16 bits Figure 24-47. Data Read Synchronization Message Format 24.9.2.6 Relative Addressing Refer to Section 24.9.2.6, "Relative Addressing," for further details. 24.9.3 Queue Overflow Data Trace Error Message A program/data/ownership trace overrun error or data trace error occurs when a trace message cannot be queued due to the queue being full, provided data trace is enabled. The overrun error causes the message queue to be flushed, and an error message to be queued. The error code within the error message indicates that a program/data/ownership trace overrun error has occurred. The next DTM will be a synchronization message. Refer to Table 24-20. The error message has the following format: [6 bits] TCODE (8) [5 bits] Error Code (0b0 0000, 0b0 0001, 0b0 0010, 0b0 0111) Length = 11 bits Figure 24-48. Error Message (Queue Overflow) Format 24.9.4 Data Trace Operation Data trace is performed by snooping the L-bus for read or write cycles. Data trace functions are enabled by setting the appropriate fields in the DC register and the DTA registers. For details on field configuration, MPC561/MPC563 Reference Manual, Rev. 1.2 24-54 Freescale Semiconductor READI Module refer to Section 24.6.1.4, "Development Control Register (DC)," and Section 24.6.1.9, "Data Trace Attributes 1 and 2 Registers (DTA1 and DTA2)," respectively. Data trace flow is depicted in Figure 24-49. Reset Idle No No Data Read/Write Detected Address In Either Range Store Address Yes Cycle Cancelled ? Wait For Data Phase Store Data Yes Data Error ? Queue Message Figure 24-49. Data Trace Flow Diagram for Non-Pipelined Access MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-55 READI Module 24.9.5 Data Trace Windowing Data trace windowing is achieved via the address range within the DTEA and the DTSA fields of the DTA registers. All L-bus accesses which fall within these two address ranges, provided the address ranges are enabled in either DTA register, are candidates to be transmitted. Data read and/or data write trace may be enabled via the TA field of the data trace attributes registers (DTA). NOTE Data trace ranges are word aligned. Therefore, the address range fields (DTEA and DTSA) of the DTA registers are only 23 bits wide and, as such, should be assigned by the tool with the 23 most significant bits of the intended 25-bit range address, i.e. the 2 LSB of the address are not used.) NOTE The off-core MPC500 special purpose register (SPR) map cannot be distinguished from the normal memory map accesses via the defined address range control. If data trace ranges are set up such that the off-core MPC500 SPR map falls within active ranges, then accesses to these off-core MPC500 SPRs will be traced, and the messages will not be distinguishable from accesses to normal memory map space. Off-core MPC500 SPRs typically exist in the 8-Kbyte - 16-Kbyte lowest memory block (0x2000 0x3FF0). If data or peripherals are mapped to this space, load/stores to MPC500 SPRs will be indistinguishable from data or peripheral accesses. 24.9.6 Special L-Bus Cases Special L-bus cases are handled as described in Table 24-30. Table 24-30. Special L-Bus Case Handling Special Case 24.9.7 Action L-bus Cycle Aborted Cycle ignored L-bus Cycle with data error Message discarded L-bus Cycle terminated due to address error Cycle ignored L-bus Cycle completed without error Cycle captured and transmitted L-bus Cycle initiated by READI (Read/Write Access) Cycle ignored L-bus Cycle is an instruction fetch Cycle ignored Data Storage Interrupt Cycle ignored System Reset Cycle ignored Data Trace Queuing For queuing program trace, data trace, and ownership trace messages, READI implements a queue 32 messages deep (The queue is 16 messages deep on some versions; refer to device errata). Messages that enter the queue are transmitted via the output auxiliary port in the order in which they are queued. MPC561/MPC563 Reference Manual, Rev. 1.2 24-56 Freescale Semiconductor READI Module NOTE If multiple trace messages need to be queued at the same time, program trace messages have a higher priority for queue entry than data trace messages, unless the data trace buffers are full, in which case the data trace messages are given temporary higher priority than the program trace messages. 24.9.8 Throughput and Latency 24.9.8.1 * * * * * * Assumptions for Throughput Analysis All accesses are data trace only 56-MHz operation Output signals are always free (not in middle of transmission) when requested Relative Address field for data trace messages is 20 bits Data field for data trace messages is 32 bits One idle clock between data trace messages 24.9.8.2 Throughput Calculations The data (read or write) trace message is 58 bits (6 [TCODE] + 20 [Relative address] + 32 [Data]). Data trace messages are transmitted out via the MDO signals. Hence it will take eight clocks (58 bits/8 MDO signals) to send a message. There will be one idle clock before the next data trace message can be sent. At 56 MHz, it will take 161ns ((8+1) x 17.8) to transmit the message. Therefore, the average number of data trace messages that can be transmitted out is 6.2 million (1/161ns) per second, or 24.8 million bytes of read/write data per second. 24.9.9 Data Timing Diagrams MCKO MSEO 00000101 MDO[7:0] 11000110 01001010 TCODE = 5 Relative address = 0x318 Data = 0x4A 00000000 00000000 Don't care data (idle clock) Figure 24-50. Date Write Message MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-57 READI Module MCKO MSEO MDO[7:0] 01000110 00101010 01110100 00110100 00010010 00000000 TCODE = 6 Relative address = 0x1D0A9 Data = 0x1234 Don't care data (idle clock) Figure 24-51. Data Read Message MCKO MSEO MDO[7:0] 00001101 00000000 11001110 10001010 01000110 00000001 10111110 00000000 00000000 TCODE = 13 (0xD) Number of messages cancelled = 0 Full target address = 0x1468ACE Data = 0xBE Don't care data (idle clock) Figure 24-52. Data Write Synchronization Message MCKO MSEO MDO[7:0] 00001110 00000000 11001110 10001010 01000110 00000001 01011100 0000000000000000 TCODE = 14 (0xE) Number of messages cancelled = 0 Full target address = 0x1468ACE Data = 0x5C Don't care data (idle clock) Figure 24-53. Data Read Synchronization Message MPC561/MPC563 Reference Manual, Rev. 1.2 24-58 Freescale Semiconductor READI Module MCKO MSEO MDO[7:0] 11001000 00000000 00000001 TCODE = 8 Error Code = 0b00111 (Program/Data/Ownership trace overrun) Don't care data (idle clock) Figure 24-54. Error Message (Program/Data/Ownership Trace Overrun) 24.10 Read/Write Access The read/write access feature allows access to internal memory-mapped space via the auxiliary port. Read/write mechanism supports single and block, reads and writes. 24.10.1 Functional Description The READI module is capable of bus mastership on the L-bus and for setting up and reading data and status. All accesses are setup and initiated to the read/write access register (RWA) and upload/download information register (UDI) via the four auxiliary access public messages: device ready for upload/download, upload request (tool requests information), download request (tool provides information), upload/download information (device/tool provides information). Read/write access features are enabled by setting the appropriate fields in the RWA register. For details on field configuration, refer to Section 24.6.1.7, "Read/Write Access Register (RWA)." The functional flow for read/write access to memory-mapped locations and MPC500 registers is depicted in Figure 24-59. [6 bits] TCODE (16) Max Length = 6 bits Min Length = 6 bits Figure 24-55. Target Ready Message [6 bits] [8 bits] TCODE (17) Opcode Max Length = 14 bits Min Length = 14 bits Figure 24-56. Read Register Message MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-59 READI Module [6 bits] [8 bits] TCODE (18) Opcode [8-80 bits] Register Value Max Length = 94 bits Min Length = 22 bits Figure 24-57. Write Register Message [6 bits] [8-80 bits] TCODE (19) Return Value Max Length = 86 bits Min Length = 14 bits Figure 24-58. Read/Write Response Message MPC561/MPC563 Reference Manual, Rev. 1.2 24-60 Freescale Semiconductor READI Module Reset IDLE Download Request Public Message (TCODE 18) Tool sends to Device Module Read/Write Write Read/Write Read Latch Data ? Device Ready for Upload/ Download Public Message (TCODE 16) Device sends to Tool SC = 0 Yes Upload/Download Information Public Message (TCODE 19) Device sends to Tool CNT= 0 ? No Decrement CNT Increment Address Write Read/Write Read ? Upload/Download Information Public Message (TCODE 19) Tool sends to Device Figure 24-59. Read/Write Access Flow Diagram 24.10.2 Write Operation to Memory-Mapped Locations and SPR Registers 24.10.2.1 Single Write Operation For a single write access to memory-mapped locations and SPR registers, the following sequence of operations need to be performed via the auxiliary port: 1. The tool confirms that the device is ready before transmitting download request public message (TCODE=18). MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-61 READI Module 2. The download request public message contains: a) TCODE(18) b) Access opcode 0xF which signals that subsequent data needs to be stored in the RWA register. c) Configure the RWA register fields as follows: - Start/complete (1 to indicate start access) -> SC - Read/write address (write address) -> RWAD - Read/write (1 to indicate a write access) -> RW - Word size (32 bits, 16 bits, 8 bits) -> SZ - Write data (write data) -> WD - Privilege (user data/instruction, supervisor data/instruction) -> PRV - Map select (select memory map, 0b0 or 0b1) -> MAP 0 = Normal memory access 1 = Secondary memory map (SPR) - Access Count (0 to indicate single access) -> CNT 3. After completion of the write operation, the device ready for upload/download public message (TCODE=16) is transmitted to the tool indicating that the device is ready for next access. 4. The SC bit is cleared to indicate that the write access is complete. 24.10.2.2 Block Write Operation For a block write access to memory-mapped locations, the following sequence of operations need to be performed via the auxiliary port: 1. The tool confirms that the device is ready before transmitting download request public message (TCODE = 18). 2. The download request public message contains: a) TCODE(18) b) Access opcode 0xF which signals that subsequent data needs to be stored in the RWA register. c) Configure the RWA register fields as follows - Start/complete (1 to indicate start access) -> SC - Read/write address (starting write address of block) -> RWAD - Read/write (1 to indicate a write access) -> RW - Word size (32 bits, 16 bits, 8 bits) -> SZ - Write data (write data) -> WD - Privilege (user data/instruction, supervisor data/instruction) -> PRV - Map select (select memory map 0b0) -> MAP - Access count (non zero number to indicate size of block access) -> CNT 3. After completion of this write operation, the device ready for upload/download public message (TCODE = 16) is transmitted to the tool indicating that the device is ready for next access. MPC561/MPC563 Reference Manual, Rev. 1.2 24-62 Freescale Semiconductor READI Module 4. The specified address (stored in RWAD field) is incremented to the next word size and the number in the CNT field is decremented. The SC field is not cleared. 5. The tool transmits the next upload/download information public message (TCODE = 19). 6. The upload/download information public message contains: a) TCODE(19) b) Write data (write data -> UDI) 7. After the completion of this write operation, the device ready for upload/download public message (TCODE = 16) is transmitted to the tool indicating that the device is ready for next access. 8. The specified address (in RWAD field) is incremented to the next word size and the number in the CNT field is decremented. The SC field is not cleared. 9. Steps 5 through 8 are repeated until the count value in the CNT field of RWA register equals zero. The SC bit is cleared to indicate end of the block write access. NOTE For downloading write data to the device for block write operation, the download request public message (TCODE = 18) should not be used to write subsequent data to the UDI register. Data written to the UDI register (via download request message, TCODE 18) is not used by the device for any read/write operation. 24.10.3 Read Operation to Memory-Mapped Locations and SPR Registers 24.10.3.1 Single Read Operation For a single read access to memory-mapped locations and SPR registers, the following sequence of operations need to be performed via the auxiliary port: 1. The tool confirms that the device is ready before transmitting download request public message (TCODE = 18). 2. The download request public message contains: a) TCODE(18) b) Access opcode 0xF which signals that subsequent data needs to be stored in the RWA register. c) Configure the RWA fields as follows: - Start/complete (1 to indicate start access) -> SC - Read/write address (read address) -> RWAD - Read/write (0 to indicate a read access) -> RW - Word size (32 bits, 16 bits, 8 bits) -> SZ - Write data (0xXXXXXXXX-> WD [don't care]) - Privilege (user data/instruction, supervisor data/instruction) > PRV - Map select (select memory map, 00 or 01) -> MAP - Access count (0 to indicate single access) -> CNT 3. Data read from the specified address is stored in the UDI register. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-63 READI Module 4. Once the read access is completed, the upload/download information public message (TCODE = 19) is transmitted to the tool along with the data read from the UDI register. This message also indicates that the device is ready for next access. 5. The SC field in the RWA register is cleared. 24.10.3.2 Block Read Operation For a block read access to memory-mapped locations and SPR registers, the following sequence of operations need to be performed via the auxiliary port: 1. The tool confirms that the device is ready before transmitting download request public message (TCODE = 18). 2. The download request public message contains: a) TCODE(18) b) Access opcode 0xF which signals that subsequent data needs to be stored in the RWA register. c) Configure the RWA fields as follows: - Start/complete (1 to indicate start access) -> SC - Read/write address (starting read address of block) -> RWAD - Read/write (0 to indicate a read access) -> RW - Word size (32 bits, 16 bits, 8 bits) -> SZ - Write data (0xXXXXXXXX-> WD [don't care]) - Privilege (user data/instruction, supervisor data/instruction) > PRV - Map select (select memory map 0b0) -> MAP - Access count (non-zero number to indicate block access) -> CNT 3. Data read from the specified address is stored in the UDI register. 4. After the completion of this read operation, the upload/download information public message (TCODE=19) is transmitted to the tool along with the data read from the UDI register. This message also indicates that the device is ready to perform the next read operation. 5. The specified address (in RWAD field) is incremented to the next word size and the number in the CNT field is decremented. The SC field is not cleared. 6. The data read from the new address is stored in the UDI register. 7. Steps 4 through 7 are repeated until the count value in the CNT field of RWA register equals zero. The SC bit is cleared to indicate end of the block read access. 24.10.4 Read/Write Access to Internal READI Registers 24.10.4.1 Write Operation For a write access to internal READI registers, the following sequence of operations need to be performed via the auxiliary port: 1. The tool confirms that the device is ready before transmitting download request public message (TCODE = 18). MPC561/MPC563 Reference Manual, Rev. 1.2 24-64 Freescale Semiconductor READI Module 2. The download request public message contains: a) TCODE(18) b) Access opcode, which specifies the register where data needs to be written, (e.g., access opcode 0x14 indicates that DTA1 register is the target register). c) Data to be written to the register. 3. After the data has been written to the targeted register, the device ready for upload/download public message (TCODE = 16) is transmitted to the tool indicating that the device is ready for next access. 24.10.4.2 Read Operation For a read access to internal READI registers, the following sequence of operations need to be performed via the auxiliary port: 1. The tool confirms that the device is ready before transmitting upload request public message (TCODE = 17). 2. The upload request public message contains: a) TCODE(17) b) Access opcode, which specifies the register where data needs to be read from, (for example, access opcode 0x14 indicates that DTA1 register is the target register). 3. The upload/download information public message (TCODE=19) is transmitted to the tool along with the data read from the targeted register indicating that the device is ready for next access. 24.10.5 Error Handling The READI module handles the various error conditions in the manner shown in the following sections. 24.10.5.1 Access Alignment The READI module will force address alignment based on the word size field (SZ) value. If the SZ field indicates word (32-bit) access, the least significant two bits of the read/write address field (RWAD) are ignored. If the SZ field indicates half-word (16-bit) access, the least significant bit of the read/write address field (RWAD) is ignored. 24.10.5.2 L-Bus Address Error An address error occurs on the L-bus when the address phase of a cycle is not completed normally. This could occur because of address not being valid or the address map not being valid. In such cases: 1. The access is terminated without retrying. 2. The SC bit of the RWA is reset. Block accesses do not continue. 3. The error message (TCODE = 8) is transmitted (error code 0b00011). Refer to Table 24-20. 24.10.5.3 L-Bus Data Error L-bus data error is signalled due to: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-65 READI Module * * * L-bus data phase error. U-bus address phase error (for a L-bus to U-bus cycle). U-bus data phase error (for a L-bus to U-bus cycle). L-bus data error conditions are signalled along with the transfer acknowledge for the access. L-bus data error conditions may occur because of privilege violations, access to protected memory, etc. In such cases, for a read access, the ERR bit of the UDI is set, and the DV bit in the UDI is reset at the termination of the access. For a write access, an error public message (TCODE = 8) is transmitted (error code 0b00011). 24.10.6 Exception Sequences The following cases are defined for sequences of the read/write protocol that differ from those described in the above sections: 1. If the SC bit is set to start READI read/write accesses, without valid values in the RWAD, then an L-bus address error may occur, which is handled as described above. 2. If a block access is in progress with all the cycles not yet completed, and the RWA is written to again, (with or without modifications), then the block access is terminated at the boundary of the nearest completed access. The resulting data is discarded and not written to the UDI. If a new access has been programmed in the RWA register, then that access will start once the controller has recovered. 3. When a block access is in progress with all the cycles not yet completed, writing the SC bit to 0 in RWA register will terminate the block access and device will send out device ready for upload/download message. 4. If a any type (single/block) of access is in progress with the cycles not yet completed, and system reset occurs, the device will send out an error message. The access will be terminated and the SC bit will be reset. Refer to Table 24-20. 5. If any type of (single/block) of access is requested while system is in reset, the device will send out an error message. The access will not be started and the SC bit will be reset. 24.10.7 Secure Mode For details refer to Section 24.2.2, "Security." 24.10.8 Error Messages 24.10.8.1 Read/Write Access Error An error message is sent out when an L-bus access error or data error on a write access occurs. The error code within the error message indicates that an L-bus address or L-bus data error occurred. For other error handling, see Section 24.10.5, "Error Handling." For a list of error codes, refer to Table 24-20. MPC561/MPC563 Reference Manual, Rev. 1.2 24-66 Freescale Semiconductor READI Module The error message has the following format: [5 bits] [6 bits] TCODE (8) Error Code (0b00011) Length = 11 bits Figure 24-60. Error Message (Read/Write Access Error) Format 24.10.8.2 Invalid Message An error message is sent out when an invalid message is received by READI. The error code within the error message indicates that an invalid TCODE was detected in the auxiliary input messages by the signal input formatter. Refer to Table 24-20. The error message has the following format: [5 bits] [6 bits] TCODE (8) Error Code (0b00100) Length = 11 bits Figure 24-61. Error Message (Invalid Message) Format NOTE If the TCODE is valid, then READI will expect that the correct number of packets have been received and no further checking will be performed. If the number of packets received by READI is not correct, READI response is not deterministic. 24.10.8.3 Invalid Access Opcode An error message is sent out when an invalid access opcode is received by READI. The error code within the error message indicates that an invalid access opcode was detected in the auxiliary input messages by the signal input formatter. Refer to Table 24-20. The error message has the following format: [6 bits] TCODE (8) [5 bits] Error Code (0b00101) Length = 11 bits Figure 24-62. Error Message (Invalid Access Opcode) Format 24.10.9 Faster Read/Write Accesses with Default Attributes Read/write access throughput may be increased by taking advantage of the default settings of the RWA register, and truncating the least significant zero bits of the download request message. For example, to read a word from the default memory map, with default attributes, a download request message that selects MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-67 READI Module the RWA register, and transmits the SC, RWAD, RW fields only is sufficient. This message will contain 41 bits instead of the 94 bits for writing the full contents of the RWA register. See Table 24-11 and Section 24.6.4, "Partial Register Updates," for RWAR and partial register update details respectively. NOTE The last data bit transmitted in the download request message (TCODE 18) will always be the MSB of the register referenced by the opcode (SC field in the case of the RWA register). 24.10.10 Throughput and Latency Throughput analysis has been performed for various read/write access cases such as single write, block write, single byte read, single word read, block byte read, block word read accesses to memory-mapped locations. Data is presented for the two cases when the RWA register is written partially and completely. 24.10.10.1 Assumptions for Throughput Analysis * * * * * * * * All accesses are single read accesses only. MCKI running at 28 MHz. MCKO running at 56 MHz. 56-MHz internal operation. Five clock internal L-bus access (read) Output signals always free (not in middle of transmission) when requested. One idle clock between read messages. No delay from tool in responding -- tool keeps up with READI port. Table 24-31. Throughput Comparison for FPM and RPM MDO/MDI Configurations Reduced Port Mode 2 MDO / 1 MDI pins Full Port Mode 8 MDO / 2 MDI pins Access Type Full RWAR Update Partial RWAR Update Full RWAR Update Partial RWAR Update Single Write Access to memory-mapped location - Word and Byte access (In Million Messages Per Second) 0.28 0.35 0.53 0.65 Single Read Access to memory-mapped location - Word access (In Million Messages Per Second) 0.25 0.51 0.52 1.05 Single Read Access to memory-mapped location - Byte access (In Million Messages Per Second) 0.27 0.56 0.53 1.05 9 9 17 17 Block Write Access to memory-mapped locations - 64-Kbyte block (Word and Byte) write access (In 64-Kbyte Block Writes Per Second) MPC561/MPC563 Reference Manual, Rev. 1.2 24-68 Freescale Semiconductor READI Module Table 24-31. Throughput Comparison for FPM and RPM MDO/MDI Configurations Reduced Port Mode 2 MDO / 1 MDI pins Full Port Mode 8 MDO / 2 MDI pins Access Type Full RWAR Update Partial RWAR Update Full RWAR Update Partial RWAR Update Block Read Access to memory-mapped locations - 64-Kbyte block (Word) read access (In 64-Kbyte Block Writes Per Second) 32 32 77 77 Block Read Access to memory-mapped locations - 64-Kbyte block (Byte) read access (In 64-Kbyte Block Writes Per Second) 61 61 95 95 24.11 Read/Write Timing Diagrams MSEI MSEO MDI Upload/Download Information Message TCODE 19 Download Request Message TCODE 18 MDO Device Ready for Upload/ Download TCODE 16 Device Ready for Upload/ Download TCODE 16 Figure 24-63. Block Write Access MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-69 READI Module MSEI MSEO MDI Download Request Message TCODE 18 Upload/Download Information Message TCODE 19 MDO Upload/Download Information Message TCODE 19 Figure 24-64. Block Read Access MCKO MSEO MDO[7:0] 00010000 TCODE = 16 (0x10) 00000000 00000000 Don't care data (idle clock) Figure 24-65. Device Ready for Upload/Download Request Message MPC561/MPC563 Reference Manual, Rev. 1.2 24-70 Freescale Semiconductor READI Module MCKI MSEI MDI[1:0] 01 00 01 11 11 00 00 00 Don't care data (idle clock) TCODE = 17 (0x11) Access Opcode = 15 (RWA register) (0xE) Figure 24-66. Upload Request Message MCKI MSEI MDI[1:0] 10 00 01 10 10 00 00 00 TCODE = 18 (0x12) Access Opcode = 10 (DC register) (0xA) Data written to DC register: EC = 0b00 00 01 00 00 Don't care data (idle clock) TM = 0b100 DPA = 0b0 DME = 0b0 DOR = 0b0 Figure 24-67. Download Request Message MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-71 READI Module MCKO MSEO MDO[7:0] 01010011 00010110 TCODE = 19 (0x13) DV =1 ERR = 0 Data Read = 0x3C16 (16 bit read access) 00111100 00000000 Don't care data (idle clock) Figure 24-68. Upload/Download Information Message MCKO MSEO MDO[7:0] 01001000 00000000 00000001 TCODE = 8 Error Code = 0b00101 (Invalid Access Opcode) Don't care data (idle clock) Figure 24-69. Error Message (Invalid Access Opcode) 24.12 Watchpoint Support This section details the watchpoint support features of the READI module. The READI module provides watchpoint messaging via the auxiliary port, as defined by the IEEE-ISTO 5001-1999. READI is not compliant with all the breakpoint/watchpoint requirements defined in the IEEE-ISTO 5001 standard. Watchpoint trigger and breakpoint/watchpoint control registers are not implemented. Watchpoint setting via READI can only be done using the BDM protocol. 24.12.1 Watchpoint Messaging The READI module provides watchpoint messaging using IEEE-ISTO 5001-1999 defined public messages. The watchpoint status signals from the RCPU are snooped, and when watchpoints occur, a message is sent to the signal output formatter to be messaged out (the general message queue is bypassed to prevent watchpoint messages from being cancelled in the event of a queue overflow). The watchpoint MPC561/MPC563 Reference Manual, Rev. 1.2 24-72 Freescale Semiconductor READI Module message has the second highest priority. Refer to Section 24.7.3, "Message Priority," for further details on message priorities. The watchpoint message contains the watchpoint code which indicates all the unique watchpoints have occurred since the last watchpoint message. If duplicate watchpoints occur before the watchpoint message is sent out, a watchpoint overrun message is generated. The watchpoint source field will indicate which watchpoints occurred. The watchpoint message has the following format: [6 bits] [6 bits] TCODE (15) Watchpoint Source Length = 12 bits Figure 24-70. Watchpoint Message Format 24.12.1.1 Watchpoint Source Field The watchpoint source field is outlined in Table 24-32. Table 24-32. Watchpoint Source Watchpoint Source Description 0bXXXXX1 First L-bus watchpoint (LW0) 0bXXXX1X Second L-bus watchpoint (LW1) 0bXXX1XX First I-bus watchpoint (IW0) 0bXX1XXX Second I-bus watchpoint (IW1) 0bX1XXXX Third I-bus watchpoint (IW2) 0b1XXXXX Fourth I-bus watchpoint (IW3) 24.12.2 Watchpoint Overrun Error Message A watchpoint overrun error occurs when the same watchpoint occurs multiple times before the first occurrence of that watchpoint has been messaged out. The watchpoint message (which has information of all the watchpoints that occurred prior to the detection of the same watchpoint occurring multiple times) will be sent before the error message can be sent. The overrun error causes further watchpoint occurrences to be ignored, until the error message has been sent. The error code within the error message indicates that a watchpoint overrun error has occurred. Refer to Table 24-20. The error message has the following format: [6 bits] [5 bits] TCODE (8) Error Code (0b00110) Length = 11 bits Figure 24-71. Error Message (Watchpoint Overrun) Format MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-73 READI Module 24.12.3 Synchronization Upon occurrence of a watchpoint, the next program and data trace message will be a synchronization message (provided program and data trace are enabled). 24.12.4 Watchpoint Timing Diagrams MCKO MSEO MDO[7:0] 01001111 00001100 00000000 Don't care data (idle clock) TCODE = 15 (0xE) Watchpoint Source = 0b110001 This indicates that First L-bus watchpoint (LWO), Third I-bus watchpoint (IW2), and Fourth I-bus watchpoint (IW3) have occurred. Figure 24-72. Watchpoint Message MCKO MSEO MDO[7:0] 10001000 00000001 TCODE = 8 Error Code = 0b00110 (Watchpoint Overrun) 00000000 Don't care data (idle clock) Figure 24-73. Error Message (Watchpoint Overrun) 24.13 Ownership Trace This section details the ownership trace support features of the READI module. Ownership trace provides a macroscopic view, such as task flow reconstruction, when debugging software written in a high level (or object-oriented) language. It offers the highest level of abstraction for tracking operating system software execution. This is especially useful when the developer is not interested in debugging at lower levels. MPC561/MPC563 Reference Manual, Rev. 1.2 24-74 Freescale Semiconductor READI Module 24.13.1 Ownership Trace Messaging Ownership trace information is messaged via the auxiliary port using an ownership trace message (OTM). The ownership trace register (OT), which can be accessed via auxiliary port, is updated by the operating system software to provide task/process ID information. When new information is updated in the register by the embedded processor, it is messaged out via the auxiliary port, allowing development tools to trace ownership flow. Ownership trace information is messaged out in the following format: [32 bits] [6 bits] TCODE (2) Task/Process ID Tag Length = 38 bits Figure 24-74. Ownership Trace Message Format 24.13.2 Queue Overflow Ownership Trace Error Message A program/data/ownership trace overrun error occurs when a trace message cannot be queued due to the queue being full, provided ownership trace is enabled. The overrun error causes the message queue to be flushed, and a error message to be queued. The error code within the error message indicates that a program/data/ownership trace overrun error has occurred. Refer to Table 24-20. The error message has the following format: [6 bits] TCODE (8) [5 bits] Error Code (0b0 0000, 0b0 0001, 0b0 0010, 0b0 0111) Length = 11 bits Figure 24-75. Error Message Format 24.13.2.1 OTM Flow Ownership trace messages are generated when the operating system (privileged supervisor task) writes to the memory-mapped ownership trace register. The following flow describes the OTM process. 1. The OT register is a memory-mapped register, whose address is located in the UBA. The OT register address can be read from the UBA register by the IEEE-ISTO 5001 tool. 2. Only privileged writes (byte/half word or word) initiated by the RCPU to the OT register that terminate normally are valid. The data value (word) written into the register is formed into the ownership trace message that is queued to be transmitted. 3. OT register reads and non-privileged OT register writes, or writes initiated by any source other than the RCPU, do not cause ownership trace messages to be transmitted by the READI module. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-75 READI Module 24.13.2.2 OTM Queueing READI implements a queue 32 messages deep for program trace, data trace, and ownership trace messages. Messages that enter the queue are transmitted via the output auxiliary port in the order in which they are queued. NOTE If multiple trace messages need to be queued at the same time, ownership trace messages will have the lowest priority. 24.13.3 OTM Timing Diagrams MCKO MSEO 01000010 11001000 01010000 11011001 MDO[7:0] 00100001 00000000 Don't care data (idle clock) TCODE = 2 Task/Process ID Tag = 0x87654321 Figure 24-76. Ownership Trace Message MCKO MSEO MDO[7:0] 11001000 00000001 TCODE = 8 Error Code = 0b00111 (Program/Data/Ownership trace overrun) 00000000 Don't care data (idle clock) Figure 24-77. Error Message (Program/Data/Ownership Trace Overrun) 24.14 RCPU Development Access This section details the RCPU development access support features of the READI module. The READI development port provides a full duplex serial interface for accessing existing RCPU user register and development features including BDM (background debug mode). MPC561/MPC563 Reference Manual, Rev. 1.2 24-76 Freescale Semiconductor READI Module RCPU development access can be achieved either via the READI signals or the BDM signals on the MCU. The access method is determined during READI module configuration. Figure 24-78 shows how READI and BDM signals are multiplexed for RCPU development access. When the READI module is configured for RCPU development access, IEEE-ISTO 5001 compliant vendor-defined messages are used for transmission of data in and out of the MCU. NOTE On the MPC561/MPC563 the BDM signals are shared with the READI signals. Therefore BDM access is limited to access via the Nexus vendor-defined development support messages. READI DSCK DSDI DSDO RCPU development Mux Control Debug JTAG .. . .. . TCK / DSCK / MCKI BDM TDO / DSDO / MDO0 signals TDI / DSDI / MDI0 USIU RCPU Development Access Multiplexer Figure 24-78. RCPU Development Access Multiplexing between READI and BDM Signals 24.14.1 RCPU Development Access Messaging The following RCPU development access messages are used for handshaking between the device and the tool -- DSDI data message, DSDO data message, and BDM status message. 24.14.1.1 DSDI Message The DSDI message is used by the tool to download information to the RCPU. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-77 READI Module The DSDI data field has a 3-bit status header followed by 7 or 32 bits of data/instruction, depending on the RCPU development port mode. The DSDI message has the following format: [6 bits] [10 or 35 bits] TCODE (56) DSDI data Max Length = 41 bits Min Length = 16 bits Figure 24-79. DSDI Message Format NOTE When sending in a DSDI data message, the DSDI data should contain the control and status bits (start, mode, control), followed by the 7 or 32-bit CPU instruction/data or trap enable, MSB first. See Figure 24-85 for DSDI data message transmission sequence. 24.14.1.2 DSDO Message The DSDO message is used by the device to upload information from the RCPU. The DSDO data field has a 3-bit status header followed by 7 or 32 bits of data/instruction, depending on the RCPU development port mode. The three status bits in the DSDO data indicates if the device is ready to receive the next message from the tool. The DSDO message has the following format: [6 bits] [10 or 35 bits] TCODE (57) DSDO data Max Length = 41 bits Min Length = 16 bits Figure 24-80. DSDO Message Format NOTE The DSDO data received will contain the control and status bits and data from the CPU, MSB first. See Figure 24-85 for DSDO data message transmission sequence. 24.14.1.3 BDM Status Message BDM status message is generated by the device to let the tool know about the status of debug mode. BDM status message (with BDM status field equal to 0b1) is sent when the RCPU is in debug mode and the device is ready to receive debug mode messages. MPC561/MPC563 Reference Manual, Rev. 1.2 24-78 Freescale Semiconductor READI Module BDM status message (with BDM status field equal to 0b0) is sent out when the device exits BDM mode and RCPU is in normal operating mode. The BDM status message has the following format: [1 bit] [6 bits] TCODE (58) BDM Status Length = 7 bits Figure 24-81. BDM Status Message Format 24.14.1.4 Error Message (Invalid Message) An error message is sent out when an invalid message is received by READI. The error code within the error message indicates that an invalid TCODE was detected in the auxiliary input messages by the signal input formatter. Refer to Table 24-20. The error message has the following format: [5 bits] [6 bits] TCODE (8) Error Code (0b00100) Length = 11 bits Figure 24-82. Error Message (Invalid Message) Format 24.14.2 RCPU Development Access Operation The RCPU development access can be achieved either via the READI signals or the BDM signals. To enable RCPU development access via the READI signals, the tool has to configure the DC register during the READI reset (RSTI). Once the READI module takes the control of RCPU development access, the protocol for transmission of development serial data in (DSDI) and out (DSDO) is performed through the IEEE-ISTO 5001-1999 compliant vendor-defined messages. After enabling RCPU development access via the READI signals, the READI module can enable debug mode and enter debug mode. When debug mode is enabled and entered, READI sends a BDM status message (BDM status field equal to 0b1) to the development tool indicating that the RCPU has entered debug mode and is now expecting instructions from the READI signals. The development tool then uses the DSDI Data Message to send in the serial transmission data to READI. Data is transmitted to the tool using the DSDO data message. This process continues until the RCPU exits debug mode and READI sends the BDM status message (BDM status field equal to 0b0) indicating debug mode exit. NOTE Only after the DSDO data message is sent out should another DSDI data message be sent in. Synchronous self-clocked mode is selected by READI for RCPU development access. In this mode, the internal transmission between READI and the USIU is performed at system frequency. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-79 READI Module When the RCPU is in debug mode, program trace is not allowed. If program trace is enabled, a program trace synchronization message is generated when debug mode exits. When the RCPU is in debug mode, data trace and R/W access are allowed. The flow chart in Figure 24-83 shows RCPU development access configuration via READI. The modes of RCPU development access via READI are described below. Allowed modes are also summarized in Table 24-8 of Section 24.14.2.4, "RCPU Development Access Flow Diagram." 24.14.2.1 Enabling RCPU Development Access Via READI Signals Reset sequencing is done by the tool to initialize the READI signals and registers by asserting RSTI (the device sends out the device ID message after the RSTI negation). System reset is held by the tool until the READI module is reset and initialized with desired RCPU development access setting. NOTE The READI module will ignore any incoming DSDI data messages when the module is not configured for RCPU development access. 24.14.2.2 Entering Background Debug Mode (BDM) Via READI Signals There are three ways to enter debug mode (provided debug mode has been enabled): 1. Enter debug mode (halted state) out-of-system reset through READI module configuration. This is displayed in Figure 24-84. 2. Enter debug mode by downloading breakpoint instructions through RCPU development access when in non-debug (running) mode. 3. Enter debug mode if an exception or interrupt occurs. When entering debug mode following an exception/breakpoint, the RCPU signals VFLS[0:1] are equal to 0b11. This causes READI to send a BDM status message to the tool indicating that the RCPU has entered debug mode and is now expecting instructions from the READI signals. Debug mode enabling through READI and entering debug mode out of system reset is done by setting the following bits in the DC register (DME=0b1, DOR=0b1) during system reset. Debug mode entry causes RCPU to halt. 24.14.2.3 Non-Debug Mode Access of RCPU Development Access The RCPU development access can be also be used while the RCPU is not halted (in debug mode). This feature is used to send in breakpoints or synchronization events to the RCPU. Please refer to Chapter 23, "Development Support" for further details. Non-debug mode access of RCPU development can be achieved by configuring the READI module to take control of RCPU development access during module configuration of the DC register (DME=0b0, DOR=0bx). MPC561/MPC563 Reference Manual, Rev. 1.2 24-80 Freescale Semiconductor READI Module 24.14.2.4 RCPU Development Access Flow Diagram Figure 24-83 has flow diagram describing how the RCPU development access can be achieved via READI signals. *A* (@ subsequent READI reset) Tool Asserts and Negates RSTI Device sends DID message BDM CONFIGURATION OUT-OF-RESET *B* (@ subsequent RCPU reset) Tool sends Download Request Message and configures READI module (assign DPA, DME & DOR, etc.) Tools Negates HRESET 16 clocks after receiving Device Ready (DPA, DME, DOR, etc. bits locked) (Debug Mode not enabled) No (No Debug out-of-reset) No DSDI=1 (synch.self-clk mode) GENERIC RCPU DEVELOPMENT PROTOCOL Tool Asserts HRESET DME=1 ? Yes (Debug Mode enabled) DOR=1 ? DSDI=1 (sync. self-clk mode) DSCK=0 within 8 clocks of SRESET negation to NOT enter debug mode BDM Entry? Tool sends DSDI Message Yes (Debug out-of-reset) DSDI=1 (sync. self-clk mode) DSCK=1 until 16 clocks after SRESET negation to enter debug mode Yes No Device sends Debug Mode Status Message "BDM entry" (status bit = 1) Device sends DSDO Message *(exit loop via READI reset (*A*) or system reset (*B*)) *(exit loop via READI reset (*A*) or via system reset (*B*)) Tool sends DSDI Message Device sends DSDO Message BDM Exit? Yes No Device sends Debug Mode Status Message "BDM exit" (status bit = 0) DEBUG MODE NOT ENALBED (DME=0) DEBUG MODE ENABLED (DME=1) Figure 24-83. RCPU Development Access Flow Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-81 READI Module 24.14.3 Throughput The tool can send a DSDI data message into device upon the receipt of a DSDO data message as soon as the tool decodes the first two status bits of the DSDO data message just received and confirms valid data from the RCPU. An example throughput analysis is performed with the following assumptions: * READI configuration of RCPU development access and debug mode is already entered through READI * The module is configured for reduced port mode * MCKI running at 28 MHz * MCKO running at 56 MHz * 56-MHz internal operation * READI auxiliary input and output signals are free (not in middle of transmission) * No delay from tool in responding -- tool keeps up with READI port * Tool reads the complete DSDO data message before shifting in DSDI data message * 10 clocks estimated to format and encode/decode DSDI data and DSDO data messages within READI The DSDI data message is 41 bits (six bits of TCODE and 35 bits of DSDI data.). It takes 41 clocks (41 bits / 1 MDI signals) to shift in the DSDI data message. It is estimated that READI will take approximately 10 clocks to decode the DSDI data message. After the message has been decoded, READI will take 35 clocks to serially shift in the 35 bits of DSDI data to the RCPU development port. Hence, it takes a total of 86 clocks (41 + 10 + 35) to decode and shift in DSDI data from the tool to the RCPU development port. At 28 MHz, it translates to 3079 ns (35.8 x 81) to decode and shift in DSDI data to RCPU development port As DSDI bits are shifted into the RCPU development register, DSDO bits are shifted out from the same RCPU development register (DPDR) and these are captured by READI. It is estimated that READI will take approximately 10 clocks to encode the DSDO data. The DSDO message is 41 bits (6 bits of TCODE and 35 bits of DSDO data). It will take 21 clocks (41 bits / 2 MDO signals) for READI to transmit this message. Hence, it will take a total of 31 clocks (10 + 21) to encode the DSDO data message and shift out the DSDO data message to the tool. At 56 MHz, it will take 552 ns (17.8 x 31) to encode and shift out DSDO data to the tool. Thus, it will take 3631 ns (3079 + 552) for one complete DSDI data and DSDO data messaging cycle. 24.14.4 Development Access Timing Diagrams Figure 24-84 shows the timing diagram of RCPU development access and entering debug mode out-of-system reset through READI. MPC561/MPC563 Reference Manual, Rev. 1.2 24-82 Freescale Semiconductor READI Module HRESET (Tool drives) SRESET is negated by the MCU after some internal system clocks delay. Tool negates 3 HRESET at least 16 system clocks after receiving device ready msg SRESET (USIU drives) RSTI (Tool drives) 4 BDM is set based on READI module configuration and BDM Entry msg is sent out when VFLS[0:1]=11. Device sends out Dev ID 1 msg after negation of RSTI MSEI DC reg Config Msg (BDM) TC = 18 MDI DSDI Message TC = 56 2 DC reg. config msg (BDM) sent after DevID msg received by tool 5 DSDI msg sent after. BDM msg DSDI Message TC = 56 msg can be 7 DSDI sent to device after TCODE and two status bits in the DSDO msg indicate it is ready. MSEO MDO BDM ENTRY Message TC = 58 Device Ready Message TC = 16 Dev ID Message TC = 1 6 DSDO msg sent out DSDO Message TC = 57 DSDO Message TC = 57 BDM EXIT Message TC = 58 Figure 24-84. RCPU Development Access Timing Diagram -- Debug Mode Entry Out-of-Reset Figure 24-85 shows the transmission sequence of DSDI/DSDO data messages. 1 TCODE (6 bits) MSB 2 HEADER (3 bits) LSB MSB 3 DATA (7 or 32 bits) LSB MSB LSB Figure 24-85. Transmission Sequence of DSDx Data Messages MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-83 READI Module DSDI message fields of the development port access message are explained in Table 24-33. . Table 24-33. Development Port Access: DSDI Field Header Data Instruction / Data (32 Bits) Start Mode Function Control Bits 0:6 Bits 7:31 1 0 0 CPU Instruction Transfer Instruction to CPU 1 0 1 CPU Data Transfer Data to CPU 1 1 0 Trap enable Does not exist Transfer data to Trap Enable Control Register 1 1 1 0011111 Does not exist Negate breakpoint requests to the CPU. 1 1 1 0 Does not exist NOP DSDO message fields of the development port access message are explained in Table 24-34. Table 24-34. Development Port Access: DSDO Field Header Ready 1 2 Data Status [0:1] (0) 0 0 (0) 0 1 (0) 1 0 (0) 1 1 Bit 0 Bit 1 Data Freeze status1 Download Procedure in progress2 Function Bits 2:31 or 2:6 -- (Depending on Input Mode) Valid Data from CPU 1's Sequencing Error 1's CPU Interrupt 1's Null The "Freeze" status is set to (1) when the CPU is in debug mode and to (0) otherwise. The "Download Procedure in progress" status is asserted (0) when Debug port in the Download procedure and is negated (1) otherwise. MPC561/MPC563 Reference Manual, Rev. 1.2 24-84 Freescale Semiconductor READI Module MCKO MSEO MDO[7:0] 00001000 00000000 00000001 TCODE = 8 Error Code = 0b00100 (Invalid Message) Don't care data (idle clock) Figure 24-86. Error Message (Invalid Message) MCKI MSEI MDI[1:0] 00 10 11 11 11 10 TCODE = 56 (0x38) Header = (Start=1, Mode=1, Control=1) Data = 0b1011111 (Assert Non Maskable Breakpoint) 11 11 00 Don't care data (idle clock) Figure 24-87. DSDI Data Message (Assert Non-Maskable Breakpoint) MCKI MSEI MDI[1:0] 00 10 11 01 00 01 10 01 00 00 00 00 00 00 00 00 00 11 00 01 00 00 TCODE = 56 (0x38) Header = (Start=1, Mode=0, Control=0) Data = 0x4C000064 (rfi Instruction) Don't care data (idle clock) Figure 24-88. DSDI Data Message (CPU Instruction -- rfi) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 24-85 READI Module MCKO MSEO 00111001 11111110 MDO[7:0] 00000001 10101010 01011110 00000001 00000000 TCODE = 57 (0x39) Header = (Start=0, Mode=0, Control=0) Data = FF00AAF5 (CPU Data Out) Don't care data (idle clock) Figure 24-89. DSDO Data Message (CPU Data Out) 24.15 Power Management This section details the power management features of the READI module. The READI module is a development interface, and is not expected to function under normal (non-development) conditions. Therefore power management is required to reduce and minimize power consumption during normal operation of the part. 24.15.1 Functional Description The following are the candidates for power management: Table 24-35. Power Management Mechanism Overview Feature Power Saving Mechanism If EVTI is negated at negation of RSTI, the READI module will be disabled. No trace output will be provided, and output auxiliary port will be three-stated. Disabled Mode Sleep, Deep-Sleep and Low Power-Down Mode All outputs will be held static. Output auxiliary signals will be three-stated. READI Reset (RSTI) 24.15.2 Low Power Modes When the MCU is in sleep, deep-sleep, or low power-down mode, all internal clocks on the MCU are shut down, including the MCKO. The MSEO signal will be held negated. Low power mode entry for the MCU will be held off until the READI module has transmitted all existing messages (in the queues and transmit buffers). During this time, input messages from the development tool are ignored. Upon restoration of clocks in normal mode, program and data traces will be synchronized, if enabled. MPC561/MPC563 Reference Manual, Rev. 1.2 24-86 Freescale Semiconductor Chapter 25 IEEE 1149.1-Compliant Interface (JTAG) The chip design includes user-accessible test logic that is compatible with the IEEE 1149.1-1994 Standard Test Access Port and Boundary Scan Architecture. The implementation supports circuit-board test strategies based on this standard. An overview of the pins requirement on JTAG is shown in Figure 25-1. bsc ........... bsc TDI MPC561/MPC563 ....... TRST bsc ........... bsc ........... ........... TAP TMS JCOMP / RSTI TDO bsc TCK ........... ........... ...... bsc bsc Figure 25-1. Pin Requirement on JTAG 25.1 IEEE 1149.1 Test Access Port The MPC561/MPC563 provides a dedicated user-accessible test access port (TAP) that is compatible with the IEEE 1149.1 Standard Test Access Port and Boundary Scan Architecture in all but two areas listed below. Problems associated with testing high density circuit boards have led to development of this proposed standard under the sponsorship of the Test Technology Committee of IEEE and the Joint Test Action Group (JTAG). The MPC561/MPC563 implementation supports circuit-board test strategies based on this standard. IEEE1149.1 Compatibility Exceptions: * The MPC561/MPC563 enters JTAG mode by going through a standard device reset sequence with the JCOMP signal asserted high during PORESET negation. Once JTAG has been entered, the MPC561/MPC563 remains in JTAG mode until another reset sequence is applied to exit JTAG mode, or the device is powered down. * The JTAG output port, TDO, is configured with a weak pull-up until reset negates or the driver is disabled. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-1 IEEE 1149.1-Compliant Interface (JTAG) The TAP consists of five dedicated signal pins, a 16-state TAP controller, and two test data registers. A boundary scan register links all device signal pins into a single shift register. The test logic implemented utilizes static logic design. The MPC561/MPC563 implementation provides the capability to: 1. Perform boundary scan operations to test circuit-board electrical continuity. 2. Bypass the MPC561/MPC563 for a given circuit-board test by effectively reducing the boundary scan register to a single cell. 3. Sample the MPC561/MPC563 system pins during operation and transparently shift out the result in the boundary scan register. 4. Disable the output drive to pins during circuit-board testing. NOTE Certain precautions must be observed to ensure that the IEEE 1149-like test logic does not interfere with nontest operation. JCOMP must be low prior to PORESET assertion after low power mode exits, otherwise an unknown state will occur. 25.1.1 Overview An overview of the MPC561/MPC563 scan chain implementation is shown in Figure 25-2. The MPC561/MPC563 implementation includes a TAP controller, a 4-bit instruction register, and two test registers (a one-bit bypass register and a 427-bit (MPC563) or 423-bit (MPC561) boundary scan register). This implementation includes a dedicated TAP consisting of the following signals: * TCK -- a test clock input to synchronize the test logic. (with an internal pull-down resistor) * TMS -- a test mode select input (with an internal pullup resistor) that is sampled on the rising edge of TCK to sequence the TAP controller's state machine. * TDI -- a test data input (with an internal pullup resistor) that is sampled on the rising edge of TCK. * TDO -- a three-state test data output that is actively driven in the shift-IR and shift-DR controller states. TDO changes on the falling edge of TCK. (This pin also has a weak pull-up that is active when output drivers are disabled, except during a HI-Z instruction). * TRST -- an asynchronous reset with an internal pull-up resistor that provides initialization of the TAP controller and other logic required by the standard. This input is multiplexed with the PORESET signal. * JCOMP -- JTAG Compliancy - This signal provides JTAG IEEE1149.1 compatibility and selects between normal operation (low) and JTAG test mode (high). NOTE JTAG mode does not provide access to the internal MPC561/MPC563 circuitry. It allows access only to the input or output pad (periphery) circuitry. MPC561/MPC563 Reference Manual, Rev. 1.2 25-2 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Boundary scan register M U X TDI Bypass Instruction apply & decode register 3 2 1 0 4-bit Instruction register M U X TRST JCOMP / RSTI TMS TCK PORESET / TRST TDO TAP Controller Figure 25-2. Test Logic Block Diagram 25.1.2 Entering JTAG Mode To enable JTAG on reset for board test JCOMP/RSTI must be high on PORESET rising edge as shown in Figure 25-3. NOTE JTAG puts all output pins in fast slew rate mode. Enough current cannot be supplied to allow all the pins to be switched simultaneously, so this should be avoided. PORESET JCOMP/RSTI Configuration JTAG JTAG ON JTAG off/READI Config T Figure 25-3. JTAG Mode Selection MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-3 IEEE 1149.1-Compliant Interface (JTAG) 25.1.2.1 TAP Controller The TAP controller is responsible for interpreting the sequence of logical values on the TMS signal. It is a synchronous state machine that controls the operation of the JTAG logic. The state machine is shown in Figure 25-4. The value shown adjacent to each arc represents the value of the TMS signal sampled on the rising edge of the TCK signal. TEST LOGIC RESET 1 0 RUN-TEST/IDLE 1 SELECT-DR_SCAN 0 1 SELECT-IR_SCAN 0 1 0 1 CAPTURE-DR CAPTURE-IR 0 0 SHIFT-DR 1 SHIFT-IR 0 1 0 EXIT1-DR EXIT2-DR PAUSE-IR 0 1 0 1 UPDATE-DR 0 0 EXIT2-IR 1 1 1 0 PAUSE-DR 0 0 EXIT1-IR 0 1 1 UPDATE-IR 1 0 Figure 25-4. TAP Controller State Machine 25.1.2.2 Boundary Scan Register The MPC561/MPC563 scan chain implementation has a 427-bit (MPC563) or 423-bit (MPC561) boundary scan register. This register contains bits for most device signals, clock pins and associated control signals. The XTAL, EXTAL and XFC pins are associated with analog signals and are not included in the boundary scan register. The PORESET, HRESET, and SRESET pins are also excluded from the boundary scan register. MPC561/MPC563 Reference Manual, Rev. 1.2 25-4 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) The 520-bit boundary scan register can be connected between TDI and TDO by selecting the EXTEST or SAMPLE/PRELOAD instructions. This register is used to capturing signal pin data on the input pins, forcing fixed values on the output signal pins, and selecting the direction and drive characteristics (a logic value or high impedance) of the bidirectional and three-state signal pins. The key to using the boundary scan register is knowing the boundary scan bit order and the pins that are associated with them. Table 25-1 shows the bit order starting from the TDO output and going to the TDI input. Table 25-1 displays boundary scan bit definitions for the MPC561 and Table 25-2 displays boundary scan bit definitions for the MPC563. Table 25-1. MPC561 Boundary Scan Bit Definition Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 0 BC_2 * controlr 0 1 BC_7 B_CNRX0 bidir 0 2 BC_2 * internal 1 3 BC_2 B_CNTX0 output2 1 4 BC_2 * controlr 0 5 BC_7 B_TPUCH0 bidir 0 6 BC_2 * controlr 0 7 BC_7 B_TPUCH1 bidir 0 8 BC_2 * controlr 0 9 BC_7 B_TPUCH2 bidir 0 10 BC_2 * controlr 0 11 BC_7 B_TPUCH3 bidir 0 12 BC_2 * controlr 0 13 BC_7 B_TPUCH4 bidir 0 14 BC_2 * controlr 0 15 BC_7 B_TPUCH5 bidir 0 16 BC_2 * controlr 0 17 BC_7 B_TPUCH6 bidir 0 18 BC_2 * controlr 0 19 BC_7 B_TPUCH7 bidir 0 20 BC_2 * controlr 0 21 BC_7 B_TPUCH8 bidir 0 22 BC_2 * controlr 0 23 BC_7 B_TPUCH9 bidir 0 24 BC_2 * controlr 0 25 BC_7 B_TPUCH10 bidir 0 0 0 Z Pin Function Pad Type IO 5vfa O 5vfa 4 0 Z IO 5vsa 6 0 Z IO 5vsa 8 0 Z IO 5vsa 10 0 Z IO 5vsa 12 0 Z IO 5vsa 14 0 Z IO 5vsa 16 0 Z IO 5vsa 18 0 Z IO 5vsa 20 0 Z IO 5vsa 22 0 Z IO 5vsa 24 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-5 IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 26 BC_2 * controlr 0 27 BC_7 B_TPUCH11 bidir 0 28 BC_2 * controlr 0 29 BC_7 B_TPUCH12 bidir 0 30 BC_2 * controlr 0 31 BC_7 B_TPUCH13 bidir 0 32 BC_2 * controlr 0 33 BC_7 B_TPUCH14 bidir 0 34 BC_2 * controlr 0 35 BC_7 B_TPUCH15 bidir 0 36 BC_2 * controlr 0 37 BC_7 B_T2CLK_PCS4 bidir 0 38 BC_2 * controlr 0 39 BC_7 A_T2CLK_PCS5 bidir 0 40 BC_2 * controlr 0 41 BC_7 A_TPUCH0 bidir 0 42 BC_2 * controlr 0 43 BC_7 A_TPUCH1 bidir 0 44 BC_2 * controlr 0 45 BC_7 A_TPUCH2 bidir 0 46 BC_2 * controlr 0 47 BC_7 A_TPUCH3 bidir 0 48 BC_2 * controlr 0 49 BC_7 A_TPUCH4 bidir 0 50 BC_2 * controlr 0 51 BC_7 A_TPUCH5 bidir 0 52 BC_2 * controlr 0 53 BC_7 A_TPUCH6 bidir 0 54 BC_2 * controlr 0 55 BC_7 A_TPUCH7 bidir 0 56 BC_2 * controlr 0 57 BC_7 A_TPUCH8 bidir 0 58 BC_2 * controlr 0 59 BC_7 A_TPUCH9 bidir 0 60 BC_2 * controlr 0 61 BC_7 A_TPUCH10 bidir 0 Pin Function Pad Type 26 0 Z IO 5vsa 28 0 Z IO 5vsa 30 0 Z IO 5vsa 32 0 Z IO 5vsa 34 0 Z IO 5vsa 36 0 Z IO 5vfa 38 0 Z IO 5vfa 40 0 Z IO 5vsa 42 0 Z IO 5vsa 44 0 Z IO 5vsa 46 0 Z IO 5vsa 48 0 Z IO 5vsa 50 0 Z IO 5vsa 52 0 Z IO 5vsa 54 0 Z IO 5vsa 56 0 Z IO 5vsa 58 0 Z IO 5vsa 60 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 25-6 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 62 BC_2 * controlr 0 63 BC_7 A_TPUCH11 bidir 0 64 BC_2 * controlr 0 65 BC_7 A_TPUCH12 bidir 0 66 BC_2 * controlr 0 67 BC_7 A_TPUCH13 bidir 0 68 BC_2 * controlr 0 69 BC_7 A_TPUCH14 bidir 0 70 BC_2 * controlr 0 71 BC_7 A_TPUCH15 bidir 0 72 BC_2 * controlr 0 73 BC_7 A_AN0_ANW_PQB0 bidir 0 74 BC_2 * controlr 0 75 BC_7 A_AN1_ANX_PQB1 bidir 0 76 BC_2 * controlr 0 77 BC_7 A_AN2_ANY_PQB2 bidir 0 78 BC_2 * controlr 0 79 BC_7 A_AN3_ANZ_PQB3 bidir 0 80 BC_2 * controlr 0 81 BC_7 A_AN48_PQB4 bidir 0 82 BC_2 * controlr 0 83 BC_7 A_AN49_PQB5 bidir 0 84 BC_2 * controlr 0 85 BC_7 A_AN50_PQB6 bidir 0 86 BC_2 * controlr 0 87 BC_7 A_AN51_PQB7 bidir 0 88 BC_2 * controlr 0 89 BC_7 A_AN52_MA0_PQA0 bidir 0 90 BC_2 * controlr 0 91 BC_7 A_AN53_MA1_PQA1 bidir 0 92 BC_2 * controlr 0 93 BC_7 A_AN54_MA2_PQA2 bidir 0 94 BC_2 * controlr 0 95 BC_7 A_AN55_PQA3 bidir 0 96 BC_2 * controlr 0 97 BC_7 A_AN56_PQA4 bidir 0 Pin Function Pad Type 62 0 Z IO 5vsa 64 0 Z IO 5vsa 66 0 Z IO 5vsa 68 0 Z IO 5vsa 70 0 Z IO 5vsa 72 0 Z IO 5vsa 74 0 Z IO 5vsa 76 0 Z IO 5vsa 78 0 Z IO 5vsa 80 0 Z IO 5vsa 82 0 Z IO 5vsa 84 0 Z IO 5vsa 86 0 Z IO 5vsa 88 0 Z IO 5vsa 90 0 Z IO 5vsa 92 0 Z IO 5vsa 94 0 Z IO 5vsa 96 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-7 IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 98 BC_2 * controlr 0 99 BC_7 A_AN57_PQA5 bidir 0 100 BC_2 * controlr 0 101 BC_7 A_AN58_PQA6 bidir 0 102 BC_2 * controlr 0 103 BC_7 A_AN59_PQA7 bidir 0 104 BC_2 * controlr 0 105 BC_7 B_AN0_ANW_PQB0 bidir 0 106 BC_2 * controlr 0 107 BC_7 B_AN1_ANX_PQB1 bidir 0 108 BC_2 * controlr 0 109 BC_7 B_AN2_ANY_PQB2 bidir 0 110 BC_2 * controlr 0 111 BC_7 B_AN3_ANZ_PQB3 bidir 0 112 BC_2 * controlr 0 113 BC_7 B_AN48_PQB4 bidir 0 114 BC_2 * controlr 0 115 BC_7 B_AN49_PQB5 bidir 0 116 BC_2 * controlr 0 117 BC_7 B_AN50_PQB6 bidir 0 118 BC_2 * controlr 0 119 BC_7 B_AN51_PQB7 bidir 0 120 BC_2 * controlr 0 121 BC_7 B_AN52_MA0_PQA0 bidir 0 122 BC_2 * controlr 0 123 BC_7 B_AN53_MA1_PQA1 bidir 0 124 BC_2 * controlr 0 125 BC_7 B_AN54_MA2_PQA2 bidir 0 126 BC_2 * controlr 0 127 BC_7 B_AN55_PQA3 bidir 0 128 BC_2 * controlr 0 129 BC_7 B_AN56_PQA4 bidir 0 130 BC_2 * controlr 0 131 BC_7 B_AN57_PQA5 bidir 0 132 BC_2 * controlr 0 133 BC_7 B_AN58_PQA6 bidir 0 Pin Function Pad Type 98 0 Z IO 5vsa 100 0 Z IO 5vsa 102 0 Z IO 5vsa 104 0 Z IO 5vsa 106 0 Z IO 5vsa 108 0 Z IO 5vsa 110 0 Z IO 5vsa 112 0 Z IO 5vsa 114 0 Z IO 5vsa 116 0 Z IO 5vsa 118 0 Z IO 5vsa 120 0 Z IO 5vsa 122 0 Z IO 5vsa 124 0 Z IO 5vsa 126 0 Z IO 5vsa 128 0 Z IO 5vsa 130 0 Z IO 5vsa 132 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 25-8 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 134 BC_2 * controlr 0 135 BC_7 B_AN59_PQA7 bidir 0 136 BC_2 * controlr 0 137 BC_7 ETRIG2_PCS7 bidir 0 138 BC_2 * controlr 0 139 BC_7 ETRIG1_PCS6 bidir 0 140 BC_2 * controlr 0 141 BC_7 MDA11 bidir 0 142 BC_2 * controlr 0 143 BC_7 MDA12 bidir 0 144 BC_2 * controlr 0 145 BC_7 MDA13 bidir 0 146 BC_2 * controlr 0 147 BC_7 MDA14 bidir 0 148 BC_2 * controlr 0 149 BC_7 MDA15 bidir 0 150 BC_2 * controlr 0 151 BC_7 MDA27 bidir 0 152 BC_2 * controlr 0 153 BC_7 MDA28 bidir 0 154 BC_2 * controlr 0 155 BC_7 MDA29 bidir 0 156 BC_2 * controlr 0 157 BC_7 MDA30 bidir 0 158 BC_2 * controlr 0 159 BC_7 MDA31 bidir 0 160 BC_2 * controlr 0 161 BC_7 MPWM0_MDI1 bidir 0 162 BC_2 * controlr 0 163 BC_7 MPWM1_MDO2 bidir 0 164 BC_2 * controlr 0 165 BC_7 MPWM2_PPM_TX1 bidir 0 166 BC_2 * controlr 0 167 BC_7 MPWM3_PPM_RX1 bidir 0 168 BC_2 * controlr 0 169 BC_7 MPWM16 bidir 0 Pin Function Pad Type 134 0 Z IO 5vsa 136 0 Z IO 5vfa 138 0 Z IO 5vfa 140 0 Z IO 5vsa 142 0 Z IO 5vsa 144 0 Z IO 5vsa 146 0 Z IO 5vsa 148 0 Z IO 5vsa 150 0 Z IO 5vsa 152 0 Z IO 5vsa 154 0 Z IO 5vsa 156 0 Z IO 5vsa 158 0 Z IO 5vsa 160 0 Z IO 26v5vs 162 0 Z IO 26v5vs 164 0 Z IO 26v5vs 166 0 Z IO 26v5vs 168 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-9 IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 170 BC_2 * controlr 0 171 BC_7 MPWM17_MDO3 bidir 0 172 BC_2 * controlr 0 173 BC_7 MPWM18_MDO6 bidir 0 174 BC_2 * controlr 0 175 BC_7 MPWM19_MDO7 bidir 0 176 BC_2 * controlr 0 177 BC_7 MPIO32B5_MDO5 bidir 0 178 BC_2 * controlr 0 179 BC_7 MPIO32B6_MPWM4_MDO6 bidir 0 180 BC_2 * controlr 0 181 BC_7 MPIO32B7_MPWM5 bidir 0 182 BC_2 * controlr 0 183 BC_7 MPIO32B8_MPWM20 bidir 0 184 BC_2 * controlr 0 185 BC_7 MPIO32B9_MPWM21 bidir 0 186 BC_2 * controlr 0 187 BC_7 MPIO32B10_PPM_TSYNC bidir 0 188 BC_2 * controlr 0 189 BC_7 MPIO32B11_C_CNRX0 bidir 0 190 BC_2 * controlr 0 191 BC_7 MPIO32B12_C_CNTX0 bidir 0 192 BC_2 * controlr 0 193 BC_7 MPIO32B13_PPM_TCLK bidir 0 194 BC_2 * controlr 0 195 BC_7 MPIO32B14_PPM_RX0 bidir 0 196 BC_2 * controlr 0 197 BC_7 MPIO32B15_PPM_TX0 bidir 0 198 BC_2 * controlr 0 199 BC_7 VF0_MPIO32B0_MDO1 bidir 0 200 BC_2 * controlr 0 201 BC_7 VF1_MPIO32B1_MCKO bidir 0 202 BC_2 * controlr 0 203 BC_7 VF2_MPIO32B2_MSEI_B bidir 0 204 BC_2 * controlr 0 Pin Function Pad Type 170 0 Z IO 26v5vs 172 0 Z IO 26v5vs 174 0 Z IO 26v5vs 176 0 Z IO 26v5vs 178 0 Z IO 26v5vs 180 0 Z IO 5vsa 182 0 Z IO 5vsa 184 0 Z IO 5vsa 186 0 Z IO 26v5vs 188 0 Z IO 5vfa 190 0 Z IO 5vfa 192 0 Z IO 26v5vs 194 0 Z IO 26v5vs 196 0 Z IO 26v5vs 198 0 Z IO 26v5vs 200 0 Z IO 26v5vs 202 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-10 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Cell Type 205 BC_7 VFLS0_MPIO32B3_MSEO_ B bidir 0 206 BC_2 * controlr 0 207 BC_7 VFLS1_MPIO32B4 bidir 0 208 BC_2 * internal 1 209 BC_2 A_CNTX0 output2 1 210 BC_2 * internal 0 211 BC_4 A_CNRX0 input X 212 BC_2 * controlr 0 213 BC_7 PCS0_SS_B_QGPIO0 bidir 0 214 BC_2 * controlr 0 215 BC_7 PCS1_QGPIO1 bidir 0 216 BC_2 * controlr 0 217 BC_7 PCS2_QGPIO2 bidir 0 218 BC_2 * controlr 0 219 BC_7 PCS3_QGPIO3 bidir 0 220 BC_2 * controlr 0 221 BC_7 MISO_QGPIO4 bidir 0 222 BC_2 * controlr 0 223 BC_7 MOSI_QGPIO5 bidir 0 224 BC_2 * controlr 0 225 BC_7 SCK_QGPIO6 bidir 0 226 BC_2 * internal 0 227 BC_4 ECK input X 228 BC_2 * internal 1 229 BC_2 TXD1_QGPO1 output2 1 230 BC_2 * internal 1 231 BC_2 TXD2_QGPO2_C_CNTX0 output2 232 BC_4 RXD1_QGPI1 233 BC_4 234 Pin/Port Name BSDL Function Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Pin Function Pad Type 204 0 Z IO 26v5vs 206 0 Z IO 26v5vs I 5vfa O 5vfa 212 0 Z IO 5vfa 214 0 Z IO 5vfa 216 0 Z IO 5vfa 218 0 Z IO 5vfa 220 0 Z IO 5vh 222 0 Z IO 5vh 224 0 Z IO 5vh I 5vfa O 5vfa 1 O 5vfa input X I 5vido RXD2_QGPI2_C_CNRX0 input X I 5vido BC_2 * internal 1 235 BC_2 ENGCLK_BUCLK output2 1 O buff 236 BC_2 * internal 1 237 BC_2 CLKOUT output2 1 O 26vf 238 BC_4 EXTCLK input X I extclk 239 BC_2 * controlr 0 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-11 IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 240 BC_7 SRESET_B bidir 0 241 BC_2 * controlr 0 242 BC_7 HRESET_B bidir 0 243 BC_2 * controlr 0 244 BC_7 RSTCONF_B_TEXP bidir 0 245 BC_2 * controlr 0 246 BC_7 IRQ7_B_MODCK3 bidir 0 247 BC_2 * controlr 0 248 BC_7 IRQ6_B_MODCK2 bidir 0 249 BC_2 * controlr 0 250 BC_7 IRQ5_B_SGPIOC5_MODCK 1 bidir 0 251 BC_2 * controlr 0 252 BC_7 DATA_SGPIOD16 bidir 0 253 BC_2 * controlr 0 254 BC_7 DATA_SGPIOD17 bidir 0 255 BC_2 * controlr 0 256 BC_7 DATA_SGPIOD18 bidir 0 257 BC_2 * controlr 0 258 BC_7 DATA_SGPIOD14 bidir 0 259 BC_2 * controlr 0 260 BC_7 DATA_SGPIOD15 bidir 0 261 BC_2 * controlr 0 262 BC_7 DATA_SGPIOD19 bidir 0 263 BC_2 * controlr 0 264 BC_7 DATA_SGPIOD20 bidir 0 265 BC_2 * controlr 0 266 BC_7 DATA_SGPIOD12 bidir 0 267 BC_2 * controlr 0 268 BC_7 DATA_SGPIOD13 bidir 0 269 BC_2 * controlr 0 270 BC_7 DATA_SGPIOD21 bidir 0 271 BC_2 * controlr 0 272 BC_7 DATA_SGPIOD10 bidir 0 273 BC_2 * controlr 0 274 BC_7 DATA_SGPIOD11 bidir 0 Pin Function Pad Type 239 0 Z IO 26vc 241 0 Z IO 26vc 243 0 Z IO 26v 245 0 Z IO 26v 247 0 Z IO 26v 249 0 Z IO 26v 251 0 Z IO 26v5vs 253 0 Z IO 26v5vs 255 0 Z IO 26v5vs 257 0 Z IO 26v5vs 259 0 Z IO 26v5vs 261 0 Z IO 26v5vs 263 0 Z IO 26v5vs 265 0 Z IO 26v5vs 267 0 Z IO 26v5vs 269 0 Z IO 26v5vs 271 0 Z IO 26v5vs 273 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-12 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 275 BC_2 * controlr 0 276 BC_7 DATA_SGPIOD22 bidir 0 277 BC_2 * controlr 0 278 BC_7 DATA_SGPIOD23 bidir 0 279 BC_2 * controlr 0 280 BC_7 DATA_SGPIOD8 bidir 0 281 BC_2 * controlr 0 282 BC_7 DATA_SGPIOD9 bidir 0 283 BC_2 * controlr 0 284 BC_7 DATA_SGPIOD24 bidir 0 285 BC_2 * controlr 0 286 BC_7 DATA_SGPIOD25 bidir 0 287 BC_2 * controlr 0 288 BC_7 DATA_SGPIOD6 bidir 0 289 BC_2 * controlr 0 290 BC_7 DATA_SGPIOD7 bidir 0 291 BC_2 * controlr 0 292 BC_7 DATA_SGPIOD26 bidir 0 293 BC_2 * controlr 0 294 BC_7 DATA_SGPIOD27 bidir 0 295 BC_2 * controlr 0 296 BC_7 DATA_SGPIOD4 bidir 0 297 BC_2 * controlr 0 298 BC_7 DATA_SGPIOD5 bidir 0 299 BC_2 * controlr 0 300 BC_7 DATA_SGPIOD28 bidir 0 301 BC_2 * controlr 0 302 BC_7 DATA_SGPIOD29 bidir 0 303 BC_2 * controlr 0 304 BC_7 DATA_SGPIOD2 bidir 0 305 BC_2 * controlr 0 306 BC_7 DATA_SGPIOD3 bidir 0 307 BC_2 * controlr 0 308 BC_7 DATA_SGPIOD30 bidir 0 309 BC_2 * controlr 0 310 BC_7 DATA_SGPIOD0 bidir 0 Pin Function Pad Type 275 0 Z IO 26v5vs 277 0 Z IO 26v5vs 279 0 Z IO 26v5vs 281 0 Z IO 26v5vs 283 0 Z IO 26v5vs 285 0 Z IO 26v5vs 287 0 Z IO 26v5vs 289 0 Z IO 26v5vs 291 0 Z IO 26v5vs 293 0 Z IO 26v5vs 295 0 Z IO 26v5vs 297 0 Z IO 26v5vs 299 0 Z IO 26v5vs 301 0 Z IO 26v5vs 303 0 Z IO 26v5vs 305 0 Z IO 26v5vs 307 0 Z IO 26v5vs 309 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-13 IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 311 BC_2 * controlr 0 312 BC_7 DATA_SGPIOD1 bidir 0 313 BC_2 * controlr 0 314 BC_7 DATA_SGPIOD31 bidir 0 315 BC_2 * controlr 0 316 BC_7 ADDR_SGPIOA29 bidir 0 317 BC_2 * controlr 0 318 BC_7 ADDR_SGPIOA25 bidir 0 319 BC_2 * controlr 0 320 BC_7 ADDR_SGPIOA26 bidir 0 321 BC_2 * controlr 0 322 BC_7 ADDR_SGPIOA27 bidir 0 323 BC_2 * controlr 0 324 BC_7 ADDR_SGPIOA28 bidir 0 325 BC_2 * controlr 0 326 BC_7 ADDR_SGPIOA24 bidir 0 327 BC_2 * controlr 0 328 BC_7 ADDR_SGPIOA23 bidir 0 329 BC_2 * controlr 0 330 BC_7 ADDR_SGPIOA22 bidir 0 331 BC_2 * controlr 0 332 BC_7 ADDR_SGPIOA30 bidir 0 333 BC_2 * controlr 0 334 BC_7 ADDR_SGPIOA21 bidir 0 335 BC_2 * controlr 0 336 BC_7 ADDR_SGPIOA20 bidir 0 337 BC_2 * controlr 0 338 BC_7 ADDR_SGPIOA8 bidir 0 339 BC_2 * controlr 0 340 BC_7 ADDR_SGPIOA31 bidir 0 341 BC_2 * controlr 0 342 BC_7 ADDR_SGPIOA19 bidir 0 343 BC_2 * controlr 0 344 BC_7 ADDR_SGPIOA18 bidir 0 345 BC_2 * controlr 0 346 BC_7 ADDR_SGPIOA9 bidir 0 Pin Function Pad Type 311 0 Z IO 26v5vs 313 0 Z IO 26v5vs 315 0 Z IO 26v5vs 317 0 Z IO 26v5vs 319 0 Z IO 26v5vs 321 0 Z IO 26v5vs 323 0 Z IO 26v5vs 325 0 Z IO 26v5vs 327 0 Z IO 26v5vs 329 0 Z IO 26v5vs 331 0 Z IO 26v5vs 333 0 Z IO 26v5vs 335 0 Z IO 26v5vs 337 0 Z IO 26v5vs 339 0 Z IO 26v5vs 341 0 Z IO 26v5vs 343 0 Z IO 26v5vs 345 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-14 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 347 BC_2 * controlr 0 348 BC_7 ADDR_SGPIOA17 bidir 0 349 BC_2 * controlr 0 350 BC_7 ADDR_SGPIOA16 bidir 0 351 BC_2 * controlr 0 352 BC_7 ADDR_SGPIOA10 bidir 0 353 BC_2 * controlr 0 354 BC_7 ADDR_SGPIOA15 bidir 0 355 BC_2 * controlr 0 356 BC_7 ADDR_SGPIOA14 bidir 0 357 BC_2 * controlr 0 358 BC_7 ADDR_SGPIOA13 bidir 0 359 BC_2 * controlr 0 360 BC_7 ADDR_SGPIOA11 bidir 0 361 BC_2 * controlr 0 362 BC_7 ADDR_SGPIOA12 bidir 0 363 BC_2 * controlr 0 364 BC_7 BI_B_STS_B bidir 0 365 BC_2 * controlr 0 366 BC_7 BURST_B bidir 0 367 BC_2 * controlr 0 368 BC_7 BDIP_B bidir 0 369 BC_2 * controlr 0 370 BC_7 TA_B bidir 0 371 BC_2 * controlr 0 372 BC_7 TS_B bidir 0 373 BC_2 * controlr 0 374 BC_7 TSIZ1 bidir 0 375 BC_2 * controlr 0 376 BC_7 TSIZ0 bidir 0 377 BC_2 * controlr 0 378 BC_7 TEA_B bidir 0 379 BC_2 * internal 1 380 BC_2 OE_B output2 1 381 BC_2 * controlr 0 382 BC_7 RD_WR_B bidir 0 Pin Function Pad Type 347 0 Z IO 26v5vs 349 0 Z IO 26v5vs 351 0 Z IO 26v5vs 353 0 Z IO 26v5vs 355 0 Z IO 26v5vs 357 0 Z IO 26v5vs 359 0 Z IO 26v5vs 361 0 Z IO 26v5vs 363 0 Z IO 26v 365 0 Z IO 26v 367 0 Z IO 26v 369 0 Z IO 26v 371 0 Z IO 26v 373 0 Z IO 26v 375 0 Z IO 26v 377 0 Z IO 26v O 26v IO 26v 381 0 Z MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-15 IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 383 BC_2 * internal 1 384 BC_2 CS3_B output2 1 385 BC_2 * internal 1 386 BC_2 CS2_B output2 1 387 BC_2 * internal 1 388 BC_2 CS1_B output2 1 389 BC_2 * internal 1 390 BC_2 CS0_B output2 1 391 BC_2 * internal 1 392 BC_2 WE_B_AT3 output2 1 393 BC_2 * internal 1 394 BC_2 WE_B_AT2 output2 1 395 BC_2 * internal 1 396 BC_2 WE_B_AT1 output2 1 397 BC_2 * internal 1 398 BC_2 WE_B_AT0 output2 1 399 BC_2 * controlr 0 400 BC_7 BR_B_VF1_IWP2 bidir 0 401 BC_2 * controlr 0 402 BC_7 BG_B_VF0_LWP1 bidir 0 403 BC_2 * controlr 0 404 BC_7 BB_B_VF2_IWP3 bidir 0 405 BC_2 * controlr 0 406 BC_7 SGPIOC7_IRQOUT_B_LWP 0 bidir 0 407 BC_2 * controlr 0 408 BC_7 IRQ1_B_RSV_B_SGPIOC1 bidir 0 409 BC_2 * controlr 0 410 BC_7 IRQ0_B_SGPIOC0_MDO4 bidir 0 411 BC_2 * controlr 0 412 BC_7 IRQ2_B_CR_B_SGPIOC2_ MDO5_MTS_B bidir 0 413 BC_2 * controlr 0 414 BC_7 IRQ4_B_AT2_SGPIOC4 bidir 0 415 BC_2 * controlr 0 416 BC_7 IRQ3_B_KR_B_RETRY_B_ SGPIOC3 bidir 0 Pin Function Pad Type O 26v O 26v O 26v O 26v O 26v O 26v O 26v O 26v 399 0 Z IO 26v 401 0 Z IO 26v 403 0 Z IO 26v 405 0 Z IO 26v5vs 407 0 Z IO 26v5vs 409 0 Z IO 26v 411 0 Z IO 26v5vs 413 0 Z IO 26v5vs 415 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-16 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-1. MPC561 Boundary Scan Bit Definition (continued) Safe Contro Disable Disable Valu l Value Result e Cell BSDL Bit Cell Type Pin/Port Name BSDL Function 417 BC_2 * internal 1 418 BC_2 IWP0_VFLS0 output2 1 419 BC_2 * internal 1 420 BC_2 IWP1_VFLS1 output2 1 421 BC_2 * controlr 0 422 BC_7 SGPIOC6_FRZ_PTR_B bidir 0 421 0 Z Pin Function Pad Type O 26v O 26v IO 26v5vs Pin Functio n Pad Type IO 5vfa O 5vfa Table 25-2. MPC563 Boundary Scan Bit Definition BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 0 BC_2 * controlr 0 1 BC_7 B_CNRX0 bidir 0 2 BC_2 * internal 1 3 BC_2 B_CNTX0 output2 1 4 BC_2 * controlr 0 5 BC_7 B_TPUCH0 bidir 0 6 BC_2 * controlr 0 7 BC_7 B_TPUCH1 bidir 0 8 BC_2 * controlr 0 9 BC_7 B_TPUCH2 bidir 0 10 BC_2 * controlr 0 11 BC_7 B_TPUCH3 bidir 0 12 BC_2 * controlr 0 13 BC_7 B_TPUCH4 bidir 0 14 BC_2 * controlr 0 15 BC_7 B_TPUCH5 bidir 0 16 BC_2 * controlr 0 17 BC_7 B_TPUCH6 bidir 0 18 BC_2 * controlr 0 19 BC_7 B_TPUCH7 bidir 0 20 BC_2 * controlr 0 21 BC_7 B_TPUCH8 bidir 0 22 BC_2 * controlr 0 23 BC_7 B_TPUCH9 bidir 0 24 BC_2 * controlr 0 Contro Disabl Disable l e Value Cell Result 0 0 Z 4 0 Z IO 5vsa 6 0 Z IO 5vsa 8 0 Z IO 5vsa 10 0 Z IO 5vsa 12 0 Z IO 5vsa 14 0 Z IO 5vsa 16 0 Z IO 5vsa 18 0 Z IO 5vsa 20 0 Z IO 5vsa 22 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-17 IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 25 BC_7 B_TPUCH10 bidir 0 26 BC_2 * controlr 0 27 BC_7 B_TPUCH11 bidir 0 28 BC_2 * controlr 0 29 BC_7 B_TPUCH12 bidir 0 30 BC_2 * controlr 0 31 BC_7 B_TPUCH13 bidir 0 32 BC_2 * controlr 0 33 BC_7 B_TPUCH14 bidir 0 34 BC_2 * controlr 0 35 BC_7 B_TPUCH15 bidir 0 36 BC_2 * controlr 0 37 BC_7 B_T2CLK_PCS4 bidir 0 38 BC_2 * controlr 0 39 BC_7 A_T2CLK_PCS5 bidir 0 40 BC_2 * controlr 0 41 BC_7 A_TPUCH0 bidir 0 42 BC_2 * controlr 0 43 BC_7 A_TPUCH1 bidir 0 44 BC_2 * controlr 0 45 BC_7 A_TPUCH2 bidir 0 46 BC_2 * controlr 0 47 BC_7 A_TPUCH3 bidir 0 48 BC_2 * controlr 0 49 BC_7 A_TPUCH4 bidir 0 50 BC_2 * controlr 0 51 BC_7 A_TPUCH5 bidir 0 52 BC_2 * controlr 0 53 BC_7 A_TPUCH6 bidir 0 54 BC_2 * controlr 0 55 BC_7 A_TPUCH7 bidir 0 56 BC_2 * controlr 0 57 BC_7 A_TPUCH8 bidir 0 58 BC_2 * controlr 0 59 BC_7 A_TPUCH9 bidir 0 60 BC_2 * controlr 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 24 0 Z IO 5vsa 26 0 Z IO 5vsa 28 0 Z IO 5vsa 30 0 Z IO 5vsa 32 0 Z IO 5vsa 34 0 Z IO 5vsa 36 0 Z IO 5vfa 38 0 Z IO 5vfa 40 0 Z IO 5vsa 42 0 Z IO 5vsa 44 0 Z IO 5vsa 46 0 Z IO 5vsa 48 0 Z IO 5vsa 50 0 Z IO 5vsa 52 0 Z IO 5vsa 54 0 Z IO 5vsa 56 0 Z IO 5vsa 58 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 25-18 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 61 BC_7 A_TPUCH10 bidir 0 62 BC_2 * controlr 0 63 BC_7 A_TPUCH11 bidir 0 64 BC_2 * controlr 0 65 BC_7 A_TPUCH12 bidir 0 66 BC_2 * controlr 0 67 BC_7 A_TPUCH13 bidir 0 68 BC_2 * controlr 0 69 BC_7 A_TPUCH14 bidir 0 70 BC_2 * controlr 0 71 BC_7 A_TPUCH15 bidir 0 72 BC_2 * controlr 0 73 BC_7 A_AN0_ANW_PQB0 bidir 0 74 BC_2 * controlr 0 75 BC_7 A_AN1_ANX_PQB1 bidir 0 76 BC_2 * controlr 0 77 BC_7 A_AN2_ANY_PQB2 bidir 0 78 BC_2 * controlr 0 79 BC_7 A_AN3_ANZ_PQB3 bidir 0 80 BC_2 * controlr 0 81 BC_7 A_AN48_PQB4 bidir 0 82 BC_2 * controlr 0 83 BC_7 A_AN49_PQB5 bidir 0 84 BC_2 * controlr 0 85 BC_7 A_AN50_PQB6 bidir 0 86 BC_2 * controlr 0 87 BC_7 A_AN51_PQB7 bidir 0 88 BC_2 * controlr 0 89 BC_7 A_AN52_MA0_PQA0 bidir 0 90 BC_2 * controlr 0 91 BC_7 A_AN53_MA1_PQA1 bidir 0 92 BC_2 * controlr 0 93 BC_7 A_AN54_MA2_PQA2 bidir 0 94 BC_2 * controlr 0 95 BC_7 A_AN55_PQA3 bidir 0 96 BC_2 * controlr 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 60 0 Z IO 5vsa 62 0 Z IO 5vsa 64 0 Z IO 5vsa 66 0 Z IO 5vsa 68 0 Z IO 5vsa 70 0 Z IO 5vsa 72 0 Z IO 5vsa 74 0 Z IO 5vsa 76 0 Z IO 5vsa 78 0 Z IO 5vsa 80 0 Z IO 5vsa 82 0 Z IO 5vsa 84 0 Z IO 5vsa 86 0 Z IO 5vsa 88 0 Z IO 5vsa 90 0 Z IO 5vsa 92 0 Z IO 5vsa 94 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-19 IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 97 BC_7 A_AN56_PQA4 bidir 0 98 BC_2 * controlr 0 99 BC_7 A_AN57_PQA5 bidir 0 100 BC_2 * controlr 0 101 BC_7 A_AN58_PQA6 bidir 0 102 BC_2 * controlr 0 103 BC_7 A_AN59_PQA7 bidir 0 104 BC_2 * controlr 0 105 BC_7 B_AN0_ANW_PQB0 bidir 0 106 BC_2 * controlr 0 107 BC_7 B_AN1_ANX_PQB1 bidir 0 108 BC_2 * controlr 0 109 BC_7 B_AN2_ANY_PQB2 bidir 0 110 BC_2 * controlr 0 111 BC_7 B_AN3_ANZ_PQB3 bidir 0 112 BC_2 * controlr 0 113 BC_7 B_AN48_PQB4 bidir 0 114 BC_2 * controlr 0 115 BC_7 B_AN49_PQB5 bidir 0 116 BC_2 * controlr 0 117 BC_7 B_AN50_PQB6 bidir 0 118 BC_2 * controlr 0 119 BC_7 B_AN51_PQB7 bidir 0 120 BC_2 * controlr 0 121 BC_7 B_AN52_MA0_PQA0 bidir 0 122 BC_2 * controlr 0 123 BC_7 B_AN53_MA1_PQA1 bidir 0 124 BC_2 * controlr 0 125 BC_7 B_AN54_MA2_PQA2 bidir 0 126 BC_2 * controlr 0 127 BC_7 B_AN55_PQA3 bidir 0 128 BC_2 * controlr 0 129 BC_7 B_AN56_PQA4 bidir 0 130 BC_2 * controlr 0 131 BC_7 B_AN57_PQA5 bidir 0 132 BC_2 * controlr 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 96 0 Z IO 5vsa 98 0 Z IO 5vsa 100 0 Z IO 5vsa 102 0 Z IO 5vsa 104 0 Z IO 5vsa 106 0 Z IO 5vsa 108 0 Z IO 5vsa 110 0 Z IO 5vsa 112 0 Z IO 5vsa 114 0 Z IO 5vsa 116 0 Z IO 5vsa 118 0 Z IO 5vsa 120 0 Z IO 5vsa 122 0 Z IO 5vsa 124 0 Z IO 5vsa 126 0 Z IO 5vsa 128 0 Z IO 5vsa 130 0 Z IO 5vsa MPC561/MPC563 Reference Manual, Rev. 1.2 25-20 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 133 BC_7 B_AN58_PQA6 bidir 0 134 BC_2 * controlr 0 135 BC_7 B_AN59_PQA7 bidir 0 136 BC_2 * controlr 0 137 BC_7 ETRIG2_PCS7 bidir 0 138 BC_2 * controlr 0 139 BC_7 ETRIG1_PCS6 bidir 0 140 BC_2 * controlr 0 141 BC_7 MDA11 bidir 0 142 BC_2 * controlr 0 143 BC_7 MDA12 bidir 0 144 BC_2 * controlr 0 145 BC_7 MDA13 bidir 0 146 BC_2 * controlr 0 147 BC_7 MDA14 bidir 0 148 BC_2 * controlr 0 149 BC_7 MDA15 bidir 0 150 BC_2 * controlr 0 151 BC_7 MDA27 bidir 0 152 BC_2 * controlr 0 153 BC_7 MDA28 bidir 0 154 BC_2 * controlr 0 155 BC_7 MDA29 bidir 0 156 BC_2 * controlr 0 157 BC_7 MDA30 bidir 0 158 BC_2 * controlr 0 159 BC_7 MDA31 bidir 0 160 BC_2 * controlr 0 161 BC_7 MPWM0_MDI1 bidir 0 162 BC_2 * controlr 0 163 BC_7 MPWM1_MDO2 bidir 0 164 BC_2 * controlr 0 165 BC_7 MPWM2_PPM_TX1 bidir 0 166 BC_2 * controlr 0 167 BC_7 MPWM3_PPM_RX1 bidir 0 168 BC_2 * controlr 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 132 0 Z IO 5vsa 134 0 Z IO 5vsa 136 0 Z IO 5vfa 138 0 Z IO 5vfa 140 0 Z IO 5vsa 142 0 Z IO 5vsa 144 0 Z IO 5vsa 146 0 Z IO 5vsa 148 0 Z IO 5vsa 150 0 Z IO 5vsa 152 0 Z IO 5vsa 154 0 Z IO 5vsa 156 0 Z IO 5vsa 158 0 Z IO 5vsa 160 0 Z IO 26v5vs 162 0 Z IO 26v5vs 164 0 Z IO 26v5vs 166 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-21 IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 169 BC_7 MPWM16 bidir 0 170 BC_2 * controlr 0 171 BC_7 MPWM17_MDO3 bidir 0 172 BC_2 * controlr 0 173 BC_7 MPWM18_MDO6 bidir 0 174 BC_2 * controlr 0 175 BC_7 MPWM19_MDO7 bidir 0 176 BC_2 * controlr 0 177 BC_7 MPIO32B5_MDO5 bidir 0 178 BC_2 * controlr 0 179 BC_7 MPIO32B6_MPWM4_MDO6 bidir 0 180 BC_2 * controlr 0 181 BC_7 MPIO32B7_MPWM5 bidir 0 182 BC_2 * controlr 0 183 BC_7 MPIO32B8_MPWM20 bidir 0 184 BC_2 * controlr 0 185 BC_7 MPIO32B9_MPWM21 bidir 0 186 BC_2 * controlr 0 187 BC_7 MPIO32B10_PPM_TSYNC bidir 0 188 BC_2 * controlr 0 189 BC_7 MPIO32B11_C_CNRX0 bidir 0 190 BC_2 * controlr 0 191 BC_7 MPIO32B12_C_CNTX0 bidir 0 192 BC_2 * controlr 0 193 BC_7 MPIO32B13_PPM_TCLK bidir 0 194 BC_2 * controlr 0 195 BC_7 MPIO32B14_PPM_RX0 bidir 0 196 BC_2 * controlr 0 197 BC_7 MPIO32B15_PPM_TX0 bidir 0 198 BC_2 * controlr 0 199 BC_7 VF0_MPIO32B0_MDO1 bidir 0 200 BC_2 * controlr 0 201 BC_7 VF1_MPIO32B1_MCKO bidir 0 202 BC_2 * controlr 0 203 BC_7 VF2_MPIO32B2_MSEI_B bidir 0 204 BC_2 * controlr 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 168 0 Z IO 5vsa 170 0 Z IO 26v5vs 172 0 Z IO 26v5vs 174 0 Z IO 26v5vs 176 0 Z IO 26v5vs 178 0 Z IO 26v5vs 180 0 Z IO 5vsa 182 0 Z IO 5vsa 184 0 Z IO 5vsa 186 0 Z IO 26v5vs 188 0 Z IO 5vfa 190 0 Z IO 5vfa 192 0 Z IO 26v5vs 194 0 Z IO 26v5vs 196 0 Z IO 26v5vs 198 0 Z IO 26v5vs 200 0 Z IO 26v5vs 202 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-22 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type BSDL Function Safe Value 205 BC_7 VFLS0_MPIO32B3_MSEO_ B bidir 0 206 BC_2 * controlr 0 207 BC_7 VFLS1_MPIO32B4 bidir 0 208 BC_2 * internal 1 209 BC_2 A_CNTX0 output2 1 210 BC_2 * internal 0 211 BC_4 A_CNRX0 input X 212 BC_2 * controlr 0 213 BC_7 PCS0_SS_B_QGPIO0 bidir 0 214 BC_2 * controlr 0 215 BC_7 PCS1_QGPIO1 bidir 0 216 BC_2 * controlr 0 217 BC_7 PCS2_QGPIO2 bidir 0 218 BC_2 * controlr 0 219 BC_7 PCS3_QGPIO3 bidir 0 220 BC_2 * controlr 0 221 BC_7 MISO_QGPIO4 bidir 0 222 BC_2 * controlr 0 223 BC_7 MOSI_QGPIO5 bidir 0 224 BC_2 * controlr 0 225 BC_7 SCK_QGPIO6 bidir 0 226 BC_2 * internal 0 227 BC_4 ECK input X 228 BC_2 * internal 1 229 BC_2 TXD1_QGPO1 output2 1 230 BC_2 * internal 1 231 BC_2 TXD2_QGPO2_C_CNTX0 output2 232 BC_4 RXD1_QGPI1 233 BC_4 234 Pin/Port Name Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 204 0 Z IO 26v5vs 206 0 Z IO 26v5vs O 5vfa I 5vfa 212 0 Z IO 5vfa 214 0 Z IO 5vh 216 0 Z IO 5vh 218 0 Z IO 5vh 220 0 Z IO 5vh 222 0 Z IO 5vh 224 0 Z IO 5vh I vfa O vfa 1 O vfa input X I 5vido RXD2_QGPI2_C_CNRX0 input X I 5vido BC_2 * internal 0 235 BC_4 B0EPEE input X 236 BC_2 * internal 0 237 BC_4 EPEE input X 238 BC_2 * internal 1 239 BC_2 ENGCLK_BUCLK output2 1 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-23 IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 1 O 26vf input X I extclk * controlr 0 BC_7 SRESET_B bidir 0 245 BC_2 * controlr 0 246 BC_7 HRESET_B bidir 0 247 BC_2 * controlr 0 248 BC_7 RSTCONF_B_TEXP bidir 0 249 BC_2 * controlr 0 250 BC_7 IRQ7_B_MODCK3 bidir 0 251 BC_2 * controlr 0 252 BC_7 IRQ6_B_MODCK2 bidir 0 253 BC_2 * controlr 0 254 BC_7 IRQ5_B_SGPIOC5_MODCK 1 bidir 0 255 BC_2 * controlr 0 256 BC_7 DATA_SGPIOD16 bidir 0 257 BC_2 * controlr 0 258 BC_7 DATA_SGPIOD17 bidir 0 259 BC_2 * controlr 0 260 BC_7 DATA_SGPIOD18 bidir 0 261 BC_2 * controlr 0 262 BC_7 DATA_SGPIOD14 bidir 0 263 BC_2 * controlr 0 264 BC_7 DATA_SGPIOD15 bidir 0 265 BC_2 * controlr 0 266 BC_7 DATA_SGPIOD19 bidir 0 267 BC_2 * controlr 0 268 BC_7 DATA_SGPIOD20 bidir 0 269 BC_2 * controlr 0 270 BC_7 DATA_SGPIOD12 bidir 0 271 BC_2 * controlr 0 272 BC_7 DATA_SGPIOD13 bidir 0 273 BC_2 * controlr 0 274 BC_7 DATA_SGPIOD21 bidir 0 BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 240 BC_2 * internal 1 241 BC_2 CLKOUT output2 242 BC_4 EXTCLK 243 BC_2 244 243 0 Z IO 26vc 245 0 Z IO 26vc 247 0 Z IO 26v 249 0 Z IO 26v 251 0 Z IO 26v 253 0 Z IO 26v 255 0 Z IO 26v5vs 257 0 Z IO 26v5vs 259 0 Z IO 26v5vs 261 0 Z IO 26v5vs 263 0 Z IO 26v5vs 265 0 Z IO 26v5vs 267 0 Z IO 26v5vs 269 0 Z IO 26v5vs 271 0 Z IO 26v5vs 273 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-24 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 275 BC_2 * controlr 0 276 BC_7 DATA_SGPIOD10 bidir 0 277 BC_2 * controlr 0 278 BC_7 DATA_SGPIOD11 bidir 0 279 BC_2 * controlr 0 280 BC_7 DATA_SGPIOD22 bidir 0 281 BC_2 * controlr 0 282 BC_7 DATA_SGPIOD23 bidir 0 283 BC_2 * controlr 0 284 BC_7 DATA_SGPIOD8 bidir 0 285 BC_2 * controlr 0 286 BC_7 DATA_SGPIOD9 bidir 0 287 BC_2 * controlr 0 288 BC_7 DATA_SGPIOD24 bidir 0 289 BC_2 * controlr 0 290 BC_7 DATA_SGPIOD25 bidir 0 291 BC_2 * controlr 0 292 BC_7 DATA_SGPIOD6 bidir 0 293 BC_2 * controlr 0 294 BC_7 DATA_SGPIOD7 bidir 0 295 BC_2 * controlr 0 296 BC_7 DATA_SGPIOD26 bidir 0 297 BC_2 * controlr 0 298 BC_7 DATA_SGPIOD27 bidir 0 299 BC_2 * controlr 0 300 BC_7 DATA_SGPIOD4 bidir 0 301 BC_2 * controlr 0 302 BC_7 DATA_SGPIOD5 bidir 0 303 BC_2 * controlr 0 304 BC_7 DATA_SGPIOD28 bidir 0 305 BC_2 * controlr 0 306 BC_7 DATA_SGPIOD29 bidir 0 307 BC_2 * controlr 0 308 BC_7 DATA_SGPIOD2 bidir 0 309 BC_2 * controlr 0 310 BC_7 DATA_SGPIOD3 bidir 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 275 0 Z IO 26v5vs 277 0 Z IO 26v5vs 279 0 Z IO 26v5vs 281 0 Z IO 26v5vs 283 0 Z IO 26v5vs 285 0 Z IO 26v5vs 287 0 Z IO 26v5vs 289 0 Z IO 26v5vs 291 0 Z IO 26v5vs 293 0 Z IO 26v5vs 295 0 Z IO 26v5vs 297 0 Z IO 26v5vs 299 0 Z IO 26v5vs 301 0 Z IO 26v5vs 303 0 Z IO 26v5vs 305 0 Z IO 26v5vs 307 0 Z IO 26v5vs 309 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-25 IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 311 BC_2 * controlr 0 312 BC_7 DATA_SGPIOD30 bidir 0 313 BC_2 * controlr 0 314 BC_7 DATA_SGPIOD0 bidir 0 315 BC_2 * controlr 0 316 BC_7 DATA_SGPIOD1 bidir 0 317 BC_2 * controlr 0 318 BC_7 DATA_SGPIOD31 bidir 0 319 BC_2 * controlr 0 320 BC_7 ADDR_SGPIOA29 bidir 0 321 BC_2 * controlr 0 322 BC_7 ADDR_SGPIOA25 bidir 0 323 BC_2 * controlr 0 324 BC_7 ADDR_SGPIOA26 bidir 0 325 BC_2 * controlr 0 326 BC_7 ADDR_SGPIOA27 bidir 0 327 BC_2 * controlr 0 328 BC_7 ADDR_SGPIOA28 bidir 0 329 BC_2 * controlr 0 330 BC_7 ADDR_SGPIOA24 bidir 0 331 BC_2 * controlr 0 332 BC_7 ADDR_SGPIOA23 bidir 0 333 BC_2 * controlr 0 334 BC_7 ADDR_SGPIOA22 bidir 0 335 BC_2 * controlr 0 336 BC_7 ADDR_SGPIOA30 bidir 0 337 BC_2 * controlr 0 338 BC_7 ADDR_SGPIOA21 bidir 0 339 BC_2 * controlr 0 340 BC_7 ADDR_SGPIOA20 bidir 0 341 BC_2 * controlr 0 342 BC_7 ADDR_SGPIOA8 bidir 0 343 BC_2 * controlr 0 344 BC_7 ADDR_SGPIOA31 bidir 0 345 BC_2 * controlr 0 346 BC_7 ADDR_SGPIOA19 bidir 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 311 0 Z IO 26v5vs 313 0 Z IO 26v5vs 315 0 Z IO 26v5vs 317 0 Z IO 26v5vs 319 0 Z IO 26v5vs 321 0 Z IO 26v5vs 323 0 Z IO 26v5vs 325 0 Z IO 26v5vs 327 0 Z IO 26v5vs 329 0 Z IO 26v5vs 331 0 Z IO 26v5vs 333 0 Z IO 26v5vs 335 0 Z IO 26v5vs 337 0 Z IO 26v5vs 339 0 Z IO 26v5vs 341 0 Z IO 26v5vs 343 0 Z IO 26v5vs 345 0 Z IO 26v5vs MPC561/MPC563 Reference Manual, Rev. 1.2 25-26 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 347 BC_2 * controlr 0 348 BC_7 ADDR_SGPIOA18 bidir 0 349 BC_2 * controlr 0 350 BC_7 ADDR_SGPIOA9 bidir 0 351 BC_2 * controlr 0 352 BC_7 ADDR_SGPIOA17 bidir 0 353 BC_2 * controlr 0 354 BC_7 ADDR_SGPIOA16 bidir 0 355 BC_2 * controlr 0 356 BC_7 ADDR_SGPIOA10 bidir 0 357 BC_2 * controlr 0 358 BC_7 ADDR_SGPIOA15 bidir 0 359 BC_2 * controlr 0 360 BC_7 ADDR_SGPIOA14 bidir 0 361 BC_2 * controlr 0 362 BC_7 ADDR_SGPIOA13 bidir 0 363 BC_2 * controlr 0 364 BC_7 ADDR_SGPIOA11 bidir 0 365 BC_2 * controlr 0 366 BC_7 ADDR_SGPIOA12 bidir 0 367 BC_2 * controlr 0 368 BC_7 BI_B_STS_B bidir 0 369 BC_2 * controlr 0 370 BC_7 BURST_B bidir 0 371 BC_2 * controlr 0 372 BC_7 BDIP_B bidir 0 373 BC_2 * controlr 0 374 BC_7 TA_B bidir 0 375 BC_2 * controlr 0 376 BC_7 TS_B bidir 0 377 BC_2 * controlr 0 378 BC_7 TSIZ1 bidir 0 379 BC_2 * controlr 0 380 BC_7 TSIZ0 bidir 0 381 BC_2 * controlr 0 382 BC_7 TEA_B bidir 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 347 0 Z IO 26v5vs 349 0 Z IO 26v5vs 351 0 Z IO 26v5vs 353 0 Z IO 26v5vs 355 0 Z IO 26v5vs 357 0 Z IO 26v5vs 359 0 Z IO 26v5vs 361 0 Z IO 26v5vs 363 0 Z IO 26v5vs 365 0 Z IO 26v5vs 367 0 Z IO 26v 369 0 Z IO 26v 371 0 Z IO 26v 373 0 Z IO 26v 375 0 Z IO 26v 377 0 Z IO 26v 379 0 Z IO 26v 381 0 Z IO 26v MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-27 IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 383 BC_2 * internal 1 384 BC_2 OE_B output2 1 385 BC_2 * controlr 0 386 BC_7 RD_WR_B bidir 0 387 BC_2 * internal 1 388 BC_2 CS3_B output2 1 389 BC_2 * internal 1 390 BC_2 CS2_B output2 1 391 BC_2 * internal 1 392 BC_2 CS1_B output2 1 393 BC_2 * internal 1 394 BC_2 CS0_B output2 1 395 BC_2 * internal 1 396 BC_2 WE_B_AT3 output2 1 397 BC_2 * internal 1 398 BC_2 WE_B_AT2 output2 1 399 BC_2 * internal 1 400 BC_2 WE_B_AT1 output2 1 401 BC_2 * internal 1 402 BC_2 WE_B_AT0 output2 1 403 BC_2 * controlr 0 404 BC_7 BR_B_VF1_IWP2 bidir 0 405 BC_2 * controlr 0 406 BC_7 BG_B_VF0_LWP1 bidir 0 407 BC_2 * controlr 0 408 BC_7 BB_B_VF2_IWP3 bidir 0 409 BC_2 * controlr 0 410 BC_7 SGPIOC7_IRQOUT_B_LWP 0 bidir 0 411 BC_2 * controlr 0 412 BC_7 IRQ1_B_RSV_B_SGPIOC1 bidir 0 413 BC_2 * controlr 0 414 BC_7 IRQ0_B_SGPIOC0_MDO4 bidir 0 415 BC_2 * controlr 0 416 BC_7 IRQ2_B_CR_B_SGPIOC2_| MDO5_MTS_B bidir 0 Contro Disabl Disable l e Value Cell Result 385 0 Z Pin Functio n Pad Type O 26v IO 26v O 26v O 26v O 26v O 26v O 26v O 26v O 26v O 26v 403 0 Z IO 26v 405 0 Z IO 26v 407 0 Z IO 26v 409 0 Z IO 26v 411 0 Z IO 26v5vs 413 0 Z IO 26v5vs 415 0 Z IO 26v MPC561/MPC563 Reference Manual, Rev. 1.2 25-28 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) Table 25-2. MPC563 Boundary Scan Bit Definition (continued) BSDL Bit Cell Type Pin/Port Name BSDL Function Safe Value 417 BC_2 * controlr 0 418 BC_7 IRQ4_B_AT2_SGPIOC4 bidir 0 419 BC_2 * controlr 0 420 BC_7 IRQ3_B_KR_B_RETRY_B_ SGPIOC3 bidir 0 421 BC_2 * internal 1 422 BC_2 IWP0_VFLS0 output2 1 423 BC_2 * internal 1 424 BC_2 IWP1_VFLS1 output2 1 425 BC_2 * controlr 0 426 BC_7 SGPIOC6_FRZ_PTR_B bidir 0 Contro Disabl Disable l e Value Cell Result Pin Functio n Pad Type 417 0 Z IO 26v5vs 419 0 Z IO 26v5vs O 26v O 26v IO 26v5vs 425 0 Z 1.Bi-state outputs (Pin Function = O) such as mdo_2, and mdo_3, are incorporated with general I/O pads hard-wired to keep output enable always on in system mode. The JTAG Control cell, indicated by the next lower bsdl bit in the chain, is configured as an "internal" only cell to be held at a "1" value (always driving out) during JTAG testing. 2. Some input-only cells made with generic I/O pads are configured with "internal" control cells to keep them always in input mode, such as epee, b0epee, and input pins that may be attached to analog references. Other input-only cells are configured as bidirectional for JTAG testing, to give the board-level ATPG tools the flexability to use the pad as an input or output, depending on the network of other devices that the pin is connected too. If it is desired to restrict these pins to only act as receivers during JTAG mode, then these JTAG bsdl entries can be converted as shown in the example below: 3. This description allows ATPG tools to use a pin as a driver or receiver: 188 BC_2 * controlr 0 189 BC_7 irq6_b_modck2 bidir 0 188 0 Z I 26v I 26v 4. A modification to restrict ATPG tools to use a functional input-only pin as an input receiver only:. 188 BC_2 * internal 0 189 BC_4 irq6_b_modck2 input X 5. The PORESET, HRESET, and SRESET pins are not part of the JTAG boundary scan chain. These pins are used in the reset configuration to enter JTAG. Board-level connections to them will not be testable with the EXTEST and CLAMP instructions. They do respond to the HI-Z JTAG instruction for parametric testing purposes.6. 6. The XTAL, EXTAL, and XFC pins are associated with analog signals and are excluded from the boundary scan chain. 7. The READI module reset pin, rsti_b, (bsdl pin 517) is in the JTAG boundary scan chain, but must be kept at a "0" level during JTAG testing, (except for Hi-Z testing), due to system interactions. It is classified as a "linkage" pin, and its data and control cells are configured to advise ATPG tools to drive a "0" value in during JTAG testing. 8. Pad type naming conventions: *26 V - 2.6 V *5 V - 5 V *s - slow *f - fast *h - high drive *a - analog input *i - input only *d - has direct connection to the pad (may be used for module test) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-29 IEEE 1149.1-Compliant Interface (JTAG) *r - resized cell instance 9. Column Descriptions: *Columns 1 through 8 are entries from the boundary-scan description from the BSDL file. The columns and formats for each of these entries are defined in the IEEE Std. 1149.1b-1994 Supplement to the IEEE Std. 1149.1-1990, IEEE Standard Test Access Port and Boundary-Scan Architecture document. Descriptions of these columns are described below: *Column 1: Defines the bit's ordinal position in the boundary scan register. The shift register cell nearest TDO (i.e., first to be shifted in) is defined as bit 0; the last bit to be shifted in is 519. *Column 2: References one of the three standard JTAG Cell Types (BC_4, BC_2, and BC_7) that are used for this JTAG cell in the MPC561/MPC563. See the IEEE Std. 1149.1-1990, IEEE Standard Test Access Port and Boundary-Scan Architecture document for further description of these standard cell types. *Column 3: Lists the pin name (also called the PortID) for all pin-related cells. For JTAG control cells or data cells that have been designated as "internal", an asterisk, is shown in this column. *Column 4: Lists the BSDL pin function. *Column 5: The "safe bit" column specifies the value that should be loaded into the capture (and update) flip-flop of a given cell when board-level test generation software might otherwise choose a value randomly. *Column 6: The "control cell" column identifies the cell number of the control cell that is associated with this data cell, and can disable its output. *Column 7: The "disable value" column gives the value that must be scanned into the control cell identified by the previous "control cell" (column 6) to disable the port named by the relevant portID. *Column 8: The "disable result" column identifies a given signal value of the PortID if that signal can be disabled. The values shown specifies the condition of the driver of that signal when it is disabled. *Column 9: The "pin function" column indicates the normal system pin directionality. (- Input Only Pin, O - Output Only Pin, I/O - Bidirectional I/O pin) *Column 10: The pad type column describes relevant characteristics about each pad type. See the Pad Type Keys in Note 5 above. 25.1.3 Instruction Register The MPC561/MPC563 JTAG implementation includes the public instructions (EXTEST, SAMPLE/PRELOAD, and BYPASS), and also supports the CLAMP instruction. One additional public instruction (HI-Z) provides the capability for disabling all device output drivers. The MPC561/MPC563 includes a 4-bit instruction register without parity consisting of a shift register with four parallel outputs. Data is transferred from the shift register to the parallel outputs during the update-IR controller state. The four bits are used to decode the five unique instructions listed in. Table 25-3. Instruction Decoding Code 1 B3 B2 B1 B01 Instruction 0 0 0 0 EXTEST 0 0 0 1 SAMPLE/PRELOAD 0 X 1 X BYPASS 0 1 0 0 HI-Z 0 1 0 1 CLAMP and BYPASS B0 (LSB) is shifted first The parallel output of the instruction register is reset to all ones in the test-logic-reset controller state. NOTE This preset state is equivalent to the BYPASS instruction. MPC561/MPC563 Reference Manual, Rev. 1.2 25-30 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) During the capture-IR controller state, the parallel inputs to the instruction shift register are loaded with the CLAMP command code. 25.1.3.1 EXTEST The external test (EXTEST) instruction selects the 520-bit boundary scan register. EXTEST also asserts internal reset for the MPC561/MPC563 system logic to force a predictable beginning internal state while performing external boundary scan operations. By using the TAP, the register is capable of: a) scanning user-defined values into the output buffers b) capturing values presented to input pins c) controlling the output drive of three-state output or bidirectional pins 25.1.3.2 SAMPLE/PRELOAD The SAMPLE/PRELOAD instruction initializes the boundary scan register output cells prior to selection of EXTEST. This initialization ensures that known data will appear on the outputs when entering the EXTEST instruction. The SAMPLE/PRELOAD instruction also provides a means to obtain a snapshot of system data and control signals. NOTE Since there is no internal synchronization between the scan chain clock (TCK) and the system clock (CLKOUT), there must be provision of some form of external synchronization to achieve meaningful results. 25.1.3.3 BYPASS The BYPASS instruction selects the single-bit bypass register as shown in Figure 25-5. This creates a shift register path from TDI to the bypass register and, finally, to TDO, circumventing the 520-bit boundary scan register. This instruction is used to enhance test efficiency when a component other than the MPC561/MPC563 becomes the device under test. SHIFT DR 0 FROM TDI G1 1 TO TDO D Mux C 1 CLOCK DR Figure 25-5. Bypass Register When the bypass register is selected by the current instruction, the shift register stage is set to a logic zero on the rising edge of TCK in the capture-DR controller state. Therefore, the first bit to be shifted out after selecting the bypass register will always be a logic zero. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-31 IEEE 1149.1-Compliant Interface (JTAG) 25.1.3.4 CLAMP The CLAMP instruction selects the single-bit bypass register as shown in Figure 25-5, and the state of all signals driven from system output pins is completely defined by the data previously shifted into the boundary scan register (for example, using the SAMPLE/PRELOAD instruction). 25.1.4 HI-Z The HI-Z instruction is provided as a manufacturer's optional public instruction to prevent having to backdrive the output pins during circuit-board testing. When HI-Z is invoked, all output drivers, including the two-state drivers, are turned off (i.e., high impedance). The instruction selects the bypass register. 25.2 MPC561/MPC563 Restrictions The control afforded by the output enable signals using the boundary scan register and the EXTEST instruction requires a compatible circuit-board test environment to avoid device-destructive configurations. The user must avoid situations in which the MPC561/MPC563 output drivers are enabled into actively driven networks. The MPC561/MPC563 features a low-power stop mode. The interaction of the scan chain interface with low-power stop mode is as follows: 1. The TAP controller must be in the test-logic-reset state to either enter or remain in the low-power stop mode. Leaving the TAP controller in the test-logic-reset state negates the ability to achieve low-power, but does not otherwise affect device functionality. 2. The TCK input is not blocked in low-power stop mode. To consume minimal power, the TCK input should be externally connected to VDD or ground. 3. The TMS pin includes an on-chip pull-up resistor. In low-power stop mode, this pin should remain either unconnected or connected to VDD to achieve minimal power consumption. Note that for proper reset of the scan chain test logic, the best approach is to pull JCOMP low at power-on reset (PORESET). 4. JCOMP must be low prior to PORESET assertion after low power mode exits otherwise an unknown state will occur. 25.2.1 Non-Scan Chain Operation In non-scan chain operation, there are two constraints. First, the TCK input does not include an internal pull-up resistor and should not be left unconnected to preclude mid-level inputs. The second constraint is to ensure that the scan chain test logic is kept transparent to the system logic by forcing TAP into the test-logic-reset controller state, using either of two methods. Connecting pin JCOMP to logic 0 (or one of the reset pins), or TMS must be sampled as a logic one for five consecutive TCK rising edges. If then TMS either remains unconnected or is connected to VDD, then the TAP controller cannot leave the test-logic-reset state, regardless of the state of TCK. MPC561/MPC563 Reference Manual, Rev. 1.2 25-32 Freescale Semiconductor IEEE 1149.1-Compliant Interface (JTAG) 25.2.2 BSDL Description The BSDL file for the MPC561/MPC563 can be found on the Freescale web site. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor 25-33 IEEE 1149.1-Compliant Interface (JTAG) MPC561/MPC563 Reference Manual, Rev. 1.2 25-34 Freescale Semiconductor Appendix A MPC562/MPC564 Compression Features The MPC562/MPC564 contains a number of code compression features not found in the MPC561/MPC563 that function from the burst buffer controller module (BBC) module of the device. The BBC's instruction code decompressor unit (ICDU) is responsible for on-line (previously compressed) instruction code decompression in the decompression on mode. The ICDU contains a 2-Kbyte RAM (DECRAM) that is used for decompressor vocabulary table storage when compression is enabled or as general-purpose memory on the U-bus when compression is disabled. NOTE The code compression features of the MPC562/MPC564 are different than the code compression of the MPC556. A.1 ICDU Key Features The following are instruction code decompression unit key features: * Instruction code on-line decompression is based on an "instruction class" algorithm. * There is no need for address translation between compressed and non-compressed address spaces -- ICDU provides the "next instruction address" to the RCPU. * In most cases, instruction decompression takes one clock. * Code decompression is pipelined: -- No performance penalty during sequential program flow execution -- Minimal performance penalty due to change of program flow execution * Two operation modes are available: decompression on and decompression off. Switches between compressed and non-compressed user application software is possible. * Adaptive vocabularies scheme is supported; each user application can have its own optimum vocabularies. A.2 Class-Based Compression Model Main Principles The operational model used by the MPC562/MPC564 is explained in the sections below. A.2.1 * * * Compression Model Features Implemented for MPC56x architecture Up to 50% instruction code size reduction No need for address translation tables MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-1 MPC562/MPC564 Compression Features * * * * * * * * No changes in the CPU architecture A compressor tool performs compression off-line in software using instruction class-based algorithms optimized for the MPC56x instruction set Decompression is done at run-time by special hardware Optimized for cache-less systems: -- Highly effective in system solutions for a low-cache hit ratio environment and for systems with fast embedded program memory -- Deterministic program execution -- No performance penalty during sequential program flow execution -- Minimal performance penalty due to change of program flow execution Switches between compressed and non-compressed user application sections is possible. (A compressed subroutine can call a non-compressed one and be called from non-compressed portions of the user application) Adaptive vocabularies, generated for a particular application Compressed address space is up to 1 Gbyte Branch displacement from its target: -- Conditional branch displacement is up to 4 Kbytes -- Unconditional branch displacement is up to 4 Mbytes NOTE Branch displacement is hardware limited. The compiler can enlarge the branch scope by creating branch chains. A.2.2 Model Limitations No address arithmetic is allowed for instruction space because the address map changes during compression and no software tool can identify address arithmetic structures in the code. Address arithmetic for data tables is permitted since data space is not compressed. Only instruction space is compressed. A.2.3 Instruction Class-Based Compression Algorithm The code compression algorithm is based on creating optimal vocabularies of frequently appearing RCPU RISC instructions or instruction halves and replacing these instructions with pointers to the vocabularies. The system contains several sets of vocabularies for different groups of instructions. These groups are referred to as classes. Every instruction belongs to exactly one class. Compression of the instructions in a class may be in one of the following modes. Refer to Figure A-1. 1. Compression of the whole instruction into one vocabulary pointer 2. Compression of each half of the instruction into a different vocabulary MPC561/MPC563 Reference Manual, Rev. 1.2 A-2 Freescale Semiconductor MPC562/MPC564 Compression Features 3. Compression of one of the instruction's halves into a vocabulary pointer and bypass of the other half. A bypassed field is one for which non-compressed data (16-bit halfword or 32-bit word) is placed in the compressed code. After compression is defined, the non-compressed data field is defined in the class. 4. Bypass of the whole instruction. No compression is permitted. Uncompressed Instruction Compressed Instruction 1. 1. 2. 2. 3. 3. OR 4. 4. Legend Uncompressed or Bypassed Code Compressed Code Class Identifier Figure A-1. Instruction Compression Alternatives A 4-bit class identifier is added to the beginning of each compressed instruction to supply class identification during decompression. Compressed and bypass field lengths may vary. (A fully bypassed instruction, including its 4-bit class identifier, is 36 bits.) The compressed instruction is guaranteed to start on an even bit. Thus, four bits are needed to find the starting location of the instruction inside a memory word. The instruction address in decompression on mode consists of a 28-bit word address (1 Gbyte of address space) and a 4-bit instruction pointer (IP). See Figure A-2. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-3 MPC562/MPC564 Compression Features 27 Compressed Instruction Adddress Base Address 31 IP x Memory Layout x+4 x+8 2*IP Bits x+c - Compressed Instruction Figure A-2. Addressing Instructions with Compressed Address A.2.4 Compressed Address Generation with Direct Branches During the compression process, compressed instructions change their location in the memory and are not word aligned. Displacement fields in the direct branch instructions have to be updated by the compression tool to make compressed instruction addressing possible. Four LSB bits of the displacement immediate field (LI or BD) in the compressed direct branch instructions are used for bit addressing in the 32-bit memory word. The remaining bits of the fields are used in the branch target calculation of the base address (word address). The RCPU branch unit copies the bit pointer into the IP field of issued compressed branch target address. The branch compressed target base address is calculated according the direct branch addressing mode. If a branch has absolute addressing mode, the branch target base address is calculated as a sign extension of the base address portion of the LI (or BD) field. If a branch has relative addressing mode, the branch target base address is calculated as a sum of the base address of the branch and sign extended base address portion of the branch LI (or BD) field. Figure A-3 illustrates direct branch target address generation in "Decompression On" mode. The base address for the unconditional branch has 20 bits This yields an unconditional branch displacement limit of 4 Mbytes. The word pointer for the conditional branch has 10 bits. This yields a conditional branch displacement limit of 4 Kbytes. MPC561/MPC563 Reference Manual, Rev. 1.2 A-4 Freescale Semiconductor MPC562/MPC564 Compression Features AA Word Pointer (LI) 0 6 30 31 Unconditional immediate branch instruction BEFORE compression mapping 4-bit Pointer 26 Word Pointer 0 6 AA 30 31 Unconditional immediate branch instruction AFTER compression mapping (I-form) Sign Extension Word Pointer 27 0 8 Sign extended Base address generation for unconditional branches OR AA W o rd P o in te r (BD ) 0 16 30 31 Conditional immediate branch instruction BEFORE compression mapping Word Pointer 4-biit Pointer 26 16 0 Conditional immediate branch instruction AFTER compression mapping (B-form) Sign Extension AA 30 31 Word Pointer 27 0 18 Sign extended Base address generation for conditional branches Si gn Extended Base Addres s Base address of the branc h + AA=0 OR A A=1 Word Pointer - Base Address 0 Bit pointer from i nstruction 4-bit Pointer 28 31 Branch target compressed address Figure A-3. Compressed Target Address Generation by Direct Branches MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-5 MPC562/MPC564 Compression Features When a change of flow occurs, the RCPU issues the new address in compression format. The address extractor unit of the BBC extracts the base address to instruction memory. When the compressed memory word is brought to the BBC from the memory, the ICDU uses the IP field of the RCPU-issued address to decompress the instruction. The BBC provides compressed addresses of the decompressed and next instructions to the RCPU together with the decompressed instruction. Shortened word pointer fields of direct branches in compressed mode imply some limitations on compilers that implement the PowerPC ISA architecture. They should generate binaries, with limited direct branch displacements to make the compression possible. If a conditional branch target, generated by a compiler, must be farther than the compression mode limitation of 4 Kbytes, the compiler may generate a sequence of a conditional branch with opposite condition to skip the following unconditional branch to the original target. If the unconditional branch range is still not big enough, the compiler can use branch chains or indirect branches. A.2.5 Compressed Address Generation--Indirect Branches The indirect branch destination address is copied without any change from one of the following RCPU registers: * LR * CTR * SRR0 See the RCPU User's Manual for more details. These registers should contain (or be loaded by) the 32-bit compressed address of existing compressed instructions to be used for correct branching. The LR register is automatically updated by the correct value of the "next" instruction compressed address during subroutine calls by using the `L' - form of branch instructions (like bl or bcl). The SRR0 register is updated by the correct return compressed address when exceptions are taken by the RCPU, thus the rfi instruction obtains the correct return address from an exception handler. A.2.6 Compressed Address Generation--Exceptions Upon an exception, the RCPU core issues a regular 0xFFF00X00 or 0x00000X00 exception vector as specified in the PowerPC ISA architecture. The compressed exception routines (or branches to them) should start (reside) at the same location in memory as noncompressed ones. The BBC ICDU passes the vectors unchanged to the MCU internal bus and provides corresponding compressed address to the RCPU together with the first exception handler instruction opcode. This scheme allows use of the BBC exception relocation feature regardless of the MCU operational mode. The RESET routine vector is relocated differently in decompression on and in decompression off modes. This feature may be used by a software code compression tool to guarantee that a vocabulary table initialization routine is always executed before application code is running. MPC561/MPC563 Reference Manual, Rev. 1.2 A-6 Freescale Semiconductor MPC562/MPC564 Compression Features A.2.7 * * * * * * * * * * Class Code Compression Algorithm Rules Compressed instruction length may vary between 6 and 36 bits and is even. A compressed instruction can begin at any even location in a memory word. An instruction source may be compressed as a single 32-bit segment or as two independent 16-bit segments. Possible partitions of an instruction for compression are: - One 32-bit bypass segment - One 32-bit compressed segment - One 16-bit compressed segment and one 16-bit bypass segment - Two 16-bit compressed segments A bypass field is always the second field of the two possible. Length of a bypass field can be zero, 10, 15, 16 or 32 bits. The class prefix in a compressed instruction is 4 bits long and covers up to 16 classes. The vocabulary table pointer of each field may be 2 to 9 bits long. Vocabulary table pointers are reversed in the code. This means the pointer's LSB will be the first bit. In a class with a single segment of full compression, data is fetched from both memories. Every vocabulary table in the DECRAM is 16 bytes (8 entries) aligned (3 LSBs zeroed). A.2.8 Bypass Field Compression Rules The bypass field can be either a full bypass, (i.e., the whole segment from the un-compressed instruction appears as is in the compressed instruction), or it can be represented in one of several compression encoding formats. These formats are hard-wired in the decompression module. A.2.8.1 Branch Right Segment Compression #1 For the MPC562/MPC564, a 15-bit bypass is used to indicate that the AA bit of a branch instruction should be inserted with a value of zero. The decompression process is performed as shown in Figure A-4. 0 13 14 16 29 30 31 15-bit Compressed Bypass Field Decompressed Right Segment 0 LK Figure A-4. Branch Right Segment Compression #1 This bypass is coded by a value of "13" (0xD) in the TP2LEN field of the DCCR register. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-7 MPC562/MPC564 Compression Features A.2.8.2 Branch Right Segment Compression #2 Also created for branch instructions on the MPC562/MPC564, a bypass of 10 bits indicates that the AA bit should be inserted with a value of zero and that the 5-bit word offset should be extended to 10 bits. The decompression process is performed as shown in Figure A-5. 0 8 4 5 1 9 10-bit Compressed Bypass Field 16 Decompressed Right Segment 21 22 w o r d o f f s e 25 26 t 29 30 31 IP 0 LK Figure A-5. Branch Right Segment Compression #2 This bypass is coded by a value of "12" (0xC) in the TP2LEN field of the DCCR register. A.2.8.3 Right Segment Zero Length Compression Bypass This MPC562/MPC564 bypass type indicates that no bypass data exists in the compressed instruction. The bypassed segment is16 zero bits. This bypass is coded by a value of "11" (0xB) in the TP2LEN field of the DCCR register. A.2.9 Instruction Class Structures and Programming The four possible compression layouts of an instruction and their attributes are listed in this section. See Section A.4, "Decompressor Class Configuration Registers (DCCR0-15)," for the instruction class attributes and more programming details. A.2.9.1 Global Bypass This MPC562/MPC564 instruction is not compressed at all. Uncompressed Instruction MSB 32-bit segment - to be bypassed Compressed Instruction 0000 32-bit bypass data Figure A-6. Global Bypass Instruction Layout This class does not have a configuration register. Its prefix is hard-wired to `0000' and no other attributes are needed. MPC561/MPC563 Reference Manual, Rev. 1.2 A-8 Freescale Semiconductor MPC562/MPC564 Compression Features A.2.9.2 Single Segment Full Compression - CLASS_1 This MPC562/MPC564 instruction is compressed into a single segment. The vocabulary table pointer points to an offset in tables of all RAMs (DECRAMs). Uncompressed Instruction MSB 32-bit segment - to be compressed Compressed Instruction 4-bit class 2-to 9-bit TP1 Figure A-7. CLASS_1 Instruction Layout The definition of the class includes: * TP1 length = 2-9 * TP2 length = 0 * TP1 base address, TP2 base address = the two tables' base addresses for RAM #1 and RAM #2, respectively. * AS, DS=0 Data brought from RAM#1 is the 16 MSBs of the decompressed instruction and data brought from RAM#2 is the 16 LSBs of the decompressed instruction. A.2.9.3 Twin Segment Full Compression - CLASS_2 This MPC562/MPC564 instruction is divided into two segments. Each segment is compressed and mapped into a different vocabulary. The vocabularies reside in different RAMs. Proper programming can swap the vocabularies' locations. Uncompressed Instruction MSB 16-bit segment #1 - to be compressed 16-bit segment #2 - to be compressed Compressed Instruction Alternative #1 (CLASS_2a) 4-bit class 2- to 9-bit TP1 for segment #1 2- to 9-bit TP2 for segment #2 Alternative #2 (CLASS_2b) 4-bit class 2- to 9-bit TP1 for segment #2 2- to 9-bit TP2 for segment #1 Figure A-8. CLASS_2 Instruction Layout The definition of the class includes: MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-9 MPC562/MPC564 Compression Features * * * * TP1 length=2-9 TP2 length=2-9 AS=0 For alternative #1: -- TP1 base address = base address of segment #1 vocabulary in RAM #1 -- TP2 base address = base address of segment #2 vocabulary in RAM #2 -- DS=0 For alternative #2: -- TP1 base address = base address of segment #2 vocabulary in RAM #1 -- TP2 base address = base address of segment #1 vocabulary in RAM #2 -- DS=1 * Alternatives #1 and #2 are referred to as CLASS_2a and CLASS_2b respectively. A.2.9.4 Left Segment Compression and Right Segment Bypass - CLASS_3 For the MPC562/MPC564, the instruction is divided into two segments. The left segment is compressed and mapped into a vocabulary. The vocabulary location is programmable. The right segment is either fully bypassed by a 16-bit field or by a shorter field which is decompressed according to fixed rules. . Uncompressed Instruction MSB 16-bit segment #1 - to be compressed 16-bit segment #2 - to be bypassed Compressed Instruction 4-bit class 2- to 9-bit TP1 for segment #1 0-, 10-, 15- or 16-bit bypass for segment #2 Figure A-9. CLASS_3 Instruction Layout The definition of the class includes * TP1 length=2-9 * TP2 length=0xB, 0xC, 0xD, or 0xE indicating a 0, 10, 15 or 16 bit bypass, respectively. * TP1 base address = base address of segment #1 vocabulary in RAM #1, if it exists there. * TP2 base address = base address of segment #1 vocabulary in RAM #2, if it exists there. * DS=0 * AS=0 or 1 directing access to the vocabulary in RAM #1 or RAM #2, respectively. When the vocabulary is located in RAM #1, the class will be referred to as CLASS_3a and when the vocabulary is located in RAM #2, the class will be referred to as CLASS_3b. MPC561/MPC563 Reference Manual, Rev. 1.2 A-10 Freescale Semiconductor MPC562/MPC564 Compression Features A.2.9.5 Left Segment Bypass and Right Segment Compression--CLASS_4 This MPC562/MPC564 instruction is divided into two segments. The left segment is either fully bypassed by a 16-bit field or by a shorter field which is decompressed according to fixed rules. The right segment is compressed and mapped into a vocabulary. The vocabulary location is programmable. The compressed fields must be swapped in the compressed instruction order to follow the rule that bypass appears only in the second field of a compressed instruction. . Uncompressed Instruction MSB 16-bit segment #1 - to be bypassed 16-bit segment #2 - to be compressed Compressed Instruction 4-bit class 2- to 9-bit TP1 for segment #2 0-, 10-, 15- or 16-bit bypass for segment #1 Figure A-10. CLASS_4 Instruction Layout The definition of the class includes: * TP1 length=2-9 * TP2 length=0xB, 0xC, 0xD, or 0xE indicating a 0, 10, 15 or 16 bit bypass, respectively. * TP1 base address = base address of segment #1 vocabulary in RAM #1, if it exists there * TP2 base address = base address of segment #1 vocabulary in RAM #2, if it exists there * DS=1 * AS=0 or 1 directing access to the vocabulary in RAM #1 or RAM #2, respectively. When the vocabulary is located in RAM #1, the class is referred to as CLASS_4band when the vocabulary is located in RAM #2, the class is referred to as CLASS_4a. Refer to Table A-4. A.2.10 Instruction Layout Programming Summary Table A-4 summarizes the programming for all possible compressed instruction layouts. The un-compressed instruction of two half-words are referred as H1 & H2. The compressed instruction can be built out of: (1) X1 field - representing a vocabulary pointer for encoding of either H1 or H1+H2; (2) X2 field - representing a vocabulary pointer for encoding of H2; and (3) BP - representing a bypass field. Vocabularies V1 and V2 refer to the 16 MSB and 16 LSB of the uncompressed instruction, respectively. A.2.11 Compression Process The compression process is implemented by the following steps. See Figure A-11. * User code compilation/linking * Vocabulary and class generation * User application code compression by a software compression tool MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-11 MPC562/MPC564 Compression Features The vocabulary and class configurations are generated by profiling the static code, based on the instruction class algorithm. The code compression can be created by using either default or specific application vocabularies, generated at the previous step. In case of default vocabularies, the generation step can be omitted, but compression efficiency is reduced. The compression tool replaces regular PowerPC ISA instructions with a compressed representation that contains fewer bits. The tool also updates offset fields in direct branch instructions to include a compressed format offset (four bits of IP and word offset). Thus, maximum branch offsets in decompression on mode are reduced. The RCPU uses the word offset for direct branch target address computation. The RCPU provides the instruction pointer portion of the branch offset field to the decompression unit as it is represented in the branch instruction. Program Executable Non-compressed Program Executable Compressed Compiler/ Compressor Tool Linker Classes Generator Classes Vocabulary Vocabulary Generator Vocabulary Generation Tool Figure A-11. Code Compression Process A.2.12 * * * * * Decompression The instruction code is stored in the memory in the compressed format The vocabularies are stored in a dedicated ICDU RAM (DECRAM) The class configuration is stored in a dedicated ICDU register (DCCR) The decompression is done on-line by the dedicated decompressor unit Decompression flow is as follows: (See Figure A-12) -- RCPU provides to the BBC a 2-bit aligned change of flow (COF) address MPC561/MPC563 Reference Manual, Rev. 1.2 A-12 Freescale Semiconductor MPC562/MPC564 Compression Features -- The ICDU: - Converts the COF address to a word-aligned physical address to access the memory - Fetches the compressed instruction code from the memory, decompresses it and delivers non-compressed instruction code, together with the bit-aligned next instruction address, to the RCPU. Compressed Instructions Memory Decompressor Bit-Aligned COF Address COF Word Aligned Physical Address MPC500 Vocabulary Noncompressed Instruction Code Embedded CPU Compressed Instruction Code Classes (DCCR) Registers Compressed Space "Next Instruction" Address ICDU Figure A-12. Code Decompression Process A.2.13 Compression Environment Initialization In order to commence the execution of the compressed code, the DECRAM and the class information (in the DCCR registers) must be programmed. The data to be programmed is supplied by the compressor tool and the vocabulary generator. There are two initialization scenarios: 1. Wake up in decompression off mode -- If the chip wakes up with decompression disabled, the initialization routine can be executed at any time before entering decompression on mode. After the compression environment is initialized, the operational mode would be changed to decompression on. 2. Wake up in decompression on mode -- If the chip wakes up in decompression on mode, it has to process compressed instructions without the vocabularies and class parameters. Thus, all instructions executed until the end of the initialization routine should be compressed in the global bypass format. DECRAM loading is an essential part of this intialization routine. After DECRAM loading, efficient compressed code may be used. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-13 MPC562/MPC564 Compression Features A.2.14 Compression/Non-Compression Mode Switch The MPC562/MPC564 allows the option to switch between compressed and non-compressed code on the fly. There are two ways to switch between the modes, as shown in Section A.2.14.1, "Compression Definition for Exception Handlers," and Section A.2.14.2, "Running Mixed Code." A.2.14.1 Compression Definition for Exception Handlers The MPC562/MPC564 can wake up upon reset with all the exception handlers defined to be compressed (or not), so when any exception occurs or completes, the hardware switches to the appropriate mode without software intervention. A.2.14.2 Running Mixed Code If the compression mode is enabled on the MPC562/MPC564, the software can switch between compressed and non-compressed code by setting (or clearing) the compression mode bit in the RCPU MSR register. This is done by setting/clearing bit 29 in the RCPU SRR1 register (SRR1 gets loaded into the MSR register when the rfi instruction is executed. Bit 29 is the DCMPEN bit of the MSR). The next step is to load SRR0 with a target address in compressed/non-compressed format and then executing an rfi instruction. Following is a suggested routine to execute the switch in both directions (must be run in supervisor mode when RCPU MSR[PR] bit is cleared): # R30 contains destination address in appropriate format .set turn_on_compression_bit_mask, 4 .set turn_off_compression_bit_mask, 0xfffb mfmsr r31 # to go to compressed code ori r31,r31,turn_on_compression_bit_mask # or alternative to go to uncompressed code: andi. r31,r31,turn_off_compression_bit_mask mtspr NRI,r0 # Disable external interrupts mtspr SRR1,r31 mtspr SRR0,r30 # destination address load rfi # branch and modify MSR NOTE When BBCMCR[EN_COMP] (bit 21) is set, modification of MSR[DCMPEN] (bit 29) by mtmsr instruction is strictly forbidden. It may cause the machine to hang until reset. A.3 A.3.1 Operation Modes Instruction Fetch The MPC562/MPC564 provides two instruction fetch modes: decompression off and decompression on. The operational modes are defined by RCPU MSR[DCMPEN] bit. If the bit is set, the mode is decompression on. Otherwise, it is in decompression off. MPC561/MPC563 Reference Manual, Rev. 1.2 A-14 Freescale Semiconductor MPC562/MPC564 Compression Features A.3.1.1 Decompression Off Mode Refer to Section 4.2.1.1, "Decompression Off Mode" for an explanation of decompression off. A.3.1.2 Decompression On Mode In this mode, the MPC562/MPC564's RCPU sends the two-bit aligned change of flow (COF) address to the BBC. The BIU transfers the word portion of the address to the U-bus. The BBC continues to pre-fetch the data from the consequent memory addresses regardless of whether the RCPU requests them in order to supply data to the ICDU. In the MPC562/MPC564, the data coming from the instruction memory is not provided directly to the RCPU, but loaded into the ICDU for decompression. Decompressed instruction code together with "next instruction address" are provided to the RCPU whenever it requires another instruction fetch. All addresses issued by the BIU to the U-bus are transferred in parallel to the IMPU. The IMPU compares the address of the access to its region programming. If any protection violation is detected by the IMPU, the current U-bus access is aborted by the BIU and an instruction storage protection error exception is signaled to the RCPU. Show cycle and program trace access attributes accompanying the COF RCPU access only are forwarded by the BIU along with the U-bus access. Additional information about the IP of the compressed instruction address is provided on the U-bus data bus. Refer below to Section A.3.1.2.1, "Show Cycles in Decompression On Mode," for more details. In this mode the MPC562/MPC564's ICDU DECRAM is used as a decompressor vocabulary storage and may not be used as a general purpose RAM. A.3.1.2.1 Show Cycles in Decompression On Mode In the MPC562/MPC564's decompression on mode, the instruction address consists of an instruction base address and four bits of the instruction bit pointer. In order to provide the capability to show full instruction address, including instruction bit pointer on the external bus, show cycle information is presented not only on the address bus, but also on some bits of the data bus: * ADDR[0:29] - show the value of the base address of compressed instruction (word pointer into the memory) * DATA[0] - shows in which mode the MPC562/MPC564 is operating -- 0 = decompression off mode -- 1 = decompression on mode * DATA[1:4] - represent an instruction bit pointer within the word. Instruction show cycle bus transactions have the following characteristics (see Figure 9-41): * One clock cycle * Address phase only; in decompression on mode part of the compressed address is driven on data lines together with address lines. The external bus interface adds one clock delay between a read cycle and such show cycle. * STS assertion only (no TA assertion) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-15 MPC562/MPC564 Compression Features NOTE The BBCMCR[DECOMP_SC_EN] bit determines if the data portion (DATA[0:4]) of the instruction show cycle is driven or not, regardless of decompression mode (BBCMCR[EN_COMP] bit) A.3.2 Vocabulary Table Storage Operation The MPC562/MPC564 uses DECRAM for decompressor vocabulary tables (VT1 and VT2) storage in decompression on mode. The ICDU utilizes DECRAM as two separately accessed 1-Kbyte RAM arrays (16 bits wide) that are accessed via internal ICDU buses. The VTs should be loaded before the decompression process starts. In order to allow decompression, the DECRAM must be disabled for the U-bus accesses after VTs and decompressor class configuration registers (DCCRs) are initialized. A.3.3 READI Compression Setting BBCMCR[DECOMP_SC_EN] when decompression is enabled allows READI to track the compressed code (see Chapter 24, "READI Module"). BBCMCR[DECOMP_SC_EN] should not be set if there is no intention to use compressed code, as it will degrade U-bus performance. The show cycle may be delayed by one clock by the USIU if the show cycle occurs after an external device read cycle. Refer to Section 24.6.5.2, "Compressed Code Mode Guidelines." The ICTRL register must be programmed such that a show cycle will be performed for all changes in the program flow (ISCTL field = 0b01), or the PTM bit must be set and ISCTL must be set to a value other than 0b11. (See Table A-2.) A.3.3.1 I-Bus Support Control Register (ICTRL) MSB 0 Field 1 2 3 CTA 4 5 6 CTB 7 8 9 CTC Reset 10 11 CTD 12 13 IWP0 14 15 IWP1 0000_0000_0000_0000 LSB 16 17 Field IWP2 18 19 IWP3 20 21 22 23 24 25 26 27 28 29 30 31 SIWP0 SIWP1 SIWP2 SIWP3 DIWP0 DIWP1 DIWP2 DIWP3 IFM ISCT_SER1 EN EN EN EN EN EN EN EN Reset 0000_0000_0000_0000 Addr SPR 158 Figure A-13. I-Bus Support Control Register (ICTRL) 1 Changing the instruction show cycle programming starts to take effect only from the second instruction after the actual mtspr to ICTRL. MPC561/MPC563 Reference Manual, Rev. 1.2 A-16 Freescale Semiconductor MPC562/MPC564 Compression Features Table A-1. ICTRL Bit Descriptions Function Bits Mnemonic Description Non-compressed mode 0xx = not active (reset value) 100 = equal 101 = less than 110 = greater than 111 = not equal Compressed Mode1 0:2 CTA Compare type of comparator A 3:5 CTB Compare type of comparator B 6:8 CTC Compare type of comparator C 9:11 CTD Compare type of comparator D 12:13 IWP0 I-bus 1st watchpoint programming 0x = not active (reset value) 10 = match from comparator A 11 = match from comparators (A&B) 14:15 W1 I-bus 2nd watchpoint programming 0x = not active (reset value) 10 = match from comparator B 11 = match from comparators (A | B) 16:17 IWP2 I-bus 3rd watchpoint programming 0x = not active (reset value) 10 = match from comparator C 11 = match from comparators (C&D) 18:19 IWP3 I-bus 4th watchpoint programming 0x = not active (reset value) 10 = match from comparator D 11 = match from comparators (C | D) 0x = not active (reset value) 10 = match from comparator D 11 = match from comparators (C | D) 20 SIWP0EN 21 SIWP1EN 22 SIWP2EN Software trap enable selection of the 3rd I-bus watchpoint 23 SIWP3EN Software trap enable selection of the 4th I-bus watchpoint 24 DIWP0EN Development port trap enable selection of the 1st I-bus watchpoint (read only bit) 25 DIWP1EN Development port trap enable selection of the 2nd I-bus watchpoint (read only bit) 26 DIWP2EN Development port trap enable selection of the 3rd I-bus watchpoint (read only bit) 27 DIWP3EN Development port trap enable selection of the 4th I-bus watchpoint (read only bit) Software trap enable selection of 0 = trap disabled (reset the 1st I-bus watchpoint value) 1 = trap enabled Software trap enable selection of the 2nd I-bus watchpoint 0 = trap disabled (reset value) 1 = trap enabled 1xx = not active 000 = equal (reset value) 001 = less than 010 = greater than 011 = not equal 0 = trap disabled (reset value) 1 = trap enabled 0 = trap disabled (reset value) 1 = trap enabled MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-17 MPC562/MPC564 Compression Features Table A-1. ICTRL Bit Descriptions (continued) Function Bits 1 Mnemonic 28 IFM 29:31 ISCT_SER Description Non-compressed mode Compressed Mode1 Ignore first match, only for I-bus breakpoints 0 = Do not ignore first match, used for "go to x" (reset value) 1 = Ignore first match (used for "continue") 0 = Do not ignore first match, used for "go to x" (reset value) 1 = Ignore first match (used for "continue") RCPU serialize control and Instruction fetch show cycle These bits control serialization and instruction fetch show cycles. See Table A-2 for the bit definitions. NOTE: Changing the instruction show cycle programming starts to take effect only from the second instruction after the actual mtspr to ICTRL. These bits control serialization and instruction fetch show cycles. See Table A-2 for the bit definitions. NOTE: Changing the instruction show cycle programming starts to take effect only from the second instruction after the actual mtspr to ICTRL. MPC562/MPC564 only. Table A-2. ISCT_SER Bit Descriptions Serialize Control (SER) Instruction Fetch (ISCTL) 0 00 RCPU is fully serialized and show cycles will be performed for all fetched instructions (reset value) 0 01 RCPU is fully serialized and show cycles will be performed for all changes in the program flow 0 10 RCPU is fully serialized and show cycles will be performed for all indirect changes in the program flow 0 11 RCPU is fully serialized and no show cycles will be performed for fetched instructions 1 00 Illegal. This mode should not be selected. 1 01 RCPU is not serialized (normal mode) and show cycles will be performed for all changes in the program flow 1 10 RCPU is not serialized (normal mode) and show cycles will be performed for all indirect changes in the program flow 1 11 RCPU is not serialized (normal mode) and no show cycles will be performed for fetched instructions A.4 Functions Selected Decompressor Class Configuration Registers (DCCR0-15) The DCCR fields are programmed to achieve maximum flexibility in the vocabulary tables placement into the two DECRAM banks under constraints, implied by hardware, which are: * A bypass field must always be in the second field of the compressed instruction MPC561/MPC563 Reference Manual, Rev. 1.2 A-18 Freescale Semiconductor MPC562/MPC564 Compression Features * When fetching 32 bits of decompressed instruction from the DECRAM, each 16 bits will be read from different RAM banks. The DCCR registers should be programmed with data supplied by the code compression tool, in order to be correlated with the compressed code. , MSB 0 Field 1 2 3 4 TP1LEN 5 6 7 8 9 10 TP2LEN 11 12 13 14 TP1BA Reset 15 TP2BA Unaffected Addr DCCR01 0x2F + A000 DCCR1 0x2F + A004 DCCR2 0x2F + A008 DCCR3 0x2F + A00C DCCR4 DCCR5 DCCR6 DCCR7 0x2F + A010 0x2F + A014 0x2F + A018 0x2F + A01C DCCR8 0x2F + A020 DCCR9 0x2F + A024 DCCR10 0x2F + A028 DCCR11 0x2F + A02C DCCR12 DCCR13 DCCR14 DCCR15 0x2F + A030 0x2F + A034 0x2F + A038 0x2F + A03C LSB 16 17 Field Reset 18 19 20 TP2BA Unaffected 0 21 22 23 AS DS 24 25 26 Unaffected 27 28 29 30 31 -- 0000_0000 Figure A-14. Decompressor Class Configuration Registers1 (DCCRx) 1. The DCCR0 register is hard coded for the "bypass decompressor class." Write accesses do not affect the DCCR0 register. The DCCR0 register will always return 0x0000 0000 when read. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-19 MPC562/MPC564 Compression Features Table A-3. DCCR0-DCCR15 Field Descriptions Bits Name Description 0:3 TP1LEN Length and Type of Table Pointer 1. This field's value defines the length of the field that contains a pointer to the first vocabulary table allocated for the class. 0x0 Empty field 0x1 Reserved 0x2 TP1 length is 2 bits 0x3 TP1 length is 3 bits 0x4 TP1 length is 4 bits 0x5 TP1 length is 5 bits 0x6 TP1 length is 6 bits 0x7 TP1 length is 7 bits 0x8 TP1 length is 8 bits 0x9 TP1 length is 9 bits 0xA to 0xFReserved 4:7 TP2LEN Length and Type of Table Pointer 2. This field's value defines the length of the field that contains either a pointer to the second vocabulary table allocated for the class or a bypass field. 0x0 Empty field 0x1 Reserved 0x2 TP2 length is 2 bits 0x3 TP2 length is 3 bits 0x4 TP2 length is 4 bits 0x5 TP2 length is 5 bits 0x6 TP2 length is 6 bits 0x7 TP2 length is 7 bits 0x8 TP2 length is 8 bits 0x9 TP2 length is 9 bits 0xA Reserved 0xB TP2 field is a 0 bit compact bypass field 0xC TP2 field is a 10 bits compact bypass field 0xD TP2 field is a 15 bits compact bypass field 0xE TP2 field is a 16 bits bypass field 0xF Reserved. 8:14 TP1BA Base address for vocabulary table in RAM Bank 1. This field specifies the base page address of the class' vocabulary table that resides in RAM Bank 1. 15:21 TP2BA Base address for vocabulary table in RAM Bank 2. This field specifies the base page address of the class' vocabulary table that resides in RAM Bank 2. 22 AS Address Swap specification 0 Address swap operation will not be performed for the class. 1 Address swap operation will be performed for the class For further details concerning AS operation refer to Table A-4. 23 DS Data swap specification 0 Data swap operation will not be performed for the class. 1 Data swap operation will be performed for the class. For further details concerning DS operation refer to Table A-4. 24:31 -- Reserved MPC561/MPC563 Reference Manual, Rev. 1.2 A-20 Freescale Semiconductor MPC562/MPC564 Compression Features Table A-4. Instruction Layout Encoding Configuration TP1 Configu Points ration to RAM Code # TP2BA Points to AS DS RAM # Vocab. RAM # Vocab. CLASS 1 Twin Segments Full Compression CLASS 2a Twin Segments Full Compression With Swapped Vocabularies (Vocabulary In RAM #2 For MSB Segment) CLASS 2b Left Segment Compression, Right Segment Bypassed, Vocabulary In RAM #1 CLASS 3a 1 1 V1 -- -- 0 Left Segment Compression, Right Segment Bypassed, Vocabulary In RAM #2 CLASS 3b 2 -- -- 2 V1 1 Left Segment Bypassed, Right Segment Compression, Vocabulary In RAM #1 CLASS 4b 1 1 V2 -- -- 0 Left Segment Bypassed, Right Segment Compression, Vocabulary In RAM #2 CLASS 4a 2 -- -- 2 V2 1 2 -- TP1BA Points to Single Segment Full Compression 1 1 and 2 TP2 Points to RAM # 1 V1 2 V1 1 2 1 V2 V2 -- V2 2 V1 -- Compressed Instruction Layout -- X11 0 X1 X2 1 X2 X1 X1 BP2 0 Bypass X1 BP2 X2 BP2 1 X2 BP2 X1, X2 - pointers to vocabularies BP - the bypassed data MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor A-21 MPC562/MPC564 Compression Features MPC561/MPC563 Reference Manual, Rev. 1.2 A-22 Freescale Semiconductor Appendix B Internal Memory Map This appendix includes the following memory maps: * Table B-1. SPR (Special Purpose Registers) * Table B-2. UC3F Flash Array * Table B-3. DECRAM SRAM Array * Table B-4. BBC (Burst Buffer Controller Module) * Table B-5. USIU (Unified System Interface Unit) * Table B-6. CDR3 Flash Control Registers EEPROM (UC3F) * Table B-7. DPTRAM Control Registers * Table B-8. DPTRAM Memory Arrays * Table B-9. Time Processor Unit 3 A and B (TPU3 A and B) * Table B-10. QADC64E A and B (Queued Analog-to-Digital Converter) * Table B-11. QSMCM (Queued Serial Multi-Channel Module) * Table B-12. Peripheral Pin Multiplexing (PPM) Module * Table B-13. MIOS14 (Modular Input/Output Subsystem) * Table B-14. TouCAN A, B and C (CAN 2.0B Controller) * Table B-15. UIMB (U-Bus to IMB Bus Interface) * Table B-16. CALRAM Control Registers * Table B-17. CALRAM Array * Table B-18. READI Module Registers MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-1 Internal Memory Map Memory map tables use the notation shown below: Notations Used in the Access Column Notations Used in the Reset Column S = Supervisor access only -- (em dash) = Untouched U = User access S = SRESET T = Test access H = HRESET M = Module Reset POR = Power-On Reset U = Unchanged X = Unknown R = RSTI In each table, the codes in the Reset column indicate which reset affects register values. Table B-1. SPR (Special Purpose Registers) Address Access Symbol CR U CR FPSCR U FPSCR MSR S SPR 1 Register Size Reset Condition State Register See Section 3.7.4 for bit descriptions. 32 -- Floating-Point Status and Control Register See Table 3-5 for bit descriptions. 32 -- MSR Machine State Register See Table 3-11 for bit descriptions. 32 -- U XER Integer Exception Register See Table 3-10 for bit descriptions. 32 -- SPR 8 U LR Link Register See Section 3.7.6 for bit descriptions. 32 -- SPR 9 U CTR Count Register See Section 3.7.7 for bit descriptions. 32 -- SPR 18 S DSISR DAE/Source Instruction Service Register See Section 3.9.2 for bit descriptions. 32 -- SPR 19 S DAR Data Address Register See Section 3.9.3 for bit descriptions. 32 -- SPR 22 S DEC Decrementer Register See Section 3.9.5 for more information. 32 POR SPR 26 S SRR0 Machine Status Save/Restore Register 0 See Section 3.9.6 for bit descriptions. 32 -- SPR 27 S SRR1 Machine Status Save/Restore Register1 See Section 3.9.7 for bit descriptions. 32 -- SPR 80 S EIE External Interrupt Enable See Section 3.9.10.1 for bit descriptions. 32 -- MPC561/MPC563 Reference Manual, Rev. 1.2 B-2 Freescale Semiconductor Internal Memory Map Table B-1. SPR (Special Purpose Registers) (continued) Address Access Symbol SPR 81 S EID SPR 82 S NRI SPR 144 -- SPR 147 -- Register Size Reset External Interrupt Disable See Section 3.9.10.1 for bit descriptions. 32 -- Non-Recoverable Interrupt Register See Section 3.9.10.1 for bit descriptions. 32 -- 32 H CMPA -- CMPD Comparator A-D Value Register See Table 23-17 for bit descriptions. SPR 148 D, S ECR Exception Cause Register See Table 23-18 for bit descriptions. 32 -- SPR 149 D, S DER Debug Enable Register See Table 23-19 for bit descriptions. 32 -- SPR 150 D, S COUNTA Breakpoint Counter A Value and Control Register See Table 23-20 for bit descriptions. 32 -- SPR 151 D, S COUNTB Breakpoint Counter B Value and Control Register See Table 23-21 for bit descriptions. 32 -- SPR 152 -- SPR 153 -- CMPE -- CMPF Comparator E-F Value Register See Table 23-22 for bit descriptions. 32 -- SPR 154 -- SPR 155 -- CMPG -- CMPH Comparator G-H Value Register See Table 23-23 for bit descriptions. 32 -- SPR 156 D, S LCTRL1 L-bus Support Control Register 1 See Table 23-24 for bit descriptions. 32 S SPR 157 D, S LCTRL2 L-bus Support Control Register 2 See Table 23-25 for bit descriptions. 32 S SPR 158 D, S ICTRL I-bus Support Control Register See Table 23-26 for bit descriptions. 32 S SPR 159 D, S BAR Breakpoint Address Register See Table 23-28 for bit descriptions. 32 -- SPR 268, 269 U TBL/TBU Time Base (Read Only) Register See Section 6.2.2.4.2 for bit descriptions. 32 -- SPR 272 -- SPR 275 S SPRG0 -- SPRG3 General Special-Purpose Registers 0-3 See Table 3-13 for bit descriptions. 32 -- SPR 284, 285 S TBL/TBU Time Base (Write Only) Register See Section 6.2.2.4.2 for bit descriptions. 32 -- SPR 287 S PVR Processor Version Register See Table 3-14 for bit descriptions. 32 -- SPR 1022 S FPECR Floating-Point Exception Cause Register See Table 3-16 for bit descriptions. 32 S SPR 528 S MI_GRA MI Global Region Attribute Register See Table 4-8 for bit descriptions. 32 -- MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-3 Internal Memory Map Table B-1. SPR (Special Purpose Registers) (continued) Address Access Symbol SPR 529 S EIBADR SPR 536 S SPR 560 Register Size Reset External Interrupt Relocation Table Base Address Register See Table 4-9 for bit descriptions. 32 -- L2U_GRA L2U Global Region Attribute Register See Table 11-10 for bit descriptions. 32 -- S BBCMCR BBC Module Configuration Register See Table 4-4 for bit descriptions. 32 H SPR 568 S L2U_MCR L2U Module Configuration Register See Table 11-7 for bit descriptions. 32 -- SPR 630 S DPDR Development Port Data Register See Section 23.4.6 for bit descriptions. 32 -- SPR 638 S IMMR Internal Memory Mapping Register See Table 6-12 for bit descriptions. 32 H SPR 784 - 787 S MI_RBAx MI Region x Base Address Register See Table 4-5 for bit descriptions. 32 -- SPR 792 - 795 S L2U_RBAx L2U Region x Base Address Register See Table 11-8 for bit descriptions. 32 -- SPR 816 - 819 S MI_RAx MI Region x Attribute Register See Table 4-6 for bit descriptions. 32 -- SPR 824 - 827 S L2U_RAx L2U Region x Attribute Register See Table 11-9 for bit descriptions. 32 -- Table B-2. UC3F Flash Array Address Access Symbol 0x00 0000 -- 0x07 FFFF U,S UC3F Register UC3F Flash Array Size Reset 32 -- Size Reset 32 -- Size Reset Table B-3. DECRAM SRAM Array Address Access Symbol 0x2F 8000 -- 0x2F 87FF U,S DECRAM Register DECRAM SRAM Table B-4. BBC (Burst Buffer Controller Module) Address Access Symbol Register 0x2F A000 S (read only)1 DCCR0 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A004 S DCCR1 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- MPC561/MPC563 Reference Manual, Rev. 1.2 B-4 Freescale Semiconductor Internal Memory Map Table B-4. BBC (Burst Buffer Controller Module) (continued) Address Access Symbol 0x2F A008 S DCCR2 0x2F A00C S 0x2F A010 Size Reset Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- DCCR3 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- S DCCR4 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A014 S DCCR5 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A018 S DCCR6 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A01C S DCCR7 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A020 S DCCR8 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A024 S DCCR9 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A028 S DCCR10 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A02C S DCCR11 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A030 S DCCR12 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A034 S DCCR13 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A038 S DCCR14 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- 0x2F A03C S DCCR15 Decompressor Class Configuration Register See Table A-3 for bit descriptions. 32 -- Size Reset 1 Register Always reads 0x0000 0000. Table B-5. USIU (Unified System Interface Unit) Address Access Symbol Register 0x2F C000 U1 SIUMCR SIU Module Configuration Register See Table 6-7 for bit descriptions. 32 H 0x2F C004 U2 SYPCR System Protection Control Register See Table 6-15 for bit descriptions. 32 H 0x2F C008 -- -- Reserved -- -- 0x2F C00E U, write only SWSR Software Service Register See Table 6-16 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-5 Internal Memory Map Table B-5. USIU (Unified System Interface Unit) (continued) Address Access Symbol 0x2F C010 U SIPEND 0x2F C014 U SIMASK 0x2F C018 U 0x2F C01C Register Size Reset Interrupt Pending Register See Section 6.2.2.2.1 for bit descriptions. 32 S Interrupt Mask Register SIMASK is a 32-bit read/write register. Each bit in the register corresponds to an interrupt request bit in the SIPEND register. 32 S SIEL Interrupt Edge Level Mask. See Section 6.2.2.2.7 for bit descriptions. 32 H U, read only SIVEC Interrupt Vector. See Section 6.2.2.2.8 for bit descriptions. 32 -- 0x2F C020 U TESR Transfer Error Status Register See Table 6-17 for bit descriptions. 32 S 0x2F C024 U SGPIODT1 USIU General-Purpose I/O Data Register 1 See Table 6-23 for bit descriptions. 32 H 0x2F C028 U SGPIODT2 USIU General-Purpose I/O Data Register 2 See Table 6-24 for bit descriptions. 32 H 0x2F C02C U SGPIOCR USIU General-Purpose I/O Control Register See Table 6-25 for bit descriptions. 32 H 0x2F C030 U EMCR External Master Mode Control Register See Table 6-13 for bit descriptions. 32 H 0x2F C038 U PDMCR2 Pads Module Configuration Register 2 See Table 2-6 for bit descriptions. 32 H 0x2F C03C U PDMCR Pads Module Configuration Register See Table 2-5 for bit descriptions. 32 H 0x2F C040 -- 0x2F C044 U SIPEND2 -- SIPEND3 Interrupt Pending Registers 2 and 3 See Section 6.2.2.2.1 for bit descriptions. 32 S 0x2F C048 -- 0x2F C04C U SIMASK2 -- SIMASK3 Interrupt Mask Register and Interrupt Mask Registers 2 and 3 See Section 6.2.2.2.9 for bit descriptions. 32 S 0x2F C050 -- 0x2F C054 U 32 S 0x2F C0FC -- 0x2F C0FF -- -- -- SISR2 -- SISR3 SISR2 and SISR3 Registers See Section 6.2.2.2.9 for bit descriptions. -- Reserved Memory Controller Registers 0x2F C100 U BR0 Base Register 0. See Table 10-8 for bit descriptions. 32 H 0x2F C104 U OR0 Option Register 0. See Table 10-10 for bit descriptions. 32 H 0x2F C108 U BR1 Base Register 1. See Table 10-8 for bit descriptions. 32 H MPC561/MPC563 Reference Manual, Rev. 1.2 B-6 Freescale Semiconductor Internal Memory Map Table B-5. USIU (Unified System Interface Unit) (continued) Address Access Symbol 0x2F C10C U OR1 0x2F C110 U 0x2F C114 Register Size Reset Option Register 1. See Table 10-10 for bit descriptions. 32 H BR2 Base Register 2. See Table 10-8 for bit descriptions. 32 H U OR2 Option Register 2. See Table 10-10 for bit descriptions. 32 H 0x2F C118 U BR3 Base Register 3. See Table 10-8 for bit descriptions. 32 H 0x2F C11C U OR3 Option Register 3. See Table 10-10 for bit descriptions. 32 H 0x2F C120 - 0x2F C13C -- -- Reserved -- -- 0x2F C140 U DMBR Dual-Mapping Base Register. See Table 10-11 for bit descriptions. 32 H 0x2F C144 U DMOR Dual-Mapping Option Register. See Table 10-12 for bit descriptions. 32 H 0x2F C148 - 0x2F C174 -- -- Reserved -- -- 0x2F C178 U MSTAT Memory Status. See Table 10-7 for bit descriptions. 16 H System Integration Timers 0x2F C200 U3 TBSCR Time Base Status and Control. See Table 6-18 for bit descriptions. 16 H 0x2F C204 U3 TBREF0 Time Base Reference 0. See Section 6.2.2.4.3 for bit descriptions. 32 U 0x2F C208 U3 TBREF1 Time Base Reference 1. See Section 6.2.2.4.3 for bit descriptions. 32 U 0x2F C20C - 0x2F C21C -- -- Reserved -- -- 0x2F C220 U4 RTCSC Real-Time Clock Status and Control. See Table 6-19 for bit descriptions. 16 H 0x2F C224 U4 RTC Real-Time Clock. See Section 6.2.2.4.6 for bit descriptions. 32 U 0x2F C228 T4 RTSEC Real-Time Alarm Seconds. Reserved 32 -- 0x2F C22C U4 RTCAL Real-Time Alarm. See Section 6.2.2.4.7 for bit descriptions. 32 U 0x2F C230 - 0x2F C23C -- -- Reserved -- -- 0x2F C240 U3 PISCR PIT Status and Control. See Table 6-20 for bit descriptions. 16 H MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-7 Internal Memory Map Table B-5. USIU (Unified System Interface Unit) (continued) Address Access Symbol 0x2F C244 U3 PITC 0x2F C248 U, read only PITR -- -- 0x2F C24C - 0x2F C27C Register Size Reset PIT Count. See Table 6-21 for bit descriptions. 32 (half reserved) U PIT Register. See Table 6-22 for bit descriptions. 32 (half reserved) U -- -- System Clock Control Register. See Table 8-9 for bit descriptions. 32 H PLL Low Power and Reset Control Register. See Table 8-11 for bit descriptions. 32 H Reserved Clocks and Reset 0x2F C280 U2 SCCR 0x2F C284 U3,5,6 PLPRCR 0x2F C288 U3 RSR Reset Status Register. See Table 7-3 for bit descriptions. 16 POR 0x2F C28C U COLIR Change of Lock Interrupt Register. See Table 8-12 for bit descriptions. 16 U 0x2F C290 U VSRMCR IRAMSTBY Control Register. See Table 8-13 for bit descriptions. 16 U 0x2F C294 - 0x2F C2FC -- -- Reserved -- -- System Integration Timer Keys 0x2F C300 U TBSCRK Time Base Status and Control Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C304 U TBREF0K Time Base Reference 0 Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C308 U TBREF1K Time Base Reference 1 Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C30C U TBK Time Base and Decrementer Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C310 - 0x2F C31C -- -- Reserved -- -- 0x2F C320 U RTCSCK Real-Time Clock Status and Control Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C324 U RTCK Real-Time Clock Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C328 U RTSECK Real-Time Alarm Seconds Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C32C U RTCALK Real-Time Alarm Key. See Table 8-8 for bit descriptions. 32 POR 0x2F C330 - 0x2F C33C -- -- Reserved -- -- MPC561/MPC563 Reference Manual, Rev. 1.2 B-8 Freescale Semiconductor Internal Memory Map Table B-5. USIU (Unified System Interface Unit) (continued) Address Access Symbol 0x2F C340 U PISCRIK 0x2F C344 U PITCK 0x2F C348 - 0x2F C37C -- -- Register Size Reset PIT Status and Control Key. See Table 8-8 for bit descriptions. 32 POR PIT Count Key. See Table 8-8 for bit descriptions. 32 POR Reserved -- -- System Clock Control Key. See Table 8-8 for bit descriptions. 32 POR PLL Low-Power and Reset Control Register Key. See Table 8-8 for bit descriptions. 32 POR Reset Status Register Key. See Table 8-8 for bit descriptions. 32 POR Reserved -- -- 32 S Clocks and Reset Keys 0x2F C380 U SCCRK 0x2F C384 U PLPRCRK 0x2F C388 U RSRK 0x2F C38C - 0x2F C3F8 -- -- Test Register 0x2F C3FC 1 2 3 4 5 6 S SIUTST SIU Test Register Entire register is locked if bit 15 (DLK) is set. Write once after power on reset (POR). Must use the key register to unlock if it has been locked by a key register, see Section 8.8.3.2, "Keep-Alive Power Registers Lock Mechanism." Locked after Power on Reset (POR). A write of 0x55CCAA33 must performed to the key register to unlock. See Section 8.8.3.2, "Keep-Alive Power Registers Lock Mechanism." Can have bits 0:11 (MF bits) write-protected by setting bit 4 (MFPDL) in the SCCR register to 1. Bit 21 (CSRC) and bits 22:23 (LPM) can be locked by setting bit 5 (LPML) of the SCCR register to 1. Bit 24 (CSR) is write-once after soft reset. Table B-6. CDR3 Flash Control Registers EEPROM (UC3F)1 Address Access Symbol Register Size Reset C3F EEPROM Configuration Register. See Table 21-3 for bit descriptions. 32 POR, H C3F EEPROM Extended Configuration Register. See Table 21-4 for bit descriptions. 32 POR, H C3F EEPROM High Voltage Control Register. See Table 21-5 for bit descriptions. 32 POR, H C3F 0x2F C800 S UC3FMCR 0x2F C804 S UC3FMCRE 0x2F C808 S UC3FCTL 1 Available on the MPC563/MPC564 only, MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-9 Internal Memory Map Table B-7. DPTRAM Control Registers Address Access Symbol Register Size Reset DPTRAM Control 0x30 0000 U, S1 DPTMCR DPTRAM Module Configuration Register. See Table 20-2 for bit descriptions. 16 S 0x30 0002 S DPTTCR Test Configuration Register. 16 S 0x30 0004 S RAMBAR RAM Array Base Address Register. See Table 20-3 for bit descriptions. 16 S 0x30 0006 S MISRH Multiple Input Signature Register High. 16 S 0x30 0008 S MISRL Multiple Input Signature Register Low. 16 S 0x30 000A S MISCNT MISC Counter Register. 16 S 1 Access to the DPTRAM array through the IMB3 bus is disabled once bit 5 (EMU) of either TPUMCR_A or TPUMCR_B is set. Table B-8. DPTRAM Memory Arrays Address Access Symbol 0x30 2000 -- 0x30 37FF U, S1 DPTRAM 1 Register DPTRAM Memory Array Size Reset 16 -- Access to the DPTRAM array through the IMB3 bus is disabled once bit 5 (EMU) of either TPUMCR_A or TPUMCR_B is set. Table B-9. Time Processor Unit 3 A and B (TPU3 A and B) Address Access Symbol Register Size Reset 16 only S, M TPU3_A Test Configuration Register. 16 S, M TPU3_A (Note: Bit descriptions apply to TPU3_B as well) 0x30 4000 S1 TPUMCR_A 0x30 4002 T TCR_A 0x30 4004 T DSCR_A TPU3_A Development Support Control Register. See Table 19-8 for bit descriptions. 162 S, M 0x30 4006 T DSSR_A TPU3_A Development Support Status Register. See Table 19-9 for bit descriptions. 162 S, M 0x30 4008 S TICR_A TPU3_A Interrupt Configuration Register. See Table 19-10 for bit descriptions. 162 S, M 0x30 400A S CIER_A TPU3_A Channel Interrupt Enable Register. See Table 19-11 for bit descriptions. 162 S, M 0x30 400C S CFSR0_A TPU3_A Channel Function Selection Register 0. See Table 19-12 for bit descriptions. 162 S, M TPU3_A Module Configuration Register. See Table 19-7 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 B-10 Freescale Semiconductor Internal Memory Map Table B-9. Time Processor Unit 3 A and B (TPU3 A and B) (continued) Address Access Symbol Register Size Reset 0x30 400E S CFSR1_A TPU3_A Channel Function Selection Register 1. See Table 19-12 for bit descriptions. 162 S, M 0x30 4010 S CFSR2_A TPU3_A Channel Function Selection Register 2. See Table 19-12 for bit descriptions. 162 S, M 0x30 4012 S CFSR3_A TPU3_A Channel Function Selection Register 3. See Table 19-12 for bit descriptions. 162 S, M 0x30 4014 S/U3 HSQR0_A TPU3_A Host Sequence Register 0. See Table 19-13 for bit descriptions. 162 S, M 0x30 4016 S/U3 HSQR1_A TPU3_A Host Sequence Register 1. See Table 19-13 for bit descriptions. 162 S, M 0x30 4018 S/U3 HSRR0_A TPU3_A Host Service Request Register 0. See Table 19-14 for bit descriptions. 162 S, M 0x30 401A S/U3 HSRR1_A TPU3_A Host Service Request Register 1. See Table 19-14 for bit descriptions. 162 S, M 0x30 401C S CPR0_A TPU3_A Channel Priority Register 0. See Table 19-15 for bit descriptions. 162 S, M 0x30 401E S CPR1_A TPU3_A Channel Priority Register 1. See Table 19-15 for bit descriptions. 162 S, M 0x30 4020 S CISR_A TPU3_A Channel Interrupt Status Register. See Table 19-17 for bit descriptions. 16 S, M 0x30 4022 T LR_A TPU3_A Link Register4 162 S, M 0x30 4024 T SGLR_A TPU3_A Service Grant Latch Register4 162 S, M 0x30 4026 T DCNR_A TPU3_A Decoded Channel Number Register4 162 S, M 0x30 4028 S5 TPUMCR2_A TPU3_A Module Configuration Register 2. See Table 19-18 for bit descriptions. 162 S, M 0x30 402A S TPUMCR3_A TPU3_A Module Configuration Register 3. See Table 19-21 for bit descriptions. 162 S, M 0x30 402C T ISDR_A TPU3_A Internal Scan Data Register 16, 322 -- 0x30 402E T ISCR_A TPU3_A Internal Scan Control Register 16, 322 -- 0x30 4100 - 0x30 410F S/U3 -- TPU3_A Channel 0 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 4110 - 0x30 411F S/U3 -- TPU3_A Channel 1 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 4120 - 0x30 412F S/U3 -- TPU3_A Channel 2 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 4130 - 0x30 413F S/U3 -- TPU3_A Channel 3 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 4140 - 0x30 414F S/U3 -- TPU3_A Channel 4 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-11 Internal Memory Map Table B-9. Time Processor Unit 3 A and B (TPU3 A and B) (continued) Address Access Symbol 0x30 4150 - 0x30 415F S/U3 -- 0x30 4160 - 0x30 416F S/U3 0x30 4170 - 0x30 417F Register Size Reset TPU3_A Channel 5 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- -- TPU3_A Channel 6 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- S/U3 -- TPU3_A Channel 7 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 4180 - 0x30 418F S/U3 -- TPU3_A Channel 8 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 4190 - 0x30 419F S/U3 -- TPU3_A Channel 9 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 41A0 - 0x30 41AF S/U3 -- TPU3_A Channel 10 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 41B0 - 0x30 41BF S/U3 -- TPU3_A Channel 11 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 41C0 - 0x30 41CF S/U3 -- TPU3_A Channel 11 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 41D0 - 0x30 41DF S/U3 -- TPU3_A Channel 11 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 41E0 - 0x30 41EF S/U3 -- TPU3_A Channel 14 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 0x30 41F0 - 0x30 41FF S/U3 -- TPU3_A Channel 15 Parameter Registers. See Section 19.4.15 for more information. 16, 322 -- 16 only S, M TPU3_B Test Configuration Register 16 S, M TPU3_B Development Support Control Register 162 S, M S, M TPU3_B 0x30 44001 S1 TPUMCR_B 0x30 4402 T TCR_B 0x30 4404 T DSCR_B TPU3_B Module Configuration Register 0x30 4406 T DSSR_B TPU3_B Development Support Status Register 162 0x30 4408 S TICR_B TPU3_B Interrupt Configuration Register 162 S, M TPU3_B Channel Interrupt Enable Register 162 S, M TPU3_B Channel Function Selection Register 0 162 S, M S, M 0x30 440A S CIER_B 0x30 440C S CFSR0_B 0x30 440E S CFSR1_B TPU3_B Channel Function Selection Register 1 162 0x30 4410 S CFSR2_B TPU3_B Channel Function Selection Register 2 162 S, M S, M 0x30 4412 S CFSR3_B TPU3_B Channel Function Selection Register 3 162 0x30 4414 S/U3 HSQR0_B TPU3_B Host Sequence Register 0 162 S, M 0x30 4416 S/U3 HSQR1_B TPU3_B Host Sequence Register 1 162 S, M 0x30 4418 S/U3 HSRR0_B TPU3_B Host Service Request Register 0 162 S, M 0x30 441A S/U3 TPU3_B Host Service Request Register 1 162 S, M HSRR1_B MPC561/MPC563 Reference Manual, Rev. 1.2 B-12 Freescale Semiconductor Internal Memory Map Table B-9. Time Processor Unit 3 A and B (TPU3 A and B) (continued) Address Access Symbol 0x30 441C S CPR0_B 0x30 441E S 0x30 4420 Register Size Reset TPU3_B Channel Priority Register 0 162 S, M CPR1_B TPU3_B Channel Priority Register 1 162 S, M S CISR_B TPU3_B Channel Interrupt Status Register 16 S, M 0x30 4422 T LR_B TPU3_B Link Register 162 S, M 0x30 4424 T SGLR_B TPU3_B Service Grant Latch Register 162 S, M 0x30 4426 T DCNR_B TPU3_B Decoded Channel Number Register 162 S, M 0x30 4428 S4 TPUMCR2_B TPU3_B Module Configuration Register 2 162 S, M 0x30 442A S TPUMCR3_B TPU3_B Module Configuration Register 3 16, 322 S, M 0x30 442C T ISDR_B TPU3_B Internal Scan Data Register 16, 322 -- 0x30 442E T ISCR_B TPU3_B Internal Scan Control Register 16, 322 -- 0x30 4500 - 0x30 450F S/U3 -- TPU3_B Channel 0 Parameter Registers 16, 322 -- 0x30 4510 - 0x30 451F S/U3 -- TPU3_B Channel 1 Parameter Registers 16, 322 -- 0x30 4520 - 0x30 452F S/U3 -- TPU3_B Channel 2 Parameter Registers 16, 322 -- 0x30 4530 - 0x30 453F S/U3 -- TPU3_B Channel 3 Parameter Registers 16, 322 -- 0x30 4540 - 0x30 454F S/U3 -- TPU3_B Channel 4 Parameter Registers 16, 322 -- 0x30 4550 - 0x30 455F S/U3 -- TPU3_B Channel 5 Parameter Registers 16, 322 -- 0x30 4560 - 0x30 456F S/U3 -- TPU3_B Channel 6 Parameter Registers 16, 322 -- 0x30 4570 - 0x30 457F S/U3 -- TPU3_B Channel 7 Parameter Registers 16, 322 -- 0x30 4580 - 0x30 458F S/U3 -- TPU3_B Channel 8 Parameter Registers 16, 322 -- 0x30 4590 - 0x30 459F S/U3 -- TPU3_B Channel 9 Parameter Registers 16, 322 -- 0x30 45A0 - 0x30 45AF S/U3 -- TPU3_B Channel 10 Parameter Registers 16, 322 -- 0x30 45B0 - 0x30 45BF S/U3 -- TPU3_B Channel 11 Parameter Registers 16, 322 -- 0x30 45C0 - 0x30 45CF S/U3 -- TPU3_B Channel 11 Parameter Registers 16, 322 -- 0x30 45D0 - 0x30 45DF S/U3 -- TPU3_B Channel 11 Parameter Registers 16, 322 -- MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-13 Internal Memory Map Table B-9. Time Processor Unit 3 A and B (TPU3 A and B) (continued) Address Access Symbol 0x30 45E0 - 0x30 45EF S/U3 -- 0x30 45F0 - 0x30 45FF S/U3 -- 1 2 3 4 5 Register Size Reset TPU3_B Channel 14 Parameter Registers 16, 322 -- TPU3_B Channel 15 Parameter Registers 162 -- Bit 10 (TPU3) and bit 11 (T2CSL) are write-once. Bits 1:2 (TCR1P) and bits 3:4 (TCR2P) are write-once if PWOD is not set in the TPUMCR3 register. This register cannot be accessed with a 32-bit read. It can only be accessed with an 8- or 16-bit read. Some TPU registers can only be read or written with 16- or 32-bit accesses. 8-bit accesses are not allowed. S/U = Supervisor accessible only if SUPV = 1 or unrestricted if SUPV = 0. Unrestricted registers allow both user and supervisor access. The SUPV bit is in the TPUMCR register. TPU code development (Debug) register Bits 9:10 (ETBANK), 14 (T2CF), and 15 (DTPU) are write-once. Table B-10. QADC64E A and B (Queued Analog-to-Digital Converter) Address Access Symbol Register Size Reset 16 S QADC64 Test Register. 16 S Interrupt Register. See Section 13.2.2 and Section 14.3.2 for bit descriptions. 16 S QADC_A (Note: Bit descriptions apply to QADC_B as well) 0x30 4800 S QADC64MCR_A QADC64 Module Configuration Register. See Table 13-5 and Table 14-5 for bit descriptions. 0x30 4802 S QADC64TST 0x30 4804 S QADC64INT_A 0x30 4806 S/U PORTQA_A/ PORTQB_A Port A and Port B Data. See Table 1-9 and Table 14-8 for bit descriptions. 16 U 0x30 4808 S/U DDRQA_A/ DDRQB_A Port A Data and Port B Direction Register. See Section 13.3.4 and Section 14.3.4 for more information. 16 S 0x30 480A S/U QACR0_A QADC64 Control Register 0. See Table 13-9 and Table 14-9 for bit descriptions. 16 S 0x30 480C S/U1 QACR1_A QADC64 Control Register 1. See Table 13-10 and Table 14-11 for bit descriptions. 16 S 0x30 480E S/U1 QACR2_A QADC64 Control Register 2. See Table 13-12 and Table 14-13 for bit descriptions. 16 S 0x30 4810 S/U QASR0_A QADC64 Status Register 0. See Table 13-14 and Table 14-15 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 B-14 Freescale Semiconductor Internal Memory Map Table B-10. QADC64E A and B (Queued Analog-to-Digital Converter) (continued) Address Access Symbol S/U QASR1_A 0x30 4814 - 0x30 49FE -- -- 0x30 4A00 - 0x30 4A7E S/U CCW_A 0x30 4A80 - 0x30 4AFE S/U 0x30 4B00 - 0x30 4B7E 0x30 4B80 - 0x30 4BFE 0x30 4812 Register Size Reset QADC64 Status Register 1. See Table 13-17 and Table 14-18 for bit descriptions. 16 S Reserved -- -- Conversion Command Word Table. See Table 13-18 and Table 14-19 for bit descriptions. 16 U RJURR_A Result Word Table Right-Justified, Unsigned Result Register. See Section 13.3.10 and Section 14.3.10 for bit descriptions. 16 X S/U LJSRR_A Result Word Table Left-Justified, Signed Result Register. See Section 13.3.10 and Section 14.3.10 for bit descriptions. 16 X S/U LJURR_A Result Word Table Left-Justified, Unsigned Result Register. See Section 13.3.10 and Section 14.3.10 for bit descriptions. 16 X QADC_B 0x30 4C00 S QADC64MCR_B QADC64 Module Configuration Register 16 S 0x30 4C02 T QADC64TEST_ QADC64 Test Register B 16 -- 0x30 4C04 S QADC64INT_B Interrupt Register 16 S 0x30 4C06 S/U PORTQA_B/ PORTQB_B Port A and Port B Data 16 U 0x30 4C08 S/U DDRQA_B/ DDRQB_B Port A Data and Port B Direction Register 16 S 0x30 4C0A S/U QACR0_B QADC64 Control Register 0 16 S 0x30 4C0C S/U1 QACR1_B QADC64 Control Register 1 16 S 0x30 4C0E S/U1 QACR2_B QADC64 Control Register 2 16 S 0x30 4C10 S/U QASR0_B QADC64 Status Register 0 16 S 0x30 4C12 S/U QASR1_B QADC64 Status Register 1 16 S 0x30 4C14 - 0x30 4DFE -- -- Reserved -- -- 0x30 4E00 - 0x30 4E7E S/U CCW_B Conversion Command Word Table 16 U 0x30 4E80 - 0x30 4EFE S/U RJURR_B Result Word Table. Right-Justified, Unsigned Result Register. 16 X MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-15 Internal Memory Map Table B-10. QADC64E A and B (Queued Analog-to-Digital Converter) (continued) Address Access Symbol 0x30 4F00 - 0x30 4F7E S/U LJSRR_B 0x30 4F80 - 0x30 4FFE S/U LJURR_B 1 Register Size Reset Result Word Table. Left-Justified, Signed Result Register. 16 X Result Word Table. Left-Justified, Unsigned Result Register. 16 X Size Reset QSMCM Module Configuration Register. See Table 15-4 for bit descriptions. 16 S QSMCM Test Register 16 S Bit 3 (SSEx) is readable in test mode only. Table B-11. QSMCM (Queued Serial Multi-Channel Module) Address Access Symbol Register QSMCM 0x30 5000 S QSMCMMCR 0x30 5002 T QTEST 0x30 5004 S QDSCI_IL Dual SCI Interrupt Level. See Table 15-5 for bit descriptions. 16 S 0x30 5006 S QSPI_IL Queued SPI Interrupt Level. See Table 15-6 for bit descriptions. 16 S 0x30 5008 S/U SCC1R0 SCI1 Control Register 1. See Table 15-24 for bit descriptions. 16 S 0x30 500A S/U SCC1R1 SCI1 Control Register 1. See Table 15-25 for bit descriptions. 16 S 0x30 500C S/U SC1SR SCI1 Status Register. See Table 15-26 for bit descriptions. 16 S 0x30 500E S/U SC1DR SCI1 Data Register. See Table 15-27 for bit descriptions. 16 S -- -- Reserved -- -- 0x30 5014 S/U PORTQS QSMCM Port QS Data Register. See Section 15.5.2 for bit descriptions. 16 S 0x30 5016 S/U PQSPAR/ DDRQST QSMCM Port QS PIn Assignment Register/ QSMCM Port QS Data Direction Register. See Section 15.5.2 for bit descriptions. 16 S 0x30 5018 S/U SPCR0 QSPI Control Register 0. See Table 15-13 for bit descriptions. 16 S 0x30 501A S/U SPCR1 QSPI Control Register 1. See Table 15-15 for bit descriptions. 16 S 0x30 501C S/U SPCR2 QSPI Control Register 2. See Table 15-16 for bit descriptions. 16 S 0x30 501E S/U SPCR3 QSPI Control Register 3. See Table 15-17 for bit descriptions. 8 S 0x30 5010 -- 0x30 5012 MPC561/MPC563 Reference Manual, Rev. 1.2 B-16 Freescale Semiconductor Internal Memory Map Table B-11. QSMCM (Queued Serial Multi-Channel Module) (continued) Address Access Symbol 0x30 501F S/U SPSR 0x30 5020 S/U 0x30 5022 Size Reset QSPI Status Register 3. See Table 15-18 for bit descriptions. 8 S SCC2R0 SCI2 Control Register 0. See Table 15-24 for bit descriptions. 16 S S/U SCC2R1 SCI2 Control Register 1. See Table 15-25 for bit descriptions. 16 S 0x30 5024 S/U SC2SR SCI2 Status Register. See Table 15-26 for bit descriptions. 16 S 0x30 5026 S/U SC2DR SCI2 Data Register. See Table 15-27 for bit descriptions. 16 S 0x30 5028 S/U1 QSCI1CR QSCI1 Control Register. See Table 15-32 for bit descriptions. 16 S 0x30 502A S/U2 QSCI1SR QSCI1 Status Register. See Table 15-33 for bit descriptions. 16 S 0x30 502C - 0x30 504A S/U SCTQ Transmit Queue Locations 16 S 0x30 504C - 0x30 506A S/U SCRQ Receive Queue Locations 16 S 0x30 506C - 0x30 513F -- -- Reserved -- -- 0x30 5140 - 0x30 517F S/U RECRAM Receive Data RAM 16 S 0x30 5180 - 0x30 51BF S/U TRAN.RAM Transmit Data RAM 16 S 0x30 51C0 - 0x30 51DF S/U COMD.RAM Command RAM 16 S 1 2 Register Bits 0-3 writeable only in test mode, otherwise read only. Bits 3-11 writeable only in test mode, otherwise read only. Table B-12. Peripheral Pin Multiplexing (PPM) Module Address Access Symbol 0x30 5C00 S/U PPMMCR 0x30 5C04 S/U 0x30 5C06 0x30 5C08 Register Size Reset PPM Module Configuration Register See Table 18-2 for bit descriptions. 16 S PPMPCR PPM Contol Register See Table 18-3 for bit descriptions. 16 S S/U TX_CONFIG_1 Transmit Configuration Register 1 See Table 18-6 for channel settings. 16 S S/U TX_CONFIG_2 Transmit Configuration Register 2 See Table 18-6 for channel settings. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-17 Internal Memory Map Table B-12. Peripheral Pin Multiplexing (PPM) Module (continued) Address Access Symbol 0x30 5C0E S/U RX_CONFIG_1 0x30 5C10 S/U RX_CONFIG_2 0x30 5C16 S/U 0x30 5C1A Register Size Reset Receive Configuration Register 1 See Table 18-6 for channel settings. 16 S Receive Configuration Register 2 See Table 18-6 for channel settings. 16 S RX_DATA Receive Data Register See Section 18.4.5 for bit descriptions. 16 S S/U RX_SHIFTER Receive Shift Register See Section 18.4.6 for bit descriptions. 16 S 0x30 5C1E S/U TX_DATA Transmit Data Register See Section 18.4.7 for bit descriptions. 16 S 0x30 5C22 S/U GPDO General-Purpose Data Out See Section 18.4.8 for bit descriptions. 16 S 0x30 5C24 S/U GPDI General-Purpose Data In See Section 18.4.9 for bit descriptions. 16 S 0x30 5C26 S/U SHORT_REG Short Register See Table 18-7 for bit descriptions. 16 S 0x30 5C28 S/U SHORT_CH_REG Short Channels Register See Table 18-10 for bit descriptions. 16 S 0x30 5C2A S/U SCALE_TCLK_REG Scale Transmit Clock Register See Table 18-13 for bit descriptions. 16 S Table B-13. MIOS14 (Modular Input/Output Subsystem) Address Access Symbol Register Size Reset MPWMSM0 (MIOS Pulse Width Modulation Submodule 0) 0x30 6000 S/U MPWMPERR MPWMSM0 Period Register. See Table 17-26 for bit descriptions. 16 S1 0x30 6002 S/U MPWMPULR MPWMSM0 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 6004 S/U MPWMCNTR MPWMSM0 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 6006 S/U MPWMSCR MPWMSM0 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM1 (MIOS Pulse Width Modulation Submodule 1) 0x30 6008 S/U MPWMPERR MPWMSM1 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 600A S/U MPWMPULR MPWMSM1 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 600C S/U MPWMCNTR MPWMSM1 Counter Register. See Table 17-28 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 B-18 Freescale Semiconductor Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address 0x30 600E Access Symbol S/U MPWMSCR Register MPWMSM1 Status/Control Register. See Table 17-29 for bit descriptions. Size Reset 16 S MPWMSM2 (MIOS Pulse Width Modulation Submodule 2) 0x30 6010 S/U MPWMPERR MPWMSM2 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 6012 S/U MPWMPULR MPWMSM2 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 6014 S/U MPWMCNTR MPWMSM2 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 6016 S/U MPWMSCR MPWMSM2 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM3 (MIOS Pulse Width Modulation Submodule 3) 0x30 6018 S/U MPWMPERR MPWMSM3 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 601A S/U MPWMPULR MPWMSM3 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 601C S/U MPWMCNTR MPWMSM3 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 601E S/U MPWMSCR MPWMSM3 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM4 (MIOS Pulse Width Modulation Submodule 4) 0x30 6020 S/U MPWMPERR MPWMSM4 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 6022 S/U MPWMPULR MPWMSM4 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 6024 S/U MPWMCNTR MPWMSM4 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 6026 S/U MPWMSCR MPWMSM4 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM5 (MIOS Pulse Width Modulation Submodule 5) 0x30 6028 S/U MPWMPERR MPWMSM5 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 602A S/U MPWMPULR MPWMSM5 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 602C S/U MPWMCNTR MPWMSM5 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 602E S/U MPWMSCR MPWMSM5 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-19 Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address Access Symbol Register Size Reset MMCSM6 (MIOS Modulus Counter Submodule 6) 0x30 6030 S/U MMCSMCNT MMCSM6 Up-Counter Register. See Table 17-10 for bit descriptions. 16 X 0x30 6032 S/U MMCSMML MMCSM6 Modulus Latch Register. See Table 17-11 for bit descriptions. 16 S 0x30 6034 S/U MMCSMSCRD MMCSM6 Status/Control Register. See Table 17-12 for bit descriptions. 16 S 0x30 6036 S/U MMCSMSCR MMCSM6 Status/Control Register. See Table 17-12 for bit descriptions. 16 S MMCSM7 (MIOS Modulus Counter Submodule 7) 0x30 6038 S/U MMCSMCNT MMCSM7 Up-Counter Register. See Table 17-10 for bit descriptions. 16 X 0x30 603A S/U MMCSMML MMCSM7 Modulus Latch Register. See Table 17-11 for bit descriptions. 16 S 0x30 603E S/U MMCSMSCR MMCSM7 Status/Control Register. See Table 17-12 for bit descriptions. 16 S MMCSM8 (MIOS Modulus Counter Submodule 8) 0x30 6040 S/U MMCSMCNT MMCSM8 Up-Counter Register. See Table 17-10 for bit descriptions. 16 X 0x30 6042 S/U MMCSMML MMCSM8 Modulus Latch Register. See Table 17-11 for bit descriptions. 16 S 0x30 6046 S/U MMCSMSCR MMCSM8 Status/Control Register. See Table 17-12 for bit descriptions. 16 S MDASM11 (MIOS Double Action Submodule 11) 0x30 6058 S/U MDASMAR MDASM11 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 605A S/U MDASMBR MDASM11 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 605A S/U MDASMSCR MDASM11 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MDASM12 (MIOS Double Action Submodule 12) 0x30 6060 S/U MDASMAR MDASM12 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 6062 S/U MDASMBR MDASM12 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 6064 S/U MDASMSCRD MDASM12 DataA Register. See Table 17-19 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 B-20 Freescale Semiconductor Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address 0x30 6066 Access Symbol S/U MDASMSCR Register MDASM Status/Control Register. See Table 17-21 for bit descriptions. Size Reset 16 S MDASM13 (MIOS Double Action Submodule 13) 0x30 6068 S/U MDASMAR MDASM13 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 606A S/U MDASMBR MDASM13 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 606E S/U MDASMSCR MDASM13 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MDASM14 (MIOS Double Action Submodule 14) 0x30 6070 S/U MDASMAR MDASM14 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 6072 S/U MDASMBR MDASM14 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 6076 S/U MDASMSCR MDASM14 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MDASM (MIOS Double Action Submodule 15) 0x30 6078 S/U MDASMAR MDASM15 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 607A S/U MDASMBR MDASM15 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 607E S/U MDASMSCR MDASM15 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MPWMSM16 (MIOS Pulse Width Modulation Submodule 16) 0x30 6080 S/U MPWMPERR MPWMSM16 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 6082 S/U MPWMPULR MPWMSM16 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 6084 S/U MPWMCNTR MPWMSM16 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 6086 S/U MPWMSCR MPWMSM16 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM17 (MIOS Pulse Width Modulation Submodule 17) 0x30 6088 S/U MPWMPERR MPWMSM17 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 608A S/U MPWMPULR MPWMSM17 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-21 Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address Access Symbol 0x30 608C S/U MPWMCNTR 0x30 608E S/U MPWMSCR Register Size Reset MPWMSM17 Counter Register. See Table 17-28 for bit descriptions. 16 S MPWMSM17 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM18 (MIOS Pulse Width Modulation Submodule 18) 0x30 6090 S/U MPWMPERR MPWMSM18 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 6092 S/U MPWMPULR MPWMSM18 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 6094 S/U MPWMCNTR MPWMSM18 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 6096 S/U MPWMSCR MPWMSM18 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM19 (MIOS Pulse Width Modulation Submodule 19) 0x30 6098 S/U MPWMPERR MPWMSM19 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 609A S/U MPWMPULR MPWMSM19 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 609C S/U MPWMCNTR MPWMSM19 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 609E S/U MPWMSCR MPWMSM19 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MPWMSM20 (MIOS Pulse Width Modulation Submodule 20) 0x30 60A0 S/U MPWMPERR MPWMSM20 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 60A2 S/U MPWMPULR MPWMSM20 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 60A4 S/U MPWMCNTR MPWMSM20 Counter Register. See Table 17-28 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 B-22 Freescale Semiconductor Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address 0x30 60A6 Access Symbol S/U MPWMSCR Register MPWMSM20 Status/Control Register. See Table 17-29 for bit descriptions. Size Reset 16 S MPWMSM21 (MIOS Pulse Width Modulation Submodule 21) 0x30 60A8 S/U MPWMPERR MPWMSM21 Period Register. See Table 17-26 for bit descriptions. 16 S 0x30 60AA S/U MPWMPULR MPWMSM21 Pulse Width Register. See Table 17-27 for bit descriptions. 16 S 0x30 60AC S/U MPWMCNTR MPWMSM21 Counter Register. See Table 17-28 for bit descriptions. 16 S 0x30 60AE S/U MPWMSCR MPWMSM21 Status/Control Register. See Table 17-29 for bit descriptions. 16 S MMCSM22 Up-Counter Register. See Table 17-10 for bit descriptions. 16 X MMCSM22 (MIOS Modulus Counter Submodule 22) 0x30 60B0 S/U MMCSMCNT 0x30 60B2 S/U MMCSMML MMCSM22 Modulus Latch Register. See Table 17-11 for bit descriptions. 16 S 0x30 60B6 S/U MMCSMSCR MMCSM22 Status/Control Register. See Table 17-12 for bit descriptions. 16 S MMCSM23 Up-Counter Register. See Table 17-10 for bit descriptions. 16 X MMCSM23 (MIOS Modulus Counter Submodule 23) 0x30 60B8 S/U MMCSMCNT 0x30 60BA S/U MMCSMML MMCSM23 Modulus Latch Register. See Table 17-11 for bit descriptions. 16 S 0x30 60BE S/U MMCSMSCR MMCSM23 Status/Control Register. See Table 17-12 for bit descriptions. 16 S 16 X MMCSM24 (MIOS Modulus Counter Submodule 24) 0x30 60C0 S/U MMCSMCNT MMCSM24 Up-Counter Register. See Table 17-10 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-23 Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address Access Symbol 0x30 60C2 S/U MMCSMML 0x30 60C6 S/U MMCSMSCR Register Size Reset MMCSM24 Modulus Latch Register. See Table 17-11 for bit descriptions. 16 S MMCSM24 Status/Control Register. See Table 17-12 for bit descriptions. 16 S MDASM27 (MIOS Double Action Submodule 27) 0x30 60D8 S/U MDASMAR MDASM27 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60DA S/U MDASMBR MDASM27 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60DE S/U MDASMSCR MDASM27 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MDASM28 (MIOS Double Action Submodule 28) 0x30 60E0 S/U MDASMAR MDASM28 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60E2 S/U MDASMBR MDASM28 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60E6 S/U MDASMSCR MDASM28 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MDASM29 (MIOS Double Action Submodule 29) 0x30 60E8 S/U MDASMAR MDASM29 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60EA S/U MDASMBR MDASM29 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60EE S/U MDASMSCR MDASM29 Status/Control Register. See Table 17-21 for bit descriptions. 16 S 16 S MDASM30 (MIOS Double Action Submodule 30) 0x30 60F0 S/U MDASMAR MDASM30 DataA Register. See Table 17-19 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 B-24 Freescale Semiconductor Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address Access Symbol 0x30 6F2 S/U MDASMBR 0x30 60F6 S/U MDASMSCR Register Size Reset MDASM30 DataA Register. See Table 17-19 for bit descriptions. 16 S MDASM30 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MDASM31 (MIOS Double Action Submodule 31) 0x30 60F8 S/U MDASMAR MDASM31 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60FA S/U MDASMBR MDASM31 DataA Register. See Table 17-19 for bit descriptions. 16 S 0x30 60FE S/U MDASMSCR MDASM31 Status/Control Register. See Table 17-21 for bit descriptions. 16 S MPIOSM (MIOS 16-bit Parallel Port I/O Submodule) 0x30 6100 S/U MPIOSMDR MPIOSM Data Register. See Table 17-33 for bit descriptions. 16 S 0x30 6102 S/U MPIOSMDDR MPIOSM Data Direction Register. See Table 17-34 for bit descriptions. 16 S MBISM (MIOS Bus Interface Submodule) 0x30 6800 S/U MIOS14TPCR MIOS14 Test and Pin Control Register. See Table 17-3 for bit descriptions. 16 X 0x30 6802 S/U MIOS14VECT MIOS14 Vector Register. See Table 17-2 for bit descriptions. 16 X 0x30 6804 S/U MIOS14VNR MIOS14 Vector Register. See Section 17.6.1.3 for bit descriptions. 16 S 0x30 6806 S/U MIOS14MCR MIOS14 Module Configuration Register. See Table 17-5 for bit descriptions. 16 X 16 X 16 X MCPSM (MIOS Status/Control Submodule) 0x30 6816 S/U MCPSMSCR MCPSM Status/Control Register. See Table 17-7 for bit descriptions. MIRSM0 (MIOS Interrupt Status Submodule 0) 0x30 6C00 S/U MIOS14SR0 MIOS14 Interrupt Status Register. See Table 17-35 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-25 Internal Memory Map Table B-13. MIOS14 (Modular Input/Output Subsystem) (continued) Address Access Symbol 0x30 6C04 S/U MIOS14ER0 0x30 6C06 S/U MIOS14RPR0 Register Size Reset MIOS14 Interrupt Enable Register. See Table 17-36 for bit descriptions. 16 X MIOS14 Request Pending Register.See Table 17-37 for bit descriptions. 16 S MIRSM1 (MIOS Interrupt Request Submodule 1) 0x30 6C40 S/U MIOS14SR1 MIOS14 Interrupt Status Register. See Table 17-38 for bit descriptions. 16 X 0x30 6C44 S/U MIOSER1 MIOS14 Interrupt Enable Register. See Table 17-39 for bit descriptions. 16 X 0x30 6C46 S/U MIOS14RPR1 MIOS14 Request Pending Register. See Table 17-40 for bit descriptions. 16 X MBISM0 (MIOS Interrupt Request Submodule 0) 0x30 6C30 S/U MIOS14LVL0 MIOS14 Interrupt Level 0 Register. See Table 17-42 for bit descriptions. 16 S 0x30 6C70 S/U MIOS14LVL1 MIOS14 Interrupt Level 1 Register. See Table 17-43 for bit descriptions. 16 X Size Reset 1 Only bits WEN, TEST, STB, and WIP affected by reset. Table B-14. TouCAN A, B and C (CAN 2.0B Controller) Address Access Symbol Register TouCAN_A (Note: Bit descriptions apply to TouCAN_B and TouCAN_C as well) 0x30 7080 S CANMCR_A TouCAN_A Module Configuration Register. See Table 16-11 for bit descriptions. 16 S 0x30 7082 T CANTCR_A TouCAN_A Test Register 16 S 0x30 7084 S CANICR_A TouCAN_A Interrupt Configuration Register. See Table 16-12 for bit descriptions. 16 S 0x30 7086 S/U CANCTRL0_A/ CANCTRL1_A TouCAN_A Control Register 0/ TouCAN_A Control Register 1. See Table 16-13 and Table 16-16 for bit descriptions. 16 S 0x30 7088 S/U PRESDIV_A/ CTRL2_A TouCAN_A Control and Prescaler Divider Register/TouCAN_A Control Register 2. See Table 16-17 and Table 16-18 for bit descriptions. 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 B-26 Freescale Semiconductor Internal Memory Map Table B-14. TouCAN A, B and C (CAN 2.0B Controller) (continued) Address Access Symbol Size Reset S/U TIMER_A TouCAN_A Free-Running Timer Register. See Table 16-19 for bit descriptions. 16 S -- -- Reserved -- -- 0x30 7090 S/U RXGMSKHI_A TouCAN_A Receive Global Mask High. See Table 16-20 for bit descriptions. 32 S 0x30 7092 S/U RXGMSKLO_A TouCAN_A Receive Global Mask Low. See Table 16-20 for bit descriptions. 32 S 0x30 7094 S/U RX14MSKHI_A TouCAN_A Receive Buffer 14 Mask High. See Table 16-21 for bit descriptions. 32 S 0x30 7096 S/U RX14MSKLO_A TouCAN_A Receive Buffer 14 Mask Low. See Table 16-21 for bit descriptions. 32 S 0x30 7098 S/U RX15MSKHI_A TouCAN_A Receive Buffer 15 Mask High. See Table 16-22 for bit descriptions. 32 S 0x30 709A S/U RX15MSKLO_A TouCAN_A Receive Buffer 15 Mask Low. See Table 16-22 for bit descriptions. 32 S Reserved -- -- 0x30 708A 0x30 708C -- 0x30 708E 0x30 709C -- 0x30 709E Register -- -- 0x30 70A0 S/U ESTAT_A TouCAN_A Error and Status Register. See Table 16-23 for bit descriptions. 16 S 0x30 70A2 S/U IMASK_A TouCAN_A Interrupt Masks. See Table 16-26 for bit descriptions. 16 S 0x30 70A4 S/U IFLAG_A TouCAN_A Interrupt Flags. See Table 16-27 for bit descriptions. 16 S 0x30 70A6 S/U RxECTR_A/ TxECTR_A TouCAN_A Receive Error Counter/ TouCAN_A Transmit Error Counter. See Table 16-28 for bit descriptions. 16 S 0x30 7100 -- 0x30 710F S/U MBUFF0_A1 TouCAN_A Message Buffer 02 -- U 0x30 7110 -- 0x30 711F S/U MBUFF1_A1 TouCAN_A Message Buffer 12 -- U 0x30 7120 -- 0x30 712F S/U MBUFF2_A1 TouCAN_A Message Buffer 22 -- U 0x30 7130 -- 0x30 713F S/U MBUFF3_A1 TouCAN_A Message Buffer 32 -- U 0x30 7140 -- 0x30 714F S/U MBUFF4_A1 TouCAN_A Message Buffer 42 -- U 0x30 7150 -- 0x30 715F S/U MBUFF5_A1 TouCAN_A Message Buffer 52 -- U 0x30 7160 -- 0x30 716F S/U MBUFF6_A1 TouCAN_A Message Buffer 62 -- U MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-27 Internal Memory Map Table B-14. TouCAN A, B and C (CAN 2.0B Controller) (continued) Address Access Symbol 0x307170 -- 0x30717F S/U MBUFF7_A1 0x30 7180 -- 0x30 718F S/U 0x30 7190 -- 0x30 719F Register Size Reset TouCAN_A Message Buffer 72 -- U MBUFF8_A1 TouCAN_A Message Buffer 82 -- U S/U MBUFF9_A1 TouCAN_A Message Buffer 92 -- U 0x30 71A0 -- 0x30 71AF S/U MBUFF10_A1 TouCAN_A Message Buffer 102 -- U 0x30 71B0 -- 0x30 71BF S/U MBUFF11_A1 TouCAN_A Message Buffer 112 -- U 0x30 71C0 -- 0x30 71CF S/U MBUFF12_A1 TouCAN_A Message Buffer 122 -- U 0x30 71D0 -- 0x30 71DF S/U MBUFF13_A1 TouCAN_A Message Buffer 132 -- U 0x30 71E0 -- 0x30 71EF S/U MBUFF14_A1 TouCAN_A Message Buffer 142 -- U 0x30 71F0 -- 0x30 71FF S/U MBUFF15_A1 TouCAN_A Message Buffer 152 -- U TouCAN_B 0x30 7480 S CANMCR_B TouCAN_B Module Configuration Register 16 S 0x30 7482 T CANTCR_B TouCAN_B Test Register 16 S 0x30 7484 S CANICR_B TouCAN_B Interrupt Configuration Register 16 S 0x30 7486 S/U CANCTRL0_B/ CANCTRL1_B TouCAN_B Control Register 0/ TouCAN_B Control Register 1 16 S 0x30 7488 S/U PRESDIV_B/ CTRL2_B TouCAN_B Control and Prescaler Divider Register/TouCAN_B Control Register 2 16 S 0x30 748A S/U TIMER_B TouCAN_B Free-Running Timer Register -- -- 0x30 7490 S/U 0x30 7492 0x30 748C -- 0x30 748E S Reserved -- -- RXGMSKHI_B TouCAN_B Receive Global Mask High 32 S S/U RXGMSKLO_B TouCAN_B Receive Global Mask Low 32 S 0x30 7494 S/U RX14MSKHI_B TouCAN_B Receive Buffer 14 Mask High 32 S 0x30 7496 S/U RX14MSKLO_B TouCAN_B Receive Buffer 14 Mask Low 3 S 0x30 7498 S/U RX15MSKHI_B TouCAN_B Receive Buffer 15 Mask High 32 S 0x30 749A S/U RX15MSKLO_B TouCAN_B Receive Buffer 15 Mask Low 32 S Reserved -- -- TouCAN_B Error and Status Register 16 S 0x30 749C -- 0x30 749E 0x30 74A0 -- -- S/U ESTAT_B MPC561/MPC563 Reference Manual, Rev. 1.2 B-28 Freescale Semiconductor Internal Memory Map Table B-14. TouCAN A, B and C (CAN 2.0B Controller) (continued) Address Access Symbol 0x30 74A2 S/U IMASK_B 0x30 74A4 S/U IFLAG_B 0x30 74A6 S/U 0x30 7500 -- 0x30 750F Register Size Reset TouCAN_B Interrupt Masks 16 S TouCAN_B Interrupt Flags 16 S RXECTR_B/ TXECTR_B TouCAN_B Receive Error Counter/ TouCAN_B Transmit Error Counter 16 S S/U MBUFF0_B1 TouCAN_B Message Buffer 0. -- U 0x30 7510 -- 0x30 751F S/U MBUFF1_B1 TouCAN_B Message Buffer 1. -- U 0x30 7520 -- 0x30 752F S/U MBUFF2_B1 TouCAN_B Message Buffer 2. -- U 0x30 7530 -- 0x30 753F S/U MBUFF3_B1 TouCAN_B Message Buffer 3. -- U 0x30 7540 -- 0x30 754F S/U MBUFF4_B1 TouCAN_B Message Buffer 4. -- U 0x30 7550 -- 0x30 755F S/U MBUFF5_B1 TouCAN_B Message Buffer 5. -- U 0x30 7560 -- 0x30 756F S/U MBUFF6_B1 TouCAN_B Message Buffer 6. -- U 0x30 7570 -- 0x30 757F S/U MBUFF7_B1 TouCAN_B Message Buffer 7. -- U 0x30 7580 -- 0x30 758F S/U MBUFF8_B1 TouCAN_B Message Buffer 8. -- U 0x30 7590 -- 0x30 759F S/U MBUFF9_B1 TouCAN_B Message Buffer 9. -- U 0x30 75A0 -- 0x30 75AF S/U MBUFF10_B1 TouCAN_B Message Buffer 10. -- U 0x30 75B0 -- 0x30 75BF S/U MBUFF11_B1 TouCAN_B Message Buffer 11. -- U 0x30 75C0 -- 0x30 75CF S/U MBUFF12_B1 TouCAN_B Message Buffer 12. -- U 0x30 75D0 -- 0x30 75DF S/U MBUFF13_B1 TouCAN_B Message Buffer 13. -- U 0x30 75E0 -- 0x30 75EF S/U MBUFF14_B1 TouCAN_B Message Buffer 14. -- U 0x30 75F0 -- 0x30 75FF S/U MBUFF15_B1 TouCAN_B Message Buffer 15. -- U TouCAN_C 0x30 7880 S CANMCR_C TouCAN_C Module Configuration Register 16 S 0x30 7882 T CANTCR_C TouCAN_C Test Register 16 S MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-29 Internal Memory Map Table B-14. TouCAN A, B and C (CAN 2.0B Controller) (continued) Address Access Symbol 0x30 7884 S CANICR_C 0x30 7886 S/U CANCTRL0_C/ CANCTRL1_C 0x30 7888 S/U 0x30 788A Size Reset TouCAN_C Interrupt Configuration Register 16 S TouCAN_C Control Register 0/ TouCAN_C Control Register 1 16 S PRESDIV_C/ CTRL2_C TouCAN_C Control and Prescaler Divider Register/ TouCAN_C Control Register 2 16 S S/U TIMER_C TouCAN_C Free-Running Timer Register -- -- 0x30 7890 S/U 0x30 7892 0x30 788C -- 0x30 788E Register S Reserved -- -- RXGMSKHI_C TouCAN_C Receive Global Mask High 32 S S/U RXGMSKLO_C TouCAN_C Receive Global Mask Low 32 S 0x30 7894 S/U RX14MSKHI_C TouCAN_C Receive Buffer 14 Mask High 32 S 0x30 7896 S/U RX14MSKLO_C TouCAN_C Receive Buffer 14 Mask Low 32 S 0x30 7898 S/U RX15MSKHI_C TouCAN_C Receive Buffer 15 Mask High 32 S 0x30 789A S/U RX15MSKLO_C TouCAN_C Receive Buffer 15 Mask Low 32 S Reserved -- -- 0x30 789C -- 0x30 789E -- -- 0x30 78A0 S/U ESTAT_C TouCAN_C Error and Status Register 16 S 0x30 78A2 S/U IMASK_C TouCAN_C Interrupt Masks 16 S 0x30 78A4 S/U IFLAG_C TouCAN_C Interrupt Flags 16 S 0x30 78A6 S/U RXECTR_C/ TXECTR_C TouCAN_C Receive Error Counter/ TouCAN_C Transmit Error Counter 16 S 0x30 7900 -- 0x30 790F S/U MBUFF0_C1 TouCAN_C Message Buffer 0. -- U 0x30 7910 -- 0x30 791F S/U MBUFF1_C1 TouCAN_B Message Buffer 1. -- U 0x30 7920 -- 0x30 792F S/U MBUFF2_C1 TouCAN_C Message Buffer 2. -- U 0x30 7930 -- 0x30 793F S/U MBUFF3_C1 TouCAN_C Message Buffer 3. -- U 0x30 7940 -- 0x30 794F S/U MBUFF4_C1 TouCAN_C Message Buffer 4. -- U 0x30 7950 -- 0x30 795F S/U MBUFF5_C1 TouCAN_C Message Buffer 5. -- U 0x30 7960 -- 0x30 796F S/U MBUFF6_C1 TouCAN_C Message Buffer 6. -- U 0x30 7970 -- 0x30 797F S/U MBUFF7_C1 TouCAN_C Message Buffer 7. -- U MPC561/MPC563 Reference Manual, Rev. 1.2 B-30 Freescale Semiconductor Internal Memory Map Table B-14. TouCAN A, B and C (CAN 2.0B Controller) (continued) Address Access Symbol 0x30 7980 -- 0x30 798F S/U MBUFF8_C1 0x30 7990 -- 0x30 799F S/U 0x30 79A0 -- 0x30 79AF Size Reset TouCAN_C Message Buffer 8. -- U MBUFF9_C1 TouCAN_C Message Buffer 9. -- U S/U MBUFF10_C1 TouCAN_C Message Buffer 10. -- U 0x30 79B0 -- 0x30 79BF S/U MBUFF11_C1 TouCAN_C Message Buffer 11. -- U 0x30 79C0 -- 0x30 79CF S/U MBUFF12_C1 TouCAN_C Message Buffer 12. -- U 0x30 79D0 -- 0x30 79DF S/U MBUFF13_C1 TouCAN_C Message Buffer 13. -- U 0x30 79E0 -- 0x30 79EF S/U MBUFF14_C1 TouCAN_C Message Buffer 14. -- U 0x30 79F0 -- 0x30 79FF S/U MBUFF15_C1 TouCAN_C Message Buffer 15. -- U 1 2 Register The last word of each of the MBUFF arrays (address 0x....E) is reserved and may cause a RCPU exception if read. See Table 16-3 and Table 16-4 for message buffer definitions. Table B-15. UIMB (U-Bus to IMB Bus Interface) Address Access Symbol 0x30 7F80 S1 UMCR 0x30 7F84 -- 0x30 7F8C -- -- 0x30 7F90 S/T UTSTCREG 0x30 7F94 -- 0x30 7F9C -- -- 0x30 7FA0 S UIPEND 1 Register Size Reset UIMB Module Configuration Register. See Table 12-6 for bit descriptions. 32 H Reserved 32 H UIMB Test Control Register. Reserved 32 H Reserved 32 H Pending Interrupt Request Register. See Section 12.5.3 and Table 12-7 for bit descriptions. 32 H S = Supervisor mode only, T = Test mode only Table B-16. CALRAM Control Registers Address Access Symbol Register Size Reset 32 S CALRAM 0x38 0000 S CRAMMCR CALRAMModule Configuration Register. See Table 22-3 for bit descriptions. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-31 Internal Memory Map Table B-16. CALRAM Control Registers (continued) Address 0x38 0004 Access Symbol S CRAMTST Register CALRAM Test Register. Size Reset 32 S Register1 32 S 0x38 0008 S CRAM_RBA0 CALRAM Region Base Address 0x38 000C S CRAM_RBA1 CALRAM Region Base Address Register1 32 S CRAM_RBA2 Register1 32 S 1 32 S 0x38 0010 S CALRAM Region Base Address 0x38 0014 S CRAM_RBA3 CALRAM Region Base Address Register 0x38 0018 S CRAM_RBA4 CALRAM Region Base Address Register1 32 S CRAM_RBA5 CALRAM Region Base Address Register 1 32 S 1 32 S 0x38 001C S 0x38 0020 S CRAM_RBA6 CALRAM Region Base Address Register 0x38 0024 S CRAM_RBA7 CALRAM Region Base Address Register1 32 S 0x38 0028 S CRAM_OLVCR CALRAM Overlay Configuration Register.See Table 22-7 for bit descriptions. 32 S 0x38 002C S2 READI_OTR READI Ownership Trace Register. See Section 24.6.1.1, "User-Mapped Register (OTR)," for more information. 32 H 1 2 See Section 22.5.2, "CALRAM Region Base Address Registers (CRAM_RBAx)," for more information. This register is write only. Table B-17. CALRAM Array Address Access Symbol Register Size Reset 32 Kbytes -- Size Reset CALRAM 0x3F 8000 -- 0x3F FFFF U,S CRAM CALRAM Array Table B-18. READI Module Registers Address Access Symbol Register 0x08 Read Only READI_DID Device ID Register See Table 24-6 for bit descriptions. 32 R 0x0A Read Only READI_DC Development Control Register See Table 24-7 for bit descriptions. 8 R 0x0B Read/Write READI_MC Mode Control Register1 See Table 24-9 for bit descriptions. 8 R 0x0D Read Only READI_UBA User Base Address Register See Table 24-10 for bit descriptions. 32 R 0x0F Read/Write READI_RWA Read/Write Access Register See Table 24-11 for bit descriptions. 80 R 0x10 Read/Write READI_UDI Upload/Download Information Register See Table 24-12 for bit descriptions. 34 R MPC561/MPC563 Reference Manual, Rev. 1.2 B-32 Freescale Semiconductor Internal Memory Map Table B-18. READI Module Registers 1 Address Access Symbol 0x14 Read/Write READI_DTA1 0x15 Read/Write READI_DTA2 Register Size Reset Data Trace Attributes Register 1 See Table 24-15 for bit descriptions. 48 R Data Trace Attributes Register 2 See Table 24-15 for bit descriptions. 48 R Not available on all revisions. Refer to the device errata for the version of silicon in use. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor B-33 Internal Memory Map MPC561/MPC563 Reference Manual, Rev. 1.2 B-34 Freescale Semiconductor Appendix C Clock and Board Guidelines The MPC561/MPC563 built-in PLL, oscillator, and other analog and sensitive circuits require that the board design follow special layout guidelines to ensure proper operation of the chip clocks. This appendix describes how the clock supplies and external components should be connected in a system. These guidelines must be fulfilled to reduce switching noise which is generated on internal and external buses during operation. Any noise injected into the sensitive clock and PLL logic reduces clock performance. The USIU maintains a PLL loss-of-lock warning indication that can be used to determine the clock stability in the MPC561/MPC563. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor C-1 Clock and Board Guidelines C.1 MPC56x Device Power Distribution Board MPC56x Device VDD (external 2.6 V) 100 nF3 Keyed VDD 2.6 V (Main Supply)1 VSS (external GND) NVDDL (external 2.6 V) 100 nF 1 nF 1 F VSS (internal GND) 100 nF VDDF5 (external 2.6 V) <100 VDDSYN CXFC XFC 100 nF VSSSYN CX(pF)4 EXTAL Q1 R12 CY(pF) XTAL 100 nF <10 KAP 2.6 V 1 nF KAPWR 1F VSupply IRAMSTBY6 100 nF 1. The main power supply may optionally supply operating current to reduce the keep-alive current requirements. See the circuit in Section 8.11.1, "System Clock Control Register (SCCR)." 2. Resistor R1 is currently not required. Space should be left on the board to add it in the future if necessary. 3. All 100 nF capacitors should be placed close to the pin. 4. CL is a function of specific crystal CL = CX + CY . See Section C.2, "Crystal Oscillator External Components." 5. This flash power supply is available on MPC563/564. VDDF should be connected to VDD as close as possible to the chip, preferably directly to an inner power plane of the board. 6. See C.3.3 for more information. 7. "All compenent values shown are nominal. Compenent tolerance should be considered when designing the system." MPC561/MPC563 Reference Manual, Rev. 1.2 C-2 Freescale Semiconductor Clock and Board Guidelines Figure C-1. MPC561/MPC563 Power Distribution Diagram -- 2.6 V Board MPC56x Device VDDH (digital 5 V) Keyed VDD 5 V VFLASH <10 1, 2 VDDA 100 nF 1nF VSSA 1uF <10 VRH 100 nF VRL 100 nF To Sensors 100 nF ALTREF R23 Analog ground plane From Sensors ~10k ~10 nF ANx (Analog Input) 1. 10 ohms is recommended because IREF (max) is 250 A per QADC64. 10 Ohm x 2 modules x 250 A = 5 mV (approximately one count, or one LSB) 2. The QADC64 circuit design allows for VDDA being less than VRH with a value of up to 10 ohms in this RC filter. 3. This size of resistor R2 depends on the sensor load current. It should be sized to match the voltage at VRH. Figure C-2. Power Distribution Diagram -- 5 V and Analog MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor C-3 Clock and Board Guidelines C.2 Crystal Oscillator External Components Board MPC56x Device CX EXTAL Q1 CY R11 XTAL VSSSYN 1. Resistor R1 is currently not required. Space should be left on the board to add it in the future if necessary. Figure C-3. Crystal Oscillator Circuit Table C-1. External Components Value For Different Crystals (Q1) Component NDK CP32C 20 MHz KINSEKI CX-11F 20 MHz MURATA CCSTC 4 MHz Units CL1 6 14 -- pF R13 1MEG3 1MEG3 1MEG3 Ohm CX 6 16 --2 pF CY 6 16 -- pF 1 CL according to crystal specification, CL = CX + CY. The Murata ceramic resonator includes the load capacitors. (8pF should be selected) 3. Resistor R1 is currently not required. Space should be left on the board to add it in the future if necessary. 2 The load capacitances specified in Table C-1 include all stray capacitance. Tolerance of the capacitors is 10%. The oscillator capacitors CX and CY were calculated as follows: CA = CB = 2CL CA = CX + CPAD + CSOCKET CB = CY + CPAD + CSOCKET Where: CL is load capacitance CPAD is pad capacitance * XTAL pad capacitance is CPAD = ~7 pF MPC561/MPC563 Reference Manual, Rev. 1.2 C-4 Freescale Semiconductor Clock and Board Guidelines * EXTAL pad capacitance is CPAD = ~7 pF CSOCKET is socket and board trace capacitance * Socket capacitance C <=1pF * Board trace capacitance C <=1pF. This should be low since the crystal must be located very close to the chip. C.2.1 KAPWR Filtering The KAPWR signal is the MPC561/MPC563 keep-alive power. KAPWR is used for the crystal oscillator circuit, and should be isolated from the noisy supplies. It is recommended that an RC filter be used on KAPWR, or bypass capacitors that are located as close as possible to the part. Board MPC56x Device <10 KAP 2.6 V KAPWR 100 nF VSSSYN Note: A filter cut off frequency of 500Hz is recommended, however this will result in a capacitor size of 33uF using a 10 Ohm resistor. This may be too expensive or large for the system. In this case the filter shown with cut- off frequency of 160kHz will suffice. Figure C-4. RC Filter Example Board MPC56x Device KAP 2.6 V KAPWR 100 nF 1 F VSSSYN Figure C-5. Bypass Capacitors Example (Alternative) C.2.2 PLL External Components VDDSYN and VSSSYN are the PLL dedicated power supplies. These supplies must be used only for the PLL and isolated from all other noisy signals in the board. VDDSYN could be isolated with RC filter (see Figure C-6), or LC filter. The maximum noise allowed on VDDSYN, and VSSSYN is 50 mV with typical cut-off frequency of 500 Hz. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor C-5 Clock and Board Guidelines Board Keyed VDD 2.6 V MPC56x Device 10 VDDSYN 100 nF VSSSYN Note: A filter cut off frequency of 500Hz is recommended, however this will result in a capacitor size of 33uF using a 10 Ohm resistor. This may be too expensive or large for the system. In this case the filter shown with cut- off frequency of 160kHz will suffice. Figure C-6. RC Filter Example MPC56x Device Board Keyed VDD 2.6 V 8.2 mH VDDSYN 100 nF VSSSYN Note: A filter cut off frequency of 500Hz is recommended, however this will result in a capacitor size of 15uF using a 8.2mH inductor. This may be too expensive or large for the system. In this case the filter shown with cut- off frequency of 5.5kHz will suffice. Figure C-7. LC Filter Example (Alternative) C.2.3 PLL Off-Chip Capacitor CXFC CXFC is the PLL feedback capacitor. It must be located as close as possible to the XFC and VDDSYN pads. The maximum noise allowed on XFC is 50 mV peak-to-peak with a typical cut-off frequency of 500 Hz. The XFC capacitor creates a low pass filter in the PLL loop. The filter output feeds the PLL VCO. The capacitor is charged and discharged by short current pulses, generated by the phase detector. So the capacitor leakage and absorption directly affect the AC component in the VCO input voltage that creates PLL output clock jitter. Therefore, the dielectric quality of CXFC should be high. Smaller CXFC makes the PLL faster to gain lock but less stable. Higher CXFC makes the PLL more stable but slower to gain lock. Because each board layout and application is unique, CXFC must be evaluated in a system. The minimum required value (including capacitor tolerance) for CXFC is determined by the following two cases: 0 < (MF+1) < 4 CXFC = (1130 * (MF+1) - 80) pF (MF+1) >= 4 CXFC = (2100 * (MF+1)) pF MPC561/MPC563 Reference Manual, Rev. 1.2 C-6 Freescale Semiconductor Clock and Board Guidelines MF is the multiplication factor in the PLPRCR register (refer to Section 8.11.2, "PLL, Low-Power, and Reset-Control Register (PLPRCR)" for more information). Board MPC56x Device XFC CXFC VDDSYN Figure C-8. PLL Off-Chip Capacitor Example C.3 C.3.1 PLL and Clock Oscillator External Components Layout Requirements Traces and Placement Traces connecting capacitors, crystal, resistor should be as short as possible. Therefore, the components (crystal, resistor and capacitors) should be placed as close to the oscillator pins of the MPC561/MPC563 as possible. The voltage to the VDDSYN pin should be well regulated and the pin should be provided with an extremely low impedance path from the VDDSYN filter to the VDDSYN pad. The VSSSYN pin should be provided with an extremely low impedance path in the board. All the filters for the supplies should be located as close as possible to the chip package. It is recommended to design individual VSSSYN plane to improve VSSSYN quietness. C.3.2 Grounding/Guarding The traces from the oscillator pins and PLL pins of the MPC561/MPC563 should be guarded from all other traces to reduce crosstalk. It can be provided by keeping other traces away from the oscillator circuit and placing a ground plane around the components and traces. C.3.3 IRAMSTBY Regulator Circuit IRAMSTBY is the data retention power supply for all on-board RAM arrays (CALRAM, DPTRAM, DECRAM). It has a shunt regulator circuit to divert excess current to ground in order to regulate voltage on the IRAMSTBY power supply pin. IRAMSTBY should be connected to a positive power supply, via a resistor, and bypassed by a capacitor to ground as shown in Figure C-9. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor C-7 Clock and Board Guidelines Board MPC56x Device RSUPPLY IRAMSTBY VSUPPLY CSUPPLY Figure C-9. IRAMSTBY Regulator Circuit The IRAMSTBY regulator has a minimum operating current required for the circuit to regulate. This minimum current, along with the range of regulation voltages, determines the regulator's limits of operation. Also, the regulator has a maximum current that it can sink without the regulated voltage rising out of range. Table C-2. IRAMSTBY Regulator Operating Specifications Parameter Minimum Typical Maximum Supply Current 50 A N/A 1.75 mA Regulated Voltage 1.35 V 1.70 V 1.95 V 1. Operating Conditions: -40 C to 150 C, all process variations. 2. Supply Current includes SRAM array standby currents. The boundary equations which describe the limits of the operating parameters for the IRAMSTBY regulator are as follows: (VSUPPLYMIN - 1.95 V) > 50 A RSUPPLY (VSUPPLYMAX - 1.35 V) < 1.75 mA RSUPPLY MPC561/MPC563 Reference Manual, Rev. 1.2 C-8 Freescale Semiconductor Appendix D TPU3 ROM Functions The following pages provide brief descriptions of the pre-programmed functions in the TPU3. For detailed descriptions, refer to the programming note for the individual function. The Freescale TPU Literature Pack provides a list of available programming notes. D.1 Overview The TPU3 contains 4 Kbytes of microcode ROM. It can have up to 8 Kbytes of memory and a maximum of four entry tables (see Figure D-1). This appendix defines the standard ROM functions for the MPC561/MPC563. TPU3ROM DPTRAM1 0 Add - Entry 1 Code Add - Entry Code Add - Entry 7 FF Bank 0 Bank 1 Bank 0 Bank 3 Add - Entry Add-Entry Code Add - Entry 3 FF 3 FF Bank 2 Code Code 1FF 5 FF Bank 3 Add - Entry Entry 1FF (Unimplemented) Code Code Bank 1 Entry Bank 2 Code 0 7FF . The DPTRAM is located at 0x30 2000. Figure D-1. TPU3 Memory Map The TPU3 can address up to 8 Kbytes of memory at any one time. It has 4 Kbytes of internal ROM, located in banks 0 and 1, and 8 Kbytes of dual-ported SRAM (DPTRAM), located in banks 0, 1, 2, and 3. As only one type of memory can be used at a time, the TPU3 must either use the internal ROM or the SRAM. Functions from both memory types cannot be used in conjunction. A new feature of the TPU3 microcode ROM is the two 16-function entry tables in the 4 Kbytes of internal ROM. The ETBANK field in the TPUMCR2 register, written once after reset, determines which one of MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-1 TPU3 ROM Functions these entry tables the RCPU selects. Though the TPU3 can access either entry table, only one table can be used at a time and functions from the tables cannot be mixed. The default entry table, located in bank 0, is identical to the standard microcode ROM in the TPU2, making any RCPU code written for the TPU2 interchangable with the TPU3. The functions in the default entry table in bank 0 are listed in Table D-1. Table D-1. Bank 0 and Bank 1 Functions 1 Function Number Bank 0 Functions (Default) Bank 1 Functions 0xF PTA (Programmable Time Accumulator) PTA (Programmable Time Accumulator) 0xE QOM (Queued Output Match) QOM (Queued Output Match) 0xD TSM (Table Stepper Motor) TSM (Table Stepper Motor) 0xC FQM (Frequency Measurement) FQM (Frequency Measurement) 0xB UART (Universal Asynchronous Receiver/Transmitter) UART (Universal Asynchronous Receiver/Transmitter) 0xA NITC (New Input Capture/Input Transition Counter) NITC (New Input Capture/Input Transition Counter) 9 COMM (Multiphase Motor Commutation) COMM (Multiphase Motor Commutation) 8 HALLD (Hall Effect Decode) HALLD (Hall Effect Decode) 7 MCPWM (Multi-Channel Pulse Width Modulation) MULTI (Multi TPU)1 6 FQD (Fast Quadrature Decode) FQD (Fast Quadrature Decode) 5 PPWA (Period/Pulse Width Accumulator) ID (Identification) 4 OC (Output Compare) OC (Output Compare) 3 PWM (Pulse Width Modulation) PWM (Pulse Width Modulation) 2 DIO (Discrete Input/Output) DIO (Discrete Input/Output) 1 SPWM (Synchronized Pulse Width Modulation) RWTPIN (Read/Write Timers and Pin) 0 SIOP (Serial Input/Output Port) SIOP (Serial Input/Output Port) The MULTI functions are only on revision D and later of the MPC561 and not available on revision B and earlier of the MPC563. The functions in the bank 1 entry table are identical to those in bank 0, except in three cases. Function 1, SPWM in the bank 0 table, has been replaced by RWTPIN, a function that allows a read and write to the TPU3 timebases and corresponding pin. Function 5, PPWA in the bank 0 table, is an identification (ID) function in the bank 1 table that provides the microcode ROM revision number. Function 7, MCPWM, has been replaced by MULTI in later silicon revisions. The functions in the bank 1 entry table are listed in Table D-1. The RCPU selects which entry table to use by setting the ETBANK field in the TPUMCR2 register. This register is written once after reset. Although one entry table is specified at start-up, in some cases it is possible to use functions from both tables without resetting the microcontroller. A customer may, for example, wish to use the ID function from bank 1 to verify the TPU3 microcode version but then use the MCPWM function from bank 0. As a customer will typically only run the ID function during system MPC561/MPC563 Reference Manual, Rev. 1.2 D-2 Freescale Semiconductor TPU3 ROM Functions configuration, and not again after that, the bank 1 entry table can be changed to the bank 0 entry table using the soft reset feature of the TPU3. This procedure is described in the following steps: 1. Set ETBANK field in TPUMCR2 to 0b01 to select the entry table in bank 1 2. Run the ID function 3. Stop the TPU3 by setting the STOP bit in the TPUMCR to one 4. Reset the TPU3 by setting the SOFTRST bit in the TPUMCR2 register 5. Wait at least nine clocks 6. Clear the SOFTRST bit in the TPUMCR2 register The TPU3 stays in reset until the RCPU clears the SOFTRST bit. After the SOFTRST bit has been cleared, the TPU3 will be reset and the entry table in bank 0 will be selected by default. To select the bank 0 entry table, write 0b00 to the ETBANK field in TPUMCR2. Always initialize any write-once register to ensure that an incorrect value is not accidentally written. The sections below document the bank 0 and bank 1 functions listed in Table D-1 of the TPU3 ROM module. D.2 Programmable Time Accumulator (PTA) PTA starts on a rising or falling edge and accumulates, over a programmable number of periods or pulses, a 32-bit sum of the total high time, low time, or input signal period. After the specified number of periods or pulses, the PTA generates an interrupt request. One to 255 period measurements can be accumulated before the TPU3 interrupts the RCPU, providing instantaneous or average frequency measurement capability. See Freescale TPU Progamming Note Programmable Time Accumulator TPU Function (PTA), (TPUPN06/D). Figure D-2 shows all of the host interface areas for the PTA function. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-3 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 Channel Function Select xxxx - PTA Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence 00 - High Time Accumulate 01 - Low Time Accumulate 10 - Period Accumulate, Rising 11 - Period Accumulate, Falling 0x30YY14 - 0x30YY16 Host Service Request 00 - No Host Service (Reset Condition) 01 - Not Used 10 - Not Used 11 - Initialize 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0x30YY20 0 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 MAX_COUNT 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 PERIOD_COUNT Param 1 LAST_TIME Param 2 ACCUM Param 3 HW Param 4 LW Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-2. PTA Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 D-4 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-2. PTA Parameters D.3 Queued Output Match TPU3 Function (QOM) QOM can generate single- or multiple-output match events from a table of offsets in parameter RAM. Loop modes allow complex pulse trains to be generated once, a specified number of times, or continuously. QOM can be used with other TPU3 channels in a variety of ways: the function can be triggered by a link from the channel, the reference time for the sequence of matches can be obtained from it, or the channel can be used as a discrete output pin. QOM can generate pulse-width modulated waveforms, including waveforms with high times of 0 or 100%. See Freescale TPU3 Progamming Note Queued Output Match TPU Function (QOM), (TPUPN01/D). Figure D-3 shows all of the host interface areas for the QOM function. The bit encodings shown in Table D-2 describe the corresponding fields in parameter RAM. Table D-2. QOM Bit Encoding A Timebase Selection 0 Use TCR1 as Timebase 1 Use TCR2 as Timebase Edge Selection 0 Falling Edge at Match 1 Rising Edge at Match B:C Reference for First Match 00 Immediate TCR Value 01 Last Event Time 10 Value Pointed to by REF_ADDR 11 Last Event Time MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-5 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 Channel Function Select xxxx - QOM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence 00 - Single-Shot Mode 01 - Loop Mode 10 - Continuous Mode 11 - Continuous Mode 0x30YY14 - 0x30YY16 Host Service Request 00 - No Host Service (Reset Condition) 01 - Initialize, No Pin Change 10 - Initialize, Pin Low 11 - Initialize, Pin High 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS BITS 7 8 9 10 11 12 13 14 15 0x30XXW0 B LAST_OFF_ADDR A Param 0 (LAST_MATCH_TM) OFF_PTR C Param 1 0x30XXW2 0x30XXW4 OFFSET_1 : Param 2 0x30XXW6 OFFSET_2 : Param 3 0x30XXW8 OFFSET_3 : Param 4 0x30XXWA OFFSET_4 : Param 5 0x30XXWC OFFSET_51 : Param 6 0x30XXWE OFFSET_61 : Param 7 0x30XX(W+1)0 OFFSET_71 : Param 8 0x30XX(W+1)2 OFFSET_81 : Param 9 : : : 0x30XX(W+1)E OFFSET_141 : Param 15 1. Not available on all channels. = Written By RCPU = Written by RCPU and TPU W = Channel Number 0 1 2 3 4 REF_ADDR LOOP_CNT = Written By TPU 5 6 = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-3. QOM Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 D-6 Freescale Semiconductor TPU3 ROM Functions D.4 Table Stepper Motor (TSM) The TSM function provides acceleration and deceleration control of a stepper motor with up to 58 programmable step rates. TSM uses a table in parameter RAM, rather than an algorithm, to define the stepper motor acceleration profile, allowing full defininition of the profile. In addition, a slew rate parameter allows fine control of the motor's terminal running speed independent of the acceleration table. The RCPU writes a desired position, and the TPU3 accelerates, slews, and decelerates the motor to the required position. Full- and half-step support is provided for two-phase motors. See Freescale TPU3 Progamming Note Table Stepper Motor TPU Function (TSM), (TPUPN04/D). Figure D-4 and Figure D-5 show all of the host interface areas for the TSM function when operating in master or slave mode. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-7 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES Channel Function Select xxxx - TSM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence x0 - Local Mode Acceleration Table 0x30YY14 - 0x30YY16 x1 - Split Mode Acceleration Table 0x - Rotate Pin_Sequence Once Between Steps 1x - Rotate Pin_Sequence Twice Between Steps Host Service Request 00 - No Host Service (Reset Condition) 01 - Initialize, Pin Low 10 - Initialize, Pin High 11 - Move Request (Master Only) 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 3 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 1 2 3 TABLE_SIZE 4 BITS 6 7 8 9 10 DESIRED_POSITION CURRENT_POSITION CHANNEL_COUNTER SLEW_PERIOD START_PERIOD PIN_SEQUENCE 5 11 12 13 14 15 TABLE_INDEX S A Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-4. TSM Parameters -- Master Mode MPC561/MPC563 Reference Manual, Rev. 1.2 D-8 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES Channel Function Select xxxx - TSM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence x0 - Rotate Pin_Sequence Once 0x30YY14 - 0x30YY16 Between Steps x1 - Split Mode Acceleration Table 1x - Rotate Pin_Sequence Once Between Steps 1x - Rotate Pin_Sequence Twice Between Steps Host Service Request 00 - No Host Service (Reset Condition) 01 - Initialize, Pin Low 10 - Initialize, Pin High 11 - Move Request (Master Only) 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 3 1 1 1 0 Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0x30YY20 0 ADDRESS OFFSETS 0 0x30XX(W+1)0 0x30XX(W+1)2 0x30XX(W+1)4 0x30XX(W+1)6 0x30XX(W+1)8 0x30XX(W+1)A 0x30XX(W+1)C1 : 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted PARAMETER RAM BITS 1 2 3 4 5 6 7 8 ACCEL_RATIO_2 ACCEL_RATIO_4 ACCEL_RATIO_6 ACCEL_RATIO_8 ACCEL_RATIO_10 ACCEL_RATIO_12 ACCEL_RATIO_141 : 0x30XX(W+3)A1 9 ACCEL_RATIO_361 10 11 12 13 14 ACCEL_RATIO_1 ACCEL_RATIO_3 ACCEL_RATIO_5 ACCEL_RATIO_7 ACCEL_RATIO_9 ACCEL_RATIO_11 ACCEL_RATIO_131 : ACCEL_RATIO_351 15 Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 : Param 29 1. Optional additional parameters not available in all cases. Refer to Freescale Programming Note TPUPN04/D for details. = Written By RCPU = Written by RCPU and TPU = Written By TPU = Unused Parameters W = Channel Number For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-5. TSM Parameters -- Slave Mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-9 TPU3 ROM Functions D.5 Frequency Measurement (FQM) FQM counts the number of TPU-channel input pulses during a user-defined window period. The function has single-shot and continuous modes. In continuous mode, no pulses are lost between sample windows, and the user can select whether to detect pulses on the rising or falling edge. This function is intended for high-speed measurement. (Measurement of slow pulses with noise rejection can be made with PTA.) See Freescale TPU Progamming Note Frequent Measurement TPU Function (FQM), (TPUPN03/D). Figure D-6 shows all of the host interface areas for the FQM function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-10 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 Channel Function Select xxxx - FQM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Begin with Falling Edge, 0x30YY14 - 0x30YY16 Single-Shot Mode 01 - Begin with Falling Edge, Continuous Mode 10 - Begin with Rising Edge, Single-Shot Mode 11 - Begin with Rising Edge, Continuous Mode cHost Service Request 00 - No Host Service (Reset Condition) 01 - Not Used 10 - Initialize 11 -Not Used 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL WINDOW_SIZE PULSE_COUNT IN_WINDOW_ACCUMULATOR Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Primary Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-6. FQM Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-11 TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-6. FQM Parameters D.6 Universal Asynchronous Receiver/Transmitter (UART) The UART uses one or two TPU3 channels to provide asynchronous communications. Data word length is programmable from 1 to 14 bits. The function supports detection or generation of even, odd, and no parity. Baud rate is freely programmable and can be higher than 100 Kbaud. Eight bidirectional UART channels running in excess of 9600 baud can be implemented on the TPU3. See Freescale TPU3 Progamming Note Asynchronous Serial Interface TPU Function (UART), (TPUPN07/D). Figure D-7 and Figure D-8 show all of the host interface areas for the UART function in transmitting and receiving modes. MPC561/MPC563 Reference Manual, Rev. 1.2 D-12 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES Channel Function Select xxxx - UART Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence 00 - No Parity 01 - No Parity 10 - Even Parity 11 - Odd Parity 0x30YY14 - 0x30YY16 Host Service Request 00 - Not Used 01 - Not Used 10 - Transmit 11 - Receive 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 3 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 1 TDRE 2 3 4 5 BITS 6 7 8 9 10 11 12 PARITY_TEMP MATCH_RATE TRANSMIT_DATA_REG DATA_SIZE ACTUAL_BIT_COUNT SHIFT_REGISTER 13 14 15 Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-7. UART Transmitter Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-13 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES Channel Function Select xxxx - UART Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence 00 - No Parity 01 - No Parity 10 - Even Parity 11 - Odd Parity 0x30YY14 - 0x30YY16 Host Service Request 00 - Not Used 01 - Not Used 10 - Transmit 11 - Receive 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 3 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWA 1 2 PE RE 3 4 5 BITS 6 7 8 9 10 11 12 PARITY_TEMP MATCH_RATE TRANSMIT_DATA_REG DATA_SIZE ACTUAL_BIT_COUNT SHIFT_REGISTER 13 14 15 Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-8. UART Receiver Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 D-14 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS Figure D-8. UART Receiver Parameters D.7 New Input Capture/Transition Counter (NITC) NITC allows, for a specified number of transitions, a TPU3 channel to: capture the value of a TCR (test configuration register) or any specified location in parameter RAM and then generate an interrupt request to notify the bus master (times of the two most recent transitions remain in parameter RAM), capture input continually or detect a specific number of transitions and end channel activity until reinitialization, or generate a link to other channels after the transitions have taken place. See Freescale TPU Progamming Note New Input Capture/Input Transition Counter TPU Function (NITC), (TPUPN08/D). Figure D-9 shows all of the host interface areas for the NITC function. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-15 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 OPTIONS ADDRESSES 3 Channel Function Select xxxx - NITC Function Number. Assigned during microcode assembly. See Table D-1 0 0 0 0x30YY0C - 0x30YY12 1 Host Sequence 00 - Single-Shot Mode, No Links 01 - Continuous Mode, No Links 10 - Single-Shot Mode, Links 11 - Continuous Mode, Links 0x30YY14 - 0x30YY16 Host Service Request 00 - No Host Service (Reset Condition) 01 - Initialize TCR Mode 10 - Initialize Parameter Mode 11 - Not Used 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 0x30XXW0 0x30XXW2 1 2 3 START_LINK_ CHANNEL 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 4 5 6 BITS 7 8 9 10 11 12 13 14 CHANNEL_CONTROL PARAM_ADDR LINK_CHAN NEL_COUNT MAX_COUNT TRANS_COUNT FINAL_TRANS_TIME LAST_TRANS_TIME 15 0 Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-9. NITC Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 D-16 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-9. NITC Parameters D.8 Multiphase Motor Commutation (COMM) The COMM function generates phase commutation signals for a variety of brushless motors, including three-phase brushless direct current motors. It derives the commutation state directly from the position decoded in FQD, eliminating the need for hall effect sensors. The state sequence is implemented as a user-configurable state machine, providing a flexible approach with other general applications. A RCPU offset parameter is provided to allow the RCPU to advance or retard all swtiching angles on the fly. This feature is useful for torque maintenance at high speeds. See Freescale TPU Progamming Note Multiphase Motor Commutation TPU Function (COMM), (TPUPN09/D). Figure D-10 and Figure D-10 show all of the host interface areas for the COMM function. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-17 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES cChannel Function Select xxxx - COMM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Sensorless Match Update Mode 01 - Sensorless Match Update Mode 10 - Sensorless Link Update Mode 11 - Sensorled Mode 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 0x30YY18 - 0x30YY1A 01 - Not Used 10 - Initialize or Force State 11 - Initialize or Force Immediate State Test cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority Channel Inerrput Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 3 1 1 1 0x30YY1C - 0x30YY1E 0 0 ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE PARAMETER RAM BITS 2 3 4 5 6 7 8 9 10 11 12 13 14 15 START_LINK_ COUNTER_ADDR Param 0 CHANNEL NO_OF_STATES STATE_NO Param 1 OFFSET Param 2 UPDATE_PERIOD Param 3 UPPER Param 4 LOWER Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the Figure D-10. COMM Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 D-18 Freescale Semiconductor TPU3 ROM Functions PRAM Address Offset Map. Figure D-10. COMM Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-19 TPU3 ROM Functions PARAMETER RAM ADDRESS OFFSETS 0 BITS 6 7 8 STATE 0 STATE 1 STATE 2 STATE 3 STATE 4 STATE 5 STATE 61 STATE 71 STATE 81 STATE 91 1 2 3 4 5 9 10 11 12 13 14 15 LENGTH PIN_CONFIG Param 8 Param 9 LENGTH PIN_CONFIG LENGTH PIN_CONFIG Param 10 LENGTH PIN_CONFIG Param 11 LENGTH PIN_CONFIG Param 12 LENGTH PIN_CONFIG Param 13 LENGTH PIN_CONFIG Param 14 LENGTH PIN_CONFIG Param 15 LENGTH PIN_CONFIG Param 16 LENGTH PIN_CONFIG Param 17 : : : : LENGTH STATE 211 PIN_CONFIG Param 29 1. Not available on all channels. = Written By RCPU = Written by RCPU and TPU W = Master Channel Number 0x30XX(W + 1)0 0x30XX(W + 1)2 0x30XX(W + 1)4 0x30XX(W + 1)6 0x30XX(W + 1)8 0x30XX(W + 1)A 0x30XX(W + 1)C 0x30XX(W + 1)E 0x30XX(W + 2)0 0x30XX(W + 2)2 : : 0x30XX(W + 3)A = Written By TPU = Unused Parameters For address offsets, XX=41 for TPU_A, 45 for TPU_BSee Table 19-24 for PRAM Address Offset Map. Figure D-10. COMM Parameters (continued) D.9 Hall Effect Decode (HALLD) The HALLD function decodes the sensor signals from a brushless motor (the function supports two- or three-sensor decoding) and a direction input from the RCPU into a state number. The decoded state number is written into a COMM channel, which outputs the required commutation drive signals. In addition to brushless motor applications, the function can have more general applications, such as decoding "option" switches. See Freescale TPU Progamming Note Hall Effect Decode TPU Function (HALLD), (TPUPN10/D). Figure D-11 shows all of the host interface areas for the HALLD function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-20 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - HALLD Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Channel A 01 - Channel B 10 - Channel B 11 - Channel C (3-Channel Mode Only) 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Not Used 10 - Initialize, 2-Channel Mode 11 - Initialize, 3-Channel Mode 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status x - Not Used 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 DIRECTION 1 STATE_NO_ADDR 2 PINSTATE Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 1. Channel A Only. 2. One Channel Only (Channel B in 2-Channel Mode, Channel C in 3-Channel Mode. = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-11. HALLD Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-21 TPU3 ROM Functions D.10 Multichannel Pulse-Width Modulation (MCPWM) MCPWM generates pulse-width modulated outputs with full 0 to 100% duty cycle range independent of other TPU3 activity. This capability requires two TPU3 channels plus an external gate for one PWM. (A simple one-channel PWM capability is supported by the QOM function.) Multiple PWMs generated by MCPWM have two types of high time alignment: edge aligned and center aligned. Edge-aligned mode uses n + 1 TPU3 channels for n PWMs, and center-aligned mode uses 2n + 1 channels. Center-aligned mode allows a user to define "dead time" so that two PWMs can be used to drive an H-bridge without destructive current spikes. This feature is important for motor control applications. See Freescale TPU Progamming Note Multichannel PWM TPU Function (MCPWM), (TPUPN05/D). Figure D-12 through Table D-17 shows the host interface areas for the MCPWM function in each mode. MPC561/MPC563 Reference Manual, Rev. 1.2 D-22 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MCPWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Edge-Aligned Mode 01 - Slave A Type Center-Aligned Mode 10 - Slave B Type Center-Aligned Mode 11 - Slave C Type Center-Aligned Mode 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Initialize as Slave (Inverted) 10 - Initialize, as Slave (Normal) 11 - Initialize as Master 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 PERIOD IRQ_RATE 10 11 12 13 14 15 PERIOD_COUNT LAST_RISE_TIME LAST_FALL_TIME RISE_TIME_PTR FALL_TIME_PTR Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-12. MCPWM Parameters -- Master Mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-23 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MCPWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0A cHost Sequence 00 - Edge-Aligned Mode 01 - Slave A Type Center-Aligned Mode 10 - Slave B Type Center-Aligned Mode 11 - Slave C Type Center-Aligned Mode 0x30YY0C - 0x30YY12 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Initialize As Slave (Inverted) 10 - Initialize As Slave (Normal) 11 - Initialize As Master 0x30YY14 - 0x30YY16 cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY18 - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY1C - 0x30YY1E 0 cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 PARAMETER RAM ADDRESS OFFSETS 0 1 0x03XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 BITS 6 7 8 9 PERIOD HIGH_TIME 10 11 12 13 14 15 Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 HIGH_TIME_PTR RISE_TIME_PTR FALL_TIME_PTR = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-13. MCPWM Parameters -- Slave Edge-Aligned Mode MPC561/MPC563 Reference Manual, Rev. 1.2 D-24 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-13. MCPWM Parameters -- Slave Edge-Aligned Mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-25 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MCPWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0A cHost Sequence 00 - Edge-Aligned Mode 01 - Slave A Type Center-Aligned Mode 10 - Slave B Type Center-Aligned Mode 11 - Slave C Type Center-Aligned Mode 0x30YY0C - 0x30YY12 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Initialize As Slave (Inverted) 10 - Initialize As Slave (Normal) 11 - Initialize As Master 0x30YY14 - 0x30YY16 cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY18 - 0x30YY1A 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY1C - 0x30YY1E 0 cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE BITS 7 8 9 10 11 12 13 14 15 PERIOD Param 0 NXT_B_RISE_TIME Param 1 NXT_B_FALL_TIME Param 2 DEAD_TIME HIGH_TIME_PTR Param 3 RISE_TIME_PTR Param 4 FALL_TIME_PTR Param 5 Param 6 Param 7 2 3 4 5 6 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-14. MCPWM Parameters -- Slave Ch A Non-Inverted Center-Aligned Mode MPC561/MPC563 Reference Manual, Rev. 1.2 D-26 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MCPWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Edge-Aligned Mode 01 - Slave A Type Center-Aligned Mode 10 - Slave B Type Center-Aligned Mode 11 - Slave C Type Center-Aligned Mode 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Initialize As Slave (Inverted) 10 - Initialize As Slave (Normal) 11 - Initialize As Master 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0x30YY20 0 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 BITS 7 8 9 10 11 12 13 14 15 HIGH_TIME Param 0 CURRENT_HIGH_TIME Param 1 TEMP_STORAGE Param 2 Param 3 B_FALL_TIME_PTR Param 4 B_RISE_TIME_PTR Param 5 Param 6 Param 7 5 6 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-15. MCPWM Parameters -- Slave Ch B Non-Inverted Center-Aligned Mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-27 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MCPWM Function Number 0x30YY0A Assigned during microcode assembly. See Table D-1 cHost Sequence 00 - Edge-Aligned Mode 01 - Slave A Type Center-Aligned Mode 10 - Slave B Type Center-Aligned Mode 11 - Slave C Type Center-Aligned Mode 0x30YY0C - 0x30YY12 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Initialize As Slave (Inverted) 10 - Initialize As Slave (Normal) 11 - Initialize As Master 0x30YY14 - 0x30YY16 cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY18 - 0x30YY1A 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY1C - 0x30YY1E 0 cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE BITS 7 8 9 10 11 12 13 14 15 PERIOD Param 0 NXT_B_RISE_TIME Param 1 NXT_B_FALL_TIME Param 2 DEAD_TIME HIGH_TIME_PTR Param 3 RISE_TIME_PTR Param 4 FALL_TIME_PTR Param 5 Param 6 Param 7 2 3 4 5 6 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-16. MCPWM Parameters -- Slave Ch A Inverted Center-Aligned Mode MPC561/MPC563 Reference Manual, Rev. 1.2 D-28 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MCPWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Edge-Aligned Mode 01 - Slave A Type Center-Aligned Mode 10 - Slave B Type Center-Aligned Mode 11 - Slave C Type Center-Aligned Mode 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Initialize As Slave (Inverted) 10 - Initialize As Slave (Normal) 11 - Initialize As Master 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0x30YY20 0 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 BITS 7 8 9 10 11 12 13 14 15 HIGH_TIME Param 0 CURRENT_HIGH_TIME Param 1 TEMP_STORAGE Param 2 Param 3 B_FALL_TIME_PTR Param 4 B_RISE_TIME_PTR Param 5 Param 6 Param 7 5 6 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-17. MCPWM Parameters -- Slave Ch B Inverted Center-Aligned Mode MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-29 TPU3 ROM Functions D.11 Multi TPU (MULTI) The MULTI function consists of four sub-functions: FRINC: A free running incrementing 32-bit counter. The counter frequency is determined by a variable parameter `TICKS' and either TCR1 or TCR2 can be used as a timebase. This function runs continuously without service from the RCPU and can only be stopped by setting its priority to zero. FRDEC: A free running 32-bit decrementing counter, similar to FRINC but with the additional feature that it can be programmed to generate an interrupt when the counter reaches zero. PWM_IN: This function analyses a PWM-input signal by measuring a selectable number of periods. It adds both periods as well as high-time for the selected number of periods. SPEED: This function measures periods from a defined edge to the next defined edge. The measurement is not specified for a number of periods, but is continuous. If the result is read regularly, the function measures the time for the number of periods detected between the two reads. In other words, the function averages the periods between two consecutive reads. This function uses TCR1 for the timebase. This function is available only on revision D and later of the MPC561 and is not available on revision B and earlier of the MPC563. Figure D-18 through Figure D-21 show all of the host interface areas for the MULTI function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-30 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MULTI Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0A cHost Sequence x0 - Initialize with timebase as TCR1 x1 - Initialize with timebase as TCR2 0x30YY0C - 0x30YY12 cHost Service Request 00 - Not used 01 - PWM_in or SPEED mode 10 - Free Running decrementer mode 11 - Free Running incrementer mode 0x30YY14 - 0x30YY16 cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY18 - 0x30YY1A 1 1 1 0 cChannel Interrupt Enable x - Not used 0x30YY1C - 0x30YY1E 0 cChannel Interrupt Status x - Not used 0x30YY20 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 BITS 7 8 9 10 11 12 13 14 15 TICKS Param 0 COUNTER_HIGH Param 1 COUNTER_LOW Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 6 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-18. MULTI Parameters -- FRINC MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-31 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MULTI Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Timebase TCR1, Interrupt Off 01 - Timebase TCR2, Interrupt Off 10 - Timebase TCR1, Interrupt On 11 - Timebase TCR2, Interrupt On 0x30YY14 - 0x30YY16 cHost Service Request 00 - N/A 01 - PWM_in or SPEED mode 10 - Free running decrementer mode 11 - Free running incrementer mode 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0x30YY20 0 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 BITS 7 8 9 10 11 12 13 14 15 TICKS Param 0 Param 1 COUNTER_HIGH COUNTER_LOW Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 6 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-19. MULTI Parameters -- FREDEC MPC561/MPC563 Reference Manual, Rev. 1.2 D-32 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MULTI Function Number Assigned during microcode assembly. See Table D-1 0x30YY0A cHost Sequence 00 - PWM_IN with TCR1 01 - PWM_IN with TCR2 10 - SPEED falling edge triggered 11 - SPEED rising edge triggered 0x30YY0C - 0x30YY12 cHost Service Request 00 - N/A 01 - PWM_IN or SPEED mode 10 - Free running decrementer mode 11 - Free running incrementer mode 0x30YY14 - 0x30YY16 cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY18 - 0x30YY1A 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY1C - 0x30YY1E 0 cChannel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 UNDEFINED PERIODS BITS 6 7 8 9 10 11 12 13 14 15 MEASURE TIME Param 0 Param 1 LAST EVENT HIGH_TEMP Param 2 LOW_TEMP Param 3 HIGH_BYTE Param 4 LOW_WORD Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-20. MULTI Parameters -- SPEED MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-33 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - MULTI Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - PWM_IN with TCR1 01 - PWM_IN with TCR2 10 - SPEED falling edge triggered 11 - SPEED rising edge triggered 0x30YY14 - 0x30YY16 cHost Service Request 00 - N/A 01 - PWM_IN or SPEED mode 10 - Free running decrementer mode 11 - Free running incrementer mode 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cChannel Interrupt Status 0x30YY20 0 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted PARAMETER RAM ADDRESS OFFSETS 0 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE BITS 7 8 1 2 3 4 5 6 9 NUMBER OF PERIODS LAST_RISING hIGH_TEMP PER_TEMP HIGH PERIODS IRQ_TIME 10 11 12 13 14 15 PER COUNT Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-21. MULTI Parameters -- PWM_IN MPC561/MPC563 Reference Manual, Rev. 1.2 D-34 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-21. MULTI Parameters -- PWM_IN D.12 Fast Quadrature Decode TPU3 Function (FQD) FQD is a position-feedback function for motor control. It provides the RCPU with a 16-bit free-running position counter by decoding the two signals from a slotted encoder. FQD incorporates a "speed switch" that disables one of the channels at high speed, allowing faster signals to be decoded. Furthermore, every counter update provides a time stamp that is useful for interpolating position and determining velocity at low speed or in instances that implement low-resolution encoders. The ITC function handles the third index channel provided by some encoders. See Freescale TPU Progamming Note Fast Quadrature Decode TPU Function (FQD), (TPUPN02/D). Figure D-22 and Figure D-23 show the host interface areas for the FQD function for primary and secondary channels. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-35 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - FQD Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Primary Channel (Normal Mode) 01 - Secondary Channel (Normal Mode) 10 - Primary Channel (Fast Mode) 11 - Secondary Channel (Fast Mode) 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Not Used 10 - Read TCR1 11 - Initialize 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable x - Not Used 0x30YY0A cChannel Interrupt Status 0x30YY20 0 x - Not Used PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 BITS 6 7 8 9 10 11 12 13 14 15 EDGE_TIME Param 0 POSITION_COUNT Param 1 TCR1_VALUE Param 2 CHAN_PINSTATE Param 3 CORR_PINSTATE_ADDR Param 4 EDGE_TIME_LSB_ADDR Param 5 Param 6 Param 7 5 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-22. FQD Parameters -- Primary Channel MPC561/MPC563 Reference Manual, Rev. 1.2 D-36 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS OPTIONS NAME 0 1 2 0 0 0 ADDRESSES 3 cChannel Function Select xxxx - FQD Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Primary Channel (Normal Mode) 01 - Secondary Channel (Normal Mode) 10 - Primary Channel (Fast Mode) 11 - Secondary Channel (Fast Mode) 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service (Reset Condition) 01 - Not Used 10 - Read TCR1 11 - Initialize 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 cChannel Interrupt Enable x - Not Used 0x30YY0A cChannel Interrupt Status 0x30YY20 0 x - Not Used PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 TCR1_VALUE CHAN_PINSTATE CORR_PINSTATE_ADDR EDGE_TIME_LSB_ADDR = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-23. FQD Parameters -- Secondary Channel MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-37 TPU3 ROM Functions CONTROL BITS NAME OPTIONS ADDRESSES See Table 19-24 for the PRAM Address Offset Map. Figure D-23. FQD Parameters -- Secondary Channel D.13 Period/Pulse-Width Accumulator (PPWA) The period/pulse-width accumulator (PPWA) algorithm accumulates a 16-bit or 24-bit sum of either the period or the pulse width of an input signal over a programmable number of periods or pulses (from one to 255). After an accumulation period, the algorithm can generate a link to a sequential block of up to eight channels. The user specifies a starting channel of the block and number of channels within the block. Generation of links depends on the mode of operation. Any channel can be used to measure an accumulated number of periods of an input signal. A maximum of 24 bits can be used for the accumulation parameter. From one to 255 period measurements can be made and summed with the previous measurement(s) before the TPU3 interrupts the RCPU, allowing instantaneous or average frequency measurement, and the latest complete accumulation (over the programmed number of periods). The pulse width (high-time portion) of an input signal can be measured (up to 24 bits) and added to a previous measurement over a programmable number of periods (one to 255). This provides an instantaneous or average pulse-width measurement capability, allowing the latest complete accumulation (over the specified number of periods) to always be available in a parameter. By using the output compare function in conjunction with PPWA, an output signal can be generated that is proportional to a specified input signal. The ratio of the input and output frequency is programmable. One or more output signals with different frequencies, yet proportional and synchronized to a single input signal, can be generated on separate channels. See Freescale TPU Progamming Note Period/Pulse-Width Accumulator TPU Function (PPWA), (TPUPN11/D). Figure D-24 shows the host interface areas and parameter RAM for the PPWA function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-38 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - PPWA Function Number 0x30YY0C - 0x30YY12 Assigned during microcode assembly. See Table D-1 cHost Sequence 00 - Accumulate 24-Bit Periods, No Links 0x30YY14 - 0x30YY16 01 - Accumulate 16-Bit Periods, Links 10 - Accumulate 24-Bit Pulse Widths, No Links 11 - Accumulate 16-Bit Pulse Widths, Links cHost Service Request 00 - Not Used 01 - Not Used 10 - Initialize 11 - Not Used 0x30YY18 - 0x30YY1A cChannel Priority 00 - Channel Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE BITS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 START_LINK_ LINK_CHANNEL_ CHANNEL_CONTROL Param 0 CHANNEL COUNT1 MAX_COUNT2 PERIOD_COUNT Param 1 LAST_ACCUM Param 2 ACCUM Param 3 ACCUM_RATE PPWA_UB Param 4 PPWA_LW Param 5 Param 6 Param 7 1. The TPU does not check the value of LINK_CHANNEL_COUNT. If this parameter is not >0 and < 8, results are unpredictable. 2. MAX_COUNT may be written at any time by the host RCPU, but if the value written is < PERIOD_COUNT, a period or pulse-width accumulation is terminated. If this happens, the number of periods over which the accumulation is performed will not correspond to MAX_COUNT. = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX =41 for TPU_A, 45 for TPU_B YY = 40 for TPU_A, Figure D-24. PPWA Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-39 TPU3 ROM Functions CONTROL BITS 44 for TPU_B See Table 19-24. Figure D-24. PPWA Parameters D.14 ID TPU3 Function (ID) This is a simple function that returns the version of the TPU3 ROM on the current device. Figure D-25 shows all of the host interface areas for the ID function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-40 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 Channel Function Select xxxx - ID Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence xx - Not Used 0x30YY14 - 0x30YY16 Host Service Request 00 - No Action 01 - Read TPU ROM version 10 - Not Used 11 - Not Used 0x30YY18 - 0x30YY1A Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E 1 1 1 0 Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 TPU3_ID 6 BITS 7 8 9 10 11 12 13 14 15 ROM_REVISION Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 Figure D-25. ID Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-41 TPU3 ROM Functions D.15 Output Compare (OC) The output compare (OC) function generates a rising edge, falling edge, or a toggle of the previous edge: immediately upon RCPU initiation (generating a pulse with a length equal to a programmable delay time), after a programmable delay time, or continuously. Upon receiving a link from a channel, OC references, without RCPU interaction, a specifiable period and calculates an offset that is equal to the period x the ratio, where the ratio is a supplied parameter. This algorithm generates, with each high/low time, a 50% duty-cycle continuous square equal to the calculated offset. Due to offset calculation, there is an initial link time before continuous pulse generation begins. See Freescale TPU Progamming Note Output Compare TPU Function (OC), (TPUPN12/D). Figure D-26 shows the host interface areas and parameter RAM for the OC function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-42 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - OC Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 0x - Matches and Pulses Scheduled x1 - Only Read TCR1, TCR2 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service Request 01 - Host-Initiated Pulse 10 - Not Used 11 - Initialize, Continuous Pulses 0x30YY18 - 0x30YY1A cChannel Priority 00 - Channel Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 OFFSET Param 1 RATIO REF_ADDR1 0 Param 2 REF_ADDR2 0 REF_ADDR3 0 Param 3 REF_TIME Param 4 ACTUAL_MATCH_TIME Param 5 TCR1 Param 6 TCR2 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-26. OC Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-43 TPU3 ROM Functions D.16 Pulse-Width Modulation (PWM) The TPU3 can generate a pulse-width modulation (PWM) waveform with any duty cycle from 0 to 100% (within the resolution and latency capability of the TPU3). To define the PWM, the RCPU provides one parameter that indicates the period and another that indicates the high time. Updates to one or both of these parameters can effect waveform change immediately, or coherently at the next low-to-high pin transition. See Freescale TPU Progamming Note Pulse-Width Modulation TPU Function (PWM), (TPUPN17/D). Figure D-27 shows the host interface areas and parameter RAM for the PWM function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-44 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - PWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence xx - Not Used 0x30YY14 - 0x30YY16 cHost Service Request 00 - Not Used 01 - Immediate Update of PWM 10 - Initialize 11 - Not Used 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E cInterrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A cInterrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 Param 1 OLDRIS PWMHI (1, 3) Param 2 PWMPER (2, 3) Param 3 PWMRIS Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-27. PWM Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-45 TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-27. PWM Parameters D.17 Discrete Input/Output (DIO) The DIO function (Bank 0 and Bank 1) allows a TPU3 channel to be used as a digital I/O pin. When a pin is used as a discrete input, a parameter indicates the current input level and the previous 15 levels of a pin. Bit 15, the most significant bit of the parameter, indicates the most recent state. Bit 14 indicates the next most recent state, and so on. The programmer can update the parameter when a transition occurs, when the RCPU makes a request, or when a rate specified in another parameter is matched. When a pin is used as a discrete output, it is set high or low only upon request by the RCPU. See Freescale TPU Progamming Note Discrete Input/Output TPU Function (DIO), (TPUPN18/D). Figure D-28 shows the host interface areas for the DIO function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-46 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - DIO Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Update on Transition 01 - Update at Match Rate 10 - Update on HSR 11 11 - Not Used 0x30YY14 - 0x30YY16 cHost Service Request 00 - Not Used 01 - Drive Pin High 10 - Drive Pin Low 11 - Initialize 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0x30YY1C - 0x30YY1E 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 Param 1 PIN_LEVEL MATCH_RATE Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-28. DIO Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-47 TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-28. DIO Parameters D.18 Synchronized Pulse-Width Modulation (SPWM) The SPWM function (Bank 0) generates a pulse-width modulated waveform (PWM). The RCPU can change the period or high time of the waveform at any time. Three different operating modes allow the function to maintain complex timing relationships between channels without RCPU intervention. The SPWM output waveform duty cycle excludes 0% and 100%. If it is not necessary for a PWM to maintain a time relationship to another PWM, the PWM function should be used instead. See Freescale TPU Progamming Note Synchronized Pulse-Width Modulation TPU Function (SPWM), (TPUPN19/D). Figure D-29 shows all of the host interface areas for the SPWM function. MPC561/MPC563 Reference Manual, Rev. 1.2 D-48 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - SPWM Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Mode 0 01 - Mode 1 10 - Mode 2 11 - Not Used 0x30YY14 - 0x30YY16 cHost Service Request 00 - No Host Service Request 01 - Not Used 10 - Initialize 11 - Immediate Update (Mode 1) 0x30YY18 - 0x30YY1A cChannel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 0x30YY1C - 0x30YY1E Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0 0 PARAMETER RAM ADDRESS OFFSETS 0 1 0x03XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 LASTRISE 5 6 BIT 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 Param 1 NEXTRISE HIGH_TIME Param 2 PERIOD Param 3 REF_ADDR1 Param 4 DELAY Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-29. SPWM Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-49 TPU3 ROM Functions PARAMETER RAM (MODE 1) ADDRESS OFFSETS 0 1 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 2 3 4 LASTRISE 5 REF_ADDR1 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 Param 1 NEXTRISE HIGH_TIME Param 2 DELAY Param 3 REF_ADDR2 Param 4 REF_VALUE Param 5 Param 6 Param 7 PARAMETER RAM (MODE 2) ADDRESS OFFSETS 0 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 1 2 3 4 LASTRISE START_LINK_ CHANNEL 0x30XXWA 0x30XXWC 0x30XXWE 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL Param 0 Param 1 NEXTRISE HIGH_TIME Param 2 PERIOD Param 3 LINK_CHANNEL_ REF_ADDR1 Param 4 COUNT DELAY Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-29. SPWM Parameters (continued) MPC561/MPC563 Reference Manual, Rev. 1.2 D-50 Freescale Semiconductor TPU3 ROM Functions D.19 Read/Write Timers and Pin TPU3 Function (RWTPIN) The RWTPIN Bank 1 TPU3 function enables the RCPU to read, via locations in PRAM, both the TCR1 and TCR2 timer counters, and than selectively load TCR1 or TCR2 with a RCPU-supplied value contained in PRAM. The function also allows control of the pin state and direction of the RWTPIN channel. A pin-state parameter is maintained in PRAM and is updated upon every service request. It can contain a value of the current pin state whether the pin is programmed as an input or output. The function also receives links. Upon receipt, it will read the two TCRs into PRAM, updating the pin-state parameter and generating a maskable interrupt request to the RCPU. The RCPU can control the channel pin, the TCRs, or both. To control the channel pin only, the `read TCR' option is used and the values returned ignored. Because this function controls the TCRs without affecting the channel pin, it can run on a TPU3 channel whose pin is controlled by a function running on another channel (for example, a slave stepper-motor channel). See Freescale TPU Progamming Note Using The TPU Function Library And TPU Emulation Mode, (TPUPN00/D). Figure D-30 shows all of the host interface areas for the PTA function. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-51 TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 Channel Function Select xxxx - RWTPIN Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 Host Sequence XX - Not Used 0x30YY14 - 0x30YY16 Host Service Request 00 - No Action 0x30YY18 - 0x30YY1A 01 - Read TCRs and read/write pin 10 - Write TCR1, read TCRs and read/write pin 11 - Write TCR2, read TCRs and read/write pin Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority 1 1 1 0x30YY1C - 0x30YY1E 0 Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 0 PARAMETER RAM ADDRESS OFFSETS 0 1 2 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL CHANNEL_PIN_STATE TCR1_VALUE TCR2_VALUE Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B See Table 19-24 for the PRAM Address Offset Map. Figure D-30. RWTPIN Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 D-52 Freescale Semiconductor TPU3 ROM Functions D.20 Serial Input/Output Port (SIOP) The serial input/output port (SIOP) TPU3 function uses two or three TPU3 channels to form a uni- or bidirectional synchronous serial port that can be used to communicate with a wide variety of devices. It can be used to add serial capabilities to a device without a serial port, or to extend the capabilities of one with a hardware-synchronous port. The SIOP TPU3 function has been designed to closely resemble the SIOP hardware port found on some Freescale MCUs. SIOP operates in master mode (the TPU3 always generates the clock) and has the following programmable features: 1. Choice of one-channel clock-only, two-channel clock + transmit, two-channel clock + receive, or three-channel clock + transmit + receive operating modes 2. Freely programmable baud-rate period over a 15-bit range of TCR1 counts 3. Selection of MSB or LSB first shift direction 4. Variable transfer size from 1 to 16 bits 5. Programmable clock polarity When a transfer of data is complete, the SIOP function notifies the host RCPU by issuing an interrupt request. The arrangement of the multiple SIOP channels is fixed: the data-out channel is the channel above the clock channel and the data-in channel is the channel below the clock channel. In clock-only or uni-directional mode, the unused TPU3 channels are free to run other TPU3 functions. Two possible SIOP configurations are shown in Figure D-31 Da ta Out-Chan x+1 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Clo c k Out-Chan x Da ta In-Cha n x-1 8-bit bidirectional transfer, MSB first with data valid on clock rising edge Da ta Out-Cha n x+1 0 1 2 3 4 5 6 7 8 9 Clo c k Out-Chan x 10-bit output only transfer, LSB first with data valid on clock falling edge Figure D-31. Two Possible SIOP Configurations D.20.1 Parameters Figure D-32 shows the host interface areas and parameter RAM for the SIOP function. The following sections describe these parameters. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-53 TPU3 ROM Functions NOTE Only the clock channel requires any programming. The data-in and data-out channels are entirely under TPU3 microcode control. MPC561/MPC563 Reference Manual, Rev. 1.2 D-54 Freescale Semiconductor TPU3 ROM Functions CONTROL BITS NAME 0 1 2 0 0 0 OPTIONS ADDRESSES 3 cChannel Function Select xxxx - SIOP Function Number. Assigned during microcode assembly. See Table D-1 0x30YY0C - 0x30YY12 cHost Sequence 00 - Clock Channel Active Only, 0x30YY14 - 0x30YY16 No Data Transfer 01 - DOUT Channels Active, No Data Receive 10 - Clock and DIN Channels Active, No Data Transmit 11 - Full Bidirectional Transmit and Receive cHost Service Request 00 - No Host Service (Reset Condition) 0x30YY18 - 0x30YY1A 01 - No Action 10 - No Action 11 - Initialize Clock Channel and Start Transfer Channel Priority 00 - Disabled 01 - Low Priority 10 - Medium Priority 11 - High Priority Channel Interrupt Enable 0 - Channel Interrupt Disabled 1 - Channel Interrupt Enabled 0x30YY0A Channel Interrupt Status 0 - Channel Interrupt Not Asserted 1 - Channel Interrupt Asserted 0x30YY20 1 1 1 0x30YY1C - 0x30YY1E 0 0 PARAMETER RAM ADDRESS OFFSETS 0x30XXW0 0x30XXW2 0x30XXW4 0x30XXW6 0x30XXW8 0x30XXWA 0x30XXWC 0x30XXWE 0 S 1 2 3 4 5 6 BITS 7 8 9 10 11 12 13 14 15 CHANNEL_CONTROL HALF-PERIOD BIT_COUNT XFER_SIZE DATA Param 0 Param 1 Param 2 Param 3 Param 4 Param 5 Param 6 Param 7 = Written By RCPU = Written by RCPU and TPU W = Channel Number = Written By TPU = Unused Parameters For address offsets: XX=41 for TPU_A, 45 for TPU_B YY=40 for TPU_A, 44 for TPU_B Figure D-32. SIOP Parameters MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-55 TPU3 ROM Functions CONTROL BITS See Table 19-24 for the PRAM Address Offset Map. Figure D-32. SIOP Parameters D.20.1.1 CHAN_CONTROL This 9-bit, RCPU-written parameter is used to set up the clock polarity for the SIOP data transfer. The valid values for CHAN_CONTROL for this function are given in Table D-3. CHAN_CONTROL must be written by the host before issuing the host service request (HSR) to initialize the function. Table D-3. SIOP Function Valid CHAN_Control Options CHAN_CONTROL1 876543210 1 Resulting Action 010001101 Data valid on clock Falling edge. 010001110 Data valid on clock Rising edge. Other values of CHAN_CONTROL may result in indeterminate operation. D.20.1.2 BIT_D BIT_D is a RCPU-written bit that determines the direction of shift of the SIOP data. If BIT_D is zero, then SIOP_DATA is right shifted (LSB first). If BIT_D is one then SIOP_DATA is left shifted (MSB first). D.20.1.3 HALF_PERIOD This RCPU-written parameter defines the baud rate of the SIOP function. The value contained in HALF_PERIOD is the number of TCR1 counts for a half-SIOP clock period (for example, for a 50 baud rate, with a TCR1 period of 240 ns, the value [(1/50)/2]/240 ns = 42) should be written to HALF_PERIOD. The range for HALF_PERIOD is 1 to 0x8000, although the minimum value in practice will be limited by other system conditions. See the notes in Section D.20.1.6, "SIOP_DATA" for information on the use and performance of the SIOP function. D.20.1.4 BIT_COUNT The TPU3 uses this parameter to count down the number of bits remaining during a transfer in progress. During the SIOP initialization state, BIT_COUNT is loaded with the value contained in XFER_SIZE and then decremented as the data is transferred. When it reaches zero, the transfer is complete and the TPU3 issues an interrupt request to the RCPU. D.20.1.5 XFER_SIZE This RCPU-written parameter determines the number of bits that make up a data transfer. During initialization, XFER_SIZE is copied into BIT_COUNT. XFER_SIZE is shown as a 5-bit parameter to match the maximum size of 16 bits in SIOP_DATA, although the TPU3 uses the whole word location. For normal use, XFER_SIZE should be in the 1- to 16-bit range. MPC561/MPC563 Reference Manual, Rev. 1.2 D-56 Freescale Semiconductor TPU3 ROM Functions D.20.1.6 SIOP_DATA This parameter is the data register for all SIOP transfers. Data is shifted out of one end of SIOP_DATA and shifted in at the other end, the shift direction being determined by the value of BIT_D. In output-only mode, zero will be shifted into SIOP_DATA and in input-only mode, the data shifted out is ignored. In clock-only mode, SIOP_DATA is still shifted. NOTE The TPU3 does not "justify" the data position in SIOP_DATA (for example, if an 8-bit bidirectional transfer is made, shifting LSB first, then the bottom byte of SIOP_DATA will be shifted out and the input data will be shifted into the upper byte of SIOP_DATA). NOTE SIOP_DATA is not buffered. The RCPU should only access it between completion of one transfer and the start of the next. D.20.2 Host RCPU Initialization of the SIOP Function The RCPU initializes the SIOP function by: 1. Disabling the channel by clearing the two channel-priority bits 2. Selecting the SIOP function on the channel by writing the assigned SIOP function number to the function-select bits 3. Writing CHAN_CONTROL in the clock channel parameter RAM 4. Writing HALF_PERIOD, BIT_D, and XFER_SIZE in the clock-channel parameter RAM to determine the speed, shift direction, and size of the transfer 5. Writing SIOP_DATA if the data output is to be used 6. Selecting the required operating mode via the two host-sequence bits 7. Issuing a host service request type 0b11 8. Enabling service by assigning H, M, or L priority to the clock channel via the two channel-priority bits The TPU3 then starts the data transfer, and issues an interrupt request when the transfer is complete. Once the function has been initialized, the RCPU only needs to write SIOP_DATA with the new data and issue a HSR 0b11 to initiate a new transfer. In input-only or clock-only modes, just the HSR 0b11 is required. D.20.3 SIOP Function Performance Like all TPU3 functions, the performance limit of the SIOP function depends, because of the operational nature of the scheduler, on the service time (latency) associated with other active TPU3 channels. Where two channels are used for a uni-directional system and no other TPU3 channels are active, the maximum baud rate is approximately 230 at a bus speed of 16.77 MHz. A three-channel bidirectional system under the same conditions has a maximum baud rate of approximately 200. When more TPU3 channels are MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-57 TPU3 ROM Functions active, these performance figures will be degraded; however, the scheduler assures that the worst-case latency in any TPU3 application can be closely approximated. TPU3 reference manual guidelines and information given in the SIOP-state timing table should be used to perform an analysis on any proposed TPU3 application that appears to approach the TPU's performance limits. Table D-4. SIOP State Timing1 1 State Number and Name Max. RCPU Clock Cycles Number of RAM Accesses by TPU3 S1 SIOP_INIT HSQ = X0 X1 28 38 7 7 S2 DATA_OUT HSQ = X0 X1 14 24 4 4 S3 DATA_IN HSQ = 0X 1X 14 28 4 6 Execution times do not include the time slot transition time (TST = 10 or 14 RCPU clocks). D.20.3.1 XFER_SIZE Greater Than 16 XFER_SIZE is normally programmed to be in the 1- to 16-bit range to match the size of SIOP_DATA, and has thus been shown as a 5-bit value in the host interface diagram. However, the TPU3 actually uses all 16 bits of the XFER_SIZE parameter when loading BIT_COUNT. In some unusual circumstances this can be used to an advantage. If an input device is producing a data stream of greater than 16 bits then manipulation of XFER_SIZE will allow selective capturing of the data. In clock-only mode, the extended XFER_SIZE can be used to generate up to 0xFFFF clocks. D.20.3.2 Data Positioning As stated above, the TPU3 does not "justify" the data position in SIOP_DATA. Therefore, in the case of a byte transfer, the data output will be sourced from one byte and the data input will shift into the other byte. This is true for all data sizes except 16 bits, in which case the full SIOP_DATA register is used for both data output and input. D.20.3.3 Data Timing In the example given in Figure D-33, the data output transitions are shown as being completely synchronous with the relevant clock edge and it is assumed that the data input is latched exactly on the opposite clock edge. This is the simplest way to show the examples, but is not strictly true. Since the TPU3 is a multi-tasking system, and the data channels are manipulated directly by microcode software while servicing the clock edge, there is a finite delay between the relevant clock edge and the data-out being valid or the data-in being latched. This delay is equivalent to the latency in servicing the clock channel due to other TPU3 activity and is shown as `Td' in the timing diagram. Td is the delay between the clock edge and the next output data being valid and also the delay between the opposite clock edge and the input data being read. For the vast majority of applications, the delay Td will not present a problem and can be ignored. Only for a system which heavily loads the TPU3 should the worst case latency be calculated for MPC561/MPC563 Reference Manual, Rev. 1.2 D-58 Freescale Semiconductor TPU3 ROM Functions the SIOP clock channel + actual SIOP service time ( = Td) and ensure that the baud rate is chosen such that HALF_PERIOD - Td is not less that the minimum setup time of the receiving device. A transmitting device must also hold data valid for a minimum time of Td after the clock. DAT A OUT c h a n x+ 1 Td CLO C K ch a n x Td D ATA IN c h a n x-1 Figure D-33. SIOP Function Data Transition Example MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor D-59 TPU3 ROM Functions MPC561/MPC563 Reference Manual, Rev. 1.2 D-60 Freescale Semiconductor Appendix E Memory Access Timing Table E-1 lists all possible memory access timings for internal and external memory combinations. The clock values show the number of clocks from the moment an address is valid on a specific bus, until data is back on that same bus. The following assumptions were used when compiling the information: * The arbitration time was ignored. The values assume that the bus (or buses) involved in a transaction was in the IDLE state when the transaction needs that bus. * The UIMB works in a mode of 1:1. This is relevant for IMB access values. In the case of 2:1 mode, the clock latency for a cycle on the IMB should be doubled (each IMB access takes two clocks). * The basic delay of an external bus to a U-bus is four clocks (external master case). * All IMB accesses are assumed to be 16-bit accesses only. If 32-bit accesses are used, then each such IMB access is split into two separate 16-bit cycles with normal IMB performance for each. Table E-1. Memory Access Times Using Different Buses Internal Buses IMB SIU 6 5 4+N2 4+N 2 2 2 -- 14 2+N 2+N -- 15 6 6 7 6 7 6 8 7 RAM 3/41 1 2-1-1-1-1.. 33 Peripheral Mode (only external master is active) 4/5 Slave Mode (both external and internal CPUs are active) 5/6 RCPU Instruction Fetches Show Cycle Internal Memory Mapped External Flash RCPU Load/Store External RAM/Flash DECRA M Non-mappe d Internal Write Read Memory 1 "/" indicates on/off page Flash access. N is the number of read cycle clocks from external address valid till external data valid. In the case of zero wait states, N = 2. 3 Assuming BBC is parked on the U-bus 4 SIUMCR[BURST_EN] = 1 5 Until address is valid on external pins 2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor E-1 Memory Access Timing Table E-2. Instruction Timing Examples for Different Buses Note: L = L-bus, U = U-bus, E = E-bus, C = CMF (Flash), IMB = intermodule bus, DC = DECRAM Number of Clocks Access Load/Store -> Ebus Total 1 2 3 L U E 4 L Instruction Fetch-> cmf new page 3 consecutive accesses C,U U 6 7 8 9 10 11 12 13 61 E Load/Store -> IMB 16 bits 5 U L IMB 6 IMB U L 2 U2 C,U 1 U C,U 1 U Instruction Fetch-> DECRAM (Decompression off) Instruction Fetch-> cmf new page Load/Store -> IMB U ICD U ICD U U C,U 2 U L U IMB 6 IMB Instruction Fetch-> cmf new page Load/Store -> IMB C U U 6 U L U IMB 6 IMB External Bus-> cmf new page E External Bus-> IMB E U 5 U L L U U E IMB 7 IMB Load/Store-> DECRAM L U E U U L MPC561/MPC563 Reference Manual, Rev. 1.2 E-2 Freescale Semiconductor Memory Access Timing Table E-2. Instruction Timing Examples for Different Buses (continued) Note: L = L-bus, U = U-bus, E = E-bus, C = CMF (Flash), IMB = intermodule bus, DC = DECRAM Number of Clocks Access Total 1 Instruction Fetch-> cmf 2 consecutive accesses and External Bus-> cmf 2 3 4 5 6 7 8 9 10 11 12 13 C,U 2 U C --3 -- -- -- -- -- -- -- U 11 U E Retr y E4 U 8 U E 1 N is the number of read cycle clocks from external address valid until external data valid. In the case of zero wait states, N = 2. 2 Core instruction fetch data bus is usually the U-bus 3 8 clocks are dedicated for external accesses, and internal accesses are denied. 4 Assuming the external master immediately retries Note: Shaded areas = address phase ; Non-shaded areas = data phase MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor E-3 Memory Access Timing MPC561/MPC563 Reference Manual, Rev. 1.2 E-4 Freescale Semiconductor Appendix F Electrical Characteristics This appendix contains detailed information on power considerations, DC/AC electrical characteristics, and AC timing characteristics of the MPC561/MPC563. The MPC561/MPC563 is designed to operate at 40 MHz, or optionally at 56 or 66 MHz. Refer to Appendix G, "66-MHz Electrical Characteristics," for more information. ) Table F-1. Absolute Maximum Ratings (VSS = 0V) Rating 1 2 3 4 5 2.6-V Supply Voltage1 Flash Supply Flash Core Voltage3,4 Voltage1, 4 Oscillator, keep-alive Reg. Supply SRAM Supply Voltage1 Symbol Min. Value Max. Value Unit VDDL -0.3 3.02 V VFLASH -0.3 5.6 V VDDF -0.3 3.0 V KAPWR -0.3 3.0 V -0.3 3.0 V -0.3 3.0 V Voltage1,5 IRAMSTBY 6 Clock Synthesizer Supply Voltage1 7 N.A. -- -- -- -- 8 QADC Supply Voltage6 VDDA -0.3 5.6 V 9 5-V Supply Voltage VDDH -0.3 5.6 V V Voltages7,8 VDDSYN 10 DC Input VIN VSS-0.3 5.69 11 Reference VRH, with reference to VRL VRH -0.3 5.6 V 12 Reference ALTREF, with reference to VRL VARH -0.3 5.6 V 13 VSS Differential Voltage VSS - VSSA -0.1 0.1 V 15 VREF Differential Voltage VRH - VRL -5.6 5.6 V 16 VRL to VSSA Differential Voltage VRL - VSSA -0.3 0.3 V 17 Maximum Input Current per pin 10, 11, 12 IMA -2513 2513 mA 18 QADC Maximum Input Current per Pin IMAX -2513 2513 mA 19 Operating Temperature Range - Ambient (Packaged), M temperature range. TA -40 (TL) +125 (TH) C 19a Operating Temperature Range - Ambient (Packaged), C temperature range. TA -40 (TL) +85 (TH) C TSB -40 (TL) +135 (TH) C TJ -40 +150 C TSTG -55 +150 C TSDR -- 235 C MSL -- 3 -- 20 Operating Temperature Range - Solder Ball (Packaged any perimeter solder ball)14 21 Junction Temperature Range 22 Storage Temperature Range 23 24 Maximum Solder Temperature Moisture Sensitivity Level16 15 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-1 Electrical Characteristics 1 For internal digital supply of VDDL = 2.6-V typical. 2.6 volt supply pins can withstand up to 3.6 volts for acumulative time of 24 hours over the lifetime of the device. 3 During operation the value of VFLASH must be 5.0 V 5% 4 These power supplies are available on MPC563 and MPC564 only. 5 Maximum average current into the IRAMSTBY pin must be < 1.75mA. 6 VDDA=5.0 V 5%. 7 All 2.6-V input-only pins are 5-V tolerant. 8 Note that long term reliability may be compromised if 2.6-V output drivers drive a node which has been previously pulled to >3.1 V by an external component. HRESET and SRESET are fully 5-V compatible. 9 6.35 V on 5-V only pins (all QADC, all TPU, all QSMCM and the following MIOS pins: MDA[11:15], MDA[27:31], MPWM16, MPIO32B[7:9]/MPWM[20:21], MPIO32B11/C_CNRX0, MPIO32B12/C_CNTX0 ). Internal structures hold the input voltage below this maximum voltage on all of these pins, except the QSMCM RXD1/QPI1 and RXD2/QPI2/C_CNRX0 pins, if the maximum injection current specification is met (1 mA for all pins; exception: 3 mA on QADC pins) and VDDH is within Operating Voltage specifications (see specification 43 in Table F-4). Exception: The RXD1/QGPI1 and RXD2/GPI2 pins do not have clamp diodes to VDDH. Voltage must be limited to less than 6.5 volts on these 2 pins to prevent damage. 10 Maximum continuous current on I/O pins provided the overall power dissipation is below the power dissipation of the package. Proper operation is not guaranteed at this condition. 11 Condition applies to one pin at a time. 12 Transitions within the limit do not affect device reliability or cause permanent damage. Exceeding limit may cause permanent conversion error on stressed channels and on unstressed channels. 13 Maximum transient current per ISO7637. 14 Maximum operating temperature on any solder ball in outer four rows of solder balls on the package. These rows are referred to as "Perimeter Balls" to distinguish them from the balls in the center of the package. 15 Solder profile per CDF-AEC-Q100, current revision. 16 Moisture sensitivity per JEDEC test method J-STD-020-A (April 1999). 2 Functional operating conditions are given in Section F.5, "DC Electrical Characteristics." Absolute maximum ratings are stress ratings only, and functional operation at the maximum is not guaranteed. Stress beyond those listed may affect device reliability or cause permanent damage to the device. This device contains circuitry protecting against damage due to high static voltage or electrical fields; however, it is advised that normal precautions be taken to avoid application of any voltages higher than maximum-rated voltages to this high-impedance circuit. Reliability of operation is enhanced if unused inputs are tied to an appropriate logic voltage level (e.g., either VSS or VDD). NOTE Negative current flows out of the pin and positive current flows into the pin. F.1 Package The MPC561/MPC563 is available in packaged form. The package is a 388-ball PBGA having a 1.0 mm ball pitch, Freescale case outline 1164-01 (See Figure F-64 and Figure F-65). F.2 F.2.1 EMI Characteristics Reference Documents The document referenced for the EMC testing of MPC561/MPC563 is SAE J1752/3 Issued 1995-03 MPC561/MPC563 Reference Manual, Rev. 1.2 F-2 Freescale Semiconductor Electrical Characteristics F.2.2 Definitions and Acronyms EMC - Electromagnetic Compatibility EMI - Electromagnetic Interference TEM cell - Transverse Electromagnetic Mode cell F.2.3 EMI Testing Specifications 1. 2. 3. 4. 5. 6. Scan range: 150 KHz - 1000 MHz Operating Frequency: 56 MHz Operating Voltages: 2.6 V, 5.0 V Max spikes: TBD dBuV I/O port waveforms: Per J1752/3 Temperature: 25 C F.3 Thermal Characteristics Table F-2. Thermal Characteristics Characteristic Symbol Value Unit RJA 47.31,2,3 C/W RJMA 29.43,4,5 C/W BGA Package Thermal Resistance, Junction to Board RJB 21.2 3,6 C/W BGA Package Thermal Resistance, Junction to Case (top) RJT 7.03,7 C/W BGA Package Thermal Resistance, Junction to Package Top, Natural Convection JT 1.68 C/W BGA Package Thermal Resistance, Junction to Ambient - Natural Convection BGA Package Thermal Resistance, Junction to Ambient - Four layer (2s2p) board, natural convection 1 2 3 4 5 6 7 8 Junction temperature is a function of on-chip power dissipation, package thermal resistance, mounting site (board) temperature, ambient temperature, air flow, power dissipation of other components on the board, and the board thermal resistance. Per SEMI G38-87 and JESD51-2 with the board horizontal. These values are the mean + 3 standard deviations of characterized data. Junction temperature is a function of on-chip power dissipation, package thermal resistance, mounting site (board) temperature, ambient temperature, air flow, power dissipation of other components on the board, and the board thermal resistance. Per JESD51-6 with the board horizontal. Thermal resistance between the die and the printed circuit board (Four layer (2s2p) board, natural convection). Indicates the thermal resistance between the die and the case top surface as measured by the cold plate method (MIL SPEC-883 Method 1012.1) with the cold plate temperature used for the case temperature. Thermal characterization parameter indicating the temperature difference between package top and the junction temperature per EIA/JESD51-2. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-3 Electrical Characteristics An estimation of the chip junction temperature, TJ, in C can be obtained from the equation: TJ = TA + (RJA x PD) where: TA = ambient temperature (C) RJA = package junction to ambient resistance (C/W) PD = power dissipation in package The junction to ambient thermal resistance is an industry standard value which provides a quick and easy estimation of thermal performance. Unfortunately, the answer is only an estimate; test cases have demonstrated that errors of a factor of two are possible. As a result, more detailed thermal characterization is supplied. Historically, the thermal resistance has frequently been expressed as the sum of a junction to case thermal resistance and a case to ambient thermal resistance: RJA = RJC + RCA where: RJA = junction to ambient thermal resistance (C/W) RJC = junction to case thermal resistance (C/W) RJA = case to ambient thermal resistance (C/W) RJC is device related and cannot be influenced. The user controls the thermal environment to change the case to ambient thermal resistance, RCA. For instance, the air flow can be changed around the device, add a heat sink, change the mounting arrangement on printed circuit board, or change the thermal dissipation on the printed circuit board surrounding the device. This description is most useful for ceramic packages with heat sinks where about 90% of the heat flow is through the case to the heat sink to ambient. For most packages, a better model is required. The simplest thermal model of a package which has demonstrated reasonable accuracy (about 20 percent) is a two resistor model consisting of a junction to board and a junction to case thermal resistance. The junction to case covers the situation where a heat sink will be used or where a substantial amount of heat is dissipated from the top of the package. The junction to board thermal resistance describes the thermal performance when most of the heat is conducted to the printed circuit board. It has been observed that the thermal performance of most plastic packages and especially PBGA packages is strongly dependent on the board. temperature. If the board temperature is known, an estimate of the junction temperature in the environment can be made using the following equation: TJ = TB + (RJB x PD) where: TB = board temperature (C) RJB = package junction to board resistance (C/W) PD = power dissipation in package () MPC561/MPC563 Reference Manual, Rev. 1.2 F-4 Freescale Semiconductor Electrical Characteristics If the board temperature is known and the heat loss from the package case to the air can be ignored, acceptable predictions of junction temperature can be made. For this method to work, the board and board mounting must be similar to the test board used to determine the junction to board thermal resistance, namely a 2s2p (board with a power and a ground plane) and vias attaching the thermal balls to the ground plane. When the board temperature is not known, a thermal simulation of the application is needed. The simple two-resistor model can be used with the thermal simulation of the application (2), or a more accurate and complex model of the package can be used in the thermal simulation. Consultation on the creation of the complex model is available. To determine the junction temperature of the device in the application after prototypes are available, the thermal characterization parameter (JT) can be used to determine the junction temperature with a measurement of the temperature at the top center of the package case using the following equation: TJ = TT + (JT x PD) where: TT = thermocouple temperature on top of package (C) JT = thermal characterization parameter PD = power dissipation in package The thermal characterization parameter is measured per JESD51-2 specification published by JEDEC using a 40 gauge type-T thermocouple epoxied to the top center of the package case. The thermocouple should be positioned so that the thermocouple junction rests on the package. A small amount of epoxy is placed over the thermocouple junction and over about one mm of wire extending from the junction. The thermocouple wire is placed flat against the package case to avoid measurement errors caused by cooling effects of the thermocouple wire. F.3.1 Thermal References The website for Semiconductor Equipment and Materials International is www.semi.org and their global headquarters address is: 3081 Zanker Road, San Jose CA, 95134; 1-408-943-6900. MIL-SPEC and EIA/JESD (JEDEC) specifications are available from Global Engineering Documents on the WEB at www.global.ihs.com or 800-854-7179 or 303-397-7956. JEDEC specifications are available on the WEB at www.jedec.org. 1. C.E. Triplett and B. Joiner, "An Experimental Characterization of a 272 PBGA Within an Automotive Engine Controller Module," Proceedings of SemiTherm, San Diego, 1998, pp. 47-54. 2. B. Joiner and V. Adams, "Measurement and Simulation of Junction to Board Thermal Resistance and Its Application in Thermal Modeling," Proceedings of SemiTherm, San Diego, 1999, pp. 212-220. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-5 Electrical Characteristics F.4 ESD Protection Table F-3. ESD Protection Characteristics Symbol Value Units 2000 V R1 1500 C 100 pF 200 V R1 0 C 200 pF Number of pulses per pin Positive pulses (MM) Negative pulses (MM) Positive pulses (HBM) Negative pulses (HBM) -- -- -- -- 3 3 1 1 Interval of Pulses -- 1 ESD for Human Body Model (HBM)1 HBM Circuit Description ESD for Machine Model (MM) MM Circuit Description 2 -- S 1 All ESD testing is in conformity with CDF-AEC-Q100 Stress Test Qualification for Automotive Grade Integrated Circuits. 2 A device will be defined as a failure if after exposure to ESD pulses the device no longer meets the device specification requirements. Complete DC parametric and functional testing shall be performed per applicable device specification at room temperature followed by hot temperature, unless specified otherwise in the device specification. MPC561/MPC563 Reference Manual, Rev. 1.2 F-6 Freescale Semiconductor Electrical Characteristics F.5 DC Electrical Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) Table F-4. DC Electrical Characteristics Characteristic 1 1 2.6-V only Input High Voltage except DATA[0:31] and EXTCLK 1a 2.6-V Input High Voltage EXTCLK 2 DATA[0:31] Precharge Voltage 2 DATA[0:31] Precharge Voltage (Predischarge circuit enabled)3 3 5-V Input only High Voltage 4 4 5-V Input High Voltage (QADC PQA, PQB) 5 MUXed 2.6-V/ 5-V pins (GPIO muxed with Addr and Data) 2.6-V Input High Voltage Addr., Data 5-V Input High Voltage (GPIO) Symbol Min Max Unit VIH2.6 2.0 VDDH + 0.3 V VIHC 1.6 VDDH + 0.3 V 3.1 5.25 V VDATAPC VDATAPC5 VIH5 0.7 * VDDH VDDH + 0.3 V VIHA5 0.7 * VDDH (VDDA | VDDH) + 0.35 V VIH2.6M VIH5M 2.0 0.7 * VDDH VDDH + 0.3 VDDH + 0.3 V V 6 2.6-V Input Low Voltage Except EXTCLK VIL2.6 VSS - 0.3 0.8 V 7 2.6-V Input Low Voltage EXTCLK VIL2.6C VSS - 0.3 0.4 V 8 5-V Input Low Voltage VIL5 VSS - 0.3 0.48 * VDDH V 9 5-V Input Low Voltage (QADC PQA, PQB) VILA5 VSSA - 0.3 0.48 * VDDH V 10 MUXed 2.6-V/ 5-V pins (GPIO muxed with Addr, Data) 2.6-V Input Low Voltage (Addr., Data) 5-V Input Low Voltage (GPIO) VIL2.6M VIL5M VSS - 0.3 VSS - 0.3 0.8 0.48 * VDDH V 11 QADC Analog Input Voltage6 Note: Assumes VDDA VDDH VINDC VSSH - 0.3 VDDH + 0.3 V 12 2.6-V Weak Pull-up/down Current pull-up @ 0 to VIL2.6, pull-down @ VIH2.6 to VDD IACT2.6V 20 130 A 13 5-V Weak Pull-up/down Current6 pull-up @ 0 to VIL5, pull-down @ VIH5 to VDDH IACT5V 20 130 A 14 2.6-V Input Leakage Current6 pull-up/down inactive - measured @rails IINACT2.6V -- 2.5 A 15 5V Input Leakage Current6,7 pull-up/down inactive - measured @rails IINACT5V -- 2.5 A 16 QADC64 Input Current, Channel Off 8 PQA, PQB IOFF -200 -200 200 200 nA MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-7 Electrical Characteristics Table F-4. DC Electrical Characteristics (continued) Characteristic 17 2.6-V Output High Voltage VDD = VDDL 2.6-V Output High Voltage (IOH = -1mA) 2.6-V Output High Voltage (IOH = -2mA) Symbol Min VOH2.6 VOH2.6A 2.3 2.1 Max Unit -- V 18 5-V Output High Voltage VDD = VDDH (IOH= -2mA) All 5-V only outputs except TPU. VOH5 VDDH - 0.7 -- V 19 5-V Output High Voltage VDD = VDDH (IOH= -5mA) For TPU pins Only VOHTP5 VDDH - 0.65 -- V 20 MUXed 2.6-V/ 5-V pins (GPIO MUXed with Addr, Data) 2.6-V Output High Voltage (IOH = -1mA) 2.6-V Output High Voltage (IOH = -2mA) 5-V Output High Voltage (IOH = -2mA) -- V VOH2.6M VOH2.6MA VOH5M 2.3 2.1 VDDH - 0.7 VOL2.6 -- 0.5 V VOL5 -- 0.45 V VOLTP5 -- 21 2.6-V Output Low voltage VDD = VDDL (IOL = 3.2mA) 22 5-V Output Low voltage VDD = VDDH (IOL = 2mA) All 5-V only outputs except TPU 23 5-V Output Low voltage VDD = VDDH -TPU pins Only IOL = 2mA IOL = 10mA 24 MUXed 2.6-V/ 5-V pins (GPIO MUXed with Addr, Data) 2.6-V Output Low Voltage (IOL = 3.2mA) 5-V Output Low Voltage (IOL = 2mA) V VOL2.6M VOL5M 0.5 0.45 25 Output Low Current (@ VOL2.6= 0.4 V) IOL2.6 2.0 27 CLKOUT Load Capacitance - SCCR COM & CQDS COM[0:1]= 0b01, CQDS = 0b1 COM[0:1]= 0b01 CQDS = 0b0 COM[0:1]= 0b00 CQDS = 0bx CCLK -- 29 Capacitance for Input, Output, and Bidirectional Pins: Vin = 0 V, f = 1 MHz (except QADC) CIN -- 30 Load Capacitance for bus pins only 9 COM[0:1] of SCCR = 0b11 COM[0:1] of SCCR = 0b10 CL -- 31 Total Input Capacitance PQA Not Sampling PQB Not Sampling V 0.45 1.0 -- mA 25 50 90 pF pF pF 7 pF pF 25 50 pF CIN -- -- 15 15 VH 0.5 -- IDDL -- 120 KAPWR (Crystal Frequency: 20 MHz) IDDKAP -- 5 KAPWR (Crystal Frequency: 4 MHz) IDDKAP -- 2 32 Hysteresis (Only IRQ, TPU, MIOS, GPIO, QADC (Digital inputs) and HRESET, SRESET, PORESET) 10 33 Operating Current (2.6-V supplies) @ 40 MHz11,12 VDD/QVDDL/NVDDL IRAMSTBY IDDSRAM VDDSYN 14 VDDF (Read, program, or erase) VDDFSTOP16 VDDFDISABLED 16 50 x 10-3 V 1.7513 IDDSYN -- 2 IDDF -- 35 IDDFSTOP -- 10 IDDFDISB -- 100 mA A MPC561/MPC563 Reference Manual, Rev. 1.2 F-8 Freescale Semiconductor Electrical Characteristics Table F-4. DC Electrical Characteristics (continued) Characteristic 34 Symbol Operating Current (5-V supplies)@ 40 MHz VDDH VDDA15 VFLASHF5 (Program or Erase) VFLASHF5READ VFLASHF5 (Stopped) 12 Operating Current (2.6-V supplies)@ 56 -- Unit mA 20 5 1016 3 1 SIDDF5D -- 100 IDDL -- 210 IDDKAP -- 5 A MHz12 VDD/QVDDL/NVDDL KAPWR (Crystal Frequency: 20 MHz) KAPWR (Crystal Frequency: 4 MHz) IDDKAP -- 2 IDDSRAM 50 x 10-3 1.7513 IDDSYN -- 2 IDDF -- 35 VDDFSTOP IDDFSTOP -- 10 VDDFDISABLED IDDFDISB -- 100 A 20 5.0 1016 4 1 100 mA mA mA mA mA A 10 A 110 15 8 mA mA mA IRAMSTBY VDDSYN (Crystal Frequency: 20 MHz) VDDF (Read, program, or erase)16 36 Max IDDH5 IDDA IDDF5 IDDF5R SIDDF5 VFLASHF5 (Disabled) 35 Min Operating Current (5-V supplies)@ 56 VDDH VDDA15 VFLASHF5 (Program or Erase) VFLASHF5READ VFLASHF5 (Stopped) VFLASHF5 (Disabled) MHz12, 15 -- IDDH5 IDDA IDDF5 IDDF5R SIDDF5 SIDDF5D 37 QADC64 Low Power Stop Mode (VDDA) 38 Low Power Current (QVDDL+ NVDDI+ VDD) @56 MHz DOZE, Active PLL and Active Clocks SLEEP, Active PLL with Clocks off DEEP SLEEP, PLL and Clocks off 16Operating 39 NVDDL, QVDDL,VDD, VDDF 40 VFLASH Flash Operating/Programming Voltage16 IDDA Voltage 41 Oscillator, Keep-Alive Registers Operating Voltage 42 N.A. 43 44 mA 17,18 -- -- IDDDZ IDDSLP IDDDPSLP NVDDL, QVDDL, VDD, VDDF 2.5 2.7 V VFLASH 4.75 5.25 V KAPWR VDD - 0.2 V VDD + 0.2 V19 V -- -- -- -- VDDH Operating Voltage VDDH 4.75 5.25 V QADC Operating Voltage VDDA 4.75 5.25 V 45 Clock Synthesizer Operating Voltage 46 N.A. Difference18 VDDSYN -- 47 VSS Differential Voltage 48 QADC64 Reference Voltage Low20 High20 49 QADC64 Reference Voltage 50 QADC64 VREF Differential Voltage 51 QADC64 Reference Supply Current, DC QADC64 Reference Supply Current, Transient 52 QADC64 ALT Reference Voltage21 VDD - 0.2 V VDD -- + 0.2 V19 V -- -- VSS - VSSA -100 100 mV VRL VSSA VSSA + 0.1 V VRH 3.0 VDDA V VRH - VRL 3.0 5.25 V IREF IREFT -- -- 500 4.0 A mA VARH 1.0 .75 * VDDA V MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-9 Electrical Characteristics Table F-4. DC Electrical Characteristics (continued) Characteristic 53 Standby Supply Current KAPWR only (4 MHz Crystal) KAPWR only (20 MHz Crystal) Measured @ 2.7 V Symbol Min Max Unit 2.0 5 m m -- ISBKAPWR4 ISBKAPWR20 53a IRAMSTBY Regulator Current Data Retention 17 Specified VDD applied (VDD, VDDH = VSS) ISTBY 50 x 10-3 1.75 mA 53b IRAMSTBY Regulator Voltage for Data Retention17,22 (power-down mode) Specified VDD applied (VDD, VDDH = VSS)21 VSTBY 1.35 1.95 V mA 54 DC Injection Current per Pin GPIO, TPU, MIOS, QSMCM, EPEE and 5 V pins 6, 23, 24 IIC5 -1.0 1.0 55 DC Injection Current per Pin 2.6 V 6, 24, 25, 26 IIC26 -1.0 1.0 mA 56 QADC64 Disruptive Input Current 24,27 INA -3 3 mA 57 Power Dissipation - 56 MHz 40 MHz PD 1.12 0.8 W W 1 This characteristic is for 2.6-V output and 5-V input friendly pins. VDATAPC is the maximum voltage the data pins can have been precharged to by an external device when the MPC561/MPC563 data pins turn on as outputs. The 3.1-V maximum for VDATAPC is to allow the data pins to be driven from an external memory running at a higher voltage. Note that if the data pins are precharged to higher than VDDL, then the 50-pF maximum load characteristic must be observed. 3 The predischarge circuit is enabled by setting the PREDIS_EN bit to a "1" in the PDMCR2 register. VDATAPC is the maximum voltage the data pins can have been precharged to by an external device when the MPC561/MPC563 data pins turn on as outputs. The 5.25-V maximum for VDATAPC is to allow the data pins to be driven from an external memory running at a higher voltage. Note that if the data pins are precharged to higher than VDDL, then the maximum load characteristic must match the data bus drive setting and the data bus can withstand up to 3.6 volts for a cumulative time of 24 hours over the lifetime of the device. 4 This characteristic is for 5-V output and 5-V input pins. 5 0.3V > V DDA or VDDH, whichever is greater. 6 Within this range, no significant injection will be seen. See QADC64 Disruptive Input Current (I NA). 7 During reset all 2.6V and 2.6V/5V pads will leak up to 10A to QVDDL if the pad has a voltage > QVDDL. 8 Maximum leakage occurs at maximum operating temperature. Current decreases by approximately one-half for each 8 to 12 C, in the ambient temperature range of 50 to 125 C. 9 All bus pins support two drive strengths capabilities, 25 pF and 50 pF. Current drive is less at the 25-pF capacitive load. Both modes achieve 40-MHz (or, optionally, 56-MHz) timing. 10 Only IRQ, TPU, MIOS, GPIO, QADC (when digital inputs) and RESET pins have hysteresis, thus there is no hysteresis specification on all other pins 11 Values to be characterized. Current consumption values will be updated as information becomes available. Initial values are only estimates based on predicted capacitive differences between CDR1 and CDR3 as well as actual CDR1 measurements. 12 All power consumption specifications assume 50-pF loads and running a typical application. The power consumption of some modules could go up if they are exercised heavier, but the power consumption of other modules would decrease. 13 This value depends on the R value set by the user. Refer to Appendix C, "Clock and Board Guidelines." 14 These power supplies are available on the MPC563 and MPC564 only. 15 Current measured at maximum system clock frequency with QADC active. 16 Transient currents can reach 50mA. 17 KAPWR and IRAMSTBY can be powered-up prior to any other supply or at the same time as the other 2.6 V supplies. IRAMSTBY must lead or coincide with VDD; however it can lag KAPWR. 2 MPC561/MPC563 Reference Manual, Rev. 1.2 F-10 Freescale Semiconductor Electrical Characteristics 18 This parameter is periodically sampled rather than 100% tested Up to 0.5 V during power up/down. 20 To obtain full-range results, VSSA VRL VINDC VRH VDDA 21 When using the QADC in legacy mode it is recommended to connect this pin to 2.6V or 3.3V, however it can be connected to 0V or 5V without damage to the device. 22 A resistor must be placed in series with the IRAMSTBY power supply. Refer to Appendix C, "Clock and Board Guidelines." 23 All injection current is transferred to the VDDH. An external load is required to dissipate this current to maintain the power supply within the specified voltage range. 24 Absolute maximum voltage ratings for each pin (see Table F-1) must also be met during this condition. 25 Total injection current for all I/O pins on the chip must not exceed 20 mA (sustained current). Exceeding this limit can cause disruption of normal operation. 26 Current refers to two QADC64 modules operating simultaneously. 27 Below disruptive current conditions, the channel being stressed has conversion values of 0x3FF for analog inputs greater than VRH and 0x000 for values less than VRL. This assumes that VRH VDDA and VRL VSSA due to the presence of the sample amplifier. Other channels are not affected by non-disruptive conditions. 19 F.6 Oscillator and PLL Electrical Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) Table F-5. Oscillator and PLL Characteristic 1 Symbol Min Typica l Oscillator Startup time (for typical crystal capacitive load) 4-MHz crystal OSCstart4 20-MHz crystal OSCstart20 TLOCK Max Unit 10 10 ms ms 10001 Input Clocks 2 PLL Lock Time 3 PLL Operating Range2 FVCOOUT 30 112 MHz 4 Crystal Operating Range, MODCK=0b010,0b110 MODCK[1:3] = 0b001, 0b011, 0b100, 0b101, 0b111 FCRYSTAL 3 15 5 25 MHz MHz 5 PLL Jitter PLL Jitter (averaged over 10 s) FJIT FJIT10 -1% -0.3% +1% +0.3% -- 6 Limp Mode Clock Out Frequency -- 33 173 MHz 7 Oscillator Bias Current (XTAL) 4 MHz 20 MHz IBIAS -- | 1.5 | | 0.8 | | 4.0 | mA mA 8 Oscillator Drive (XTAL) IOSC 7 -- mA 9 Oscillator Bias Resistor ROSC 0.5 3 M 11 1 1 Assumes stable power and oscillator. FVCOOUT is 2x the system frequency. 3 Estimated value, real values to be characterized and updated. 2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-11 Electrical Characteristics F.7 Flash Electrical Characteristics The characteristics found in this section apply only to the MPC563. Note: (VDDF = 2.6 V 0.1 V, VFLASH = 5.0 V 0.25 V, TA = TL to TH, TB = TL to TH) Table F-6. Array Program and Erase Characteristics Value Symbol Meaning Minimum Maximum 3 12 s 13 60 s 15 20 s Block Erase Time2 TERASE 2 TERASEM Module Erase Time TPROG Word Programming Time Units Typical1 3,4 1 Typical program and erase times assume nominal supply values and 25 C. Erase time specification does not include pre-programming operation 3 Word size is 32 bits. 4 The maximum hardware programming time of the entire Flash (not including the shadow row) is 20 s x (512 Kbytes / 4 bytes per word), or 131,072 words, (no software overhead). 2 Note: (VDDF = 2.6 V 0.1 V, VFLASH = 5.0 V 0.25 V, TA = TL to TH, TB = TL to TH) Table F-7. CENSOR Cell Program and Erase Characteristics Value Symbol Meaning Units Minimum 1 2 Typical1 Maximum TCLEAR CENSOR Bit Clear Time2 13 60 s TSET CENSOR Bit Set Time 115 250 s Typical set and clear times assume nominal supply values and 25 C. Clear time specification does not include pre-set operation. Table F-8. Flash Module Life Symbol Array P/E Cycles1 CENSOR Set/Clear Cycles2 Meaning Maximum number of Program/Erase cycles per block to guarantee data retention. Minimum number of Program/Erase cycles per bit before failure. Array and CENSOR Data Minimum data retention at an average of 85 C junction temperature. Retention Minimum data retention at an average of 125 C junction temperature. Value 1,000 100 Min 15 years3 Min 10 years3 1 A Program/Erase cycle is defined as switching the bits from 1 to 0 to 1. A CENSOR Set/Clear cycle is defined as switching the bits from 1 to 0 to 1. 3 Maximum total time @ 150 C junction temperature 1 year. 2 MPC561/MPC563 Reference Manual, Rev. 1.2 F-12 Freescale Semiconductor Electrical Characteristics F.8 Power-Up/Down Sequencing The supply symbols used in this section are described in Table F-9. . Table F-9. Power Supply Pin Groups Symbol Types of Power Pins VDDH Supply to the 5-V pads for output driver (VDDH) (High Voltage Supply Group) Supply to the analog (QADC64E) circuitry (VDDA) High voltage supply to the flash module (VFLASH)1 VDDL (Low Voltage Supply Pins) Supply to low voltage pad drivers (QVDDL, NVDDL) Supply to all low voltage internal logic (VDD) Supply to low voltage flash circuitry (VDDF)1 Supply to system PLL VDDKA (Low Voltage Keep-Alive Supply Pins2 1 2 Supply to IRAMSTBY Supply to oscillator and other circuitry for keep-alive functions (KAPWR). These power supplies are only available on the MPC563 and MPC564. Any supply in the VDDKA group can be powered with the VDDL if the function which it supplies is not required during "Keep-alive." There are two power-up/down options. Choosing which one is required for an application will depend upon circuitry connected to 2.6-V compliant pins and dual 2.6-V/5-V compliant pins. Power-up/down option A is required if 2.6-V compliant pins and dual 2.6-V/5-V compliant pins are connected to the 5-V supply with a pull-up resistor or driven by 5-V logic during power-up/down. In applications for which this scenario is not true the power-up/down option B may be implemented. Option B is less stringent and easier to ensure over a variety of applications. Refer to Table 2-1 for a list of 2.6 V and dual 2.6V/5 V compliant pins. The power consumption during power-up/down sequencing will stay below the operating power consumption specifications when following these guidelines. NOTE: The VDDH ramp voltage should be kept below 50V/ms and the VDDL ramp rate less that 25V/ms. F.8.1 Power-Up/Down Option A The Option A power-up sequence (excluding VDDKA) is 1. VDDH VDDL + 3.1 V (VDDH cannot lead VDDL by more than 3.1 V) 2. VDDH VDDL - 0.5 V (VDDH cannot lag VDDL by more than 0.5 V) The first step in the sequence is required is due to gate-to-drain stress limits for transistors in the pads of 2.6-V compliant pins and dual 2.6-V/5-V compliant pins. Damage can occur if gate-to-drain voltage potential is greater than 3.1 V. This is only a concern at power-up/down. The second step in the sequence MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-13 Electrical Characteristics is required is due to ESD diodes in the pad logic for dual 2.6-V/5-V compliant pins and 2.6-V pins. The diodes are forward biased when VDDL is greater than VDDH and will start to conduct current. Figure F-1 illustrates the power-up sequence if no keep-alive supply is required. Figure F-2 illustrates the power-up sequence if a keep-alive supply is required. The keep-alive supply should be powered-up at the same instant or before both the high voltage and low voltage supplies are powered-up. VDDH 3.1-V lead VDDL 0.5-V lag VDDH cannot lead VDDL by more than 3.1 V VDDH cannot lag VDDL by more than 0.5 V Figure F-1. Option A Power-Up Sequence Without Keep-Alive Supply VDDH 3.1-V lead VDDL VDDKA 0.5-V lag VDDH cannot lead VDDL by more than 3.1 V VDDH cannot lag VDDL by more than 0.5 V Figure F-2. Option A Power-Up Sequence With Keep-Alive Supply The option A power-down sequence (excluding VDDKA) is 1. VDDH VDDL + 3.1 V (VDDH cannot lag VDDL by more than 3.1 V) 2. VDDH VDDL - 0.5 V (VDDH cannot lead VDDL by more than 0.5 V) Figure F-3 illustrates the power-down sequence if no keep-alive supply is required. MPC561/MPC563 Reference Manual, Rev. 1.2 F-14 Freescale Semiconductor Electrical Characteristics VDDH VDDL 3.1-V Max 0.5-V Max Ramp down rates may differ with load, so care should be taken maintain VDDH with respect to VDDL. VDDH cannot lag VDDL by more than 3.1 V. VDDH VDDL - 0.5 V (VDDH cannot lead VDDL by more than 0.5 V.) Figure F-3. Option A Power-Down Sequence Without Keep-Alive Supply Figure F-4 illustrates the power-down sequence if a keep-alive supply is required. VDDH VDDL VDDKA 0.5-V Max 3.1-V Max Ramp down rates may differ with load. VDDH cannot lag VDDL by more than 3.1 V. VDDH VDDL - 0.5 V (VDDH cannot lead VDDL by more than 0.5 V.) Figure F-4. Option A Power-Down Sequence With Keep-Alive Supply F.8.2 Power-Up/Down Option B A less stringent power-up sequence may be implemented if 2.6-V compliant pins and dual 2.6-V/5-V compliant pins are NOT connected to the 5-V supply with a pull-up resistor or driven by 5-V logic during power-up/down. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-15 Electrical Characteristics The option B power-up sequence (excluding VDDKA) is: 1. VDDH > VDDL - 0.5 V (VDDH cannot lag VDDL by more than 0.5 V) Thus the VDDH supply group can be fully powered-up prior to power-up of the VDDL supply group, with no adverse affects to the device. The requirement that VDDH cannot lag VDDL by more than 0.5 V is due to ESD diodes in the pad logic for dual 2.6-V/5-V compliant pins and 2.6-V pins. The diodes are forward biased when VDDL is greater than VDDH and will start to conduct current. Figure F-5 illustrates the power-up sequence if no keep-alive supply is required. Figure F-6 illustrates the power-up sequence if a keep-alive supply is required. The keep-alive supply should be powered-up at the same time or before both the high voltage and low voltage supplies are powered-up. VDDH VDDL 0.5-V lag VDDH cannot lag VDDL by more than 0.5 V Figure F-5. Option B Power-Up Sequence Without Keep-Alive Supply VDDH VDDL VDDKA 0.5-V lag VDDH cannot lag VDDL by more than 0.5 V Figure F-6. Option B Power-Up Sequence With Keep-Alive Supply The option B power-down sequence (excluding VDDKA) is: 1. The VDDL supply group can be fully powered-down prior to power-down of the VDDH supply group, with no adverse affects to the device. MPC561/MPC563 Reference Manual, Rev. 1.2 F-16 Freescale Semiconductor Electrical Characteristics For power-down, the low voltage supply should come down before the high voltage supply, although with varying loads, the high voltage may actually get ahead. Figure F-7 illustrates the power-down sequence if no keep-alive supply is required. Figure F-8 illustrates the power-down sequence if a keep-alive supply is required. VDDH VDDH 5.25V VDDL 0.5-V lag Ramp down rates may differ with load. VDDH cannot lead VDDL by more than 0.5V Figure F-7. Option B Power-Down Sequence Without Keep-Alive Supply VDDH VDDL VDDKAP 0.5-V lag Ramp down rates may differ with load. VDDH cannot lead VDDL by more than 0.5V Figure F-8. Option B Power-Down Sequence with Keep-Alive Supply F.9 F.9.1 Issues Regarding Power Sequence Application of PORESET or HRESET When VDDH is rising and VDDL is at 0.0 V, as VDDH reaches 1.6 V, all 5 V drivers are tristated. Before VDDH reaches 1.6V, all 5 V outputs are unknown. If VDDL is rising and VDDH is at least 3.1V greater than VDDL, then the 5 V drivers can come out of tristate when VDDL reaches 1.1V, and the 2.6 V drivers can start driving when VDDL reaches 0.5 V. For these reasons, the PORESET or HRESET signal must be asserted during power-up before VDDL is above 0.5 V. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-17 Electrical Characteristics If the PORESET or HRESET signal is not asserted before this condition, there is a possibility of disturbing the programmed state of the flash. In addition, the state of the pads are indeterminant until PORESET or HRESET propagates through the device to initialize all circuitry. F.9.2 Keep-Alive RAM PORESET or HRESET must be asserted during power-down prior to any supply dropping out of specified operating conditions. An additional constraint is placed on PORESET assertion since it is an asynchronous input. To assure that the assertion of PORESET does not potentially cause stores to keep-alive RAM to be corrupted (store single or store multiple) or non-coherent (store multiple), either of the following solutions is recommended: * Assert HRESET at least 0.5 s prior to when PORESET is asserted. * Assert IRQ0 (non-maskable interrupt) at least 0.5 s prior to when PORESET is asserted. The service routine for IRQ0 should not perform any writes to keep-alive RAM. The amount of delay that should be added to PORESET assertion is dependent upon the frequency of operation and the maximum number of store multiples executed that are required to be coherent. If store multiples of more than 28 registers are needed and if the frequency of operation is lower that 56 MHz, the delay added to PORESET assertion will need to be greater than 0.5 s. In addition, if KAPWR features are being used, PORESET should not be driven low while the VDDH and VDDL supplies are off. F.10 AC Timing Figure F-9 displays generic examples of MPC561/MPC563 timing. Specific timing diagrams are shown in Figure F-10 through Figure F-36. MPC561/MPC563 Reference Manual, Rev. 1.2 F-18 Freescale Semiconductor Electrical Characteristics CLKOUT VDD/2 VDD/2 VDD/2 A B 5-V OUTPUTS VOH VOL VOH VOL A B 5-V OUTPUTS VOH VOH VOL VOL A B VDD/2 ADDR/DATA/CTRL A B ADDR/DATA/CTRL OUTPUTS VDD/2 C VIH VIL 5-V INPUTS D VIH VIL C VIH VIL 5-V INPUTS C ADDR/DATA/CTRL D VIH VIL D VDD/2 VDD/2 C ADDR/DATA/CTRL INPUTS VDD/2 A. Maximum Output Delay Specification B. Minimum Output Hold Time D VDDVDD/2 C. Minimum input Setup Time Specification D. Minimum input Hold Time Specification Figure F-9. Generic Timing Examples MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-19 Electrical Characteristics Table F-10. Bus Operation Timing Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min 1 CLKOUT Period (TC) 1a ENGCLK Frequency 5 V - EECLK = 01 2. 6 V - EECLK = 00 Max 25 Min Max 17.86 ns MHz 10 20 10 28 2 Clock pulse width low 12.5 -2% 12.5 + 2% 8.93 -2% 8.93 + 2% ns 3 Clock pulse width high 12.5 - 2% 12.5 + 2% 8.93 - 2% 8.93 + 2% ns 4 CLKOUT rise time ABUS/DBUS rise time 3.5 3.0 3.5 3.0 ns 5 CLKOUT fall time ABUS/DBUS fall time 3.5 3.0 3.5 3.0 ns 6 Circuit Parameter 7 CLKOUT to Signal Invalid (Hold Time) ADDR[8:31] RD/WR BURST D[0:31] 7a 7b 7c 7 CLKOUT to Signal Invalid: (Hold Time) TSIZ[0:1] RSV AT[0:3] BDIP PTR RETRY CLKOUT to Signal Invalid (Hold Time)2 BR BG FRZ VFLS[0:1] VF[0:2] IWP(0:2] LWP[0:1] STS3 Slave mode CLKOUT to Signal Invalid D[0:31] 5 ns 3.5 3.5 ns 3.5 3.5 ns 3.5 3.5 ns 3.5 3.5 ns MPC561/MPC563 Reference Manual, Rev. 1.2 F-20 Freescale Semiconductor Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic 8 Min Max Min Max 6.25 14 4.5 11 ns CLKOUT to Signal Valid TSIZ[0:1] RSV AT[0:3] BDIP PTR RETRY 6.25 13 4.5 9.5 ns CLKOUT to Signal Valid2 BR BG VFLS[0:1] VF[0:2] IWP[0:2] FRZ LWP[0:1] STS valid. 6.25 14 4.5 10.5 ns 14 11 ns 16 16 ns CLKOUT to Signal Valid ADDR[8:31] RD/WR BURST D[0:31]4 8a 8b 8c Slave Mode CLKOUT to Signal Valid D[0:31] 8d CLKOUT to Data Pre-discharge time 8e CLKOUT to Data Pre-discharge start 9 CLKOUT to High Z ADDR[8:31] RD/WR BURST D[0:31] TSIZ[0:1] RSV AT[0:3] PTR RETRY 3 10 CLKOUT to TS, BB assertion 10a CLKOUT to TA, BI assertion (when driven by the Memory Controller) 3 ns 6.25 13 4.5 9.5 ns 7.25 14 5.5 10.5 ns 8.5 ns 8.5 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-21 Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min 10b CLKOUT to RETRY assertion (when driven by the Memory Controller) Max Min 10 Max 10 ns 11 CLKOUT to TS, BB negation 7.25 14 5.5 10.5 ns 11a CLKOUT to TA, BI negation (when driven by the Memory Controller) 2 11 2 11 ns CLKOUT to RETRY negation (when driven by the Memory Controller) 2 11 2 11 ns 6.25 20 4.5 16 ns 11b 12 CLKOUT to TS, BB High Z 12a CLKOUT to TA, BI High Z (when driven by the Memory Controller) 15 15 ns 13 CLKOUT to TEA assertion 8.5 8.5 ns 14 CLKOUT to TEA High Z 15 15 ns 15 Input Valid to CLKOUT (Setup Time) TA TEA BI3 12 8.5 ns Input Valid to CLKOUT (Setup Time) KR CR RETRY 10 7.25 ns Input Valid to CLKOUT (Setup Time) BB BG BR2 8 6.5 ns 2 2 ns 15a 15b 16 CLKOUT to Signal Invalid (Hold Time) TA TEA BI BB BG BR2, 3 MPC561/MPC563 Reference Manual, Rev. 1.2 F-22 Freescale Semiconductor Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min 16a 17 17b 18 19 19a 19b 19c 20 Max Min Max CLKOUT to Signal Invalid (Hold Time) RETRY KR CR 2 2 ns Signal Valid to CLKOUT Rising Edge (Setup Time) D[0:31]4 6 6 ns 3 3 2 2 Signal Valid to CLKOUT Rising Edge (Short Setup Time, SST = 1) D[0:31]4 CLKOUT Rising Edge to Signal Invalid (Hold Time) D[0:31]4 CLKOUT Rising Edge to CS asserted -GPCM- ACS = 00 7.25 CLKOUT Falling Edge to CS asserted -GPCM- ACS = 10, TRLX = 0 or 1 CLKOUT Falling Edge to CS asserted -GPCM- ACS = 11, TRLX = 0 or 1 CLKOUT Falling Edge to CS asserted -GPCM- ACS = 11, TRLX = 0, EBDF = 1 CLKOUT Rising Edge to CS negated -GPCM- Read Access or Write access when CSNT = 0 or write access when CSNT = 1 and ACS = 00 15 6.5 8 ns 11.5 ns 6 ns 6.25 14 5.5 10.5 ns 6.25 17 6.69 12.69 ns 1 8 1 7 ns 21 ADDR[8:31] to CS asserted -GPCM- ACS = 10, TRLX = 0 0.75 1 ns 21a ADDR[8:31] to CS asserted -GPCM- ACS = 11, TRLX = 0 8 6 ns 22 CLKOUT Rising Edge to OE, WE[0:3]/BE[0:3] asserted 1 8 1 6 ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-23 Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min Max Min Max 8 1 6 23 CLKOUT Rising Edge to OE n egated 1 24 ADDR[8:31] to CS asserted -GPCM- ACS = 10, TRLX = 1 23 16.42 ns 24a ADDR[8:31] to CS asserted -GPCM- ACS = 11, TRLX = 1 28 20 ns 25 CLKOUT Rising Edge to WE[0:3]/BE[0:3] negated -GPCM-write access CSNT = `0` 25a 25b 25c 25d 26 26a CLKOUT Falling Edge to WE[0:3]/BE[0:3] negated -GPCM-write access TRLX = `0' or `1', CSNT = `1, EBDF = 0'. CLKOUT Falling Edge to CS negated -GPCM-write access TRLX = `0' or `1', CSNT = `1', ACS = `10' or ACS='11', EBDF = 0 CLKOUT Falling Edge to WE[0:3]/BE[0:3] negated -GPCM-write access TRLX = `0', CSNT = `1, EBDF = 1'. CLKOUT Falling Edge to CS negated -GPCM-write access TRLX = `0', CSNT = `1', ACS = `10' or ACS='11', EBDF = 1 WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, CSNT = `0' WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, TRLX = `0', CSNT = `1', EBDF = 0 7.5 ns 6 ns 6.25 14 5.5 10.5 ns 6.25 14 5.5 10.5 ns 6.25 17 5.5 12.69 ns 6.25 17 6.25 17 ns 3 2.25 ns 8 5.71 ns MPC561/MPC563 Reference Manual, Rev. 1.2 F-24 Freescale Semiconductor Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min 26b 26c 26d 26e 26f 26g 26h 26i 27 CS negated to D[0:31], High Z -GPCM- write access, ACS = `00', TRLX = `0' & CSNT = `0' Max Min Max 3 2.25 ns CS negated to D[0:31], High Z -GPCM- write access, TRLX = `0', CSNT = `1', ACS = `10' or ACS='11', EBDF = 0 8 5.71 ns WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', EBDF = 0 28 20 ns CS negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', ACS = `10' or ACS='11', EBDF = 0 28 20 ns WE[0:3]/BE[0:3] negated to D[0:31] HighZ -GPCM- write access, TRLX = `0', CSNT = `1', EBDF = 1 5 3.75 ns CS negated to D[0:31] High Z -GPCM- write access, TRLX = `0', CSNT = `1', ACS = `10' or ACS=`11', EBDF = 1 5 3.75 ns WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', EBDF = 1 24 17.25 ns CS negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', ACS = `10' or ACS='11', EBDF = 1 24 17.25 ns CS, WE[0:3]/BE[0:3] negated to ADDR[8:31] invalid -GPCMwrite access5 0.75 1 ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-25 Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min 27a Max Min Max WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX=`0', CSNT = `1'. 8 5.71 ns 28 20 ns 4 3 ns 24 17.25 ns 9 6 ns 5 5 ns CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='0', CSNT = `1', ACS = 10,ACS = =`11', EBDF = 0 27b WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1'. CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1', ACS = 10,ACS = ='11', EBDF = 0 27c WE[0:3]/BE[0:3] negated to ADDR[8:31] invalid -GPCM- write access, TRLX='0', CSNT = '1'. CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='0', CSNT = '1', ACS = 10,ACS = ='11', EBDF = 1 27d WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1'. CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1', ACS = 10,ACS = ='11', EBDF = 1 28 28a ADDR[8:31], TSIZ[0:1], RD/WR, BURST, valid to CLKOUT Rising Edge. (Slave mode Setup Time) Slave Mode D[0:31] valid to CLKOUT Rising Edge MPC561/MPC563 Reference Manual, Rev. 1.2 F-26 Freescale Semiconductor Electrical Characteristics Table F-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 56 MHz1 40 MHz Unit Characteristic Min 1 2 3 4 5 Max Min Max 29 TS valid to CLKOUT Rising Edge (Setup Time) 7 5 ns 30 CLKOUT Rising Edge to TS Valid (Hold Time). 5 5 ns 56-MHz operation is available as an option. Some parts (without the 56-MHz option) will operate at a maximum frequency of 40 MHz. The timing for BR output is relevant when the MPC561/MPC563 is selected to work with external bus arbiter. The timing for BG output is relevant when the MPC561/MPC563 is selected to work with internal bus arbiter. The setup times required for TA, TEA, and BI are relevant only when they are supplied by the external device (and not the memory controller). The maximum value of spec 8 for DATA[0:31] pins must be extended by 1.1 ns if the pins have been precharged to greater than VDDL. This is the case if an external slave device on the bus is running at the max. value of VDATAPC. This is currently specified at 3.1 V. The 1.1 ns addition to spec 8 reflects the expected timing degradation for 3.1 V. The timing 27 refers to CS when ACS = `00' and to WE[0:3]/BE[0:3] when CSNT = `0'. NOTE The D[0:31] input timings 17 and 18 refer to the rising edge of the CLKOUT in which the TA input signal is asserted. CLKOUT 4 3 2 5 1 Figure F-10. CLKOUT Pin Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-27 Electrical Characteristics CLKOUT 8 9 7 OUTPUT SIGNALS 8a 9 7a OUTPUT SIGNALS 8b 7b OUTPUT SIGNALS Figure F-11. Synchronous Output Signals Timing MPC561/MPC563 Reference Manual, Rev. 1.2 F-28 Freescale Semiconductor Electrical Characteristics CLKOUT TS 8e DATA 5.25V < 3.1V 2.6V 0V 8d sp8e: clkout to predischarge drivers enabled sp8d: clkout to data below 3.1V Figure F-12. Predischarge Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-29 Electrical Characteristics CLKOUT 12 10 11 TS, BB 12a 10a 11a TA, BI 13 14 TEA Figure F-13. Synchronous Active Pull-Up And Open Drain Outputs Signals Timing MPC561/MPC563 Reference Manual, Rev. 1.2 F-30 Freescale Semiconductor Electrical Characteristics CLKOUT 15 16 TA, BI 15a 16a TEA, KR, RETRY, CR 15b 16 BB, BG, BR Figure F-14. Synchronous Input Signals Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-31 Electrical Characteristics CLKOUT 15a 16 TA 17 18 DATA[0:31] Figure F-15. Input Data Timing In Normal Case MPC561/MPC563 Reference Manual, Rev. 1.2 F-32 Freescale Semiconductor Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19 20 CSx 22 23 OE 25 WE[0:3]/BE[0:3] 17 DATA[0:31] 18 Figure F-16. External Bus Read Timing (GPCM Controlled - ACS = `00') MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-33 Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19a 20 CSx OE 21 23 22 17 DATA[0:31] 18 Figure F-17. External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `10') MPC561/MPC563 Reference Manual, Rev. 1.2 F-34 Freescale Semiconductor Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19b CSx 20 19c 21a OE 23 22 17 DATA[0:31] 18 Figure F-18. External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `11') MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-35 Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19a 20 CSx 24 OE 23 24a 19b 19c 17 DATA[0:31] 18 Figure F-19. External Bus Read Timing (GPCM Controlled - TRLX = `1', ACS = `10', ACS = `11') CLKOUT 10 TS 11 9 8 ADDR[8:31] Figure F-20. Address Show Cycle Bus Timing MPC561/MPC563 Reference Manual, Rev. 1.2 F-36 Freescale Semiconductor Electrical Characteristics CLKOUT 10 11 TS 8 27 ADDR[8:31] CSx WE[0:3]/BE[0:3] 8 DATA[0:31] 9 Figure F-21. Address and Data Show Cycle Bus Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-37 Electrical Characteristics CLKOUT 10 11 TS 8 27 ADDR[8:31] 19 20 CSx 26b 22 25 WE[0:3]/BE[0:3] 23 OE 26 8 DATA[0:31] 9 Figure F-22. External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `0') MPC561/MPC563 Reference Manual, Rev. 1.2 F-38 Freescale Semiconductor Electrical Characteristics CLKOUT 10 11 TS 27c 8 27a 19 20 ADDR[8:31] CSx 25b 25d 22 26c 26g WE[0:3]/BE[0:3] 23 26a 26g OE 25a 25c 8 D[0:31] 9 Figure F-23. External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `1') MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-39 Electrical Characteristics CLKOUT 10 11 TS 27d 27b 8 ADDR[8:31] 19 20 CSx 25b 25d 22 26i 26e WE[0:3]/BE[0:3] 23 26h 26d OE 26b 25a 25c 8 DATA[0:31] 9 Figure F-24. External Bus Write Timing (GPCM Controlled - TRLX = `1', CSNT = `1') MPC561/MPC563 Reference Manual, Rev. 1.2 F-40 Freescale Semiconductor Electrical Characteristics CLKOUT 30 29 TS 28 ADDR[8:31], TSIZ[0:1], RD/WR, BURST, BDIP 12a 10a 11a TA, BI 13 14 TEA 8 DATA[0:31] 9 10b 11b RETRY Figure F-25. External Master Read From Internal Registers Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-41 Electrical Characteristics CLKOUT 30 29 TS 28 ADDR[8:31], TSIZ[0:1], RD/WR, BURST 12a 10a 11a TA, BI 13 14 TEA, 28a DATA[0:31] 18 10b RETRY 11b Figure F-26. External Master Write To Internal Registers Timing MPC561/MPC563 Reference Manual, Rev. 1.2 F-42 Freescale Semiconductor Electrical Characteristics Table F-11. Interrupt Timing Note: (TA = TL to TH) 40 MHz 56 MHz Characteristic Unit Min Max Min Max 33 IRQx Pulse width Low TC TC ns 34 IRQx Pulse width High; Between Level IRQ TC TC ns 35 IRQx Edge to Edge time 4 * TC 4 * TC ns IRQx 35 34 33 Level IRQ Edge IRQ Figure F-27. Interrupt Detection Timing for External Edge Sensitive Lines F.10.1 Debug Port Timing Table F-12. Debug Port Timing Note: (TA = TL to TH) 40 MHz 56 MHz Characteristic Unit Min Max Min Max 36 DSCK Cycle Time 50 -- 37.4 -- ns 37 DSCK Clock Pulse Width 25 -- 18.7 -- ns 38 DSCK Rise and Fall Times 0 7 0 7 ns 39 DSDI Input Data Setup Time 15 -- 15 -- ns 40 DSDI Data Hold Time 5 -- 5 -- ns 41 DSCK low to DSDO Data Valid 0 18 0 18 ns 42 DSCK low to DSDO Invalid 0 -- 0 -- ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-43 Electrical Characteristics DSCK 36 37 37 36 38 38 Figure F-28. Debug Port Clock Input Timing DSCK 39 40 DSDI 41 42 DSDO Figure F-29. Debug Port Timings MPC561/MPC563 Reference Manual, Rev. 1.2 F-44 Freescale Semiconductor Electrical Characteristics F.11 READI Electrical Characteristics The AC electrical characteristics (56 MHz) are described in the following tables and figures Table F-13. READI AC Electrical Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH 50 pF load unless noted otherwise) Number Characteristic Min Max Unit 17.9 -- ns 1 MCKO Cycle Time (Tco) 2 MCKO Duty Cycle 40 60 % 3 Output Rise and Fall Times 0 3 ns 4 MCKO low to MDO Data Valid -1.79 3.58 ns 5 MCKI Cycle Time (Tci) 35.6 -- ns 6 MCKI Duty Cycle 40 60 % 7 Input Rise and Fall Times 0 3 ns 8 MDI, EVTI, MSEI Setup Time 7.12 -- ns 9 MDI Hold TIme 3.56 -- ns 10 RSTI Pulse Width 71.6 -- ns 11 MCKO low to MSEO Valid -1.79 3.58 ns 12 EVTI Pulse Width 71.6 -- ns 13 EVTI to RSTI Setup (at reset only) (4.0) x TC -- ns 14 EVTI to RSTI Hold (at reset only) (4.0) x TC -- ns MCKI 8 MDI, EVTI,MSEI 9 Input Data Valid Figure F-30. Auxiliary Port Data Input Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-45 Electrical Characteristics MCKO MDO, MSEO 4 11 Output Data Valid Figure F-31. Auxiliary Port Data Output Timing Diagram MDO and MSEO data is held valid until the next MCKO low transition. When RSTI is asserted, EVTI is used to enable or disable the auxiliary port. Because MCKO probably is not active at this point, the timing must be based on the system clock. Since the system clock is not realized on the connector, its value must be known by the tool. RSTI 13 14 EVTI Figure F-32. Enable Auxiliary From RSTI RSTI 13 14 EVTI Figure F-33. Disable Auxiliary From RSTI MPC561/MPC563 Reference Manual, Rev. 1.2 F-46 Freescale Semiconductor Electrical Characteristics F.12 RESET Timing Table F-14. RESET Timing Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) 40 MHz Characteristic 56 MHz Expression Unit Min Max Min Max 43 CLKOUT to HRESET high impedance 20 20 ns 44 CLKOUT to SRESET high impedance 20 20 ns 45 RSTCONF pulse width 46 17 * TC 425 302 ns Configuration Data to HRESET rising edge Setup Time 15 * TC + TCC 382 272 ns 47 Configuration Data to RSTCONF rising edge set up time 15 * TC + TCC 382 272 ns 48 Configuration Data hold time after RSTCONF negation 0 0 ns 49 Configuration Data hold time after HRESET negation 0 0 ns 49a RSTCONF hold time after HRESET negation1 50 35 50 HRESET and RSTCONF asserted to Data out drive 25 25 ns 51 RSTCONF negated to Data out high impedance 25 25 ns 52 CLKOUT of last rising edge before chip tristates HRESET to Data out high impedance 25 25 ns 53 DSDI, DSCK set up 75 55 ns 54 DSDI, DSCK hold time 0 0 ns 55 SRESET negated to CLKOUT rising edge for DSDI and DSCK sample 200 142 ns 55a HRESET, SRESET, PORESET pulse width 2 100 100 ns 3 * TC 8 * TC Weak pull-ups and pull-downs used for Reset timing will comply with the 130 A mode select current outlined in Table F.5 on page F-7 The system requires two clocks of hold time on RSTCONF/TEXP after negation of HRESET. The simplest way to insure meeting this requirement in systems that require the use of the TEXP function, is to connect RSTCONF/TEXP to SRESET. 2 HRESET, SRESET and PORESET have a glitch detector to ensure that spikes less than 20 ns are rejected. The internal HRESET, SRESET and PORESET will assert only if these signals are asserted for more than 100 ns 1 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-47 Electrical Characteristics HRESET 45 49a RSTCONF 49 46 48 DATA[0:31] (IN) 47 Figure F-34. Reset Timing - Configuration from Data Bus MPC561/MPC563 Reference Manual, Rev. 1.2 F-48 Freescale Semiconductor Electrical Characteristics CLKOUT 43 55a HRESET RSTCONF 51 50 52 DATA[0:31] (OUT) (Weak) Figure F-35. Reset Timing - Data Bus Weak Drive During Configuration MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-49 Electrical Characteristics CLKOUT 44 55 SRESET 53 53 54 54 DSCK, DSDI Figure F-36. Reset Timing - Debug Port Configuration F.13 IEEE 1149.1 Electrical Characteristics Table F-15. JTAG Timing Note: (TA = TL to TH) 10 MHz1 Characteristic Min Max Unit 56 TCK Cycle Time1 (JTAG clock) 100 -- ns 57 TCK Clock Pulse Width Measured at VDD/2 50 -- ns 58 TCK Rise and Fall Times 0 10 ns 59 TMS, TDI Data Setup Time 5 ns 60 TMS, TDI Data Hold Time 25 ns 61 TCK Low to TDO Data Valid 62 TCK Low to TDO Data Invalid 63 TCK Low to TDO High Impedance 20 ns 66 TCK Falling Edge to Output Valid 50 ns 67 TCK Falling Edge to Output Valid out of High Impedance 50 ns 68 TCK Falling Edge to Output High Impedance 50 ns 69 Boundary Scan Input Valid to TCK Rising Edge 50 ns 70 TCK Rising Edge to Boundary Scan Input Invalid 50 ns 20 0 ns ns MPC561/MPC563 Reference Manual, Rev. 1.2 F-50 Freescale Semiconductor Electrical Characteristics 1 JTAG timing (TCK) is only tested at 10 MHz. TCK is the operating clock of the MPC561/MPC563 in JTAG mode. TCK 57 56 57 58 Figure F-37. JTAG Test Clock Input Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-51 Electrical Characteristics TCK 59 60 TMS, TDI 61 63 62 TDO Figure F-38. JTAG Test Access Port Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 F-52 Freescale Semiconductor Electrical Characteristics TCK 66 68 OUTPUT SIGNALS 67 OUTPUT SIGNALS 70 69 OUTPUT SIGNALS Figure F-39. Boundary Scan (JTAG) Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-53 Electrical Characteristics F.14 QADC64E Electrical Characteristics Table F-16. QADC64E Conversion Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) Num Parameter 97 QADC Clock (QCLK) Frequency1 98 Conversion Cycles2 Legacy mode: QADCMCR[FLIP] = 0 Enhanced mode: QADCMCR[FLIP] = 1 99 Symbol Min Max Units FQCLK 0.5 3.0 MHz CC CC 12 14 28 20 QCLK cycles QCLK cycles 14 s s 10 s s Conversion Time FQCLK = 2.0 MHz1 Legacy mode: QADCMCR[FLIP] = 0 Min = CCW[IST] =0b00, CCW[BYP] = 0 Max = CCW[IST] =0b11, CCW[BYP] = 1 6.0 TCONV Enhanced mode: QADCMCR[FLIP] = 1 Min = CCW[IST] =0b0 Max = CCW[IST] =0b1 5 6 7 s Resolution3 -- 5 -- mV Absolute (total unadjusted) error4, 5, 6, 7 FQCLK = 2.0MHz3, 2 clock input sample time AE -2 2 Counts -7.8 3.5 mV m mA 102 8, 9, 10, 11 Absolute (total unadjusted) error FQCLK = 2.0MHz3, 2 clock input sample time AEALT 104 DC Disruptive Input Injection Current12, 13, 14, 15, 16 IINJ17 IINJ18 -319 -1 3 1 105 Current Coupling Ratio20 PQA PQB K -- -- 8x10 -5 8x10 -5 107a 4 10 101 107 3 -- Stop Mode Recovery Time 106 2 TSR 100 102a 1 7.0 Incremental error due to injection current All channels have same 10K < Rs <100k Channel under test has Rs=10K, IINJ=+3mA Source impedance at input 21 Incremental capacitance during Sampling 22 EINJ +1.0 +1.0 Counts Counts RS -- 100 K CSAMP -- 5 pF Conversion characteristics vary with FQCLK rate. Reduced conversion accuracy occurs at max FQCLK rate. The number of conversion cycles is dependent on the IST bit in the CCW register. At VRH - VRL = 5.12 V, one count = 5 mV. Accuracy tested and guaranteed at VRH - VRL = 5.0 V 0.25 V This parameter is periodically sampled rather than 100% tested. Absolute error includes 1/2 count (~2.5 mV) of inherent quantization error and circuit (differential, integral, and offset) error. Specification assumes that adequate low-pass filtering is present on analog input pins -- capacitive filter with 0.01 F to 0.1 F capacitor between analog input and analog ground, typical source isolation impedance of 10 K. Input signals with large slew rates or high frequency noise components cannot be converted accurately. These signals may affect the conversion accuracy of other channels. MPC561/MPC563 Reference Manual, Rev. 1.2 F-54 Freescale Semiconductor Electrical Characteristics 8 Accuracy tested and guaranteed at VARH - VRL = 1.0V to 0.75 x VDDA V. See Specification 52 in Table F-4 on page F-7. 9 This parameter is periodically sampled rather than 100% tested. 10 Absolute error includes 1/2 count (~2.5 mV) of inherent quantization error and circuit (differential, integral, and offset) error. Specification assumes that adequate low-pass filtering is present on analog input pins -- capacitive filter with 0.01 F to 0.1 F capacitor between analog input and analog ground, typical source isolation impedance of 10 K. 11 Input signals with large slew rates or high frequency noise components cannot be converted accurately. These signals may affect the conversion accuracy of other channels. 12 Below disruptive current conditions, the channel being stressed has conversion values of 0x3FF for analog inputs greater than VRH and 0x000 for values less than VRL. This assumes that VRH <= VDDA and VRL >= VSSA due to the presence of the sample amplifier. Other channels are not affected by non-disruptive conditions. 13 Exceeding limit may cause conversion error on stressed channels and on unstressed channels. Transitions within the limit do not affect device reliability or cause permanent damage. 14 Input must be current limited to the value specified. To determine the value of the required current-limiting resistor, calculate resistance values using VPOSCLAMP = (the lower of VDDA or VDDH) + 0.3 V and VNEGCLAMP = - 0.3 V, then use the larger of the calculated values. The diode drop voltage is a function of current and varies approximately 0.4 to 0.8 V over temperature 15 This parameter is periodically sampled rather 100% tested. 16 Derate linearly to 0.3 mA if VDDH - VDDA = 1 V. This specification is preliminary and may change after further characterization. 17 Condition applies to two adjacent pins. 18 Condition applies to all analog channels. 19 Note that -ve means current flows out of the pin. 20 Current Coupling Ratio, K, is defined as the ratio of the output current, I OUT, measured on the pin under test to the injection current, IINJ, when both adjacent pins are overstressed with the specified injection current. K = IOUT/ IINJ The input voltage error on the channel under test is calculated as Verr = IINJ * K * RS. 21 Maximum source impedance is application-dependent. Error resulting from pin leakage depends on junction leakage into the pin and on leakage due to charge-sharing with internal capacitance. Error from junction leakage is a function of external source impedance and input leakage current. In the following expression, expected error in result value due to junction leakage is expressed in voltage (VERRJ): VERRJ = RS * IOFF where IOFF is a function of operating temperature. Charge-sharing leakage is a function of input source impedance, conversion rate, change in voltage between successive conversions, and the size of the filtering capacitor used. Error levels are best determined empirically. In general, continuous conversion of the same channel may not be compatible with high source impedance 22 For a maximum sampling error of the input voltage <= 1LSB, then the external filter capacitor, C >= 1024 * C . f SAMP The value of CSAMP in the new design may be reduced. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-55 Electrical Characteristics F.15 QSMCM Electrical Characteristics Table F-17. QSPI Timing Note: (TA = TL to TH , 50 pF load on all QSPI pins unless otherwise noted) Num 108 109 Function Operating Frequency1 Master Slave Symbol Min Max Unit -- -- fSYS/4 fSYS/4 Hz Hz 4*TC 4*TC 510 * TC2 -- ns ns 2*TC 2*TC 128 * TC -- ns ns -- 2*TC SCK/2 -- ns ns 2*TC- 60 2*TC- n 255 * TC -- ns ns 17*TC 13*TC 8192 * TC - ns ns 30 20 - ns ns 0 20 - ns ns fOP Cycle Time Master Slave tQCYC Enable Lead Time Master Slave tLEAD Enable Lag Time Master Slave tLAG Clock (SCK) High or Low Time Master Slave3 tSW Sequential Transfer Delay Master Slave (Does Not Require Deselect) tTD Data Setup Time (Inputs) Master Slave tSU Data Hold Time (Inputs) Master Slave tHI 116 Slave Access Time tA -- TC ns 117 Slave MISO Disable Time tDIS -- 2 * TC ns 118 Data Valid (after SCK Edge) Master Slave -- -- 50 50 ns ns 0 0 -- -- ns ns trI -- 1 s tRO tRO tRO -- -- 200 21 300 ns ns ns 110 111 112 113 114 115 119 120 Data Hold Time (Outputs) Master Slave SCK, MOSI, MISO Rise Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 200 pF, SLRC1 bit of PDMCR = "1" (fast) up to 200 pF, SLRC1 bit of PDMCR = "0" (slow) tV tHO MPC561/MPC563 Reference Manual, Rev. 1.2 F-56 Freescale Semiconductor Electrical Characteristics Table F-17. QSPI Timing (continued) Note: (TA = TL to TH , 50 pF load on all QSPI pins unless otherwise noted) Num 120a 121 121a Function PCS[0:1] Rise Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 50 pF, SLRC1 bit of PDMCR = "1" (fast) SCK, MOSI, MISO Fall Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 200 pF, SLRC1 bit of PDMCR = "1" (fast) up to 200 pF, SLRC1 bit of PDMCR = "0" (slow) PCS[0:1] Fall Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 50 pF, SLRC1 bit of PDMCR = "1" (fast) Symbol Min Max Unit trI -- 1 s tRO tRO -- -- 50 25 ns ns trI -- 1 s tFO tFO tFO -- -- -- 200 21 300 ns ns ns trI -- 1 s tFO tFO -- -- 50 25 ns ns 1 All AC timing is tested to the 5-V levels outlined in Table F.5 on page F-7 TC is defined to be the clock period. 3 For high time, n = External SCK rise time; for low time, n = External SCK fall time. 2 Table F-18. QSCI Timing Note: (TA = TL to TH , 50 pF load on all SCI pins unless otherwise noted) Note: All AC timing is tested to the 5-V levels outlined in Table F.5 Num 120b 121b Function TXD Rise Time Input - Output - up to 50 pF, SLRC2 bit of PDMCR = "0" (slow) up to 50 pF, SLRC2 bit of PDMCR = "1" (fast) TXD Fall Time Input - Output - up to 50 pF, SLRC2 bit of PDMCR = "0" (slow) up to 50 pF, SLRC2 bit of PDMCR = "1" (fast) Symbol Min Max Unit trI -- 1 s tRO tRO -- -- 50 25 ns ns trI -- 1 s tFO tFO -- -- 50 25 ns ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-57 Electrical Characteristics 111 110 PCS[0:3] OUTPUT 121 SCK CPOL=0 OUTPUT SCK CPOL=1 OUTPUT 113 120 109 112 120 114 111 115 MISO INPUT MSB IN 121 DATA LSB IN 119 MOSI OUTPUT PD MSB OUT MSB IN 118 DATA PORT DATA LSB OUT 121 MSB OUT 120 Figure F-40. QSPI Timing - Master, CPHA = 0 111 110 PCS[0:3] OUTPUT 121 120 109 SCK CPOL=0 OUTPUT 113 109 112 115 SCK CPOL=1 OUTPUT 112 MISO INPUT MSB IN 121 120 114 DATA 119 MOSI OUTPUT PORT DATA MSB OUT 121 DATA LSB IN MSB 118 LSB OUT PORT DATA MSB 120 Figure F-41. QSPI Timing - Master, CPHA = 1 MPC561/MPC563 Reference Manual, Rev. 1.2 F-58 Freescale Semiconductor Electrical Characteristics 111 110 SS INPUT 121 120 113 SCK CPOL=0 INPUT 109 112 SCK CPOL=1 INPUT 111 MISO OUTPUT 119 MSB OUT 114 MOSI INPUT 121 120 116 119 117 118 DATA LSB OUT 115 MSB IN PD MSB OUT 121 DATA LSB IN MSB IN Figure F-42. QSPI Timing - Slave, CPHA = 0 SS INPUT 109 SCK CPOL=0 INPUT 121 111 120 110 116 MOSI INPUT 120 121 118 118 PD 111 112 SCK CPOL=1 INPUT MISO OUTPUT 113 MSB OUT DATA MSB IN PD 121 115 114 119 117 SLAVE LSB OUT DATA LSB IN Figure F-43. QSPI Timing - Slave, CPHA = 1 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-59 Electrical Characteristics F.16 GPIO Electrical Characteristics Table F-19. GPIO Timing Note: (TA = TL to TH) Num 122 122a 122b 122c 123 Rating Symbol Min Max Unit Input t RI - 1 s Output (PDMCR[SLRC0] = 0), 50 pF Load1 t RO - 200 ns Output (PDMCR[SLRC0] = 1), 50 pF Load t RO - 25 ns 1 s SGPIOA[8:31], SGPIOD[0:31], SGPIOC[1:4, 6:7], MPIO32B[0:10, 13:15], A_PQA[0:7], A_PQB[0:7], B_PQA[0:7], B_PQB[0:7] rise time. QGPIO[4:6] rise time. Input t RI Output (PDMCR[SLRC0] = 0), 50 pF Load1 t RO - 200 ns Output (PDMCR[SLRC0] = 1), 200 pF Load t RO - 21 ns Input t RI - 1 ms Output (PDMCR[SLRC0] = 0), 50 pF Load1 t RO - 50 ns Output (PDMCR[SLRC0] = 1), 50 pF Load t RO - 21 ns Input t RI - 1 s Output (SCCR[COM] = 0b11), 25 pF Load t RO - 10 ns Output (SCCR[COM] = 0b00), 50 pF Load t RO - 10 ns t FI - 1 s t FO - 200 ns t FO - 25 ns QGPIO[0:3], MPIO32B[11;12] rise time. SGPIOC[0, 5] rise time.2 SGPIOA[8:31], SGPIOD[0:31], SGPIOC[1:4, 6:7], MPIO32B[0:10, 13:15], A_PQA[0:7], A_PQB[0:7], B_PQA[0:7], B_PQB[0:7] fall time. Input Output (PDMCR[SLRC0] = 0), 50 pF Load1 Output (PDMCR[SLRC0] = 1), 50 pF Load 123a QGPIO[4:6] fall time. t FI - 1 s Load1 t FO - 200 ns Output (PDMCR[SLRC0] = 1), 200 pF Load t FO - 21 ns t FI - 1 ms t FO - 50 ns t FO - 21 ns Input Output (PDMCR[SLRC0] = 0), 50 pF 123b QGPIO[0:3], MPIO32B[11;12] fall time. Input Output (PDMCR[SLRC0] = 0), 50 pF Load1 Output (PDMCR[SLRC0] = 1), 50 pF Load MPC561/MPC563 Reference Manual, Rev. 1.2 F-60 Freescale Semiconductor Electrical Characteristics Table F-19. GPIO Timing (continued) Note: (TA = TL to TH) 123c 1 2 F.17 SGPIOC[0, 5] fall time. 2 Input t FI - 1 s Output (SCCR[COM] = 0b11), 25 pF Load t FO - 10 ns Output (SCCR[COM] = 0b00), 50 pF Load t FO - 10 ns For this 5-V output, a drive load of 200 pf is possible but with a rise/fall time of 300 ns. These are 2.6 V GPIO pins. TPU3 Electrical Characteristics Table F-20. TPU3 Timing Note: (TA = TL to TH) Num 124 125 126 Rating Symbol Min Max Unit 92 3 650 25 ns ns Slew Rate of TPU Output Channel Valid1,2 (SLRC0 of PDMCR = 0, 50 pF to 200 pF load) (SLRC0 of PDMCR = 1, 50 pF load) tCHTOV CLKOUT High to TPU Output Channel Hold tCHTOH 0 15 ns tTIPW 4 -- tcyc TPU Input Channel Pulse Width3 1 AC timing is shown with respect to 10% VDD & 90% VDD levels. Timing not valid for external T2CLK input. 3 t CYC is defined as the CLKOUT Period. 2 CLKOUT 125 124 TPU OUTPUT TPU INPUT 126 TPU I/O TIM Figure F-44. TPU3 Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-61 Electrical Characteristics F.18 TouCAN Electrical Characteristics Table F-21. TouCAN Timing1 Note: (TA = TL to TH) Nu m Rating Symbol Min Max Unit 127 CNTX0 (Delay from ICLOCK) tCNTX0 19 ns 128 CNRX0 (Set-Up to ICLOCK rise) tCNRX0 0 ns tRI 1 s 50 100 25 ns ns ns 1 s 50 100 25 ns ns ns -- MHz 129 Rise Time Input Output - 50 pF load, SLRC1 bit of PDMCR = "0" 200 pF load, SLRC1 bit of PDMCR = "0" 50 pF, SLRC1 bit of PDMCR = "1" 130 Fall Time Input tFI Output- 50 pF load, SLRC1 bit of PDMCR = "0" 200 pF load, SLRC1 bit of PDMCR = "0" 50 pF, SLRC1 bit of PDMCR = "1" Serial Pins (Maximum frequency) 1 tRO tFO tF 1 AC timing is shown is tested to the 3-V levels outlined in Table F-4 on page F-7. F.19 PPM Timing Characteristics Table F-22. PPM Timing Note: (TA = TL to TH, 50 pF Load on all Pins) Nu m Symbol Min Max Unit 131 Operating Frequency1 fOP fSYS/256 fSYS/22 Hz 132 Cycle Time tCYC 2*TC 256*TC3 ns 133 PPM Clock (PPM_TCLK) high or low time tSW (tcyc/2) - (tRO + tFI) ns 134 Sequential Transfer Delay tTD 9*tcyc 17*tcyc ns 135 Data Setup Time (Inputs) tSU 30 -- ns 136 Data Hold Time (Inputs) tHI 0 -- ns 137 Data Valid (After PPM_TCLK Edge) tV -- 5 ns tHO TC/2 -- ns 138 Data Hold Time (Outputs) Rating MPC561/MPC563 Reference Manual, Rev. 1.2 F-62 Freescale Semiconductor Electrical Characteristics Table F-22. PPM Timing (continued) Note: (TA = TL to TH, 50 pF Load on all Pins) Nu m Rating 139 Rise Time Input Output - 2.6V PPM pads (PDMCR2[PPMV] = 0) 5V PPM pads (PDMCR2[PPMV] = 1) 140 Fall Time Input Symbol Min Max Unit tHI -- 1 s -- -- 7 15 ns ns -- 1 s -- -- 7 15 ns ns tRO tFI Output - 2.6V PPM pads (PDMCR2[PPMV] = 0) 5V PPM pads (PDMCR2[PPMV] = 1) tFO 1 All AC timing is tested to the 2.6-V levels outlined in Table F.5 on page F-7. Although the PPM permits frequencies of up to fSYS/2, if the 5-V bus is selected the bus frequency should not be run at frequencies above fSYS/8 for EMI/EMC reasons. 3 TC is defined to be the clock period. 2 Following are PPM timing diagrams. PPM_TCLK Figure F-45. PPM_TCLK Timing PPM_TCLK PPM_TSYNC PPM_TX[0:1] Figure F-46. PPM Data Transfer Timing (SPI Mode) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-63 Electrical Characteristics F.20 MIOS Timing Characteristics All MIOS output pins are slew rate controlled. Slew rate control circuitry adds 90 ns as minimum to the output timing and 650 ns as a maximum. This slew rate is from 10% VDD to 90% VDD, an additional 100 ns should be added for total 0 to VDD slew rate. Table F-23. MCPSM Timing Characteristics Note: After reset MCPSMSCR_PSL[3:0] is set to 0b0000. Note: VS_PCLK is the MIOS prescaler clock which is distributed to all the counter (e.g., MPWMSM and MMCSM) submodules. Characteristic MCPSM enable to VS_PCLK pulse1 1 Symbol Delay Unit tCPSMC (MCPSMSCR_PSL[3:0]) -1 System Clock Cycles The MCPSM clock prescaler value (MCPSMSCR_PSL[3:0]) should be written to the MCPSMSCR (MCPSM Status/Control Register) before rewriting the MCPSMSCR to set the enable bit (MCPSMSCR_PREN). If this is not done the prescaler will start with the old value in the MCPSMSCR_PSL[3:0] before reloading the new value into the counter. tCPSMC fSYS Prescaler enable bit (PREN) MIOB VS_PCLK Note 1: fSYS is the internal system clock for the IMB3 bus. Note 2: The numbers associated with the fSYS ticks refer to the IMB3 internal state. Note 3: vs_pclk is the MIOS prescaler clock which is distributed around the MIOS to counter modules such as the MMCSM and MPWMSM. Figure F-47. MCPSM Enable to VS_PCLK Pulse Timing Diagram F.20.1 MPWMSM Timing Characteristics Table F-24. MPWMSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max PWMSM output resolution tPWMR --1 2.0 2 PWM output pulse3 tPWMO 2.0 -- MPC561/MPC563 Reference Manual, Rev. 1.2 F-64 Freescale Semiconductor Electrical Characteristics Table F-24. MPWMSM Timing Characteristics (continued) Note: All delays are in system clock periods. Characteristic MPWMI input pin to MPWMSCR_PIN status set Symbol Min Max tPIN 1 2 CPSM enable to output set4 tPWMP (MPWMPERR - MPWMPULR + 1) * (256 - MPWMSCR_CP) * MCPSMSCR_PSL + 1 MPWMSM Enable to output set (MIN)5 tPWME (MPWMPERR - MPWMPULR) * (256 - MPWMSCR_CP) * MCPSMSCR_PSL + 3 + (255 - MPWMSCR_CP) * MCPSMSCR_PSL6 MPWMSM Enable to output set (MAX)5 tPWME tPWME(MIN) + MCPSMSCR_PSL - 16 Interrupt Flag to output pin reset (period start)7 tFLGP (256 - MPWMSCR_CP) * MCPSMSCR_PSL - 16 1 2 3 4 5 6 7 Minimum output resolution depends on MPWMSM and MCPSM prescaler settings. Maximum resolution is obtained by setting CPSMPSL[3:0] =0x2 and MPWMSCR_CP[7:0] =0xFF. Excluding the case where the output is always "0". With MPWMSM enabled before enabling the MCPSM. Please also see NOTE 1 on the MCPSM timing information. The exact timing from MPWMSM enable to the pin being set depends on the timing of the register write and the MCPSM VS_PCLK. When MCPSMSCR_PSL = 0x0000, this gives a prescale value of 16 and it is 16 which should be used in these calculations. When MCPSMSCR_PSL = 0x0001, the CPSM is inactive. The interrupt is set before the output pin is reset (Signifying the start of a new period). tPWMO min fSYS MPWMO output pin Figure F-48. MPWMSM Minimum Output Pulse Example Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-65 Electrical Characteristics tPWMP fSYS 3 4 1 Prescaler enable bit (PREN) MIOB VS_PCLK MPWMO output pin Figure F-49. MCPSM Enable to MPWMO Output Pin Rising Edge Timing Diagram tPWME fSYS 3 4 1 MPWMSCR enable bit MPWMO output pin Figure F-50. MPWMSM Enable to MPWMO Output Pin Rising Edge Timing Diagram fSYS tFLGP MPSMO pin output MPWMSM interrupt flag Figure F-51. MPWMSM Interrupt Flag to MPWMO Output Pin Falling Edge Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 F-66 Freescale Semiconductor Electrical Characteristics F.20.2 MMCSM Timing Characteristics Table F-25. MMCSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max MMCSM input pin period tPPER 4 -- MMCSM pin low time tPLO 2 -- MMCSM pin high time tPHI 2 -- clock pin to counter bus increment. tPCCB 1 2 load pin to new counter bus value tPLCB 1 2 clock pin to PINC delay tPINC 1 2 Load pin to PINL delay tPINL 1 2 Counter bus resolution tCBR --1 22 Counter bus overflow reload to interrupt flag tCBFLG 1 MCPSM enable to counter bus increment. tMCMP (256 - MMCSMSCR_CP) * MCPSMSCR_PSL + 2 MMCSM Enable to counter bus increment (MIN) 3 tMCME 4 + MCPSMSCR_PSL* (255 - MMCSMSCR_CP)3 MMCSM Enable to counter bus increment (MAX)3 tMCME 4 + MCPSMSCR_PSL * (255 - MMCSMSCR_CP) + (MCPSMSCR_PSL - 1)3 1 Minimum output resolution depends on MMCSM and MCPSM prescaler settings. Maximum resolution is obtained by setting CPSMPSL[3:0] =0x2 and MMCSMSCR_CP[7:0] =0xFF. 3 The exact timing from MMCSM enable to the pin being set depends on the timing of the MMCSMSCR register write and the MCPSM VS_PCLK. The MMCSM enable is taken to mean the MMCSMSCR_CLS[1:0] being written to 2`b11. 2 tPPER min tPLO min tPHI min fSYS MMCSM pin Figure F-52. MMCSM Minimum Input Pin (Either Load Or Clock) Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-67 Electrical Characteristics tPCCB fSYS MMCSM clock pin A Counter bus[15:0] A+1 Figure F-53. MMCSM Clock Pin To Counter Bus Increment Timing Diagram tPLCB fSYS MMCSM load pin A Counter bus[15:0] B Figure F-54. MMCSM Load Pin To Counter Bus Reload Timing Diagram tCBFLG fSYS Counter bus[15:0] FFFE FFFF MMCSMML[15:0] 5AFE MMCSM interrupt flag 5AFE Figure F-55. MMCSM Counter Bus Reload To Interrupt Flag Setting Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 F-68 Freescale Semiconductor Electrical Characteristics tMCME fSYS 1 2 MMCSMSCR_CLS[1:0] 3 00 4 1 11 A Counter bus[15:0] A+1 Figure F-56. MMCSM Prescaler Clock Select To Counter Bus Increment Timing Diagram F.20.3 MDASM Timing Characteristics Table F-26. MDASM Timing Characteristics Note: All delays are in system clock periods. Characteristics Symbol Min Max Input Modes: (IPWM, IPM, IC, DIS) MDASM input pin period tPPER 4 -- MDASM pin low time tPLO 2 -- MDASM pin high time tPHI 2 -- Input capture resolution tCAPR -- 2 Input pin to Counter Bus capture delay tPCAP 1 31 Input pin to interrupt flag delay tPFLG 2 3 Input pin to PIN delay tPIN 1 2 Counter bus resolution tCBR -- 22 tPULW 2 -- tCOMR -- 22 Output Modes: (OC, OPWM) Output pulse width3 Compare resolution3 Counter Bus to pin change Counter Bus to interrupt flag set. tCBP 3 tCBFLG 3 1 If the counter bus capture occurs when the counter bus is changing then the capture is delayed one cycle. In situations where the counter bus is stable when the input capture occurs the tPCAP has a maximum delay of two cycles (the one-cycle uncertainty is due to the synchronizer). 2 Maximum resolution is obtained by setting CPSMPSL[3:0] =0x2 and MDASMSCR_CP[7:0] =0xFF. 3 Maximum output resolution and pulse width depends on counter (e.g., MMCSM) and MCPSM prescaler settings. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-69 Electrical Characteristics tPPER min tPLO min tPHI min fSYS MDAI input pin Figure F-57. MDASM Minimum Input Pin Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. tPCAP fSYS MDAI input pin MDASMAR[15:0] XXXX Counter bus[15:0] A A Figure F-58. MDASM Input Pin To Counter Bus Capture Timing Diagram tPFLG fSYS MDAI input pin MDASM interrupt flag Figure F-59. MDASM Input Pin to MDASM Interrupt Flag Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 F-70 Freescale Semiconductor Electrical Characteristics tPULW min fSYS MDAO output pin Figure F-60. MDASM Minimum Output Pulse Width Timing Diagram tCBP fSYS MDAO output pin Counter bus[15:0] 5AFC MDASMAR[15:0] 5AFE 5AFD 5AFE Figure F-61. Counter Bus to MDASM Output Pin Change Timing Diagram tCBFLG fSYS MDASM interrupt flag Counter bus[15:0] 5AFC MDASMAR[15:0] 5AFE 5AFD 5AFE Figure F-62. Counter Bus to MDASM Interrupt Flag Setting Timing Diagram F.21 MPIOSM Timing Characteristics Table F-27. MPIOSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max --1 -- Input Mode MPIOSM input pin period tPPER MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-71 Electrical Characteristics Table F-27. MPIOSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max tPLO --1 -- MPIOSM pin high time tPHI -- 1 -- Input pin to MPIOSM_DR delay tPDR 0 1 --2 -- MPIOSM pin low time Output mode Output pulse width 2 tPULW 1 The minimum input pin period, pin low and pin high times depend on the rate at which the MPIOSM_DR register is polled. 2 The minimum output pulse width depends on how quickly the CPU updates the value inside the MIOPSM_DR register. tPDR fSYS MPIOSM input pins MPIOSM_DR FFA5 005A FFA5 005A Figure F-63. MPIOSM Input Pin to MPIOSM_DR (Data Register) Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. MPC561/MPC563 Reference Manual, Rev. 1.2 F-72 Freescale Semiconductor Electrical Characteristics F.22 Pin Summary Table F-28. MPC561/MPC563 Signal Names and Pin Names Signal Name Pin Name Ball Assignment USIU ADDR/SGPIOA[8:31] addr_sgpioa8 AF9 addr_sgpioa9 AF8 addr_sgpioa10 AC6 addr_sgpioa11 Y4 addr_sgpioa12 Y3 addr_sgpioa13 AD7 addr_sgpioa14 AE7 addr_sgpioa15 AF7 addr_sgpioa16 AD8 addr_sgpioa17 AE8 addr_sgpioa18 AC7 addr_sgpioa19 AD9 addr_sgpioa20 AC8 addr_sgpioa21 AD10 addr_sgpioa22 AF10 addr_sgpioa23 AC9 addr_sgpioa24 AD11 addr_sgpioa25 AD12 addr_sgpioa26 AC11 addr_sgpioa27 AF11 addr_sgpioa28 AE11 addr_sgpioa29 AE12 addr_sgpioa30 AE10 addr_sgpioa31 AE9 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-73 Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment DATA/SGPIOD[0:31] data_sgpiod0 AD13 data_sgpiod1 AC12 data_sgpiod2 AF14 data_sgpiod3 AF13 data_sgpiod4 AF15 data_sgpiod5 AC13 data_sgpiod6 AF16 data_sgpiod7 AC14 data_sgpiod8 AF17 data_sgpiod9 AC16 data_sgpiod10 AF18 data_sgpiod11 AC17 data_sgpiod12 AC18 data_sgpiod13 AD18 data_sgpiod14 AC20 data_sgpiod15 AD19 data_sgpiod16 AD20 data_sgpiod17 AE20 data_sgpiod18 AF20 data_sgpiod19 AE19 data_sgpiod20 AF19 data_sgpiod21 AE18 data_sgpiod22 AD17 data_sgpiod23 AE17 data_sgpiod24 AD16 data_sgpiod25 AE16 data_sgpiod26 AD15 data_sgpiod27 AE15 data_sgpiod28 AD14 data_sgpiod29 AE14 data_sgpiod30 AE13 data_sgpiod31 AF12 irq0_b_sgpioc0_mdo4 P3 IRQ0/SGPIOC0/MDO4 MPC561/MPC563 Reference Manual, Rev. 1.2 F-74 Freescale Semiconductor Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment IRQ1/RSV/SGPIOC1 irq1_b_rsv_b_sgpioc1 P4 IRQ2/CR/SGPIOC2/MTS1 irq2_b_cr_b_sgpioc2_mts_b P2 IRQ3/KR/RETRY/SGPIOC irq3_b_kr_b_retry_b_sgpioc3 N1 IRQ4/AT2/SGPIOC4 irq4_b_at2_sgpioc4 P1 IRQ5/SGPIOC5/MODCK1 irq5_b_sgpioc5_modck1 AD21 IRQ[6:7]/MODCK[2:3] irq6_b_modck2 AE21 irq7_b_modck3 Y24 PULL_SEL (input only) pull_sel R26 TSIZ[0:1] tsiz0 V4 tsiz1 W1 RD/WR rd_wr _b V1 BURST burst Y1 BDIP bdip_b W4 TS ts_b W2 TA ta_b W3 TEA tea_b V3 RSTCONF/TEXP rstconf_b_texp Y25 OE oe_b V2 BI/STS bi_b_sts_b Y2 CS[0:3] cs0_b U1 cs1_b U2 cs2_b U3 cs3_b U4 we0_b_we0_b_a0 T1 we0_b_be1_b_at1 T2 we0_b_be2_b_at2 T3 we0_b_be3_b_at3 T4 PORESET/TRST poreset_b_trst_b W25 HRESET hreset_b W23 SRESET sreset_b W24 SGPIOC6/FRZ/PTR sgpioc6_frz_ptr_b N4 SGPIOC7/IRQOUT/LWP0 sgpioc7_irqout_b_lwp0 R1 BG/VF0/LWP1 bg_b_vf0_lwp1 R3 WE[0:3]/BE[0:3]/AT[0:3] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-75 Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment BR/VF1/IWP2 br_b_vf1_iwp2 R4 BB/VF2/IWP3 bb_b_vf2_iwp3 R2 IWP[0:1]/VFLS[0:1] iwp0_vfls0 N2 iwp1_vfls1 N3 TMS/EVTI tms_evti_b M2 TDI/DSDI/MDI0 tdi_dsdi_mdi0 M1 TCK/DSCK/MCKI tck_dsck_mcki L2 TDO/DSDO/MDO0 tdo_dsdo_mdo0 M4 JCOMP/RSTI jcomp_rsti_b L1 XTAL xtal AD26 EXTAL extal AC26 XFC xfc AA26 CLKOUT clkout U23 EXTCLK extclk V24 ENGCLK/BUCLK engclk_buclk V26 QSMCM PCS0/SS/QGPIO0 pcs0_ss_b_qgpio0 N25 PCS[1:3]/QGPIO[1:3] pcs1_qgpio1 N24 pcs2_qgpio2 N23 pcs3_qgpio3 P26 MISO/QGPIO4 miso_b_qgpio4 P25 MOSI/QGPIO5 mosi_b_qgpio5 P24 SCK/QGPIO6 sck_qgpio6 P23 TXD1/QGPO1 txd1_qgpo1 R25 TXD2/QGPO2/C_CNTX0 txd2_qgpo2_c_cntx0 R24 RXD1/QGPI1 rxd1_qgpi1 R23 RXD2/QGPI2/C_CNRX0 rxd2_qgpi2_c_cnrx0 T26 MIOS14 MPC561/MPC563 Reference Manual, Rev. 1.2 F-76 Freescale Semiconductor Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment MDA[11:15] mda11 C20 mda12 D20 mda13 A21 mda14 B21 mda15 C21 mda27 D21 mda28 A22 mda29 B22 mda30 F24 mda31 F25 mpwm0_mdi1 F26 mpwm1_mdo2 G23 MPWM2/PPM_TX1 mpwm2_ppm_tx1 G26 MPWM3/PPM_RX1 mpwm3_ppm_rx1 G25 MPWM16 mpwm16 G24 MPWM17/MDO3 mpwm17_mdo3 H23 MPWM[18:19]/MDO[6:7] mpwm18_mdo6 H24 mpwm19_mdo7 H25 VF0/MPIO32B0/MDO1 vf0_mpio32b0_mdo1 L23 VF1/MPIO32B1/MCKO vf1_mpio32b1_mcko L24 VF2/MPIO32B2/MSEI vf2_mpio32b2_msei_b M24 VFLS0/MPIO32B3/MSEO vfls0_mpio32b3_mseo_b M25 VFLS1/MPIO32B4 vfls1_mpio32b4 M26 MPIO32B5/MDO5 mpio32b5_mdo5 H26 MPIO32B6/MPWM4/MDO6 mpio32b6_mpwm4_mdo6 J23 MPIO32B7/MPWM5 mpio32b7_mpwm5 J24 MPIO32B[8:9]/MPWM[20:21] mpio32b8_mpwm20 J25 mpio32b9_mpwm21 J26 MPIO32B10/PPM_TSYNC mpio32b10_ppm_tsync K25 MPIO32B11/C_CNRX0 mpio32b11_c_cnrx0 K24 MPIO32B12/C_CNTX0 mpio32b12_c_cntx0 K23 MPIO32B13/PPM_TCLK mpio32b13_ppm_tclk K26 MPIO32B14/PPM_RX0 mpio32b14_ppm_rx0 L26 MDA[27:31] MPWM[0:1]/MDI[1:2] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-77 Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment MPIO32B15/PPM_TX0 mpio32b15_ppm_tx0 L25 TPU_A/TPU_B A_TPUCH[0:15] a_tpuch0 F3 a_tpuch1 C5 a_tpuch2 B5 a_tpuch3 A5 a_tpuch4 C6 a_tpuch5 D6 a_tpuch6 B6 a_tpuch7 A6 a_tpuch8 C7 a_tpuch9 D7 a_tpuch10 B7 a_tpuch11 A7 a_tpuch12 C8 a_tpuch13 D8 a_tpuch14 B8 a_tpuch15 A8 MPC561/MPC563 Reference Manual, Rev. 1.2 F-78 Freescale Semiconductor Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment B_TPUCH[0:15] b_tpuch0 K1 b_tpuch1 K2 b_tpuch2 K3 b_tpuch3 K4 b_tpuch4 J1 b_tpuch5 J2 b_tpuch6 J3 b_tpuch7 J4 b_tpuch8 H1 b_tpuch9 H2 b_tpuch10 H3 b_tpuch11 H4 b_tpuch12 G1 b_tpuch13 G2 b_tpuch14 G3 b_tpuch15 G4 A_T2CLK/PCS5 a_t2clk_pcs5 F2 B_T2CLK/PCS4 b_t2clk_pcs4 F1 QADC64E_A/QADC64E_B ETRIG[1:2]/PCS[6:7] etrig1_pcs6 B20 etrig2_pcs7 A20 A_AN0/ANw/PQB0 a_an0_anw_pqb0 C11 A_AN1/ANx/PQB1 a_an1_anx_pqb1 D11 A_AN2/ANy/PQB2 a_an2_any_pqb2 B11 A_AN3/ANz/PQB3 a_an3_anz_pqb3 A11 A_AN[48:51]/PQB[4:7] a_an48_pqb4 C12 a_an49_pqb5 D12 a_an50_pqb6 B12 a_an51_pqb7 A12 a_an52_ma0_pqa0 C13 a_an53_ma1_pqa1 D13 a_an54_ma2_pqa2 B13 A_AN[52:54]/MA[0:2]/PQA[0:2] MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-79 Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment A_AN[55:59]/PQA[3:7] a_an55_pqa3 A13 a_an56_pqa4 A14 a_an57_pqa5 D14 a_an58_pqa6 B14 a_an59_pqa7 C14 B_AN0/ANw/PQB0 b_an0_anw_pqb0 A15 B_AN1/ANx/PQB1 b_an1_anx_pqb1 B15 B_AN2/ANy/PQB2 b_an2_any_pqb2 C15 B_AN3/ANz/PQB3 b_an3_anz_pqb3 D15 B_AN[48:51]/PQB[4:7] b_an48_pqb4 A16 b_an49_pqb5 B16 b_an50_pqb6 C16 b_an51_pqb7 D16 b_an52_ma0_pqa0 A17 b_an53_ma1_pqa1 B17 b_an54_ma2_pqa2 C17 b_an55_pqa3 D17 b_an56_pqa4 A18 b_an57_pqa5 B18 b_an58_pqa6 C18 b_an59_pqa7 D18 B_AN[52:54]/MA[0:2]/PQA[0:2] B_AN[55:59]/PQA[3:7] TouCAN_A/TouCAN_B/TouCAN_C A_CNTX0 a_cntx0 M23 B_CNTX0 b_cntx0 L4 A_CNRX0 a_cnrx0 N26 B_CNRX0 b_cnrx0 L3 UC3F B0EPEE2 boepee T24 EPEE2 epee T23 VFLASH2 vflash U26 VDDF2 vddf U25 VSSF2 vssf U24 MPC561/MPC563 Reference Manual, Rev. 1.2 F-80 Freescale Semiconductor Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment Global Power Supplies NVDDL nvddl AC10 AC15 AC19 AC4 AD3 AE2 AF1 C9 D9 Y23 VDD vdd A1 A25 AC22 AD23 AE24 AF25 B2 B24 C23 C3 D22 D4 V23 VDDH vddh AF21 AF5 C19 C22 D19 E1 F23 T25 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-81 Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment VSS vss A19, A2, A23, A24, A26, A3, A4, AA1, AA2, AA23, AA24, AA25, AA3, AB1, AB2, AB24, AB25, AB4, AC1, AC21, AC23, AC25, AC3, AC5, AD2, AD22, AD24, AD4, AD5, AE1, AE22, AE23, AE25, AE3, AE4, AE5, AF2, AF22, AF23, AF24, AF26, AF3, AF4, AF6, B1, B19, B23, B25, B3, B4, C1, C2, C24, C26, C4, D1, D2, D23, D25, D26, D3, D5, E2, E24, E25, E26, E3, E4, L11, L12, L13, L14, L15, L16, M11, M12, M13, M14, M15, M16, N11, N12, N13, N14, N15, N16, P11, P12, P13, P14, P15, P16, R11, R12, R13, R14, R15, R16, T11, T12, T13, T14, T15, T16, V25 KAPWR kapwr W26 IRAMSTBY IRAMSTBY M3 QVDDL qvddl AA4 AB23 AB3 AC2 AC24 AD1 AD25 AD6 AE26 AE6 B26 C25 D24 E23 F4 USIU Power Supplies VDDSYN vddsyn Y26 VSSSYN vsssyn AB26 QADC64E Power Supplies VRH vrh C10 VRL vrl A10 MPC561/MPC563 Reference Manual, Rev. 1.2 F-82 Freescale Semiconductor Electrical Characteristics Table F-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment ALTREF altref B10 VDDA vdda D10 VSSA vssa A9 B9 1 2 This pin also included the MDO5 function on the K27S mask set off the MPC561. MPC563 only, no connection on MPC561. F.22.1 Package Diagrams The package for the MPC561/MPC563 is the 388 PBGA (27 x 27 mm, 1.0 mm ball pitch). This package has 352 balls in the perimeter rows and 36 ground balls in the center island for a total of 388 balls. The case outline drawing is 1164-01, as shown in Figure F-64. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-83 Electrical Characteristics 1 NOTE: Top Down View Figure F-64. MPC561/MPC563 Package Footprint (1 of 2) MPC561/MPC563 Reference Manual, Rev. 1.2 F-84 Freescale Semiconductor Electrical Characteristics Figure F-65. MPC561/MPC563 Package Footprint (2 of 2) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-85 Electrical Characteristics F.22.1.1 MPC561/MPC563 Ball Map The ball diagram of the MPC561/MPC563 is shown in Figure F-66. A 1 2 3 4 VDD VSS VSS VSS 5 6 7 8 A_TPUCH A_TPUCH3 A_TPUCH7 11 A_TPUCH15 9 10 VSSA VRL 11 12 13 14 15 16 17 18 A_AN3_A A_AN51_P A_AN55_ A_AN56_P B_AN0_AN B_AN48_ B_AN52_M B_AN56_P NZ_PQB3 QB7 PQA3 QA4 W_PQB0 PQB4 A0_PQA0 QA4 19 VSS 21 22 ETRIG2_ PCS7 MDA13 20 MDA28 23 24 25 26 VSS VSS VDD VSS A VDD VSS QVDDL B B VSS VDD VSS VSS A_TPUCH2 A_TPUCH6 A_TPUCH A_TPUCH14 10 VSSA ALTREF A_AN54_ A_AN2_A A_AN50_P MA2_PQ A_AN58_P B_AN1_AN B_AN49_ B_AN53_M B_AN57_P NY_PQB2 QB6 A2 QA6 X_PQB1 PQB5 A1_PQA1 QA5 VSS ETRIG1_ PCS6 MDA14 MDA29 VSS C VSS VSS VDD VSS A_TPUCH1 A_TPUCH4 A_TPUCH A_TPUCH12 8 NVDDL VRH A_AN0_A A_AN52_ NW_PQB A_AN48_P MA0_PQ A_AN59_P B_AN2_AN B_AN50_ B_AN54_M B_AN58_P 0 QB4 A0 QA7 Y_PQB2 PQB6 A2_PQA2 QA6 VDDH MDA11 MDA15 VDDH VDD VSS QVDDL VSS C D VSS VSS VSS VDD A_TPUCH A_TPUCH13 9 NVDDL VDDA A_AN53_ A_AN1_A A_AN49_P MA1_PQ A_AN57_P B_AN3_AN B_AN51_ B_AN55_P B_AN59_P NX_PQB1 QB5 A1 QA5 Z_PQB3 PQB7 QA3 QA7 VDDH MDA12 MDA27 VDD VSS QVDDL VSS VSS D VDDH VSS VSS E E F B_T2CLK_P A_T2CLK_ A_TPUCH CS4 PCS5 0 G B_TPUCH12 VSS A_TPUCH5 VSS QVDDL VSS VSS VSS QVDDL VDDH MDA30 MDA31 MPWM0_MD I1 F MPWM1_MD O2 MPWM16 MPWM3_PP MPWM2_PP M_RX1 M_TX1 G B_TPUCH1 B_TPUCH B_TPUCH1 3 14 5 H B_TPUCH8 B_TPUCH9 Ball Map (As viewed from top, through the package and silicon) B_TPUCH B_TPUCH1 10 1 MPWM17_M MPWM18_MD MPWM19_M DO3 O6 DO7 MPIO32B5_ MDO5 MPIO32B6_ MPIO32B7_MP MPIO32B8_ MPWM4_MD WM5 MPWM20 O6 MPIO32B9_ MPWM21 J MPIO32B12_ MPIO32B11_C MPIO32B10_ MPIO32B13_ C_CNTX0 _CNRX0 PPM_TSYNC PPM_TCLK K VF0_MPIO32 VF1_MPIO32B MPIO32B15_ MPIO32B14_ B0_MDO1 1_MCKO PPM_TX0 PPM_RX0 L J B_TPUCH B_TPUCH4 B_TPUCH5 B_TPUCH7 6 K B_TPUCH0 B_TPUCH1 L JCOMP_RS TCK_DSCK B_CNRX0 B_CNTX0 TI_B _MCKI VSS VSS VSS VSS VSS VSS M TDI_DSDI_ TMS_EVTI IRAMSTBY TDO_DSD MDI0 _B O_MDO0 VSS VSS VSS VSS VSS VSS N IRQ3_B_KR SGPIOC6_ _B_RETRY IWP0_VFL IWP1_VFL FRZ_PTR_ _B_SGPIO S0 S1 B C3 VSS VSS VSS VSS VSS VSS PCS2_QGPI PCS0_SS_B_ PCS1_QGPIO1 O2 QGPIO0 P IRQ2_B_C IRQ0_B_S IRQ1_B_R IRQ4_B_AT R_B_SGPI GPIOC0_ SV_B_SG 2_SGPIOC4 OC2_MDO MDO4 PIOC1 5_MTS VSS VSS VSS VSS VSS VSS SCK_QGPIO MISO_QGPI MOSI_QGPIO5 6 O4 SGPIOC7_I BB_B_VF2 BG_B_VF BR_B_VF1 R RQOUT_B_ _IWP3 0_LWP1 _IWP2 LWP0 VSS VSS VSS VSS VSS VSS RXD1_QGPI TXD2_QGPO2 TXD1_QGPO 1 _C_CNTX0 1 B_TPUCH B_TPUCH3 2 VFLS0_MPIO VF2_MPIO32B VFLS1_MPIO M 32B3_MSEO 32B4 2_MSEI_B _B A_CNRX0 N PCS3_QGPI O3 P PULL-SEL R T EPEE BOEPEE VDDH RXD2_QGPI 2_C_CNRX0 U CS0_B CS1_B CS2_B CS3_B CLKOUT VSSF VDDF VFLASH U V OE_B TEA_B TSIZ0 VDD EXTCLK VSS ENGCLK_BU CLK V W TSIZ1 TS_B TA_B BDIP_B SRESET_B PORESET_B _TRST_B KAPWR W Y BI_B_STS_ ADDR_SG ADDR_SG B PIOA12 PIOA11 T WE_B_AT WE_B_AT WE_B_AT0 WE_B_AT1 2 3 A_CNTX0 H RD_WR_B BURST_B AA VSS AB AC AD VSS VSS VSS VSS VSS VSS HRESET_B NVDDL VSS VSS QVDDL VSS VSS VSS QVDDL VSS VSS QVDDL VSS NVDDL VSS QVDDL VSS NVDDL VSS VSS ADDR_SGP ADDR_SG ADDR_SGPI ADDR_SG IOA10 PIOA18 OA20 PIOA23 NVDDL ADDR_S DATA_SG DATA_SG DATA_SG GPIOA26 PIOD1 PIOD5 PIOD7 NVDDL DATA_SG DATA_SGP DATA_SG PIOD9 IOD11 PIOD12 NVDDL DATA_S GPIOD14 VSS IRQ7_B_MODC RSTCONF_B K3 _TEXP VSS VDDSYN Y VSS XFC AA QVDDL VSS VSS VSSSYN AB VDD VSS QVDDL VSS EXTAL AC VSS VDD VSS QVDDL XTAL AD QVDDL IRQ5_B_S ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S GPIOC5_M PIOA13 OA16 PIOA19 IOA21 GPIOA24 PIOA25 PIOD0 PIOD28 IOD26 PIOD24 IOD22 PIOD13 OD15 GPIOD16 ODCK1 ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S IRQ6_B_M PIOA14 OA17 PIOA31 IOA30 GPIOA28 PIOA29 PIOD30 PIOD29 IOD27 PIOD25 IOD23 PIOD21 OD19 GPIOD17 ODCK2 VSS VSS VDD VSS QVDDL AE ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S DATA_SG DATA_SG DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S PIOA15 OA9 PIOA8 IOA22 GPIOA27 PIOD31 PIOD3 PIOD2 IOD4 PIOD6 IOD8 PIOD10 OD20 GPIOD18 VDDH VSS VSS VSS VDD VSS AF 21 22 23 24 25 26 AE VSS NVDDL VSS VSS VSS QVDDL AF NVDDL VSS VSS VSS VDDH VSS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 NOTE: The Flash balls are only available on the MPC563 and MPC564. These are no connects on the MPC561 and MPC562. Flash supplies and inputs are located on the following balls: T23, T24, U24, U25. U26. Figure F-66. MPC561/MPC563 Ball Map MPC561/MPC563 Reference Manual, Rev. 1.2 F-86 Freescale Semiconductor Electrical Characteristics 1 2 3 4 5 6 7 8 A VDD VSS VSS VSS A_TPUCH A_TPUCH3 A_TPUCH7 11 A_TPUCH15 B VSS VDD VSS VSS A_TPUCH2 A_TPUCH6 C VSS VSS VDD VSS A_TPUCH1 A_TPUCH4 D VSS VSS VSS VDD VDDH VSS VSS VSS E F B_T2CLK_P A_T2CLK_ A_TPUCH CS4 PCS5 0 G B_TPUCH12 VSS A_TPUCH5 9 10 11 12 13 14 A_AN3_A A_AN51_P A_AN55_ A_AN56_P NZ_PQB3 QB7 PQA3 QA4 VSSA VRL A_TPUCH A_TPUCH14 10 VSSA ALTREF A_AN54_ A_AN2_A A_AN50_P MA2_PQ A_AN58_P NY_PQB2 QB6 A2 QA6 A_TPUCH A_TPUCH12 8 NVDDL VRH A_AN52_ A_AN0_A NW_PQB A_AN48_P MA0_PQ A_AN59_P A0 QA7 0 QB4 A_TPUCH A_TPUCH13 9 NVDDL VDDA A_AN53_ A_AN1_A A_AN49_P MA1_PQ A_AN57_P NX_PQB1 QB5 A1 QA5 QVDDL B_TPUCH1 B_TPUCH B_TPUCH1 3 14 5 H B_TPUCH8 B_TPUCH9 B_TPUCH B_TPUCH1 10 1 J B_TPUCH4 B_TPUCH5 B_TPUCH B_TPUCH7 6 K B_TPUCH0 B_TPUCH1 B_TPUCH B_TPUCH3 2 L JCOMP_RS TCK_DSCK B_CNRX0 B_CNTX0 TI_B _MCKI VSS VSS VSS VSS VSS VSS M TDI_DSDI_ TMS_EVTI IRAMSTBY TDO_DSD MDI0 _B O_MDO0 VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS N IRQ3_B_KR SGPIOC6_ _B_RETRY IWP0_VFL IWP1_VFL FRZ_PTR_ Figure F-67. MPC561/MPC563 Ball Map (Black and White, page 1) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-87 Electrical Characteristics VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS IRQ2_B_C IRQ0_B_S IRQ1_B_R IRQ4_B_AT R_B_SGPI GPIOC0_ SV_B_SG 2_SGPIOC4 OC2_MDO MDO4 PIOC1 5_MTS VSS VSS VSS VSS VSS VSS SGPIOC7_I BB_B_VF2 BG_B_VF BR_B_VF1 R RQOUT_B_ _IWP3 0_LWP1 _IWP2 LWP0 VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS P T WE_B_AT0 WE_B_AT1 WE_B_AT WE_B_AT 2 3 U CS0_B CS1_B CS2_B CS3_B V OE_B TEA_B TSIZ0 W TSIZ1 TS_B TA_B BDIP_B Y BI_B_STS_ ADDR_SG ADDR_SG B PIOA12 PIOA11 RD_WR_B BURST_B AA VSS VSS VSS QVDDL AB VSS VSS QVDDL VSS AC VSS QVDDL VSS NVDDL VSS AD QVDDL VSS NVDDL VSS VSS QVDDL ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG PIOA13 OA16 PIOA19 IOA21 GPIOA24 PIOA25 PIOD0 AE VSS NVDDL VSS VSS VSS QVDDL ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG PIOA14 OA17 PIOA31 IOA30 GPIOA28 PIOA29 PIOD30 AF NVDDL VSS VSS VSS VDDH VSS ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S DATA_SG DATA_SG PIOA15 OA9 PIOA8 IOA22 GPIOA27 PIOD31 PIOD3 1 2 3 4 5 6 ADDR_SGP ADDR_SG ADDR_SGPI ADDR_SG IOA10 PIOA18 OA20 PIOA23 7 8 9 NVDDL 10 ADDR_S DATA_SG DATA_SG GPIOA26 PIOD1 PIOD5 11 12 13 Figure F-68. MPC561/MPC563 Ball Map (Black and White, page 2) MPC561/MPC563 Reference Manual, Rev. 1.2 F-88 Freescale Semiconductor Electrical Characteristics 14 15 16 17 18 19 20 21 22 ETRIG2_ PCS7 MDA13 MDA28 23 24 25 26 VSS VSS VDD VSS A A_AN56_P B_AN0_AN B_AN48_ B_AN52_M B_AN56_P QA4 W_PQB0 PQB4 A0_PQA0 QA4 VSS A_AN58_P B_AN1_AN B_AN49_ B_AN53_M B_AN57_P QA6 X_PQB1 PQB5 A1_PQA1 QA5 VSS ETRIG1_ PCS6 MDA14 MDA29 VSS VDD VSS QVDDL B A_AN59_P B_AN2_AN B_AN50_ B_AN54_M B_AN58_P QA7 Y_PQB2 PQB6 A2_PQA2 QA6 VDDH MDA11 MDA15 VDDH VDD VSS QVDDL VSS C A_AN57_P B_AN3_AN B_AN51_ B_AN55_P B_AN59_P QA5 Z_PQB3 PQB7 QA3 QA7 VDDH MDA12 MDA27 VDD VSS QVDDL VSS VSS D QVDDL VSS VSS VSS E MDA31 MPWM0_MD I1 F MPWM3_PP MPWM2_PP M_RX1 M_TX1 G MPWM17_M MPWM18_MD MPWM19_M MPIO32B5_ DO3 O6 DO7 MDO5 H MPIO32B6_ MPIO32B7_MP MPIO32B8_ MPWM4_MD WM5 MPWM20 O6 MPIO32B9_ MPWM21 J MPIO32B12_ MPIO32B11_C MPIO32B10_ MPIO32B13_ C_CNTX0 _CNRX0 PPM_TSYNC PPM_TCLK K VF0_MPIO32 VF1_MPIO32B MPIO32B15_ MPIO32B14_ B0_MDO1 1_MCKO PPM_TX0 PPM_RX0 L VDDH MPWM1_MD O2 VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS A_CNTX0 MDA30 MPWM16 VFLS0_MPIO VFLS1_MPIO VF2_MPIO32B M 32B3_MSEO 32B4 2_MSEI_B _B PCS2_QGPI PCS0_SS_B_ PCS1_QGPIO1 O2 QGPIO0 A_CNRX0 N Figure F-69. MPC561/MPC563 Ball Map (Black and White, page 3) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor F-89 Electrical Characteristics VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS SCK_QGPIO MISO_QGPI MOSI_QGPIO5 6 O4 PCS3_QGPI O3 P VSS R VSS VSS VSS VSS VSS RXD1_QGPI TXD2_QGPO2 TXD1_QGPO 1 _C_CNTX0 1 PULL_SEL VSS VSS VSS VSS VSS VSS RXD2_QGPI 2_C_CNRX0 T VSS VFLASH1 U V EPEE1 CLKOUT BOEPEE1 VDDH VSSF1 VDDF1 VDD EXTCLK VSS ENGCLK_BU CLK HRESET_B SRESET_B PORESET_B _TRST_B KAPWR W VDDSYN Y NVDDL IRQ7_B_MODC RSTCONF_B K3 _TEXP VSS VSS VSS XFC AA QVDDL VSS VSS VSSSYN AB VDD VSS QVDDL VSS EXTAL AC IRQ5_B_S DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S GPIOC5_M PIOD28 IOD26 PIOD24 IOD22 PIOD13 OD15 GPIOD16 ODCK1 VSS VDD VSS QVDDL XTAL AD DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S IRQ6_B_M PIOD29 IOD27 PIOD25 IOD23 PIOD21 OD19 GPIOD17 ODCK2 VSS VSS VDD VSS QVDDL AE DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S PIOD2 IOD4 PIOD6 IOD8 PIOD10 OD20 GPIOD18 VDDH VSS VSS VSS VDD VSS AF 21 22 23 24 25 26 DATA_SG PIOD7 14 NVDDL 15 DATA_SG DATA_SGP DATA_SG PIOD9 IOD11 PIOD12 16 17 18 NVDDL 19 DATA_S GPIOD14 20 VSS Figure F-70. MPC561/MPC563 Ball Map (Black and White, page 4) MPC561/MPC563 Reference Manual, Rev. 1.2 F-90 Freescale Semiconductor Appendix G 66-MHz Electrical Characteristics This appendix contains detailed information on power considerations, DC/AC electrical characteristics, and AC timing characteristics of the MPC561/MPC563 at the optional operating frequency of 66 MHz. For information on the 40- and 56-MHz operating frequency, refer to Appendix F, "Electrical Characteristics." G.1 66-MHz Feature Limitations The following feature limitations apply when operating the MPC561/MPC563 at a system frequency of 66 MHz: * Internal Flash programming must be performed with a system frequency of 56 MHz or less. * Data Bus Pre-discharge cannot be used to prevent damage due to voltages higher than 3.1 V on the data bus. * In a dual controller application with the MPC563 as master and MPC561 as slave, revision D of MPC561 silicon must be used. ) Table G-1. Absolute Maximum Ratings (VSS = 0V) Rating 1 2.6-V Supply Voltage1 2 Flash Supply Voltage3,4 Voltage1, 4 3 Flash Core 4 Oscillator, keep-alive Reg. Supply Voltage1 1,5 Symbol Min. Value Max. Value Unit VDDL -0.3 3.02 V VFLASH -0.3 5.6 V VDDF -0.3 3.0 V KAPWR -0.3 3.0 V IRAMSTBY -0.3 3.0 V VDDSYN -0.3 3.0 V -- -- -- -- 5 SRAM Supply Voltage 6 Clock Synthesizer Supply Voltage1 7 N.A. 8 QADC Supply Voltage6 VDDA -0.3 5.6 V 9 5-V Supply Voltage VDDH -0.3 5.6 V 10 DC Input Voltages7,8 VIN VSS-0.3 5.69 V 11 Reference VRH, with reference to VRL VRH -0.3 5.6 V 12 Reference ALTREF, with reference to VRL VARH -0.3 5.6 V 13 VSS Differential Voltage VSS - VSSA -0.1 0.1 V 15 VREF Differential Voltage VRH - VRL -5.6 5.6 V 16 VRL to VSSA Differential Voltage VRL - VSSA -0.3 0.3 V MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-1 66-MHz Electrical Characteristics Table G-1. Absolute Maximum Ratings (VSS = 0V) (continued) Rating Symbol Min. Value Max. Value Unit 17 Maximum Input Current per pin 10, 11, 12 IMA -2513 2513 mA 18 QADC Maximum Input Current per Pin IMAX -2513 2513 mA 19 Operating Temperature Range - Ambient (Packaged), M temperature range. TA -40 (TL) +125 (TH) C 19a Operating Temperature Range - Ambient (Packaged), C temperature range. TA -40 (TL) +85 (TH) C TSB -40 (TL) +135 (TH) C 20 Operating Temperature Range - Solder Ball (Packaged any perimeter solder ball)14 21 Junction Temperature Range TJ -40 +150 C 22 Storage Temperature Range TSTG -55 +150 C TSDR -- 235 C MSL -- 3 -- Temperature15 23 Maximum Solder 24 Moisture Sensitivity Level16 1 For internal digital supply of VDDL = 2.6-V typical. 2.6 volt supply pins can withstand up to 3.6 volts for acumulative time of 24 hours over the lifetime of the device. 3 During operation the value of V FLASH must be 5.0 V 5% 4 These power supplies are available on MPC563 and MPC564 only. 5 Maximum average current into the IRAMSTBY pin must be < 1.75mA. 6 V DDA=5.0 V 5%. 7 All 2.6-V input-only pins are 5-V tolerant. 8 Note that long term reliability may be compromised if 2.6-V output drivers drive a node which has been previously pulled to >3.1 V by an external component. HRESET and SRESET are fully 5-V compatible. 9 6.35 V on 5-V only pins (all QADC, all TPU, all QSMCM and the following MIOS pins: MDA[11:15], MDA[27:31], MPWM16, MPIO32B[7:9]/MPWM[20:21], MPIO32B11/C_CNRX0, MPIO32B12/C_CNTX0 ). Internal structures hold the input voltage below this maximum voltage on all of these pins, except the QSMCM RXD1/QPI1 and RXD2/QPI2/C_CNRX0 pins, if the maximum injection current specification is met (1 mA for all pins; exception: 3 mA on QADC pins) and VDDH is within Operating Voltage specifications (see specification 43 in Table G-4). Exception: The RXD1/QGPI1 and RXD2/GPI2 pins do not have clamp diodes to VDDH. Voltage must be limited to less than 6.5 volts on these 2 pins to prevent damage. 10 Maximum continuous current on I/O pins provided the overall power dissipation is below the power dissipation of the package. Proper operation is not guaranteed at this condition. 11 Condition applies to one pin at a time. 12 Transitions within the limit do not affect device reliability or cause permanent damage. Exceeding limit may cause permanent conversion error on stressed channels and on unstressed channels. 13 Maximum transient current per ISO7637. 14 Maximum operating temperature on any solder ball in outer four rows of solder balls on the package. These rows are referred to as "Perimeter Balls" to distinguish them from the balls in the center of the package. 15 Solder profile per CDF-AEC-Q100, current revision. 16 Moisture sensitivity per JEDEC test method J-STD-020-A (April 1999). 2 Functional operating conditions are given in Section G.6, "DC Electrical Characteristics." Absolute maximum ratings are stress ratings only, and functional operation at the maximum is not guaranteed. Stress beyond those listed may affect device reliability or cause permanent damage to the device. MPC561/MPC563 Reference Manual, Rev. 1.2 G-2 Freescale Semiconductor 66-MHz Electrical Characteristics This device contains circuitry protecting against damage due to high static voltage or electrical fields; however, it is advised that normal precautions be taken to avoid application of any voltages higher than maximum-rated voltages to this high-impedance circuit. Reliability of operation is enhanced if unused inputs are tied to an appropriate logic voltage level (e.g., either VSS or VDD). NOTE Negative current flows out of the pin and positive current flows into the pin. G.2 Package The MPC561/MPC563 is available in packaged form. The package is a 388-ball PBGA having a 1.0 mm ball pitch, Freescale case outline 1164-01 (See Figure G-63 and Figure G-64). G.3 G.3.1 EMI Characteristics Reference Documents The document referenced for the EMC testing of MPC561/MPC563 is SAE J1752/3 Issued 1995-03 G.3.2 Definitions and Acronyms EMC - Electromagnetic Compatibility EMI - Electromagnetic Interference TEM cell - Transverse Electromagnetic Mode cell G.3.3 1. 2. 3. 4. 5. 6. G.4 EMI Testing Specifications Scan range: 150 KHz - 1000 MHz Operating Frequency: 66 MHz Operating Voltages: 2.6 V, 5.0 V Max spikes: TBD dBuV I/O port waveforms: Per J1752/3 Temperature: 25 C Thermal Characteristics Table G-2. Thermal Characteristics Characteristic BGA Package Thermal Resistance, Junction to Ambient - Natural Convection BGA Package Thermal Resistance, Junction to Ambient - Four layer (2s2p) board, natural convection Symbol Value Unit RJA 47.31,2,3 C/W RJMA 29.43,4,5 C/W MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-3 66-MHz Electrical Characteristics Table G-2. Thermal Characteristics (continued) Characteristic Symbol Value Unit BGA Package Thermal Resistance, Junction to Board RJB 21.2 3,6 C/W BGA Package Thermal Resistance, Junction to Case (top) RJT 7.03,7 C/W BGA Package Thermal Resistance, Junction to Package Top, Natural Convection JT 1.68 C/W 1 2 3 4 5 6 7 8 Junction temperature is a function of on-chip power dissipation, package thermal resistance, mounting site (board) temperature, ambient temperature, air flow, power dissipation of other components on the board, and the board thermal resistance. Per SEMI G38-87 and JESD51-2 with the board horizontal. These values are the mean + 3 standard deviations of characterized data. Junction temperature is a function of on-chip power dissipation, package thermal resistance, mounting site (board) temperature, ambient temperature, air flow, power dissipation of other components on the board, and the board thermal resistance. Per JESD51-6 with the board horizontal. Thermal resistance between the die and the printed circuit board (Four layer (2s2p) board, natural convection). Indicates the thermal resistance between the die and the case top surface as measured by the cold plate method (MIL SPEC-883 Method 1012.1) with the cold plate temperature used for the case temperature. Thermal characterization parameter indicating the temperature difference between package top and the junction temperature per EIA/JESD51-2. An estimation of the chip junction temperature, TJ, in C can be obtained from the equation: TJ = TA + (RJA x PD) where: TA = ambient temperature (C) RJA = package junction to ambient resistance (C/W) PD = power dissipation in package The junction to ambient thermal resistance is an industry standard value which provides a quick and easy estimation of thermal performance. Unfortunately, the answer is only an estimate; test cases have demonstrated that errors of a factor of two are possible. As a result, more detailed thermal characterization is supplied. Historically, the thermal resistance has frequently been expressed as the sum of a junction to case thermal resistance and a case to ambient thermal resistance: RJA = RJC + RCA where: RJA = junction to ambient thermal resistance (C/W) RJC = junction to case thermal resistance (C/W) RJA = case to ambient thermal resistance (C/W) MPC561/MPC563 Reference Manual, Rev. 1.2 G-4 Freescale Semiconductor 66-MHz Electrical Characteristics RJC is device related and cannot be influenced. The user controls the thermal environment to change the case to ambient thermal resistance, RCA. For instance, the air flow can be changed around the device, add a heat sink, change the mounting arrangement on printed circuit board, or change the thermal dissipation on the printed circuit board surrounding the device. This description is most useful for ceramic packages with heat sinks where about 90% of the heat flow is through the case to the heat sink to ambient. For most packages, a better model is required. The simplest thermal model of a package which has demonstrated reasonable accuracy (about 20 percent) is a two resistor model consisting of a junction to board and a junction to case thermal resistance. The junction to case covers the situation where a heat sink will be used or where a substantial amount of heat is dissipated from the top of the package. The junction to board thermal resistance describes the thermal performance when most of the heat is conducted to the printed circuit board. It has been observed that the thermal performance of most plastic packages and especially PBGA packages is strongly dependent on the board. temperature. If the board temperature is known, an estimate of the junction temperature in the environment can be made using the following equation: TJ = TB + (RJB x PD) where: TB = board temperature (C) RJB = package junction to board resistance (C/W) PD = power dissipation in package () If the board temperature is known and the heat loss from the package case to the air can be ignored, acceptable predictions of junction temperature can be made. For this method to work, the board and board mounting must be similar to the test board used to determine the junction to board thermal resistance, namely a 2s2p (board with a power and a ground plane) and vias attaching the thermal balls to the ground plane. When the board temperature is not known, a thermal simulation of the application is needed. The simple two-resistor model can be used with the thermal simulation of the application (2), or a more accurate and complex model of the package can be used in the thermal simulation. Consultation on the creation of the complex model is available. To determine the junction temperature of the device in the application after prototypes are available, the thermal characterization parameter (JT) can be used to determine the junction temperature with a measurement of the temperature at the top center of the package case using the following equation: TJ = TT + (JT x PD) where: TT = thermocouple temperature on top of package (C) JT = thermal characterization parameter PD = power dissipation in package The thermal characterization parameter is measured per JESD51-2 specification published by JEDEC using a 40 gauge type-T thermocouple epoxied to the top center of the package case. The thermocouple MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-5 66-MHz Electrical Characteristics should be positioned so that the thermocouple junction rests on the package. A small amount of epoxy is placed over the thermocouple junction and over about one mm of wire extending from the junction. The thermocouple wire is placed flat against the package case to avoid measurement errors caused by cooling effects of the thermocouple wire. G.4.1 Thermal References The website for Semiconductor Equipment and Materials International is www.semi.org and their global headquarters address is: 3081 Zanker Road, San Jose CA, 95134; 1-408-943-6900. MIL-SPEC and EIA/JESD (JEDEC) specifications are available from Global Engineering Documents on the WEB at www.global.ihs.com or 800-854-7179 or 303-397-7956. JEDEC specifications are available on the WEB at www.jedec.org. 1. C.E. Triplett and B. Joiner, "An Experimental Characterization of a 272 PBGA Within an Automotive Engine Controller Module," Proceedings of SemiTherm, San Diego, 1998, pp. 47-54. 2. B. Joiner and V. Adams, "Measurement and Simulation of Junction to Board Thermal Resistance and Its Application in Thermal Modeling," Proceedings of SemiTherm, San Diego, 1999, pp. 212-220. G.5 ESD Protection Table G-3. ESD Protection Characteristics Symbol Value Units 2000 V R1 1500 C 100 pF 200 V R1 0 C 200 pF Number of pulses per pin2 Positive pulses (MM) Negative pulses (MM) Positive pulses (HBM) Negative pulses (HBM) -- -- -- -- 3 3 1 1 Interval of Pulses -- 1 ESD for Human Body Model (HBM)1 HBM Circuit Description ESD for Machine Model (MM) MM Circuit Description -- S 1 All ESD testing is in conformity with CDF-AEC-Q100 Stress Test Qualification for Automotive Grade Integrated Circuits. 2 A device will be defined as a failure if after exposure to ESD pulses the device no longer meets the device specification requirements. Complete DC parametric and functional testing shall be performed per applicable device specification at room temperature followed by hot temperature, unless specified otherwise in the device specification. MPC561/MPC563 Reference Manual, Rev. 1.2 G-6 Freescale Semiconductor 66-MHz Electrical Characteristics G.6 DC Electrical Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) Table G-4. DC Electrical Characteristics Characteristic 1 1 2.6-V only Input High Voltage except DATA[0:31] and EXTCLK 1a 2.6-V Input High Voltage EXTCLK 2 N.A. 2 3 5-V Input only High Voltage 4 5-V Input High Voltage (QADC PQA, PQB) 5 MUXed 2.6-V/ 5-V pins (GPIO muxed with Addr and Data) 2.6-V Input High Voltage Addr., Data 5-V Input High Voltage (GPIO) Symbol Min Max Unit VIH2.6 2.0 VDDH + 0.3 V VIHC 1.6 VDDH + 0.3 V -- -- -- -- VIH5 0.7 * VDDH VDDH + 0.3 V VIHA5 0.7 * VDDH (VDDA | VDDH) + 0.33 V VIH2.6M VIH5M 2.0 0.7 * VDDH VDDH + 0.3 VDDH + 0.3 V V 6 2.6-V Input Low Voltage Except EXTCLK VIL2.6 VSS - 0.3 0.8 V 7 2.6-V Input Low Voltage EXTCLK VIL2.6C VSS - 0.3 0.4 V 8 5-V Input Low Voltage 9 5-V Input Low Voltage (QADC PQA, PQB) 10 MUXed 2.6-V/ 5-V pins (GPIO muxed with Addr, Data) 2.6-V Input Low Voltage (Addr., Data) 5-V Input Low Voltage (GPIO) VIL5 VSS - 0.3 0.48 * VDDH V VILA5 VSSA - 0.3 0.48 * VDDH V VIL2.6M VIL5M VSS - 0.3 VSS - 0.3 0.8 0.48 * VDDH V 11 QADC Analog Input Voltage4 Note: Assumes VDDA VDDH VINDC VSSH - 0.3 VDDH + 0.3 V 12 2.6-V Weak Pull-up/down Current pull-up @ 0 to VIL2.6, pull-down @ VIH2.6 to VDD IACT2.6V 20 130 A 13 5-V Weak Pull-up/down Current4 pull-up @ 0 to VIL5, pull-down @ VIH5 to VDDH IACT5V 20 130 A 14 2.6-V Input Leakage Current4 pull-up/down inactive - measured @rails IINACT2.6V -- 2.5 A 15 5V Input Leakage Current4,5 pull-up/down inactive - measured @rails IINACT5V -- 2.5 A 16 QADC64 Input Current, Channel Off 6 PQA, PQB IOFF -200 -200 200 200 nA MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-7 66-MHz Electrical Characteristics Table G-4. DC Electrical Characteristics (continued) Characteristic 17 2.6-V Output High Voltage VDD = VDDL 2.6-V Output High Voltage (IOH = -1mA) 2.6-V Output High Voltage (IOH = -2mA) Symbol Min VOH2.6 VOH2.6A 2.3 2.1 Max Unit -- V 18 5-V Output High Voltage VDD = VDDH (IOH= -2mA) All 5-V only outputs except TPU. VOH5 VDDH - 0.7 -- V 19 5-V Output High Voltage VDD = VDDH (IOH= -5mA) For TPU pins Only VOHTP5 VDDH - 0.65 -- V 20 MUXed 2.6-V/ 5-V pins (GPIO MUXed with Addr, Data) 2.6-V Output High Voltage (IOH = -1mA) 2.6-V Output High Voltage (IOH = -2mA) 5-V Output High Voltage (IOH = -2mA) -- V VOH2.6M VOH2.6MA VOH5M 2.3 2.1 VDDH - 0.7 VOL2.6 -- 0.5 V VOL5 -- 0.45 V VOLTP5 -- 21 2.6-V Output Low voltage VDD = VDDL (IOL = 3.2mA) 22 5-V Output Low voltage VDD = VDDH (IOL = 2mA) All 5-V only outputs except TPU 23 5-V Output Low voltage VDD = VDDH -TPU pins Only IOL = 2mA IOL = 10mA 24 MUXed 2.6-V/ 5-V pins (GPIO MUXed with Addr, Data) 2.6-V Output Low Voltage (IOL = 3.2mA) 5-V Output Low Voltage (IOL = 2mA) V VOL2.6M VOL5M 0.5 0.45 25 Output Low Current (@ VOL2.6= 0.4 V) IOL2.6 2.0 27 CLKOUT Load Capacitance - SCCR COM & CQDS COM[0:1]= 0b01, CQDS = 0b1 COM[0:1]= 0b01 CQDS = 0b0 COM[0:1]= 0b00 CQDS = 0bx CCLK -- 29 Capacitance for Input, Output, and Bidirectional Pins: Vin = 0 V, f = 1 MHz (except QADC) CIN -- 30 Load Capacitance for bus pins only 7 COM[0:1] of SCCR = 0b11 COM[0:1] of SCCR = 0b10 CL -- 31 Total Input Capacitance PQA Not Sampling PQB Not Sampling V 0.45 1.0 -- mA 25 50 90 pF pF pF 7 pF pF 25 50 pF CIN -- -- 15 15 32 Hysteresis (Only IRQ, TPU, MIOS, GPIO, QADC (Digital inputs) and HRESET, SRESET, PORESET) 8 VH 0.5 -- V 33 N.A. (see Appendix F, "Electrical Characteristics") -- -- -- -- 34 N.A. (see Appendix F, "Electrical Characteristics") -- -- -- -- 35 N.A. (see Appendix F, "Electrical Characteristics") -- -- -- -- IDDL -- 250 IDDKAP -- 5 35a Operating Current (2.6-V supplies)@ 66 MHz10 VDD/QVDDL/NVDDL KAPWR (Crystal Frequency: 20 MHz) KAPWR (Crystal Frequency: 4 MHz) IDDKAP -- 2 IDDSRAM 50 x 10-3 1.7511 IDDSYN -- 2 IDDF -- 35 VDDFSTOP IDDFSTOP -- 10 VDDFDISABLED IDDFDISB -- 100 IRAMSTBY VDDSYN (Crystal Frequency: 20 MHz) VDDF (Read, program, or erase)9 mA A MPC561/MPC563 Reference Manual, Rev. 1.2 G-8 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-4. DC Electrical Characteristics (continued) Characteristic 36 Symbol Min Max Unit -- -- -- -- VDDH IDDH5 -- 20 mA VDDA11 IDDA -- 5 mA VFLASHF5 (Program or Erase) IDDF5 -- 109 mA VFLASHF5READ IDDF5R -- 5 mA VFLASHF5 (Stopped) SIDDF5 -- 1 mA VFLASHF5 (Disabled) SIDDF5D -- 100 A IDDA -- 10 A 130 18 9.5 mA mA mA 2.5 2.7 V 4.75 5.25 V N.A. (see Appendix F, "Electrical Characteristics") 36a Operating Current (5-V supplies)@ 66 MHz10, 11 1 37 QADC64 Low Power Stop Mode (VDDA) 38 Low Power Current (QVDDL+ NVDDI+ VDD) @ 66 MHz DOZE, Active PLL and Active Clocks SLEEP, Active PLL with Clocks off DEEP SLEEP, PLL and Clocks off -- IDDDZ IDDSLP IDDDPSLP 39 NVDDL, QVDDL,VDD, VDDF 9Operating Voltage 40 VFLASH Flash Operating/Programming Voltage9 VFLASH 41 Oscillator, Keep-Alive Registers Operating Voltage10,11 KAPWR 42 N.A. 43 VDDH Operating Voltage 44 QADC Operating Voltage 45 Clock Synthesizer Operating Voltage Difference11 46 N.A. 47 VSS Differential Voltage 48 49 NVDDL, QVDDL, VDD, VDDF -- VDDH VDDA VDDSYN VDD - 0.2 V VDD + 0.2 V12 -- -- V -- 4.75 5.25 V 4.75 5.25 V VDD - 0.2 V VDD + 0.2 V12 V -- -- -- -- VSS - VSSA -100 100 mV QADC64 Reference Voltage Low13 VRL VSSA VSSA + 0.1 V QADC64 Reference Voltage High13 VRH 3.0 VDDA V 50 QADC64 VREF Differential Voltage VRH - VRL 3.0 5.25 V 51 QADC64 Reference Supply Current, DC QADC64 Reference Supply Current, Transient -- -- 500 4.0 A mA 52 QADC64 ALT Reference Voltage14 IREF IREFT VARH 1.0 .75 * VDDA V 53 Standby Supply Current KAPWR only (4 MHz Crystal) KAPWR only (20 MHz Crystal) Measured @ 2.7 V 2.0 5 m m -- ISBKAPWR4 ISBKAPWR20 53a IRAMSTBY Regulator Current Data Retention 10 Specified VDD applied (VDD, VDDH = VSS) ISTBY 50 x 10-3 1.75 mA 53b IRAMSTBY Regulator Voltage for Data Retention10,15 (power-down mode) Specified VDD applied (VDD, VDDH = VSS)14 VSTBY 1.35 1.95 V mA 54 DC Injection Current per Pin GPIO, TPU, MIOS, QSMCM, EPEE and 5 V pins 4, 16, 17 IIC5 -1.0 1.0 55 DC Injection Current per Pin 2.6 V 4, 17, 18, 19 IIC26 -1.0 1.0 mA 56 QADC64 Disruptive Input Current 17, 20 INA -3 3 mA 57 Power Dissipation - 66 MHz PD 1.32 W This characteristic is for 2.6-V output and 5-V input friendly pins. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-9 66-MHz Electrical Characteristics 2 This characteristic is for 5-V output and 5-V input pins. 0.3V > VDDA or VDDH, whichever is greater. 4 Within this range, no significant injection will be seen. See QADC64 Disruptive Input Current (I NA). 5 During reset all 2.6V and 2.6V/5V pads will leak up to 10A to QVDDL if the pad has a voltage > QVDDL. 6 Maximum leakage occurs at maximum operating temperature. Current decreases by approximately one-half for each 8 to 12 C, in the ambient temperature range of 50 to 125 C. 7 All bus pins support two drive strengths capabilities, 25 pF and 50 pF. Current drive is less at the 25-pF capacitive load. Both modes achieve 66-MHz timing. 8 Only IRQ, TPU, MIOS, GPIO, QADC (when digital inputs) and RESET pins have hysteresis, thus there is no hysteresis specification on all other pins 9 Transient currents can reach 50mA. 10 KAPWR and IRAMSTBY can be powered-up prior to any other supply or at the same time as the other 2.6 V supplies. IRAMSTBY must lead or coincide with VDD; however it can lag KAPWR. 11 This parameter is periodically sampled rather than 100% tested 12 Up to 0.5 V during power up/down. 13 To obtain full-range results, V SSA VRL VINDC VRH VDDA 14 When using the QADC in legacy mode it is recommended to connect this pin to 2.6V or 3.3V, however it can be connected to 0V or 5V without damage to the device. 15 A resistor must be placed in series with the IRAMSTBY power supply. Refer to Appendix C, "Clock and Board Guidelines." 16 All injection current is transferred to the V DDH. An external load is required to dissipate this current to maintain the power supply within the specified voltage range. 17 Absolute maximum voltage ratings for each pin (see Table G-1) must also be met during this condition. 18 Total injection current for all I/O pins on the chip must not exceed 20 mA (sustained current). Exceeding this limit can cause disruption of normal operation. 19 Current refers to two QADC64 modules operating simultaneously. 20 Below disruptive current conditions, the channel being stressed has conversion values of 0x3FF for analog inputs greater than VRH and 0x000 for values less than VRL. This assumes that VRH VDDA and VRL VSSA due to the presence of the sample amplifier. Other channels are not affected by non-disruptive conditions. 3 G.7 Oscillator and PLL Electrical Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) Table G-5. Oscillator and PLL 1 Characteristic Symbol Oscillator Startup time (for typical crystal capacitive load) 4-MHz crystal 20-MHz crystal Min Typica l Max Unit OSCstart4 OSCstart20 10 10 ms ms TLOCK 10001 Input Clocks 2 PLL Lock Time 3 PLL Operating Range2 FVCOOUT 30 132 MHz 4 Crystal Operating Range, MODCK=0b010,0b110 MODCK[1:3] = 0b001, 0b011, 0b100, 0b101, 0b111 FCRYSTAL 3 15 5 25 MHz MHz 5 PLL Jitter PLL Jitter (averaged over 10 s) FJIT FJIT10 -1% -0.3% +1% +0.3% -- 6 Limp Mode Clock Out Frequency -- 33 173 MHz 7 Oscillator Bias Current (XTAL) 4 MHz 20 MHz | 0.8 | | 4.0 | mA mA 11 IBIAS -- | 1.5 | MPC561/MPC563 Reference Manual, Rev. 1.2 G-10 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-5. Oscillator and PLL (continued) Characteristic Symbol Min 8 Oscillator Drive (XTAL) IOSC 7 9 Oscillator Bias Resistor ROSC 0.5 Typica l Max 1 Unit -- mA 3 M 1 Assumes stable power and oscillator. FVCOOUT is 2x the system frequency. 3 Estimated value, real values to be characterized and updated. 2 G.8 Flash Electrical Characteristics The characteristics found in this section apply only to the MPC563. NOTE Flash programming should be restricted to 56 MHz. Flash read operations are unaffected by this condition. Note: (VDDF = 2.6 V 0.1 V, VFLASH = 5.0 V 0.25 V, TA = TL to TH, TB = TL to TH) Table G-6. Array Program and Erase Characteristics Value Symbol Meaning Minimum TERASE TERASEM TPROG Maximum 3 12 s 13 60 s 15 20 s Block Erase Time2 Module Erase Time2 Word Programming Units Typical1 Time3,4 1 Typical program and erase times assume nominal supply values and 25 C. Erase time specification does not include pre-programming operation 3 Word size is 32 bits. 4 The maximum hardware programming time of the entire Flash (not including the shadow row) is 20 s x (512 Kbytes / 4 bytes per word), or 131,072 words, (no software overhead). 2 Note: (VDDF = 2.6 V 0.1 V, VFLASH = 5.0 V 0.25 V, TA = TL to TH, TB = TL to TH) Table G-7. CENSOR Cell Program and Erase Characteristics Value Symbol Meaning Minimum 1 2 Units Typical1 Maximum TCLEAR CENSOR Bit Clear Time2 13 60 s TSET CENSOR Bit Set Time 115 250 s Typical set and clear times assume nominal supply values and 25 C. Clear time specification does not include pre-set operation. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-11 66-MHz Electrical Characteristics Table G-8. Flash Module Life Symbol Array P/E Cycles1 CENSOR Set/Clear Cycles2 Meaning Value Maximum number of Program/Erase cycles per block to guarantee data retention. Minimum number of Program/Erase cycles per bit before failure. Array and CENSOR Data Minimum data retention at an average of 85 C junction temperature. Retention Minimum data retention at an average of 125 C junction temperature. 1,000 100 Min 15 years3 Min 10 years3 1 A Program/Erase cycle is defined as switching the bits from 1 to 0 to 1. A CENSOR Set/Clear cycle is defined as switching the bits from 1 to 0 to 1. 3 Maximum total time @ 150 C junction temperature 1 year. 2 G.9 Power-Up/Down Sequencing The supply symbols used in this section are described in Table G-9. . Table G-9. Power Supply Pin Groups Symbol VDDH (High Voltage Supply Group) Types of Power Pins Supply to the 5-V pads for output driver (VDDH) Supply to the analog (QADC64E) circuitry (VDDA) High voltage supply to the Flash module (VFLASH)1 VDDL (Low Voltage Supply Pins) Supply to low voltage pad drivers (QVDDL, NVDDL) Supply to all low voltage internal logic (VDD) Supply to low voltage Flash circuitry (VDDF)1 Supply to system PLL VDDKA (Low Voltage Keep-Alive Supply Pins2 1 2 Supply to IRAMSTBY Supply to oscillator and other circuitry for keep-alive functions (KAPWR). These power supplies are only available on the MPC563 and MPC564. Any supply in the VDDKA group can be powered with the VDDL if the function which it supplies is not required during "Keep-alive." MPC561/MPC563 Reference Manual, Rev. 1.2 G-12 Freescale Semiconductor 66-MHz Electrical Characteristics There are two power-up/down options. Choosing which one is required for an application will depend upon circuitry connected to 2.6-V compliant pins and dual 2.6-V/5-V compliant pins. Power-up/down option A is required if 2.6-V compliant pins and dual 2.6-V/5-V compliant pins are connected to the 5-V supply with a pull-up resistor or driven by 5-V logic during power-up/down. In applications for which this scenario is not true the power-up/down option B may be implemented. Option B is less stringent and easier to ensure over a variety of applications. Refer to Table 2-1 for a list of 2.6 V and dual 2.6V/5 V compliant pins. The power consumption during power-up/down sequencing will stay below the operating power consumption specifications when following these guidelines. NOTE: The VDDH ramp voltage should be kept below 50V/ms and the VDDL ramp rate less that 25V/ms. G.9.1 Power-Up/Down Option A The Option A power-up sequence (excluding VDDKA) is 1. VDDH VDDL + 3.1 V (VDDH cannot lead VDDL by more than 3.1 V) 2. VDDH VDDL - 0.5 V (VDDH cannot lag VDDL by more than 0.5 V) The first step in the sequence is required is due to gate-to-drain stress limits for transistors in the pads of 2.6-V compliant pins and dual 2.6-V/5-V compliant pins. Damage can occur if gate-to-drain voltage potential is greater than 3.1 V. This is only a concern at power-up/down. The second step in the sequence is required is due to ESD diodes in the pad logic for dual 2.6-V/5-V compliant pins and 2.6-V pins. The diodes are forward biased when VDDL is greater than VDDH and will start to conduct current. Figure G-1 illustrates the power-up sequence if no keep-alive supply is required. Figure G-2 illustrates the power-up sequence if a keep-alive supply is required. The keep-alive supply should be powered-up at the same instant or before both the high voltage and low voltage supplies are powered-up. VDDH 3.1-V lead VDDL 0.5-V lag VDDH cannot lead VDDL by more than 3.1 V VDDH cannot lag VDDL by more than 0.5 V Figure G-1. Option A Power-Up Sequence Without Keep-Alive Supply MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-13 66-MHz Electrical Characteristics VDDH 3.1-V lead VDDL VDDKA 0.5-V lag VDDH cannot lead VDDL by more than 3.1 V VDDH cannot lag VDDL by more than 0.5 V Figure G-2. Option A Power-Up Sequence With Keep-Alive Supply The option A power-down sequence (excluding VDDKA) is 1. VDDH VDDL + 3.1 V (VDDH cannot lag VDDL by more than 3.1 V) 2. VDDH VDDL - 0.5 V (VDDH cannot lead VDDL by more than 0.5 V) Figure G-3 illustrates the power-down sequence if no keep-alive supply is required. VDDH VDDL 3.1-V Max 0.5-V Max Ramp down rates may differ with load, so care should be taken maintain VDDH with respect to VDDL. VDDH cannot lag VDDL by more than 3.1 V. VDDH VDDL - 0.5 V (VDDH cannot lead VDDL by more than 0.5 V.) Figure G-3. Option A Power-Down Sequence Without Keep-Alive Supply MPC561/MPC563 Reference Manual, Rev. 1.2 G-14 Freescale Semiconductor 66-MHz Electrical Characteristics Figure G-4 illustrates the power-down sequence if a keep-alive supply is required. VDDH VDDL VDDKA 0.5-V Max 3.1-V Max Ramp down rates may differ with load. VDDH cannot lag VDDL by more than 3.1 V. VDDH VDDL - 0.5 V (VDDH cannot lead VDDL by more than 0.5 V.) Figure G-4. Option A Power-Down Sequence With Keep-Alive Supply G.9.2 Power-Up/Down Option B A less stringent power-up sequence may be implemented if 2.6-V compliant pins and dual 2.6-V/5-V compliant pins are NOT connected to the 5-V supply with a pull-up resistor or driven by 5-V logic during power-up/down. The option B power-up sequence (excluding VDDKA) is: 1. VDDH > VDDL - 0.5 V (VDDH cannot lag VDDL by more than 0.5 V) Thus the VDDH supply group can be fully powered-up prior to power-up of the VDDL supply group, with no adverse affects to the device. The requirement that VDDH cannot lag VDDL by more than 0.5 V is due to ESD diodes in the pad logic for dual 2.6-V/5-V compliant pins and 2.6-V pins. The diodes are forward biased when VDDL is greater than VDDH and will start to conduct current. Figure G-5 illustrates the power-up sequence if no keep-alive supply is required. Figure G-6 illustrates the power-up sequence if a keep-alive supply is required. The keep-alive supply should be powered-up at the same time or before both the high voltage and low voltage supplies are powered-up. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-15 66-MHz Electrical Characteristics VDDH VDDL 0.5-V lag VDDH cannot lag VDDL by more than 0.5 V Figure G-5. Option B Power-Up Sequence Without Keep-Alive Supply VDDH VDDL VDDKA 0.5-V lag VDDH cannot lag VDDL by more than 0.5 V Figure G-6. Option B Power-Up Sequence With Keep-Alive Supply The option B power-down sequence (excluding VDDKA) is: 1. The VDDL supply group can be fully powered-down prior to power-down of the VDDH supply group, with no adverse affects to the device. For power-down, the low voltage supply should come down before the high voltage supply, although with varying loads, the high voltage may actually get ahead. Figure G-7 illustrates the power-down sequence if no keep-alive supply is required. Figure G-8 illustrates the power-down sequence if a keep-alive supply is required. MPC561/MPC563 Reference Manual, Rev. 1.2 G-16 Freescale Semiconductor 66-MHz Electrical Characteristics VDDH VDDH 5.25V VDDL 0.5-V lag VDDH cannot lead VDDL by more than 0.5V Ramp down rates may differ with load. Figure G-7. Option B Power-Down Sequence Without Keep-Alive Supply VDDH VDDL VDDKAP 0.5-V lag Ramp down rates may differ with load. VDDH cannot lead VDDL by more than 0.5V Figure G-8. Option B Power-Down Sequence with Keep-Alive Supply G.10 Issues Regarding Power Sequence G.10.1 Application of PORESET or HRESET When VDDH is rising and VDDL is at 0.0 V, as VDDH reaches 1.6 V, all 5 V drivers are tristated. Before VDDH reaches 1.6V, all 5 V outputs are unknown. If VDDL is rising and VDDH is at least 3.1V greater than VDDL, then the 5 V drivers can come out of tristate when VDDL reaches 1.1V, and the 2.6 V drivers can start driving when VDDL reaches 0.5 V. For these reasons, the PORESET or HRESET signal must be asserted during power-up before VDDL is above 0.5 V. If the PORESET or HRESET signal is not asserted before this condition, there is a possibility of disturbing the programmed state of the flash. In addition, the state of the pads are indeterminant until PORESET or HRESET propagates through the device to initialize all circuitry. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-17 66-MHz Electrical Characteristics G.10.2 Keep-Alive RAM PORESET or HRESET must be asserted during power-down prior to any supply dropping out of specified operating conditions. An additional constraint is placed on PORESET assertion since it is an asynchronous input. To assure that the assertion of PORESET does not potentially cause stores to keep-alive RAM to be corrupted (store single or store multiple) or non-coherent (store multiple), either of the following solutions is recommended: * Assert HRESET at least 0.5 s prior to when PORESET is asserted. * Assert IRQ0 (non-maskable interrupt) at least 0.5 s prior to when PORESET is asserted. The service routine for IRQ0 should not perform any writes to keep-alive RAM. The amount of delay that should be added to PORESET assertion is dependent upon the frequency of operation and the maximum number of store multiples executed that are required to be coherent. If store multiples of more than 28 registers are needed and if the frequency of operation is lower that 66 MHz, the delay added to PORESET assertion will need to be greater than 0.5 s. In addition, if KAPWR features are being used, PORESET should not be driven low while the VDDH and VDDL supplies are off. G.11 AC Timing Figure G-9 displays generic examples of MPC561/MPC563 timing. Specific timing diagrams are shown in Figure G-10 through Figure G-35. MPC561/MPC563 Reference Manual, Rev. 1.2 G-18 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT VDD/2 VDD/2 VDD/2 A B 5-V OUTPUTS VOH VOL VOH VOL A B 5-V OUTPUTS VOH VOH VOL VOL A B VDD/2 ADDR/DATA/CTRL A B ADDR/DATA/CTRL OUTPUTS VDD/2 C VIH VIL 5-V INPUTS D VIH VIL C VIH VIL 5-V INPUTS C ADDR/DATA/CTRL D VIH VIL D VDD/2 VDD/2 C ADDR/DATA/CTRL INPUTS VDD/2 A. Maximum Output Delay Specification B. Minimum Output Hold Time D VDDVDD/2 C. Minimum input Setup Time Specification D. Minimum input Hold Time Specification Figure G-9. Generic Timing Examples MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-19 66-MHz Electrical Characteristics Table G-10. Bus Operation Timing Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 66 MHz Characteristic Min Max -- 1 CLKOUT Period (TC) 15.15 1a ENGCLK Frequency 5 V - EECLK = 01 2. 6 V - EECLK = 00 -- 10 33 Uni t ns MH z 2 Clock pulse width low 7.575 -2% 7.575 + 2% ns 3 Clock pulse width high 7.575 - 2% 7.575 + 2% ns 4 CLKOUT rise time ABUS/DBUS rise time -- 3.5 3.0 ns 5 CLKOUT fall time ABUS/DBUS fall time -- 3.5 3.0 ns 6 N.A. -- -- -- 7 CLKOUT to Signal Invalid (Hold Time) ADDR[8:31] RD/WR BURST D[0:31] 1.8 -- ns 2.0 -- ns 2.15 -- ns Slave mode CLKOUT to Signal Invalid D[0:31] 1.8 -- ns CLKOUT to Signal Valid ADDR[8:31] RD/WR BURST D[0:31]3 5.95 9.8 ns 7a 7b 7c 8 CLKOUT to Signal Invalid: (Hold Time) TSIZ[0:1] RSV AT[0:3] BDIP PTR RETRY CLKOUT to Signal Invalid (Hold Time)1 BR BG FRZ VFLS[0:1] VF[0:2] IWP(0:2] LWP[0:1] STS2 MPC561/MPC563 Reference Manual, Rev. 1.2 G-20 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 66 MHz Characteristic 8a 8b Uni t Min Max CLKOUT to Signal Valid TSIZ[0:1] RSV AT[0:3] BDIP PTR RETRY 4.65 8.3 ns CLKOUT to Signal Valid1 BR BG VFLS[0:1] VF[0:2] IWP[0:2] FRZ LWP[0:1] STS valid. 4.55 8.75 ns 8c Slave Mode CLKOUT to Signal Valid D[0:31] -- 8.3 ns 8d CLKOUT to Data Pre-discharge time4 -- -- ns 8e CLKOUT to Data Pre-discharge start4 -- -- ns 9 CLKOUT to High Z ADDR[8:31] RD/WR BURST D[0:31] TSIZ[0:1] RSV AT[0:3] PTR RETRY 5.95 9.8 ns 3.33 7.9 ns 10 CLKOUT to TS, BB assertion 10a CLKOUT to TA, BI assertion (when driven by the Memory Controller) -- 7.85 ns 10b CLKOUT to RETRY assertion (when driven by the Memory Controller) -- 6.4 ns 11 CLKOUT to TS, BB negation 2.78 5.95 ns 11a CLKOUT to TA, BI negation (when driven by the Memory Controller) 0.28 2.8 ns 11b CLKOUT to RETRY negation (when driven by the Memory Controller) 0 11 ns 12 CLKOUT to TS, BB High Z 3.85 13.6 ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-21 66-MHz Electrical Characteristics Table G-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 66 MHz Characteristic Min Max Uni t 12a CLKOUT to TA, BI High Z (when driven by the Memory Controller) -- 12.75 ns 13 CLKOUT to TEA assertion -- 5.85 ns 14 CLKOUT to TEA High Z -- 12.75 ns 15 Input Valid to CLKOUT (Setup Time) TA TEA BI2 6.35 -- ns Input Valid to CLKOUT (Setup Time) KR CR RETRY 6.6 -- ns Input Valid to CLKOUT (Setup Time) BB BG BR1 5.46 -- ns 1 -- ns 1 -- ns 4 -- ns 3 -- ns 15a 15b 16 16a 17 CLKOUT to Signal Invalid (Hold Time) TA TEA BI BB BG BR1, 2 CLKOUT to Signal Invalid (Hold Time) RETRY KR CR Signal Valid to CLKOUT Rising Edge (Setup Time) D[0:31]3 17b Signal Valid to CLKOUT Rising Edge (Short Setup Time, SST = 1) D[0:31]3 18 CLKOUT Rising Edge to Signal Invalid (Hold Time) D[0:31]3 0.5 -- ns 19 CLKOUT Rising Edge to CS asserted -GPCM- ACS = 00 6.1 9.75 ns 19a CLKOUT Falling Edge to CS asserted -GPCM- ACS = 10, TRLX = 0 or 1 -- 4.25 ns MPC561/MPC563 Reference Manual, Rev. 1.2 G-22 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 66 MHz Characteristic 19b CLKOUT Falling Edge to CS asserted -GPCM- ACS = 11, TRLX = 0 or 1 19c CLKOUT Falling Edge to CS asserted -GPCM- ACS = 11, TRLX = 0, EBDF = 1 20 CLKOUT Rising Edge to CS negated -GPCM- Read Access or Write access when CSNT = 0 or write access when CSNT = 1 and ACS = 00 Uni t Min Max 4 9 ns 6.69 12.69 ns 1.55 4.85 ns 21 ADDR[8:31] to CS asserted -GPCM- ACS = 10, TRLX = 0 1.2 -- ns 21a ADDR[8:31] to CS asserted -GPCM- ACS = 11, TRLX = 0 5.1 -- ns 22 CLKOUT Rising Edge to OE, WE[0:3]/BE[0:3] asserted 1 5.45 ns 23 CLKOUT Rising Edge to OE negated 1.45 5.06 ns 24 ADDR[8:31] to CS asserted -GPCM- ACS = 10, TRLX = 1 13.95 -- ns 24a ADDR[8:31] to CS asserted -GPCM- ACS = 11, TRLX = 1 17 -- ns 25 CLKOUT Rising Edge to WE[0:3]/BE[0:3] negated -GPCM-write access CSNT = `0` -- 4.75 ns 25a CLKOUT Falling Edge to WE[0:3]/BE[0:3] negated -GPCM-write access TRLX = `0' or `1', CSNT = `1, EBDF = 0'. 4.5 9.5 ns CLKOUT Falling Edge to CS negated -GPCM-write access TRLX = `0' or `1', CSNT = `1', ACS = `10' or ACS='11', EBDF = 0 4.5 9.5 ns CLKOUT Falling Edge to WE[0:3]/BE[0:3] negated -GPCM-write access TRLX = `0', CSNT = `1, EBDF = 1'. 5.5 12.69 ns CLKOUT Falling Edge to CS negated -GPCM-write access TRLX = `0', CSNT = `1', ACS = `10' or ACS='11', EBDF = 1 6.25 17 ns 25b 25c 25d 26 WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, CSNT = `0' 1.95 -- ns 26a WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, TRLX = `0', CSNT = `1', EBDF = 0 4.85 -- ns 26b CS negated to D[0:31], High Z -GPCM- write access, ACS = `00', TRLX = `0' & CSNT = `0' 1.95 -- ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-23 66-MHz Electrical Characteristics Table G-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 66 MHz Characteristic 26c CS negated to D[0:31], High Z -GPCM- write access, TRLX = `0', CSNT = `1', ACS = `10' or ACS='11', EBDF = 0 26d WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', EBDF = 0 26e CS negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', ACS = `10' or ACS='11', EBDF = 0 26f WE[0:3]/BE[0:3] negated to D[0:31] HighZ -GPCM- write access, TRLX = `0', CSNT = `1', EBDF = 1 26g CS negated to D[0:31] High Z -GPCM- write access, TRLX = `0', CSNT = `1', ACS = `10' or ACS=`11', EBDF = 1 26h WE[0:3]/BE[0:3] negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', EBDF = 1 26i CS negated to D[0:31] High Z -GPCM- write access, TRLX = `1', CSNT = `1', ACS = `10' or ACS='11', EBDF = 1 27 CS, WE[0:3]/BE[0:3] negated to ADDR[8:31] invalid -GPCM- write access5 27a WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX=`0', CSNT = `1'. Uni t Min Max 4.85 -- ns 17 -- ns 17 -- ns 3.2 -- ns 3.2 -- ns 14.65 -- ns 14.65 -- ns 1.2 -- ns 4.85 -- ns 17 -- ns 2.55 -- ns CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='0', CSNT = `1', ACS = 10,ACS = =`11', EBDF = 0 27b WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1'. CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1', ACS = 10,ACS = ='11', EBDF = 0 27c WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='0', CSNT = '1'. CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='0', CSNT = '1', ACS = 10,ACS = ='11', EBDF = 1 MPC561/MPC563 Reference Manual, Rev. 1.2 G-24 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-10. Bus Operation Timing (continued) Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH, 50 pF load unless noted otherwise) 66 MHz Characteristic 27d Uni t Min Max 14.65 -- ns WE[0:3]/BE[0:3] negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1'. CS negated to ADDR[8:31] Invalid -GPCM- write access, TRLX='1', CSNT = '1', ACS = 10,ACS = ='11', EBDF = 1 1 2 3 4 5 28 ADDR[8:31], TSIZ[0:1], RD/WR, BURST, valid to CLKOUT Rising Edge. (Slave mode Setup Time) 3.5 -- ns 28a Slave Mode D[0:31] valid to CLKOUT Rising Edge 3.7 -- ns 29 TS valid to CLKOUT Rising Edge (Setup Time) 2 -- ns 30 CLKOUT Rising Edge to TS Valid (Hold Time). 3.6 -- ns The timing for BR output is relevant when the deviceMPC561/MPC563 is selected to work with external bus arbiter. The timing for BG output is relevant when the MPC561/MPC563 is selected to work with internal bus arbiter. The setup times required for TA, TEA, and BI are relevant only when they are supplied by the external device (and not the memory controller). The maximum value of spec 8 for DATA[0:31] pins must be extended by 1.1 ns if the pins have been precharged to greater than VDDL. This is the case if an external slave device on the bus is running at the max. value of VDATAPC. This is currently specified at 3.1 V. The 1.1 ns addition to spec 8 reflects the expected timing degradation for 3.1 V. The device may be used without limitation in conjuction with 2.6 V external memories. Pre-discharge function is not available for 66-MHz operation. The timing 27 refers to CS when ACS = `00' and to WE[0:3]/BE[0:3] when CSNT = `0'. NOTE The D[0:31] input timings 17 and 18 refer to the rising edge of the CLKOUT in which the TA input signal is asserted. CLKOUT 4 3 2 5 1 Figure G-10. CLKOUT Pin Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-25 66-MHz Electrical Characteristics CLKOUT 8 9 7 OUTPUT SIGNALS 8a 9 7a OUTPUT SIGNALS 8b 7b OUTPUT SIGNALS Figure G-11. Synchronous Output Signals Timing MPC561/MPC563 Reference Manual, Rev. 1.2 G-26 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 12 10 11 TS, BB 12a 10a 11a TA, BI 13 14 TEA Figure G-12. Synchronous Active Pull-Up And Open Drain Outputs Signals Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-27 66-MHz Electrical Characteristics CLKOUT 15 16 TA, BI 15a 16a TEA, KR, RETRY, CR 15b 16 BB, BG, BR Figure G-13. Synchronous Input Signals Timing MPC561/MPC563 Reference Manual, Rev. 1.2 G-28 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 15a 16 TA 17 18 DATA[0:31] Figure G-14. Input Data Timing In Normal Case MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-29 66-MHz Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19 20 CSx 22 23 OE 25 WE[0:3]/BE[0:3] 17 DATA[0:31] 18 Figure G-15. External Bus Read Timing (GPCM Controlled - ACS = `00') MPC561/MPC563 Reference Manual, Rev. 1.2 G-30 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19a 20 CSx 21 OE 23 22 17 DATA[0:31] 18 Figure G-16. External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `10') MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-31 66-MHz Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19b CSx 20 19c 21a OE 23 22 17 DATA[0:31] 18 Figure G-17. External Bus Read Timing (GPCM Controlled - TRLX = `0' ACS = `11') MPC561/MPC563 Reference Manual, Rev. 1.2 G-32 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 10 11 TS 8 ADDR[8:31] 19a 20 CSx 24 OE 23 24a 19b 19c 17 DATA[0:31] 18 Figure G-18. External Bus Read Timing (GPCM Controlled - TRLX = `1', ACS = `10', ACS = `11') MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-33 66-MHz Electrical Characteristics CLKOUT 10 TS 11 9 8 ADDR[8:31] Figure G-19. Address Show Cycle Bus Timing MPC561/MPC563 Reference Manual, Rev. 1.2 G-34 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 10 11 TS 8 27 ADDR[8:31] CSx WE[0:3]/BE[0:3] 8 DATA[0:31] 9 Figure G-20. Address and Data Show Cycle Bus Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-35 66-MHz Electrical Characteristics CLKOUT 10 11 TS 8 27 ADDR[8:31] 19 20 CSx 26b 22 25 WE[0:3]/BE[0:3] 23 OE 26 8 DATA[0:31] 9 Figure G-21. External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `0') MPC561/MPC563 Reference Manual, Rev. 1.2 G-36 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 10 11 TS 27c 8 27a 19 20 ADDR[8:31] CSx 25b 25d 22 26c 26g WE[0:3]/BE[0:3] 23 26a 26g OE 25a 25c 8 D[0:31] 9 Figure G-22. External Bus Write Timing (GPCM Controlled - TRLX = `0', CSNT = `1') MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-37 66-MHz Electrical Characteristics CLKOUT 10 11 TS 27d 27b 8 ADDR[8:31] 19 20 CSx 25b 25d 22 26i 26e WE[0:3]/BE[0:3] 23 26h 26d OE 26b 25a 25c 8 DATA[0:31] 9 Figure G-23. External Bus Write Timing (GPCM Controlled - TRLX = `1', CSNT = `1') MPC561/MPC563 Reference Manual, Rev. 1.2 G-38 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 30 29 TS 28 ADDR[8:31], TSIZ[0:1], RD/WR, BURST, BDIP 12a 10a 11a TA, BI 13 14 TEA 8 DATA[0:31] 9 10b 11b RETRY Figure G-24. External Master Read From Internal Registers Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-39 66-MHz Electrical Characteristics CLKOUT 30 29 TS 28 ADDR[8:31], TSIZ[0:1], RD/WR, BURST 12a 10a 11a TA, BI 13 14 TEA, 28a DATA[0:31] 18 10b 11b RETRY Figure G-25. External Master Write To Internal Registers Timing Table G-11. Interrupt Timing Note: (TA = TL to TH) 66 MHz Characteristic Unit Min Max 33 IRQx Pulse width Low TC -- ns 34 IRQx Pulse width High; Between Level IRQ TC -- ns 35 IRQx Edge to Edge time 4 * TC -- ns MPC561/MPC563 Reference Manual, Rev. 1.2 G-40 Freescale Semiconductor 66-MHz Electrical Characteristics IRQx 35 34 33 Level IRQ Edge IRQ Figure G-26. Interrupt Detection Timing for External Edge Sensitive Lines G.11.1 Debug Port Timing Table G-12. Debug Port Timing Note: (TA = TL to TH) 66 MHz Characteristic Unit Min Max 36 DSCK Cycle Time 30.30 -- ns 37 DSCK Clock Pulse Width 15.15 -- ns 38 DSCK Rise and Fall Times 0 7 ns 39 DSDI Input Data Setup Time 15 -- ns 40 DSDI Data Hold Time 5 -- ns 41 DSCK low to DSDO Data Valid 0 18 ns 42 DSCK low to DSDO Invalid 0 -- ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-41 66-MHz Electrical Characteristics DSCK 36 37 37 36 38 38 Figure G-27. Debug Port Clock Input Timing DSCK 39 40 DSDI 41 42 DSDO Figure G-28. Debug Port Timings MPC561/MPC563 Reference Manual, Rev. 1.2 G-42 Freescale Semiconductor 66-MHz Electrical Characteristics G.12 READI Electrical Characteristics The AC electrical characteristics (56 MHz) are described in the following tables and figures Table G-13. READI AC Electrical Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH 50 pF load unless noted otherwise) Number Characteristic Min Max Unit 17.9 -- ns 1 MCKO Cycle Time (Tco) 2 MCKO Duty Cycle 40 60 % 3 Output Rise and Fall Times 0 3 ns 4 MCKO low to MDO Data Valid -1.79 3.58 ns 5 MCKI Cycle Time (Tci) 35.6 -- ns 6 MCKI Duty Cycle 40 60 % 7 Input Rise and Fall Times 0 3 ns 8 MDI, EVTI, MSEI Setup Time 7.12 -- ns 9 MDI Hold TIme 3.56 -- ns 10 RSTI Pulse Width 71.6 -- ns 11 MCKO low to MSEO Valid -1.79 3.58 ns 12 EVTI Pulse Width 71.6 -- ns 13 EVTI to RSTI Setup (at reset only) (4.0) x TC -- ns 14 EVTI to RSTI Hold (at reset only) (4.0) x TC -- ns MCKI 8 9 Input Data Valid MDI, EVTI,MSEI Figure G-29. Auxiliary Port Data Input Timing Diagram MCKO MDO, MSEO 4 11 Output Data Valid Figure G-30. Auxiliary Port Data Output Timing Diagram MDO and MSEO data is held valid until the next MCKO low transition. When RSTI is asserted, EVTI is used to enable or disable the auxiliary port. Because MCKO probably is not active at this point, the timing must be based on the system clock. Since the system clock is not realized on the connector, its value must be known by the tool. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-43 66-MHz Electrical Characteristics RSTI 14 13 EVTI Figure G-31. Enable Auxiliary From RSTI RSTI 13 14 EVTI Figure G-32. Disable Auxiliary From RSTI G.13 RESET Timing Table G-14. RESET Timing Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) 66 MHz Characteristic Unit Min Max 43 CLKOUT to HRESET high impedance -- 20 ns 44 CLKOUT to SRESET high impedance -- 20 ns 45 RSTCONF pulse width 257 -- ns 46 Configuration Data to HRESET rising edge Setup Time 231 -- ns 47 Configuration Data to RSTCONF rising edge set up time 231 -- ns 48 Configuration Data hold time after RSTCONF negation 0 -- ns 49 Configuration Data hold time after HRESET negation 0 -- ns 24 -- 1 49a RSTCONF hold time after HRESET negation 50 HRESET and RSTCONF asserted to Data out drive 25 -- ns 51 RSTCONF negated to Data out high impedance 25 -- ns 52 CLKOUT of last rising edge before chip tristates HRESET to Data out high impedance 25 -- ns 53 DSDI, DSCK set up 46 -- ns 54 DSDI, DSCK hold time 0 -- ns 55 SRESET negated to CLKOUT rising edge for DSDI and DSCK sample 121 -- ns 55a HRESET, SRESET, PORESET pulse width 2 100 -- ns MPC561/MPC563 Reference Manual, Rev. 1.2 G-44 Freescale Semiconductor 66-MHz Electrical Characteristics Weak pull-ups and pull-downs used for Reset timing will comply with the 130 A mode select current outlined in Table G.6 on page G-7 The system requires two clocks of hold time on RSTCONF/TEXP after negation of HRESET. The simplest way to insure meeting this requirement in systems that require the use of the TEXP function, is to connect RSTCONF/TEXP to SRESET. 2 HRESET, SRESET and PORESET have a glitch detector to ensure that spikes less than 20 ns are rejected. The internal HRESET, SRESET and PORESET will assert only if these signals are asserted for more than 100 ns 1 HRESET 45 49a RSTCONF 49 46 48 DATA[0:31] (IN) 47 Figure G-33. Reset Timing - Configuration from Data Bus MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-45 66-MHz Electrical Characteristics CLKOUT 43 55a HRESET RSTCONF 51 50 52 DATA[0:31] (OUT) (Weak) Figure G-34. Reset Timing - Data Bus Weak Drive During Configuration MPC561/MPC563 Reference Manual, Rev. 1.2 G-46 Freescale Semiconductor 66-MHz Electrical Characteristics CLKOUT 44 55 SRESET 53 53 54 54 DSCK, DSDI Figure G-35. Reset Timing - Debug Port Configuration G.14 IEEE 1149.1 Electrical Characteristics Table G-15. JTAG Timing Note: (TA = TL to TH) 10 MHz1 Characteristic Min Max Unit 56 TCK Cycle Time1 (JTAG clock) 100 -- ns 57 TCK Clock Pulse Width Measured at VDD/2 50 -- ns 58 TCK Rise and Fall Times 0 10 ns 59 TMS, TDI Data Setup Time 5 ns 60 TMS, TDI Data Hold Time 25 ns 61 TCK Low to TDO Data Valid 62 TCK Low to TDO Data Invalid 63 TCK Low to TDO High Impedance 20 ns 66 TCK Falling Edge to Output Valid 50 ns 67 TCK Falling Edge to Output Valid out of High Impedance 50 ns 68 TCK Falling Edge to Output High Impedance 50 ns 69 Boundary Scan Input Valid to TCK Rising Edge 50 ns 70 TCK Rising Edge to Boundary Scan Input Invalid 50 ns 20 0 ns ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-47 66-MHz Electrical Characteristics 1 JTAG timing (TCK) is only tested at 10 MHz. TCK is the operating clock of the MPC561/MPC563 in JTAG mode. TCK 57 56 57 58 Figure G-36. JTAG Test Clock Input Timing TCK 59 60 TMS, TDI 61 63 62 TDO Figure G-37. JTAG Test Access Port Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 G-48 Freescale Semiconductor 66-MHz Electrical Characteristics TCK 66 68 OUTPUT SIGNALS 67 OUTPUT SIGNALS 70 69 OUTPUT SIGNALS Figure G-38. Boundary Scan (JTAG) Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-49 66-MHz Electrical Characteristics G.15 QADC64E Electrical Characteristics Table G-16. QADC64E Conversion Characteristics Note: (VDD = 2.6 V 0.1 V, VDDH = 5.0 V 0.25 V, TA = TL to TH) Num Parameter 97 QADC Clock (QCLK) Frequency1 98 Conversion Cycles2 Legacy mode: QADCMCR[FLIP] = 0 Enhanced mode: QADCMCR[FLIP] = 1 99 Symbol Min Max Units FQCLK 0.5 3.0 MHz CC CC 12 14 28 20 QCLK cycles QCLK cycles 14 s s 10 s s Conversion Time FQCLK = 2.0 MHz1 Legacy mode: QADCMCR[FLIP] = 0 Min = CCW[IST] =0b00, CCW[BYP] = 0 Max = CCW[IST] =0b11, CCW[BYP] = 1 6.0 TCONV Enhanced mode: QADCMCR[FLIP] = 1 Min = CCW[IST] =0b0 Max = CCW[IST] =0b1 5 6 7 s Resolution3 -- 5 -- mV Absolute (total unadjusted) error4, 5, 6, 7 FQCLK = 2.0MHz3, 2 clock input sample time AE -2 2 Counts -7.8 3.5 mV m mA 102 8, 9, 10, 11 Absolute (total unadjusted) error FQCLK = 2.0MHz3, 2 clock input sample time AEALT 104 DC Disruptive Input Injection Current12, 13, 14, 15, 16 IINJ17 IINJ18 -319 -1 3 1 105 Current Coupling Ratio20 PQA PQB K -- -- 8x10 -5 8x10 -5 107a 4 10 101 107 3 -- Stop Mode Recovery Time 106 2 TSR 100 102a 1 7.0 Incremental error due to injection current All channels have same 10K < Rs <100k Channel under test has Rs=10K, IINJ=+3mA Source impedance at input 21 Incremental capacitance during Sampling 22 EINJ +1.0 +1.0 Counts Counts RS -- 100 K CSAMP -- 5 pF Conversion characteristics vary with FQCLK rate. Reduced conversion accuracy occurs at max FQCLK rate. The number of conversion cycles is dependent on the IST bit in the CCW register. At VRH - VRL = 5.12 V, one count = 5 mV. Accuracy tested and guaranteed at VRH - VRL = 5.0 V 0.25 V This parameter is periodically sampled rather than 100% tested. Absolute error includes 1/2 count (~2.5 mV) of inherent quantization error and circuit (differential, integral, and offset) error. Specification assumes that adequate low-pass filtering is present on analog input pins -- capacitive filter with 0.01 F to 0.1 F capacitor between analog input and analog ground, typical source isolation impedance of 10 K. Input signals with large slew rates or high frequency noise components cannot be converted accurately. These signals may affect the conversion accuracy of other channels. MPC561/MPC563 Reference Manual, Rev. 1.2 G-50 Freescale Semiconductor 66-MHz Electrical Characteristics 8 Accuracy tested and guaranteed at VARH - VRL = 1.0V to 0.75 x VDDA V. See Specification 52 in Table G-4 on page G-7. 9 This parameter is periodically sampled rather than 100% tested. 10 Absolute error includes 1/2 count (~2.5 mV) of inherent quantization error and circuit (differential, integral, and offset) error. Specification assumes that adequate low-pass filtering is present on analog input pins -- capacitive filter with 0.01 F to 0.1 F capacitor between analog input and analog ground, typical source isolation impedance of 10 K. 11 Input signals with large slew rates or high frequency noise components cannot be converted accurately. These signals may affect the conversion accuracy of other channels. 12 Below disruptive current conditions, the channel being stressed has conversion values of 0x3FF for analog inputs greater than VRH and 0x000 for values less than VRL. This assumes that VRH <= VDDA and VRL >= VSSA due to the presence of the sample amplifier. Other channels are not affected by non-disruptive conditions. 13 Exceeding limit may cause conversion error on stressed channels and on unstressed channels. Transitions within the limit do not affect device reliability or cause permanent damage. 14 Input must be current limited to the value specified. To determine the value of the required current-limiting resistor, calculate resistance values using VPOSCLAMP = (the lower of VDDA or VDDH) + 0.3 V and VNEGCLAMP = - 0.3 V, then use the larger of the calculated values. The diode drop voltage is a function of current and varies approximately 0.4 to 0.8 V over temperature 15 This parameter is periodically sampled rather 100% tested. 16 Derate linearly to 0.3 mA if VDDH - VDDA = 1 V. This specification is preliminary and may change after further characterization. 17 Condition applies to two adjacent pins. 18 Condition applies to all analog channels. 19 Note that -ve means current flows out of the pin. 20 Current Coupling Ratio, K, is defined as the ratio of the output current, I OUT, measured on the pin under test to the injection current, IINJ, when both adjacent pins are overstressed with the specified injection current. K = IOUT/ IINJ The input voltage error on the channel under test is calculated as Verr = IINJ * K * RS. 21 Maximum source impedance is application-dependent. Error resulting from pin leakage depends on junction leakage into the pin and on leakage due to charge-sharing with internal capacitance. Error from junction leakage is a function of external source impedance and input leakage current. In the following expression, expected error in result value due to junction leakage is expressed in voltage (VERRJ): VERRJ = RS * IOFF where IOFF is a function of operating temperature. Charge-sharing leakage is a function of input source impedance, conversion rate, change in voltage between successive conversions, and the size of the filtering capacitor used. Error levels are best determined empirically. In general, continuous conversion of the same channel may not be compatible with high source impedance 22 For a maximum sampling error of the input voltage <= 1LSB, then the external filter capacitor, C >= 1024 * C . f SAMP The value of CSAMP in the new design may be reduced. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-51 66-MHz Electrical Characteristics G.16 QSMCM Electrical Characteristics Table G-17. QSPI Timing Note: (TA = TL to TH , 50 pF load on all QSPI pins unless otherwise noted) Num 108 109 Function Operating Frequency1 Master Slave Symbol Min Max Unit -- -- fSYS/4 fSYS/4 Hz Hz 4*TC 4*TC 510 * TC2 -- ns ns 2*TC 2*TC 128 * TC -- ns ns -- 2*TC SCK/2 -- ns ns 2*TC- 60 2*TC- n 255 * TC -- ns ns 17*TC 13*TC 8192 * TC - ns ns 30 20 - ns ns 0 20 - ns ns fOP Cycle Time Master Slave tQCYC Enable Lead Time Master Slave tLEAD Enable Lag Time Master Slave tLAG Clock (SCK) High or Low Time Master Slave3 tSW Sequential Transfer Delay Master Slave (Does Not Require Deselect) tTD Data Setup Time (Inputs) Master Slave tSU Data Hold Time (Inputs) Master Slave tHI 116 Slave Access Time tA -- TC ns 117 Slave MISO Disable Time tDIS -- 2 * TC ns 118 Data Valid (after SCK Edge) Master Slave -- -- 50 50 ns ns 0 0 -- -- ns ns trI -- 1 s tRO tRO tRO -- -- 200 21 300 ns ns ns 110 111 112 113 114 115 119 120 Data Hold Time (Outputs) Master Slave SCK, MOSI, MISO Rise Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 200 pF, SLRC1 bit of PDMCR = "1" (fast) up to 200 pF, SLRC1 bit of PDMCR = "0" (slow) tV tHO MPC561/MPC563 Reference Manual, Rev. 1.2 G-52 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-17. QSPI Timing (continued) Note: (TA = TL to TH , 50 pF load on all QSPI pins unless otherwise noted) Num 120a 121 121a Function PCS[0:1] Rise Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 50 pF, SLRC1 bit of PDMCR = "1" (fast) SCK, MOSI, MISO Fall Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 200 pF, SLRC1 bit of PDMCR = "1" (fast) up to 200 pF, SLRC1 bit of PDMCR = "0" (slow) PCS[0:1] Fall Time Input - Output - up to 50 pF, SLRC1 bit of PDMCR = "0" (slow) up to 50 pF, SLRC1 bit of PDMCR = "1" (fast) Symbol Min Max Unit trI -- 1 s tRO tRO -- -- 50 25 ns ns trI -- 1 s tFO tFO tFO -- -- -- 200 21 300 ns ns ns trI -- 1 s tFO tFO -- -- 50 25 ns ns 1 All AC timing is tested to the 5-V levels outlined in Table G.6 on page G-7 TC is defined to be the clock period. 3 For high time, n = External SCK rise time; for low time, n = External SCK fall time. 2 Table G-18. QSCI Timing Note: (TA = TL to TH , 50 pF load on all SCI pins unless otherwise noted) Note: All AC timing is tested to the 5-V levels outlined in Table G.6 Num 120b 121b Function TXD Rise Time Input - Output - up to 50 pF, SLRC2 bit of PDMCR = "0" (slow) up to 50 pF, SLRC2 bit of PDMCR = "1" (fast) TXD Fall Time Input - Output - up to 50 pF, SLRC2 bit of PDMCR = "0" (slow) up to 50 pF, SLRC2 bit of PDMCR = "1" (fast) Symbol Min Max Unit trI -- 1 s tRO tRO -- -- 50 25 ns ns trI -- 1 s tFO tFO -- -- 50 25 ns ns MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-53 66-MHz Electrical Characteristics 111 110 PCS[0:3] OUTPUT 121 SCK CPOL=0 OUTPUT SCK CPOL=1 OUTPUT 113 120 109 112 120 114 111 115 MISO INPUT MSB IN 121 DATA LSB IN 119 MOSI OUTPUT PD MSB OUT MSB IN 118 DATA PORT DATA LSB OUT 121 MSB OUT 120 Figure G-39. QSPI Timing - Master, CPHA = 0 111 110 PCS[0:3] OUTPUT 121 120 109 SCK CPOL=0 OUTPUT 113 109 112 115 SCK CPOL=1 OUTPUT 112 MISO INPUT MSB IN 121 120 114 DATA 119 MOSI OUTPUT PORT DATA MSB OUT 121 DATA LSB IN MSB 118 LSB OUT PORT DATA MSB 120 Figure G-40. QSPI Timing - Master, CPHA = 1 MPC561/MPC563 Reference Manual, Rev. 1.2 G-54 Freescale Semiconductor 66-MHz Electrical Characteristics 111 110 SS INPUT 121 120 113 SCK CPOL=0 INPUT 109 112 SCK CPOL=1 INPUT 111 MISO OUTPUT 119 MSB OUT 114 MOSI INPUT 121 120 116 119 117 118 DATA LSB OUT 115 MSB IN PD MSB OUT 121 DATA LSB IN MSB IN Figure G-41. QSPI Timing - Slave, CPHA = 0 SS INPUT 109 SCK CPOL=0 INPUT 121 111 120 110 116 MOSI INPUT 120 121 118 118 PD 111 112 SCK CPOL=1 INPUT MISO OUTPUT 113 MSB OUT DATA MSB IN PD 121 115 114 119 117 SLAVE LSB OUT DATA LSB IN Figure G-42. QSPI Timing - Slave, CPHA = 1 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-55 66-MHz Electrical Characteristics G.17 GPIO Electrical Characteristics Table G-19. GPIO Timing Note: (TA = TL to TH) Num 122 Rating Output (PDMCR[SLRC0] = 0), 50 pF Load 1 Output (PDMCR[SLRC0] = 1), 50 pF Load 1 s t RO - 200 ns t RO - 25 ns 1 s - 200 ns Output (PDMCR[SLRC0] = 1), 200 pF Load t RO - 21 ns t RI - 1 ms t RO - 50 ns t RO - 21 ns Input t RI - 1 s Output (SCCR[COM] = 0b11), 25 pF Load t RO - 10 ns Output (SCCR[COM] = 0b00), 50 pF Load t RO - 10 ns t FI - 1 s t FO - 200 ns t FO - 25 ns QGPIO[0:3], MPIO32B[11;12] rise time. Load1 Output (PDMCR[SLRC0] = 1), 50 pF Load SGPIOC[0, 5] rise time.2 SGPIOA[8:31], SGPIOD[0:31], SGPIOC[1:4, 6:7], MPIO32B[0:10, 13:15], A_PQA[0:7], A_PQB[0:7], B_PQA[0:7], B_PQB[0:7] fall time. Input Output (PDMCR[SLRC0] = 0), 50 pF Load1 Output (PDMCR[SLRC0] = 1), 50 pF Load QGPIO[4:6] fall time. t FI - 1 s Load1 t FO - 200 ns Output (PDMCR[SLRC0] = 1), 200 pF Load t FO - 21 ns t FI - 1 ms t FO - 50 ns t FO - 21 ns Input Output (PDMCR[SLRC0] = 0), 50 pF 123b - t RO Output (PDMCR[SLRC0] = 0), 50 pF 123a t RI t RI Input 123 Unit Load1 Output (PDMCR[SLRC0] = 0), 50 pF 122c Max QGPIO[4:6] rise time. Input 122b Min SGPIOA[8:31], SGPIOD[0:31], SGPIOC[1:4, 6:7], MPIO32B[0:10, 13:15], A_PQA[0:7], A_PQB[0:7], B_PQA[0:7], B_PQB[0:7] rise time. Input 122a Symbol QGPIO[0:3], MPIO32B[11;12] fall time. Input Output (PDMCR[SLRC0] = 0), 50 pF Load Output (PDMCR[SLRC0] = 1), 50 pF Load 1 MPC561/MPC563 Reference Manual, Rev. 1.2 G-56 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-19. GPIO Timing (continued) Note: (TA = TL to TH) 123c 1 2 SGPIOC[0, 5] fall time. 1 Input t FI - 1 s Output (SCCR[COM] = 0b11), 25 pF Load t FO - 10 ns Output (SCCR[COM] = 0b00), 50 pF Load t FO - 10 ns For this 5-V output, a drive load of 200 pf is possible but with a rise/fall time of 300 ns. These are 2.6 V GPIO pins. G.18 TPU3 Electrical Characteristics Table G-20. TPU3 Timing Note: (TA = TL to TH) Num 124 125 126 Rating Symbol Min Max Unit 92 3 650 25 ns ns Slew Rate of TPU Output Channel Valid1,2 (SLRC0 of PDMCR = 0, 50 pF to 200 pF load) (SLRC0 of PDMCR = 1, 50 pF load) tCHTOV CLKOUT High to TPU Output Channel Hold tCHTOH 0 15 ns tTIPW 4 -- tcyc TPU Input Channel Pulse Width3 1 AC timing is shown with respect to 10% VDD & 90% VDD levels. Timing not valid for external T2CLK input. 3 t CYC is defined as the CLKOUT Period. 2 CLKOUT 125 124 TPU OUTPUT TPU INPUT 126 TPU I/O TIM Figure G-43. TPU3 Timing MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-57 66-MHz Electrical Characteristics G.19 TouCAN Electrical Characteristics Table G-21. TouCAN Timing1 Note: (TA = TL to TH) Nu m Rating Min Max Unit 127 CNTX0 (Delay from ICLOCK) tCNTX0 19 ns 128 CNRX0 (Set-Up to ICLOCK rise) tCNRX0 0 ns tRI 1 s 50 100 25 ns ns ns 1 s 50 100 25 ns ns ns -- MHz 129 Rise Time Input Output - 50 pF load, SLRC1 bit of PDMCR = "0" 200 pF load, SLRC1 bit of PDMCR = "0" 50 pF, SLRC1 bit of PDMCR = "1" 130 Fall Time Input tRO tFI Output- 50 pF load, SLRC1 bit of PDMCR = "0" 200 pF load, SLRC1 bit of PDMCR = "0" 50 pF, SLRC1 bit of PDMCR = "1" Serial Pins (Maximum frequency) 1 Symbol tFO tF 1 AC timing is shown is tested to the 3-V levels outlined in Table G-4 on page G-7. G.20 PPM Timing Characteristics Table G-22. PPM Timing Note: (TA = TL to TH, 50 pF Load on all Pins) Nu m Symbol Min Max Unit 131 Operating Frequency1 fOP fSYS/256 fSYS/22 Hz 132 Cycle Time tCYC 2*TC 256*TC3 ns 133 PPM Clock (PPM_TCLK) high or low time tSW (tcyc/2) - (tRO + tFI) ns 134 Sequential Transfer Delay tTD 9*tcyc 17*tcyc ns 135 Data Setup Time (Inputs) tSU 30 -- ns 136 Data Hold Time (Inputs) tHI 0 -- ns 137 Data Valid (After PPM_TCLK Edge) tV -- 5 ns tHO TC/2 -- ns 138 Data Hold Time (Outputs) Rating MPC561/MPC563 Reference Manual, Rev. 1.2 G-58 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-22. PPM Timing (continued) Note: (TA = TL to TH, 50 pF Load on all Pins) Nu m Rating 139 Rise Time Input Output - 2.6V PPM pads (PDMCR2[PPMV] = 0) 5V PPM pads (PDMCR2[PPMV] = 1) 140 Fall Time Input Symbol Min Max Unit tHI -- 1 s -- -- 7 15 ns ns -- 1 s -- -- 7 15 ns ns tRO tFI Output - 2.6V PPM pads (PDMCR2[PPMV] = 0) 5V PPM pads (PDMCR2[PPMV] = 1) tFO 1 All AC timing is tested to the 2.6-V levels outlined in Table G.6 on page G-7. Although the PPM permits frequencies of up to fSYS/2, if the 5-V bus is selected the bus frequency should not be run at frequencies above fSYS/8 for EMI/EMC reasons. 3 TC is defined to be the clock period. 2 Following are PPM timing diagrams. PPM_TCLK Figure G-44. PPM_TCLK Timing PPM_TCLK PPM_TSYNC PPM_TX[0:1] Figure G-45. PPM Data Transfer Timing (SPI Mode) G.21 MIOS Timing Characteristics All MIOS output pins are slew rate controlled. Slew rate control circuitry adds 90 ns as minimum to the output timing and 650 ns as a maximum. This slew rate is from 10% VDD to 90% VDD, an additional 100 ns should be added for total 0 to VDD slew rate. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-59 66-MHz Electrical Characteristics Table G-23. MCPSM Timing Characteristics Note: After reset MCPSMSCR_PSL[3:0] is set to 0b0000. Note: VS_PCLK is the MIOS prescaler clock which is distributed to all the counter (e.g., MPWMSM and MMCSM) submodules. Characteristic MCPSM enable to VS_PCLK pulse1 1 Symbol Delay Unit tCPSMC (MCPSMSCR_PSL[3:0]) -1 System Clock Cycles The MCPSM clock prescaler value (MCPSMSCR_PSL[3:0]) should be written to the MCPSMSCR (MCPSM Status/Control Register) before rewriting the MCPSMSCR to set the enable bit (MCPSMSCR_PREN). If this is not done the prescaler will start with the old value in the MCPSMSCR_PSL[3:0] before reloading the new value into the counter. tCPSMC fSYS Prescaler enable bit (PREN) MIOB VS_PCLK Note 1: fSYS is the internal system clock for the IMB3 bus. Note 2: The numbers associated with the fSYS ticks refer to the IMB3 internal state. Note 3: vs_pclk is the MIOS prescaler clock which is distributed around the MIOS to counter modules such as the MMCSM and MPWMSM. Figure G-46. MCPSM Enable to VS_PCLK Pulse Timing Diagram G.21.1 MPWMSM Timing Characteristics Table G-24. MPWMSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max PWMSM output resolution tPWMR --1 2.0 2 PWM output pulse3 tPWMO 2.0 -- tPIN 1 2 MPWMI input pin to MPWMSCR_PIN status set CPSM enable to output set4 tPWMP (MPWMPERR - MPWMPULR + 1) * (256 - MPWMSCR_CP) * MCPSMSCR_PSL + 1 MPWMSM Enable to output set (MIN)5 tPWME (MPWMPERR - MPWMPULR) * (256 - MPWMSCR_CP) * MCPSMSCR_PSL + 3 + (255 - MPWMSCR_CP) * MCPSMSCR_PSL6 MPC561/MPC563 Reference Manual, Rev. 1.2 G-60 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-24. MPWMSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max MPWMSM Enable to output set (MAX)5 tPWME tPWME(MIN) + MCPSMSCR_PSL - 16 Interrupt Flag to output pin reset (period start)7 tFLGP (256 - MPWMSCR_CP) * MCPSMSCR_PSL - 16 1 2 3 4 5 6 7 Minimum output resolution depends on MPWMSM and MCPSM prescaler settings. Maximum resolution is obtained by setting CPSMPSL[3:0] =0x2 and MPWMSCR_CP[7:0] =0xFF. Excluding the case where the output is always "0". With MPWMSM enabled before enabling the MCPSM. Please also see NOTE 1 on the MCPSM timing information. The exact timing from MPWMSM enable to the pin being set depends on the timing of the register write and the MCPSM VS_PCLK. When MCPSMSCR_PSL = 0x0000, this gives a prescale value of 16 and it is 16 which should be used in these calculations. When MCPSMSCR_PSL = 0x0001, the CPSM is inactive. The interrupt is set before the output pin is reset (Signifying the start of a new period). tPWMO min fSYS MPWMO output pin Figure G-47. MPWMSM Minimum Output Pulse Example Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. tPWMP fSYS 3 4 1 Prescaler enable bit (PREN) MIOB VS_PCLK MPWMO output pin Figure G-48. MCPSM Enable to MPWMO Output Pin Rising Edge Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-61 66-MHz Electrical Characteristics tPWME 3 fSYS 4 1 MPWMSCR enable bit MPWMO output pin Figure G-49. MPWMSM Enable To MPWMO Output Pin Rising Edge Timing Diagram tFLGP fSYS MPSMO pin output MPWMSM interrupt flag Figure G-50. MPWMSM Interrupt Flag to MPWMO Output Pin Falling Edge Timing Diagram G.21.2 MMCSM Timing Characteristics Table G-25. MMCSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max MMCSM input pin period tPPER 4 -- MMCSM pin low time tPLO 2 -- MMCSM pin high time tPHI 2 -- clock pin to counter bus increment. tPCCB 1 2 load pin to new counter bus value tPLCB 1 2 clock pin to PINC delay tPINC 1 2 Load pin to PINL delay tPINL 1 2 Counter bus resolution tCBR --1 22 Counter bus overflow reload to interrupt flag tCBFLG 1 MCPSM enable to counter bus increment. tMCMP (256 - MMCSMSCR_CP) * MCPSMSCR_PSL + 2 MPC561/MPC563 Reference Manual, Rev. 1.2 G-62 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-25. MMCSM Timing Characteristics (continued) Note: All delays are in system clock periods. Characteristic Symbol Min Max MMCSM Enable to counter bus increment (MIN) 3 tMCME 4 + MCPSMSCR_PSL* (255 - MMCSMSCR_CP)3 MMCSM Enable to counter bus increment (MAX)3 tMCME 4 + MCPSMSCR_PSL * (255 - MMCSMSCR_CP) + (MCPSMSCR_PSL - 1)3 1 Minimum output resolution depends on MMCSM and MCPSM prescaler settings. Maximum resolution is obtained by setting CPSMPSL[3:0] =0x2 and MMCSMSCR_CP[7:0] =0xFF. 3 The exact timing from MMCSM enable to the pin being set depends on the timing of the MMCSMSCR register write and the MCPSM VS_PCLK. The MMCSM enable is taken to mean the MMCSMSCR_CLS[1:0] being written to 2`b11. 2 tPPER min tPLO min tPHI min fSYS MMCSM pin Figure G-51. MMCSM Minimum Input Pin (Either Load or Clock) Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. tPCCB fSYS MMCSM clock pin Counter bus[15:0] A A+1 Figure G-52. MMCSM Clock Pin to Counter Bus Increment Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-63 66-MHz Electrical Characteristics tPLCB fSYS MMCSM load pin A Counter bus[15:0] B Figure G-53. MMCSM Load Pin to Counter Bus Reload Timing Diagram tCBFLG fSYS Counter bus[15:0] FFFE FFFF MMCSMML[15:0] 5AFE MMCSM interrupt flag 5AFE Figure G-54. MMCSM Counter Bus Reload to Interrupt Flag Setting Timing Diagram tMCME fSYS 1 MMCSMSCR_CLS[1:0] 2 00 3 4 1 11 A Counter bus[15:0] A+1 Figure G-55. MMCSM Prescaler Clock Select to Counter Bus Increment Timing Diagram G.21.3 MDASM Timing Characteristics Table G-26. MDASM Timing Characteristics Note: All delays are in system clock periods. Characteristics Symbol Min Max Input Modes: (IPWM, IPM, IC, DIS) MDASM input pin period tPPER 4 -- MDASM pin low time tPLO 2 -- MPC561/MPC563 Reference Manual, Rev. 1.2 G-64 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-26. MDASM Timing Characteristics (continued) Note: All delays are in system clock periods. Characteristics Symbol Min Max tPHI 2 -- Input capture resolution tCAPR -- 2 Input pin to Counter Bus capture delay tPCAP 1 31 Input pin to interrupt flag delay tPFLG 2 3 Input pin to PIN delay tPIN 1 2 Counter bus resolution tCBR -- 22 MDASM pin high time Output Modes: (OC, OPWM) Output pulse width3 tPULW 2 -- Compare resolution3 tCOMR -- 22 Counter Bus to pin change Counter Bus to interrupt flag set. tCBP 3 tCBFLG 3 1 If the counter bus capture occurs when the counter bus is changing then the capture is delayed one cycle. In situations where the counter bus is stable when the input capture occurs the tPCAP has a maximum delay of two cycles (the one-cycle uncertainty is due to the synchronizer). 2 Maximum resolution is obtained by setting CPSMPSL[3:0] =0x2 and MDASMSCR_CP[7:0] =0xFF. 3 Maximum output resolution and pulse width depends on counter (e.g., MMCSM) and MCPSM prescaler settings. tPPER min tPLO min tPHI min fSYS MDAI input pin Figure G-56. MDASM Minimum Input Pin Timing Diagram NOTE fSYS is the internal system clock for the IMB3 bus. MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-65 66-MHz Electrical Characteristics tPCAP fSYS MDAI input pin MDASMAR[15:0] XXXX Counter bus[15:0] A A Figure G-57. MDASM Input Pin To Counter Bus Capture Timing Diagram tPFLG fSYS MDAI input pin MDASM interrupt flag Figure G-58. MDASM Input Pin to MDASM Interrupt Flag Timing Diagram tPULW min fSYS MDAO output pin Figure G-59. MDASM Minimum Output Pulse Width Timing Diagram tCBP fSYS MDAO output pin Counter bus[15:0] 5AFC MDASMAR[15:0] 5AFE 5AFD 5AFE Figure G-60. Counter Bus to MDASM Output Pin Change Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 G-66 Freescale Semiconductor 66-MHz Electrical Characteristics tCBFLG fSYS MDASM interrupt flag Counter bus[15:0] 5AFC MDASMAR[15:0] 5AFE 5AFD 5AFE Figure G-61. Counter Bus to MDASM Interrupt Flag Setting Timing Diagram G.22 MPIOSM Timing Characteristics Table G-27. MPIOSM Timing Characteristics Note: All delays are in system clock periods. Characteristic Symbol Min Max tPPER --1 -- tPLO --1 -- MPIOSM pin high time tPHI -- 1 -- Input pin to MPIOSM_DR delay tPDR 0 1 --2 -- Input Mode MPIOSM input pin period MPIOSM pin low time Output mode Output pulse width 2 tPULW 1 The minimum input pin period, pin low and pin high times depend on the rate at which the MPIOSM_DR register is polled. 2 The minimum output pulse width depends on how quickly the CPU updates the value inside the MIOPSM_DR register. tPDR fSYS MPIOSM input pins MPIOSM_DR FFA5 005A FFA5 005A Figure G-62. MPIOSM Input Pin to MPIOSM_DR (Data Register) Timing Diagram MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-67 66-MHz Electrical Characteristics NOTE fSYS is the internal system clock for the IMB3 bus. G.23 Pin Summary Table G-28. MPC561/MPC563 Signal Names and Pin Names Signal Name Pin Name Ball Assignment USIU ADDR/SGPIOA[8:31] addr_sgpioa8 AF9 addr_sgpioa9 AF8 addr_sgpioa10 AC6 addr_sgpioa11 Y4 addr_sgpioa12 Y3 addr_sgpioa13 AD7 addr_sgpioa14 AE7 addr_sgpioa15 AF7 addr_sgpioa16 AD8 addr_sgpioa17 AE8 addr_sgpioa18 AC7 addr_sgpioa19 AD9 addr_sgpioa20 AC8 addr_sgpioa21 AD10 addr_sgpioa22 AF10 addr_sgpioa23 AC9 addr_sgpioa24 AD11 addr_sgpioa25 AD12 addr_sgpioa26 AC11 addr_sgpioa27 AF11 addr_sgpioa28 AE11 addr_sgpioa29 AE12 addr_sgpioa30 AE10 addr_sgpioa31 AE9 MPC561/MPC563 Reference Manual, Rev. 1.2 G-68 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment DATA/SGPIOD[0:31] data_sgpiod0 AD13 data_sgpiod1 AC12 data_sgpiod2 AF14 data_sgpiod3 AF13 data_sgpiod4 AF15 data_sgpiod5 AC13 data_sgpiod6 AF16 data_sgpiod7 AC14 data_sgpiod8 AF17 data_sgpiod9 AC16 data_sgpiod10 AF18 data_sgpiod11 AC17 data_sgpiod12 AC18 data_sgpiod13 AD18 data_sgpiod14 AC20 data_sgpiod15 AD19 data_sgpiod16 AD20 data_sgpiod17 AE20 data_sgpiod18 AF20 data_sgpiod19 AE19 data_sgpiod20 AF19 data_sgpiod21 AE18 data_sgpiod22 AD17 data_sgpiod23 AE17 data_sgpiod24 AD16 data_sgpiod25 AE16 data_sgpiod26 AD15 data_sgpiod27 AE15 data_sgpiod28 AD14 data_sgpiod29 AE14 data_sgpiod30 AE13 data_sgpiod31 AF12 irq0_b_sgpioc0_mdo4 P3 IRQ0/SGPIOC0/MDO4 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-69 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment IRQ1/RSV/SGPIOC1 irq1_b_rsv_b_sgpioc1 P4 IRQ2/CR/SGPIOC2/MTS1 irq2_b_cr_b_sgpioc2_mts_b P2 IRQ3/KR/RETRY/SGPIOC irq3_b_kr_b_retry_b_sgpioc3 N1 IRQ4/AT2/SGPIOC4 irq4_b_at2_sgpioc4 P1 IRQ5/SGPIOC5/MODCK1 irq5_b_sgpioc5_modck1 AD21 IRQ[6:7]/MODCK[2:3] irq6_b_modck2 AE21 irq7_b_modck3 Y24 PULL_SEL (input only) pull_sel R26 TSIZ[0:1] tsiz0 V4 tsiz1 W1 RD/WR rd_wr _b V1 BURST burst Y1 BDIP bdip_b W4 TS ts_b W2 TA ta_b W3 TEA tea_b V3 RSTCONF/TEXP rstconf_b_texp Y25 OE oe_b V2 BI/STS bi_b_sts_b Y2 CS[0:3] cs0_b U1 cs1_b U2 cs2_b U3 cs3_b U4 we0_b_we0_b_a0 T1 we0_b_be1_b_at1 T2 we0_b_be2_b_at2 T3 we0_b_be3_b_at3 T4 PORESET/TRST poreset_b_trst_b W25 HRESET hreset_b W23 SRESET sreset_b W24 SGPIOC6/FRZ/PTR sgpioc6_frz_ptr_b N4 SGPIOC7/IRQOUT/LWP0 sgpioc7_irqout_b_lwp0 R1 BG/VF0/LWP1 bg_b_vf0_lwp1 R3 WE[0:3]/BE[0:3]/AT[0:3] MPC561/MPC563 Reference Manual, Rev. 1.2 G-70 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment BR/VF1/IWP2 br_b_vf1_iwp2 R4 BB/VF2/IWP3 bb_b_vf2_iwp3 R2 IWP[0:1]/VFLS[0:1] iwp0_vfls0 N2 iwp1_vfls1 N3 TMS/EVTI tms_evti_b M2 TDI/DSDI/MDI0 tdi_dsdi_mdi0 M1 TCK/DSCK/MCKI tck_dsck_mcki L2 TDO/DSDO/MDO0 tdo_dsdo_mdo0 M4 JCOMP/RSTI jcomp_rsti_b L1 XTAL xtal AD26 EXTAL extal AC26 XFC xfc AA26 CLKOUT clkout U23 EXTCLK extclk V24 ENGCLK/BUCLK engclk_buclk V26 QSMCM PCS0/SS/QGPIO0 pcs0_ss_b_qgpio0 N25 PCS[1:3]/QGPIO[1:3] pcs1_qgpio1 N24 pcs2_qgpio2 N23 pcs3_qgpio3 P26 MISO/QGPIO4 miso_b_qgpio4 P25 MOSI/QGPIO5 mosi_b_qgpio5 P24 SCK/QGPIO6 sck_qgpio6 P23 TXD1/QGPO1 txd1_qgpo1 R25 TXD2/QGPO2/C_CNTX0 txd2_qgpo2_c_cntx0 R24 RXD1/QGPI1 rxd1_qgpi1 R23 RXD2/QGPI2/C_CNRX0 rxd2_qgpi2_c_cnrx0 T26 MIOS14 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-71 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment MDA[11:15] mda11 C20 mda12 D20 mda13 A21 mda14 B21 mda15 C21 mda27 D21 mda28 A22 mda29 B22 mda30 F24 mda31 F25 mpwm0_mdi1 F26 mpwm1_mdo2 G23 MPWM2/PPM_TX1 mpwm2_ppm_tx1 G26 MPWM3/PPM_RX1 mpwm3_ppm_rx1 G25 MPWM16 mpwm16 G24 MPWM17/MDO3 mpwm17_mdo3 H23 MPWM[18:19]/MDO[6:7] mpwm18_mdo6 H24 mpwm19_mdo7 H25 VF0/MPIO32B0/MDO1 vf0_mpio32b0_mdo1 L23 VF1/MPIO32B1/MCKO vf1_mpio32b1_mcko L24 VF2/MPIO32B2/MSEI vf2_mpio32b2_msei_b M24 VFLS0/MPIO32B3/MSEO vfls0_mpio32b3_mseo_b M25 VFLS1/MPIO32B4 vfls1_mpio32b4 M26 MPIO32B5/MDO5 mpio32b5_mdo5 H26 MPIO32B6/MPWM4/MDO6 mpio32b6_mpwm4_mdo6 J23 MPIO32B7/MPWM5 mpio32b7_mpwm5 J24 MPIO32B[8:9]/MPWM[20:21] mpio32b8_mpwm20 J25 mpio32b9_mpwm21 J26 MPIO32B10/PPM_TSYNC mpio32b10_ppm_tsync K25 MPIO32B11/C_CNRX0 mpio32b11_c_cnrx0 K24 MPIO32B12/C_CNTX0 mpio32b12_c_cntx0 K23 MPIO32B13/PPM_TCLK mpio32b13_ppm_tclk K26 MPIO32B14/PPM_RX0 mpio32b14_ppm_rx0 L26 MDA[27:31] MPWM[0:1]/MDI[1:2] MPC561/MPC563 Reference Manual, Rev. 1.2 G-72 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment MPIO32B15/PPM_TX0 mpio32b15_ppm_tx0 L25 TPU_A/TPU_B A_TPUCH[0:15] a_tpuch0 F3 a_tpuch1 C5 a_tpuch2 B5 a_tpuch3 A5 a_tpuch4 C6 a_tpuch5 D6 a_tpuch6 B6 a_tpuch7 A6 a_tpuch8 C7 a_tpuch9 D7 a_tpuch10 B7 a_tpuch11 A7 a_tpuch12 C8 a_tpuch13 D8 a_tpuch14 B8 a_tpuch15 A8 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-73 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment B_TPUCH[0:15] b_tpuch0 K1 b_tpuch1 K2 b_tpuch2 K3 b_tpuch3 K4 b_tpuch4 J1 b_tpuch5 J2 b_tpuch6 J3 b_tpuch7 J4 b_tpuch8 H1 b_tpuch9 H2 b_tpuch10 H3 b_tpuch11 H4 b_tpuch12 G1 b_tpuch13 G2 b_tpuch14 G3 b_tpuch15 G4 A_T2CLK/PCS5 a_t2clk_pcs5 F2 B_T2CLK/PCS4 b_t2clk_pcs4 F1 QADC64E_A/QADC64E_B ETRIG[1:2]/PCS[6:7] etrig1_pcs6 B20 etrig2_pcs7 A20 A_AN0/ANw/PQB0 a_an0_anw_pqb0 C11 A_AN1/ANx/PQB1 a_an1_anx_pqb1 D11 A_AN2/ANy/PQB2 a_an2_any_pqb2 B11 A_AN3/ANz/PQB3 a_an3_anz_pqb3 A11 A_AN[48:51]/PQB[4:7] a_an48_pqb4 C12 a_an49_pqb5 D12 a_an50_pqb6 B12 a_an51_pqb7 A12 a_an52_ma0_pqa0 C13 a_an53_ma1_pqa1 D13 a_an54_ma2_pqa2 B13 A_AN[52:54]/MA[0:2]/PQA[0:2] MPC561/MPC563 Reference Manual, Rev. 1.2 G-74 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment A_AN[55:59]/PQA[3:7] a_an55_pqa3 A13 a_an56_pqa4 A14 a_an57_pqa5 D14 a_an58_pqa6 B14 a_an59_pqa7 C14 B_AN0/ANw/PQB0 b_an0_anw_pqb0 A15 B_AN1/ANx/PQB1 b_an1_anx_pqb1 B15 B_AN2/ANy/PQB2 b_an2_any_pqb2 C15 B_AN3/ANz/PQB3 b_an3_anz_pqb3 D15 B_AN[48:51]/PQB[4:7] b_an48_pqb4 A16 b_an49_pqb5 B16 b_an50_pqb6 C16 b_an51_pqb7 D16 b_an52_ma0_pqa0 A17 b_an53_ma1_pqa1 B17 b_an54_ma2_pqa2 C17 b_an55_pqa3 D17 b_an56_pqa4 A18 b_an57_pqa5 B18 b_an58_pqa6 C18 b_an59_pqa7 D18 B_AN[52:54]/MA[0:2]/PQA[0:2] B_AN[55:59]/PQA[3:7] TouCAN_A/TouCAN_B/TouCAN_C A_CNTX0 a_cntx0 M23 B_CNTX0 b_cntx0 L4 A_CNRX0 a_cnrx0 N26 B_CNRX0 b_cnrx0 L3 UC3F B0EPEE2 boepee T24 EPEE2 epee T23 VFLASH2 vflash U26 VDDF2 vddf U25 VSSF2 vssf U24 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-75 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment Global Power Supplies NVDDL nvddl AC10 AC15 AC19 AC4 AD3 AE2 AF1 C9 D9 Y23 VDD vdd A1 A25 AC22 AD23 AE24 AF25 B2 B24 C23 C3 D22 D4 V23 VDDH vddh AF21 AF5 C19 C22 D19 E1 F23 T25 MPC561/MPC563 Reference Manual, Rev. 1.2 G-76 Freescale Semiconductor 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment VSS vss A19, A2, A23, A24, A26, A3, A4, AA1, AA2, AA23, AA24, AA25, AA3, AB1, AB2, AB24, AB25, AB4, AC1, AC21, AC23, AC25, AC3, AC5, AD2, AD22, AD24, AD4, AD5, AE1, AE22, AE23, AE25, AE3, AE4, AE5, AF2, AF22, AF23, AF24, AF26, AF3, AF4, AF6, B1, B19, B23, B25, B3, B4, C1, C2, C24, C26, C4, D1, D2, D23, D25, D26, D3, D5, E2, E24, E25, E26, E3, E4, L11, L12, L13, L14, L15, L16, M11, M12, M13, M14, M15, M16, N11, N12, N13, N14, N15, N16, P11, P12, P13, P14, P15, P16, R11, R12, R13, R14, R15, R16, T11, T12, T13, T14, T15, T16, V25 KAPWR kapwr W26 IRAMSTBY IRAMSTBY M3 QVDDL qvddl AA4 AB23 AB3 AC2 AC24 AD1 AD25 AD6 AE26 AE6 B26 C25 D24 E23 F4 USIU Power Supplies VDDSYN vddsyn Y26 VSSSYN vsssyn AB26 QADC64E Power Supplies VRH vrh C10 VRL vrl A10 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-77 66-MHz Electrical Characteristics Table G-28. MPC561/MPC563 Signal Names and Pin Names (continued) Signal Name Pin Name Ball Assignment ALTREF altref B10 VDDA vdda D10 VSSA vssa A9 B9 1 2 This pin also included the MDO5 function on the K27S mask set off the MPC561. MPC563 only, no connection on MPC561. G.23.1 Package Diagrams The package for the MPC561/MPC563 is the 388 PBGA (27 x 27 mm, 1.0 mm ball pitch). This package has 352 balls in the perimeter rows and 36 ground balls in the center island for a total of 388 balls. The case outline drawing is 1164-01, as shown in Figure G-63. MPC561/MPC563 Reference Manual, Rev. 1.2 G-78 Freescale Semiconductor 66-MHz Electrical Characteristics 1 NOTE: Top Down View Figure G-63. MPC561/MPC563 Package Footprint (1 of 2) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-79 66-MHz Electrical Characteristics Figure G-64. MPC561/MPC563 Package Footprint (2 of 2) MPC561/MPC563 Reference Manual, Rev. 1.2 G-80 Freescale Semiconductor 66-MHz Electrical Characteristics G.23.1.1 MPC561/MPC563 Ball Map The ball diagram of the MPC561/MPC563 is shown in Figure G-65. A 1 2 3 4 VDD VSS VSS VSS 5 6 7 8 A_TPUCH A_TPUCH3 A_TPUCH7 11 A_TPUCH15 9 10 VSSA VRL 11 12 13 14 15 16 17 18 A_AN3_A A_AN51_P A_AN55_ A_AN56_P B_AN0_AN B_AN48_ B_AN52_M B_AN56_P NZ_PQB3 QB7 PQA3 QA4 W_PQB0 PQB4 A0_PQA0 QA4 19 VSS 21 22 ETRIG2_ PCS7 MDA13 20 MDA28 23 24 25 26 VSS VSS VDD VSS A VDD VSS QVDDL B B VSS VDD VSS VSS A_TPUCH2 A_TPUCH6 A_TPUCH A_TPUCH14 10 VSSA ALTREF A_AN54_ A_AN2_A A_AN50_P MA2_PQ A_AN58_P B_AN1_AN B_AN49_ B_AN53_M B_AN57_P NY_PQB2 QB6 A2 QA6 X_PQB1 PQB5 A1_PQA1 QA5 VSS ETRIG1_ PCS6 MDA14 MDA29 VSS C VSS VSS VDD VSS A_TPUCH1 A_TPUCH4 A_TPUCH A_TPUCH12 8 NVDDL VRH A_AN0_A A_AN52_ NW_PQB A_AN48_P MA0_PQ A_AN59_P B_AN2_AN B_AN50_ B_AN54_M B_AN58_P 0 QB4 A0 QA7 Y_PQB2 PQB6 A2_PQA2 QA6 VDDH MDA11 MDA15 VDDH VDD VSS QVDDL VSS C D VSS VSS VSS VDD A_TPUCH A_TPUCH13 9 NVDDL VDDA A_AN53_ A_AN1_A A_AN49_P MA1_PQ A_AN57_P B_AN3_AN B_AN51_ B_AN55_P B_AN59_P NX_PQB1 QB5 A1 QA5 Z_PQB3 PQB7 QA3 QA7 VDDH MDA12 MDA27 VDD VSS QVDDL VSS VSS D VDDH VSS VSS E E F B_T2CLK_P A_T2CLK_ A_TPUCH CS4 PCS5 0 G B_TPUCH12 VSS A_TPUCH5 VSS QVDDL VSS VSS VSS QVDDL VDDH MDA30 MDA31 MPWM0_MD I1 F MPWM1_MD O2 MPWM16 MPWM3_PP MPWM2_PP M_RX1 M_TX1 G B_TPUCH1 B_TPUCH B_TPUCH1 3 14 5 H B_TPUCH8 B_TPUCH9 Ball Map (As viewed from top, through the package and silicon) B_TPUCH B_TPUCH1 10 1 MPWM17_M MPWM18_MD MPWM19_M DO3 O6 DO7 MPIO32B5_ MDO5 MPIO32B6_ MPIO32B7_MP MPIO32B8_ MPWM4_MD WM5 MPWM20 O6 MPIO32B9_ MPWM21 J MPIO32B12_ MPIO32B11_C MPIO32B10_ MPIO32B13_ C_CNTX0 _CNRX0 PPM_TSYNC PPM_TCLK K VF0_MPIO32 VF1_MPIO32B MPIO32B15_ MPIO32B14_ B0_MDO1 1_MCKO PPM_TX0 PPM_RX0 L J B_TPUCH B_TPUCH4 B_TPUCH5 B_TPUCH7 6 K B_TPUCH0 B_TPUCH1 L JCOMP_RS TCK_DSCK B_CNRX0 B_CNTX0 TI_B _MCKI VSS VSS VSS VSS VSS VSS M TDI_DSDI_ TMS_EVTI IRAMSTBY TDO_DSD MDI0 _B O_MDO0 VSS VSS VSS VSS VSS VSS N IRQ3_B_KR SGPIOC6_ _B_RETRY IWP0_VFL IWP1_VFL FRZ_PTR_ _B_SGPIO S0 S1 B C3 VSS VSS VSS VSS VSS VSS PCS2_QGPI PCS0_SS_B_ PCS1_QGPIO1 O2 QGPIO0 P IRQ2_B_C IRQ0_B_S IRQ1_B_R IRQ4_B_AT R_B_SGPI GPIOC0_ SV_B_SG 2_SGPIOC4 OC2_MDO MDO4 PIOC1 5_MTS VSS VSS VSS VSS VSS VSS SCK_QGPIO MISO_QGPI MOSI_QGPIO5 6 O4 SGPIOC7_I BB_B_VF2 BG_B_VF BR_B_VF1 R RQOUT_B_ _IWP3 0_LWP1 _IWP2 LWP0 VSS VSS VSS VSS VSS VSS RXD1_QGPI TXD2_QGPO2 TXD1_QGPO 1 _C_CNTX0 1 B_TPUCH B_TPUCH3 2 VFLS0_MPIO VF2_MPIO32B VFLS1_MPIO M 32B3_MSEO 32B4 2_MSEI_B _B A_CNRX0 N PCS3_QGPI O3 P PULL-SEL R T EPEE BOEPEE VDDH RXD2_QGPI 2_C_CNRX0 U CS0_B CS1_B CS2_B CS3_B CLKOUT VSSF VDDF VFLASH U V OE_B TEA_B TSIZ0 VDD EXTCLK VSS ENGCLK_BU CLK V W TSIZ1 TS_B TA_B BDIP_B SRESET_B PORESET_B _TRST_B KAPWR W Y BI_B_STS_ ADDR_SG ADDR_SG B PIOA12 PIOA11 T WE_B_AT WE_B_AT WE_B_AT0 WE_B_AT1 2 3 A_CNTX0 H RD_WR_B BURST_B AA VSS AB AC AD VSS VSS VSS VSS VSS VSS HRESET_B NVDDL VSS VSS QVDDL VSS VSS VSS QVDDL VSS VSS QVDDL VSS NVDDL VSS QVDDL VSS NVDDL VSS VSS ADDR_SGP ADDR_SG ADDR_SGPI ADDR_SG IOA10 PIOA18 OA20 PIOA23 NVDDL ADDR_S DATA_SG DATA_SG DATA_SG GPIOA26 PIOD1 PIOD5 PIOD7 NVDDL DATA_SG DATA_SGP DATA_SG PIOD9 IOD11 PIOD12 NVDDL DATA_S GPIOD14 VSS IRQ7_B_MODC RSTCONF_B K3 _TEXP VSS VDDSYN Y VSS XFC AA QVDDL VSS VSS VSSSYN AB VDD VSS QVDDL VSS EXTAL AC VSS VDD VSS QVDDL XTAL AD QVDDL IRQ5_B_S ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S GPIOC5_M PIOA13 OA16 PIOA19 IOA21 GPIOA24 PIOA25 PIOD0 PIOD28 IOD26 PIOD24 IOD22 PIOD13 OD15 GPIOD16 ODCK1 ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S IRQ6_B_M PIOA14 OA17 PIOA31 IOA30 GPIOA28 PIOA29 PIOD30 PIOD29 IOD27 PIOD25 IOD23 PIOD21 OD19 GPIOD17 ODCK2 VSS VSS VDD VSS QVDDL AE ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S DATA_SG DATA_SG DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S PIOA15 OA9 PIOA8 IOA22 GPIOA27 PIOD31 PIOD3 PIOD2 IOD4 PIOD6 IOD8 PIOD10 OD20 GPIOD18 VDDH VSS VSS VSS VDD VSS AF 21 22 23 24 25 26 AE VSS NVDDL VSS VSS VSS QVDDL AF NVDDL VSS VSS VSS VDDH VSS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 NOTE: The Flash balls are only available on the MPC563 and MPC564. These are no connects on the MPC561 and MPC562. Flash supplies and inputs are located on the following balls: T23, T24, U24, U25. U26. Figure G-65. MPC561/MPC563 Ball Map MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-81 66-MHz Electrical Characteristics 1 2 3 4 5 6 7 8 A VDD VSS VSS VSS A_TPUCH A_TPUCH3 A_TPUCH7 11 A_TPUCH15 B VSS VDD VSS VSS A_TPUCH2 A_TPUCH6 C VSS VSS VDD VSS A_TPUCH1 A_TPUCH4 D VSS VSS VSS VDD VDDH VSS VSS VSS E F B_T2CLK_P A_T2CLK_ A_TPUCH CS4 PCS5 0 G B_TPUCH12 VSS A_TPUCH5 9 10 11 12 13 14 A_AN3_A A_AN51_P A_AN55_ A_AN56_P NZ_PQB3 QB7 PQA3 QA4 VSSA VRL A_TPUCH A_TPUCH14 10 VSSA ALTREF A_AN54_ A_AN2_A A_AN50_P MA2_PQ A_AN58_P NY_PQB2 QB6 A2 QA6 A_TPUCH A_TPUCH12 8 NVDDL VRH A_AN52_ A_AN0_A NW_PQB A_AN48_P MA0_PQ A_AN59_P A0 QA7 0 QB4 A_TPUCH A_TPUCH13 9 NVDDL VDDA A_AN53_ A_AN1_A A_AN49_P MA1_PQ A_AN57_P NX_PQB1 QB5 A1 QA5 QVDDL B_TPUCH1 B_TPUCH B_TPUCH1 3 14 5 H B_TPUCH8 B_TPUCH9 B_TPUCH B_TPUCH1 10 1 J B_TPUCH4 B_TPUCH5 B_TPUCH B_TPUCH7 6 K B_TPUCH0 B_TPUCH1 B_TPUCH B_TPUCH3 2 L JCOMP_RS TCK_DSCK B_CNRX0 B_CNTX0 TI_B _MCKI VSS VSS VSS VSS VSS VSS M TDI_DSDI_ TMS_EVTI IRAMSTBY TDO_DSD MDI0 _B O_MDO0 VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS N IRQ3_B_KR SGPIOC6_ _B_RETRY IWP0_VFL IWP1_VFL FRZ_PTR_ Figure G-66. MPC561/MPC563 Ball Map (Black and White, page 1) MPC561/MPC563 Reference Manual, Rev. 1.2 G-82 Freescale Semiconductor 66-MHz Electrical Characteristics VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS IRQ2_B_C IRQ0_B_S IRQ1_B_R IRQ4_B_AT R_B_SGPI GPIOC0_ SV_B_SG 2_SGPIOC4 OC2_MDO MDO4 PIOC1 5_MTS VSS VSS VSS VSS VSS VSS SGPIOC7_I BB_B_VF2 BG_B_VF BR_B_VF1 R RQOUT_B_ _IWP3 0_LWP1 _IWP2 LWP0 VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS P T WE_B_AT0 WE_B_AT1 WE_B_AT WE_B_AT 2 3 U CS0_B CS1_B CS2_B CS3_B V OE_B TEA_B TSIZ0 W TSIZ1 TS_B TA_B BDIP_B Y BI_B_STS_ ADDR_SG ADDR_SG B PIOA12 PIOA11 RD_WR_B BURST_B AA VSS VSS VSS QVDDL AB VSS VSS QVDDL VSS AC VSS QVDDL VSS NVDDL VSS AD QVDDL VSS NVDDL VSS VSS QVDDL ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG PIOA13 OA16 PIOA19 IOA21 GPIOA24 PIOA25 PIOD0 AE VSS NVDDL VSS VSS VSS QVDDL ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S ADDR_SG DATA_SG PIOA14 OA17 PIOA31 IOA30 GPIOA28 PIOA29 PIOD30 AF NVDDL VSS VSS VSS VDDH VSS ADDR_SG ADDR_SGPI ADDR_SG ADDR_SGP ADDR_S DATA_SG DATA_SG PIOA15 OA9 PIOA8 IOA22 GPIOA27 PIOD31 PIOD3 1 2 3 4 5 6 ADDR_SGP ADDR_SG ADDR_SGPI ADDR_SG IOA10 PIOA18 OA20 PIOA23 7 8 9 NVDDL 10 ADDR_S DATA_SG DATA_SG GPIOA26 PIOD1 PIOD5 11 12 13 Figure G-67. MPC561/MPC563 Ball Map (Black and White, page 2) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-83 66-MHz Electrical Characteristics 14 15 16 17 18 19 20 21 22 ETRIG2_ PCS7 MDA13 MDA28 23 24 25 26 VSS VSS VDD VSS A A_AN56_P B_AN0_AN B_AN48_ B_AN52_M B_AN56_P QA4 W_PQB0 PQB4 A0_PQA0 QA4 VSS A_AN58_P B_AN1_AN B_AN49_ B_AN53_M B_AN57_P QA6 X_PQB1 PQB5 A1_PQA1 QA5 VSS ETRIG1_ PCS6 MDA14 MDA29 VSS VDD VSS QVDDL B A_AN59_P B_AN2_AN B_AN50_ B_AN54_M B_AN58_P QA7 Y_PQB2 PQB6 A2_PQA2 QA6 VDDH MDA11 MDA15 VDDH VDD VSS QVDDL VSS C A_AN57_P B_AN3_AN B_AN51_ B_AN55_P B_AN59_P QA5 Z_PQB3 PQB7 QA3 QA7 VDDH MDA12 MDA27 VDD VSS QVDDL VSS VSS D QVDDL VSS VSS VSS E MDA31 MPWM0_MD I1 F MPWM3_PP MPWM2_PP M_RX1 M_TX1 G MPWM17_M MPWM18_MD MPWM19_M MPIO32B5_ DO3 O6 DO7 MDO5 H MPIO32B6_ MPIO32B7_MP MPIO32B8_ MPWM4_MD WM5 MPWM20 O6 MPIO32B9_ MPWM21 J MPIO32B12_ MPIO32B11_C MPIO32B10_ MPIO32B13_ C_CNTX0 _CNRX0 PPM_TSYNC PPM_TCLK K VF0_MPIO32 VF1_MPIO32B MPIO32B15_ MPIO32B14_ B0_MDO1 1_MCKO PPM_TX0 PPM_RX0 L VDDH MPWM1_MD O2 VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS A_CNTX0 MDA30 MPWM16 VFLS0_MPIO VFLS1_MPIO VF2_MPIO32B M 32B3_MSEO 32B4 2_MSEI_B _B PCS2_QGPI PCS0_SS_B_ PCS1_QGPIO1 O2 QGPIO0 A_CNRX0 N Figure G-68. MPC561/MPC563 Ball Map (Black and White, page 3) MPC561/MPC563 Reference Manual, Rev. 1.2 G-84 Freescale Semiconductor 66-MHz Electrical Characteristics VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS VSS SCK_QGPIO MISO_QGPI MOSI_QGPIO5 6 O4 PCS3_QGPI O3 P VSS R VSS VSS VSS VSS VSS RXD1_QGPI TXD2_QGPO2 TXD1_QGPO 1 _C_CNTX0 1 PULL_SEL VSS VSS VSS VSS VSS VSS RXD2_QGPI 2_C_CNRX0 T VSS VFLASH1 U V EPEE1 CLKOUT BOEPEE1 VDDH VSSF1 VDDF1 VDD EXTCLK VSS ENGCLK_BU CLK HRESET_B SRESET_B PORESET_B _TRST_B KAPWR W VDDSYN Y NVDDL IRQ7_B_MODC RSTCONF_B K3 _TEXP VSS VSS VSS XFC AA QVDDL VSS VSS VSSSYN AB VDD VSS QVDDL VSS EXTAL AC IRQ5_B_S DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S GPIOC5_M PIOD28 IOD26 PIOD24 IOD22 PIOD13 OD15 GPIOD16 ODCK1 VSS VDD VSS QVDDL XTAL AD DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S IRQ6_B_M PIOD29 IOD27 PIOD25 IOD23 PIOD21 OD19 GPIOD17 ODCK2 VSS VSS VDD VSS QVDDL AE DATA_SG DATA_SGP DATA_SG DATA_SGP DATA_SG DATA_SGPI DATA_S PIOD2 IOD4 PIOD6 IOD8 PIOD10 OD20 GPIOD18 VDDH VSS VSS VSS VDD VSS AF 21 22 23 24 25 26 DATA_SG PIOD7 14 NVDDL 15 DATA_SG DATA_SGP DATA_SG PIOD9 IOD11 PIOD12 16 17 18 NVDDL 19 DATA_S GPIOD14 20 VSS Figure G-69. MPC561/MPC563 Ball Map (Black and White, page 4) MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor G-85 66-MHz Electrical Characteristics MPC561/MPC563 Reference Manual, Rev. 1.2 G-86 Freescale Semiconductor Register Index A Associated registers 10-4 B BAR (breakpoint address register) 23-53 BBCMCR (BBC module configuration register) 4-19 BR0 - BR3 (emory controller base registers 0 -3) 10-32 Breakpoint counter B value and control register (COUNTB) 23-46 C CALRAM_OTR (CALRAM ownership trace register) 22-17, 22-18 CANCTRL0 (control register 0) 16-27 CANCTRL1 (control register 1) 16-28 CANCTRL2 (control register 2) 16-30 CFSR0 (TPU3 channel function select register 0) 19-16 CFSR1 (TPU3 channel function select register 1) 19-16 CFSR2 (TPU3 channel function select register 2) 19-16 CFSR3 (TPU3 channel function select register 3) 19-16 CIER (TPU3 channel interrupt enable register) 19-15 CISR (TPU3 channel interrupt status register) 19-19 CMPA-CMPD (comparator A-D value registers) 23-41 CMPE-CMPF (comparator E-F value registers) 23-46 CMPG-CMPH (comparator G-H value registers) 23-47 COLIR (change of lock interrupt register) 8-36 COUNTA (breakpoint counter A value and control register) 23-45 COUNTB (breakpoint counter B value and control register) 23-46 CPR0 (TPU3 channel priority register 0) 19-18 CPR1 (TPU3 channel priority register 1) 19-18 CRAM_RBAx (CALRAM region base address register) 22-15, 22-16 CRAMMCR (CALRAM module configuration register) 22-13 CRAMOVL (CALRAM overlay configuration register) 22-17 D DDRQA (QADC64E port A data direction registers) 13-14, 14-14 DDRQS (PORTQS data direction register) 15-14 DEC (decrementer register) 6-40 DER (debug enable register) 23-43 DMBR (dual mapping base register) 10-36 DPDR (development port data register) 23-53 DPTRAM module configuration register (DPTMCR) 20-3 ram base address register (RAMBAR) 20-4 DSCR (TPU3 development support control register) 19-12 DSSR (TPU3 development support status register) 19-14 Dual mapping option register 10-37 E ECR (exception cause register) 23-41, 23-42 EIBADR (external interrupt relocation table base address register) 4-25 EMCR (external master control register) 6-29 G General-Purpose I/O registers 6-46 GPDI (general-purpose data in register) 18-19 GPDO (general-purpose data out register) 18-18 H HSQR0 (TPU3 host sequence register 0) 19-17 HSQR1 (TPU3 host sequence register 1) 19-17 HSSR0 (TPU3 host service request register 0) 19-17 HSSR1 (TPU3 host service request register 1) 19-17 I ICTRL (I-bus support control register) 23-51, A-16 IMASK (interrupt mask register) 16-35 Internal memory map register 6-28 K Keep alive power registers lock mechanism 8-25 L L2U global region attribute register (L2U_GRA) 11-16 module configuration register (L2U_MCR) 11-13 region attribute registers (L2U_RAx) 11-15 region base address registers (L2U_RBAx) 11-14 L2U_GRA (L2U global region attribute register) 11-16 L2U_MCR (L2U module configuration register) 11-14 L2U_RAx (L2U region X attribute register) 11-15 L2U_RBAx (L2U region x base address register) 11-14 LCTRL1 (L-bus support control register 1) 23-47 LCTRL1 (L-bus support control register 2) 23-48 LCTRL2 (L-bus support control register 2) 23-48 M MBISM interrupt registers 17-69 MCPSMCR (MCPSM status/control register) 17-18 MDASMSCR (MDASM status/control register) 17-43 MI_GRA (global regionattribute register) 4-23 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor RegIndex-1 MI_RA 1 - 3 (region base address registers (1 - 3)) 4-22 MI_RBA 0 - 3 (region base address registers (0 - 3)) 4-21 MIOS bus interface (MBISM) Registers 17-13 MIOS1 interrupt level register 0 (MIOSLVL0) (MIOS1LVL0) 17-69 interrupt level register 1 (MIOSLVL1) (MIOS1LVL0) 17-70 module and version number register (MIOS1VNR) 17-14 MIOS14ER0 interrupt enable register 17-66 MIOS14ER1 interrupt enable register 17-68 MIOS14MCR (MIOS14 module configuration register) 17-15 MIOS14RPR0 request pending register 17-66 MIOS14RPR1 request pending register 17-68 MIOS14SR0 (interrupt status register) 17-66 MIOS14SR0 interrupt status register 17-65, 24-8 MIOS14SR1 (interrupt status register) 17-67, 17-68 MIOS14SR1 interrupt status register 17-67 MIOS14TPCR (test and pin control register) 17-13, 17-14 MIOS1LVL0 (MIOS1 interrupt level register 0) 17-69 MIOS1LVL1 (MIOS1 interrupt level 1 register) 17-70 MISCNT (MISC counter) 20-6, 21-5, 21-9 MISRH (multiple input signature register high) 20-5 MISRL (multiple input signature register low) 20-6 MMCSMCNT (MMCSM up-counter register) 17-23 MMCSMMML (MMCSM modulus latch register) 17-24 MMCSMSCR (MMCSM status/control register) 17-24 MPIOSMDDR (MPIOSM data direction register) 17-63 MPIOSMDR (MPIOSM data register) 17-62 MPWMCNTR (MPWMSM counter register) 17-58 MPWMPERR (MPWMSM period register) 17-57 MPWMPULR (MPWMSM pulse width register) 17-57 MPWMSCR (MPWMSM status/control register) 17-58 MSTAT (memory controller status registers) 10-32 O OR0 - OR3 (memory controller option registers 0-3) 10-34 P PDMCR (pads module configuration register) 2-22 PDMCR2 (pads module configuration register) 2-23 PISCR (periodic interrupt status and control register) 6-44 PITC (periodic interrupt timer count register) 6-45 PITR (periodic interrupt timer register) 6-45 PLPRCR (PLL, low-power, and reset-control register) 8-33 Port data direction registers 13-14, 14-13 Port data registers 13-13, 14-12 PORTQS (port QS data register) 15-12 PPMMCR (module configuration register) 18-10 PPMPCR (PPM control register) 18-12 PQSPAR (PORTQS pin assignment register) 15-13 PRESDIV (prescaler divide register) 16-29 Q QACR0 (QADC64E control register 0) 13-14, 14-14 QACR1 (QADC64E control register 1) 13-15, 13-16, 14-16 QACR2 (QADC64E control register 2) 13-17, 14-18 QADCINT (QADC64E interrupt register) 13-12, 14-11 QADCMCR (module configuration register) 13-8, 14-8 QASR (status register 0) 14-22 QASR (status registers) 13-20 QSCI1CR (QSCI1 control register) 15-60 QSCI1SR (QSCI1 status register) 15-61 QSMCM configuration register (QMCMMCR) 15-8 interrupt level registers (QDSCI_IL, QSPI_IL) 15-9 port QS data register (PORTQS) 15-11 PORTQS data direction register (DDRQS) 15-13 PORTQS pin assignment register (PQSPAR) 15-12 QSCI1 control register (QSCI1CR) 15-60 QSCI1 status register (QSCI1SR) 15-61 QSPI command RAM (CRx) 15-23 QSPI control register 0 (SPCR0) 15-17 QSPI control register 1 (SPCR1) 15-19 QSPI control register 2 (SPCR2) 15-20 QSPI control register 3 (SPCR3) 15-20 QSPI registers 15-16 QSPI status register (SPSR) 15-21 queued SCI1 status and control registers 15-59 SCI control register 0 (SCCxR0) 15-46 SCI control register 1 (SCCxR1) 15-47 SCI data register (SCxDR) 15-50 SCI registers 15-45 SCI status register (SCxSR) 15-48 test register (QTEST) 15-9 QSMCMMCR (QSMCM module configuration register) 15-8 QSPI_IL (QSPI interrupt level register) 15-10 R RCPU additional implementation-specific registers 3-27 condition register (CR) 3-16 condition register CR0 field definition 3-17 condition register CR1 field definition 3-17 condition register crn field - compare instruction 3-17 count register (CTR) 3-19 dae/source instruction service register (DSISR) 3-22 data address register (DAR) 3-23 decrementer register (DEC) 3-23 EIE, EID, and NRI special-purpose registers 3-25 MPC561/MPC563 Reference Manual, Rev. 1.2 RegIndex-2 Freescale Semiconductor floating-point exception cause register (FPECR) 3-26 floating-point registers (FPRs) 3-12 floating-point status and control register (FPSCR) 3-13 general special-purpose registers (SPRG0-SPRG3) 3-24 general-purpose registers (GPRs) 3-12 implementation-specific special-purpose 3-25 registers integer exception register (XER) 3-18 link register (LR) 3-19 machine state register (MSR) 3-20 machine status save/restore register 0 (SRR0) 3-23 machine status save/restore register 1 (SRR1) 3-23 OEA register set 3-20 processor version register (PVR) 3-25 UISA register set 3-12 VEA register set - time base 3-20 READI development control register 24-10, 24-11 READI device ID register 24-9 READI DID 24-9 READI DTA 1 and DTA 2 (READI data trace attributes 1 and 2 registers) 24-17 READI RWA (READI read/write access register) 24-13 READI UBA (READI user base accress register) 24-12 READI UDI (READI upload/download information register) 24-15 Region attribute register (0 - 3) 4-22 Register diagrams CALRLAM_OTR (CALRAM ownership trace register) 22-18 CANCTRL0 (control register 0) 16-27 CANCTRL1 (control register 1) 16-28 CANCTRL2 (control register 2) 16-30 CFSR0 (TPU3 channel function select register 0) 19-16 CFSR1 (TPU3 channel function select register 1) 19-16 CFSR2 (TPU3 channel function select register 2) 19-16 CFSR3 (TPU3 channel function select register 3) 19-16 CIER (TPU3 channel interrupt enable register) 19-15 CISR (TPU3 channel interrupt status register) 19-19 CMPG-CMPH (comparator G-H value registers) 23-47 COUNTA (breakpoint counter A value and control register) 23-45 CPR0 (TPU3 channel priority register 0) 19-18 CPR1 (TPU3 channel priority register 1) 19-18 CRAM_RBAx (CALRAM region base address register) 22-16 CRAMMCR (CALRAM module configuration register) 22-13 CRAMOVL (CALRAM overlay configuration register) 22-17 DDRQA (QADC64E port A data direction registers) 13-14, 14-14 DDRQS (PORTQS data direction register) 15-14 DER (debug enable register) 23-43 DSCR (TPU3 development support control register) 19-12 DSSR (TPU3 development support status register) 19-14 ECR (exception cause register) 23-42 EIBADR (external interrupt relocation table base address register) 4-25 HSQR0 (TPU3 host sequence register 0) 19-17 HSQR1 (TPU3 host sequence register 1) 19-17 HSSR0 (TPU3 host service request register 0) 19-17 HSSR1 (TPU3 host service request register 1) 19-17 IMASK (interrupt mask register) 16-35 L2U_GRA (L2U global region attribute register) 11-16 L2U_MCR (L2U module configuration register) 11-14 L2U_RAx (L2U region X attribute register) 11-15 L2U_RBAx (L2U region x base address register) 11-14 LCTRL2 (L-bus support control register 2) 23-48 MIOS14SR0 (interrupt status register) 17-66 MIOS14SR1 (interrupt status register) 17-67, 17-68 MIOS1LVL0 (MIOS1 interrupt level register 0) 17-69 MIOS1LVL1 (MIOS1 interrupt level 1 register) 17-70 MISCNT (MISC counter) 20-6, 21-5, 21-9 MISRH (multiple input signature register high) 20-5 MISRL (multiple input signature register low) 20-6 PORTQS (port QS data register) 15-12 PQSPAR (PORTQS pin assignment register) 15-13 PRESDIV (prescaler divide register) 16-29 QACR1 (QADC64E control register 1) 13-16, 14-16 QADCMCR (module configuration register) 13-8 QSCI1CR (QSCI1 control register) 15-60 QSCI1SR (QSCI1 status register) 15-61 QSMCMMCR (QSMCM module configuration register) 15-8 QSPI_IL (QSPI interrupt level register) 15-10 READI DTA 1 and DTA 2 (READI data trace attributes 1 and 2 registers) 24-17 Region attribute register (0 - 3) 4-22 SCCxR0 (QSMCM SCI control register 0) 15-46 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor RegIndex-3 SCCxR1 (QSMCM SCI control register 1) 15-47 SCDR (QSMCM SCI data register) 15-51 SCxSR (QSMCM SCIx status register) 15-49 SPCR0 (QSPI control register 0) 15-17 SPCR1 (QSPI control register 1) 15-19 SPCR2 (QSPI control register 2) 15-20 SPCR3 (QSPI control register) 15-21 SPRG0-SPRG3 (general special-purpose registers 0-3) 3-24 SPSR (QSPI status register) 15-21 SRR0 (machine status save/restore register 0) 3-23 TBREF1 (time base reference register 1) 6-41 TICR (TPU3 interrupt configuration register) 19-14 TPUMCR (TPU3 module configuration register) 19-11 TPUMCR2 (TPU3 module configuration register 2) 19-19 TPUMCR3 (TPU3 module configuration register 3) 19-21, 19-22 UC3FCFIG (hard reset configuration word) 21-16 UC3FCTL (UC3F EEPROM high voltage control register 21-11 UIPEND (UIMB pending interrupt reqiuest register) 12-9 UMCR (UIMB module configuration register) 12-7 XER (integer exception register) 3-18 Registers Associated registers 10-4 BAR (breakpoint address register) 23-53 BBCMCR (BBC module configuration register) 4-19 BR0 - BR3 (memory controller base registers 0-3) 10-32 Breakpoint counter B value and control register (COUNTB) 23-46 CALRLAM_OTR (CALRAM ownership trace register) 22-17 CMPA-CMPD (comparator A-D value registers ) 23-41 11-16 module configuration 11-13 register (L2U_MCR) region attribute registers (L2U_RAx) 11-15 region base address registers (L2U_RBAx) 11-14 LCTRL1 (L-bus support control register 1) 23-47 LCTRL1 (L-bus support control register 2) 23-48 MBISM interrupt registers 17-69 MCPSMSCR (MCPSM status/control register) 17-18 MDASMSCR (MDASM status/control register) 17-43 MI_GRA (global region attribute register) 4-23 MI_RA 1 - 3 (region base address registers (1 - 3)) 4-22 MI_RBA 0 - 3 (region base address registers (0 - 3)) CMPE-CMPF (comparator E-F value registers) 23-46 CMPG-CMPH (comparator G-H value registers) 23-47 ter) 22-17 DEC (decrementer register) 6-40 DER (debug enable register) 23-43 DMBR (dual mapping base register) 10-36 DPDR (development port data register) 23-53 DPTRAM module configuration register (DPTMCR) 20-3 ram base address register (RAMBAR) 20-4 Dual mapping option register 10-37 ECR (exception cause register) 23-41 EIBADR (external interrupt relocation table base address register) 4-25 EMCR (external master control register) 6-29 General-Purpose I/O registers 6-46 GPDI (general-purpose data in register) 18-19 GPDO (general-purpose data out register) 18-18 ICTRL (I-bus support control register) 23-51, A-16 Internal memory map register 6-28 Keep alive power registers lock mechanism 8-25 L2U global region attribute register (L2U_GRA) COLIR (change of lock register) 8-36 COUNTA (breakpoint counter A value and control register) 23-45 COUNTB (breakpoint counter B value and control register) 23-46 CRAM_RBAx (CALRAM region base address register) 22-15 CRAMMCR (CALRAM module configuration register) 22-13 CRAMOVL (CALRAM overlay configuration regis- 4-21 MIOS bus interface (MBISM) Registers 17-13 MIOS1 interrupt level register 0 (MIOSLVL0) (MIOS1LVL1) 17-69 interrupt level register 1 (MIOSLVL1) (MIOS1LVL0) 17-70 module and version number register (MIOS1VNR) 17-14 MIOS14ER0 interrupt enable register 17-66 MIOS14ER1interrupt enable register 17-68 MIOS14MCR (MIOS14 module configuration register) 17-15 MPC561/MPC563 Reference Manual, Rev. 1.2 RegIndex-4 Freescale Semiconductor MIOS14RPR0 request pending register 17-66 MIOS14RPR1 request pending register 17-68 MIOS14SR0 interrupt status register 17-65, 24-8 MIOS14SR1interrupt status register 17-67 MIOS14TPCR (test and pin control register) 17-13, 17-14 MISCNT (MISC counter) 20-6 MMCSMCNT (MMCSM up-counter register) 17-23 MMCSMMML (MMCSM modulus latch register) 17-24 MMCSMSCR 17-24 (MMCSMstatus/control register) MPIOSMDDR (MPIOSM data direction register) 17-63 MPIOSMDR (MPIOSM data register) 17-62 MPWMCNTR (MPWMSM counter register) 17-58 MPWMPERR (MPWMSM period register) 17-57 MPWMPULR (MPWMSM pulse width register) 17-57 MPWMSCR (MPWMSM status/control register) 17-58 MSTAT (memory controller status registers) 10-32 OR0 - OR3 (memory controller option registers 0-3) 10-34 PDMCR (pads module configuration register) 2-22 PDMCR2 (pads module configuration register) 2-23 PISCR (periodic interrupt status and control register) 6-44 PITC (periodic interrupt timer count register) 6-45 PITR (periodic interrupt timer register) 6-45 PLPRCR (PLL, low-power, and reset-control register) 8-33 Port data direction registers 13-14, 14-13 Port data registers 13-13, 14-12 PPMMCR (module confguration register) 18-10 PPMPCR (PPM control register) 18-12 QACR0 (QADC64E control register 0) 13-14, 14-14 PORTQS data direction register (DDRQS) 15-13 PORTQS pin assignment register (PQSPAR) 15-12 QSCI1 control register (QSCI1CR) 15-60 QSCI1 status register (QSCI1SR) 15-61 QSPI command RAM (CRx) 15-23 QSPI control register 0 (SPCR0) 15-17 QSPI control register 1 (SPCR1) 15-19 QSPI control register 2 (SPCR2) 15-20 QSPI control register 3 (SPCR3) 15-20 QSPI registers 15-16 QSPI status register (SPSR) 15-21 queued SCI1 status and control registers 15-59 SCI control register 0 (SCCxR0) 15-46 SCI control register 1 (SCCxR1) 15-47 SCI data register (SCxDR) 15-50 SCI registers 15-45 SCI status register (SCxSR) 15-48 test register (QTEST) 15-9 RCPU additional implementation-specific registers 3-27 condition register (CR) 3-16 condition register CR0 field definition 3-17 condition register CR1 field definition 3-17 condition register crn field - compare instruction 3-17 count register (CTR) 3-19 dae/source instruction service register (DSISR) 3-22 data address register (DAR) 3-23 decrementer register (DEC) 3-23 EIE, EID, and NRI special-purpose registers 3-25 floating-point exception cause register (FPECR) 3-26 QACR1 (QADC64E control register 1) 13-15, floating-point registers (FPRs) 3-12 floating-point status and control register (FPSCR) QACR2 (QADC64E control register 2) 13-17, general QADCINT (QADC64E interrupt register) 13-12, 14-16 14-18 14-11 QADCMCR (module configuration register) 14-8 QASR (status register 0) 14-22 QASR (status registers) 13-20 QSMCM configuration register (QMCMMCR) 15-8 interrupt level registers (QDSCI_IL, QSPI_IL) 15-9 port QS data register (PORTQS) 15-11 3-13 special-purpose registers (SPRG0-SPRG3) 3-24 general-purpose registers (GPRs) 3-12 implementation-specific special-purpose registers 3-25 integer exception register (XER) 3-18 link register (LR) 3-19 machine state register (MSR) 3-20 machine status save/restore register 0 (SRR0) 3-23 machine status save/restore register 1 (SRR1) 3-23 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor RegIndex-5 OEA register set 3-20 processor version register (PVR) 3-25 UISA register set 3-12 VEA register set - time base 3-20 READI development control register 24-10, 24-11 READI DID 24-9 READI DTA 1 and DTA 2 (READI data trace attributes 1 and 2 registers) 24-17 READI RWA (READI read/write access register) 24-13 16-27 CANMCR READI UBA (READI user base address register) 24-12 READI UDI (READI upload/download information register) 24-15 RSR (reset status register) 7-5 RTC (real-time clock register) 6-43 RTCAL (real-time clock alarm register) 6-44 RTCSC (real-time clock status and control register) 6-42 TBSCR (time base control and status register) 6-42 TESR (transfer error status register) 6-39 TIMER (free running timer register) 16-31 TouCAN CANCTRL0 (control register 0) 16-27 CANCTRL1 (control register 1) 16-28 CANCTRL2 (control register 2) 16-30 CANICR (interrupt configuration register) Rx_config_1 (Rx configuration register 1) 18-16 Rx_Config_2 (Rx configuration register 2) 18-16 Rx_data register 18-17 Rx_shifter register 18-18 RXECTR (receive error counter) 16-36 SCALE_TCLK_REG (scale tclk register) 18-24 SCCR (system clock control register) 8-29 SGPIO control register (SGPIOCR) 6-48 data register 1 (SGPIODT1) 6-46 data register 2 (SGPIODT2) 6-47 SHORT_CH_REG (short channels register) 18-22 SHORT_REG (short register) 18-19 SIMASK (SIU interrupt mask register) 6-33 SIMASK2 (SIU interrupt mask register 2) 6-34 SIMASK3 (SIU interrupt mask register 3) 6-35 SIPEND (SIU interrupt pending register) 6-32 SIPEND2 (SIU interrupt pending register 2) 6-32 SIPEND3 (SIU interrupt pending register 3) 6-33 SIU interrupt edge level register (SIEL) 6-35 interrupt mask register (SIMASK) 6-33 interrupt registers 6-31 interrupt vector register (SIVEC) 6-35 SIU interrupt in-service register 6-37 SIUMCR (SIU module configuration register) 6-25 SWSR (software service register) 6-38 SYPCR (system protection control register) 6-37 System configuration and protection registers 6-24 System configuration registers 6-24 System protection registers 6-37 System timer registers 6-40 TBREF0 (time base reference registers) 6-41 (module 16-25 configuration register) ESTAT (error and status register) 16-33 IFLAG (interrupt flag register) 16-36 IMASK (interrupt mask register) 16-35 PRESDIV (prescaler divide register) 16-29 receive buffer 14 mask registers 16-32 receive buffer 15 mask registers 16-33 receive mask registers 16-7 RXGMSKHI (receive global mask registers) 16-31 Test configuration register 16-27 TPU3 channel function select registers (CFSRx) 19-15 channel interrupt enable register (CIER) 19-15 channel interrupt status register (CISR) 19-19 channel priority registers (CPRx) 19-18 development support control register (DSCR) 19-12 development support status register (DSSR) 19-13 host sequence registers (HSQRx) 19-16 host service request registers (HSSRx) 19-17 interrupt configuration register (TICR) 19-14 module configuration register (TPUMCR) 19-11 module configuration register 2 (TPUMCR2) 19-19 module configuration register 3 (TPUMCR3) 19-21 service grant latch register (SGLR) 19-22 Tx_Config_1 (Tx configuration register 1) 18-15 Tx_Config_2 (Tx configuration register 2) 18-15 Tx_data register 18-18 UC3FCFIG (hard reset configuration word) 21-16 UC3FCTL (UC3F EEPROM high voltage control register 21-11 UIMB module configuration register (UMCR) 12-7 pending interrupt request register (UIPEND) 12-8 test control register (UTSTCREG) 12-8 VSRMSR (VDDSRM sensor register) 8-37 RSR (reset status register) 7-5 MPC561/MPC563 Reference Manual, Rev. 1.2 RegIndex-6 Freescale Semiconductor RTC (real-time clock register) 6-43 RTCAL (real-time clock alarm register) 6-44 RTCSC (real-time clock status and control register) 6-42 Rx data register 18-17 Rx shifter register 18-18 Rx_config_1 (Rx configuration register 1) 18-16 Rx_Config_2 (Rx configuration register 2) 18-16 RXECTR (receive error counter) 16-36 S SCALE_TCLK_REG (scale tclk register) 18-24 SCCR (system clock control register) 8-29 SCCxR0 (QSMCM SCI control register 0) 15-46 SCCxR1 (QSMCM SCI control register 1) 15-47 SCDR (QSMCM SCI data register) 15-51 SCxSR (QSMCM SCIx status register) 15-49 SGPIO control register (SGPIOCR) 6-48 data register 1 (SGPIODT1) 6-46 data register 2 (SGPIODT2) 6-47 SHORT_CH_REG (short channels register) 18-22 SHORT_REG (short register) 18-19 SIMASK (SIU interrupt mask register) 6-33 SIMASK2 (SIU interrupt mask register 2) 6-34 SIMASK3 (SIU interrupt mask register 3) 6-35 SIPEND (SIU interrupt pending register) 6-32 SIPEND2 (SIU interrupt pending register 2) 6-32 SIPEND3 (SIU interrupt pending register 3) 6-33 SIU interrupt edge level register (SIEL) 6-35 interrupt mask register (SIMASK) 6-33 interrupt registers 6-31 interrupt vector register (SIVEC) 6-35 SIU interrupt in-service register 6-37 SIUMCR (SIU module configuration register) 6-25 SPCR0 (QSPI control register 0) 15-17 SPCR1 (QSPI control register 1) 15-19 SPCR2 (QSPI control register 2) 15-20 SPCR3 (QSPI control register) 15-21 SPRG0-SPRG3 (general special-purpose registers 0-3) 3-24 SPSR (QSPI status register) 15-21 SRR0 (machine status save/restore register 0) 3-23 SWSR (software service register) 6-38 SYPCR (system protection control register) 6-37 System configuration and protection registers 6-24 System configuration registers 6-24 System protection registers 6-37 System timer registers 6-40 T TBREF0 (ime base reference registers) 6-41 TBREF1 (time base reference register 1) 6-41 TBSCR (time base control and status register) 6-42 TESR (transfer error status register) 6-39 TICR (TPU3 interrupt configuration register) 19-14 TIMER (free running timer register) 16-31 TouCAN CANCTRL0 (control register 0) 16-27 CANCTRL1 (control register 1) 16-28 CANCTRL2 (control register 2) 16-30 CANICR (interrupt configuration register) 16-27 CANMCR (module configuration register) 16-25 ESTAT (error and status register) 16-33 IFLAG (interrupt flag register) 16-36 IMASK (interrupt mask register) 16-35 PRESDIV (prescaler divide register) 16-29 receive buffer 14 mask registers 16-32 receive buffer 15 mask registers 16-33 receive mask registers 16-7 RXGMSKHI (receive global mask registers) 16-31 Test configuration register 16-27 TPU3 channel function select registers (CFSRx) 19-15 channel interrupt enable register (CIER) 19-15 channel interrupt status register (CISR) 19-19 channel priority registers (CPRx) 19-18 development support control register (DSCR) 19-12 development support status register (DSSR) 19-13 host sequence registers (HSQRx) 19-16 host service request registers (HSSRx) 19-17 interrupt configuration register (TICR) 19-14 module configuration register (TPUMCR) 19-11 module configuration register 2 (TPUMCR2) 19-19 module configuration register 3 (TPUMCR3) 19-21 service grant latch register (SGLR) 19-22 TPUMCR (TPU3 module configuration register) 19-11 TPUMCR2 (TPU3 module configuration register 2) 19-19 TPUMCR3 (TPU3 module configuration register 3) 19-21, 19-22 Tx data register 18-18 Tx_Config_1 (Tx configuration register 1) 18-15 Tx_Config_2 (Tx configuration register 2) 18-15 U UC3FCFIG (hard reset configuration word) 21-16 UC3FCTL (UC3F EEPROM high voltage control register 21-11 UIMB module configuration register (UMCR) 12-7 pending interrupt request register (UIPEND) 12-8 test control register (UTSTCREG) 12-8 UIPEND (UIMB pending interrupt reqiuest register) 12-9 UMCR (UIMB module configuration register) 12-7 V VSRMSR (VDDSRM MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor RegIndex-7 sensor register) 8-37 X XER (integer exception register) 3-18 MPC561/MPC563 Reference Manual, Rev. 1.2 RegIndex-8 Freescale Semiconductor Index A Accesses clock requirements 13-52, 14-51 ACKERR 16-34 Acknowledge error (ACKERR) 16-34 ADDR[8:31] 9-4, 9-37 Address -mark wakeup 15-59 address bus 9-37 Address space 13-11 address type (AT[0:3]), 9-38 ALE 23-42 ALEE 23-44 Alignment exception 3-49 ALU-BFU 3-5 AN 13-7, 14-6 Analog front-end multiplexer 13-36, 14-37 input considerations 13-73, 14-71 pins 13-71, 14-70 power pins 13-67, 14-66 reference pins 13-71, 14-70 section contents 13-2, 14-2 submodule block diagram 13-34, 14-36 supply filtering and grounding 13-69, 14-67 pins 13-67, 14-66 to digital converter operation 13-34, 14-36 arbitration, 9-32 AT[0:3] 9-4 atomic 9-32 atomic operation reservation of data 11-7 atomic update primitives, 3-43 B BAR 3-60, 23-53 Base ID mask bits 16-32, 16-33 Baud clock 15-52 BB 9-7 BBCMCR 4-19 BDIP, 9-5 BE bit 3-21 Beginning of queue 2 (BQ2) 13-19, 14-20 BG 9-7 BI 9-7, 9-40 Binary divider 13-47, 14-48 -weighted capacitors 13-36, 14-37 Bit stuff error (STUFFERR) 16-34 BITERR 16-34 BITS 15-18 Bits per transfer enable (BITSE) 15-24 field (BITS) 15-18 BITSE 15-24, 15-39 Bit-time 15-51 BIU 13-2, 13-51, 14-2, 14-51 BIUSM BIUTEST -- BIUSM test configuration register 17-13 selecting the time base bus 17-13 BKPT (TPU asserted) 19-14 BLC 19-12 block diagram CALRAM 22-2 DPTRAM 20-2 JTAG test logic 25-3 L2U 11-2 memory controller 10-2 MIOS 17-1 MPC561/MPC563 1-2 READI 24-3 READI signal interface 24-22 TouCAN 16-1 UC3F EEPROM 21-1 UIMB 12-2 USIU 6-3 block diagrams analog subsystem 13-34 BBC module 4-2 clock 8-2 DECRAM interfaces 4-13 MPC561/MPC563 signals 2-2 RCPU 3-1 USIU 5-2 BOFFINT 16-35 Boundary conditions 13-40, 14-41 boundary scan register 25-4 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-1 BPU 3-4, 3-5 BQ2 13-19, 13-40, 14-20, 14-41 BR 9-7 Branch prediction 3-5 processing unit 3-5 trace enable 3-21 Branch latch control (BLC) 19-12 Branch processing unit 3-4 branch target buffer 4-14 Break frame 15-52 Breakpoint asserted flag (BKPT) 19-14 flag (PCBK) 19-14 Breakpoint counter A value and control register 23-45 Breakpoint counter B value and control register 23-46 breakpoints 23-9 BRKNOMSK 23-50 BRx registers 10-32 BTB 4-14 BURST 9-4, 9-37 burst indicator (BURST), 9-37 burst inhibit (BI), 9-40 burst read cycle (illustration), 9-21 burst transfer, 9-17 burst write cycle (illustration), 9-26 Bus monitor 6-17 off interrupt (BOFFINT) 16-35 bus busy (BB), 9-34 bus exception control cycles, 9-45 bus grant (BG), 9-33 bus interface bus control signals, 9-2 bus operation address transfer phase related signals, 9-37 arbitration phase, 9-32 basic transfer protocol, 9-8 burst mechanism, 9-18 burst transfer, 9-17 bus exception control cycles, 9-45 single beat transfer single beat read flow, 9-9 single beat write flow, 9-9, 9-11 single beat transfer, 9-9 storage reservation, 9-42 termination signals, 9-40 bus operations, 9-8 bus transfer signals, 9-1 features, 9-1 signal descriptions, 9-3 Bus interface unit (BIU) 13-2, 14-2 components 13-51, 14-51 bus request (BR), 9-33 bus signals (illustration), 9-3 BUSY 16-16 receive message buffer code 16-5 BYP 13-30, 13-35, 14-31 Bypass mode 13-35 BYTES field 3-19 C CA bit 3-19 cache control instructions, 3-43 CALRAM CLPS 22-8, 22-9, 22-10 operation modes 22-4 privileges 22-5 CAN2.0B system 16-3 CANCTRL0 16-27 CANCTRL1 16-28 CANCTRL2 16-30 CANICR 16-27 Carry 3-19 CCL 19-13 CCW 13-2, 13-27, 14-2, 14-28 censorship states 21-30 CF 13-75, 14-73 CF1 13-21, 14-22 CF2 13-22, 14-23 CFSR 19-15 CGBMSK 23-48 CH 19-15, 19-18, 19-19 CHAN 13-31, 14-32 CHANNEL 19-16 Channel assignments multiplexed 13-32 nonmultiplexed 13-31 conditions latch (CCL) 19-13 interrupt enable /disable field (CH) 19-15 request level (CIRL) 19-15 status (CH) 19-19 invalid 13-31 number (CHAN) 13-31, 14-32 orthogonality 19-4 priority registers 19-18 register breakpoint flag (CHBK) 19-14 reserved 13-31 Charge sharing 13-76, 14-73 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-2 Freescale Semiconductor CHBK 19-14 CHBMSK 23-48 check stop state 23-26 checkstop 7-3 Checkstop enable 3-47 chip-select global 10-27 CHSTP bit 23-42 CHSTPE 23-43 CHSTPE bit 3-47 CIE1 13-16, 14-17 CIE2 13-18, 14-19 CIER 19-15, 19-19 CIRL 19-15 CISR 19-8, 19-19 class, instruction, 3-40 CLKOUT 8-13 CLKOUT to TA, BI assertion (when driven by the Memory Controller) F-21, F-22, G-21 CLKOUT, 9-8 CLKS 19-12 Clock block diagram 13-48, 14-49 frequency 13-48 generation 13-47, 14-48 phase (CPHA) 15-18 polarity (CPOL) 15-18 requirements 13-52, 14-51 clocks general system 8-10 CLPS 22-9 CLPS bit 22-8, 22-9, 22-10 CMPA-CMPD 23-41 CMPE-CMPF 23-46 CMPG-CMPH 23-47 CNRX/TX pins 16-2 CNTC 23-45 CNTV 23-45 Code message buffer field 16-4 code decompression features A-1 modes of A-14 Coherency 13-45, 13-52, 14-46, 14-51 coherency 19-4 data coherency during reset 7-4 COLIR 8-36 COMM D-17 Command RAM 15-23 Command word pointer (CWP) 13-24, 13-27, 14-25, 14-28 Comparator 13-37, 14-38 Comparator A-D value registers 23-41 Comparator E-F value registers 23-46 Comparator G-H value registers 23-47 Compare instructions 3-17 Compare size 23-48 Compare type 23-47, 23-51, A-17 Completed queue pointer (CPTQP) 15-22 compressed address generation direct branches A-4 exceptions A-6 indirect branches A-6 compression READI A-16 compression, code algorithm A-2 features of A-1 implementation of A-11 compression, environment initialization of A-13 Condition register 3-16, 3-17 configuration soft reset 7-13 configuration word hard reset (RCW) 7-11 CONT 15-24 contention, 9-37 Continue (CONT) 15-24 Continuous transfer mode 15-16 Control registers 0 (QACR0) 13-7, 14-7 1 (QACR1) 13-7, 14-7 2 (QACR2) 13-7, 14-7 QADC64E control register 1 (QACR1) 13-15, 14-16 QADC64E control register 2 (QACR2) 13-17, 14-18 controlling termination of a bus cycle for a bus error, 9-45 Conversion command word table (CCW) 13-2, 13-27, 13-37, 14-2, 14-28, 14-38 cycle times 13-35, 14-36 stages 13-29, 14-30 conversion queue operation 14-29 Count register 3-19 COUNTA 23-45, 23-51 COUNTB 23-46 CPHA 15-18, 15-35 CPOL 15-18, 15-35 CPR 19-18 CPTQP 15-22, 15-25 CPU wait states 13-52, 14-51 CR 3-5, 3-16, 3-19, 9-5 and compare instructions 3-17 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-3 CR0 field 3-17 CR1 field 3-17 CRAM_OTR register 22-18 CRAM_OVLCR register 22-17 CRAM_RBAx register 22-16 CRAMMCR register 22-13 CRCERR 16-34 CRWE 23-47 CRWF 23-47 CSG 23-48 CSH 23-48 CTA 23-51, A-17 CTB 23-51, A-17 CTC 23-51, A-17 CTD 23-51, A-17 CTE 23-47 CTF 23-47 CTG 23-47 CTH 23-47 CTR 3-5 CWP 13-24, 13-27, 14-25, 14-28 Cyclic redundancy check error (CRCERR) 16-34 D DAC 13-2, 14-2 DAE/source instruction service register 3-22 DAR 3-23, 3-48, 3-59 DAR, 3-48, 3-59 Data frame 15-52 DATA [0:31] 9-6 Data address register 3-23 data memory protection unit 11-1 data reservation 11-7 data storage interrupt, 3-48 DC 24-10 DCCR 4-25 DCCR0-15 A-19 DDRQS 15-10, 15-34, 15-39 Debug enable register 23-53 debug mode 23-21 DEC 3-23, 6-18, 6-40 DECE 23-42 DECEE 23-44 decompression features A-1 modes of A-14 Decrementer register 3-23 decrementer 6-18 Decrementer exception 3-53 deep-sleep 6-23 Delay after transfer (DT) 15-24, 15-36 before SCK (DSCKL) 15-19 DER 23-43, 23-53 Development Port trap enable selection 23-52, A-17 development port 23-28 development support debug mode 23-21 instruction support 23-14 port registers 23-30 program trace 23-4 protection features 23-40 registers 23-39 system interface 23-19 watchpoints 23-9 DID 24-9 Digital control section contents 13-2, ??-13-34, 13-37-??, 14-2, ??-14-35, 14-38-?? input/output port (PQA) 13-66, 14-65 to analog converter (DAC) 13-2, 13-36, 14-2, 14-37 DIO D-46 Disable TPU2 pins field (DTPU) 19-20 Disabled mode 13-41, 14-42 Discrete input/output (DIO) D-46 DIV2 19-19 DIV8 clock 19-7 Divide by two control field (DIV2) 19-19 DIW0EN 23-52, A-17 DIW1EN 23-52, A-17 DIW2EN 23-52, A-17 DIW3EN 23-52, A-17 DLW0EN 23-50 DLW1EN 23-50 DMBR register 10-36 DMOR register 10-37 DMPU 11-1 Double -buffered 15-54, 15-57 doze 6-23 DPI 23-43 DPTMCR 20-3 DPTRAM 20-4 DPTRAM operation 20-6 DSCK 15-24 DSCKL 15-19 DSCR 19-12 DSISR 3-22, 3-48, 3-50, 3-59 DSSR 19-13 DT 15-24 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-4 Freescale Semiconductor DTA1 24-17 DTA2 24-17 DTL 15-19 DTPU 19-20 E EA 3-34 EBRK 23-43 ECR 23-41 EE bit 3-21, 3-25 EEPROM mapping 10-24 Effective address 3-34 EIBADR 4-25 EID 3-25 EIE 3-25 ELE bit 3-21 EMCR 6-29 EMPTY receive message buffer code 16-5 EMU 19-4, 19-11 Emulation control (EMU) 19-11 support 19-4 Encoded one of three channel priority levels (CH) 19-18 time function for each channel (CHANNEL) 19-16 type of host service (CH) 19-18 Ending queue pointer (ENDQP) 15-20 End-offrame (EOF) 16-17 End-of-queue condition 13-29, 14-30 ENDQP 15-20, 15-25 ENGCLK 8-14 Entry table bank select field (ETBANK) 19-20 EOF 16-17 EOQ 13-40, 14-41 EP bit 3-21, 3-22 ERRINT 16-35 Error conditions 15-57 interrupt (ERRINT) 16-35 resulting from leakage 13-75, 14-73 Error counters 16-10 ESTAT 16-33 ETBANK 19-20 ETRIG 13-67, 13-71, 14-66, 14-69 Event timing 19-3 Exception cause register 23-41 Exception prefix 3-21, 3-22 exception table 4-7 Exceptions 3-34 alignment 3-49 classes 3-35 decrementer 3-53 external interrupt 3-48 little endian mode 3-21 ordered 3-35 precise 3-36 program 3-51 system call 3-54 unordered 3-35 vector table 3-36 exceptions compressed address generation A-6 data storage 3-48 Execution units 3-4 Extended message format 16-1 frames 16-4 External interrupt disable 3-25 enable 3-25 leakage 13-76, 14-73 trigger continuous-scan mode 13-46, 14-47 trigger pins 13-67, 14-66 trigger single-scan mode 13-43, 14-44 external interface UC3F 21-4 external device arbitration phase 9-32 priority of 9-35 USIU address decoding 6-6 External interrupt 3-48 enable 3-21, 3-25 external interrupt enhanced 4-10 external master memory controller 10-28 external master control register (EMCR) 6-29 Externally multiplexed mode (MUX) 13-15 EXTI 23-42 EXTIE 23-44 F Fast quadrature decode TPU function (FQD) D-35 Fault confinement state (FCS) 16-11, 16-34 FCS 16-11, 16-34 FE 15-50, 15-57 FE bits 3-21, 3-22 features BIU 4-2 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-5 bus interface, 9-1 Fetch serialized 23-1 FEX bit 3-14 FI 3-15 Final sample time 13-35, 14-36 Floating-point available 3-21 enabled exception summary 3-14 exception mode 3-21, 3-22 exception summary 3-14 fraction inexact 3-15 fraction rounded 3-15 inexact exception 3-14 enable 3-15 invalid operation exception enable 3-15 for x*0 3-14 for x/x 3-14 for x-x 3-14 for 0/0 3-14 for invalid compare 3-15 for SNaN 3-14 summary 3-14 invalid operation exception for invalid integer convert 3-15 invalid operation exception for invalid square root 3-15 invalid operation exception for software request 3-15 overflow exception 3-14 enable 3-15 registers 3-12 result flags 3-15 rounding control 3-16 status and control register 3-13 underflow exception 3-14 unit 3-5 zero divide exception 3-14, 3-15 FORMERR 16-34 FP bit 3-21 FPECR 3-26 FPRF 3-15 FPRs 3-12 FPSCK 19-20 FPSCR 3-13 FPU 3-5 FPUVE 23-42 FPUVEE 23-44 FQCLK 13-47, 14-48 FQD D-35 FQM D-10 FR 3-15 Frame size 15-58 Frames overload 16-17 remote 16-17 Framing error (FE) flag 15-50, 15-57 FREEZ ACK 16-18 FREEZE assertion response (FRZ) QSM 15-6 TPU 19-13 Freeze enable (FRZ) 13-8, 14-8 mode 13-9 FREEZE (internal signal) 13-10, 13-30, 14-9, 14-31 freeze operation 6-23 Frequency measurement (FQM) D-10 parameters D-12 FRZ 13-8, 14-8, 16-13, 19-13, 23-29 FRZACK 16-13 FULL receive message buffer code 16-5 Function library for TPU 19-4 FX bit 3-14 G general purpose chip-select machine 10-3 General SPRs 3-24 General-purpose registers (GPRs) 3-12 Global registers 13-7 GPCM 10-3 H Hall effect decode (HALLD) D-20 HALLD D-20 HALT 15-21, 16-13 Halt acknowledge flag (HALTA) 15-22 QSPI (HALT) 15-21 HALTA 15-22 HALTA and MODF Interrupt Enable (HMIE) 15-42 HALTA/MODF interrupt enable (HMIE) bit 15-21 Hang on T4 (HOT4) 19-12 hard reset 7-2 hard reset configuration word (RCW) 7-11 HMIE 15-21 HOT4 19-12 HRESET 7-2 HSQR 19-16 HSSR 19-17 I IBRK 23-43 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-6 Freescale Semiconductor I-bus watchpoint programming 23-51, A-17 ICDU features A-1 ICTRL A-16 ID Extended (IDE) field 16-6 HIGH field 16-6 LOW field 16-6 IDE 16-6 Identifier (ID) 16-1 bit field for standard format 16-6 IDLE 15-49, 15-58, 16-34 Idle CAN status (IDLE) 16-34 frame 15-52 -line detect type (ILT) 15-47 detected (IDLE) 15-49, 15-58 detection process 15-58 interrupt enable (ILIE) 15-48, 15-58 type (ILT) bit 15-58 IFLAG 16-36 Ignore first match 23-52, A-18 IIFM 23-52, A-18 ILBS 12-4 ILIE 15-48, 15-58 illegal and reserved instructions, 3-40 ILSCI 15-9, 15-10 ILT 15-47, 15-58 IMASK 16-35 IMB 13-47, 14-48 IMB clock 12-2 IMMR 6-28 implementation dependent software emulation interrupt, 3-56 implementation specific data TLB error interrupt, 3-58 implementation specific debug interrupt, 3-59 implementation specific instruction TLB error interrupt, 3-57 IMUL-IDIV 3-5 Information processing time (IPT) 16-10 Initial sample time 13-35, 14-36 Input sample time (IST) 13-31, 13-49, 14-32 Instruction pipeline 3-38 sequencer 3-3 set summary 3-28 timing 3-37 Instruction fetch show cycle control 23-1 instruction storage interrupt, 3-48 instruction support 23-14 instructions cache control, 3-43 storage control, 3-45 instructions, partially executed, 3-60 Integer exception register 3-18 Integer unit 3-5 interchannel communication 19-4 Intermission 16-17 internal bus arbiter 9-35 Interrupt register (QADCINT) 13-7, 13-12, 14-11 interrupt external 3-48 interrupt controller enhanced 6-8 interrupt level byte select 12-4 Interrupt Level of SCI (ILSCI) 15-9, 15-10 Interrupts TOUCAN 16-20 TPU 19-5 interrupts MIOS 17-63 UIMB 12-3 interrupts, 3-45 Inter-transfer delay 15-15 Interval timer single-scan mode 13-44, 14-45 invalid and preferred instructions, 3-40 Invalid channel number 13-31 IPT 16-10 IRAMSTBY 8-23, 22-5 IRQ 19-5 ISCTL 23-1 IST 13-31, 13-49, 14-32 IU 3-5 IW 23-51, A-17 IWPn 23-30 IWPnand VFLSn 23-30 J JTAG instruction register 25-30 pin diagram 25-1 reset 7-3 K KAPWR 8-22 registers 8-26 keep alive power 8-24 keep-alive power 22-5 KR/RETRY, 9-5 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-7 L L2U 11-1 modes of operation 11-3 L2U module configuration register (L2U_MCR) 11-13 L2U_GRA 11-16 L2U_MCR 11-13 L2U_RAx 11-15 L2U_RBAx 11-14 LBRK 23-43 LBUF 16-29 L-bus support control register 1 23-47 control register 2 23-48 L-bus to U-bus interface unit 11-1 LCTRL1 23-47 LCTRL2 23-48 LE bit 3-22 Least significant bit (LSB) 13-36, 14-38 Length of delay after transfer (DTL) 15-19 Link register 3-19 Little endian mode 3-22 LJSRR 13-33, 14-35 LJURR 13-33, 14-35 Load/store unit 3-4, 3-6 Lock /release/busy mechanism 16-16 Loop mode (LOOPS) 15-47 LOOPQ 15-21 LOOPS 15-47 low power stop 6-23 Low power stop (LPSTOP) QSM 15-6 Lowest buffer transmitted first (LBUF) 16-29 Low-power stop mode enable (STOP) TPU 19-11 LR 3-5, 3-19 LSB 13-36, 14-38 LSU 3-4, 3-6 LW0EN 23-49 LW0IA 23-49 LW0IADC 23-49 LW0LA 23-49 LW0LADC 23-49 LW0LD 23-49 LW0LDDC 23-49 LW1EN 23-49 LW1IA 23-49 LW1IADC 23-49 LW1LA 23-50 LW1LADC 23-50 LW1LD 23-50 LW1LDDC 23-50 M M 15-47, 15-52 MA 13-14 Machine check enable 3-21 state register 3-20 status save/restore register 0 3-23 status save/restore register 1 3-23 Machine check enable 3-47 machine check exception enable 3-47 mapping dual 10-26 EEPROM 10-24 Mask examples for normal/extended messages 16-8 registers (RX) 16-7 Master /slave mode select (MSTR) 15-18 master external arbitration phase 9-32 MBISM 17-13 MC 24-11 MCE 23-42 MCEE 23-43 MCIE bit 3-47 MCPSM 17-16 MCPSMSCR 17-18 MCPWM D-22, D-30 MDASM submodule 17-70 MDASMAR 17-41 MDASMBR 17-42 MDASMSCR 17-44 MDASMSCRD 17-43 ME bit 3-21, 3-47 memory controller registers 10-31 memory map 1-11 TPU 19-1 Message buffer address map 16-24 code for RX/TX buffers 16-5 deactivation 16-14 structure 16-4 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-8 Freescale Semiconductor format error (FORMERR) 16-34 message CAN bus transmission 16-13 messaging READI 24-4, 24-22 MI_GRA 4-23 MI_RA [0:3] 4-22 MI_RBA[0:3] 4-21 MIOS14 16-bit parallel port I/O submodule (MPIOSM) 17-60 bus interface submodule (MBISM) 17-13 counter prescaler submodule (MCPSM) 17-16 double action submodule (MDASM) 17-26, 17-70 interrupt request submodule (MIRSM) 17-64 interrupts 17-63 modulus counter submodule (MMCSM) 17-19 pulse width modulation submodule (MPWMSM) 17-46 MIOS14ER0 17-66 MIOS14ER1 17-68 MIOS14LVL0 17-69 MIOS14LVL1 17-70 MIOS14MCR 17-15 MIOS14RPR0 17-67 MIOS14RPR1 17-68 MIOS14SR0 17-66 MIOS14SR1 17-67 MIOS14TPCR 17-14 MIOS14VECT 17-14 MIOS14VNR 17-14 MISC 20-8 MISCNT 20-6 MISO 15-34, 15-39 MISRH 20-5 MISRL 20-5 MMCSM 17-19 MMCSMCNT 17-23 MMCSMML 17-24 MMCSMSCR 17-24 MMCSMSCRD 17-24 Mode fault flag (MODF) 15-22, 15-27 select (M) 15-47 Mode Fault Flag (MODF) 15-42 Modes stop 14-8 modes BBC operation 4-4 CALRAM operation 22-4 censorship modes of UC3F 21-31 clock frequency for each 8-17 code decompression A-14 debug operation of BBC 4-7 DECRAM standby operation 4-14 disabled 13-41, 14-42 DPTRAM operation 20-6 external master 6-4 freeze 13-9 interrupt controller enhanced operation 6-11 interrupt controller regular operation 6-10 JTAG 25-3 L2U operation 11-3 limp support 8-14 low power 8-16 low-power 6-23 MIOS14 MDASM operation 17-3, 17-29 MPC561/563 development support signals 2-29 READI 24-3 reserved 13-41, 14-42 scan. See Scan modes stop 13-9 TOUCAN 16-17 MODF 15-22, 15-27, 15-42 module configuration register (QADC64E) 13-8 module configuration register (QADCMCR) 14-8 Modulus counter 15-52 MOSI 15-34, 15-39 Most significant bit (MSB) 13-36, 14-38 MPC561/MPC563 block diagram 1-2 differences from MPC555 1-9 memory map 1-11 optional features 1-9 VFLSn and MPIO32B 23-30 MPIOSM 17-60 MPIOSMDDR 17-63 MPIOSMDR 17-62 MPWMCNTR 17-58 MPWMPERR 17-57 MPWMPULR 17-58 MPWMSCR 17-58 MQ1 13-16, 14-17 MQ2 13-18, 14-19 MSB 13-36, 14-38 MSR 3-20, 3-46, 3-48, 3-49, 3-50, 3-52, 3-53, 3-54, 3-55, 3-56, 3-57, 3-59, 3-60 MSTAT registers 10-32 MSTR 15-18 Multichannel pulse-width modulation (MCPWM) D-22, D-30 parameters slave channel A MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-9 non-inverted center aligned mode D-48 slave edge-aligned mode D-23 Multimaster operation 15-27 Multiphase motor commutation (COMM) D-17 Multiple end-of-queue 13-40, 14-41 multiple input signature calculator (MISC) 20-8 Multiplexed analog inputs 13-7, 14-6 multiplexing signals 2-20 MUX 13-15 N VFLSn and MPIO32B 23-30 Negative stress 13-76, 14-74 New queue pointer value (NEWQP) 15-20 New input capture/transistion counter (NITC) D-15 parameters D-15 NEWQP 15-20, 15-25 NF 15-50, 15-57 NI bit 3-16 NITC D-15 Noise error flag (NF) 15-50 errors 15-57 flag (NF) 15-57 Non-IEEE floating-point operation 3-16 nonoptional instructions, 3-40 Non-recoverable interrupt 3-25 NOT ACTIVE receive message buffer code 16-5 Not ready (NOTRDY) 16-21 NOTRDY 16-18, 16-21 NRI 3-25 O OC D-42 OE bit 3-15 OP0 9-30 OP1 9-30 OP2 9-30 OP3 9-30 Open drain drivers 14-66 operand placement (effects), 3-43 operand representation (illustration), 9-30 Operating Environment Architecture (Book 3) branch processor, 3-44 exceptions, 3-45 fixed-point processor special purpose registers, 3-44 fixed-point processor, 3-44 optional facilities and instructions, 3-61 storage control instructions, 3-45 timer facilities, 3-61 Operating Environment Architecture (OEA) 3-44 optional instructions, 3-40 OR 15-50 OR registers 10-34 Ordered exceptions 3-35 OTR 24-8 Output compare (OC) D-42 OV (overflow) bit 3-18 Overload frames 16-17 OVERRUN receive message buffer code 16-5 Overrun error (OR) 15-50 OX bit 3-14 P P 13-30, 14-31 parameter RAM 19-3, 19-23 Parity (PF) flag 15-57 checking 15-53 enable (PE) 15-47 error (PF) bit 15-50 errors 15-57 type (PT) 15-47 type (PT) bit 15-53 Pause (P) 13-30, 13-38, 14-31, 14-39 PCBK 19-14 PCS 15-24 to SCK delay (DSCK) 15-24 PCS0/SS 15-39 PCS3-PCS0/SS 15-42 PDMCR 2-22 PDMCR2 2-23 PE 15-47 performance L-bus 11-10 Period /pulse-width accumulator (PPWA) D-38 Periodic interrupt timer 6-20 Periodic/interval timer 13-51, 14-50 continuous-scan mode 13-47, 14-48 Peripheral chip-selects (PCS) 15-24, 15-37 Peripheral Chip-Select 3-0/Slave Select (PCS3-PCSO/SS) 15-42 PF 15-50, 15-57 PF1 13-22, 14-23 PF2 13-23, 14-24 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-10 Freescale Semiconductor Phase buffer segment 1/2 (PSEG1/2) bit field 16-30 phase-lock loop, 9-8 PIE1 13-16, 14-17 PIE2 13-18, 14-19 PISCR 6-44 PIT 6-20 PITC 6-45 PITR 6-45 PLL 8-3 loss of lock 7-2 PLL, 9-8 PLPRCR 8-33 Pointer 15-16 PORESET 7-1 Port A data register (PORTQA) 13-13 B data register (PORTQB) 13-13 port size device interfaces (illustration), 9-31 port width definition 9-1 PORTQA 13-13 PORTQB 13-13 PORTQS 15-11 Positive stress 13-76, 14-74 power on reset 7-1 PPWA D-38 PQA 13-66, 14-65 PQSPAR 15-10, 15-34, 15-39 PR bit 3-7, 3-21 PRE 23-42 Precise exceptions 3-36 PREE 23-44 Prescaler 13-48 clock (PSCK) 19-12 high time (PSH) 13-15 low time (PSL) 13-15 clock high time (PSH) 13-48, 14-15 control for TCR1 19-5 for TCR2 19-7 divide factor field 16-30 register (PRESDIV) 16-8, 16-29 PRESDIV (bit field) 16-30 PRESDIV (register) 16-8, 16-10, 16-29 priority CALRAM overlay regions 22-11 channel service 19-4 Privilege level 3-7, 3-21 Processor version register 3-25 Program 3-51 exception 3-51 Programmable channel service priority 19-4 transfer length 15-15 Programmable time accumulator (PTA) D-3 parameters D-3, D-40, D-51 Propagation segment time (PROPSEG) 16-29 PROPSEG 16-13, 16-29 PSCK 19-12 PSEG1 16-30 PSEG2 16-10, 16-13, 16-30 PSEGS1 16-13 PSH 13-15, 13-48, 14-15 PSL 13-15 PT 15-47, 15-53 PTA D-3 PTR, 9-4, 9-38 Pulse-width modulation (PWM) D-44 parameters D-44 PVR 3-25 PWM D-44 Q QACR0 13-7, 13-15, 14-7 QACR1 13-7, 13-15, 14-7, 14-16 QACR2 13-7, 13-17, 13-18, 14-7, 14-18 QADC64E conversion queue operation 14-29 QADC64E module configuration register (QADCMCR) 13-7 QADCINT 13-7, 13-12, 14-11 QADCMCR 13-7, 13-8, 14-8 QADCTEST 13-7 QADMCR 13-8 QASR 13-8, 13-20, 14-7, 14-22 QCLK 13-47, 14-48 frequency 13-47, 14-48 QDDR 15-13, 15-42 QILR 15-9 QOM D-5 QPAR 15-12 QPDR 15-11, 15-42 QS 13-24, 14-25 QSCI1 registers QSCI1CR 15-59 QSCI1SR 15-59 QSM global registers 15-6 pin function 15-11 QSPI 15-14 operating modes 15-27 operation 15-25 RAM 15-22 registers MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-11 pin control registers 15-10 port QS data direction register (DDRQS) 15-10 data register (PORTQS) 15-11 QSCI control register 1 (QSCI1CR) 15-59 status register 1 (QSCI1SR) 15-59 QSPI control register 0 (SPCR0) 15-17 control register 1 (SPCR1) 15-19 control register 2 (SPCR2) 15-20 control register 3 (SPCR3) 15-20 status register (SPSR) 15-20 SCI control register 0 (SCCR0) 15-46 control register 1 (SCCR1) 15-47 data register (SCDR) 15-50 status register (SCSR) 15-48 SCI 15-42 operation 15-51 pins 15-51 registers 15-45 QSM Data Direction Register (QDDR) 15-13, 15-42 QSM Interrupt Level Register (QILR) 15-9 QSM Pin Assignment Register (QPAR) 15-12 QSM Port Data Register (QPDR) 15-11, 15-42 QSMCMMCR bit settings 15-9 QSPI 15-14 block diagram 15-15 enable (SPE) 15-19 finished flag (SPIF) 15-22 initialization operation 15-28 loop mode (LOOPQ) 15-21 master operation flow 15-29 operating modes 15-27 master mode 15-27, 15-34 wraparound mode 15-38 slave mode 15-27, 15-39 operation 15-25 peripheral chip-selects 15-37 RAM 15-22, 15-23 command RAM 15-23 receive RAM 15-23 transmit RAM 15-23 QSPI Enable (SPE) 15-42 QSPI Status Register (SPSR) 15-42 Queue 13-37, 14-38 1 completion flag (CF1) 13-21, 14-22 1 completion interrupt enable (CIE1) 13-16, 14-17 1 operating mode (MQ1) 13-16, 14-17 1 pause flag (PF1) 13-22, 14-23 1 pause interrupt enable (PIE1) 13-16, 14-17 1 single-scan enable bit (SSE1) 13-16, 14-17 1 trigger overrun (TOR1) 13-23, 14-24 2 completion flag (CF2) 13-22, 14-23 2 completion software interrupt enable (CIE2) 13-18, 14-19 2 operating mode (MQ2) 13-18, 14-19 2 pause flag (PF2) 13-23, 14-24 2 pause software interrupt enable (PIE2) 13-18, 14-19 2 single-scan enable bit (SSE2) 13-18, 14-19 2 trigger overrun (TOR2) 13-24, 14-25 pointers completed queue pointer (CPTQP) 15-25 end queue pointer (ENDQP) 15-25 new queue pointer (NEWQP) 15-25 priority 13-38, 14-39 priority schemes 13-54, 13-63, 14-53, 14-62 status (QS) 13-24, 14-25 queue SCI 15-59 Queued serial peripheral interface (QSPI) 15-14 Queued output match TPU function (QOM) D-5 R RAF 15-49 RAMBAR 20-4 RCW 7-11 RD/WR 9-4, 9-37 RDRF 15-49, 15-57 RE 15-46, 15-48, 15-57 RE bit 3-22, 3-25 read cycle, data bus requirements, 9-31 read/write (RD/WR), 9-37 READI compressed code mode guidelines 24-20, A-16 compression A-16 features 24-1 public messages 24-5 register map 24-8 signals 24-21 vendor-defined messages 24-5 real-time clock 6-19 Receive data register full (RDRF) 15-49 error status flag (RXWARN) 16-34 RAM 15-23 time sample clock (RT) 15-53, 15-57 receive buffer message code 16-5 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-12 Freescale Semiconductor Receiver active (RAF) 15-49 data register (RDRF) flag 15-57 enable (RE) 15-48, 15-57 interrupt enable (RIE) 15-48 wakeup (RWU) 15-48, 15-59 Receiver Enable (RE) 15-46 Reception of transmitted frames 16-14 Recoverable exception 3-22, 3-25 Register diagrams MPWMPERR MPWMSM period register 18-10, 18-12, 18-16, 18-17, 18-18, 18-19 registers BBCMCR BBC module configuration register 4-19 breakpoint address register (BAR) 23-53 breakpoint counter A value and control register (COUNTA) 23-45 breakpoint counter B value and control register (COUNTB) 23-46 CALRAM_OTR CALRAM ownership trace register 22-18 change of lock interrupt register (COLIR) 8-36 CMPA-CMPD 23-41 CMPE-CMPF 23-46 comparator G-H value registers (CMPG-CMPH) 23-47 condition register (CR) 3-16 conversion command word table (CCW) 13-30, 14-31 count register (CTR) 3-19 CRAM_RBAx CALRAM region base address register 22-16 CRAMMCR CALRAM module configuration register 22-13 CRAMOVL CALRAM overlay configuration register 22-17 DAE/source instruction service register (DSISR) 3-22 data address register (DAR) 3-23 DCCR0-DCCR15 decompressor class configuration registers A-19 debug enable register (DER) 23-43 decompressor class configuration 4-25 decrementer register (DEC) 6-40 development port data register (DER) 23-53 documenter register (DEC) 3-23 DPTRAM base address register (RAMBAR) 20-4 DPTRAM module configuration register (DPTMCR) 20-3 DPTRAM test register (DPTTCR) 20-4 dual-mapping base register (DMBR) 10-36 dual-mapping option register (DMOR) 10-37 EIBADR external interrupt relocation table base address register 4-25 exception cause register (ECR) 23-41 external master control register (EMCR) 6-29 floating point (FPRs) 3-12 floating point exception cause register (FPECR) 3-26 floating point status and control register (FPSCR) 3-13 general purpose registers (GPRs) 3-12 general SPRs 3-24 hard reset configuration word register (UC3FCFIG) 21-16 I-bus support control register (COUNTA) 23-51 I-bus support control register (ICTRL) A-16 implementation specific SPRs 3-25 integer exception register (XER) 3-18 internal memory map register (IMMR) 6-28 interrupt (QADCINT) 13-12, 14-11 interrupt in-service registers (SISR2 and SISR3) 6-37 IRAMSTBY control register (VSRMCR) 8-37 L2U global region attribute registers (L2U_GRA) 11-16 L2U module configuration register (L2U_MCR) 11-13 L2U region attribute registers (L2U_RAx) 11-15 L2U region base address registers (L2U_RBAx) 11-14 L-bus support control register 1 (LCTRL1) 23-47 L-bus support control register 2 (LCTRL2) 23-48 left justified, unsigned result format (LJURR) 13-33, 14-35 link register (LR) 3-19 machine state (MSR) 3-20 machine status save/restore register 0 (SRR0) 3-23 machine status save/restore register 1 (SRR1) 3-23 MBISM interrupt registers 17-69 MBISM registers, list of 17-13 MCPSM register organization 17-17, 17-62 MCPSMSCR MCPSM status/control register 17-18 MDASM status/control register (duplicated) (MDASMSCRD) 17-43 MDASM status/control register (MDASMSCR) 17-44 MDASMAR MDASM Data A register 17-41 MDASMBR MDASM Data B register 17-42 memory controller base registers (BR0-BR3) 10-32 memory controller option registers (OR0-OR3) 10-34 memory controller status registers (MSTAT) 10-32 MI_GRA global region atribute register 4-23 MI_RA [0:3] region attribute register 4-22 MI_RBA[0:3] region base address register 4-21 MIOS14ER0 interrupt enable register 17-66 MIOS14ER1 interrupt enable register 17-68 MIOS14LVL0 interrupt level register 0 17-69 MIOS14LVL1 interrupt level register 1 17-70 MIOS14MCR module configuration register 17-15 MIOS14RPR0 interrupt request pending register 0 17-67 MIOS14RPR1 interrupt request pending register 1 17-68 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-13 MIOS14SR0 interrupt status register 17-66 MIOS14SR1 interrupt status register 17-67 MIOS14TPCR test and signal control register 17-14 MIOS14TVECT vector register 17-14 MIOS14VNR module and version number register 17-14 MISC counter register (MISCNT) 20-6 MISR High register 20-5 MISR Low register 20-5 MMCSM registers 17-22 MMCSMCNT MMCSM up-counter register 17-23 MMCSMML MMCSM modulus latch register 17-24 MMCSMSCR MMCSM status/control register 17-24 MMSCM status/control register duplicated (MMCSMSCRD) 17-24 module configuration (QADC64E) 13-8 MPIOSMDDR MPIOSM data direction register 17-63 MPIOSMDR MPIOSM data register 17-62 MPWMCNTR MPWMSM counter register 17-58 MPWMPERR MPWMSM period register 17-57 MPWMPULR MPWMSM pulse width register 17-58 MPWMSCR MPWMSM status/control register 17-58 pads module configuration register (PDMCR) 2-22 pads module configuration register 2 (PDMCR2) 2-23 pending interrupt request register (UIPEND) 12-8 periodic interrupt status and control register (PISCR) 6-44 periodic interrupt timer count register (PITC) 6-45 periodic interrupt timer register (PITR) 6-45 PLL, low power, and reset control register (PLPRCR) 8-33 port A data register (PORTQA) 13-13 port B data register (PORTQB) 13-13 processor version register (PVR) 3-25 QACR0 control register 13-15, 14-14 QADC64E control register 1 (QACR1) 13-15, 14-16 QADC64E control register 2 (QACR2) 13-17, 13-18, 14-18 QADC64E module configuration (QADCMCR) 14-8 QADC64E PORTQA Port A data register 14-13 QADC64E PORTQA port A data register 13-13 READI data trace attribute 1 register (DTA1) 24-17 READI data trace attribute 2 register (DTA2) 24-17 READI development control register (DC) 24-10 READI device ID register (DID) 24-9 READI mode control register (MC) 24-11 READI ownership trace register (OTR) 24-8 READI read/write access register (RWA) 24-13 READI upload/download information register (UDI) 24-15 READI user base address register (UBA) 24-12 real-time clock alarm register (RTCAL) 6-44 real-time clock register (RTC) 6-43 real-time clock status and control register (RTCSC) 6-42 receive mask 16-7 reset status register (RSR) 7-5 SGPIO control register (SGPIOCR) 6-48 SGPIO data register 1 (SGPIODT1) 6-46 SGPIO data register 2 (SGPIODT2) 6-47 SIU interrupt edge level register (SIEL) 6-35 SIU interrupt mask registers (SIMASK) 6-33 SIU interrupt vector register (SIVEC) 6-35 SIU module configuration register (SIUMCR) 6-25 software service register (SWSR) 6-38 special purpose 3-44 added registers, 3-44 unsupported registers, 3-44 status (QASR) 13-20, 14-22 status (QASR0) 13-21, 14-22 status (QASR1) 13-27, 14-28 system clock and reset control register (SCCR) 8-30 system protection control register (SYPCR) 6-37 time base control and status register (TBSCR) 6-42 time base reference registers (TBREF0 and TBREF1) 6-41 time base SPR (TB) 3-23 time base SPR (TBSPR) 6-40 TOUCAN control register (CANCTRL0) 16-27 TOUCAN control register 0 (CANCTRL0) 16-27 TOUCAN control register 1 (CANCTRL1) 16-28 TOUCAN control register 2 (CANCTRL2) 16-30 TOUCAN error and status register (ESTAT) 16-33 TOUCAN error counters 16-36 TOUCAN free running timer (TIMER) 16-31 TOUCAN interrupt configuration register (CANICR) 16-27 TOUCAN interrupt flag register (IFLAG) 16-36 TOUCAN interrupt mask register (IMASK) 16-35 TOUCAN module configuration register (CANMCR) 16-25 TOUCAN prescaler divide register (PRESDIV) 16-29 TOUCAN receive buffer 14 mask registers 16-32 TOUCAN receive buffer 15 mask registers 16-33 TOUCAN receive global mask registers 16-31 TPU channel interrupt enable register (CIER) 19-15 TPU channel interrupt status register (CISR) 19-19 TPU channel priority register (CPR) 19-18 TPU development support control register (DSCR) 19-12 TPU function select register (CFSR) 19-15 TPU host sequence register (HSQR) 19-16 TPU host service request register (HSRR) 19-17 TPU interrupt configuration register (TICR) 19-14 TPU module configuration register (TPUMCR) 19-11 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-14 Freescale Semiconductor TPU module configuration register 2 (TPUMCR2) 19-19 TPU module configuration register 3 (TPUMCR3) 19-21 TPU support status register (DSSR) 19-13 transfer error status register (TESR) 6-39 UC3F configuration register (UC3FMCR) 21-5 UC3F extended configuration register (UC3FMCRE) 21-8 UC3F high voltage control register (UC3FCTL) 21-11 UIMB 12-6 UIMB module configuration register (UMCR) 12-7 USIU special purpose registers 5-6 Remote frames 16-17 transmission request (RTR) 16-5 transmission request field (RTR) 16-6 reservation of data 11-7 reservation protocol for a multi-level (local) bus, 9-43 Reserved channel number 13-31 mode 13-41, 14-42 Reset BBC behavior 4-6 configuration 7-7 soft reset configuration 7-13 sources of 7-3 status register 7-5 Resistor-divider chain 13-36, 14-37 Resolution time 13-35, 14-36 Result word table 13-2, 13-32, 13-37, 14-2, 14-34, 14-38 Resynchronization jump width (RJW) bit field 16-30 RETRY, 9-45 RF 13-75, 14-73 RIE 15-48 RJURR 13-33, 14-35 RJW 16-13, 16-30 RN field 3-16 RSR 7-5 RSV, 9-38 RT 15-57 RTC 6-19 RTC register 6-43 RTCAL 6-44 RTCSC 6-42 RTR 16-5, 16-17 RTR field 16-6 RWA 24-13 RWU 15-48, 15-59 RX14MSKHI 16-32 RX14MSKLO 16-32 RX15MSKHI 16-33 RX15MSKLO 16-33 RXECTR 16-36 RXGMSKHI 16-31 RXGMSKLO 16-31 RXWARN 16-34 S S0 15-9 SAMP 16-29 Sample amplifier bypass (BYP) 13-30, 14-31 Sampling mode (SAMP) 16-29 SAR 13-37, 14-38 SBK 15-48, 15-54 Scan modes continuous-scan modes external trigger 13-46, 14-47 periodic timer continuous-scan mode 13-47, 14-48 software initiated 13-45, 14-46 single-scan modes external trigger 13-43, 14-44 interval timer 13-44, 14-45 software initiated 13-42, 14-43 SCBR 15-46 SCCR 8-30 SCCR0 15-46 SCCR1 15-47 SCDR 15-50 SCI 15-34, 15-42 baud clock 15-52 rate (SCBR) 15-46 equation 15-46 idle-line detection 15-58 internal loop 15-59 operation 15-51 parity checking 15-53 pins 15-51 queue 15-59 receiver block diagram 15-44 operation 15-57 wakeup 15-58 registers 15-45 SCCR0 15-46 SCCR1 15-46 SCI Baud Rates 15-53 SCI SUBMODULE 15-13 SCSR 15-45 transmitter block diagram 15-43 operation 15-54 SCI Control Register 0 (SCCR0) 15-46 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-15 SCI Control Register 1 (SCCR1) 15-46 SCI Status Register (SCSR) 15-45 SCK 15-12, 15-34, 15-39 actual delay before SCK (equation) 15-36 baud rate (equation) 15-35 S-clock 16-8 SCSR 15-48 SE bit 3-21 SEE 23-42 Send break (SBK) 15-48, 15-54 Sequencer, instruction 3-3 Serial clock baud rate (SPBR) 15-18 communication interface (SCI) 15-42 formats 15-52 mode (M) bit 15-52 shifter 15-54 Serial Clock (SCK) 15-12 Serialization fetch 23-1 Service request breakpoint flag (SRBK) 19-14 SGLR 19-22 SGPIOCR 6-48 SGPIODT1 6-46 SGPIODT2 6-47 shadow row erasing 21-28 programming 21-24 select read 21-21 UC3F 21-15 show cycles L-bus 11-9 SIEL 6-35 Signals internal clock 8-7 MPC561/563 signals 2-3 multiplexing 2-20 SIMASK 6-33 SIMASK2 6-34 SIMASK3 6-35 Simplified mnemonics 3-33 Single-step trace enable 3-21 SIPEND 6-32 SIPEND2 6-32 SIPEND3 6-33 SISR2 6-37 SISR3 6-37 SIU interrupt pending registers (SIPEND) 6-32 SIU signals, 9-4 SIUMCR 6-25 SIVEC 6-35 SIW0EN 23-52, A-17 SIW1EN 23-52, A-17 SIW2EN 23-52, A-17 SIW3EN 23-52, A-17 Slave Select (SS) 15-42 Slave select signal (SS) 15-39 sleep 6-23 SLW0EN 23-50 SLW1EN 23-50 snooping L2U 11-9 snooping external bus activity, 3-43 SO bit 3-18 SOF 16-10 soft reset 7-2 Soft reset control field (SOFT_RST) 19-20 SOFT_RST 19-20 SOFTRST 16-12 Software initiated continuous-scan mode 13-45, 14-46 single-scan mode 13-42, 14-43 Software trap enable selection 23-52, A-17 software watchdog timer 6-21 SPBR 15-18 SPCR0 15-17 SPCR1 15-19 SPCR2 15-20 SPCR3 15-20 SPE 15-19, 15-42 special purpose registers 5-6 BBC 4-17 implementation-specific 3-25 special purpose registers, general 3-24 SPI finished interrupt enable (SPIFIE) 15-20 SPIF 15-22 SPIFIE 15-20 SPRG0-SPRG3 3-24 SPRGs 3-24 SPRs 5-6 BBC 4-17 general 3-24 SPSR 15-20, 15-42 SPWM D-48 SRAM supervisor space only 15-9 SRBK 19-14 SRESET 7-2 SRR field 16-6 SRR0 3-23, 3-45, 3-47, 3-55, 3-56, 3-57, 3-59, 3-60 SRR1 3-23, 3-45, 3-47, 3-49, 3-50, 3-52, 3-53, 3-54, 3-55, 3-56, 3-57, 3-59, 3-60 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-16 Freescale Semiconductor SS 15-42 SS 15-39 SSE1 13-16, 14-17 SSE2 13-18, 14-19 Standard message format 16-1 frames 16-4 standby operation 22-5 Star-point ground system 13-70, 14-68 Start bit (beginning of data frame) 15-51 -of-frame (SOF) symbol 16-10 State machine 13-47, 14-48, 15-57 Status register (QASR) 13-8, 13-20, 14-7, 14-22 STF 19-11 STOP 13-8, 13-9, 14-8, 16-18, 19-11 Stop clocks to TCRs (CLKS) 19-12 enable (STOP) 13-8, 14-8 enable (STOP) bit QSM 15-6 TOUCAN 16-18 TPU 19-11 flag (STF) 19-11 mode 13-9, 14-8 SCI end of data frame bit 15-51 storage control instructions, 3-45 storage reservation, 9-42 Stress conditions 13-76, 14-74 STUFFERR 16-34 Subqueue 13-38, 14-39 Substitute remote request field (SRR) 16-6 Successive approximation register (SAR) 13-37, 14-38 Summary overflow 3-18 Supervisor /Unrestricted data space (SUPV) 13-9, 14-8 /unrestricted data space (SUPV) TPU 19-11 Supervisor mode and SRAM 15-9 SUPV 13-9, 13-11, 14-8, 14-10 SUSG 23-48 SUSH 23-48 SWSR 6-38 SWT 6-21 Synchronized pulse-width modulation (SPWM) D-48 SYPCR 6-37 SYSE 23-42 SYSEE 23-44 System call exception 3-54 system clock output, 9-8 system reset exception 3-45 system reset interrupt, 3-45 T T1 13-54, 14-53 T2 13-54, 14-53 T2CFILTER 19-20 T2CG 19-7, 19-11 T2CLK pin filter control (T2CFILTER) 19-20 T2CSL 19-12 TA 9-6, 9-40 Table stepper motor (TSM) D-7 TAP controller 25-4 TB 6-19 TB register 3-23, 6-40 TBREF registers 6-41 TBRS1, TBRS0 - bits in BIUMCR 17-13 TBSCR 6-42 TBSPR 6-40 TC 15-49, 15-54 TCIE 15-47, 15-55 TCNMCR 16-25 TCODE 24-4 TCR1P 19-11 TCR2 clock/gate control (T2CG) 19-11 TDRE 15-49 TE 15-46, 15-48 TEA 9-6, 9-40 termination signals, 9-40 TESR 6-39 test register (DPTTCR) 20-4 Test register (QADCTEST) 13-7 TICR 19-14, 19-21 TIE 15-47, 15-55 Time quanta clock 16-8 stamp 16-4, 16-12 time base (TB) 6-19 time base bus selecting 17-13 time base register (TB) 3-23 timebase register 3-44 TIMER 16-31 Timer count register 1 prescaler control (TCR1P) 19-11 synchronize mode (TSYNC) 16-29 Timing, instruction 3-37 tool-mapped registers 24-9 TOR 13-55, 14-54 TOR1 13-23, 14-24 TOR2 13-24, 14-25 TOUCAN MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-17 address map 16-21 bit timing configuration 16-8, 16-10 external pins 16-2 initialization sequence 16-12 interrupts 16-20 message buffer address map 16-24 operation 16-3 receive process 16-14 registers control register 0 (CANCTRL0) 16-27 control register 1 (CTRL1) 16-8 control register 1(CANCTRL1) 16-28 control register 2 (CANCTRL2) 16-30 control register 2 (CTRL2) 16-8 error and status register (ESTAT) 16-33 free running timer register (TIMER) 16-31 interrupt configuration register (CANICR) 16-27 flag register (IFLAG) 16-36 mask register (IMASK) 16-35 module configuration register (TCNMCR) 16-25 receive buffer 14 mask registers (RX14MSKHI/LO) 16-32 buffer 15 mask registers (RX15MSKHI/LO) 16-33 global mask registers (RXGMSKLO/HI 16-31 RX/TX error counter registers (RXECTR/TXECTR) 16-36 test configuration register (CANTCR) 16-27 special operating modes 16-17 auto power save mode 16-19 debug mode 16-17 low-power stop mode 16-18 transmit process 16-13 TouCAN features 16-1 TPU address map 19-8 components 19-2 FREEZE flag (TPUF) 19-14 function library 19-4 host interface 19-2 interrupts 19-5 microengine 19-2 operation 19-3 coherency 19-4 emulation support 19-4 event timing 19-3 interchannel communication 19-4 programmable channel service priority 19-4 parameter RAM 19-2, 19-23 address map 19-23 registers channel function select registers (CFSR) 19-15 interrupt enable register (CIER) 19-5, 19-15 status register (CISR) 19-5, 19-19 priority registers (CPR) 19-18 development support control register (DSCR) 19-12 support status register (DSSR) 19-13 host sequence registers (HSQR) 19-16 service request registers (HSSR) 19-17 module configuration register (TPUMCR) 19-11 service grant latch register (SGLR) 19-22 TPU interrupt configuration register (TICR) 19-14, 19-21 scheduler 19-2 time bases 19-2 timer channels 19-2 TPU Reference Manual 19-3, 19-17 TPU2 module configuration register 2 (TPUMCR2) 19-19 TPU3 Emulation Mode Operation 20-7 TPUF 19-14 TPUMCR 19-11 TPUMCR2 19-19 TR 23-42 trace indicators 23-4 trace interrupt, 3-54 transaction (bus), 9-8 Transfer length options 15-37 time 13-35, 14-36 transfer acknowledge (TA), 9-40 transfer code 24-4 transfer error acknowledge (TEA), 9-40 transfer size (TSIZ), 9-38 transfer start (TS) 9-37 transfers alignment and packaging 9-29 burst-inhibited 9-18 termination signals 9-40 Transmission complete (TC) flag 15-54 interrupt enable (TCIE) 15-55 Transmit /receive status (TX/RX) 16-34 bit error (BITERR) 16-34 complete MPC561/MPC563 Reference Manual, Rev. 1.2 Index-18 Freescale Semiconductor bit (TC) 15-49 interrupt enable (TCIE) 15-47 data register empty (TDRE) flag 15-49 error status flag (TXWARN) 16-34 interrupt enable (TIE) 15-47, 15-55 pin configuration control (TXMODE) 16-28 RAM 15-23 Transmitter Enable (TE) 15-46 Transmitter enable (TE) 15-48, 15-54 TRE 23-44 Trigger event 13-28, 13-54, 14-29, 14-53 overrun error (TOR) 13-55, 14-54 TS signal 9-5, 9-37 TSIZ[0:1] 9-4, 9-38 TSIZ0 9-1 TSIZ1 9-1 TSM D-7 TSR 13-9, 14-8 TSYNC 16-29 TX/RX 16-34 TXECTR 16-36 TXMODE 16-28 TXWARN 16-34 U UART D-12 UBA 24-12 UC3F 512-Kbyte array 21-19 array addressing 21-15 censorship states 21-30 features 21-3 high voltage operations 21-21 operation 21-19 program sequencing 21-22 registers 21-5 shadow row 21-15 signals 21-4 UC3FCFIG register 21-16 UC3FCTL register 21-11 UC3FMCR register 21-5 UC3FMCRE register 21-8 UDI 24-15 UIMB interface features 12-1 UIMB module configuration register 12-7 UIPEND register 12-8 UMCR register 12-7 Universal asynchronous receiver/transmitter (UART) D-12 parameters receiver parameters D-13 transmitter parameters D-12 Unordered exceptions 3-35 User Instruction Set Architecture Book 1 instruction fetching, 3-40 User Instruction Set Architecture (Book 1) branch instructions, 3-40 branch processor, 3-40 computation modes, 3-39 exceptions, 3-40 fixed point-processor, 3-41 floating point processor, 3-41 instruction classes, 3-40 load/store processor, 3-42 reserved fields, 3-39 user-mapped registers READI 24-8 Using the TPU Function Library and TPU Emulation Mode 19-5 UX bit 3-14 V VCF 13-75, 14-73 VDDA 13-67, 13-71, 14-66, 14-70 VDDSYN 8-22 VE bit 3-15 Vector table, exception 3-36 Vector table, exceptions 3-36 VFLSn 23-30 VFn 23-2 VIH 13-66, 14-65 VIL 13-66, 14-65 Virtual Environment Architecture (Book 2) operand placement effects, 3-43 storage control instructions, 3-43 timebase register 3-44 Virtual Environment Architecture (VEA) 3-43 Voltage inputs 13-66, 14-65 reference pins 13-71, 14-69 VRH 13-31, 13-32, 13-36, 13-71, 13-75, 14-34, 14-37, 14-69, 14-70, 14-73 VRL 13-31, 13-36, 13-71, 13-75, 14-37, 14-69, 14-70, 14-73 VSRC 13-75, 14-73 VSRMCR 8-37 VSS 8-23 VSSA 13-67, 13-71, 14-66, 14-70 VSSSYN 8-22 VX bit 3-14 MPC561/MPC563 Reference Manual, Rev. 1.2 Freescale Semiconductor Index-19 VXCVI 3-15 VXIDI 3-14 VXIMZ bit 3-14 VXISI 3-14 VXSNAN 3-14 VXSOFT 3-15 VXSQRT 3-15 VXVC bit 3-15 VXZDZ bit 3-14 W WAKE 15-47, 15-59 Wake interrupt (WAKEINT) 16-35 WAKEINT 16-18, 16-35 WAKEMSK 16-18 Wakeup address mark (WAKE) 15-47, 15-59 watchpoint counters 23-19 watchpoints and breakpoints 23-9 Wired-OR mode for QSPI pins (WOMQ) 15-18 for SCI pins (WOMS) 15-47, 15-54 WOMQ 15-18 WOMS 15-47, 15-54 Wrap enable (WREN) 15-20 to (WRTO) 15-20 Wraparound mode 15-16 master 15-38 WREN 15-20 write cycle data bus contents, 9-32 WRTO 15-20 X XE bit 3-15 XER 3-18 XX bit 3-14 Z ZE 3-15 ZX bit 3-14 MPC561/MPC563 Reference Manual, Rev. 1.2 Index-20 Freescale Semiconductor