K10 Sub-Family Reference Manual Supports: MK10DX128ZVLQ10, MK10DX128ZVMD10, MK10DX256ZVLQ10, MK10DX256ZVMD10, MK10DN512ZVLQ10, MK10DN512ZVMD10 Document Number: K10P144M100SF2RM Rev.
K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 2 Freescale Semiconductor, Inc.
Contents Section Number Title Page Chapter 1 About This Document 1.1 1.2 Overview.......................................................................................................................................................................51 1.1.1 Purpose.........................................................................................................................................................51 1.1.2 Audience......................................................................
Section Number 3.2 3.3 3.4 3.5 Title Page Core modules................................................................................................................................................................63 3.2.1 ARM Cortex-M4 Core Configuration..........................................................................................................63 3.2.2 Nested Vectored Interrupt Controller (NVIC) Configuration......................................................................66 3.
Section Number 3.6 Title Page 3.5.5 System Register File Configuration.............................................................................................................102 3.5.6 VBAT Register File Configuration..............................................................................................................103 3.5.7 EzPort Configuration...................................................................................................................................104 3.5.
Section Number 3.7 3.8 3.9 3.10 Title Page Analog...........................................................................................................................................................................109 3.7.1 16-bit SAR ADC with PGA Configuration.................................................................................................109 3.7.2 CMP Configuration................................................................................................................
Section Number Title Page 4.4 SRAM memory map.....................................................................................................................................................153 4.5 Peripheral bridge (AIPS-Lite0 and AIPS-Lite1) memory maps...................................................................................153 4.6 4.5.1 Peripheral Bridge 0 (AIPS-Lite 0) Memory Map........................................................................................153 4.5.
Section Number Title Page Chapter 6 Reset and Boot 6.1 Introduction...................................................................................................................................................................177 6.2 Reset..............................................................................................................................................................................177 6.3 6.2.1 Power-on reset (POR)....................................................
Section Number Title Page Chapter 9 Debug 9.1 Introduction...................................................................................................................................................................199 9.1.1 9.2 References....................................................................................................................................................201 The Debug Port..............................................................................................
Section Number 10.2 10.3 10.4 Title Page Signal Multiplexing Integration....................................................................................................................................215 10.2.1 Port control and interrupt module features..................................................................................................216 10.2.2 Clock gating..............................................................................................................................
Section Number 11.5 Title Page 11.4.6 Digital Filter Clock Register (PORTx_DFCR)............................................................................................249 11.4.7 Digital Filter Width Register (PORTx_DFWR)..........................................................................................249 Functional description...................................................................................................................................................250 11.5.
Section Number 12.3 Title Page 12.2.16 System Clock Divider Register 2 (SIM_CLKDIV2)...................................................................................281 12.2.17 Flash Configuration Register 1 (SIM_FCFG1)...........................................................................................282 12.2.18 Flash Configuration Register 2 (SIM_FCFG2)...........................................................................................284 12.2.
Section Number Title Page 14.4.2 Low Voltage Detect Status and Control 2 Register (PMC_LVDSC2)........................................................314 14.4.3 Regulator Status and Control Register (PMC_REGSC)..............................................................................316 Chapter 15 Low-leakage wake-up unit (LLWU) 15.1 Introduction........................................................................................................................................................
Section Number 16.2 16.3 Title Page Memory Map/Register Descriptions.............................................................................................................................339 16.2.1 Crossbar switch (AXBS) slave configuration (MCM_PLASC)..................................................................340 16.2.2 Crossbar switch (AXBS) master configuration (MCM_PLAMC)..............................................................340 16.2.
Section Number 18.3 18.4 Title Page Memory Map/Register Definition.................................................................................................................................363 18.3.1 Control/Error Status Register (MPU_CESR)..............................................................................................366 18.3.2 Error Address Register, Slave Port n (MPU_EARn)...................................................................................368 18.3.
Section Number Title Page Chapter 20 Direct memory access multiplexer (DMAMUX) 20.1 Introduction...................................................................................................................................................................401 20.1.1 Overview......................................................................................................................................................401 20.1.2 Features..........................................................
Section Number Title Page 21.3.6 Set Enable Error Interrupt Register (DMA_SEEI)......................................................................................441 21.3.7 Clear Enable Request Register (DMA_CERQ)...........................................................................................442 21.3.8 Set Enable Request Register (DMA_SERQ)...............................................................................................443 21.3.
Section Number 21.3.31 Title Page TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled) (DMA_TCDn_BITER_ELINKNO)............................................................................................................467 21.4 21.5 Functional description...................................................................................................................................................468 21.4.1 eDMA basic data flow..................................................
Section Number Title Page 22.4.3 EWM Counter..............................................................................................................................................496 22.4.4 EWM Compare Registers............................................................................................................................496 22.4.5 EWM Refresh Mechanism...........................................................................................................................
Section Number 23.8 23.9 Title Page 23.7.9 Watchdog Timer Output Register High (WDOG_TMROUTH).................................................................515 23.7.10 Watchdog Timer Output Register Low (WDOG_TMROUTL)..................................................................515 23.7.11 Watchdog Reset Count Register (WDOG_RSTCNT).................................................................................516 23.7.12 Watchdog Prescaler Register (WDOG_PRESC)...........................
Section Number 24.5 Title Page 24.4.3 MCG Internal Reference Clocks..................................................................................................................541 24.4.4 External Reference Clock............................................................................................................................542 24.4.5 MCG Fixed Frequency Clock .....................................................................................................................542 24.
Section Number Title Page Chapter 26 RTC Oscillator 26.1 26.2 Introduction...................................................................................................................................................................569 26.1.1 Features and Modes.....................................................................................................................................569 26.1.2 Block Diagram.................................................................................
Section Number 27.5 Title Page 27.4.9 Cache Data Storage (lower word) (FMC_DATAW0SnL)..........................................................................594 27.4.10 Cache Data Storage (upper word) (FMC_DATAW1SnU)..........................................................................595 27.4.11 Cache Data Storage (lower word) (FMC_DATAW1SnL)..........................................................................596 27.4.12 Cache Data Storage (upper word) (FMC_DATAW2SnU).................
Section Number Title Page 28.4.9 Flash Program and Erase..............................................................................................................................635 28.4.10 FTFL Command Operations........................................................................................................................635 28.4.11 Margin Read Commands.............................................................................................................................644 28.4.
Section Number 29.4 29.5 Title Page Functional Description..................................................................................................................................................690 29.4.1 Chip-Select Operation..................................................................................................................................690 29.4.2 Data Transfer Operation.........................................................................................................
Section Number Title Page Chapter 31 Cyclic redundancy check (CRC) 31.1 31.2 31.3 Introduction...................................................................................................................................................................737 31.1.1 Features........................................................................................................................................................737 31.1.2 Block diagram...................................................
Section Number 32.4 Title Page 32.3.3 Configuration register 2 (ADCx_CFG2)......................................................................................................759 32.3.4 ADC data result register (ADCx_Rn)..........................................................................................................760 32.3.5 Compare value registers (ADCx_CVn).......................................................................................................761 32.3.
Section Number 32.5 Page 32.4.5 Conversion control.......................................................................................................................................779 32.4.6 Automatic compare function........................................................................................................................786 32.4.7 Calibration function...................................................................................................................................
Section Number 33.8 33.9 Title Page CMP Functional Description........................................................................................................................................815 33.8.1 CMP Functional Modes...............................................................................................................................816 33.8.2 Power Modes...............................................................................................................................
Section Number 34.5.4 Title Page Low Power Mode Operation........................................................................................................................844 Chapter 35 Voltage Reference (VREFV1) 35.1 35.2 35.3 35.4 Introduction...................................................................................................................................................................847 35.1.1 Overview......................................................................
Section Number 36.4 36.5 Title Page 36.3.4 Interrupt Delay Register (PDBx_IDLY)......................................................................................................864 36.3.5 Channel n Control Register 1 (PDBx_CHnC1)...........................................................................................865 36.3.6 Channel n Status Register (PDBx_CHnS)...................................................................................................866 36.3.
Section Number 37.3 Title Page 37.2.3 FAULTj — FTM Fault Input.......................................................................................................................882 37.2.4 PHA — FTM Quadrature Decoder Phase A Input......................................................................................883 37.2.5 PHB — FTM Quadrature Decoder Phase B Input.......................................................................................883 Memory Map and Register Definition....
Section Number 37.4 Title Page 37.3.26 FTM Software Output Control (FTMx_SWOCTRL)..................................................................................931 37.3.27 FTM PWM Load (FTMx_PWMLOAD).....................................................................................................933 Functional Description..................................................................................................................................................935 37.4.1 Clock Source.....
Section Number Title Page 37.4.27 Intermediate Load........................................................................................................................................1005 37.4.28 Global Time Base (GTB).............................................................................................................................1007 37.5 Reset Overview.....................................................................................................................................
Section Number 39.1.2 39.2 39.4 Page Modes of operation......................................................................................................................................1023 LPTMR signal descriptions..........................................................................................................................................1024 39.2.1 39.3 Title Detailed signal descriptions.................................................................................................
Section Number 40.7 40.8 Title Page 40.6.3 CMT Carrier Generator High Data Register 2 (CMT_CGH2)....................................................................1042 40.6.4 CMT Carrier Generator Low Data Register 2 (CMT_CGL2).....................................................................1042 40.6.5 CMT Output Control Register (CMT_OC).................................................................................................1043 40.6.
Section Number 41.3 Title Page 41.2.7 RTC Lock Register (RTC_LR)....................................................................................................................1067 41.2.8 RTC Interrupt Enable Register (RTC_IER).................................................................................................1068 41.2.9 RTC Write Access Register (RTC_WAR)..................................................................................................1069 41.2.
Section Number 42.4 42.5 Title Page 42.3.7 Rx 15 Mask Register (CANx_RX15MASK)...............................................................................................1099 42.3.8 Error Counter (CANx_ECR)........................................................................................................................1100 42.3.9 Error and Status 1 Register (CANx_ESR1).................................................................................................1101 42.3.
Section Number Title Page Chapter 43 SPI (DSPI) 43.1 43.2 43.3 43.4 Introduction...................................................................................................................................................................1161 43.1.1 Block Diagram.............................................................................................................................................1161 43.1.2 Features.........................................................................
Section Number 43.5 Title Page 43.4.2 Serial Peripheral Interface (SPI) Configuration...........................................................................................1190 43.4.3 DSPI Baud Rate and Clock Delay Generation.............................................................................................1194 43.4.4 Transfer Formats..........................................................................................................................................1198 43.4.
Section Number 44.4 44.5 Title Page 44.3.9 I2C SMBus Control and Status register (I2Cx_SMB).................................................................................1227 44.3.10 I2C Address Register 2 (I2Cx_A2)..............................................................................................................1228 44.3.11 I2C SCL Low Timeout Register High (I2Cx_SLTH)..................................................................................1229 44.3.
Section Number 45.4 Title Page 45.3.7 UART Control Register 3 (UARTx_C3).....................................................................................................1272 45.3.8 UART Data Register (UARTx_D)...............................................................................................................1273 45.3.9 UART Match Address Registers 1 (UARTx_MA1)....................................................................................1275 45.3.
Section Number Title Page 45.4.4 Data format (non ISO-7816)........................................................................................................................1319 45.4.5 Single-wire operation...................................................................................................................................1322 45.4.6 Loop operation.......................................................................................................................................
Section Number 46.4 Title Page Memory map and register definition.............................................................................................................................1346 46.4.1 DMA System Address Register (SDHC_DSADDR)..................................................................................1347 46.4.2 Block Attributes Register (SDHC_BLKATTR)..........................................................................................1348 46.4.
Section Number 46.5 46.6 46.7 Title Page Functional description...................................................................................................................................................1394 46.5.1 Data buffer...................................................................................................................................................1394 46.5.2 DMA crossbar switch interface...................................................................................
Section Number Title Page Chapter 47 Integrated interchip sound (I2S) 47.1 Introduction...................................................................................................................................................................1449 47.1.1 Block diagram..............................................................................................................................................1449 47.1.2 Features....................................................................
Section Number 47.4 47.5 Title Page Functional description...................................................................................................................................................1491 47.4.1 Detailed operating mode descriptions..........................................................................................................1491 47.4.2 I2S clocking..........................................................................................................................
Section Number 49.3 49.4 49.5 49.7 49.8 Page Overview.......................................................................................................................................................................1532 49.3.1 Electrode capacitance measurement unit.....................................................................................................1532 49.3.2 Electrode scan unit.....................................................................................................
Section Number 50.2 50.3 50.4 50.5 Title Page 50.1.2 Features........................................................................................................................................................1562 50.1.3 Modes of operation......................................................................................................................................1562 External signal description............................................................................................
K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 50 Freescale Semiconductor, Inc.
Chapter 1 About This Document 1.1 Overview 1.1.1 Purpose This document describes the features, architecture, and programming model of the Freescale K10 microcontroller. 1.1.2 Audience This document is primarily for system architects and software application developers who are using or considering using the K10 microcontroller in a system. 1.2 Conventions 1.2.1 Numbering systems The following suffixes identify different numbering systems: This suffix Identifies a b Binary number.
Conventions 1.2.2 Typographic notation The following typographic notation is used throughout this document: Example Description placeholder, x Items in italics are placeholders for information that you provide. Italicized text is also used for the titles of publications and for emphasis. Plain lowercase letters are also used as placeholders for single letters and numbers. code Fixed-width type indicates text that must be typed exactly as shown.
Chapter 2 Introduction 2.1 Overview This chapter provides an overview of the Kinetis portfolio and K10 family of products. It also presents high-level descriptions of the modules available on the devices covered by this document. 2.2 K10 Family Introduction The K10 family is the entry point into the Kinetis portfolio.
Module Functional Categories Table 2-1.
Chapter 2 Introduction 2.3.1 ARM Cortex-M4 Core Modules The following core modules are available on this device. Table 2-2. Core modules Module Description ARM Cortex-M4 The ARM Cortex-M4 is the newest member of the Cortex M Series of processors targeting microcontroller cores focused on very cost sensitive, deterministic, interrupt driven environments.
Module Functional Categories Table 2-3. System modules (continued) Module Description Low-leakage wakeup unit (LLWU) The LLWU module allows the device to wake from low leakage power modes (LLS and VLLS) through various internal peripheral and external pin sources. Miscellaneous control module (MCM) The MCM includes integration logic and embedded trace buffer details.
Chapter 2 Introduction Table 2-4. Memories and memory interfaces (continued) Module Description System register file 32-byte register file that is accessible during all power modes and is powered by VDD. VBAT register file 32-byte register file that is accessible during all power modes and is powered by VBAT. Serial programming interface (EzPort) Same serial interface as, and subset of, the command set used by industrystandard SPI flash memories.
Module Functional Categories 2.3.6 Analog modules The following analog modules are available on this device: Table 2-7. Analog modules Module Description 16-bit analog-to-digital converters (ADC) 16-bit successive-approximation ADC designed with integrated programmable and programmable-gain amplifiers gain amplifiers (PGA) (PGA) Analog comparators Compares two analog input voltages across the full range of the supply voltage.
Chapter 2 Introduction Table 2-8.
Orderable part numbers Table 2-9. Communication modules Module Description Controller Area Network (CAN) Supports the full implementation of the CAN Specification Version 2.0, Part B Serial peripheral interface (SPI) Synchronous serial bus for communication to an external device Inter-integrated circuit (I2C) Allows communication between a number of devices. Also supports the System Management Bus (SMBus) Specification, version 2.
Chapter 2 Introduction Table 2-11. Orderable part numbers summary (continued) Freescale part number CPU frequenc y Pin count Package Total flash memory Program flash EEPROM SRAM GPIO MK10DX256ZVMD10 100 MHz 144 MAPBGA 512 KB 256 KB 4 KB 64 KB 104 MK10DN512ZVLQ10 100 MHz 144 LQFP 512 KB 512 KB — 128 KB 104 MK10DN512ZVMD10 100 MHz 144 MAPBGA 512 KB 512 KB — 128 KB 104 K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Orderable part numbers K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 62 Freescale Semiconductor, Inc.
Chapter 3 Chip Configuration 3.1 Introduction This chapter provides details on the individual modules of the microcontroller. It includes: • module block diagrams showing immediate connections within the device, • specific module-to-module interactions not necessarily discussed in the individual module chapters, and • links for more information. 3.2 Core modules 3.2.1 ARM Cortex-M4 Core Configuration This section summarizes how the module has been configured in the chip.
Core modules Debug Interrupts PPB ARM Cortex-M4 Core Crossbar switch PPB Modules SRAM Upper SRAM Lower Figure 3-1. Core configuration Table 3-1. Reference links to related information Topic Related module Reference Full description ARM Cortex-M4 core, r0p0 http://www.arm.
Chapter 3 Chip Configuration Bus name Description Instruction code (ICODE) bus The ICODE and DCODE buses are muxed. This muxed bus is called the CODE bus and is connected to the crossbar switch via a single master port. In addition, the CODE bus is also Data code (DCODE) bus tightly coupled to the lower half of the system RAM (SRAM_L). System bus The system bus is connected to a separate master port on the crossbar. In addition, the system bus is tightly coupled to the upper half system RAM (SRAM_U).
Core modules 3.2.2 Nested Vectored Interrupt Controller (NVIC) Configuration This section summarizes how the module has been configured in the chip. Full documentation for this module is provided by ARM and can be found at http:// www.arm.com. ARM Cortex-M4 core Interrupts Module Nested Vectored Interrupt Controller (NVIC) PPB Module Module Figure 3-2. NVIC configuration Table 3-2.
Chapter 3 Chip Configuration 3.2.2.3 Interrupt channel assignments The interrupt source assignments are defined in the following table. • Vector number — the value stored on the stack when an interrupt is serviced. • IRQ number — non-core interrupt source count, which is the vector number minus 16. The IRQ number is used within ARM's NVIC documentation. Table 3-4.
Core modules Table 3-4. Interrupt vector assignments (continued) Address IRQ1 Vector NVIC NVIC non-IPR IPR register register number number 2 Source module Source description 3 0x0000_0054 21 5 0 1 DMA DMA channel 5 transfer complete 0x0000_0058 22 6 0 1 DMA DMA channel 6 transfer complete 0x0000_005C 23 7 0 1 DMA DMA channel 7 transfer complete 0x0000_0060 24 8 0 2 DMA DMA channel 8 transfer complete 0x0000_0064 25 9 0 2 DMA DMA channel 9 transfer complete .
Chapter 3 Chip Configuration Table 3-4.
Core modules Table 3-4.
Chapter 3 Chip Configuration Table 3-4.
Core modules • NVICIABR2 • NVICIPR21 • To determine the particular IRQ's bitfield location within these particular registers: • NVICISER2, NVICICER2, NVICISPR2, NVICICPR2, NVICIABR2 bit location = IRQ mod 32 = 21 • NVICIPR21 bitfield starting location = 8 * (IRQ mod 4) + 4 = 12 Since the NVICIPR bitfields are 4-bit wide (16 priority levels), the NVICIPR21 bitfield range is 12-15 Therefore, the following bitfield locations are used to configure the LPTMR interrupts: • • • • • • NVICISER2[21] NVICICER2[21]
Chapter 3 Chip Configuration Table 3-6. Reference links to related information (continued) Topic Related module Power management Reference Power management Nested Vectored Interrupt Controller (NVIC) Wake-up requests NVIC AWIC wake-up sources 3.2.3.1 Wake-up sources The device uses the following internal and external inputs to the AWIC module. Table 3-7.
JTAG controller Signal multiplexing cJTAG System modules Figure 3-4. JTAGC Controller configuration Table 3-8. Reference links to related information Topic Related module Reference Full description JTAGC JTAGC Signal multiplexing Port control Signal multiplexing 3.3 System modules 3.3.1 SIM Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter.
Chapter 3 Chip Configuration 3.3.2 Mode Controller Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bridge Resets Mode controller Power management controller (PMC) Register access Figure 3-6. Mode controller configuration Table 3-10.
System modules Peripheral bridge Mode controller Register access Power management controller (PMC) Figure 3-7. PMC configuration Table 3-11. Reference links to related information Topic Related module Reference Full description PMC PMC System memory map System memory map Power management Power management Full description Mode Controller Mode Controller Low-Leakage Wakeup Unit (LLWU) LLWU 3.3.
Chapter 3 Chip Configuration Table 3-12. Reference links to related information (continued) Topic Related module Reference Clocking Clock distribution Power management Power management chapter Power Management Controller (PMC) Power Management Controller (PMC) Mode Controller Mode Controller Wake-up requests LLWU wake-up sources 3.3.4.
System modules up the MCU from any non-VLLSx mode with the NMI function selected in its port control register asserts an NMI exception on low power mode recovery. The same occurs when recovering from VLLSx modes if EzPort is disabled; otherwise, EzPort mode is entered. See the "EzPort Configuration" section in this chapter for more information. 2. Requires the peripheral and the peripheral interrupt to be enabled. The LLWU's WUME bit enables the internal module flag as a wakeup input.
Chapter 3 Chip Configuration Master Modules Slave Modules Crossbar Switch M1 ARM core system bus SRAM backdoor M2 Mux S1 DMA Flash controller Memory protection unit (MPU) S0 M0 ARM core code bus Peripheral bridge 0 S2 EzPort S3 Mux Peripheral bridge 1 MPU FlexBus M5 S4 GPIO controller SDHC Figure 3-10. Crossbar switch integration Table 3-15.
System modules Table 3-15. Reference links to related information (continued) Topic Related module Reference Crossbar switch slave FlexBus FlexBus 3.3.6.1 Crossbar Switch Master Assignments The masters connected to the crossbar switch are assigned as follows: Master module Master port number ARM core code bus 0 ARM core system bus 1 DMA/EzPort 2 SDHC 5 NOTE The DMA and EzPort share a master port.
Chapter 3 Chip Configuration Peripheral bridge 0 Register access Logical Master Transfers Transfers Logical Master Memory Protection Unit (MPU) Slave Slave Logical Master Slave Figure 3-11. Memory Protection Unit configuration Table 3-16.
System modules 3.3.7.2 MPU Logical Bus Master Assignments The logical bus master assignments for the MPU are: Table 3-18. MPU Logical Bus Master Assignments MPU Logical Bus Master Number Bus Master 0 Core 1 Debugger 2 DMA 3 none 4 none 5 SDHC 6 none 7 none 3.3.7.3 MPU Access Violation Indications Access violations detected by the MPU are signaled to the appropriate bus master as shown below: Table 3-19.
Chapter 3 Chip Configuration Table 3-20. Reset Values for RGD0 Registers Register Reset value RGD0_WORD0 0000_0000h RGD0_WORD1 FFFF_FFFFh RGD0_WORD2 0061_F7DFh RGD0_WORD3 0000_0001h RGDAAC0 0061_F7DFh 3.3.7.5 Write Access Restrictions for RGD0 Registers In addition to configuring the initial state of RGD0, the MPU implements further access control on writes to the RGD0 registers.
Transfers Transfers AIPS-Lite peripheral bridge Peripherals Crossbar switch System modules Figure 3-12. Peripheral bridge configuration Table 3-22. Reference links to related information Topic Related module Reference Full description Peripheral bridge (AIPS-Lite) Peripheral bridge (AIPS-Lite) System memory map System memory map Clocking Clock Distribution Crossbar switch Crossbar switch Crossbar switch 3.3.8.
Chapter 3 Chip Configuration 3.3.8.5 PACR registers Each of the two peripheral bridges support up to 128 peripherals each assigned to an PACRx field within the PACRA-PACRP registers. However, fewer peripherals are supported on this device. See AIPS0 Memory MapandAIPS1 Memory Map for details of the peripheral slot assignments for this device. Unused PACRx fields are reserved. 3.3.8.
System modules 3.3.9.1 DMA MUX request sources This device includes a DMA request mux that allows up to 63 DMA request signals to be mapped to any of the 16 DMA channels. Because of the mux there is not a hard correlation between any of the DMA request sources and a specific DMA channel. Table 3-24.
Chapter 3 Chip Configuration Table 3-24.
System modules Table 3-24. DMA request sources - MUX 0 (continued) Source number Source module Source description 61 DMA MUX Always enabled 62 DMA MUX Always enabled 63 DMA MUX Always enabled 1. Configuring a DMA channel to select source 0 or any of the reserved sources disables that DMA channel. 3.3.9.2 DMA transfers via PIT trigger The PIT module can trigger a DMA transfer on the first four DMA channels. The assignments are detailed at PIT/DMA Periodic Trigger Assignments . 3.3.
Chapter 3 Chip Configuration 3.3.11 External Watchdog Monitor (EWM) Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bridge 0 External Watchdog Monitor (EWM) Module signals Signal multiplexing Register access Figure 3-15. External Watchdog Monitor configuration Table 3-26.
System modules Table 3-28. EWM low-power modes Module mode Chip mode Wait Wait, VLPW Stop Stop, VLPS, LLS Power Down VLLS3, VLLS2, VLLS1 3.3.11.3 EWM_OUT pin state in low power modes During Wait, Stop and Power Down modes the EWM_OUT pin enters a high-impedance state. A user has the option to control the logic state of the pin using an external pull device or by configuring the internal pull device.
Chapter 3 Chip Configuration 3.3.12.1 WDOG clocks This table shows the WDOG module clocks and the corresponding chip clocks. Table 3-30. WDOG clock connections Module clock Chip clock LPO Oscillator 1 kHz LPO Clock Alt Clock Bus Clock Fast Test Clock Bus Clock System Bus Clock Bus Clock 3.3.12.2 WDOG low-power modes This table shows the WDOG low-power modes and the corresponding chip low-power modes. Table 3-31.
Clock Modules Peripheral bridge System integration module (SIM) RTC System oscillator oscillator Register access Multipurpose Clock Generator (MCG) Figure 3-17. MCG configuration Table 3-32. Reference links to related information Topic Related module Reference Full description MCG MCG System memory map System memory map Clocking Clock distribution Power management Power management Signal multiplexing Port control Signal multiplexing 3.4.
Chapter 3 Chip Configuration Table 3-33. Reference links to related information (continued) Topic Related module Reference Power management Power management Signal multiplexing Port control Signal multiplexing Full description MCG MCG 3.4.2.1 OSC modes of operation with MCG The MCG's C2 register bits configure the oscillator frequency range. See the OSC and MCG chapters for more details. 3.4.
Memories and Memory Interfaces Peripheral bus controller 0 Flash memory controller Register access Transfers Flash memory Figure 3-20. Flash memory configuration Table 3-35. Reference links to related information Topic Related module Reference Full description Flash memory Flash memory System memory map System memory map Clocking Clock Distribution Transfers Flash memory controller Flash memory controller Register access Peripheral bridge Peripheral bridge 3.5.1.
Chapter 3 Chip Configuration • For devices that contain FlexNVM: 1 block of program flash consisting of 2 KB sectors • For devices that contain FlexNVM: 1 block of FlexNVM consisting of 2 KB sectors • For devices that contain FlexNVM: 1 block of FlexRAM The amounts of flash memory for the devices covered in this document are: Device Program flash (KB) Block 0 (PFlash) address range1 FlexNVM (KB) Block 1 (FlexNVM/ PFlash) address range1 FlexRAM (KB) FlexRAM address range MK10DX128ZV LQ10 128 0x0000
Memories and Memory Interfaces 3.5.1.4 Flash Memory Map The various flash memories and the flash registers are located at different base addresses as shown in the following figure. The base address for each is specified in System memory map. Flash memory base address Registers Program flash base address Flash configuration field Program flash Programming acceleration RAM base address RAM Figure 3-21.
Chapter 3 Chip Configuration 3.5.1.6 Flash Modes The flash memory operates in NVM normal and NVM special modes. The flash memory enters NVM special mode when the EzPort is enabled (EZP_CS asserted during reset), or the system is under debug mode. Otherwise, flash memory operates in NVM normal mode. 3.5.1.7 Erase All Flash Contents In addition to software, the entire flash memory may be erased external to the flash memory in two ways: 1. Via the EzPort by issuing a bulk erase (BE) command.
Memories and Memory Interfaces Peripheral bus controller 0 Transfers Flash memory controller Transfers Flash memory Memory protection unit Crossbar switch Register access Figure 3-23. Flash memory controller configuration Table 3-36.
Chapter 3 Chip Configuration • FMC_PFB0CR controls the upper code addresses (now in block 0) • FMC_PFB1CR controls the lower code addresses (now in block 1) 3.5.3 SRAM Configuration Cortex-M4 core MPU Crossbar switch MPU SRAM controller This section summarizes how the module has been configured in the chip. SRAM upper Transfers SRAM lower Figure 3-24. SRAM configuration Table 3-37.
Memories and Memory Interfaces 3.5.3.2 SRAM Arrays The on-chip SRAM is split into two equally-sized logical arrays, SRAM_L and SRAM_U. The on-chip RAM is implemented such that the SRAM_L and SRAM_U ranges form a contiguous block in the memory map. As such: • SRAM_L is anchored to 0x1FFF_FFFF and occupies the space before this ending address. • SRAM_U is anchored to 0x2000_0000 and occupies the space after this beginning address.
Chapter 3 Chip Configuration In VLLS1 no SRAM is retained. However, the 32-byte register file is available in VLLS1. 3.5.3.4 SRAM accesses The SRAM is split into two logical arrays that are 32-bits wide. • SRAM_L — Accessible by the code bus of the Cortex-M4 core and by the backdoor port. • SRAM_U — Accessible by the system bus of the Cortex-M4 core and by the backdoor port. The backdoor port makes the SRAM accessible to the non-core bus masters (such as DMA).
Memories and Memory Interfaces NOTE Burst-access cannot occur across the 0x2000_0000 boundary that separates the two SRAM arrays. The two arrays should be treated as separate memory ranges for burst accesses. 3.5.3.5 SRAM arbitration and priority control The MCM's SRAMAP register controls the arbitration and priority schemes for the two SRAM arrays. 3.5.
Chapter 3 Chip Configuration Peripheral bridge 0 Register access Register file Figure 3-28. System Register file configuration Table 3-39. Reference links to related information Topic Related module Reference Full description Register file Register file System memory map System memory map Clocking Clock distribution Power management Power management 3.5.5.1 System Register file This device includes a 32-byte register file that is powered in all power modes.
Memories and Memory Interfaces Peripheral bridge Register access VBAT register file Figure 3-29. VBAT Register file configuration Table 3-40. Reference links to related information Topic Related module Reference Full description VBAT register file VBAT register file System memory map System memory map Clocking Clock distribution Power management Power management 3.5.6.1 VBAT register file This device includes a 32-byte register file that is powered in all power modes and is powered by VBAT.
Chapter 3 Chip Configuration Table 3-41. Reference links to related information (continued) Topic Related module Reference System memory map System memory map Clocking Clock Distribution Transfers Crossbar switch Crossbar switch Signal Multiplexing Port control Signal Multiplexing 3.5.7.1 JTAG instruction The system JTAG controller implements an EZPORT instruction.
Memories and Memory Interfaces Peripheral bridge 0 Transfers FlexBus Module signals Signal multiplexing Memory protection unit Crossbar switch Register access Figure 3-31. FlexBus configuration Table 3-42.
Chapter 3 Chip Configuration FB_CS4 FB_TSIZ0 Group2 FB_BE_31_24 Reserved FB_CS5 FB_TSIZ1 Group3 FB_BE_23_16 Reserved FB_TBST FB_CS2 Group4 FB_BE_15_8 Reserved FB_TA FB_CS3 Group5 FB_BE_7_0 External Pins Reserved To other modules Group1 FB_TS To other modules FB_CS1 To other modules FB_ALE To other modules CSPMCR Port Control Module To other modules FlexBus Reserved Figure 3-32. FlexBus control signal multiplexing K10 Sub-Family Reference Manual, Rev.
Security Therefore, use the CSPMCR and port control registers to configure which control signal is available on the external pin. All control signals, except for FB_TA, are assigned to the ALT5 function in the port control module. Since, unlike the other control signals, FB_TA is an input signal, it is assigned to the ALT6 function. 3.5.8.3 FlexBus CSCR0 reset value On this device the CSCR0 resets to 0x003F_FC00. Configure this register as needed before performing any FlexBus access. 3.5.8.
Chapter 3 Chip Configuration Peripheral bridge Register access CRC Figure 3-33. CRC configuration Table 3-43. Reference links to related information Topic Related module Reference Full description CRC CRC System memory map System memory map Power management Power management 3.7 Analog 3.7.1 16-bit SAR ADC with PGA Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter.
Analog Table 3-44. Reference links to related information (continued) Topic Related module Reference System memory map System memory map Clocking Clock distribution Power management Power management Signal multiplexing Port control Signal multiplexing 3.7.1.1 ADC instantiation information This device contains two ADCs. Each ADC contains a PGA channel for a total of two separate PGAs. 3.7.1.1.
Chapter 3 Chip Configuration 3.7.1.3.
Analog 5. ADCx_CFG2[MUXSEL] bit selects between ADCx_SEn channels a and b. Refer to MUXSEL description in ADC chapter for details. 6. Interleaved with ADC1_SE8 7. Interleaved with ADC1_SE9 8. Interleaved with ADC1_DM3 9. This is the PMC bandgap 1V reference voltage not the VREF module 1.2 V reference voltage. Prior to reading from this ADC channel, ensure that you enable the bandgap buffer by setting the PMC_REGSC[BGBE] bit. Refer to the device data sheet for the bandgap voltage (VBG) specification. 3.7.1.
Chapter 3 Chip Configuration ADC Channel (SC1n[ADCH]) Channel Input signal (SC1n[DIFF]= 1) Input signal (SC1n[DIFF]= 0) 10011 AD19 Reserved ADC1_DM08 10100 AD20 Reserved ADC1_DM1 10101 AD21 Reserved Reserved 10110 AD22 Reserved 10111 AD23 Reserved 12-bit DAC1 Output 11000 AD24 Reserved Reserved 11001 AD25 Reserved Reserved 11010 AD26 Temperature Sensor (Diff) 11011 AD27 Bandgap (Diff)9 11100 AD28 Reserved Reserved 11101 AD29 -VREFH (Diff) VREFH (S.
Analog 3.7.1.6 ADC Hardware Interleaved Channels The AD8 and AD9 channels on ADCx are interleaved in hardware using the following configuration. ADC0 ADC0_SE8/ADC1_SE8 AD8 ADC0_SE9/ADC1_SE9 AD9 AD8 ADC1 AD9 Figure 3-36. ADC hardware interleaved channels integration 3.7.1.7 ADC and PGA Reference Options The ADC supports the following references: • VREFH/VREFL - connected as the primary reference option • 1.
Chapter 3 Chip Configuration 3.7.1.8 ADC triggers The ADC supports both software and hardware triggers. The primary hardware mechanism for triggering the ADC is the PDB. The PDB itself can be triggered by other peripherals. For example: RTC (Alarm, Seconds) signal is connected to the PDB. The PDB trigger can receive the RTC (alarm/seconds) trigger input forcing ADC conversions in run mode (where PDB is enabled). On the other hand, the ADC can conduct conversions in low power modes, not triggered by PDB.
Analog 3.7.1.
Chapter 3 Chip Configuration Peripheral bridge 0 Other peripherals CMP Module signals Signal multiplexing Register access Figure 3-38. CMP configuration Table 3-46. Reference links to related information Topic Related module Reference Full description Comparator (CMP) Comparator System memory map System memory map Clocking Clock distribution Power management Power management Signal multiplexing Port control Signal multiplexing 3.7.2.
Analog 3.7.2.3 External window/sample input PDB pulse-out controls the CMP Sample/Window timing. 3.7.3 12-bit DAC Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bus controller 0 Transfers Other peripherals 12-bit DAC Module signals Signal multiplexing Register access Figure 3-39. 12-bit DAC configuration Table 3-47.
Chapter 3 Chip Configuration 3.7.3.3 12-bit DAC Reference For this device VREF_OUT and VDDA are selectable as the DAC reference. VREF_OUT is connected to the DACREF_1 input and VDDA is connected to the DACREF_2 input. Use DACx_C0[DACRFS] control bit to select between these two options. Be aware that if the DAC and ADC use the VREF_OUT reference simultaneously, some degradation of ADC accuracy is to be expected due to DAC switching. 3.7.
Timers The voltage reference can provide a reference voltage to external peripherals or a reference to analog peripherals, such as the ADC, DAC, or CMP. NOTE For either an internal or external reference if the VREF_OUT functionality is being used, VREF_OUT signal must be connected to an output load capacitor. Refer the device data sheet for more details. 3.8 Timers 3.8.1 PDB Configuration This section summarizes how the module has been configured in the chip.
Chapter 3 Chip Configuration 3.8.1.1.1 3.8.1.1.2 PDB Output Triggers Table 3-50. PDB output triggers Number of PDB channels for ADC trigger 2 Number of pre-triggers per PDB channel 2 Number of DAC triggers 2 Number of PulseOut 1 PDB Input Trigger Connections Table 3-51.
Timers 3.8.1.
Chapter 3 Chip Configuration NOTE Application code can set the PDBx_DACINTCn[EXT] bit to allow DAC external trigger input when the corresponding ADC Conversion complete flag, ADCx_SC1n[COCO], is set. 3.8.1.6 Pulse-Out Connection The Pulse-Out of PDB is connected to all the CMP blocks and used as the sample window. 3.8.1.7 Pulse-Out Enable Register Implementation The following table shows the comparison of pulse-out enable register at the module and chip level. Table 3-52.
Timers Peripheral bus controller 0 Transfers FlexTimer Other peripherals Module signals Signal multiplexing Register access Figure 3-43. FlexTimer configuration Table 3-53. Reference links to related information Topic Related module Reference Full description FlexTimer FlexTimer System memory map System memory map Clocking Clock distribution Power management Power management Signal multiplexing Port control Signal multiplexing 3.8.2.
Chapter 3 Chip Configuration 3.8.2.2 External Clock Options By default each FTM is clocked by the internal bus clock (the FTM refers to it as system clock). Each module contains a register setting that allows the module to be clocked from an external clock instead. There are two external FTM_CLKINx pins that can be selected by any FTM module via the SOPT4 register in the SIM module. 3.8.2.3 Fixed frequency clock The fixed frequency clock for each FTM is MCGFFCLK. 3.8.2.
Timers • FTM0 hardware trigger 0 = CMP0 Output • FTM0 hardware trigger 1 = PDB channel 1 Trigger Output • FTM0 hardware trigger 2 = FTM0_FLT0 pin • FTM1 hardware trigger 0 = CMP0 Output • FTM1 hardware trigger 1 = CMP1 Output • FTM1 hardware trigger 2 = FTM1_FLT0 pin • FTM2 hardware trigger 0 = CMP0 Output • FTM2 hardware trigger 1 = CMP2 Output • FTM2 hardware trigger 2 = FTM2_FLT0 pin 3.8.2.
Chapter 3 Chip Configuration FTM1 CONF Register GTBEOUT = 0 GTBEEN = 1 FTM0 CONF Register GTBEOUT = 1 GTBEEN = 1 FTM Counter gtb_in gtb_in FTM Counter FTM2 gtb_out CONF Register GTBEOUT = 0 GTBEEN = 1 FTM Counter gtb_in Figure 3-44. FTM Global Time Base Configuration 3.8.2.10 FTM BDM and debug halt mode In the FTM chapter, references to the chip being in "BDM" are the same as the chip being in “debug halt mode". 3.8.
Timers 3.8.3.1 PIT/DMA Periodic Trigger Assignments The PIT generates periodic trigger events to the DMA Mux as shown in the table below. Table 3-56. PIT channel assignments for periodic DMA triggering DMA Channel Number PIT Channel DMA Channel 0 PIT Channel 0 DMA Channel 1 PIT Channel 1 DMA Channel 2 PIT Channel 2 DMA Channel 3 PIT Channel 3 3.8.3.2 PIT/ADC Triggers PIT triggers are selected as ADCx trigger sources using the SOPT7[ADCxTRGSEL] bits in the SIM module.
Chapter 3 Chip Configuration Table 3-57. Reference links to related information (continued) Topic Related module Reference Power management Signal Multiplexing Power management Port control Signal Multiplexing 3.8.4.1 LPTMR prescaler/glitch filter clocking options The prescaler and glitch filter of the LPTMR module can be clocked from one of four sources determined by the LPTMR0_PSR[PCS] bitfield. The following table shows the chip-specific clock assignments for this bitfield.
Timers 3.8.5 CMT Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bus controller 0 CMT Module signals Signal multiplexing Register access Figure 3-47. CMT configuration Table 3-58.
Chapter 3 Chip Configuration 3.8.6 RTC configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bridge Module signals Real-time clock Signal multiplexing Register access Figure 3-48. RTC configuration Table 3-59.
Communication interfaces 3.9 Communication interfaces 3.9.1 CAN Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bridge FlexCAN Module signals Signal multiplexing Register access Figure 3-49. CAN configuration Table 3-60.
Chapter 3 Chip Configuration 3.9.1.3 Number of message buffers Each FlexCAN module contains 16 message buffers. Each message buffer is 16 bytes. 3.9.1.4 FlexCAN Clocking 3.9.1.4.1 Clocking Options The FlexCAN module has a register bit CANCTRL[CLK_SRC] that selects between clocking the FlexCAN from the internal bus clock or the input clock (EXTAL). 3.9.1.4.2 Clock Gating The clock to each CAN module can be gated on and off using the SCGCn[CANx] bits.
Communication interfaces 3.9.1.6 FlexCAN Operation in Low Power Modes The FlexCAN module is operational in VLPR and VLPW modes. With the 2 MHz bus clock, the fastest supported FlexCAN transfer rate is 256 kbps. The bit timing parameters in the module must be adjusted for the new frequency, but full functionality is possible. The FlexCAN module can be configured to generate a wakeup interrupt in STOP and VLPS modes.
Chapter 3 Chip Configuration 3.9.2.1 SPI Modules Configuration This device contains three SPI modules. 3.9.2.2 SPI clocking The SPI module is clocked by the internal bus clock (the DSPI refers to it as system clock). The module has an internal divider, with a minimum divide is two. So, the SPI can run at a maximum frequency of bus clock/2. 3.9.2.3 Number of CTARs SPI CTAR registers define different transfer attribute configurations. The SPI module supports up to eight CTAR registers.
Communication interfaces 3.9.2.6 Number of PCS signals The following table shows the number of peripheral chip select signals available per SPI module. Table 3-64. SPI PCS signals SPI Module PCS Signals SPI0 SPI_PCS[5:0] SPI1 SPI_PCS[3:0] SPI2 SPI_PCS[1:0] 3.9.2.7 SPI Operation in Low Power Modes In VLPR and VLPW modes the SPI is functional; however, the reduced system frequency also reduces the max frequency of operation for the SPI. In VLPR and VLPW modes the max SPI_CLK frequency is 1MHz.
Chapter 3 Chip Configuration 3.9.2.8 SPI Doze Mode The Doze mode for the SPI module is the same as the Wait and VLPW modes for the chip. 3.9.2.9 SPI Interrupts The SPI has multiple sources of interrupt requests. However, these sources are OR'd together to generate a single interrupt request per SPI module to the interrupt controller. When an SPI interrupt occurs, read the SPI_SR to determine the exact interrupt source. 3.9.2.
Communication interfaces Peripheral bridge I2 C Module signals Signal multiplexing Register access Figure 3-51. I2C configuration Table 3-66. Reference links to related information Topic Related module Reference Full description I2C I 2C System memory map System memory map Clocking Clock Distribution Power management Power management Signal Multiplexing Port control Signal Multiplexing 3.9.3.1 Number of I2C modules This device has two I2C modules. 3.9.
Chapter 3 Chip Configuration Peripheral bridge Module signals UART Signal multiplexing Register access Figure 3-52. UART configuration Table 3-67. Reference links to related information Topic Related module Reference Full description UART UART System memory map System memory map Clocking Clock Distribution Power management Power management Signal Multiplexing Port control Signal Multiplexing 3.9.4.1 UART configuration information This device contains six UART modules.
Communication interfaces 3.9.4.2 UART wakeup The UART can be configured to generate an interrupt/wakeup on the first active edge that it receives. 3.9.4.3 UART interrupts The UART has multiple sources of interrupt requests. However, some of these sources are OR'd together to generate a single interrupt request.
Chapter 3 Chip Configuration Source UART 0 UART 1 UART 2 UART 3 UART 4 UART 5 Wait timer (ISO7816) x — — — — — Character wait x timer (ISO7816) — — — — — Block wait timer x (ISO7816) — — — — — Guard time violation (ISO7816) — — — — — x 3.9.5 SDHC Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter.
Communication interfaces • • • • Core/system clock MCGPLLCLK or MCGFLLCLK EXTAL Bypass clock from off-chip (SDHC0_CLKIN) 3.9.5.2 SD bus pullup/pulldown constraints The SD standard requires the SD bus signals (except the SD clock) to be pulled up during data transfers. The SDHC also provides a feature of detecting card insertion/removal, by detecting voltage level changes on DAT[3] of the SD bus. To support this DAT[3] must be pulled down.
Chapter 3 Chip Configuration NOTE The I2S master clock can be output on the I2S0_MCLK pin or input on the I2S0_CLKIN pin. Using the I2S0_RX_BCLK pin to output the I2S master clock in synchronous mode is not supported on this device. 3.9.6.1 Interrupts The interrupt outputs from the I2S module are OR'd to create a single interrupt to the interrupt control logic. 3.9.6.2 DMA requests The I2S module has two DMA requests: • Transmit FIFO • Receive FIFO 3.9.6.
Human-machine interfaces (HMI) In VLPR and VLPW modes, the I2S is functional. However, the I2S is limited to 400 kHz maximum frequency. 3.10 Human-machine interfaces (HMI) 3.10.1 GPIO configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bridge Transfers Module signals GPIO controller Signal multiplexing Crossbar switch Register access Figure 3-55.
Chapter 3 Chip Configuration 3.10.1.2 Number of GPIO signals The number of GPIO signals available on the devices covered by this document are detailed in Orderable part numbers. 3.10.2 TSI Configuration This section summarizes how the module has been configured in the chip. For a comprehensive description of the module itself, see the module’s dedicated chapter. Peripheral bridge Touch sense input module Module signals Signal multiplexing Register access Figure 3-56. TSI configuration Table 3-71.
Human-machine interfaces (HMI) 3.10.2.2 TSI module functionality in MCU operation modes Table 3-72.
Chapter 3 Chip Configuration 3.10.2.4 TSI Interrupts The TSI has multiple sources of interrupt requests. However, these sources are OR'd together to generate a single interrupt request. When a TSI interrupt occurs, read the TSI status register to determine the exact interrupt source. 3.10.2.5 Shield drive signal The shield drive signal is not supported on this device. Ignore this feature in the TSI chapter. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Human-machine interfaces (HMI) K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 148 Freescale Semiconductor, Inc.
Chapter 4 Memory Map 4.1 Introduction This device contains various memories and memory-mapped peripherals which are located in one 32-bit contiguous memory space. This chapter describes the memory and peripheral locations within that memory space. 4.2 System memory map The following table shows the high-level device memory map. Table 4-1.
System memory map Table 4-1.
Chapter 4 Memory Map A 32-bit read in the alias region returns either: • a value of 0x0000_0000 to indicate the target bit is clear • a value of 0x0000_0001 to indicate the target bit is set Bit-band region 31 Alias bit-band region 31 0 32 MByte 1 MByte 0 Figure 4-1. Alias bit-band mapping NOTE Each bit in bit-band region has an equivalent bit that can be manipulated through bit 0 in a corresponding long word in the alias bit-band region. 4.
Flash Memory Map Flash memory base address Registers Program flash base address Flash configuration field Program flash Programming acceleration RAM base address RAM Figure 4-2. Flash memory map for devices containing only program flash Flash memory base address Registers Program flash base address Flash configuration field Program flash FlexNVM base address FlexNVM FlexRAM base address FlexRAM Figure 4-3. Flash memory map for devices containing FlexNVM 4.3.
Chapter 4 Memory Map 4.4 SRAM memory map The on-chip RAM is split evenly among SRAM_L and SRAM_U. The RAM is also implemented such that the SRAM_L and SRAM_U ranges form a contiguous block in the memory map. See SRAM Arrays for details. Accesses to the SRAM_L and SRAM_U memory ranges outside the amount of RAM on the device causes the bus cycle to be terminated with an error followed by the appropriate response in the requesting bus master. 4.
Peripheral bridge (AIPS-Lite0 and AIPS-Lite1) memory maps 4.5.1 Peripheral Bridge 0 (AIPS-Lite 0) Memory Map Table 4-2.
Chapter 4 Memory Map Table 4-2.
Peripheral bridge (AIPS-Lite0 and AIPS-Lite1) memory maps Table 4-2.
Chapter 4 Memory Map Table 4-2.
Peripheral bridge (AIPS-Lite0 and AIPS-Lite1) memory maps Table 4-3.
Chapter 4 Memory Map Table 4-3.
Peripheral bridge (AIPS-Lite0 and AIPS-Lite1) memory maps Table 4-3.
Chapter 4 Memory Map Table 4-3.
Private Peripheral Bus (PPB) memory map 4.6 Private Peripheral Bus (PPB) memory map The PPB is part of the defined ARM bus architecture and provides access to select processor-local modules. These resources are only accessible from the core; other system masters do not have access to them. Table 4-4.
Chapter 5 Clock Distribution 5.1 Introduction The MCG module controls which clock source is used to derive the system clocks. The clock generation logic divides the selected clock source into a variety of clock domains, including the clocks for the system bus masters, system bus slaves, and flash memory. The clock generation logic also implements module-specific clock gating to allow granular shutoff of modules. The primary clocks for the system are generated from the MCGOUTCLK clock.
Clock definitions OSC MCG SIM Muliplexers MCG_Cx MCG_Cx SIM_SOPT1, SIM_SOPT2 Dividers — MCG_Cx SIM_CLKDIVx Clock gates OSC_CR MCG_C1 SIM_SCGCx SIM 4 MHz IRC ÷2 MCGIRCLK CG 32 kHz IRC MCGFFCLK ÷2 FLL OUTDIV1 CG Core / system clocks OUTDIV2 CG Bus clock OUTDIV3 CG FlexBus clock OUTDIV4 CG Flash clock MCGOUTCLK PLL MCGFLLCLK FRDIV MCGPLLCLK MCGPLLCLK/ MCGFLLCLK System oscillator EXTAL OSCCLK XTAL_CLK XTAL EXTAL32 XTAL32 OSC logic OSCERCLK CG Clock options for so
Chapter 5 Clock Distribution Clock name Description Bus clock MCGOUTCLK divided by OUTDIV2 clocks the bus slaves and peripheral (excluding memories) FlexBus clock MCGOUTCLK divided by OUTDIV3 clocks the external FlexBus interface Flash clock MCGOUTCLK divided by OUTDIV4 clocks the flash memory MCGIRCLK MCG output of the slow or fast internal reference clock MCGFFCLK MCG output of the slow internal reference clock or a divided MCG external reference clock.
Clock definitions Table 5-1.
Chapter 5 Clock Distribution 5.5 Internal clocking requirements The clock dividers are programmed via the SIM module’s CLKDIV registers. Each divider is programmable from a divide-by-1 through divide-by-16 setting. The following requirements must be met when configuring the clocks for this device: 1. The core and system clock frequencies must be 100 MHz or slower. 2. The bus clock frequency must be programmed to 50 MHz or less and an integer divide of the core clock. 3.
Clock Gating 5.5.1 Clock divider values after reset Each clock divider is programmed via the SIM module’s CLKDIVn registers.
Chapter 5 Clock Distribution 5.7 Module clocks The following table summarizes the clocks associated with each module. Table 5-2.
Module clocks Table 5-2.
Chapter 5 Clock Distribution 5.7.2 WDOG clocking The WDOG may be clocked from two clock sources as shown in the following figure. LPO WDOG clock Bus clock WDOG_STCTRLH[CLKSRC] Figure 5-2. WDOG clock generation 5.7.3 Debug trace clock The debug trace clock source can be clocked as shown in the following figure. MCGOUTCLK TRACECLKIN TPIU TRACE_CLKOUT ÷2 Core / system clock SIM_SOPT2[TRACECLKSEL] Figure 5-3.
Module clocks NOTE In stop mode, the digital input filters are bypassed unless they are configured to run from the 1 kHz LPO clock source. Bus clock PORTx digital input filter clock LPO PORTx_DFCR[CS] Figure 5-4. PORTx digital input filter clock generation 5.7.5 LPTMR clocking The prescaler and glitch filters in each of the LPTMRx modules can be clocked as shown in the following figure. NOTE The chosen clock must remain enabled if the LPTMRx is to continue operating in all required low-power modes.
Chapter 5 Clock Distribution OSCERCLK FlexCAN clock Bus clock CANx_CTRL1[CLKSRC] Figure 5-6. FlexCAN clock generation 5.7.7 UART clocking UART0 and UART1 modules operate from the core/system clock, which provides higher performance level for these modules. All other UART modules operate from the bus clock. 5.7.8 SDHC clocking The SDHC module has four possible clock sources for the external clock source, as shown in the following figure.
Module clocks 5.7.9 I2S clocking In addition to the bus clock, the I2S has a clock source for master clock generation. The maximum frequency of this clock is 50 MHz. The master clock source can be derived from several sources, as shown in the following figure. Core/system clock MCGPLLCLK or MCGFLLCLK SIM_CLKDIV2 [I2SFRAC,I2SDIV] 2 I S master clock OSCERCLK I2S_CLKIN SIM_SOPT2[I2SSRC] Figure 5-8. I2S baud clock generation 5.7.
Chapter 5 Clock Distribution LPO TSI clock in low-power mode ERCLK32K TSI_GENCS[LPCLKS] Figure 5-10. TSI low-power clock generation K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Module clocks K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 176 Freescale Semiconductor, Inc.
Chapter 6 Reset and Boot 6.1 Introduction The following reset sources are supported in this MCU: Table 6-1.
Reset 6.2.1 Power-on reset (POR) When power is initially applied to the MCU or when the supply voltage drops below the power-on reset re-arm voltage level (VPOR), the POR circuit causes a POR reset condition. As the supply voltage rises, the LVD circuit holds the MCU in reset until the supply has risen above the LVD low threshold (VLVDL). The POR and LVD bits in SRSL register are set following a POR. 6.2.
Chapter 6 Reset and Boot 6.2.2.1 External pin reset (PIN) On this device, RESET is a dedicated pin. This pin is open drain and has an internal pullup device. Asserting RESET wakes the device from any mode. During a pin reset, the SRSL[PIN] bit is set. 6.2.2.1.1 Reset pin filter The RESET pin supports digital filtering in all modes of operation. For LLS and VLLSx modes, the LLWU provides an optional fixed digital filter running off the 1 kHz LPO clock. See the LLWU chapter for operation of this filter.
Reset The LVD can be configured to generate a reset upon detection of a low voltage condition by setting LVDSC1[LVDRE]. After an LVD reset has occurred, the LVD system holds the MCU in reset until the supply voltage rises above the low voltage detection threshold. The SRSL[LVD] bit is set following an LVD reset or POR. 6.2.2.
Chapter 6 Reset and Boot The MC_SRSL[LOC] bit is set to indicate the error. 6.2.2.6 Software reset (SW) The SYSRESETREQ bit in the NVIC application interrupt and reset control register can be set to force a software reset on the device. (See ARM's NVIC documentation for the full description of the register fields, especially the VECTKEY field requirements.) Setting SYSRESETREQ generates a software reset request. This reset forces a system reset of all major components except for the debug module.
Reset 6.2.3 Debug resets The following sections detail the debug resets available on the device. 6.2.3.1 JTAG reset The JTAG module generate a system reset when certain IR codes are selected. This functional reset is asserted when EzPort, EXTEST, HIGHZ and CLAMP instructions are active. The reset source from the JTAG module is released when any other IR code is selected. A JTAG reset causes the SRSH[JTAG] bit to set. 6.2.3.2 nTRST reset The nTRST pin causes a reset of the JTAG logic when asserted.
Chapter 6 Reset and Boot • • • • • • DWT ITM NVIC Crossbar bus switch1 AHB-AP1 Private peripheral bus1 6.3 Boot This section describes the boot sequence, including sources and options. 6.3.1 Boot sources This device only supports booting from internal flash. Any secondary boot must go through an initialization sequence in flash. 6.3.2 Boot options The device's functional mode is controlled by the state of the EzPort chip select (EZP_CS) pin during reset.
Boot reprogram the option byte in flash to change the FOPT values that are used for subsequent resets. For more details on programming the option byte, refer to the flash memory chapter. The MCU uses the FTFL_FOPT register bits to configure the device at reset as shown in the following table. Table 6-3. Flash Option Register (FTFL_FOPT) Bit Definitions Bit Num Field 7-2 Reserved 1 EZPORT_DIS 0 LPBOOT Value Definition Reserved for future expansion. 0 EzPort operation is disabled.
Chapter 6 Reset and Boot 4. The RESET pin is released, but the system reset of internal logic continues to be held until the Flash Controller finishes initialization. EzPort mode is selected instead of the normal CPU execution if EZP_CS is low when the internal reset is deasserted. EzPort mode can be disabled by programming FTFL_FOPT[EZPORT_DIS].
Boot K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 186 Freescale Semiconductor, Inc.
Chapter 7 Power Management 7.1 Introduction This chapter describes the various chip power modes and functionality of the individual modules in these modes. 7.2 Power modes The power management controller (PMC) provides multiple power options to allow the user to optimize power consumption for the level of functionality needed.
Power modes Table 7-1. Chip power modes (continued) Chip mode Description Normal Wait via WFI Allows peripherals to function while the core is in sleep mode, reducing power. NVIC remains sensitive to interrupts; peripherals continue to be clocked. Normal Stop via WFI Places chip in static state. Lowest power mode that retains all registers while maintaining LVD protection. NVIC is disabled; AWIC is used to wake up from interrupt; peripheral clocks are stopped.
Chapter 7 Power Management Table 7-1. Chip power modes (continued) Chip mode BAT (backup battery only) Description Core mode Normal recovery method Off Power-up Sequence The chip is powered down except for the VBAT supply. The RTC and the 32-byte VBAT register file for customer-critical data remain powered. 1. Resumes normal run mode operation by executing the LLWU interrupt service routine. 2. Follows the reset flow with the LLWU interrupt flag set for the NVIC. 7.
Power mode transitions 7.4 Power mode transitions The following figure shows the power mode transitions. Any reset always brings the chip back to the normal run state. In run, wait, and stop modes active power regulation is enabled. The VLPx modes are limited in frequency, but offer a lower power operating mode than normal modes. The LLS and VLLSx modes are the lowest power stop modes based on amount of logic or memory that is required to be retained by the application.
Chapter 7 Power Management 7.5 Power modes shutdown sequencing When entering stop or other low-power modes, the clocks are shut off in an orderly sequence to safely place the chip in the targeted low-power state. All low-power entry sequences are initiated by the core executing an WFI instruction.
Module Operation in Low Power Modes • powered = Memory is powered to retain contents. • low power = Flash has a low power state that retains configuration registers to support faster wakeup. • OFF = Modules are powered off; module is in reset state upon wakeup. • wakeup = Modules can serve as a wakeup source for the chip. Table 7-2.
Chapter 7 Power Management Table 7-2.
Clock Gating 1. Using the LLWU module, the external pins available for this chip do not require the associated peripheral function to be enabled. It only requires the function controlling the pin (GPIO or peripheral) to be configured as an input to allow a transition to occur to the LLWU. 2. A 4KB portion of SRAM_U block is left powered on in low power mode VLLS2. 3. FlexRAM is always powered in VLLS3. When the FlexRAM is configured for traditional RAM, optionally powered in VLLS2 mode.
Chapter 8 Security 8.1 Introduction This device implements security based on the mode selected from the flash module. The following sections provide an overview of flash security and details the effects of security on non-flash modules. 8.2 Flash Security The flash module provides security information to the MCU based on the state held by the FSEC[SEC] bits. The MCU, in turn, confirms the security request and limits access to flash resources.
Security Interactions with other Modules 8.3 Security Interactions with other Modules The flash security settings are used by the SoC to determine what resources are available. The following sections describe the interactions between modules and the flash security settings or the impact that the flash security has on non-flash modules. 8.3.1 Security interactions with FlexBus When flash security is enabled, SIM_SOPT2[FBSL] enables/disables off-chip accesses through the FlexBus interface.
Chapter 8 Security When mass erase is disabled, mass erase via the debugger is blocked. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Security Interactions with other Modules K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 198 Freescale Semiconductor, Inc.
Chapter 9 Debug 9.1 Introduction This device's debug is based on the ARM coresight architecture and is configured in each device to provide the maximum flexibility as allowed by the restrictions of the pinout and other available resources. Four debug interfaces are supported: • • • • IEEE 1149.1 JTAG IEEE 1149.7 JTAG (cJTAG) Serial Wire Debug (SWD) ARM Real-Time Trace Interface The basic Cortex-M4 debug architecture is very flexible.
Introduction INTNMI INTISR[239:0] SLEEPING Cortex-M4 Interrupts Sleep NVIC Core ETM Debug SLEEPDEEP Instr. Trigger Data ETB AWIC Trace port (serial wire or multi-pin) TPIU MCM FPB DWT ITM Private Peripheral Bus (internal) ROM Table APB i/f I-code bus Bus Matrix SW/ JTAG SWJ-DP D-code bus Code bus System bus AHB-AP MDM-AP Figure 9-1. Cortex-M4 Debug Topology The following table presents a brief description of each one of the debug components. Table 9-1.
Chapter 9 Debug Table 9-1. Debug Components Description (continued) Module Description DWT (Data and Address Watchpoints) 4 data and address watchpoints (configurable for less, but 4 seems to be accepted) FPB (Flash Patch and Breakpoints) The FPB implements hardware breakpoints and patches code and data from code space to system space. The FPB unit contains two literal comparators for matching against literal loads from Code space, and remapping to a corresponding area in System space.
The Debug Port IR==BYPASSor IDCODE 4’b1111 or 4’b0000 jtag_updateinstr[3:0] A TDI nTRST TCK TMS TDO TRACESWO TDO TDI TDO TDI (1’b1 = 4-pin JTAG) (1’b0 = 2-pin cJTAG) To Test Resources CJTAG TDI TDO PEN TDO TDI nSYS_TDO nSYS_TDI nTRST 1’b1 SWCLKTCK TCK JTAGC nSYS_TRST TCK TMS_OUT TMS_OUT_OE SWDITMS nSYS_TCK nSYS_TMS AHB-AP JTAGir[3:0] TMS_IN IR==BYPASSor IDCODE JTAGNSW A DAP Bus 4’b1111 or 4’b1110 MDM-AP TMS SWDO SWDOEN SWDSEL JTAGSEL SWDITMS SWCLKTCK SWD/ JTAG SELECT Figure
Chapter 9 Debug 2. Set the control level to 2 via zero-bit scans 3. Execute the Store Format (STFMT) command (00011) to set the scan format register to 1149.7 scan format 9.3 Debug Port Pin Descriptions The debug port pins default after POR to their JTAG functionality with the exception of JTAG_TRST_b and can be later reassigned to their alternate functionalities. In cJTAG and SWD modes JTAG_TDI and JTAG_TRST_b can be configured to alternate GPIO functions. Table 9-2.
JTAG status and control registers 9.4.1 IR Codes Table 9-3.
Chapter 9 Debug It is important to note that these DAP control and status registers are not memory mapped within the system memory map and are only accessible via the Debug Access Port (DAP) using JTAG, cJTAG, or SWD. The MDM-AP is accessible as Debug Access Port 1 with the available registers shown in the table below. Table 9-4.
JTAG status and control registers 9.5.1 MDM-AP Control Register Table 9-5. MDM-AP Control register assignments Bit 0 Secure1 Name Flash Mass Erase in Progress Y Description Set to cause mass erase. Cleared by hardware after mass erase operation completes. When mass erase is disabled (via MEEN and SEC settings), the erase request does not occur and the Flash Mass Erase in Progress bit continues to assert until the next system reset. 1 Debug Disable N Set to disable debug.
Chapter 9 Debug Table 9-5. MDM-AP Control register assignments (continued) Bit 7 Secure1 Name LLS, VLLSx Status Acknowledge N Description Set this bit to acknowledge the DAP LLS and VLLS Status bits have been read. This acknowledge automatically clears the status bits. This bit is used by the debugger to clear the sticky LLS and VLLSx mode entry status bits. This bit is asserted and cleared by the debugger. 8– 31 Reserved for future use N 1. Command available in secure mode 9.5.
Debug Resets Table 9-6. MDM-AP Status register assignments (continued) Bit 7 Name LP Enabled Description Decode of LPLLSM control bits to indicate that VLPS, LLS, or VLLSx are the selected power mode the next time the ARM Core enters Deep Sleep. 0 Low Power Stop Mode is not enabled 1 Low Power Stop Mode is enabled Usage intended for debug operation in which Run to VLPS is attempted. Per debug definition, the system actually enters the Stop state.
Chapter 9 Debug • Debug reset (CDBGRSTREQ bit within the SWJ-DP CTRL/STAT register) in the TCLK domain that allows the debugger to reset the debug logic. • TRST asserted via the cJTAG escape command. • System POR reset Conversely the debug system is capable of generating system reset using the following mechanism: • A system reset in the DAP control register which allows the debugger to hold the system in reset.
ITM 9.8 ITM The ITM is an application-driven trace source that supports printf style debugging to trace Operating System (OS) and application events, and emits diagnostic system information. The ITM emits trace information as packets. There are four sources that can generate packets. If multiple sources generate packets at the same time, the ITM arbitrates the order in which packets are output. The four sources in decreasing order of priority are: 1.
Chapter 9 Debug 9.11 Coresight Embedded Trace Buffer (ETB) The ETB provides on-chip storage of trace data using 32-bit RAM. The ETB accepts trace data from any CoreSight-compliant component trace source with an ATB master port, such as a trace source or a trace funnel. It is included in this device to remove dependencies from the trace pin pad speed, and enable low cost trace solutions. The TraceRAM size is 2 KB.
TPIU multiple sequential runs by executing code until the ETB is almost full, and halting or executing an interrupt handler to allow the buffer to be emptied, and then continuing executing code. The target halts or executes an interrupt handler when the buffer is almost full to empty the data and then the debugger runs the target again. 9.11.
Chapter 9 Debug • Sleep cycles • CPI (all instruction cycles except for the first cycle) • Interrupt overhead NOTE An event is emitted each time a counter overflows. • The DWT can be configured to emit PC samples at defined intervals, and to emit interrupt event information. 9.14 Debug in Low Power Modes In low power modes in which the debug modules are kept static or powered off, the debugger cannot gather any debug data for the duration of the low power mode.
Debug & Security 9.14.1 Debug Module State in Low Power Modes The following table shows the state of the debug modules in low power modes. These terms are used: • FF = Full functionality. In VLPR and VLPW the system frequency is limited, but if a module does not have a limitation in its functionality, it is still listed as FF. • static = Module register states and associated memories are retained. • OFF = Modules are powered off; module is in reset state upon wakeup. Table 9-7.
Chapter 10 Signal Multiplexing and Signal Descriptions 10.1 Introduction To optimize functionality in small packages, pins have several functions available via signal multiplexing. This chapter illustrates which of this device's signals are multiplexed on which external pin. The Port Control block controls which signal is present on the external pin. Reference that chapter to find which register controls the operation of a specific pin. 10.
Pinout Table 10-1. Reference links to related information (continued) Topic Related module Clocking Reference Clock Distribution Register access Peripheral bus controller Peripheral bridge 10.2.1 Port control and interrupt module features • Five 32-pin ports NOTE Not all pins are available on the device. See the following section for details. • Each 32-pin port is assigned one interrupt. • The digital filter option has two clock source options: bus clock and 1-kHz LPO.
Chapter 10 Signal Multiplexing and Signal Descriptions 10.3.1 K10 Signal Multiplexing and Pin Assignments The following table shows the signals available on each pin and the locations of these pins on the devices supported by this document. The Port Control Module is responsible for selecting which ALT functionality is available on each pin.
Pinout 144 144 LQF MAP P BGA Pin Name Default ALT0 ALT1 ALT2 ALT3 ALT4 UART2_RX FTM_CLKIN 1 19 H2 PTE17 ADC0_SE5 a ADC0_SE5 a PTE17 SPI0_SCK 20 G1 PTE18 ADC0_SE6 a ADC0_SE6 a PTE18 SPI0_SOUT UART2_CT S_b I2C0_SDA 21 G2 PTE19 ADC0_SE7 a ADC0_SE7 a PTE19 SPI0_SIN I2C0_SCL 22 H3 VSS VSS VSS 23 J1 ADC0_DP1 ADC0_DP1 ADC0_DP1 24 J2 ADC0_DM1 ADC0_DM1 ADC0_DM1 25 K1 ADC1_DP1 26 K2 ADC1_DM1 ADC1_DM1 ADC1_DM1 27 L1 PGA0_DP/ PGA0_DP/ PGA0_DP/ ADC0_DP0/ ADC0_DP0/ AD
Chapter 10 Signal Multiplexing and Signal Descriptions 144 144 LQF MAP P BGA Pin Name Default ALT0 ADC1_SE2 3 ADC1_SE2 3 ADC1_SE2 3 ALT1 ALT2 ALT3 ALT4 ALT5 ALT6 ALT7 EzPort 40 M7 XTAL32 XTAL32 XTAL32 41 M6 EXTAL32 EXTAL32 EXTAL32 42 L6 VBAT VBAT VBAT 43 — VDD VDD VDD 44 — VSS VSS VSS 45 M4 PTE24 ADC0_SE1 7 ADC0_SE1 7 PTE24 CAN1_TX UART4_TX EWM_OUT _b 46 K5 PTE25 ADC0_SE1 8 ADC0_SE1 8 PTE25 CAN1_RX UART4_RX EWM_IN 47 K4 PTE26 DISABLED PTE26 UART
Pinout 144 144 LQF MAP P BGA Pin Name 65 J9 PTA13/ LLWU_P4 66 L10 PTA14 67 Default ALT0 CMP2_IN1 CMP2_IN1 ALT1 ALT2 ALT3 ALT4 ALT5 ALT6 ALT7 FTM1_QD_ PHB PTA13/ LLWU_P4 CAN0_RX FTM1_CH1 I2S0_TX_F S DISABLED PTA14 SPI0_PCS0 UART0_TX I2S0_TX_B CLK L11 PTA15 DISABLED PTA15 SPI0_SCK I2S0_RXD 68 K10 PTA16 DISABLED PTA16 SPI0_SOUT UART0_CT S_b I2S0_RX_F S 69 K11 PTA17 ADC1_SE1 7 ADC1_SE1 7 PTA17 SPI0_SIN I2S0_MCLK I2S0_CLKIN 70 E8 VDD VDD VDD 71 G8 VSS VSS VS
Chapter 10 Signal Multiplexing and Signal Descriptions 144 144 LQF MAP P BGA Pin Name Default ALT0 / ADC1_SE1 3 / ADC1_SE1 3 ALT1 ALT2 ALT3 ALT4 ALT6 88 F11 PTB7 89 F10 PTB8 PTB8 UART3_RT S_b FB_AD21 90 F9 PTB9 SPI1_PCS1 UART3_CT S_b FB_AD20 91 E12 PTB10 / ADC1_SE1 4 / ADC1_SE1 4 PTB10 SPI1_PCS0 UART3_RX FB_AD19 FTM0_FLT1 92 E11 PTB11 / ADC1_SE1 5 / ADC1_SE1 5 PTB11 SPI1_SCK UART3_TX FB_AD18 FTM0_FLT2 93 H7 VSS VSS VSS 94 F5 VDD VDD VDD 95 E10 PTB16 /TSI0_
Pinout 144 144 LQF MAP P BGA Pin Name Default ALT0 ALT1 ALT2 ALT3 ALT4 ALT5 ALT6 111 C8 PTC6/ LLWU_P10 /CMP0_IN0 /CMP0_IN0 PTC6/ LLWU_P10 SPI0_SOUT PDB0_EXT RG FB_AD9 112 B8 PTC7 /CMP0_IN1 /CMP0_IN1 PTC7 SPI0_SIN FB_AD8 113 A8 PTC8 / ADC1_SE4 b/ CMP0_IN2 / ADC1_SE4 b/ CMP0_IN2 PTC8 114 D7 PTC9 / ADC1_SE5 b/ CMP0_IN3 / ADC1_SE5 b/ CMP0_IN3 PTC9 115 C7 PTC10 / ADC1_SE6 b/ CMP0_IN4 / ADC1_SE6 b/ CMP0_IN4 PTC10 116 B7 PTC11/ LLWU_P11 / ADC1_SE7 b / ADC1_SE7 b PTC
Chapter 10 Signal Multiplexing and Signal Descriptions 144 144 LQF MAP P BGA Pin Name 128 D4 PTD1 129 C4 130 Default ALT0 / ADC0_SE5 b / ADC0_SE5 b ALT1 ALT2 ALT3 ALT4 UART2_CT S_b ALT5 ALT6 PTD1 SPI0_SCK PTD2/ LLWU_P13 PTD2/ LLWU_P13 SPI0_SOUT UART2_RX FB_AD4 B4 PTD3 PTD3 SPI0_SIN FB_AD3 131 A4 PTD4/ LLWU_P14 PTD4/ LLWU_P14 SPI0_PCS1 UART0_RT S_b FTM0_CH4 FB_AD2 EWM_IN 132 A3 PTD5 / ADC0_SE6 b / ADC0_SE6 b PTD5 SPI0_PCS2 UART0_CT S_b FTM0_CH5 FB_AD1 EWM_OUT _b
PTD15 PTD14 PTD13 PTD12 PTD11 PTD10 PTD9 PTD8 PTD7 VDD VSS PTD6 PTD5 PTD4 PTD3 PTD2 PTD1 PTD0 PTC19 PTC18 PTC17 PTC16 VDD VSS PTC15 PTC14 PTC13 PTC12 PTC11 PTC10 PTC9 PTC8 PTC7 PTC6 PTC5 PTC4 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 Pinout PTE0 1 108 VDD PTE1 2 107 VSS PTE2 3 106 PTC3 PTE3 4 105 PTC2 VDD 5 104 PTC1
Chapter 10 Signal Multiplexing and Signal Descriptions 1 2 3 4 5 6 7 8 9 10 11 12 A PTD7 PTD6 PTD5 PTD4 PTD0 PTC16 PTC12 PTC8 PTC4 NC PTC3 PTC2 A B PTD12 PTD11 PTD10 PTD3 PTC19 PTC15 PTC11 PTC7 PTD9 NC PTC1 PTC0 B C PTD15 PTD14 PTD13 PTD2 PTC18 PTC14 PTC10 PTC6 PTD8 NC PTB23 PTB22 C D PTE2 PTE1 PTE0 PTD1 PTC17 PTC13 PTC9 PTC5 PTB21 PTB20 PTB19 PTB18 D E PTE6 PTE5 PTE4 PTE3 VDD VDD VDD VDD PTB17 PTB16 PTB11 PTB10 E F PTE10 PT
Module Signal Description Tables 10.4.1 Core Modules Table 10-2. JTAG Signal Descriptions Chip signal name Module signal name Description I/O JTAG_TMS JTAG_TMS/ SWD_DIO JTAG Test Mode Selection I/O JTAG_TCLK JTAG_TCLK/ SWD_CLK JTAG Test Clock I JTAG_TDI JTAG_TDI JTAG Test Data Input I JTAG_TDO JTAG_TDO/ TRACE_SWO JTAG Test Data Output O JTAG_TRST JTAG_TRST_b JTAG Reset I Table 10-3.
Chapter 10 Signal Multiplexing and Signal Descriptions Table 10-5. System Signal Descriptions (continued) Chip signal name Module signal name Description I/O RESET — Reset bi-directional signal I/O VDD — MCU power I VSS — MCU ground I Table 10-6. EWM Signal Descriptions Chip signal name Module signal name EWM_IN EWM_in EWM_OUT EWM_out Description I/O EWM input for safety status of external safety circuits. The polarity of EWM_in is programmable using the CTRL[ASSIN] bit.
Module Signal Description Tables Table 10-10. FlexBus Signal Descriptions Chip signal name Module signal name Description I/O FB_CLKOUT FB_CLK FlexBus clock output O FB_A[29:16] FB_A[29:16] In a non-multiplexed configuration, this is the address bus. O FB_AD[31:0] FB_D[31:0]/ FB_AD[31:0] In a non-multiplexed configuration, this is the data bus. In a multiplexed configuration this bus is the address/data bus, FB_AD[31:0].
Chapter 10 Signal Multiplexing and Signal Descriptions Table 10-11. ADC 0 Signal Descriptions (continued) Chip signal name Module signal name VSSA VSSA Description Analog ground I/O I Table 10-12.
Module Signal Description Tables Table 10-16. DAC 0 Signal Descriptions Chip signal name Module signal name DAC0_OUT — Description I/O DAC output O Table 10-17. DAC 1 Signal Descriptions Chip signal name Module signal name DAC1_OUT — Description I/O DAC output O Table 10-18.
Chapter 10 Signal Multiplexing and Signal Descriptions Table 10-22.
Module Signal Description Tables Table 10-26. UART 1 Signal Descriptions Chip signal name Module signal name Description I/O UART1_CTS CTS Clear to send I UART1_RTS RTS Request to send O UART1_TX TXD Transmit data O UART1_RX RXD Receive data I Table 10-27. UART 2 Signal Descriptions Chip signal name Module signal name Description I/O UART2_CTS CTS Clear to send I UART2_RTS RTS Request to send O UART2_TX TXD Transmit data O UART2_RX RXD Receive data I Table 10-28.
Chapter 10 Signal Multiplexing and Signal Descriptions Table 10-31. SDHC Signal Descriptions Chip signal name Module signal name SDHC0_CLKIN — SDHC0_DCLK Description I/O SDHC clock input I SDHC_DCLK Generated clock used to drive the MMC, SD, SDIO or CE-ATA cards. O SDHC0_CMD SDHC_CMD Send commands to and receive responses from the card.
Module Signal Description Tables Table 10-32. I2S 0 Signal Descriptions (continued) Chip signal name Module signal name Description I/O I2S0_TX_BCLK STCK Serial transmit clock. The STCK port can be used as an input or output. This clock signal is used by the transmitter and can be continuous or gated. During gated clock mode, data on STCK is valid only during the transmission of data. Otherwise, it is pulled to the inactive state.
Chapter 11 Port control and interrupts (PORT) 11.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. 11.1.1 Overview The port control and interrupt (PORT) module provides support for external interrupt, digital filtering and port control functions. Most functions can be configured independently for each pin in the 32-bit port and affect the pin regardless of its pin muxing state.
Introduction • Selectable clock source for digital input filter with 5-bit resolution on filter size • Digital filter is functional in all digital pin muxing modes • Port control • • • • • • Individual pull control registers with pullup, pulldown and pull-disable support Individual drive strength register supporting high and low drive strength Individual slew rate register supporting fast and slow slew rates Individual input passive filter register supporting enabled and disabled Individual open-drain reg
Chapter 11 Port control and interrupts (PORT) 11.2 External signal description Table 11-1. Signal properties Name Function I/O Reset Pull PORTx[31:0] External interrupt I/O 0 - NOTE Not all pins within each port are implemented on each device. 11.3 Detailed signal descriptions Table 11-2. PORTx interface-detailed signal descriptions Signal PORTx[31:0] I/O Description I/O External interrupt. State meaning Asserted-pin is logic one. Negated-pin is logic zero.
Memory map and register definition PORT memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_900C Pin Control Register n (PORTA_PCR3) 32 R/W 0000_0000h 11.4.1/244 4004_9010 Pin Control Register n (PORTA_PCR4) 32 R/W 0000_0000h 11.4.1/244 4004_9014 Pin Control Register n (PORTA_PCR5) 32 R/W 0000_0000h 11.4.1/244 4004_9018 Pin Control Register n (PORTA_PCR6) 32 R/W 0000_0000h 11.4.
Chapter 11 Port control and interrupts (PORT) PORT memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page reads zero) 4004_90A0 Interrupt Status Flag Register (PORTA_ISFR) 32 w1c 0000_0000h 11.4.4/247 4004_90C0 Digital Filter Enable Register (PORTA_DFER) 32 R/W 0000_0000h 11.4.5/248 4004_90C4 Digital Filter Clock Register (PORTA_DFCR) 32 R/W 0000_0000h 11.4.
Memory map and register definition PORT memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_A070 Pin Control Register n (PORTB_PCR28) 32 R/W 0000_0000h 11.4.1/244 4004_A074 Pin Control Register n (PORTB_PCR29) 32 R/W 0000_0000h 11.4.1/244 4004_A078 Pin Control Register n (PORTB_PCR30) 32 R/W 0000_0000h 11.4.1/244 4004_A07C Pin Control Register n (PORTB_PCR31) 32 R/W 0000_0000h 11.4.
Chapter 11 Port control and interrupts (PORT) PORT memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_B050 Pin Control Register n (PORTC_PCR20) 32 R/W 0000_0000h 11.4.1/244 4004_B054 Pin Control Register n (PORTC_PCR21) 32 R/W 0000_0000h 11.4.1/244 4004_B058 Pin Control Register n (PORTC_PCR22) 32 R/W 0000_0000h 11.4.1/244 4004_B05C Pin Control Register n (PORTC_PCR23) 32 R/W 0000_0000h 11.4.
Memory map and register definition PORT memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_C030 Pin Control Register n (PORTD_PCR12) 32 R/W 0000_0000h 11.4.1/244 4004_C034 Pin Control Register n (PORTD_PCR13) 32 R/W 0000_0000h 11.4.1/244 4004_C038 Pin Control Register n (PORTD_PCR14) 32 R/W 0000_0000h 11.4.1/244 4004_C03C Pin Control Register n (PORTD_PCR15) 32 R/W 0000_0000h 11.4.
Chapter 11 Port control and interrupts (PORT) PORT memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_D010 Pin Control Register n (PORTE_PCR4) 32 R/W 0000_0000h 11.4.1/244 4004_D014 Pin Control Register n (PORTE_PCR5) 32 R/W 0000_0000h 11.4.1/244 4004_D018 Pin Control Register n (PORTE_PCR6) 32 R/W 0000_0000h 11.4.1/244 4004_D01C Pin Control Register n (PORTE_PCR7) 32 R/W 0000_0000h 11.4.
Memory map and register definition PORT memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4004_D0A0 Interrupt Status Flag Register (PORTE_ISFR) 32 w1c 0000_0000h 11.4.4/247 4004_D0C0 Digital Filter Enable Register (PORTE_DFER) 32 R/W 0000_0000h 11.4.5/248 4004_D0C4 Digital Filter Clock Register (PORTE_DFCR) 32 R/W 0000_0000h 11.4.6/249 4004_D0C8 Digital Filter Width Register (PORTE_DFWR) 32 R/W 0000_0000h 11.4.7/249 11.
Chapter 11 Port control and interrupts (PORT) PORTx_PCRn field descriptions (continued) Field Description 1001 1010 1011 1100 Others 15 LK 14–11 Reserved 10–8 MUX Lock Register 0 1 6 DSE Pin Mux Control The corresponding pin is configured as follows: Drive Strength Enable Drive Strength configuration is valid in all digital pin muxing modes. Open Drain configuration is valid in all digital pin muxing modes. Open Drain output is disabled on the corresponding pin.
Memory map and register definition PORTx_PCRn field descriptions (continued) Field Description 2 SRE Slew Rate Enable Slew Rate configuration is valid in all digital pin muxing modes. 0 1 1 PE Fast slew rate is configured on the corresponding pin, if pin is configured as a digital output. Slow slew rate is configured on the corresponding pin, if pin is configured as a digital output. Pull Enable Pull configuration is valid in all digital pin muxing modes.
Chapter 11 Port control and interrupts (PORT) 11.4.
Memory map and register definition PORTx_ISFR field descriptions Field Description 31–0 ISF Interrupt Status Flag Each bit in the field indicates the detection of the configured interrupt of the same number as the bit. 0 1 Configured interrupt has not been detected. Configured interrupt has been detected.
Chapter 11 Port control and interrupts (PORT) 11.4.
Functional description PORTx_DFWR field descriptions Field 31–5 Reserved 4–0 FILT Description This read-only field is reserved and always has the value zero. Filter Length The digital filter configuration is valid in all digital pin muxing modes. Configures the maximum size of the glitches (in clock cycles) the digital filter absorbs for enabled digital filters.
Chapter 11 Port control and interrupts (PORT) 11.5.2 Global pin control The two global pin control registers allow a single register write to update the lower half of the pin control register on up to sixteen pins, all with the same value. Registers that are locked cannot be written using the global pin control registers. The global pin control registers are designed to enable software to quickly configure multiple pins within the one port for the same peripheral function.
Functional description During stop mode, the interrupt status flag for any enabled interrupt (but not DMA request) will asynchronously set if the required level or edge is detected. This also generates an asynchronous wakeup signal to exit the low power mode. 11.5.4 Digital filter The digital filter capabilities of the PORT module are available in all digital pin muxing modes provided the PORT module is enabled.
Chapter 12 System integration module (SIM) 12.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The system integration module (SIM) provides system control and chip configuration registers. 12.1.
Memory map and register definition 12.1.3 SIM Signal Descriptions Table 12-1. SIM Signal Descriptions Signa Description l I/O EZP_ EzPort mode select CS I 12.1.3.1 Detailed signal description Table 12-2.
Chapter 12 System integration module (SIM) SIM memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_7000 System Options Register 1 (SIM_SOPT1) 32 R/W Undefined 12.2.1/256 4004_8004 System Options Register 2 (SIM_SOPT2) 32 R/W 0000_1000h 12.2.2/258 4004_800C System Options Register 4 (SIM_SOPT4) 32 R/W 0000_0000h 12.2.3/260 4004_8010 System Options Register 5 (SIM_SOPT5) 32 R/W 0000_0000h 12.2.
Memory map and register definition 12.2.1 System Options Register 1 (SIM_SOPT1) The reset value of the SOPT1 register is as follows: Exit from POR and LVD: OSC32KSEL is cleared.
Chapter 12 System integration module (SIM) SIM_SOPT1 field descriptions (continued) Field 15–12 RAMSIZE Description RAM size This field specifies the amount of system RAM available on the device.
Memory map and register definition 12.2.2 System Options Register 2 (SIM_SOPT2) SOPT2 contains the controls for selecting many of the module clock source options on this device. See the Clock Distribution chapter for more information including clocking diagrams and definitions of device clocks.
Chapter 12 System integration module (SIM) SIM_SOPT2 field descriptions (continued) Field Description 10 11 OSCERCLK clock External bypass clock (I2S0_CLKIN) 23–22 Reserved This read-only field is reserved and always has the value zero. 21–20 Reserved This read-only field is reserved and always has the value zero. 19 Reserved This read-only field is reserved and always has the value zero. 18 Reserved This read-only field is reserved and always has the value zero.
Memory map and register definition SIM_SOPT2 field descriptions (continued) Field Description 0 MCGCLKSEL MCG clock select Selects the MCG's external reference clock. 0 1 System oscillator (OSCCLK) 32 kHz RTC oscillator 12.2.
Chapter 12 System integration module (SIM) SIM_SOPT4 field descriptions (continued) Field Description NOTE: The selected pin must also be configured for the FTM external clock function through the appropriate pin control register in the port control module. 0 1 24 FTM0CLKSEL FTM_CLK0 pin FTM_CLK1 pin FlexTimer 0 External Clock Pin Select Selects the external pin used to drive the clock to the FTM0 module.
Memory map and register definition SIM_SOPT4 field descriptions (continued) Field Description Selects the source of FTM1 fault 0. NOTE: The pin source for fault 0 must be configured for the FTM module fault function through the appropriate pin control register in the port control module. 0 1 3 Reserved 2 FTM0FLT2 FTM1_FLT0 pin CMP0 out This read-only field is reserved and always has the value zero. FTM0 Fault 2 Select Selects the source of FTM0 fault 2.
Chapter 12 System integration module (SIM) 12.2.
Memory map and register definition SIM_SOPT5 field descriptions (continued) Field Description 10 11 UART0_TX pin modulated with FTM2 channel 0 output Reserved 12.2.5 System Options Register 6 (SIM_SOPT6) The reset values of the RSTFLTEN and RSTFLTSEL bits are for power-on reset only. They are unaffected by other reset types.
Chapter 12 System integration module (SIM) 12.2.
Memory map and register definition SIM_SOPT7 field descriptions (continued) Field Description 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1011 7 ADC0ALTTRGEN ADC0 alternate trigger enable Enable alternative conversion triggers for ADC0.
Chapter 12 System integration module (SIM) SIM_SOPT7 field descriptions (continued) Field Description 1101 1110 1011 RTC seconds Low-power timer trigger Unused 12.2.
Memory map and register definition SIM_SDID field descriptions (continued) Field Description 3–0 PINID Pincount identification Specifies the pincount of the device. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Reserved Reserved 32-pin Reserved 48-pin 64-pin 80-pin 81-pin 100-pin 121-pin 144-pin Reserved 196-pin Reserved 256-pin Reserved 12.2.
Chapter 12 System integration module (SIM) SIM_SCGC1 field descriptions (continued) Field Description 11 UART5 UART5 Clock Gate Control This bit controls the clock gate to the UART5 module. 0 1 10 UART4 Clock disabled Clock enabled UART4 Clock Gate Control This bit controls the clock gate to the UART4 module. 0 1 9–0 Reserved Clock disabled Clock enabled This read-only field is reserved and always has the value zero. 12.2.
Memory map and register definition 12.2.
Chapter 12 System integration module (SIM) SIM_SCGC3 field descriptions (continued) Field Description 0 1 16–13 Reserved Clock disabled Clock enabled This read-only field is reserved and always has the value zero. 12 SPI2 SPI2 Clock Gate Control This bit controls the clock gate to the SPI2 module. 0 1 11–5 Reserved Clock disabled Clock enabled This read-only field is reserved and always has the value zero.
Memory map and register definition SIM_SCGC4 field descriptions (continued) Field Description 0 1 27–21 Reserved 20 VREF This read-only field is reserved and always has the value zero. VREF Clock Gate Control This bit controls the clock gate to the VREF module. 0 1 19 CMP Clock disabled Clock enabled Clock disabled Clock enabled Comparator Clock Gate Control This bit controls the clock gate to the comparator module.
Chapter 12 System integration module (SIM) SIM_SCGC4 field descriptions (continued) Field Description 0 1 6 I2C0 Clock disabled Clock enabled I2C0 Clock Gate Control This bit controls the clock gate to the I2C0 module. 0 1 Clock disabled Clock enabled 5–4 Reserved This read-only field is reserved and always has the value one. 3 Reserved This read-only field is reserved and always has the value zero. 2 CMT CMT Clock Gate Control This bit controls the clock gate to the CMT module.
Memory map and register definition SIM_SCGC5 field descriptions Field Description 31–19 Reserved This read-only field is reserved and always has the value zero. 18 Reserved This read-only field is reserved and always has the value one. 17–14 Reserved This read-only field is reserved and always has the value zero. 13 PORTE Port E Clock Gate Control This bit controls the clock gate to the Port E module. 0 1 12 PORTD Port D Clock Gate Control This bit controls the clock gate to the Port D module.
Chapter 12 System integration module (SIM) SIM_SCGC5 field descriptions (continued) Field Description 1 REGFILE Register File Clock Gate Control This bit controls the clock gate to the Register File module. 0 1 0 LPTIMER Clock disabled Clock enabled Low Power Timer Clock Gate Control This bit controls the clock gate to the Low Power Timer module. 0 1 Clock disabled Clock enabled 12.2.
Memory map and register definition SIM_SCGC6 field descriptions (continued) Field 28 Reserved 27 ADC0 Description This read-only field is reserved and always has the value zero. ADC0 Clock Gate Control This bit controls the clock gate to the ADC0 module. 0 1 26 Reserved 25 FTM1 This read-only field is reserved and always has the value zero. FTM1 Clock Gate Control This bit controls the clock gate to the FTM1 module. 0 1 24 FTM0 This bit controls the clock gate to the FTM0 module.
Chapter 12 System integration module (SIM) SIM_SCGC6 field descriptions (continued) Field Description 0 1 14 Reserved 13 SPI1 This read-only field is reserved and always has the value zero. SPI1 Clock Gate Control This bit controls the clock gate to the SPI1 module. 0 1 12 SPI0 4 FLEXCAN0 Clock disabled Clock enabled SPI0 Clock Gate Control This bit controls the clock gate to the SPI0 module.
Memory map and register definition 12.2.
Chapter 12 System integration module (SIM) 12.2.15 System Clock Divider Register 1 (SIM_CLKDIV1) The CLKDIV1 register cannot be written to when the device is in VLPR mode.
Memory map and register definition SIM_CLKDIV1 field descriptions (continued) Field Description 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 23–20 OUTDIV3 Clock 3 output divider value This field sets the divide value for the FlexBus clock driven to the external pin (FB_CLK). At the end of reset, it is loaded with either 0001 or 1111 depending on FTFL_FOPT[LPBOOT]. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 19–16 OUTDIV4 Divide-by-7. Divide-by-8. Divide-by-9.
Chapter 12 System integration module (SIM) SIM_CLKDIV1 field descriptions (continued) Field Description 1100 1101 1110 1111 15–0 Reserved Divide-by-13. Divide-by-14. Divide-by-15. Divide-by-16. This read-only field is reserved and always has the value zero. 12.2.
Memory map and register definition 12.2.17 Flash Configuration Register 1 (SIM_FCFG1) For devices with FlexNVM: The reset value of EESIZE and DEPART are based on user programming in user IFR via the PGMPART flash command. For devices with program flash only: The EESIZE and DEPART filelds are not applicable.
Chapter 12 System integration module (SIM) SIM_FCFG1 field descriptions (continued) Field Description 0001 Reserved 0010 4 KB 0011 2 KB 0100 1 KB 0101 512 Bytes 0110 256 Bytes 0111 128 Bytes 1000 64 Bytes 1001 32 Bytes 1010-1110 Reserved 1111 0 Bytes For devices without FlexNVM:Reserved 15–12 Reserved This read-only field is reserved and always has the value zero. 11–8 DEPART FlexNVM partition For devices with FlexNVM: Data flash / EEPROM backup split. See DEPART bit description in FTFL chapter.
Memory map and register definition 12.2.
Chapter 12 System integration module (SIM) SIM_FCFG2 field descriptions (continued) Field Description For devices without FlexNVM: This bit is always set. 22 Reserved 0 For devices with FlexNVM: Physical flash block 1 is used as FlexNVM 1 For devices without FlexNVM: Reserved Physical flash block 1 is used as program flash This read-only field is reserved and always has the value zero.
Memory map and register definition 12.2.20 Unique Identification Register Mid-High (SIM_UIDMH) Address: SIM_UIDMH is 4004_7000h base + 1058h offset = 4004_8058h Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 UID R W Reset x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* * Notes: • x = Undefined at reset.
Chapter 12 System integration module (SIM) 12.2.22 Unique Identification Register Low (SIM_UIDL) Address: SIM_UIDL is 4004_7000h base + 1060h offset = 4004_8060h Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 UID R W Reset x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* x* * Notes: • x = Undefined at reset.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 288 Freescale Semiconductor, Inc.
Chapter 13 Mode Controller 13.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. This section discusses the mode controller (MC) which controls power management and reset mechanisms including the various sources of resets on the device.
Introduction 13.1.2 Modes of Operation The ARM CPU has three primary modes of operation: run, sleep, and deep sleep. The WFI instruction is used to invoke sleep and deep sleep modes. For Freescale microcontrollers, run, wait and stop are the common terminology used for the primary operating modes. The following table shows the translation between the ARM CPU and the MCU power modes.
Chapter 13 Mode Controller Table 13-1. Power modes (continued) Mode Description VLPR The Core Clock, System Clock and Bus Clocks maximum frequency is restricted to 2MHz max, Flash Clock is restricted to 1MHz. The slow IRC within the MCG must not be enabled when VLPR is entered. VLPW In ARM architectures, the Core Clock to the ARM Cortex-M4 core is shut off.
Introduction Any reset VLPW 4 5 1 VLPR Wait 3 Run 6 7 2 Stop VLPS 8 10 11 9 LLS VLLS 3, 2, 1 Figure 13-1. Power Mode State Diagram The following table defines triggers for the various state transitions shown in the previous figure. Table 13-2. Power mode transition triggers Transition # From To 1 Run Wait Sleep-now or sleep-on-exit modes entered with SLEEPDEEP clear, controlled in System Control Register in ARM core.
Chapter 13 Mode Controller Table 13-2. Power mode transition triggers (continued) Transition # From To 3 Run VLPR Trigger Conditions Reduce system, bus and core frequency to 2 MHz or less, Flash access limited to 1MHz. AVLP=1, Set RUNM = 10. NOTE: Poll VLPRS bit before transitioning out of VLPR mode. VLPR Run Set RUNM = 00 or Interrupt with LPWUI =1 or Reset. NOTE: Poll REGONS bit before increasing frequency.
Introduction Table 13-2. Power mode transition triggers (continued) Transition # From To 11 VLPR VLLS(3,2,1) Trigger Conditions LPLLSM = (see PMCTRL register description for VLLS configuration), Sleep-now or sleep-on-exit modes entered with SLEEPDEEP set, controlled in System Control Register in ARM core 13.1.2.2 Run Modes The device contains two different run modes: • Run • Very low power run (VLPR) 13.1.2.2.1 Run Mode This is the normal operating mode for the device.
Chapter 13 Mode Controller • • • • RUNM set to 10b to enter VLPR. Flash programming/erasing is not allowed. The slow IRC must not be enabled. All clock monitors must be disabled before entering VLPR. While in VLPR, the regulator is slow responding and cannot handle fast load transitions. Therefore, do not change the clock frequency. This includes a requirement to not modify the module clock enables in the SIM or any clock divider registers. To re-enter normal run mode, simply clear RUNM.
Introduction 13.1.2.3.1 Wait Mode Wait mode is entered when the ARM core enters the sleep-now or sleep-on-exit modes. The ARM CPU enters a low-power state in which it is not clocked, but peripherals continue to be clocked provided they are enabled and clock gating to the peripheral is enabled via the SIM. When an interrupt request occurs, the CPU exits wait mode and resumes processing, beginning with the stacking operations leading to the interrupt service routine.
Chapter 13 Mode Controller certain asynchronous mode peripherals are operating with the remainer of the MCU powered off. The tradeoffs depend upon the user's application, where power usage and state retention versus functional needs are weighed. The various stop modes are selected by setting the appropriate bits in the power mode protection (PMPROT) and power mode control (PMCTRL) registers.
Introduction Register in the ARM core forces the MCU into VLPS and hardware sets the LPWUI bit set. In VLPS, the on-chip voltage regulator remains in its stop regulation state as in VLPR. On transitions from VLPR to VLPS with LPLLSM set to 000b, hardware forces LPLLSM to value of 010b.
Chapter 13 Mode Controller 13.1.2.4.4 Very Low-Leakage Stop (VLLS3,2,1) Modes This device contains three very low leakage modes: VLLS3, VLLS2, and VLLS1. When a reference applies to all three low leakage modes, VLLS is used. All three of the VLLS modes can be entered from normal run or VLPR. The MCU enters the configured VLLS mode if: • In sleep-now or sleep-on-exit mode, the SLEEPDEEP bit is set in the System Control Register in the ARM core, and • The device is configured as per Table 13-2.
Introduction No debug is available while the MCU is in LLS or VLLS modes. LLS is a state-retention mode and all debug operation can continue after waking from LLS, even in cases where system wakeup is due to a system reset event. Entering into a VLLS mode causes all the debug controls and settings to be powered off.
Chapter 13 Mode Controller • • • • • Computer operating properly (COP) timer Clock generator (MCG) loss of clock reset (LOC) Low-voltage detect (LVD) Wakeup from very low leakage stop modes, VLLSx Software reset (SW) - by setting SYSRESETREQ bit of the NVIC's Application Interrupt and Reset Control Register • LOCKUP - core in lockup state • EzPort • MDM AP Reset - by setting System Reset Request bit of the MDM AP Control Register Debug reset: • Asserting JTAG_TRST pin Each of the system reset sources, wi
Introduction 13.1.3.4 Multi-Clock Generator (MCG) Loss-of-Clock (LOC) Reset The MCG module supports an external reference clock. If the clock monitor is enabled (MCG_C6[CME] is set) and the external reference falls below a certain frequency (specified in the MCG_C2[RANGE] field), the MCU resets. If a loss of clock causes a reset, the SRSL[LOC] bit is set. For more details on the clock generator, see Multi-Clock Generator (MCG). 13.1.3.
Chapter 13 Mode Controller 13.1.3.7 Software (SW) Reset Setting the SYSRESETREQ bit in the NVIC's Application Interrupt and Reset Control Register forces a software reset on the device. A software reset resets of all major components except for debug. When the device is reset by a software reset, the SRSH[SW] bit is set. 13.1.3.8 Lock-Up Reset When the processor’s built-in system state protection hardware detects the core is locked up because of an unrecoverable exception, a lock-up reset occurs.
Mode Control Memory Map/Register Definition MC memory map Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4007_E000 System Reset Status Register High (MC_SRSH) 8 R/W 00h 13.2.1/304 4007_E001 System Reset Status Register Low (MC_SRSL) 8 R/W 82h 13.2.2/305 4007_E002 Power Mode Protection Register (MC_PMPROT) 8 R/W 00h 13.2.3/306 4007_E003 Power Mode Control Register (MC_PMCTRL) 8 R/W 00h 13.2.4/308 13.2.
Chapter 13 Mode Controller MC_SRSH field descriptions (continued) Field Description Indicates reset was caused by the ARM core indication of a LOCKUP event. 0 1 0 JTAG Reset not caused by core LOCKUP event Reset caused by core LOCKUP event JTAG generated reset Indicates reset was caused by JTAG selection of certain IR codes (EZPORT, EXTEST, HIGHZ, and CLAMP). 0 1 Reset not caused by JTAG Reset caused by JTAG 13.2.
Mode Control Memory Map/Register Definition MC_SRSL field descriptions (continued) Field Description 0 1 6 PIN External reset pin Indicates reset was caused by an active-low level on the external RESETpin. 0 1 5 COP 2 LOC Reset was caused by the COP watchdog timer timing out. This reset source can be blocked by disabling the watchdog. For more information, see the watchdog chapter. Loss-of-clock reset Indicates reset was caused by a loss of external clock.
Chapter 13 Mode Controller If the MCU is configured for a disallowed power mode, the MCU remains in its current power mode. For example, if in normal run (RUNM = 00, AVLP = 0) an attempt to enter VLPR using PMCTRL[RUNM] is blocked and the RUNM bits remain 00b indicating MCU is still in normal run mode. PMPROT is write once after any reset. This write to PMPROT clears LPLLSM, which provides protection after wakeup from low power or low leakage modes.
Mode Control Memory Map/Register Definition MC_PMPROT field descriptions (continued) Field Description 0 1 1 AVLLS2 Allow very low leakage stop 2 mode This write once bit allows the MCU to enter very low leakage stop 2 mode (VLLS2) provided the appropriate control bits are set up in PMCTRL.
Chapter 13 Mode Controller Address: MC_PMCTRL is 4007_E000h base + 3h offset = 4007_E003h Bit Read Write Reset 7 6 LPWUI 5 4 RUNM 0 0 3 2 0 0 0 1 0 LPLLSM 0 0 0 0 MC_PMCTRL field descriptions Field 7 LPWUI Description Low Power Wake Up on Interrupt Controls if the voltage regulator exits stop regulation when any active MCU interrupt occurs, returning the MCU to normal run mode.
Mode Control Memory Map/Register Definition K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 310 Freescale Semiconductor, Inc.
Chapter 14 Power Management Controller 14.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The PMC contains the internal voltage regulator, power on reset (POR), and low voltage detect system. The Mode Controller controls the PMC and its chapter contains description of all device resets, including POR. 14.
Low-Voltage Detect (LVD) System selectable trip voltage: high (VLVDH) or low (VLVDL). The trip voltage is selected by the LVDSC1[LVDV] bits. The LVD is disabled upon entering VLPx, LLS, and VLLSx modes. Two flags are available to indicate the status of the low-voltage detect system: • The low voltage detect flag (LVDF) operates in a level sensitive manner. The LVDF bit is set when the internal supply voltage falls below the selected internal monitor trip point (VLVD).
Chapter 14 Power Management Controller The LVDSC2[LVWV] bits select one of four trip voltages: • Highest (VLVW4) • Two mid-levels (VLVW3 and VLVW2) • Lowest (VLVW1) 14.4 PMC Memory Map/Register Definition The following table shows the registers related to the PMC. See Mode Control Memory Map/Register Definition for the mode controller registers.
PMC Memory Map/Register Definition Address: PMC_LVDSC1 is 4007_D000h base + 0h offset = 4007_D000h Bit Read 7 6 LVDF 0 Write Reset 5 LVDACK 0 0 4 3 LVDIE LVDRE 0 1 2 1 0 0 0 LVDV 0 0 0 PMC_LVDSC1 field descriptions Field 7 LVDF Description Low-Voltage Detect Flag This read-only status bit indicates a low-voltage detect event. 0 1 6 LVDACK 5 LVDIE Low-Voltage Detect Acknowledge This write-only bit is used to acknowledge low voltage detection errors (write 1 to clear LVDF).
Chapter 14 Power Management Controller See the device's data sheet for the exact LVD trip voltages. NOTE The LVW trip voltages depend on LVWV and LVDV bits.
PMC Memory Map/Register Definition 14.4.3 Regulator Status and Control Register (PMC_REGSC) The power management controller contains an internal voltage regulator. The voltage regulator design uses a bandgap reference, that is also available through a buffer as input to certain internal peripherals. The internal regulator provides a status bit (REGONS) indicating the regulator is in run regulation.
Chapter 14 Power Management Controller PMC_REGSC field descriptions (continued) Field 0 BGBE Description Bandgap Buffer Enable Enables the bandgap buffer. 0 1 Bandgap buffer not enabled Bandgap buffer enabled K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
PMC Memory Map/Register Definition K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 318 Freescale Semiconductor, Inc.
Chapter 15 Low-leakage wake-up unit (LLWU) 15.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The LLWU module allows the user to select up to 16 external pin sources and up to 7 internal modules as a wakeup source from low-leakage power modes (LLS and VLLS). The input sources vary by device and are described in the specific device's Chip Configuration details. Each of the available wakeup sources can be individually enabled.
Introduction 15.1.1 Features The LLWU module features include: • Supports up to 16 external input pins and up to 7 internal modules with individual enable bits • Input sources may be external pins or from internal peripherals capable of running in LLS or VLLS. See the Chip Configuration details for wakeup input sources for this device.
Chapter 15 Low-leakage wake-up unit (LLWU) 15.1.2.2 VLLS modes The LLWU module provides up to 16 external wakeup inputs and up to seven internal module wakeup inputs. In addition, a VLLS reset event can be initiated via assertion of the RESET pin. All wakeup and reset events result in VLLS exit via a reset flow. 15.1.2.3 Non-low leakage modes The LLWU is not active in all non- LLS and VLLS modes where detection and control logic are in a static state.
LLWU Signal Descriptions LLS/VLLS entered WUME7 LLWU_MWUF7 occurred Module7 interrupt flag (LLWU_M7IF) (System Error) Interrupt module flag detect Module6 interrupt flag (LLWU_M6IF) Interrupt module flag detect LLWU_MWUF6 occurred Interrupt module flag detect LLWU_MWUF0 occurred WUME6 Module0 interrupt flag (LLWU_M0IF) WUPE15 2 LLWU controller WUME0 LPO LLWU_P15 exit low leakge mode (LLS or VLLS) FLTEP Edge detect interrupt flow Pin filter LLWU_P0 Internal module sources LLWU_P0-LLWU_P1
Chapter 15 Low-leakage wake-up unit (LLWU) 15.
Memory map/register definition Address: LLWU_PE1 is 4007_C000h base + 0h offset = 4007_C000h Bit 7 Read 5 WUPE3 Write Reset 6 0 4 3 WUPE2 0 0 2 1 WUPE1 0 0 0 WUPE0 0 0 0 LLWU_PE1 field descriptions Field 7–6 WUPE3 Description Wakeup Pin Enable for LLWU_P3 Enables and configures the edge detection for the wakeup pin. 00 01 10 11 5–4 WUPE2 Wakeup Pin Enable for LLWU_P2 Enables and configures the edge detection for the wakeup pin.
Chapter 15 Low-leakage wake-up unit (LLWU) NOTE This register is unaffected by wakeup from low leakage modes (exit from LLS via RESET or any exit from VLLS). Address: LLWU_PE2 is 4007_C000h base + 1h offset = 4007_C001h Bit 7 Read 5 WUPE7 Write Reset 6 0 4 3 WUPE6 0 0 2 1 WUPE5 0 0 0 WUPE4 0 0 0 LLWU_PE2 field descriptions Field 7–6 WUPE7 Description Wakeup Pin Enable for LLWU_P7 Enables and configures the edge detection for the wakeup pin.
Memory map/register definition 15.3.3 LLWU Pin Enable 3 Register (LLWU_PE3) LLWU_PE3 contains the bit field to enable and select the edge detect type for the external wakeup input pins LLWU_P11-LLWU_P8. NOTE This register is unaffected by wakeup from low leakage modes (exit from LLS via RESET or any exit from VLLS).
Chapter 15 Low-leakage wake-up unit (LLWU) LLWU_PE3 field descriptions (continued) Field Description 10 11 External input pin enabled with falling edge detection External input pin enabled with any change detection 15.3.4 LLWU Pin Enable 4 Register (LLWU_PE4) LLWU_PE4 contains the bit field to enable and select the edge detect type for the external wakeup input pins LLWU_P15-LLWU_P12. NOTE This register is unaffected by wakeup from low leakage modes (exit from LLS via RESET or any exit from VLLS).
Memory map/register definition LLWU_PE4 field descriptions (continued) Field Description 10 11 1–0 WUPE12 External input pin enabled with falling edge detection External input pin enabled with any change detection Wakeup Pin Enable for LLWU_P12 Enables and configures the edge detection for the wakeup pin.
Chapter 15 Low-leakage wake-up unit (LLWU) LLWU_ME field descriptions (continued) Field Description 0 1 4 WUME4 Wakeup Module Enable for Module 4 Enables an internal module as a wakeup source input. 0 1 3 WUME3 Enables an internal module as a wakeup source input. Enables an internal module as a wakeup source input. Internal module flag not used as wakeup source Internal module flag used as wakeup source Wakeup Module Enable for Module 1 Enables an internal module as a wakeup source input.
Memory map/register definition Address: LLWU_F1 is 4007_C000h base + 5h offset = 4007_C005h 7 6 5 4 3 2 1 0 Read Bit WUF7 WUF6 WUF5 WUF4 WUF3 WUF2 WUF1 WUF0 Write w1c w1c w1c w1c w1c w1c w1c w1c Reset 0 0 0 0 0 0 0 0 LLWU_F1 field descriptions Field 7 WUF7 Description Wakeup Flag for LLWU_P7 Indicates that an enabled external wakeup pin was a source of exiting LLS or VLLS. To clear the flag write a one to WUF7.
Chapter 15 Low-leakage wake-up unit (LLWU) LLWU_F1 field descriptions (continued) Field 1 WUF1 Description Wakeup Flag for LLWU_P1 Indicates that an enabled external wakeup pin was a source of exiting LLS or VLLS. To clear the flag write a one to WUF1. 0 1 0 WUF0 LLWU_P1 input was not a source of wakeup from LLS or VLLS mode LLWU_P1 input was a source of wakeup from LLS or VLLS mode Wakeup Flag for LLWU_P0 Indicates that an enabled external wakeup pin was a source of exiting LLS or VLLS.
Memory map/register definition LLWU_F2 field descriptions (continued) Field Description 0 1 6 WUF14 Wakeup Flag for LLWU_P14 Indicates that an enabled external wakeup pin was a source of exiting LLS or VLLS. To clear the flag write a one to WUF14. 0 1 5 WUF13 Indicates that an enabled external wakeup pin was a source of exiting LLS or VLLS. To clear the flag write a one to WUF13. Indicates that an enabled external wakeup pin was a source of exiting LLS or VLLS. To clear the flag write a one to WUF12.
Chapter 15 Low-leakage wake-up unit (LLWU) 15.3.8 LLWU Flag 3 Register (LLWU_F3) LLWU_F3 contains the wakeup flags indicating which internal wakeup source caused the MCU to exit LLS or VLLS mode. For LLS, this will be the source causing the CPU interrupt flow. For VLLS, this will be the source causing the MCU reset flow. For internal peripherals that are capable of running in LLS or VLLS mode, such as RTC or CMP modules, the flag from the associated peripheral is accessible as the MWUFx bit.
Memory map/register definition LLWU_F3 field descriptions (continued) Field 4 MWUF4 Description Wakeup flag for module 4 Indicates that an enabled internal peripheral was a source of exiting LLS or VLLS. To clear the flag follow the internal peripheral flag clearing mechanism. 0 1 3 MWUF3 Wakeup flag for module 3 Indicates that an enabled internal peripheral was a source of exiting LLS or VLLS. To clear the flag follow the internal peripheral flag clearing mechanism.
Chapter 15 Low-leakage wake-up unit (LLWU) Address: LLWU_CS is 4007_C000h base + 8h offset = 4007_C008h Bit 7 6 Read ACKISO Write w1c Reset 0 5 4 3 2 0 1 0 0 0 0 1 1 0 FLTEP FLTR 0 0 LLWU_CS field descriptions Field 7 ACKISO Description Acknowledge Isolation Reading this bit indicates whether certain peripherals and the I/O pads are in a latched state as a result of having been in a VLLS mode.
Functional description The LLWU implements an optional 3-cycle glitch filter, based on the LPO clock, such that a detected external pin is required to stay asserted until the enabled glitch filter times out. There is also 2 additional cycles of latency due to synchronization that results in a total of 5 cycles of delay before the detect circuit alerts the system to the wakeup or reset event when the filter function is enabled.
Chapter 15 Low-leakage wake-up unit (LLWU) In the case of a wakeup due to external pin or internal module wakeup, the I/O states are held until software clears the ACKISO bit (by writing a 1 to it). Recovery is always via a system reset flow and the MC_SRS[WAKEUP] is set indicating the low leakage mode was active prior to the last system reset flow. An VLLS reset event due to RESET pin assertion causes an exit via a system reset.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 338 Freescale Semiconductor, Inc.
Chapter 16 Miscellaneous Control Module (MCM) 16.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The Miscellaneous Control Module (MCM) provides a myriad of miscellaneous control functions. 16.1.1 Features The MCM includes these distinctive features: • Program-visible information on the platform configuration and revision • Control and counting logic for ETB almost full 16.
Memory Map/Register Descriptions MCM memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page E008_000A Crossbar switch (AXBS) master configuration (MCM_PLAMC) 16 R 003Fh 16.2.2/340 E008_000C SRAM arbitration and protection (MCM_SRAMAP) 32 R/W 0000_0000h 16.2.3/341 E008_0010 Interrupt status register (MCM_ISR) 32 R 0000_0000h 16.2.4/342 E008_0014 ETB counter control register (MCM_ETBCC) 32 R/W 0000_0000h 16.2.
Chapter 16 Miscellaneous Control Module (MCM) MCM_PLAMC field descriptions Field Description 15–8 Reserved This read-only field is reserved and always has the value zero. 7–0 AMC Each bit in the AMC field indicates if there is a corresponding connection to the AXBS master input port. 0 1 A bus master connection to AXBS input port n is absent A bus master connection to AXBS input port n is present 16.2.
Memory Map/Register Descriptions MCM_SRAMAP field descriptions (continued) Field Description 01 10 11 27 Reserved Special round robin (favors SRAM backoor accesses over the processor) Fixed priority. Processor has highest, backdoor has lowest Fixed priority. Backdoor has highest, processor has lowest This read-only field is reserved and always has the value zero.
Chapter 16 Miscellaneous Control Module (MCM) MCM_ISR field descriptions (continued) Field Description 2 NMI Non-maskable interrupt pending If ETBCC[RSPT] is set to 10b, this bit is set when the ETB counter expires. 0 1 1 IRQ No pending NMI Due to the ETB counter expiring, an NMI is pending Normal interrupt pending If ETBCC[RSPT] is set to 01b, this bit is set when the ETB counter expires.
Memory Map/Register Descriptions MCM_ETBCC field descriptions (continued) Field Description If debug halt was enabled and a debug halt request was asserted on counter expiration, setting this bit clears the debug halt request.
Chapter 16 Miscellaneous Control Module (MCM) 16.2.
Functional Description 16.3.1.2 Normal interrupt The MCM's normal interrupt is generated if any of the following are true: • MCM_ISCR[ETBI] is set, which is caused by • The ETB counter is enabled (MCM_ETBCC[CNTEN] = 1), • The ETB count expires, and • The response to counter expiration is a normal interrupt (MCM_ETBCC[RSPT] = 01) K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 346 Freescale Semiconductor, Inc.
Chapter 17 Crossbar Switch (AXBS) 17.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. This chapter provides information on the layout, configuration, and programming of the crossbar switch. The crossbar switch connects bus masters and bus slaves using a crossbar switch structure.
Memory Map / Register Definition 17.2 Memory Map / Register Definition Each slave port of the crossbar switch contains configuration registers. Read- and writetransfers require two bus clock cycles. The registers can be read from and written to only in supervisor mode. Additionally, these registers can be read from or written to only by 32-bit accesses. A bus error response is returned if an unimplemented location is accessed within the crossbar switch.
Chapter 17 Crossbar Switch (AXBS) AXBS memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_4600 Priority Registers Slave (AXBS_PRS6) 32 R/W 7654_3210h 17.2.1/349 4000_4610 Control Register (AXBS_CRS6) 32 R/W 0000_0000h 17.2.2/352 4000_4700 Priority Registers Slave (AXBS_PRS7) 32 R/W 7654_3210h 17.2.1/349 4000_4710 Control Register (AXBS_CRS7) 32 R/W 0000_0000h 17.2.
Memory Map / Register Definition • If the device contains less than five masters, values 000– 011 are valid and writing other values results in an error. • If the device contains n masters where n ≥ 5, values 0 to n-1 are valid and writing other values results in an error.
Chapter 17 Crossbar Switch (AXBS) AXBS_PRSn field descriptions (continued) Field 22–20 M5 19 Reserved 18–16 M4 15 Reserved 14–12 M3 11 Reserved 10–8 M2 Description Master 5 priority. Sets the arbitration priority for this port on the associated slave port. 000 001 010 011 100 101 110 111 This master has level 1, or highest, priority when accessing the slave port. This master has level 2 priority when accessing the slave port. This master has level 3 priority when accessing the slave port.
Memory Map / Register Definition AXBS_PRSn field descriptions (continued) Field Description 7 Reserved This read-only field is reserved and always has the value zero. 6–4 M1 Master 1 priority. Sets the arbitration priority for this port on the associated slave port. 000 001 010 011 100 101 110 111 3 Reserved This master has level 1, or highest, priority when accessing the slave port. This master has level 2 priority when accessing the slave port.
Chapter 17 Crossbar Switch (AXBS) AXBS_CRSn field descriptions Field 31 RO Description Read only Forces the slave port’s CSRn and PRSn registers to be read-only. After set, only a hardware reset clears it. 0 1 30 HLP Halt low priority Sets the initial arbitration priority for low power mode requests. Setting this bit will not effect the request for low power mode from attaining highest priority once it has control of the slave ports.
Memory Map / Register Definition AXBS_CRSn field descriptions (continued) Field Description 001 010 011 100 101 110 111 Park on master port M1 Park on master port M2 Park on master port M3 Park on master port M4 Park on master port M5 Reserved Reserved 17.2.3 Master General Purpose Control Register (AXBS_MGPCRn) The MGPCR controls only whether the master’s undefined length burst accesses are allowed to complete uninterrupted or whether they can be broken by requests from higher priority masters.
Chapter 17 Crossbar Switch (AXBS) AXBS_MGPCRn field descriptions (continued) Field Description 101 110 111 Reserved Reserved Reserved 17.3 Functional Description 17.3.1 General operation When a master accesses the crossbar switch the access is immediately taken. If the targeted slave port of the access is available, then the access is immediately presented on the slave port. It is possible to make single-clock, or zero wait state, accesses through the crossbar.
Functional Description The crossbar terminates all master IDLE transfers, as opposed to allowing the termination to come from one of the slave busses. Additionally, when no master is requesting access to a slave port, the crossbar drives IDLE transfers onto the slave bus, even though a default master may be granted access to the slave port. When a slave bus is being idled by the crossbar, it can park the slave port on the master port indicated by CRSn[PARK].
Chapter 17 Crossbar Switch (AXBS) MGPCR[AULB] No arbitration Master-to-slave transfer 1 1 beat Lost control Arbitration allowed 2 3 4 5 6 1 beat Lost control No arbitration 7 8 9 10 No arbitration 11 12 12 beat burst Figure 17-28. Undefined length burst example In this example, a master runs an undefined length burst and the MGPCR[AULB] bits indicate arbitration occurs after the fourth beat of the burst.
Functional Description When a master makes a request to a slave port, the slave port checks if the new requesting master's priority level is higher than that of the master that currently has control over the slave port, unless the slave port is in a parked state. The slave port performs an arbitration check at every clock edge to ensure that the proper master, if any, has control of the slave port. The following table describes possible scenarios based on the requesting master port: Table 17-29.
Chapter 17 Crossbar Switch (AXBS) Parking may continue to be used in a round-robin mode, but does not affect the roundrobin pointer unless the parked master actually performs a transfer. Handoff occurs to the next master in line after one cycle of arbitration. If the slave port is put into low-power park mode, the round-robin pointer is reset to point at master port 0, giving it the highest priority. 17.3.3.4 Priority assignment Each master port needs to be assigned a unique 3-bit priority level.
Initialization/application information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 360 Freescale Semiconductor, Inc.
Chapter 18 Memory Protection Unit (MPU) 18.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The Memory Protection Unit (MPU) provides hardware access control for all memory references generated in the device. 18.2 Overview The MPU concurrently monitors all system bus transactions and evaluates their appropriateness using pre-programmed region descriptors that define memory spaces and their access rights.
Overview Slave Port n Address Phase Signals MPU_EARn Internal Peripheral Bus Access Evaluation Macro Region Descriptor 0 Access Evaluation Macro Region Descriptor 1 Access Evaluation Macro Region Descriptor x MPU_EDRn Mux Figure 18-1. MPU Block Diagram 18.2.2 Features The MPU implements a two-dimensional hardware array of memory region descriptors and the crossbar slave ports to continuously monitor the legality of every memory reference generated by each bus master in the system.
Chapter 18 Memory Protection Unit (MPU) • Alternate programming model view of the access control permissions word • Priority given to granting permission over denying access for overlapping region descriptors • Detects access protection errors if a memory reference does not hit in any memory region, or if the reference is illegal in all hit memory regions.
Memory Map/Register Definition MPU memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_D020 Error Address Register, Slave Port n (MPU_EAR2) 32 R Undefined 18.3.2/368 4000_D024 Error Detail Register, Slave Port n (MPU_EDR2) 32 R Undefined 18.3.3/369 4000_D028 Error Address Register, Slave Port n (MPU_EAR3) 32 R Undefined 18.3.2/368 4000_D02C Error Detail Register, Slave Port n (MPU_EDR3) 32 R Undefined 18.3.
Chapter 18 Memory Protection Unit (MPU) MPU memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_D46C Region Descriptor n, Word 3 (MPU_RGD6_WORD3) 32 R/W 0000_0000h 18.3.7/374 4000_D470 Region Descriptor n, Word 0 (MPU_RGD7_WORD0) 32 R/W 0000_0000h 18.3.4/370 4000_D474 Region Descriptor n, Word 1 (MPU_RGD7_WORD1) 32 R/W 0000_001Fh 18.3.5/371 4000_D478 Region Descriptor n, Word 2 (MPU_RGD7_WORD2) 32 R/W 0000_0000h 18.3.
Memory Map/Register Definition MPU memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4000_D81C Region Descriptor Alternate Access Control n (MPU_RGDAAC7) 32 R/W 0000_0000h 18.3.8/375 4000_D820 Region Descriptor Alternate Access Control n (MPU_RGDAAC8) 32 R/W 0000_0000h 18.3.8/375 4000_D824 Region Descriptor Alternate Access Control n (MPU_RGDAAC9) 32 R/W 0000_0000h 18.3.
Chapter 18 Memory Protection Unit (MPU) MPU_CESR field descriptions (continued) Field 22–20 Reserved Description This read-only field is reserved and always has the value zero. 19–16 HRL Hardware revision level 15–12 NSP Number of slave ports 11–8 NRGD Number of region descriptors Specifies the MPU’s hardware and definition revision level. It can be read by software to determine the functional definition of the module. Specifies the number of slave ports connected to the MPU.
Memory Map/Register Definition 18.3.2 Error Address Register, Slave Port n (MPU_EARn) When the MPU detects an access error on slave port n, the 32-bit reference address is captured in this read-only register and the corresponding bit in CESR[SPERR] set. Additional information about the faulting access is captured in the corresponding EDRn at the same time.
Chapter 18 Memory Protection Unit (MPU) 18.3.3 Error Detail Register, Slave Port n (MPU_EDRn) When the MPU detects an access error on slave port n, 32 bits of error detail are captured in this read-only register and the corresponding bit in CESR[SPERR] is set. Information on the faulting address is captured in the corresponding EARn register at the same time.
Memory Map/Register Definition MPU_EDRn field descriptions (continued) Field Description NOTE: All other encodings are reserved. 000 001 010 011 0 ERW User mode, instruction access User mode, data access Supervisor mode, instruction access Supervisor mode, data access Error read/write Indicates the access type of the faulting reference. 0 1 Read Write 18.3.
Chapter 18 Memory Protection Unit (MPU) 18.3.5 Region Descriptor n, Word 1 (MPU_RGD_WORD1) The second word of the region descriptor defines the 31-modulo-32 byte end address of the memory region. Writes to this register clear the region descriptor’s valid bit (RGDn_WORD3[VLD]).
Memory Map/Register Definition Writes to RGDn_WORD2 clear the region descriptor’s valid bit (RGDn_WORD3[VLD]). If only updating the access controls, write to RGDAACn instead because stores to these locations do not affect the descriptor’s valid bit.
Chapter 18 Memory Protection Unit (MPU) MPU_RGDn_WORD2 field descriptions (continued) Field Description 0 1 24 M4WE 23 Reserved 22–21 M3SM Bus master 4 write enable 0 1 Bus master 3 supervisor mode access control Defines the access controls for bus master 3 in supervisor mode r/w/x; read, write and execute allowed r/x; read and execute allowed, but no write r/w; read and write allowed, but no execute Same as user mode defined in M3UM Bus master 3 user mode access control Defines the access controls f
Memory Map/Register Definition MPU_RGDn_WORD2 field descriptions (continued) Field Description See M3UM description 18.3.7 Region Descriptor n, Word 3 (MPU_RGD_WORD3) The fourth word of the region descriptor contains the region descriptor’s valid bit.
Chapter 18 Memory Protection Unit (MPU) 18.3.8 Region Descriptor Alternate Access Control n (MPU_RGDAACn) Since software may adjust only the access controls within a region descriptor (RGDn_WORD2) as different tasks execute, an alternate programming view of this 32bit entity is available. Writing to this register does not affect the descriptor’s valid bit.
Memory Map/Register Definition MPU_RGDAACn field descriptions (continued) Field Description 0 1 Bus master 5 writes terminate with an access error and the write is not performed Bus master 5 writes allowed 25 M4RE Bus master 4 read enable.
Chapter 18 Memory Protection Unit (MPU) MPU_RGDAACn field descriptions (continued) Field Description 4–3 M0SM Bus master 0 supervisor mode access control 2–0 M0UM Bus master 0 user mode access control See M3SM description. See M3UM description. 18.4 Functional Description In this section, the functional operation of the MPU is detailed, including the operation of the access evaluation macro and the handling of error-terminated bus cycles. 18.4.
Functional Description 18.4.1.1 Hit Determination To determine if the current reference hits in the given region, two magnitude comparators are used with the region's start and end addresses.
Chapter 18 Memory Protection Unit (MPU) 1. If the access does not hit in any region descriptor, a protection error is reported. 2. If the access hits in a single region descriptor and that region signals a protection violation, a protection error is reported. 3. If the access hits in multiple (overlapping) regions and all regions signal protection violations, a protection error is reported.
Application Information • Creating a new memory region—Load the appropriate region descriptor into an available RGDn, using four sequential 32-bit writes. The hardware assists in the maintenance of the valid bit, so if this approach is followed, there are no coherency issues with the multi-cycle descriptor writes. (Clearing RGDn_Word3[VLD] deletes/ removes an existing memory region.
Chapter 18 Memory Protection Unit (MPU) Table 18-81.
Application Information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 382 Freescale Semiconductor, Inc.
Chapter 19 Peripheral Bridge (AIPS-Lite) 19.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The peripheral bridge (AIPS-Lite) converts the crossbar switch interface to an interface to access a majority of peripherals on the device. The peripheral bridge supports up to 128 peripherals. The peripheral bridge occupies a 64 MB portion of the address space.
Memory map/register definition module address, transfer attributes, byte enables, and write data as inputs to the peripherals. The peripheral bridge captures read data from the peripheral interface and drives it to the crossbar switch. The register maps of the peripherals are located on 4 KB boundaries. Each peripheral is allocated one 4 KB block of the memory map. The peripheral bridge (AIPS-Lite) memory map is illustrated as follows.
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPS memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_0040 Peripheral Access Control Register (AIPS0_PACRE) 32 R/W Undefined 19.2.3/394 4000_0044 Peripheral Access Control Register (AIPS0_PACRF) 32 R/W Undefined 19.2.3/394 4000_0048 Peripheral Access Control Register (AIPS0_PACRG) 32 R/W Undefined 19.2.
Memory map/register definition NOTE At reset, the default value loaded into the MPROT[7-0] fields is device-specific. See the Chip Configuration details for the value on your particular device. Accesses to registers or register fields which correspond to master or peripheral locations which are not implemented return zeros on reads, and are ignored on writes. Each master is assigned depending on its connection to the crossbar switch master ports.
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPSx_MPRA field descriptions (continued) Field 26 MTR1 Description Master trusted for read Determines whether the master is trusted for read accesses. 0 1 25 MTW1 Master trusted for writes Determines whether the master is trusted for write accesses. 0 1 24 MPL1 22 MTR2 Specifies how the privilege level of the master is determined. Master trusted for read Determines whether the master is trusted for read accesses.
Memory map/register definition AIPSx_MPRA field descriptions (continued) Field Description 0 1 16 MPL3 Master privilege level Specifies how the privilege level of the master is determined. 0 1 15 Reserved 14 MTR4 Master trusted for read Determines whether the master is trusted for read accesses. Determines whether the master is trusted for write accesses. 10 MTR5 Specifies how the privilege level of the master is determined.
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPSx_MPRA field descriptions (continued) Field Description 3–0 Reserved This read-only field is reserved and always has the value zero. 19.2.2 Peripheral Access Control Register (AIPSx_PACRn) Each of the peripherals has a four-bit PACR[0:127] field which defines the access levels supported by the given module.
Memory map/register definition Offset Register [31:28] [27:24] [23:20] [19:16] [15:12] [11:8] [7:4] [3:0] 0x60 PACRM PACR96 PACR97 PACR98 PACR99 PACR100 PACR101 PACR102 PACR103 0x64 PACRN PACR104 PACR105 PACR106 PACR107 PACR108 PACR109 PACR110 PACR111 0x68 PACRO PACR112 PACR113 PACR114 PACR115 PACR116 PACR117 PACR118 PACR119 0x6C PACRP PACR120 PACR121 PACR122 PACR123 PACR124 PACR125 PACR126 PACR127 Addresses: AIPS0_PACRA is 4000_0000h base + 20h offset = 400
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPSx_PACRn field descriptions (continued) Field 27 Reserved 26 SP1 Description This read-only field is reserved and always has the value zero. Supervisor protect Determines whether the peripheral requires supervisor privilege level for access. When this bit is set, the master privilege level must indicate the supervisor access attribute , and the MPROTn[MPL] control bit for the master must be set.
Memory map/register definition AIPSx_PACRn field descriptions (continued) Field Description 0 1 19 Reserved 18 SP3 This read-only field is reserved and always has the value zero. Supervisor protect Determines whether the peripheral requires supervisor privilege level for access. When this bit is set, the master privilege level must indicate the supervisor access attribute , and the MPROTn[MPL] control bit for the master must be set.
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPSx_PACRn field descriptions (continued) Field Description Determines whether the peripheral allows accesses from an untrusted master. When this bit is set and an access is attempted by an untrusted master, the access terminates with an error response and no peripheral access initiates. 0 1 11 Reserved 10 SP5 This read-only field is reserved and always has the value zero.
Memory map/register definition AIPSx_PACRn field descriptions (continued) Field 4 TP6 Description Trusted protect Determines whether the peripheral allows accesses from an untrusted master. When this bit is set and an access is attempted by an untrusted master, the access terminates with an error response and no peripheral access initiates . 0 1 3 Reserved 2 SP7 This read-only field is reserved and always has the value zero.
Chapter 19 Peripheral Bridge (AIPS-Lite) NOTE The reset value of the PACRE-P depends on your device's configuration.
Memory map/register definition AIPSx_PACRn field descriptions (continued) Field Description 0 1 25 WP1 Write protect Determines whether the peripheral allows write accesss. When this bit is set and a write access is attempted, access terminates with an error response and no peripheral access initiates. 0 1 24 TP1 22 SP2 Determines whether the peripheral allows accesses from an untrusted master.
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPSx_PACRn field descriptions (continued) Field Description the master must be set. If not, access terminates with an error response and no peripheral access initiates. 0 1 17 WP3 Write protect Determines whether the peripheral allows write accesss. When this bit is set and a write access is attempted, access terminates with an error response and no peripheral access initiates.
Memory map/register definition AIPSx_PACRn field descriptions (continued) Field Description Determines whether the peripheral requires supervisor privilege level for access. When this bit is set, the master privilege level must indicate the supervisor access attribute , and the MPROTn[MPL] control bit for the master must be set. If not, access terminates with an error response and no peripheral access initiates. 0 1 9 WP5 Write protect Determines whether the peripheral allows write accesss.
Chapter 19 Peripheral Bridge (AIPS-Lite) AIPSx_PACRn field descriptions (continued) Field 2 SP7 Description Supervisor protect Determines whether the peripheral requires supervisor privilege level for access. When this bit is set, the master privilege level must indicate the supervisor access attribute , and the MPROTn[MPL] control bit for the master must be set. If not, access terminates with an error response and no peripheral access initiates .
Functional Description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 400 Freescale Semiconductor, Inc.
Chapter 20 Direct memory access multiplexer (DMAMUX) 20.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. 20.1.1 Overview The DMA Mux routes up to 63 DMA sources (called slots) to be mapped to any of the 16 DMA channels. This is illustrated in the following figure. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Introduction DMAMUX Source #1 DMA Channel #0 DMA Channel #1 Source #2 Source #3 Source #x Always #1 Always #y Trigger #1 DMA Channel #n Trigger #z Figure 20-1. DMA MUX block diagram 20.1.2 Features The DMA channel MUX provides these features: • 52 peripheral slots + 10 always-on slots can be routed to 16 channels. • 16 independently selectable DMA channel routers. • The first 4 channels additionally provide a trigger functionality.
Chapter 20 Direct memory access multiplexer (DMAMUX) In this mode, the DMA channel is disabled. Since disabling and enabling of DMA channels is done primarily via the DMA configuration registers, this mode is used mainly as the reset state for a DMA channel in the DMA channel MUX. It may also be used to temporarily suspend a DMA channel while reconfiguration of the system takes place (e.g. changing the period of a DMA trigger).
Memory map/register definition DMAMUX memory map Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4002_1000 Channel Configuration Register (DMAMUX_CHCFG0) 8 R/W 00h 20.3.1/404 4002_1001 Channel Configuration Register (DMAMUX_CHCFG1) 8 R/W 00h 20.3.1/404 4002_1002 Channel Configuration Register (DMAMUX_CHCFG2) 8 R/W 00h 20.3.1/404 4002_1003 Channel Configuration Register (DMAMUX_CHCFG3) 8 R/W 00h 20.3.
Chapter 20 Direct memory access multiplexer (DMAMUX) DMAMUX_CHCFGn field descriptions Field 7 ENBL Description DMA Channel Enable Enables the DMA channel 0 1 6 TRIG DMA Channel Trigger Enable Enables the periodic trigger capability for the triggered DMA channel 0 1 5–0 SOURCE DMA channel is disabled. This mode is primarily used during configuration of the DMA Mux. The DMA has separate channel enables/disables, which should be used to disable or re-configure a DMA channel.
Functional description such, the configuration of the periodic triggering interval is done via configuration registers in the PIT. Please refer to Periodic Interrupt Timer chapter for more information on this topic. Note Because of the dynamic nature of the system (i.e. DMA channel priorities, bus arbitration, interrupt service routine lengths, etc.), the number of clock cycles between a trigger and the actual DMA transfer cannot be guaranteed.
Chapter 20 Direct memory access multiplexer (DMAMUX) Peripheral Request Trigger DMA Request Figure 20-20. DMA MUX channel triggering: normal operation Once the DMA request has been serviced, the peripheral will negate its request, effectively resetting the gating mechanism until the peripheral re-asserts its request AND the next trigger event is seen. This means that if a trigger is seen, but the peripheral is not requesting a transfer, that triggered will be ignored.
Functional description 20.4.2 DMA channels with no triggering capability The other channels of the DMA MUX provide the normal routing functionality as described in Modes of operation. 20.4.3 "Always enabled" DMA sources In addition to the peripherals that can be used as DMA sources, there are 10 additional DMA sources that are "always enabled".
Chapter 20 Direct memory access multiplexer (DMAMUX) • Use explicit software re-activation. In this option, the DMA is configured to transfer the data using both minor and major loops, but the processor is required to re-activate the channel (by writing to the DMA registers) after every minor loop. For this option, the DMA channel should be disabled in the DMA channel MUX. • Use a "always enabled" DMA source.
Initialization/application information 3. Configure a timer for the desired trigger interval 4. Write 0xC5 to CHCFG2 (base address + 0x02) The following code example illustrates steps #1 and #4 above: In File registers.
Chapter 20 Direct memory access multiplexer (DMAMUX) volatile volatile volatile volatile volatile volatile volatile volatile volatile volatile volatile volatile volatile unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned char char char char char char char char char char char char char *CHCONFIG3 = *CHCONFIG4 = *CHCONFIG5 = *CHCONFIG6 = *CHCONFIG7 = *CHCONFIG8 = *CHCONFIG9 = *CHCONFIG10= *CHCONFIG11= *CHCONFIG12= *CHCONFIG13= *CHCONFIG14= *
Initialization/application information volatile volatile volatile volatile volatile volatile volatile volatile unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned char char char char char char char char *CHCONFIG8 = *CHCONFIG9 = *CHCONFIG10= *CHCONFIG11= *CHCONFIG12= *CHCONFIG13= *CHCONFIG14= *CHCONFIG15= (volatile (volatile (volatile (volatile (volatile (volatile (volatile (volatile unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned char char char char char ch
Chapter 21 Direct Memory Access Controller (eDMA) 21.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The enhanced direct memory access (eDMA) controller is a second-generation module capable of performing complex data transfers with minimal intervention from a host processor.
Introduction eDMA Write Address Write Data 0 Transfer Control Descriptor (TCD) n-1 64 eDMA Engine Program Model/ Channel Arbitration Read Data Read Data Internal Peripheral Bus To/From Crossbar Switch 1 2 Address Path Control Data Path Write Data Address eDMA Peripheral Request eDMA Done Figure 21-1. eDMA block diagram 21.1.2 Block parts The eDMA module is partitioned into two major modules: the eDMA engine and the transfer-control descriptor local memory.
Chapter 21 Direct Memory Access Controller (eDMA) Table 21-1. eDMA engine submodules Submodule Address path Function This block implements registered versions of two channel transfer control descriptors, channel x and channel y, and manages all master bus-address calculations. All the channels provide the same functionality.
Introduction Table 21-2. Transfer control descriptor memory Submodule Description Memory controller This logic implements the required dual-ported controller, managing accesses from the eDMA engine as well as references from the internal peripheral bus. As noted earlier, in the event of simultaneous accesses, the eDMA engine is given priority and the peripheral transaction is stalled. Memory array TCD storage is implemented using a single-port, synchronous RAM array. 21.1.
Chapter 21 Direct Memory Access Controller (eDMA) • Channel completion reported via optional interrupt requests • One interrupt per channel, optionally asserted at completion of major iteration count • Optional error terminations per channel and logically summed together to form one error interrupt to the interrupt controller • Optional support for scatter/gather DMA processing • Support for complex data structures • Support to cancel transfers via software In the discussion of this module, n is used to re
Memory map/register definition • The first region defines a number of registers providing control functions • The second region corresponds to the local transfer control descriptor memory Each channel requires a 32-byte transfer control descriptor for defining the desired data movement operation. The channel descriptors are stored in the local memory in sequential order: channel 0, channel 1,... channel 15 . Each TCDn definition is presented as 11 registers of 16 or 32 bits.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) 4000_801E Register name Width Access (in bits) Clear Error Register (DMA_CERR) Reset value Section/ page 8 W (always reads zero) 00h 21.3.11/ 446 00h 21.3.12/ 447 4000_801F Clear Interrupt Request Register (DMA_CINT) 8 W (always reads zero) 4000_8024 Interrupt Request Register (DMA_INT) 32 R/W 0000_0000h 21.3.13/ 447 4000_802C Error Register (DMA_ERR) 32 R/W 0000_0000h 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_810E Channel n Priority Register (DMA_DCHPRI13) 8 R/W Undefined 21.3.16/ 454 4000_810F Channel n Priority Register (DMA_DCHPRI12) 8 R/W Undefined 21.3.16/ 454 4000_9000 TCD Source Address (DMA_TCD0_SADDR) 32 R/W Undefined 21.3.17/ 455 4000_9004 TCD Signed Source Address Offset (DMA_TCD0_SOFF) 16 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_9028 TCD Minor Byte Count (Minor Loop Disabled) (DMA_TCD1_NBYTES_MLNO) 32 R/W Undefined 21.3.20/ 457 4000_9028 TCD Signed Minor Loop Offset (Minor Loop Enabled and Offset Disabled) (DMA_TCD1_NBYTES_MLOFFNO) 32 R/W Undefined 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_9054 TCD Signed Destination Address Offset (DMA_TCD2_DOFF) 16 R/W Undefined 21.3.25/ 461 4000_9056 TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled) (DMA_TCD2_CITER_ELINKYES) 16 R/W Undefined 21.3.26/ 461 4000_9056 DMA_TCD2_CITER_ELINKNO 16 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_907E TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled) (DMA_TCD3_BITER_ELINKYES) 16 R/W Undefined 21.3.30/ 466 4000_907E TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Disabled) (DMA_TCD3_BITER_ELINKNO) 16 R/W Undefined 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_90A6 TCD Transfer Attributes (DMA_TCD5_ATTR) 16 R/W Undefined 21.3.19/ 456 4000_90A8 TCD Minor Byte Count (Minor Loop Disabled) (DMA_TCD5_NBYTES_MLNO) 32 R/W Undefined 21.3.20/ 457 4000_90A8 TCD Signed Minor Loop Offset (Minor Loop Enabled and Offset Disabled) (DMA_TCD5_NBYTES_MLOFFNO) 32 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_90D0 TCD Destination Address (DMA_TCD6_DADDR) 32 R/W Undefined 21.3.24/ 460 4000_90D4 TCD Signed Destination Address Offset (DMA_TCD6_DOFF) 16 R/W Undefined 21.3.25/ 461 4000_90D6 TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled) (DMA_TCD6_CITER_ELINKYES) 16 R/W Undefined 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_90FC TCD Control and Status (DMA_TCD7_CSR) 16 R/W Undefined 21.3.29/ 464 4000_90FE TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled) (DMA_TCD7_BITER_ELINKYES) 16 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_9124 TCD Signed Source Address Offset (DMA_TCD9_SOFF) 16 R/W Undefined 21.3.18/ 456 4000_9126 TCD Transfer Attributes (DMA_TCD9_ATTR) 16 R/W Undefined 21.3.19/ 456 4000_9128 TCD Minor Byte Count (Minor Loop Disabled) (DMA_TCD9_NBYTES_MLNO) 32 R/W Undefined 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_914C TCD Last Source Address Adjustment (DMA_TCD10_SLAST) 32 R/W Undefined 21.3.23/ 460 4000_9150 TCD Destination Address (DMA_TCD10_DADDR) 32 R/W Undefined 21.3.24/ 460 4000_9154 TCD Signed Destination Address Offset (DMA_TCD10_DOFF) 16 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_9178 TCD Last Destination Address Adjustment/Scatter Gather Address (DMA_TCD11_DLASTSGA) 32 R/W Undefined 21.3.28/ 463 4000_917C TCD Control and Status (DMA_TCD11_CSR) 16 R/W Undefined 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_91A0 TCD Source Address (DMA_TCD13_SADDR) 32 R/W Undefined 21.3.17/ 455 4000_91A4 TCD Signed Source Address Offset (DMA_TCD13_SOFF) 16 R/W Undefined 21.3.18/ 456 4000_91A6 TCD Transfer Attributes (DMA_TCD13_ATTR) 16 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_91C8 TCD Signed Minor Loop Offset (Minor Loop and Offset Enabled) (DMA_TCD14_NBYTES_MLOFFYES) 32 R/W Undefined 21.3.22/ 459 4000_91CC TCD Last Source Address Adjustment (DMA_TCD14_SLAST) 32 R/W Undefined 21.3.23/ 460 4000_91D0 TCD Destination Address (DMA_TCD14_DADDR) 32 R/W Undefined 21.3.
Memory map/register definition DMA memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4000_91F6 DMA_TCD15_CITER_ELINKNO 16 R/W Undefined 21.3.27/ 462 4000_91F8 TCD Last Destination Address Adjustment/Scatter Gather Address (DMA_TCD15_DLASTSGA) 32 R/W Undefined 21.3.28/ 463 4000_91FC TCD Control and Status (DMA_TCD15_CSR) 16 R/W Undefined 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_CR field descriptions (continued) Field Description 0 1 16 ECX 15–8 Reserved 7 EMLM 6 CLM Normal operation Cancel the remaining data transfer. Stop the executing channel and force the minor loop to finish. The cancel takes effect after the last write of the current read/write sequence. The CX bit clears itself after the cancel has been honored. This cancel retires the channel normally as if the minor loop was completed.
Memory map/register definition DMA_CR field descriptions (continued) Field Description 0 1 0 Reserved When in debug mode, the DMA continues to operate. When in debug mode, the DMA stalls the start of a new channel. Executing channels are allowed to complete. Channel execution resumes when the system exits debug mode or the EDBG bit is cleared. This read-only field is reserved and always has the value zero. 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_ES field descriptions (continued) Field 15 Reserved 14 CPE Description This read-only field is reserved and always has the value zero. Channel Priority Error 0 1 No channel priority error The last recorded error was a configuration error in the channel priorities. Channel priorities are not unique. 13–12 Reserved This read-only field is reserved and always has the value zero.
Memory map/register definition DMA_ES field descriptions (continued) Field Description 1 SBE Source Bus Error 0 DBE Destination Bus Error 0 1 0 1 No source bus error The last recorded error was a bus error on a source read No destination bus error The last recorded error was a bus error on a destination write 21.3.3 Enable Request Register (DMA_ERQ) The ERQ register provides a bit map for the 16 implemented channels to enable the request signal for each channel.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_ERQ field descriptions (continued) Field Description 13 ERQ13 Enable DMA Request 13 12 ERQ12 Enable DMA Request 12 11 ERQ11 Enable DMA Request 11 10 ERQ10 Enable DMA Request 10 9 ERQ9 Enable DMA Request 9 8 ERQ8 Enable DMA Request 8 7 ERQ7 Enable DMA Request 7 6 ERQ6 Enable DMA Request 6 5 ERQ5 Enable DMA Request 5 4 ERQ4 Enable DMA Request 4 3 ERQ3 Enable DMA Request 3 2 ERQ2 Enable DMA Request 2 0 1 0 1 0 1 0 1 0 1 0 1
Memory map/register definition DMA_ERQ field descriptions (continued) Field Description 0 1 The DMA request signal for the corresponding channel is disabled The DMA request signal for the corresponding channel is enabled 1 ERQ1 Enable DMA Request 1 0 ERQ0 Enable DMA Request 0 0 1 0 1 The DMA request signal for the corresponding channel is disabled The DMA request signal for the corresponding channel is enabled The DMA request signal for the corresponding channel is disabled The DMA request signal
Chapter 21 Direct Memory Access Controller (eDMA) DMA_EEI field descriptions (continued) Field Description 13 EEI13 Enable Error Interrupt 13 12 EEI12 Enable Error Interrupt 12 11 EEI11 Enable Error Interrupt 11 10 EEI10 Enable Error Interrupt 10 9 EEI9 Enable Error Interrupt 9 8 EEI8 Enable Error Interrupt 8 7 EEI7 Enable Error Interrupt 7 6 EEI6 Enable Error Interrupt 6 5 EEI5 Enable Error Interrupt 5 4 EEI4 Enable Error Interrupt 4 3 EEI3 Enable Error Interrupt 3 2 EEI2 Enable E
Memory map/register definition DMA_EEI field descriptions (continued) Field Description 0 1 The error signal for corresponding channel does not generate an error interrupt The assertion of the error signal for corresponding channel generates an error interrupt request 1 EEI1 Enable Error Interrupt 1 0 EEI0 Enable Error Interrupt 0 0 1 0 1 The error signal for corresponding channel does not generate an error interrupt The assertion of the error signal for corresponding channel generates an error in
Chapter 21 Direct Memory Access Controller (eDMA) 21.3.6 Set Enable Error Interrupt Register (DMA_SEEI) The SEEI provides a simple memory-mapped mechanism to set a given bit in the EEI to enable the error interrupt for a given channel. The data value on a register write causes the corresponding bit in the EEI to be set. Setting the SAEE bit provides a global set function, forcing the entire EEI contents to be set. If the NOP bit is set, the command is ignored.
Memory map/register definition 21.3.7 Clear Enable Request Register (DMA_CERQ) The CERQ provides a simple memory-mapped mechanism to clear a given bit in the ERQ to disable the DMA request for a given channel. The data value on a register write causes the corresponding bit in the ERQ to be cleared. Setting the CAER bit provides a global clear function, forcing the entire contents of the ERQ to be cleared, disabling all DMA request inputs. If NOP is set, the command is ignored.
Chapter 21 Direct Memory Access Controller (eDMA) 21.3.8 Set Enable Request Register (DMA_SERQ) The SERQ provides a simple memory-mapped mechanism to set a given bit in the ERQ to enable the DMA request for a given channel. The data value on a register write causes the corresponding bit in the ERQ to be set. Setting the SAER bit provides a global set function, forcing the entire contents of ERQ to be set. If the NOP bit is set, the command is ignored.
Memory map/register definition 21.3.9 Clear DONE Status Bit Register (DMA_CDNE) The CDNE provides a simple memory-mapped mechanism to clear the DONE bit in the TCD of the given channel. The data value on a register write causes the DONE bit in the corresponding transfer control descriptor to be cleared. Setting the CADN bit provides a global clear function, forcing all DONE bits to be cleared. If the NOP bit is set, the command is ignored. This allows you to write multiple-byte registers as a 32-bit word.
Chapter 21 Direct Memory Access Controller (eDMA) 21.3.10 Set START Bit Register (DMA_SSRT) The SSRT provides a simple memory-mapped mechanism to set the START bit in the TCD of the given channel. The data value on a register write causes the START bit in the corresponding transfer control descriptor to be set. Setting the SAST bit provides a global set function, forcing all START bits to be set. If the NOP bit is set, the command is ignored.
Memory map/register definition 21.3.11 Clear Error Register (DMA_CERR) The CERR provides a simple memory-mapped mechanism to clear a given bit in the ERR to disable the error condition flag for a given channel. The given value on a register write causes the corresponding bit in the ERR to be cleared. Setting the CAEI bit provides a global clear function, forcing the ERR contents to be cleared, clearing all channel error indicators. If the NOP bit is set, the command is ignored.
Chapter 21 Direct Memory Access Controller (eDMA) 21.3.12 Clear Interrupt Request Register (DMA_CINT) The CINT provides a simple, memory-mapped mechanism to clear a given bit in the INT to disable the interrupt request for a given channel. The given value on a register write causes the corresponding bit in the INT to be cleared. Setting the CAIR bit provides a global clear function, forcing the entire contents of the INT to be cleared, disabling all DMA interrupt requests.
Memory map/register definition The state of any given channel’s interrupt request is directly affected by writes to this register; it is also affected by writes to the CINT register. On writes to INT, a 1 in any bit position clears the corresponding channel’s interrupt request. A zero in any bit position has no affect on the corresponding channel’s current interrupt status.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_INT field descriptions (continued) Field Description 0 1 The interrupt request for corresponding channel is cleared The interrupt request for corresponding channel is active 10 INT10 Interrupt Request 10 9 INT9 Interrupt Request 9 8 INT8 Interrupt Request 8 7 INT7 Interrupt Request 7 6 INT6 Interrupt Request 6 5 INT5 Interrupt Request 5 4 INT4 Interrupt Request 4 3 INT3 Interrupt Request 3 2 INT2 Interrupt Request 2 1 INT1 Interrup
Memory map/register definition 21.3.14 Error Register (DMA_ERR) The ERR provides a bit map for the 16 channels, signaling the presence of an error for each channel. The eDMA engine signals the occurrence of an error condition by setting the appropriate bit in this register. The outputs of this register are enabled by the contents of the EEI, and then routed to the interrupt controller.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_ERR field descriptions (continued) Field Description 15 ERR15 Error In Channel 15 14 ERR14 Error In Channel 14 13 ERR13 Error In Channel 13 12 ERR12 Error In Channel 12 11 ERR11 Error In Channel 11 10 ERR10 Error In Channel 10 9 ERR9 Error In Channel 9 8 ERR8 Error In Channel 8 7 ERR7 Error In Channel 7 6 ERR6 Error In Channel 6 5 ERR5 Error In Channel 5 4 ERR4 Error In Channel 4 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Memory map/register definition DMA_ERR field descriptions (continued) Field Description 0 1 An error in the corresponding channel has not occurred An error in the corresponding channel has occurred 3 ERR3 Error In Channel 3 2 ERR2 Error In Channel 2 1 ERR1 Error In Channel 1 0 ERR0 Error In Channel 0 0 1 0 1 0 1 0 1 An error in the corresponding channel has not occurred An error in the corresponding channel has occurred An error in the corresponding channel has not occurred An error in the
Chapter 21 Direct Memory Access Controller (eDMA) DMA_HRS field descriptions Field 31–16 Reserved Description This read-only field is reserved and always has the value zero.
Memory map/register definition DMA_HRS field descriptions (continued) Field Description 4 HRS4 Hardware Request Status Channel 4 3 HRS3 Hardware Request Status Channel 3 2 HRS2 Hardware Request Status Channel 2 1 HRS1 Hardware Request Status Channel 1 0 HRS0 Hardware Request Status Channel 0 0 1 0 1 0 1 0 1 0 1 A hardware service request for the corresponding channel is not present A hardware service request for the corresponding channel is present A hardware service request for the corre
Chapter 21 Direct Memory Access Controller (eDMA) DMA_DCHPRIn field descriptions (continued) Field Description 0 1 6 DPA Channel n cannot be suspended by a higher priority channel’s service request Channel n can be temporarily suspended by the service request of a higher priority channel Disable Preempt Ability 0 1 5–4 Reserved Channel n can suspend a lower priority channel Channel n cannot suspend any channel, regardless of channel priority This read-only field is reserved and always has the value
Memory map/register definition 21.3.18 TCD Signed Source Address Offset (DMA_TCD_SOFF) Addresses: 4000_8000h base + 1004h offset + (32d × n), where n = 0d to 15d Bit 15 14 13 12 11 10 9 8 Read 6 5 4 3 2 1 0 x* x* x* x* x* x* x* x* SOFF Write Reset 7 x* x* x* x* x* x* x* x* * Notes: • x = Undefined at reset.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_TCDn_ATTR field descriptions (continued) Field Description 10–8 SSIZE Source data transfer size The attempted use of a Reserved encoding causes a configuration error. 000 001 010 011 100 101 110 111 8-bit 16-bit 32-bit Reserved 16-byte Reserved Reserved Reserved 7–3 DMOD Destination Address Modulo 2–0 DSIZE Destination Data Transfer Size See the SMOD definition See the SSIZE definition 21.3.
Memory map/register definition DMA_TCDn_NBYTES_MLNO field descriptions (continued) Field Description is exhausted, the SADDR and DADDR values are written back into the TCD memory, the major iteration count is decremented and restored to the TCD memory. If the major iteration count is completed, additional processing is performed. NOTE: An NBYTES value of 0x0000_0000 is interpreted as a 4 GB transfer. 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_TCDn_NBYTES_MLOFFNO field descriptions (continued) Field Description As a channel activates, the appropriate TCD contents load into the eDMA engine, and the appropriate reads and writes perform until the minor byte transfer count has transferred. This is an indivisible operation and cannot be halted; although, it may be stalled by using the bandwidth control field, or via preemption.
Memory map/register definition DMA_TCDn_NBYTES_MLOFFYES field descriptions (continued) Field Description 9–0 NBYTES Minor Byte Transfer Count Number of bytes to be transferred in each service request of the channel. As a channel activates, the appropriate TCD contents load into the eDMA engine, and the appropriate reads and writes perform until the minor byte transfer count has transferred. This is an indivisible operation and cannot be halted.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_TCDn_DADDR field descriptions Field Description 31–0 DADDR Destination Address Memory address pointing to the destination data. 21.3.25 TCD Signed Destination Address Offset (DMA_TCD_DOFF) Addresses: 4000_8000h base + 1014h offset + (32d × n), where n = 0d to 15d Bit 15 14 13 12 11 10 9 8 Read 7 6 5 4 3 2 1 0 x* x* x* x* x* x* x* x* DOFF Write Reset x* x* x* x* x* x* x* x* * Notes: • x = Undefined at reset.
Memory map/register definition DMA_TCDn_CITER_ELINKYES field descriptions Field Description 15 ELINK Enable channel-to-channel linking on minor-loop complete As the channel completes the minor loop, this flag enables linking to another channel, defined by the LINKCH field. The link target channel initiates a channel service request via an internal mechanism that sets the TCDn_CSR[START] bit of the specified channel.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_TCDn_CITER_ELINKNO field descriptions Field Description 15 ELINK Enable channel-to-channel linking on minor-loop complete As the channel completes the minor loop, this flag enables linking to another channel, defined by the LINKCH field. The link target channel initiates a channel service request via an internal mechanism that sets the TCDn_CSR[START] bit of the specified channel.
Memory map/register definition DMA_TCDn_DLASTSGA field descriptions (continued) Field Description else • This address points to the beginning of a 0-modulo-32-byte region containing the next transfer control descriptor to be loaded into this channel. This channel reload is performed as the major iteration count completes. The scatter/gather address must be 0-modulo-32-byte, else a configuration error is reported. 21.3.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_TCDn_CSR field descriptions (continued) Field Description • After the major loop counter is exhausted, the eDMA engine initiates a channel service request at the channel defined by these six bits by setting that channel’s TCDn_CSR[START] bit. 7 DONE Channel Done This flag indicates the eDMA has completed the major loop. The eDMA engine sets it as the CITER count reaches zero; The software clears it, or the hardware when the channel is activated.
Memory map/register definition DMA_TCDn_CSR field descriptions (continued) Field Description 0 1 1 INTMAJOR The half-point interrupt is disabled The half-point interrupt is enabled Enable an interrupt when major iteration count completes If this flag is set, the channel generates an interrupt request by setting the appropriate bit in the INT when the current major iteration count reaches zero.
Chapter 21 Direct Memory Access Controller (eDMA) DMA_TCDn_BITER_ELINKYES field descriptions (continued) Field Description 0 1 14–13 Reserved The channel-to-channel linking is disabled The channel-to-channel linking is enabled This read-only field is reserved and always has the value zero.
Functional description DMA_TCDn_BITER_ELINKNO field descriptions (continued) Field Description value extends to 15 bits in place of a link channel number. If the major loop is exhausted, this link mechanism is suppressed in favor of the MAJORELINK channel linking. NOTE: When the software loads the TCD, this field must be set equal to the corresponding CITER field. Otherwise, a configuration error is reported.
Chapter 21 Direct Memory Access Controller (eDMA) eDMA Write Address Write Data 0 Transfer Control Descriptor (TCD) 64 eDMA Engine Program Model/ Channel Arbitration Read Data n-1 Internal Peripheral Bus To/From Crossbar Switch 1 2 Read Data Address Path Control Data Path Write Data Address eDMA Peripheral Request eDMA Done Figure 21-289. eDMA operation, part 1 This example uses the assertion of the eDMA peripheral request signal to request service for channel n.
Functional description eDMA Write Address Write Data To/From Crossbar Switch Transfer Control Descriptor (TCD) n-1 64 eDMA Engine Program Model/ Channel Arbitration Read Data Internal Peripheral Bus 0 1 2 Read Data Address Path Control Data Path Write Data Address eDMA Peripheral Request eDMA Done Figure 21-290.
Chapter 21 Direct Memory Access Controller (eDMA) eDMA Write Address Write Data To/From Crossbar Switch Transfer Control Descriptor (TCD) n-1 64 Internal Peripheral Bus 0 1 2 eDMA En g in e Program Model/ Channel Arbitration Read Data Read Data Address Path Control Data Path Write Data Address eDMA Peripheral Request eDMA Done Figure 21-291. eDMA operation, part 3 21.4.
Functional description • All source reads and destination writes must be configured to the natural boundary of the programmed transfer size respectively. • In fixed arbitration mode, a configuration error is caused by any two channel priorities being equal. All channel priority levels must be unique when fixed arbitration mode is enabled.
Chapter 21 Direct Memory Access Controller (eDMA) loop complete indicators, setting the transfer control descriptor DONE flag and the possible assertion of an interrupt request, are not affected when an error is detected. After the error status has been updated, the eDMA engine continues operating by servicing the next appropriate channel. A channel that experiences an error condition is not automatically disabled.
Functional description address spaces remains important. However, the microarchitecture of the eDMA also factors significantly into the resulting metric. 21.4.4.1 Peak transfer rates The peak transfer rates for several different source and destination transfers are shown in the following tables.
Chapter 21 Direct Memory Access Controller (eDMA) The eDMA design supports the following hardware service request sequence: Table 21-293. Hardware service request process, cycles 1–7 Cycle Description 1 eDMA peripheral request is asserted. 2 The eDMA peripheral request is registered locally in the eDMA module and qualified. TCDn_CSR[START] bit initiated requests start at this point with the registering of the user write to TCDn word 7. 3 Channel arbitration begins. 4 Channel arbitration completes.
Functional description Assuming zero wait states on the system bus, DMA requests can be processed every 9 cycles. Assuming an average of the access times associated with internal peripheral busto-SRAM (4 cycles) and SRAM-to-internal peripheral bus (5 cycles), DMA requests can be processed every 11.5 cycles (4 + (4+5)/2 + 3). This is the time from Cycle 4 to Cycle ? +5. The resulting peak request rate, as a function of the system frequency, is shown in the following table. Table 21-295.
Chapter 21 Direct Memory Access Controller (eDMA) PEAKreq = 150 MHz / [ 4 + (1 + 1) + (1 + 3) + 3 ] cycles = 11.5 Mreq/sec For an internal peripheral bus to SRAM transfer, PEAKreq = 150 MHz / [ 4 + (1 + 2) + (1 + 1) + 3 ] cycles = 12.5 Mreq/sec Assuming an even distribution of the two transfer types, the average peak request rate would be: PEAKreq = (11.5 Mreq/sec + 12.5 Mreq/sec) / 2 = 12.
Initialization/application information 3. Enable error interrupts in the EEI register if so desired. 4. Write the 32-byte TCD for each channel that may request service. 5. Enable any hardware service requests via the ERQ register. 6.
Chapter 21 Direct Memory Access Controller (eDMA) The following figure shows how each DMA request initiates one minor-loop transfer, or iteration, without CPU intervention. DMA arbitration can occur after each minor loop, and one level of minor loop DMA preemption is allowed. The number of minor loops in a major loop is specified by the beginning iteration count (BITER).
Initialization/application information 21.5.2 Programming errors The eDMA performs various tests on the transfer control descriptor to verify consistency in the descriptor data. Most programming errors are reported on a per channel basis with the exception of channel priority error (ES[CPE]). For all error types other than channel priority error, the channel number causing the error is recorded in the ES register.
Chapter 21 Direct Memory Access Controller (eDMA) For example, the following TCD entry is configured to transfer 16 bytes of data. The eDMA is programmed for one iteration of the major loop transferring 16 bytes per iteration. The source memory has a byte wide memory port located at 0x1000. The destination memory has a 32-bit port located at 0x2000. The address offsets are programmed in increments to match the transfer size: one byte for the source and four bytes for the destination.
Initialization/application information h. Write 32-bits to location 0x200C → last iteration of the minor loop → major loop complete. 6. The eDMA engine writes: TCDn_SADDR = 0x1000, TCDn_DADDR = 0x2000, TCDn_CITER = 1 (TCDn_BITER). 7. The eDMA engine writes: TCDn_CSR[ACTIVE] = 0, TCDn_CSR[DONE] = 1, INT[n] = 1. 8. The channel retires and the eDMA goes idle or services the next channel. 21.5.4.
Chapter 21 Direct Memory Access Controller (eDMA) f. Write 32-bits to location 0x2008 → third iteration of the minor loop. g. Read byte from location 0x100C, read byte from location 0x100D, read byte from 0x100E, read byte from 0x100F. h. Write 32-bits to location 0x200C → last iteration of the minor loop. 6. eDMA engine writes: TCDn_SADDR = 0x1010, TCDn_DADDR = 0x2010, TCDn_CITER = 1. 7. eDMA engine writes: TCDn_CSR[ACTIVE] = 0. 8. The channel retires → one iteration of the major loop.
Initialization/application information 15. eDMA engine writes: TCDn_CSR[ACTIVE] = 0, TCDn_CSR[DONE] = 1, INT[n] = 1. 16. The channel retires → major loop complete. The eDMA goes idle or services the next channel. 21.5.4.3 Using the modulo feature The modulo feature of the eDMA provides the ability to implement a circular data queue in which the size of the queue is a power of 2.
Chapter 21 Direct Memory Access Controller (eDMA) complete condition is indicated by both bits reading zero after the TCDn_CSR[START] was set. Polling the TCDn_CSR[ACTIVE] bit may be inconclusive, because the active status may be missed if the channel execution is short in duration.
Initialization/application information DADDR, and NBYTES, decrements to zero as the transfer progresses, can give an indication of the progress of the transfer. All other values are read back from the TCD local memory. 21.5.5.3 Checking channel preemption status Preemption is available only when fixed arbitration is selected as the channel arbitration mode. A preemptive situation is one in which a preempt-enabled channel runs and a higher priority request becomes active.
Chapter 21 Direct Memory Access Controller (eDMA) Because software can change the configuration during execution, a coherency sequence must be followed. Consider the scenario the user attempts to execute a dynamic channel link by enabling the TCDn_CSR[MAJOR_E_LINK] bit as the eDMA engine retires the channel. The TCDn_CSR[MAJOR_E_LINK] would be set in the programmer's model, but it would be indeterminate whether the actual link was made before the channel retired.
Initialization/application information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 488 Freescale Semiconductor, Inc.
Chapter 22 External Watchdog Monitor (EWM) 22.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The watchdog is generally used to monitor the flow and execution of embedded software within an MCU. The watchdog consists of a counter that if allowed to overflow, forces an internal reset (asynchronous) to all on-chip peripherals and optionally assert the RESET pin to reset external devices/circuits.
Introduction • Windowed refresh option • Provides robust check that program flow is faster than expected. • Programmable window. • Refresh outside window leads to assertion of EWM_out. • Robust refresh mechanism • Write values of 0xB4 and 0x2C to EWM Refresh Register within 15 (EWM_service_time) peripheral bus clock cycles. • One output port, EWM_out, when asserted is used to reset or place the external circuit into safe mode.
Chapter 22 External Watchdog Monitor (EWM) 22.1.2.2 Wait Mode The EWM module treats the stop and wait modes as the same. EWM functionality remains the same in both of these modes. 22.1.2.3 Debug Mode Entry to debug mode has no effect on the EWM. • If the EWM is enabled prior to entry of debug mode, it remains enabled. • If the EWM is disabled prior to entry of debug mode, it remains disabled. 22.1.3 Block Diagram This figure shows the EWM block diagram.
EWM Signal Descriptions 22.2 EWM Signal Descriptions The EWM has two external signals, as shown in the following table. Table 22-1. EWM Signal Descriptions Signal EWM_in EWM_out Description I/O EWM input for safety status of external safety circuits. The polarity of EWM_in is programmable using the CTRL[ASSIN] bit. The default polarity is active-low. I EWM reset out signal O 22.3 Memory Map/Register Definition This section contains the module memory map and registers.
Chapter 22 External Watchdog Monitor (EWM) Address: EWM_CTRL is 4006_1000h base + 0h offset = 4006_1000h Bit 7 6 Read 5 4 3 0 Write Reset 0 0 0 0 0 2 1 0 INEN ASSIN EWMEN 0 0 0 EWM_CTRL field descriptions Field 7–3 Reserved 2 INEN 1 ASSIN 0 EWMEN Description This read-only field is reserved and always has the value zero. Input Enable. This bit when set, enables the EWM_in port. EWM_in's Assertion State Select. Default assert state of the EWM_in signal is logic zero.
Memory Map/Register Definition 22.3.3 Compare Low Register (EWM_CMPL) The CMPL register is reset to zero after a CPU reset. This provides no minimum time for the CPU to service the EWM counter. NOTE This register can be written only once after a CPU reset. Writing this register more than once generates a bus transfer error.
Chapter 22 External Watchdog Monitor (EWM) EWM_CMPH field descriptions Field 7–0 COMPAREH Description To prevent runaway code from changing this field, software should write to this field after a CPU reset even if the (default) maximum service time is required. 22.4 Functional Description The following sections describe functional details of the EWM module. 22.4.
Functional Description Note EWM_out pad must be in pull down state when EWM functionality is used and when EWM is under Reset. 22.4.2 The EWM_in Signal The EWM_in is a digital input signal that allows an external circuit to control the EWM_out signal. For example, in the application, an external circuit monitors a critical safety function, and if there is fault with this circuit's behavior, it can then actively initiate the EWM_out signal that controls the gating circuit.
Chapter 22 External Watchdog Monitor (EWM) The EWM compare registers are used to create a service window, which is used by the CPU to service/refresh the EWM module. • If the CPU services the EWM when the counter value lies between CMPL value and CMPH value, the counter is reset to zero. This is a legal service operation. • If the CPU executes a EWM service/refresh action outside the legal service window, EWM_out is asserted. It is illegal to program CMPL and CMPH with same value.
Functional Description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 498 Freescale Semiconductor, Inc.
Chapter 23 Watchdog Timer (WDOG) 23.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The Watchdog Timer (WDOG) keeps a watch on the system functioning and resets it in case of its failure. Some reasons for such failures are: run-away software code and the stoppage of the system clock that in a safety critical system can lead to serious consequences. In such cases, the watchdog brings the system into a safe state of operation.
Features • You need to always update these bits after unlocking within 256 bus clock cycles. Failure to update these bits, resets the system. • Programmable time-out period specified in terms of number of WDOG clock cycles. • Ability to test WDOG timer and reset with a flag indicating watchdog test. • Quick test—Small time-out value programmed for quick test. • Byte test—Individual bytes of timer tested one at a time. • Read-only access to the WDOG timer—Allows dynamic check that WDOG timer is operational.
Chapter 23 Watchdog Timer (WDOG) 23.
Functional Overview to be serviced periodically, failing which it resets the system. This ensures that the software is executing correctly and has not run away in an unintended direction. Software can adjust the period of servicing or the time-out value for the watchdog timer to meet the needs of the application. You can select a windowed mode of operation that expects the servicing to be done only in a particular window of the time-out period.
Chapter 23 Watchdog Timer (WDOG) The update feature is useful for applications that have an initial, non-safety critical part, where the watchdog is kept disabled or with a conveniently long time-out period. This means the application coder does not have to bother with frequently servicing the watchdog. After the critical part of the application begins, the watchdog can be reconfigured as per need.
Functional Overview Updates in the write–once registers take effect only after the WCT window closes with the following exceptions for which changes take effect immediately: • the stop, wait, and debug mode enable bits • the standby mode enable bit • the IRQ_RST_EN bit The operations of refreshing the watchdog goes undetected during the WCT. 23.3.3 Refreshing the Watchdog A robust refreshing mechanism has been chosen for the watchdog.
Chapter 23 Watchdog Timer (WDOG) non-time-out exception (see Generated Resets and Interrupts). You need to unlock the watchdog before enabling it. A system reset brings the watchdog out of the disabled mode. 23.3.6 Low Power Modes of Operation • In Wait mode, if the WDOG is enabled (WAIT_EN = 1), it can run on bus clock or low power oscillator clock (CLK_SRC = x) to generate interrupt (IRQ_RST_EN=1) followed by a reset on time-out. After reset the WDOG reset counter increments by one.
Testing the Watchdog The entry into Debug mode within WCT time after reset is treated differently. The WDOG timer is kept reset to zero and there is no need to unlock and configure it within WCT time. You must not try to refresh or unlock the WDOG in this state or unknown behavior may result. Upon exit from this mode, the WDOG timer restarts and the WDOG has to be unlocked and configured within WCT time. 23.
Chapter 23 Watchdog Timer (WDOG) 23.4.2 Byte Test The byte test implements more thorough a test of the watchdog timer. In this test, the timer is split up into its constituent byte-wide stages that are run independently and tested for time-out against the corresponding byte of the time-out value register.
Backup Reset Generator Note Do not enable the watchdog interrupt during these tests. If required, you must ensure that the effective time-out value is greater than WCT time. See Generated Resets and Interrupts for more details. 23.5 Backup Reset Generator The backup reset generator generates the final reset which goes out to the system.
Chapter 23 Watchdog Timer (WDOG) • A gap of more than 20 bus cycles exists between the writes of two values of the unlock sequence. • A gap of more than 20 bus cycles exists between the writes of two values of the refresh sequence. The watchdog can also generate an interrupt. If IRQ_RST_EN is set, then on the above mentioned events WDOG_ST_CTRL_L[INT_FLG] is set, generating an interrupt. A watchdog reset is also generated WCT time later to ensure the watchdog is fault tolerant.
Memory Map and Register Definition WDOG memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4005_200E Watchdog Unlock Register (WDOG_UNLOCK) 16 R/W D928h 23.7.8/ 514 4005_2010 Watchdog Timer Output Register High (WDOG_TMROUTH) 16 R/W 0000h 23.7.9/ 515 4005_2012 Watchdog Timer Output Register Low (WDOG_TMROUTL) 16 R/W 0000h 23.7.10/ 515 4005_2014 Watchdog Reset Count Register (WDOG_RSTCNT) 16 R/W 0000h 23.7.
Chapter 23 Watchdog Timer (WDOG) WDOG_STCTRLH field descriptions (continued) Field Description 0 1 10 TESTWDOG 9 Reserved 8 STNDBYEN Quick test. The timer runs in normal operation. You can load a small time-out value to do a quick test. Byte test. Puts the timer in the byte test mode where individual bytes of the timer are enabled for operation and are compared for time-out against the corresponding byte of the programmed time-out value. Select the byte through BYTESEL[1:0] for testing.
Memory Map and Register Definition WDOG_STCTRLH field descriptions (continued) Field Description 0 1 WDOG is disabled. WDOG is enabled. 23.7.2 Watchdog Status and Control Register Low (WDOG_STCTRLL) Address: WDOG_STCTRLL is 4005_2000h base + 2h offset = 4005_2002h Bit Write INTFLG Read 15 Reset 0 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 1 Reserved 0 0 0 0 0 0 0 0 WDOG_STCTRLL field descriptions Field Description 15 INTFLG Interrupt flag.
Chapter 23 Watchdog Timer (WDOG) 23.7.4 Watchdog Time-out Value Register Low (WDOG_TOVALL) The time-out value of the watchdog must be set to a minimum of four watchdog clock cycles. This is to take into account the delay in new settings taking effect in the watchdog clock domain.
Memory Map and Register Definition 23.7.6 Watchdog Window Register Low (WDOG_WINL) You must set the Window Register value lower than the Time-out Value Register.
Chapter 23 Watchdog Timer (WDOG) WDOG_UNLOCK field descriptions Field Description 15–0 You can write the unlock sequence values to this register to make the watchdog write once registers WDOGUNLOCK writable again. The required unlock sequence is 0xC520 followed by 0xD928 within 20 bus clock cycles. A valid unlock sequence opens up a window equal in length to the WCT within which you can update the registers.
Watchdog Operation with 8-bit access 23.7.11 Watchdog Reset Count Register (WDOG_RSTCNT) Address: WDOG_RSTCNT is 4005_2000h base + 14h offset = 4005_2014h Bit 15 14 13 12 11 10 9 Read 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 RSTCNT Write Reset 8 0 0 0 0 0 0 0 0 0 WDOG_RSTCNT field descriptions Field Description 15–0 RSTCNT Counts the number of times the watchdog resets the system. This register is reset only on a POR.
Chapter 23 Watchdog Timer (WDOG) 23.8.1 General Guideline When performing 8-bit accesses to the watchdog's 16-bit registers where the intention is to access both the bytes of a register, you must try to place the two 8-bit accesses one after the other in your code. 23.8.
Restrictions on Watchdog Operation takes place only when the complete 16-bit value is correctly written, write4. Hence, the requirement of writing value2 of the sequence within 20 bus clock cycles of value1 is checked by measuring the gap between write2 and write4. It is reiterated that the condition for matching values 1 and 2 of the refresh or unlock sequence remains unchanged.
Chapter 23 Watchdog Timer (WDOG) • The time-out value of the watchdog should be set to a minimum of four watchdog clock cycles. This is to take into account the delay in new settings taking effect in the watchdog clock domain. • You must take care not only to refresh the watchdog within the watchdog timer's actual time-out period, but also provide enough allowance for the time it takes for the refresh sequence to be detected by the watchdog timer, on the watchdog clock.
Restrictions on Watchdog Operation K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 520 Freescale Semiconductor, Inc.
Chapter 24 Multipurpose Clock Generator (MCG) 24.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The multipurpose clock generator (MCG) module provides several clock source choices for the MCU. The module contains a frequency-locked loop (FLL) and a phase-locked loop (PLL). The FLL is controllable by either an internal or an external reference clock. The PLL is controllable by the external reference clock.
Introduction • Internal or external reference clock can be used as the FLL source. • Can be used as a clock source for other on-chip peripherals. • Phase-locked loop (PLL) • Voltage-controlled oscillator (VCO) • External reference clock is used as the PLL source • Modulo VCO frequency divider • Phase/Frequency detector • Integrated loop filter • Can be used as a clock source for other on-chip peripherals.
Chapter 24 Multipurpose Clock Generator (MCG) • Internal Reference Clocks Auto Trim Machine (ATM) capability using an external clock as a reference • Reference dividers for both the FLL and PLL are provided • Reference dividers for the Fast Internal Reference Clock are provided • MCG PLL Clock (MCGPLLCLK) is provided as a clock source for other on-chip peripherals • MCG FLL Clock (MCGFLLCLK) is provided as a clock source for other on-chip peripherals • MCG Fixed Frequency Clock (MCGFFCLK) is provided as a
Introduction Crystal Oscillator External Reference Clock CLKS ATMS OSCINIT PLLCLKEN EREFS IREFS HGO PLLS RANGE MCG Crystal Oscillator Enable Detect STOP IREFSTEN Auto Trim Machine IRCLKEN SCTRIM SCFTRIM FCTRIM Internal Reference Clock Generator MCGIRCLK IRCS CLKS Slow Clock Fast Clock IRCSCLK /2 MCGOUTCLK MCGFLLCLK CME DRS External Clock Monitor DMX32 Filter DCO PLLS DCOOUT FLL FRDIV / 2n n=0-7 MCGPLLCLK IREFS Clock Valid LP /2 / 25 Sync MCGFFCLK PRDIV LOLIE /(1,2,3,
Chapter 24 Multipurpose Clock Generator (MCG) 24.1.2 Modes of Operation There are nine modes of operation for the MCG: FEI, FEE, FBI, FBE, PBE, PEE, BLPI, BLPE, and Stop. For details, see MCG Modes of Operation. 24.2 External Signal Description There are no MCG signals that connect off chip. 24.3 Memory Map/Register Definition This section includes the memory map and register definition. The MCG registers can only be written to when in supervisor mode.
Memory Map/Register Definition 24.3.1 MCG Control 1 Register (MCG_C1) Address: MCG_C1 is 4006_4000h base + 0h offset = 4006_4000h Bit 7 Read 5 CLKS Write Reset 6 0 4 3 FRDIV 0 0 0 0 2 1 0 IREFS IRCLKEN IREFSTEN 1 0 0 MCG_C1 field descriptions Field 7–6 CLKS Description Clock Source Select Selects the clock source for MCGOUTCLK . 00 01 10 11 5–3 FRDIV FLL External Reference Divider Selects the amount to divide down the external reference clock for the FLL.
Chapter 24 Multipurpose Clock Generator (MCG) MCG_C1 field descriptions (continued) Field Description 0 1 Internal reference clock is disabled in Stop mode. Internal reference clock is enabled in Stop mode if IRCLKEN is set or if MCG is in FEI, FBI, or BLPI modes before entering Stop mode. 24.3.
Memory Map/Register Definition MCG_C2 field descriptions (continued) Field Description 0 1 0 IRCS FLL (or PLL) is not disabled in bypass modes. FLL (or PLL) is disabled in bypass modes (lower power) Internal Reference Clock Select Selects between the fast or slow internal reference clock source. 0 1 Slow internal reference clock selected. Fast internal reference clock selected. 24.3.
Chapter 24 Multipurpose Clock Generator (MCG) 24.3.4 MCG Control 4 Register (MCG_C4) Reset values for DRST and DMX32 bits are 0. Address: MCG_C4 is 4006_4000h base + 3h offset = 4006_4003h Bit Read Write Reset 7 6 DMX32 5 4 3 DRST_DRS 0 0 2 1 FCTRIM 0 x* x* 0 SCFTRIM x* x* x* * Notes: • x = Undefined at reset. • A value for FCTRIM is loaded during reset from a factory programmed location . x = Undefined at reset.
Memory Map/Register Definition MCG_C4 field descriptions (continued) Field Description 10 11 4–1 FCTRIM Encoding 2 — Mid-high range. Encoding 3 — High range. Fast Internal Reference Clock Trim Setting FCTRIM 1 controls the fast internal reference clock frequency by controlling the fast internal reference clock period. The FCTRIM bits are binary weighted (that is, bit 1 adjusts twice as much as bit 0). Increasing the binary value increases the period, and decreasing the value decreases the period.
Chapter 24 Multipurpose Clock Generator (MCG) MCG_C5 field descriptions (continued) Field Description 0 1 5 PLLSTEN MCGPLLCLK is active. PLL Stop Enable Enables the PLL Clock during Normal Stop (In Low Power Stop mode, the PLL clock gets disabled even if PLLSTEN =1). All other power modes, PLLSTEN bit has no affect and does not enable the PLL Clock to run if it is written to 1. 0 1 4–0 PRDIV MCGPLLCLK is inactive. MCGPLLCLK is disabled in any of the Stop modes.
Memory Map/Register Definition 24.3.6 MCG Control 6 Register (MCG_C6) Address: MCG_C6 is 4006_4000h base + 5h offset = 4006_4005h Bit Read Write Reset 7 6 5 LOLIE PLLS CME 0 0 0 4 3 2 1 0 0 0 VDIV 0 0 0 MCG_C6 field descriptions Field 7 LOLIE Description Loss of Lock Interrrupt Enable Determines if an interrupt request is made following a loss of lock indication. This bit only has an effect when LOLS is set.
Chapter 24 Multipurpose Clock Generator (MCG) MCG_C6 field descriptions (continued) Field Description Table 24-9. PLL VCO Divide Factor (continued) 00001 25 01001 33 10001 41 11001 49 00010 26 01010 34 10010 42 11010 50 00011 27 01011 35 10011 43 11011 51 00100 28 01100 36 10100 44 11100 52 00101 29 01101 37 10101 45 11101 53 00110 30 01110 38 10110 46 11110 54 00111 31 01111 39 10111 47 11111 55 24.3.
Memory Map/Register Definition MCG_S field descriptions (continued) Field Description While the PLL clock is locking to the desired frequency, the MCG PLL clock (MCGPLLCLK) will be gated off until the LOCK bit gets asserted. If the lock status bit is set, changing the value of the PRDIV [4:0] bits in the C5 register or the VDIV0[4:0] bits in the C6 register causes the lock status bit to clear and stay cleared until the PLL has reacquired lock.
Chapter 24 Multipurpose Clock Generator (MCG) 24.3.8 MCG Auto Trim Control Register (MCG_ATC) Address: MCG_ATC is 4006_4000h base + 8h offset = 4006_4008h Bit Read Write Reset 7 6 ATME ATMS 0 0 5 4 3 ATMF 0 2 1 0 0 0 0 0 0 0 MCG_ATC field descriptions Field 7 ATME Description Automatic Trim Machine Enable Enables the Auto Trim Machine to start automatically trimming the selected Internal Reference Clock.
Functional Description MCG_ATCVH field descriptions Field 7–0 ATCVH Description ATM Compare Value High Values are used by Auto Trim Machine to compare and adjust Internal Reference trim values during ATM SAR conversion. 24.3.
Chapter 24 Multipurpose Clock Generator (MCG) Reset FEI FEE FBI FBE BLPE BLPI PBE PEE Entered from any state when the MCU enters Stop mode Stop Returns to the state that was active before the MCU entered Stop mode, unless a reset occurs while in Stop mode. Figure 24-12. MCG Mode State Diagram NOTE • During exits from LLS or VLPS when the MCG is in PEE mode, the MCG will reset to PBE clock mode and the C1[CLKS] and S[CLKST] will automatically be set to 2’b10.
Functional Description Table 24-14. MCG Modes of Operation Mode Description FLL Engaged Internal (FEI) FLL engaged internal (FEI) is the default mode of operation and is entered when all the following condtions occur: • C1[CLKS] bits are written to 00 • C1[IREFS] bit is written to 1 • C6[PLLS] bit is written to 0 In FEI mode, MCGOUTCLK is derived from the FLL clock (DCOCLK) that is controlled by the 32 kHz Internal Reference Clock (IRC).
Chapter 24 Multipurpose Clock Generator (MCG) Table 24-14. MCG Modes of Operation (continued) Mode Description FLL Bypassed External FLL bypassed external (FBE) mode is entered when all the following conditions occur: (FBE) • C1[CLKS] bits are written to 10 • C1[IREFS] bit is written to 0 • C1[FRDIV] must be written to divide external reference clock to be within the range of 31.25 kHz to 39.0625 kHz.
Functional Description Table 24-14. MCG Modes of Operation (continued) Mode Description Bypassed Low Power Internal (BLPI)1 Bypassed Low Power Internal (BLPI) mode is entered when all the following conditions occur: • C1[CLKS] bits are written to 01 • C1[IREFS] bit is written to 1 • C6[PLLS] bit is written to 0 • C2[LP] bit is written to 1 In BLPI mode, MCGOUTCLK is derived from the internal reference clock. The FLL is disabled and PLL is disabled even if the C5[PLLCLKEN] is set to 1.
Chapter 24 Multipurpose Clock Generator (MCG) 24.4.1.2 MCG Mode Switching The C1[IREFS] bit can be changed at any time, but the actual switch to the newly selected reference clocks is shown by the S[IREFST] bit. When switching between engaged internal and engaged external modes, the FLL will begin locking again after the switch is completed. The C1[CLKS] bits can also be changed at anytime, but the actual switch to the newly selected clock is shown by the S[CLKST] bits.
Functional Description selected or by writing a new trim value to the C4[FCTRIM] bits when the fast IRC clock is selected. The internal reference clock period is proportional to the trim value written. C3[SCTRIM]:C4[SCFTRIM] (if C2[IRCS]=0) and C4[FCTRIM] (if C2[IRCS]=1) bits affect the MCGOUTCLK frequency if the MCG is in FBI or BLPI modes. C3[SCTRIM]:C4[SCFTRIM] (if C2[IRCS]=0) bits also affect the MCGOUTCLK frequency if the MCG is in FEI mode.
Chapter 24 Multipurpose Clock Generator (MCG) 24.4.6 MCG PLL Clock The MCG PLL Clock (MCGPLLCLK) is available depending on the device's configuration of the MCG module. For more details, refer to the clock distribution chapter of this MCU. The MCGPLLCLK is prevented from coming out of the MCG until it is enabled and S[LOCK] is set. 24.4.
Initialization / Application Information Before the ATM can be enabled, the ATM expected count needs to get derived and stored into the ATCV register.
Chapter 24 Multipurpose Clock Generator (MCG) 2. Write to C1 register to select the clock mode. • If entering FEE mode, set C1[FRDIV] appropriately, clear the C1[IREFS] bit to switch to the external reference, and leave the C1[CLKS] bits at 2'b00 so that the output of the FLL is selected as the system clock source. • If entering FBE, clear the C1[IREFS] bit to switch to the external reference and change the C1[CLKS] bits to 2'b10 so that the external reference clock is selected as the system clock source.
Initialization / Application Information • When using a 32.768 kHz external reference, if the maximum low-range DCO frequency that can be achieved with a 32.768 kHz reference is desired, set C4[DRST_DRS] bits to 2'b00 and set C4[DMX32] bit to 1. The resulting DCO output (MCGOUTCLK) frequency with the new multiplier of 732 will be 24 MHz. • When using a 32.768 kHz external reference, if the maximum mid-range DCO frequency that can be achieved with a 32.
Chapter 24 Multipurpose Clock Generator (MCG) 24.5.2 Using a 32.768 kHz Reference In FEE and FBE modes, if using a 32.768 kHz external reference, at the default FLL multiplication factor of 640, the DCO output (MCGFLLCLK) frequency is 20.97 MHz at low-range. If C4[DRST_DRS] bits are set to 2'b01, the multiplication factor is doubled to 1280, and the resulting DCO output frequency is 41.94 Mhz at mid-low-range.
Initialization / Application Information Table 24-15. MCGOUTCLK Frequency Calculation Options Clock Mode fMCGOUTCLK1 Note FEI (FLL engaged internal) (fint * F) Typical fMCGOUTCLK = 20 MHz immediately after reset. FEE (FLL engaged external) (fext / FLL_R) *F fext / FLL_R must be in the range of 31.25 kHz to 39.0625 kHz FBE (FLL bypassed external) fext fext / FLL_R must be in the range of 31.25 kHz to 39.
Chapter 24 Multipurpose Clock Generator (MCG) • C1[CLKS] set to 2'b10 in order to select external reference clock as system clock source • C1[FRDIV] set to 3'b010, or divide-by-128 because 4 MHz / 128 = 31.25 kHz which is in the 31.25 kHz to 39.0625 kHz range required by the FLL • C1[IREFS] cleared to 0, selecting the external reference clock and enabling the external oscillator. c. Loop until S[OSCINIT] is 1, indicating the crystal selected by C2[EREFS] has been initialized.. d.
Initialization / Application Information e. PBE: Then loop until S[LOCK] is set, indicating that the PLL has acquired lock. 4. Lastly, PBE mode transitions into PEE mode: a. C1 = 0x10 • C1[CLKS] set to 2'b00 in order to select the output of the PLL as the system clock source. b. Loop until S[CLKST] are 2'b11, indicating that the PLL output is selected to feed MCGOUTCLK in the current clock mode. • Now, With PRDIV of divide-by-2, and C6[VDIV] of multiply-by-24, MCGOUTCLK = [(4 MHz / 2) * 24] = 48 MHz.
Chapter 24 Multipurpose Clock Generator (MCG) START IN FEI MODE C6 = 0x40 C2 = 0x1C IN BLPE MODE ? (S[LP]=1) C1 = 0x90 NO YES C2 = 0x1C (S[LP]=0) NO CHECK S[OSCINIT] = 1? CHECK S[PLLST] = 1? YES CHECK S[IREFST] = 0? NO YES NO CHECK S[LOCK] = 1? YES CHECK NO S[CLKST] = %10? NO YES C1 = 0x10 YES C5 = 0x01 (C5[VDIV] = 1) ENTER BLPE MODE ? CHECK S[CLKST] = %11? NO NO YES CONTINUE YES IN PEE MODE C2 = 0x1E (C2[LP] = 1) Figure 24-13.
Initialization / Application Information 24.5.3.2 Example 2: Moving from PEE to BLPI Mode: MCGOUTCLK Frequency =32 kHz In this example, the MCG will move through the proper operational modes from PEE mode with a 4 MHz crystal configured for a 48 MHz MCGOUTCLK frequency (see previous example) to BLPI mode with a 32 kHz MCGOUTCLK frequency.First, the code sequence will be described. Then a flowchart will be included which illustrates the sequence. 1. First, PEE must transition to PBE mode: a.
Chapter 24 Multipurpose Clock Generator (MCG) • C1[CLKS] set to 2'b01 in order to switch the system clock to the internal reference clock. • C1[IREFS] set to 1 to select the internal reference clock as the reference clock source. • C1[FRDIV] remain unchanged because the reference divider does not affect the internal reference. b. Loop until S[IREFST] is 1, indicating the internal reference clock has been selected as the reference clock source. c.
Initialization / Application Information START IN PEE MODE C1 = 0x90 CHECK S[PLLST] = 0? NO CHECK S[CLKST] = %10 ? YES C1 = 0x54 YES ENTER NO NO CHECK S[IREFST] = 0? BLPE MODE ? YES NO YES C2 = 0x1E (C2[LP] = 1) CHECK S[CLKST] = %01? NO C6 = 0x00 YES C2 = 0x02 IN BLPE MODE ? (C2[LP]=1) NO CONTINUE YES IN BLPI MODE C2 = 0x1C (C2[LP] = 0) Figure 24-14. Flowchart of PEE to BLPI Mode Transition using an 4 MHz crystal K10 Sub-Family Reference Manual, Rev.
Chapter 24 Multipurpose Clock Generator (MCG) 24.5.3.3 Example 3: Moving from BLPI to FEE Mode In this example, the MCG will move through the proper operational modes from BLPI mode at a 32 kHz MCGOUTCLK frequency running off the internal reference clock (see previous example) to FEE mode using a 4 MHz crystal configured for a 20 MHz MCGOUTCLK frequency. First, the code sequence will be described. Then a flowchart will be included which illustrates the sequence. 1. First, BLPI must transition to FBI mode.
Initialization / Application Information multiplication factor from 640 to 1280. To return the MCGOUTCLK frequency to 20 MHz, set C4[DRST_DRS] bits to 2'b00 again, and the FLL multiplication factor will switch back to 640. START IN BLPI MODE CHECK NO S[IREFST] = 0? C2 =0x00 YES C2 = 0x1C NO CHECK S[CLKST] = %00? C1 =0x10 YES CONTINUE CHECK S[OSCINIT] = 1 ? NO IN FEE MODE YES Figure 24-15. Flowchart of BLPI to FEE Mode Transition using an 4 MHz crystal K10 Sub-Family Reference Manual, Rev.
Chapter 25 Oscillator (OSC) 25.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The OSC module is a crystal oscillator. The module, in conjunction with an external crystal or resonator, generates a reference clock for the MCU. 25.
Block Diagram 25.3 Block Diagram The OSC module uses a crystal or resonator to generate three filtered oscillator clock signals. Three clocks are output from OSC module: OSCCLK for MCU system, OSCERCLK for on-chip peripherals, and OSC32KCLK. The OSCCLK can only work in run mode. OSCERCLK and OSC32KCLK can work in low power modes. For the clock source assignments, refer to the clock distribution information of this MCU.
Chapter 25 Oscillator (OSC) Table 25-1. OSC Signal Descriptions Signal Description EXTAL External clock/Oscillator input I Oscillator output O XTAL I/O 25.5 External Crystal / Resonator Connections The connections for a crystal/resonator frequency reference are shown in the following figures. When using low-frequency, low-power mode, the only external component is the crystal or ceramic resonator itself.
External Clock Connections OSC XTAL EXTAL VSS RF Crystal or Resonator Figure 25-3. Crystal/Ceramic Resonator Connections - Connection 2 NOTE Connection 1 and Connection 2 should use internal capacitors as the load of the oscillator by configuring the CR[SCxP] bits. OSC XTAL EXTAL VSS Cx Cy RF Crystal or Resonator Figure 25-4. Crystal/Ceramic Resonator Connections - Connection 3 25.6 External Clock Connections In external clock mode, the pins can be connected as shown below.
Chapter 25 Oscillator (OSC) OSC XTAL EXTAL VSS Clock Input I/O Figure 25-5. External Clock Connections 25.7 Memory Map/Register Definitions Some oscillator module register bits are typically incorporated into other peripherals such as MCG or SIM. 25.7.1 OSC Memory Map/Register Definition OSC memory map Absolute address (hex) 4006_5000 Width Access (in bits) Register name OSC Control Register (OSC_CR) 8 R/W Reset value Section/ page 00h 25.71.1/ 561 25.71.
Functional Description OSC_CR field descriptions (continued) Field Description 0 1 6 Reserved 5 EREFSTEN This read-only field is reserved and always has the value zero. External Reference Stop Enable Controls whether or not the external reference clock (OSCERCLK) remains enabled when MCU enters Stop mode. 0 1 4 Reserved 3 SC2P Oscillator 2 pF Capacitor Load Configure Configures the oscillator load. Configures the oscillator load. Disable the selection. Add 4 pF capacitor to the oscillator load.
Chapter 25 Oscillator (OSC) 25.8.1 OSC Module States The states of the OSC module are shown in the following figure. The states and their transitions between each other are described in this section.
Functional Description 25.8.1.2 Oscillator Start-Up The OSC enters start-up state when it is configured to generate clocks (internally the OSC_EN transitions high) using the internal oscillator circuits by setting the external reference clock selection bit. In this state, the OSC module is enabled and oscillations are starting up, but have not yet stabilized. When the oscillation amplitude becomes large enough to pass through the input buffer, XTL_CLK begins clocking the counter.
Chapter 25 Oscillator (OSC) Table 25-5. Oscillator Modes Mode Frequency Range Low-frequency, high-gain fosc_lo (1 kHz) up to fosc_lo (32.
Reset 25.8.2.3 High-Frequency, High-Gain Mode In high-frequency, high-gain mode, the oscillator uses a simple inverter-style amplifier. The gain is set to achieve rail-to-rail oscillation amplitudes. This mode provides low pass frequency filtering as well as hysteresis for voltage filtering and converts the output to logic levels. In this mode, the internal capacitors could be used. 25.8.2.
Chapter 25 Oscillator (OSC) 25.10 Low Power Modes Operation When the MCU enters Stop modes, the OSC is functional depending on ERCLKEN and EREFSETN bit settings. If both these bits are set, the OSC is in operation. In Low Leakage Stop (LLS) modes, the OSC holds all register settings. If ERCLKEN and EREFSTEN bits are set before entry to Low Leakage Stop modes, the OSC is still functional in these modes.
Interrupts K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 568 Freescale Semiconductor, Inc.
Chapter 26 RTC Oscillator 26.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The RTC oscillator module provides the clock source for the RTC. The RTC oscillator module, in conjunction with an external crystal, generates a reference clock for the RTC. 26.1.
RTC Signal Descriptions control Amplitude detector clk out for RTC EXTAL32 gm Rf XTAL32 C2 C1 PAD PAD Figure 26-1. RTC Oscillator Block Diagram 26.2 RTC Signal Descriptions The following table shows the user-accessible signals available for the RTC oscillator. See the chip-level specification to find out which signals are actually connected to the external pins. Table 26-1. RTC Signal Descriptions Signal EXTAL32 XTAL32 Description I/O Oscillator Input I Oscillator Output O 26.2.
Chapter 26 RTC Oscillator 26.3 External Crystal Connections The connections with a crystal is shown in the following figure. External load capacitors and feedback resistor are not required. RTC Oscillator Module XTAL32 VSS EXTAL32 Crystal or Resonator Figure 26-2. Crystal Connections 26.4 Memory Map/Register Descriptions RTC oscillator control bits are part of the RTC registers. Refer to RTC_CR for more details. 26.
Reset Overview 26.6 Reset Overview There is no reset state associated with the RTC oscillator. 26.7 Interrupts The RTC oscillator does not generate any interrupts. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 572 Freescale Semiconductor, Inc.
Chapter 27 Flash Memory Controller (FMC) 27.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The Flash Memory Controller (FMC) is a memory acceleration unit that provides: • an interface between the device and the dual-bank nonvolatile memory. Bank 0 consists of program flash memory, and bank 1 consists of FlexNVM. • buffers that can accelerate flash memory and FlexNVM data transfers. 27.1.
Modes of operation 27.1.2 Features The FMC's features include: • Interface between the device and the dual-bank flash memory and FlexMemory: • 8-bit, 16-bit, and 32-bit read operations to program flash memory and FlexNVM used as data flash memory. • 8-bit, 16-bit, and 32-bit read and write operations to FlexNVM and FlexRAM used as EEPROM. • For bank 0 and bank 1: Read accesses to consecutive 32-bit spaces in memory return the second read data with no wait states.
Chapter 27 Flash Memory Controller (FMC) 27.4 Memory map and register descriptions The programming model consists of the FMC control registers and the program visible cache (data and tag/valid entries). NOTE Program the registers only while the flash controller is idle (for example, execute from RAM). Changing configuration settings while a flash access is in progress can lead to non-deterministic behavior. Table 27-2.
Memory map and register descriptions Table 27-3. Program visible cache registers Cache storage Based at offset Contents of 32-bit read Nomenclature Nomenclature example Tag 100h 13'h0, tag[18:6], 5'h0, valid In TAGVDWxSy, x denotes the way and y denotes the set. TAGVDW2S0 is the 13-bit tag and 1-bit valid for cache entry way 2, set 0. Data 200h Upper or lower word of data In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively.
Chapter 27 Flash Memory Controller (FMC) FMC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4001_F130 Cache Tag Storage (FMC_TAGVDW1S4) 32 R/W 0000_0000h 27.4.5/ 590 4001_F134 Cache Tag Storage (FMC_TAGVDW1S5) 32 R/W 0000_0000h 27.4.5/ 590 4001_F138 Cache Tag Storage (FMC_TAGVDW1S6) 32 R/W 0000_0000h 27.4.5/ 590 4001_F13C Cache Tag Storage (FMC_TAGVDW1S7) 32 R/W 0000_0000h 27.4.
Memory map and register descriptions FMC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4001_F200 Cache Data Storage (upper word) (FMC_DATAW0S0U) 32 R/W 0000_0000h 27.4.8/ 593 4001_F204 Cache Data Storage (lower word) (FMC_DATAW0S0L) 32 R/W 0000_0000h 27.4.9/ 594 4001_F208 Cache Data Storage (upper word) (FMC_DATAW0S1U) 32 R/W 0000_0000h 27.4.
Chapter 27 Flash Memory Controller (FMC) FMC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4001_F250 Cache Data Storage (upper word) (FMC_DATAW1S2U) 32 R/W 0000_0000h 27.4.10/ 595 4001_F254 Cache Data Storage (lower word) (FMC_DATAW1S2L) 32 R/W 0000_0000h 27.4.11/ 596 4001_F258 Cache Data Storage (upper word) (FMC_DATAW1S3U) 32 R/W 0000_0000h 27.4.
Memory map and register descriptions FMC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4001_F2A0 Cache Data Storage (upper word) (FMC_DATAW2S4U) 32 R/W 0000_0000h 27.4.12/ 597 4001_F2A4 Cache Data Storage (lower word) (FMC_DATAW2S4L) 32 R/W 0000_0000h 27.4.13/ 598 4001_F2A8 Cache Data Storage (upper word) (FMC_DATAW2S5U) 32 R/W 0000_0000h 27.4.
Chapter 27 Flash Memory Controller (FMC) FMC memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4001_F2F0 Cache Data Storage (upper word) (FMC_DATAW3S6U) 32 R/W 0000_0000h 27.4.14/ 599 4001_F2F4 Cache Data Storage (lower word) (FMC_DATAW3S6L) 32 R/W 0000_0000h 27.4.15/ 600 4001_F2F8 Cache Data Storage (upper word) (FMC_DATAW3S7U) 32 R/W 0000_0000h 27.4.
Memory map and register descriptions FMC_PFAPR field descriptions (continued) Field Description 0 1 21 M5PFD Master 5 Prefetch Disable These bits control whether prefetching is enabled based on the logical number of the requesting crossbar switch master. This field is further qualified by the PFBnCR[BxDPE,BxIPE] bits. 0 1 20 M4PFD These bits control whether prefetching is enabled based on the logical number of the requesting crossbar switch master.
Chapter 27 Flash Memory Controller (FMC) FMC_PFAPR field descriptions (continued) Field Description 10 11 13–12 M6AP[1:0] Master 6 Access Protection This field controls whether read and write access to the flash are allowed based on the logical master number of the requesting crossbar switch master. 00 01 10 11 11–10 M5AP[1:0] This field controls whether read and write access to the flash are allowed based on the logical master number of the requesting crossbar switch master.
Memory map and register descriptions FMC_PFAPR field descriptions (continued) Field Description This field controls whether read and write access to the flash are allowed based on the logical master number of the requesting crossbar switch master.
Chapter 27 Flash Memory Controller (FMC) FMC_PFB0CR field descriptions (continued) Field Description 27–24 Cache Lock Way x CLCK_WAY[3:0] These bits determine if the given cache way is locked such that its contents will not be displaced by future misses. The bit setting definitions are for each bit in the field.
Memory map and register descriptions FMC_PFB0CR field descriptions (continued) Field 4 B0DCE Description Bank 0 Data Cache Enable This bit controls whether data references are loaded into the cache. 0 1 3 B0ICE Bank 0 Instruction Cache Enable This bit controls whether instruction fetches are loaded into the cache. 0 1 2 B0DPE This bit controls whether prefetches (or speculative accesses) are initiated in response to data references. Do not prefetch in response to data references.
Chapter 27 Flash Memory Controller (FMC) 27.4.3 Flash Bank 1 Control Register (FMC_PFB1CR) This register has a format similar to that for PFB0CR, except it controls the operation of flash bank 1, and the "global" cache control fields are empty.
Memory map and register descriptions FMC_PFB1CR field descriptions (continued) Field 4 B1DCE Description Bank 1 Data Cache Enable This bit controls whether data references are loaded into the cache. 0 1 3 B1ICE Bank 1 Instruction Cache Enable This bit controls whether instruction fetches are loaded into the cache. 0 1 2 B1DPE This bit controls whether prefetches (or speculative accesses) are initiated in response to data references. Do not prefetch in response to data references.
Chapter 27 Flash Memory Controller (FMC) 27.4.4 Cache Tag Storage (FMC_TAGVDW0Sn) The 32-entry cache is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In TAGVDWxSy, x denotes the way, and y denotes the set. This section represents tag/vld information for all 8 sets (n=0-7) in way 0.
Memory map and register descriptions 27.4.5 Cache Tag Storage (FMC_TAGVDW1Sn) The 32-entry cache is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In TAGVDWxSy, x denotes the way, and y denotes the set. This section represents tag/vld information for all 8 sets (n=0-7) in way 1.
Chapter 27 Flash Memory Controller (FMC) 27.4.6 Cache Tag Storage (FMC_TAGVDW2Sn) The 32-entry cache is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In TAGVDWxSy, x denotes the way, and y denotes the set. This section represents tag/vld information for all 8 sets (n=0-7) in way 2.
Memory map and register descriptions 27.4.7 Cache Tag Storage (FMC_TAGVDW3Sn) The 32-entry cache is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In TAGVDWxSy, x denotes the way, and y denotes the set. This section represents tag/vld information for all 8 sets (n=0-7) in way 3.
Chapter 27 Flash Memory Controller (FMC) 27.4.8 Cache Data Storage (upper word) (FMC_DATAW0SU) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the upper word (bits [63:32]) of all 8 sets (n=0-7) in way 0.
Memory map and register descriptions 27.4.9 Cache Data Storage (lower word) (FMC_DATAW0SL) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the lower word (bits [31:0]) of all 8 sets (n=0-7) in way 0.
Chapter 27 Flash Memory Controller (FMC) 27.4.10 Cache Data Storage (upper word) (FMC_DATAW1SU) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the upper word (bits [63:32]) of all 8 sets (n=0-7) in way 1.
Memory map and register descriptions 27.4.11 Cache Data Storage (lower word) (FMC_DATAW1SL) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the lower word (bits [31:0]) of all 8 sets (n=0-7) in way 1.
Chapter 27 Flash Memory Controller (FMC) 27.4.12 Cache Data Storage (upper word) (FMC_DATAW2SU) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the upper word (bits [63:32]) of all 8 sets (n=0-7) in way 2.
Memory map and register descriptions 27.4.13 Cache Data Storage (lower word) (FMC_DATAW2SL) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the lower word (bits [31:0]) of all 8 sets (n=0-7) in way 2.
Chapter 27 Flash Memory Controller (FMC) 27.4.14 Cache Data Storage (upper word) (FMC_DATAW3SU) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the upper word (bits [63:32]) of all 8 sets (n=0-7) in way 3.
Functional description 27.4.15 Cache Data Storage (lower word) (FMC_DATAW3SL) The cache of 64-bit entries is a 4-way, set-associative cache with 8 sets. The ways are numbered 0-3 and the sets are numbered 0-7. In DATAWxSyU and DATAWxSyL, x denotes the way, y denotes the set, and U and L represent upper and lower word, respectively. This section represents data for the lower word (bits [31:0]) of all 8 sets (n=0-7) in way 3.
Chapter 27 Flash Memory Controller (FMC) • These masters have write access to a portion of bank 1 when FlexNVM is used with FlexRAM as EEPROM. • For bank 0 and bank 1: • Prefetch support for data and instructions is enabled for crossbar masters 0, 1, 2. • The cache is configured for least recently used (LRU) replacement for all four ways. • The cache is configured for data or instruction replacement. • The single-entry buffer is enabled.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 602 Freescale Semiconductor, Inc.
Chapter 28 Flash Memory Module (FTFL) 28.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter.
Introduction The standard shipping condition for flash memory is erased with security disabled. Data loss over time may occur due to degradation of the erased ('1') states and/or programmed ('0') states. Therefore, it is recommended that each flash block or sector be re-erased immediately prior to factory programming to ensure that the full data retention capability is achieved. 28.1.1 Features The FTFL module includes the following features.
Chapter 28 Flash Memory Module (FTFL) • Section programming for faster bulk programming times • Read access to data flash memory possible while programming or erasing data in the program flash memory 28.1.1.3 Program Acceleration RAM Features • For devices with only program flash memory: RAM to support section programming 28.1.1.
Introduction • Optional interrupt generation upon flash command completion • Supports MCU security mechanisms which prevent unauthorized access to the flash memory contents 28.1.2 Block Diagram The block diagram of the FTFL module is shown in the following figure. For devices with FlexNVM feature: Interrupt Register access Program flash Status registers Memory controller Control registers To MCU's flash controller FlexNVM Data flash FlexRAM EEPROM backup Figure 28-1.
Chapter 28 Flash Memory Module (FTFL) Interrupt Register access Status registers Memory controller Program flash 0 Control registers To MCU's flash controller Program flash 1 Programming acceleration RAM Figure 28-2. FTFL Block Diagram 28.1.3 Glossary Command write sequence — A series of MCU writes to the Flash FCCOB register group that initiates and controls the execution of Flash algorithms that are built into the FTFL module.
Introduction EEPROM backup data record — The EEPROM backup data record is comprised of a 2-bit status field, a 14-bit address field, and a 16-bit data field found in EEPROM backup data memory which is used by the EEPROM filing system. If the status field indicates a record is valid, the data field is mirrored in the FlexRAM at a location determined by the address field.
Chapter 28 Flash Memory Module (FTFL) NVM Special Mode — An NVM mode enabling external, off-chip access to the memory resources in the FTFL module. A reduced FTFL command set is available when the MCU is secured. See the Chip Configuration details for information on when this mode is used. Phrase — 64 bits of data with an aligned phrase having byte-address[2:0] = 000. Longword — 32 bits of data with an aligned longword having byte-address[1:0] = 00.
Memory Map and Registers 28.3.1 Flash Configuration Field Description The program flash memory contains a 16-byte flash configuration field that stores default protection settings (loaded on reset) and security information that allows the MCU to restrict access to the FTFL module. Flash Configuration Field Byte Address Size (Bytes) Field Description 0x0_0400 - 0x0_0407 8 Backdoor Comparison Key. Refer to Verify Backdoor Access Key Command and Unsecuring the Chip Using Backdoor Key Access.
Chapter 28 Flash Memory Module (FTFL) Address Range Size (Bytes) Field Description 0x00 – 0xBF 192 Reserved 0xC0 – 0xFF 64 Program Once Field 28.3.2.1 Program Once Field The Program Once Field in the program flash IFR provides 64 bytes of user data storage separate from the program flash main array. The user can program the Program Once Field one time only as there is no program flash IFR erase mechanism available to the user. The Program Once Field can be read any number of times.
Memory Map and Registers Table 28-1. EEPROM Data Set Size (continued) 1 1 EEESPLIT EEESIZE = Unimplemented or Reserved Table 28-2. EEPROM Data Set Size Field Description Field 7-6 Description This read-only bitfield is reserved and must always be written as one. Reserved 5-4 EEESPLIT EEPROM Split Factor — Determines the relative sizes of the two EEPROM subsystems.
Chapter 28 Flash Memory Module (FTFL) Table 28-3. FlexNVM Partition Code Data Flash IFR: 0x00FC 7 6 5 4 1 1 1 1 3 2 1 0 DEPART = Unimplemented or Reserved Table 28-4. FlexNVM Partition Code Field Description Field 7-4 Description This read-only bitfield is reserved and must always be written as one. Reserved 3-0 DEPART FlexNVM Partition Code — Encoding of the data flash / EEPROM backup split within the FlexNVM memory block.
Memory Map and Registers sequence, prior to the initial rise of CCIF. During this initialization period the user may write any register. All register writes are also disabled (except for registers FCNFG and FSTAT) whenever an erase suspend request is active (FCNFG[ERSSUSP]=1). FTFL memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4002_0000 Flash Status Register (FTFL_FSTAT) 8 R/W 00h 28.34.
Chapter 28 Flash Memory Module (FTFL) FTFL memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4002_0010 Program Flash Protection Registers (FTFL_FPROT3) 8 R/W Undefined 28.34.6/ 622 4002_0011 Program Flash Protection Registers (FTFL_FPROT2) 8 R/W Undefined 28.34.6/ 622 4002_0012 Program Flash Protection Registers (FTFL_FPROT1) 8 R/W Undefined 28.34.
Memory Map and Registers FTFL_FSTAT field descriptions (continued) Field Description The CCIF bit is reset to 0 but is set to 1 by the memory controller at the end of the reset initialization sequence. Depending on how quickly the read occurs after reset release, the user may or may not see the 0 hardware reset value. 0 1 6 RDCOLERR FTFL Read Collision Error Flag The RDCOLERR error bit indicates that the MCU attempted a read from an FTFL resource that was being manipulated by an FTFL command (CCIF=0).
Chapter 28 Flash Memory Module (FTFL) The erase control bits (ERSAREQ and ERSSUSP) have write restrictions. SWAP, PFLSH, RAMRDY , and EEERDY are read-only status bits . The unassigned bits read as noted and are not writable. The reset values for the SWAP, PFLSH, RAMRDY , and EEERDY bits are determined during the reset sequence.
Memory Map and Registers FTFL_FCNFG field descriptions (continued) Field Description For program flash only configurations, the SWAP flag indicates which physical program flash block is located at relative address 0x0000. The state of the SWAP flag is set by the FTFL during the reset sequence . See the Swap Control command section for information on swap management.
Chapter 28 Flash Memory Module (FTFL) Address: FTFL_FSEC is 4002_0000h base + 2h offset = 4002_0002h Bit 7 Read 6 5 KEYEN 4 3 MEEN 2 1 FSLACC 0 SEC Write Reset x* x* x* x* x* x* x* x* * Notes: • x = Undefined at reset. FTFL_FSEC field descriptions Field 7–6 KEYEN Description Backdoor Key Security Enable These bits enable and disable backdoor key access to the FTFL module. 00 01 10 11 5–4 MEEN Mass Erase Enable Bits Enables and disables mass erase capability of the FTFL module.
Memory Map and Registers FTFL_FSEC field descriptions (continued) Field Description 10 11 MCU security status is unsecure (The standard shipping condition of the FTFL is unsecure.) MCU security status is secure 28.34.4 Flash Option Register (FTFL_FOPT) The flash option register allows the MCU to customize its operations by examining the state of these read-only bits, which are loaded from NVM at reset. The function of the bits is defined in the device's Chip Configuration details.
Chapter 28 Flash Memory Module (FTFL) 28.34.5 Flash Common Command Object Registers (FTFL_FCCOBn) The FCCOB register group provides 12 bytes for command codes and parameters. The individual bytes within the set append a 0-B hex identifier to the FCCOB register name: FCCOB0, FCCOB1, ..., FCCOBB.
Memory Map and Registers FTFL_FCCOBn field descriptions (continued) Field Description FCCOB Number Typical Command Parameter Contents [7:0] A Data Byte 6 B Data Byte 7 FCCOB Endianness and Multi-Byte Access : The FCCOB register group uses a big endian addressing convention. For all command parameter fields larger than 1 byte, the most significant data resides in the lowest FCCOB register number.
Chapter 28 Flash Memory Module (FTFL) Addresses: FTFL_FPROT3 is 4002_0000h base + 10h offset = 4002_0010h FTFL_FPROT2 is 4002_0000h base + 11h offset = 4002_0011h FTFL_FPROT1 is 4002_0000h base + 12h offset = 4002_0012h FTFL_FPROT0 is 4002_0000h base + 13h offset = 4002_0013h Bit 7 6 5 4 Read 2 1 0 x* x* x* x* PROT Write Reset 3 x* x* x* x* * Notes: • x = Undefined at reset.
Memory Map and Registers Address: FTFL_FEPROT is 4002_0000h base + 16h offset = 4002_0016h Bit 7 6 5 4 Read 2 1 0 x* x* x* x* EPROT Write Reset 3 x* x* x* x* * Notes: • x = Undefined at reset. FTFL_FEPROT field descriptions Field 7–0 EPROT Description EEPROM Region Protect For devices with program flash only: Reserved For devices with FlexNVM: Individual EEPROM regions can be protected from alteration by setting the associated EPROT bit.
Chapter 28 Flash Memory Module (FTFL) 28.34.8 Data Flash Protection Register (FTFL_FDPROT) The FDPROT register defines which data flash regions are protected against program and erase operations. Protected Flash regions cannot have their content changed; that is, these regions cannot be programmed and cannot be erased by any FTFL command. Unprotected regions can be changed by both program and erase operations.
Functional Description 28.4 Functional Description The following sections describe functional details of the FTFL module. 28.4.1 Program Flash Memory Swap For devices that only contain program flash memory: The user can configure the logical memory map of the program flash space such that either of the two physical program flash blocks can exist at relative address 0x0000.
Chapter 28 Flash Memory Module (FTFL) • FDPROT — • For 2n data flash sizes, protects eight regions of the data flash memory as shown in the following figure FlexNVM 0x0_0000 EEPROM backup size (DEPART) Last data flash address Data flash size / 8 DPROT0 Data flash size / 8 DPROT1 Data flash size / 8 DPROT2 Data flash size / 8 DPROT3 Data flash size / 8 DPROT4 Data flash size / 8 DPROT5 Data flash size / 8 DPROT6 Data flash size / 8 DPROT7 EEPROM backup Last FlexNVM address non-2n Figur
Functional Description 192KB data flash 224KB data flash 0x0_0000 0x0_0000 32KB DPROT0 32KB DPROT0 32KB DPROT1 32KB DPROT1 32KB DPROT2 32KB DPROT2 32KB DPROT3 32KB DPROT3 32KB DPROT4 32KB DPROT4 32KB DPROT5 32KB DPROT5 0x2_FFFF 32KB DPROT6 64KB EEPROM backup 0x3_7FFF 0x3_FFFF 32KB EEPROM backup 0x3_FFFF Figure 28-29.
Chapter 28 Flash Memory Module (FTFL) 28.4.3 FlexNVM Description This section describes the FlexNVM memory. This section does not apply for devices that contain only program flash memory. 28.4.3.1 FlexNVM Block Partitioning for FlexRAM The user can configure the FlexNVM block as either: • Basic data flash, • EEPROM flash records to support the built-in EEPROM feature, or • A combination of both.
Functional Description configured for EEPROM (see Set FlexRAM Function Command). The EEPROM partition grows upward from the bottom of the FlexRAM address space. 2. Data flash partition (DEPART) — The amount of FlexNVM memory used for data flash can be programmed from 0 bytes (all of the FlexNVM block is available for EEPROM backup) to the maximum size of the FlexNVM block (see Table 28-4). 3.
Chapter 28 Flash Memory Module (FTFL) Data flash 0 FlexRAM DEPART /2 FlexNVM Block 1 EEESIZE DEPART /2 FlexNVM Block 0 Data flash 1 EEPROM partition A EEPROM partition B EEPROM backup A EEPROM backup B Unavailable Subsystem A Subsystem B EEESPLIT = 1/8, 1/4, or 1/2 Size of EEPROM partition A = EEESIZE x EEESPLIT Data flash 0 and 1 interleaved Figure 28-32. FlexRAM to FlexNVM Memory Mapping with 2 Sub-systems 28.4.3.
Functional Description After a sector in EEPROM backup is full of EEPROM data records, EEPROM data records from the sector holding the oldest data are gradually copied over to a previouslyerased EEPROM backup sector. When the sector copy completes, the EEPROM backup sector holding the oldest data is tagged for erase. 28.4.3.4 Write endurance to FlexRAM for EEPROM When the FlexNVM partition code is not set to full data flash, the EEPROM data set size can be set to any of several non-zero values.
Chapter 28 Flash Memory Module (FTFL) Figure 28-33. EEPROM backup writes to FlexRAM 28.4.4 Interrupts The FTFL module can generate interrupt requests to the MCU upon the occurrence of various FTFL events. These interrupt events and their associated status and control bits are shown in the following table. Table 28-30.
Flash Operation in Low-Power Modes 28.4.5 Flash Operation in Low-Power Modes 28.4.5.1 Wait Mode When the MCU enters wait mode, the FTFL module is not affected. The FTFL module can recover the MCU from wait via the command complete interrupt (see Interrupts). 28.4.5.2 Stop Mode When the MCU requests stop mode, if an FTFL command is active (CCIF = 0) the command execution completes before the MCU is allowed to enter stop mode.
Chapter 28 Flash Memory Module (FTFL) 28.4.8 Read While Write (RWW) The following simultaneous accesses are allowed for devices with FlexNVM: • The user may read from the program flash memory while commands (typically program and erase operations) are active in the data flash and FlexRAM memory space. • The MCU can fetch instructions from program flash during both data flash program and erase operations and while EEPROM backup data is maintained by the EEPROM commands.
Flash Operation in Low-Power Modes • The command write sequence used to set FTFL command parameters and launch execution • A description of all FTFL commands available 28.4.10.1 Command Write Sequence FTFL commands are specified using a command write sequence illustrated in Figure 28-34. The FTFL module performs various checks on the command (FCCOB) content and continues with command execution if all requirements are fulfilled.
Chapter 28 Flash Memory Module (FTFL) If the parameter check fails, the FSTAT[ACCERR] (access error) flag is set. ACCERR reports invalid instruction codes and out-of bounds addresses. Usually, access errors suggest that the command was not set-up with valid parameters in the FCCOB register group. Program and erase commands also check the address to determine if the operation is requested to execute on protected areas. If the protection check fails, the FSTAT[FPVIOL] (protection error) flag is set.
Flash Operation in Low-Power Modes START Read: FSTAT register FCCOB Availability Check no CCIF = ‘1’? Previous command complete? yes Access Error and Protection Violation Check ACCERR/ FPVIOL Set? Results from previous command yes Clear the old errors Write 0x30 to FSTAT register no Write to the FCCOB registers to load the required command parameter. More Parameters? yes no Clear the CCIF to launch the command Write 0x80 to FSTAT register EXIT Figure 28-34.
Chapter 28 Flash Memory Module (FTFL) FCMD Command Program flash 0 Program flash 1 (Devices with only program flash) Data flash FlexRAM (Devices with FlexNVM) (Devices with FlexNVM) Function 0x00 Read 1s Block × × × Verify that a program flash or data flash block is erased. FlexNVM block must not be partitioned for EEPROM. 0x01 Read 1s Section × × × Verify that a given number of program flash or data flash locations from a starting address are erased.
Flash Operation in Low-Power Modes FCMD Command Program flash 0 Program flash 1 (Devices with only program flash) Data flash FlexRAM (Devices with FlexNVM) (Devices with FlexNVM) × Function 0x0B Program Section × × × Program data from the Section Program Buffer to a program flash or data flash block. 0x40 Read 1s All Blocks × × × 0x41 Read Once IFR Read 4 bytes of a dedicated 64 byte field in the program flash 0 IFR.
Chapter 28 Flash Memory Module (FTFL) FCMD Command Program flash 0 Program flash 1 (Devices with only program flash) 0x44 Erase All Blocks × × Data flash FlexRAM (Devices with FlexNVM) (Devices with FlexNVM) × × Function Erase all program flash blocks, program flash 1 IFR, data flash blocks, FlexRAM, EEPROM backup data records, and data flash IFR. Then, verifyerase and release MCU security. NOTE: An erase is only possible when all memory locations are unprotected.
Flash Operation in Low-Power Modes FCMD Command Program flash 0 Program flash 1 Data flash FlexRAM (Devices with FlexNVM) (Devices with FlexNVM) (Devices with only program flash) 0x81 Set FlexRAM Function x × Function Switches FlexRAM function between RAM and EEPROM. When switching to EEPROM, FlexNVM is not available while valid data records are being copied from EEPROM backup to FlexRAM. 28.4.10.
Chapter 28 Flash Memory Module (FTFL) Table 28-31. FTFL Commands by Mode (continued) FCMD Command 0x80 0x81 NVM Normal NVM Special Unsecure Secure MEEN=10 Unsecure Secure MEEN=10 Program Partition × × × × — — Set FlexRAM Function × × × × — — 28.4.10.4 Allowed Simultaneous Flash Operations Only the operations marked 'OK' in the following table are permitted to run simultaneously on the program flash, data flash, and FlexRAM memories.
Flash Operation in Low-Power Modes Table 28-33. Allowed Simultaneous Memory Operations Program Flash 0 Read Read Program flash 0 Program Sector Erase Read — Program — Sector Erase Read Program flash 1 Program Flash 1 OK Program OK Sector Erase OK Program Sector Erase OK OK OK — OK OK — — — 28.4.
Chapter 28 Flash Memory Module (FTFL) The 'factory' margin is a bigger deviation from the norm, a more stringent read criteria that should only be attempted immediately (or very soon) after completion of an erase or program command, early in the cycling life. 'Factory' margin levels can be used to check that flash memory contents have adequate margin for long-term data retention at the normal level setting.
Flash Operation in Low-Power Modes 28.4.12.1 Read 1s Block Command The Read 1s Block command checks to see if an entire program flash or data flash block has been erased to the specified margin level. The FCCOB flash address bits determine which logical block is erase-verified. Table 28-34.
Chapter 28 Flash Memory Module (FTFL) 28.4.12.2 Read 1s Section Command The Read 1s Section command checks if a section of program flash or data flash memory is erased to the specified read margin level. The Read 1s Section command defines the starting address and the number of phrases to be verified. Table 28-37.
Flash Operation in Low-Power Modes 28.4.12.3 Program Check Command The Program Check command tests a previously programmed program flash or data flash longword to see if it reads correctly at the specified margin level. Table 28-40.
Chapter 28 Flash Memory Module (FTFL) Table 28-42. Program Check Command Error Handling Error Condition Error Bit Command not available in current mode/security FSTAT[ACCERR] An invalid flash address is supplied FSTAT[ACCERR] Flash address is not longword aligned FSTAT[ACCERR] An invalid margin choice is supplied FSTAT[ACCERR] Either of the margin reads does not match the expected data FSTAT[MGSTAT0] 28.4.12.
Flash Operation in Low-Power Modes After clearing CCIF to launch the Read Resource command, four consecutive bytes are read from the selected resource at the provided relative address and stored in the FCCOB register. The CCIF flag sets after the Read Resource operation completes. The Read Resource command exits with an access error if an invalid resource code is provided or if the address for the applicable area is out-of-range. Table 28-45.
Chapter 28 Flash Memory Module (FTFL) Upon clearing CCIF to launch the Program Longword command, the FTFL programs the data bytes into the flash using the supplied address. The swap indicator address in each program flash block is implicitly protected from programming. The targeted flash locations must be currently unprotected (see the description of the FPROT and FDPROT registers) to permit execution of the Program Longword operation. The programming operation is unidirectional.
Flash Operation in Low-Power Modes Upon clearing CCIF to launch the Erase Flash Block command, the FTFL erases the main array of the selected flash block and verifies that it is erased. When the data flash is targeted, DEPART must be set for no EEPROM (see Table 28-4) else the Erase Flash Block command aborts setting the FSTAT[ACCERR] bit. The Erase Flash Block command aborts and sets the FSTAT[FPVIOL] bit if any region within the block is protected (see the description of the FPROT and FDPROT registers).
Chapter 28 Flash Memory Module (FTFL) address being erased is the non-active block. If the erase-verify fails the FSTAT[MGSTAT0] bit is set. The CCIF flag is set after the Erase Flash Sector operation completes. The Erase Flash Sector command is suspendable (see the FCNFG[ERSSUSP] bit and Figure 28-35). Table 28-51.
Flash Operation in Low-Power Modes i.e. the suspend requests come repeatedly and too quickly, no forward progress is made by the Erase Flash Sector algorithm. The resume/suspend sequence runs indefinitely without completing the erase. 28.4.12.7.3 Aborting a Suspended Erase Flash Sector Operation The user may choose to abort a suspended Erase Flash Sector operation by clearing the ERSSUSP bit prior to clearing CCIF for the next command launch.
Chapter 28 Flash Memory Module (FTFL) Enter with CCIF = 1 Command Initiation ERSSCR Command (Write FCCOB) Memory Controller Command Processing Launch/Resume Command (Clear CCIF) Yes SUSPACK=1 Next Command (Write FCCOB) Yes CCIF = 1? No No Interrupt? Yes Request Suspend (Set ERSSUSP) Start New No CCIF = 1? Restore Erase Algo Clear SUSPACK = 0 Execute DONE? Yes No ERSSUSP=1? No Resume ERSSCR No Yes Save Erase Algo Clear ERSSUSP Yes Service Interrupt (Read Flash) ERSSCR Suspended ERSSUS
Flash Operation in Low-Power Modes 28.4.12.8 Program Section Command The Program Section operation programs the data found in the section program buffer to previously erased locations in the flash memory using an embedded algorithm. Data is preloaded into the section program buffer by writing to the FlexRAM while it is set to function as traditional RAM (see Flash Sector Programming). The section program buffer is limited to the lower half of the RAM.
Chapter 28 Flash Memory Module (FTFL) After the Program Section operation completes, the CCIF flag is set and normal access to the FlexRAM is restored. The contents of the section program buffer may be changed by the Program Section operation. Table 28-53.
Flash Operation in Low-Power Modes 7. To restore EEPROM functionality, execute the Set FlexRAM Function command to make the FlexRAM available as EEPROM. 28.4.12.9 Read 1s All Blocks Command The Read 1s All Blocks command checks if the program flash blocks, data flash blocks, EEPROM backup records, and data flash IFR have been erased to the specified read margin level, if applicable, and releases security if the readout passes, i.e. all data reads as '1'. Table 28-54.
Chapter 28 Flash Memory Module (FTFL) Table 28-56. Read 1s All Blocks Command Error Handling (continued) Error Condition Error Bit Read-1s fails FSTAT[MGSTAT0] 28.4.12.10 Read Once Command The Read Once command provides read access to a reserved 64-byte field located in the program flash 0 IFR (see Program Flash IFR Map and Program Once Field). Access to this field is via 16 records, each 4 bytes long. The Read Once field is programmed using the Program Once command described in Program Once Command.
Flash Operation in Low-Power Modes 28.4.12.11 Program Once Command The Program Once command enables programming to a reserved 64-byte field in the program flash 0 IFR (see Program Flash IFR Map and Program Once Field). Access to the Program Once field is via 16 records, each 4 bytes long. The Program Once field can be read using the Read Once command (see Read Once Command) or using the Read Resource command (see Read Resource Command).
Chapter 28 Flash Memory Module (FTFL) 28.4.12.12 Erase All Blocks Command The Erase All Blocks operation erases all flash memory, initializes the FlexRAM, verifies all memory contents, and releases MCU security. Table 28-61.
Flash Operation in Low-Power Modes unsecure state and the FCNFG[RAMRDY] bit sets. The security byte in the Flash Configuration Field is also programmed to the unsecure state. The status of the erase-all request is reflected in the FCNFG[ERSAREQ] bit. The FCNFG[ERSAREQ] bit is cleared once the operation completes and the normal FSTAT error reporting is available as described in Erase All Blocks Command. 28.4.12.
Chapter 28 Flash Memory Module (FTFL) FTFL module occurs. If the entire 8-byte key is all zeros or all ones, the Verify Backdoor Access Key command fails with an access error. The CCIF flag is set after the Verify Backdoor Access Key operation completes. Table 28-64.
Flash Operation in Low-Power Modes Table 28-65. Swap Control Command FCCOB Requirements (continued) FCCOB Number FCCOB Contents [7:0] Next Swap Block Status (after any reset): 7 0x00 - Program flash block 0 at 0x0_0000 0X01 - Program flash block 1 at 0x0_0000 1. Must be phrase-aligned (Flash address [2:0] = 000).
Chapter 28 Flash Memory Module (FTFL) • FCCOB6 (Current Swap Block Status) - indicates which program flash block is currently located at relative flash address 0x0_0000. • FCCOB7 (Next Swap Block Status) - indicates which program flash block will be located at relative flash address 0x0_0000 after the next reset of the FTFL module.
Flash Operation in Low-Power Modes Table 28-66. Swap Control Command Error Handling (continued) Error Condition Swap Control Code Error Bit Any errors have been encountered during the swap determination and program-verify operations 1, 2, 4 FSTAT[MGSTAT0] 8 FSTAT[MGSTAT0] Any brownouts were detected during the swap determination procedure 1. Returned fields will not be updated, i.e. no swap state or status reporting K10 Sub-Family Reference Manual, Rev.
Chapter 28 Flash Memory Module (FTFL) Block0 Active States Block1 Active States Uninitialized0 0xFFFF 0xFFFF Ready0 0xFFFF 0x0000 Reset 2 1 Complete1 0xFFFF 0x0000 4 Update0 0xFF00 0x0000 UpErs1 0xFFFF 0xFF00 Erase Erase UpErs0 0xFF00 0xFFFF Update1 0x0000 0xFF00 2 4 Complete0 0x0000 0xFFFF Reset Ready1 0x0000 0xFFFF Legend Swap State Indicator0 Indicator1 Swap Control Code Erase: ERSBLK or ERSSCR commands Reset: POR, VLLSx exit, warm/system reset Figure 28-36.
Flash Operation in Low-Power Modes Table 28-67.
Chapter 28 Flash Memory Module (FTFL) 28.4.12.14.1 Swap State Determination During the reset sequence, the state of the swap system is determined by evaluating the IFR Swap Field in the program flash 1 IFR and the swap indicators located in each of the program flash blocks at the swap indicator address stored in the IFR Swap Field. Table 28-68.
Flash Operation in Low-Power Modes Table 28-70.
Chapter 28 Flash Memory Module (FTFL) Table 28-71. Valid FlexNVM Partition Codes FlexNVM Partition Code (FCCOB5[DEPART])1 Data flash Size (Kbytes) EEPROM backup Size (Kbytes) 0000 256 0 0011 224 32 0100 192 64 0101 128 128 0110 0 256 1000 0 256 1011 32 224 1100 64 192 1101 128 128 1110 256 0 1.
Flash Operation in Low-Power Modes Table 28-72. Program Partition Command Error Handling (continued) Error Condition Error Bit FlexNVM Partition Code allocates space for EEPROM backup, but EEPROM Data Size Code allocates no FlexRAM for EEPROM FSTAT[ACCERR] FCCOB4[7:6] != 00 FSTAT[ACCERR] FCCOB5[7:4] != 0000 FSTAT[ACCERR] Any errors have been encountered during the verify operation FSTAT[MGSTAT0] 28.4.12.
Chapter 28 Flash Memory Module (FTFL) When the FlexRAM is set to function as a RAM, normal read and write accesses to the FlexRAM are available. When large sections of flash memory need to be programmed, e.g. during factory programming, the FlexRAM can be used as the Section Program Buffer for the Program Section command (see Program Section Command).
Flash Operation in Low-Power Modes 28.4.13.1 FTFL Access by Mode and Security The following table summarizes how access to the FTFL module is affected by security and operating mode. Table 28-77. FTFL Access Summary Operating Mode Chip Security State Unsecure NVM Normal NVM Special Secure Full command set Full command set Only the Erase All Blocks and Read 1s All Blocks commands. 28.4.13.
Chapter 28 Flash Memory Module (FTFL) 1. Follow the command sequence for the Verify Backdoor Access Key command as explained in Verify Backdoor Access Key Command 2. If the Verify Backdoor Access Key command is successful, the chip is unsecured and the FSEC[SEC] bits are forced to the unsecure state An illegal key provided to the Verify Backdoor Access Key command prohibits further use of the Verify Backdoor Access Key command.
Flash Operation in Low-Power Modes K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 676 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) 29.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. This chapter describes external bus data transfer operations and error conditions. It describes transfers initiated by the core processor (or any other bus master) and includes detailed timing diagrams showing the interaction of signals in supported bus operations. 29.1.
Signal Descriptions 29.1.
Chapter 29 External Bus Interface (FlexBus) Table 29-1. FlexBus Signal Summary Signal Description I/O In a non-multiplexed configuration, this is the address bus. O FB_D[31:0]/ FB_AD[31:0] In a non-multiplexed configuration, this is the data bus. In a multiplexed configuration this bus is the address/data bus, FB_AD[31:0]. In nonmultiplexed and multiplexed configurations, during the first cycle, this bus drives the upper address byte, addr[31:24]. I/O FB_CS[5:0] General purpose chip-selects.
Signal Descriptions 29.2.2 Chip Selects (FB_CS[5 :0]) The chip-select signal indicates which device is selected. A particular chip-select asserts when the transfer address is within the device's address space, as defined in the base- and mask-address registers. The actual number of chip selects available depends upon the pin configuration. 29.2.
Chapter 29 External Bus Interface (FlexBus) 29.2.7 Transfer Size (FB_TSIZ[1:0]) For memory accesses, these signals, along with FB_TBST, indicate the data transfer size of the current bus operation. The interface supports 8-, 16-, and 32-bit operand transfers and allows accesses to 8-, 16-, and 32-bit data ports. For misaligned transfers, FB_TSIZ[1:0] indicates the size of each transfer.
Memory Map/Register Definition Note When burst (FB_TBST = 0), transfer size is 16 bytes (FB_TSIZ[1:0] = 11) and the address is misaligned within the 16-byte boundary, the external device must be able to wrap around the address. 29.2.9 Transfer Acknowledge (FB_TA) This input signal indicates the external data transfer is complete. When the processor recognizes FB_TA during a read cycle, it latches the data and then terminates the bus cycle.
Chapter 29 External Bus Interface (FlexBus) Note You must set CSMR0[V] before the chip select registers take effect. A bus error occurs when writing to reserved register locations. FB memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4000_C000 Chip select address register (FB_CSAR0) 32 R/W 0000_0000h 29.3.1/ 684 4000_C004 Chip select mask register (FB_CSMR0) 32 R/W 0000_0000h 29.3.
Memory Map/Register Definition FB memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4000_C040 Chip select mask register (FB_CSMR5) 32 R/W 0000_0000h 29.3.2/ 685 4000_C044 Chip select control register (FB_CSCR5) 32 R/W 0000_0000h 29.3.3/ 686 4000_C060 Chip select port multiplexing control register (FB_CSPMCR) 32 R/W 0000_0000h 29.3.4/ 689 29.3.
Chapter 29 External Bus Interface (FlexBus) 29.3.2 Chip select mask register (FB_CSMRn) CSMRn registers specify the address mask and allowable access types for the respective chip-selects.
Memory Map/Register Definition FB_CSMRn field descriptions (continued) Field Description Indicates whether the corresponding CSAR, CSMR, and CSCR contents are valid. Programmed chipselects do not assert until V bit is set (except for FB_CS0, which acts as the global chip-select). Reset clears each CSMRn[V]. NOTE: At reset, no chip-select other than FB_CS0 can be used until the CSMR0[V] is set. Afterward, FB_CS[5:0] functions as programmed. 0 1 Chip select invalid Chip select valid 29.3.
Chapter 29 External Bus Interface (FlexBus) FB_CSCRn field descriptions (continued) Field Description (CSCRn[WS]). If the SWSEN bit is cleared, the WS value is used for all burst transfers and this field is ignored. 25–24 Reserved 23 SWSEN 22 EXTS 21–20 ASET This read-only field is reserved and always has the value zero.
Memory Map/Register Definition FB_CSCRn field descriptions (continued) Field Description The number of wait states inserted after FB_CSn asserts and before an internal transfer acknowledge is generated (WS = 0 inserts zero wait states, WS = 0x3F inserts 63 wait states). If AA is reserved, FB_TA must be asserted by the external system regardless of the number of generated wait states. In that case, the external transfer acknowledge ends the cycle.
Chapter 29 External Bus Interface (FlexBus) FB_CSCRn field descriptions (continued) Field Description Specifies whether burst writes are used for memory associated with each FB_CSn. 0 1 2–0 Reserved Break data larger than the specified port size into individual, port-sized, non-burst writes. For example, a longword write to an 8-bit port takes four byte writes.
Functional Description FB_CSPMCR field descriptions (continued) Field 23–20 GROUP3 Description FlexBus signal group 3 multiplex control Controls the multiplexing of the FB_CS5, FB_TSIZ1, and FB_BE_23_16 signals. 0000 0001 0010 Else 19–16 GROUP4 FlexBus signal group 4 multiplex control Controls the multiplexing of the FB_TBST, FB_CS2, and FB_BE_15_8 signals.
Chapter 29 External Bus Interface (FlexBus) • Chip-select mask registers (CSMRn) provide 16-bit address masking and access control. • Chip-select control registers (CSCRn) provide port size and burst capability indication, wait-state generation, address setup and hold times, and automatic acknowledge generation features. 29.4.1.
Functional Description No bit ordering is required when connecting address and data lines to the FB_AD bus. For example, a full 16-bit address/16-bit data device connects its addr[15:0] to FB_AD[16:1] and data[15:0] to FB_AD[31:16]. See Data Byte Alignment and Physical Connections for a graphical connection. 29.4.
Chapter 29 External Bus Interface (FlexBus) Byte Select External Data Bus FB_BE_31_24 FB_BE_23_16 FB_BE_15_8 FB_BE_7_0 FB_D[31:24] FB_D[23:16] FB_D[15:8] FB_D[7:0] 32-Bit Port Memory Byte 3 Byte 2 Byte 1 Byte 0 16-Bit Port Memory Byte 1 Byte 0 Byte 3 Byte 2 8-Bit Port Memory Driven with address values Byte 0 Byte 1 Driven with address values Byte 2 Byte 3 Figure 29-23.
Functional Description Table 29-27. FlexBus Multiplexed Operating Modes for CSCRn[BLS]=0 8-bit 16-bit 32-bit Port Size and Phase FB_AD [31:24] [23:16] [15:8] Address phase Address Data phase Data Address phase Address Data phase Data Address Address phase Data phase [7:0] Address Data Address Table 29-28.
Chapter 29 External Bus Interface (FlexBus) 4. S3: FB_CSn is negated at the fourth rising clock edge. This last clock of the bus cycle uses what would be an idle clock between cycles to provide hold time for address, attributes, and write data. 29.4.5.1 Data Transfer Cycle States An on-chip state machine controls the data-transfer operation in the device. The following figure shows the state-transition diagram for basic read and write cycles. S0 Next Cycle Wait States S3 S1 S2 Figure 29-25.
Functional Description 29.4.6 FlexBus Timing Examples Note The timing diagrams throughout this section use signal names that may not be included on your particular device. Ignore these extraneous signals. Note Throughout this section: • FB_D[X] indicates a 32-, 16-, or 8-bit wide data bus • FB_A[Y] indicates an address bus that can be 32, 24, or 16 bits wide. 29.4.6.1 Basic Read Bus Cycle During a read cycle, the MCU receives data from memory or a peripheral device.
Chapter 29 External Bus Interface (FlexBus) Note FB_TA does not have to be driven by the external device for internally-terminated bus cycles. Note The processor drives the data lines during the first clock cycle of the transfer with the full 32-bit address. This may be ignored by standard connected devices using non-multiplexed address and data buses. However, some applications may find this feature beneficial. The address and data busses are muxed between the FlexBus and another module.
Functional Description External Memory/Peripheral FlexBus 1. Set FB_R/W to write. 2. Place address on the external address signals. 3. Assert transfer start. 1. Decode address. 1. Negate transfer start. 2. Assert FB_CSn. 3. Drive data. 1. Select the appropriate slave device. 1. FlexBus asserts internal FB_TA (auto acknowledge/internal termination). 2. Latch data on the external address signals. 2. Sample FB_TA low. 3. Assert FB_TA (external termination). 1. Start next cycle. 1.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-29. Basic Write-Bus Cycle 29.4.6.3 Bus Cycle Sizing This section shows timing diagrams for various port size scenarios. 29.4.6.3.
Functional Description FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ = 01 Figure 29-30. Single Byte-Read Transfer The following figure shows the similar configuration for a write transfer. The data is driven from the second clock on FB_AD[31:24]. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 700 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ=01 Figure 29-31. Single Byte-Write Transfer 29.4.6.3.2 Bus Cycle Sizing—Word Transfer, 16-bit Device, No Wait States The following figure illustrates the basic word read transfer to a 16-bit device with no wait states. • The address is driven on the full FB_AD[31:8] bus in the first clock.
Functional Description FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ = 10 Figure 29-32. Single Word-Read Transfer The following figure shows the similar configuration for a write transfer. The data is driven from the second clock on FB_AD[31:16]. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 702 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ=10 Figure 29-33. Single Word-Write Transfer 29.4.6.3.3 Bus Cycle Sizing—Longword Transfer, 32-bit Device, No Wait States The following figure depicts a longword read from a 32-bit device. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Functional Description FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ = 00 Figure 29-34. Longword-Read Transfer The following figure illustrates the longword write to a 32-bit device. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 704 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ=00 Figure 29-35. Longword-Write Transfer 29.4.6.4 Timing Variations The FlexBus module has several features that can change the timing characteristics of a basic read- or write-bus cycle to provide additional address setup, address hold, and time for a device to provide or latch data. 29.4.6.4.
Functional Description FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-36. Basic Read-Bus Cycle (No Wait States) K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 706 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-37. Basic Write-Bus Cycle (No Wait States) If wait states are used, the S1 state repeats continuously until the the chip-select autoacknowledge unit asserts internal transfer acknowledge or the external FB_TA is recognized as asserted.
Functional Description FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-38. Read-Bus Cycle (One Wait State) K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 708 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-39. Write-Bus Cycle (One Wait State) 29.4.6.4.2 Address Setup and Hold The timing of the assertion and negation of the chip selects, byte selects, and output enable can be programmed on a chip-select basis.
Functional Description FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-40. Read-Bus Cycle with Two-Clock Address Setup (No Wait States) K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 710 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-41. Write-Bus Cycle with Two Clock Address Setup (No Wait States) In addition to address setup, a programmable address hold option for each chip select exists. Address and attributes can be held one to four clocks after chip-select, byteselects, and output-enable negate.
Functional Description FB_CLK Address FB_A[Y] FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-42. Read Cycle with Two-Clock Address Hold (No Wait States) K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 712 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-43. Write Cycle with Two-Clock Address Hold (No Wait States) The following figure shows a bus cycle using address setup, wait states, and address hold. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Functional Description FB_CLK FB_A[Y] FB_D[X] Address Address Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-44. Write Cycle with Two-Clock Address Setup and Two-Clock Hold (One Wait State) 29.4.7 Burst Cycles The device can be programmed to initiate burst cycles if its transfer size exceeds the port size of the selected destination. The initiation of a burst cycle is encoded on the size pins.
Chapter 29 External Bus Interface (FlexBus) Table 29-30. Transfer Size and Port Size Translation Burst-Inhibited: Number of Transfers Port Size PS[1:0] Transfer Size FB_TSIZ[1:0] 01 (8-bit) 10 (16-bits) 2 00 (32-bits) 4 11 (16 bytes) 16 00 (32 bits) 2 11 (16 bytes) 8 11 (line) 4 1x (16-bit) 00 (32-bit) Burst Enabled: Number of Beats The FlexBus can support 2-1-1-1 burst cycles to maximize system performance. Delaying termination of the cycle can add wait states.
Functional Description FB_CLK FB_A[Y] Add+1 Address FB_D[X] Address Data Add+2 Data Add+3 Data Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ = 11 Figure 29-45. 32-bit-Read Burst from 8-Bit Port 2-1-1-1 (No Wait States) The following figure shows a 32-bit write to an 8-bit device with burst enabled. The transfer results in a 4-beat burst and the data is driven on FB_AD[31:24].
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Address Add+1 Data Add+2 Data Add+3 Data Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ Figure 29-46. 32-bit-Write Burst to 8-Bit Port 3-1-1-1 (No Wait States) The following figure shows a 32-bit read from an 8-bit device with burst inhibited. The transfer results in four individual transfers.
Functional Description FB_CLK FB_A[Y] FB_D[X] Address Add Add+1 Data Add+1 Data Add+2 Add+2 Data Add+3 Add+3 Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OE FB_BE/BWEn AA=1 FB_TA AA=0 FB_TBST FB_TSIZ[1:0] TSIZ = 00 TSIZ = 01 Figure 29-47. 32-bit-Read Burst-Inhibited from 8-Bit Port (No Wait States) The following figure shows a 32-bit write to an 8-bit device with burst inhibited. The transfer results in four individual transfers.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Add Add+1 Data Add+1 Add+2 Data Add+2 Data Add+3 Add+3 Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TBST FB_TSIZ[1:0] TSIZ = 01 TSIZ = 00 Figure 29-48. 32-bit-Write Burst-Inhibited to 8-Bit Port (No Wait States) The following figure illustrates another read burst transfer, but in this case a wait state is added between individual beats.
Functional Description FB_CLK FB_A[Y] FB_D[X] Address Address Data Add+1 Data Add+2 Data Add+3 Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA FB_TSIZ[1:0] AA=0 TSIZ = 00 Figure 29-49. 32-bit-Read Burst from 8-Bit Port 3-2-2-2 (One Wait State) The following figure illustrates a write burst transfer with one wait state. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 720 Freescale Semiconductor, Inc.
Chapter 29 External Bus Interface (FlexBus) FB_CLK FB_A[Y] Address FB_D[X] Add+1 Address Add+2 Data Data Add+3 Data Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ = 00 Figure 29-50. 32-bit-Write Burst to 8-Bit Port 3-2-2-2 (One Wait State) If address setup and hold are used, only the first and last beat of the burst cycle are affected. The following figure shows a read cycle with one clock of address setup and address hold.
Functional Description FB_CLK FB_A[Y] FB_D[X] Add+1 Address Address Data Data Add+2 Data Add+3 Data FB_RW FB_TS FB_ALE AA=1 FB_CSn AA=0 FB_OEn FB_BE/BWEn AA=1 FB_TA AA=0 FB_TSIZ[1:0] TSIZ=11 Figure 29-51. 32-bit-Read Burst from 8-Bit Port 3-1-1-1 (Address Setup and Hold) The following figure shows a write cycle with one clock of address setup and address hold.
Chapter 29 External Bus Interface (FlexBus) 29.4.8 Extended Transfer Start/Address Latch Enable The FB_TS/FB_ALE signal indicates that a bus transaction has begun and the address and attributes are valid. By default, the FB_TS/FB_ALE signal asserts for a single bus clock cycle. When CSCRn[EXTS] is set, the FB_TS/FB_ALE signal asserts and remain asserted until the first positive clock edge after FB_CSn asserts. See the following figure.
Initialization/Application Information The types of accesses that cause the access to terminate with a bus error are: • • • • • • Writes to write-protected region Address with no hit to any chip select Address with hits to multiple chip selects Writes to reserved addresses in the memory map Writes to reserved bits in the CSPMCR register FlexBus accesses when the FlexBus is secure Also, the device can hang if the FlexBus is configured for external termination and the CSPMCR is not configured for FB_TA.
Chapter 30 EzPort 30.1 Overview NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. EzPort is a serial flash programming interface that allows In-System Programming (ISP) of flash memory contents on a 32 bit general purpose micro-controller. Memory contents can be read, erased and programmed from off-chip in a compatible format to many standalone flash memory chips, without necessitating the removal of the micro-controller from the system. 30.1.
Overview EzPort Enabled G EZP_CS EZP_CK Flash Controller EzPort EZP_D EZP_Q Reset Flash Memory Reset Out Reset Controller Micro-controller Core Figure 30-1. EzPort Block Diagram 30.1.2 Features The EzPort includes the following features: • Serial interface that is compatible with a subset of the SPI format. • Able to read, erase and program flash memory. • Able to reset the micro-controller, allowing it to boot from the flash memory after the memory has been configured. 30.1.
Chapter 30 EzPort The EzPort provides a simple interface to connect an external device to the flash memory on board a 32 bit micro-controller. The interface itself is compatible with the SPI interface (with the EzPort operating as a slave) running in either of the two following modes with data transmitted most significant bit first: • CPOL = 0, CPHA = 0 • CPOL = 1, CPHA = 1 Commands are issued by the external device to erase, program or read the contents of the flash memory.
Command Definition 30.2.2 EzPort Chip Select (EZP_CS) Chip select for signalling the start and end of serial transfers. If EZP_CS is asserted during and when the micro-controller's reset out signal is negated, then EzPort is enabled out of reset; otherwise it is disabled. After EzPort is enabled, asserting EZP_CS commences a serial data transfer, which continues until EZP_CS is negated again.
Chapter 30 EzPort Table 30-2. EzPort Commands (continued) Command Description Code Address Bytes Data Bytes Accepted when secure? RESET Reset Chip 0xB9 0 0 Yes WRFCCOB Write FCCOB Registers 0xBA 0 12 Yes6 FAST_RDFCCOB Read FCCOB registers at high speed 0xBB 0 1 - 122 No WRFLEXRAM Write FlexRAM 0xBC 31 4 No RDFLEXRAM Read FlexRAM 0xBD 31 1+ No 0xBE 31 1+2 No FAST_RDFLEXRAM Read FlexRAM at high speed 1. 2. 3. 4.
Command Definition Table 30-3. EzPort Status Register R 7 6 FS WEF 0/11 0 5 4 3 2 1 0 FLEXRAM BEDIS WEN WIP 0/12 0/13 0 14 W Reset: 0 0 1. Reset value reflects the status of flash security out of reset. 2. Reset value reflects FlexNVM flash partitioning. If FlexNVM flash has been paritioned for EEPROM, this bit is set immediately after reset. Note that FLEXRAM is cleared after the EzPort initialization sequence completes, as indicated by clearing of WIP. 3.
Chapter 30 EzPort Table 30-4. EzPort Status Register Field Descriptions (continued) Field Description 6 Write error flag WEF Status flag that indicates if there has been an error while executing a write command (SP, SE, BE, WRFCCOB, or WRFLEXRAM). The WEF flag will set if either the Flash Access Error Flag (ACCERR) or the Flash Protection Violation Flag (FPVIOL) or the Memory Controller Command Completion Status Flag (MGSTAT0) inside the flash memory is set at the completion of the write command.
Command Definition 30.3.1.6 Section Program The Section Program (SP) command programs up to one section of flash memory which has previously been erased. A section is defined as the smaller of the flash sector size or half the size of the FlexRAM/Programming Acceleration RAM. The starting address of the memory to program is sent after the command word and must be a 64-bit aligned address (the three LSBs must be zero).
Chapter 30 EzPort 30.3.1.8 Bulk Erase The Bulk Erase (BE) command erases the entire contents of flash memory, ignoring any protected sectors or flash security. Flash security is disabled upon successful completion of the BE command. Attempts to issue a BE command while the BEDIS and FS bits are set results in the WEF flag being set in the EzPort status register. Also, this command is not accepted if the WEF or WIP bit is set or if the WEN bit is not set in the EzPort status register. 30.3.1.
Command Definition 30.3.1.11 Read FCCOB Registers at High Speed The Read FCCOB Registers at High Speed (FAST_RDFCCOB) command allows the user to read the contents of the flash common command object registers. After receiving the command, EzPort waits for one dummy byte of data before returning FCCOB register data starting at FCCOB 0 and ending with FCCOB B. This command can be run with an EzPort clock (EZP_CK) frequency half the internal system clock frequency of the micro-controller or slower.
Chapter 30 EzPort The Read FlexRAM (RDFLEXRAM) command returns data from the FlexRAM. If the FlexRAM is configured for EEPROM operation, the RDFLEXRAM command can effectively be used to read data from EEPROM-flash memory. Data continues being returned for as long as the EzPort chip select (EZP_CS) is asserted, with the address automatically incrementing. In this way, the entire contents of FlexRAM can be returned by one command. The initial address must be 32-bit aligned (the two LSBs must be zero).
Flash Memory Map for EzPort Access Table 30-5. Flash Memory Map for EzPort Access (continued) Valid Start Address Size Flash block Valid Commands 0x0080_0000 See device's Chip Configuration details FlexNVM READ, FAST_READ, SP, SE, BE 0x0000_0000 See device's Chip Configuration details FlexRAM RDFLEXRAM, FAST_RDFLEXRAM, WRFLEXRAM, BE K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 736 Freescale Semiconductor, Inc.
Chapter 31 Cyclic redundancy check (CRC) 31.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The cyclic redundancy check (CRC) module generates 16/32-bit CRC code for error detection. The CRC module provides a programmable polynomial, WAS, and other parameters required to implement a 16-bit or 32-bit CRC standard. The 16/32-bit code is calculated for 32 bits of data at a time. 31.1.
Memory map and register descriptions 31.1.2 Block diagram This is a block diagram of the CRC. TOT WAS FXOR TOTR Seed Reverse Logic MUX CRC Data Register [31:24] [23:16] [15:8] [7:0] NOT Logic CRC Data Reverse Logic Checksum CRC Polynomial Register [31:24] [23:16] [15:8] [7:0] CRC Data Register [31:24] [23:16] [15:8] [7:0] CRC Engine Data Combine Logic Polynomial 16-/32-bit Select TCRC Figure 31-1. Programmable cyclic redundancy check (CRC) block diagram 31.1.
Chapter 31 Cyclic redundancy check (CRC) CRC memory map Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4003_2000 CRC Data Register (CRC_CRC) 32 R/W FFFF_ FFFFh 31.2.1/ 739 4003_2004 CRC Polynomial Register (CRC_GPOLY) 32 R/W 0000_1021h 31.2.2/ 740 4003_2008 CRC Control Register (CRC_CTRL) 32 R/W 0000_0000h 31.2.3/ 741 31.2.1 CRC Data Register (CRC_CRC) The CRC data register contains the value of the seed, data, and checksum.
Memory map and register descriptions CRC_CRC field descriptions (continued) Field Description 23–16 HL CRC High Lower Byte 15–8 LU CRC Low Upper Byte 7–0 LL CRC Low Lower Byte In 16-bit CRC mode (the CTRL[TCRC] bit is 0), this field is not used for programming a seed value. In 32bit CRC mode (the CTRL[TCRC] bit is 1), values written to this field are part of the seed value when the CTRL[WAS] bit is 1.
Chapter 31 Cyclic redundancy check (CRC) 31.2.3 CRC Control Register (CRC_CTRL) This register controls the configuration and working of the CRC module. Appropriate bits must be set before starting a new CRC calculation. A new CRC calculation is initialized by asserting the CTRL[WAS] bit and then writing the seed into the CRC data register.
Functional description CRC_CTRL field descriptions (continued) Field 24 TCRC 23–0 Reserved Description Width of CRC protocol. 0 1 16-bit CRC protocol. 32-bit CRC protocol. This read-only field is reserved and always has the value zero. 31.3 Functional description 31.3.1 CRC initialization/re-initialization To enable the CRC calculation, the user must program the WAS, POLYNOMIAL, and necessary parameters for transpose and CRC result inversion in the applicable registers.
Chapter 31 Cyclic redundancy check (CRC) 5. Write a 16-bit seed to CRC[LU:LL]. CRC[HU:HL] are not used. 6. Clear the CTRL[WAS] bit to start writing data values. 7. Write data values into CRC[HU:HL:LU:LL]. A CRC is computed on every data value write, and the intermediate CRC result is stored back into CRC[LU:LL]. 8. When all values have been written, read the final CRC result from CRC[LU:LL]. Transpose and complement operations are performed "on the fly" while reading or writing values.
Functional description 31.3.3.1 Types of transpose The CRC module provides several types of transpose functions to flip the bits and/or bytes (for both writing input data and reading the CRC result, separately using the CTRL[TOT] or CTRL[TOTR] fields) according to the CRC calculation being used. The following types of transpose functions are available for writing to and reading from the CRC data register. 1. CTRL[TOT] or CTRL[TOTR] is 00 No transposition occurs. 2.
Chapter 31 Cyclic redundancy check (CRC) 31 7 24 23 16 15 8 0 15 8 23 16 7 31 0 24 Figure 31-7. Transpose type 11 NOTE For 8-bit and 16-bit write accesses to the CRC data register, the data is transposed with zeros on the unused byte or bytes (taking 32 bits as a whole), but the CRC is calculated on the valid byte(s) only.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 746 Freescale Semiconductor, Inc.
Chapter 32 Analog-to-Digital Converter (ADC) 32.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The 16-bit analog-to-digital converter (ADC) is a successive approximation ADC designed for operation within an integrated microcontroller system-on-chip. NOTE For the chip specific modes of operation, refer to the Power Management information for the device. 32.1.
Introduction • Input clock selectable from up to four sources • Operation in low power modes for lower noise operation • Asynchronous clock source for lower noise operation with option to output the clock • Selectable hardware conversion trigger with hardware channel select • Automatic compare with interrupt for less-than, greater-than or equal-to, within range, or out-of-range, programmable value • Temperature sensor • Hardware average function • Selectable voltage reference: external or alternate • Self-
Chapter 32 Analog-to-Digital Converter (ADC) ADHWTSA SC1A Conversion Trigger Control ADHWTSn ADHWT SC1n ADTRG Control Registers (SC2, CFG1, CFG2) Async Clock Gen A D IC L K A D IV ADLPC/ADHSC MODE ADLSMP/ADLSTS DIFF ADCO trig g e r c o m p le te AIEN ADACKEN COCO ADCH C o m p a re tru e 1 Interrupt MCU STOP AD23 TempP ADACK Clock Divide Bus Clock 2 ALTCLK abort transfer sample initialize PGA DADP0 DADP2 DADP3 AD4 convert Control Sequencer VREF_OUT ADCK A D V IN P PG, MG A
ADC Signal Descriptions Table 32-1. ADC Signal Descriptions (continued) Signal DADM[3:0] Description I/O Differential analog channel inputs I Single-ended analog channel inputs I VREFSH Voltage reference select high I VREFSL Voltage reference select low I VDDA Analog power supply I VSSA Analog ground I AD[23:4] 32.2.1 Analog power (VDDA) The ADC analog portion uses VDDA as its power connection. In some packages, VDDA is connected internally to VDD.
Chapter 32 Analog-to-Digital Converter (ADC) In some packages, VREFH is connected in the package to VDDA and VREFL to VSSA. If externally available, the positive reference(s) may be connected to the same potential as VDDA or may be driven by an external source to a level between the minimum Ref Voltage High and the VDDA potential (VREFH must never exceed VDDA). Connect the ground references to the same voltage potential as VSSA. 32.2.
Register Definition ADC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_B00C Configuration register 2 (ADC0_CFG2) 32 R/W 0000_0000h 32.3.3/ 759 4003_B010 ADC data result register (ADC0_RA) 32 R 0000_0000h 32.3.4/ 760 4003_B014 ADC data result register (ADC0_RB) 32 R 0000_0000h 32.3.4/ 760 4003_B018 Compare value registers (ADC0_CV1) 32 R/W 0000_0000h 32.3.
Chapter 32 Analog-to-Digital Converter (ADC) ADC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_B05C ADC minus-side general calibration value register (ADC0_CLM4) 32 R/W 0000_0200h 32.3.21/ 773 4003_B060 ADC minus-side general calibration value register (ADC0_CLM3) 32 R/W 0000_0100h 32.3.22/ 774 4003_B064 ADC minus-side general calibration value register (ADC0_CLM2) 32 R/W 0000_0080h 32.3.
Register Definition ADC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400B_B03C ADC plus-side general calibration value register (ADC1_CLP4) 32 R/W 0000_0200h 32.3.13/ 768 400B_B040 ADC plus-side general calibration value register (ADC1_CLP3) 32 R/W 0000_0100h 32.3.14/ 769 400B_B044 ADC plus-side general calibration value register (ADC1_CLP2) 32 R/W 0000_0080h 32.3.
Chapter 32 Analog-to-Digital Converter (ADC) Writing SC1A while SC1A is actively controlling a conversion aborts the current conversion. In software trigger mode (ADTRG=0), writes to the SC1A register subsequently initiate a new conversion (if the ADCH bits are equal to a value other than all 1s). Similarly, writing any of the SC1n registers while that specific SC1n register is actively controlling a conversion aborts the current conversion.
Register Definition ADCx_SC1n field descriptions (continued) Field 6 AIEN Description Interrupt enable AIEN enables conversion complete interrupts. When COCO becomes set while the respective AIEN is high, an interrupt is asserted. 0 1 5 DIFF Differential mode enable DIFF configures the ADC to operate in differential mode. When enabled, this mode automatically selects from the differential channels, and changes the conversion algorithm and the number of cycles to complete a conversion.
Chapter 32 Analog-to-Digital Converter (ADC) ADCx_SC1n field descriptions (continued) Field Description 10111 11000 11001 11010 11011 11100 11101 11110 11111 When DIFF=0, AD23 is selected as input; when DIFF=1, it is reserved. Reserved. Reserved. When DIFF=0, Temp sensor (single-ended) is selected as input; when DIFF=1, Temp sensor (differential) is selected as input. When DIFF=0, Bandgap (single-ended) is selected as input; when DIFF=1, Bandgap (differential) is selected as input. Reserved.
Register Definition ADCx_CFG1 field descriptions (continued) Field Description 0 1 6–5 ADIV Clock divide select ADIV selects the divide ratio used by the ADC to generate the internal clock ADCK. 00 01 10 11 4 ADLSMP ADLSMP selects between different sample times based on the conversion mode selected. This bit adjusts the sample period to allow higher impedance inputs to be accurately sampled or to maximize conversion speed for lower impedance inputs.
Chapter 32 Analog-to-Digital Converter (ADC) 32.3.3 Configuration register 2 (ADCx_CFG2) CFG2 register selects the special high speed configuration for very high speed conversions and selects the long sample time duration during long sample mode.
Register Definition ADCx_CFG2 field descriptions (continued) Field Description ADHSC configures the ADC for very high speed operation. The conversion sequence is altered (2 ADCK cycles added to the conversion time) to allow higher speed conversion clocks. 0 1 1–0 ADLSTS Normal conversion sequence selected. High speed conversion sequence selected (2 additional ADCK cycles to total conversion time).
Chapter 32 Analog-to-Digital Converter (ADC) Table 32-44.
Register Definition The compare value 2 register (CV2) is utilized only when the compare range function is enabled (ACREN=1).
Chapter 32 Analog-to-Digital Converter (ADC) ADCx_SC2 field descriptions Field 31–8 Reserved 7 ADACT Description This read-only field is reserved and always has the value zero. Conversion active ADACT indicates that a conversion or hardware averaging is in progress. ADACT is set when a conversion is initiated and cleared when a conversion is completed or aborted. 0 1 6 ADTRG Conversion trigger select ADTRG selects the type of trigger used for initiating a conversion.
Register Definition ADCx_SC2 field descriptions (continued) Field Description 00 01 10 11 Default voltage reference pin pair (external pins VREFH and VREFL) Alternate reference pair (VALTH and VALTL). This pair may be additional external pins or internal sources depending on MCU configuration. Consult the Chip Configuration information for details specific to this MCU. Reserved Reserved 32.3.
Chapter 32 Analog-to-Digital Converter (ADC) ADCx_SC3 field descriptions (continued) Field Description 0 1 5–4 Reserved Calibration completed normally. Calibration failed. ADC accuracy specifications are not guaranteed. This read-only field is reserved and always has the value zero. 3 ADCO Continuous conversion enable ADCO enables continuous conversions. 0 1 2 AVGE One conversion or one set of conversions if the hardware average function is enabled (AVGE=1) after initiating a conversion.
Register Definition ADCx_OFS field descriptions Field Description 31–16 Reserved This read-only field is reserved and always has the value zero. 15–0 OFS Offset error correction value 32.3.9 ADC plus-side gain register (ADCx_PG) The plus-side gain register (PG) contains the gain error correction for the plus-side input in differential mode or the overall conversion in single-ended mode.
Chapter 32 Analog-to-Digital Converter (ADC) Addresses: ADC0_MG is 4003_B000h base + 30h offset = 4003_B030h ADC1_MG is 400B_B000h base + 30h offset = 400B_B030h Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 0 R 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 MG W Reset 8 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 ADCx_MG field descriptions Field Description 31–16 Reserved This read-only field is reserved and always has t
Register Definition 32.3.12 ADC plus-side general calibration value register (ADCx_CLPS) For more information, refer to CLPD register description.
Chapter 32 Analog-to-Digital Converter (ADC) 32.3.14 ADC plus-side general calibration value register (ADCx_CLP3) For more information, refer to CLPD register description.
Register Definition 32.3.16 ADC plus-side general calibration value register (ADCx_CLP1) For more information, refer to CLPD register description.
Chapter 32 Analog-to-Digital Converter (ADC) 32.3.
Register Definition ADCx_PGA field descriptions (continued) Field Description 1000 1001 1010 1011 1100 1101 1110 1111 15–0 Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved This read-only field is reserved and always has the value zero. 32.3.19 ADC minus-side general calibration value register (ADCx_CLMD) CLMx contain calibration information that is generated by the calibration function.
Chapter 32 Analog-to-Digital Converter (ADC) 32.3.20 ADC minus-side general calibration value register (ADCx_CLMS) For more information, refer to CLMD register description.
Register Definition 32.3.22 ADC minus-side general calibration value register (ADCx_CLM3) For more information, refer to CLMD register description.
Chapter 32 Analog-to-Digital Converter (ADC) 32.3.24 ADC minus-side general calibration value register (ADCx_CLM1) For more information, refer to CLMD register description.
Functional description 32.4 Functional description The ADC module is disabled during reset, in low power stop mode (refer to the Power Management information for details), or when the ADCH bits in SC1n are all high. The module is idle when a conversion has completed and another conversion has not been initiated. When it is idle and the asynchronous clock output enable is disabled (ADACKEN is 0), the module is in its lowest power state.
Chapter 32 Analog-to-Digital Converter (ADC) The PGA has only one voltage reference pair. The positive reference used is chip specific and depends on the MCU configuration. Refer to the Chip Configuration chapter on the PGA Voltage Reference specific to this MCU. The ground reference is the analog ground for the PGA. The ADC PGA register allows to control the PGA gain and modes of operation. 32.4.
Functional description 32.4.3 Voltage reference selection The ADC can be configured to accept one of the two voltage reference pairs as the reference voltage (VREFSH and VREFSL) used for conversions. Each pair contains a positive reference that must be between the minimum Ref Voltage High and VDDA, and a ground reference that must be at the same potential as VSSA. The two pairs are external (VREFH and VREFL) and alternate (VALTH and VALTL).
Chapter 32 Analog-to-Digital Converter (ADC) When the conversion is completed, the result is placed in the data registers associated with the ADHWTSn received (ADHWTSA active selects RA register; ADHWTSn active selects Rn register). The conversion complete flag associated with the ADHWTSn received (the COCO bit in SC1n register) is then set and an interrupt is generated if the respective conversion complete interrupt has been enabled (AIEN=1). 32.4.
Functional description If continuous conversions are enabled, a new conversion is automatically initiated after the completion of the current conversion. In software triggered operation (ADTRG=0), continuous conversions begin after SC1A register is written and continue until aborted. In hardware triggered operation (ADTRG=1 and one ADHWTSn event has occurred), continuous conversions begin after a hardware trigger event and continue until aborted.
Chapter 32 Analog-to-Digital Converter (ADC) • The MCU is reset or enters Low Power Stop modes. • The MCU enters Normal Stop mode with ADACK not enabled. When a conversion is aborted, the contents of the data registers, Rn, are not altered. The data registers continue to be the values transferred after the completion of the last successful conversion. If the conversion was aborted by a reset or Low Power Stop modes, RA and R n return to their reset states. 32.4.5.
Functional description ADC Configuration 1 11 Sample time (ADCK cycles) 1 8 The total conversion time depends upon: the sample time (as determined by ADLSMP and ADLSTS bits), the MCU bus frequency, the conversion mode (as determined by MODE and SC1n[DIFF] bits), the high speed configuration (ADHSC bit), and the frequency of the conversion clock (fADCK). The ADHSC bit is used to configure a higher clock input frequency. This will allow faster overall conversion times.
Chapter 32 Analog-to-Digital Converter (ADC) Table 32-108. Average number factor (AverageNum) AVGE AVGS[1:0] Average number factor (AverageNum) 0 xx 1 1 00 4 1 01 8 1 10 16 1 11 32 Table 32-109. Base Conversion Time (BCT) Mode Base conversion time (BCT) 8b s.e. 17 ADCK cycles 9b diff 27 ADCK cycles 10b s.e. 20 ADCK cycles 11b diff 30 ADCK cycles 12b s.e. 20 ADCK cycles 13b diff 30 ADCK cycles 16b s.e. 25 ADCK cycles 16b diff 34 ADCK cycles Table 32-110.
Functional description 32.4.5.6 Conversion time examples The following examples use Figure 32-95 and the information provided in Table 32-107 through Table 32-111. 32.4.5.6.1 Typical conversion time configuration A typical configuration for ADC conversion is: 10-bit mode, with the bus clock selected as the input clock source, the input clock divide-by-1 ratio selected, and a bus frequency of 8 MHz, long sample time disabled and high speed conversion disabled.
Chapter 32 Analog-to-Digital Converter (ADC) Table 32-113. Typical conversion time (continued) Variable Time HSCAdder 0 The resulting conversion time is generated using the parameters listed in the preceding table. Therefore, for bus clock equal to 8 MHz and ADCK equal to 1 MHz, the resulting conversion time is 57.625 µs (AverageNum). This results in a total conversion time of 1.844 ms. 32.4.5.6.
Functional description After the selected input is sampled and converted, the result is placed in an accumulator from which an average is calculated once the selected number of conversions has been completed. When hardware averaging is selected, the completion of a single conversion will not set the COCO bit.
Chapter 32 Analog-to-Digital Converter (ADC) With the ADC range enable bit set, ACREN =1, and if compare value register 1 (CV1 value) is less than or equal to the compare value register 2 (CV2 value), then setting ACFGT will select a trigger-if-inside-compare-range inclusive-of-endpoints function. Clearing ACFGT will select a trigger-if-outside-compare-range, not-inclusive-ofendpoints function.
Functional description for the different configurations. For best calibration results, it is recommended to set hardware averaging to maximum (AVGE=1, AVGS=11 for average of 32), ADC clock frequency fADCK less than or equal to 4 MHz, VREFH=VDDA, and to calibrate at nominal voltage and temperature. The input channel, conversion mode continuous function, compare function, resolution mode, and differential/single-ended mode are all ignored during the calibration function.
Chapter 32 Analog-to-Digital Converter (ADC) stored in flash memory after an initial calibration and recovered prior to the first ADC conversion. This method should reduce the calibration latency to 20 register store operations on all subsequent power, reset, or Low Power Stop mode recoveries. 32.4.8 User defined offset function The ADC offset correction register (OFS) contains the user selected or calibration generated offset error correction value. This register is a 2’s complement, left justified.
Functional description format and the effect will be an addition. An offset correction that results in an out-ofrange value will be forced to the minimum or maximum value (the minimum value for single-ended conversions is 0x0000; for a differential conversion it is 0x8000). To preserve accuracy, the calibrated offset value initially stored in the OFS register must be added to the user defined offset.
Chapter 32 Analog-to-Digital Converter (ADC) 32.4.10 MCU wait mode operation Wait mode is a lower power-consumption standby mode from which recovery is fast because the clock sources remain active. If a conversion is in progress when the MCU enters Wait mode, it continues until completion. Conversions can be initiated while the MCU is in Wait mode by means of the hardware trigger or if continuous conversions are enabled.
Initialization information 32.4.11.2 Normal Stop mode with ADACK enabled If ADACK is selected as the conversion clock, the ADC continues operation during Normal Stop mode. Refer to the Chip Configuration chapter for configuration information for this MCU. If a conversion is in progress when the MCU enters Normal Stop mode, it continues until completion. Conversions can be initiated while the MCU is in Normal Stop mode by means of the hardware trigger or if continuous conversions are enabled.
Chapter 32 Analog-to-Digital Converter (ADC) Note Hexadecimal values are designated by a preceding 0x, binary values designated by a preceding %, and decimal values have no preceding character. 32.5.1 ADC module initialization example This section provides details about the ADC module initialization. 32.5.1.1 Initialization sequence Before the ADC module can be used to complete conversions, an initialization procedure must be performed. A typical sequence is as follows: 1.
Initialization information CFG1 = 0x98 (%10011000) Bit 7 ADLPC 1 Bit 6:5 ADIV 00 Bit 4 ADLSMP 1 Bit 3:2 MODE 10 bit conversion. Bit 1:0 ADICLK 00 Configures for low power (lowers maximum clock speed. Sets the ADCK to the input clock ÷ 1. Configures for long sample time. Selects the single-ended 10-bit conversion, differential 11Selects the bus clock. SC2 = 0x00 (%00000000) Bit Bit Bit Bit Bit Bit Bit and VREFL).
Chapter 32 Analog-to-Digital Converter (ADC) Reset Initialize ADC CFG1 = 0x98 SC2 = 0x00 SC1n = 0x41 Check No SC1n[COCO]=1? Yes Read Rn to clear SC1n[COCO] bit Continue Figure 32-97. Initialization Flowchart for Example 32.6 Application information This section contains information for using the ADC module in applications. The ADC has been designed to be integrated into a microcontroller for use in embedded control applications requiring an ADC. 32.6.
Application information supply pins. In these cases, there are separate pads for the analog supplies bonded to the same pin as the corresponding digital supply so that some degree of isolation between the supplies is maintained. When available on a separate pin, both VDDA and VSSA must be connected to the same voltage potential as their corresponding MCU digital supply (VDD and VSS) and must be routed carefully for maximum noise immunity and bypass capacitors placed as near as possible to the package.
Chapter 32 Analog-to-Digital Converter (ADC) frequency characteristics. This capacitor is connected between VREFH and VREFL and must be placed as near as possible to the package pins. Resistance in the path is not recommended because the current causes a voltage drop that could result in conversion errors. Inductance in this path must be minimum (parasitic only). 32.6.1.3 Analog input pins The external analog inputs are typically shared with digital I/O pins on MCU devices.
Application information SC = Number of ADCK cycles used during sample window CADIN = Internal ADC input capacitance NUMTAU = -ln(LSBERR / 2N) LSBERR = value of acceptable sampling error in LSBs N = 8 in 8-bit mode, 10 in 10-bit mode, 12 in 12-bit mode or 16 in 16-bit mode Higher source resistances or higher-accuracy sampling is possible by setting ADLSMP and changing the ADLSTS bits (to increase the sample window) or decreasing ADCK frequency to increase sample time. 32.6.2.
Chapter 32 Analog-to-Digital Converter (ADC) • For software triggered conversions, immediately follow the write to the SC1 register with a wait instruction or stop instruction. • For Normal Stop mode operation, select ADACK as the clock source. Operation in Normal Stop reduces VDD noise but increases effective conversion time due to stop recovery. • There is no I/O switching, input or output, on the MCU during the conversion.
Application information For 16-bit conversions, the code transitions only after the full code width is present, so the quantization error is -1 LSB to 0 LSB and the code width of each step is 1 LSB. 32.6.2.5 Linearity errors The ADC may also exhibit non-linearity of several forms. Every effort has been made to reduce these errors, but the system designers should be aware of them because they affect overall accuracy.
Chapter 32 Analog-to-Digital Converter (ADC) This error may be reduced by repeatedly sampling the input and averaging the result. Additionally, the techniques discussed in Noise-induced errors reduces this error. Non-monotonicity is defined as when, except for code jitter, the converter converts to a lower code for a higher input voltage. Missing codes are those values never converted for any input value. In 8-bit or 10-bit mode, the ADC is guaranteed to be monotonic and have no missing codes.
Application information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 802 Freescale Semiconductor, Inc.
Chapter 33 Comparator (CMP) 33.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The Comparator module (CMP) provides a circuit for comparing two analog input voltages. The comparator circuit is designed to operate across the full range of the supply voltage (rail to rail operation). The Analog MUX (ANMUX) provides a circuit for selecting an analog input signal from eight channels. One signal provided by the 6-bit DAC.
6-bit DAC Key Features • Selectable interrupt on rising edge, falling edge, or both rising or falling edges of comparator output • Selectable inversion on comparator output • Comparator output may be: • Sampled • Windowed (ideal for certain PWM zero-crossing-detection applications) • Digitally Filtered • Filter can be bypassed • Can be clocked via external SAMPLE signal or scaled bus clock • External hysteresis can be used at the same time that the output filter is used for internal functions.
Chapter 33 Comparator (CMP) 33.4 ANMUX Key Features • Two 8 to 1 channel mux • Operates the entire supply range 33.5 CMP, DAC, and ANMUX Diagram The following figure shows the block diagram for the High Speed Comparator, Digital to Analog Converter, and Analog MUX modules. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
CMP Block Diagram VRSEL Vin1 Vin2 VOSEL[5:0] MUX DAC output MUX 64-level DACEN DAC PSEL[2:0] CMP MUX Reference Input 0 Reference Input 1 Reference Input 2 Reference Input 3 Reference Input 4 Reference Input 5 Reference Input 6 INP Sample Input CMP MUX ANMUX Window and Filter control INM IRQ CMPO MSEL[2:0] Figure 33-1. CMP, DAC and ANMUX Blocks Diagram 33.6 CMP Block Diagram The following figure shows the block diagram for the Comparator module. K10 Sub-Family Reference Manual, Rev.
Chapter 33 Comparator (CMP) INTERNAL BUS FILT_PER EN,PMODE,HYSCTRL[1:0] COS INV OPE WE FILTER_CNT SE COUT IER/F CFR/F INP + - CMPO Polarity Select Window Control Interrupt Control Filter Block INM IRQ COUT (TO OTHER SOC FUNCTIONS)) WINDOW/SAMPLE bus clock Clock Prescaler FILT_PER 1 0 0 divided bus clock COUTA CGMUX SE 1 CMPO to PAD COS Figure 33-2.
Memory Map/Register Definitions • If enabled, the Filter Block will incur up to 1 bus clock additional latency penalty on COUT due to the fact that COUT (which is crossing clock domain boundaries) must be resynchronized to the bus clock. • CR1[WE] and CR1[SE] are mutually exclusive. 33.7 Memory Map/Register Definitions CMP memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4007_3000 CMP Control Register 0 (CMP0_CR0) 8 R/W 00h 33.7.
Chapter 33 Comparator (CMP) CMP memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4007_3012 CMP Filter Period Register (CMP2_FPR) 8 R/W 00h 33.7.3/ 811 4007_3013 CMP Status and Control Register (CMP2_SCR) 8 R/W 00h 33.7.4/ 812 4007_3014 DAC Control Register (CMP2_DACCR) 8 R/W 00h 33.7.5/ 813 4007_3015 MUX Control Register (CMP2_MUXCR) 8 R/W 00h 33.7.6/ 814 1 0 33.7.
Memory Map/Register Definitions CMPx_CR0 field descriptions (continued) Field Description 2 Reserved This read-only field is reserved and always has the value zero. 1–0 HYSTCTR Comparator hard block hysteresis control Defines the programmable hysteresis level. The hysteresis values associated with each level is devicespecific. See the device's data sheet for the exact values. 00 01 10 11 Level 0 Level 1 Level 2 Level 3 33.7.
Chapter 33 Comparator (CMP) CMPx_CR1 field descriptions (continued) Field Description Refer to the device data sheet's CMP electrical specifications table for details on the impact of the modes below. 0 1 3 INV Low Speed (LS) comparison mode selected. In this mode, CMP has slower output propagation delay and lower current consumption. High Speed (HS) comparison mode selected. In this mode, CMP has faster output propagation delay and higher current consumption.
Memory Map/Register Definitions CMPx_FPR field descriptions Field 7–0 FILT_PER Description Filter Sample Period When CR1[SE] is equal to zero, this field specifies the sampling period, in bus clock cycles, of the comparator output filter. Setting FILT_PER to 0x0 disables the filter. Filter programming and latency details appear in the Functional Description. This field has no effect when CR1[SE] is equal to one. In that case, the external SAMPLE signal is used to determine the sampling period. 33.7.
Chapter 33 Comparator (CMP) CMPx_SCR field descriptions (continued) Field Description 0 1 3 IEF Interrupt disabled. Interrupt enabled. Comparator Interrupt Enable Falling The IEF bit enables the CFF interrupt from the CMP. When this bit is set, an interrupt will be asserted when the CFF bit is set. 0 1 2 CFR Interrupt disabled. Interrupt enabled. Analog Comparator Flag Rising During normal operation, the CFR bit is set when a rising edge on COUT has been detected.
Memory Map/Register Definitions CMPx_DACCR field descriptions Field 7 DACEN Description DAC Enable This bit is used to enable the DAC. When the DAC is disabled, it is powered down to conserve power. 0 1 6 VRSEL 5–0 VOSEL DAC is disabled. DAC is enabled. Supply Voltage Reference Source Select 0 1 Vin1 is selected as resistor ladder network supply reference Vin. Vin2 is selected as resistor ladder network supply reference Vin.
Chapter 33 Comparator (CMP) CMPx_MUXCR field descriptions (continued) Field 5–3 PSEL Description Plus Input MUX Control Determines which input is selected for the plus input of the comparator. For INx inputs, refer to CMP, DAC and ANMUX Blocks Diagram. NOTE: When an inappropriate operation selects the same input for both MUXes, the comparator automatically shuts down to prevent itself from becoming a noise generator.
CMP Functional Description 33.8.1 CMP Functional Modes There are three main sub-blocks to the comparator module: the comparator itself, the window function and the filter function. The filter, CR0[FILTER_CNT] can be clocked from an internally or external clock source. Additionally, the filter is programmable with respect to how many samples must agree before a change on the output is registered. In the simplest case, only 1 sample must agree. In this case, the filter acts as a simple sampler.
Chapter 33 Comparator (CMP) Table 33-29. Comparator Sample/Filter Controls (continued) Mode # CR1[EN] CR1[WE] CR1[SE] CR0[FILTER_C NT] FPR[FILT_PER] Operation 6 1 1 0 0x01 0x01 - 0xFF Windowed/Resampled mode Comparator output is sampled on every rising bus clock edge when SAMPLE=1 to generate COUTA, which is then resampled on an interval determined by FILT_PER to generate COUT. Refer to the Windowed/Resampled Mode (# 6).
CMP Functional Description 33.8.1.2 Continuous Mode (#s 2A & 2B) INTERNAL BUS EN,PMODE,HYSTCTR[1:0] FILT_PER INV COS OPE WE FILTER_CNT SE COUT IER/F CFR/F 0 INP + - CMPO Polarity Select Window Control Interrupt Control Filter Block INM IRQ COUT (TO OTHER SOC FUNCTIONS)) WINDOW/SAMPLE bus clock FILT_PER Clock Prescaler 1 0 0 divided bus clock COUTA CGMUX SE 1 CMPO to PAD COS Figure 33-27.
Chapter 33 Comparator (CMP) 33.8.1.3 Sampled, Non-Filtered Mode (#s 3A & 3B) INTERNAL BUS EN,PMODE,HYSTCTR[1:0] FILT_PER INV COS OPE WE FILTER_CNT SE COUT 0x01 0 IER/F CFR/F 1 INP + - CMPO Polarity Select Window Control Interrupt Control Filter Block INM IRQ COUT (TO OTHER SOC FUNCTIONS) WINDOW/SAMPLE bus clock FILT_PER Clock Prescaler 1 0 0 divided bus clock COUTA CGMUX SE=1 1 CMPO to PAD COS Figure 33-28.
CMP Functional Description INTERNAL BUS EN,PMODE,HYSTCTR[1:0] FILT_PER INV COS OPE WE FILTER_CNT SE COUT 0 IER/F CFR/F 0 0x01 INP + - CMPO Polarity Select Window Control Interrupt Control Filter Block INM IRQ COUT (TO OTHER SOC FUNCTIONS)) WINDOW/SAMPLE bus clock FILT_PER Clock Prescaler 1 0 0 divided bus clock COUTA CGMUX SE=0 1 CMPO to PAD COS Figure 33-29. Sampled, Non-Filtered (# 3B): Sampling interval internally derived 33.8.1.
Chapter 33 Comparator (CMP) INTERNAL BUS EN, PMODE, HYSTCTR[1:0] FILT_PER INV COS OPE WE FILTER_CNT SE COUT > 0x01 0 INP + - CMPO Polarity Select Window Control IER/F CFR/F 1 Interrupt Control Filter Block INM IRQ COUT (TO OTHER SOC FUNCTIONS) WINDOW/SAMPLE bus clock FILT_PER Clock Prescaler 1 0 0 divided bus clock COUTA CGMUX SE=1 1 CMPO to PAD COS Figure 33-30. Sampled, Filtered (# 4A): Sampling point externally driven K10 Sub-Family Reference Manual, Rev.
CMP Functional Description INTERNAL BUS OPE FILT_PER EN, PMODE,HYSTCTR[1:0] COS INV WE FILTER_CNT SE COUT IER/F CFR/F >0x01 0 1 INP + - CMPO Polarity Select Window Control Interrupt Control Filter Block INM IRQ COUT (TO OTHER SOC FUNCTIONS)) WINDOW/SAMPLE bus clock FILT_PER Clock Prescaler 1 0 0 divided bus clock COUTA CGMUX SE=0 1 CMPO to PAD COS Figure 33-31.
Chapter 33 Comparator (CMP) WI NDOW Plus input Minus input CMPO COUTA Figure 33-32. Windowed Mode Operation INTERNAL BUS EN, PMODE,HYSCTR[1:0] FILT_PER INV COS OPE WE FILTER_CNT SE COUT 0x01 IER/F CFR/F 0 INP + - CMPO Polarity Select Window Control Interrupt Control Filter Block IRQ INM COUT (TO OTHER SOC FUNCTIONS)) WINDOW/SAMPLE bus clock FILT_PER Clock Prescaler 1 0 0 divided bus clock COUTA CGMUX SE=0 1 CMPO to PAD COS Figure 33-33.
CMP Functional Description When any windowed mode is active, COUTA is clocked by the bus clock whenever WINDOW = 1. The last latched value is held when WINDOW = 0. 33.8.1.6 Windowed/Resampled Mode (# 6) The following figure uses the same input stimulus shown in Figure 33-32, and adds resampling of COUTA to generate COUT. Samples are taken at the time points indicated by the arrows. Again, prop delays and latency is ignored for clarity's sake.
Chapter 33 Comparator (CMP) 33.8.1.7 Windowed/Filtered Mode (#7) This is the most complex mode of operation for the comparator block, as it utilizes both windowing and filtering features. It also has the highest latency of any of the modes. This can be approximated: up to 1 bus clock synchronization in the window function + ((CR0[FILTER_CNT] X FPR[FILT_PER]) + 1) X bus clock for the filter function. When any windowed mode is active, COUTA is clocked by the bus clock whenever WINDOW = 1.
CMP Functional Description 33.8.2.2 Stop Mode Operation Subject to platform-specific clock restrictions, the MCU is brought out of stop when a compare event occurs and the corresponding interrupt is enabled. Similarly, if CR1[OPE] is enabled, the comparator output operates as in the normal operating mode and comparator output is placed onto the external pin.
Chapter 33 Comparator (CMP) 33.8.4 Low Pass Filter The low-pass filter operates on the unfiltered and unsynchronized and optionally inverted comparator output COUTA and generates the filtered and synchronized output COUT. Both COUTA and COUT can be configured as module outputs and are used for different purposes within the system. Synchronization and edge detection are always used to determine status register bit values. They also apply to COUT for all sampling and windowed modes.
CMP Functional Description If CR1[SE]=1, the filter takes samples of COUTA on each positive transition of the sample input. The output state of the filter changes when CR0[FILTER_CNT] consecutive samples all agree that the output value has changed. 33.8.4.2 Latency Issues The FPR[FILT_PER] value (or SAMPLE period) should be set such that the sampling period is just larger than the period of the expected noise. This way a noise spike will only corrupt one sample.
Chapter 33 Comparator (CMP) Table 33-30. Comparator Sample/Filter Maximum Latencies (continued) Mode # CR1[ EN] CR1[ WE] CR1[ SE] CR0[FILTER _CNT] FPR[FILT_P ER] Operation Maximum Latency1 7 1 1 0 > 0x01 0x01 - 0xFF Windowed / Filtered mode TPD + (CR0[FILTER_CNT] x FPR[FILT_PER] x Tper) + 2Tper 1. TPD represents the intrinsic delay of the analog component plus the polarity select logic. TSAMPLE is the clock period of the external sample clock. Tper is the period of the bus clock. 33.
DAC Functional Description Vin1 Vin2 MUX VRSEL VOSEL[5:0] DACEN Vin MUX DACO Figure 33-36. 6-bit DAC Block Diagram 33.12 DAC Functional Description This section provides DAC functional description. 33.12.1 Voltage Reference Source Select • Vin1 should be used to connect to the primary voltage source as supply reference of 64 tap resistor ladder • Vin2 should be used to connect to alternate voltage source (or primary source if alternate voltage source is not available) 33.
Chapter 33 Comparator (CMP) 33.15 DAC Interrupts This module has no interrupts. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
DAC Interrupts K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 832 Freescale Semiconductor, Inc.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) 34.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The 12-bit digital-to-analog converter (DAC) is a low power general purpose DAC. The output of this DAC can be placed on an external pin or set as one of the inputs to the analog comparator, Op-Amps, ADC, or other peripherals. 34.
Memory Map/Register Definition DACREF_1 DACREF_2 DACRFS MUX AMP Buffer Vin DACEN MUX 4096-level VDD - LPEN Vo Vout + DACDAT[11:0] 12 Hardware Trigger DACBFWMF DACBWIEN DACSWTRG DACBFWM DACBFEN DACBFUP DACBFRP DATA BUFFER & DACBFRPTF DACBTIEN & OR dac_interrupt DACBFRPBF DACBBIEN & DACBFMD DACTRGSE Figure 34-1. DAC Block Diagram 34.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) DAC memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400C_C000 DAC Data Low Register (DAC0_DAT0L) 8 R/W 00h 34.4.1/ 838 400C_C001 DAC Data High Register (DAC0_DAT0H) 8 R/W 00h 34.4.2/ 839 400C_C002 DAC Data Low Register (DAC0_DAT1L) 8 R/W 00h 34.4.1/ 838 400C_C003 DAC Data High Register (DAC0_DAT1H) 8 R/W 00h 34.4.
Memory Map/Register Definition DAC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400C_C014 DAC Data Low Register (DAC0_DAT10L) 8 R/W 00h 34.4.1/ 838 400C_C015 DAC Data High Register (DAC0_DAT10H) 8 R/W 00h 34.4.2/ 839 400C_C016 DAC Data Low Register (DAC0_DAT11L) 8 R/W 00h 34.4.1/ 838 400C_C017 DAC Data High Register (DAC0_DAT11H) 8 R/W 00h 34.4.2/ 839 400C_C018 DAC Data Low Register (DAC0_DAT12L) 8 R/W 00h 34.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) DAC memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400C_D004 DAC Data Low Register (DAC1_DAT2L) 8 R/W 00h 34.4.1/ 838 400C_D005 DAC Data High Register (DAC1_DAT2H) 8 R/W 00h 34.4.2/ 839 400C_D006 DAC Data Low Register (DAC1_DAT3L) 8 R/W 00h 34.4.1/ 838 400C_D007 DAC Data High Register (DAC1_DAT3H) 8 R/W 00h 34.4.
Memory Map/Register Definition DAC memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 400C_D018 DAC Data Low Register (DAC1_DAT12L) 8 R/W 00h 34.4.1/ 838 400C_D019 DAC Data High Register (DAC1_DAT12H) 8 R/W 00h 34.4.2/ 839 400C_D01A DAC Data Low Register (DAC1_DAT13L) 8 R/W 00h 34.4.1/ 838 400C_D01B DAC Data High Register (DAC1_DAT13H) 8 R/W 00h 34.4.2/ 839 400C_D01C DAC Data Low Register (DAC1_DAT14L) 8 R/W 00h 34.4.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) 34.4.2 DAC Data High Register (DACx_DATH) Addresses: 400C_C000h base + 1h offset + (2d × n), where n = 0d to 15d Bit 7 6 Read 5 4 3 2 0 0 0 0 0 DATA[11:8] Write Reset 1 0 0 0 0 0 DACx_DATnH field descriptions Field 7–4 Reserved 3–0 DATA[11:8] Description This read-only field is reserved and always has the value zero. When the DAC Buffer is not enabled, DATA[11:0] controls the output voltage based on the following formula.
Memory Map/Register Definition DACx_SR field descriptions (continued) Field Description 0 1 0 DACBFRPBF The DAC buffer read pointer is not zero. The DAC buffer read pointer is zero. DAC buffer read pointer bottom position flag 0 1 The DAC buffer read pointer is not equal to the DACBFUP. The DAC buffer read pointer is equal to the DACBFUP. 34.4.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) DACx_C0 field descriptions (continued) Field Description 0 1 high power mode. low power mode. 2 DACBWIEN DAC buffer watermark interrupt enable 1 DACBTIEN DAC buffer read pointer top flag interrupt enable 0 DACBBIEN DAC buffer read pointer bottom flag interrupt enable 0 1 0 1 0 1 The DAC buffer watermark interrupt is disabled. The DAC buffer watermark interrupt is enabled. The DAC buffer read pointer top flag interrupt is disabled.
Functional Description DACx_C1 field descriptions (continued) Field Description 2–1 DACBFMD DAC buffer work mode select 0 DACBFEN DAC buffer enable 00 01 10 11 0 1 Normal Mode Swing Mode One-Time Scan Mode Reserved Buffer read pointer disabled. The converted data is always the first word of the buffer. Buffer read pointer enabled. The converted data is the word that the read pointer points to. It means converted data can be from any word of the buffer. 34.4.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) 34.5.1 DAC Data Buffer Operation When the DAC is enabled and the buffer is not enabled, the DAC module always converts the data in DAT0 to analog output voltage. When both the DAC and the buffer are enabled, the DAC converts the data in the data buffer to analog output voltage. The data buffer read pointer advances to the next word in the event the hardware trigger or the software trigger occurs.
Functional Description 34.5.1.4 Buffer One-time Scan Mode The read pointer increases by one every time when the trigger occurs. When it reaches the upper limit, it stops at there. If read pointer is reset to the address other than the upper limit, it will increase to the upper address and stop at there again. Note If the software set the read pointer to the upper limit, the read pointer will not advance in this mode. 34.5.2 DMA Operation When DMA is enabled, interrupt requests are not generated.
Chapter 34 12-bit Digital-to-Analog Converter (DAC) NOTE The assignment of module modes to core modes is chipspecific. For module-to-core mode assignments, see the chapter that describes how modules are configured. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Functional Description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 846 Freescale Semiconductor, Inc.
Chapter 35 Voltage Reference (VREFV1) 35.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The VREFV1 Voltage Reference is intended to supply an accurate voltage output that can be trimmed in 0.5 mV steps. The VREFV1 can be used in applications to provide a reference voltage to external devices or used internally as a reference to analog peripherals such as the ADC, DAC, or CMP.
Introduction 1.75 V Regulator SC[VREFST] 1.75 V 6 BITS TRM DEDICATED OUTPUT PIN BANDGAP VDDA SC[VREFEN] SC[MODE_LV] VREF_OUT 2 BITS 100nF REGULATION BUFFER VSSA Figure 35-1. Voltage reference block diagram 35.1.1 Overview The Voltage Reference provides a buffered reference voltage with high output current for use as an external reference. In addition, the buffered reference is available internally for use with on chip peripherals such as ADCs and DACs.
Chapter 35 Voltage Reference (VREFV1) • Bandgap enabled/standby (output buffer disabled) • Tight-regulation buffer mode (output buffer enabled) • 1.2 V output at room temperature • Dedicated output pin, VREF_OUT • Load regulation in tight-regulation mode 35.1.3 Modes of Operation The Voltage Reference continues normal operation in Run, Wait, and Stop modes. The Voltage Reference can also run in Very Low Power Run (VLPR), Very Low Power Wait (VLPW) and Very Low Power Stop (VLPS).
Memory Map and Register Definition VREF memory map Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4007_4000 VREF Trim Register (VREF_TRM) 8 R/W Undefined 35.2.1/ 850 4007_4001 VREF Status and Control Register (VREF_SC) 8 R/W 00h 35.2.2/ 851 35.2.1 VREF Trim Register (VREF_TRM) This register contains bits that contain the trim data for the Voltage Reference.
Chapter 35 Voltage Reference (VREFV1) 35.2.2 VREF Status and Control Register (VREF_SC) This register contains the control bits used to enable the internal voltage reference and to select the VREF mode to be used.
Functional Description VREF_SC field descriptions (continued) Field Description 10 11 Tight-regulation buffer enabled Reserved 35.3 Functional Description The Voltage Reference is a bandgap buffer system. Unity gain amplifiers are used. The VREF_OUT signal is available as an internal reference when it is enabled. A 100 nF capacitor must be connected between VREF_OUT and VSSA. The following table shows all possible function configurations of the Voltage Reference. Table 35-5.
Chapter 35 Voltage Reference (VREFV1) 35.3.2.1 SC[MODE_LV]=00 The internal bandgap is enabled to generate an accurate 1.2 V output that can be trimmed with the TRM register's TRIM[5:0] bitfield. The bandgap requires some time for startup and stabilization. SC[VREFST] can be monitored to determine if the stabilization and startup is complete. The output buffer is disabled in this mode, and there is no buffered voltage output. The Voltage Reference is in standby mode.
Initialization/Application Information When the Voltage Reference is already enabled and stabilized, changing SC[MODE_LV] will not clear SC[VREFST] but there will be some startup time before the output voltage at the VREF_OUT pin has settled. This is the buffer start up delay (Tstup) and the value is specified in the appropriate device data sheet. Also, there will be some settling time when a step change of the load current is applied to the VREF_OUT pin. When the 1.
Chapter 36 Programmable Delay Block (PDB) 36.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The programmable delay block (PDB) provides controllable delays from either an internal or an external trigger, or a programmable interval tick, to the hardware trigger inputs of ADCs and/or generates the interval triggers to DACs, so that the precise timing between ADC conversions and/or DAC updates can be achieved.
Introduction • Optional back-to-back mode operation, which enables the ADC conversions complete to trigger the next PDB channel • One programmable delay interrupt • One sequence error interrupt • One channel flag and one sequence error flag per pre-trigger • DMA support • Up to eight DAC interval triggers • One interval trigger output per DAC • One 16-bit delay interval register per DAC trigger output • Optional bypass the delay interval trigger registers • Optional external triggers • Up to eight pulse ou
Chapter 36 Programmable Delay Block (PDB) • Y — Total number of Pulse-Out's. • y — Pulse-Out number, valid value is 0 to Y-1. NOTE The number of module output triggers to core are chip-specific. For module to core output triggers implementation, refer to the Chip Configuration information. 36.1.3 Back-to-back Acknowledgement Connections PDB back-to-back operation acknowledgment connections are chip-specific. For implementation, refer to the Chip Configuration information. 36.1.
Introduction Ack 0 PDBCHnDLY0 = Pre-trigger 0 BB[0], TOS[0] Ch n pre-trigger 0 EN[0] Ack m PDBCHnDLYm = Pre-trigger m BB[m], TOS[m] Ch n pre-trigger m EN[m] Sequence Error Detection ERR[M - 1:0] Ch n trigger PDBMOD PDBCNT = PDB Counter Control Logic DACINTx CONT DAC interval trigger x = DAC Interval Counter x TOEx MULT EXTx DAC ext trigger input x PRESCALER DAC interval trigger x Trigger-In 0 Trigger-In 1 POyDLY1 Trigger-In 14 = SWTRIG POyDLY2 TRIGSEL Pulse Generation = P
Chapter 36 Programmable Delay Block (PDB) 36.1.6 Modes of Operation PDB ADC trigger operates in the following modes. Disabled: Counter is off, all pre-trigger and trigger outputs are low if PDB is not in backto-back operation of Bypass mode. Debug: Counter is paused when processor is in debug mode, the counter for dac trigger also paused in Debug mode.
Memory Map and Register Definition PDB memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_6000 Status and Control Register (PDB0_SC) 32 R/W 0000_0000h 36.3.1/ 861 4003_6004 Modulus Register (PDB0_MOD) 32 R/W 0000_FFFFh 36.3.2/ 863 4003_6008 Counter Register (PDB0_CNT) 32 R 0000_0000h 36.3.3/ 864 4003_600C Interrupt Delay Register (PDB0_IDLY) 32 R/W 0000_FFFFh 36.3.
Chapter 36 Programmable Delay Block (PDB) 36.3.
Memory Map and Register Definition PDBx_SC field descriptions (continued) Field 15 DMAEN Description DMA Enable When DMA is enabled, the PDBIF flag generates a DMA request instead of an interrupt. 0 1 14–12 PRESCALER DMA disabled DMA enabled Prescaler Divider Select 000 001 010 Counting uses the peripheral clock divided by multiplication factor selected by MULT. Counting uses the peripheral clock divided by twice of the multiplication factor selected by MULT.
Chapter 36 Programmable Delay Block (PDB) PDBx_SC field descriptions (continued) Field Description This bit is set when the counter value is equal to the IDLY register. Writing zero clears this bit. 5 PDBIE PDB Interrupt Enable. This bit enables the PDB interrupt. When this bit is set and DMAEN is cleared, PDBIF generates a PDB interrupt. 0 1 4 Reserved PDB interrupt disabled PDB interrupt enabled This read-only field is reserved and always has the value zero.
Memory Map and Register Definition PDBx_MOD field descriptions Field Description 31–16 Reserved This read-only field is reserved and always has the value zero. 15–0 MOD PDB Modulus. These bits specify the period of the counter. When the counter reaches this value, it will be reset back to zero. If the PDB is in Continuous mode, the count begins anew. Reading these bits returns the value of internal register that is effective for the current cycle of PDB. 36.3.
Chapter 36 Programmable Delay Block (PDB) PDBx_IDLY field descriptions (continued) Field Description These bits specify the delay value to schedule the PDB interrupt. It can be used to schedule an independent interrupt at some point in the PDB cycle. If enabled, a PDB interrupt is generated, when the counter is equal to the IDLY. Reading these bits returns the value of internal register that is effective for the current cycle of the PDB. 36.3.
Memory Map and Register Definition PDBx_CHnC1 field descriptions (continued) Field Description These bits enable the PDB ADC pre-trigger outputs. Only lower M pre-trigger bits are implemented in this MCU. 0 1 PDB channel's corresponding pre-trigger disabled. PDB channel's corresponding pre-trigger enabled. 36.3.
Chapter 36 Programmable Delay Block (PDB) 36.3.
Memory Map and Register Definition 36.3.
Chapter 36 Programmable Delay Block (PDB) PDBx_DACINTn field descriptions (continued) Field Description 15–0 INT DAC Interval These bits specify the interval value for DAC interval trigger. DAC interval trigger triggers DAC[1:0] update when the DAC interval counter is equal to the DACINT. Reading these bits returns the value of internal register that is effective for the current PDB cycle. 36.3.
Functional Description PDBx_POnDLY field descriptions (continued) Field Description These bits specify the delay 1 value for the PDB Pulse-Out. Pulse-Out goes high when the PDB counter is equal to the DLY1. Reading these bits returns the value of internal register that is effective for the current PDB cycle. 15–0 DLY2 PDB Pulse-Out Delay 2 These bits specify the delay 2 value for the PDB Pulse-Out. Pulse-Out goes low when the PDB counter is equal to the DLY2.
Chapter 36 Programmable Delay Block (PDB) Trigger input event Ch n pre-trigger 0 Ch n pre-trigger 1 ... ... ... ... Ch n pre-trigger M Ch n trigger Figure 36-54. Pre-trigger and Trigger Outputs The delay in CHnDLYm register can be optionally bypassed, if CHnC1[TOS[m]] is cleared. In this case, when the trigger input event occurs, the pre-trigger m is asserted after two peripheral clock cycles. The PDB can be configured in back-to-back (B2B) operation.
Functional Description 36.4.2 PDB Trigger Input Source Selection The PDB has up to 15 trigger input sources, namely Trigger-In 0 to 14. They are connected to on-chip or off-chip event sources. The PDB can be triggered by software through the SC[SWTRIG]. SC[TRIGSEL] bits select the active trigger input source or software trigger. For the trigger input sources implemented in this MCU, refer to Chip Configuration information. 36.4.
Chapter 36 Programmable Delay Block (PDB) MOD, IDLY CHnDLY1 CHnDLY0 DACINTx x3 DACINTx x2 PDB counter DACINTx 0 Trigger input event ... ... DAC internal trigger x ... ... Ch n pre-trigger 0 Ch n pre-trigger 1 Ch n trigger PDB interrupt Figure 36-55. PDB ADC Triggers and DAC Interval Triggers Use Case NOTE Because the DAC interval counters share the prescaler with PDB counter, PDB must be enabled if the DAC interval trigger outputs are used in the applications. 36.4.
Functional Description • PDB Modulus Register (MOD) • PDB Interrupt Delay Register (IDLY) • PDB Channel n Delay m Register (CHnDLYm) • DAC Interval x Register (DACINTx) • PDB Pulse-Out y Delay Register (POyDLY) The internal registers of them are buffered and any values written to them are written first to their buffers. The circumstances that cause their internal registers to be updated with the values from the buffers are summarized as below table. Table 36-56.
Chapter 36 Programmable Delay Block (PDB) CHnDLY1 CHnDLY0 PDB Counter SC[LDOK] Ch n pre-trigger 0 Ch n pre-trigger 1 Figure 36-57. Registers Update with SC[LDMOD] = x1 36.4.6 Interrupts PDB can generate two interrupts, PDB interrupt and PDB sequence error interrupt. The following table summarizes the interrupts. Table 36-57. PDB Interrupt Summary Interrupt Flags Enable Bit PDB Interrupt SC[PDBIF] SC[PDBIE] = 1 and SC[DMAEN] = 0 PDB Sequence Error Interrupt CHnS[ERRm] SC[PDBEIE] = 1 36.4.
Application Information values of total peripheral clocks that can be detected are even values; if prescaler is set to 4 then the only values of total peripheral clocks that can be decoded as detected are mod(4) and so forth. If the applications need a really long delay value and use 128, then the resolution would be limited to 128 peripheral clock cycles. Therefore, use the lowest possible prescaler and multiplication factor for a given application. K10 Sub-Family Reference Manual, Rev.
Chapter 37 FlexTimer (FTM) 37.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The FlexTimer Module (FTM) is a two to eight channel timer which supports input capture, output compare, and the generation of PWM signals to control electric motor and power management applications. The FTM time reference is a 16-bit counter that can be used as an unsigned or signed counter. 37.1.
Introduction FlexTimer input triggers can be from comparators, ADC or other sub modules to initiate timer functions automatically. These triggers can be linked in a variety of ways during integration of the sub modules so please note carefully the options available for used FlexTimer configuration.
Chapter 37 FlexTimer (FTM) • Each pair of channels can be combined to generate a PWM signal (with independent control of both edges of PWM signal) • The FTM channels can operate as pairs with equal outputs, pairs with complementary outputs, or independent channels (with independent outputs) • The deadtime insertion is available for each complementary pair • Generation of triggers (match trigger) • Software control of PWM outputs • Up to 4 fault inputs for global fault control • The polarity of each channel
Introduction 37.1.4 Block Diagram The FTM uses one input/output (I/O) pin per channel, CHn (FTM channel (n)) where n is the channel number (0–7). The following figure shows the FTM structure. The central component of the FTM is the 16-bit counter with programmable initial and final values and its counting can be up or up-down. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 880 Freescale Semiconductor, Inc.
Chapter 37 FlexTimer (FTM) CLKS FTMEN QUADEN no clock selected (FTM counter disable) system clock fixed frequency clock external clock phase A phase B PS prescaler 3(1, 2, 4, 8, 16, 32, 64 or 128) synchronizer Quadrature decoder QUADEN CPWMS CAPTEST INITTRIGEN CNTIN FAULTM[1:0] FFVAL[3:0] FAULTIE FAULTnEN* FFLTRnEN* FTM counter FAULTIN FAULTF FAULTFn* fault control fault input n* CH0IE CH0F input capture mode logic C0V input capture mode logic C1V DECAPEN COMBINE0 CPWMS MS1B:MS1A ELS1B:ELS1A
FTM Signal Descriptions 37.2 FTM Signal Descriptions Table 37-1 shows the user-accessible signals for the FTM. Table 37-1. FTM Signal Descriptions Signal EXTCLK CHn FAULTj Description I/O External clock. FTM external clock can be selected to drive the FTM counter. I FTM channel (n), where n can be 7-0 I/O Fault input (j), where j can be 3-0 I PHA Quadrature decoder phase A input. Input pin associated with quadrature decoder phase A. I PHB Quadrature decoder phase B input.
Chapter 37 FlexTimer (FTM) defined for each pair of channels. Since there are several FAULTj inputs, maximum of 4 for the FTM module, each one of these inputs is activated by the FAULTjEN bit in the FLTCTRL register. 37.2.4 PHA — FTM Quadrature Decoder Phase A Input The quadrature decoder phase A input is used as the quadrature decoder mode is selected.
Memory Map and Register Definition 37.3.2 Register Descriptions This section consists of register descriptions in address order. Accesses to reserved addresses result in transfer errors. Registers for absent channels are considered reserved. FTM memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_8000 Status and Control (FTM0_SC) 32 R/W 0000_0000h 37.3.3/ 890 4003_8004 Counter (FTM0_CNT) 32 R/W 0000_0000h 37.3.
Chapter 37 FlexTimer (FTM) FTM memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_8040 Channel (n) Value (FTM0_C6V) 32 R/W 0000_0000h 37.3.7/ 896 4003_8044 Channel (n) Status and Control (FTM0_C7SC) 32 R/W 0000_0000h 37.3.6/ 893 4003_8048 Channel (n) Value (FTM0_C7V) 32 R/W 0000_0000h 37.3.7/ 896 4003_804C Counter Initial Value (FTM0_CNTIN) 32 R/W 0000_0000h 37.3.
Memory Map and Register Definition FTM memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_8090 FTM Inverting Control (FTM0_INVCTRL) 32 R/W 0000_0000h 37.3.25/ 930 4003_8094 FTM Software Output Control (FTM0_SWOCTRL) 32 R/W 0000_0000h 37.3.26/ 931 4003_8098 FTM PWM Load (FTM0_PWMLOAD) 32 R/W 0000_0000h 37.3.27/ 933 4003_9000 Status and Control (FTM1_SC) 32 R/W 0000_0000h 37.3.
Chapter 37 FlexTimer (FTM) FTM memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_9044 Channel (n) Status and Control (FTM1_C7SC) 32 R/W 0000_0000h 37.3.6/ 893 4003_9048 Channel (n) Value (FTM1_C7V) 32 R/W 0000_0000h 37.3.7/ 896 4003_904C Counter Initial Value (FTM1_CNTIN) 32 R/W 0000_0000h 37.3.8/ 897 4003_9050 Capture and Compare Status (FTM1_STATUS) 32 R/W 0000_0000h 37.3.
Memory Map and Register Definition FTM memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4003_9094 FTM Software Output Control (FTM1_SWOCTRL) 32 R/W 0000_0000h 37.3.26/ 931 4003_9098 FTM PWM Load (FTM1_PWMLOAD) 32 R/W 0000_0000h 37.3.27/ 933 400B_8000 Status and Control (FTM2_SC) 32 R/W 0000_0000h 37.3.3/ 890 400B_8004 Counter (FTM2_CNT) 32 R/W 0000_0000h 37.3.
Chapter 37 FlexTimer (FTM) FTM memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400B_8048 Channel (n) Value (FTM2_C7V) 32 R/W 0000_0000h 37.3.7/ 896 400B_804C Counter Initial Value (FTM2_CNTIN) 32 R/W 0000_0000h 37.3.8/ 897 400B_8050 Capture and Compare Status (FTM2_STATUS) 32 R/W 0000_0000h 37.3.9/ 897 400B_8054 Features Mode Selection (FTM2_MODE) 32 R/W 0000_0004h 37.3.
Memory Map and Register Definition FTM memory map (continued) Absolute address (hex) 400B_8098 Width Access (in bits) Register name FTM PWM Load (FTM2_PWMLOAD) 32 R/W Reset value Section/ page 0000_0000h 37.3.27/ 933 37.3.3 Status and Control (FTMx_SC) SC contains the overflow status flag and control bits used to configure the interrupt enable, FTM configuration, clock source, and prescaler factor. These controls relate to all channels within this module.
Chapter 37 FlexTimer (FTM) FTMx_SC field descriptions (continued) Field Description 0 1 5 CPWMS Disable TOF interrupts. Use software polling. Enable TOF interrupts. An interrupt is generated when TOF equals one. Center-aligned PWM Select Selects CPWM mode. This mode configures the FTM to operate in up-down counting mode. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 4–3 CLKS FTM counter operates in up counting mode. FTM counter operates in up-down counting mode.
Memory Map and Register Definition Addresses: FTM0_CNT is 4003_8000h base + 4h offset = 4003_8004h FTM1_CNT is 4003_9000h base + 4h offset = 4003_9004h FTM2_CNT is 400B_8000h base + 4h offset = 400B_8004h Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 0 R 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 COUNT W Reset 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 FTMx_CNT field descriptions Field Description 31–16 Reserved Th
Chapter 37 FlexTimer (FTM) FTMx_MOD field descriptions (continued) Field 15–0 MOD Description Modulo value 37.3.6 Channel (n) Status and Control (FTMx_CSC) CnSC contains the channel-interrupt-status flag and control bits used to configure the interrupt enable, channel configuration, and pin function. Table 37-67. Mode, Edge, and Level Selection DECAPEN COMBINE CPWMS MSnB:MSnA ELSnB:ELSnA Mode Configuration X X X XX 0 None Pin not used for FTM Table continues on the next page...
Memory Map and Register Definition Table 37-67. Mode, Edge, and Level Selection (continued) DECAPEN COMBINE CPWMS MSnB:MSnA ELSnB:ELSnA Mode Configuration 0 0 0 0 1 Input capture Capture on Rising Edge Only 1 1X 10 Capture on Falling Edge Only 11 Capture on Rising or Falling Edge 1 Output compare 10 Clear Output on match 11 Set Output on match 10 Edge-aligned PWM X1 1 XX 10 0 XX 10 Center-aligned PWM 0 0 X0 X1 See the following table (Table 37-8).
Chapter 37 FlexTimer (FTM) Table 37-68.
Memory Map and Register Definition FTMx_CnSC field descriptions (continued) Field Description This field is write protected. It can be written only when MODE[WPDIS] = 1. 4 MSA Channel Mode Select Used for further selections in the channel logic. Its functionality is dependent on the channel mode. See Table 37-7. This field is write protected. It can be written only when MODE[WPDIS] = 1. 3 ELSB Edge or Level Select The functionality of ELSB and ELSA depends on the channel mode. See Table 37-7.
Chapter 37 FlexTimer (FTM) FTMx_CnV field descriptions Field Description 31–16 Reserved This read-only field is reserved and always has the value zero. 15–0 VAL Channel Value Captured FTM counter value of the input modes or the match value for the output modes 37.3.8 Counter Initial Value (FTMx_CNTIN) The Counter Initial Value register contains the initial value for the FTM counter. Writing to the CNTIN register latches the value into a buffer.
Memory Map and Register Definition Each CHnF bit in STATUS is a mirror of CHnF bit in CnSC. All CHnF bits can be checked using only one read of STATUS. All CHnF bits can be cleared by reading STATUS followed by writing 0x00 to STATUS. Hardware sets the individual channel flags when an event occurs on the channel. CHF is cleared by reading STATUS while CHnF is set and then writing a 0 to the CHF bit. Writing a 1 to CHF has no effect.
Chapter 37 FlexTimer (FTM) FTMx_STATUS field descriptions (continued) Field Description 0 1 4 CH4F Channel 4 Flag See the register description. 0 1 3 CH3F See the register description. See the register description. No channel event has occurred. A channel event has occurred. Channel 1 Flag See the register description. 0 1 0 CH0F No channel event has occurred. A channel event has occurred. Channel 2 Flag 0 1 1 CH1F No channel event has occurred. A channel event has occurred.
Memory Map and Register Definition 37.3.10 Features Mode Selection (FTMx_MODE) This register contains the control bits used to configure the fault interrupt and fault control, capture test mode, PWM synchronization, write protection, channel output initialization, and enable the enhanced features of the FTM. These controls relate to all channels within this module.
Chapter 37 FlexTimer (FTM) FTMx_MODE field descriptions (continued) Field 4 CAPTEST Description Capture Test Mode Enable Enables the capture test mode. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 3 PWMSYNC PWM Synchronization Mode Selects which triggers can be used by MOD, CnV, OUTMASK, and FTM counter synchronization (PWM Synchronization). The PWMSYNC bit configures the synchronization when SYNCMODE is zero. 0 1 2 WPDIS No restrictions.
Memory Map and Register Definition NOTE The software trigger (SWSYNC bit) and hardware triggers (TRIG0, TRIG1, and TRIG2 bits) have a potential conflict if used together when SYNCMODE = 0. It is recommended using only hardware or software triggers but not both at the same time, otherwise unpredictable behavior is likely to happen. The selection of the loading point (CNTMAX and CNTMIN bits) is intended to provide the update of MOD, CNTIN, and CnV registers across all enabled channels simultaneously.
Chapter 37 FlexTimer (FTM) FTMx_SYNC field descriptions (continued) Field Description 0 1 6 TRIG2 PWM Synchronization Hardware Trigger 2 Enables hardware trigger 2 to the PWM synchronization. Hardware trigger 2 happens when a rising edge is detected at the trigger 2 input signal. 0 1 5 TRIG1 Enables hardware trigger 1 to the PWM synchronization. Hardware trigger 1 happens when a rising edge is detected at the trigger 1 input signal. Enables hardware trigger 0 to the PWM synchronization.
Memory Map and Register Definition FTMx_SYNC field descriptions (continued) Field Description 0 1 The minimum loading point is disabled. The minimum loading point is enabled. 37.3.
Chapter 37 FlexTimer (FTM) FTMx_OUTINIT field descriptions (continued) Field Description Selects the value that is forced into the channel output when the initialization occurs. 0 1 2 CH2OI The initialization value is 0. The initialization value is 1. Channel 2 Output Initialization Value Selects the value that is forced into the channel output when the initialization occurs. 0 1 1 CH1OI The initialization value is 0. The initialization value is 1.
Memory Map and Register Definition FTMx_OUTMASK field descriptions Field 31–8 Reserved 7 CH7OM Description This read-only field is reserved and always has the value zero. Channel 7 Output Mask Defines if the channel output is masked (forced to its inactive state) or unmasked (it continues to operate normally). 0 1 6 CH6OM Channel 6 Output Mask Defines if the channel output is masked (forced to its inactive state) or unmasked (it continues to operate normally).
Chapter 37 FlexTimer (FTM) FTMx_OUTMASK field descriptions (continued) Field Description 0 CH0OM Channel 0 Output Mask Defines if the channel output is masked (forced to its inactive state) or unmasked (it continues to operate normally). 0 1 Channel output is not masked. It continues to operate normally. Channel output is masked. It is forced to its inactive state. 37.3.
Memory Map and Register Definition FTMx_COMBINE field descriptions (continued) Field 29 SYNCEN3 Description Synchronization Enable for n = 6 Enables PWM synchronization of registers C(n)V and C(n+1)V. 0 1 28 DTEN3 The PWM synchronization in this pair of channels is disabled. The PWM synchronization in this pair of channels is enabled. Deadtime Enable for n = 6 Enables the deadtime insertion in the channels (n) and (n+1). This field is write protected. It can be written only when MODE[WPDIS] = 1.
Chapter 37 FlexTimer (FTM) FTMx_COMBINE field descriptions (continued) Field 23 Reserved 22 FAULTEN2 Description This read-only field is reserved and always has the value zero. Fault Control Enable for n = 4 Enables the fault control in channels (n) and (n+1). This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 21 SYNCEN2 Synchronization Enable for n = 4 Enables PWM synchronization of registers C(n)V and C(n+1)V.
Memory Map and Register Definition FTMx_COMBINE field descriptions (continued) Field Description 0 1 16 COMBINE2 The channel (n+1) output is the same as the channel (n) output. The channel (n+1) output is the complement of the channel (n) output. Combine Channels for n = 4 Enables the combine feature for channels (n) and (n+1). This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 15 Reserved 14 FAULTEN1 Channels (n) and (n+1) are independent.
Chapter 37 FlexTimer (FTM) FTMx_COMBINE field descriptions (continued) Field Description 0 1 9 COMP1 The dual edge capture mode in this pair of channels is disabled. The dual edge capture mode in this pair of channels is enabled. Complement of Channel (n) for n = 2 Enables complementary mode for the combined channels. In complementary mode the channel (n+1) output is the inverse of the channel (n) output. This field is write protected. It can be written only when MODE[WPDIS] = 1.
Memory Map and Register Definition FTMx_COMBINE field descriptions (continued) Field Description 2 DECAPEN0 Dual Edge Capture Mode Enable for n = 0 Enables the dual edge capture mode in the channels (n) and (n+1). This bit reconfigures the function of MSnA, ELSnB:ELSnA and ELS(n+1)B:ELS(n+1)A bits in dual edge capture mode according to Table 37-7. This field applies only when FTMEN = 1. This field is write protected. It can be written only when MODE[WPDIS] = 1.
Chapter 37 FlexTimer (FTM) FTMx_DEADTIME field descriptions (continued) Field 7–6 DTPS Description Deadtime Prescaler Value Selects the division factor of the system clock. This prescaled clock is used by the deadtime counter. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0x 10 11 5–0 DTVAL Divide the system clock by 1. Divide the system clock by 4. Divide the system clock by 16. Deadtime Value Selects the deadtime insertion value for the deadtime counter.
Memory Map and Register Definition Addresses: FTM0_EXTTRIG is 4003_8000h base + 6Ch offset = 4003_806Ch FTM1_EXTTRIG is 4003_9000h base + 6Ch offset = 4003_906Ch FTM2_EXTTRIG is 400B_8000h base + 6Ch offset = 400B_806Ch Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 R Reserved[bit 8] Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 TRIGF INITTRIGEN CH1TRIG CH0TRIG CH5TRIG CH4TRIG CH3TRIG CH2TRIG W 0 0 0 0 0
Chapter 37 FlexTimer (FTM) FTMx_EXTTRIG field descriptions (continued) Field Description Enable the generation of the channel trigger when the FTM counter is equal to the CnV register. 0 1 2 CH4TRIG The generation of the channel trigger is disabled. The generation of the channel trigger is enabled. Channel 4 Trigger Enable Enable the generation of the channel trigger when the FTM counter is equal to the CnV register. 0 1 1 CH3TRIG The generation of the channel trigger is disabled.
Memory Map and Register Definition FTMx_POL field descriptions Field 31–8 Reserved 7 POL7 Description This field is reserved. Channel 7 Polarity Defines the polarity of the channel output. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 6 POL6 The channel polarity is active high. The channel polarity is active low. Channel 6 Polarity Defines the polarity of the channel output. This field is write protected. It can be written only when MODE[WPDIS] = 1.
Chapter 37 FlexTimer (FTM) FTMx_POL field descriptions (continued) Field Description 0 1 0 POL0 The channel polarity is active high. The channel polarity is active low. Channel 0 Polarity Defines the polarity of the channel output. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 The channel polarity is active high. The channel polarity is active low. 37.3.
Memory Map and Register Definition FTMx_FMS field descriptions (continued) Field 7 FAULTF Description Fault Detection Flag Represents the logic OR of the individual FAULTFj bits (where j = 3, 2, 1, 0). Clear FAULTF by reading the FMS register while FAULTF is set and then writing a 0 to FAULTF while there is no existing fault condition at the enabled fault inputs. Writing a 1 to FAULTF has no effect.
Chapter 37 FlexTimer (FTM) FTMx_FMS field descriptions (continued) Field Description 0 1 1 FAULTF1 No fault condition was detected at the fault input. A fault condition was detected at the fault input. Fault Detection Flag 1 Set by hardware when fault control is enabled, the corresponding fault input is enabled and a fault condition is detected at the fault input.
Memory Map and Register Definition Addresses: FTM0_FILTER is 4003_8000h base + 78h offset = 4003_8078h FTM1_FILTER is 4003_9000h base + 78h offset = 4003_9078h FTM2_FILTER is 400B_8000h base + 78h offset = 400B_8078h Bit 31 30 29 28 27 26 25 R 23 22 21 20 19 18 17 16 15 Reserved W Reset 24 0 0 0 0 0 0 0 0 0 14 13 12 11 CH3FVAL 0 0 0 0 0 0 0 0 0 0 10 9 8 7 CH2FVAL 0 0 0 0 6 5 4 3 CH1FVAL 0 0 0 0 2 1 0 CH0FVAL 0 0 0 0 0 FTMx_FILTER field desc
Chapter 37 FlexTimer (FTM) 37.3.20 Fault Control (FTMx_FLTCTRL) This register selects the filter value for the fault inputs, enables the fault inputs and the fault inputs filter.
Memory Map and Register Definition FTMx_FLTCTRL field descriptions (continued) Field 5 FFLTR1EN Description Fault Input 1 Filter Enable Enables the filter for the fault input. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 4 FFLTR0EN Fault input filter is disabled. Fault input filter is enabled. Fault Input 0 Filter Enable Enables the filter for the fault input. This field is write protected. It can be written only when MODE[WPDIS] = 1.
Chapter 37 FlexTimer (FTM) 37.3.21 Quadrature Decoder Control and Status (FTMx_QDCTRL) This register has the control and status bits for the quadrature decoder mode.
Memory Map and Register Definition FTMx_QDCTRL field descriptions (continued) Field Description 0 1 4 PHBPOL Phase B Input Polarity Selects the polarity for the quadrature decoder phase B input. 0 1 3 QUADMODE Selects the encoding mode used in the quadrature decoder mode. Indicates the counting direction. Counting direction is decreasing (FTM counter decrement). Counting direction is increasing (FTM counter increment).
Chapter 37 FlexTimer (FTM) 37.3.22 Configuration (FTMx_CONF) This register selects the number of times that the FTM counter overflow should occur before the TOF bit to be set, the FTM behavior in BDM modes, the use of an external global time base, and the global time base signal generation.
Memory Map and Register Definition FTMx_CONF field descriptions (continued) Field Description 4–0 NUMTOF TOF Frequency Selects the ratio between the number of counter overflows to the number of times the TOF bit is set. NUMTOF = 0: The TOF bit is set for each counter overflow. NUMTOF = 1: The TOF bit is set for the first counter overflow but not for the next overflow. NUMTOF = 2: The TOF bit is set for the first counter overflow but not for the next 2 overflows.
Chapter 37 FlexTimer (FTM) FTMx_FLTPOL field descriptions (continued) Field 2 FLT2POL Description Fault Input 2 Polarity Defines the polarity of the fault input. This field is write protected. It can be written only when MODE[WPDIS] = 1. 0 1 1 FLT1POL The fault input polarity is active high. A one at the fault input indicates a fault. The fault input polarity is active low. A zero at the fault input indicates a fault. Fault Input 1 Polarity Defines the polarity of the fault input.
Memory Map and Register Definition 37.3.24 Synchronization Configuration (FTMx_SYNCONF) This register selects the PWM synchronization configuration, SWOCTRL, INVCTRL and CNTIN registers synchronization, if FTM clears the TRIGj bit (where j = 0, 1, 2) when the hardware trigger j is detected.
Chapter 37 FlexTimer (FTM) FTMx_SYNCONF field descriptions (continued) Field Description 16 HWRSTCNT FTM counter synchronization is activated by a hardware trigger. 15–13 Reserved This read-only field is reserved and always has the value zero. 12 SWSOC Software output control synchronization is activated by the software trigger. 11 SWINVC Inverting control synchronization is activated by the software trigger.
Memory Map and Register Definition FTMx_SYNCONF field descriptions (continued) Field Description 0 1 1 Reserved CNTIN register is updated with its buffer value at all rising edges of system clock. CNTIN register is updated with its buffer value by the PWM synchronization. This read-only field is reserved and always has the value zero. 0 HWTRIGMODE Hardware Trigger Mode 0 1 FTM clears the TRIGj bit when the hardware trigger j is detected.
Chapter 37 FlexTimer (FTM) FTMx_INVCTRL field descriptions (continued) Field Description 0 1 0 INV0EN Inverting is disabled. Inverting is enabled. Pair Channels 0 Inverting Enable 0 1 Inverting is disabled. Inverting is enabled. 37.3.26 FTM Software Output Control (FTMx_SWOCTRL) This register enables software control of channel (n) output and defines the value forced to the channel (n) output: • The CHnOC bits enable the control of the corresponding channel (n) output by software.
Memory Map and Register Definition FTMx_SWOCTRL field descriptions (continued) Field Description 15 CH7OCV Channel 7 Software Output Control Value 14 CH6OCV Channel 6 Software Output Control Value 13 CH5OCV Channel 5 Software Output Control Value 12 CH4OCV Channel 4 Software Output Control Value 11 CH3OCV Channel 3 Software Output Control Value 10 CH2OCV Channel 2 Software Output Control Value 9 CH1OCV Channel 1 Software Output Control Value 8 CH0OCV Channel 0 Software Output Control Value
Chapter 37 FlexTimer (FTM) FTMx_SWOCTRL field descriptions (continued) Field Description 0 1 The channel output is not affected by software output control. The channel output is affected by software output control. 3 CH3OC Channel 3 Software Output Control Enable 2 CH2OC Channel 2 Software Output Control Enable 1 CH1OC Channel 1 Software Output Control Enable 0 CH0OC Channel 0 Software Output Control Enable 0 1 0 1 0 1 0 1 The channel output is not affected by software output control.
Memory Map and Register Definition FTMx_PWMLOAD field descriptions Field 31–10 Reserved 9 LDOK Description This read-only field is reserved and always has the value zero. Load Enable Enables the loading of the MOD, CNTIN, and CV registers with the values of their write buffers. 0 1 Loading updated values is disabled. Loading updated values is enabled. 8 Reserved This read-only field is reserved and always has the value zero.
Chapter 37 FlexTimer (FTM) 37.4 Functional Description The following sections describe the FTM features. The notation used in this document to represent the counters and the generation of the signals is shown in the following figure. FTM counting is up. Channel (n) is in high-true EPWM mode.
Functional Description The fixed frequency clock is an alternative clock source for the FTM counter that allows the selection of a clock other than the system clock or an external clock. This clock input is defined by chip integration. Refer the chip specific documentation for further information. Due to FTM hardware implementation limitations, the frequency of the fixed frequency clock must not exceed 1/2 of the system clock frequency.
Chapter 37 FlexTimer (FTM) 37.4.3.1 Up Counting Up counting is selected when (QUADEN = 0) and (CPWMS = 0). CNTIN defines the starting value of the count and MOD defines the final value of the count (see the following figure). The value of CNTIN is loaded into the FTM counter, and the counter increments until the value of MOD is reached, at which point the counter is reloaded with the value of CNTIN. The FTM period when using up counting is (MOD – CNTIN + 0x0001) × period of the FTM counter clock.
Functional Description FTM counting is up CNTIN = 0x0000 MOD = 0x0004 FTM counter 3 4 0 1 2 3 4 0 1 2 3 0 4 1 2 TOF bit set TOF bit set TOF bit set TOF bit period of FTM counter clock period of counting = (MOD - CNTIN + 0x0001) x period of FTM counter clock = (MOD + 0x0001) x period of FTM counter clock Figure 37-169.
Chapter 37 FlexTimer (FTM) FTM counting is up MOD = 0x0005 CNTIN = 0x0015 load of CNTIN FTM counter load of CNTIN 0x0005 0x0015 0x0016 ... 0xFFFE 0xFFFF 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0015 0x0016 ... TOF bit set TOF bit set TOF bit Figure 37-170. Example of Up Counting When the Value of CNTIN Is Greater Than the Value of MOD 37.4.3.2 Up-Down Counting Up-down counting is selected when (QUADEN= 0) and (CPWMS = 1).
Functional Description FTM counting is up-down CNTIN = 0x0000 MOD = 0x0004 FTM counter 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 TOF bit set TOF bit period of FTM counter clock set TOF bit period of counting = 2 x (MOD - CNTIN) x period of FTM counter clock = 2 x MOD x period of FTM counter clock Figure 37-171. Example of Up-Down Counting When CNTIN = 0x0000 Note It is expected that the up-down counting be used only with CNTIN = 0x0000. 37.4.3.
Chapter 37 FlexTimer (FTM) 37.4.3.4 Counter Reset Any write to CNT resets the FTM counter to the value in the CNTIN register and the channels output to its initial value (except for channels in output compare mode). The FTM counter synchronization (see FTM Counter Synchronization) can also be used to force the value of CNTIN into the FTM counter and the channels output to its initial value (except for channels in output compare mode). 37.4.3.
Functional Description When a selected edge occurs on the channel input, the current value of the FTM counter is captured into the CnV register, at the same time the CHnF bit is set and the channel interrupt is generated if enabled by CHnIE = 1 (see the following figure). When a channel is configured for input capture, the FTMxCHn pin is an edge-sensitive input. ELSnB:ELSnA control bits determine which edge, falling or rising, triggers inputcapture event.
Chapter 37 FlexTimer (FTM) Firstly the input signal is synchronized by the system clock. Following synchronization, the input signal enters the filter block (see the following figure). When there is a state change in the input signal, the 5-bit counter is reset and starts counting up. As long as the new state is stable on the input, the counter continues to increment. If the 5-bit counter overflows (the counter exceeds the value of the CHnFVAL[3:0] bits), the state change of the input signal is validated.
Functional Description 37.4.5 Output Compare Mode The output compare mode is selected when (DECAPEN = 0), (COMBINE = 0), (CPWMS = 0), and (MSnB:MSnA = 0:1). In output compare mode, the FTM can generate timed pulses with programmable position, polarity, duration, and frequency. When the counter matches the value in the CnV register of an output compare channel, the channel (n) output can be set, cleared, or toggled.
Chapter 37 FlexTimer (FTM) MOD = 0x0005 CnV = 0x0003 channel (n) match counter overflow CNT ... channel (n) output 0 2 1 3 counter overflow 4 5 0 channel (n) match 1 2 3 counter overflow 4 5 0 1 ... previous value previous value CHnF bit TOF bit Figure 37-180. Example of the Output Compare Mode when the Match Sets the Channel Output It is possible to use the output compare mode with (ELSnB:ELSnA = 0:0).
Functional Description If (ELSnB:ELSnA = 0:0) when the counter reaches the value in the CnV register, the CHnF bit is set and the channel (n) interrupt is generated (if CHnIE = 1), however the channel (n) output is not controlled by FTM. If (ELSnB:ELSnA = 1:0), then the channel (n) output is forced high at the counter overflow (when the CNTIN register value is are loaded into the FTM counter), and it is forced low at the channel (n) match (FTM counter = CnV) (see the following figure).
Chapter 37 FlexTimer (FTM) 37.4.7 Center-Aligned PWM (CPWM) Mode The center-aligned mode is selected when (QUADEN = 0), (DECAPEN = 0), (COMBINE = 0), and (CPWMS = 1). The CPWM pulse width (duty cycle) is determined by 2 × (CnV − CNTIN) and the period is determined by 2 × (MOD − CNTIN)(see the following figure). MOD must be kept in the range of 0x0001 to 0x7FFF because values outside this range can produce ambiguous results.
Functional Description counter overflow channel (n) match in down counting MOD = 0x0008 CnV = 0x0005 CNT ... 7 8 7 6 5 4 3 counter overflow channel (n) match in down counting channel (n) match in up counting 2 1 0 1 2 3 4 5 7 6 8 7 6 5 ... channel (n) output previous value CHnF bit TOF bit Figure 37-185.
Chapter 37 FlexTimer (FTM) 37.4.8 Combine Mode The combine mode is selected when (FTMEN = 1), (QUADEN = 0), (DECAPEN = 0), (COMBINE = 1), and (CPWMS = 0). In combine mode, the channel (n) (an even channel) and channel (n+1) (the adjacent odd channel) are combined to generate a PWM signal in the channel (n) output. In the combine mode, the PWM period is determined by (MOD − CNTIN + 0x0001) and the PWM pulse width (duty cycle) is determined by (|C(n+1)V − C(n)V|).
Functional Description FTM counter MOD C(n+1)V C(n)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 Figure 37-188. Channel (n) Output If (CNTIN < C(n)V < MOD) and (CNTIN < C(n+1)V < MOD) and (C(n)V < C(n+1)V) FTM counter MOD = C(n+1)V C(n)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 Figure 37-189.
Chapter 37 FlexTimer (FTM) FTM counter MOD = C(n+1)V C(n)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 not fully 100% duty cycle not fully 0% duty cycle Figure 37-191. Channel (n) Output If (CNTIN < C(n)V < MOD) and (C(n)V is Almost Equal to CNTIN) and (C(n+1)V = MOD) FTM counter MOD C(n+1)V C(n)V = CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 not fully 100% duty cycle not fully 0% duty cycle Figure 37-192.
Functional Description FTM counter C(n+1)V MOD CNTIN C(n)V channel (n) output with ELSnB:ELSnA = 1:0 0% duty cycle channel (n) output with ELSnB:ELSnA = X:1 100% duty cycle Figure 37-193. Channel (n) Output If C(n)V and C(n+1)V Are Not Between CNTIN and MOD FTM counter MOD C(n+1)V = C(n)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 0% duty cycle channel (n) output with ELSnB:ELSnA = X:1 100% duty cycle Figure 37-194.
Chapter 37 FlexTimer (FTM) FTM counter MOD C(n)V = C(n+1)V = CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 0% duty cycle 100% duty cycle Figure 37-195. Channel (n) Output If (C(n)V = C(n+1)V = CNTIN) MOD = C(n+1)V = C(n)V FTM counter CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 0% duty cycle 100% duty cycle Figure 37-196.
Functional Description FTM counter MOD C(n+1)V CNTIN C(n)V channel (n) output with ELSnB:ELSnA = 1:0 0% duty cycle channel (n) output with ELSnB:ELSnA = X:1 100% duty cycle Figure 37-198. Channel (n) Output If (C(n)V < CNTIN) and (CNTIN < C(n+1)V < MOD) FTM counter MOD C(n)V CNTIN C(n+1)V channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 Figure 37-199. Channel (n) Output If (C(n+1)V < CNTIN) and (CNTIN < C(n)V < MOD) K10 Sub-Family Reference Manual, Rev.
Chapter 37 FlexTimer (FTM) FTM counter C(n)V MOD C(n+1)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 0% duty cycle channel (n) output with ELSnB:ELSnA = X:1 100% duty cycle Figure 37-200. Channel (n) Output If (C(n)V > MOD) and (CNTIN < C(n+1)V < MOD) FTM counter C(n+1)V MOD C(n)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 channel (n) output with ELSnB:ELSnA = X:1 Figure 37-201. Channel (n) Output If (C(n+1)V > MOD) and (CNTIN < C(n)V < MOD) K10 Sub-Family Reference Manual, Rev.
Functional Description FTM counter C(n+1)V MOD = C(n)V CNTIN channel (n) output with ELSnB:ELSnA = 1:0 not fully 0% duty cycle channel (n) output with ELSnB:ELSnA = X:1 not fully 100% duty cycle Figure 37-202. Channel (n) Output If (C(n+1)V > MOD) and (CNTIN < C(n)V = MOD) 37.4.8.
Chapter 37 FlexTimer (FTM) channel (n+1) match FTM counter channel (n) match channel (n) output with ELSnB:ELSnA = 1:0 channel (n+1) output with COMP = 0 channel (n+1) output with COMP = 1 Figure 37-203. Channel (n+1) Output in Complementary Mode with (ELSnB:ELSnA = 1:0) channel (n+1) match FTM counter channel (n) match channel (n) output with ELSnB:ELSnA = X:1 channel (n+1) output with COMP = 0 channel (n+1) output with COMP = 1 Figure 37-204.
Functional Description If (CLKS[1:0] ≠ 0:0 and FTMEN = 0), then MOD register is updated according to the CPWMS bit, that is: • If the selected mode is not CPWM then MOD register is updated after MOD register was written and the FTM counter changes from MOD to CNTIN. If the FTM counter is at free-running counter mode then this update occurs when the FTM counter changes from 0xFFFF to 0x0000.
Chapter 37 FlexTimer (FTM) • If the selected mode is output compare then CnV register is updated according to the SYNCEN bit. If (SYNCEN = 0) then CnV register is updated after CnV register was written at the next change of the FTM counter (end of the prescaler counting). If (SYNCEN = 1) then CnV register is updated by the CnV register synchronization (C(n)V and C(n+1)V Register Synchronization).
Functional Description system clock write 1 to TRIG0 bit TRIG0 bit trigger_0 input synchronized trigger_0 by system clock trigger 0 event Note All hardware trigger inputs have the same behavior. Figure 37-205. Hardware Trigger Event with HWTRIGMODE = 0 If HWTRIGMODE = 1 then the TRIGn bit is only cleared when 0 is written to it. NOTE It is expected that the HWTRIGMODE bit be 1 only with enhanced PWM synchronization (SYNCMODE = 1). 37.4.11.
Chapter 37 FlexTimer (FTM) system clock write 1 to SWSYNC bit SWSYNC bit software trigger event PWM synchronization selected loading point Figure 37-206. Software Trigger Event 37.4.11.3 Boundary Cycle and Loading Points The boundary cycle definition is important for the loading points for the registers MOD, CNTIN and C(n)V. In up counting mode (Up Counting) the boundary cycle is defined as when the counter wraps to its initial value (CNTIN).
Functional Description loading points if CNTMAX = 1 or CNTMIN = 1 CNT = MOD -> CNTIN up counting mode loading points if CNTMAX = 1 CNT = (MOD - 0x0001) -> MOD up-down counting mode CNT = (CNTIN + 0x0001) -> CNTIN loading points if CNTMIN = 1 Figure 37-207. Boundary Cycles and Loading Points 37.4.11.4 MOD Register Synchronization The MOD register synchronization updates the MOD register with its buffer value. This synchronization is enabled if (FTMEN = 1).
Chapter 37 FlexTimer (FTM) begin legacy PWM synchronization SYNCMODE bit ? =0 =1 enhanced PWM synchronization MOD register is updated by hardware trigger MOD register is updated by software trigger HWWRBUF = 0 bit ? SWWRBUF = 0 bit ? =1 =1 end software trigger 0= SWSYNC bit ? end hardware trigger TRIGn bit ? =1 =0 =1 FTM counter is reset by software trigger SWRSTCNT bit ? =1 wait hardware trigger n =0 wait the next selected loading point HWTRIGMODE bit ? =1 =0 update MOD with its
Functional Description loading point. If the trigger event was a hardware trigger then the trigger enable bit (TRIGn) is cleared according to Hardware Trigger. Examples with software and hardware triggers follow. system clock write 1 to SWSYNC bit SWSYNC bit software trigger event selected loading point MOD register is updated Figure 37-209.
Chapter 37 FlexTimer (FTM) system clock write 1 to SWSYNC bit SWSYNC bit software trigger event MOD register is updated Figure 37-211. MOD Synchronization with (SYNCMODE = 0), (PWMSYNC = 0), (REINIT = 1), and (Software Trigger Was Used) system clock write 1 to TRIG0 bit TRIG0 bit trigger 0 event MOD register is updated Figure 37-212.
Functional Description 37.4.11.5 CNTIN Register Synchronization The CNTIN register synchronization updates the CNTIN register with its buffer value. This synchronization is enabled if (FTMEN = 1), (SYNCMODE = 1) and (CNTINC = 1). The CNTIN register synchronization can be done only by the enhanced PWM synchronization (SYNCMODE = 1). The synchronization mechanism is the same as the MOD register synchronization done by the enhanced PWM synchronization (MOD Register Synchronization). 37.4.11.
Chapter 37 FlexTimer (FTM) begin update OUTMASK register at each rising edge of system clock no = 0= SYNCHOM bit ? update OUTMASK register by PWM synchronization =1 1= rising edge of system clock ? SYNCMODE bit ? =0 legacy PWM synchronization = yes update OUTMASK with its buffer value end enhanced PWM synchronization OUTMASK is updated by hardware trigger OUTMASK is updated by software trigger 1= 0= SWSYNC bit ? SWOM bit ? software trigger =0 end 0= end HWOM bit ? =1 hardware trigger
Functional Description If (SYNCMODE = 0), (SYNCHOM = 1) and (PWMSYNC = 0) then this synchronization is done on the next enabled trigger event. If the trigger event was a software trigger then the SWSYNC bit is cleared on the next selected loading point. If the trigger event was a hardware trigger then the TRIGn bit is cleared according to Hardware Trigger. Examples with software and hardware triggers follow.
Chapter 37 FlexTimer (FTM) system clock write 1 to TRIG0 bit TRIG0 bit trigger 0 event OUTMASK register is updated and TRIG0 bit is cleared Figure 37-217. OUTMASK Synchronization with (SYNCMODE = 0), (HWTRIGMODE = 0), (SYNCHOM = 1), (PWMSYNC = 1), and (a Hardware Trigger Was Used) 37.4.11.8 INVCTRL Register Synchronization The INVCTRL register synchronization updates the INVCTRL register with its buffer value.
Functional Description begin update INVCTRL register at each rising edge of system clock 0= INVC bit ? =1 update INVCTRL register by PWM synchronization 1= no = rising edge of system clock ? SYNCMODE bit ? =0 end = yes update INVCTRL with its buffer value end enhanced PWM synchronization INVCTRL is updated by hardware trigger INVCTRL is updated by software trigger 1= 0= SWSYNC bit ? SWINVC bit ? software trigger =0 end 0= end HWINVC bit ? hardware trigger end TRIGn bit ? =0 =1 =1
Chapter 37 FlexTimer (FTM) The SWOCTRL register can be updated at each rising edge of system clock (SWOC = 0) or by the enhanced PWM synchronization (SWOC = 1 and SYNCMODE = 1) according to the following flowchart. In the case of enhanced PWM synchronization, the SWOCTRL register synchronization depends on SWSOC and HWSOC bits.
Functional Description 37.4.11.10 FTM Counter Synchronization The FTM counter synchronization is a mechanism that allows the FTM to re-start the PWM generation at a certain point in the PWM period. The channels outputs are forced to their initial value (except for channels in output compare mode) and the FTM counter is forced to its initial counting value defined by CNTIN register. The following figure shows the FTM counter synchronization.
Chapter 37 FlexTimer (FTM) begin legacy PWM synchronization SYNCMODE bit ? =0 =1 enhanced PWM synchronization FTM counter is reset by software trigger SWSYNC bit ? SWRSTCNT bit ? software trigger =0 end =0 1= FTM counter is reset by hardware trigger end HWRSTCNT bit ? =1 hardware trigger =0 update the channels outputs with their initial value clear SWSYNC bit =0 =1 =1 update FTM counter with CNTIN register value TRIGn bit ? wait hardware trigger n update FTM counter with CNTIN reg
Functional Description system clock write 1 to SWSYNC bit SWSYNC bit software trigger event FTM counter is updated with the CNTIN register value and channel outputs are forced to their initial value Figure 37-222. FTM Counter Synchronization with (SYNCMODE = 0), (REINIT = 1), (PWMSYNC = 0), and (Software Trigger Was Used) system clock write 1 to TRIG0 bit TRIG0 bit trigger 0 event FTM counter is updated with the CNTIN register value and channel outputs are forced to their initial value Figure 37-223.
Chapter 37 FlexTimer (FTM) 37.4.12 Inverting The invert functionality swaps the signals between channel (n) and channel (n+1) outputs. The inverting operation is selected when (FTMEN = 1), (QUADEN = 0), (DECAPEN = 0), (COMBINE = 1), (COMP = 1), (CPWMS = 0), and (INVm = 1), where m represents a channel pair.
Functional Description channel (n+1) match FTM counter channel (n) match channel (n) output before the inverting channel (n+1) output before the inverting write 1 to INV(m) bit INV(m) bit buffer INVCTRL register synchronization INV(m) bit channel (n) output after the inverting channel (n+1) output after the inverting NOTE INV(m) bit selects the inverting to the pair channels (n) and (n+1). Figure 37-226.
Chapter 37 FlexTimer (FTM) channel (n+1) match FTM counter channel (n) match channel (n) output after the software output control channel (n+1) output after the software output control CH(n)OC buffer CH(n+1)OC buffer write to SWOCTRL register write to SWOCTRL register CH(n)OC bit CH(n+1)OC bit SWOCTRL register synchronization SWOCTRL register synchronization NOTE CH(n)OCV = 1 and CH(n+1)OCV = 0. Figure 37-227.
Functional Description Note • It is expected that the software output control feature be used only in combine mode. • The CH(n)OC and CH(n+1)OC bits should be equal. • The COMP bit should not be modified when software output control is enabled, that is, CH(n)OC = 1 and/or CH(n+1)OC = 1. • Software output control has the same behavior with disabled or enabled FTM counter (see the CLKS bitfield description in the Status and Control register). 37.4.
Chapter 37 FlexTimer (FTM) channel (n+1) match FTM counter channel (n) match channel (n) output (before deadtime insertion) channel (n+1) output (before deadtime insertion) channel (n) output (after deadtime insertion) channel (n+1) output (after deadtime insertion) Figure 37-228.
Functional Description • and the deadtime delay is greater than or equal to the channel (n) duty cycle ((C(n +1)V – C(n)V) × system clock), then the channel (n) output is always the inactive value (POL(n) bit value). • and the deadtime delay is greater than or equal to the channel (n+1) duty cycle ((MOD – CNTIN + 1 – (C(n+1)V – C(n)V) ) × system clock), then the channel (n+1) output is always the inactive value (POL(n+1) bit value).
Chapter 37 FlexTimer (FTM) 37.4.15 Output Mask The output mask can be used to force channels output to their inactive state through software (for example: to control a BLDC motor). Any write to the OUTMASK register updates its write buffer. The OUTMASK register is updated with its buffer value by PWM synchronization (OUTMASK Register Synchronization). If CHnOM = 1, then the channel (n) output is forced to its inactive state (POLn bit value).
Functional Description Note It is expected the output mask feature be used only in combine mode. 37.4.16 Fault Control The fault control is enabled if (FTMEN = 1) and (FAULTM[1:0] ≠ 0:0). FTM can have up to four fault inputs. FAULTnEN bit (where n = 0, 1, 2, 3) enables the fault input n and FFLTRnEN bit enables the fault input n filter. FFVAL[3:0] bits select the value of the enabled filter in each enabled fault input.
Chapter 37 FlexTimer (FTM) (FFVAL[3:0] 0000) and (FFLTRnEN*) FLTnPOL synchronizer fault input n* value 0 fault input n* system clock D CLK Q D Q CLK Fault filter (5-bit counter) 1 fault input polarity control rising edge detector FAULTFn* * where n = 3, 2, 1, 0 Figure 37-233. Fault Input n Control Block Diagram If the fault control and fault input n are enabled and a rising edge at the fault input n signal is detected, then the FAULTFn bit is set.
Functional Description 37.4.16.1 Automatic Fault Clearing If the automatic fault clearing is selected (FAULTM[1:0] = 1:1), then the channels output disabled by fault control is again enabled when the fault input signal (FAULTIN) returns to zero and a new PWM cycle begins (see the following figure).
Chapter 37 FlexTimer (FTM) the beginning of new PWM cycles FTM counter channel (n) output (before fault control) FAULTIN bit channel (n) output (after fault control with manual fault clearing and POLn=0) FAULTF bit FAULTF bit is cleared NOTE The channel (n) output is after the fault control with manual fault clearing and POLn = 0. Figure 37-236. Fault Control with Manual Fault Clearing 37.4.16.3 Fault Inputs Polarity Control The FLTjPOL bit selects the fault input j polarity (where j = 0, 1, 2, 3).
Functional Description Note It is expected that the polarity control be used only in combine mode. 37.4.18 Initialization The initialization forces the CHnOI bit value to the channel (n) output when a one is written to the INIT bit. The initialization depends on COMP and DTEN bits. The following table shows the values that channels (n) and (n+1) are forced by initialization when the COMP and DTEN bits are zero. Table 37-245.
Chapter 37 FlexTimer (FTM) pair channels (m) - channels (n) and (n+1) FTM counter QUADEN DECAPEN COMBINE(m) CPWMS C(n)V MS(n)B CH(n)OC MS(n)A CH(n)OCV POL(n) ELS(n)B CH(n+1)OC POL(n+1) ELS(n)A CH(n)OI CH(n+1)OI COMP(m) INV(m)EN CH(n+1)OCV CH(n)OM DTEN(m) CH(n+1)OM FAULTEN(m) channel (n) output signal generation of channel (n) output signal initialization complementary mode inverting software output control deadtime insertion output mask fault control polarity control channel (n+1) o
Functional Description The FTM is able to generate multiple triggers in one PWM period. Since each trigger is generated for a specific channel, several channels are required to implement this functionality. This behavior is described in the following figure.
Chapter 37 FlexTimer (FTM) • When there is a write to CNT register • When there is the FTM counter synchronization (FTM Counter Synchronization) • If (CNT = CNTIN), (CLKS[1:0] = 0:0), and a value different from zero is written to CLKS[1:0] bits The following figures show the cases. CNTIN = 0x0000 MOD = 0x000F CPWMS = 0 system clock FTM counter 0x0C 0x0D 0x0E 0x0F 0x00 0x01 0x02 0x03 0x04 0x05 initialization trigger Figure 37-239.
Functional Description CNTIN = 0x0000 MOD = 0x000F CPWMS = 0 system clock 0x00 FTM counter CLKS[1:0] bits 00 0x01 0x02 0x03 0x04 0x05 01 initialization trigger Figure 37-242. Initialization Trigger Is Generated If (CNT = CNTIN), (CLKS[1:0] = 0:0), and a Value Different From Zero Is Written to CLKS[1:0] Bits The initialization trigger output provides a trigger signal that is used for on-chip modules. Note It is expected that the initialization trigger be used only in combine mode. 37.4.
Chapter 37 FlexTimer (FTM) FTM counter clock set CAPTEST clear CAPTEST write to MODE CAPTEST bit FTM counter 0x1053 0x1054 0x1055 0x1056 0x78AC 0x78AD 0x78AE0x78AF 0x78B0 write 0x78AC write to CNT CHnF bit 0x78AC 0x0300 CnV NOTE - FTM counter configuration: (FTMEN = 1), (QUADEN = 0), (CAPTEST = 1), (CPWMS = 0), (CNTIN = 0x0000), and (MOD = 0xFFFF) - FTM channel n configuration: input capture mode - (DECAPEN = 0), (COMBINE = 0), and (MSnB:MSnA = 0:0) Figure 37-243. Capture Test Mode 37.4.
Functional Description Table 37-248. Clear CHnF Bit when DMA = 1 CHnIE How CHnF Bit Can Be Cleared 0 CHnF bit is cleared either when the channel DMA transfer is done or by reading CnSC while CHnF is set and then writing a 0 to CHnF bit. 1 CHnF bit is cleared when the channel DMA transfer is done. 37.4.24 Dual Edge Capture Mode The dual edge capture mode is selected if FTMEN = 1 and DECAPEN = 1.
Chapter 37 FlexTimer (FTM) The C(n)V register stores the value of FTM counter when the selected edge by channel (n) is detected at channel (n) input. The C(n+1)V register stores the value of FTM counter when the selected edge by channel (n+1) is detected at channel (n) input. In this mode, the pair channels coherency mechanism ensures coherent data when the C(n)V and C(n+1)V registers are read. The only requirement is that C(n)V must be read before C(n+1)V.
Functional Description 37.4.24.2 Continuous Capture Mode The continuous capture mode is selected when (FTMEN = 1), (DECAPEN = 1), and (MS(n)A = 1). In this capture mode, the edges at the channel (n) input are captured continuously. The ELS(n)B:ELS(n)A bits select the initial edge to be captured, and ELS(n+1)B:ELS(n+1)A bits select the final edge to be captured. The edge captures are enabled while DECAP bit is set.
Chapter 37 FlexTimer (FTM) 4 FTM counter 12 8 3 7 2 6 1 16 11 10 5 20 15 14 9 13 24 19 18 17 28 23 27 22 26 21 25 channel (n) input (after the filter channel input) DECAPEN bit set DECAPEN DECAP bit set DECAP C(n)V 1 3 5 7 9 15 2 4 6 8 10 16 19 CH(n)F bit clear CH(n)F C(n+1)V 20 22 24 CH(n+1)F bit clear CH(n+1)F problem 1 problem 2 Note - The commands set DECAPEN, set DECAP, clear CH(n)F, and clear CH(n+1)F are made by the user.
Functional Description 4 FTM counter 12 8 3 7 2 6 1 16 11 10 5 20 15 14 9 13 24 19 18 17 28 23 27 22 26 21 25 channel (n) input (after the filter channel input) DECAPEN bit set DECAPEN DECAP bit set DECAP C(n)V 1 3 5 7 9 11 15 19 21 23 2 4 6 8 10 12 16 20 22 24 CH(n)F bit clear CH(n)F C(n+1)V CH(n+1)F bit clear CH(n+1)F Note - The commands set DECAPEN, set DECAP, clear CH(n)F, and clear CH(n+1)F are made by the user. Figure 37-246.
Chapter 37 FlexTimer (FTM) The following figure shows an example of the dual edge capture – one-shot mode used to measure the period between two consecutive rising edges. The DECAPEN bit selects the dual edge capture mode, so it keeps set in all operation mode. The DECAP bit is set to enable the measurement of next period. The CH(n)F bit is set when the first rising edge is detected, that is, the edge selected by ELS(n)B:ELS(n)A bits.
Functional Description edge is detected, that is, the edge selected by ELS(n)B:ELS(n)A bits. The CH(n+1)F bit is set when the second rising edge is detected, that is, the edge selected by ELS(n +1)B:ELS(n+1)A bits. The CH(n+1)F bit indicates when two edges of the period were captured and the C(n)V and C(n+1)V registers are ready for reading.
Chapter 37 FlexTimer (FTM) When a rising edge occurs in the channel (n) input signal, the FTM counter value is captured into channel (n) capture buffer. The channel (n) capture buffer value is transferred to C(n)V register when a falling edge occurs in the channel (n) input signal. C(n)V register has the FTM counter value when the previous rising edge occurred, and the channel (n) capture buffer has the FTM counter value when the last rising edge occurred.
Functional Description (CH(n)FVAL[3:0] bits in FILTER0 register). The phase B input filter is enabled by PHBFLTREN bit and this filter’s value is defined by CH1FVAL[3:0] bits (CH(n +1)FVAL[3:0] bits in FILTER0 register). Except for CH0FVAL[3:0] and CH1FVAL[3:0] bits, no channel logic is used in quadrature decoder mode.
Chapter 37 FlexTimer (FTM) phase B (counting direction) phase A (counting rate) FTM counter increment/decrement +1 +1 +1 +1 +1 +1 +1 +1 -1 -1 -1 -1 -1 FTM counter MOD CNTIN 0x0000 Time Figure 37-251. Quadrature Decoder – Count and Direction Encoding Mode If QUADMODE = 0, then the phase A and phase B encoding mode (see the following figure) is enabled.
Functional Description phase A phase B FTM counter increment/decrement +1 +1 +1 +1 +1 +1 +1 +1 -1 -1 -1 -1 -1 -1 -1 +1 +1 +1 +1 +1 +1 +1 +1 -1 -1 -1 -1 -1 -1 -1 +1 +1 +1 +1 +1 +1 +1 FTM counter MOD CNTIN 0x0000 Time Figure 37-252. Quadrature Decoder – Phase A and Phase B Encoding Mode The following figure shows the FTM counter overflow in up counting. In this case, when the FTM counter changes from MOD to CNTIN, TOF and TOFDIR bits are set. TOF bit indicates the FTM counter overflow occurred.
Chapter 37 FlexTimer (FTM) phase A phase B FTM counter increment/decrement -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 FTM counter MOD CNTIN 0x0000 Time set TOF clear TOFDIR set TOF clear TOFDIR Figure 37-254. FTM Counter Overflow in Down Counting for Quadrature Decoder Mode 37.4.25.1 Quadrature Decoder Boundary Conditions The following figures are examples of motor jittering which causes the FTM counter transitions as indicated by these figures.
Functional Description The following figure shows motor jittering produced by the phase B and A pulses respectively. The first highlighted transition causes a jitter on the FTM counter value near the maximum count value (MOD). The second indicated transition occurs on phase A and causes the FTM counter transition between the maximum and minimum count values which are defined by MOD and CNTIN registers. phase A phase B FTM counter MOD CNTIN 0x0000 Time Figure 37-256.
Chapter 37 FlexTimer (FTM) Table 37-249.
Functional Description After enabling the loading points, the LDOK bit needs to be set for the load to occur. In this case the load occurs at the next enabled loading point according to the following conditions: • If a new value was written to the MOD register, then the MOD register is updated with its write buffer value. • If a new value was written to the CNTIN register and CNTINC = 1, then the CNTIN register is updated with its write buffer value.
Chapter 37 FlexTimer (FTM) • • • • NOTE If ELSjB and ELSjA bits are different from zero, then the channel (j) output signal is generated according to the configured output mode. If ELSjB and ELSjA bits are zero, then the generated signal is not available on channel (j) output. If CHjIE = 1, then the channel (j) interrupt is generated when the channel (j) match occurs. At the intermediate load neither the channels outputs nor the FTM counter are changed.
Reset Overview In the configuration described in the preceding figure, FTM modules A and B have their FTM counters enabled if at least one of the gtb_out signals from one of the FTM modules is 1. There are several possible configurations for the interconnection of the gtb_in and gtb_out signals (represented by the example glue logic shown in the figure). Note that these configurations are chip-dependent and implemented outside of the FTM modules.
Chapter 37 FlexTimer (FTM) When the FTM exits from reset: • the FTM counter and the prescaler counter are zero and are stopped (CLKS[1:0] = 00b); • the timer overflow interrupt is zero (Timer Overflow Interrupt); • the channels interrupts are zero (Channel (n) Interrupt); • the fault interrupt is zero (Fault Interrupt); • the channels are in input capture mode (Input Capture Mode); • the channels outputs are zero; • the channels pins are not controlled by FTM (ELS(n)B:ELS(n)A = 0:0) ().
FTM Interrupts The following figure shows an example when the channel (n) is in output compare mode and the channel (n) output is toggled when there is a match. In the output compare mode, the channel output is not updated to its initial value when there is a write to CNT register (item 3). In this case, it is recommended to use the software output control (Software Output Control) or the initialization (Initialization) to update the channel output to the selected value (item 4).
Chapter 37 FlexTimer (FTM) 37.6.3 Fault Interrupt The fault interrupt is generated when (FAULTIE = 1) and (FAULTF = 1). K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
FTM Interrupts K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1012 Freescale Semiconductor, Inc.
Chapter 38 Periodic Interrupt Timer (PIT) 38.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The PIT timer module is an array of timers that can be used to raise interrupts and trigger DMA channels. 38.1.1 Block Diagram The following figure shows the PIT block diagram. K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Signal Description PIT Peripheral Bus PIT Registers load_value Timer 1 Iinterrupts Triggers Timer n Peripheral Bus Clock Figure 38-1. Block diagram of the PIT NOTE Refer to the Chip Configuration information for the number of PIT channels used in this MCU. 38.1.2 Features The main features of this block are: • Timers can generate DMA trigger pulses • Timers can generate interrupts • All interrupts are maskable • Independent timeout periods for each timer 38.
Chapter 38 Periodic Interrupt Timer (PIT) 38.3 Memory Map/Register Description This section provides a detailed description of all registers accessible in the PIT module. NOTE Reserved registers will read as 0, writes will have no effect. NOTE Refer to the Chip Configuration information for the number of PIT channels used in this MCU.
Memory Map/Register Description PIT memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4003_7130 Timer Load Value Register (PIT_LDVAL3) 32 R/W 0000_0000h 38.3.2/ 1017 4003_7134 Current Timer Value Register (PIT_CVAL3) 32 R/W 0000_0000h 38.3.3/ 1017 4003_7138 Timer Control Register (PIT_TCTRL3) 32 R/W 0000_0000h 38.3.4/ 1018 4003_713C Timer Flag Register (PIT_TFLG3) 32 R/W 0000_0000h 38.3.5/ 1018 38.3.
Chapter 38 Periodic Interrupt Timer (PIT) 38.3.2 Timer Load Value Register (PIT_LDVALn) These registers select the timeout period for the timer interrupts.
Memory Map/Register Description 38.3.4 Timer Control Register (PIT_TCTRLn) These register contain the control bits for each timer.
Chapter 38 Periodic Interrupt Timer (PIT) PIT_TFLGn field descriptions Field 31–1 Reserved 0 TIF Description This read-only field is reserved and always has the value zero. Timer Interrupt Flag. TIF is set to 1 at the end of the timer period. This flag can be cleared only by writing it with 1. Writing 0 has no effect. If enabled (TIE = 1), TIF causes an interrupt request. 0 1 Time-out has not yet occurred. Time-out has occurred. 38.
Functional Description Timer Enabled Start Value = p1 Disable Timer Re-Enable Timer Trigger Event p1 p1 p1 p1 Figure 38-23. Stopping and Starting a Timer The counter period of a running timer can be modified, by first disabling the timer, setting a new load value and then enabling the timer again (see the following figure). Disable Re-Enable Timer, Timer Set new Load Value Timer Enabled Start Value = p1 Trigger Event p2 p1 p2 p2 p1 Figure 38-24.
Chapter 38 Periodic Interrupt Timer (PIT) 38.4.2 Interrupts All of the timers support interrupt generation. Refer to the MCU specification for related vector addresses and priorities. Timer interrupts can be enabled by setting the TIE bits. The timer interrupt flags (TIF) are set to 1 when a timeout occurs on the associated timer, and are cleared to 0 by writing a 1 to that TIF bit. 38.5 Initialization and Application Information In the example configuration: • The PIT clock has a frequency of 50 MHz.
Initialization and Application Information PIT_LDVAL3 = 0x0016E35F; // setup timer 3for 1500000 cycles PIT_TCTRL3 |= TEN; // start Timer 3 K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1022 Freescale Semiconductor, Inc.
Chapter 39 Low power timer (LPTMR) 39.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The low power timer (LPTMR) can be configured to operate as a time counter (with optional prescaler) or as a pulse counter (with optional glitch filter) across all power modes, including the low leakage modes. It can also continue operating through most system reset events, allowing it to be used as a time of day counter. 39.1.
LPTMR signal descriptions 39.1.2.2 Wait mode In wait mode, the LPTMR continues to operate normally and may be configured to exit the low power mode by generating an interrupt request. 39.1.2.3 Stop mode In stop mode, the LPTMR continues to operate normally and may be configured to exit the low power mode by generating an interrupt request. 39.1.2.
Chapter 39 Low power timer (LPTMR) 39.2.1 Detailed signal descriptions Table 39-2. LPTMR interface-detailed signal descriptions Signal I/O LPTMR_ALTn I Description Pulse counter input. The LPTMR can select one of the input pins to be used in pulse counter mode. State meaning Assertion-If configured for pulse counter mode with active high input then assertion causes the LPTMR counter register to increment.
Memory map and register definition 39.3.
Chapter 39 Low power timer (LPTMR) LPTMRx_CSR field descriptions (continued) Field Description The Timer Pin Polarity configures the polarity of the input source in Pulse Counter mode. The Timer Pin Polarity should only be changed when the LPTMR is disabled. 0 1 2 TFC Pulse Counter input source is active high, and LPTMR Counter Register will increment on the rising edge. Pulse Counter input source is active low, and LPTMR Counter Register will increment on the falling edge.
Memory map and register definition LPTMRx_PSR field descriptions (continued) Field 6–3 PRESCALE Description Prescale Value The Prescaler Value register field configures the size of the Prescaler (in Time Counter mode) or width of the Glitch Filter (in Pulse Counter mode). The Prescale Value should only be altered when the LPTMR is disabled.
Chapter 39 Low power timer (LPTMR) LPTMRx_PSR field descriptions (continued) Field Description 00 01 10 11 Prescaler/glitch filter clock 0 selected Prescaler/glitch filter clock 1 selected Prescaler/glitch filter clock 2 selected Prescaler/glitch filter clock 3 selected 39.3.
Functional description LPTMRx_CNR field descriptions (continued) Field 15–0 COUNTER Description Counter Value The LPTMR Counter Register returns the current value of the LPTMR Counter. 39.4 Functional description 39.4.1 LPTMR power and reset The LPTMR remains powered in all power modes, including low leakage modes. If the LPTMR is not required to remain operating during a low power mode, then it should be disabled before entering the mode. The LPTMR is reset only on global POR or LVD.
Chapter 39 Low power timer (LPTMR) 39.4.3 LPTMR prescaler/glitch filter The LPTMR prescaler and glitch filter share the same logic which operates as a prescaler in time counter mode and as a glitch filter in pulse counter mode. The prescaler/glitch filter configuration must not be altered when the LPTMR is enabled. 39.4.3.1 Prescaler enabled In time counter mode when the prescaler is enabled, the output of the prescaler directly clocks the LPTMR counter register.
Functional description 39.4.3.4 Glitch filter bypassed In pulse counter mode when the glitch filter is bypassed, the selected input source increments the LPTMR counter register every time it asserts. Before the LPTMR is first enabled, the selected input source is forced to asserted. This is to prevent the LPTMR counter register from incrementing if the selected input source is already asserted when the LPTMR is first enabled. 39.4.
Chapter 39 Low power timer (LPTMR) The LPTMR counter register cannot be initialized, but can be read at any time. Reading the LPTMR counter register at the same time as it is incrementing may return invalid data due to synchronization of the read data bus. If it is necessary for software to read the LPTMR counter register, it is recommended that two read accesses are performed and software verifies that the same data was returned for both reads. 39.4.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1034 Freescale Semiconductor, Inc.
Chapter 40 Carrier Modulator Transmitter (CMT) 40.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The carrier modulator transmitter (CMT) module provides means to generate the protocol timing and carrier signals for a wide variety of encoding schemes.
Block Diagram • Extended space operation in time, baseband, and FSK modes • Selectable input clock divider • Interrupt on end of cycle • Ability to disable CMT_IRO signal and use as timer interrupt 40.3 Block Diagram The following figure is the CMT block diagram. CMT Car r ier Gener ator Modulator CMT_IRO CMT Interrupts CMT Registers divider_enable Peripheral bus clock Clock Divider Peripheral bus Figure 40-1. CMT Module Block Diagram K10 Sub-Family Reference Manual, Rev.
Chapter 40 Carrier Modulator Transmitter (CMT) 40.4 Modes of Operation The CMT module operates in the following modes. • Time—When operating in time mode, the user independently defines the high and low times of the carrier signal to determine both period and duty cycle. • Baseband—When MSC[BASE] bit is set, the carrier output (fcg) to the modulator is held high continuously to allow for the generation of baseband protocols.
Modes of Operation NOTE The assignment of module modes to core modes is chipspecific. For module-to-core mode assignments, see the chapter that describes how modules are configured. 40.4.1 Wait Mode Operation During wait mode, the CMT if enabled, will continue to operate normally . However, there is no change in operating modes of CMT while in wait mode, because the CPU is not operating. 40.4.2 Stop Mode Operation This section describes the CMT stop mode operations. 40.4.2.
Chapter 40 Carrier Modulator Transmitter (CMT) 40.5 CMT External Signal Descriptions This table shows the description of the external signal. Table 40-2. CMT Signal Descriptions Signal CMT_IRO Description I/O Infrared Output O 40.5.1 CMT_IRO — Infrared Output This output signal is driven by the modulator output when MSC[MCGEN] is set and OC[IROPEN] is set.
Memory Map/Register Definition CMT memory map Absolute address (hex) Register name 4006_2000 CMT Carrier Generator High Data Register 1 (CMT_CGH1) 8 4006_2001 CMT Carrier Generator Low Data Register 1 (CMT_CGL1) 4006_2002 Width Access (in bits) Reset value Section/ page R/W Undefined 40.6.1/ 1040 8 R/W Undefined 40.6.2/ 1041 CMT Carrier Generator High Data Register 2 (CMT_CGH2) 8 R/W Undefined 40.6.
Chapter 40 Carrier Modulator Transmitter (CMT) CMT_CGH1 field descriptions Field 7–0 PH Description Primary Carrier High Time Data Value When selected, these bits contain the number of input clocks required to generate the carrier high time period. When operating in Time mode, this register is always selected. When operating in FSK mode, this register and the secondary register pair are alternately selected under control of the modulator. The primary carrier high time value is undefined out of reset.
Memory Map/Register Definition 40.6.3 CMT Carrier Generator High Data Register 2 (CMT_CGH2) This data register contain the secondary high value for generating the carrier output. Address: CMT_CGH2 is 4006_2000h base + 2h offset = 4006_2002h Bit 7 6 5 4 Read 2 1 0 x* x* x* x* SH Write Reset 3 x* x* x* x* * Notes: • x = Undefined at reset.
Chapter 40 Carrier Modulator Transmitter (CMT) 40.6.5 CMT Output Control Register (CMT_OC) This register is used to control the IRO signal of the CMT module. Address: CMT_OC is 4006_2000h base + 4h offset = 4006_2004h Bit Read Write Reset 7 6 5 IROL CMTPOL IROPEN 0 0 0 4 3 2 1 0 0 0 0 0 0 0 CMT_OC field descriptions Field 7 IROL 6 CMTPOL Description IRO Latch Control Reading IROL reads the state of the IRO latch.
Memory Map/Register Definition 40.6.6 CMT Modulator Status and Control Register (CMT_MSC) The MSC register contains the modulator and carrier generator enable (MCGEN), end of cycle interrupt enable (EOCIE), FSK mode select (FSK), baseband enable (BASE), extended space (EXSPC), prescaler (CMTDIV) bits, and the end of cycle (EOCF) status bit.
Chapter 40 Carrier Modulator Transmitter (CMT) CMT_MSC field descriptions (continued) Field 3 BASE Description Baseband Enable When set, the BASE bit disables the carrier generator and forces the carrier output high for generation of baseband protocols. When BASE is cleared, the carrier generator is enabled and the carrier output toggles at the frequency determined by values stored in the carrier data registers. This bit is cleared by reset.
Memory Map/Register Definition CMT_CMD1 field descriptions Field 7–0 MB[15:8] Description These bits control the upper mark periods of the modulator for all modes. 40.6.8 CMT Modulator Data Register Mark Low (CMT_CMD2) The contents of this register are transferred to the modulator down counter upon the completion of a modulation period.
Chapter 40 Carrier Modulator Transmitter (CMT) CMT_CMD3 field descriptions Field 7–0 SB[15:8] Description These bits control the upper space periods of the modulator for all modes. 40.6.10 CMT Modulator Data Register Space Low (CMT_CMD4) The contents of this register are transferred to the space period register upon the completion of a modulation period.
Memory Map/Register Definition CMT_PPS field descriptions (continued) Field Description The primary prescaler divides the CMT clock to generate the Intermediate Frequency clock enable to the secondary prescaler.
Chapter 40 Carrier Modulator Transmitter (CMT) CMT_DMA field descriptions (continued) Field Description 0 1 DMA transfer request and done are disabled DMA transfer request and done are enabled 40.7 Functional Description The CMT module consists primarily of clock divider, carrier generator and modulator. 40.7.1 Clock Divider The CMT was originally designed to be based on 8 MHz bus clock that could be divided by 1, 2, 4 or 8 times accordingly with the specification.
Functional Description Table 40-17. Clock Divider Min. Min. Carrier Generator Period Modulator Period (μs) (μs) 0.125 0.25 1.0 01 0.25 0.5 2.0 8 10 0.5 1.0 4.0 8 11 1.0 2.0 8.0 Bus Clock (MHz) MSC[CMTDIV] 8 00 8 Carrier Generator Resolution (μs) The possible duty cycle options depend upon the number of counts required to complete the carrier period. For example, 1.6 MHz signal has a period of 625 ns and will therefore require 5 x 125 ns counts to generate.
Chapter 40 Carrier Modulator Transmitter (CMT) SECONDARY HIGH COUNT REGISTER PRIMARY HIGH COUNT REGISTER CLO CK AND O UTPUT CO NTRO L =? CMTCLK BASE FSK MCGEN CLK CLR CARRIER OUT (fcg) 8-BIT UP COUNTER PRIMARY/ SECONDARY SELECT =? SECONDARY LOW COUNT REGISTER PRIMARY LOW COUNT REGISTER Figure 40-15. Carrier Generator Block Diagram The high/low time counter is an 8-bit up counter. After each increment, the contents of the counter are compared with the appropriate high or low count value register.
Functional Description The duty cycle of the carrier signal is controlled by varying the ratio of high time to low + high time. As the input clock period is fixed, the duty cycle resolution will be proportional to the number of counts required to generate the desired carrier period. 40.7.3 Modulator The modulator block controls the state of the infrared out signal (IRO) . The modulator output is gated on to the IRO signal when the modulator/carrier generator is enabled .
Chapter 40 Carrier Modulator Transmitter (CMT) The activation of modulation space period is done when the carrier signal is low to prohibit cutting off the high pulse of a carrier signal. If the carrier signal is high, the modulator extends the mark period until the carrier signal become low. To de-assert the space period and assert the mark period, the carrier signal must have gone low to assure that a space period is not erroneously shortened.
Functional Description tmark = (CMD1:CMD2 + 1) ÷ (fCMTCLK ÷ 8) tspace = CMD3:CMD4 ÷ (fCMTCLK ÷ 8) where CMD1:CMD2 and CMD3:CMD4 are the decimal values of the concatenated registers. CMTCLK 8 C A R R IE R O U T (fcg) M O DULATO R G ATE MARK SPACE MARK IRO SIGNAL (TIME MODE) IRO SIGNAL (BASEBAND MODE) Figure 40-17. Example: CMT Output in Time and Baseband Modes with OC[CMTPOL]=0 40.7.3.
Chapter 40 Carrier Modulator Transmitter (CMT) Note The waveforms in Figure 40-17 and Figure 40-18 are for the purpose of conceptual illustration and are not meant to represent precise timing relationships between the signals shown. 40.7.3.3 FSK Mode When the modulator operates in FSK mode (MSC[MCGEN] and MSC[FSK] bits are set, and MSC[BASE] bit is cleared), the modulation mark and space periods consist of an integer number of carrier clocks (space period can be zero).
Functional Description CARRIER OUT (fcg) MARK1 MODULATOR GATE SPACE1 MARK2 SPACE2 MARK1 MARK2 SPACE1 IR O SIGNAL Figure 40-18. Example: CMT Output in FSK Mode 40.7.4 Extended Space Operation In either time, baseband or FSK mode, the space period can be made longer than the maximum possible value of the space period register .
Chapter 40 Carrier Modulator Transmitter (CMT) SET EXSPC CLEAR EXSPC Figure 40-19. Extended Space Operation 40.7.4.2 EXSPC Operation in FSK Mode In FSK mode, the modulator continues to count carrier out clocks, alternating between the primary and secondary registers at the end of each modulation period.
CMT Interrupts and DMA MSC[EOCF] is set when: • The modulator is not currently active and MSC[MCGEN] bit is set to begin the initial CMT transmission • At the end of each modulation cycle (when the counter is reloaded from CMD1:CMD2) while MSC[MCGEN] bit is set In the case where MSC[MCGEN] bit is cleared and then set before the end of the modulation cycle, MSC[EOCF] bit will not be set when MSC[MCGEN] is set, but will become set at the end of the current modulation cycle.
Chapter 41 Real Time Clock (RTC) 41.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. 41.1.1 Features The RTC module features include: • Independent power supply, POR and 32 kHz crystal oscillator • 32-bit seconds counter with roll-over protection and 32-bit alarm • 16-bit prescaler with compensation that can correct errors between 0.
Register definition During chip power-down, RTC is powered from the backup power supply (VBAT) and is electrically isolated from the rest of the chip but continues to increment the time counter (if enabled) and retain the state of the RTC registers. The RTC registers are not accessible. During chip power-up, RTC remains powered from the backup power supply (VBAT). All RTC registers are accessible by software and all functions are operational. If enabled, the 32.
Chapter 41 Real Time Clock (RTC) Write accesses to any register by non-supervisor mode software, when the supervisor access bit in the control register is clear, will terminate with a bus error. Read accesses by non-supervisor mode software complete as normal. Writing to a register protected by the write access register or lock register does not generate a bus error, but the write will not complete.
Register definition RTC_TSR field descriptions Field Description 31–0 TSR Time Seconds Register When the time counter is enabled, the TSR is read only and increments once a second provided SR[TOF] or SR[TIF] are not set. The time counter will read as zero when SR[TOF] or SR[TIF] are set. When the time counter is disabled, the TSR can be read or written. Writing to the TSR when the time counter is disabled will clear the SR[TOF] and/or the SR[TIF].
Chapter 41 Real Time Clock (RTC) RTC_TAR field descriptions (continued) Field Description When the time counter is enabled, the SR[TAF] is set whenever the TAR[TAR] equals the TSR[TSR] and the TSR[TSR] increments. Writing to the TAR clears the SR[TAF]. 41.2.
Register definition 41.2.
Chapter 41 Real Time Clock (RTC) RTC_CR field descriptions (continued) Field Description 9 CLKO Clock Output 8 OSCE Oscillator Enable 7–4 Reserved 3 UM 0 1 0 1 The 32kHz clock is output to other peripherals The 32kHz clock is not output to other peripherals 32.768 kHz oscillator is disabled. 32.768 kHz oscillator is enabled. After setting this bit, wait the oscillator startup time before enabling the time counter to allow the 32.768 kHz clock time to stabilize.
Register definition 41.2.
Chapter 41 Real Time Clock (RTC) 41.2.
Register definition 41.2.
Chapter 41 Real Time Clock (RTC) 41.2.
Register definition RTC_WAR field descriptions (continued) Field Description 1 TPRW Time Prescaler Register Write Once cleared, this bit is only set by system reset. It is not affected by VBAT POR or software reset. 0 1 0 TSRW Writes to the time prescaler register are ignored. Writes to the time prescaler register complete as normal. Time Seconds Register Write Once cleared, this bit is only set by system reset. It is not affected by VBAT POR or software reset.
Chapter 41 Real Time Clock (RTC) RTC_RAR field descriptions (continued) Field 4 CRR Description Control Register Read Once cleared, this bit is only set by system reset. It is not affected by VBAT POR or software reset. 0 1 3 TCRR Time Compensation Register Read Once cleared, this bit is only set by system reset. It is not affected by VBAT POR or software reset 0 1 2 TARR Once cleared, this bit is only set by system reset. It is not affected by VBAT POR or software reset.
Functional description The RTC includes its own analog POR block, which generates a power-on-reset signal whenever the RTC module is powered up and initializes all RTC registers to their default state. A software reset bit can also initialize all RTC registers. The RTC also monitors the chip power supply and electrically isolates itself when the rest of the chip is powered down.
Chapter 41 Real Time Clock (RTC) The time seconds register and time prescaler register can only be written when the SR[TCE] bit is clear. Always write to the prescaler register before writing to the seconds register, since the seconds register increments on the falling edge of bit 14 of the prescaler register. The time prescaler register increments provided the SR[TCE] bit is set, the SR[TIF] is clear, the SR[TOF] is clear and the 32.768 kHz clock source is present.
Functional description Updates to the time compensation register will not take effect until the next time the time seconds register increments and provided the previous compensation interval has expired. When the compensation interval is set to other than once a second then the compensation is applied in the first second interval and the remaining second intervals receive no compensation. Compensation is disabled by configuring the time compensation register to zero. 41.3.
Chapter 41 Real Time Clock (RTC) 41.3.7 Access control The read access and write access registers are implemented in the chip power domain and reset on the chip reset (they are not affected by the VBAT POR or the software reset). They are used to block read or write accesses to each register until the next chip system reset. When accesses are blocked the bus access is not seen in the VBAT power supply and does not generate a bus error. 41.3.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1076 Freescale Semiconductor, Inc.
Chapter 42 CAN (FlexCAN) 42.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The FlexCAN module is a communication controller implementing the CAN protocol according to the CAN 2.0B protocol specification.
Introduction Peripheral Bus Interface Address, Data, Clocks, Interrupts Registers Message Buffers (MBs) CAN Control Host Interface Tx Arbitration Rx Matching RAM CAN Protocol Engine CAN Tx CAN Rx Chip CAN Bus Figure 42-1. FlexCAN Block Diagram 42.1.
Chapter 42 CAN (FlexCAN) 42.1.2 FlexCAN Module Features The FlexCAN module includes these distinctive legacy features: • Full Implementation of the CAN protocol specification, Version 2.
Introduction • Short latency time due to an arbitration scheme for high-priority messages • Low power modes, with programmable wake up on bus activity Furthermore, the new major features below are also provided in addition to the previous FlexCAN version: • Remote request frames may be handled automatically or by software • Safe mechanism for ID Filter configuration in Normal Mode • CAN bit time settings and configuration bits can only be written in "Freeze" mode • Tx mailbox status (Lowest priority buffer
Chapter 42 CAN (FlexCAN) It is enabled when the FRZ bit in the MCR Register is asserted. If enabled, Freeze Mode is entered when the HALT bit in MCR is set or when Debug Mode is requested at MCU level and the FRZ_ACK bit in the MCR Register is asserted by the FlexCAN. In this mode, no transmission or reception of frames is done and synchronicity to the CAN bus is lost. See Freeze Mode for more information.
FlexCAN Signal Descriptions This low power mode is entered when Stop Mode is requested at MCU level and the LPM_ACK bit in the MCR Register is asserted by the FlexCAN. When in Stop Mode, the module puts itself in an inactive state and then informs the CPU that the clocks can be shut down globally. Exit from this mode happens when the Stop Mode request is removed or when activity is detected on the CAN bus and the Self Wake Up mechanism is enabled. See Stop Mode for more information. 42.
Chapter 42 CAN (FlexCAN) The complete memory map for a FlexCAN module is shown in the following table. The address space occupied by FlexCAN has 128 bytes for registers starting at the module base address, followed by embedded RAM starting at address 0x0080. Each individual register is identified by its complete name and the corresponding mnemonic. The access type can be Supervisor (S) or Unrestricted (U).
Memory Map/Register Definition The FlexCAN module can store CAN messages for transmission and reception using Mailboxes and Rx FIFO structures. This module's memory map includes sixteen 128-bit message buffers (MBs) that occupy the range from offset 0x80 to 0x17F. CAN memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4002_4000 Module Configuration Register (CAN0_MCR) 32 R/W D890_000Fh 42.3.
Chapter 42 CAN (FlexCAN) CAN memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4002_4880 Rx Individual Mask Registers (CAN0_RXIMR0) 32 R/W Undefined 42.3.19/ 1117 4002_4884 Rx Individual Mask Registers (CAN0_RXIMR1) 32 R/W Undefined 42.3.19/ 1117 4002_4888 Rx Individual Mask Registers (CAN0_RXIMR2) 32 R/W Undefined 42.3.19/ 1117 4002_488C Rx Individual Mask Registers (CAN0_RXIMR3) 32 R/W Undefined 42.3.
Memory Map/Register Definition CAN memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400A_4014 Rx 14 Mask Register (CAN1_RX14MASK) 32 R/W FFFF_ FFFFh 42.3.6/ 1098 400A_4018 Rx 15 Mask Register (CAN1_RX15MASK) 32 R/W FFFF_ FFFFh 42.3.7/ 1099 400A_401C Error Counter (CAN1_ECR) 32 R/W 0000_0000h 42.3.8/ 1100 400A_4020 Error and Status 1 Register (CAN1_ESR1) 32 R/W 0000_0000h 42.3.
Chapter 42 CAN (FlexCAN) CAN memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400A_489C Rx Individual Mask Registers (CAN1_RXIMR7) 32 R/W Undefined 42.3.19/ 1117 400A_48A0 Rx Individual Mask Registers (CAN1_RXIMR8) 32 R/W Undefined 42.3.19/ 1117 400A_48A4 Rx Individual Mask Registers (CAN1_RXIMR9) 32 R/W Undefined 42.3.19/ 1117 400A_48A8 Rx Individual Mask Registers (CAN1_RXIMR10) 32 R/W Undefined 42.3.
Memory Map/Register Definition 42.3.2 Module Configuration Register (CANx_MCR) This register defines global system configurations, such as the module operation modes and the maximum message buffer configuration.
Chapter 42 CAN (FlexCAN) CANx_MCR field descriptions (continued) Field Description This bit controls whether the Rx FIFO feature is enabled or not. When RFEN is set, MBs 0 to 5 cannot be used for normal reception and transmission because the corresponding memory region (0x80-0xDC) is used by the FIFO engine as well as additional MBs (up to 32, depending on CTRL2[RFFN] setting) which are used as Rx FIFO ID Filter Table elements.
Memory Map/Register Definition CANx_MCR field descriptions (continued) Field Description Therefore the software can poll the FRZACK bit to know when FlexCAN has actually entered Freeze Mode. If Freeze Mode request is negated, then this bit is negated once the FlexCAN prescaler is running again. If Freeze Mode is requested while FlexCAN is in a low power mode, then the FRZACK bit will only be set when the low power mode is exited. See Section "Freeze Mode".
Chapter 42 CAN (FlexCAN) CANx_MCR field descriptions (continued) Field Description NOTE: LPMACK will be asserted within 180 CAN bits from the low power mode request by the CPU, and negated within 2 CAN bits after the low power mode request removal (see Section "Protocol Timing"). 0 1 19 Reserved 18 DOZE This field is reserved. Doze Mode Enable This bit defines whether FlexCAN is allowed to enter low power mode when Doze Mode is requested at MCU level.
Memory Map/Register Definition CANx_MCR field descriptions (continued) Field Description frame is sent in the CAN bus without notification. This bit can only be written in Freeze mode as it is blocked by hardware in other modes. NOTE: When MCR[AEN] is asserted, only the abort mechanism (see Section "Transmission Abort Mechanism") must be used for updating Mailboxes configured for transmission. CAUTION: Writing the Abort code into Rx Mailboxes can cause unpredictable results when the MCR[AEN] is asserted.
Chapter 42 CAN (FlexCAN) 42.3.3 Control 1 Register (CANx_CTRL1) This register is defined for specific FlexCAN control features related to the CAN bus, such as bit-rate, programmable sampling point within an Rx bit, Loop Back Mode, Listen-Only Mode, Bus Off recovery behavior and interrupt enabling (Bus-Off, Error, Warning). It also determines the Division Factor for the clock prescaler.
Memory Map/Register Definition CANx_CTRL1 field descriptions (continued) Field Description This 3-bit field defines the length of Phase Buffer Segment 2 in the bit time. The valid programmable values are 1–7. This field can only be written in Freeze mode as it is blocked by hardware in other modes. Phase Buffer Segment 2 = (PSEG2 + 1) x Time-Quanta. 15 BOFFMSK Bus Off Mask This bit provides a mask for the Bus Off Interrupt. 0 1 14 ERRMSK Error Mask This bit provides a mask for the Error Interrupt.
Chapter 42 CAN (FlexCAN) CANx_CTRL1 field descriptions (continued) Field Description This bit provides a mask for the Rx Warning Interrupt associated with the RWRNINT flag in the Error and Status Register. This bit is read as zero when MCR[WRNEN] bit is negated. This bit can only be written if MCR[WRNEN] bit is asserted. 0 1 9–8 Reserved 7 SMP This read-only field is reserved and always has the value zero. CAN Bit Sampling This bit defines the sampling mode of CAN bits at the Rx input.
Memory Map/Register Definition CANx_CTRL1 field descriptions (continued) Field Description This bit configures FlexCAN to operate in Listen-Only Mode. In this mode, transmission is disabled, all error counters are frozen and the module operates in a CAN Error Passive mode. Only messages acknowledged by another CAN station will be received. If FlexCAN detects a message that has not been acknowledged, it will flag a BIT0 error (without changing the REC), as if it was trying to acknowledge the message.
Chapter 42 CAN (FlexCAN) Addresses: CAN0_TIMER is 4002_4000h base + 8h offset = 4002_4008h CAN1_TIMER is 400A_4000h base + 8h offset = 400A_4008h Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 0 R 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 TIMER W Reset 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 CANx_TIMER field descriptions Field Description 31–16 Reserved This read-only field is reserved and always has the value z
Memory Map/Register Definition CANx_RXMGMASK field descriptions (continued) Field Description These bits mask the Mailbox filter bits. Note that the alignment with the ID word of the Mailbox is not perfect as the two most significant MG bits affect the fields RTR and IDE, which are located in the Control and Status word of the Mailbox. The following table shows in detail which MG bits mask each Mailbox filter field.
Chapter 42 CAN (FlexCAN) CANx_RX14MASK field descriptions Field Description 31–0 RX14M[31:0] Rx Buffer 14 Mask Bits Each mask bit masks the corresponding Mailbox 14 filter field in the same way that RXMGMASK masks other Mailboxes' filters. See the description of the CAN_RXMGMASK register. 0 1 The corresponding bit in the filter is "don’t care." The corresponding bit in the filter is checked. 42.3.7 Rx 15 Mask Register (CANx_RX15MASK) This register is located in RAM.
Memory Map/Register Definition 42.3.8 Error Counter (CANx_ECR) This register has two 8-bit fields reflecting the value of two FlexCAN error counters: Transmit Error Counter (TXERRCNT field) and Receive Error Counter (RXERRCNT field). The rules for increasing and decreasing these counters are described in the CAN protocol and are completely implemented in the FlexCAN module. Both counters are read-only except in Freeze Mode, where they can be written by the CPU.
Chapter 42 CAN (FlexCAN) Addresses: CAN0_ECR is 4002_4000h base + 1Ch offset = 4002_401Ch CAN1_ECR is 400A_4000h base + 1Ch offset = 400A_401Ch Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 0 R 0 0 0 0 0 0 0 0 12 11 10 9 8 7 6 RXERRCNT W Reset 13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 4 3 2 1 0 0 0 TXERRCNT 0 0 0 0 0 0 0 0 CANx_ECR field descriptions Field 31–16 Reserved Description This read-only field is reserved and always has the v
Memory Map/Register Definition Addresses: CAN0_ESR1 is 4002_4000h base + 20h offset = 4002_4020h CAN1_ESR1 is 400A_4000h base + 20h offset = 400A_4020h 29 28 27 26 25 24 23 22 21 20 19 0 R 18 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 R CRCERR FRMERR STFERR TXWRN RXWRN IDLE TX FLTCONF RX W Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 WAKINT 0 ERRINT 0 BOFFINT Reset ACKERR w1c BIT0ERR w1c BIT1ERR W 17 RWRNINT
Chapter 42 CAN (FlexCAN) CANx_ESR1 field descriptions (continued) Field Description Otherwise it will be set when the WRNEN is set again. Writing ‘0’ has no effect. This bit is not updated during Freeze mode. 0 1 15 BIT1ERR No such occurrence The Rx error counter transitioned from less than 96 to greater than or equal to 96. Bit1 Error This bit indicates when an inconsistency occurs between the transmitted and the received bit in a message.
Memory Map/Register Definition CANx_ESR1 field descriptions (continued) Field Description This bit indicates when repetitive errors are occurring during message transmission. This bit is not updated during Freeze mode. 0 1 8 RXWRN Rx Error Warning This bit indicates when repetitive errors are occurring during message reception. This bit is not updated during Freeze mode. 0 1 7 IDLE No such occurrence CAN bus is now IDLE. FlexCAN in Transmission This bit indicates if FlexCAN is transmitting a message.
Chapter 42 CAN (FlexCAN) CANx_ESR1 field descriptions (continued) Field Description 0 1 1 ERRINT No such occurrence FlexCAN module entered ‘Bus Off’ state Error Interrupt This bit indicates that at least one of the Error Bits (bits 15-10) is set. If the corresponding mask bit CTRL1[ERRMSK] is set, an interrupt is generated to the CPU. This bit is cleared by writing it to ‘1’. Writing ‘0’ has no effect.
Memory Map/Register Definition CANx_IMASK2 field descriptions (continued) Field Description 0 1 The corresponding buffer Interrupt is disabled. The corresponding buffer Interrupt is enabled. 42.3.11 Interrupt Masks 1 Register (CANx_IMASK1) This register allows any number of a range of 32 Message Buffer Interrupts to be enabled or disabled. It contains one interrupt mask bit per buffer, enabling the CPU to determine which buffer generates an interrupt after a successful transmission or reception (i.e.
Chapter 42 CAN (FlexCAN) Addresses: CAN0_IFLAG2 is 4002_4000h base + 2Ch offset = 4002_402Ch CAN1_IFLAG2 is 400A_4000h base + 2Ch offset = 400A_402Ch Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 R BUFHI W w1c Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 CANx_IFLAG2 field descriptions Field 31–0 BUFHI Description Buffer MBi Interrupt Each bit flags the corresponding Fle
Memory Map/Register Definition Addresses: CAN0_IFLAG1 is 4002_4000h base + 30h offset = 4002_4030h CAN1_IFLAG1 is 400A_4000h base + 30h offset = 400A_4030h Bit 31 30 29 28 27 26 25 24 23 R BUF31TO8I[bit 8] W w1c 22 21 20 19 18 17 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 R BUF31TO8I[7:0] BUF5I 0 BUF6I 0 BUF7I Reset BUF4TO0I W w1c w1c w1c w1c w1c 0 0 0 Reset 0 0 0 0 0 0 0 0 0 0 0 CANx_IFLAG1
Chapter 42 CAN (FlexCAN) CANx_IFLAG1 field descriptions (continued) Field Description 0 1 5 BUF5I No occurrence of MB6 completing transmission/reception (when MCR[RFEN]=0) or of Rx FIFO almost full (when MCR[RFEN]=1) MB6 completed transmission/reception (when MCR[RFEN]=0) or Rx FIFO almost full (when MCR[RFEN]=1) Buffer MB5 Interrupt or "Frames available in Rx FIFO" When the RFEN bit in the MCR is cleared (Rx FIFO disabled), this bit flags the interrupt for MB5.
Memory Map/Register Definition 42.3.14 Control 2 Register (CANx_CTRL2) This register contains control bits for CAN errors, FIFO features, and mode selection.
Chapter 42 CAN (FlexCAN) CANx_CTRL2 field descriptions (continued) Field Description The number of remaining Mailboxes available will be: (SETUP_MB - 8) - (RFFN x 2) If the Number of Rx FIFO Filters programmed through RFFN exceeds the SETUP_MB value (memory space available) the exceeding ones will not be functional.
Memory Map/Register Definition CANx_CTRL2 field descriptions (continued) Field Description If TASD is 0 then the arbitration start is not delayed, thus the CPU has less time to configure a Tx MB for the next arbitration, but more time is reserved for arbitration. In the other hand, if TASD is 24 then the CPU can configure a Tx MB later and less time is reserved for arbitration.
Chapter 42 CAN (FlexCAN) CANx_CTRL2 field descriptions (continued) Field Description 0 1 15–0 Reserved Rx Mailbox filter’s IDE bit is always compared and RTR is never compared despite mask bits. Enables the comparison of both Rx Mailbox filter’s IDE and RTR bit with their corresponding bits within the incoming frame. Mask bits do apply. This read-only field is reserved and always has the value zero. 1.
Memory Map/Register Definition CANx_ESR2 field descriptions (continued) Field Description already been scanned (i.e. it is behind Tx Arbitration Pointer) during the Tx arbitration process. If there is no inactive Mailbox and only one Tx Mailbox which is being transmitted then VPS is not asserted. VPS is negated upon the start of every Tx arbitration process or upon a write to Control and Status word of any Mailbox.
Chapter 42 CAN (FlexCAN) CANx_CRCR field descriptions (continued) Field Description 22–16 MBCRC CRC Mailbox This field indicates the number of the Mailbox corresponding to the value in TXCRC field. 15 Reserved This read-only field is reserved and always has the value zero. 14–0 TXCRC CRC Transmitted This field indicates the CRC value of the last message transmitted. This field is updated at the same time the Tx Interrupt Flag is asserted. 42.3.
Memory Map/Register Definition CANx_RXFGMASK field descriptions (continued) Field Description Rx FIFO ID Filter Table Elements Format (MCR[IDAM]) Identifier Acceptance Filter Fields RTR IDE RXIDA A FGM[31] FGM[30] FGM[29:1] B FGM[31], FGM[15] FGM[30], FGM[14] C - - RXIDB1 RXIDC2 - - Reserved FGM[0] FGM[29:16], FGM[13:0] - - FGM[31:24], FGM[23:16], FGM[15:8], FGM[7:0] 1.
Chapter 42 CAN (FlexCAN) CANx_RXFIR field descriptions Field Description 31–9 Reserved This read-only field is reserved and always has the value zero. 8–0 IDHIT Identifier Acceptance Filter Hit Indicator This field indicates which Identifier Acceptance Filter was hit by the received message that is in the output of the Rx FIFO. If multiple filters match the incoming message ID then the first matching IDAF found (lowest number) by the matching process is indicated.
Memory Map/Register Definition CANx_RXIMRn field descriptions (continued) Field Description For Rx FIFO ID Filter Table elements, see the RXFGMASK register description. 0 1 The corresponding bit in the filter is "don't care." The corresponding bit in the filter is checked. 42.3.56 Message Buffer Structure The Message Buffer structure used by the FlexCAN module is represented in the following figure.
Chapter 42 CAN (FlexCAN) Table 42-109. Message Buffer Code for Rx buffers (continued) CODE Description Rx Code BEFORE receive New Frame SRV1 Rx Code AFTER successful reception2 RRS3 Comment 0b0100: EMPTY MB is active and empty. EMPTY - FULL - When a frame is received successfully (after move-in process. Refer to Section "Move-in" for details), the CODE field is automatically updated to FULL. 0b0010: FULL MB is full.
Memory Map/Register Definition Table 42-109. Message Buffer Code for Rx buffers (continued) CODE Description Rx Code BEFORE receive New Frame SRV1 Rx Code AFTER successful reception2 RRS3 Comment 0b0110: OVERRUN - MB is being overwritten into a full buffer. OVERRUN Yes FULL - If the CODE field indicates OVERRUN and CPU has serviced the MB, when a new frame is moved to the MB, the code returns to FULL.
Chapter 42 CAN (FlexCAN) Table 42-109. Message Buffer Code for Rx buffers (continued) CODE Description Rx Code BEFORE receive New Frame SRV1 Rx Code AFTER successful reception2 RRS3 Comment 0b1010: RANSWER4 - A frame was configured to recognize a Remote Request Frame and transmit a Response Frame in return. RANSWER - TANSWER(0b111 0) 0 A Remote Answer was configured to recognize a remote request frame received, after that a MB is set to transmit a response frame.
Memory Map/Register Definition Table 42-110. Message Buffer Code for Tx buffers CODE Description Tx Code BEFORE tx frame MBRTR Tx Code AFTER successful transmission Comment 0b1000: INACTIVE MB is not active INACTIVE - - MB does not participate in the arbitration process. 0b1001: ABORT - MB is aborted ABORT - - MB does not participate in the arbitration process. 0b1100: DATA - MB is a Tx Data Frame (MB RTR must be 0) DATA 0 INACTIVE Transmit data frame unconditionally once.
Chapter 42 CAN (FlexCAN) Fixed recessive bit, used only in extended format. It must be set to '1' by the user for transmission (Tx Buffers) and will be stored with the value received on the CAN bus for Rx receiving buffers. It can be received as either recessive or dominant. If FlexCAN receives this bit as dominant, then it is interpreted as arbitration loss.
Memory Map/Register Definition This 3-bit field is only used when LPRIO_EN bit is set in MCR and it only makes sense for Tx mailboxes. These bits are not transmitted. They are appended to the regular ID to define the transmission priority. See Arbitration process. ID — Frame Identifier In Standard Frame format, only the 11 most significant bits (28 to 18) are used for frame identification in both receive and transmit cases. The 18 least significant bits are ignored.
Chapter 42 CAN (FlexCAN) An additional memory area, that starts at 0xE0 and may extend up to 0x2DC (normally occupied by MBs 6 up to 37) depending on the CTRL2[RFFN] field setting, contains the ID Filter Table (configurable from 8 to 128 table elements) that specifies filtering criteria for accepting frames into the FIFO.
Memory Map/Register Definition Table 42-113. ID Table structure (continued) B C RTR IDE RXIDB_0 (Standard = 29-19, Extended = 29-16) RTR IDE RXIDB_1 (Standard = 13-3, Extended = 13-0) RXIDC_0 RXIDC_1 RXIDC_2 RXIDC_3 (Std/Ext = 31-24) (Std/Ext = 23-16) (Std/Ext = 15-8) (Std/Ext = 7-0) = Unimplemented or Reserved RTR — Remote Frame This bit specifies if Remote Frames are accepted into the FIFO if they match the target ID.
Chapter 42 CAN (FlexCAN) 42.4 Functional Description The FlexCAN module is a CAN protocol engine with a very flexible mailbox system for transmitting and receiving CAN frames. The mailbox system is composed by a set of up to 64Message Buffers (MB) that store configuration and control data, time stamp, message ID and data (see Message Buffer Structure).
Functional Description 3. Write the ID word. 4. Write the data bytes. 5. Write the DLC, Control and CODE fields of the Control and Status word to activate the MB. Once the MB is activated in the fourth step, it will participate into the arbitration process and eventually be transmitted according to its priority.
Chapter 42 CAN (FlexCAN) • When FlexCAN exits Bus Off state. • Upon leaving Freeze Mode or Low Power Mode. If the arbitration process does not manage to evaluate all Mailboxes before the CAN bus has reached the first bit of the Intermission field the temporary arbitration winner is invalidated and the FlexCAN will not compete for the CAN bus in the next opportunity.
Functional Description Table 42-114. Composition of the arbitration value when Local Priority is disabled Format Mailbox Arbitration Value (32 bits) Standard (IDE = 0) Standard ID (11 bits) Extended (IDE = 1) Extended ID[28:18] (11 bits) 42.4.2.2.2 RTR (1 bit) IDE (1 bit) - (18 bits) - (1 bit) SRR (1 bit) IDE (1 bit) Extended ID[17:0] (18 bits) RTR (1 bit) Local Priority enabled If Local Priority is desired MCR[LPRIO_EN] must be asserted.
Chapter 42 CAN (FlexCAN) Arbitration process can be triggered in the following situations: • During Rx and Tx frames from CAN CRC field to end of frame. Arbitration start point depends on instantiation parameters NUMBER_OF_MB and TASD. Additionally, TASD value may be changed to optimize the arbitration start point. • During CAN BusOff state from TX_ERR_CNT=124 to 128. Arbitration start point depends on instantiation parameters NUMBER_OF_MB and TASD.
Functional Description • If C/S write is performed in the arbitration winner, a new process is restarted immediately. • If C/S write is performed in a MB whose number is higher than the Tx arbitration pointer, the ongoing arbitration process will scan this MB as normal. 42.4.3 Receive Process To be able to receive CAN frames into a Mailbox, the CPU must prepare it for reception by executing the following steps: 1.
Chapter 42 CAN (FlexCAN) 3. Read the contents of the Mailbox. Once Mailbox is locked now, its contents won’t be modified by FlexCAN Move-in processes. See Section "Move-in". 4. Acknowledge the proper flag at IFLAG registers. 5. Read the Free Running Timer. It is optional but recommended to unlock Mailbox as soon as possible and make it available for reception.
Functional Description 5. Clear the Frames Available in Rx FIFO interrupt by writing 1 to IFLAG[BUF5I] bit (mandatory – releases the MB and allows the CPU to read the next Rx FIFO entry) 42.4.4 Matching Process The matching process scans the MB memory looking for Rx MBs programmed with the same ID as the one received from the CAN bus. If the FIFO is enabled, the priority of scanning can be selected between Mailboxes and FIFO filters.
Chapter 42 CAN (FlexCAN) Table 42-116.
Functional Description If the selected priority is Rx FIFO first: • if the Rx FIFO is a matched structure and is free-to-receive then the Rx FIFO is the matching winner regardless of the scan for Mailboxes; • otherwise (the Rx FIFO is not a matched structure or is not free-to-receive), then the matching winner is searched among Mailboxes as described above.
Chapter 42 CAN (FlexCAN) Table 42-117.
Functional Description Suppose, for example, that the FIFO is disabled, IRMQ is enabled and there are two MBs with the same ID, and FlexCAN starts receiving messages with that ID. Let us say that these MBs are the second and the fifth in the array. When the first message arrives, the matching algorithm will find the first match in MB number 2. The code of this MB is EMPTY, so the message is stored there.
Chapter 42 CAN (FlexCAN) but only one is performed at a given time as described ahead.
Functional Description The move-in process is not atomic, in such a way that it is immediately cancelled by the inactivation of the destination Mailbox (see Section "Message Buffer Inactivation") and in this case the Mailbox may be left partially updated, thus incoherent. The exception is if the move-in destination is an Rx FIFO Message Buffer, then the process cannot be cancelled.
Chapter 42 CAN (FlexCAN) • MCR[AEN] bit must be asserted; • the first CPU action must be the writing of abort code (0b1001) into the CODE field of the Control and Status word. The active MBs configured as transmission must be aborted first and then they may be updated.
Functional Description • CPU reads the CODE field to check if the frame was either transmitted (CODE=0b1000) or aborted (CODE=0b1001). • It is necessary to clear the corresponding IFLAG in order to allow the MB to be reconfigured. 42.4.6.2 Message Buffer Inactivation Inactivation is a mechanism provided to protect the Mailbox against updates by the FlexCAN internal processes, thus allowing the CPU to rely on Mailbox data coherence after having updated it, even in Normal Mode.
Chapter 42 CAN (FlexCAN) FlexCAN. CPU must maintain data coherency in the FIFO region when RFEN is asserted. 42.4.6.3 Message Buffer Lock Mechanism Besides MB inactivation, FlexCAN has another data coherence mechanism for the receive process. When the CPU reads the Control and Status word of an Rx MB with codes FULL or OVERRUN, FlexCAN assumes that the CPU wants to read the whole MB in an atomic operation, and thus it sets an internal lock flag for that MB.
Functional Description Inactivation takes precedence over locking. If the CPU inactivates a locked Rx MB, then its lock status is negated and the MB is marked as invalid for the current matching round. Any pending message on the SMB will not be transferred anymore to the MB. An MB is unlocked when the CPU reads the Free Running Timer Register (see Section "Free Running Timer Register (TIMER)"), or the C/S word of another MB.
Chapter 42 CAN (FlexCAN) Clearing one of those three flags does not affect the state of the other two. An interrupt is generated if an IFLAG bit is asserted and the corresponding mask bit is asserted too. A powerful filtering scheme is provided to accept only frames intended for the target application, thus reducing the interrupt servicing work load.
Functional Description 42.4.8.1 Remote Frames Remote frame is a special kind of frame. The user can program a mailbox to be a Remote Request Frame by writing the mailbox as Transmit with the RTR bit set to '1'. After the remote request frame is transmitted successfully, the mailbox becomes a Receive Message Buffer, with the same ID as before.
Chapter 42 CAN (FlexCAN) • Detection of a dominant bit in the first/second bit of Intermission • Detection of a dominant bit at the 7th bit (last) of End of Frame field (Rx frames) • Detection of a dominant bit at the 8th bit (last) of Error Frame Delimiter or Overload Frame Delimiter 42.4.8.
Functional Description The PRESDIV field controls a prescaler that generates the Serial Clock (Sclock), whose period defines the 'time quantum' used to compose the CAN waveform. A time quantum is the atomic unit of time handled by the CAN engine. f CANCLK f Tq = (Prescaler Value) A bit time is subdivided into three segments2 (reference Figure 42-105 and Table 42-118): • SYNC_SEG: This segment has a fixed length of one time quantum.
Chapter 42 CAN (FlexCAN) Whenever CAN bit is used as a measure of duration (e.g.
Functional Description Note It is the user's responsibility to ensure the bit time settings are in compliance with the CAN standard. For bit time calculations, use an IPT (Information Processing Time) of 2, which is the value implemented in the FlexCAN module. 42.4.8.5 Arbitration and Matching Timing During normal reception and transmission of frames, the matching, arbitration, move-in and move-out processes are executed during certain time windows inside the CAN frame, as shown in the following figures.
Chapter 42 CAN (FlexCAN) concurrent memory access due to the CPU or other internal peripheral. When doing matching and arbitration, FlexCAN needs to scan the whole Message Buffer memory during the available time slot. In order to have sufficient time to do that, the following requirements must be observed: • A valid CAN bit timing must be programmed, as indicated in Table 42-119 • The peripheral clock frequency can not be smaller than the oscillator clock frequency, i.e.
Functional Description As an example, taking the case of 64 MBs, if the oscillator and peripheral clock frequencies are equal and the CAN bit timing is programmed to have 8 time quanta per bit, then the prescaler factor (PRESDIV + 1) should be at least 2. For prescaler factor equal to one and CAN bit timing with 8 time quanta per bit, the ratio between peripheral and oscillator clock frequencies should be at least 2. 42.4.
Chapter 42 CAN (FlexCAN) • Grants write access to the Error Counters Register, which is read-only in other modes • Sets the NOT_RDY and FRZ_ACK bits in MCR After requesting Freeze Mode, the user must wait for the FRZ_ACK bit to be asserted in MCR before executing any other action, otherwise FlexCAN may operate in an unpredictable way. In Freeze mode, all memory mapped registers are accessible, except for CTRL1[CLK_SRC] bit that can be read but cannot be written.
Functional Description The Bus Interface Unit continues to operate, enabling the CPU to access memory mapped registers, except the Rx Mailboxes Global Mask Registers, the Rx Buffer 14 Mask Register, the Rx Buffer 15 Mask Register, the Rx FIFO Global Mask Register. The Rx FIFO Information Register, the Message Buffers, the Rx Individual Mask Registers, and the reserved words within RAM may not be accessed when the module is in Disable Mode.
Chapter 42 CAN (FlexCAN) • CPU removing the Doze Mode request • CPU negating the DOZE bit of the MCR Register • Self Wake mechanism In the Self Wake mechanism, if the SLF_WAK bit in MCR Register was set at the time FlexCAN entered Doze Mode, then upon detection of a recessive to dominant transition on the CAN bus, FlexCAN negates the DOZE bit, requests to resume its clocks and negates the LPM_ACK after the CAN protocol engine recognizes the negation of the Doze Mode request.
Functional Description • Waits for all internal activities like arbitration, matching, move-in and move-out to finish. A pending move-in is not taken into account.
Chapter 42 CAN (FlexCAN) 42.4.10 Interrupts Each one of the message buffers can be an interrupt source, if its corresponding IMASK bit is set. There is no distinction between Tx and Rx interrupts for a particular buffer, under the assumption that the buffer is initialized for either transmission or reception. Each of the buffers has assigned a flag bit in the IFLAG Registers.
Initialization/Application Information • Write access to positions whose bits are all currently read-only results in access error. If at least one of the bits is not read-only then no access error is issued. Write permission to positions or some of their bits can change depending on the mode of operation or transitory state. Refer to register and bit descriptions for details. • Read and write access to unimplemented address space results in access error.
Chapter 42 CAN (FlexCAN) Soft reset is synchronous and has to follow an internal request/acknowledge procedure across clock domains. Therefore, it may take some time to fully propagate its effects. The SOFT_RST bit remains asserted while soft reset is pending, so software can poll this bit to know when the reset has completed. Also, soft reset can not be applied while clocks are shut down in any of the low power modes. The low power mode should be exited and the clocks resumed before applying soft reset.
Initialization/Application Information • If Rx FIFO was enabled, the ID filter table must be initialized • Other entries in each Message Buffer should be initialized as required • Initialize the Rx Individual Mask Registers • Set required interrupt mask bits in the IMASK Registers (for all MB interrupts), in CTRL Register (for Bus Off and Error interrupts) and in MCR Register for Wake-Up interrupt • Negate the HALT bit in MCR Starting with the last event, FlexCAN attempts to synchronize to the CAN bus.
Chapter 43 SPI (DSPI) 43.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The serial peripheral interface module provides a synchronous serial bus for communication between an MCU and an external peripheral device. 43.1.1 Block Diagram The block diagram of this module is as follows: K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Introduction INTC eDMA Slave Bus Interface Clock/Reset SPI DMA and Interrupt Control POPR TX FIFO RX FIFO PUSHR CMD Data Data 32 32 SOUT Shift Register SIN SCK S PI Baud Rate, Delay & Transfer Control PCS[x]/SS/PCSS 8 Figure 43-1. DSPI Block Diagram 43.1.
Chapter 43 SPI (DSPI) • 2 transfer attribute registers • Serial clock with programmable polarity and phase • Various programmable delays • Programmable serial frame size of 4 to 16 bits, expandable by software control • SPI frames longer than 16 bits can be supported using the continuous selection format.
Introduction 43.1.3.1 SPI Configuration The SPI configuration allows the DSPI to send and receive serial data. This configuration allows the DSPI to operate as a basic SPI block with internal FIFOs supporting external queues operation. Transmit data and received data reside in separate FIFOs. The host CPU or a DMA controller read the received data from the receive FIFO and write transmit data to the transmit FIFO. For queued operations the SPI queues can reside in system RAM, external to the DSPI.
Chapter 43 SPI (DSPI) • External stop mode • Debug mode The DSPI enters module-specific modes when the host writes a DSPI register. The MCUspecific modes are controlled by signals, external to the DSPI. The MCU-specific modes are modes that an MCU may enter in parallel to the DSPI block-specific modes. 43.1.4.1 Master Mode Master mode allows the DSPI to initiate and control serial communication. In this mode, the SCK signal and the PCS[x] signals are controlled by the DSPI and configured as outputs. 43.
DSPI Signal Descriptions 43.1.4.5 Debug Mode Debug mode is used for system development and debugging. The MCR[FRZ] bit controls DSPI behavior in the debug mode. If the bit is set, the DSPI stops all serial transfers, when the MCU is in debug mode. If the bit is cleared, the MCU debug mode has no effect on the DSPI. 43.2 DSPI Signal Descriptions This section provides the DSPI signals description. The following table lists the signals that may connect off chip depending on device implementation. Table 43-1.
Chapter 43 SPI (DSPI) 43.2.2 PCS1 - PCS3 — Peripheral Chip Selects 1 - 3 PCS1 - PCS3 are Peripheral Chip Select output signals in master mode. In slave mode, these signals are unused. 43.2.3 PCS4 — Peripheral Chip Select 4 In master mode, PCS4 is a Peripheral Chip Select output signal. In slave mode, this signal is unused. 43.2.4 PCS5/PCSS — Peripheral Chip Select 5/Peripheral Chip Select Strobe PCS5 is a Peripheral Chip Select output signal.
Memory Map/Register Definition 43.3 Memory Map/Register Definition Register accesses to memory addresses that are reserved or undefined result in a transfer error. Write access to the POPR register also results in a transfer error. SPI memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4002_C000 DSPI Module Configuration Register (SPI0_MCR) 32 R/W 0000_4001h 43.3.1/ 1171 4002_C008 DSPI Transfer Count Register (SPI0_TCR) 32 R/W 0000_0000h 43.3.
Chapter 43 SPI (DSPI) SPI memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4002_C084 DSPI Receive FIFO Registers (SPI0_RXFR2) 32 R 0000_0000h 43.3.11/ 1188 4002_C088 DSPI Receive FIFO Registers (SPI0_RXFR3) 32 R 0000_0000h 43.3.11/ 1188 4002_D000 DSPI Module Configuration Register (SPI1_MCR) 32 R/W 0000_4001h 43.3.1/ 1171 4002_D008 DSPI Transfer Count Register (SPI1_TCR) 32 R/W 0000_0000h 43.3.
Memory Map/Register Definition SPI memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400A_C000 DSPI Module Configuration Register (SPI2_MCR) 32 R/W 0000_4001h 43.3.1/ 1171 400A_C008 DSPI Transfer Count Register (SPI2_TCR) 32 R/W 0000_0000h 43.3.2/ 1174 400A_C00C DSPI Clock and Transfer Attributes Register (In Master Mode) (SPI2_CTAR0) 32 R/W 7800_0000h 43.3.
Chapter 43 SPI (DSPI) 43.3.1 DSPI Module Configuration Register (SPIx_MCR) Contains bits to configure various attributes associated with DSPI operations. The HALT and MDIS bits can be changed at any time, but they only take effect on the next frame boundary. Only the HALT and MDIS bits in the MCR can be changed, while the DSPI is in the Running state.
Memory Map/Register Definition SPIx_MCR field descriptions (continued) Field 27 FRZ Description Freeze Enables the DSPI transfers to be stopped on the next frame boundary when the device enters Debug mode. 0 1 26 MTFE Modified Timing Format Enable Enables a modified transfer format to be used. 0 1 25 PCSSE Enables the PCS[5]/ PCSS to operate as a PCS Strobe output signal.
Chapter 43 SPI (DSPI) SPIx_MCR field descriptions (continued) Field 13 DIS_TXF Description Disable Transmit FIFO When the TX FIFO is disabled, the transmit part of the DSPI operates as a simplified double-buffered SPI. This bit can only be written when the MDIS bit is cleared. 0 1 12 DIS_RXF Disable Receive FIFO When the RX FIFO is disabled, the receive part of the DSPI operates as a simplified double-buffered SPI. This bit can only be written when the MDIS bit is cleared.
Memory Map/Register Definition 43.3.2 DSPI Transfer Count Register (SPIx_TCR) TCR contains a counter that indicates the number of SPI transfers made. The transfer counter is intended to assist in queue management. Do not write the TCR when the DSPI is in the Running state.
Chapter 43 SPI (DSPI) Addresses: SPI0_CTAR0 is 4002_C000h base + Ch offset = 4002_C00Ch SPI0_CTAR1 is 4002_C000h base + 10h offset = 4002_C010h SPI1_CTAR0 is 4002_D000h base + Ch offset = 4002_D00Ch SPI1_CTAR1 is 4002_D000h base + 10h offset = 4002_D010h SPI2_CTAR0 is 400A_C000h base + Ch offset = 400A_C00Ch SPI2_CTAR1 is 400A_C000h base + 10h offset = 400A_C010h Bit 31 30 29 28 27 26 25 24 23 PCSSCK 19 18 17 16 LSBFE 20 CPHA 21 CPOL R 22 Reset 0 1 1 1 1 0 0 0 0 0 0 0 0 0
Memory Map/Register Definition SPIx_CTARn field descriptions (continued) Field Description 30–27 FMSZ Frame Size 26 CPOL Clock Polarity The number of bits transferred per frame is equal to the FMSZ field value plus 1. The minimum valid FMSZ field value is 3. Selects the inactive state of the Serial Communications Clock (SCK). This bit is used in both master and slave mode. For successful communication between serial devices, the devices must have identical clock polarities.
Chapter 43 SPI (DSPI) SPIx_CTARn field descriptions (continued) Field Description Selects the prescaler value for the delay between the negation of the PCS signal at the end of a frame and the assertion of PCS at the beginning of the next frame. The PDT field is only used in master mode. See the DT field description for details on how to compute the Delay after Transfer. Refer Delay after Transfer (tDT) for more details.
Memory Map/Register Definition SPIx_CTARn field descriptions (continued) Field Description Table 43-33. Delay Scaler Encoding (continued) Field Value Delay Scaler Value 1110 32768 1111 65536 Refer PCS to SCK Delay (tCSC) for more details. 11–8 ASC After SCK Delay Scaler Selects the scaler value for the After SCK Delay. This field is used only in master mode. The After SCK Delay is the delay between the last edge of SCK and the negation of PCS.
Chapter 43 SPI (DSPI) SPIx_CTARn field descriptions (continued) Field Description Table 43-34. DSPI Baud Rate Scaler (continued) CTARn[BR] Baud Rate Scaler Value 1000 256 1001 512 1010 1024 1011 2048 1100 4096 1101 8192 1110 16384 1111 32768 43.3.4 DSPI Clock and Transfer Attributes Register (In Slave Mode) (SPIx_CTAR_SLAVE) When the DSPI is configured as an SPI bus slave, the CTAR0 register is used.
Memory Map/Register Definition SPIx_CTARn_SLAVE field descriptions (continued) Field Description Selects which edge of SCK causes data to change and which edge causes data to be captured. This bit is used in both master and slave mode. For successful communication between serial devices, the devices must have identical clock phase settings. In Continuous SCK mode, the bit value is ignored and the transfers are done as the CPHA bit is set to 1.
Chapter 43 SPI (DSPI) SPIx_SR field descriptions Field 31 TCF Description Transfer Complete Flag Indicates that all bits in a frame have been shifted out. TCF remains set until it is cleared by writing a 1 to it. 0 1 30 TXRXS TX and RX Status Reflects the run status of the DSPI. 0 1 29 Reserved 28 EOQF End of Queue Flag Indicates that the last entry in a queue has been transmitted when the DSPI is in master mode.
Memory Map/Register Definition SPIx_SR field descriptions (continued) Field Description 21 Reserved This read-only field is reserved and always has the value zero. 20 Reserved This read-only field is reserved and always has the value zero. 19 RFOF Receive FIFO Overflow Flag Indicates an overflow condition in the RX FIFO. The bit is set when the RX FIFO and shift register are full and a transfer is initiated. The bit remains set until it is cleared by writing a 1 to it.
Chapter 43 SPI (DSPI) 43.3.6 DSPI DMA/Interrupt Request Select and Enable Register (SPIx_RSER) RSER controls DMA and interrupt requests. Do not write to the RSER while the DSPI is in the Running state.
Memory Map/Register Definition SPIx_RSER field descriptions (continued) Field Description 26 Reserved This read-only field is reserved and always has the value zero. 25 TFFF_RE Transmit FIFO Fill Request Enable Enables the TFFF flag in the SR to generate a request. The TFFF_DIRS bit selects between generating an interrupt request or a DMA request. 0 1 24 TFFF_DIRS TFFF interrupts or DMA requests are disabled. TFFF interrupts or DMA requests are enabled.
Chapter 43 SPI (DSPI) SPIx_RSER field descriptions (continued) Field Description 15–0 Reserved This read-only field is reserved and always has the value zero. 43.3.7 DSPI PUSH TX FIFO Register In Master Mode (SPIx_PUSHR) PUSHR provides the means to write to the TX FIFO. Data written to this register is transferred to the TX FIFO. Eight- or sixteen-bit write accesses to the PUSHR transfer all 32 register bits to the TX FIFO. The register structure is different in master and slave modes.
Memory Map/Register Definition SPIx_PUSHR field descriptions (continued) Field Description 110 111 27 EOQ End Of Queue Host software uses this bit to signal to the DSPI that the current SPI transfer is the last in a queue. At the end of the transfer, the EOQF bit in the SR is set. 0 1 26 CTCNT Reserved Reserved The SPI data is not the last data to transfer. The SPI data is the last data to transfer. Clear Transfer Counter. Clears the SPI_TCNT field in the TCR register.
Chapter 43 SPI (DSPI) 43.3.8 DSPI PUSH TX FIFO Register In Slave Mode (SPIx_PUSHR_SLAVE) PUSHR provides the means to write to the TX FIFO. Data written to this register is transferred to the TX FIFO. Eight- or sixteen-bit write accesses to the PUSHR transfer all 32 register bits to the TX FIFO. The register structure is different in master and slave modes. In master mode the register provides 16-bit command and 16-bit data to the TX FIFO.
Memory Map/Register Definition SPIx_POPR field descriptions Field Description 31–0 RXDATA Received Data Contains the SPI data from the RX FIFO entry to which the Pop Next Data Pointer points. 43.3.10 DSPI Transmit FIFO Registers (SPIx_TXFRn) TXFRn provide visibility into the TX FIFO for debugging purposes. Each register is an entry in the TX FIFO. The registers are read-only and cannot be modified. Reading the TXFRx registers does not alter the state of the TX FIFO.
Chapter 43 SPI (DSPI) SPIx_RXFRn field descriptions Field 31–0 RXDATA Description Receive Data Contains the received SPI data. 43.4 Functional Description The Serial Peripheral Interface (DSPI) block supports full-duplex, synchronous serial communications between MCUs and peripheral devices. All communications are done with SPI-like protocol. The DSPI has the following configurations: • SPI Configuration in which the DSPI operates as a basic SPI or a queued SPI.
Functional Description Generally more than one slave device can be connected to the DSPI master. 6 Peripheral Chip Select (PCS) signals of the DSPI masters can be used to select which of the slaves to communicate with. Refer to the chip configuration chapter for the number of PCS signals used in this MCU. The three DSPI configurations share transfer protocol and timing properties which are described independently of the configuration in Transfer Formats .
Chapter 43 SPI (DSPI) 43.4.2 Serial Peripheral Interface (SPI) Configuration The SPI Configuration transfers data serially using a shift register and a selection of programmable transfer attributes. The DSPI is in SPI Configuration when the DCONF field in the MCR is 0b00. The SPI frames can be 32 bits long. The host CPU or a DMA controller transfers the SPI data from the external to DSPI RAM queues to a transmit FIFO (TX FIFO) buffer.
Functional Description 43.4.2.3 FIFO Disable Operation The FIFO disable mechanisms allow SPI transfers without using the TX FIFO or RX FIFO. The DSPI operates as a double-buffered simplified SPI when the FIFOs are disabled. The FIFOs are disabled separately; setting the MCR[DIS_TXF] bit disables the TX FIFO, and setting the MCR[DIS_RXF] bit disables the RX FIFO.
Chapter 43 SPI (DSPI) 43.4.2.4.1 Filling the TX FIFO Host software or other intelligent blocks can add (push) entries to the TX FIFO by writing to the PUSHR. When the TX FIFO is not full, the TX FIFO Fill Flag (TFFF) in the SR is set. The TFFF bit is cleared when TX FIFO is full and the DMA controller indicates that a write to PUSHR is complete. Writing a '1' to the TFFF bit also clears it. The TFFF can generate a DMA request or an interrupt request.
Functional Description incremented every time the POPR is read. The maximum value of the field is equal to the maximum implemented RXFR register number and it rolls over after reaching the maximum. 43.4.2.5.1 Filling the RX FIFO The RX FIFO is filled with the received SPI data from the shift register. While the RX FIFO is not full, SPI frames from the shift register are transferred to the RX FIFO. Every time a SPI frame is transferred to the RX FIFO the RX FIFO Counter is incremented by one.
Chapter 43 SPI (DSPI) 43.4.3.1 Baud Rate Generator The Baud Rate is the frequency of the Serial Communication Clock (SCK). The system clock is divided by a prescaler (PBR) and scaler (BR) to produce SCK with the possibility of halving the scaler division. The DBR, PBR and BR fields in the CTAR registers select the frequency of SCK by the formula in the BR field description. The following table shows an example of how to compute the baud rate. Table 43-106.
Functional Description 43.4.3.3 After SCK Delay (tASC) The After SCK Delay is the length of time between the last edge of SCK and the negation of PCS. See Figure 43-94 and Figure 43-95 for illustrations of the After SCK delay. The PASC and ASC fields in the CTARx registers select the After SCK Delay by the formula in the ASC field description. The following table shows an example of how to compute the After SCK delay. Table 43-108.
Chapter 43 SPI (DSPI) 43.4.3.5 Peripheral Chip Select Strobe Enable (PCSS ) The PCSS signal provides a delay to allow the PCS signals to settle after a transition occurs thereby avoiding glitches. When the DSPI is in master mode and the PCSSE bit is set in the MCR, PCSS provides a signal for an external demultiplexer to decode the PCS[0] - PCS[4] signals into as many as 128 glitch-free PCS signals. The following figure shows the timing of the PCSS signal relative to PCS signals.
Functional Description NOTE The clock frequency mentioned in the preceding tables is given as an example. Refer to the clocking chapter for the frequency used to drive this module in the device. 43.4.4 Transfer Formats The SPI serial communication is controlled by the Serial Communications Clock (SCK) signal and the PCS signals. The SCK signal provided by the master device synchronizes shifting and sampling of the data on the SIN and SOUT pins.
Chapter 43 SPI (DSPI) 43.4.4.1 Classic SPI Transfer Format (CPHA = 0) The transfer format shown in following figure is used to communicate with peripheral SPI slave devices where the first data bit is available on the first clock edge. In this format, the master and slave sample their SIN pins on the odd-numbered SCK edges and change the data on their SOUT pins on the even-numbered SCK edges.
Functional Description 43.4.4.2 Classic SPI Transfer Format (CPHA = 1) This transfer format shown in the following figure is used to communicate with peripheral SPI slave devices that require the first SCK edge before the first data bit becomes available on the slave SOUT pin.
Chapter 43 SPI (DSPI) 43.4.4.3 Continuous Selection Format Some peripherals must be deselected between every transfer. Other peripherals must remain selected between several sequential serial transfers. The Continuous Selection Format provides the flexibility to handle the following case. The Continuous Selection Format is enabled for the SPI Configuration by setting the CONT bit in the SPI command.
Functional Description SCK (CPOL = 0) SCK (CPOL = 1) Master SOUT Master SIN PCS tCSC t tCSC = PC S to SCK del ay t ASC t ASC CSC = After SCK delay Figure 43-97. Example of Continuous Transfer (CPHA=1, CONT=1) When using DSPI with continuous selection follow these rules: • All transmit commands must have the same PCSn bits programming. • The CTARs, selected by transmit commands, must be programmed with the same transfer attributes. Only FMSZ field can be programmed differently in these CTARs.
Chapter 43 SPI (DSPI) 43.4.5 Continuous Serial Communications Clock The DSPI provides the option of generating a continuous SCK signal for slave peripherals that require a continuous clock. Continuous SCK is enabled by setting the CONT_SCKE bit in the MCR. Enabling this bit generates the Continuous Serial Communications Clock regardless of the MCR[HALT] bit status.. Continuous SCK is valid in all configurations. Continuous SCK is only supported for CPHA=1.
Functional Description SCK (CPOL = 0) SCK (CPOL = 1) Master SOUT Master SIN PCS tDT Figure 43-98. Continuous SCK Timing Diagram (CONT=0) If the CONT bit in the TX FIFO entry is set, PCS remains asserted between the transfers. Under certain conditions, SCK can continue with PCS asserted, but with no data being shifted out of SOUT (SOUT pulled high). This can cause the slave to receive incorrect data. Those conditions include: • Continuous SCK with CONT bit set, but no data in the transmit FIFO.
Chapter 43 SPI (DSPI) 43.4.6 Slave Mode Operation Constraints Slave mode logic shift register is buffered. This allows data streaming operation, when the DSPI is permanently selected and data is shifted in with a constant rate. The transmit data is transferred at second SCK clock edge of the each frame to the shift register if the SS signal is asserted and any time when transmit data is ready and SS signal is negated.
Functional Description 43.4.7.1 End of Queue Interrupt Request The End of Queue Request indicates that the end of a transmit queue is reached. The End of Queue Request is generated when the EOQ bit in the executing SPI command is set and the EOQF_RE bit in the RSER is set. NOTE This interrupt request is generated when the last bit of the SPI frame with EOQ bit set is transmitted. 43.4.7.2 Transmit FIFO Fill Interrupt or DMA Request The Transmit FIFO Fill Request indicates that the TX FIFO is not full.
Chapter 43 SPI (DSPI) 43.4.7.4 Transmit FIFO Underflow Interrupt Request The Transmit FIFO Underflow Request indicates that an underflow condition in the TX FIFO has occurred. The transmit underflow condition is detected only for the DSPI, operating in slave mode and SPI configuration . The TFUF bit is set when the TX FIFO of a DSPI is empty, and a transfer is initiated from an external SPI master. If the TFUF bit is set while the TFUF_RE bit in the RSER is set, an interrupt request is generated. 43.4.7.
Initialization/Application Information 43.4.8.1 Stop Mode (External Stop Mode) The DSPI supports the stop mode protocol. When a request is made to enter external stop mode, the DSPI block acknowledges the request . If a serial transfer is in progress, the DSPI waits until it reaches the frame boundary before it is ready to have its clocks shut off .While the clocks are shut off, the DSPI memory-mapped logic is not accessible.
Chapter 43 SPI (DSPI) 1. When DSPI executes last command word from a queue, the EOQ bit in the command word is set to indicate to the DSPI that this is the last entry in the queue. 2. At the end of the transfer, corresponding to the command word with EOQ set is sampled, the EOQ flag (EOQF) in the SR is set. 3. The setting of the EOQF flag disables serial transmission and reception of data, putting the DSPI in the STOPPED state. The TXRXS bit is cleared to indicate the STOPPED state. 4.
Initialization/Application Information 43.5.3 Baud Rate Settings The following table shows the baud rate that is generated based on the combination of the baud rate prescaler PBR and the baud rate scaler BR in the CTAR registers. The values calculated assume a 100 MHz system frequency and the double baud rate DBR bit is clear. NOTE The clock frequency mentioned above is given as an example in this chapter. Refer to the clocking chapter for the frequency used to drive this module in the device.
Chapter 43 SPI (DSPI) NOTE The clock frequency mentioned above is given as an example in this chapter. Refer to the clocking chapter for the frequency used to drive this module in the device. Table 43-114. Delay Values Delay Scaler Values Delay Prescaler Values 1 3 5 7 2 20.0 ns 60.0 ns 100.0 ns 140.0 ns 4 40.0 ns 120.0 ns 200.0 ns 280.0 ns 8 80.0 ns 240.0 ns 400.0 ns 560.0 ns 16 160.0 ns 480.0 ns 800.0 ns 1.1 μs 32 320.0 ns 960.0 ns 1.6 μs 2.2 μs 64 640.0 ns 1.9 μs 3.
Initialization/Application Information Push TX FIFO Register TX FIFO Base Transmit Next Data Pointer Entry A (first in) Entry B Entry C Entry D (last in) - Shift Register +1 TX FIFO Counter SOUT -1 Figure 43-100. TX FIFO Pointers and Counter 43.5.5.
Chapter 43 SPI (DSPI) The memory address of the last-in entry in the RX FIFO is computed by the following equation: RX FIFO Base - Base address of RX FIFO RXCTR - RX FIFO counter POPNXTPTR - Pop Next Pointer RX FIFO Depth - Receive FIFO depth, implementation specific K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Initialization/Application Information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1214 Freescale Semiconductor, Inc.
Chapter 44 Inter-Integrated Circuit (I2C) 44.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The inter-integrated circuit (I2C, I2C, or IIC) module provides a method of communication between a number of devices. The interface is designed to operate up to 100 kbit/s with maximum bus loading and timing. The device is capable of operating at higher baud rates, up to a maximum of clock/20, with reduced bus loading.
Introduction • • • • • • 10-bit address extension Support for System Management Bus (SMBus) Specification, version 2 Programmable glitch input filter Low power mode wakeup on slave address match Range slave address support DMA support 44.1.2 Modes of Operation The I2C module's operation in various low power modes is as follows: • Run mode: This is the basic mode of operation. To conserve power in this mode, disable the module.
Chapter 44 Inter-Integrated Circuit (I2C) Address Module Enable Write/Read Interrupt ADDR_DECODE DATA_MUX CTRL_REG FREQ_REG ADDR_REG STATUS_REG DATA_REG Input Sync START STOP Arbitration Control Clock Control In/Out Data Shift Register Address Compare SDA SCL Figure 44-1. I2C Functional Block Diagram 44.2 I2C Signal Descriptions The signal properties of I2C are shown in the following table. Table 44-1.
Memory Map and Register Descriptions I2C memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_6000 I2C Address Register 1 (I2C0_A1) 8 R/W 00h 44.3.1/ 1219 4006_6001 I2C Frequency Divider register (I2C0_F) 8 R/W 00h 44.3.2/ 1219 4006_6002 I2C Control Register 1 (I2C0_C1) 8 R/W 00h 44.3.3/ 1220 4006_6003 I2C Status Register (I2C0_S) 8 R/W 80h 44.3.4/ 1222 4006_6004 I2C Data I/O register (I2C0_D) 8 R/W 00h 44.3.
Chapter 44 Inter-Integrated Circuit (I2C) I2C memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4006_7008 I2C SMBus Control and Status register (I2C1_SMB) 8 R/W 00h 44.3.9/ 1227 4006_7009 I2C Address Register 2 (I2C1_A2) 8 R/W C2h 44.3.10/ 1228 4006_700A I2C SCL Low Timeout Register High (I2C1_SLTH) 8 R/W 00h 44.3.11/ 1229 4006_700B I2C SCL Low Timeout Register Low (I2C1_SLTL) 8 R/W 00h 44.3.12/ 1229 1 0 44.3.
Memory Map and Register Descriptions I2Cx_F field descriptions Field 7–6 MULT Description The MULT bits define the multiplier factor mul. This factor is used along with the SCL divider to generate the I2C baud rate. 00 01 10 11 5–0 ICR mul = 1 mul = 2 mul = 4 Reserved Clock rate Prescales the bus clock for bit rate selection. This field and the MULT field determine the I2C baud rate, the SDA hold time, the SCL start hold time, and the SCL stop hold time.
Chapter 44 Inter-Integrated Circuit (I2C) I2Cx_C1 field descriptions (continued) Field Description 0 1 6 IICIE I2C interrupt enable Enables I2C interrupt requests. 0 1 5 MST When the MST bit is changed from a 0 to a 1, a START signal is generated on the bus and master mode is selected. When this bit changes from a 1 to a 0, a STOP signal is generated and the mode of operation changes from master to slave. Slave mode Master mode Transmit mode select Selects the direction of master and slave transfers.
Memory Map and Register Descriptions I2Cx_C1 field descriptions (continued) Field Description 0 1 All DMA signalling disabled. DMA transfer is enabled and the following conditions trigger the DMA request: • While FACK = 0, a data byte is received, either address or data is transmitted. (ACK/NACK automatic) • While FACK = 0, the first byte received matches the A1 register or is general call address. If any address matching occurs, IAAS and TCF are set.
Chapter 44 Inter-Integrated Circuit (I2C) I2Cx_S field descriptions (continued) Field Description 0 1 5 BUSY Bus busy Indicates the status of the bus regardless of slave or master mode. This bit is set when a START signal is detected and cleared when a STOP signal is detected. 0 1 4 ARBL Bus is idle Bus is busy Arbitration lost This bit is set by hardware when the arbitration procedure is lost. The ARBL bit must be cleared by software, by writing a one to it.
Memory Map and Register Descriptions I2Cx_S field descriptions (continued) Field Description 0 1 Acknowledge signal was received after the completion of one byte of data transmission on the bus No acknowledge signal detected 44.3.
Chapter 44 Inter-Integrated Circuit (I2C) 44.3.6 I2C Control Register 2 (I2Cx_C2) Addresses: I2C0_C2 is 4006_6000h base + 5h offset = 4006_6005h I2C1_C2 is 4006_7000h base + 5h offset = 4006_7005h Bit Read Write Reset 7 6 5 4 3 GCAEN ADEXT HDRS SBRC RMEN 0 0 0 0 0 2 1 0 AD[10:8] 0 0 0 I2Cx_C2 field descriptions Field 7 GCAEN Description General call address enable Enables general call address. 0 1 6 ADEXT Address extension Controls the number of bits used for the slave address.
Memory Map and Register Descriptions 44.3.7 I2C Programmable Input Glitch Filter register (I2Cx_FLT) Addresses: I2C0_FLT is 4006_6000h base + 6h offset = 4006_6006h I2C1_FLT is 4006_7000h base + 6h offset = 4006_7006h Bit 7 Read 0 6 5 4 3 0 0 0 1 0 0 0 FLT Write Reset 2 0 0 0 0 I2Cx_FLT field descriptions Field Description 7 Reserved This read-only field is reserved and always has the value zero. 6–5 Reserved This read-only field is reserved and always has the value zero.
Chapter 44 Inter-Integrated Circuit (I2C) 44.3.9 I2C SMBus Control and Status register (I2Cx_SMB) NOTE When the SCL and SDA signals are held high for a length of time greater than the high timeout period, the SHTF1 flag sets. Before reaching this threshold, while the system is detecting how long these signals are being held high, a master assumes that the bus is free. However, the SHTF1 bit rises in the bus transmission process with the idle bus state.
Memory Map and Register Descriptions I2Cx_SMB field descriptions (continued) Field Description 0 1 4 TCKSEL Timeout counter clock select Selects the clock source of the timeout counter.
Chapter 44 Inter-Integrated Circuit (I2C) I2Cx_A2 field descriptions Field 7–1 SAD Description SMBus address Contains the slave address used by the SMBus. This field is used on the device default address or other related addresses. 0 Reserved This read-only field is reserved and always has the value zero. 44.3.
Functional Description 44.4 Functional Description This section provides a comprehensive functional description of the I2C module. 44.4.1 I2C Protocol The I2C bus system uses a serial data line (SDA) and a serial clock line (SCL) for data transfers. All devices connected to it must have open drain or open collector outputs. A logic AND function is exercised on both lines with external pull-up resistors. The value of these resistors depends on the system.
Chapter 44 Inter-Integrated Circuit (I2C) 44.4.1.1 START Signal The bus is free when no master device is engaging the bus (both SCL and SDA are high). When the bus is free, a master may initiate communication by sending a START signal. A START signal is defined as a high-to-low transition of SDA while SCL is high. This signal denotes the beginning of a new data transfer (each data transfer might contain several bytes of data) and brings all slaves out of their idle states. 44.4.1.
Functional Description If the slave receiver does not acknowledge the master in the ninth bit, the slave must leave SDA high. The master interprets the failed acknowledgement as an unsuccessful data transfer. If the master receiver does not acknowledge the slave transmitter after a data byte transmission, the slave interprets it as an end to data transfer and releases the SDA line.
Chapter 44 Inter-Integrated Circuit (I2C) stop driving SDA output. In this case, the transition from master to slave mode does not generate a STOP condition. Meanwhile, hardware sets a status bit to indicate the loss of arbitration. 44.4.1.7 Clock Synchronization Because wire AND logic is performed on SCL, a high-to-low transition on SCL affects all devices connected on the bus.
Functional Description 44.4.1.9 Clock Stretching The clock synchronization mechanism can be used by slaves to slow down the bit rate of a transfer. After the master drives SCL low, a slave can drive SCL low for the required period and then release it. If the slave's SCL low period is greater than the master's SCL low period, the resulting SCL bus signal's low period is stretched. 44.4.1.10 I2C Divider and Hold Values Table 44-41.
Chapter 44 Inter-Integrated Circuit (I2C) Table 44-41.
Functional Description After the master-transmitter has sent the first byte of the 10-bit address, the slave-receiver sees an I2C interrupt. User software must ensure that for this interrupt, the contents of the Data register are ignored and not treated as valid data. 44.4.2.2 Master-Receiver Addresses a Slave-Transmitter The transfer direction is changed after the second R/W bit.
Chapter 44 Inter-Integrated Circuit (I2C) address matching process.If the Range Address register is programmed to a nonzero value, the range address itself participates in the address matching process. If the RMEN bit is set, any address within the range of values of the Address Register 1 and the Range Address register participates in the address matching process. The Range Address register must be programmed to a value greater than the value of the Address Register 1.
Functional Description the I2C module is an active master, if it detects that SMBCLK low has exceeded the value of TTIMEOUT,MIN, it must generate a stop condition within or after the current data byte in the transfer process. When the I2C module is a slave, if it detects the TTIMEOUT,MIN condition, it resets its communication and is then able to receive a new START condition. 44.4.4.1.
Chapter 44 Inter-Integrated Circuit (I2C) Stop T LOW:SEXT Start T LOW:MEXT ClkAck T LOW:MEXT ClkAck T LOW:MEXT SCL SDA Figure 44-40. Timeout measurement intervals A master is allowed to abort the transaction in progress to any slave that violates the TLOW:SEXT or TTIMEOUT,MIN specifications. To abort the transaction, the master issues a STOP condition at the conclusion of the byte transfer in progress.
Functional Description have the ability to generate the not acknowledge after the transfer of each byte and before the completion of the transaction. This requirement is important because SMBus does not provide any other resend signaling. This difference in the use of the NACK signaling has implications on the specific implementation of the SMBus port, especially in devices that handle critical system data such as the SMBus host and the SBS components.
Chapter 44 Inter-Integrated Circuit (I2C) 44.4.6.1 Byte Transfer Interrupt The transfer complete flag (TCF) bit is set at the falling edge of the ninth clock to indicate the completion of a byte and acknowledgement transfer. When FACK is enabled, TCF is then set at the falling edge of 8th clock to indicate the completion of byte. 44.4.6.
Functional Description The ARBL bit must be cleared (by software) by writing 1 to it. 44.4.6.5 Timeout Interrupt in SMBus When the IICIE bit is set, the I2C module asserts a timeout interrupt (outputs SLTF and SHTF2) upon detection of any of the mentioned timeout conditions, with one exception. The SCL high and SDA high TIMEOUT mechanism must not be used to influence the timeout interrupt output, because this timeout indicates an idle condition on the bus.
Chapter 44 Inter-Integrated Circuit (I2C) NOTE After the system recovers and is in run mode, restart the I2C module if necessary. The SCL line is not held low until the I2C module resets after address matching. The main purpose of this feature is to wake the MCU from stop mode. Data sent on the bus that is the same as a target device address might also wake the target MCU. 44.4.9 DMA Support If the DMAEN bit is cleared and the IICIE bit is set, an interrupt condition generates an interrupt request.
Initialization/Application Information Module Initialization (Master) 1. Write: Frequency Divider register to set the I2C baud rate (example provided in this chapter) 2. Write: Control Register 1 to enable the I2C module and interrupts 3. Initialize RAM variables (IICEN = 1 and IICIE = 1) for transmit data 4. Initialize RAM variables used to achieve the routine shown in the following figure 5. Write: Control Register 1 to enable TX 6. Write: Control Register 1 to enable MST (master mode) 7.
Chapter 44 Inter-Integrated Circuit (I2C) Clear IICIF Y Tx Master mode? N Rx Y Tx/Rx? Last byte transmitted? Y Arbitration lost? N Clear ARBL N N Last byte to be read? RXAK=0? N End of address cycle (master Rx)? Y Y (read) 2nd to last byte to be read? Write next byte to Data reg Set TXACK Address transfer see note 1 N Data transfer see note 2 Tx/Rx? Tx Y Generate stop signal (MST=0) IIAAS=1? Rx SRW=1? N (write) N N Y IIAAS=1? Y N Y Y Y Set TX mode ACK from receiver? N W
Initialization/Application Information Y N SLTF or SHTF2=1? N FACK=1? See typical I2C interrupt routine flow chart Y Clear IICIF Y Tx Master mode? N Rx Y Tx/Rx? Last byte transmitted? Y Last byte to be read? Y N RXAK=0? 2nd to last byte to be read? N N Y N Clear IICIF Y (read) Delay (note 2) Read data and Soft CRC Set TXAK to proper value Delay (note 2) Set TXACK=1 Clear FACK=0 Write next byte to Data reg Switch to Rx mode Generate stop signal (MST=0) Y IAAS=1? Y Delay (note 2
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The UART allows asynchronous serial communication with peripheral devices and CPUs. 45.1.1 Features The UART includes these distinctive features: • Full-duplex operation • Standard mark/space non-return-to-zero (NRZ) format • Selectable IrDA 1.
Introduction • 11-bit break character detection option • Independent FIFO structure for transmit and receive • Two receiver wakeup methods: • Idle line wakeup • Address mark wakeup • Address match feature in receiver to reduce address mark wakeup ISR overhead • Ability to select MSB or LSB to be first bit on wire • Hardware flow control support for request to send (RTS) and clear to send (CTS) signals • Support for ISO 7816 protocol for interfacing with SIM cards and smart cards • Support of T=0 and T=1 pr
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) • Receiver data buffer overrun • Receiver data buffer underflow • Transmit data buffer overflow • Noise error • Framing error • Parity error • Active edge on receive pin • LIN break detect • Receiver framing error detection • Hardware parity generation and checking • 1/16 bit-time noise detection • DMA interface 45.1.2 Modes of operation The UART functions the same in all the normal modes. It has two low power modes: Wait and Stop modes. 45.1.
UART signal descriptions The C1[UARTSWAI] bit does not initiate any power down or power up procedures for the smartcard (ISO-7816) interface. Setting C1[UARTSWAI] does not affect the state of the C2[RE], or C2[TE]. If C1[UARTSWAI] is set, any transmission or reception in progress stops at Wait mode entry. The transmission or reception resumes when either an internal or external interrupt brings the CPU out of Wait mode.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) Table 45-2. UART—Detailed signal descriptions Signal I/O Description CTS I Clear to send. Indicates whether the UART can start to transmit data when flow control is enabled. State meaning Asserted—Data transmission can start. Negated—Data transmission can not start. Timing Assertion—When transmitting device's RTS asserts. Negation—When transmitting device's RTS deasserts. RTS O Request to send.
Memory map and registers UART memory map Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_A000 UART Baud Rate Registers:High (UART0_BDH) 8 R/W 00h 45.3.1/ 1261 4006_A001 UART Baud Rate Registers: Low (UART0_BDL) 8 R/W 04h 45.3.2/ 1262 4006_A002 UART Control Register 1 (UART0_C1) 8 R/W 00h 45.3.3/ 1263 4006_A003 UART Control Register 2 (UART0_C2) 8 R/W 00h 45.3.4/ 1265 4006_A004 UART Status Register 1 (UART0_S1) 8 R C0h 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_A015 UART FIFO Receive Watermark (UART0_RWFIFO) 8 R/W 01h 45.3.21/ 1286 4006_A016 UART FIFO Receive Count (UART0_RCFIFO) 8 R 00h 45.3.22/ 1287 4006_A018 UART 7816 Control Register (UART0_C7816) 8 R/W 00h 45.3.23/ 1288 4006_A019 UART 7816 Interrupt Enable Register (UART0_IE7816) 8 R/W 00h 45.3.
Memory map and registers UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_B009 UART Match Address Registers 2 (UART1_MA2) 8 R/W 00h 45.3.10/ 1275 4006_B00A UART Control Register 4 (UART1_C4) 8 R/W 00h 45.3.11/ 1276 4006_B00B UART Control Register 5 (UART1_C5) 8 R/W 00h 45.3.12/ 1277 4006_B00C UART Extended Data Register (UART1_ED) 8 R 00h 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_B01E UART 7816 Error Threshold Register (UART1_ET7816) 8 R/W 00h 45.3.30/ 1296 4006_B01F UART 7816 Transmit Length Register (UART1_TL7816) 8 R/W 00h 45.3.31/ 1297 4006_C000 UART Baud Rate Registers:High (UART2_BDH) 8 R/W 00h 45.3.
Memory map and registers UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_C013 UART FIFO Transmit Watermark (UART2_TWFIFO) 8 R/W 00h 45.3.19/ 1285 4006_C014 UART FIFO Transmit Count (UART2_TCFIFO) 8 R 00h 45.3.20/ 1286 4006_C015 UART FIFO Receive Watermark (UART2_RWFIFO) 8 R/W 01h 45.3.21/ 1286 4006_C016 UART FIFO Receive Count (UART2_RCFIFO) 8 R 00h 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_D007 UART Data Register (UART3_D) 8 R/W 00h 45.3.8/ 1273 4006_D008 UART Match Address Registers 1 (UART3_MA1) 8 R/W 00h 45.3.9/ 1275 4006_D009 UART Match Address Registers 2 (UART3_MA2) 8 R/W 00h 45.3.10/ 1275 4006_D00A UART Control Register 4 (UART3_C4) 8 R/W 00h 45.3.
Memory map and registers UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4006_D01C UART 7816 Wait N Register (UART3_WN7816) 8 R/W 00h 45.3.28/ 1295 4006_D01D UART 7816 Wait FD Register (UART3_WF7816) 8 R/W 01h 45.3.29/ 1295 4006_D01E UART 7816 Error Threshold Register (UART3_ET7816) 8 R/W 00h 45.3.30/ 1296 4006_D01F UART 7816 Transmit Length Register (UART3_TL7816) 8 R/W 00h 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400E_A011 UART FIFO Control Register (UART4_CFIFO) 8 R/W 00h 45.3.17/ 1283 400E_A012 UART FIFO Status Register (UART4_SFIFO) 8 R/W C0h 45.3.18/ 1284 400E_A013 UART FIFO Transmit Watermark (UART4_TWFIFO) 8 R/W 00h 45.3.19/ 1285 400E_A014 UART FIFO Transmit Count (UART4_TCFIFO) 8 R 00h 45.3.
Memory map and registers UART memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 400E_B005 UART Status Register 2 (UART5_S2) 8 R/W 00h 45.3.6/ 1270 400E_B006 UART Control Register 3 (UART5_C3) 8 R/W 00h 45.3.7/ 1272 400E_B007 UART Data Register (UART5_D) 8 R/W 00h 45.3.8/ 1273 400E_B008 UART Match Address Registers 1 (UART5_MA1) 8 R/W 00h 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UART memory map (continued) Absolute address (hex) Register name 400E_B01B UART 7816 Wait Parameter Register (UART5_WP7816T0) 8 400E_B01B UART 7816 Wait Parameter Register (UART5_WP7816T1) 400E_B01C Width Access (in bits) Reset value Section/ page R/W 0Ah 45.3.26/ 1293 8 R/W 0Ah 45.3.27/ 1294 UART 7816 Wait N Register (UART5_WN7816) 8 R/W 00h 45.3.
Memory map and registers UARTx_BDH field descriptions (continued) Field Description 0 1 6 RXEDGIE RxD Input Active Edge Interrupt Enable RXEDGIE enables the Receive input active edge, RXEDGIF, to generate interrupt requests. 0 1 5 Reserved 4–0 SBR LBKDIF interrupt requests disabled. LBKDIF interrupt requests enabled. Hardware interrupts from RXEDGIF disabled (use polling). RXEDGIF interrupt request enabled. This read-only field is reserved and always has the value zero.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_BDL field descriptions Field 7–0 SBR Description UART Baud Rate Bits The baud rate for the UART is determined by these 13 bits. See Baud rate generation for details NOTE: The baud rate generator is disabled until the C2[TE] bit or the C2[RE] bit is set for the first time after reset.The baud rate generator is disabled when SBR = 0.
Memory map and registers UARTx_C1 field descriptions (continued) Field Description 0 1 4 M 9-bit or 8-bit Mode Select This bit must be set when 7816E is set/enabled. 0 1 3 WAKE Normal - start + 8 data bits (MSB/LSB first as determined by MSBF) + stop. Use - start + 9 data bits (MSB/LSB first as determined by MSBF) + stop.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.4 UART Control Register 2 (UARTx_C2) This register can be read or written at any time.
Memory map and registers UARTx_C2 field descriptions (continued) Field 3 TE Description Transmitter Enable TE enables the UART transmitter.The TE bit can be used to queue an idle preamble by clearing and then setting the TE bit. When 7816E is set/enabled and C7816[TTYPE] = 1, this bit is automatically cleared after the requested block has been transmitted. This condition is detected when TL7816[TLEN] = 0 and four additional characters have been transmitted.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.5 UART Status Register 1 (UARTx_S1) The S1 register provides inputs to the MCU for generation of UART interrupts or DMA requests. This register can also be polled by the MCU to check the status of these bits. To clear a flag, the status register should be read followed by a read or write (depending on interrupt flag type) to the UART Data Register.
Memory map and registers UARTx_S1 field descriptions (continued) Field Description register (D). For more efficient interrupt servicing all data except the final value to be written to the buffer should written to D/C3[T8]. Then S1 can be read before writing the final data value, resulting in the clearing of the TRDE flag.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_S1 field descriptions (continued) Field Description OR is set when software fails to prevent the receive data register from overflowing with data. The OR bit is set immediately after the stop bit has been completely received for the dataword that overflows the buffer and all the other error flags (FE,NF and PF) are prevented from setting.
Memory map and registers 45.3.6 UART Status Register 2 (UARTx_S2) The S2 register provides inputs to the MCU for generation of UART interrupts or DMA requests. Also, this register can be polled by the MCU to check the status of these bits. This register can be read or written at any time, with the exception of the MSBF and RXINV bits which should only be changed by the user between transmit and receive packets.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_S2 field descriptions (continued) Field Description 0 1 4 RXINV LSB (bit0) is the first bit that is transmitted following the start bit. Further, the first bit received after the start bit is identified as bit0. MSB (bit8, bit7 or bit6) is the first bit that is transmitted following the start bit depending on the setting of C1[M] and C1[PE].
Memory map and registers UARTx_S2 field descriptions (continued) Field Description transfer actually takes 13 ETU with the 13th ETU slot being a inactive buffer. Hence in this situation the RAF may deassert one ETU prior to actually being inactive. 0 1 UART receiver idle/inactive waiting for a start bit. UART receiver active (RxD input not idle). 45.3.7 UART Control Register 3 (UARTx_C3) Writing to R8 bit does not have any effect.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_C3 field descriptions (continued) Field Description 0 1 4 TXINV TXD pin is an input in single-wire mode. TXD pin is an output in single-wire mode. Transmit Data Inversion. Setting this bit reverses the polarity of the transmitted data output. In NRZ format, a one is represented by a mark and a zero is represented by a space for normal polarity, and the opposite for inverted polarity.
Memory map and registers NOTE In 8-bit or 9-bit data format, only UART data register (D) needs to be accessed in order to clear the S1[RDRF] bit (assuming receiver buffer level is less than RWFIFO[RXWATER]). The C3 register only needs to be read (prior to the D register) if the ninth bit of data needs to be captured. Likewise the ED register only needs to be read (prior to the D register) if the additional flag data for the dataword needs to be captured.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.9 UART Match Address Registers 1 (UARTx_MA1) The MA1 and MA2 registers are compared to input data addresses when the most significant bit is set and the associated C4[MAEN] bit is set. If a match occurs, the following data is transferred to the data register. If a match fails, the following data is discarded. These registers can be read and written at anytime.
Memory map and registers UARTx_MA2 field descriptions Field 7–0 MA Description Match Address 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_C4 field descriptions (continued) Field Description 0 1 4–0 BRFA The parity bit is the ninth bit in the serial transmission. The parity bit is the tenth bit in the serial transmission. Baud Rate Fine Adjust This bit field is used to add more timing resolution to the average baud frequency, in increments of 1/32. Refer to Baud rate generation for more information. 45.3.
Memory map and registers UARTx_C5 field descriptions (continued) Field Description NOTE: If C2[RIE] is cleared, the RDRF DMA and RDFR interrupt request signals are not asserted when the S1[RDRF] flag is set, regardless of the state of RDMAS. 0 1 4–0 Reserved If C2[RIE] is set and the S1[RDRF] flag is set, the RDFR interrupt request signal is asserted to request interrupt service. If C2[RIE] is set and the S1[RDRF] flag is set, the RDRF DMA request signal is asserted to request a DMA transfer.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_ED field descriptions Field 7 NOISY Description The current received dataword contained in D and C3[R8] was received with noise. 0 1 The dataword was received without noise. The data was received with noise. 6 PARITYE The current received dataword contained in D and C3[R8] was received with a parity error. 5–0 Reserved This read-only field is reserved and always has the value zero.
Memory map and registers UARTx_MODEM field descriptions (continued) Field Description 0 1 2 TXRTSPOL Transmitter request-to-send polarity Controls the polarity of the transmitter RTS. TXRTSPOL does not affect the polarity of the receiver RTS. RTS will remain negated in the active low state unless TXRTSE is set. 0 1 1 TXRTSE Transmitter RTS is active low. Transmitter RTS is active high. Transmitter request-to-send enable Controls RTS before and after a transmission.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_IR field descriptions Field 7–3 Reserved 2 IREN Description This read-only field is reserved and always has the value zero. Infrared enable This bit enables/disables the infrared modulation/demodulation. 0 1 1–0 TNP IR disabled. IR enabled. Transmitter narrow pulse These bits enable whether the UART transmits a 1/16, 3/16, 1/32 or 1/4 narrow pulse. 00 01 10 11 3/16. 1/16. 1/32. 1/4. 45.3.
Memory map and registers UARTx_PFIFO field descriptions Field 7 TXFE Description Transmit FIFO Enable When this bit is set the built in FIFO structure for the transmit buffer is enabled. The size of the FIFO structure is indicated by the TXFIFOSIZE field. If this bit is not set then the transmit buffer operates as a FIFO of depth one dataword regardless of the value in TXFIFOSIZE. Both C2[TE] and C2[RE] must be cleared prior to changing this bit.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.17 UART FIFO Control Register (UARTx_CFIFO) This register provides the ability to program various control bits for FIFO operation. This register may be read or written at any time. Note that writing the TXFLUSH and RXFLUSH bits may result in data loss and requires careful action to prevent unintended / unpredictable behavior, hence it is recommended that TE and RE be cleared prior to flushing the corresponding FIFO.
Memory map and registers UARTx_CFIFO field descriptions (continued) Field Description 0 1 RXUF flag does not generate an interrupt to the host. RXUF flag generates an interrupt to the host. 45.3.18 UART FIFO Status Register (UARTx_SFIFO) This register provides various status information regarding the transmit and receiver buffers/FIFOs, including interrupt information. This register may be written or read at anytime.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_SFIFO field descriptions (continued) Field Description 0 1 0 RXUF No transmit buffer overflow has occurred since the last time the flag was cleared. At least one transmit buffer overflow has occurred since the last time the flag was cleared. Receiver Buffer Underflow Flag This flag indicates that more data has been read from the receive buffer than was present. This bit will assert regardless of the value of CFIFO[RXUFE].
Memory map and registers 45.3.20 UART FIFO Transmit Count (UARTx_TCFIFO) This is a read only register that indicates how many datawords are currently in the transmit buffer/FIFO. It may be read at anytime.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_RWFIFO field descriptions Field 7–0 RXWATER Description Receive Watermark When the number of datawords in the Receive FIFO/buffer is equal to or greater than the value in this register field the event is flagged. An interrupt via S1[RDRF] or a DMA request via C5[RDMAS] will be generated as determined by C5[RDMAS] and C2[RIE] fields.
Memory map and registers 45.3.23 UART 7816 Control Register (UARTx_C7816) The C7816 register is the primary control register for ISO-7816 specific functionality. This register is specific to 7816 functionality and the values in this register have no effect on UART operation and should be ignored if ISO_7816E is not set/enabled. This register may be read at anytime but values should only be changed when the ISO_7816E bit is not set.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) UARTx_C7816 field descriptions (continued) Field Description When this bit is set, all received characters will be searched for a valid initial character. If an invalid initial character is identified then a NACK will be sent if ANACK is set. All received data is discarded and error flags blocked (S1[NF], S1[OR], S1[FE], S1[PF], IS7816[WT], IS7816[CWT], IS7816[BWT], IS7816[GTV]) until a valid initial character is detected.
Memory map and registers UARTx_IE7816 field descriptions Field 7 WTE Description Wait Timer Interrupt Enable 0 1 The assertion of the IS7816[WT] bit will not result in the generation of an interrupt. The assertion of the IS7816[WT] bit will result in the generation of an interrupt.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.25 UART 7816 Interrupt Status Register (UARTx_IS7816) The IS7816 register provides a mechanism to read and clear the interrupt flags. All flags/ interrupts are cleared by writing a "1" to the bit location. Writing a "0" has no effect. All bits are "sticky", meaning they only indicate that the flag condition occurred since the last time the bit was cleared not that the condition currently exists.
Memory map and registers UARTx_IS7816 field descriptions (continued) Field Description 0 1 4 INITD Initial Character Detected Interrupt This flag indicates that a valid initial character was received. This interrupt is cleared by writing `1'. 0 1 3 Reserved 2 GTV Guard Timer Violated Interrupt This flag indicates that one or more of the character guard time, block guard time or guard time were violated. This interrupt is cleared by writing `1'. A guard time (GT, CGT or BGT) has not been violated.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.26 UART 7816 Wait Parameter Register (UARTx_WP7816T0) The WP7816 register contains constants used in the generation of various wait timer counters. To save register space this register is used differently when C7816[TTYPE] = 0 and C7816[TTYPE] = 1. This register may be read at anytime. This register must only be written when C7816[ISO_7816E] is not set.
Memory map and registers 45.3.27 UART 7816 Wait Parameter Register (UARTx_WP7816T1) The WP7816 register contains constants used in the generation of various wait timer counters. To save register space this register is used differently when C7816[TTYPE] = 0 and C7816[TTYPE] = 1. This register maybe read at anytime. This register must only be written when C7816[ISO_7816E] is not set.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.28 UART 7816 Wait N Register (UARTx_WN7816) The WN7816 register contains a parameter that is used in the calculation of the guard time counter. This register may be read at anytime. This register must only be written when C7816[ISO_7816E] is not set.
Memory map and registers UARTx_WF7816 field descriptions Field 7–0 GTFD Description FD Multiplier This field is used as another multiplier in the calculation of WT and BWT. This values represents a number between 1 and 255. The value of 0 is invalid. This value is NOT used in baud rate generation. See Wait time and guard time parameters and Baud rate generation. 45.3.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.3.31 UART 7816 Transmit Length Register (UARTx_TL7816) The TL7816 register is used to indicate how many characters are contained in the block being transmitted. This register is only used when C7816[TTYPE] = 1. This register may be read at anytime. This register should only be written when C2[TE] is not enabled.
Functional description 45.4.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.4.1.2 Transmission bit order When the S2[MSBF] bit is set, the UART automatically transmits the MSB of the data word as the first bit after the start bit. Likewise the LSB of the data word is transmitted immediately preceding the parity bit (or the stop bit if parity is not enabled).
Functional description Hardware supports odd or even parity. When parity is enabled, the bit immediately preceding the stop bit is the parity bit. When the transmit shift register is not transmitting a frame, the transmit data output signal goes to the idle condition, logic 1. If at any time software clears the C2[TE] bit, the transmitter enable signal goes low and the transmit signal goes idle.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) NOTE When queuing a break character, it will be transmitted following the completion of the data value currently being shifted out from the shift register. This means that if data is queued in the data buffer to be transmitted, the break character will preempt that queued data. The queued data will then be transmitted after the break character is complete. 45.4.1.
Functional description If the clear-to-send operation is disabled, the transmitter ignores the state of CTS. Also, if the transmitter is forced to send a continuous low condition because it is sending a break character, the transmitter ignores the state of CTS regardless of whether the clear-to-send operation is enabled. The transmitter's CTS signal can also be enabled even if the same UART receiver's RTS signal is disabled. 45.4.1.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) C1 in transmission TXD data buffer write C1 1 C1 C2 C2 C3 Break C3 C4 Start Stop Break Break C4 C5 C5 CTS_B RTS_B 1. Cn = transmit characters Figure 45-219. Transmitter RTS and CTS timing diagram K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 Freescale Semiconductor, Inc.
Functional description 45.4.2 Receiver INTERNAL BUS BRFA4:0 RE RAF BAUDRATE GENERATOR STOP MODULE CLOCK DATA BUFFER VARIABLE 12-BIT RECEIVE SHIFT REGISTER START SBR12:0 RECEIVE CONTROL M M10 LBKDE MSBF RXINV SHIFT DIRECTION RxD LOOPS RSRC RECEIVER SOURCE CONTROL PE PT From Transmitter RxD PARITY LOGIC WAKEUP LOGIC IRQ / DMA LOGIC ACTIVE EDGE DETECT DMA Requests IRQ Requests To TxD 7816 LOGIC INFRARED LOGIC Figure 45-220. UART receiver block diagram 45.4.2.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) the data word. All necessary bit ordering is handled automatically by the module hence the format of the data read from receive data buffer is completely independent of the S2[MSBF] setting. 45.4.2.3 Character reception During UART reception, the receive shift register shifts a frame in from the unsynchronized receiver input signal.
Functional description • After every start bit. • After the receiver detects a data bit change from logic 1 to logic 0 (after the majority of data bit samples at RT8, RT9, and RT10 returns a valid logic 1 and the majority of the next RT8, RT9, and RT10 samples returns a valid logic 0). To locate the start bit, data recovery logic does an asynchronous search for a logic 0 preceded by three logic 1s. When the falling edge of a possible start bit occurs, the RT clock begins to count to 16.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) To determine the value of a data bit and to detect noise, recovery logic takes samples at RT8, RT9, and RT10. The following table summarizes the results of the data bit samples. Table 45-229. Data bit recovery RT8, RT9, and RT10 samples Data bit determination Noise flag 000 0 0 001 0 1 010 0 1 011 1 1 100 0 1 101 1 1 110 1 1 111 1 0 Note The RT8, RT9, and RT10 samples do not affect start bit verification.
Functional description In the following figure, the verification samples RT3 and RT5 determine that the first low detected was noise and not the beginning of a start bit. In this example C7816[ISO_7816E] = 0. The RT clock is reset and the start bit search begins again. The noise flag is not set because the noise occurred before the start bit was found.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) PERCEIVED START BIT LSB ACTUAL START BIT RT1 RT1 1 0 0 0 0 0 RT10 0 RT9 1 RT8 1 RT7 1 RT1 SAMPLES RT1 Rx pin input RT9 RT8 RT7 RT6 RT5 RT4 RT3 RT2 RT1 RT16 RT15 RT14 RT13 RT12 RT11 RT6 RT5 RT4 RT3 RT CLOCK COUNT RT2 RT CLOCK RESET RT CLOCK Figure 45-224. Start bit search example 3 (C7816[ISO_7816E] = 0) The following figure shows the effect of noise early in the start bit time.
Functional description START BIT NO START BIT FOUND 0 RT1 RT1 RT1 RT1 RT1 RT1 RT1 RT1 1 0 1 0 0 0 0 0 0 0 0 RT1 1 RT1 1 RT1 1 RT1 1 RT1 1 RT1 1 RT1 1 RT1 1 LSB RT7 1 RT1 SAMPLES RT1 Rx pin input RT1 RT1 RT1 RT1 RT6 RT5 RT4 RT3 RT CLOCK COUNT RT2 RT CLOCK RESET RT CLOCK Figure 45-226. Start bit search example 5 (C7816[ISO_7816E] = 0) In the following figure, a noise burst makes the majority of data samples RT8, RT9, and RT10 high.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.4.2.6 Receiving break characters The UART recognizes a break character when a start bit is followed by eight, nine, or ten logic 0 data bits and a logic 0 where the stop bit should be. Receiving a break character has these effects on UART registers: • Sets the framing error flag, S1[FE]. • Writes an all "0" dataword to the data buffer, which may cause S1[RDRF] to set depending on the watermark and number of values in the data buffer.
Functional description 45.4.2.7 Hardware flow control To support hardware flow control, the receiver can be programmed to automatically deassert and assert RTS. • RTS will remain asserted until the transfer is completed, even if the transmitter is disabled mid way through a data transfer, see Transceiver driver enable using RTS for more details.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.4.2.8.1 Start bit detection When S2[RXINV] is cleared, the first rising edge of the received character corresponds to the start bit. The infrared decoder resets its counter. At this time, the receiver also begins its start bit detection process. Once the start bit is detected, the receiver synchronizes its bit times to this start bit time.
Functional description As the receiver samples an incoming frame, it re-synchronizes the RT clock on any valid falling edge within the frame. Resynchronization within frames will correct a misalignment between transmitter bit times and receiver bit times. 45.4.2.9.1 Slow data tolerance The following figure shows how much a slow received frame can be misaligned without causing a noise error or a framing error.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.4.2.9.2 Fast data tolerance The following figure shows how much a fast received frame can be misaligned. The fast stop bit ends at RT10 instead of RT16 but is still sampled at RT8, RT9, and RT10. IDLE OR NEXT FRAME STOP RT16 RT15 RT14 RT13 RT12 DATA SAMPLES RT11 RT10 RT9 RT8 RT7 RT6 RT5 RT4 RT3 RT2 RT1 RECEIVER RT CLOCK Figure 45-230.
Functional description 45.4.2.10.1 Idle input line wakeup (C1[WAKE] = 0) In this wakeup method, an idle condition on the unsynchronized receiver input signal clears the C2[RWU] bit and wakes the UART. The initial frame or frames of every message contain addressing information. All receivers evaluate the addressing information, and receivers for which the message is addressed process the frames that follow.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.4.2.10.3 Match address operation Match address operation is enabled when the C4[MAEN1] or C4[MAEN2] bit is set. In this function, a frame received by the RX pin with a logic 1 in the bit position immediately preceding the stop bit is considered an address and is compared with the associated MA1 or MA2 register. The frame is only transferred to the receive buffer, and S1[RDRF] is set, if the comparison matches.
Functional description The Table 45-232 lists the available baud divisor fine adjust values. UART baud rate = UART module clock / (16 × (SBR[12:0] + BRFD)) The following table lists some examples of achieving target baud rates with a module clock frequency of 10.2 MHz, with and without fractional fine adjustment. Table 45-232. Baud rates (example: module clock = 10.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) Table 45-233. Baud rate fine adjust (continued) BRFA Baud Rate Fractional Divisor (BRFD) 01101 13/32 = 0.40625 01110 14/32 = 0.4375 01111 15/32 = 0.46875 10000 16/32 = 0.5 10001 17/32 = 0.53125 10010 18/32 = 0.5625 10011 19/32 = 0.59375 10100 20/32 = 0.625 10101 21/32 = 0.65625 10110 22/32 = 0.6875 10111 23/32 = 0.71875 11000 24/32 = 0.75 11001 25/32 = 0.78125 11010 26/32 = 0.8125 11011 27/32 = 0.
Functional description Table 45-234. Configuration of 8-bit data format UART_C1[PE] 0 Start Data Address Parity Stop bit bits bits bits bit 1 8 0 0 1 0 1 1 1 0 1 7 11 1 1 7 0 1. The address bit identifies the frame as an address character. See Receiver wakeup. 45.4.4.2 Nine-bit configuration When UARTx_C1[M] is set and UARTx_C4[M10] is cleared the UART is configured for 9-bit data characters.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 1. The address bit identifies the frame as an address character. 2. The address bit identifies the frame as an address character. Note Unless in 9-bit mode with M10 set, do not use address mark wakeup with parity enabled. 45.4.4.3 Timing examples Timing examples of these configurations in the NRZ mark/space data format are illustrated in the following figures.
Functional description ADDRESS MARK START BIT 8 BIT 7 BIT BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 START BIT 0 STOP BIT BIT Figure 45-236. Nine bits of data with MSB first 45.4.4.3.4 Nine-bit format with parity enabled START BIT 0 BIT BIT 1 BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 START BIT 7 PARITY STOP BIT BIT Figure 45-237. Eight bits of data with LSB first and parity START BIT 7 BIT BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 START BIT 0 PARITY STOP BIT BIT Figure 45-238.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) Enable single-wire operation by setting the C1[LOOPS] bit and the receiver source bit, C1[RSRC]. Setting the C1[LOOPS] bit disables the path from the unsynchronized receiver input signal to the receiver. Setting the C1[RSRC] bit connects the receiver input to the output of the TXD pin driver. Both the transmitter and receiver must be enabled (C2[TE] = 1 and C2[RE] = 1).
Functional description Additionally the module is able to provide automated NACK responses and has programing automated retransmission of failed packets. An assortment of programmable timeouts and guard band times are also supported. The term elemental time unit (ETU) is frequently used in the context of ISO-7816. This concept is used to relate the frequency that the system (UART) is running at and the frequency that data is being transmitted and received.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) When the C7816[INIT] bit is set, the receiver will search all received data for the first valid initial character. All data received which is not a valid initial character will be ignored and all flags resulting from the invalid data will be blocked from asserting. If the C7816[ANACK] bit is set, a NACK will be returned for invalid received initial characters and a RXT interrupt will be generated as programmed. 45.4.7.
Functional description ISO 7816 FORMAT (T=1) START BIT 0 BIT PARITY BIT 1 BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 BIT 7 BIT NEXT START STOP BIT BIT Figure 45-244. ISO 7816 T=1 data format The smallest data unit that is transferred is a block. A block is made up of several data characters and may vary in size depending on the block type. The UART does not provide a mechanism to decode the block type. As part of the block, an LRC or CRC is included.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) (transmission or reception). Block guard time (BGT) is the minimum allowable time between the leading edges of two consecutive characters in opposite directions (transmission then reception or reception then transmission). The GT and WT counters reset whenever C7816[TTYPE] = 1 or C7816[ISO_7816E] = 0 or a new dataword start bit has been received or transmitted as specified by the counter descriptions.
Functional description 45.4.7.6 UART restrictions in ISO-7816 operation Due to the flexibility of the UART module, there are several features and interrupts that are not supported while running in ISO-7816 mode. These restrictions are documented within the register bit definitions. 45.4.8 Infrared interface The UART provides the capability of transmitting narrow pulses to an IR LED and receiving narrow pulses and transforming them to serial bits, which are sent to the UART.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.4.8.2 Infrared receive decoder The infrared receive block converts data from the RXD signal to the receive shift register. A narrow pulse is expected for each zero received and no pulse is expected for each one received. A narrow high pulse is expected for a zero bit when S2[RXINV] is cleared, while a narrow low pulse is expected for a zero bit when S2[RXINV] is set.
System level interrupt sources Table 45-238. UART interrupt sources (continued) Interrupt Source Flag Local enable DMA select Receiver WT WTWE - Receiver CWT CWTE - Receiver BWT BWTE - Receiver INITD INITDE - Receiver TXT TXTE - Receiver RXT RXTE - Receiver GTV GTVE - 45.6.1 RXEDGIF description The S2[RXEDGIF] is set when an active edge is detected on the RxD pin. Hence, the active edge can only be detected when in two wire mode.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 45.6.1.3 Exit from low-power modes The receive input active edge detect circuit is still active on low power modes (wait and stop). An active edge on the receive input brings the CPU out of low power mode if the interrupt is not masked (S2[RXEDGIF]=1). 45.7 DMA operation In the transmitter, flags S1[TDRE] can be configured to assert a DMA transfer request. In the receiver, flag S1[RDRF], can be configured to assert a DMA transfer request.
Application information operate as a depth of one. This is the default/reset behavior of the module and can be adjusted using the PFIFO[RXFE] and PFIFO[TXFE] bits. Individual watermark levels are also provided for transmit and receive. There are multiple ways to ensure that a data block (set of characters) has completed transmission. These methods include: 1. Set TXFIFO[TXWATER] to 0. The TDRE flag will assert when there is no further data in the transmit buffer.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 6. Write to set up interrupt enable bits desired (C3[ORIE], C3[NEIE], C3[PEIE], and C3[FEIE]) 7. Write to set C4[MAEN1] = 0 and C4[MAEN2] = 0. 8. Write to C5 register and configure DMA control register bits as desired for application. 9. Write to set C7816[INIT] = 1,C7816[ TTYPE] = 0, 7C7816[ISO_7816E] = 1. Program C7816[ONACK] and C7816[ANACK] as desired. 10. Write to IE7816 register to set interrupt enable parameters as desired. 11.
Application information 45.8.2.2 Transmission procedure for (C7816[TTYPE] = 1) When the protocol selected is C7816[TTYPE] = 1, data is transferred in blocks. Prior to starting a transmission software should write the size (number of bytes) for the Information Field portion of the block in to the TLEN register. If a CRC is being transmitted for the block the value in TLEN should be one more than the size of the information field. Software should then set C2[TE] = 1, and C2[RE] = 1.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) b. If the TDRE flag is set, or there is space in the transmit buffer, write the data to be transmitted to (C3[T8]/D). A new transmission will not result until data exists in the transmit buffer. 3. Repeat step 2 for each subsequent transmission.
Application information In most applications since the total amount of lost data is known, the application will desire to return the system to a known state. Prior to the S1[OR] flag being cleared all received data will be dropped. To do this the software would: 1. Remove data from the receive data buffer.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) committed to prior to the dataword being fully received. While the NACK is being received it is possible that the application code will read the data buffer such that sufficient room will be made to store the dataword that is being NACKed.
Application information 45.8.7.2 Transceiver driver enable using RTS RS-485 is a multiple drop communication protocol in which the UART transceiver's driver is 3-stated unless that UART is driving. The RTS signal can be used by the transmitter to enable the driver of a transceiver. The polarity of RTS can be matched to the polarity of the transceiver's driver enable signal. Refer to the following figure.
Chapter 45 Universal Asynchronous Receiver/Transmitter (UART) 4. After the WT interrupt has been cleared, the smartcard remains unresponsive. At cycle 9701 the WT interrupt will reasserted. If the intent of clearing the interrupt is such that it does not reassert, the interrupt service routine must remove or clear the condition that originally caused the interrupt to assert prior to clearing the interrupt.
Application information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1340 Freescale Semiconductor, Inc.
Chapter 46 Secured digital host controller (SDHC) 46.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The chapter is intended for a module driver software developer. It describes module-level operation and programming. 46.2 Overview 46.2.
Overview card, which is also known as SDIO card, provides high-speed data I/O with low power consumption for mobile electronic devices. For the sake of simplicity, the figure does not show cards with reduced size or mini cards. Host Controller DMA Interface Crossbar switch Peripheral bus Card Slot Transceiver MMC/SD/SDIO MMC card SD card SDIO card Power Supply Figure 46-1. System connection of the SDHC CE-ATA is a hard drive interface that is optimized for embedded applications storage.
Chapter 46 Secured digital host controller (SDHC) 46.2.
Overview • Designed to work with CE-ATA, SD memory, miniSD memory, SDIO, miniSDIO, SD Combo, MMC, MMC plus, and MMC RS cards • Card bus clock frequency up to 52 MHz • Supports 1-bit / 4-bit SD and SDIO modes, 1-bit / 4-bit / 8-bit MMC modes, 1-bit / 4-bit / 8-bit CE-ATA devices • Up to 200 Mbps of data transfer for SD/SDIO cards using 4 parallel data lines • Up to 416 Mbps of data transfer for MMC cards using 8 parallel data lines in SDR (single data rate) mode • Supports single block, multi-block read and
Chapter 46 Secured digital host controller (SDHC) • MMC 4-bit • MMC 8-bit • CE-ATA 1-bit • CE-ATA 4-bit • CE-ATA 8-bit • Identification mode (up to 400 kHz) • MMC full speed mode (up to 20 MHz) • MMC high speed mode (up to 52 MHz) • SD/SDIO full speed mode (up to 25 MHz) • SD/SDIO high speed mode (up to 50 MHz) 46.3 SDHC signal descriptions Table 46-1. SDHC signal descriptions Signal Description I/O SDHC_DCLK Generated clock used to drive the MMC, SD, SDIO or CE-ATA cards.
Memory map and register definition Table 46-1. SDHC signal descriptions (continued) Signal SDHC_D6 Description I/O DAT6 line in 8-bit mode I/O Not used in other modes SDHC_D7 DAT7 line in 8-bit mode I/O Not used in other modes 46.4 Memory map and register definition This section includes the module memory map and detailed descriptions of all registers.
Chapter 46 Secured digital host controller (SDHC) SDHC memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 400B_1030 Interrupt Status Register (SDHC_IRQSTAT) 32 R/W 0000_0000h 46.4.13/ 1369 400B_1034 Interrupt Status Enable Register (SDHC_IRQSTATEN) 32 R/W 117F_013Fh 46.4.14/ 1375 400B_1038 Interrupt Signal Enable Register (SDHC_IRQSIGEN) 32 R/W 0000_0000h 46.4.
Memory map and register definition SDHC_DSADDR field descriptions (continued) Field Description This register contains the 32-bit system memory address for a DMA transfer. Since the address must be word (4 bytes) align, the least 2 bits are reserved, always 0. When the SDHC stops a DMA transfer, this register points to the system address of the next contiguous data position. It can be accessed only when no transaction is executing (i.e. after a transaction has stopped).
Chapter 46 Secured digital host controller (SDHC) SDHC_BLKATTR field descriptions (continued) Field Description When restoring transfer content prior to issuing a resume command, the host driver shall restore the previously saved block count. NOTE: Although the BLKCNT field is 0 after reset, the read of reset value is 0x1. This is because when XFERTYP[MSBSEL] bit is 0, indicating a single block transfer, the read value of BLKCNT is always 1. 0000h 0001h 0002h ...
Memory map and register definition SDHC_CMDARG field descriptions Field Description 31–0 CMDARG Command Argument The SD/MMC command argument is specified as bits 39-8 of the command format in the SD or MMC specification.This register is write protected when the PRSSTAT[CDIHB0] bit is set. 46.4.4 Transfer Type Register (SDHC_XFERTYP) This register is used to control the operation of data transfers.
Chapter 46 Secured digital host controller (SDHC) Table 46-7. Transfer Type Register Setting for Various Transfer Types (continued) Multi/Single block select Block count enable Block count Function 1 0 Don't care Infinite transfer 1 1 Positive number Multiple transfer 1 1 Zero No data transfer The following table shows the relationship between the XFERTYP[CICEN] and XFERTYP[CCCEN], in regards to the XFERTYP[RSPTYP] as well as the name of the response type. Table 46-8.
Memory map and register definition Address: SDHC_XFERTYP is 400B_1000h base + Ch offset = 400B_100Ch Bit 31 30 29 28 27 26 25 24 23 22 0 18 17 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BCEN DMAEN 0 0 0 CMDTYP W 0 R W Reset 0 0 0 0 0 0 0 0 0 0 DTDSEL 0 CMDINX MSBSEL Reset AC12EN 0 CCCEN 19 CICEN 20 DPSEL R 21 0 0 0 0 RSPTYP SDHC_XFERTYP field descriptions Field Description 31–30 Reserved
Chapter 46 Secured digital host controller (SDHC) SDHC_XFERTYP field descriptions (continued) Field Description This bit is set to 1 to indicate that data is present and shall be transferred using the DAT line. It is set to 0 for the following: • Commands using only the CMD line (for example: CMD52). • Commands with no data transfer, but using the busy signal on DAT[0] line (R1b or R5b, for example: CMD38).
Memory map and register definition SDHC_XFERTYP field descriptions (continued) Field Description 0b 1b Write (host to card) Read (card to host) 3 Reserved This read-only field is reserved and always has the value zero. 2 AC12EN Auto CMD12 Enable Multiple block transfers for memory require a CMD12 to stop the transaction. When this bit is set to 1, the SDHC will issue a CMD12 automatically when the last block transfer has completed.
Chapter 46 Secured digital host controller (SDHC) 46.4.6 Command Response 1 (SDHC_CMDRSP1) This register is used to store part 1 of the response bits from the card.
Memory map and register definition Table 46-13. Response bit definition for each response type Response type Meaning of response Response field Response register R1,R1b (normal response) Card status R[39:8] CMDRSP0 R1b (Auto CMD12 response) Card status for auto CMD12 R[39:8] CMDRSP3 R2 (CID, CSD register) CID/CSD register [127:8] R[127:8] {CMDRSP3[23:0], CMDRSP2, CMDRSP1, CMDRSP0} R3 (OCR register) OCR register for memory R[39:8] CMDRSP0 R4 (OCR register) OCR register for I/O etc.
Chapter 46 Secured digital host controller (SDHC) SDHC_CMDRSP3 field descriptions Field Description 31–0 CMDRSP3 Command Response 3 46.4.9 Buffer Data Port Register (SDHC_DATPORT) This is a 32-bit data port register used to access the internal buffer and it can not be updated in idle mode.
Memory map and register definition Address: SDHC_PRSSTAT is 400B_1000h base + 24h offset = 400B_1024h Bit 31 30 29 28 27 26 25 24 DLSL R 23 22 21 20 19 18 17 0 CLSL 16 CINS Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BREN BWEN RTA WTA SDOFF PEROFF HCKOFF IPGOFF SDSTB DLA CDIHB CIHB W 0 0 0 0 0 0 0 0 0 0 0 0 0 R W Reset 0 0 0 0 SDHC_PRSSTAT field descriptions Field 31–24 DLSL Descript
Chapter 46 Secured digital host controller (SDHC) SDHC_PRSSTAT field descriptions (continued) Field Description The SYSCTL[RSTA] does not effect this bit.A software reset does not effect this bit. 0b 1b 15–12 Reserved 11 BREN This read-only field is reserved and always has the value zero. Buffer Read Enable This status bit is used for non-DMA read transfers. The SDHC may implement multiple buffers to transfer data efficiently. This read only flag indicates that valid data exists in the host side buffer.
Memory map and register definition SDHC_PRSSTAT field descriptions (continued) Field Description During a write transaction, a block gap event interrupt is generated when this bit is changed to 0, as result of the stop at block gap request being set. This status is useful for the host driver in determining when to issue commands during write busy state.
Chapter 46 Secured digital host controller (SDHC) SDHC_PRSSTAT field descriptions (continued) Field Description 0b 1b 3 SDSTB SD Clock Stable This status bit indicates that the internal card clock is stable. This bit is for the host driver to poll clock status when changing the clock frequency. It is recommended to clear SYSCTL[SDCLKEN] bit to remove glitch on the card clock when the frequency is changing.
Memory map and register definition SDHC_PRSSTAT field descriptions (continued) Field Description This status bit is generated if either the DLA or the RTA is set to 1. If this bit is 0, it indicates that the SDHC can issue the next SD/MMC Command. Commands with a busy signal belong to CDIHB (e.g. R1b, R5b type). Except in the case when the command busy is finished, changing from 1 to 0 generates a transfer complete interrupt in the interrupt status register.
Chapter 46 Secured digital host controller (SDHC) Address: SDHC_PROCTL is 400B_1000h base + 28h offset = 400B_1028h Bit 31 30 29 28 27 0 23 22 21 20 19 18 17 16 RWCTL CREQ SABGREQ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 CDTL 0 0 0 R DMAS W Reset 0 0 0 0 0 0 0 0 EMODE 1 0 0 LCTL IABG 0 W D3CD Reset CDSS 0 WECINT 24 WECINS 25 WECRM R 26 DTW 0 0 0 SDHC_PROCTL field descriptions Field Descrip
Memory map and register definition SDHC_PROCTL field descriptions (continued) Field Description This bit is valid only in 4-bit mode, of the SDIO card, and selects a sample point in the interrupt cycle. Setting to 1 enables interrupt detection at the block gap for a multiple block transfer. Setting to 0 disables interrupt detection during a multiple block transfer. If the SDIO card can't signal an interrupt during a multiple block transfer, this bit should be set to 0 to avoid an inadvertent interrupt.
Chapter 46 Secured digital host controller (SDHC) SDHC_PROCTL field descriptions (continued) Field 9–8 DMAS Description DMA Select This field is valid while DMA (SDMA or ADMA) is enabled and selects the DMA operation. 00 01 10 11 7 CDSS Card Detect Signal Selection This bit selects the source for the card detection. 0b 1b 6 CDTL This is bit is enabled while the CDSS is set to 1 and it indicates card insertion. The SDHC supports all four endian modes in data transfer.
Memory map and register definition SDHC_PROCTL field descriptions (continued) Field Description all these transactions. It is not necessary to change for each transaction. When the software issues multiple SD commands, setting the bit once before the first command is sufficient: it is not necessary to reset the bit between commands. 0b 1b LED off LED on 46.4.
Chapter 46 Secured digital host controller (SDHC) SDHC_SYSCTL field descriptions (continued) Field Description • • • • • • • • • • • • 0b 1b 25 RSTC 19–16 DTOCV No reset Reset Software Reset For ALL This reset effects the entire host controller except for the card detection circuit. Register bits of type ROC, RW, RW1C, RWAC are cleared. During its initialization, the host driver shall set this bit to 1 to reset the SDHC.
Memory map and register definition SDHC_SYSCTL field descriptions (continued) Field Description Setting 00h bypasses the frequency prescaler of the SD Clock. Multiple bits must not be set, or the behavior of this prescaler is undefined. The two default divider values can be calculated by the frequency of SDHC clock and the following divisor bits.
Chapter 46 Secured digital host controller (SDHC) SDHC_SYSCTL field descriptions (continued) Field Description • • • • • • 0b 1b 1 HCKEN Continue request is just set, or This bit is set, or Card insertion is detected, or Card removal is detected, or Card external interrupt is detected, or 80 clocks for initialization phase is ongoing SDHC clock will be internally gated off SDHC clock will not be automatically gated off System Clock Enable If this bit is set, system clock will always be active and no au
Memory map and register definition The table below shows the relationship between the CTOE and the CC bits. Table 46-19. SDHC status for CTOE/CC bit combinations Command complete Command timeout error Meaning of the status 0 0 X X 1 Response not received within 64 SDCLK cycles 1 0 Response received The table below shows the relationship between the Transfer Complete and the Data Timeout Error. Table 46-20.
Chapter 46 Secured digital host controller (SDHC) 27 26 25 0 w1c W 24 23 22 21 20 19 18 17 0 DCE CIE CCE CTOE 0 R 28 CEBE 29 DTOE 30 DEBE 31 DMAE Bit AC12E Address: SDHC_IRQSTAT is 400B_1000h base + 30h offset = 400B_1030h w1c w1c w1c w1c w1c w1c w1c w1c 16 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 TC CC 0 R W Reset 0 0 0 0 0 0 0 BRR DINT 0 BWR 0 CINS 0 CRM 0 CINT Reset BGE w1c w1c w1c
Memory map and register definition SDHC_IRQSTAT field descriptions (continued) Field Description 0b 1b 21 DCE Data CRC Error Occurs when detecting a CRC error when transferring read data, which uses the DAT line, or when detecting the Write CRC status having a value other than 010. 0b 1b 20 DTOE No Error Error No Error Error Data Timeout Error Occurs when detecting one of following time-out conditions.
Chapter 46 Secured digital host controller (SDHC) SDHC_IRQSTAT field descriptions (continued) Field 15–9 Reserved 8 CINT Description This read-only field is reserved and always has the value zero. Card Interrupt This status bit is set when an interrupt signal is detected from the external card. In 1-bit mode, the SDHC will detect the Card Interrupt without the SD Clock to support wakeup.
Memory map and register definition SDHC_IRQSTAT field descriptions (continued) Field Description 0b 1b 3 DINT DMA Interrupt Occurs only when the internal DMA finishes the data transfer successfully. Whenever errors occur during data transfer, this bit will not be set. Instead, the DMAE bit will be set. Either Simple DMA or ADMA finishes data transferring, this bit will be set.
Chapter 46 Secured digital host controller (SDHC) 46.4.14 Interrupt Status Enable Register (SDHC_IRQSTATEN) Setting the bits in this register to 1 enables the corresponding interrupt status to be set by the specified event. If any bit is cleared, the corresponding interrupt status bit is also cleared (i.e. when the bit in this register is cleared, the corresponding bit in interrupt status register is always 0).
Memory map and register definition SDHC_IRQSTATEN field descriptions (continued) Field 24 AC12ESEN Description Auto CMD12 Error Status Enable 0b 1b Masked Enabled 23 Reserved This read-only field is reserved and always has the value zero.
Chapter 46 Secured digital host controller (SDHC) SDHC_IRQSTATEN field descriptions (continued) Field Description 0b 1b Masked Enabled 6 CINSEN Card Insertion Status Enable 5 BRRSEN Buffer Read Ready Status Enable 4 BWRSEN Buffer Write Ready Status Enable 3 DINTSEN DMA Interrupt Status Enable 2 BGESEN Block Gap Event Status Enable 0b 1b 0b 1b 0b 1b 0b 1b 0b 1b Masked Enabled Masked Enabled Masked Enabled Masked Enabled Masked Enabled 1 TCSEN Transfer Complete Status Enable 0 CCSEN
Memory map and register definition 46.4.15 Interrupt Signal Enable Register (SDHC_IRQSIGEN) This register is used to select which interrupt status is indicated to the host system as the interrupt. These status bits all share the same interrupt line. Setting any of these bits to 1 enables interrupt generation. The corresponding status register bit will generate an interrupt when the corresponding interrupt signal enable bit is set.
Chapter 46 Secured digital host controller (SDHC) SDHC_IRQSIGEN field descriptions (continued) Field Description 0b 1b 20 DTOEIEN 19 CIEIEN 18 CEBEIEN 17 CCEIEN Masked Enabled Data Timeout Error Interrupt Enable 0b 1b Masked Enabled Command Index Error Interrupt Enable 0b 1b Masked Enabled Command End Bit Error Interrupt Enable 0b 1b Masked Enabled Command CRC Error Interrupt Enable 0b 1b Masked Enabled 16 CTOEIEN Command Timeout Error Interrupt Enable 15–9 Reserved This read-only field i
Memory map and register definition SDHC_IRQSIGEN field descriptions (continued) Field Description 0b 1b 2 BGEIEN Masked Enabled Block Gap Event Interrupt Enable 0b 1b Masked Enabled 1 TCIEN Transfer Complete Interrupt Enable 0 CCIEN Command Complete Interrupt Enable 0b 1b 0b 1b Masked Enabled Masked Enabled 46.4.
Chapter 46 Secured digital host controller (SDHC) • Check errors correspond to bits 1-4. • Set bits 1-4 corresponding to detected errors. • Clear bits 1-4 corresponding to detected errors. 3. Before reading the auto CMD12 error status bit 7. • Set bit 7 to 1 if there is a command that can't be issued. • Clear bit 7 if there is no command to issue. The timing for generating the auto CMD12 error and writing to the command register are asynchronous.
Memory map and register definition SDHC_AC12ERR field descriptions (continued) Field 7 CNIBAC12E Description Command Not Issued By Auto CMD12 Error Setting this bit to 1 means CMD_wo_DAT is not executed due to an auto CMD12 error (D04-D01) in this register. 0b 1b 6–5 Reserved 4 AC12IE This read-only field is reserved and always has the value zero. Auto CMD12 Index Error Occurs if the command index error occurs in response to a command.
Chapter 46 Secured digital host controller (SDHC) 46.4.17 Host Controller Capabilities (SDHC_HTCAPBLT) This register provides the host driver with information specific to the SDHC implementation. The value in this register is the power-on-reset value, and does not change with a software reset. Any write to this register is ignored.
Memory map and register definition SDHC_HTCAPBLT field descriptions (continued) Field 23 SRS Description Suspend/Resume Support This bit indicates whether the SDHC supports suspend / resume functionality. If this bit is 0, the suspend and resume mechanism, as well as the read Wwait, are not supported, and the host driver shall not issue either suspend or resume commands.
Chapter 46 Secured digital host controller (SDHC) 46.4.18 Watermark Level Register (SDHC_WML) Both write and read watermark levels (FIFO threshold) are configurable. There value can range from 1 to 128 words. Both write and read burst lengths are also configurable. There value can range from 1 to 31 words.
Memory map and register definition Forcing a card interrupt will generate a short pulse on the DAT[1] line, and the driver may treat this interrupt as a normal interrupt. The interrupt service routine may skip polling the card interrupt factor as the interrupt is self cleared.
Chapter 46 Secured digital host controller (SDHC) SDHC_FEVT field descriptions (continued) Field Description Forces the IRQSTAT[DEBE] bit to be set. 21 DCE 20 DTOE 19 CIE 18 CEBE 17 CCE 16 CTOE 15–8 Reserved 7 CNIBAC12E 6–5 Reserved 4 AC12IE 3 AC12EBE 2 AC12CE 1 AC12TOE 0 AC12NE Force Event Data CRC Error Forces the IRQSTAT[DCE] bit to be set. Force Event Data Time Out Error Force the IRQSTAT[DTOE] bit to be set. Force Event Command Index Error Forces the IRQSTAT[CCE] bit to be set.
Memory map and register definition 46.4.20 ADMA Error Status Register (SDHC_ADMAES) When an ADMA error interrupt has occurred, the ADMA error states field in this register holds the ADMA state and the ADMA system address register holds the address around the error descriptor. For recovering from this error, the host driver requires the ADMA state to identify the error descriptor address as follows: • ST_STOP: Previous location set in the ADMA System Address register is the error descriptor address.
Chapter 46 Secured digital host controller (SDHC) Address: SDHC_ADMAES is 400B_1000h base + 54h offset = 400B_1054h Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 0 R Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADMADCE ADMALME W 0 0 0 R ADMAES W Reset 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SDHC_ADMAES field descriptions Field 31–4 Reserved 3 ADMADCE Description This read-only field is reserved and alw
Memory map and register definition 46.4.21 ADMA System Address Register (SDHC_ADSADDR) This register contains the physical system memory address used for ADMA transfers.
Chapter 46 Secured digital host controller (SDHC) SDHC_VENDOR field descriptions Field Description 31–28 Reserved This read-only field is reserved and always has the value zero. 27–24 Reserved This read-only field is reserved and always has the value zero. 23–16 INTSTVAL Internal State Value 15–2 Reserved This read-only field is reserved and always has the value zero.
Memory map and register definition 46.4.23 MMC Boot Register (SDHC_MMCBOOT) This register contains the MMC fast boot control register.
Chapter 46 Secured digital host controller (SDHC) SDHC_MMCBOOT field descriptions (continued) Field Description 0011b 0100b 0101b 0110b 0111b ... 1110b 1111b SDCLK x 2^11 SDCLK x 2^12 SDCLK x 2^13 SDCLK x 2^14 SDCLK x 2^15 SDCLK x 2^22 Reserved 46.4.24 Host Controller Version (SDHC_HOSTVER) This register contains the vendor host controller version information. All bits are read only and will read the same as the power-reset value.
Functional description 46.5 Functional description The following sections provide a brief functional description of the major system blocks, including the data buffer, DMA crossbar switch interface, dual-port memory wrapper, data/command controller, clock & reset manager and clock generator. 46.5.
Chapter 46 Secured digital host controller (SDHC) • External DMA mode: • For a read operation, when there are more words received in the buffer than the amount set in the RDWML register, a DMA request is sent out to inform the external DMA to fetch the data. The request will be immediately de-asserted when there is an access on the DATPORT register. If the number of words in the buffer after the current burst meets or exceeds RDWML value, then the DMA request is asserted again.
Functional description System IP Bus or System AHB Bus SDHC Data buffer 31-24 23-16 23-16 15-8 7-0 15-8 7-0 31-24 Figure 46-28. Data swap between system bus and SDHC data buffer in byte little endian mode System IP Bus or System AHB Bus SDHC Data buffer 7-0 15-8 7-0 15-8 31-24 23-16 23-16 31-24 Figure 46-29. Data swap between system bus and SDHC data buffer in half word big endian mode 46.5.1.
Chapter 46 Secured digital host controller (SDHC) The SDHC will not start data transmission until the number of words set in the WML register can be held in the buffer. If the buffer is empty and the host system does not write data in time, the SDHC will stop the SD_CLK to avoid the data buffer under-run situation. 46.5.1.2 Read operation sequence There are three ways to read data from the buffer when the user transfers data to the card: 1. By using the external DMA through the SDHC DMA request signal 2.
Functional description maximum of 128 words. For both read and write, the burst length, can be from 1 word to the maximum of 31 words. The host driver may configure the value according to the system situation and requirement. During a multi-block data transfer, the block length may be set to any value between 1 and 4096 bytes inclusive which satisfies the requirements of the external card. The only restriction is from the external card.
Chapter 46 Secured digital host controller (SDHC) 544 Bytes WLAN Frame 802. .
Functional description Because the DMA burst length can't change during a data transfer for an external DMA transfer, the watermark level (read or write) must be a divisor of the block size. If it is not, transferring of the block may cause buffer under-run (read operation) or over-run (write operation). For example, if the block size is 512 bytes, the watermark level of read (or write) must be a power of two between 1 and 128.
Chapter 46 Secured digital host controller (SDHC) Crossbar switch interface Master Logic D MA Engine System Address R/W indication eSDHC Registers Error Indication Burst Length Data Exchange Buffer Control DMA Request Figure 46-31. DMA crossbar switch interface block 46.5.2.1 Internal DMA request If the watermark level requirement is met in data transfer, and the internal DMA is enabled, the data buffer block sends a DMA request to the crossbar switch interface.
Functional description starts, which is 31 bytes, more than 6 words. The host driver writer may take this variable burst length into account. It is also acceptable to configure the burst length as the divisor of the block size, so that each time the burst length will be the same. 46.5.2.3 Crossbar switch master interface It is possible that the internal DMA engine could fail during the data transfer.
Chapter 46 Secured digital host controller (SDHC) • Valid/Invalid descriptor. • Nop descriptor. • Set data length descriptor. • Set data address descriptor. • Link descriptor. • Interrupt flag and end flag in descriptor. For ADMA2, including the following descriptors: • Valid/Invalid descriptor. • Nop descriptor. • Rsv descriptor. • Set data length & address descriptor. • Link descriptor. • Interrupt flag and end flag in descriptor. ADMA2 deals with the lower 32-bit first, and then the higher 32-bit.
Functional description Table 46-35. Format of the ADMA1 descriptor table (continued) Act2 Act1 Symbol Comment 0 0 nop No operation 0 1 set Set data length 1 0 tran Transfer data Data address 1 1 link Link descriptor Descriptor address Valid 31-28 27-12 Don't care 0000 Data length Valid = 1 indicates this line of descriptor is effective. If Valid = 0 generate ADMA error Interrupt and stop ADMA. End End = 1 indicates current descriptor is the ending one.
Chapter 46 Secured digital host controller (SDHC) Table 46-36. Format of the ADMA2 descriptor table (continued) Valid Valid = 1 indicates this line of descriptor is effective. If valid = 0 generate ADMA error interrupt and stop ADMA. End End = 1 indicates current descriptor is the ending one. Int Int = 1 generates DMA interrupt when this descriptor is done.
Functional description 46.5.2.4.3 ADMA error The ADMA stops whenever any error is encountered. These errors include: • Fetching descriptor error • Transfer error • Data length mismatch error ADMA descriptor error will be generated when it fails to detect 'valid' flag in the descriptor. If ADMA descriptor error occurs, the interrupt is not generated even if the 'interrupt' flag of this descriptor is set.
Chapter 46 Secured digital host controller (SDHC) 2. SD clock and monitor. 3. Command agent. 4. Data agent. 46.5.3.1 SD transceiver In the SD protocol unit, the transceiver is the main control module. It consists of a FSM and control module, from which the control signals for all other three modules are generated. 46.5.3.2 SD clock & monitor This module monitors the signal level on all 8 data lines, the command lines, and directly routes the level values into the register bank.
Functional description CLR_CRC ZERO CRC_IN CRC Bus [0] CRC Bus [1] CRC Bus [2] CRC Bus [3] CRC Bus [4] CRC Bus [5] CRC Bus [6] CRC OUT Figure 46-34. Command CRC Shift Register The CRC polynomials for the CMD are as follows: Generator polynomial: G(x) = x7 + x3 + 1 M(x) = (first bit) * xn + (second bit) * xn-1 +...+ (last bit) * x0 CRC[6:0] = Remainder [(M(x) * x7) / G(x)] 46.5.3.4 Data agent The data agent deals with the transactions on the eight data lines.
Chapter 46 Secured digital host controller (SDHC) 1. Bus clock. 2. SDHC clock. 3. System clock. The module monitors the activities of all other modules, supplies the clocks for them, and when enabled, automatically gates off the corresponding clocks. 46.5.5 Clock generator The clock generator generates the SDHC_CLK by peripheral source clock in two stages. The following diagram illustrates the structure of the divider. The term "base" represents the frequency of peripheral source clock.
Functional description 46.5.6.2 Interrupt in 4-bit mode Since the interrupt and data line 1 share Pin 8 in 4-bit mode, an interrupt will only be sent by the card and recognized by the host during a specific time. This is known as the interrupt period. The SDHC will only sample the level on pin 8 during the interrupt period. At all other times, the host will ignore the level on pin 8, and treat it as the data signal.
Chapter 46 Secured digital host controller (SDHC) SDIO interrupt status latched in the SDHC and to stop driving the interrupt signal to the system interrupt controller. The host driver must issue a CMD52 to clear the card interrupt. After completion of the card interrupt service, the SDIO Interrupt Enable bit is set to 1, and the SDHC starts sampling the interrupt signal again.
Functional description detection or not, the CD pin is always a reference for card detection. Whether the DAT[3] pin or the CD pin is used to detect card insertion, the SDHC will send an interrupt (if enabled) to inform the Host system that a card is inserted. 46.5.8 Power management and wakeup events When there is no operation between the SDHC and the card through the SD bus, the user can completely disable the bus clock and SDHC clock in the chip level clock control module to save power.
Chapter 46 Secured digital host controller (SDHC) • No read or write transfer is active • Data and command lines are not active • No interrupts are pending • Internal data buffer is empty 46.5.9 MMC fast boot In Embedded MultiMediaCard(eMMC4.3) spec, add fast boot feature need hardware support.
Functional description Boot operation will be terminated when all contents of the enabled boot data are sent to the master. After boot operation is executed, the slave shall be ready for CMD1 operation and the master needs to start a normal MMC initialization sequence by sending CMD1.
Chapter 46 Secured digital host controller (SDHC) CLK CMD CMD01 CMD0/Reset S DAT[0] Min 74 clocks required after power is stable to start boot command NOTE 1. 010 E S 512bytes +CRC E S 512bytes +CRC CMD1 RESP CMD2 RESP CMD3 RESP E 50ms max 1 sec.max CMD0 with argument 0xFFFFFFFA Figure 46-38. MultiMediaCard state diagram (alternative boot mode) 46.6 Initialization/application of SDHC All communication between system and cards are controlled by the host.
Initialization/application of SDHC set BCEN bit; if (auto12 command is to use) set AC12EN bit; } } write_reg(CMDARG, ); // configure the command argument write_reg(XFERTYP, wCmd); // set Transfer Type register as wCmd value to issue the command } wait_for_response(cmd_index) { while (CC bit in IRQ Status register is not set); // wait until Command Complete bit is set read IRQ Status register and check if any error bits about Command are set if (any error bits are set) report error; write 1 to clea
Chapter 46 Secured digital host controller (SDHC) Enable card detection irq (1) Wait SDHC interrupt No card presents Check IRQSTAT[CINS] Y es, card presents Clear CINSIEN to disable card detection irq (2) Voltage validation Figure 46-39.
Initialization/application of SDHC • Software reset (host only) is proceed by the write operation on the SYSCTL[RSTD], SYSCTL[RSTC], or SYSCTL[RSTA] bits to reset the data part, command part, or all parts of the host controller, respectively • Card reset (card only). The command, "Go_Idle_State" (CMD0), is the software reset command for all types of MMC cards, SD Memory cards, and CE-ATA cards. This command sets each card into the idle state regardless of the current card state.
Chapter 46 Secured digital host controller (SDHC) 46.6.2.3 Voltage validation All cards should be able to establish communication with the host using any operation voltage in the maximum allowed voltage range specified in the card specification. However, the supported minimum and maximum values for VDD are defined in the Operation Conditions Register (OCR) and may not cover the whole range.
Initialization/application of SDHC return; // } // end of if (no error ... else if (errors other than time-out occur) { // command/response pair is corrupted deal with it by program specific manner; } // of else if (response time-out else { // CMD55 is refuse, it must be MMC card or CE-ATA card if (card is already labelled as SDCombo) { // change label re-label the card as SDIO; ignore the error or report it; return; // card is identified as SDIO card } // of if (card is ...
Chapter 46 Secured digital host controller (SDHC) For MMC operation, the host starts the card identification process in open-drain mode with the identification clock rate lower than 400 kHz and the power voltage higher than 2.7 V. The open drain driver stages on the CMD line allow parallel card operation during card identification. After the bus is activated the host will request the cards to send their valid operation conditions (CMD1).
Initialization/application of SDHC 46.6.3.1 Block write This section discusses the block write access methods. 46.6.3.1.1 Normal write During a block write (CMD24 - 27, CMD60, CMD61), one or more blocks of data are transferred from the host to the card with a CRC appended to the end of each block by the host. If the CRC fails, the card shall indicate the failure on the dat line.
Chapter 46 Secured digital host controller (SDHC) The software flow to write to a card incorporates the internal DMA and the write operation is a multi-block write with the Auto CMD12 enabled. For the other two methods (by means of external DMA or CPU polling status) with different transfer methods, the internal DMA parts should be removed and the alternative steps should be straightforward. The software flow to write to a card is described below: 1.
Initialization/application of SDHC 1. Check the card status, wait until card is ready for data. 2. Set the card block length/size: a. For SD/MMC, use SET_BLOCKLEN (CMD16) b. For SDIO cards or the I/O portion of SDCombo cards, use IO_RW_DIRECT(CMD52) to set the I/O Block Size bit field in the CCCR register (for function 0) or FBR register (for functions 1~7) c. For CE-ATA cards, configure bits 1~0 in the scrControl register 3.
Chapter 46 Secured digital host controller (SDHC) When the write operation is paused, the data transfer inside the host system is not stopped, and the transfer is active until the data buffer is full. Because of this (if not needed), it is recommended to avoid using the suspend command for the SDIO card. This is because when such a command is sent, the SDHC thinks the system will switch to another function on the SDIO card, and flush the data buffer.
Initialization/application of SDHC 3. Set the SDHC block length register to be the same as the block length set for the card in Step 2. 4. Set the SDHC number block register (NOB), nob is 5 (for instance). 5. Disable the buffer read ready interrupt, configure the DMA settings and enable the SDHC DMA when sending the command with data transfer. The XFERTYP[AC12EN] bit should also be set: 6. Wait for the transfer complete interrupt. 7.
Chapter 46 Secured digital host controller (SDHC) 5. Set the SDHC block length register to be the same as the block length set for the card in Step 2. 6. Set the SDHC number block register (NOB), nob is 5 (for instance). 7. Disable the buffer read ready interrupt, configure the DMA setting and enable the eSDHC DMA when sending the command with data transfer. The AC12EN bit should also be set 8. Set the SABGREQ bit. 9. Wait for the Transfer Complete interrupt. 10. Clear the SABGREQ bit. 11.
Initialization/application of SDHC 46.6.3.3.1 Suspend After setting the PROCTL[SABGREQ] bit, the host driver may send a suspend command to switch to another function of the SDIO card. The SDHC does not monitor the content of the response, so it doesn't know if the suspend command succeeded or not. Accordingly, it doesn't de-assert read wait for read pause. To solve this problem, the driver shall not mark the suspend command as a "suspend", (i.e. setting the XFERTYP[CMDTYP] bits to 01).
Chapter 46 Secured digital host controller (SDHC) 46.6.3.4 ADMA usage To use the ADMA in a data transfer, the host driver must prepare the correct descriptor chain prior to sending the read/write command. The steps to accomplish this are: 1. Create a descriptor to set the data length that the current descriptor group is about to transfer. The data length should be even numbers of the block size. 2. Create another descriptor to transfer the data from the address setting in this descriptor.
Initialization/application of SDHC last block is not transferred. On the other hand, if it is within the last block that the CRC error occurs, an auto CMD12 will be sent by the SDHC. In this case, the driver shall resend or re-obtain the last block with a single block transfer. 46.6.3.5.2 Internal DMA error During the data transfer with internal simple DMA, if the DMA engine encounters some error on the system bus, the DMA operation is aborted and DMA error interrupt is sent to the host system.
Chapter 46 Secured digital host controller (SDHC) 2. Invalid descriptor error: For such errors, it is recommended to retrieve the transfer context, reset for the data part and re-create the descriptor chain from the invalid descriptor and issue a new transfer. As the data to transfer now may be less than the previous setting, the data length configured in the new descriptor chain should match the new value. 3. Data-length mismatch error: It is similar to recover from this error.
Initialization/application of SDHC When the SDIO interrupt is captured by the SDHC, and the host system is informed by the SDHC asserting the SDHC interrupt line, the interrupt service from the host driver is called. As the interrupt factor is controlled by the external card, the interrupt from the SDIO card must be served before the IRQSTAT[CINT] bit is cleared by written 1. Refer to Card interrupt handling for the card interrupt handling flow. 46.6.
Chapter 46 Secured digital host controller (SDHC) send CMD52 to clear bit EHS at address 0x13 and read after write to confirm EHS bit is cleared; change clock divisor value or configure the system clock feeding into eSDHC to generate the card_clk of the desired value below 25MHz; (data transactions like normal peers) } 46.6.4.
Initialization/application of SDHC if (HS_TIMING is not 0) report the function switch failed and return; change clock divisor value or configure the system clock feeding into eSDHC to generate the card_clk of the desired value below 20MHz; (data transactions like normal peers) } 46.6.4.
Chapter 46 Secured digital host controller (SDHC) 46.6.5.2 ADMA2 operation Set_adma2_descriptor { if (to start data transfer) { // Make sure the address is 32-bit boundary (lower 2-bit are always '00'). Set higher 32-bit of descriptor for this data transfer initial address; Set [31:16] bits data length (byte unit); Set Act bits to '10'; } else if (to fetch descriptor at non-continuous address) { Set Act bits to '11'; // Make sure the address is 32-bit boundary (lower 2-bit are always set to '00').
Initialization/application of SDHC 6. Software need to configure XFERTYP register to start the boot process . In normal boot mode, XFERTYP[CMDINX], XFERTYP[CMDTYP], XFERTYP[RSPTYP], XFERTYP[CICEN], XFERTYP[CCCEN], XFERTYP[AC12EN], XFERTYP[BCEN] and XFERTYP[DMAEN] are kept default value. XFERTYP[DPSEL] bit is set to 1, XFERTYP[DTDSEL] is set to 1, XFERTYP[MSBSEL] is set to 1. Note XFERTYP[DMAEN] should be configured as 0 in polling mode.
Chapter 46 Secured digital host controller (SDHC) is set to 1, DTDSEL is set to 1, MSBSEL is set to 1. Note DMAEN should be configured as 0 in polling mode. And if BCEN is configured as 1 in polling mode, better to configure blk no in Bock Attributes Register to the max value. 7. When the step 6 is configured, boot process will begin. Software need to poll the data buffer ready status to read the data from buffer in time.
Initialization/application of SDHC 3. Software then need to configure BLKATTR register to set block size/no. In DMA mode, it is better to set block number to the max value(16'hffff). 4. Software need to configure PROCTL[DTW]. 5. Software enable ADMA2 by configuring PROCTL[DMAS]. 6. Software need to set at least three pairs ADMA2 descriptor in boot memory (ie, in IRAM, at least 6 words). The first pair descriptor define the start address (ie, IRAM) and data length(ie,512byte*VALUE1) of first part boot code.
Chapter 46 Secured digital host controller (SDHC) stop at block gap when card block counter is equal to this value. And need to configure MMCBOOT[DTOCVACK] bit to select the ack timeout value according to the sd clk frequence. 12. Software need to clear IRQSTAT[TC] and IRQSTAT[BGE] bit. And software need to clear PROCTL[SABGREQ], and set PROCTL[CREQ] to 1 to resume the data transfer. Host will transfer the VALUE2 and VAULE3 data to the destination that is set by descriptor. 13.
Initialization/application of SDHC Table 46-37. Commands for MMC/SD/SDIO/CE-ATA cards (continued) CMD INDEX Type Argument Resp Abbreviation Description CMD1 bcr [31:0] OCR without busy R3 SEND_OP_COND Asks all MMC and SD memory cards in idle state to send their operation conditions register contents in the response on the CMD line. CMD2 bcr [31:0] stuff bits R2 ALL_SEND_CID Asks all cards to send their CID numbers on the CMD line.
Chapter 46 Secured digital host controller (SDHC) Table 46-37. Commands for MMC/SD/SDIO/CE-ATA cards (continued) CMD INDEX Type Argument Resp Abbreviation Description CMD8 adtc [31:0] stuff bits R1 SEND_EXT_CSD The card sends its EXT_CSD register as a block of data, with a block size of 512 bytes. CMD9 ac [31:6] RCA R2 SEND_CSD Addressed card sends its card-specific data (CSD) on the CMD line. R2 SEND_CID Addressed card sends its card-identification (CID) on the CMD line.
Initialization/application of SDHC Table 46-37. Commands for MMC/SD/SDIO/CE-ATA cards (continued) CMD INDEX Type Argument Resp Abbreviation Description CMD25 adtc [31:0] data address R1 WRITE_MULTIPLE_BL Continuously writes blocks of OCK data until a STOP_TRANSMISSION follows. CMD26 adtc [31:0] stuff bits R1 PROGRAM_CID Programming of the card identification register. This command shall be issued only once per card.
Chapter 46 Secured digital host controller (SDHC) Table 46-37. Commands for MMC/SD/SDIO/CE-ATA cards (continued) CMD INDEX Type Argument Resp Abbreviation CMD36 ac [31:0] data address R1 TAG_ERASE_GROUP Sets the address of the last _END erase group within a continuous range to be selected for erase. CMD37 ac [31:0] data address R1 UNTAG_ERASE_GRO Removes one previously UP selected erase group from the erase selection.
Initialization/application of SDHC Table 46-37. Commands for MMC/SD/SDIO/CE-ATA cards (continued) CMD INDEX Type Argument Resp Abbreviation Description CMD56 adtc [31:1] stuff bits R1b GEN_CMD Used either to transfer a data block to the card or to get a data block from the card for general purpose / application specific commands. The size of the data block is set by the SET_BLOCK_LEN command.
Chapter 46 Secured digital host controller (SDHC) Table 46-37. Commands for MMC/SD/SDIO/CE-ATA cards (continued) CMD INDEX Type Argument Resp Abbreviation Description ACMD5110 adtc [31:0] stuff bits R1 SEND_SCR Reads the SD Configuration Register (SCR). 1. CMD3 differs for MMC and SD cards. For MMC cards, it is referred to as SET_RELATIVE_ADDR, with a response type of R1. For SD cards, it is referred to as SEND_RELATIVE_ADDR, with a response type of R6 (with RCA inside). 2.
Software restrictions 46.7.1 Initialization active The driver cannot set SYSCTL[INITA] bit when any of the command line or data lines is active, so the driver must ensure both PRSSTAT[CDIHB] and PRSSTAT[CIHB] bits are cleared. And in order to auto clear the SYSCTL[INITA] bit, the SYSCTL[SDCLKEN] bit must be '1', otherwise no clocks can go out to the card and SYSCTL[INITA] will never clear. 46.7.
Chapter 46 Secured digital host controller (SDHC) 46.7.5 (A)DMA address setting To configure ADMA1/ADMA2/DMA address register, when TC[IRQSTAT] bit is set, the register will always update itself with the internal address value to support dynamic address synchronization, so software must make sure TC[IRQSTAT] bit is cleared prior to configuring ADMA1/ADMA2/DMA address register. 46.7.6 Data port access Data port does not support parallel access.
Software restrictions K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1448 Freescale Semiconductor, Inc.
Chapter 47 Integrated interchip sound (I2S) 47.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. This section discusses the architecture, the programming model, the operating modes, and initialization of integrated interchip sound (I2S) module. The I2S is a full-duplex, serial port that allows the chip to communicate with a variety of serial devices.
Introduction 47.1.1 Block diagram The following figure illustrates the organization of the I2S. It consists of control registers to set up the port, status register, separate transmit and receive circuits with FIFO registers, and separate serial clock and frame sync generation for the transmit and receive sections. The second set of Tx and Rx FIFOs replicates the logic used for the first set of FIFOs.
Chapter 47 Integrated interchip sound (I2S) • Network mode operation allowing multiple devices to share the port with as many as thirty-two time slots • Gated clock mode operation requiring no frame sync • 2 sets of transmit and receive FIFOs. Each of the four FIFOs is 15x32 bits.
Introduction • Asynchronous protocol • Synchronous protocol • Gated clock mode • Synchronous protocol only • I2S mode • AC97 mode • AC97 fixed mode (ACNT[FV] = 0) • AC97 variable mode (ACNT[FV] = 1) These modes can be programmed by several bits in the I2S control registers. The following table lists these operating modes and some of the typical applications in which they can be used: Table 47-1.
Chapter 47 Integrated interchip sound (I2S) The I2S supports both normal and network modes, and these can be selected independently of whether the transmitter and receiver are synchronous or asynchronous. Typically, these protocols are used in a periodic manner, where data transfers at regular intervals, such as at the sampling rate of an external codec. Both modes use the concept of a frame. The beginning of the frame is marked with a frame sync when programmed with continuous clock.
I2S signal descriptions Table 47-2. I2S signal descriptions (continued) Signal Description I/O SRFS Serial receive frame Sync. The SRFS port can be used as an input or output. The frame sync is used by the receiver to synchronize the transfer of data. The frame sync signal can be one bit or one word in length and can occur one bit before the transfer of data or right at the transfer of data. If SRFS is configured as an input, the external device should drive SRFS during the rising edge of STCK or SRCK.
Chapter 47 Integrated interchip sound (I2S) I2S STXD SRXD STCK STFS SRCK SRFS I2S internal continuous clock for TX/RX (RCR[RXDIR] = 1,TCR[TXDIR] = 1, RCR[RFDIR] = 1,TCR[TFDIR] = 1, CR[SYN] = 0) I2S STXD SRXD STCK STFS SRCK SRFS I2S external continuous clock for TX/RX (RCR[RXDIR] = 0,TCR[TXDIR] = 0, RCR[RFDIR] = 0,TCR[TFDIR] = 0, CR[SYN] = 0) I2S STXD SRXD STCK STFS SRCK SRFS I2S internal continuous clock for RX (RCR[RXDIR] = 1, TCR[TXDIR] = 0, RCR[RFDIR] = 1,TCR[TFDIR] = 0, CR[SYN] = 0) I2S external cont
I2S signal descriptions (not used in gated clock) Continuous STCK, SRCK STFS, SRFS Early STFS, SRFS Gated STCK STXD 7 6 4 5 3 2 1 0 7 6 2 1 0 7 6 8-bit Data SRXD 7 6 5 4 3 Bit-length frame sync Word-length frame sync Figure 47-3. Serial clock and frame sync timing The following table shows a list of clock pin configurations. Table 47-3.
Chapter 47 Integrated interchip sound (I2S) Table 47-3.
Memory map/register definition I2S memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4002_F018 I2S Interrupt Enable Register (I2S0_IER) 32 R/W 0000_3003h 47.3.7/ 1469 4002_F01C I2S Transmit Configuration Register (I2S0_TCR) 32 R/W 0000_0200h 47.3.8/ 1473 4002_F020 I2S Receive Configuration Register (I2S0_RCR) 32 R/W 0000_0200h 47.3.9/ 1475 4002_F024 I2S Transmit Clock Control Registers (I2S0_TCCR) 32 R/W 0004_0000h 47.3.
Chapter 47 Integrated interchip sound (I2S) 47.3.1 I2S Transmit Data Registers 0 (I2Sx_TX0) The TX0 registers store the data to be transmitted by the I2S.
Memory map/register definition I2Sx_TX1 field descriptions (continued) Field Description Example: If Tx FIFO0 is in use and you write Data1 - 16 to TX0, Data16 does not overwrite Data1. Data1 15 are stored in the FIFO while Data16 is discarded. Example: If Tx FIFO0 is not in use and you write Data1, Data2 to TX0, then Data2 does not overwrite Data1 and is discarded. NOTE: Enable I2S (CR[I2SEN]=1) before writing to the I2S transmit data registers. 47.3.
Chapter 47 Integrated interchip sound (I2S) I2Sx_RX1 field descriptions (continued) Field Description FIFOs are in use, data is transferred to each data register alternately. RX1 can only be used in twochannel mode of operation. 47.3.5 I2S Control Register (I2Sx_CR) The I2S Control Register (CR) sets up the I2S. I2S reset is controlled by bit 0 in the CR. I2S operating modes are also selected in this register (except AC97 mode which is selected in the ACNT register).
Memory map/register definition I2Sx_CR field descriptions (continued) Field Description This bit provides the option to keep the frame-sync and clock enabled or to disable them after the receive frame in which the receiver is disabled. Writing to this bit has effect only when CR[RE] is disabled.The receiver is disabled by clearing the CR[RE] bit. 0 1 10 TFRCLKDIS Transmit Frame Clock Disable.
Chapter 47 Integrated interchip sound (I2S) I2Sx_CR field descriptions (continued) Field Description 10 11 4 SYN Synchronous Mode. This bit controls whether I2S is in synchronous mode or not. In synchronous mode, the transmit and receive sections of I2S share a common clock port (STCK) and frame sync port (STFS). 0 1 3 NET This bit controls whether I2S is in network mode or not. Network mode not selected. Network mode selected. Receive Enable. Enables the receive section of the I2S.
Memory map/register definition I2Sx_CR field descriptions (continued) Field Description This bit is used to enable/disable the I2S. When disabled, all I2S status bits are preset to the same state produced by the power-on reset, all control bits are unaffected, the contents of Tx and Rx FIFOs are cleared. When I2S is disabled, all internal clocks are disabled (except register access clock). 0 1 I2S is disabled. I2S is enabled. 47.3.
Chapter 47 Integrated interchip sound (I2S) I2Sx_ISR field descriptions Field 31–25 Reserved 24 RFRC Description This read-only field is reserved and always has the value zero. Receive Frame Complete. This flag is set at the end of the frame during which receiver is disabled. If receive frame and clock are not disabled in the same frame, this flag is also set at the end of the frame in which receive frame and clock are disabled.
Memory map/register definition I2Sx_ISR field descriptions (continued) Field Description This flag bit is set when RX1 or Rx FIFO 1 is loaded with a new value and two-channel mode is selected. RDR1 is cleared when the core reads the RX1 register. If Rx FIFO 1 is enabled, RDR1 is cleared when the FIFO is empty.
Chapter 47 Integrated interchip sound (I2S) I2Sx_ISR field descriptions (continued) Field Description This flag is set when the RXSR is filled and ready to transfer to RX0 register or to Rx FIFO 0 (when enabled) and these are already full. If Rx FIFO 0 is enabled, this is indicated by RFF0 flag, else this is indicated by the RDR0 flag. The RXSR is not transferred in this case. The ROE0 flag causes an interrupt if IER[RIE] and IER[ROE0EN] are set. The ROE0 bit is cleared by POR and I2S reset.
Memory map/register definition I2Sx_ISR field descriptions (continued) Field 5 TLS Description Transmit Last Time Slot. This flag indicates the last time slot in a frame. When set, it indicates that the current time slot is the last time slot of the frame. TLS is set at the start of the last transmit time slot and causes the I2S to issue an interrupt (if IER[TIE] and TLSEN are set). TLS is not generated when frame rate is 1 in normal mode of operation.
Chapter 47 Integrated interchip sound (I2S) I2Sx_ISR field descriptions (continued) Field Description 0 TFE0 Transmit FIFO Empty 0. This flag is set when the empty slots in Tx FIFO exceed or are equal to the selected Tx FIFO WaterMark 0 (TFWM0) threshold. The setting of TFE0 only causes an interrupt when IER[TIE] and IER[TFE0EN] are set and Tx FIFO0 is enabled. The TFE0 bit is automatically cleared when the data level in Tx FIFO0 becomes more than the amount specified by the watermark bits.
Memory map/register definition I2Sx_IER field descriptions (continued) Field Description 0 1 22 RDMAE Receive DMA Enable. This bit allows I2S to request for DMA transfers. When enabled, DMA requests are generated when any of the RFF0/1 bits in the ISR are set and if the corresponding RFEN bit is also set. If the corresponding FIFO is disabled, a DMA request is generated when the corresponding RDR bit is set. 0 1 21 RIE This control bit allows the I2S to issue receiver related interrupts to the core.
Chapter 47 Integrated interchip sound (I2S) I2Sx_IER field descriptions (continued) Field Description Each bit controls whether the corresponding status bit in ISR can issue an interrupt to the core or not. 0 1 14 RDR0EN Enable Bit. Each bit controls whether the corresponding status bit in ISR can issue an interrupt to the core or not. 0 1 13 TDE1EN Each bit controls whether the corresponding status bit in ISR can issue an interrupt to the core or not.
Memory map/register definition I2Sx_IER field descriptions (continued) Field Description 0 1 6 RFSEN Enable Bit. Each bit controls whether the corresponding status bit in ISR can issue an interrupt to the core or not. 0 1 5 TLSEN Each bit controls whether the corresponding status bit in ISR can issue an interrupt to the core or not. Each bit controls whether the corresponding status bit in ISR can issue an interrupt to the core or not.
Chapter 47 Integrated interchip sound (I2S) 47.3.8 I2S Transmit Configuration Register (I2Sx_TCR) The TCR directs the transmit operation of the I2S. A power-on reset clears all TCR bits. However, I2S reset does not affect the TCR bits.
Memory map/register definition I2Sx_TCR field descriptions (continued) Field 5 TXDIR Description Transmit clock direction This bit controls the direction and source of the clock signal used to clock the TXSR. Internally generated clock is output through the STCK port. External clock is taken from this port. 0 1 4 TSHFD Transmit clock is external. Transmit clock generated internally Transmit Shift Direction. This bit controls whether the MSB or LSB will be transmitted first in a sample.
Chapter 47 Integrated interchip sound (I2S) 47.3.9 I2S Receive Configuration Register (I2Sx_RCR) RCR directs the receive operation of the I2S. A power-on reset clears all RCR bits. However, I2S reset does not affect the RCR bits.
Memory map/register definition I2Sx_RCR field descriptions (continued) Field Description This bit controls the direction and source of the receive frame sync signal. Internally generated frame sync signal is sent out through the SRFS port and external frame sync is taken from the same port. 0 1 5 RXDIR Receive Clock Direction. This bit controls the direction and source of the clock signal used to clock the RXSR. Internally generated clock is output through the SRCK port.
Chapter 47 Integrated interchip sound (I2S) 47.3.10 I2S Transmit Clock Control Registers (I2Sx_TCCR) The I2S Transmit and Receive Control (TCCR and RCCR) registers are 19-bit, read/write control registers used to direct the operation of the I2S. The Clock and Reset Module (CRM) can source the I2S clock (network clock) from multiple sources and perform fractional division to support commonly used audio bit rates.
Memory map/register definition I2Sx_TCCR field descriptions (continued) Field Description control the amount of valid data in those 32 bits. In AC97 Mode of operation, if word length is set to any value other than 16 bits, it will result in a word length of 20 bits. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 12–8 DC Reserved. Do not program this value. Reserved. Do not program this value. Reserved. Do not program this value. 8 10 12 Reserved.
Chapter 47 Integrated interchip sound (I2S) 47.3.11 I2S Receive Clock Control Registers (I2Sx_RCCR) The I2S Transmit and Receive Control (TCCR and RCCR) registers are 19-bit, read/write control registers used to direct the operation of the I2S. The Clock and Reset Module (CRM) can source the I2S clock (network clock) from multiple sources and perform fractional division to support commonly used audio bit rates.
Memory map/register definition I2Sx_RCCR field descriptions (continued) Field Description used to control the amount of valid data in those 32 bits. In AC97 Mode of operation, if word length is set to any value other than 16 bits, it will result in a word length of 20 bits. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 12–8 DC Number of Bits/Word: 2; Supported in Implementation: No. Number of Bits/Word: 4; Supported in Implementation: No.
Chapter 47 Integrated interchip sound (I2S) Table 47-40.
Memory map/register definition I2Sx_FCSR field descriptions (continued) Field Description 1100 1101 1110 1111 27–24 TFCNT1 Transmit FIFO Counter1. These bits indicate the number of data words in Transmit FIFO. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 23–20 RFWM1 12 data word in receive FIFO. 13 data word in receive FIFO. 14 data word in receive FIFO. 15 data word in receive FIFO. 0 data word in transmit FIFO. 1 data word in transmit FIFO.
Chapter 47 Integrated interchip sound (I2S) I2Sx_FCSR field descriptions (continued) Field Description 1010 1011 1100 1101 1110 1111 19–16 TFWM1 Transmit FIFO Empty WaterMark 1. These bits control the threshold at which the TFE1 flag will be set. The TFE1 flag is set whenever the empty slots in Tx FIFO exceed or are equal to the selected threshold.
Memory map/register definition I2Sx_FCSR field descriptions (continued) Field Description These bits indicate the number of data words in Receive FIFO 0. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1000 1001 1010 1011 1100 1101 1110 1111 11–8 TFCNT0 Transmit FIFO Counter 0. These bits indicate the number of data words in Transmit FIFO 0. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 7–4 RFWM0 0 data word in receive FIFO. 1 data word in receive FIFO.
Chapter 47 Integrated interchip sound (I2S) I2Sx_FCSR field descriptions (continued) Field Description 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 3–0 TFWM0 RFF set when more than or equal to 2 data word have been written to the Receive FIFO. Set when RxFIFO = 2,3.....15 data words RFF set when more than or equal to 3 data word have been written to the Receive FIFO. Set when RxFIFO = 3,4.....
Memory map/register definition I2Sx_FCSR field descriptions (continued) Field Description 1001 TFE set when there are more than or equal to 9 empty slots in Transmit FIFO. (default) Transmit FIFO empty is set when TxFIFO ≤ 6 data. TFE set when there are more than or equal to 10 empty slots in Transmit FIFO. (default) Transmit FIFO empty is set when TxFIFO ≤ 5 data. TFE set when there are more than or equal to 11 empty slots in Transmit FIFO. (default) Transmit FIFO empty is set when TxFIFO ≤ 4 data.
Chapter 47 Integrated interchip sound (I2S) I2Sx_ACNT field descriptions (continued) Field Description This bit specifies whether the next frame will carry an AC97 Write Command or not. The programmer should take care that only one of the bits (WR or RD) is set at a time. When this bit is set, the corresponding tag bits (corresponding to Command Address and Command Data slots of the next Tx frame) are automatically set. This bit is automatically cleared by the I2S after completing transmission of a frame.
Memory map/register definition I2Sx_ACADD field descriptions Field Description 31–19 Reserved This read-only field is reserved and always has the value zero. 18–0 ACADD AC97 Command Address. These bits store the Command Address Slot information (bit 19 of the slot is sent in accordance with the Read and Write Command bits in ACNT register). These bits can be updated by a direct write from the Core. They are also updated with the information received in the incoming Command Address Slot.
Chapter 47 Integrated interchip sound (I2S) I2Sx_ATAG field descriptions Field Description 31–16 Reserved This read-only field is reserved and always has the value zero. 15–0 ATAG AC97 Tag Value. Writing to this register (by the Core) sets the value of the Tx-Tag in AC97 fixed mode of operation. On a read, the Core gets the Rx-Tag Value received (in the last frame) from the Codec. If TIF bit in ACNT register is set, the TAG value is also stored in Rx-FIFO in addition to ATAG register.
Memory map/register definition I2Sx_RMSK field descriptions Field Description 31–0 RMSK Receive Mask. These bits indicate which slot has been masked in the current frame. The Core can write to this register to control the time slots in which the I2S receives data. Each bit has info corresponding to the respective time slot in the frame. RMSK register value must be set before enabling Receiver.Receive mask bits should not be used in I2S Slave mode of operation. 0 1 Valid Time Slot.
Chapter 47 Integrated interchip sound (I2S) I2Sx_ACCEN field descriptions Field Description 31–10 Reserved This read-only field is reserved and always has the value zero. 9–0 ACCEN AC97 Channel Enable. The Core writes a `1' to these bits to enable an AC97 data channel. Writing a `0' has no effect. Bit [0] corresponds to the first data slot in an AC97 frame (Slot #3) and Bit [9] corresponds to the tenth data slot (slot #12). Writes to these bits only have effect in the AC97 Variable mode of operation.
Functional description 47.4.1 Detailed operating mode descriptions The following sections provide detailed descriptions of the above modes. 47.4.1.1 Normal mode Normal mode is the simplest mode of the I2S. It transfers data in one time slot per frame. A time slot is a unit of data and the RCCR[WL] bits define the number of bits in a time slot. In continuous clock mode, a frame sync occurs at the beginning of each frame.
Chapter 47 Integrated interchip sound (I2S) • In gated-external mode, the data word in transmitted on the external clock. • In gated-internal mode, the data word is transmitted whenever data is available in the transmit FIFO. If transmit FIFO 0 is not enabled and the transmit data register empty enable (IER[TDE0EN]) and transmit interrupt enable (IER[TIE]) bits are set, transmit interrupt 0 occurs when the word in I2S_TX0 is shifted to transmit shift (TXSR) register.
Functional description If receive FIFO 0 is enabled and receive interrupt enable (IER[RIE]) and received FIFO 0 full enable (IER[RDR0EN]) bits are set, receive interrupt 0 occurs when the received data word is transferred to the receive FIFO 0 and receive FIFO 0 reaches the selected threshold. This results in receive FIFO full 0 (RFF0) flag to set.
Chapter 47 Integrated interchip sound (I2S) Note A pull-down resistor is required in the gated clock mode, because the clock port is disabled between transmissions. The Tx data register is loaded with the data to be transmitted. On arrival of the clock, this data is transferred to the transmit shift register which gets transmitted on the STXD output.
Functional description Gated CLK TX DATA STXD SRXD RX DATA Figure 47-48. Normal mode timing - external gated clock 47.4.1.2 Network mode Network mode creates a time division multiplexed (TDM) network, such as a TDM CODEC network or a network of DSPs. In continuous clock mode, a frame sync occurs at the beginning of each frame. In this mode, the frame is divided into more than one time slot. During each time slot, one data word can be transferred.
Chapter 47 Integrated interchip sound (I2S) writing to the TX registers or ignoring the time slot as determined by TMSK register bits. The receiver is treated in the same manner and received data is only transferred to the receive data register/FIFO if the corresponding time slot is enabled through RMSK. By using the TMSK and RMSK registers, software only has to service the I2S during valid time slots. This eliminates any overhead associated with unused time slots.
Functional description next time slot. Failing to reload the TX register before the TXSR is finished shifting (empty) causes a transmitter underrun and the TUE error bit is set. In case the FIFO is enabled, the ISR[TFE] flag is set in accordance with the watermark setting and this flag causes the transmitter interrupt to occur. Clearing the TE bit disables the transmitter after completion of transmission of the current frame. Setting the TE bit enables transmission from the next frame.
Chapter 47 Integrated interchip sound (I2S) • Read RX and use the data. • Read RX and ignore the data. • Do nothing—the receiver overrun exception occurs at the end of the current time slot. Note For a continuous clock, the optional frame sync output and clock output signals are not affected, even if the transmitter or receiver is disabled. TE and RE do not disable the bit clock or the frame sync generation.
Functional description CLK FS TX DATA 0x5E REG STXD 0x7B 0xD6 0x5E 0x5E 0xD6 0xD6 0xD6 0x7B 0x55 0x5E 0xD6 0x12 0x34 $7B 0x55 0x5E TDE TUE SRXD RX DATA REG 0xD6 0x12 RDR ROE Note: Processor must write ‘1’ to the corresponding TUE/ROE Interrupt status bit in ISR to clear TUE/ROE Interrupt Figure 47-49. Network mode timing - continuous clock 47.4.1.
Chapter 47 Integrated interchip sound (I2S) normal mode), the internal bit clock is enabled onto the appropriate clock port. This allows data to be transferred out in periodic intervals in gated clock mode. With an external clock, the I2S module waits for a clock signal to be received. After the clock begins, valid data is shifted in. Ensure all RCCR[DC] bits are cleared when the module is used in gated mode.
Functional description STCK STXD SRXD TCR[TSCKP] = 1, RCR[RSCKP] = 1 Figure 47-53. External gated mode timing - falling edge clocking/rising edge latching Note • The bit clock signals must not have timing glitches. If a single glitch occurs, all ensuing transfers are out of synchronization.
Chapter 47 Integrated interchip sound (I2S) Table 47-50. I2S mode selection (continued) CR[I2SMODE] Mode type 10 I2S slave mode 11 Normal mode In normal (non-I2S) mode operation, no register bits are forced to any particular state internally, and the user can program the I2S to work in any operating condition.
Functional description • Rx frame sync length set to one-word-long-frame (RCR[RFSL]=0) • Tx shifting w.r.t. bit 0 of TXSR (TCR[TXBIT0] = 1) • Rx shifting w.r.t. bit 0 of RXSR (RCR[RXBIT0] = 1) Set the TCCR[PM, PSR, DIV2, WL, DC] to configure the bit clock and frame sync. The word length is fixed to 32 in I2S master mode and the RCCR[WL] bits determine the number of bits that contain valid data (out of the 32 transmitted/received bits in each channel). 47.4.1.4.
Chapter 47 Integrated interchip sound (I2S) 47.4.1.5 AC97 mode In AC97 mode, the I2S transmits a 16-bit tag slot at the start of a frame and the rest of the slots (in that frame) are all 20-bits wide. The same sequence is followed while receiving data. Refer to the AC97 specification for details regarding transmit and receive sequences and data formats.
Functional description • Tx frame sync initiated one bit before data is transmitted (TCR[TEFS] = 1) • Rx frame sync initiated one bit before data is received (RCR[REFS] = 1) • Tx shifting w.r.t. bit 0 of TXSR (TCR[TXBIT0] = 1) • Rx shifting w.r.t.
Chapter 47 Integrated interchip sound (I2S) While using AC97 in two-channel mode (CR[TCHEN] = 1), it is recommended that the received tag is not stored in the Rx FIFO (ACNT[TIF] = 0). If you need to update the ATAG register and also issue a RD/WR command (in a single frame), it is recommended that the ATAG register is updated prior to issuing a RD/WR command. 47.4.1.5.
Functional description • Bit clock — Serially clocks the data bits in and out of the I2S port. This clock is either generated internally or taken from external clock source (through the Tx/Rx clock ports). • Word clock — Counts the number of data bits per word (8, 10, 12, 16, 18, 20, 22 or 24 bits). This clock is generated internally from the bit clock. • Frame clock (frame sync) — Counts the number of words in a frame.
Chapter 47 Integrated interchip sound (I2S) 47.4.2.1 I2S clock and frame sync generation Data clock and frame sync signals can be generated internally, or can be obtained from external sources. If internally generated, the I2S clock generator is used to derive bit clock and frame sync signals from the network clock . The I2S clock generator consists of a selectable, fixed prescaler and a programmable prescaler for bit rate clock generation.
Functional description DC[4:0] Word Clock Frame Sync Frame Rate TFSL TFDIR(1=output) TFSI STFS Tx Frame Sync Out Tx Control TFSI Tx Frame Sync In TFDIR(0=input) Figure 47-57. I2S transmit frame sync generator block diagram 47.4.2.2 DIV2, PSR and PM bits description The bit clock frequency can be calculated from the I2S serial system clock using id-73884. Note You must ensure that the bit-clock frequency must be 5 times the peripheral clock frequency.
Chapter 47 Integrated interchip sound (I2S) In the next example, the oversampling clock (network clock) clock is 11.2896 MHz. A 16-bit word network mode with TCCR[DC] = 1, TCCR[PM] = 3, TCCR[PSR] = 0, TCCR[DIV2] = 0, a bit clock rate of 1.4112 MHz is generated. Since the 16-bit word rate is equal to two, the sampling rate (or frame sync rate) would be 1.4112/(2×16) = 44.1 kHz. The following table shows examples of programming the TCCR[PSR] and TCCR[PM] bits to generate various bit clock (STCK) frequencies.
Functional description Table 47-51. I2S bit clock and frame rate as a function of PSR, PM, and DIV2 (continued) Bits/ word Words/ frame TCCR MCLK/network clock Bit clock freq (MHz) DIV2 PSR PM WL DC (kHz) Frame rate STCK (kHz) 16 1 11.2896 0 0 7 7 0 705.6 44.1 16 2 11.2896 0 0 3 7 1 1411.2 44.1 16 4 11.2896 0 0 1 7 3 2822.4 44.
Chapter 47 Integrated interchip sound (I2S) 47.4.3.1 Supported data alignment formats The I2S supports three data formats to provide flexibility with handling data. These formats dictate how data is written to (and read from) the data registers. Therefore, data can appear in different places in TX0/1 and RX0/1 based on the data format and the number of bits per word.
Functional description Table 47-53. Data alignment (continued) 24-bit lsb aligned 24-bit msb aligned 23:0 23:0 In addition, if lsb alignment is selected, the receive data can be zero-extended or signextended. • In zero-extension, all bits above the most significant bit are 0s. This format is useful when data is stored in a pure integer format. • In sign-extension, all bits above the most significant bit are equal to the most significant bit.
Chapter 47 Integrated interchip sound (I2S) Table 47-54. I2S receive data interrupts Interrupt RIE ROEn RFFn/RDRn Receive data 0 interrupts (n = 0) Receive data 0 (with exception status) 1 1 1 Receive data 0 (without exception) 1 0 1 Receive data 1 interrupts (n = 1) Receive data 1 (with exception status) 1 1 1 Receive data 1 (without exception) 1 0 1 47.4.
Functional description Table 47-55. I2S transmit data interrupts (continued) Interrupt TIE TUEn TFEn/TDEn Transmit data 1 (without exception) 1 0 1 Transmit data 1 interrupts (n = 1) Transmit data 0 (with exception status) 1 1 1 Transmit data 0 (without exception) 1 0 1 47.4.6 Internal frame and clock shutdown During transmit/receive operation, clearing TE/RE stops data transmission/reception when the current frame ends.
Chapter 47 Integrated interchip sound (I2S) The following figure is illustrates a transmission case where: • TCR[TXDIR] and TCR[TFDIR] are set • CR[TFRCLKDIS] is set a few frames after clearing CR[TE] • ISR[TRFC] is set at the frame boundary after CR[TE] is cleared. Once software services this interrupt and later sets CR[TFRCLKDIS] bit, the ISR[TRFC] bit is set again at next frame boundary. CLK FS Tx Data CR[TE] CR[TFCLDIS] ISR[TFRC] w1c Figure 47-60.
Initialization/application information 2. Set all control bits for configuring the I2S (see the following table ). 3. Enable appropriate interrupts/DMA requests through IER. 4. Set the CR[I2SEN] bit to enable the I2S. 5. In AC97 mode, set the ACNT[AC97EN] bit after programming the ATAG register (if needed, for AC97 Fixed mode). 6. In AC97 fixed mode, do not program the slot request bits without programming the frame valid bits in ATAG register. 7. In gated clock mode, refer to Table 47-3. 8.
Chapter 47 Integrated interchip sound (I2S) Table 47-56.
Initialization/application information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1520 Freescale Semiconductor, Inc.
Chapter 48 General purpose input/output (GPIO) 48.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The general purpose input and output (GPIO) module interfaces to the processor core via a zero wait state interface for maximum pin performance. Accesses of any data size are supported to the GPIO registers.
Introduction 48.1.2.1 Run mode In run mode, the GPIO operates normally. 48.1.2.2 Wait mode In wait mode, the GPIO operates normally. 48.1.2.3 Stop mode The GPIO is disabled in stop mode, although the pins retain their state. 48.1.2.4 Debug mode In debug mode, the GPIO operates normally. 48.1.3 GPIO signal descriptions Table 48-1.
Chapter 48 General purpose input/output (GPIO) 48.1.3.1 Detailed signal description Table 48-2. GPIO interface-detailed signal descriptions Signal I/O Description PORTA[31:0] I/O General purpose input/output. PORTB[31:0] State meaning Asserted - pin is logic one. PORTC[31:0] Negated - pin is logic zero. PORTD[31:0] Timing Assertion - when output, occurs on rising edge of the system clock. For input, may occur at any time and input may be asserted asynchronously to the system clock.
Memory map and register definition GPIO memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page reads zero) 400F_F010 Port Data Input Register (GPIOA_PDIR) 32 R 0000_0000h 48.2.5/ 1528 400F_F014 Port Data Direction Register (GPIOA_PDDR) 32 R/W 0000_0000h 48.2.6/ 1528 400F_F040 Port Data Output Register (GPIOB_PDOR) 32 R/W 0000_0000h 48.2.1/ 1526 32 W (always reads zero) 0000_0000h 48.2.
Chapter 48 General purpose input/output (GPIO) GPIO memory map (continued) Absolute address (hex) Width Access (in bits) Reset value Section/ page 32 W (always reads zero) 0000_0000h 48.2.2/ 1526 32 W (always reads zero) 0000_0000h 48.2.3/ 1527 400F_F0CC Port Toggle Output Register (GPIOD_PTOR) 32 W (always reads zero) 0000_0000h 48.2.4/ 1527 400F_F0D0 Port Data Input Register (GPIOD_PDIR) 32 R 0000_0000h 48.2.
Memory map and register definition 48.2.
Chapter 48 General purpose input/output (GPIO) 48.2.
Memory map and register definition GPIOx_PTOR field descriptions (continued) Field Description 0 1 Corresponding bit in PDORn does not change. Corresponding bit in PDORn is set to the inverse of its existing logic state. 48.2.
Chapter 48 General purpose input/output (GPIO) GPIOx_PDDR field descriptions Field 31–0 PDD Description Port data direction 0 1 Pin is configured as general purpose input, if configured for the GPIO function Pin is configured for general purpose output, if configured for the GPIO function 48.3 Functional description 48.3.
Functional description K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1530 Freescale Semiconductor, Inc.
Chapter 49 Touch sense input (TSI) 49.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The touch sensing input (TSI) module provides capacitive touch sensing detection with high sensitivity and enhanced robustness. Each TSI pin implements the capacitive measurement of an electrode having individual programmable detection thresholds and result registers.
Overview • Configurable integration of each electrode capacitance measurement from 1 to 4096 times • Programmable electrode oscillator and TSI Reference Oscillator for high sensitivity, small scan time and low power functionality • Only uses one pin per electrode implementation with no external hardware required 49.3 Overview This section presents an overview of the TSI module. The following figure presents the simplified TSI module block diagram.
Chapter 49 Touch sense input (TSI) capacitance, while the other according to an internal reference capacitor. The pin capacitance measurement is given by the counted number of periods of the reference oscillator during a configurable number of oscillations of the external electrode oscillator. The electrode oscillator charges and discharges the pin capacitance with a programmable 5-bit binary current source in order to accommodate different sizes of electrode capacitance.
Modes of operation electrode scan unit also allows software triggering of the electrode scans. This feature is very useful for initialization of the touch application to detect the initial electrode capacitances. This module generates configurable end-of-scan interrupt to indicate the application that all electrodes were scanned.
Chapter 49 Touch sense input (TSI) 49.4.3 TSI low power mode The TSI module enters low power mode if the GENCS[STPE] is set to one and the MCU is programmed into one of the following operational modes: LLS, VLLS1, VLLS2 or VLLS3. In low power mode, only one selectable pin is active, being able to perform capacitance measurements. The scan period is defined by GENCS[LPSCNITV]. Two low power clock sources are available in the TSI low power mode, LPOCLK and VLPOSCCLK, being selected by the GENCS[LPCLKS].
TSI signal descriptions 49.5 TSI signal descriptions The TSI module has up to 16 external pins for touch sensing. The table below itemizes all the TSI external pins. Table 49-1. TSI signal descriptions Signal TSI_IN[15:0] Description I/O TSI pins. Switchable driver that connects directly to the electrode pins TSI[15:0] can operate as GPIO pins I/O 49.5.
Chapter 49 Touch sense input (TSI) TSI memory map (continued) Absolute address (hex) Register name Width Access (in bits) Reset value Section/ page 4004_5104 Counter Register (TSI0_CNTR3) 32 R 0000_0000h 49.6.5/ 1550 4004_5108 Counter Register (TSI0_CNTR5) 32 R 0000_0000h 49.6.5/ 1550 4004_510C Counter Register (TSI0_CNTR7) 32 R 0000_0000h 49.6.5/ 1550 4004_5110 Counter Register (TSI0_CNTR9) 32 R 0000_0000h 49.6.
Memory map and register definition TSI memory map (continued) Absolute address (hex) Width Access (in bits) Register name Reset value Section/ page 4004_5154 Channel n threshold register (TSI0_THRESHLD13) 32 R/W 0000_0000h 49.6.6/ 1551 4004_5158 Channel n threshold register (TSI0_THRESHLD14) 32 R/W 0000_0000h 49.6.6/ 1551 4004_515C Channel n threshold register (TSI0_THRESHLD15) 32 R/W 0000_0000h 49.6.6/ 1551 49.6.
Chapter 49 Touch sense input (TSI) TSIx_GENCS field descriptions (continued) Field Description 0 1 27–24 LPSCNITV 23–19 NSCN LPOCLK VLPOSCCLK TSI Low Power Mode Scan Interval 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 1 ms scan interval 5 ms scan interval 10 ms scan interval 15 ms scan interval 20 ms scan interval 30 ms scan interval 40 ms scan interval 50 ms scan interval 75 ms scan interval 100 ms scan interval 125 ms scan interval 150 ms scan interval 200 ms sc
Memory map and register definition TSIx_GENCS field descriptions (continued) Field Description 11001 11010 11011 11100 11101 11110 11111 26 times per electrode 27 times per electrode 28 times per electrode 29 times per electrode 30 times per electrode 31 times per electrode 32 times per electrode 18–16 PS Electrode oscillator prescaler 15 EOSF End of scan flag 000 001 010 011 100 101 110 111 Electrode oscillator frequency divided by 1 Electrode oscillator frequency divided by 2 Electrode oscillator
Chapter 49 Touch sense input (TSI) TSIx_GENCS field descriptions (continued) Field Description 0 1 5 ERIE Disable Enable TSI error interrupt Enable Caused by a short or overrun error. 0 1 4 ESOR Error interrupt disabled Error interrupt enabled End-of-scan or out-of-range interrupt select 0 1 Out-of-range interrupt selected End-of-scan interrupt selected 3 Reserved Reserved 2 Reserved Reserved This field is reserved. This field is reserved.
Memory map and register definition TSIx_SCANC field descriptions Field 31–27 REFCHRG 26–24 CAPTRM 23–19 EXTCHRG Description Reference oscillator charge current select 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 1 µA charge current 2 µA charge current 3 µA charge current 4 µA charge current 5 µA charge current 6 µA charge current 7 µA charge current 8 µA cha
Chapter 49 Touch sense input (TSI) TSIx_SCANC field descriptions (continued) Field Description 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 18–16 DELVOL 15–8 SMOD 7–6 Reserved 2 µA charge current 3 µA charge current 4 µA charge current 5 µA charge current 6 µA charge current 7 µA charge current 8 µA charge current 9 µA charge current 10 µA charge current 11 µA ch
Memory map and register definition TSIx_SCANC field descriptions (continued) Field Description 5 AMCLKDIV Active mode clock divider 4–3 AMCLKS Active mode clock source 2–0 AMPSC Active mode prescaler 0 1 00 01 10 11 Divider set to 1 Divider set to 2048 Bus Clock MCGIRCLK OSCERCLK Not valid 000 001 010 011 100 101 110 111 Input clock source divided by 1 Input clock source divided by 2 Input clock source divided by 4 Input clock source divided by 8 Input clock source divided by 16 Input clock so
Chapter 49 Touch sense input (TSI) TSIx_PEN field descriptions (continued) Field Description Selects which input is active in low-power mode.
Memory map and register definition TSIx_PEN field descriptions (continued) Field Description 8 PEN8 TSI pin 8 enable 7 PEN7 TSI pin 7 enable 6 PEN6 TSI pin 6 enable 5 PEN5 TSI pin 5 enable 4 PEN4 TSI pin 4 enable 3 PEN3 TSI pin 3 enable 2 PEN2 TSI pin 2 enable 1 PEN1 TSI pin 1 enable 0 PEN0 TSI pin 0 enable 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 The corresponding pin is not used by TSI The corresponding pin is used by TSI The corresponding pin is not used by TSI The corresponding
Chapter 49 Touch sense input (TSI) 49.6.
Memory map and register definition TSIx_STATUS field descriptions (continued) Field Description This bit indicates when the corresponding electrode is shorted to VDD or VSS. If the GENCS[ERIE] bit is set, an error interrupt is generated. Write a one to clear this bit.
Chapter 49 Touch sense input (TSI) TSIx_STATUS field descriptions (continued) Field Description This bit indicates when the corresponding electrode is out of range. If the GENCS[TSIIE] bit is set and the GENCS[ESOR] bit is cleared, an out-of-range interrupt is generated. Write a one to clear this bit.
Memory map and register definition TSIx_STATUS field descriptions (continued) Field Description This bit indicates when the corresponding electrode is out of range. If the GENCS[TSIIE] bit is set and the GENCS[ESOR] bit is cleared, an out-of-range interrupt is generated. Write a one to clear this bit. 1 ORNGF1 Touch Sensing Electrode Out-of-Range Flag 1 0 ORNGF0 Touch Sensing Electrode Out-of-Range Flag 0 This bit indicates when the corresponding electrode is out of range.
Chapter 49 Touch sense input (TSI) 49.6.6 Channel n threshold register (TSIx_THRESHLD) All THRESHLD bits can be read at any time, but must not be written while GENCS[SCNIP] is set.
Functional descriptions Electrode charge current (EXTCHRG) Delta Voltage (DELVOL) Figure 49-64. TSI electrode oscillator circuit The current source applied to the pad capacitance is 5-bit binary controlled by the SCANC[EXTCHRG]. The hysteresis delta voltage is also configurable and is 3-bit binary controlled by the SCANC[DELVOL]. The figure below shows the voltage amplitude waveform of the electrode capacitance charging and discharging with a programmable current.
Chapter 49 Touch sense input (TSI) So by this equation, for example, an electrode with Celec= 20 pF, with a current source of I = 16 µA and ΔV = 600 mV will have the following oscillation frequency: Felec 16 µA 2 * 20pF * 600mV 0.67MHz Figure 49-67. Equation 2: TSI electrode oscillator frequency The current source and hysteresis delta voltage are used to accommodate the TSI electrode oscillator frequency with different electrode capacitance sizes. 49.7.1.
Functional descriptions Tcap_samp 2*2*16*20pF*600mV 48µs 16µA 49.7.1.3 TSI reference oscillator The TSI reference oscillator has the same topology of the TSI electrode oscillator. The TSI reference oscillator instead of using an external capacitor for the electrode oscillator has an internal reference capacitor which can be programmable. The SCANC[CAPTRM] defines the internal reference capacitor trimming value *.
Chapter 49 Touch sense input (TSI) TSICHnCNT Iref * PS *NSCN * Celec Cref * Iref Figure 49-70. Equation 5: Capacitance result value In the example where Fref_osc = 10.0MHz and Tcap_samp = 48 µs, TSICHnCNT = 480 49.7.3 Electrode scan unit This section describes the functionality of the electrode scan unit. It is responsible for triggering the start of the active electrode scan. The touch sense input module needs to periodically scan all active electrodes to determine if a touch event has occurred.
Functional descriptions 49.7.3.2 Scan trigger The scan trigger can be set to periodical scan or software trigger. The bit GENCS[STM] determines the TSI scan trigger mode. If STM = 1 the trigger mode is selected as continuous. If STM = 0, the software trigger mode is selected. In periodic mode the scan trigger is generated automatically by the electrode scan unit. NOTE It takes some time (less than 40 µs) for TSI oscillators to be stable in software trigger mode and periodical scan mode.
Chapter 49 Touch sense input (TSI) First Active Electrode Scan States ... ... ... Result Counter ... Last Scan 1st Scan 1st Scan Last Active Electrode Second Active Electrode Count from 0 to result Count from 0 to result Last Scan 1st Scan Last Scan ... ... ... ... ... ... ... Count from 0 to result End-of-Scan Signal Figure 49-71. Scan sequence 49.7.3.4.2 Low power mode scan In low power periodic scan, the scan period is define by the 4-bit binary GENCS[LPSCNITV].
Functional descriptions It is worthy to note that, since all the possible flags are asserted upon the end of scan event, in TSI interrupt service routine, the end-of-scan flag will be always set until the software clears it. 49.7.3.4.4 Over-run interrupt If an electrode scan is in progress and there is a scan trigger, the electrode scan unit generates an over-run error by asserting the GENCS[OVRF]. If the TSI error interrupt is active by setting the GENCS[ERIE] bit a interrupt request is asserted.
Chapter 49 Touch sense input (TSI) When GENCS[OUTRGF] flag is asserted, it is requested the software to poll which specific electrode is out of range by reading the status from STATUS register, clearing the corresponding electrodes flags will also clear the out-of-range flag in GENCS[OUTRGF]. 49.7.4.2 Error interrupt The GENCS[EXTERF] is set in the case the capacitance result registers, TSICHnCNT, of a TSI pin is either 0 or 0xFFFF, the two possible extreme values.
Application information K10 Sub-Family Reference Manual, Rev. 6, Nov 2011 1560 Freescale Semiconductor, Inc.
Chapter 50 JTAG Controller (JTAGC) 50.1 Introduction NOTE For the chip-specific implementation details of this module's instances see the chip configuration chapter. The JTAGC block provides the means to test chip functionality and connectivity while remaining transparent to system logic when not in test mode. Testing is performed via a boundary scan technique, as defined in the IEEE 1149.1-2001 standard. All data input to and output from the JTAGC block is communicated in serial format. 50.1.
Introduction Power-on reset Test Access Port (TAP) Controller TMS TCK 1-bit Bypass Register 32-bit Device Identification Register TDI TDO Boundary Scan Register TAP Instruction Decoder TAP Instruction Register Figure 50-1. JTAG (IEEE 1149.1) block diagram 50.1.2 Features The JTAGC block is compliant with the IEEE 1149.1-2001 standard and supports the following features: • IEEE 1149.
Chapter 50 JTAG Controller (JTAGC) 50.1.3.1 Reset The JTAGC block is placed in reset when either power-on reset is asserted, or the TMS input is held high for enough consecutive rising edges of TCK to sequence the TAP controller state machine into the Test-Logic-Reset state. Holding TMS high for five consecutive rising edges of TCK guarantees entry into the Test-Logic-Reset state regardless of the current TAP controller state. Asserting power-on reset results in asynchronous entry into the reset state.
External signal description 50.2 External signal description The JTAGC consists of a set of signals that connect to off chip development tools and allow access to test support functions. The JTAGC signals are outlined in the following table and described in the following sections. Table 50-1. JTAG signal properties Name I/O Function Reset State Pull TCK Input Test Clock — Down TDI Input Test Data In — Up TDO Output Test Data Out High Z1 — TMS Input Test Mode Select — Up 1.
Chapter 50 JTAG Controller (JTAGC) 50.3 Register description This section provides a detailed description of the JTAGC block registers accessible through the TAP interface, including data registers and the instruction register. Individual bit-level descriptions and reset states of each register are included. These registers are not memory-mapped and can only be accessed through the TAP. 50.3.1 Instruction register The JTAGC block uses a 4-bit instruction register as shown in the following figure.
Register description 50.3.3 Device identification register The device identification (JTAG ID) register, shown in the following figure, allows the revision number, part number, manufacturer, and design center responsible for the design of the part to be determined through the TAP. The device identification register is selected for serial data transfer between TDI and TDO when the IDCODE instruction is active.
Chapter 50 JTAG Controller (JTAGC) scan register cell, as described in the IEEE 1149.1-2001 standard and discussed in Boundary scan. The size of the boundary scan register and bit ordering is devicedependent and can be found in the device BSDL file. 50.4 Functional description This section explains the JTAGC functional description. 50.4.
Functional description TEST LOGIC RESET 1 0 1 1 1 SELECT-DR-SCAN RUN-TEST/IDLE SELECT-IR-SCAN 0 0 0 1 1 CAPTURE-DR CAPTURE-IR 0 0 SHIFT-IR SHIFT-DR 0 0 1 1 1 1 EXIT1-IR EXIT1-DR 0 0 PAUSE-DR PAUSE-IR 0 0 1 0 EXIT2-DR 1 0 EXIT2-IR 1 1 UPDATE-DR 1 0 UPDATE-IR 1 0 The value shown adjacent to each state transition in this figure represents the value of TMS at the time of a rising edge of TCK. Figure 50-4. IEEE 1149.1-2001 TAP controller finite state machine 50.4.3.
Chapter 50 JTAG Controller (JTAGC) 50.4.3.2 Selecting an IEEE 1149.1-2001 register Access to the JTAGC data registers is achieved by loading the instruction register with any of the JTAGC block instructions while the JTAGC is enabled. Instructions are shifted in via the Select-IR-Scan path and loaded in the Update-IR state. At this point, all data register access is performed via the Select-DR-Scan path.
Functional description Table 50-3. 4-bit JTAG instructions (continued) Instruction Code[3:0] Instruction Summary ARM JTAG-DP Reserved 1011 This instruction goes the ARM JTAG-DP controller. See the ARM JTAG-DP documentation for more information. CLAMP 1100 Selects bypass register while applying preloaded values to output pins and asserting functional reset ARM JTAG-DP Reserved 1110 This instruction goes the ARM JTAG-DP controller. See the ARM JTAG-DP documentation for more information.
Chapter 50 JTAG Controller (JTAGC) of the boundary scan register cells on the falling edge of TCK in the Update-DR state. The data is applied to the external output pins by the EXTEST or CLAMP instruction. System operation is not affected. 50.4.4.4 SAMPLE instruction The SAMPLE instruction obtains a sample of the system data and control signals present at the MCU input pins and just before the boundary scan register cells at the output pins.
Initialization/Application information single bit (the bypass register) while conducting an EXTEST type of instruction through the boundary scan register. CLAMP also asserts the internal system reset for the MCU to force a predictable internal state. 50.4.4.8 BYPASS instruction BYPASS selects the bypass register, creating a single-bit shift register path between TDI and TDO. BYPASS enhances test efficiency by reducing the overall shift path when no test operation of the MCU is required.
Appendix A Release Notes for Revision 6 A.1 General changes throughout document • No substantial content changes A.2 About This Document chapter changes • No substantial content changes A.3 Introduction chapter changes • Updated 'Kinetis MCU portfolio' diagram for K6x family. A.4 Chip Configuration chapter changes • • • • Clarified 'PDB Module Interconnections' section. In 'UART interrupts' section, updated LON and ISO7816 interrupt sources. Clarified 'I2S/SAI clock generation' section.
Memory Map chapter changes A.5 Memory Map chapter changes • Added Alternate non-volatile IRC user trim description topic. A.6 Clock Distribution chapter changes • Added 'SAI clock generation' diagram. • Updated Clock Diagram for standard XTAL, EXTAL, and MCG clock names. • In Device Clock Summary table, updated bus clock, external reference clock, USB FS clock, and TRACE clock. • Updated Clocking diagram for IRC clock and updated MCGFFCLK definition. • Added note to Debug trace clock section.
Appendix A Release Notes for Revision 6 A.11 Signal Multiplexing and Signal Descriptions chapter changes • Updated pinout diagrams and tables • In 'Port control and interrupt module features' section, updated digital filter clock cycles from 1 to 32. • Updated CMPx_IN signals to 5:0. • In 'System Signal Descriptions' table, modified RESET_b pin to I/O. • For the "Signal Multiplexing and Pin Assignments" table, added the LLWU inputs to the appropriate pin names. A.
Crossbar switch chapter changes A.18 Crossbar switch chapter changes • No substantial content changes A.19 MPU changes • No substantial content changes A.20 AIPS-Lite changes • No substantial content changes A.21 DMAMUX changes • No substantial content changes A.22 DMA changes • No substantial content changes A.23 EWM changes • No substantial content changes A.
Appendix A Release Notes for Revision 6 A.26 OSC changes • No substantial content changes A.27 RTC Oscillator changes • No substantial content changes A.28 FMC changes • Terminology update: changed "Directory" to "Tag" in the names of tag cache registers. A.
CRC changes A.32 CRC changes No substantial content changes A.33 ADC changes • Removed CLPD from generating gain calibration values procedure. • Updated Pseudo-code example section for CFG1 and SC2 register bits. • Removed band gap voltages, BGH and BGL. A.34 CMP changes • Updated CMPx_CR1[PMODE] field description. A.35 DAC changes • Updated DACx_C0[LPEN] field description. A.36 VREF changes • No substantial content changes A.37 PDB changes Added Debug mode and updated PDBEN encodings. A.
Appendix A Release Notes for Revision 6 A.39 PIT changes • No substantial content changes A.40 LPTMR changes • Added note in LPTMR clocking section. A.41 CMT changes • No substantial content changes A.42 RTC changes Updated RTC_CR[14] bit field access. Updated Time Alarm section with IER[TAIE]. A.43 FlexCAN changes • No substantial content changes A.44 DSPI chapter changes • In 'Transmit FIFO Fill Interrupt or DMA Request' section, added note on using TFFF flag.
UART changes A.46 UART changes • Changed TWFIFO[TXWATER] in RDRF register to RWFIFO[RXWATER]. A.47 SDHC changes • Removed the feature of "Support voltage selection by configuring vendor specific register bit" A.48 I2S changes • Updated 1111 encoding for TFWM0 and TFWM1 bit fields. A.49 GPIO changes • No substantial content changes A.50 TSI changes • No substantial content changes A.51 JTAG Controller changes • No substantial content changes K10 Sub-Family Reference Manual, Rev.
How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, EL516 2100 East Elliot Road Tempe, Arizona 85284 +1-800-521-6274 or +1-480-768-2130 www.freescale.