Infineon XMC4500 RM
Infineon XMC4500 RM
Infineon XMC4500 RM
Microcontroller Series
for Industrial Applications
XMC4000 Family
ARM Cortex-M4
32-bit processor core
Reference Manual
V1.0 2012-02
Microcontrollers
Edition 2012-02
Published by
Infineon Technologies AG
81726 Munich, Germany
2012 Infineon Technologies AG
All Rights Reserved.
Legal Disclaimer
The information given in this document shall in no event be regarded as a guarantee of conditions or
characteristics. With respect to any examples or hints given herein, any typical values stated herein and/or any
information regarding the application of the device, Infineon Technologies hereby disclaims any and all warranties
and liabilities of any kind, including without limitation, warranties of non-infringement of intellectual property rights
of any third party.
Information
For further information on technology, delivery terms and conditions and prices, please contact the nearest
Infineon Technologies Office (www.infineon.com).
Warnings
Due to technical requirements, components may contain dangerous substances. For information on the types in
question, please contact the nearest Infineon Technologies Office.
Infineon Technologies components may be used in life-support devices or systems only with the express written
approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure
of that life-support device or system or to affect the safety or effectiveness of that device or system. Life support
devices or systems are intended to be implanted in the human body or to support and/or maintain and sustain
and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may
be endangered.
XMC4500
Microcontroller Series
for Industrial Applications
XMC4000 Family
ARM Cortex-M4
32-bit processor core
Reference Manual
V1.0 2012-02
Microcontrollers
XMC4500
XMC4000 Family
Trademarks
C166, TriCore and DAVE are trademarks of Infineon Technologies AG.
ARM, ARM Powered, Cortex and AMBA are registered trademarks of ARM, Limited.
CoreSight, ETM, Embedded Trace Macrocell and Embedded Trace Buffer are
trademarks of ARM, Limited.
Synopsys is a trademark of Synopsys, Inc.
Table of Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.1.1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.2 CPU Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.3 On-Chip Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.4 Communication Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
1.5 Analog Frontend Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
1.6 Industrial Control Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
1.7 On-Chip Debug Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
2 Central Processing Unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.1.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.1.2 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
2.2 Programmers Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.2.1 Processor Mode and Privilege Levels for Software Execution . . . . . . 2-4
2.2.2 Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.2.3 Core Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.2.4 Exceptions and Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
2.2.5 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
2.2.6 The Cortex Microcontroller Software Interface Standard . . . . . . . . . . 2-17
2.2.7 CMSIS functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
2.3 Memory Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
2.3.1 Memory Regions, Types and Attributes . . . . . . . . . . . . . . . . . . . . . . . 2-20
2.3.2 Memory System Ordering of Memory Accesses . . . . . . . . . . . . . . . . 2-21
2.3.3 Behavior of Memory Accesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
2.3.4 Software Ordering of Memory Accesses . . . . . . . . . . . . . . . . . . . . . . 2-23
2.3.5 Memory Endianness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
2.3.6 Synchronization Primitives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
2.3.7 Programming Hints for the Synchronization Primitives . . . . . . . . . . . 2-26
2.4 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
2.5 Exception Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
2.5.1 Exception States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
2.5.2 Exception Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
2.5.3 Exception Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
2.5.4 Vector Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30
2.5.5 Exception Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
2.5.6 Interrupt Priority Grouping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
2.5.7 Exception Entry and Return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
2.6 Fault Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
2.6.1 Fault Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-37
Related Documentation
The following documents are referenced:
ARM Cortex-M4
Technical Reference Manual
User Guide, Reference Material
ARMv7-M Architecture Reference Manual
AMBA 3 AHB-Lite Protocol Specification
Copyright Notice
Portions of SDMMC chapter Copyright 2010 by Arasan Chip Systems, Inc. All
rights reserved. Used with permission.
Portions of CPU chapter Copyright 2009, 2010 by ARM, Ltd. All rights reserved.
Used with permission.
Portions of ETH, USB and GPDMA chapter Copyright 2009, 2010 by Synopsys,
Inc. All rights reserved. Used with permission.
Text Conventions
This document uses the following naming conventions:
Functional units of the device are given in plain UPPER CASE. For example: The
USIC0 unit supports.
Pins using negative logic are indicated by an overline. For example: The WAIT input
has.
Bit fields and bits in registers are generally referenced as
Module_RegisterName.BitField or Module_RegisterName.Bit. For example: The
USIC0_PCR.MCLK bit enables the. Most of the register names contain a module
name prefix, separated by an underscore character _ from the actual register name
(for example, USIC0_PCR, where USIC0 is the module name prefix, and PCR
is the kernel register name). In chapters describing the kernels of the peripheral
modules, the registers are mainly referenced with their kernel register names. The
peripheral module implementation sections mainly refer to the actual register names
with module prefixes.
Variables used to describe sets of processing units or registers appear in mixed
upper and lower cases. For example, register name MOFCRn refers to multiple
MOFCR registers with variable n. The bounds of the variables are always given
where the register expression is first used (for example, n = 0-31), and are repeated
as needed in the rest of the text.
The default radix is decimal. Hexadecimal constants are suffixed with a subscript
letter H, as in 100H. Binary constants are suffixed with a subscript letter B, as in:
111B.
When the extent of register fields, groups register bits, or groups of pins are
collectively named in the body of the document, they are represented as
NAME[A:B], which defines a range for the named group from B to A. Individual bits,
signals, or pins are given as NAME[C] where the range of the variable C is given in
the text. For example: CFG[2:0] and SRPN[0].
Units are abbreviated as follows:
MHz = Megahertz
s = Microseconds
kBaud, kbit/s = 1000 characters/bits per second
MBaud, Mbit/s, Mbps = 1,000,000 characters/bits per second
Kbyte, KB = 1024 bytes of memory
Mbyte, MB = 1048576 bytes of memory
In general, the k prefix scales a unit by 1000 whereas the K prefix scales a unit by
1024. Hence, the Kbyte unit scales the expression preceding it by 1024. The
kBaud unit scales the expression preceding it by 1000. The M prefix scales by
1,000,000 or 1048576. For example, 1 Kbyte is 1024 bytes, 1 Mbyte is
Reserved Bits
Register bit fields named Reserved or 0 indicate unimplemented functions with the
following behavior:
Reading these bit fields returns 0.
These bit fields should be written with 0 if the bit field is defined as r or rh.
These bit fields must to be written with 0 if the bit field is defined as rw.
Introduction
Introduction
1 Introduction
The XMC4500 series belongs to the XMC4000 family of industrial microcontrollers
based on the ARM Cortex-M4 processor core. The XMC4500 series devices are
optimized for electrical motor control, power conversion, industrial connectivity and
sense & control applications.
The growing complexity of today's energy efficient embedded control applications are
demanding microcontroller solutions with higher performance CPU cores featuring DSP
(Digital Signal Processing) and FPU (Floating Point Unit) capabilities as well as
integrated peripherals that are optimized for performance. Complemented with a
development environment designed to shorten product development time and increase
productivity, the XMC4500 series of microcontrollers take advantage of Infineon's
decades of experience in microcontroller design, providing an optimized solution to meet
the performance challenges of today's embedded control applications.
1.1 Overview
The XMC4500 series devices combine the extended functionality and performance of
the ARM Cortex-M4 core with powerful on-chip peripheral subsystems and on-chip
memory units. The following key features are available in the XMC4500 series devices:
CPU Subsystem
CPU Core
High Performance 32-bit ARM Cortex-M4 CPU
16-bit and 32-bit Thumb2 instruction set
DSP/MAC instructions
System timer (SysTick) for Operating System support
Floating Point Unit
Memory Protection Unit
Nested Vectored Interrupt Controller
Two General Purpose DMA with up to 12 channels
Event Request Unit (ERU) for programmable processing of external and internal
service requests
Flexible CRC Engine (FCE) for multiple bit error detection
On-Chip Memories
16 KB on-chip boot ROM
64 KB on-chip high-speed program memory
64 KB on-chip high speed data memory
32 KB on-chip high-speed communication
1024 KB on-chip Flash Memory with 4 KB instruction cache
Communication Peripherals
Ethernet MAC module capable of 10/100 Mbit/s transfer rates
Universal Serial Bus, USB 2.0 host, Full-Speed OTG, with integrated PHY
Controller Area Network interface (MultiCAN), Full-CAN/Basic-CAN with 3 nodes, 64
message objects, data rate up to 1 Mbit/s
Six Universal Serial Interface Channels (USIC), usable as UART, double-SPI,
quadSPI, IIC, IIS and LIN interfaces
LED and Touch-Sense Controller (LEDTS) for Human-Machine interface
SD and Multi-Media Card interface (SDMMC) for data storage memory cards
External Bus Interface Unit (EBU) enabling communication with external memories
and off-chip peripherals like SRAM, SDRAM, NOR, NAND and Burst Flash.
Input/Output Lines
Programmable port driver control module (PORTS)
Individual bit addressability
Tri-stated in input mode
Push/pull or open drain output mode
Boundary scan test support over JTAG interface
Packages
PG-LQFP-144
PG-LQFP-100
PG-LFBGA-144
Note: For details about package availability for a particular derivative please check the
datasheet. For information on available delivery options for assembly support and
general package see http://www.infineon.com/packages
CPU RTC
TM
ARM Cortex -M4 ERU0
USB WDT
GPDMA0 GPDMA1 Ethernet
OTG
System DCode ICode FCE
Bus Matrix
Data Code
PMU PSRAM DSRAM1 DSRAM2 EBU
ROM & Flash
ERU1 VADC POSIF0 CCU40 CCU41 CCU42 SDMMC USIC2 USIC1 CAN
Flash memory
The Flash is for nonvolatile code or constant data storage. The single supply Flash
module is programmable at production line end and in application via built-in erase and
program commands. Read and write protection mechanism are offered. A hardware
error correction ensures data consistency over the whole life time under rugged
industrial environment and temperatures.
The integrated cache provides an average performance boost factor of 3 in code
execution compared to uncached execution.
ROMs, EPROMs
NOR and NAND flash devices
Static RAMs and PSRAMs
PC133/100 compatible SDRAM
Burst FLASH
for incoming and outgoing frames, message objects can be combined to build gateways
between the CAN nodes or to setup a FIFO buffer.
channels. Additionally an offset can be added and the amplitude can be scaled. Several
time trigger sources are possible.
the On-Chip Debug Support system can be controlled by the CPU, e.g. by a monitor
program.
CPU Subsystem
CPU Subsystem
2.1 Overview
The Cortex-M4 processor is built on a high-performance processor core, with a 3-stage
pipeline Harvard architecture, making it ideal for demanding embedded applications.
The processor delivers exceptional power efficiency through an efficient instruction set
and extensively optimized design, providing high-end processing hardware including
IEEE754-compliant single-precision floating-point computation, a range of single-cycle
and SIMD multiplication and multiply-with-accumulate capabilities, saturating arithmetic
and dedicated hardware division.
To facilitate the design of cost-sensitive devices, the Cortex-M4 processor implements
tightly-coupled system components that reduce processor area while significantly
improving interrupt handling and system debug capabilities. The Cortex-M4 processor
implements a version of the Thumb instruction set based on Thumb-2 technology,
ensuring high code density and reduced program memory requirements. The Cortex-M4
instruction set provides the exceptional performance expected of a modern 32-bit
architecture, with the high code density of 8-bit and 16-bit microcontrollers.
The Cortex-M4 processor closely integrates a configurable NVIC, to deliver industry-
leading interrupt performance. The NVIC includes a non-maskable interrupt (NMI), and
provides up to 64 interrupt priority levels. The tight integration of the processor core and
NVIC provides fast execution of interrupt service routines (ISRs), dramatically reducing
the interrupt latency. This is achieved through the hardware stacking of registers, and
the ability to suspend load-multiple and store-multiple operations. Interrupt handlers do
not require wrapping in assembler code, removing any code overhead from the ISRs. A
tail-chain optimization also significantly reduces the overhead when switching from one
ISR to another.
To optimize low-power designs, the NVIC integrates with the sleep modes, that include
a deep sleep function that enables the entire device to be rapidly powered down while
still retaining program state.
2.1.1 Features
The XMC4500 CPU features comprise
Thumb2 instruction set combines high code density with 32-bit performance
IEEE754-compliant single-precision FPU
power control optimization of system components
integrated sleep modes for low power consumption
fast code execution permits slower processor clock or increases sleep mode time
hardware division and fast digital-signal-processing orientated multiply accumulate
saturating arithmetic for signal processing
deterministic, high-performance interrupt handling for time-critical applications
memory protection unit (MPU) for safety-critical applications
extensive debug and trace capabilities:
Serial Wire Debug and Serial Wire Trace reduce the number of pins required for
debugging, tracing, and code profiling.
Processor Core
The CPU provides 16-bit and 32-bit Thumb2 instruction set and DSP/MAC instructions.
Floating-point unit
The FPU provides IEEE754-compliant operations on single-precision, 32-bit, floating-
point values.
Debug Solution
The XMC4500 implements a complete hardware debug solution.
Embedded Trace Macrocell
Traditional JTAG port or a 2-pin Serial Wire Debug Access Port
Trace port or Serial Wire Viewer
Flash breakpoints and Data watchpoints
This provides high system control and visibility of the processor and memory even in
small package devices.
Cortex-M4
processor FPU
Embedded
NVIC Trace
Processor
Macrocell
core
Debug Serial
Memory
Access Wire
protection unit
Port Viewer
Flash Data
breakpoints watchpoints
Bus matrix
Code Data
System interface
interface interface
2.2.2 Stacks
The processor uses a full descending stack. This means the stack pointer holds the
address of the last stacked item in memory. When the processor pushes a new item onto
the stack, it decrements the stack pointer and then writes the item to the new memory
location. The processor implements two stacks, the main stack and the process stack,
with a pointer for each held in independent registers, see Stack Pointer on Page 2-8.
In Thread mode, the CONTROL register controls whether the processor uses the main
stack or the process stack, see CONTROL register on Page 2-15. In Handler mode, the
processor always uses the main stack. The options for processor operations are:
Table 2-1 Summary of processor mode, execution privilege level, and stack
use options
Processor Used to Privilege level for Stack used
mode execute software execution
Thread Applications Privileged or Main stack or process stack1)
unprivileged1)
Handler Exception Always privileged Main stack
handlers
1) See CONTROL register on Page 2-15.
R0
R1
R2
R3
Low registers
R4
R5
R6 General-purpose registers
R7
R8
R9
High registers R10
R11
R12
Stack Pointer SP (R13) PSP MSP
Banked version of SP
Link Register LR (R14)
Program Counter PC (R15)
General-purpose registers
R0-R12 are 32-bit general-purpose registers for data operations
Rx (x=0-12)
General Purpose Register Rx Reset Value: XXXX XXXXH
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
VALUE
rw
Stack Pointer
The Stack Pointer (SP) is register R13. In Thread mode, bit[1] of the CONTROL register
indicates the stack pointer to use:
0 = Main Stack Pointer (MSP). This is the reset value.
1 = Process Stack Pointer (PSP).
On reset, the processor loads the MSP with the value from address 00000000H.
SP
Stack Pointer Reset Value: 2000 FF3CH
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
VALUE
rw
Link Register
The Link Register (LR) is register R14. It stores the return information for subroutines,
function calls, and exceptions. On reset, the processor sets the LR value to FFFFFFFFH.
LR
Link Register Reset Value: FFFF FFFFH
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
VALUE
rw
Program Counter
The Program Counter (PC) is register R15. It contains the current program address. On
reset, the processor loads the PC with the value of the reset vector, which is at address
00000004H. Bit[0] of the value is loaded into the EPSR T-bit at reset and must be 1.
PC
Program Counter Reset Value: 0000 0004H
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
VALUE
rw
APSR
Application Program Status Register Reset Value: XXXX XXXXH
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
N Z C V Q 0 GE[3:0] 0
rw rw rw rw rw r rw r
IPSR
Interrupt Program Status Register Reset Value: 0000 0000H
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
0 ISR_NUMBER
r r
EPSR
Execution Program Status Register Reset Value: 0100 0000H
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
0 ICI/IT T 0 ICI/IT 0
r r r r r r
Interruptible-continuable instructions
When an interrupt occurs during the execution of an LDM, STM, PUSH, POP, VLDM,
VSTM, VPUSH, or VPOP instruction, the processor:
stops the load multiple or store multiple instruction operation temporarily
stores the next register operand in the multiple operation to EPSR bits[15:12]
After servicing the interrupt, the processor:
returns to the register pointed to by bits[15:12]
resumes execution of the multiple load or store instruction.
When the EPSR holds ICI execution state, bits[26:25,11:10] are zero.
If-Then block
The If-Then block contains up to four instructions following an IT instruction. Each
instruction in the block is conditional. The conditions for the instructions are either all the
same, or some can be the inverse of others. See IT on page 3-122 for more information.
Thumb state
The Cortex-M4 processor only supports execution of instructions in Thumb state. The
following can clear the T bit to 0:
instructions BLX, BX and POP{PC}
PRIMASK
Priority Mask Register Reset Value: 0000 0000H
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
PRI
0 MAS
K
r rw
FAULTMASK
Fault Mask Register Reset Value: 0000 0000H
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
FAU
0 LTM
ASK
r rw
The processor clears the FAULTMASK bit to 0 on exit from any exception handler except
the NMI handler.
BASEPRI
Base Priority Mask Register Reset Value: 0000 0000H
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
0 BASEPRI
r rw
CONTROL register
The CONTROL register controls the stack used and the privilege level for software
execution when the processor is in Thread mode and indicates whether the FPU state is
active. See the register summary in Table 2-2 on Page 2-6 for its attributes.
CONTROL
CONTROL register Reset Value: 0000 0000H
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
FPC SPS nPRI
0
A EL V
r rh rh rh
Handler mode always uses the MSP, so the processor ignores explicit writes to the
active stack pointer bit of the CONTROL register when in Handler mode. The exception
entry and return mechanisms automatically update the CONTROL register based on the
EXC_RETURN value, see Table 2-9 on Page 2-36.
In an OS environment, ARM recommends that threads running in Thread mode use the
process stack and the kernel and exception handlers use the main stack.
By default, Thread mode uses the MSP. To switch the stack pointer used in Thread
mode to the PSP, either:
use the MSR instruction to set the Active stack pointer bit to 1.
perform an exception return to Thread mode with the appropriate EXC_RETURN
value, see Table 2-9 on Page 2-36.
Note: When changing the stack pointer, software must use an ISB instruction
immediately after the MSR instruction. This ensures that instructions after the ISB
instruction execute using the new stack pointer.
CMSIS simplifies software development by enabling the reuse of template code and the
combination of CMSIS-compliant software components from various middleware
vendors. Software vendors can expand the CMSIS to include their peripheral definitions
and access functions for those peripherals.
This document includes the register names defined by the CMSIS, and gives short
descriptions of the CMSIS functions that address the processor core and the core
peripherals.
Note: This document uses the register short names defined by the CMSIS. In a few
cases these differ from the architectural short names that might be used in other
documents.
The following sections give more information about the CMSIS:
Power management programming hints on Page 2-42
CMSIS functions on Page 2-18
Using CMSIS functions to access NVIC on Page 2-45
For additional information please refer to http://www.onarm.com/cmsis
The CMSIS also provides a number of functions for accessing the special registers using
MRS and MSR instructions:
0xFFFFFFFF
Vendor-specific
511MB
memory
0xE0100000
Private peripheral 0xE00FFFFF
1.0MB
bus
0xE0000000
0xDFFFFFFF
0xA0000000
0x9FFFFFFF
0x60000000
0x5FFFFFFF
Peripheral 0.5GB
0x40000000
0x3FFFFFFF
SRAM 0.5GB
0x20000000
0x1FFFFFFF
Code 0.5GB
0x00000000
attributes. The memory type and attributes determine the behavior of accesses to the
region.
The memory types are:
The different ordering requirements for Device and Strongly-ordered memory mean that
the memory system can buffer a write to Device memory, but must not buffer a write to
Strongly-ordered memory.
The additional memory attributes include:
Execute Never (XN) Means the processor prevents instruction accesses. A fault
exception is generated only on execution of an instruction
executed from an XN region.
Strongly-
A2 Normal Device
ordered
A1 access access
access
Normal access - - -
1) See Memory regions, types and attributes on Page 2-20 for more information.
The Code, SRAM, and external RAM regions can hold programs. However, it is
recommended that programs always use the Code region. This is because the processor
has separate buses that enable instruction fetches and data accesses to occur
simultaneously.
The MPU can override the default memory access behavior described in this section. For
more information, see Memory protection unit on Page 2-46.
DMB The Data Memory Barrier (DMB) instruction ensures that outstanding
memory transactions complete before subsequent memory
transactions.
DSB The Data Synchronization Barrier (DSB) instruction ensures that
outstanding memory transactions complete before subsequent
instructions execute.
ISB The Instruction Synchronization Barrier (ISB) ensures that the effect of
all completed memory transactions is recognizable by subsequent
instructions.
MPU programming
Use a DSB followed by an ISB instruction or exception return to ensure that the new
MPU configuration is used by subsequent instructions.
Little-endian format
In little-endian format, the processor stores the least significant byte of a word at the
lowest-numbered byte, and the most significant byte at the highest-numbered byte. For
example:
Memory Register
7 0
31 24 23 16 15 8 7 0
Address A B0 lsbyte B3 B2 B1 B0
A+1 B1
A+2 B2
A+3 B3 msbyte
A Load-Exclusive instruction
Used to read the value of a memory location, requesting exclusive access to that
location.
A Store-Exclusive instruction
Used to attempt to write to the same memory location, returning a status bit to a register.
If this bit is:
0 it indicates that the thread or process gained exclusive access to the memory, and
the write succeeds,
1 it indicates that the thread or process did not gain exclusive access to the memory,
and no write was performed.
The pairs of Load-Exclusive and Store-Exclusive instructions are:
the word instructions LDREX and STREX
the halfword instructions LDREXH and STREXH
the byte instructions LDREXB and STREXB.
Software must use a Load-Exclusive instruction with the corresponding Store-Exclusive
instruction.
To perform an exclusive read-modify-write of a memory location, software must:
1. Use a Load-Exclusive instruction to read the value of the location.
2. Modify the value, as required.
3. Use a Store-Exclusive instruction to attempt to write the new value back to the
memory location.
4. Test the returned status bit. If this bit is:
0 The read-modify-write completed successfully.
1 No write was performed. This indicates that the value returned at step 1 might be
out of date. The software must retry the entire read-modify-write sequence.
Software can use the synchronization primitives to implement a semaphores as follows:
1. Use a Load-Exclusive instruction to read from the semaphore address to check
whether the semaphore is free.
2. If the semaphore is free, use a Store-Exclusive to write the claim value to the
semaphore address.
3. If the returned status bit from step 2 indicates that the Store-Exclusive succeeded
then the software has claimed the semaphore. However, if the Store-Exclusive failed,
another process might have claimed the semaphore after the software performed
step 1.
The Cortex-M4 includes an exclusive access monitor, that tags the fact that the
processor has executed a Load-Exclusive instruction.
The processor removes its exclusive access tag if:
It executes a CLREX instruction.
It executes a Store-Exclusive instruction, regardless of whether the write succeeds.
An exception occurs. This means the processor can resolve semaphore conflicts
between different threads.
For example:
uint16_t value;
uint16_t *address = 0x20001002;
value = __LDREXH (address); // load 16-bit value from memory
address 0x20001002
For an asynchronous exception, other than reset, the processor can execute another
instruction between when the exception is triggered and when the processor enters the
exception handler.
Privileged software can disable the exceptions that Table 2-8 on Page 2-28 shows as
having configurable priority, see:
System Handler Control and State Register on Page 2-71
Interrupt Clear-enable Registers on Page 2-87.
For more information about HardFaults, MemManage faults, BusFaults, and
UsageFaults, see Fault handling on Page 2-36.
Interrupt Service Interrupts IRQ0 to IRQ111 are the exceptions handled by ISRs.
Routines (ISRs)
Fault handlers HardFault, MemManage fault, UsageFault, and BusFault are
fault exceptions handled by the fault handlers.
System handlers NMI, PendSV, SVCall SysTick, and the fault exceptions are all
system exceptions that are handled by system handlers.
On system reset, the vector table is fixed at address 0x00000000. Privileged software
can write to the VTOR to relocate the vector table start address to a different memory
location, in the range 0x00000400 to 0x3FFFFC00, see Vector Table Offset Register on
Page 2-63.
For information about splitting the interrupt priority fields into group priority and
subpriority, see Application Interrupt and Reset Control Register on Page 2-63.
Exception entry
Exception entry occurs when there is a pending exception with sufficient priority and
either:
...
Pre-IRQ top of stack
{aligner}
FPSCR
S15
S14
S13
S12
S11
S10
S9
S8
S7
S6
S5
S4
S3
S2
S1 ...
Pre-IRQ top of stack
S0 {aligner}
xPSR Decreasing xPSR
PC memory PC
address
LR LR
R12 R12
R3 R3
R2 R2
R1 R1
R0 IRQ top of stack R0 IRQ top of stack
If another higher priority exception occurs during exception entry, the processor starts
executing the exception handler for this exception and does not change the pending
status of the earlier exception. This is the late arrival case.
Exception return
Exception return occurs when the processor is in Handler mode and executes one of the
following instructions to load the EXC_RETURN value into the PC:
an LDM or POP instruction that loads the PC
an LDR instruction with PC as the destination
a BX instruction using any register.
EXC_RETURN is the value loaded into the LR on exception entry. The exception
mechanism relies on this value to detect when the processor has completed an
exception handler. The lowest five bits of this value provide information on the return
stack and processor mode. Table 2-9 shows the EXC_RETURN values with a
description of the exception return behavior.
All EXC_RETURN values have bits[31:5] set to one. When this value is loaded into the
PC it indicates to the processor that the exception is complete, and the processor
initiates the appropriate exception return sequence.
A fault handler causes the same kind of fault as the one it is servicing. This escalation
to HardFault occurs because a fault handler cannot preempt itself because it must
have the same priority as the current priority level.
A fault handler causes a fault with the same or lower priority as the fault it is servicing.
This is because the handler for the new fault cannot preempt the currently executing
fault handler.
An exception handler causes a fault for which the priority is the same as or lower than
the currently executing exception.
A fault occurs and the handler for that fault is not enabled.
If a BusFault occurs during a stack push when entering a BusFault handler, the BusFault
does not escalate to a HardFault. This means that if a corrupted stack causes a fault, the
fault handler executes even though the stack push for the handler failed. The fault
handler operates but the stack contents are corrupted.
Note: Only Reset and NMI can preempt the fixed priority HardFault. A HardFault can
preempt any exception other than Reset, NMI, or another HardFault.
2.6.4 Lockup
The processor enters a lockup state if a fault occurs when executing the NMI or
HardFault handlers. When the processor is in lockup state it does not execute any
instructions. The processor remains in lockup state until either:
it is reset
an NMI occurs
it is halted by a debugger
Note: If lockup state occurs from the NMI handler a subsequent NMI does not cause the
processor to leave lockup state.
asserted, or a processor in the system has executed an SEV instruction, see SEV on
page 3-166. Software cannot access this register directly.
Sleep-on-exit
If the SLEEPONEXIT bit of the SCR is set to 1, when the processor completes the
execution of all exception handlers it returns to Thread mode and immediately enters
sleep mode. Use this mechanism in applications that only require the processor to run
when an exception occurs.
For a pulse interrupt, the NVIC continues to monitor the interrupt signal, and if this
is pulsed the state of the interrupt changes to pending and active. In this case,
when the processor returns from the ISR the state of the interrupt changes to
pending, which might cause the processor to immediately re-enter the ISR.
If the interrupt signal is not pulsed while the processor is in the ISR, when the
processor returns from the ISR the state of the interrupt changes to inactive.
Software writes to the corresponding interrupt clear-pending register bit.
For a level-sensitive interrupt, if the interrupt signal is still asserted, the state of the
interrupt does not change. Otherwise, the state of the interrupt changes to inactive.
For a pulse interrupt, state of the interrupt changes to:
inactive, if the state was pending
active, if the state was active and pending.
The parameter IRQn is the IRQ number, see Table 2-8 on Page 2-28. For more
information about these functions see the CMSIS documentation [4].
The memory attributes affect the behavior of memory accesses to the region. The
Cortex-M4 MPU defines:
eight separate memory regions, 0-7
a background region
When memory regions overlap, a memory access is affected by the attributes of the
region with the highest number. For example, the attributes for region 7 take precedence
over the attributes of any region that overlaps region 7.
The background region has the same memory access attributes as the default memory
map, but is accessible from privileged software only.
The Cortex-M4 MPU memory map is unified. This means instruction accesses and data
accesses have same region settings.
If a program accesses a memory location that is prohibited by the MPU, the processor
generates a MemManage fault. This causes a fault exception, and might cause
termination of the process in an OS environment.
In an OS environment, the kernel can update the MPU region setting dynamically based
on the process to be executed. Typically, an embedded OS uses the MPU for memory
protection.
Configuration of MPU regions is based on memory types, see Memory regions, types
and attributes on Page 2-20.
Table 2-14 shows the possible MPU region attributes.
Note: The shareability and cache attributes are not relevant to the XMC4500.
Table 2-16 shows the cache policy for memory attribute encodings with a TEX value is
in the range 4-7.
Table 2-18 shows the AP encodings that define the access permissions for privileged
and unprivileged software.
Subregions
Regions of 256 bytes or more are divided into eight equal-sized subregions. Set the
corresponding bit in the SRD field of the MPU_RASR to disable a subregion, see MPU
Region Attribute and Size Register on Page 2-97. The least significant bit of SRD
controls the first subregion, and the most significant bit controls the last subregion.
Disabling a subregion means another region overlapping the disabled range matches
instead. If no other enabled region overlaps the disabled subregion the MPU issues a
fault.
Regions of 32, 64, and 128 bytes do not support subregions, With regions of these sizes,
you must set the SRD field to 0x00, otherwise the MPU behavior is Unpredictable.
By default this register is set to provide optimum performance from the Cortex-M4
processor, and does not normally require modification.
ACTLR
Auxiliary Control Register (E000 E008H) Reset Value: 0000 0000H
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
DISD DIS
DISO DISF DISF
0 0 EFW MCY
OFP PCA OLD
BUF CINT
r rw rw r rw rw rw
About IT folding
In some situations, the processor can start executing the first instruction in an IT block
while it is still executing the IT instruction. This behavior is called IT folding, and improves
performance, However, IT folding can cause jitter in looping. If a task must avoid jitter,
set the DISFOLD bit to 1 before executing the task, to disable IT folding.
CPUID
CPUID Base Register (E000 ED00H) Reset Value: 410F C241H
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
r r r r r
ICSR
Interrupt Control and State Register
(E000 ED04H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
NMI
PEN PEN PEN PEN ISRP
PEN VECTPEN
0 DSV DSV DST DST 0 Res ENDI 0
DSE DING
SET CLR SET CLR NG
T
rw r rw w rw w r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RET
VECTPENDING TOB 0 VECTACTIVE
ASE
r r r r
VTOR
Vector Table Offset Register (E000 ED08H) Reset Value: 0000 0000H
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
TBLOFF 0
rw r
When setting TBLOFF, you must align the offset to the number of exception entries in
the vector table. The XMC4500 provides 112 interrupt nodes - minimum alignment is
therefore 256 words, enough for up to 128 interrupts.
Notes
1. XMC4500 implements 112 interrupts, the remaining nodes to 128 are not used.
2. Table alignment requirements mean that bits[9:0] of the table offset must always be
zero.
AIRCR
Application Interrupt and Reset Control Register
(E000 ED0CH) Reset Value: FA05 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VECTKEY
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SYS VEC
ENDI VEC
RES TCL
ANN 0 PRIGROUP 0 TRE
ETR RAC
ESS SET
EQ TIVE
r r rw r w w w
Binary point
The PRIGROUP field indicates the position of the binary point that splits the PRI_n fields
in the Interrupt Priority Registers into separate group priority and subpriority fields.
Table 2-20 shows how the PRIGROUP value controls this split.
Note: Determining preemption of an exception uses only the group priority field, see
Interrupt Priority Grouping on Page 2-31.
SCR
System Control Register (E000 ED10H) Reset Value: 0000 0000H
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
SLE
SEV SLE
EPO
0 ONP 0 EPD 0
NEXI
END EEP
T
r rw r rw rw r
CCR
Configuration and Control Register
(E000 ED14H) Reset Value: 0000 0200H
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
NON
UNA USE
STK BFH DIV_ BAS
LIGN RSE
0 ALIG FNMI 0 0_TR 0 ETH
_TR TMP
N GN P RDE
P END
NA
r rw rw r rw rw r rw rw
Each PRI_N field is 8 bits wide, but the XMC4500 implements only bits[7:2] of each field,
and bits[1:0] read as zero and ignore writes.
System Handler Priority Register 1
SHPR1
System Handler Priority Register 1
(E000 ED18H) Reset Value: 0000 0000H
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
r rw rw rw
SHPR2
System Handler Priority Register 2
(E000 ED1CH) Reset Value: 0000 0000H
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
PRI_11 0
rw r
SHPR3
System Handler Priority Register 3
(E000 ED20H) Reset Value: 0000 0000H
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
PRI_15 PRI_14 0
rw rw r
SHCSR
System Handler Control and State Register
(E000 ED24H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
USG BUS MEM
FAU FAU FAU
0
LTE LTE LTE
NA NA NA
r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BUS MEM USG
SVC USG BUS MEM
FAU FAU FAU SYS PEN MON SVC
ALL FAU FAU FAU
LTP LTP LTP TICK DSV 0 ITOR ALL 0 0
PEN LTA LTA LTA
END END END ACT ACT ACT ACT
DED CT CT CT
ED ED ED
rw rw rw rw rw rw r rw rw r rw r rw rw
Notes
1. Active bits, read as 1 if the exception is active, or as 0 if it is not active. You can write
to these bits to change the active status of the exceptions, but see the Caution in this
section.
2. Pending bits, read as 1 if the exception is pending, or as 0 if it is not pending. You
can write to these bits to change the pending status of the exceptions.
3. Enable bits, set to 1 to enable the exception, or set to 0 to disable the exception.
If you disable a system handler and the corresponding fault occurs, the processor treats
the fault as a hard fault.
You can write to this register to change the pending or active status of system
exceptions. An OS kernel can write to the active bits to perform a context switch that
changes the current exception type.
Note: Software that changes the value of an active bit in this register without correct
adjustment to the stacked content can cause the processor to generate a fault
exception. Ensure software that writes to this register retains and subsequently
restores the current active status.
Note: After you have enabled the system handlers, if you have to change the value of a
bit in this register you must use a read-modify-write procedure to ensure that you
change only the required bit.
The flags in the BFSR indicate the cause of a bus access fault.
The UFSR indicates the cause of a UsageFault.
31 16 15 8 7 0
Bus Fault Status Memory Management
Usage Fault Status Register
Register Fault Status Register
CFSR
Configurable Fault Status Register
(E000 ED28H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DIVB UNA INVS UND
NOC INVP
0 YZE LIGN 0 TAT EFIN
P C
RO ED E STR
r rw rw r rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
IMP
BFA UNS PRE MMA MLS MST MUN DAC
LSP STK RECI IBUS IACC
RVA 0 TKE CISE RVA 0 PER KER STK 0 CVIO
ERR ERR SER ERR VIOL
LID RR RR LID R R ERR L
R
rw r rw rw rw rw rw rw rw r rw rw rw r rw rw
HFSR
HardFault Status Register (E000 ED2CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DEB
FOR
UGE 0
CED
VT
rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VEC
0 TTB 0
L
r rw r
Note: The HFSR bits are sticky. This means as one or more fault occurs, the associated
bits are set to 1. A bit that is set to 1 is cleared to 0 only by writing 1 to that bit, or
by a reset.
MMFAR
MemManage Fault Address Register
(E000 ED34H) Reset Value: XXXX XXXXH
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
ADDRESS
rw
When an unaligned access faults, the address is the actual address that faulted.
Because a single read or write instruction can be split into multiple aligned accesses, the
fault address can be any address in the range of the requested access size.
Flags in the MMFSR indicate the cause of the fault, and whether the value in the MMFAR
is valid. See MemManage Fault Status Register on Page 2-73.
BFAR
BusFault Address Register (E000 ED38H) Reset Value: XXXX XXXXH
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
ADDRESS
rw
When an unaligned access faults the address in the BFAR is the one requested by the
instruction, even if it is not the address of the fault.
Flags in the BFSR indicate the cause of the fault, and whether the value in the BFAR is
valid. See BusFault Status Register on Page 2-73.
AFSR
Auxiliary Fault Status Register (E000 ED3CH) Reset Value: 0000 0000H
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
rw
Each AFSR bit maps directly to an AUXFAULT input of the processor, and a single-cycle
HIGH signal on the input sets the corresponding AFSR bit to one. It remains set to 1 until
you write 1 to the bit to clear it to zero.
When an AFSR bit is latched as one, an exception does not occur. Use an interrupt if an
exception is required.
SYST_CSR
SysTick Control and Status Register
(E000 E010H) Reset Value: 0000 0004H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
COU
0 NTF
LAG
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CLK
TICK ENA
0 SOU
INT BLE
RCE
r rw rw rw
When ENABLE is set to 1, the counter loads the RELOAD value from the SYST_RVR
register and then counts down. On reaching 0, it sets the COUNTFLAG to 1 and
optionally asserts the SysTick depending on the value of TICKINT. It then loads the
RELOAD value again, and begins counting.
SYST_RVR
SysTick Reload Value Register (E000 E014H) Reset Value: XXXX XXXXH
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
0 RELOAD
r rw
2. The RELOAD value is calculated according to its use. For example, to generate a
multi-shot timer with a period of N processor clock cycles, use a RELOAD value of
N-1. If the SysTick interrupt is required every 100 clock pulses, set RELOAD to 99.
SYST_CVR
SysTick Current Value Register (E000 E018H) Reset Value: XXXX XXXXH
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
0 CURRENT
r rw
SYST_CALIB
SysTick Calibration Value Register
r (E000 E01CH) Reset Value: C000 0000H
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
N
S
O
K
R 0 TENMS
E
E
W
F
rw rw r rw
NVIC_ISERx (x=0-3)
Interrupt Set-enable Register x
(E000 E100H + 4*x) Reset Value: 0000 0000H
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
SETENA
rw
If a pending interrupt is enabled, the NVIC activates the interrupt based on its priority. If
an interrupt is not enabled, asserting its interrupt signal changes the interrupt state to
pending, but the NVIC never activates the interrupt, regardless of its priority.
NVIC_ISCERx (x=0-3)
Interrupt Clear-enable Register x
(E000 E180H + 4*x) Reset Value: 0000 0000H
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
CLRENA
rw
NVIC_ISSPRx (x=0-3)
Interrupt Set-pending Register x
(E000 E200H + 4*x) Reset Value: 0000 0000H
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
SETPEND
rw
NVIC_ICPRx (x=0-3)
Interrupt Clear-pending Register x
(E000 E280H + 4*x) Reset Value: 0000 0000H
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
CLRPEND
rw
Note: Writing 1 to an ICPR bit does not affect the active state of the corresponding
interrupt.
NVIC_IABRx (x=0-3)
Interrupt Active Bit Register x
(E000 E300H + 4*x) Reset Value: 0000 0000H
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
ACTIVE
rw
A bit reads as one if the status of the corresponding interrupt is active or active and
pending.
31 24 23 16 15 8 7 0
...
IPRn PRI_4n+3 PRI_4n+2 PRI_4n+1 PRI_4n
...
...
IPR0 PRI_3 PRI_2 PRI_1 PRI_0
NVIC_IPRx (x=0-27)
Interrupt Priority Register x
(E000 E400H + 4*x) Reset Value: 0000 0000H
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
rw rw rw rw
See Using CMSIS functions to access NVIC on Page 2-45 for more information about
the access to the interrupt priority array, which provides the software view of the interrupt
priorities.
Find the IPR number and byte offset for interrupt m as follows:
the corresponding IPR number n, see Figure 2-10 on Page 2-907, is given by
n = m DIV 4
the byte offset of the required Priority field in this register is m MOD 4, where:
byte offset 0 refers to register bits[7:0]
byte offset 1 refers to register bits[15:8]
byte offset 2 refers to register bits[23:16]
byte offset 3 refers to register bits[31:24].
STIR
Software Trigger Interrupt Register
(E000 EF00H) Reset Value: 0000 0000H
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
0 INTID
r w
MPU_TYPE
MPU Type Register (E000 ED90H) Reset Value: 0000 0800H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 IREGION
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SEP
DREGION 0 ARA
TE
r r r
MPU_CTRL
MPU Control Register (E000 ED94H) Reset Value: 0000 0000H
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
PRIV HFN
ENA
0 DEF MIE
BLE
ENA NA
r rw rw rw
MPU_RNR
MPU Region Number Register (E000 ED98H) Reset Value: 0000 0000H
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
0 REGION
r rw
Normally, you write the required region number to this register before accessing the
MPU_RBAR or MPU_RASR. However you can change the region number by writing to
the MPU RBAR with the VALID bit set to 1, see MPU Region Base Address Register.
This write updates the value of the REGION field.
MPU_RBAR
MPU Region Base Address Register
(E000 ED9CH) Reset Value: 0000 0000H
MPU_RBAR_A1
MPU Region Base Address Register A1
(E000 EDA4H) Reset Value: 0000 0000H
MPU_RBAR_A2
MPU Region Base Address Register A2
(E000 EDACH) Reset Value: 0000 0000H
MPU_RBAR_A3
MPU Region Base Address Register A3
(E000 EDB4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADDR
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VALI
ADDR 0 REGION
D
rw r rw rw
MPU_RASR
MPU Region Attribute and Size Register
(E000 EDA0H) Reset Value: 0000 0000H
MPU_RASR_A1
MPU Region Attribute and Size Register A1
(E000 EDA8H) Reset Value: 0000 0000H
MPU_RASR_A2
MPU Region Attribute and Size Register A2
(E000 EDB0H) Reset Value: 0000 0000H
MPU_RASR_A3
MPU Region Attribute and Size Register A3
(E000 EDB8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 XN 0 AP 0 TEX S C B
r rw r rw r rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ENA
SRD 0 SIZE
BLE
rw r rw rw
For information about access permission, see MPU Access Permission Attributes on
Page 2-48.
CPACR
Coprocessor Access Control Register
(E000 ED88H) Reset Value: 0000 0000H
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
0 CP11 CP10 0
r rw rw r
FPCCR
Floating-point Context Control Register
(E000 EF34H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ASP LSP
0
EN EN
rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MON BFR MMR HFR THR USE LSP
0 0 0
RDY DY DY DY EAD R ACT
r rw r rw rw rw rw r rw rw
FPCAR
Floating-point Context Address Register
(E000 EF38H) Reset Value: 0000 0000H
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
ADDRESS 0
rw r
FPSCR
Floating-point Status Control Register
Reset Value: XXXX XXXXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
N Z C V 0 AHP DN FZ RMode 0
rw rw rw rw r rw rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
r rw r rw rw rw rw rw
FPDSCR
Floating-point Default Status Control Register
(E000 EF3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 AHP DN FZ RMode 0
r rw rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
3 Bus System
The XMC4500 is targeted for use in embedded systems. Therefore the key features are
timing determinism and low latency on real time events. Bus bandwidth is required
particularly for communication peripherals.
The bus system will therefore provide:
Timing Determinism
Low Latency
Performance
Throughput
Memory Interface
The on-chip memories capable to accept a transfer request with each bus clock cycle.
The memory interface data bus width is 32-bit. Each memory slave support 32-bit, 16-
bit and 8-bit access types.
Peripheral Interface
Each slave supports 32-bit accesses. Some slaves also support 8-bit and/or 16-bit
accesses.
Masters
System System
CPU Ethernet USB
DMA0 DMA1
D-Code
System
I-Code
Flash
&
BROM
PSRAM
DSRAM 1
Slaves
DSRAM 2
EBU
Peripherals 0
(PBA0)
Peripherals 1
(PBA1)
Peripherals 2
(PBA2)
Arbitration Priorities
In case of concurring access to the same slave the master with the highest priority is
granted the bus.
The DSRAM priorities are choosen to support the application dependance of the data
memories:
DSRAM1: general purpose data storage
DSRAM2: Ethernet and USB data storage
Notes
1. The CPU exception model and interrupt processing (by NVIC unit) are described in
the CPU chapter.
2. General Purpose DMA request processing is described in the GPDMA chapter
4.1 Overview
Efficient Service Request Processing is based on the interconnect between the request
sources and the request processing units. XMC4500 provides both fixed and
programmable interconnect.
4.1.1 Features
The following features are provided for Service Request processing:
Connectivity matrix between Service Requests and request processing units
Fixed connections
Programmable connections using ERU
Event Request Unit (ERU)
Flexible processing of external and internal service requests
Programmable for edge and/or level triggering
Multiple inputs per channel
Triggers combinable from multiple inputs
Input and output gating
4.1.2 Applications
The following table lists features of the Service Request Processing unit mapped to
selected applications.
On-Chip Unit
PORTS
Outputs
Interconnections
ERU
On-Chip Unit
DLR NVIC PORTS
Inputs
GPDMA CPU
NVIC
(Interrupt)
DLR
(DMA Request)
VADC.SR0
CCU4.<input_x>
ERU1.<input_x>
NVIC Features
112 interrupt nodes
Programmable priority level of 0-63 for each interrupt node. A higher level
corresponds to a lower priority, so level 0 is the highest interrupt priority
Request source can be level or edge signal type
Dynamic reprioritization of interrupts.
Grouping of priority values into group priority and subpriority fields.
Interrupt tail-chaining.
Service
Request
SRSELx.RSy DEMUX
Selected SR
DMA
LNEN.LNy Transfer
Req
DMA
GPDMA
Handler
Ack
SCU
If any bit within the DLR_OVRSTAT register is set, a service request is flagged by setting
the SCU_RAWSR.DLROVR bit.
The DLR unit has the following inputs:
3
Source Inputs Channel 3
2
Source Inputs Channel 2
1
ADC ADC
Source Inputs Channel 1
0
CAPCOM CAPCOM
Source Inputs Channel 0
>1 &
&
GPIO IRQ
EVENTS TRIGGERS
Trigger Cross Connect
Event Input Selectors
DAC DSD
POSIF POSIF
to provide one combined output signal ERSxO to the associated ETLx. Input Ax can be
selected from 4 options of the input vector ERU_xA[3:0] and can be optionally inverted.
A similar structure exists for input Bx (selection from ERU_xB[3:0]).
In addition to the direct choice of either input Ax or Bx or their inverted values, the
possible logical combinations for two selected inputs are a logical AND or a logical OR.
ERU_xA0
ERU_xA1
Select Select Ax
Input Polarity
ERU_xA2 Bx
Ax Ax
ERU_xA3 Select
Ax OR Bx Source ERSxO
1 ETLx
for
ERU_xB0
ERSxO
ERU_xB1
Select Select &
Ax AND Bx
Input Polarity
ERU_xB2
Bx Bx
ERU_xB3
EXISEL. EXICONx.
EXSxB NB ERSx
EXICONx. EXICONx.
FE LD ETLx
Modify
set Status Flag EXICONx.FL
Status to all OGUy
clear FL
Flag
ERSxO
Detect
edge event
ERSx Event TRx0 to
(edge) OGU0
EXICON0.FL
Pattern
Detection ERU_PDOUT0
TR00 Inputs ERU_GOUT0
TR01
ERU_IOUT0
ETL0 TR02
OGU0
ERU_TOUT0
TR03 Trigger
Inputs Peripheral
TRx0 Triggers
EXICON1.FL
Pattern
Detection ERU_PDOUT1
TR10 Inputs ERU_GOUT1
TR11
ERU_IOUT1
ETL1 TR12
OGU1
ERU_TOUT1
TR13 Trigger
Inputs Peripheral
TRx1 Triggers
EXICON2.FL
Pattern
Detection ERU_PDOUT2
TR20 Inputs ERU_GOUT2
TR21
ERU_IOUT2
ETL2 TR22
OGU2
ERU_TOUT2
TR23 Trigger
Inputs Peripheral
TRx2 Triggers
EXICON3.FL
Pattern
Detection ERU_PDOUT3
TR30 Inputs ERU_GOUT3
TR31
ERU_IOUT3
ETL3 TR32
OGU3
ERU_TOUT3
TR33 Trigger
Inputs Peripheral
TRx3 Triggers
Status Flags
EXICON0.FL
EXOCONy. EXOCONy.
IPEN0 GEEN
EXICON1.FL
ERU_PDOUTy
EXOCONy.
IPEN1 Detect EXOCONy.
EXICON2.FL Pattern PDR
EXOCONy.
IPEN2 Select
EXOCONy.
Gating
EXICON3.FL GP
Scheme
EXOCONy.
Triggers IPEN3
from Input ERU_GOUTy
Channels
TR0y
Combine
TR1y
Interrupt
OGU
Gating ERU_IOUTy
TR2y Triggers
(AND)
TR3y (OR)
ERU_TOUTy
ERU_OGUy1
ERU_OGUy2
Select
Peripheral EXOCONy.
Triggers Periph.
ERU_OGUy3 ISS
Triggers
OGUy
Each OGUy unit generates 4 output signals that are distributed to the system (not all of
them are necessarily used):
ERU_PDOUTy to directly output the pattern match information for gating purposes
in other modules (pattern match = 1).
ERU_GOUTy to output the pattern match or pattern miss information (inverted
pattern match), or a permanent 0 or 1 under software control for gating purposes in
other modules.
ERU_TOUTy as combination of a peripheral trigger, a pattern detection result
change event, or the ETLx trigger outputs TRxy to trigger actions in other modules.
ERU_IOUTy as gated trigger output (ERU_GOUTy logical AND-combined with
ERU_TOUTy) to trigger service requests (e.g. the service request generation can be
gated to allow service request activation during a certain time window).
Trigger Combination
The trigger combination logically OR-combines different trigger inputs to form a common
trigger ERU_TOUTy. Possible trigger inputs are:
In each ETLx unit of the Input Channels, the trigger output TRxy can be enabled and
the trigger event can be directed to one of the OGUy units.
One out of three peripheral trigger signals per OGUy can be selected as additional
trigger source. These peripheral triggers are generated by on-chip peripheral
modules, such as capture/compare or timer units. The selection is done by bit field
EXOCONy.ISS.
In the case that at least one pattern detection input is enabled (EXOCONy.IPENx)
and a change of the pattern detection result from pattern match to pattern miss (or
vice-versa) is detected, a trigger event is generated to indicate a pattern detection
result event (if enabled by ECOCONy.GEEN).
The trigger combination offers the possibility to program different trigger criteria for
several input signals (independently for each Input Channel) or peripheral signals, and
to combine their effects to a single output, e.g. to generate an service request or to start
an ADC conversion. This combination capability allows the generation of a service
request per OGU that can be triggered by several inputs (multitude of request sources
results in one reaction).
The selection is defined by the bit fields ISS in registers ERU0_EXOCONx (x=0-3) (for
ERU0.OGUx) and ERU1_EXOCONy (y=0-3) (for ERU1.OGUy).
Pattern Detection
The pattern detection logic allows the combination of the status flags of all ETLx units.
Each status flag can be individually included or excluded from the pattern detection for
each OGUy, via control bits EXOCONy.IPENx. The pattern detection block outputs the
following pattern detection results:
4.10 Registers
Registers Overview
The absolute register address is calculated by adding:
Module Base Address + Offset Address
Table 4-8
Short Name Description Offset Access Mode Description
Addr. Read Write See
DLR Registers
OVRSTAT Status of DMA Service 000H U, PV PV Page 4-25
Request Overruns
OVRCLR Clear Status of DMA 004H U, PV PV Page 4-26
Service Request
Overruns
SRSEL0 DLR Service Request 008H U, PV PV Page 4-27
Selection 0
LNEN Enable DLR Line 010H U, PV PV Page 4-26
SRSEL1 DLR Service Request 00CH U, PV PV Page 4-28
Selection 1
ERU Registers
EXISEL ERU External Input 0000H U, PV PV Page 4-29
Control Selection
EXICON0 ERU External Input 0010H U, PV PV Page 4-31
Control Selection
EXICON1 ERU External Input 0014H U, PV PV Page 4-31
Control Selection
EXICON2 ERU External Input 0018H U, PV PV Page 4-31
Control Selection
DLR_OVRSTAT
The DLR_OVRSTAT register is used to track status of GPDMA service request
overruns. Upon overrun detection, additionally a service request flag is set in the
SCU_RAWSR.DLROVR bit.
DLR_OVRSTAT
Overrun Status (00H) Reset Value: 0000 0000H
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
0 LN11 LN10 LN9 LN8 LN7 LN6 LN5 LN4 LN3 LN2 LN1 LN0
r rh rh rh rh rh rh rh rh rh rh rh rh
DLR_OVRCLR
The DLR_OVRCLR register is used to clear the DLR_OVRSTAT register bits.
DLR_OVRCLR
Overrun Clear (04H) Reset Value: 0000 0000H
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
0 LN11 LN10 LN9 LN8 LN7 LN6 LN5 LN4 LN3 LN2 LN1 LN0
r w w w w w w w w w w w w
DLR_LNEN
The DLR_LNEN register is used to enable each individual DLR line and to reset a
previously stored and pending service request.
DLR_LNEN
Line Enable (10H) Reset Value: 0000 0000H
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
0 LN11 LN10 LN9 LN8 LN7 LN6 LN5 LN4 LN3 LN2 LN1 LN0
r rw rw rw rw rw rw rw rw rw rw rw rw
DLR_SRSELx
The DLR_SRSELx registers are used to select the service request source used to
trigger a DMA transfer.
DLR_SRSEL0
Service Request Selection 0
(08H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw
DLR_SRSEL1
Service Request Selection 1
(0CH) Reset Value: 0000 0000H
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
rw rw rw rw
ERU0_EXISEL
Event Input Select (00H) Reset Value: 0000 0000H
ERU1_EXISEL
Event Input Select (0000H) Reset Value: 0000 0000H
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
rw rw rw rw rw rw rw rw
ERU0_EXICONx (x=0-3)
Event Input Control x
(10H + 4*x) Reset Value: 0000 0000H
ERU1_EXICONy (y=0-3)
Event Input Control y
(0010H + 4*y) Reset Value: 0000 0000H
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
0 NB NA SS FL OCS FE RE LD PE
r rw rw rw rwh rw rw rw rw rw
ERU0_EXOCONx (x=0-3)
Event Output Trigger Control x
(20H + 4*x) Reset Value: 0000 0008H
ERU1_EXOCONy (y=0-3)
Event Output Trigger Control y
(0020H + 4*y) Reset Value: 0000 0008H
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
IPEN IPEN IPEN IPEN GEE
0 GP PDR ISS
3 2 1 0 N
rw rw rw rw r rw rh rw rw
4.11 Interconnects
This section describes how the ERU0 and ERU1 modules are connected within the
XMC4500 system.
ERU0
- Select
xA[3:0] - Combine
x - Detect y
IOUTy TRIGGER
EXTERNAL EVENTS
- Cross-
Connect
xB[3:0] - Gate
GPDMA
SR1-4
PORTS Req Ack
PORTS
DLR
PORTS NVIC.SRn
SR5-8
PORTS
ERU1
- Select
xA[3:0] - Combine IOUTy TRIGGER
x - Detect y
- Cross-
Connect
xB[3:0] - Gate PDOUTy LEVEL
INTERNAL EVENTS
PERIPH
PERIPH
PERIPH
Top-Level
Cross
Inter-
connect
x=0-3 y=0-3
5.1 Overview
The GPDMA module enables hardware or software controlled data transfers between all
microcontroller modules with the exclusion of those modules which provide built-in DMA
functionality (USB and Ethernet).
Each GPDMA module contains a dedicated set of highly programmable channels, that
can accommodate several type of peripheral-to-peripheral, peripheral-to-memory and
memory-to-memory transfers.
The link between a highly programmable channel allocation and channel priority, gives
a high benefit for applications that need high efficiency and parallelism.
The built-in fast DMA request handling together with the flexible peripheral configuration,
enables the implementation of very demanding application software loops.
5.1.1 Features
The GPDMA component includes the following features.
General
Bus interfaces
1 Bus master interface per each DMA unit
1 Bus slave interface per each DMA unit
Channels
One GPDMA0 unit with 8 channels
One GPDMA1 unit with 4 channels
Programmable channel priority
Transfers
Support for memory-to-memory, memory-to-peripheral, peripheral-to-memory,
and peripheral-to-peripheral DMA transfers
Channels
All channels can be programmed for the following transfer modes
DMA triggered by software or selectable from hardware service request sources
Programmable source and destination addresses
Address increment, decrement, or no change
Channels 0 and 1 of GPDMA0 can be programmed for the following transfer modes
Multi-block transfers achieved through:
Linked Lists (block chaining)
Auto-reloading of channel registers
Contiguous address between blocks
Independent source and destination selection of multi-block transfer type
Scatter/Gather - source and destination areas do not need to be in a contiguous
memory space
The GPDMA0 channels 0 and 1 provide a FIFO of 32 Bytes (eight 32-bit entries). These
channels can be used to execute burst transfers up to a fixed length burst size of 8. The
remaining channels FIFO size is 8 Bytes.
Channel Control
Programmable source and destination for each channel
Programmable burst transaction size for each channel
Programmable enable and disable of DMA channel
Support for disabling channel without data loss
Support for suspension of DMA operation
Support for ERROR response
Bus locking - programmable over transaction, block, or DMA transfer level
Channel locking - programmable over transaction, block, or DMA transfer level
Optional writeback of the Channel Control register at the end of every block transfer
Interrupts
Combined and separate interrupt requests
Interrupt generation on:
DMA transfer (multi-block) completion
Block transfer completion
Single and burst transaction completion
Error condition
Support of interrupt enabling and masking
GPDMA0
GPDMA Channels
Slave I/F
Channel 7
...
Channel 1 Arbiter
Master I/F
Channel 0 Cortex uC
Ethernet USB
HW handshaking
HW I/F n
...
HW I/F 1
HW I/F 0 SRAM
Bus Matrix
Peripherals
(Bridge 1)
Bridge 1
GPDMA1
Bridge 2
GPDMA Channels Peripherals
Slave I/F
(Bridge 2)
Channel 3
...
Channel 1 Arbiter
Master I/F
Channel 0
DLR
(DMA Line Router)
DMA requests
HW handshaking
DMA requests
HW I/F n
...
HW I/F 1
HW I/F 0
Transfer hierarchy - Figure 5-2 illustrates the hierarchy between GPDMA transfers,
block transfers, transactions (single or burst), and AHB transfers (single or burst) for
non-memory peripherals. Figure 5-3 shows the transfer hierarchy for memory.
Note: Note that for memory peripherals, there is no DMA Transaction Level.
GPDMA
Transfer DMA Transfer Level
GPDMA
Transfer DMA Transfer Level
between the GPDMA and a source or destination peripheral if the peripheral is a non-
memory device. There are two types of transactions:
Single transaction - is always converted to a single AHB transfer.
Burst transaction - Length of a burst transaction is programmed into the GPDMA.
The burst transaction is converted into a sequence of AHB fixed length bursts and
AHB single transfers. GPDMA executes each burst transfer by performing
incremental bursts that are no longer than the maximum burst size set; the only
type of burst in this kind of transaction is incremental. The burst transaction length
is under program control and normally bears some relationship to the FIFO sizes
in the GPDMA and in the source and destination peripherals.
DMA transfer - Software controls the number of blocks in a GPDMA transfer. Once
the DMA transfer has completed, the hardware within the GPDMA disables the
channel and can generate an interrupt to signal the DMA transfer completion. You
can then reprogram the channel for a new DMA transfer.
Single-block DMA transfer - Consists of a single block.
Multi-block DMA transfer - DMA transfer may consist of multiple GPDMA blocks.
Multi-block DMA transfers are supported through block chaining (linked list
pointers), auto-reloading channel registers, and contiguous blocks. The source
and destination can independently select which method to use
- Linked lists (block chaining) - Linked list pointer (LLP) points to the location in
system memory where the next linked list item (LLI) exists. The LLI is a set of
registers that describes the next block (block descriptor) and an LLP register. The
GPDMA fetches the LLI at the beginning of every block when block chaining is
enabled.
LLI accesses are always 32-bit accesses aligned to 32-bit boundaries and cannot
be changed or programmed to anything other than 32-bit, even if the AHB master
interface of the LLI supports more than a 32-bit data width.
- Auto-reloading - GPDMA automatically reloads the channel registers at the end
of each block to the value when the channel was first enabled.
- Contiguous blocks - Address between successive blocks is selected to be a
continuation from the end of the previous block.
Scatter - Relevant to destination transfers within a block. The destination address is
incremented or decremented by a programmed amount when a scatter boundary is
reached. The number of AHB transfers between successive scatter boundaries is
under software control.
Gather - Relevant to source transfers within a block. The source address is
incremented or decremented by a programmed amount when a gather boundary is
reached. The number of AHB transfers between successive gather boundaries is
under software control.
Channel locking - Software can program a channel to keep the AHB master
interface by locking arbitration of the master AHB interface for the duration of a DMA
transfer, block, or transaction (single or burst).
Bus locking - Software can program a channel to maintain control of the AHB bus
for the duration of a DMA transfer, block, or transaction (single or burst). At minimum,
channel locking is asserted during bus locking.
FIFO mode - Special mode to improve bandwidth. When enabled, the channel waits
until the FIFO is less than half full to fetch the data from the source peripheral, and
waits until the FIFO is greater than or equal to half full in order to send data to the
destination peripheral. Because of this, the channel can transfer the data using
bursts, which eliminates the need to arbitrate for the AHB master interface in each
single AHB transfer. When this mode is not enabled, the channel waits only until the
FIFO can transmit or accept a single AHB transfer before it requests the master bus
interface.
Note: Throughout the remainder of this chapter, references to both source and
destination hardware handshaking interfaces assume an active-high interface
(refer to CFGx.SRC(DST)_HS_POL bits in the Channel Configuration register,
CFG). When active-low handshaking interfaces are used, then the active level and
edge are reversed from that of an active-high interface.
Note: Source and destination peripherals can independently select the handshaking
interface type; that is, hardware or software handshaking. For more information,
refer to the CFGx.HS_SEL_SRC and CFGx.HS_SEL_DST parameters in the
CFG register.
Interrupt
If (5.6) is fulfilled then the source never enters this region, and the source block
uses only burst transactions.
The destination peripheral enters the Single Transaction Region when the number
of bytes left to complete in the destination block transfer is less than
dst_burst_size_bytes.
If (5.7) is fulfilled then the destination never enters this region, and the destination
block uses only burst transactions.
blk_size_bytes/dst_burst_size_bytes = integer
(5.7)
Note: The above conditions cause a peripheral to enter the Single Transaction Region.
When the peripheral is outside the Single Transaction Region, then the GPDMA
responds to only burst transaction requests.
Example 1
Scenario: Example block transfer when the GPDMA is the flow controller. This example
is the same for both software and hardware handshaking interfaces. Table 5-4 lists the
DMA parameters for this example (as an exemple the FIFO depth is taken as 16 bytes).
Using (5.5), a total of 48 bytes are transferred in the block (that is blk_size_bytes_dma
= 48). As shown in Figure 5-6, this block transfer consists of three bursts of length 4 from
the source, interleaved with three bursts, again of length 4, to the destination.
Example 2
Scenario: Effect of the maximum AMBA burst length, CFGx.MAX_ABRST. This
example is the same for both software and hardware handshaking interfaces.
If the CFGx.MAX_ABRST = 2 parameter and all other parameters are left unchanged
from Example 1, Table 5-4, then the block transfer would look like that shown in
Figure 5-8.
Channel Fifo
32
The channel FIFO is alternatively half filled by a burst from the source, and then emptied
by a burst to the destination until the block transfer has completed; this is illustrated in
Figure 5-9.
Channel Fifo
32
Recommendation
To allow a burst transaction to complete in a single burst, the following should be true:
CFGx.MAX_ABRST >= max(src_burst_size_bytes,
dst_burst_size_bytes)
Adhering to the above recommendation results in a reduced number of bursts per block,
which in turn results in improved bus utilization and lower latency for block transfers.
Limiting a burst to a maximum length prevents the GPDMA from saturating the AHB bus
when the system arbiter is configured to only allow changing of the grant signals to bus
masters at the end of an undefined length burst. It also prevents a channel from
saturating a GPDMA master bus interface.
Example 3
Scenario: Source peripheral enters Single Transaction Region; the GPDMA is the flow
controller.
This example is the same for both hardware and software handshaking and
demonstrates how a block from the source can be completed using a series of single
transactions. It also demonstrates how the watermark level that triggers a burst request
in the source peripheral can be dynamically adjusted so that the block transfer from the
source completes with an Early-terminated Burst Transaction. Table 5-5 lists the
parameters used in this example (as an example the FIFO depth was considered as 16
bytes).
In this case, CTL.BLOCK_TS is not a multiple of the source burst transaction length,
CTL.SRC_MSIZE, so near the end of a block transfer from the source, the amount of
data left to be transferred is less than src_burst_size_bytes.
In this example, the block size is a multiple of the destination burst transaction length:
blk_size_bytes_dma/dst_burst_size_bytes = 48/16 = integer
The destination block is made up of three burst transactions to the destination and does
not enter the Single Transaction Region.
The block size is not a multiple of the source burst transaction length:
blk_size_bytes_dma/src_burst_size_bytes = 48/32 != integer
Consider the case where the watermark level that triggers a source burst request in the
source peripheral is equal to CTL.SRC_MSIZE = 8; that is, eight entries or more need
to be in the source peripheral FIFO in order to trigger a burst request. Figure 5-12 shows
how this block transfer is broken into burst and single transactions, and bursts and single
transfers.
Channel Fifo
32
Figure 5-13 shows the status of the source FIFO at various times throughout the source
block transfer.
In the Single Transaction Region, the GPDMA performs single transactions from the
source peripheral until the source block transfer has completed. In this example, the
GPDMA completes the source block transfer using four single transactions from the
source.
Now consider Case B in Figure 5-14, where the source peripheral can dynamically
adjust the watermark level that triggers a burst transaction request near the end of a
block. After the first source burst transaction completes, the source peripheral
recognizes that it has only four data items left to complete in the block and adjusts the
FIFO watermark level that triggers a burst transaction to 4. This triggers a burst request,
and the block completes using a burst transaction. However, CTL.SRC_MSIZE = 8, and
there are only four data items left to transfer in the source block. The GPDMA terminates
the last source burst transaction early and fetches only four of the eight data items in the
last source burst transaction. This is called an Early-Terminated Burst Transaction.
Observation: Under certain conditions, it is possible to hardcode dma_single from the
source peripheral to an inactive level (hardware handshaking). Under the same
conditions, it is possible for software to complete a source block transfer without initiating
single transactions from the source. For more information, refer to Section 5.2.8.
Example 4
Scenario: The destination peripheral enters the Single Transaction Region while the
GPDMA is the flow controller. This example also demonstrates how the GPDMA channel
FIFO is flushed at the end of a block transfer to the destination; this example is the same
for both hardware and software handshaking.
Consider the case with the parameters set to values listed in Table 5-6 (as an example
the FIFO depth was considered as 32 bytes).
In this example, the block size is a multiple of the source burst transaction length:
blk_size_bytes_dma/src_burst_size_bytes = (44 * 1)/4 = 11
= integer
The source block transfer is completed using only burst transactions, and the source
does not enter the Single Transaction Region.
The block size is not a multiple of the destination burst transaction length:
blk_size_bytes_dma/dst_burst_size_bytes 44/32 != integer
So near the end of the block transfer to the destination, the amount of data left to be
transferred is less than dst_burst_size_bytes and the destination enters the Single
Transaction Region.
Figure 5-15 shows one way in which the block transfer to the destination can occur.
Notes
1. In the Single Transaction Region, asserting dma_single initiates a single transaction
for hardware handshaking. Writing a 1 to the relevant channel bit of the
SGLREQDSTREG register initiates a single transaction for software handshaking.
2. The destination peripheral, not knowing the length of a block and only able to request
burst transactions, sits and waits for the FIFO to fall below a watermark level before
requesting a new burst transaction request.
At time t2 in Figure 5-15, a single transaction to the destination has been completed.
There are now only four bytes (12 - dst_single_size_bytes = 12 - 8) left to transfer in the
destination block. However, CTL.DST_TR_WIDTH implies 64-bit AHB transfers to the
destination (dst_single_size_bytes = 8 byte); therefore, the GPDMA cannot form a single
word of the specified CTL.DST_TR_WIDTH.
The GPDMA channel FIFO has four bytes in it that must be flushed to the destination.
The GPDMA switches into a "FIFO flush mode, where the block transfer to the
destination is completed by changing the AHB transfer width to the destination to be
equal to that of the CTL.SRC_TR_WIDTH; that is, byte AHB transfers in this example.
Thus the last single transaction in the destination block is made up of a burst of length 4
and CTL.SRC_TR_WIDTH width.
When the GPDMA is in FIFO flush mode, the address is incremented by the value of
CTL.SRC_TR_WIDTH and not CTL.DST_TR_WIDTH.
In cases where the DAR is selected to be contiguous between blocks, the DARx will
need re-alignment at the start of the next block, since it is aligned to
CTL.SRC_TR_WIDTH and not CTL.DST_TR_WIDTH at the end of the previous block
(this is handled by hardware).
In general, channel FIFO flushing to the destination occurs if all three of the following are
true:
GPDMA or the Source peripheral are flow control peripherals
CTL.DST_TR_WIDTH > CTL.SRC_TR_WIDTH
Flow control device:
If GPDMA is flow controller:
blk_size_bytes_dma/dst_single_size_bytes != integer
If source is flow controller:
blk_size_bytes_src /dst_single_size_bytes != integer
Note: When not in FIFO flush mode, a single transaction is mapped to a single AHB
transfer. However, in FIFO flush mode, a single transaction is mapped to multiple
AHB transfers of CTLx.SRC_TR_WIDTH width. The cumulative total of data
transferred to the destination in FIFO flush mode is less than
dst_single_size_bytes.
In the above example, a burst request is not generated in the Single Transaction Region.
If a burst request were generated at time t1 in Figure 5-15, then the burst transaction
would proceed until there was not enough data left in the destination block to form a
single data item of CTL.DST_TR_WIDTH width. The burst transaction would then be
early-terminated. In this example, only one data item of the four requested (decoded
value of DEST_MIZE = 4) would be transferred to the destination in the burst transaction.
This is referred to as an Early-Terminated Burst Transaction. If a burst request were
generated at time t2 in Figure 5-15, then the destination block would be completed (four
byte transfers to the destination to flush the GPDMA channel FIFO) and this burst
request would again be early-terminated at the end of the destination block.
Example 5
Scenario: In all examples presented so far, none of the bursts have been early-
terminated by the system arbiter. Referring to Example 1, the AHB transfers on the
source and destination side look somewhat symmetric. In the examples presented so
far, where the bursts are not early-terminated by the system arbiter, the traffic profile on
the AHB bus would be the same, regardless of the value of CFGx.FIFO_MODE.
This example, however, considers the effect of CFGx.FIFO_MODE; it is the same for
both hardware and software handshaking.
CFGx.FIFO_MODE: Determines how much space or data needs to be available in the
FIFO before a burst transaction request is serviced.
0B - Space/data available for single AHB transfer of the specified transfer width.
1B - Data available is greater than or equal to half the FIFO depth for destination transfers
and space available is greater than half the fifo depth for source transfers. The
exceptions are at the end of a burst transaction request or at the end of a block transfer.
Table 5-7 lists the parameters used in this example (as an example the FIFO depth was
considered as 16 bytes).
The block transfer may proceed by alternately filling and emptying the GPDMA channel
FIFO. Up to time t4, the transfer might proceed like that shown in Figure 5-16.
At time t4, the src, channel, and destination FIFOs might look like that shown in
Figure 5-17
Figure 5-17 Source, GPDMA Channel and Destination FIFOs at Time 't4'
At time t4, a source burst transaction is requested, and the GPDMA attempts a burst of
length 4. Suppose that this burst is early-burst terminated after three AHB transfers. The
FIFO status after this burst might look like that shown in Figure 5-18.
Referring to Figure 5-18, notice that a burst request from the destination is not triggered,
since the destination FIFO contents are above the watermark level. The GPDMA has
space for one data item in the channel FIFO.
The GPDMA will attempt to perform a single transfer, to fill the channel FIFO, if
CFGx.FIFO_MODE = 0.
If CFGx.FIFO_MODE = 1, then the GPDMA waits until the channel FIFO is less than
half-full before initiating a burst from the source, as illustrated in Figure 5-18.
Memory
Channel
control
CPU Block size
register
GPDMA
(CTLx)
Memory
Memory
Channel
control
CPU Block size
register
GPDMA
(CTLx)
finish Peripheral 1
finish Peripheral 1
Channel
control
CPU Block size
register
GPDMA
(CTLx)
finish Peripheral 2
memory peripherals, the criterion for "FIFO readiness" is controlled by the FIFO_MODE
field of the CFG register.
The definition of FIFO readiness is the same for:
Single transactions
Burst transactions, where CFGx.FIFO_MODE = 0
Transfers involving memory peripherals, where CFGx.FIFO_MODE = 0
The channel FIFO is deemed ready when the space/data available is sufficient to
complete a single AHB transfer of the specified transfer width. FIFO readiness for source
transfers occurs when the channel FIFO contains enough room to accept at least a
single transfer of CTL.SRC_TR_WIDTH width. FIFO readiness for destination transfers
occurs when the channel FIFO contains data to form at least a single transfer of
CTL.DST_TR_WIDTH width.
Note: An exception to FIFO readiness for destination transfers occurs in "FIFO flush
mode" In this mode, FIFO readiness for destination transfers occurs when the
channel FIFO contains data to form at least a single transfer of
CTL.SRC_TR_WIDTH width (and not CTL.DST_TR_WIDTH width, as is the
normal case).
When CFG.FIFO_MODE = 1, then the criteria for FIFO readiness for burst transaction
requests and transfers involving memory peripherals are as follows:
A FIFO is ready for a source burst transfer when the FIFO is less than half empty.
A FIFO is ready for a destination burst transfer when the FIFO is greater than or equal
to half full.
Exceptions to this "readiness" occur. During these exceptions, a value of CTL.
FIFO_MODE = 0 is assumed. The following are the exceptions:
Near the end of a burst transaction or block transfer - The channel source state
machine does not wait for the channel FIFO to be less than half empty if the number
of source data items left to complete the source burst transaction or source block
transfer is less than FIFO DEPTH/2. Similarly, the channel destination state machine
does not wait for the channel FIFO to be greater than or equal to half full, if the
number of destination data items left to complete the destination burst transaction or
destination block transfer is less than FIFO DEPTH/2.
In FIFO flush mode
When a channel is suspended - The destination state machine does not wait for the
FIFO to become half empty to flush the FIFO, regardless of the value of the
FIFO_MODE field.
When the source/destination peripheral is not memory, the source/destination state
machine waits for a single/burst transaction request. Upon receipt of a transaction
request and only if the channel FIFO is "ready" for source/destination AHB transfers, a
request for the master bus interface is made by the source/destination state machine.
Note: There is one exception to this, which occurs when the destination peripheral is the
flow controller and CFGx.FCMODE = 1 (data pre-fetching is disabled). Then the
source state machine does not generate a request for the master bus interface
(even if the FIFO is "ready" for source transfers and has received a source
transaction request) until the destination requests new data.
When the source/destination peripheral is memory, the source/destination state
machine must wait until the channel FIFO is "ready". A request is then made for the
master bus interface. There is no handshaking mechanism employed between a
memory peripheral and the GPDMA.
Bus Locking
If the LOCK_B bit in the channel configuration register (CFG) is set, then the AHB bus is
locked for the duration specified in the LOCK_B_L field.
Channel Locking
If the LOCK_CH field is set, then the arbitration for the master bus interface is exclusively
reserved for the source and destination peripherals of that channel for the duration
specified in the LOCK_CH_L field.
If bus locking is activated for a certain duration, then it follows that the channel is also
automatically locked for that duration. Three cases arise:
CFGx.LOCK_B = 0 - Programmed values of CFGx.LOCK_CH and
CFGx.LOCK_CH_L are used.
CFGx.LOCK_B = 1 and CFGx.LOCK_CH = 0 - DMA transfer proceeds as if
CFGx.LOCK_CH = 1 and CFGx.LOCK_CH_L = CFGx.LOCK_B_L. The
programmed values of CFGx.LOCK_CH and CFGx.LOCK_CH_L are ignored.
CFGx.LOCK_B = 1 and CFGx.LOCK_CH = 1 - Two cases arise:
CFGx.LOCK_B_L <= CFGx.LOCK_CH_L - In this case, the DMA transfer
proceeds as if CFGx.LOCK_CH_L = CFGx. LOCK_B_L and the programmed
value of CFGx.LOCK_CH_L is ignored. Thus, if bus locking is enabled over the
DMA transfer level, then channel locking is enabled over the DMA transfer level,
regardless of the programmed value of CFGx.LOCK_CH_LCFGx.
Locking Levels
If locking is enabled for a channel, then locking of the AHB master bus interface at a
programmed locking transfer level is activated when the channel is first granted the AHB
master bus interface at the start of that locking transfer level. It continues until the locking
transfer level has completed; that is, if channel 0 has enabled channel level locking at
the block transfer level, then this channel locks the master bus interface when it is first
granted the master bus interface at the start of the block transfer, and continues to lock
the master bus interface until the block transfer has completed.
Source and destination block transfers occur successively in time, and a new source
block cannot commence until the previous destination block has completed.
When both source and destination are on the same AHB layer, then block level locking
is terminated on completion of the block to the destination. If they are on separate layers,
then block-level locking is terminated on completion of the block on that layerwhen the
source block on the source AHB layer completes, and when the destination block on the
destination AHB layer completes. The same is true for DMA transfer-level locking.
Transaction-level locking is different due to the fact that source and destination
transactions occur independently in time, and the number of source and destination
transactions in a DMA block or DMA transfer do not have to match. When the source and
destination are on the same AHB layer, then transaction-level locking is cleared at the
end of a source or destination transaction only if the opposing peripheral is not currently
in the middle of a transaction.
For example, if locking is enabled at the transaction level and an end-of-source
transaction is signaled, then this disables locking only if one of the following is true:
The destination is on a different AHB layer
The destination is on the same AHB layer, but the channel is not currently in the
middle of a transaction to the destination peripheral.
The same rules apply when an end-of-destination transaction is signalled.
If channel-level or bus-level locking is enabled for a channel at the transaction level, and
either the source or destination of the channel is a memory device, then the locking is
ignored and the channel proceeds as if locking (bus or channel) is disabled.
Note: Since there is no notion of a transaction level for a memory peripheral, then
transaction-level locking is not allowed when either source or destination is
memory.
Request = 0
IDLE
Request = 1
No
Transfer in progress?
Yes
Transfer complete
No
No
Yes
Lowest numbered No
highest priority request?
Yes
Transfer incomplete
Granted Master
Interface
5.2.13 Scatter/Gather
Scatter is relevant to a destination transfer. The destination address is incremented or
decremented by a programmed amount - the scatter increment - when a scatter
boundary is reached. Figure 5-21 shows an example destination scatter transfer. The
destination address is incremented or decremented by the value stored in the destination
scatter increment (DSRx.DSI) field (refer to DSR), multiplied by the number of bytes in
a single AHB transfer to the destination s (decoded value of CTL.DST_TR_WIDTH)/8 -
when a scatter boundary is reached. The number of destination transfers between
successive scatter boundaries is programmed into the Destination Scatter Count (DSC)
field of the DSRx register.
Scatter is enabled by writing a 1 to the CTL.DST_SCATTER_EN field. The CTL.DINC
field determines if the address is incremented, decremented, or remains fixed when a
scatter boundary is reached. If the CTL.DINC field indicates a fixed-address control
throughout a DMA transfer, then the CTL.DST_SCATTER_EN field is ignored, and the
scatter feature is automatically disabled.
Gather is relevant to a source transfer. The source address is incremented or
decremented by a programmed amount when a gather boundary is reached. The
number of source transfers between successive gather boundaries is programmed into
the Source Gather Count (SGRx.SGC) field. The source address is incremented or
decremented by the value stored in the source gather increment (SGRx.SGI) field (refer
to SGR), multiplied by the number of bytes in a single AHB transfer from the source -
(decoded value of CTL.SRC_TR_WIDTH)/8 - when a gather boundary is reached.
Gather is enabled by writing a 1 to the CTL.SRC_GATHER_EN field. The CTL.SINC
field determines if the address is incremented, decremented, or remains fixed when a
gather boundary is reached. If the CTL.SINC field indicates a fixed-address control
throughout a DMA transfer, then the CTL.SRC_GATHER_EN field is ignored, and the
gather feature is automatically disabled.
Note: For multi-block transfers, the counters that keep track of the number of transfers
left to reach a gather/scatter boundary are re-initialized to the source gather count
(SGRx.SGC) and destination scatter count (DSC), respectively, at the start of
each block transfer.
5.3 Programming
The GPDMA can be programmed through software registers or the GPDMA low-level
software driver; software registers are described in more detail in Section 5.6.
Note: There are references to both software parameters throughout this chapter. The
software parameters are the field names in each register description table and are
prefixed by the register name; for example, the Block Transfer Size field in the
Control Register for Channel x is designated as "CTL.BLOCK_TS."
It is assumed that no allocation is made in system memory for the source status when
the parameter CFGx.SS_UPD_EN is set to 0. In this case, then the order of a Linked
List item is as follows:
1. SAR
2. DAR
3. LLP
4. CTL
5. DSTAT
CFGx.RELOAD_SRC
CFGx.RELOAD_DST
CTLx.LLP_ SRC EN
CTLx.LLPDST_EN
UpdateMethod
UpdateMethod
UpdateMethod
Transfer Type
LLP. LOC = 0
Write Back1)
CTLx, LLPx
DARx
SARx
1. Single-block or Yes 0 0 0 0 None, user None None No
last transfer of reprograms (single) (single)
multi-block.
2. Auto-reload Yes 0 0 0 1 CTLx, LLPx are Contig Auto- No
multi-block reloaded from uous Reload
transfer with initial values.
contiguous SAR
3. Auto-reload Yes 0 1 0 0 CTLx, LLPx are Auto- Contig No
multi-block reloaded from Reload uous
transfer with initial values
contiguous DAR.
4. Auto-reload Yes 0 1 0 1 CTLx, LLPx are Auto- Auto- No
multi-block reloaded from reload Reload
transfer initial values
5. Single-block or No 0 0 0 0 None, user None None Yes
last transfer of reprograms (single) (single)
multi-block.
6. Linked list No 0 0 1 0 CTLx, LLPx Contig Linked Yes
multi-block loaded from uous List
transfer with next Linked List
contiguous SAR item.
7. Linked list No 0 1 1 0 CTLx, LLPx Auto- Linked Yes
multi-block loaded from Reload List
transfer with next Linked List
auto-reload SAR item.
8. Linked list No 1 0 0 0 CTLx, LLPx Linked Contig Yes
multi-block loaded from List uous
transfer with next Linked List
contiguous DAR item.
CFGx.RELOAD_SRC
CFGx.RELOAD_DST
CTLx.LLP_ SRC EN
CTLx.LLPDST_EN
UpdateMethod
UpdateMethod
UpdateMethod
Transfer Type
LLP. LOC = 0
Write Back1)
CTLx, LLPx
DARx
SARx
9. Linked list No 1 0 0 1 CTLx, LLPx Linked Auto- Yes
multi-block loaded from List Reload
transfer with next Linked List
auto-reload DAR item.
10. Linked list No 1 0 1 0 CTLx, LLPx Linked Linked Yes
multi-block loaded from List List
transfer next Linked List
item.
1) Applicable to channels 0 and 1 only.
Notes
1. Throughout this chapter, there are descriptions about fetching the LLI.CTLx register
from the location pointed to by the LLPx register. This exact location is the LLI base
address (stored in LLPx register) plus the fixed offset. For example, in Figure 5-25
the location of the LLI.CTLx register is LLPx.LOC + 0xc.
2. Referring to Table 5-8, if the Write Back column entry is "Yes" and the channel is 0
or 1, then the CTLxH register is always written to system memory (to LLI.CTLxH) at
the end of every block transfer.
3. The source status is fetched and written to system memory at the end of every block
transfer if the Write Back column entry is "Yes" and CFGx.SS_UPD_EN is enabled.
4. The destination status is fetched and written to system memory at the end of every
block transfer if the Write Back column entry is "Yes and CFGx.DS_UPD_EN is
enabled.
Note: You cannot select both SARx and DARx updates to be contiguous. If you want this
functionality, you should increase the size of the Block Transfer
(CTL.BLOCK_TS), or if this is at the maximum value, use Row 10 of Table 5-8
and set up the LLI.SARx address of the block descriptor to be equal to the end
SARx address of the previous block. Similarly, set up the LLI.DARx address of the
block descriptor to be equal to the end DARx address of the previous block.
5.3.3.2 Multi-Block Transfer with Linked List for Source and Linked List
for Destination (Row 10)
This type of transfer is supported by channels 0 and 1 only.
1. Read the Channel Enable register (see GPDMA0_CHENREG) to choose a free
(disabled) channel.
2. Set up the chain of Linked List Items (otherwise known as block descriptors) in
memory. Write the control information in the LLI.CTL register location of the block
descriptor for each LLI in memory (see Figure 5-23) for channel x.
3. Write the channel configuration information into the CFG register for channel x.
a) Designate the handshaking interface type (hardware or software) for the source
and destination peripherals; this is not required for memory.
This step requires programming the CFG.HS_SEL_SRC or CFG.HS_SEL_DST
bits, respectively. Writing a 0 activates the hardware handshaking interface to
handle source/destination requests for the specific channel. Writing a 1 activates
the software handshaking interface to handle source/destination requests.
b) If the hardware handshaking interface is activated for the source or destination
peripheral, assign the handshaking interface to the source and destination
peripheral. This requires programming the CFG.SRC_PER and CFG.DEST_PER
bits, respectively.
4. Make sure that the LLI.CTLx register locations of all LLI entries in memory (except
the last) are set as shown in Row 10 of Table 5-8. The LLI.CTLx register of the last
Linked List Item must be set as described in Row 1 or Row 5 of Table 5-8.
Figure 5-23 shows a Linked List example with two list items.
5. Make sure that the LLI.LLPx register locations of all LLI entries in memory (except
the last) are non-zero and point to the base address of the next Linked List Item.
6. Make sure that the LLI.SARx/LLI.DARx register locations of all LLI entries in memory
point to the start source/destination block address preceding that LLI fetch.
7. Ensure that the LLI.CTLx.DONE field of the LLI.CTLx register locations of all LLI
entries in memory is cleared.
8. If source status fetching is enabled (CFGx.SS_UPD_EN is enabled), program the
SSTATAR register so that the source status information can be fetched from the
location pointed to by the SSTATAR. For conditions under which the source status
information is fetched from system memory, refer to the Write Back column of
Table 5-8.
9. If destination status fetching is enabled (CFGx.DS_UPD_EN is enabled), program
the DSTATAR register so that the destination status information can be fetched from
the location pointed to by the DSTATAR register. For conditions under which the
destination status information is fetched from system memory, refer to the Write Back
column of Table 5-8.
10. If gather is enabled (CTL.SRC_GATHER_EN = 1), program the SGR register for
channel x.
11. If scatter is enabled (CTL.DST_SCATTER_EN = 1), program the DSR register for
channel x.
12. Clear any pending interrupts on the channel from the previous DMA transfer by
writing to the Interrupt Clear registers: CLEARTFR, CLEARBLOCK,
CLEARSRCTRAN, CLEARDSTTRAN, and CLEARERR. Reading the Interrupt Raw
Status and Interrupt Status registers confirms that all interrupts have been cleared.
13. Program the CTL and CFG registers according to Row 10, as shown in Table 5-8.
14. Program the LLP register with LLP(0), the pointer to the first linked list item.
15. Finally, enable the channel by writing a 1 to the GPDMA0_CHENREG.CH_EN bit;
the transfer is performed.
16. The GPDMA fetches the first LLI from the location pointed to by LLPx(0).
Note: The LLI.SARx, LLI.DARx, LLI.LLPx, and LLI.CTLx registers are fetched. The
GPDMA automatically reprograms the SARx, DARx, LLPx, and CTLx channel
registers from the LLPx(0).
17. Source and destination request single and burst DMA transactions to transfer the
block of data (assuming non-memory peripheral). The GPDMA acknowledges at the
completion of every transaction (burst and single) in the block and carries out the
block transfer.
18. Once the block of data is transferred, the source status information is fetched from
the location pointed to by the SSTATAR register and stored in the SSTAT register if
CFGx.SS_UPD_EN is enabled. For conditions under which the source status
information is fetched from system memory, refer to the Write Back column of
Table 5-8.
The destination status information is fetched from the location pointed to by the
DSTATAR register and stored in the DSTAT register if CFGx.DS_UPD_EN is
enabled. For conditions under which the destination status information is fetched
from system memory, refer to the Write Back column of Table 5-8.
19. The CTLxH register is written out to system memory. For conditions under which the
CTLxH register is written out to system memory, refer to the Write Back column of
Table 5-8.
The CTLxH register is written out to the same location on the same layer (LLP.LMS)
where it was originally fetched; that is, the location of the CTL register of the linked
list item fetched prior to the start of the block transfer. Only the CTLxH register is
written out, because only the CTL.BLOCK_TS and CTL.DONE fields have been
updated by the GPDMA hardware. Additionally, the CTL.DONE bit is asserted to
indicate block completion. Therefore, software can poll the LLI.CTLx.DONE bit of the
CTL register in the LLI to ascertain when a block transfer has completed.
Note: Do not poll the CTLx.DONE bit in the GPDMA memory map; instead, poll the
LLI.CTLx.DONE bit in the LLI for that block. If the polled LLI.CTLx.DONE bit is
asserted, then this block transfer has completed. This LLI.CTLx.DONE bit was
cleared at the start of the transfer (Step 7).
20. The SSTAT register is now written out to system memory if CFGx.SS_UPD_EN is
enabled. It is written to the SSTAT register location of the LLI pointed to by the
previously saved LLPx.LOC register.
The DSTAT register is now written out to system memory if CFGx.DS_UPD_EN is
enabled. It is written to the DSTAT register location of the LLI pointed to by the
previously saved LLPx.LOC register.
The end-of-block interrupt, int_block, is generated after the write-back of the control
and status registers has completed.
Note: The write-back location for the control and status registers is the LLI pointed to
by the previous value of the LLPx.LOC register, not the LLI pointed to by the current
value of the LLPx.LOC register.
21. The GPDMA does not wait for the block interrupt to be cleared, but continues fetching
the next LLI from the memory location pointed to by the current LLP register and
automatically reprograms the SAR, DAR, CTL, and LLP channel registers. The DMA
transfer continues until the GPDMA determines that the CTL and LLP registers at the
end of a block transfer match the ones described in Row 1 or Row 5 of Table 5-8 (as
discussed earlier). The GPDMA then knows that the previously transferred block was
the last block in the DMA transfer.
The DMA transfer might look like that shown in Figure 5-27.
Figure 5-27 Multi-Block with Linked Address for Source and Destination
If the user needs to execute a DMA transfer where the source and destination address
are contiguous, but where the amount of data to be transferred is greater than the
maximum block size CTL.BLOCK_TS, then this can be achieved using the type of multi-
block transfer shown in Figure 5-28.
Figure 5-28 Multi-Block with Linked Address for Source and Destination Where
SARx and DARx Between Successive Blocks are Contiguous
LLI fetch
Block interrupt
generated here
Is the GPDMA in No
row1 or row5
Figure 5-29 DMA Transfer Flow for Source and Destination Linked List Address
disables the channel. You can either respond to the Block Complete or Transfer
Complete interrupts, or poll for the transfer complete raw interrupt status register
(RAWTFR[n], where n is the channel number) until it is set by hardware, in order to
detect when the transfer is complete. Note that if this polling is used, software must
ensure that the transfer complete interrupt is cleared by writing to the Interrupt Clear
register, CLEARTFR[n], before the channel is enabled. If the GPDMA is not in Row
1, the next step is performed.
7. The DMA transfer proceeds as follows:
a) If interrupts are enabled (CTL.INT_EN = 1) and the block-complete interrupt is
unmasked (MASKBLOCK[x] = 1B, where x is the channel number), hardware sets
the block-complete interrupt when the block transfer has completed. It then stalls
until the block-complete interrupt is cleared by software. If the next block is to be
the last block in the DMA transfer, then the block-complete ISR (interrupt service
routine) should clear the reload bits in the CFGx.RELOAD_SRC and
CFGx.RELOAD_DST registers. This puts the GPDMA into Row 1, as shown in
Table 5-8. If the next block is not the last block in the DMA transfer, then the reload
bits should remain enabled to keep the GPDMA in Row 4.
b) If interrupts are disabled (CTL.INT_EN = 0) or the block-complete interrupt is
masked (MASKBLOCK[x] = 0B, where x is the channel number), then hardware
does not stall until it detects a write to the block-complete interrupt clear register;
instead, it immediately starts the next block transfer. In this case, software must
clear the reload bits in the CFGx.RELOAD_SRC and CFGx.RELOAD_DST
registers to put the GPDMA into Row 1 of Table 5-8 before the last block of the
DMA transfer has completed.
The transfer is similar to that shown in Figure 5-30.
Figure 5-30 Multi-Block DMA Transfer with Source and Destination Address
Auto-Reloaded
Channel enabled by SW
Block transfer
Channel disabled by HW No
CTLx.INT_EN = 1
AND
No
MASKBLOCK[x] = 1
Block-complete Yes
interrupt generated here
Figure 5-31 DMA Transfer Flow for Source and Destination Address Auto-
Reloaded
11. If gather is enabled (CTL.SRC_GATHER_EN = 1), program the SGR register for
channel x.
12. If scatter is enabled (CTL.DST_SCATTER_EN = 1), program the DSR register for
channel x.
13. Clear any pending interrupts on the channel from the previous DMA transfer by
writing to the Interrupt Clear registers: CLEARTFR, CLEARBLOCK,
CLEARSRCTRAN, CLEARDSTTRAN, and CLEARERR. Reading the Interrupt Raw
Status and Interrupt Status registers confirms that all interrupts have been cleared.
14. Program the CTL and CFG registers according to Row 7, as shown in Table 5-8.
15. Program the LLP register with LLP(0), the pointer to the first Linked List item.
16. Finally, enable the channel by writing a 1 to the GPDMA0_CHENREG.CH_EN bit;
the transfer is performed. Ensure that bit 0 of the GPDMA0_DMACFGREG register
is enabled.
17. The GPDMA fetches the first LLI from the location pointed to by LLP(0).
Note: The LLI.SARx, LLI.DARx, LLI.LLPx, and LLI.CTLx registers are fetched. The
LLI.SARx register - although fetched - is not used.
18. Source and destination request single and burst GPDMA transactions in order to
transfer the block of data (assuming non-memory peripherals). The GPDMA
acknowledges at the completion of every transaction (burst and single) in the block
and carries out the block transfer.
19. Once the block of data is transferred, the source status information is fetched from
the location pointed to by the SSTATAR register and stored in the SSTAT register if
CFGx.SS_UPD_EN is enabled. For conditions under which the source status
information is fetched from system memory, refer to the Write Back column of
Table 5-8.
The destination status information is fetched from the location pointed to by the
DSTATAR register and stored in the DSTAT register if CFGx.DS_UPD_EN is
enabled. For conditions under which the destination status information is fetched
from system memory, refer to the Write Back column of Table 5-8.
20. The CTLxH register is written out to system memory. For conditions under which the
CTLxH register is written out to system memory, refer to the Write Back column of
Table 5-8.
The CTLxH register is written out to the same location on the same layer (LLP.LMS)
where it was originally fetched; that is, the location of the CTL register of the linked
list item fetched prior to the start of the block transfer. Only the CTLxH register is
written out, because only the CTL.BLOCK_TS and CTL.DONE fields have been
updated by hardware within the GPDMA. The LLI.CTLx.DONE bit is asserted to
indicate block completion. Therefore, software can poll the LLI.CTL.DONE bit field of
the CTL register in the LLI to ascertain when a block transfer has completed.
Note: Do not poll the CTLx.DONE bit in the GPDMA memory map. Instead, poll the
LLI.CTLx.DONE bit in the LLI for that block. If the polled LLI.CTLx.DONE bit is
asserted, then this block transfer has completed. This LLI.CTLx.DONE bit was
cleared at the start of the transfer (Step 8).
21. The SSTAT register is now written out to system memory if CFGx.SS_UPD_EN is
enabled. It is written to the SSTATx register location of the LLI pointed to by the
previously saved LLPx.LOC register.
The DSTAT register is now written out to system memory if CFGx.DS_UPD_EN is
enabled. It is written to the DSTATx register location of the LLI pointed to by the
previously saved LLPx.LOC register.
The end-of-block interrupt, int_block, is generated after the write-back of the control
and status registers has completed.
Note: The write-back location for the control and status registers is the LLI pointed to
by the previous value of the LLPx.LOC register, not the LLI pointed to by the current
value of the LLPx.LOC register.
22. The GPDMA reloads the SAR register from the initial value. Hardware sets the block-
complete interrupt. The GPDMA samples the row number, as shown in Table 5-8. If
the GPDMA is in Row 1 or Row 5, then the DMA transfer has completed. Hardware
sets the transfer complete interrupt and disables the channel. You can either respond
to the Block Complete or Transfer Complete interrupts, or poll for the transfer
complete raw interrupt status register (RAWTFR[n], n = channel number) until it is set
by hardware, in order to detect when the transfer is complete. Note that if this polling
is used, software must ensure that the transfer complete interrupt is cleared by
writing to the Interrupt Clear register, CLEARTFR[n], before the channel is enabled.
If the GPDMA is not in Row 1 or Row 5 as shown in Table 5-8, the following steps
are performed.
23. The DMA transfer proceeds as follows:
a) If interrupts are enabled (CTL.INT_EN = 1) and the block-complete interrupt is
unmasked (MASKBLOCK[x] = 1B, where x is the channel number), hardware sets
the block-complete interrupt when the block transfer has completed. It then stalls
until the block-complete interrupt is cleared by software. If the next block is to be
the last block in the DMA transfer, then the block-complete ISR (interrupt service
routine) should clear the CFGx.RELOAD_SRC source reload bit. This puts the
GPDMA into Row 1, as shown in Table 5-8. If the next block is not the last block
in the DMA transfer, then the source reload bit should remain enabled to keep the
GPDMA in Row 7, as shown in Table 5-8.
b) If interrupts are disabled (CTL.INT_EN = 0) or the block-complete interrupt is
masked (MASKBLOCK[x] = 0B, where x is the channel number), then hardware
does not stall until it detects a write to the block-complete interrupt clear register;
instead, it immediately starts the next block transfer. In this case, software must
clear the source reload bit, CFGx.RELOAD_SRC in order to put the device into
Row 1 of Table 5-8 before the last block of the DMA transfer has completed.
24. The GPDMA fetches the next LLI from memory location pointed to by the current LLP
register and automatically reprograms the DAR, CTL, and LLP channel registers.
Note that the SAR is not reprogrammed, since the reloaded value is used for the next
DMA block transfer. If the next block is the last block of the DMA transfer, then the
CTL and LLP registers just fetched from the LLI should match Row 1 or Row 5 of
Table 5-8.
The DMA transfer might look like that shown in Figure 5-32.
Figure 5-32 Multi-Block DMA Transfer with Source Address Auto-Reloaded and
Linked List Destination Address
Channel enabled by SW
LLI fetch
Block transfer
Reload SARx
Channel disabled by HW No
CTLx.INT_EN = 1
AND
No
MASKBLOCK[x] = 1
Block-complete Yes
interrupt generated here
Figure 5-33 DMA Transfer Flow for Source Address Auto-Reloaded and Linked
List Destination Address
Transfer Complete interrupts, or poll for the transfer complete raw interrupt status
register (RAWTFR[n], n = channel number) until it is set by hardware, in order to
detect when the transfer is complete. Note that if this polling is used, software must
ensure that the transfer complete interrupt is cleared by writing to the Interrupt Clear
register, CLEARTFR[n], before the channel is enabled. If the GPDMA is not in Row
1, the next step is performed.
7. The DMA transfer proceeds as follows:
a) If interrupts are enabled (CTL.INT_EN = 1) and the block-complete interrupt is
unmasked (MASKBLOCK[x] = 1B, where x is the channel number), hardware sets
the block-complete interrupt when the block transfer has completed. It then stalls
until the block-complete interrupt is cleared by software. If the next block is to be
the last block in the DMA transfer, then the block-complete ISR (interrupt service
routine) should clear the source reload bit, CFGx.RELOAD_SRC. This puts the
GPDMA into Row 1, as shown in Table 5-8. If the next block is not the last block
in the DMA transfer, then the source reload bit should remain enabled to keep the
GPDMA in Row 3, as shown in Table 5-8.
b) If interrupts are disabled (CTL.INT_EN = 0) or the block-complete interrupt is
masked (MASKBLOCK[x] = 0B, where x is the channel number), then hardware
does not stall until it detects a write to the block-complete interrupt clear register;
instead, it starts the next block transfer immediately. In this case, software must
clear the source reload bit, CFGx.RELOAD_SRC, to put the device into Row 1 of
Table 5-8 before the last block of the DMA transfer has completed.
The transfer is similar to that shown in Figure 5-34.
Figure 5-34 Multi-Block DMA Transfer with Source Address Auto-Reloaded and
Contiguous Destination Address
Channel enabled by SW
Block transfer
Channel disabled by HW No
CTLx.INT_EN = 1
AND
No
MASKBLOCK[x] = 1
Block-complete Yes
interrupt generated here
Figure 5-35 DMA Transfer Flow for Source Address Auto-Reloaded and Linked
List Destination Address
5.3.3.6 Multi-Block DMA Transfer with Linked List for Source and
Contiguous Destination Address (Row 8)
This type of transfer is supported by channels 0 and 1 only.
1. Read the Channel Enable register (see GPDMA0_CHENREG) to choose a free
(disabled) channel.
2. Set up the linked list in memory. Write the control information in the LLI.CTL register
location of the block descriptor for each LLI in memory (see Figure 5-23) for channel
x.
3. Write the starting destination address in the DAR register for channel x.
Note: The values in the LLI.DARx register location of each Linked List Item (LLI) in
memory, although fetched during an LLI fetch, are not used.
4. Write the channel configuration information into the CFG register for channel x.
1. Designate the handshaking interface type (hardware or software) for the source
and destination peripherals; this is not required for memory.
This step requires programming the HS_SEL_SRC/HS_SEL_DST bits. Writing a 0
activates the hardware handshaking interface to handle source/destination requests
for the specific channel. Writing a 1 activates the software handshaking interface to
handle source/destination requests.
2. If the hardware handshaking interface is activated for the source or destination
peripheral, assign the handshaking interface to the source and destination
peripherals. This requires programming the SRC_PER and DEST_PER bits,
respectively.
5. Ensure that all LLI.CTLx register locations of the LLI (except the last) are set as
shown in Row 8 of Table 5-8, while the LLI.CTLx register of the last Linked List item
must be set as described in Row 1 or Row 5 of Table 5-8. Figure 5-23 shows a
Linked List example with two list items.
6. Ensure that the LLI.LLPx register locations of all LLIs in memory (except the last) are
non-zero and point to the next Linked List Item.
7. Ensure that the LLI.SARx register location of all LLIs in memory point to the start
source block address preceding that LLI fetch.
8. Ensure that the LLI.CTLx.DONE fields of the LLI.CTLx register locations of all LLIs in
memory are cleared.
9. If source status fetching is enabled (CFGx.SS_UPD_EN is enabled), program the
SSTATAR register so that the source status information can be fetched from the
location pointed to by SSTATAR. For conditions under which the source status
information is fetched from system memory, refer to the Write Back column of
Table 5-8.
10. If destination status fetching is enabled (CFGx.DS_UPD_EN is enabled), program
the DSTATAR register so that the destination status information can be fetched from
the location pointed to by the DSTATAR register. For conditions under which the
destination status information is fetched from system memory, refer to the Write Back
column of Table 5-8.
11. If gather is enabled (CTL.SRC_GATHER_EN = 1), program the SGR register for
channel x.
12. If scatter is enabled (CTL.DST_SCATTER_EN = 1), program the DSR register for
channel x.
13. Clear any pending interrupts on the channel from the previous DMA transfer by
writing to the Interrupt Clear registers: CLEARTFR, CLEARBLOCK,
CLEARSRCTRAN, CLEARDSTTRAN, and CLEARERR. Reading the Interrupt Raw
Status and Interrupt Status registers confirms that all interrupts have been cleared.
14. Program the CTL and CFG registers according to Row 8, as shown in Table 5-8.
15. Program the LLP register with LLP(0), the pointer to the first Linked List item.
16. Finally, enable the channel by writing a 1 to the GPDMA0_CHENREG.CH_EN bit;
the transfer is performed. Ensure that bit 0 of the GPDMA0_DMACFGREG register
is enabled.
17. The GPDMA fetches the first LLI from the location pointed to by LLP(0).
Note: The LLI.SARx, LLI.DARx, LLI.LLPx, and LLI.CTLx registers are fetched. The
LLI.DARx register location of the LLI - although fetched - is not used. The DAR
register in the GPDMA remains unchanged.
18. Source and destination request single and burst GPDMA transactions to transfer the
block of data (assuming non-memory peripherals). The GPDMA acknowledges at the
completion of every transaction (burst and single) in the block and carries out the
block transfer.
19. Once the block of data is transferred, the source status information is fetched from
the location pointed to by the SSTATAR register and stored in the SSTAT register if
CFGx.SS_UPD_EN is enabled. For conditions under which the source status
information is fetched from system memory, refer to the Write Back column of
Table 5-8.The destination status information is fetched from the location pointed to
by the DSTATAR register and stored in the DSTAT register if CFGx.DS_UPD_EN is
enabled. For conditions under which the destination status information is fetched
from system memory, refer to the Write Back column of Table 5-8.
20. The CTLxH register is written out to system memory. For conditions under which the
CTLxH register is written out to system memory, refer to the Write Back column of
Table 5-8.The CTLxH register is written out to the same location on the same layer
(LLPx.LMS) where it was originally fetched; that is, the location of the CTL register of
the linked list item fetched prior to the start of the block transfer. Only the second word
of the CTL register is written out, CTLxH, because only the CTL.BLOCK_TS and
CTL.DONE fields have been updated by hardware within the GPDMA. Additionally,
the CTL.DONE bit is asserted to indicate block completion. Therefore, software can
poll the LLI.CTL.DONE bit field of the CTL register in the LLI to ascertain when a
block transfer has completed.
Note: Do not poll the CTL.DONE bit in the GPDMA memory map. Instead, poll the
LLI.CTLx.DONE bit in the LLI for that block. If the polled LLI.CTLx.DONE bit is
asserted, then this block transfer has completed. This LLI.CTLx.DONE bit was
cleared at the start of the transfer (Step 8).
21. The SSTAT register is now written out to system memory if CFGx.SS_UPD_EN is
enabled. It is written to the SSTAT register location of the LLI pointed to by the
previously saved LLPx.LOC register.The DSTAT register is now written out to
system memory if CFGx.DS_UPD_EN is enabled. It is written to the DSTAT register
location of the LLI pointed to by the previously saved LLPx.LOC register.The end-of-
block interrupt, int_block, is generated after the write-back of the control and status
registers has completed.
Note: The write-back location for the control and status registers is the LLI pointed to
by the previous value of the LLPx.LOC register, not the LLI pointed to by the current
value of the LLPx.LOC register.
22. The GPDMA does not wait for the block interrupt to be cleared, but continues and
fetches the next LLI from the memory location pointed to by the current LLP register
and automatically reprograms the SAR, CTL, and LLP channel registers. The DAR
register is left unchanged. The DMA transfer continues until the GPDMA samples
that the CTL and LLP registers at the end of a block transfer match those described
in Row 1 or Row 5 of Table 5-8 (as discussed earlier). The GPDMA then knows that
the previously transferred block was the last block in the DMA transfer.
The GPDMA transfer might look like that shown in Figure 5-36. Note that the destination
address is decrementing.
Figure 5-36 Multi-Block DMA Transfer with Linked List Source Address and
Contiguous Destination Address
Channel enabled by SW
LLI fetch
Block transfer
Block-complete complete
interrupt generated here
No
Is the GPDMA in row1
Channel disabled by HW
Figure 5-37 DMA Transfer Flow for Source Address Auto-Reloaded and Linked
List Destination Address
and Linked List for Destination. This example uses the GPDMA to move four blocks of
contiguous data from source to destination memory using the Linked List feature.
1. Set up the chain of Linked List items otherwise known as block descriptors in
memory. Write the control information in the LLI.CTLx register location of the block
descriptor for each LLI in memory for Channel 1. In the LLI.CTLx register, the
following is programmed:
a) Set up the transfer type for a memory-to-memory transfer:
- ctlx[22:20] = 000;
b) Set up the transfer characteristics:
1. Transfer width for the source in the SRC_TR_WIDTH field
- ctlx[6:4] = 001;
2. Transfer width for the destination in the DST_TR_WIDTH field
- ctlx[3:1] = 001;
3. Source master layer in the SMS field where the source resides
- ctlx[26:25] = 00;
4. Destination master layer in the DMS field where the destination resides
- ctlx[24:23] = 00;
5. Incrementing address for the source in the SINC field
- ctlx[10:9] = 00;
6. Incrementing address for the destination in the DINC field
- ctlx[8:7] = 00;
2. Write the channel configuration information into the CFGx register for Channel 1:
a) HS_SEL_SRC/HS_SEL_DST bits select which of the handshaking interfaces
hardware or softwareis active for source requests on this channel.
- cfgx[11] = 0;
- cfgx[10] = 0;
These settings are ignored because both the source and destination are memory
types
b) If the hardware handshaking interface is activated for the source or destination
peripheral, assign the handshaking interface to the source and destination
peripheral by programming the SRC_PER and DEST_PER bits:
- cfgx[46:43] = 0;
- cfgx[42:39] = 0;
These settings are ignored because both the source and destination are memory
types.
3. The following For loop, shown as a programming example, sets the following:
a) LLI.LLPx register locations of all LLI entries in memory (except the last) to non-
zero and point to the base address of the next Linked List Item
b) LLI.SARx/LLI.DARx register locations of all LLI entries in memory point to the start
source/destination block address preceding that LLI fetch. The For statement
below configures the LLPx entries:
for(i=0 ; i < 4 ; i=i+1) begin
5th Step: Configure the DLR (DMA Line Router) block to map the DMA requests from
the peripherals to the wanted DMA request lines (if not previously done).
6th Step: Configure the peripherals that are linked with DMA requests.
7th Step: Enable the specific Service requests on the peripheral blocks.
8th Step: Start the peripheral(s)
Note: This is a generic channel initialization example. Please address Section 5.3 for a
complete description and examples of how to control the complete flow for a
GPDMA channel.
5.6 Registers
This chapter includes information on how to program the GPDMA.
Notes
1. There are references to software parameters throughout this chapter. The software
parameters are the field names in each register description table and are prefixed by
the register name; for example, the Block Transfer Size field in the Control register
for channel x of GPDMA0 is designated as "GPDMA0_CTLxH.BLOCK_TS
DMACFGREG
This register is used to enable the GPDMA, which must be done before any channel
activity can begin.
GPDMA0_DMACFGREG
GPDMA Configuration Register (398H) Reset Value: 0000 0000H
GPDMA1_DMACFGREG
GPDMA Configuration Register (398H) Reset Value: 0000 0000H
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
DMA
0
_EN
r rw
If the global channel enable bit is cleared while any channel is still active, then
DMACFGREG.DMA_EN still returns 1 to indicate that there are channels still active until
hardware has terminated all activity on all channels, at which point the
DMACFGREG.DMA_EN bit returns 0.
CHENREG
This is the GPDMA Channel Enable Register. If software needs to set up a new
channel, then it can read this register in order to find out which channels are currently
inactive; it can then enable an inactive channel with the required priority.
All bits of this register are cleared to 0 when the global GPDMA channel enable bit,
DMACFGREG[0], is 0. When the global channel enable bit is 0, then a write to the
CHENREG register is ignored and a read will always read back 0.
The channel enable bit, CHENREG.CH_EN, is written only if the corresponding channel
write enable bit, CHENREG.CH_EN_WE, is asserted on the same AHB write transfer.
For example, writing hex 01x1 writes a 1 into CHENREG[0], while CHENREG[7:1]
remains unchanged. Writing hex 00xx leaves CHENREG[7:0] unchanged. Note that a
read-modified write is not required.
GPDMA0_CHENREG
GPDMA Channel Enable Register (3A0H) Reset Value: 0000 0000H
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
0 WE_CHx CHx
r w rw
GPDMA1_CHENREG
GPDMA Channel Enable Register (3A0H) Reset Value: 0000 0000H
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
0 WE_CHx 0 CHx
r w r rw
SAR
The starting source address is programmed by software before the DMA channel is
enabled, or by an LLI update before the start of the DMA transfer. While the DMA transfer
is in progress, this register is updated to reflect the source address of the current AHB
transfer.
Note: You must program the SAR address to be aligned to CTL.SRC_TR_WIDTH.
For information on how the SARx is updated at the start of each DMA block for multi-
block transfers, refer to Table 5-8.
GPDMA0_CHx_SAR (x=0-7)
Source Address Register for Channel x
(00H + x*58H) Reset Value: 0000 0000H
GPDMA1_CHx_SAR (x=0-3)
Source Address Register for Channel x
(00H + x*58H) Reset Value: 0000 0000H
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
SAR
rw
DAR
The starting destination address is programmed by software before the DMA channel is
enabled, or by an LLI update before the start of the DMA transfer. While the DMA transfer
is in progress, this register is updated to reflect the destination address of the current
AHB transfer.
Note: You must program the DAR to be aligned to CTL.DST_TR_WIDTH.
GPDMA0_CHx_DAR (x=0-7)
Destination Address Register for Channel x
(08H + x*58H) Reset Value: 0000 0000H
GPDMA1_CHx_DAR (x=0-3)
Destination Address Register for Channel x
(08H + x*58H) Reset Value: 0000 0000H
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
DAR
rw
LLP
You need to program this register to point to the first Linked List Item (LLI) in memory
prior to enabling the channel if block chaining is enabled.
GPDMA0_CHx_LLP (x = 0-1)
Linked List Pointer Register for Channel x
(10H + x*58H) Reset Value: 0000 0000H
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
LOC 0
rw r
CTL
These registers contain fields that control the DMA transfer.
The CTLxH and CTLxL registers are part of the block descriptor (linked list item - LLI)
when block chaining is enabled. It can be varied on a block-by-block basis within a DMA
transfer when block chaining is enabled.
If status write-back is enabled, the upper control register, CTLxH, is written to the control
register location of the LLI in system memory at the end of the block transfer.
Note: You need to program these registers prior to enabling the channel.
CTLxH
Control Register High.
GPDMA0_CHx_CTLH (x=0-7)
Control Register High for Channel x
(1CH + x*58H) Reset Value: 0000 0002H
GPDMA1_CHx_CTLH (x=0-3)
Control Register High for Channel x
(1CH + x*58H) Reset Value: 0000 0002H
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
D
O
0 BLOCK_TS
N
E
r rw rw
CTLxL
Control Register Low.
GPDMA0_CHx_CTLL (x=0-1)
Control Register Low for Channel x
(18H + x*58H) Reset Value: 0030 4801H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DST SRC
LLP_ LLP_ _SC _GA SRC
0 SRC DST 0 TT_FC 0 ATT THE _MSI
_EN _EN ER_ R_E ZE
EN N
r rw rw r rw r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SRC_MSIZ INT_
DEST_MSIZE SINC DINC SRC_TR_WIDTH DST_TR_WIDTH
E EN
rw rw rw rw rw rw rw
GPDMA0_CHx_CTLL (x=2-7)
Control Register Low for Channel x
(18H + x*58H) Reset Value: 0030 4801H
GPDMA1_CHx_CTLL (x=0-3)
Control Register Low for Channel x
(18H + x*58H) Reset Value: 0030 4801H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SRC
0 TT_FC 0 _MSI
ZE
r rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SRC_MSIZ INT_
DEST_MSIZE SINC DINC SRC_TR_WIDTH DST_TR_WIDTH
E EN
rw rw rw rw rw rw rw
SSTAT
After each block transfer completes, hardware can retrieve the source status information
from the address pointed to by the contents of the SSTATAR register. This status
information is then stored in the SSTATx register and written out to the SSTATx register
location of the LLI before the start of the next block.
Note: This register is a temporary placeholder for the source status information on its
way to the SSTATx register location of the LLI. The source status information
should be retrieved by software from the SSTATx register location of the LLI, and
not by a read of this register over the GPDMA slave interface.
GPDMA0_CHx_SSTAT (x=0-1)
Source Status Register for Channel x
(20H + x*58H) Reset Value: 0000 0000H
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
SSTAT
rw
DSTAT
After the completion of each block transfer, hardware can retrieve the destination status
information from the address pointed to by the contents of the DSTATAR register. This
status information is then stored in the DSTATx register and written out to the DSTATx
register location of the LLI before the start of the next block. This register does only exist
for channels 0 and 1, for other channels the read-back value is always 0.
Note: This register is a temporary placeholder for the destination status information on
its way to the DSTATx register location of the LLI. The destination status
information should be retrieved by software from the DSTATx register location of
the LLI and not by a read of this register over the GPDMA slave interface.
GPDMA0_CHx_DSTAT (x=0-1)
Destination Status Register for Channel x
(28H + x*58H) Reset Value: 0000 0000H
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
DSTAT
rw
SSTATAR
After the completion of each block transfer, hardware can retrieve the source status
information from the address pointed to by the contents of the SSTATARx register.
GPDMA0_CHx_SSTATAR (x=0-1)
Source Status Address Register for Channel x
(30H + x*58H) Reset Value: 0000 0000H
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
SSTATAR
rw
DSTATAR
After the completion of each block transfer, hardware can retrieve the destination status
information from the address pointed to by the contents of the DSTATARx register.
GPDMA0_CHx_DSTATAR (x=0-1)
Destination Status Address Register for Channel x
(38H + x*58H) Reset Value: 0000 0000H
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
DSTATAR
rw
CFG
These registers contain fields that configure the DMA transfer. The channel configuration
register remains fixed for all blocks of a multi-block transfer.
Note: You need to program this register prior to enabling the channel.
GPDMA0_CHx_CFGH (x=0-1)
Configuration Register High for Channel x
(44H + x*58H) Reset Value: 0000 0004H
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
SS_ DS_ FIFO
FCM
0 DEST_PER SRC_PER UPD UPD PROTCTL _MO
ODE
_EN _EN DE
r rw rw rw rw rw rw rw
GPDMA0_CHx_CFGH (x=2-7)
Configuration Register High for Channel x
(44H + x*58H) Reset Value: 0000 0004H
GPDMA1_CHx_CFGH (x=0-3)
Configuration Register High for Channel x
(44H + x*58H) Reset Value: 0000 0004H
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
FIFO
FCM
0 DEST_PER SRC_PER 0 PROTCTL _MO
ODE
DE
r rw rw r rw rw rw
GPDMA0_CHx_CFGL (x=0-1)
Configuration Register Low for Channel x
(40H + x*58H) Reset Value: 0000 0EX0H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
REL REL SRC DST
LOC
OAD OAD _HS _HS LOC
MAX_ABRST K_C
_DS _SR _PO _PO K_B
H
T C L L
rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HS_ HS_
FIFO CH_
LOCK_B_ LOCK_CH SEL SEL
_EM SUS CH_PRIOR 0
L _L _SR _DS
PTY P
C T
rw rw rw rw r rw rw r
GPDMA0_CHx_CFGL (x=2-7)
Configuration Register Low for Channel x
(40H + x*58H) Reset Value: 0000 0EX0H
GPDMA1_CHx_CFGL (x=0-3)
Configuration Register Low for Channel x
(40H + x*58H) Reset Value: 0000 0EX0H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SRC DST
LOC
_HS _HS LOC
0 MAX_ABRST K_C
_PO _PO K_B
H
L L
r rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HS_ HS_
FIFO CH_
LOCK_B_ LOCK_CH SEL SEL
_EM SUS CH_PRIOR 0
L _L _SR _DS
PTY P
C T
rw rw rw rw r rw rw r
SGR
The Source Gather register contains two fields:
Source gather count field (SGRx.SGC) - Specifies the number of contiguous source
transfers of CTL.SRC_TR_WIDTH between successive gather intervals. This is
defined as a gather boundary.
Source gather interval field (SGRx.SGI) - Specifies the source address
increment/decrement in multiples of CTL.SRC_TR_WIDTH on a gather boundary
when gather mode is enabled for the source transfer.
The CTL.SINC field controls whether the address increments or decrements. When the
CTL.SINC field indicates a fixed-address control, then the address remains constant
throughout the transfer and the SGRx register is ignored. For more information, see
Section 5.2.13.
GPDMA0_CHx_SGR (x=0-1)
Source Gather Register for Channel x
(48H + x*58H) Reset Value: 0000 0000H
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
SGC SGI
rw rw
DSR
The Destination Scatter register contains two fields:
Destination scatter count field (DSRx.DSC) - Specifies the number of contiguous
destination transfers of CTL.DST_TR_WIDTH between successive scatter
boundaries.
Destination scatter interval field (DSRx.DSI) - Specifies the destination address
increment/decrement in multiples of CTL.DST_TR_WIDTH on a scatter boundary
when scatter mode is enabled for the destination transfer.
The CTL.DINC field controls whether the address increments or decrements. When the
CTL.DINC field indicates a fixed address control, then the address remains constant
throughout the transfer and the DSRx register is ignored. For more information, see
Section 5.2.13.
GPDMA0_CHx_DSR (x=0-1)
Destination Scatter Register for Channel x
(50H + x*58H) Reset Value: 0000 0000H
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
DSC DSI
rw rw
The contents of each of the five Status registers is ORed to produce a single bit for each
interrupt type in the Combined Status register; that is, STATUSINT.
Note: For interrupts to propagate past the raw* interrupt register stage, CTL.INT_EN
must be set to 1B, and the relevant interrupt must be unmasked in the mask*
interrupt register.
RAWTFR
Raw DMA Transfer Complete Interrupt Status.
RAWBLOCK
Raw Block Transfer Complete Interrupt Status.
RAWSRCTRAN
Raw Source Transaction Complete Interrupt Status.
RAWDSTTRAN
Raw Block Transfer Complete Interrupt Status.
RAWERR
Raw Error Interrupt Status.
GPDMA0_RAWTFR
Raw IntTfr Status (2C0H) Reset Value: 0000 0000H
GPDMA0_RAWBLOCK
Raw IntBlock Status (2C8H) Reset Value: 0000 0000H
GPDMA0_RAWSRCTRAN
Raw IntSrcTran Status (2D0H) Reset Value: 0000 0000H
GPDMA0_RAWDSTTRAN
Raw IntBlock Status (2D8H) Reset Value: 0000 0000H
GPDMA0_RAWERR
Raw IntErr Status (2E0H) Reset Value: 0000 0000H
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
C C C C C C C C
0 H H H H H H H H
7 6 5 4 3 2 1 0
r rw rw rw rw rw rw rw rw
GPDMA1_RAWTFR
Raw IntTfr Status (2C0H) Reset Value: 0000 0000H
GPDMA1_RAWBLOCK
Raw IntBlock Status (2C8H) Reset Value: 0000 0000H
GPDMA1_RAWSRCTRAN
Raw IntSrcTran Status (2D0H) Reset Value: 0000 0000H
GPDMA1_RAWDSTTRAN
Raw IntBlock Status (2D8H) Reset Value: 0000 0000H
GPDMA1_RAWERR
Raw IntErr Status (2E0H) Reset Value: 0000 0000H
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
C C C C
0 H H H H
3 2 1 0
r rw rw rw rw
STATUSTFR
DMA Transfer Complete Interrupt Status.
STATUSBLOCK
Block Transfer Complete Interrupt Status.
STATUSSRCTRAN
Source Transaction Complete Interrupt Status.
STATUSDSTTRAN
Block Transfer Complete Interrupt Status.
STATUSERR
Error Interrupt Status.
GPDMA0_STATUSTFR
IntTfr Status (2E8H) Reset Value: 0000 0000H
GPDMA0_STATUSBLOCK
IntBlock Status (2F0H) Reset Value: 0000 0000H
GPDMA0_STATUSSRCTRAN
IntSrcTran Status (2F8H) Reset Value: 0000 0000H
GPDMA0_STATUSDSTTRAN
IntBlock Status (300H) Reset Value: 0000 0000H
GPDMA0_STATUSERR
IntErr Status (308H) Reset Value: 0000 0000H
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
C C C C C C C C
0 H H H H H H H H
7 6 5 4 3 2 1 0
r r r r r r r r r
GPDMA1_STATUSTFR
IntTfr Status (2E8H) Reset Value: 0000 0000H
GPDMA1_STATUSBLOCK
IntBlock Status (2F0H) Reset Value: 0000 0000H
GPDMA1_STATUSSRCTRAN
IntSrcTran Status (2F8H) Reset Value: 0000 0000H
GPDMA1_STATUSDSTTRAN
IntBlock Status (300H) Reset Value: 0000 0000H
GPDMA1_STATUSERR
IntErr Status (308H) Reset Value: 0000 0000H
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
C C C C
0 H H H H
3 2 1 0
r r r r r
MASKTFR
Mask for Raw DMA Transfer Complete Interrupt Status.
MASKBLOCK
Mask for Raw Block Transfer Complete Interrupt Status.
MASKSRCTRAN
Mask for Raw Source Transaction Complete Interrupt Status.
MASKDSTTRAN
Mask for Raw Block Transfer Complete Interrupt Status.
MASKERR
Mask for Raw Error Interrupt Status.
GPDMA0_MASKTFR
Mask for Raw IntTfr Status (310H) Reset Value: 0000 0000H
GPDMA0_MASKBLOCK
Mask for Raw IntBlock Status (318H) Reset Value: 0000 0000H
GPDMA0_MASKSRCTRAN
Mask for Raw IntSrcTran Status (320H) Reset Value: 0000 0000H
GPDMA0_MASKDSTTRAN
Mask for Raw IntBlock Status (328H) Reset Value: 0000 0000H
GPDMA0_MASKERR
Mask for Raw IntErr Status (330H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_MASKTFR
Mask for Raw IntTfr Status (310H) Reset Value: 0000 0000H
GPDMA1_MASKBLOCK
Mask for Raw IntBlock Status (318H) Reset Value: 0000 0000H
GPDMA1_MASKSRCTRAN
Mask for Raw IntSrcTran Status (320H) Reset Value: 0000 0000H
GPDMA1_MASKDSTTRAN
Mask for Raw IntBlock Status (328H) Reset Value: 0000 0000H
GPDMA1_MASKERR
Mask for Raw IntErr Status (330H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
CLEARTFR
Clear DMA Transfer Complete Interrupt Status and Raw Status.
CLEARBLOCK
Clear Block Transfer Complete Interrupt Status and Raw Status.
CLEARSRCTRAN
Clear Source Transaction Complete Interrupt Status and Raw Status.
CLEARDSTTRAN
Clear Block Transfer Complete Interrupt Status and Raw Status.
CLEARERR
Clear Error Interrupt Status and Raw Status.
GPDMA0_CLEARTFR
IntTfr Status (338H) Reset Value: 0000 0000H
GPDMA0_CLEARBLOCK
IntBlock Status (340H) Reset Value: 0000 0000H
GPDMA0_CLEARSRCTRAN
IntSrcTran Status (348H) Reset Value: 0000 0000H
GPDMA0_CLEARDSTTRAN
IntBlock Status (350H) Reset Value: 0000 0000H
GPDMA0_CLEARERR
IntErr Status (358H) Reset Value: 0000 0000H
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
C C C C C C C C
0 H H H H H H H H
7 6 5 4 3 2 1 0
r w w w w w w w w
GPDMA1_CLEARTFR
IntTfr Status (338H) Reset Value: 0000 0000H
GPDMA1_CLEARBLOCK
IntBlock Status (340H) Reset Value: 0000 0000H
GPDMA1_CLEARSRCTRAN
IntSrcTran Status (348H) Reset Value: 0000 0000H
GPDMA1_CLEARDSTTRAN
IntBlock Status (350H) Reset Value: 0000 0000H
GPDMA1_CLEARERR
IntErr Status (358H) Reset Value: 0000 0000H
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
C C C C
0 H H H H
3 2 1 0
r w w w w
GPDMA0_STATUSINT
Combined Interrupt Status Register (360H) Reset Value: 0000 0000H
GPDMA1_STATUSINT
Combined Interrupt Status Register (360H) Reset Value: 0000 0000H
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
DST SRC BLO
0 ERR TFR
T T CK
r r r r r r
REQSRCREG
A bit is assigned for each channel in this register. REQSRCREG[n] is ignored when
software handshaking is not enabled for the source of channel n.
A channel SRC_REQ bit is written only if the corresponding channel write enable bit in
the SRC_REQ_WE field is asserted on the same AHB write transfer, and if the channel
is enabled in the CHENREG register. For example, writing hex 0101 writes a 1 into
REQSRCREG[0], while REQSRCREG[7:1] remains unchanged. Writing hex 00xx
leaves REQSRCREG[7:0] unchanged. This allows software to set a bit in the
REQSRCREG register without performing a read-modified write operation.
The functionality of this register depends on whether the source is a flow control
peripheral or not. For a description of when the source is not a flow controller, refer to
Section 5.2.7.4.
GPDMA0_REQSRCREG
Source Software Transaction Request Register
(368H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_REQSRCREG
Source Software Transaction Request Register
(368H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
REQDSTREG
A bit is assigned for each channel in this register. REQDSTREG[n] is ignored when
software handshaking is not enabled for the source of channel n.
A channel DST_REQ bit is written only if the corresponding channel write enable bit in
the DST_REQ_WE field is asserted on the same AHB write transfer, and if the channel
is enabled in the CHENREG register.
The functionality of this register depends on whether the destination is a flow control
peripheral or not. For a description of when the destination is not a flow controller, refer
to Section 5.2.7.4.
GPDMA0_REQDSTREG
Destination Software Transaction Request Register
(370H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_REQDSTREG
Destination Software Transaction Request Register
(370H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
SGLREQSRCREG
A bit is assigned for each channel in this register. SGLREQSRCREG[n] is ignored when
software handshaking is not enabled for the source of channel n.
A channel SRC_SGLREQ bit is written only if the corresponding channel write enable bit
in the SRC_SGLREQ_WE field is asserted on the same AHB write transfer, and if the
channel is enabled in the CHENREG register.
The functionality of this register depends on whether the source is a flow control
peripheral or not. For a description of when the source is not a flow controller, refer to
Section 5.2.7.4.
GPDMA0_SGLREQSRCREG
Single Source Transaction Request Register
(378H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_SGLREQSRCREG
Single Source Transaction Request Register
(378H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
SGLREQDSTREG
A bit is assigned for each channel in this register. SGLREQDSTREG[n] is ignored when
software handshaking is not enabled for the destination of channel n.
A channel DST_SGLREQ bit is written only if the corresponding channel write enable bit
in the DST_SGLREQ_WE field is asserted on the same AHB write transfer, and if the
channel is enabled in the CHENREG register.
The functionality of this register depends on whether the destination is a flow control
peripheral or not. For a description of when the destination is not a flow controller, refer
to Section 5.2.7.4.
GPDMA0_SGLREQDSTREG
Single Destination Transaction Request Register
(380H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_SGLREQDSTREG
Single Destination Transaction Request Register
(380H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
LSTSRCREG
A bit is assigned for each channel in this register. LSTSRCREG[n] is ignored when
software handshaking is not enabled for the source of channel n, or when the source of
channel n is not a flow controller.
A channel LSTSRC bit is written only if the corresponding channel write enable bit in the
LSTSRC_WE field is asserted on the same AHB write transfer, and if the channel is
enabled in the CHENREG register.
GPDMA0_LSTSRCREG
Last Source Transaction Request Register
(388H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_LSTSRCREG
Last Source Transaction Request Register
(388H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
LSTDSTREG
A bit is assigned for each channel in this register. LSTDSTREG[n] is ignored when
software handshaking is not enabled for the destination of channel n or when the
destination of channel n is not a flow controller.
A channel LSTDST bit is written only if the corresponding channel write enable bit in the
LSTDST_WE field is asserted on the same AHB write transfer, and if the channel is
enabled in the CHENREG register.
GPDMA0_LSTDSTREG
Last Destination Transaction Request Register
(390H) Reset Value: 0000 0000H
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
W W W W W W W W
E_ E_ E_ E_ E_ E_ E_ E_ C C C C C C C C
0 C C C C C C C C H H H H H H H H
H H H H H H H H 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
r w w w w w w w w rw rw rw rw rw rw rw rw
GPDMA1_LSTDSTREG
Last Destination Transaction Request Register
(390H) Reset Value: 0000 0000H
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
W W W W
E_ E_ E_ E_ C C C C
0 C C C C 0 H H H H
H H H H 3 2 1 0
3 2 1 0
r w w w w r rw rw rw rw
ID
This is the GPDMA ID register, which is a read-only register that reads back the
hardcoded module ID number.
GPDMA0_ID
GPDMA0 ID Register (3A8H) Reset Value: 00AF C0XXH
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
VALUE
GPDMA1_ID
GPDMA1 ID Register (3A8H) Reset Value: 00B0 C0XXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VALUE
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VALUE
TYPE
This is the GPDMA Component Type register, which is a read-only register that specifies
the type of the packaged component.
GPDMA0_TYPE
GPDMA Component Type (3F8H) Reset Value: 4457 1110H
GPDMA1_TYPE
GPDMA Component Type (3F8H) Reset Value: 4457 1110H
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
VALUE
VERSION
This is the GPDMA Component Version register, which is a read-only register that
specifies the version of the packaged component.
GPDMA0_VERSION
DMA Component Version (3FCH) Reset Value: 3231 342AH
GPDMA1_VERSION
DMA Component Version (3FCH) Reset Value: 3231 342AH
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
VALUE
Input documents
[5] A painless guide to CRC Error Detection Algorithms, Ross N. Williams
[6] 32-Bit Cyclic Redundancy Codes for Internet Applications, Philip Koopman,
International Conference on Dependable Systems and Networks (DSN), 2002
6.1 Overview
This chapter provides on overview of the features, applications and architecture of the
FCE module.
6.1.1 Features
The FCE provides the following features:
The FCE implements the following CRC polynomials:
Depending on the hardware configuration the FCE may implement more CRC kernels
with different CRC polynomials. The specific configuration for the XMC4500
microcontroller is shown in the Figure 6-1 FCE Block Diagram on Page 6-3.
fCPU
Reset
SR0
4. input data reflected: indicates if each byte of the input parallel data is reflected before
being used to compute the CRC
5. result data reflected: indicates if the final CRC value is reflected or not
6. XOR value: indicates if a final XOR operation is done before returning the CRC result
All the properties are fixed once a polynomial has been chosen. However the FCE
provides the capability to control the two reflection steps and the final XOR through the
CFG register. The reset values are compatible with the implemented algorithm. The final
XOR control enables to select either 0xFFFFFFFF or 0x00000000 to be XORed with the
POST_CRC1 value. These two values are those used by the most common CRC
polynomials.
Note: The reflection steps and final XOR do not modify the properties of the CRC
algorithm in terms of error detection, only the CRC final signature is affected.
The next two figures provides an overview of the control and status features of a CRC
kernel.
CFGm (m = 0-3)), the LENGTH register is reinitialized with the previously configured
value. This feature is especially suited when the FCE is used in combination with a DMA
engine.
In the case the automatic length reload feature is not enabled, if LENGTH is already at
zero but software still writes to IR (by mistake) every bit of the LENGTH should be set to
1 and hold this value until software initializes it again for the processing of a new
message. In such case the STS.LEF (Length Error Flag) should be set and an interrupt
generated if the CFG.LEI (Length Error Interrupt) is set.
Usually, the CRC signature of a message M0 is computed and appended to M0 to form
the message M1 which is transmitted. One interesting property of CRCs is that the CRC
signature of M1 shall be zero. This property is particularly useful when automatically
checking the signature of data blocks of fixed length with the automatic length reload
enabled. LENGTH should be loaded with the length of M1 and CHECK with 0.
SW Write access
Register Contents
Shifted Left
Compare
<reg> versus redundant <reg>
STS.CEF
0xFACECAFE value to the <REG> address. The 0xFACECAFE is not written into the
<REG> register. The next write access will proceed as a normal bus write access. The
write accesses shall use full 32-bit access only. This procedure will then be repeated
every time software wants to configure a new <REG> value. If software reads the
CHECK register just after writing 0xFACECAFE it returns the current <REG> contents
and not 0xFACECAFE. A read access to <REG> has no effect on the protection
mechanism.
The following C-code shows write accesses to the CHECK and LENGTH registers
following this procedure:
//set CHECK register
FCE_CHECK0.U = 0xFACECAFE;
FCE_CHECK0.U = 0;
interrupt from the same source. If a SW access to clear the interrupt status bit takes
place and in the same cycle the hardware wants to set the bit, the hardware condition
wins the arbitration.
As all the interrupts are caused by an error condition, the interrupt shall be handled by a
Error Management software layer. The software services using the FCE as acceleration
engine may not directly deal with error conditions but let the upper layer using the service
to deal with the error handling.
Initialization:
The FCE is enabled by writing 0x0 to the CLC register. Software must first ensure that
the CRC kernel is properly configured, especially the initial CRC register value written
via the CRC register, the input and result reflection as well as the final xored value via
the CFG register. The following source code is an example of initialization for the basic
operation of the FCE kernel 0:
//enable FCE
FCE_CLC.U = 0x0;
//final result to be xored with 0xFFFFFFFF, no reflection
FCE_CFG0.U = 0x400;
//set CRC initial value (seed)
FCE_CRC0.U = 0xFFFFFFFF;
6.7 Registers
Table 6-3 show all registers associated with a FCE CRC-kernel. All FCE kernel register
names are described in this section. They should get the prefix FCE_ when used in the
context of a product specification.
The registers are numbered by one index to indicate the related FCE CRC Kernel
(m = 0-3). Some kernel registers are adapted to the degree of the polynomial
implemented by the kernel.
CLC
Clock Control Register (00H) Reset Value: 0000 0003H
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
0 DISS DISR
r rh rw
ID
Module Identification Register (08H) Reset Value: 00CA C001H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MOD_NUMBER
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOD_TYPE MOD_REV
r r
IRm (m = 0-1)
Input Register m (20H + m*20H) Reset Value: 0000 0000H
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
IR
rw
A write to IRm triggers the CRC kernel to update the message checksum according to
the IR contents and to the current CRC register contents. Only 32-bit write transactions
are allowed to this IRm registers, any other bus write transaction will lead to a Bus Error.
IRm (m = 2-2)
Input Register m (20H + m*20H) Reset Value: 0000 0000H
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
0 IR
r rw
A write to IRm triggers the CRC kernel to update the message checksum according to
the IR contents and to the current CRC register contents. Only 32-bit or 16-bit write
transactions are allowed to this IRm register, any other bus write transaction will lead to
a Bus Error. Only the lower 16-bit of the write transactions will be used.
IRm (m = 3-3)
Input Register m (20H + m*20H) Reset Value: 0000 0000H
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
0 IR
r rw
A write to IRm triggers the CRC kernel to update the message checksum according to
the IR contents and to the current CRC register contents. Any write transaction is
allowed to this IRm register. Only the lower 8-bit of the write transactions will be used.
RESm (m = 0-1)
CRC Result Register m (24H + m*20H) Reset Value: FFFF FFFFH
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
RES
rh
RESm (m = 2-2)
CRC Result Register m (24H + m*20H) Reset Value: 0000 FFFFH
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
0 RES
r rh
RESm (m = 3-3)
CRC Result Register m (24H + m*20H) Reset Value: 0000 00FFH
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
0 RES
r rh
CFGm (m = 0-3)
CRC Configuration Register m
(28H + m*20H) Reset Value: 0000 0700H
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
XSE REF REFI
0 0 ALR CCE BEI LEI CEI CMI
L OUT N
r rw rw rw r rw rw rw rw rw rw
STSm (m = 0-3)
CRC Status Register m (2CH + m*20H) Reset Value: 0000 0000H
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
LENGTHm (m = 0-3)
CRC Length Register m (30H + m*20H) Reset Value: 0000 0000H
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
0 LENGTH
r rwh
CHECKm (m = 0-1)
CRC Check Register m (34H + m*20H) Reset Value: 0000 0000H
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
CHECK
rw
CHECKm (m = 2-2)
CRC Check Register m (34H + m*20H) Reset Value: 0000 0000H
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
0 CHECK
r rw
CHECKm (m = 3-3)
CRC Check Register m (34H + m*20H) Reset Value: 0000 0000H
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
0 CHECK
r rw
CRCm (m = 0-1)
CRC Register m (38H + m*20H) Reset Value: 0000 0000H
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
CRC
rwh
CRCm (m = 2-2)
CRC Register m (38H + m*20H) Reset Value: 0000 0000H
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
0 CRC
r rwh
CRCm (m = 3-3)
CRC Register m (38H + m*20H) Reset Value: 0000 0000H
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
0 CRC
r rwh
CTRm (m = 0-3)
CRC Test Register m (3CH + m*20H) Reset Value: 0000 0000H
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
FRM FRM
0 _CH _CF FCM
ECK G
r rw rw rw
6.8 Interconnects
The interfaces of the FCE module shall be described in the module design specification.
The Table 6-4 shows the services requests of the FCE module.
Hamming Distance
The Hamming distance defines the error detection capability of a CRC polynomial. A
cyclic code with a Hamming Distance of D can detect all D-1 bit errors. Table 6-5
Hamming Distance as a function of message length (bits) on Page 6-25 shows
the dependency of the Hamming Distance with the length of the message.
13 8 - 10
12 11 - 12
11 13 - 21
10 22 - 34
9 35 - 57
8 58 - 91
7 92 - 171
6 172 - 268
5 269 - 2974
4 2973 - 91607
3 91607 - 131072
1) Data from technical paper 32-Bit Cyclic Redundancy Codes for Internet Applications by Philip Koopman,
Carnegie Mellon University, 2002
On-Chip Memories
On-Chip Memories
7 Memory Organization
This chapter provides description of the system Memory Organization and basic
information related to Parity Testing and Parity Error handling.
References
[8] Cortex-M4 User Guide, ARM DUI 0508B (ID062910)
7.1 Overview
The Memory Map is intended to balance decoding cost at various level of the system bus
infrastructure.
7.1.1 Features
The Memory Map implements the following features:
Compatibility with standard ARM Cortex-M4 CPU [8]
Compatibility across entire XMC4000 Family
Optimal functional module address spaces grouping
0xE0100000 0xFFFFFFFF
ROM Table
0xE00FF000
External PPB System
0xE0042000
ETM
0xE0041000 0xE0100000
TPIU
0xE0040000 Private peripheral bus - External
0xE0040000
Private peripheral bus - Internal
0xE0040000
Reserved 0xE0000000
0xE000F000
SCS
0xE000E000
Reserved
0xE0003000 External device 1.0GB
FPB
0xE0002000
DWT
0xE0001000
ITM
0xE0000000 0xA0000000
0x60000000
Peripheral 0.5GB
0x40000000
SRAM 0.5GB
0x20000000
Code 0.5GB
0x00000000
mapped ressources, unsupported access data witdhs, protected memory regions. For
module specific limitations please refer to individual module chapters.
Invalid Address
Accesses to invalid addresses result in error responses. Invalid addresses are defined
as those that do not mapped to any valid ressources. This applies to single addresses
and to wider address ranges. Some invalid addresses within valid module address
ranges may not produce error responses and this is specific to individual modules.
Parity Errors
Parity test is performed on the XMC4500 memories in normal functional mode. Parity
errors are generated in case of failure of parity test performed inside of each of the
memory module. The mechnism of parity testing depends on memory data width and
access mode, i.e. memory modules that are accessible byte-wise implement parity
check for each data byte individually while for memory modules that are accessible
double-word-wise it is sufficient to perform joint check for all bits.
The occurrence of a parity error gets signalized to the system with system bus error or
an interrupt (parity trap). For details on parity errror generation control and handling
please refer to the SCU chapter. For more details please refer to Table 7-3.
Table 7-3 Parity Test Enabled Memories and Supported Parity Error Indication
7.8 Registers
This section describes registers of the Peripheral Bridges. The purpose of the registers
is handling of errors signalized during bufferable accesses to peripherals connected to
the respective bridges. Aactive errors on bufferable writes trigger interrupt requests
geberated from the Peripheral Bridges that can be monitored and cleared in the register
defiled in this chapter.
PBA0_STS
The status register of PBA0 bridge indicates bus error occurrence for write access. Is
meant to be used for errors triggered upon buffered writes. The bit gets set and interrupt
request has been generated to the SCU.
Write one to clear, writing zero has no effect.
PBA0_STS
Peripheral Bridge Status Register (0000H) Reset Value: 0000 0000H
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
WER
0
R
r rw
PBA0_WADDR
The Write Error Address Register keeps write access address that caused a bus error
upon bufferable write attempt to a peripheral connected to PBA0 bridge. This register
store the address that of the bufferable write access attempt that caused error resulting
in setting WERR bit of the PBA0_STS register.
This register value remains unchanged when WERR bit of PBA0_STS register is set.
PBA0_WADDR
PBA Write Error Address Register (0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WADDR
rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WADDR
rh
PBA1_STS
The status register of PBA1 bridge indicates bus error occurrence for write access. Is
meant to be used for errors triggered upon buffered writes. The bit gets set and interrupt
request has been generated to the SCU.
Write one to clear, writing zero has no effect.
PBA1_STS
Peripheral Bridge Status Register (0000H) Reset Value: 0000 0000H
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
WER
0
R
r rw
PBA1_WADDR
The Write Error Address Register keeps write access address that caused a bus error
upon bufferable write attempt to to a peripheral connected to PBA1 bridge. This register
store the address that of the bufferable write access attempt that caused error resulting
in setting WERR bit of the PBA1_STS register.
This register value remains unchanged when WERR bit of PBA1_STS register is set.
PBA1_WADDR
PBA Write Error Address Register (0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WADDR
rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WADDR
rh
8.1 Overview
In the XMC4500, the PMU controls the following interfaces:
The Flash command and fetch control interface for Program Flash
The Boot ROM interface
The PMU interfaces via the Prefetch unit to the Bus Matrix
Following memories are controlled by and belong to the PMU:
1.0 Mbyte of Program Flash memory (PFLASH)
16 Kbyte of BROM (BROM)
4 Kbyte of Instruction Cache memory in the Prefetch unit
256-bit Data Buffer in the Prefetch unit
Bus Matrix
PREFETCH
PMU
Control
PFLASH BROM
8.3.1 Overview
The Prefetch unit separates between instruction and data accesses to the Flash with the
following configuration:
4 Kbyte Instruction Buffer
2-way set associative
Least-Recently-Used (LRU) replacement policy
Cache line size: 256 bits
Critical word first
Streaming1)
Line wrap around
Parity, 32-bit granularity
Buffer can be bypassed
Buffer can be globally invalidated
256-bit Data Buffer
Single line
Critical word first
Streaming1)
Line Wrap around
1) The first 32-bit data from Flash gets immediately forwarded to the CPU
Instruction
ICode Bus I/F
Instruction
Buffer
PMU
Flash memory
I/F
8.3.2 Operation
the DMA. CPU read accesses to the prefetch buffer are without any penalty i.e. single
cycle access rate. The miss latency is minimized.
The data interface is shared between DMA requests, CPU DCode bus requests and
CPU System bus requests. The CPU System bus is attached to the Prefetch unit to
access configuration and status registers within the Prefetch unit and the PMU and
Flash. All read requests outside the cacheable address space and all write accesses
bypass the data buffer.
Note: The streaming operation is on the fly - it does not cause any additional latency.
8.4.1 Overview
The embedded Flash module of XMC4500 includes 1.0 MB of Flash memory for code or
constant data (called Program Flash).
8.4.1.1 Features
The following list gives an overview of the features implemented in the Program Flash.
Absolute values can be found in the Data Sheet.
Consists of one bank.
Commonly used for instructions and constant data.
High throughput burst read based on a 256-bit Flash access.
Application optimized sector structure with sectors ranging from 16 Kbytes to
256 Kbytes.
High throughput programming of a 256 byte page (see Data Sheet tPRP).
Sector-wise erase on logical and physical sectors (see Data Sheet tERP).
Write protection separately configurable for groups of sectors.
Hierarchical write protection control with 3 levels of which 2 are password based and
1 is a one-time programmable one.
Password based read protection combined with write protection for the whole Flash.
Separate configuration sector containing the protection configuration and boot
configuration (BMI).
All Flash operations initiated by command sequences as protection against
unintended operation.
Erase and program performed by a Flash specific control logic independent of the
CPU.
End of erase and program operations reported by interrupt.
Dynamic Error Correcting Code (ECC) with Single-bit Error Correction and Double-
bit Error Detection (SEC-DED).
Error reporting by bus error, interrupts and status flags.
Margin reads for quality assurance.
Delivery in the erased state.
Configurable wait state configuration for optimum read performance depending on
CPU frequency (see FCON.WSPFLASH).
High endurance and long retention.
Pad supply voltage used for program and erase.
by the user. The UCBs are the only part of the configuration sector that can be
programmed and erased by the user.
Word-Line: A word-line consists of two pages, an even one and an odd one. In the
PFLASH a word-line contains aligned 512 bytes.
Page: A page is a part of a word-line that is programmed at once. In PFLASH a
page is an aligned group of 256 bytes.
PFLASH
All addresses offset to the start addresses given in Table 8-1. All sectors from S9 on
have a size of 256 Kbyte.
UCB
All addresses offset to the start addresses given in Table 8-1. As explained before the
UCBx are logical sectors.
The PFLASH delivers 256 bits per read access. All read data from the PFLASH passes
through a 256-bit global read buffer.
The PMU allows 4x64-bit burst accesses to the cached address space and single 32-bit
read accesses to the non-cached address space of the PFLASH.
1) WSPFLASH = 0H deviates from this formula and results in the same timing as WSPFLASH = 1H.
The Prefetch generates the 4x64-bit bursts for code and data fetches from the cached
address range in order to fill one cache line or the data buffer respectively. Data reads
from the non-cached address range are performed with single 32-bit transfers.
Following an inital Flash access, the PFLASH automatically starts a prefetch of the next
linear address (even before it has been requested). Has the content of the global read
buffer been read completely (e.g. by a burst from the Prefetch unit), the new prefetched
data is copied to the read buffer and another prefetch to the PFLASH is started. This
significantly reduces the Flash latency for mostly linearly accessed code or data
sections. To avoid additional wait states due to these prefetches, they can be aborted in
case a new (initial) read access is requested from a different address. For power saving
purposes these prefetch operations can be disabled by FCON.IDLE (Idle Read Path).
Read accesses from Flash can be blocked by the read protection (see Chapter 8.4.8).
ECC errors can be detected and corrected (see Chapter 8.4.9).
Register read and write accesses are not affected by these modes.
UL: User protection level (xxx0H or xxx1H for user levels 0 and 1).
PWx: 32-bit password.
When using for command cycles 64-bit transfers the data is expected in the correct 32-
bit word as indicated by the address addr.
Reset to Read
This function resets the command interpreter to its initial state (i.e. the next command
cycle must be the 1st cycle of a sequence). A page mode is aborted.
This command is the only one that is accepted without generating a SQER when the
command interpreter has already received command cycles of a different sequence but
is still not in command mode. Thus Reset to Read can cancel every command
sequence before its last command cycle has been received.
The error flags of FSR (PFOPER, SQER, PROER, PFDBER, ORIER, VER) are cleared.
The flags can be also cleared in the status registers without command sequence.
If any Flash bank is busy this command is executed but the flag SQER is set.
Load Page
Loads the data WD into the page assembly buffer and increments the write pointer to
the next position1).
All WD transfers for one page must have the same width (either all 32-bit or all 64-bit).
Else the transfer is refused with SQER.
The addressed bank must be in page mode, else SQER is issued.
If Load Page is called more often than necessary for filling the page SQER is issued
and if configured an interrupt is triggered. The overflow data is discarded. The page
mode is not left.
Write Page
This function starts the programming process for one page with the data transferred
previously by Load Page commands. Upon entering command mode the page mode
1) More specifically: after Load Page has transferred 64 bits (i.e. two command with 32-bit WD or one command
with one 64-bit WD) the ECC is calculated and the result is transferred to the assembly buffer.
is finished (indicated by clearing the corresponding PAGE flag) and the BUSY flag of the
bank is set.
This command is refused with SQER when the addressed Flash bank is not in page
mode.
SQER is also issued when PA addresses an unavailable Flash range or when PA does
not point to a legal page start address.
If after Enter Page Mode too few data or no data was transferred to the assembly buffer
with Load Page then Write Page programs the page but sets SQER. The missing data
is programmed with the previous content of the assembly buffer.
When the page PA is located in a sector with active write protection or the Flash module
has an active global read protection the execution fails and PROER is set.
Erase Sector
The sector SA is erased.
SQER is returned when SA does not point to the base address of a correct sector (as
specified at the beginning of this section) or to an unavailable sector.
When SA has an active write protection or the Flash module has an active global read
protection the execution fails and PROER is set.
The command fails with SQER when UCBA is not the start address of a valid UCB.
Resume Protection
This command clears all FSR.WPRODISx and the FSR.RPRODIS effectively enabling
again the Flash protection as it was configured.
A FSR.WPRODISx is not cleared when corresponding UCBx is not in the confirmed
state (see Chapter 8.4.8.1).
Clear Status
The flags FSR.PROG and FSR.ERASE and the error flags of FSR (PFOPER, SQER,
PROER, PFDBER, ORIER, VER) are cleared. These flags can be also cleared in the
status registers without command sequence.
When any Flash bank is busy this command fails by setting additionally SQER.
If the confirmation code field is programmed with 8AFE 15C3H the UCB content is
confirmed otherwise it is unconfirmed. The status flags FSR.PROIN, FSR.RPROIN
and FSR.WPROIN02 indicate this confirmation state:
FSR.PROIN: set when any UCB is in the confirmed state.
FSR.RPROIN: set when PROCON0.RPRO is 1 and the UCB0 is in confirmed
state.
FSR.WPROIN02: set when their UCB02 is in confirmed state.
An UCB can be erased with the command Erase User Configuration Block. An UCB
page can be programmed with the command Write User Configuration Page. These
commands fail with PROER when the UCB is write-protected.
An UCB is write-protected if:
UCB0: (FSR.RPROIN and not FSR.RPRODIS) or
(FSR.WPROIN0 and not FSR.WPRODIS0)
UCB1: FSR.WPROIN1 and not FSR.WPRODIS1.
UCB2: FSR.WPROIN2
So when the UCB2 is in the confirmed state its protection can not be changed anymore.
Therefore this realizes a one-time programmable protection.
Changing UCBs
The protection installation is modified by erasing and programming the UCBs with
dedicated command sequences, described in Chapter 8.4.7.1. These operations need
to be performed with care as described in the following.
Aborting an Erase UC Block operation (e.g. due to reset or power failure) must be
avoided at all means, as it can result in an unusable device.
UCBs are logical sectors, and as such the allowed number of program/erase cycles of
the UCBs must not be exceeded. Over-cycling the UCBs can also lead to an unusable
device.
The installation of the protection and its confirmation on different pages of the UCB offers
the possibility to check the installation before programming the confirmation. First the
protection needs to be programmed, then an application reset must be triggered to
trigger the reading of the UCBs by the PMU and after that the protection can be verified
(e.g. Disable Protection to check the password and by checking PROCONs and
FCON). The application reset is inevitable because the PMU reads the UCBs only during
the startup phase.
be performed up to 4 times. But note, after execution of the Erase UC block command
(which is protected and therefore requires the preceding disable command with the
users specific passwords), all keywords and all protection installations of user 0 are
erased; thus, the Flash is no more read protected (beginning with next reset) until re-
programming the UC pages. But the division and separation of the protection
configuration data and of the confirmation data into two different UCB-wordlines
guarantees, that a disturb of keywords can be discovered and corrected before the
protection is confirmed. For this reason, the command sequence Disable Read
Protection can also be used when protection is programmed (configured) but not
confirmed; wrong keywords are then indicated by the error flag PROER.
Read protection can be combined with sector specific write protection. In this case, after
execution of the command Disable Read Protection only those sectors are unlocked for
write accesses, which are not separately write protected.
the users UC pages are re-programmed. Only exception: sectors protected by user 2
are locked for ever because the UCB2 can no more be erased after installation of write
protection in UCB2.
Note: In case of an OPER or VER error, the error interrupt is issued not before the busy
state of the Flash is deactivated.
The source of interrupt is indicated in the Flash Status Register FSR by the error flags
or by the PROG or ERASE flag in case of end of busy interrupt. An interrupt is also
generated for a new error event, even if the related error flag is still set from a previous
error interrupt.
Every interrupt source is masked (disabled) after reset and can be enabled via dedicated
mask bits in the Flash Configuration Register FCON.
1) When the command addresses the busy Flash bank, the access is serviced withbusy cycles.
The flag should be cleared with Clear Status. The last operation can be determined
from the PROG and ERASE flags. In case of an erase operation the affected physical
sector must be assumed to be in an invalid state, in case of a program operation only the
affected page. Other physical sectors can still be read. New program or erase
commands must not be issued before the next reset.
Consequently a reset must be performed. This performs a new Flash ramp up with
initialization of the microcode SRAM. The application must determine from the context
which operation failed and react accordingly. Mostly erasing the addressed sector and
re-programming its data is most appropriate. If a Program Page command was affected
and the sector can not be erased the wordline could be invalidated if needed by marking
it with all-one data and the data could be programmed to another empty wordline.
Only in case of a defective microcode SRAM the next program or erase operation will
incur again this error.
Note: Although this error indicates a failed operation it is possible to ignore it and rely on
a data verification step to determine if the Flash memory has correct data. Before
re-programming the Flash the flow must ensure that a new reset is applied.
Note: Even when the flag is ignored it is recommended to clear it. Otherwise all following
operations including sleep could trigger an interrupt even when they are
successful (see Chapter 8.5.1, interrupt because of operational error).
When reading data or fetching code from PFLASH the ECC evaluation detected a single-
bit error (SBE) which was corrected.
This flag is a warning indication and not an error. A certain amount of single-bit errors
must be expected because of known physical effects.
New state:
No state change. Just the bit is set.
Proposed handling by software:
This flag can be used to analyze the state of the Flash memory. During normal operation
it should be ignored. In order to count single-bit errors it must be cleared by Clear
Status or Reset to Read after each occurrence1).
Usually it is sufficient after programming data to compare the programmed data with its
reference values ignoring the SBE bits. When there is a comparison error the sector is
erased and programmed again.
When programming the PFLASH (end-of-line programming or SW updates) customers
can further reduce the probability of future read errors by performing the following check
after programming:
Change the read margin to high margin 0.
Verify the data and count the number of SBEs.
When the number of SBEs exceeds a certain limit (e.g. 10 in 2 Mbyte) the affected
sectors could be erased and programmed again.
Repeat the check for high margin 1.
Each sector should be reprogrammed at most once, afterwards SBEs can be
ignored.
Due to the specificity of each application the appropriate usage and implementation of
these measures (together with the more elaborate VER handling) must be chosen
according to the context of the application.
1) Further advice: remember that the ECC is evaluated when the data is read from the PMU. When counting
single-bit errors use always the non-cached address range otherwise the error count can depend on cache hit
or miss and it refers to the complete cache line. As the ECC covers a block of 64 data bits take care to evaluate
the FSR only once per 64-bit block.
As long as the Flash is in Sleep mode, this state is indicated by the bit FSR.SLM. The
FSR.PBUSY stays set as well.
Wake-up from sleep is controlled with clearing of bit FCON.SLEEP, if selected via this
bit, or wake-up is initiated by releasing the external sleep signal from SCU. After wake-
up, the Flash enters read mode and is available again after the wake-up time tWU. During
the wake-up phase the FSR.PBUSY is set until the wake-up process is completed.
Note: During sleep and wake-up, the Flash is reported to be busy. Thus, read and write
accesses to the Flash in Sleep mode are acknowledged with busy and should
therefore be avoided; those accesses make sense only during wake-up, when
waiting for the Flash read mode.
2. The wake-up time tWU is documented in the Data Sheet. This time may fully delay the
interrupt response time in Sleep mode.
3. Note: A wake-up is only accepted by the Flash if it is in Sleep mode. The Flash will
first complete the ramp down to Sleep mode before reacting to a wake-up trigger.
When a page programming operation is aborted the page can still appear as erased (but
contain slightly programmed bits), it can appear as being correctly programmed (but the
data has a lowered retention) or the page contains garbage data. It is also possible that
the read data is instable so that depending on the operating conditions different data is
read.
For the detection of an aborted Flash process the flags FSR.PROG and FSR.ERASE
could be used as indicator but only when the reset was a System Reset. Power-on resets
can not be determined from any flags. It is not possible to detect an aborted operation
simply by reading the Flash range. Even the margin reads dont offer a reliable
indication.
When erasing or programming the PFLASH usually an external instance can notice the
reset and simply restart the operation by erasing the Flash range and programming it
again.
However, in cases where this external instance is not existing, a common solution is
detecting an abort by performing two operations in sequence and determine after reset
from the correctness of the second the completeness of the first operation.
E.g. after erasing a sector a page is programmed. After reset the existence of this page
proves that the erase process was performed completely.
The detection of aborted programming processes can be handled similarly. After
programming a block of data an additional page is programmed as marker. When after
reset the block of data is readable and the marker is existent it is ensured that the block
of data was programmed without interruption.
If a complete page can be spent as marker, the following recipe allows to reduce the
marker size to 8 bytes. This recipe violates the rule that a page may be programmed only
once. This violation is only allowed for this purpose and only when the algorithm is robust
against disturbed pages (see also recommendations for handling single-bit errors) by
repeating a programming step when it detects a failure.
Robust programming of a page of data with an 8 byte marker:
1. After reset program preferably always first to an even page (Target Page).
2. If the Other Page on the same wordline contains active data save it to SRAM (the
page can become disturbed because of the 4 programming operations per wordline).
3. Program the data to the Target Page.
4. Perform strict check of the Target Page (see below).
5. Program 8 byte marker to Target Page.
6. Perform strict check of the Target Page.
7. In case of any error of the strict check go to the next wordline and program the saved
data and the target data again following the same steps.
8. Ensure that the algorithm doesnt repeat unlimited in case of a violation of operating
conditions.
Strict checking of programmed data:
8.6.4 Clock
The Flash interface is operating at the same clock speed as the CPU, fCPU. Depending
on the frequency, wait states must be inserted in the Flash accesses. Further details
onthe wait states configuration are give in Chapter 8.4.4.
For proper operation of command sequences and when entering or waking up
from Sleep mode, fCPU must be equal or above 1 MHz.
8.7 Registers
The register set consists of the PMU ID register (Chapter 8.7.1), the Prefetch Control
register (Chapter 8.7.2). The other registers control Flash functionality (Chapter 8.7.3).
All accesses prevented due to access mode restrictions fail with a bus error.
Also accesses to unoccupied register addresses fail with a bus error.
PMU0_ID
PMU0 Identification Register (5800 0508H) Reset Value: 00A1 C0XXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MOD_NUMBER
r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOD_TYPE MOD_REV
r r
PREF_PCON
Prefetch Configuration Register (5800 4000H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0
r rwrw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 IINV IBYP
r r r r w rw
The following table shows the addresses, the access modes and reset types for the
Flash registers in PMU0:
FSR
Flash Status Register (1010H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
W W W W W R R
PRO
VER X 0 SLM 0 PRO PRO 0 PRO PRO PRO 0 PRO PRO 0
IN
DIS1 DIS0 IN2 IN1 IN0 DIS IN
rh rh r rh r rh rh r rh rh rh r rh rh r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PF PF PF PF FA P
PRO SQ ERA PRO
0 DB 0 SB 0 OP 0 PAG 0 0 BUS BUS
ER ER SE G
ER ER ER E Y Y
r rh r rh rh rh r rh r rh rh rh r r rh rh
Note: The footnote numbers of FSR bits describe the specific reset conditions:
1)Cleared with System Reset
2)Cleared with command Reset to Read
3)Cleared with command Clear Status
4)Cleared with power-on reset (PORST)
5)Cleared with command Resume Protection
Note: The xBUSY flags as well as the protection flags cannot be cleared with the Clear
Status command or with the Reset to Read command. These flags are
controlled by HW.
Note: The reset value above is indicated after correct execution of Flash ramp up.
Additionally, errors are possible after ramp up (see Chapter 8.5.3.6).
FCON
Flash Configuration Register (1014H) Reset value: 0007 0006H1)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PF PF
EOB PRO SQ VOP
0 DB 0 SB 0 0 0 0 0 DDF DCF RPA
M ERM ERM ERM
ERM ERM
rw r rw r rw rw rw rw r r r r r rwh rwh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WS
SL ESL
IDLE 0 EC WSPFLASH
EEP DIS
PF
rw rw rw r r r rw rw
1) After Flash ramp up and execution of the startup software in BROM (after firmware exit), the initial value is
000X 0006H.
1) WSPFLASH = 0H deviates from this formula and results in the same timing as WSPFLASH = 1H.
Note: The default numbers of wait states represent the slow cases. This is a general
proceeding and additionally opens the possibility to execute higher frequencies
without changing the configuration.
Note: After reset and execution of Firmware, the read protection control bits are coded
as follows:
DDF, DCF, RPA = 110: No read protection installed
DDF, DCF, RPA = 001: Read protection installed; start in internal Flash
DDF, DCF, RPA = 111: Read protection installed; start not in internal Flash.
FLASH0_ID
Flash Module Identification Register (1008H) Reset Value: 00A2 C0XXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MOD_NUMBER
r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOD_TYPE MOD_REV
r r
MARP
Margin Control Register PFLASH (1018H) Reset Value: 0000 8000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TR
AP 0 MARGIN
DIS
rw r rw
PROCON0
Flash Protection Configuration Register User 0
(1020H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R S10_
0 0 0 0 S9L S8L S7L S6L S5L S4L S3L S2L S1L S0L
PRO S11L
rh r rh rh rh rh rh rh rh rh rh rh rh rh rh rh
PROCON1
Flash Protection Configuration Register User 1
(1024H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
S10_
0 0 0 0 S9L S8L S7L S6L S5L S4L S3L S2L S1L S0L
S11L
r rh rh rh rh rh rh rh rh rh rh rh rh rh rh
PROCON2
Flash Protection Configuration Register User 2
(1028H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
S10_
S9 S8 S7 S6 S5 S4 S3 S2 S1 S0
0 0 0 0 0 S11
ROM ROM ROM ROM ROM ROM ROM ROM ROM ROM
ROM
r r rh rh rh rh rh rh rh rh rh rh rh rh rh rh
System Control
System Control
References
[9] Cortex-M4 User Guide, ARM DUI 0508B (ID062910)
9.1 Overview
A successful servicing of the WDT results in a pulse on the signal wdt_service. The
signal is offered also as an alternate function output. It can be used to show to an
external watchdog that the system is alive.
The WDT timer is a 32-bit counter, which counts up from 0H. It can be serviced while the
counter value is within the window boundary, i.e. between the lower and the upper
boundary value. Correct servicing results in a reset of the counter to 0H. A so called Bad
Service attempt results in a system reset request.
The timer block is running on the fWDT clock which is independent from the bus clock. The
timer value is updated in the corresponding register TIM, whenever the timer value
increments. This mechanism enables immediate response on a read access from the
bus.
The WDT module provides a register interface for configuration. A write to writable
registers is only allowed, when the access is in privileged mode. A write access in user
mode results in a bus error response.
9.1.1 Features
The watchdog timer (WDT) is an independent window watchdog timer.
The features are:
Triggers system reset when not serviced on time or serviced in a wrong way
Servicing restricted to be within boundaries of a user definable refresh window
Can run from an independent clock
Provides service indication to an external pin
Can be suspended in HALT mode
Provides optional pre-warning alarm before reset
PBA2
Bus Interface
wdt_service SCU.HCU
external
WDT watchdog
Registers
CPU wdt_alarm SCU.GCU
HALTED
wdt_rst_req SCU.RCU
Timer
SCU.CCU fWDT
An overflow results in an immediate reset request going to the RCU of the SCU via the
signal wdt_rst_req whenever the counter crosses the upper boundary it triggers an
overflow event pre-warning is not enabled with CTR register. A successful servicing
performed with writing a unique value, referred to as Magic Word to the SRV register
of the WDT within the valid servicing window, results in a pulse on the signal wdt_service
and reset of the timer counter.
0H
No
Servicing
servicing
allowed
allowed
wdt_service
wdt_alarm
wdt_rst_req
0H
No
Servicing
servicing
allowed
allowed
wdt_service
wdt_alarm
wdt_rst_req
serviced
WDT in wrong
serviced window
Window Upper Bound
0H
No
Servicing
servicing
allowed
allowed
wdt_service
wdt_alarm
wdt_rst_req
serviced with
WDT invalid magic
serviced word
Window Upper Bound
0H
No
Servicing
servicing
allowed
allowed
wdt_service
wdt_alarm
wdt_rst_req
The example in Figure 9-5 shows servicing performed within a valid servicing window
but with an invalid Magic Word. Attempt to write a wrong word to the SRV register results
in immediate reset request on wdt_rst_req signal.
check reason for last system reset in order to determine power state
read out SCU_RSTSTAT.RSTSTAT register bit field to determine last system
reset cause
perform appropriate operations dependent on the last system reset cause
WDT software initialization sequence
enable WDT clock with SCU_CLKSET.WDTCEN register bit field
release WDT reset with SCU_PRCLR2.WDTRS register bit field
set lower window bound with WDT_WLB register
set upper window bound with WDT_WUB register
configure external watchdog service indication (optional, please refer to SCU/HCU
chapter)
select and enable WDT input clock with SCU_WDTCLKCR register
enable system trap for pre-warning alarm on system level with SCU_NMIREQEN
register (optional, used in WDT pre-warning mode only)
software start sequence
select mode (Time-Out or Pre-warning) and enable WDT module with WDT_CTR
register
service the watchdog
check current timer value in WDT_TIM register against programmed time window
write magic word to WDT_SRV register within valid time window
alarm event
exception routine (system trap or service request) clearing WDT_WDTSTAT
register with WDT_WDTCLR register
service the watchdog
check current timer value in WDT_TIM register against programmed time window
write magic word to WDT_SRV register within valid time window
9.9 Registers
Registers Overview
All these registers can be read in User Mode, but can only be written in Supervisor Mode.
The absolute register address is calculated by adding:
Module Base Address + Offset Address
ID
The module ID register.
ID
WDT ID Register (00H) Reset Value: 00AD C0XXH
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
r r r
CTR
The operation mode control register.
CTR
WDT Control Register (04H) Reset Value: 0000 0000H
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
rw r rw r rw rw
SRV
The WDT service register. Software must write a magic word while the timer value is
within the valid window boundary. Writing the magic word while the timer value is within
the window boundary will service the watchdog and result a reload of the timer with 0H.
Upon writing data different than the magic word within valid time window or writing even
correct Magic Word but outside of the valid time window no servicing will be performed.
Instead will request an immediate system reset request.
SRV
WDT Service Register (08H) Reset Value: 0000 0000H
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
SRV
TIM
The actual watchdog timer register count value. This register can be read by software in
order to determine current position in the WDT time window.
TIM
WDT Timer Register (0CH) Reset Value: 0000 0000H
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
TIM
rh
WLB
The Window Lower Bound register defines the lower bound for servicing window.
Servicing of the watchdog has only effect within the window boundary
WLB
WDT Window Lower Bound Register (10H) Reset Value: 0000 0000H
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
WLB
rw
WUB
The Window Upper Bound register defines the upper bound for servicing window.
Servicing of the watchdog has only effect within the window boundary.
WUB
WDT Window Upper Bound Register (14H) Reset Value: FFFF FFFFH
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
WUB
rw
WDTSTS
The status register contains sticky bit indicating occurrence of alarm condition.
WDTSTS
WDT Status Register (0018H) Reset Value: 00000000H
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
ALM
0
S
r r
WDTCLR
The status register contains sticky bit field indicating occurrence of alarm condition.
WDTCLR
WDT Clear Register (001CH) Reset Value: 00000000H
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
ALM
0
C
r w
9.10 Interconnects
10.1 Overview
The RTC module tracks time with separate registers for hours, minutes, and seconds.
The calendar registers track date, day of the week, month and year with automatic leap
year correction.
The RTC is capable of running from an alternate source of power, so it can continue to
keep time while the primary source of power is off or unavailable. The timer remains
operational when the core domain is in power-down. The kernel part of the RTC keeps
running as long as the hibernate domain is powered with an alternate supply source. The
alternate source can be for example a lithium battery or a supercapacitor.
10.1.1 Features
The features of the Real Time Clock (RTC) module are:
Precise real time keeping with
32.768 kHz external crystal clock
32.768 kHz high precision internal clock
Periodic time-based interrupt
Programmable alarm interrupt on time match
Supports wake-up mechanism from hibernate state
The main building blocks of the RTC is Time Counter implementing real time counter and
RTC registers containing multi-field registers for the time counter and alarm
programming register. Dedicated fields represent values for elapsing second, minutes,
hours, days, days of week, months and years.
The kernel of the RTC module is instantiated in the hibernate domain.
The RTC registers are instantiated in hibernate domain and mirrored in SCU. Access to
the RTC registers is performed via register mirror updated over serial interface.
Time
Counter alarm
RTC
periodic_event
SCU
Alarm Time
(ATIM0 & ATIM1)
alarm
Real Time
=
(TIM0 & TIM1)
days of
week
Prescaler
1 second seconds minutes hours days months years
tick
periodic_event
Periodic Service Request Logic
After wake-up from hibernate state the content of the mirror registers TIM0 and TIM1 is
undefined until the first update of the corresponding RTC timers occurs and is
propagated to the registers.
For consistent read-out of the timer registers TIM0 and TIM1, the register TIM0 has to
be read before the register TIM1. The value of TIM1 is stored in a shadow register upon
each read of TIM0 before they get copied to the mirror register in core domain.
10.8 Registers
Registers Overview
The absolute register address is calculated by adding:
Module Base Address + Offset Address
ID
Read-only ID register of the RTC module containing unique identification code of the
RTC module.
ID
RTC ID Register (00H) Reset Value: 00A3 C0XXH
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
r r r
CTR
RTC Control Register providing control means of the operation mode of the module.
CTR
RTC Control Register (04H) Reset Value: 7FFF 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DIV
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EYE EMO EDA EHO EMI ESE
0 0 0 TAE 0 ENB
C C C C C C
r rw rw r rw rw rw rw r rw r rw
RAWSTAT
RTC Raw Service Request Register contains raw status info i.e. before status mask
takes effect on generation of service requests. This register serves debug purpose but
can be also used for polling of the status without generating serice requests.
RAWSTAT
RTC Raw Service Request Register (08H) Reset Value: 0000 0000H
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
RPY RPM RPD RPH RPM RPS
0 RAI 0 0
E O A O I E
r rh r rh rh r rh rh rh rh
STSSR
RTC Service Request Status Register contains status info reflecting status mask effect
on generation of service requests. This register needs to be accessed by software in
order to determine the actual cause of an event.
STSSR
RTC Service Request Status Register (0CH) Reset Value: 0000 0000H
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
SPY SPM SPD SPH SPS
0 SAI 0 0 SPMI
E O A O E
r rh r rh rh r rh rh rh rh
MSKSR
RTC Service Request Mask Register contains masking value for generation control of
service requests or interrupts.
MSKSR
RTC Service Request Mask Register (10H) Reset Value: 0000 0000H
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
MPY MPM MPD MPH MPM MPS
0 MAI 0 0
E O A O I E
r rw r rw rw r rw rw rw rw
CLRSR
RTC Clear Service Request Register serves purpose of clearing sticky bits of
RAWSTAT and STSSR registers. Write one to a bit in order to clear it is set. Writing zero
has no effect on the set nor reset bits.
CLRSR
RTC Clear Service Request Register (14H) Reset Value: 0000 0000H
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
RPY RPM RPD RPH RPM RPS
0 RAI 0 0
E O A O I E
r w r w w r w w w w
ATIM0
RTC Alarm Time Register 0 serves purpose of programming single alarm time at a
desired point of time reflecting comparison configuration in the CTR for individual fields
against TIM0 register. The register contains portion of bit fields for seconds, minutes,
hours and days. Upon attempts to write an invalid value to a bit field e.g. exceeding
maximum value default value gets programmed as described for each individual bit
fields.
ATIM0
RTC Alarm Time Register 0 (18H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 ADA 0 AHO
r rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 AMI 0 ASE
r rw r rw
ATIM1
RTC Alarm Time Register 1 serves purpose of programming single alarm time at a
desired point of time reflecting comparison configuration in the CTR for individual fields
against TIM1 register. The ATM1 register contains portion of bit fields for days of week,
months and years. Upon attempts to write an invalid value to a bit field e.g. exceeding
maximum value default value gets programmed as described for each individual bit
fields.
ATIM1
RTC Alarm Time Register 1 (1CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AYE
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 AMO 0
r rw r
TIM0
RTC Time Register 0 contains current time value for seconds, minutes, hours and days.
The bit fields get updated in intervals corresponding with their meaning accordingly. The
register needs to be programmed to reflect actual time after initial power up and will
continue counting time also while in hibernate mode. Upon attempts to write an invalid
value to a bit bield e.g. exceeding maximum value a default value gets programmed as
described for each individual bit fields.
TIM0
RTC Time Register 0 (20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 DA 0 HO
r rwh r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 MI 0 SE
r rwh r rwh
TIM1
RTC Time Register 1 contains current time value for days of week, months and years.
The bit fields get updated in intervals corresponding with their meaning accordingly. The
register needs to be programmed to reflect actual time after initial power up and will
continue counting time also while in hibernate mode. Upon attempts to write an invalid
value to a bit bield e.g. exceeding maximum value a default value gets programmed as
described for each individual bit fields.
TIM1
RTC Time Register 1 (24H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
YE
rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 MO 0 DAWE
r rwh r rwh
10.9 Interconnects
11.1 Overview
The functionality of the SCU described in this chapter is organized in the following sub-
chapters, representing different aspects of system control:
Miscellaneous control functions, Chapter 11.2
Power Control, Chapter 11.3
Hibernate Control, Chapter 11.4
Reset Control, Chapter 11.5
Clock Control, Chapter 11.6
11.1.1 Features
The following features are provided for monitoring and controlling the system:
General Control
Boot Mode Detection
Memory Content Protection
Trap Generation
Die Temperature Measurement
Retention Memory Support
Power Control
Power Sequencing
EVR Control
Supply Watchdog
Voltage Monitoring
Power Validation
Power State Indication
Flash Power Control
Hibernate Control
Hibernate Mode Control
Wake-up from Hibernate Mode
Hibernate Domain Control
Reset Control
Reset assertion on various reset request sources
System Reset Generation
Inspection of Reset Sources After Reset
Selective Module reset
Clock Control
Bus Interface
SCU Register
Interface
Parity Error
Trap Request RTC
GCU RTC Module
Service Request Interface
NMI/IRQ
Retention Memory
EVR Module
PCU HCU Hibernate Control
I/O Control
Wake-up Triggers
XTAL1
each power related reset. Reset requests are coming to the unit from the watchdog, the
CPU and the test control unit. The RCU is providing the reset signals to all other units of
the chip in the Core power domain. The RCU related signals are described in more detail
in Chapter 11.5.
Interface of RTC
Access to the RTC module is served over shared serial interface identical to the one
used to access Hibernate domain registers, for detail please refer to Interface of
Hibernate Power Domain on Page 11-4. The RTC module functionality is described
in separate RTC chapter.
clear
to NMI request
combined output
Service
request
Request set raw request & 1
Event x 1 SRRAW.x
to IRQ request
combined output
The bus error generation applies to memories that can be accessed directly from the bus
system level. Apart from that, all memories, including those that are not accessible
directly and are internal to peripherals are capable of generating system traps resulting
in NMI. Parity trap requests get enabled with PETE register implementing individual
control for each memory. Parity error signalling with trap generation is not recommended
to be used for memories capable of bus error generation and therefore should be
disabled.
Parity error trap generation mechanism can be also used to generate system reset if
enabled with PERSTEN register in conjunction with the PETE register configuration. For
more details of the parity error generation scheme please refer to Figure 11-3.
RESET TRAP
REQUEST REQUEST
&
RESET
ENABLE
>1
& & & & & & & & & & & &
PETE.PEENDS2 PFLAG.PEFDS2
PETE.PEENDS1 PFLAG.PEFDS1
PETE.PEENPS PFLAG.PEFPS
PETE.PEENU2 PFLAG.PEFU2
PETE.PEENU1 PFLAG.PEFU1
PETE.PEENU0 PFLAG.PEFU0
PETE.PEENPPRF PFLAG.PEFPPRF
PETE.PEENUSB PFLAG.PEFUSB
PETE.PEENETH0TX PFLAG.PEFETH0TX
PETE.PEENETH0RX PFLAG.PEFETH0RX
PETE.PEENSD0 PFLAG.PEFSD0
PETE.PEENSD1 PFLAG.PEFSD1
Parity
Parity
Parity
Parity
Parity
Parity
Parity
Parity
Parity
Parity
Parity
Parity
error
error
error
error
error
error
error
error
error
error
error
error
SD MMC 0 RAM
SD MMC 1 RAM
ETH 0RX R AM
PMUPF R AM
U SB RAM
DSRAM1
DSRAM2
U0 RAM
U1 RAM
U2 RAM
PSR AM
PEEN.PEENETH 0RX
PEEN.PEENPPR F
PEEN.PEENUSB
PEEN.PEEN SD 1
PEEN.PEEN SD 0
PEEN.PEEN DS1
PEEN.PEEN DS2
PEEN.PEENU 0
PEEN.PEENU 1
PEEN.PEENU 2
PEEN.PEEN PS
clear
to NMI request
combined output
Trap request
Event x set raw request & 1
1 TRAPRAW.x
The Die Temperature Sensor (DTS) generates a measurement result that indicates
directly the current temperature. The result of the measurement is displayed via bit field
DTSSTAT.RESULT. In order to start one measurement bit DTSCON.START needs to
be set.
The DTS has to be enabled before it can be used via bit DTSCON.PWD. When the DTS
is powered temperature measurement can be started.
In order to adjust production variations of temperature measurement accuracy bit field
DTSCON.BGTRIM is provided. DTSCON.BGTRIM can be programmed by the user
software.
Measurement data is available certain time after measurement started. Register
DTSSTAT.RDY bit indicated that the DTS is ready to start a measurement. If a started
measurement is finished or still in progress is indicated via the status bit
DTSSTAT.BUSY.
The formula to calculate the die temperature is defined in the Target Data Sheet.
Note: The first measurement after the DTS was powered delivers a result without
calibration adjustment and should be ignored.
GCU
GxORCy
PORTS GxORCOUTy
+ORC To ERU
VAREF -
GxORCEN.ENORCy
Regulator (EVR). The safe voltage range of the core voltage is supervised by a power
validation circuit, which is part of the EVR.
Logic in the hibernate domain, mainly the real-time clock RTC, hibernate control and
retention memory, is supplied by an auxiliary power supply using an additional power
pad called. The auxiliary VBAT voltage, supplied from e.g. a coin battery, enables the RTC
to operate while the main supply is switched off.
Sleep
Wake-up Event
Hibernate Request
Wake-up Event
Hibernate
Active State
The Active state is the normal operation state. The system is fully powered. The CPU is
usually running from a high-speed clock. Depending on the application the system clock
might be slowed down. The PLL output clock or another clock can be selected as clock
source. Unused peripherals might be stopped. Stopping a peripheral means that the
peripheral i put into reset and the clock to this peripherals is disabled.
After a cold start the hibernate domain stays disabled until activated by user code.
Sleep State
The Sleep state of the system corresponds to the Sleep state of the CPU. The state is
entered via WFI or WFE instruction of the CPU. In this state the clock to the CPU is
stopped. The source of the system clock may be altered. Peripherals clocks are gated
according to the SLEEPCR register.
Peripherals can continue to operate unaffected and eventually generate an event to
wake-up the CPU. Any interrupt to the NVIC will bring the CPU back to operation. The
clock tree upon exit from SLEEP state is restored to what it was before entry into SLEEP
state.
Deep-Sleep State
The Deep-Sleep State is entered on the same mechanism as the Sleep state with the
addition that user code has enabled the Deep Sleep state in system control register. In
Deep-Sleep state the OSCHP and the PLL may be switched off. The wake-up logic in
the NVIC is still clocked by a free-running clock. Peripherals are only clocked when
configured to stay enabled in the DSLEEPCR register. Configuration of peripherals and
any SRAM content is preserved.
The Flash can be put into low-power mode to achieve a further power reduction. On
wake-up Flash will be restarted again before instructions or data access is possible.
Any interrupt will bring the system back to operation via the NVIC.The clock setup before
entering Deep Sleep state is restored upon wake-up.
Hibernate State
In Hibernate mode the power supply to the core is switched off. Additionally the power
to the analog domain and the main supply VDDP can be switched off. Only the Hibernate
power domain will stay powered. The power supply of the Hibernate domain is switched
automatically to the auxiliary supply when the main supply is no longer present.
The Hibernate State is entered using control register HDCR of HCU in the Hibernate
domain that will drive the external Voltage Regulator with HIBOUT signal to switch off
power to the chip (see System Level Power Control Example).
Depending on configuration the following wake-up sources will wake-up the system to
normal operation:
Edge detection on external WKUP signal
voltage
System Supply
3.3 V VDDP
VBAT
1.3 V VDDC
0V
time
voltage
System Supply
3.3 V VDDP
VBAT
1.3 V VDDC
time
voltage
System Supply
Battery insertion
3.3 V VDDP
VBAT
1.3 V VDDC
0V
time
voltage
VPOR
time
PORST
While the supply voltage is below VPOR the device is held in reset. As soon as the voltage
falls below VPOR a power on reset is triggered.
level. The supply voltage can be monitored also directly by software in register
EVRVADCSTAT. The threshold value and the inspection interval is configured at
PWRMON.
Hibernation Support
The entry of the hibernate state is configured via the register HDCR by setting of the HIB
bit. The HIBOUT bit in conjunction with selected HIBIOnPOL bit of HDCR register drives
HIB_IO_n pad.
The hibernation control signal HIBOUT is connected to an open-drain pad to enable
control of an external power regulator for VDDP.
OR
USB
supply
EVR core domain CPU
External Voltage
Buck 5V Regulator 3.3V
Converter irq alarm
IN OUT
12-48V
SPI
EN#
SHTDN
Hibernate hibernate VBAT 2V...VDDP
Control
LOW = ON domain
32kHz
OR RTC
Clock
WAKE
Retention
Memory
Battery or optional
capacitor Zener diode
Core
Domain
Isolation Isolation Isolation
Cell Cell Cell
X1D Hibernate
RTC_XTAL_1 Domain
fULP
HIB_IO_0
MUX
HIB_IO_0
HIBIO0SEL
HIB_SR0
MUX
GPI0SEL
HIBOUT
Hibernate
Control
WKUP
MUX
WKUP
WKUPSEL
HIB_IO_1
HIB_IO_1
MUX
HIBIO1SEL
in the pins may be swapped to ensure safe startup of the system (additional external pull-
up required on HIB_IO_1)
Table 11-3 shows an overview of the reset signals their source and effects on the
various parts of the system.
Core Domain
fPLLUSB fDMA
fOSCHP PLLUSB
XTAL1/CLKIN fOHP fPERIPH
OSCHP
XTAL2 fCCU
fPLL
PLL
fUSB
Clock
Generation fSDMMC
fSTDBY Backup fOFI Control
Clock fETH
Source
fEBU
fWDT
fEXT
EXTCLK
fRTC
Internal fOSI
Slow Clock
Source
fPLLUSB
fOSCHP PLLUSB
XTAL1/CLKIN fOHP
OSCHP
XTAL2
fOSC fPLL
PLL
The clock sources of the clock selection unit are the four clocks from the clock generation
unit, i.e. the USB clock fUSB, the PLL output clocks fPLL and a fast internal generated clock
fOFI.The clock selection unit receives as additional clocks source a slow standby clock
from the hibernate domain.
In Deep Sleep mode the system clocks can be switched to a clock which does not require
PLL and thereby allowing the power down of the system PLL. This is either the fast
internal clock or the slow standby clock. The DSLEEPCR register controls the clock
settings for Deep Sleep mode.
fPLL
fSYS fETH
SYSDIV ETHDIV
fOFI /n /2
fCCU
CCUDIV
/1/2
fCPU, fDMA
CPUDIV
/1/2
fPERIPH
PBDIV
/1/2
fUSBPLL
fUSB, fSDMMC
USBDIV
fPLL /n
fPLL fEBU
EBUDIV
/n
fSTDBY
fWDT
fOFI WDTDIV
/n
fPLL
Table 11-5 Valid values of clock divide registers for fCCU, fCPU and fPERIPH clocks
CCUCLKCR.CCUDIV CPUCLKCR.CPUDIV PBCLKCR.PBDIV
0 (120 MHz) 0 (120 MHz) 0 (120 MHz)
0 (120 MHz) 0 (120 MHz) 1 (60 MHz)
Table 11-5 Valid values of clock divide registers for fCCU, fCPU and fPERIPH clocks
CCUCLKCR.CCUDIV CPUCLKCR.CPUDIV PBCLKCR.PBDIV
0 (120 MHz) 1 (60 MHz) 0 (60 MHz)
1 (60 MHz) 0 (120 MHz) 1 (60 MHz)
1 (60 MHz) 1 (60 MHz) 0 (60 MHz)
The capture compare blocks CCU4, CCU8 and POSIF use as timer clock the clock fCCU
derived from system fSYS via CCUDIV clock divider. The clock divider allows to adjust
clock frequency of the timers with respect to the rest of the system. Relation between
fCCU clock and other clocks in the system is constrained as described in the Table 11-5.
The fCCU clock frequency must only be configured while all CAPCOM and POSIF
modules are not enabled.
fSYS
fFLASH
EXTCLK
fEXT
fUSB
fPLL ECKDIV
/n
XTAL1 fOSCHP
External
Clock Signal
OSC_HP fOHP
XTAL2
leave unconnected
VSS
Figure 11-17 External Clock Input Mode for the High-Precision Oscillator
External Crystal Mode
For the external crystal mode an external oscillator load circuitry is required. The circuitry
must be connected to both pins, XTAL1 and XTAL2. It consists normally of the two load
capacitances C1 and C2. For some crystals a series damping resistor might be
necessary. The exact values and related operating range depend on the crystal and
have to be determined and optimized together with the crystal vendor using the negative
resistance method.
Fundamental Mode
Crystal
XTAL1 fOSCHP
OSC_HP fOHP
XTAL2
C1 C2
VSS
Figure 11-18 External Crystal Mode Circuitry for the High-Precision Oscillator
source during normal operation. While in prescaler mode this clock is automatically used
as emergency clock if the external clock failure is detected.
Clock adjustment is required to reach desired level of fOFI precision. The backup clock
source provides two adjustment procedures:
loading of adjustment value during start-up
continuos adjustment using the high-precision fSTDBY clock as reference
11.6.6.1 Features
and accordingly controls the frequency of the VCO (fVCO). A PLL lock detection unit
monitors and signals this condition. The phase detection logic continues to monitor the
two clocks and adjusts the VCO clock if required.
The following figure shows the PLL block structure.
The PLL clock fPLL is generated in emergency from one of two sources:
Free running VCO if Emergency entered from Normal Mode of PLL
Backup Clock if emergency entered from Prescaler Mode of PLL
The maximum frequency in normal mode is 520 MHz corresponding to the maximum
supported VCO frequency.
PLLSTAT.FINDIS
1
0 M
fP f REF U fPLL
P-
f OSC f VCO K2-
0 X
Divider VCO
Divider f K2
Lock
N-
Detect.
Osc. fDIV Divider PLLCON0.
WDG VCOBYP
PLL Block
f K1
K1-
f OSC 1
Divider M
U f PLL
0 X
Osc.
WDG
OSCCON.PLLLV PLLCON0.
VCOBYP
OSCCON.PLLHV PLL Block
Depending on the selected divider value of the K1-Divider the duty cycle of the clock is
selected. This can have an impact for the operation with an external communication
interface. The duty cycles values for the different K1-divider values are defined in the
Data Sheet.
The Prescaler Mode is requested from the Normal Mode by setting bit
PLLCON.VCOBYP. The Prescaler Mode is entered when the status bit
PLLSTAT.VCOBYST is set. Before the Prescaler Mode is requested the K1-Divider
should be configured with a value generating a PLL output frequency fPLL that matches
the one generated by the Normal Mode as much as possible. In this way the frequency
change resulting out of the mode change is reduced to a minimum.
The Prescaler Mode is requested to be left by clearing bit PLLCON.VCOBYP. The
Prescaler Mode is left when the status bit PLLSTAT.VCOBYST is cleared.
f PLL = f OSC
f
f
OSC
= -----------------------------------
OSCREF OSCVAL + 1
Note: fOSCREF has to be within the range of 2 MHz to 3 MHz and should be as close as
possible to 2.5 MHz.
The monitored frequency is too low if it is below 1.25 MHz and too high if it is above
7.5 MHz. This leads to the following two conditions:
Too low: fOSC < 1.25 MHz (OSCHPCTRL.OSCVAL+1)
Too high: fOSC > 7.5 MHz (OSCHPCTRL.OSCVAL+1)
Before configuring the OSC_WDG function all the trap options should be disabled in
order to avoid unintended traps. Thereafter the value of OSCHPCTRL.OSCVAL can be
changed. Then the OSC_WDG should be reset by setting PLLCON0.OSCVAL. This
requests the start of OSC_WDG monitoring with the new configuration. When the
expected positive monitoring results of PLLSAT.PLLLV and / or PLLSAT.PLLHV are set
the input frequency is within the expected range. As setting PLLCON0.OSCVAL clears
all three bits PLLSAT.PLLSP, PLLSAT.PLLLV, and PLLSAT.PLLHV all three trap status
flags will be set. Therefore all three flags should be cleared before the trap generation is
enabled again. The trap disabling-clearing-enabling sequence should also be used if
only bit PLLCON0.OSCVAL is set without any modification of OSCHPCTRL.OSCVAL.
PLLSTAT.FINDIS
0
fP f REF
fOSCHP P-
f VCO
Divider VCO fPLLUSB
Lock
N-
Detect.
f DIV Divider
USBPLL Block
Table 11-6 USB support and N Divider Values for crystal frequencies
Crystal frequency [MHz] N Divider Value
4 24
6 16
8 12
12 8
16 6
The USB PLL is put automatically in power-down by the USB suspend signal, when the
clock is not used for SD/MMC operation.
Note: Reconfiguration of the P-Divider before USB-PLL has locked must be avoided.
Power domains:
Power domains get separated with appropriate power separation cells.
Core domain supplied with VDDC voltage
Clock domains:
All cross-domain interfaces implement signal synchronization.
internal SCU clock is fSYS always identical to the CPU clock and selectable within
SCU
HCU, RTC and register mirror interface clock is 32.786 kHz clock generated in
hibernate domain
Reset domains:
All resets get internally synchronized to respective clocks.
System Reset (SYSRESETn) resets most of the logic in SCU and can be triggered
from various sources (please refer to Reset Control chapter for more details)
Power-on Reset (PORESETn) resets directly a few registers and contributes in
generation of the System Reset an gets triggered upon power-up sequence of the
Core domain
Standby Reset (STDBYRESETn) resets HCU part of SCU, get triggered by power-
up sequence of Hibernate domain and is not affected by power-up sequence of the
Core domain
Debug Reset (DBGRESETn) is used in various debug or test related scenarios
(please refer to Reset Control chapter for more details)
Initialization
The system initialization requires that all required clocks are enabled and the relevant
modules get released from reset state. After system reset release a number of modules
clocked with fPERIPH still remain in reset state. Reset release of those modules is
controlled with PRCLR0, PRCLR1, PRCLR2 and PRCLR3.
The system relevant clocks are configured with the dedicated registers SYSCLKCR,
CPUCLKCR and PBCLKCR. Some modules require explicit clock enable with CLKSET
register. For details please refer to Reset Control on Page 11-22
After reset release the system is clocked with a clock derived from the Backup Clock
source. If a PLL output clock is required as the system clock source then it is necessary
to initialize the respective PLL with a software routine. For details please refer to PLL
section in Main PLL on Page 11-34.
Auxiliary functionality of the system control, like Memory Parity, Die Temperature
Sensor, Out of Range Comparators for analog inputs can be activated with the registers
defined in GCU section of the GCU Registers on Page 11-50
The Watchdog Timer requires the activation of an independent clock. For more details
please refer to WDT chapter.
Hibernate Control logic and the RTC module needs to be activated with PWRSET
register before it can be used. This initialization has to be performed only once if the VBAT
is newly applied and it stays enabled until VBAT is removed. After power off of the chips
the hibernate domain will remain intact while VBAT is still supplied. For details of hibernate
control please refer to Hibernate Control on Page 11-19. For details of RTC module
control please refer o RTC chapter.
11.10 Registers
This section describes the registers of SCU. Most of the registers are reset SYSRESETn
reset signal but some of the registers can be reset only with PORST reset.
HCU Registers
HDSTAT Hibernate Domain Status 0000H U, PV PV Page 11-101
Register
HDCLR Hibernate Domain Status 0004H U, PV PV Page 11-102
Clear Register
HDSET Hibernate Domain Status 0008H U, PV PV Page 11-103
Set Register
HDCR Hibernate Domain 000CH U, PV PV Page 11-104
Control Register
OSCSICTRL Internal 32 kHz Clock 0014H U, PV PV Page 11-107
Source Control Register
OSCULSTAT OSCULP Status Register 0018H U, PV BE Page 11-107
OSCULCTRL OSCULP Control 001CH U, PV PV Page 11-108
Register
RCU Registers
RSTSTAT System Reset Status 0000H U, PV BE Page 11-109
RSTSET Reset Set Register 0004H nBE PV Page 11-110
RSTCLR Reset Clear Register 0008H nBE PV Page 11-111
PRSTAT0 Peripheral Reset Status 000CH U, PV PV Page 11-112
Register 0
PRSET0 Peripheral Reset Set 0010H nBE PV Page 11-114
Register 0
PRCLR0 Peripheral Reset Clear 0014H nBE PV Page 11-116
Register 0
PRSTAT1 Peripheral Reset Status 0018H U, PV BE Page 11-117
Register 1
PRSET1 Peripheral Reset Set 001CH nBE PV Page 11-119
Register 1
PRCLR1 Peripheral Reset Clear 0020H nBE PV Page 11-120
Register 1
PRSTAT2 Peripheral Reset Status 0024H U, PV BE Page 11-121
Register 2
ID
Register containing unique ID of the module.
ID
SCU Module ID Register (0000H) Reset Value: 00A0 C0XXH
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
r r r
IDCHIP
Register containing unique ID of the chip.
IDCHIP
Chip ID Register (0004H) Reset Value: XXXX XXXXH
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
IDCHIP
IDMANUF
Register containing unique manufactory ID of the chip.
IDMANUF
Manufactory ID Register (0008H) Reset Value: 0000 1820H
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
MANUF DEPT
r r
STCON
Startup configuration register determining boot process of the chip.
STCON
Startup Configuration Register (0010H) Reset Value: 0000 0000H
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
0 SWCON 0 HWCON
r rw r rh
GPRx
Software support registers. Can be reset only with PORST reset.
GPRx (x=0-1)
General Purpose Register x (002CH+ x*4) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DAT
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DAT
rw
ETH0_CON
ETH0 module configuration register.
ETH0_CON
Ethernet 0 Port Control Register (50004040H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
INFS
0 0 MDIO 0 CLK_TX COL
EL
r rw r rw r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw rw rw rw rw
CCUCON
CAPCOM module control register. Individual signals signal is generated with fCCU clock.
CCUCON
CCU Control Register (004CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0
r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
GSC GSC GSC GSC GSC GSC
0 0
81 80 43 42 41 40
r rw rw r rw rw rw rw
SRSTAT
Service request status reflecting masking with SRMSK mask register. Write one to a bit
in SRCLR register to clear a bit or SRSET to set a bit. Writing zero has no effect. Outputs
of this register are used to trigger interrupts or service requests.
SRSTAT
SCU Service Request Status (0074H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RTC RTC RTC RTC RTC OSC OSC OSC
HDC HDS HDC HDS
0 RMX _TIM _TIM _ATI _ATI _CT ULC ULS SICT 0
R ET LR TAT
1 0 M1 M0 R TRL TAT RL
r rh rh rh rh rh rh rh rh rh r rh rh rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DLR PRW
0 0 0 AI PI
OVR ARN
r r r rh rh rh rh
SRRAW
Service request status without masking. Write one to a bit in SRCLR register to clear a
bit or SRSET to set a bit. Writing zero has no effect.
SRRAW
SCU Raw Service Request Status (0078H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RTC RTC RTC RTC RTC OSC OSC OSC
HDC HDS HDC HDS
0 RMX _TIM _TIM _ATI _ATI _CT ULC ULS SICT 0
R ET LR TAT
1 0 M1 M0 R TRL TAT RL
r rh rh rh rh rh rh rh rh rh r rh rh rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DLR PRW
0 0 0 AI PI
OVR ARN
r r r rh rh rh rh
SRMSK
Service request mask used to mask outputs of SRRAW register outputs connected to
SRSTAT register.
SRMSK
SCU Service Request Mask (007CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RTC RTC RTC RTC RTC OSC OSC OSC
HDC HDS HDC HDS
0 RMX _TIM _TIM _ATI _ATI _CT ULC ULS SICT 0
R ET LR TAT
1 0 M1 M0 R TRL TAT RL
r rw rw rw rw rw rw rw rw rw r rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DLR PRW
0 0 0 AI PI
OVR ARN
r r r rw rw rw rw
SRCLR
Clear service request bits of registers SRRAW and SRSTAT. Write one to clear
corresponding bits. Writing zeros has no effect.
SRCLR
SCU Service Request Clear (0080H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RTC RTC RTC RTC RTC OSC OSC OSC
HDC HDS HDC HDS
0 RMX _TIM _TIM _ATI _ATI _CT ULC ULS SICT 0
R ET LR TAT
1 0 M1 M0 R TRL TAT RL
r w w w w w w w w w r w w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DLR PRW
0 0 0 AI PI
OVR ARN
r r r w w w w
SRSET
Set service request fits of registers SRRAW and SRSTAT. Write one to clear
corresponding bits. Writing zeros has no effect.
SRSET
SCU Service Request Set (0084H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RTC RTC RTC RTC RTC OSC OSC OSC HDC HDC
HDC HDS
0 RMX _TIM _TIM _ATI _ATI _CT ULC ULS SICT 0 RSE RCL
R TAT
1 0 M1 M0 R TRL TAT RL T R
r w w w w w w w w w r w w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DLR PRW
0 0 0 AI PI
OVR ARN
r r r w w w w
NMIREQEN
The NMIREQEN register serves purpose of promoting service requests to NMI requests.
Is a bit is set then corresponding service request reflected in SRSTAT otherwise will be
mirrored in the TRAPSTAT register instead.
NMIREQEN
SCU Service Request Mask (0088H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ERU ERU ERU ERU
0
03 02 01 00
r rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PRW
0 AI PI
ARN
r rw rw rw
DTSCON
Die temperature sensor control register
DTSCON
Die Temperature Sensor Control Register (008CH) Reset Value: 0000 0001H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
GAI
0 BGTRIM REFTRIM
N
r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
STA
GAIN OFFSET 0 PWD
RT
rw rw r w rw
DTSSTAT
Die temperature status register
DTSSTAT
Die Temperature Sensor Status Register (0090H) Reset Value: 0000 0000H
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
BUS
RDY 0 RESULT
Y
rh rh r rh
SDMMCDEL
Delay control register for SD-MMC module.
SDMMCDEL
SD-MMC Delay Control Register (009CH) Reset Value: 0000 0000H
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
TAP
0 TAPDEL 0
EN
r rw r rw
G0ORCEN
Enable register for out-of-range comparators of group 0 of analog input channels.
G0ORCEN
Out of Range Comparator Enable Register 0 (00A0H) Reset Value: 0000 0000H
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
ENO ENO
0 0
RC7 RC6
r rw rw r
G1ORCEN
Enable register for out-of-range comparators of group 1 of analog input channels.
G1ORCEN
Out of Range Comparator Enable Register 1 (00A4H) Reset Value: 0000 0000H
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
ENO ENO
0 0
RC7 RC6
r rw rw r
MIRRSTS
Mirror status register for control of communication between SCU and other modules in
hibernate domain.
MIRRSTS
Mirror Update Status Register (00C4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RTC RTC RTC RTC RTC OSC OSC OSC
HDC HDS HDC HDS
0 RMX _TIM _TIM _ATI _ATI _CT ULC ULS SICT 0
R ET LR TAT
1 0 M1 M0 R TRL TAT RL
r rh rh rh rh rh rh rh rh rh r rh rh rh rh
RMACR
Access control to retention memory in hibernate domain.
RMACR
Retention Memory Access Control Register (00C8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 ADDR
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RDW
0
R
r rw
RMDATA
Access data of retention memory in hibernate domain.
RMDATA
Retention Memory Access Data Register (00CCH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DATA
rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DATA
rwh
PEEN
The following register enables parity check mechanism on peripheral modules.
PEEN
Parity Error Enable Register (013CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PEE PEE
PEE PEE PEE
NET NET
0 NSD NSD NUS
H0R H0T
1 0 B
X X
r rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PEE PEE PEE
PEE PEE PEE PEE PEE
0 NPP 0 0 NDS NDS
NMC NU2 NU1 NU0 NPS
RF 2 1
r rw rw r rw rw rw r rw rw rw
MCHKCON
The following register enables the functional parity check mechanism for testing
purpose. MCHKCON register is used to support access to parity bits of SRAM modules
for various types of peripherals. The SRAM modules providing direct access natively
need to be selected in order to enable direct write to parity bits using PMTPR register.
MCHKCON
Memory Checking Control Register (0140H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SEL SEL
SEL SEL SEL
0 ETH ETH
SD1 SD0 USB
0RX 0TX
r rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PPR MCA USIC USIC USIC
SEL SEL SEL
0 FDR NDR 0 2DR 1DR 0DR 0
DS2 DS1 PS
A A A A A
r rw rw r rw rw rw r rw rw rw
PETE
The following register enables the functional parity error trap generation mechanism.
The trap flag gets reflected in TRAPRAW register and needs to be enabled with
TRAPDIS register before can be effectively used to generate an NMI. The same tap flag
can be configured with PERSTEN register to generate system reset instead of an NMI.
PETE
Parity Error Trap Enable Register (0144H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PET PET
PET PET PET
EET EET
0 ESD ESD EUS
H0R H0T
1 0 B
X X
r rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PET PET PET
PET PET PET PET PET
0 EPP 0 0 EDS EDS
EMC EU2 EU1 EU0 EPS
RF 2 1
r rw rw r rw rw rw r rw rw rw
PERSTEN
The following register enables reset upon parity error flag from the functional parity
check mechanism indicated in PEFLAG register.
PERSTEN
Parity Error Reset Enable Register (0148H) Reset Value: 0000 0000H
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
RSE
0
N
r rw
PEFLAG
The PEFLAG register controls the functional parity check mechanism.
The register bits can only get set by corresponding parity error assertion if enabled and
can only be cleared via software. Writing a zero to this bit does not change the content.
Writing a one to this bit does clear the bit.
PEFLAG
Parity Error Flag Register (0150H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PEE PEE
PES PES PEU
0 TH0 TH0
D1 D0 SB
RX TX
r rwh rwh rwh rwh rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PEF
PEF PEF PEF PEF PEF PEF PEF
0 PPR 0 0
MC U2 U1 U0 DS2 DS1 PS
F
r rwh rwh r rwh rwh rwh r rwh rwh rwh
PMTPR
The following register provides direct access to parity bits of a selected module.
The width and therefore the valid bits in register PMTPR is listed in Table 11-10.
PMTPR
Parity Memory Test Pattern Register (0154H) Reset Value: 0000 0000H
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
PRD PWR
rh rw
PMTSR
This register selects parity test output from a memory instance that will be reflected in
PRD bit field of PMTPR register.
Note: Only one bit shall be set at the same time in register PMTPR. Otherwise the result
of the parity software test is unpredictable.
PMTSR
Parity Memory Test Select Register (0158H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MTE MTE
MTS MTS MTU
0 TH0 TH0
D1 D0 SB
RX TX
r rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MTE MTE MTE
MTE MTE MTE MTE MTE
0 PPR 0 0 NDS NDS
MC U2 U1 U0 NPS
F 2 1
r rwh rwh r rwh rwh rwh r rw rw rw
TRAPSTAT
This register contains the status flags for all trap request trigger sources of the SCU.
A trap flag is set when a corresponding emergency event occurs. Trap mechanism
supports testing and debug of these status bits by software using registers TRAPSET
and TRAPCLR. This register reflects masking with TRAPDIS register.
TRAPSTAT
Trap Status Register (0160H) Reset Value: 0000 0000H
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
BWE BWE ULP UVC SVC SOS
BRW
0 0 0 0 RR1 RR0 WDG PET OLC OLC 0 CWD
NT
T T T KT KT GT
r r r r rh rh rh rh rh rh rh r rh
TRAPRAW
This register contains the status flags for all trap request trigger sources of the SCU
before masking with TRAPDIS.
A trap flag is set when a corresponding emergency event occurs. For setting and
clearing of these status bits by software see registers TRAPSET and TRAPCLR,
respectively.
TRAPRAW
Trap Raw Status Register (0164H) Reset Value: 0000 0000H
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
BWE BWE ULP UVC SVC SOS
BRW
0 0 0 0 RR1 RR0 WDG PET OLC OLC 0 CWD
NT
T T T KT KT GT
r r r r rh rh rh rh rh rh rh r rh
TRAPDIS
Disable corresponding traps.
TRAPDIS
Trap Disable Register (0168H) Reset Value: 0000 01FFH
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
BWE BWE ULP UVC SVC SOS
BRW
0 0 0 0 RR1 RR0 WDG PET OLC OLC 0 CWD
NT
T T T KT KT GT
r r r r rw rw rw rw rw rw rw r rw
TRAPCLR
This register contains the software clear control for the trap status flags in register
TRAPRAW and TRAPSTAT.
TRAPCLR
Trap Clear Register (016CH) Reset Value: 0000 0000H
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
BWE BWE ULP UVC SVC SOS
BRW
0 0 0 0 RR1 RR0 WDG PET OLC OLC 0 CWD
NT
T T T KT KT GT
r r r r w w w w w w w r w
TRAPSET
This register contains the software set control for the trap status flags in register
TRAPRAW.
TRAPSET
Trap Set Register (0170H) Reset Value: 0000 0000H
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
BWE BWE UVC SVC SOS
ULP BRW
0 0 0 0 RR1 RR0 PET OLC OLC 0 CWD
WDT NT
T T KT KT GT
r r r r w w w w w w w r w
PWRSTAT
Power status register.
PWRSTAT
PCU Status Register (0200H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
USB USB USB
0 PUW OTG PHY
Q EN PDQ
r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HIBE
0 0
N
r r r
PWRSET
Power control register. Write one to set, writing zeros have no effect.
PWRSET
PCU Set Control Register (0204H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
USB USB USB
0 PUW OTG PHY
Q EN PDQ
r w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 HIB
r w
PWRCLR
Power control register. Write one to clear, writing zeros have no effect.
PWRCLR
PCU Clear Control Register (0208H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
USB USB USB
0 PUW OTG PHY
Q EN PDQ
r w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 HIB
r w
EVRSTAT
EVR status register.
EVRSTAT
EVR Status Register (0210H) Reset Value: 0000 0000H
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
OV1
0 0
3
r rh r
EVRVADCSTAT
Supply voltage monitor register.
EVRVADCSTAT
EVR VADC Status Register (0214H) Reset Value: 0000 0000H
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
VADC33V VADC13V
rh rh
PWRMON
Power monitoring control register for brown-out detection.
PWRMON
Power Monitor Control (022CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 ENB
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
INTV THRS
rw rw
HDSTAT
Hibernate domain status register
HDSTAT
Hibernate Domain Status Register (0300H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HIBN ULP RTC ENE EPE
0 0 0
OUT WDG EV V V
r r r rh rh rh rh rh
HDCLR
Hibernate domain clear status register. Write one to clear, writing zeros has no effect.
HDCLR
Hibernate Domain Status Clear Register (0304H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ULP RTC ENE EPE
0 0 0
WDG EV V V
r r r w w w w
HDSET
Hibernate domain set status register. Write one to set, writing zeros has no effect.
HDSET
Hibernate Domain Status Set Register (0308H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ULP RTC ENE EPE
0 0 0
WDG EV V V
r r r w w w w
HDCR
Hibernate domain configuration register.
HDCR
Hibernate Domain Control Register (030CH) Reset Value: 000C 2000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 HIBIO1SEL HIBIO0SEL
r r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HIBI HIBI WKU STD ULP
GPI0 RTC WKP WKP
0 O1P O0P 0 0 PSE BYS RCS 0 HIB WDG
SEL E EN EP
OL OL L EL EN
r rw rw r rw r rw rw rw r rwh rw rw rw rw
[31:30]
OSCSICTRL
Control register for fOSI clock source. A special mechanism keeps the fOSI clock active if
the external crystal oscillator is switched off, regardless of the value of the PWD bit field.
The fOSI can be switched off only if the external crystal oscillator is enabled and the fULP
clock toggling.
OSCSICTRL
fOSI Control Register (0314H) Reset Value: 0000 0001H
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
0 PWD
r rw
OSCULSTAT
Status register of the OSCULP oscillator.
OSCULSTAT
OSCULP Status Register (0318H) Reset Value: 0000 0000H
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
0 X1D
r rh
OSCULCTRL
Control register for OSCULP oscillator. This register allows selection of clock generation
with external crystal, direct clock input, or power down mode. Alternate GPI function of
the pin is also controlled with this register.
OSCULCTRL
OSCULP Control Register (031CH) Reset Value: 0000 0020H
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
X1D
0 MODE 0
EN
r rw r rw
RSTSTAT
Reset status register. This register needs to be checked after system startup in order to
determine last reset reason.
RSTSTAT
RCU Reset Status (0400H) Reset Value: 0000 0000H
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
LCK HIBR HIB
0 0 RSTSTAT
EN S WK
r r r r rh rh
RSTSET
Selective configuration of reset behavior in the system. Write one to set selected bit,
writing zeros has no effect.
RSTSET
RCU Reset Set Register (0404H) Reset Value: 0000 0000H
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
LCK HIBR HIB
0 0
EN S WK
r w w w r
RSTCLR
Selective configuration of reset behavior in the system. Write one to clear selected bit,
writing zeros has no effect.
RSTCLR
RCU Reset Clear Register (0408H) Reset Value: 0000 0000H
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
LCK HIBR HIB RSC
0 0
EN S WK LR
r w w w r w
PRSTAT0
Selective reset status register for peripherals for Peripherals 0.
PRSTAT0
RCU Peripheral 0 Reset Status (040CH) Reset Value: 0001 0F9FH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ERU
0 0 0
1RS
r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
POSI POSI CCU CCU CCU CCU CCU
USIC DSD VAD
0 F1R F0R 81R 80R 0 42R 41R 40R
0RS RS CRS
S S S S S S S
r r r r r r r r r r r r
PRSET0
Selective reset assert register for peripherals for Peripherals 0. Write one to assert
selected reset, writing zeros has no effect.
PRSET0
RCU Peripheral 0 Reset Set (0410H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ERU
0 0 0
1RS
r r r w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
POSI POSI CCU CCU CCU CCU CCU
USIC DSD VAD
0 F1R F0R 81R 80R 0 42R 41R 40R
0RS RS CRS
S S S S S S S
r w w w w w r w w w w w
PRCLR0
Selective reset de-assert register for peripherals for Peripherals 0. Write one to de-assert
selected reset, writing zeros has no effect.
PRCLR0
RCU Peripheral 0 Reset Clear (0414H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ERU
0 0 0
1RS
r r r w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
POSI POSI CCU CCU CCU CCU CCU
USIC DSD VAD
0 F1R F0R 81R 80R 0 42R 41R 40R
0RS RS CRS
S S S S S S S
r w w w w w r w w w w w
PRSTAT1
Selective reset status register for peripherals for Peripherals 1.
PRSTAT1
RCU Peripheral 1 Reset Status (0418H) Reset Value: 0000 01F9H
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
LED
PPO MCA CCU
USIC USIC MMC DAC TSC
0 RTS N0R 0 43R
2RS 1RS IRS RS U0R
RS S S
S
r r r r r r r r r r
[31:10]
PRSET1
Selective reset assert register for peripherals for Peripherals 1. Write one to assert
selected reset, writing zeros has no effect.
PRSET1
RCU Peripheral 1 Reset Set (041CH) Reset Value: 0000 0000H
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
LED
PPO MCA CCU
USIC USIC MMC DAC TSC
0 RTS N0R 0 43R
2RS 1RS IRS RS U0R
RS S S
S
r w w w w w w w r w
PRCLR1
Selective reset de-assert register for peripherals for Peripherals 1. Write one to de-assert
selected reset, writing zeros has no effect.
PRCLR1
RCU Peripheral 1 Reset Clear (0420H) Reset Value: 0000 0000H
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
LED
PPO MCA CCU
USIC USIC MMC DAC TSC
0 RTS N0R 0 43R
2RS 1RS IRS RS U0R
RS S S
S
r w w w w w w w r w
PRSTAT2
Selective reset status register for peripherals for Peripherals 2.
PRSTAT2
RCU Peripheral 2 Reset Status (0424H) Reset Value: 0000 00F6H
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
USB FCE DMA DMA ETH WDT
0 0 0
RS RS 1RS 0RS 0RS RS
r r r r r r r r r
PRSET2
Selective reset assert register for peripherals for Peripherals 2. Write one to assert
selected reset, writing zeros has no effect.
PRSET2
RCU Peripheral 2 Reset Set (0428H) Reset Value: 0000 0000H
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
USB FCE DMA DMA ETH WDT
0 0 0
RS RS 1RS 0RS 0RS RS
r w w w w r w w r
3,
[31:8]
PRCLR2
Selective reset de-assert register for peripherals for Peripherals 2. Write one to de-assert
selected reset, writing zeros has no effect.
PRCLR2
RCU Peripheral 2 Reset Clear (042CH) Reset Value: 0000 0000H
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
USB FCE DMA DMA ETH WDT
0 0 0
RS RS 1RS 0RS 0RS RS
r w w w w r w w r
[31:8]
PRSTAT3
Selective reset status register for peripherals for Peripherals 3.
Note: Reset release must be effectively prevented for unless module clock is gated or
off in cases where kernel clock and bus interface clocks are shared, in order to
avoid system hang-ups.
PRSTAT3
RCU Peripheral 3 Reset Status (0430H) Reset Value: 0000 0004H
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
0 EBU 0
r r r
PRSET3
Selective reset assert register for peripherals for Peripherals 3. Write one to assert
selected reset, writing zeros has no effect.
PRSET3
RCU Peripheral 3 Reset Set (0434H) Reset Value: 0000 0000H
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
0 EBU 0
r w r
PRCLR3
Selective reset de-assert register for peripherals for Peripherals 3. Write one to de-assert
selected reset, writing zeros has no effect.
PRCLR3
RCU Peripheral 3 Reset Clear (0438H) Reset Value: 0000 0000H
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
0 EBU 0
r w r
CLKSTAT
Global clock status register.
CLKSTAT
Clock Status Register (0600H) Reset Value: 0000 0000H
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
ETH
WDT CCU EBU MMC USB
0 0CS
CST CST CST CST CST
T
r r r r r r r
CLKSET
Global clock enable register. Write one to enable selected clock, writing zeros has no
effect.
CLKSET
CLK Set Register (0604H) Reset Value: 0000 0000H
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
ETH
WDT CCU EBU MMC USB
0 0CE
CEN CEN CEN CEN CEN
N
r w w w w w w
CLKCLR
Global clock disable register. Write one to disable selected clock, writing zeros has no
effect.
CLKCLR
CLK Clear Register (0608H) Reset Value: 0000 0000H
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
WDT CCU EBU ETH MMC USB
0
CDI CDI CDI 0CDI CDI CDI
r w w w w w w
SYSCLKCR
System clock control register.
SYSCLKCR
System Clock Control Register (060CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SYS
0
SEL
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 SYSDIV
r rw
CPUCLKCR
CPU clock control register.
CPUCLKCR
CPU Clock Control Register (0610H) Reset Value: 0000 0000H
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
CPU
0
DIV
r rw
PBCLKCR
Peripheral clock control register.
PBCLKCR
Peripheral Bus Clock Control Register (0614H) Reset Value: 0000 0000H
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
PBDI
0
V
r rw
USBCLKCR
USB clock control register.
USBCLKCR
USB Clock Control Register (0618H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
USB
0
SEL
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 USBDIV
r rw
EBUCLKCR
EBU clock control register.
EBUCLKCR
EBU Clock Control Register (061CH) Reset Value: 0000 0000H
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
0 EBUDIV
r rw
CCUCLKCR
CCUx clock control register.
CCUCLKCR
CCU Clock Control Register (0620H) Reset Value: 0000 0000H
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
CCU
0
DIV
r rw
WDTCLKCR
System watchdog (WDT) clock control register.
WDTCLKCR
WDT Clock Control Register (0624H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 WDTSEL
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 WDTDIV
r rw
EXTCLKCR
External clock control register. Use this register to select output clock.
EXTCLKCR
External Clock Control (0628H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 ECKDIV
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 ECKSEL
rw rw
SLEEPCR
Configuration register that defines some system behavior aspects while in sleep mode.
The original system state gets restored upon wake-up from sleep mode.
SLEEPCR
Sleep Control Register (0630H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WDT CCU EBU ETH MMC USB
0
CR CR CR 0CR CR CR
r rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SYS
0 0
SEL
r r rwh
DSLEEPCR
Configuration register that defines some system behavior aspects while in deep-sleep
mode. The original system state gets restored upon wake-up from sleep mode except
for PLL re-start if enabled before entering deep-sleep mode and configured to go into
power down while in deep-sleep mode.
DSLEEPCR
Deep Sleep Control Register (0634H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WDT CCU EBU ETH MMC USB
0
CR CR CR 0CR CR CR
r rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VCO PLL FPD
0 0 SYSSEL
PDN PDN N
r rw rw rw r rwh
OSCHPSTAT
Status register of the OSCHP oscillator.
OSCHPSTAT
OSCHP Status Register (0700H) Reset Value: 0000 0000H
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
0 X1D
r rh
OSCHPCTRL
Control register of the OSCHP oscillator.
OSCHPCTRL
OSCHP Control Register (0704H) Reset Value: 0000 003CH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 OSCVAL
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SHB X1D
0 MODE 0 0
Y EN
r rw r r rwh rw
PLLSTAT
System PLL Status register.
PLLSTAT
PLL Status Register (0710H) Reset Value: 0000 0002H
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
VCO PWD VCO
PLL PLL PLL K2R K1R
0 BY 0 LOC STA BYS
SP HV LV DY DY
K T T
r rh rh rh rh rh rh r rh rh rh
PLLCON0
System PLL configuration register 0.
PLLCON0
PLL Configuration 0 Register (0714H) Reset Value: 0003 0003H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RES OSC PLL
0
LD RES PWD
r w rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OSC
FIND VCO VCO VCO
0 DISC 0 0
IS TR PWD BYP
DIS
r rw r rwh r rw rw rw
PLLCON1
System PLL configuration register 1.
PLLCON1
PLL Configuration 1 Register (0718H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 PDIV 0 K2DIV
r rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 NDIV 0 K1DIV
r rw r rw
PLLCON2
System PLL configuration register 2.
PLLCON2
PLL Configuration 2 Register (071CH) Reset Value: 0000 0001H
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
K1IN PINS
0 0
SEL EL
r rw r rw
USBPLLSTAT
USB PLL Status register.
USBPLLSTAT
USB PLL Status Register (0720H) Reset Value: 0000 0002H
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
VCO VCO PWD VCO
0 LOC BY 0 0 LOC STA BYS
KED K T T
r rh rh r r rh rh rh
USBPLLCON
USB PLL configuration register 0.
USBPLLCON
USB PLL Configuration Register (0724H) Reset Value: 0001 0003H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RES PLL
0 PDIV 0 0
LD PWD
r rw r w r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OSC
FIND VCO VCO VCO
0 NDIV 0 DISC 0 0
IS TR PWD BYP
DIS
r rw r rw r rwh r rw rw rw
CLKMXSTAT
Clock Multiplexer Switching Status
This register shows status of clock multiplexing upon switching from one clock source to
another. This register should be checked before disabling any of the multiplexer input
clock sources after switching. Bits of this registers indicate which of the corresponding
input clocks must not be switched off under any circumstances until indicated as inactive.
The clocks sources that are indicated as active are still contributing in driving the output
clock from respective multiplexer. This is a side effect of glitch-free clock switching
mechanism.
CLKMXSTAT
Clock Multiplexing Status Register (0738H) Reset Value: 0000 0000H
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
SYSCLKM
0
UX
r rh
11.11 Interconnects
The system control unit SCU is connected towards the system via bus interface. The bus
interface provides register access for monitoring and controlling operation of all sub-
modules of the SCU.
A number of signals connected to the submodules os SCU allow monitoring and control
of various aspects of the system. The following tables provide logical grouping of
different signals vital for the SCU module operation.
Communication Peripherals
Communication Peripherals
12.1 Overview
The LEDTS can measure the capacitance of up to 8 touch pads using the relaxation
oscillator (RO) topology. The pad capacitance is measured by generating oscillations on
the pad for a fixed time period and counting them. The module can also drive up to 64
LEDs in an LED matrix. Touch pads and LEDs can share pins to minimize the number
of pins needed for such applications. This configuration is realized by the module
controlling the touch pads and driving the LEDs in a time-division multiplexed manner.
The LEDs in the LED matrix are organized into columns and lines. Every line can be
shared between up to 8 LEDs and one touch pad. Certain functions such as column
enabling, function selection and control are controlled by hardware. Application software
is required to update the LED lines and evaluate the touch pad measurement results.
12.1.1 Features
For the LED driving function, LEDTS provides features:
Selection of up to 8 LED columns; Up to 7 LED columns if touch-sense function is
also enabled
Configurable active time in LED columns to control LED brightness
Possibility to drive up to 8 LEDs per column, common-anode or common-cathode
Shadow activation of line pattern for LED column time slice; LED line patterns are
updated synchronously to column activation
Configurable interrupt enable on selected event
Line and column pins controlled by PORTS SFR setting
For the touch-sensing function, LEDTS provides features:
Up to 8 touch-sense input turns
Only one pad can be measured at any time; selection of active pad controllable by
software or hardware round-robin
Flexible measurement time on touch pads
Pin oscillation control circuit with adjustments for oscillation
Compare mux
ISR LINE1
LEDTS LINE0
Library
oscillation counting to be flexible. This is also how the relative brightness of the LEDs
can be controlled. In case of touch pads, the activation time is called the oscillation
window.
Figure 12-1 shows an example for a LED matrix configuration with touch pads. The
configuration in this example is 8 X 4 LED matrix with 4 touch input lines (here: 6
touchpads with two being dual-pad) enabled in sequence by hardware. Here no pad
turn is extended by ACCCNT, so four time frames complete an autoscan time period.
In the time slice interrupt, software can:
set up line pattern for next time slice
set up compare value for next time slice
evaluate current function in time slice (especially for analysis/debugging)
Refer to Section 12.9.1 for Interpretation of Bit Field FNCOL to determine the
currently active time slice.
The (extended) time frame interrupt indicates one touch input line TSIN[x] has been
sensed (once or number of times in consecutive frames), application-level software can,
for example:
start touch-sense processing (e.g. filtering) routines and update status
update LED display data to SFR
In the autoscan time period interrupt which indicates all touch-sense input TSIN[x] have
been scanned one round, application-level software can:
evaluate touch detection result & action
update LED display data to SFR
ledts _fn
COLA
pad _turn_0
pad _turn_1
pad _turn_2
pad _turn_3
COL3
COLLEV = 0
COL2
COL1
COL0
line_3
line_2
line_1
line_0
line_A
(Control (Control
signals ) signals )
LINE MUX
Definition : Definition :
CMP_TS[x] = Compare for touch -sense TSIN[x] LINE_A = Output on LINE[x] pins when LED COLA or touch -sense time slice active
CMP_LD [y] = Compare for LED COL [y] LINE_[y] = Output on LINE [x] pins when LED COL [y] active
CMP_LDA /TSCOM = Compare for LED COLA or touch -sense common
compare value for all TSIN [x]
Note: If TSCCMP bit is enabled , then CMP _TS[x] will never be referenced .
Figure 12-3 Activate Internal Compare/Line Register for New Time Slice
When the LEDTS-counter is first started (enable input clock by CLK_PS), a shadow
transfer of line pattern and compare value is activated for the first time slice (column).
A time slice interrupt can be enabled. A new time slice starts on the overflow of the
8LSBs of the LEDTS-counter.
Figure 12-4 shows the LED function control circuit. This circuit also provides the control
for enabling the pad oscillator. A 16-bit divider provides pre-scale possibilities to flexibly
configure the internal LEDTS-counter count rate, which overflows in one time frame at
the end. During a time frame comprising a configurable number of time slices, the
configured number of LED columns are activated in sequence. In the last time slice of
the time frame, touch-sense function is activated if enabled.
The LEDTS-counter is started when bit CLK_PS is set to any value other than 0 and
either the LED or touch-sense function is enabled. It does not run when both functions
are disabled. To avoid over-write of function enable which disturbs the hardware control
during LEDTS-counter running, the TS_EN and LD_EN bits can only be modified when
bit CLK_PS = 0. It is nonetheless possible to set the bits TS_EN and LD_EN in one
single write to SFR GLOBCTL when setting CLK_PS from 0 to 1, or from 1 to 0.
When started, the counter starts running from a reset/reload value based on enabled
function(s): 1) the number of columns (bit-field NR_LEDCOL) when LED function is
enabled, 2) add one time slice at end of time frame when touch-sense function is
enabled. The counter always counts up and overflows from 7FFH to the reload value
which is the same as the reset value. Within each time frame, the sequence of LED
column enabling always starts from the most-significant enabled column (column with
highest numbering).
To illustrate this point, in the case of four LED columns enabled, the column enabling
sequence will be as follows:
Start with COL3,
followed by COL2,
followed by COL1,
followed by COL0,
then COLA for touch sense function.
If touch-sense function is not enabled, COLA will be available for LED function as the
last LED column time slice of a time frame. The column enabling sequence will then be
as follows:
Start with COL2,
followed by COL1,
followed by COL0,
then COLA.
ledts_clk CLK_PS LEDTS-Counter 000 B: 700 H 010 B : 500 H 100 B : 300 H 110 B: 100 H
prescaler
001 B: 600 H 011 B : 400 H 101 B : 200 H 111B: 000 H
(16-bit)
8-bit compare On compare On 8-bit
0: No clock
reg. match overflow
1: /1
n: /n & Enable pin oscillation *
...
OR
65535 : / 111 B
65535 & ^ COLA *
110 B
& ^ COL0
101 B
& ^ COL1
100 B
de- & ^ COL2
011 B
mux & ^ COL3
010 B
& ^ COL4
001 B
& ^ COL5
000 B
& ^ COL6
CA/
C6 C5 C4 C3 C2 C1 C0
COLLEV = 1 TS*
Figure 12-4 LED Function Control Circuit (also provides pad oscillator enable)
In Section 12.9.3, the time slice duration and formulations for LEDTS related timings are
provided.
COLA
enable external pull- up
enable pad oscillator
pad_turn_num
&
pad_turn_x counter reset on start of1st
pad turn on new TSIN[x]
TSIN[x]
write,
16-bit TS-counter
read
active- (Extended) Time
Sensor Pad
extend Frame event
ledts_extended read
Shadow TS -counter
s tandard P ORTS pad
Figure 12-6 Hardware-Controlled Pad Turns for Autoscan of Four TSIN[x] with
Extended Frames
There is a 16-bit TS-counter register and there is a 16-bit shadow TS-counter register.
The former is both write- and read-accesible, while the latter is only read-accessible. The
actual TS-counter counts the latched number of oscillations and can only be written
when there is no active pad turn. The content of the TS-counter is latched to the shadow
register on every (extended) time frame event. Reading from the shadow register
therefore shows the latest valid oscillation count on one TSIN[x] input, ensuring for the
application SW there is at least one time slice duration to get the valid oscillation count
and meanwhile the actual TS-counter could continually update due to enabled pin
oscillations in current time slice.
The TS-counter and shadow TS-counter have another user-enabled function on
(extended) time frame event, which is to validate the counter value differences. When
this function is enabled by the user and in case the counter values do not differ by 2n LSB
bits (n is configurable), the (extended) time frame interrupt request is gated (no
interrupt) and the time frame event flag TFF is not set. This gating is on top of the time
frame interrupt enable/disable control.
The TS-counter may be enabled for automatic reset (to 00H) on the start of a new pad
turn on the next TSIN[x], i.e. resets in the first touch-sense time slice of each (extended)
time frame. Bit TSCTROVF indicates that the counter has overflowed. Alternatively, it
can be configured such that the TS-counter stops counting in touch-sense time slice(s)
of the same extended frame when the count value saturates, i.e. does not overflow &
stops at FFFFH. In this case, the TS-counter starts running again only in a new
(extended) frame on the start of a new pad turn on the next TSIN[x].
A configurable pin-low-level active extension is provided for adjustment of oscillation per
user system. The extension is active during the discharge phase of oscillation, and can
be configured to be extended by a number of peripheral clocks. This function is very
useful if there is a series resistor between the pin and the touch pad which makes the
discharge slower. Figure 12-7 illustrates this function.
The configuration of the active touch-sense pin TSIN[x] is over-ruled by hardware in the
active duration to enable oscillations, reference Section 12.9.5. In particular, the weak
TS-counter input
Input high
threshold
ledts _extended
Input high
threshold
pin oscillation
Input high
threshold
Input low
threshold
The oscillation is enabled on the pin with valid turn for a configurable duration. A
compare value provides the means to adjust the duty cycle within the time slice. The pin
oscillation is enabled (TS-counter is counting) only on compare match until the end of
the time slice. The time interval, in which the TS-counter is counting, is called the
oscillation window. For a 100% duty cycle, the compare value has to be set to 00H. In
this case, the oscillation window fills in the entire time slice. Setting the compare value
to FFH results in no pin oscillation in time slice.
The time slice interrupt, (extended) time frame interrupt and/or autoscan time period
interrupt may be enabled as required for touch-sense control.
In a typical application, COLA is not used and the oscillation is generated by the internal
pad structure only. The bits in LINE_A will determine whether the pads, that are not being
measured in the given COLA time slice, have a floating or 0V value. This setting usually
has a serious effect on the sensitivity and noise robustness of the touch pads.
Refer to Section 12.2 and Section 12.3 for more details on time slice allocation and
configuration.
Table 12-4 shows the interrupt node assignment for each LEDTS interrupt source.
TSD = 2 8 ( CR ) (12.2)
Extended TFD:
HWS E L
HW S elect
HWS E L
HW S elect
(Touch-sense time slice active ) AND (Pad turn on pin )
IOCR
A lternate Output
S elect
Pull
Device
LED line output ALT[LED]
ALT[x] Output
M Driver
Touch -sense HW_OUT[LED ] U
output Pin
X
Schmitt
Trigger
Pad
12.10 Registers
Registers Overview
The absolute register address is calculated by adding:
Module Base Address + Offset Address
The prefix LEDTSx_ is added to the register names in this table to indicate they belong
to the LEDTS kernel.
Access rights within the address range of an LEDTS kernel:
Read or write access to defined register addresses: U, PV
Accesses to empty addresses: nBE
ID
The module identification register indicate the function and the design step of the
peripheral.
ID
Module Identification Register (0000H) Reset Value: 00AB C0XXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MOD_NUMBER
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOD_TYPE MOD_REV
r r
GLOBCTL
The GLOBCTL register is used to initialize the LEDTS global controls.
GLOBCTL
Global Control Register (04H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CLK_PS
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ENS LD_
ITP_ ITF_ ITS_ FEN SUS CMT TS_
MASKVAL 0 YNC EN1)
EN EN EN VAL CFG R1)0 EN
1)0 0
rw rw rw rw rw rw r rw rw rw rw
FNCTL
The FNCTL control register provides control bits for the LED and Touch Sense functions.
FNCTL
Function Control Register (08H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSC
COL TSC TSC
NR_LEDCOL NR_TSIN TRS TSOEXT ACCCNT
LEV TRR CMP
AT
rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EPU PAD
0 FNCOL PADT
LL TSW
r rh rw rw rwh
EVFR
The EVFR register contains the status flags for events and control bits for requesting
clearance of event flags.
EVFR
Event Flag Register (0CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CTP CTF CTS
0
F F F
r w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSC
0 TRO TPF TFF TSF
VF
r rh rh rh rh
TSVAL
The TSVAL register holds the current and shadow touch sense counter values.
TSVAL
Touch-sense TS-Counter Value (10H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSCTRVAL
rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSCTRVALR
LINEx (x = 0-1)
The LINEx registers hold the values that are output to the respective line pins during their
active column period.
LINE0
Line Pattern Register 0 (14H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
LINE_3 LINE_2
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LINE_1 LINE_0
rw rw
LINE1
Line Pattern Register 1 (18H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
LINE_A LINE_6
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LINE_5 LINE_4
rw rw
LDCMPx (x = 0-1)
The LDCMPx registers hold the COMPARE values for their respective LED columns.
These values are used for LED brightness control.
LDCMP0
LED Compare Register 0 (1CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CMP_LD3 CMP_LD2
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMP_LD1 CMP_LD0
rw rw
LDCMP1
LED Compare Register 1 (20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CMP_LDA_TSCOM CMP_LD6
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMP_LD5 CMP_LD4
rw rw
TSCMPx (x = 0-1)
The TSCMPx registers hold the COMPARE values for their respective touch pad input
lines. These values determine the size of the pad oscillation window for each pad input
lines during their pad turn.
TSCMP0
Touch-sense Compare Register 0 (24H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CMP_TS3 CMP_TS2
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMP_TS1 CMP_TS0
rw rw
TSCMP1
Touch-sense Compare Register 1 (28H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CMP_TS7 CMP_TS6
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMP_TS5 CMP_TS4
rw rw
12.11 Interconnects
The LEDTS has interconnection to other peripherals enabling higher level of automation
without requiring software. Table 12-9 provides a list of the pin connections.
LEDTS.FN is an output signal denoting LEDTS active function. This signal can be used
as a source for VADC request gating and background gating.
References
[10] SD Specifications Part A2, SD Host Controller Standard Specification, Version 2.00,
February 2007
https://www.sdcard.org/developers/overview/host_controller/simple_spec
[11] SD Specifications Part 1, Physical Layer Specification, Version 2.00, May 2006
https://www.sdcard.org/downloads/pls
[12] SD Specifications Part E1, SDIO Specification, Version 2.00, January 2007
https://www.sdcard.org/developers/overview/sdio/sdio_spec
[13] SD Memory Card Security Specification, Version 1.01
[14] The MultiMediaCard System Specification, Version 3.31, 4.2 and 4.4
13.1 Overview
The Secure Digital/ MultiMediaCard interface (SDMMC) of the XMC4500 provides an
interface between SD/SDIO/MMC cards and the AHB bus. The CPU is programmed to
support SD, SDIO, SDHC and MMC cards, and can operate up to 48 MHz. The SDMMC
module is able to transfer a maximum of 24 MB/sec for SD cards and 48 MB/sec for
MMC cards.
13.1.1 Features
The SDMMC Host Controller handles SDIO/SD protocol at transmission level, packing
data, adding cyclic redundancy check (CRC), start/end bit, and checking for transaction
format correctness. Some useful applications of the SDMMC includes memory
extension, data logging, and firmware update.
System Interface
Data transfer using Programmed IO mode on AHB Slave interface
SD/SDIO/MMC Card Interface
Transfers data in 1 bit and 4 bit SD modes and SPI mode
Cyclic Redundancy Check CRC7 for command and CRC16 for data integrity
Variable-length data transfers for SD/SDIO cards
Designed to work with SD I/O cards, Read-only cards and Read/Write cards
Supports Read wait Control, and Suspend/Resume operation for SD/SDIO cards
Supports MMC Plus and MMC Mobile
MMC Card detection for insertion/removal
Error Correction Codes (ECC) for eMMC 4.4 cards
Password protection for MMC cards
Two 512 byte buffer for data transfers between core and cards
Handles FIFO overrun and underrun conditions
BUS
Power Monitor
Management
AHB BUS
Synchronizer
Command
Control Unit
SD2.0/
SD Protocol unit SDIO2.0/
MMC4.4
Device
AHB Data
Interface Control Unit
SD
Data
Registers FIFO
To NVIC
Interrupts
Clock
Control
AHB Interface
Host AHB interface acts as a bridge between AHB and the host controller. The SDMMC
host controller provides Programmed IO method in which the ARM Host Driver transfers
data using the Buffer Data Port Register SDMMC_DATA_BUFFER. The AHB target is
having the Host control register SDMMC_HOST_CTRL and these registers are
programmed by the CPU through the AHB target interface. The data transaction is
performed through the AHB target interface in case of Programmed IO method of data
transfer.
Interrupt controller
The SDMMC host controller generates interrupt to the Nested Vectored Interrupt
Controller (NVIC) if any of the interrupt bits are set in the interrupt status register
SDMMC_INT_STATUS_NORM.
DATA FIFO
The SDMMC host controller uses two 512 bytes dual port fifo for performing both read
and write transactions. During a write transaction (data transferred from CPU to
SD/SDIO/MMC card), the data will be filled in to the first and second fifo alternatively.
When data from first fifo is transferring to the SD/SDIO/MMC card, the second fifo will be
filled and vice versa. The two fifos are alternatively used to store data which will give
maximum throughput. During a read transaction (data transferred from SD/SDIO/MMC
card to CPU), the data from SD/SDIO/MMC card will be written in to the two fifos
alternatively. When data from one fifo is transferring to the CPU, the second fifo will be
filled and vice versa and thereby the throughput will be maximum. If the host controller
cannot accept any data from SD/SDIO/MMC card, it will issue read wait (if card supports
read wait mechanism) to stop the data coming from card or through stopping clock.
BUS Monitor
Bus monitor will check for any violations occurring in the SD bus and time-out conditions.
Power Control
The SDMMC host controller controls the SD Bus Power depending on the value
programmed in the Power Control Register SDMMC_POWER_CTRL by the CPU. The
system has the responsibility to supply SD Bus Voltage according to card OCR and
supply voltage capabilities depending on the host controller. If SD Bus power
SDMMC_POWER_CTRL.SD_BUS_POWER = 1, the system shall supply voltage to the
Card. If an unsupported voltage is selected in the SD Bus Voltage Select
SDMMC_POWER_CTRL.SD_BUS_VOLTAGE_SEL field, the system may ignore write
to SD Bus Power and keep its value at 0.
Clock Control
The Clock generation block will generate the SD clock depending on the value
programmed by the CPU in the Clock Control Register SDMMC_CLOCK_CTRL.
Asynchronous Abort
In an Asynchronous Abort sequence, the host driver can issue an Abort Command at
anytime unless Command Inhibit (CMD) in the Present State Register is set to 1.
SDMMC_PRESENT_STATE.COMMAND_INHIBIT_CMD = 1.
Synchronous Abort
In a Synchronous Abort, the host driver shall issue an Abort command after the data
transfer stopped by using Stop At Block Gap Request in the Block Gap Control register.
SDMMC_BLOCK_GAP_CTRL.STOP_AT_BLOCK_GAP = 1.
Suspend Command
Suspend command can be selected by setting SDMMC_COMMAND.CMD_TYPE =
01B.
If the Suspend command succeeds, the host controller shall assume the SD Bus has
been released and that it is possible to issue the next command which uses the DAT line.
The controller shall de-assert Read Wait for read transactions and stop checking busy
for write transactions. The Interrupt cycle shall start, in 4-bit mode. If the Suspend
command fails, the controller shall maintain its current state, and the host driver shall
restart the transfer by setting Continue Request in the Block Gap Control Register
SDMMC_BLOCK_GAP_CTRL.CONTINUE_REQ = 1 to restart the transfer.
Note: Suspend / Resume cannot be supported if Read Wait Control is disabled. Set
SDMMC_BLOCK_GAP_CTRL.READ_WAIT_CTRL = 1 to enable Read Wait
Control if the SD/SDIO card supports read wait function.
Resume Command
Resume command can be selected by setting SDMMC_COMMAND.CMD_TYPE = 10B.
The host driver re-starts the data transfer by restoring the registers in the range of 000H
- 00DH. The host controller shall check for busy before starting write transfers.
Note: Suspend / Resume cannot be supported if Read Wait Control is disabled. Set
SDMMC_BLOCK_GAP_CTRL.READ_WAIT_CTRL = 1 to enable Read Wait
Control if the SD/SDIO card supports the read wait function.
Abort Command
Abort command can be selected by setting SDMMC_COMMAND.CMD_TYPE = 11B.
If this command is set when executing a read transfer, the host controller shall stop reads
to the buffer. If this command is set when executing a write transfer, the host controller
shall stop driving the DAT line. After issuing the Abort command, the controller should
issue a software reset
Power
The SD/MMC card power supply can be controlled by the signal bus_pow. The SD bus
voltage supported by the SDMMC is 3.3V. If the SD Bus power is set to 1 in the Power
Control Register SDMMC_POWER_CTRL.SD_BUS_POWER = 1, the system shall
supply voltage to the card.
Reset
The SDMMC host controller is reset asynchronously when one of the following occurs:
Clocks
The clocks connected to SDMMC include:
clk_xin
Input clock to the SDMMC controller.
This is used to generate clk_sdcard_out and clk_sleep_out.
Frequency of clock is 48 MHz, generated from the System Control Unit (SCU)
module.
clk_sdcard_out
Clock supplied to the SD/MMC card.
clk_sdcard_in
Feedback clock of clk_sdcard_out from the pad.
Feedback clock is used to reduce the pad delay in the clock line.
Start
Write Read
9. Write or Read?
10-W. Wait for Buffer Write 10-R. Wait for Buffer Read
Ready Interrupt Ready Interrupt
Buffer Write Ready Buffer Read Ready
Interrupt occur Interrupt occur
11-W. Clear Buffer 11-R. Clear Buffer
Write Ready status Read Ready status
Yes Yes
13-W. More Blocks? 13-R. More Blocks?
No No
End
Asynchronous Abort
The following shows the asynchronous abort sequence:
1. Check SDMMC_PRESENT_STATE.COMMAND_INHIBIT_CMD is not set to 1.
2. Issue Abort Command. SDMMC_COMMAND.CMD_TYPE = 11B.
Synchronous Abort
The following shows the synchronous abort sequence:
1. Set SDMMC_BLOCK_GAP_CTRL.STOP_AT_BLOCK_GAP = 1 to stop SD
transactions.
2. Wait for Transfer Complete Interrupt. SDMMC_INT_STATUS_NORM.TX_COMPLETE.
3. Set SDMMC_INT_STATUS_NORM.TX_COMPLETE = 1 to clear this bit.
4. Issue Abort Command. SDMMC_COMMAND.CMD_TYPE = 11B.
5. Set SDMMC_SW_RESET.SW_RST_DAT_LINE = 1 and
SDMMC_SW_RESET.SW_RST_CMD_LINE = 1 to do software reset.
6. Check SW_RST_DAT_LINE and SW_RST_CMD_LINE. If both are 0, end data transfer.
If either SW_RST_DAT_LINE or SW_RST_CMD_LINE is 1, repeat step (6).
Start
1. Set Stop at Block Gap Request 5. Set Software Reset for DAT line
(DR) and CMD line (CR)
End
4. Issue Abort Command
13.12 Registers
Registers Overview
The absolute register address is calculated by adding:
Module Base Address + Offset Address
Access Restrictions
Note: The SDMMC registers are accessible only through word accesses. Half-word and
byte accesses on SDMMC registers will not generate a bus error. Writes to
unused address space will not cause an error but will be ignored.
SDMMC_BLOCK_SIZE
This register is used to configure the block size for data transfer.
SDMMC_BLOCK_SIZE
Block Size Register (0004H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX_
BLO
CK_ 0 TX_BLOCK_SIZE
SIZE
_12
rw rw rw
SDMMC_BLOCK_COUNT
This register is used to configure the block count for current transfer.
SDMMC_BLOCK_COUNT
Block Count Register (0006H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BLOCK_COUNT
rw
SDMMC_ARGUMENT1
This register is used to configure the SD command argument.
SDMMC_ARGUMENT1
Argument1 Register (0008H) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ARGUMENT1
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ARGUMENT1
rw
SDMMC_TRANSFER_MODE
This register is used to configure the data transfer mode.
SDMMC_TRANSFER_MODE
Transfer Mode Register (000CH) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MUL BLO
CMD TX_
TI_B CK_
_CO LOC DIR_
0 ACMD_EN COU 0
MP_ SEL
K_S NT_
ATA ECT
ELE EN
r rw rw rw rw rw rw
SDMMC_COMMAND
This register is used to configure the SDMMC command.
SDMMC_COMMAND
Command Register (000EH) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DAT CMD CMD
A_P _IND _CR RESP_TY
CMD_TYP RES C_C
0 CMD_IND _CH 0 PE_SELE
E
ENT ECK HEC CT
_SE _EN K_E
r rw rw rw rw rw r rw
SDMMC_RESPONSE
This register is used to configure the command response. Table 13-5 shows the relation
between parameters and the name of response type.
Table 13-5 Relation between parameters and the name of response type
Response Type Index Check CRC Check Name of Response
Enable Enable Type
00 0 0 No Response
01 0 1 R2
10 0 0 R3, R4
10 1 1 R1, R6, R5, R7
11 1 1 R1b, R5b
Table 13-6 describes the mapping of command responses from the SD Bus to this
register for each response type. In the table, R[] refers to a bit range within the response
data as transmitted on the SD Bus, RESPONSE[] refers to a bit range within the
Response register.
Table 13-6 Response bit definition for each response type (contd)
Kind of Response Meaning of Response Response Response
Field Register
R5, R5b SDIO Response R[39:8] RESPONSE
0[31:0]
R6 (Published RCA New published RCA[31:16] R[39:8] RESPONSE
response) etc. 0[31:0]
SDMMC_RESPONSE0
Response 0 Register (0010H) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RESPONSE1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESPONSE0
SDMMC_RESPONSE2
Response 2 Register (0014H) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RESPONSE3
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESPONSE2
SDMMC_RESPONSE4
Response 4 Register (0018H) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RESPONSE5
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESPONSE4
SDMMC_RESPONSE6
Response 6 Register (001CH) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RESPONSE7
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESPONSE6
SDMMC_DATA_BUFFER
This register is used to configure the SDMMC host controller data buffer.
SDMMC_DATA_BUFFER
Data Buffer Register (0020H) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DATA_BUFFER
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DATA_BUFFER
rw
SDMMC_PRESENT_STATE
This register is used to check the present state of the SDMMC host controller.
SDMMC_PRESENT_STATE
Present State Register (0024H) Reset Value: 00000000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CMD WRI CAR CAR
CAR
_LIN TE_ D_D D_S
D_IN
0 DAT_7_4_PIN_LEVEL E_L DAT_3_0_PIN_LEVEL PRO ETE TAT
SER
EVE TEC CT_ E_S
TED
L T_PI PIN_ TAB
r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BUF BUF REA WRI DAT COM COM
FER FER D_T TE_T _LIN MAN MAN
0 _RE _WR RAN RAN 0 E_A D_IN D_IN
AD_ ITE_ SFE SFE CTIV HIBI HIBI
ENA ENA R_A R_A E T_D T_C
r r r r r r r r r
Note: The host driver can issue cmd0, cmd12, cmd13 (for memory) and cmd52 (for
SDIO) when the DAT lines are busy during data transfer. These commands can
be issued when Command Inhibit (CMD) is set to zero. Other commands shall be
issued when Command Inhibit (DAT) is set to zero.
SDMMC_HOST_CTRL
This register is used to configure the modes of the SDMMC host controller.
SDMMC_HOST_CTRL
Host Control Register (0028H) Reset Value: 00H
7 6 5 4 3 2 1 0
CARD_DE CARD_DE
HIGH_SPE DATA_TX LED_CTR
T_SIGNAL TECT_TES 0
ED_EN _WIDTH L
_DETECT T_LEVEL
rw rw rw rw rw rw
SDMMC_POWER_CTRL
This register is used to configure the SD bus power.
SDMMC_POWER_CTRL
Power Control Register (0029H) Reset Value: 00H
7 6 5 4 3 2 1 0
HARDWA
SD_BUS_
0 RE_RESE SD_BUS_VOLTAGE_SEL
POWER
T
r rw rw rw
SDMMC_BLOCK_GAP_CTRL
This register is used to configure the block gap request.
SDMMC_BLOCK_GAP_CTRL
Block Gap Control Register (002AH) Reset Value: 00H
7 6 5 4 3 2 1 0
INT_AT_B STOP_AT
SPI_MOD READ_WA CONTINU
0 0 LOCK_GA _BLOCK_
E IT_CTRL E_REQ
P GAP
r rw rw rw rw rw rw
There are three cases to restart the transfer after stop at the block gap. Which case is
appropriate depends on whether the host controller issues a Suspend command or the
SD card accepts the Suspend command.
1. If the host driver does not issue Suspend command, the Continue Request shall be
used to restart the transfer.
2. If the host driver issues a Suspend command and the SD card accepts it, a Resume
Command shall be used to restart the transfer.
3. If the host driver issues a Suspend command and the SD card does not accept it, the
Continue Request shall be used to restart the transfer.
Any time Stop At Block Gap Request stops the data transfer, the host driver shall wait
for Transfer Complete (in the Normal Interrupt Status register) before attempting to
restart the transfer. When restarting the data transfer by Continue Request, the host
driver shall clear Stop At Block Gap Request before or simultaneously.
SDMMC_WAKEUP_CTRL
Wakeup functionality depends on the host controller system hardware and software. The
host driver shall maintain voltage on the SD Bus, by setting SD Bus power to 1 in the
Power Control register, when wakeup event via card interrupt is desired.
SDMMC_WAKEUP_CTRL
Wake-up Control Register (002BH) Reset Value: 00H
7 6 5 4 3 2 1 0
WAKEUP_ WAKEUP_ WAKEUP_
0 EVENT_E EVENT_E EVENT_E
N_REM N_INS N_INT
r rw rw rw
SDMMC_CLOCK_CTRL
This register is used to configure the SD Clock.
SDMMC_CLOCK_CTRL
Clock Control Register (002CH) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
INTE INTE
SDC
RNA RNA
LOC L_C L_C
SDCLK_FREQ_SEL 0 0
K_E
LOC LOC
N
K_S K_E
rw rw r rw r rw
SDMMC_TIMEOUT_CTRL
This register is used to configure the interval for data timeout.
SDMMC_TIMEOUT_CTRL
Timeout Control Register (002EH) Reset Value: 00H
7 6 5 4 3 2 1 0
0 DAT_TIMEOUT_CNT_VAL
r rw
SDMMC_SW_RESET
A reset pulse is generated when writing 1 to each bit of this register. After completing the
reset, the host controller shall clear each bit. Because it takes some time to complete
software reset, the SD Host Driver shall confirm that these bits are 0.
SDMMC_SW_RESET
Software Reset Register (002FH) Reset Value: 00H
7 6 5 4 3 2 1 0
SW_RST_ SW_RST_ SW_RST_
0
DAT_LINE CMD_LINE ALL
r rw rw rw
SDMMC_INT_STATUS_NORM
The Normal Interrupt Status Enable affects read of this register, but Normal Interrupt
Signal does not affect these reads. An Interrupt is generated when the Normal Interrupt
Signal Enable is enabled and at least one of the status bits is set to 1. For all bits except
Card Interrupt and Error Interrupt, writing 1 to a bit clears it. The Card Interrupt is cleared
when the card stops asserting the interrupt: that is when the Card Driver services the
Interrupt condition.
SDMMC_INT_STATUS_NORM
Normal Interrupt Status Register (0030H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BUF BUF BLO
CAR TX_ CMD
CAR CAR F_R F_W CK_
ERR D_R COM _CO
0 0 D_IN D_IN EAD RITE 0 GAP
_INT EMO PLE MPL
T S _RE _RE _EV
VAL TE ETE
ADY ADY ENT
r rw r r rw rw rw rw rw rw rw rw
Table 13-7 Relation between transfer complete and data timeout error
Transfer Data Timeout Error Meaning of the Status
Complete
0 0 Interrupted by Another Factor.
0 1 Timeout occur during transfer.
1 Dont Care Data Transfer Complete
Table 13-8 Relation between command complete and command timeout error
Command Command Timeout Meaning of the Status
Complete Error
0 0 Interrupted by Another Factor.
Dont Care 1 Response not received within 64 SDCLK cycles.
1 0 Response Received
SDMMC_INT_STATUS_ERR
Status defined in this register can be enabled by the Error Interrupt Status Enable
Register, but not by the Error Interrupt Signal Enable Register. The Interrupt is generated
when the Error Interrupt Signal Enable is enabled and at least one of the statuses is set
to 1. Writing to 1 clears the bit and writing to 0 keeps the bit unchanged. More than one
status can be cleared at a single register write.
SDMMC_INT_STATUS_ERR
Error Interrupt Status Register (0032H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CUR DAT DAT CMD CMD
DAT CMD CMD
CEA ACM REN A_E A_TI _EN _TIM
A_C _IND _CR
0 TA_ 0 0 0 D_E T_LI ND_ MEO D_BI EOU
RC_ _ER C_E
ERR RR MIT_ BIT_ UT_ T_E T_E
ERR R RR
ERR ERR ERR RR RR
r rw rw r rw rw rw rw rw rw rw rw rw rw
Table 13-9 Relation between command CRC error and command time-out error
Command CRC Command Kinds of Error
Error Time-out Error
0 0 No Error
0 1 Response Timeout Error
1 0 Response CRC Error
1 1 CMD Line Conflict
SDMMC_EN_INT_STATUS_NORM
Interrupt status can be enabled by writing 1 to the bit in this register. The host controller
may sample the card Interrupt signal during interrupt period and may hold its value in the
flip-flop. If the Card Interrupt Status Enable is set to 0, the host controller shall clear all
internal signals regarding Card Interrupt.
SDMMC_EN_INT_STATUS_NORM
Normal Interrupt Status Enable Register(0034H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CAR BUF BUF BLO TX_ CMD
CAR CAR
FIXE D_R F_R F_W CK_ COM _CO
D_IN D_IN EAD RITE GAP
D_T 0 EMO 0 PLE MPL
T_E S_E
O_0 VAL _RE _RE _EV TE_ ETE
N N
_EN ADY ADY ENT EN _EN
r rw rw rw rw rw rw rw rw rw rw
SDMMC_EN_INT_STATUS_ERR
Interrupt status can be enabled by writing 1 to the bit in this register. To Detect CMD Line
conflict, the host driver must set both Command Time-out Error Status Enable and
Command CRC Error Status Enable to 1.
SDMMC_EN_INT_STATUS_ERR
Error Interrupt Status Enable Register(0036H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TAR CUR DAT DAT DAT CMD CMD CMD CMD
CEA GET ACM REN A_E A_TI _EN
A_C _IND _CR _TIM
VSES1514 TA_ D_E
_RE 0 0 T_LI ND_ RC_ MEO _ER D_BI C_E EOU
_EN ERR RR_
SP_ MIT_ BIT_ ERR UT_ R_E T_E RR_ T_E
_EN ERR EN ERR ERR ERR RR_
_EN N EN RR_
r rw rw r rw rw rw rw rw rw rw rw rw rw
SDMMC_EN_INT_SIGNAL_NORM
This register is used to select which interrupt status is indicated to the Host System as
the Interrupt. The interrupt line is shared by all the status bits. Interrupt generation can
be enabled by writing 1 to any of these bits.
SDMMC_EN_INT_SIGNAL_NORM
Normal Interrupt Signal Enable Register(0038H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CAR BUF BUF BLO TX_ CMD
CAR CAR F_R F_W CK_
FIXE D_R COM _CO
D_IN D_IN
D_T 0 EMO EAD RITE 0 GAP PLE MPL
T_E S_E
O_0 VAL _RE _RE _EV TE_ ETE
N N ADY ADY ENT
_EN EN _EN
r rw rw rw rw rw rw rw rw rw rw
SDMMC_EN_INT_SIGNAL_ERR
This register is used to select which interrupt status is notified to the Host System as the
Interrupt. The interrupt line is shared by all the status bits. Interrupt generation can be
enabled by writing 1 to any of these bits.
SDMMC_EN_INT_SIGNAL_ERR
Error Interrupt Signal Enable Register(003AH) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TAR CUR DAT DAT DAT CMD CMD CMD CMD
CEA GET ACM REN A_E A_TI _EN
A_C _IND _CR _TIM
TA_ D_E
0 _RE 0 0 T_LI ND_ RC_ MEO _ER D_BI C_E EOU
ERR RR_
SP_ MIT_ BIT_ ERR UT_ R_E T_E RR_ T_E
_EN ERR EN ERR ERR ERR RR_
_EN N EN RR_
r rw rw r rw rw rw rw rw rw rw rw rw rw
SDMMC_ACMD_ERR_STATUS
This register is used to indicate CMD12 response error of Auto CMD12. The Host driver
can determine what kind of Auto CMD12 errors occur by this register. This register is
valid only when the Auto CMD Error is set.
SDMMC_ACMD_ERR_STATUS
Auto CMD Error Status Register (003CH) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CMD ACM ACM ACM
_NO ACM ACM D12_
D_E D_TI
D_IN D_C
0 T_IS 0 ND_ MEO NOT
D_E RC_
SUE BIT_ UT_ _EX
D_B RR ERR EC_
ERR ERR
r r r r r r r r
Table 13-10 Relation between Auto CMD12 CRC error and Auto CMD12 timeout
error
Auto Cmd12 CRC Error Auto CMD12 Timeout Error Kinds of Error
0 0 No Error
0 1 Response Timeout Error
1 0 Response CRC Error
1 1 CMD Line Conflict
The timing of changing Auto CMD12 Error Status can be classified in three scenarios:
1. When the host controller is going to issue Auto CMD12.
a) Set D00 to 1 if Auto CMD12 cannot be issued due to an error in the previous
command.
b) Set D00 to 0 if Auto CMD12 is issued.
2. At the end bit of Auto CMD12 response.
a) Check received responses by checking the error bits D01, D02, D03, D04.
b) Set to 1 if Error is Detected.
c) Set to 0 if Error is Not Detected.
3. Before reading the Auto CMD12 Error Status bit D07
a) Set D07 to 1 if there is a command cannot be issued.
b) Set D07 to 0 if there is no command to issue.
Timing of generating the Auto CMD12 Error and writing to the Command register are
Asynchronous. Then D07 shall be sampled when driver never writing to the Command
register. So just before reading the Auto CMD12 Error Status register is good timing to
set the D07 status bit.
SDMMC_FORCE_EVENT_ACMD_ERR_STATUS
The Force Event Register is an address at which the Auto CMD12 Error Status Register
can be written.
Writing 1 : set each bit of the Auto CMD12 Error Status Register
Writing 0 : no effect.
SDMMC_FORCE_EVENT_ACMD_ERR_STATUS
Force Event Register for Auto CMD Error Status(0050H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FE_ FE_ FE_ FE_ FE_ FE_
CMD ACM ACM ACM ACM ACM
0 _NO 0 D_IN D_E D_C D_TI D_N
T_IS D_E ND_ RC_ MEO OT_
SUE RR BIT_ ERR UT_ EXE
r w r w w w w w
SDMMC_FORCE_EVENT_ERR_STATUS
The Force Event Register is an address at which the Error Interrupt Status register can
be written. The effect of a write to this address will be reflected in the Error Interrupt
Status Register if the corresponding bit of the Error Interrupt Status Enable Register is
set.
Writing 1 : set each bit of the Error Interrupt Status Register
Writing 0 : no effect
SDMMC_FORCE_EVENT_ERR_STATUS
Force Event Register for Error Interrupt Status(0052H) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FE_T FE_ FE_ FE_ FE_ FE_ FE_ FE_ FE_
FE_ ARG FE_ CUR DAT DAT CMD
DAT CMD CMD CMD
CEA ACM
0 ET_ 0 0 REN A_E A_C A_TI _IND _EN _CR _TIM
TA_ D12_
RES T_LI ND_ RC_ MEO _ER D_BI C_E EOU
ERR PON ERR MIT_ BIT_ UT_ T_E
ERR R RR T_E
w w w r w w w w w w w w w w
SDMMC_DEBUG_SEL
This register is used to select the debug mode.
SDMMC_DEBUG_SEL
Debug Selection Register (0074H) Reset Value: 00000000H
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
DEB
0 UG_
SEL
r w
SDMMC_SPI
This register is used to configure the SPI interrupt support.
SDMMC_SPI
SPI Interrupt Support Register (00F0H) Reset Value: 00000000H
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
0 SPI_INT_SUPPORT
r rw
SDMMC_SLOT_INT_STATUS
This register is used to configure the interrupt signal for card slot.
SDMMC_SLOT_INT_STATUS
Slot Interrupt Status Register (00FCH) Reset Value: 0000H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 SLOT_INT_STATUS
r r
13.13 Interconnects
The interface signals of the SDMMC Host Controller are described below.
clk_sdcard_out SDMMC.CLK_OUT
clk_sdcard_in
OUT_EN
DATA0 OUT SDMMC.DATA0_OUT
IN
OUT_EN
DATA1 OUT SDMMC.DATA1_OUT
IN
OUT_EN
DATA2 OUT SDMMC.DATA2_OUT
IN
OUT_EN
DATA3 OUT SDMMC.DATA3_OUT
IN
OUT_EN
DATA4 OUT SDMMC.DATA4_OUT
IN
OUT_EN
DATA5 OUT SDMMC.DATA5_OUT
IN
OUT_EN
DATA6 OUT SDMMC.DATA6_OUT
IN
OUT_EN
DATA7 OUT SDMMC.DATA7_OUT
IN
OUT_EN
CMD OUT SDMMC.CMD
IN
bus_pow SDMMC.BUS_POWER
led_on SDMMC.LED
SDCD_n SDMMC.SDCD
SDWP SDMMC.SDWC
14.1 Overview
The Memory Controller module for ARM-based systems connects on-chip controller
cores (e.g. ARM9EJ CPU, DMA Controller) to external resources such as memories and
peripherals. Figure 14-1 shows Memory Controller within a typical system.
Several type of external memories are supported, such as: Burst FLASH, Cellular RAM,
SDRAM or NAND.
Any AHB master can (in conjunction with an AHB Bus Matrix) access external memories
through the Memory Controller.
Memory
Interface
14.1.1 Features
External bus frequency: Module frequency: flash clock = 1:1, 1:2, 1:3 or 1:4.
External bus frequency: Module frequency: SDRAM clock = 1:1, 1:2, or 1:4.
Highly programmable access parameters.
Intel-style peripheral/device support.
Burst FLASH support (see Section 14.12 for specific device types).
Cellular RAM support (see Section 14.12 for specific device types).
SDRAM support (see Section 14.13 for specific device types).
NAND flash
Asynchronous static memory device e.g. ROM, RAM, NOR Flash
Clock Mode
Clock Source Switch
Control
Control
Lines
Asynchronous
(& NAND Flash)
Internal I/F Data (32-bit) AHB2IF State Machine
Signals BCx can be programmed for different timing. The available modes cover a wide
range of external devices, such as RAM with separate byte write-enable signals, and
RAM with separate byte chip select signals. This allows external devices to connect
without any external glue logic.
Table 14-5 Memory Controller External Bus pin states during reset
Pin Name State during Reset and State during Idle2)
no bus mode1)
AD(31:0) GPIO High Impedance - pull ups enabled
to pull to 1.
A(24:16) GPIO Driven to 0 after reset, otherwise
last used address
CS(3:0) GPIO Driven to 1 (High).
RD GPIO Driven to 1 (High).
WR GPIO Driven to 1 (High).
CAS GPIO Driven to 1 (High).
RAS GPIO Driven to 1 (High).
Table 14-5 Memory Controller External Bus pin states during reset (contd)
Pin Name State during Reset and State during Idle2)
no bus mode1)
CKE GPIO Dependant on SDRAM
clocking/power save mode
ADV GPIO Driven to 1 (High).
SDCLKO GPIO Dependant on SDRAM
clocking/power save mode
SDCLKI GPIO High Impedance
BFCLKI GPIO High Impedance
BFCLKO GPIO Driven to 0 (Low).
BC(3:0) GPIO Driven to 1 (High).
WAIT GPIO Always an input (must have a pull-
resistor to inactive state).
1) GPIO controlled pins should be high impedance with pull up during reset, except for CKE which should be high
impedance with pull down.
2) Assuming that the pins have not been made available as GPIO.
Clock Mode
Clock Source Switch
Control
Control
Lines
Asynchronous
(& NAND Flash)
AHB Data (32-bit) AHB2IF State Machine
The bridge contains a Write Burst Buffer which allows the bridge to accept a complete
AHB Write Access prior to generation of the matching Write Transaction Request.
The bridge can be operated either Synchronously or Asynchronously. Support is
provided for dynamic switching of clocking modes (see Section 14.6.1).
The AHB port is configured with a 8 x 32-bit word write buffer and supports all AHB
transactions.
Byte and half-word transfers are supported for all transactions from external memory
shown in the Table 14-6. Byte accesses may be aligned to any byte boundary. Half-word
accesses may be aligned to any half-word boundary.
The Memory Controller will ensure that the limitations of external memories are
transparent to the AHB interfaces. If an AHB request cannot be directly mapped to an
access supported by the external memory, the Memory Controller will split and realign
the access into transfers supportable by the external memory. The most noticeable
effects of this are:
1. All burst accesses to an external memory are realigned so that the lowest address
is fetched first (unless specifically disabled using BUSRCON[3:0].dba)
This prevents unexpected interaction between AHB access wrapping and any
wrapping built into external memories such as SDRAM or burst flash.
2. An AHB, burst access to an asynchronous memory such as SRAM will result in
multiple accesses on the external bus as the Memory Controller fetches enough
single words from the memory to complete the burst
the outputs from the read buffer will be multiplexed to the AHB port. Once the AHB port
signals that all data has been returned to the requesting AHB master, the read buffer will
again be flagged as available.
This architecture allows reads to be in progress simultaneously, as a second read can
be running while the first read is still waiting for data to be returned to the AHB master.
Memory
Controller
AHB Bridge
AHB Data (32-bit) Data Core
INT_CLK
domain
HCLK domain
AHB Address (28-bit) Transaction
INT_CLK
Pulse
fCPU Swallowing
Clock Divide
fEBU
Clock Control
Table 14-8 lists the programmable parameters that are available for the four external
regions (regions 0 to 3).
1) This address is pre-aligned according to the bus width as detailed in Section 14.7.7.
Memory Controller
Memory/Peripheral A(MAX:16)
A(MAX:16)
AD(15:0) AD(15:0)
Memory/Peripheral
A(MAX:16)
AD(15:0)
MEMORY
CONTROLLER
Memory/Peripheral A(MAX:16)
A(MAX:16)
AD(31:16)
AD(15:0) AD(15:0)
1) This address is pre-aligned according to the bus width as detailed in Section 14.7.7.
Memory Controller
Memory/Peripheral A(MAX:16)
AD(31:0) AD(31:0)
Memory Controller
Memory/Peripheral
A(MAX:0) A(MAX:16)
AD(31:16)
D(15:0) AD(15:0)
1) This address is pre-aligned according to the bus width as detailed in Section 14.7.7.
memory
controller External
Data32(31:16) DataMS16(15:0) Address Data Bus
Bus pins AD(31:16)
1 A(15:0)
AHB/memory
controller
Bus Interface Data32(31:0) Data32(31:16)
2 memory
controller External
DataLS16(15:0) Data Bus Data Bus
pins AD(15:0)
Data32(15:0) AD(15:0)
of the external bus, and to use the bus to access external devices connected to this bus.
The scheme provided by the EBU is compatible with other Infineon microcontroller
devices and therefore allows the use of such devices as (external bus) masters together
with the XMC4500.
Note: In this section, the term external master is used to denote a device which is
located on the external bus and is capable of generating accesses across the
external bus (i.e. is capable of driving the external bus). An external master is not
able to access units that are located inside the XMC4500.
Two components that are equipped with the EBU arbitration protocol can be directly
connected together (without additional external logic) as shown below:
HOLD HOLD
HLDA HLDA
Arbiter User
BREQ BREQ
The EBU, having yielded ownership of the bus, will always request return of ownership
even if there is no EBU external bus access pending.
Arbiter Mode is selected by MODCON.ARBMODE = 01B.
Table 14-16 and Figure 14-12 show the functionality of the arbitration signals in Arbiter
Mode.
HOLD 1) 4)
(EBU Input)
1 Cycle
HLDA 2) 5)
(EBU Output)
2 Cycles
1 Cycle
BREQ 3) 6)
(EBU Output)
Start
While EXTLOCK = 1
Perform Appropriate or
LMB access yes External Bus Access Until all current/queued external
to external bus (for read access return accesses are completed.
is starting? result to LMB)
When the external master requests
no the external bus (HOLD = 0) and
conditions are appropriate the EBU
releases ownership of the bus by
EBU_CON. yes HLDA = 0.
EXTLOCK = 1?
no
no
HOLD = 0?
yes
yes
HOLD = 0?
no
BREQ 1) 5)
(EBU Output) 7) 8)
1 Cycle
HLDA 2) 6)
(EBU Input)
1 Cycle
HOLD 4)
(EBU Input)
1 Cycle
External Bus Ext. Master on Bus 3) EBU on Bus Ext. Master on Bus
Start
yes
no
Figure 14-15 Bus Ownership Control with the EBU in Participant Mode
1) Requests for the external bus already pending when EXTLOCK is set will not be cancelled so the EBU can
give up control of the external bus after EXTLOCK is set provided that the request occurs before the
EXTLOCK bit is set.
no yes
Arbitration Mode =
"No Bus"?
yes
Done
1) If an active high, ALE, signal is required, the polarity of the ADV output can be inverted by setting the ALE field
of the MODCON register.
During a write access, the write data can be driven onto the multiplexed address/data
bus
Latches the data from the data bus AD[15:0] (in the case of a read cycle),
Returns the appropriate BCx high (in the case where BCx is programmed to be
asserted with the RD or RD/WR signals).
This function is controlled by the register bits BUSCONx.EBSE for ADV and
BUSCONCx.ECSE for the other control signals.
Note: If CS is delayed a recovery phase must be used to prevent conflicts between chip
selects as the rising edge of chip select will be delayed past the end of the burst
phases. Also, for muxed devices, the write data will be delayed into the address
phase of the next access, resulting in the valid address being driven one clock
after ADV is asserted.
INT_CLK
new
AP1 AP2 AH1 CDi1 CPi1 CPi2 RP1 RP2 RP3
AP1
ADV
CSx
RD
A(MAX:16) address X
INT_CLK
new
AP1 AP2 AH1 CDi1 CPi1 CPi2 DH1 DH2 RP1
AP1
ADV
CSx
WR
A(MAX:16) address X
LMBCLK
A[23:0] Address
CSx
ADV
RD
WAIT
(active low)
1 2 3 4
At EBU_CLK edge 1 (at the end of the Address Phase), the EBU samples the WAIT
input as low and starts the first cycle of the Command Phase (CPi1 - internally
programmed).
At EBU_CLK edge 2, the EBU samples the WAIT input as low and starts the second
cycle of the Command Phase (CPi2 - internally programmed).
At EBU_CLK edge 3, the EBU samples the WAIT input as high and starts an
additional Command Phase cycle (CPe3 - externally generated) as a result of the
WAIT input sampled as low at EBU_CLK edge 1.
At EBU_CLK edge 4, the EBU starts an additional Command Phase cycle (CPe4 -
externally generated) as a result of the WAIT input sampled as low at EBU_CLK
edge 2.
Finally at EBU_CLK edge 5, as a result of the WAIT input sampled as high at
EBU_CLK edge 3, the EBU terminates the Command Phase, reads the input data
from AD[15:0],and starts the Recovery Phase.
LMBCLK
A[20:16] Address
CSx
ADV
RD
WAIT
(active low)
1 2 3 4 5
AD(15:0) I/O(1:8)
A(17) CLE
A(16) ALE
CS CE
RD RE
WR WE
WAIT R/B
Memory
Interface Nand Flash
Figure 14-20 Example of interfacing a Nand Flash device to the Memory Controller
The R/B input from the NAND flash is connected to the memory controller WAIT input
and is available as the MODCON.STS. This enables a NAND flash to be driven by
software from the processor.
As shown above only two address lines are connected to the Nand Flash, and rather
than being connected to address inputs, they are connected to control inputs. This allows
access to three registers in the Nand Flash as follows:-
Note: AHB addresses are byte addresses and addresses on the external bus are 16 bit
word addresses. Therefore [AHB address(18)]->[external address(17)] and [AHB
address(17)]->[external address(16)].
Note that the Memory Controller does not directly support byte wide devices. Writes to
8 bit, NAND Flash devices must therefore be done as 16-bit word writes with the valid
byte in the lower part and the upper-byte padded.
INT_CLK
AP1 AP2 AH1 CDi1 CPi1 CPi2 CDi1 CPi1 CPi2 CDi1
ADV
CSx
RD
ALE/CLE A(17:16)
INT_CLK
AP1 AP2 AH1 CDi1 CPi1 CPi2 DH1 DH2 CPi1 CPi2
ADV
CSx
RD/WR
ALE/CLE A(17:16)
CLE (A(17))
ALE (A(16))
CE (CS2)
WE (WR)
RE (RD)
R/B (WAIT)
read address address address 1st
I/O(8:1) command (high byte) (middle byte) (low byte) data
1 2 3 4 5
Features
The Synchronous Access Controller is primarily designed to perform burst mode read
cycles for an external instruction memory and read and write cycles for an external
Cellular RAM or FCRAM data memory. In general, the features are:-
Fully synchronous timing with flexible programmable timing parameters (address
cycles, read wait cycles, data cycles).
Programmable WAIT function.
Programmable burst (mode and length)
16-bit device width.
32-bit device width
Page mode read accesses.
Resynchronisation of read data to a feedback clock to maximize the frequency of
operation (optional).
14.12.1 Signals
The following signals are used for the Burst FLASH interface:-
AD(15:0) DQ(15:0)
A(n:16) A(n:0)
AD(31:16)
CSx CE
RD OE
RD/WR WE
ADV ADV
WAIT WAIT
BFCLKO CLK
BFCLKI
Unless documented elsewhere, all outputs to the external bus are generated of the rising
edge of EBU_CLK.
The BFCLKO phase is controlled so that control signal changes will normally occur at
the rising edge of BFCLKO unless configured otherwise by register settings.
When the ratio of EBU_CLK to BFCLKO is 1:4, control signals are asserted on the
negative edge of BFCLK (i.e. it is in effect delayed by two EBU_CLK cycles with
respect to the other signals).
The default setting after reset has the delay enabled
If the delay is disabled, then the signals will not be delayed in 1:1 mode (except for ADV
which will be guaranteed to be after the edge of BFCLKO). In 2:1, 3:1 and 4:1 mode, the
signals will be delayed by half of an EBU_CLK cycle from the start of the cycle in which
they are asserted.
This function is controlled by the register bits BUSCONx.EBSE for the ADVsignal and by
BUSCON.ECSE for the CS, RD/WR and write data signals
Note: If CS is delayed a recovery phase must be used to prevent conflicts between chip
selects as the rising edge of chip select will be delayed past the end of the burst
phases. Also, for muxed devices, the write data will be delayed into the address
phase of the next access, resulting in the valid address being driven one clock
after ADV is asserted.
When using two synchronization stages (default) the data is initially resynchronized to
PD_BFCLKFEEDBK_I and then is additionally internally resynchronized to BFCLKO
before being passed to the normal logic. In this mode PD_BFCLKFEEDBK_I can
therefore be skewed by almost an entire BFCLK cycle relative to the EBU_CLK clock
without losing data integrity. A side effect of using this mode is an increase in data
latency of two cycles of BFCLK (compared to not using clock feedback).
When using a single synchronization stage the data is resynchronized to
PD_BFCLKFEEDBK_I before being passed to the normal logic. This provides a
compromise setting for operating frequency and latency for 1:1 clocking mode where the
second resynchronisation stage offers no advantage.
Note: If EBU_CLK:BFCLKO = 1:1, then the second and third resynchronisation stages
have identical clock signals. There is therefore no advantage to having the second
resynchronisation stage and it can be bypassed without loss of performance.
As above, a side effect of using this mode is an increase in data latency. In this case
addition of one BFCLK cycle (compared to not using clock feedback).
Note: Clock feedback will be automatically disabled for burst writes as the additional
latency on the WAIT input cannot be tolerated
INT_CLK
BFCLKO
new
AP1 AP2 AP3 AH1 CDi1 CDi2 CPi1 CPi2 BP1 BP2 BP1 BP2 BP1 BP2 BP1 BP2 RP1 RP2
AP1
A(MAX:0) address X
ADV
CSx
RD
Figure 14-24 Burst FLASH Read without Clock Feedback (burst length of 4)
Note:
4. The start of the cycle is synchronised to a +ve edge of the BFCLKO signal
5. The BFCLKO signal is used to clock the Burst FLASH devices
6. BFCLKO to Internal Clock frequency ratio can be programmed to 1:1, 1:2, 1:3 or 1:4.
Each BFCLKO +ve edge is generated from a +ve edge of internal clock
7. Addresses show are byte addresses
8. ADV signal positioning is programmable via the EBSE bitfield in the BUSCON
registers
Figure 14-24 shows an example of a burst read access (burst length of four) to a Burst
FLASH device with WAIT and clock feedback functions disabled.
Programmability of the length of the Address, Command Delay and Command phases
allows flexible configuration to meet the initial read access time of a Burst FLASH device.
Data is sampled at the end of each Burst Phase cycle. The Burst Phase is repeated the
appropriate number of times for the programmed burst length (programmable for lengths
of 1, 2, 4 or 8 via the BUSCONx.FETBLEN bit-field).
Figure 14-24 shows an access cycle with the following settings:-
Clock Feedback disabled.
Address Phase length = 3 EBU_CLK cycles (see ADDRC and Section 14.10.1).
This mode of operation is compatible with the use of clock feedback as, with feedback
enabled, WAIT is fed through the same resynchronisation signals as the data bus. The
only effect on operation is that the number of overrun cycles will increase as the
decrementing of the sample counter will be lagged by the resynchronisation stages.
During the initial phases of an access, WAIT is sampled on every edge of EBU_CLK.
This is so the first burst phase is working with an accurate value for the WAIT signal. To
ensure this is the case, the command phase should be of sufficient length to allow the
device to drive WAIT and for the signal to propagate to the controller.
INT_CLK
BFCLKO
A(MAX:0) address
ADV
CSx
RD
INT_CLK
BFCLKO
CSx
WR
WAIT
AD(15:0) address data out data out data out data out
(16 bit) (addr 0) (addr 2) (addr 4) (addr 6)
1 2 3 4 5
Figure 14-26 Burst Cellular RAM Burst Write Access (burst length of 4)
Note:
9. The start of the cycle is synchronised to a +ve edge of the BFCLKO signal
10. The BFCLKO signal is used to clock the Cellular RAM devices
11. BFCLKO to Internal Clock frequency ratio can be programmed to 1:1, 1:2, 1:3 or 1:4.
Each BFCLKO +ve edge is generated from a +ve edge of internal clock
12. Addresses show are byte addresses
13. ADV signal positioning is programmable via the EBSE bitfield in the BUSCON
registers
Figure 14-26 shows an example of a Cellular RAM burst write access.
Note: Figure 14-26 shows operation with a BFCLKO to EBU_CLK ratio of 1:2.
The Start of the access cycle is the same as for a Synchronous Read access (see
Figure 14-24) except that the WR signal is treated as an address phase signal (i.e. it is
asserted active during the Address Phase and Address Hold Phase and is then
deasserted). See Fujitsu FCRAM Support (burst write with WR active during data
phase) on Page 14-64 for alternative WR timing during burst write.
The remaining sequence is as follows (with reference to the figure above):-
1. At the positive edge of EBU_CLK labelled as 1 above the first Burst Phase starts.
As the state machine is currently in the command phase, the interface samples the
WAIT input. This is sampled as active. By coincidence, in this example, the Cellular
RAM also deasserts its WAIT output as a response to this clock edge to signal that
it will start to take the data from the data bus on the BFCLKO rising clock edge after
the next (i.e. the rising edge of BFCLKO labelled as 5 above) - this need not be the
case.
2. At the positive edge of EBU_CLK labelled as 2 above the second programmed
EBU_CLK period of the Burst Phase begins.
3. At the positive edge of EBU_CLK labelled as 3 above the Burst FLASH evaluates
the WAIT sample from 1 above. As this sample was active the write data is not
updated. As this clock edge is coincident with the end of a burst phase the WAIT input
is resampled. The value of this new WAIT sample is inactive.
4. At the positive edge of EBU_CLK labelled as 5 above the Burst FLASH again
evaluates the WAIT sample from 3 above. As this sample was in-active, and the
edge is coincident with the end of a burst phase, the next data value is issued to the
AD(15:0) pins and the next Burst Phase is started.
This process continues until all the data is written.
Fujitsu FCRAM Support (burst write with WR active during data phase)
The FCRAM device type can be supported in two ways. Later FCRAMs have a
compatibility bit in the device configuration register which programmes the device to
expect the WR signal to be active with the address and to be latched with the ADV signal.
In this mode, FCRAM can be treated as an Infineon/Micron cellular RAM.
Alternatively, if a write is attempted to a region configured as a burst flash, the memory
controller will generate a burst write with the WR signal asserted with the write data. This
should be directly compatible with an FCRAM operating in its native mode.
14.13.1 Features
Compatible with mobile PC133/PC100 memories at 100 MHz (if maximum bus load
is not exceeded).
Mobile SDRAM support.
Multibank support.
Interleaved access support.
Support for 64, 128, 256 and 512 MBit SDRAM devices.
Auto-refresh mode support for power-down mode.
Data types (16-bit bus): byte and half-word for single reads/writes and half-word for
burst reads/writes.
FLASH
SRAM
AD(15:0) D(15:0) ROM
AD(31:16) A(15:0)
CS[m] CS
SDRAM #1
CS
CS
1) Previous Memory Controller documentation uses the term page to refer to a row. Where possible this has
been changed to reflect the more commonly used term row.
1) In addition verified support is limited to specific SDRAM device geometries (number of banks and row size).
Support for other sizes/geometries may be possible but this has not been verified.
3. Write to SDRMREF to set CKE high. (SELFREX=1) but leave all refresh fields at 0
to disable
4. All other Memory Controller registers except SDRAM specific registers (i.e. other
than those listed below).
5. Write to SDRMOD with the "COLDSTART" bit cleared to update the mode register
values.
6. Write to SDRMREF to configure refresh rate.
Note: As no other accesses are permitted in the current implementation while the
SDRAM initialization sequence is running, it will not be possible to poll the
sdrmbusy bit at 1 unless there has been a failure in the controller logic.
The user has to make sure that the SDRAM is programmed in the following way:
The Memory Controller uses the CAS latency value and burst length to adjust the burst
read timing. All other fields have no influence on the Memory Controller, which means
only single value is accepted for those fields.
The complete initialization sequence described will only be issued on the first write (since
reset) to the SDRMOD register with the COLDSTART field set to logic 1. On
subsequent writes with the COLDSTART field set to logic 1, the SDRAM device does
not need to be initialized, so a simple mode register set command can be issued to
refresh the contents of the registers in the SDRAM. A precharge-all command needs to
be issued to the SDRAM before this can happen.
An initialization sequence will write to both the mode register and the extended mode
register (if the extended mode register has been enabled).
A write to the SDRMOD register with the COLDSTART cleared will update the EBU
register and will also write to the configuration registers of the SDRAM but will not
execute the refresh cycles which are part of the full initialization required at cold start.
SDR Operation
The Memory Controller supports burst lengths of 1, 2, 4, 8 and 16. Bursts of other lengths
are supported but are implemented using data-masking. Burst length 16 is currently not
supported by available SDR memories.
SDR Operation
The Memory Controller can be configured to generate SDRAM bursts lengths of either
one, four or eight via the SDRMOD.BURSTL bit fields. When configured for burst lengths
of four or eight the interface will use data masking to support shorter write accesses.
However, when configured for a burst length of one data masking is not used.
Figure 14-29 shows how short burst write accesses are handled. During the write
access data masking is activated (with zero clock latency) to prevent unwanted write
operation. Data masking is activated through the BCx outputs (connected to DQM)
during a write cycle.
A row miss means that the access cannot be serviced from the SDRAM local data
buffer (i.e. the specified bank is closed, or the last row address that was issued to the
bank does not match the row address of the current access). In this case Memory
Controller must close the specified bank and then re-open it with the new row
address.
The Memory Controller must be configured so that it can detect row hits and row
misses for different SDRAM configurations (number of banks/row size). This allows the
Memory Controller to properly issue the appropriate SDRAM commands to allow up to
four SDRAM rows to be kept open simultaneously (i.e. one row open in each bank
assuming a four bank device). To perform this Memory Controller maintains two items of
data for each bank:-
1. Bank status (1 bit): open or closed (upon reset all of these bits are preloaded with
closed).
2. Last row address (up to 18 bits).
These two items are referred to as a bank tag. In order to maintain these bank tags The
Memory Controller must be made aware of:-
The AHB address range that defines which bank is being accessed.
The AHB address range that defines which row is being accessed.
These AHB address ranges change according to the geometry of an SDRAM device.
Table 14-41 shows some examples of how banks and rows are determined from the
address bits. This configuration is performed by means of the Bank Mask and Row
Mask. For example, if the SDRAM is configured as:-
16-bit wide
4 banks in the device
8192 rows
row size of 512
The bank to be accessed is determined by bits 24 and 23 of the address
(Address[24:23]). Each open bank has an associated open row, and for our example the
row tag is Address[22:10].
Each time there is a new AHB request, the address is compared against the appropriate
bank tag. After one clock cycle there will be two decisions to make. If the current access
is targeted to an SDRAM region(s) then Memory Controller must determine whether the
requested address is a row hit or row miss.
When the device has 2 banks then the "BANKM" value must be set to include the
most significant address bit of the AHB address range occupied by the SDRAM
device (i.e. region) - see Table 14-41.
When the device has 4 banks then the "bankm" value must be set to include the most
significant two address bits of the AHB address range occupied by the SDRAM
device (i.e. region) - see Table 14-41.
The following settings should be used:-
It can be seen that the ROWM bit-field only has an effect on the low-end of the address
range used to determine the row address (i.e. for use in comparison of the AHB address
with the address stored in the bank tag). The upper end of the comparison is determined
by the BANKM setting. "n" is therefore (BANKM+18)
set accordingly. This error flag can be cleared by writing to SDRMCON respective to the
appropriate address region.
memory. This allows between 1 and 255 NOPs to be inserted before the device sees
a non-null command.
For predictable operation of the device during warm start, both the SDRMREF.ARFSH
and SDRMREF.SELFREX_DLY fields should be set to 0.
When performing byte writes, byte selection is handled via the BC(3:0) signals which
used to generate DQM signals during an SDRAM access.
Table 14-37 Bank Address to Memory Controller Address Pin Connection (contd)
Number of BA0 BA11)
Rows
8192 A[13] A[14]
16384 A[14] A[15]
1) For devices with four banks only.
The following table shows all the multiplexing schemes discussed in the previous
sections:
The Memory Controller requires the SDRAM to be configured to read / write bursts of
length 1, 4 or 8. A burst shorter than the programmed burst (e.g. a single access) can be
generated by masking the excess data phases with DQM. Due to the wrap around
feature of the SDRAMs a burst has to start at certain addresses to prevent the wrap
around (a burst must not cross an address modulo 8*4). This guarantees also that the
internal row boundaries of the SDRAMs will not be crossed by any burst access. For
bursts that are 16-bit wide transfers, AHB address A[0] of any burst address must be 0.
For bursts that are 16-bit wide transfers, AHB address A[1:0] of any burst address must
be 0. This restriction is currently enforced by the AHB interface logic which will split any
unsupported bursts into 32 bit transfers
Table 14-41 Supported Configurations for 16-bit wide data bus (Part 1)
SDRAM Memory Controller Pins
portw = 01B (16-bit) A(15) A(14) A(13) A(12) A(11) A(10) A(9:0)
1GBit SDRAM Pins BA(1) BA(0) A(13) A(12) A(11) A(10) A(9:0)
64Mx row RA(15) RA(14) RA(13) RA(12) RA(11) RA(10) RA(9:0)
16 col /BA(1) / BA(0) CMD CA(9:0)
512MBit SDRAM Pins BA(1) BA(0) A(12) A(11) A(10) A(9:0)
32Mx row RA(14) RA(13) RA(12) RA(11) RA(10) RA(9:0)
16 col / BA(1) / BA(0) CMD CA(9:0)
Table 14-41 Supported Configurations for 16-bit wide data bus (Part 1) (contd)
SDRAM Memory Controller Pins
portw = 01B (16-bit) A(15) A(14) A(13) A(12) A(11) A(10) A(9:0)
128MBit SDRAM Pins BA(1) BA(0) A(11) A(10) A(9:0)
8Mx row RA(13) RA(12) RA(11) RA(10) RA(9:0)
16 col / BA(1) / BA(0) CMD CA(8:0)
64MBit SDRAM Pins BA(1) BA(0) A(11) A(10) A(9:0)
16Mx row RA(13) RA(12) RA(11) RA(10) RA(9:0)
4 col / BA(1) / BA(0) CMD CA(9:0)
8Mx8 row RA(13) RA(12) RA(11) RA(10) RA(9:0)
col / BA(1) / BA(0) CMD CA(8:0)
4Mx row RA(13) RA(12) RA(11) RA(10) RA(9:0)
16 col / BA(1) / BA(0) CMD CA(7:0)
16MBit SDRAM Pins BS A(10) A(9:0)
4Mx4 row RA(11) RA(10) RA(9:0)
col / BA(0) CMD CA(9:0)
2Mx8 row RA(11) RA(10) RA(9:0)
col / BA(0) CMD CA(8:0)
1Mx row RA(11) RA(10) RA(9:0)
16 col / BA(0) CMD CA(7:0)
Table 14-42 Supported Configurations for 16-bit wide data bus (Part 2)
SDRAM Multiplexed AWIDTH
portw = 01B (16-bit) AHB Address setting
1GBit SDRAM Pins
64Mx row A(26:11) 11
16 col A(26:25), A(10:1)
512MBit SDRAM Pins
32Mx row A(25:11) 11
16 col A(25:23), A(10:1)
Table 14-42 Supported Configurations for 16-bit wide data bus (Part 2) (contd)
SDRAM Multiplexed AWIDTH
portw = 01B (16-bit) AHB Address setting
256MBit SDRAM Pins
16Mx row A(24:10) 10
16 col A(24:23), A(9:1)
128MBit SDRAM Pins
8Mx row A(23:10) 10
16 col A(23:22), A(9:1)
64MBit SDRAM Pins
16Mx row A(24:11) 11
4 col A(24:23), A(10:1)
8Mx8 row A(23:10) 10
col A(23:22), A(9:1)
4Mx row A(22:9) 01
16 col A(22:21), A(8:1)
16MBit SDRAM Pins
4Mx4 row A(22:11) 11
col A(22), A(10:1)
2Mx8 row A(21:10) 10
col A(21), A(9:1)
1Mx row A(20:9) 01
16 col A(20), A(8:1)
Notes:
RA: row address
BA: bank select (MSB of row address)
CA: column address
CMD: auto pre-charge command is currently not supported
Areas in shades are not recommended for SDRAM configurations, in order to
minimize loads on the pads.
mode. Once Power Down mode is initiated by holding CKE low, all receiver circuits
except for CLK and CKE are gated off. Power Down mode does not perform any refresh
operations, therefore to prevent loss of data, the device must not remain in Power Down
mode longer than the Refresh period (tREF) of the device. Exit from this mode is
performed by taking CKE high. One clock delay is required for power down mode entry
and exit.
The Memory Controller provides automatic support for Power Down Mode via the
SDRMCON.SDCMSEL (SDRAM clock mode select) bit. When this bit is 0 Power Down
mode will not be used and the SDRAM clock will always be present at the SDCLKO pin.
When the bit is 1 the device will automatically be placed into Power Down Mode when
there are no SDRAM accesses pending. In this case the SDRAM clock will only be
present during an Memory Controller-generated SDRAM access (data, refresh,
bank/row open etc.) and will be gated off at all other times.
When a refresh is required (at the programmed rate) Memory Controller will
automatically take the device out of Power Down Mode, issue the required refresh and
will then return the device to Power Down Mode (providing no other SDRAM accesses
are pending following the refresh).
By default, the Memory Controller automatically issues the Pre-Charge All command
sequence and closes all pages prior to entry into Power Down Mode
(SDRMCON.PWR_MODE set to 00B).
The memory controller can also be configured to use the auto-precharge option when
running a command (SDRMCON.PWR_MODE set to 01B) or not to precharge banks at
all (active power down mode) with SDRMCON.PWR_MODE set to 10B.
As a final option, "clock stop" power down mode is also supported. In this case, the clock
is disabled between accesses with no preparatory command cycles
(SDRMCON.PWR_MODE set to 11B).
The default reset state of Memory Controller is Power Down Mode enabled
(SDRMCON.SDCMSEL = 1).
Note: The programmer should be very careful about the use of this feature as external
devices may require this clock to be running in some modes. There are restrictions
within the PC-133 specification about when the clock can be disabled, especially
if the SDRAMs are operated in self-refresh mode.
A separate field SDRMCON.RES_DLY is provided to allow a delay to be programmed
after exiting the power down mode. This field is the delay, in external clock cycles
(NOPs), after CKE is taken high on exiting power down mode before another command
is permitted.
An additional bit SDRMCON.CLKDIS is provided to allow the clock output to be
completely disabled. The projected use for this bit is for DDR cold start where CKE
should be high before the clock is enabled. Setting this bit will allow a self refresh exit to
be performed to enable CKE without starting the clock.
14.15.1 Clocks
The EBU receives two clocks from the system:
AHB bus clock
dedicated EBU clock
The dedicated EBU clock is allowed to be asynchronous to AHB clock. Therefore it is
also possible to run the EBU at a higher clock rate than the AHB. This mode is suitable
for higher performance applications.
If higher EBU performance is not required it is recommended to operate the EBU on the
AHB bus clock because this will save resynchronisation cycles.
The dedicated EBU clock is described on the SCU (System Control Unit) chapter as fEBU.
The AHB bus clock for the EBU block is described on the SCU chapter as fCPU.
It is possible to program the fEBU frequency via the EBUCLKR register on the SCU.
The EBU clock, fEBU, can also be enabled or disabled via the CLKSET.EBUCEN and
CLKR.EBUCDI bitfields, respectively (see the SCU chapter for a complete description).
14.15.3 Power
The EBU is inside the power core domain, therefore no special considerations about
power up or power down sequences need to be taken. For an explanation about the
different power domains, please address the SCU (System Control Unit) chapter.
An internal power down mode for the EBU, can be achieved by disabling the clock
provided to it. For this one should disable the clock via the specific SCU bitfield
(CLKR.EBUCDI).
14.17 Registers
This section describes the registers and programmable parameters of the EBU. All these
registers can be read in User Mode, but can only be written in Supervisor Mode.
All registers are reset by the module reset.
Access Restrictions
Note: The EBU registers are accessible only through word accesses. Half-word and byte
accesses on EBU registers will generate a bus error. Writes to unused address
space will not cause an error but be ignored.
CLC
EBU Clock Control Register (000H) Reset Value: 0011 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SYN
EBUDIVA DIV2 SYN
0 CAC EBUDIV DIV2
CK ACK C
K
r r r r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 DISS DISR
r r rw
Note: While the DISR bit is implemented in the EBU, it connects to the standby logic
which will disable the clock tree. Standby mode will be exited automatically when
an attempt is made to access the EBU. This register can be Endinit-protected after
initialization. Writing to this register in this state will cause the EBU to generate an
AHB Error.
MODCON
EBU Configuration Register (004H)
Reset Value: 0000 0020H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ACC
ACC
ALE 0 SINH GLOBALCS LOCKTIMEOUT
SINH
ACK
rw r r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ARB EXT LCK
ARBMOD SDT
TIMEOUTC SYN LOC 0 ABR STS
E RI
C K T
rw rw rw rw r rw r r
ADDRSELx (x = 0-3)
EBU Address Select Register x (018H+x*4H) Reset Value: 0000 0000H
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
ALT REG
WPR
0 ENA ENA
OT
B B
r rw rw rw
BUSRCONx (x = 0-3)
EBU Bus Configuration Register (028H+x*10H)
Reset Value: 00D3 0040H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WAI EBS ECS
AGEN 0 AAP WAIT PORTW BCGEN DBA
TINV E E
rw r rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BFC FBB
FDB BFS
0 NAA MSE MSE FETBLEN
KEN SS
L L
r rw rw rw rw rw rw
BUSWCONx (x = 0-3)
EBU Bus Write Configuration Register(030H+x*10H)
Reset Value: 00D3 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
LOC WAI EBS ECS
AGEN AAP WAIT PORTW BCGEN 0
KCS TINV E E
rw rw rw rw r rw rw r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FBB
0 NAA 0 MSE FETBLEN
L
r r r rw rw
BUSRAPx (x = 0-3)
EBU Bus Read Access Parameter Register
(02CH+x*10H) Reset Value: FFFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EXTCLOC
ADDRC AHOLDC CMDDELAY EXTDATA
K
rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw
BUSWAPx (x = 0-3)
EBU Bus Write Access Parameter Register
(034H+x*10H) Reset Value: FFFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EXTCLOC
ADDRC AHOLDC CMDDELAY EXTDATA
K
rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw
SDRMCON
EBU SDRAM Control Register (068H) Reset Value: 8000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SDC
PWR_MO CLK
MSE CRCE BANKM ROWM CRC
DE DIS
L
rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw rw rw
SDRMOD
EBU SDRAM Mode Register (6CH) Reset Value: 0000 0020H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
XBA XOPM
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
COL
BTY
DST 0 OPMODE CASLAT BURSTL
P
ART
w r rw rw rw rw
SDRMREF
EBU SDRAM Refresh Control Register(070H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ARF
0 RES_DLY SELFREX_DLY
SH
r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AUT SEL SEL SEL SEL
ERFSHC OSE FRE FRE FRE FRE REFRESHR REFRESHC
LFR N NST X XST
rw rw rw rw rw rw rw rw
SDRSTAT
EBU SDRAM Status Register (074H) Reset Value: 0001 0000H
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
SDR
SDE REF
0 MBU
RR ERR
SY
r r r r
USERCON
EBU Test/Control Configuration Register
(00CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADVI
0 ADDIO
O
r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 DIP
r rw
ID
EBU Module Identification Register (08H) Reset Value: 0014 C0XXH
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
r r r
15.1 Overview
The ETH peripheral is comprised of five major functional units. The ETH-Core takes user
provided data frames and formats them for transmission to an external PHY via an MII
or RMII interface. The ETH MAC Transaction Layer (MTL) acts as a bridge between the
application and the ETH Core. The MTL provides two 2K byte FIFOs to buffer the
transmit and receive frames. The application may write data frames directly to the MTL
(cut through mode) or more normally will use the dedicated ETH DMA unit. The ETH
DMA allows the application to define a region of RAM to be used as transmit and receive
buffers. DMA transfers are initiated by DMA descriptors which are also held in RAM. The
ETH also includes a system time module which allows timestamping of transmit and
receive frames. The ETH also includes an extensive set of MAC Mangement counters
which provide detailed bus statistics.
The ETH includes the following features, listed by category.
Supports 10/100-Mbit/s data transfer rates with the following PHY interfaces
IEEE 802.3-compliant RMII/MII (default) interface to communicate with an external
Fast Ethernet PHY
Supports both full-duplex and half-duplex operation
Supports CSMA/CD Protocol for half-duplex operation
Supports IEEE 802.3x flow control for full-duplex operation
Optional forwarding of received pause control frames to the user application in
full-duplex operation
Back-pressure support for half-duplex operation
Automatic transmission of zero-quanta pause frame on deassertion of flow control
input in full-duplex operation
Preamble and start-of-frame data (SFD) insertion in Transmit, and deletion in
Receive paths
Automatic CRC and pad generation controllable on a per-frame basis
Options for Automatic Pad/CRC Stripping on receive frames
Programmable frame length to support Standard or Jumbo Ethernet frames with
sizes up to 16 KB
Programmable InterFrameGap (40-96 bit times in steps of 8)
Supports a variety of flexible address filtering modes:
Up to 3 additional 48-bit perfect (DA) address filters with masks for each byte
Up to 3 48-bit SA address comparison check with masks for each byte
64-bit Hash filter for multicast and uni-cast (DA) addresses
Option to pass all multicast addressed frames
Promiscuous mode support to pass all frames without any filtering for network
monitoring
Passes all incoming packets (as per filter) with a status report
Separate 32-bit status returned for transmission and reception packets
Supports IEEE 802.1Q VLAN tag detection for reception frames
Separate transmission, reception, and control interfaces to the Application
Supports 32-bit data transfer interface on the system-side
Complete network statistics with RMON/MIB Counters (RFC1757/RFC2819 /
RFC2665). It is completely under control of higher protocol level (SW) to make use
of these counters.
MDIO Master interface for PHY device configuration and management, e.g. for
switching the PHY in external loopback mode.
Detection of LAN wake-up frames and AMD Magic Packet frames
Enhanced Receive module for checking IPv4 header checksum and TCP, UDP, or
ICMP checksum encapsulated in IPv4 or IPv6 datagrams.
Module to support Ethernet frame time stamping as described in IEEE 1588-2008.
Sixty-four-bit time stamps are given in each frames transmit or receive status.
TxFIFO R xFIFO
(Mem) (Mem)
AH B/AXI
Master D MA TxFC R xFC Optional
Interface PH Y
Interface
(RGMII/
GMAC RTBI/TBI/
SGMII/
RMII)
D MA OMR MAC
AH B/AXI Select
C SR R egister CSR
Slave (G)MII
Interface
GMAC-CORE
GMAC-MTL
GMAC-DMA
GMAC-AHB or GMAC-AXI
15.2.1.1 Transmission
Transmission is initiated when the MTL Application pushes in data with the SOF . When
the SOF signal is detected, the ETH accepts the data and begins transmitting to the MII.
The time required to transmit the frame data to the RMII/MII after the Application initiates
transmission is variable, depending on delay factors like IFG delay, time to transmit
preamble/SFD, and any back-off delays for Half-Duplex mode. Until then, the ETH does
not accept the data received from MTL.
After the EOF is transferred to the ETH Core, the core complete normal transmission and
then gives the Status of Transmission back to the MTL. If a normal collision (in Half-
duplex mode) occurs during transmission, the ETH core makes valid the Transmit Status
to the MTL. It then accepts and drops all further data until the next SOF is received. The
MTL block should retransmit the same frame from SOF on observing a Retry request (in
the Status) from the ETH.
The ETH issues an underflow status if the MTL is not able to provide the data
continuously during the transmission. During the normal transfer of a frame from MTL, if
the ETH receives a SOF without getting an EOF for the previous frame, then it (the SOF)
is ignored and the new frame is considered as continuation of the previous frame.
The following six modules constitute the transmission function of the ETH:
Transmit Bus Interface Module (TBU)
Transmit Frame Controller Module (TFC)
Transmit Protocol Engine Module (TPE)
Transmit Scheduler Module (STX)
Transmit CRC Generator Module (CTX)
Transmit Flow Control Module (FTX)
In MII mode, if a collision occurs any time from the beginning of the frame to the end of
the CRC field, the transmit state machine sends a 32-bit jam pattern of 55555555H on
the MII to inform all other stations that a collision has occurred. If the collision is seen
during the preamble transmission phase, the transmit state machine completes the
transmission of preamble and SFD and then sends the jam pattern.
If the collision occurs after the collision window and before the end of the FCS field (or
the end of Burst if the Frame Burst mode is enabled), the transmit state machine sends
a 32-bit jam pattern and sets the late collision bit in the transmit frame status.
The TPE module maintains a jabber timer to cut off the transmission of Ethernet frames
if the TFC module transfers more than 2048 (default) bytes. The time-out is changed to
10240 bytes when the Jumbo frame is enabled.
The Transmit state machine uses the deferral mechanism for the flow control (Back
Pressure) in Half-Duplex mode. When the Application requests to stop receiving frames,
the Transmit state machine sends a JAM pattern of 32 bytes whenever it senses a
reception of a frame, provided the transmit flow control is enabled. This will result in a
collision and the remote station will back off. The Application requests the flow control by
setting ETH0_FLOW_CONTROL.FCA_BPA bit. If the application requests a frame to be
transmitted, then it will be scheduled and transmitted even when the backpressure is
activated. Note that if the backpressure is kept activated for a long time (and more than
16 consecutive collision events occur) then the remote stations will abort their
transmissions due to excessive collisions.
If IEEE 1588 time stamping is enabled for the transmit frame, this block takes a snapshot
of the system time when the SFD is put onto the transmit MII bus. The system time
source is either an external input or internally generated, according to the configuration
selected.
if a carrier is detected during the first two-thirds (64-bit times for all IFG values) of the
IFG interval. If the carrier is detected during the final one third of the IFG interval, the STX
module continues the IFG count and enables the transmitter after the IFG interval.
The STX module implements the Truncated Binary Exponential Back-off algorithm when
it operates in Half-Duplex mode.
bits ) before this Pause-time runs-out, a second Pause frame will be transmitted to the
TFC module. The process will be repeated as long as the MTI flow control signal remains
asserted.
If the MTI flow control signal goes inactive prior to the sampling time, the FTX module
will transmit a Pause frame with zero Pause Time to indicate to the remote end that the
receive buffer is ready to receive new data frames.
15.2.1.3 Reception
A receive operation is initiated when the ETH detects an SFD on the MII. The core strips
the preamble and SFD before proceeding to process the frame. The header fields are
checked for the filtering and the FCS field used to verify the CRC for the frame. The
received frame is stored in a shallow buffer until the address filtering is performed. The
frame is dropped in the core if it fails the address filter.
The following are the functional blocks in the Receive path of the ETH core.
Receive Protocol Engine Module (RPE)
Receive CRC Module (CRX)
Receive Frame Controller Module (RFC)
Receive Flow Control Module (FRX)
Receive IP Checksum checker (IPC)
Receive Bus Interface Unit Module (RBU)
Address Filtering Module (AFM)
If IEEE 1588 time stamping is enabled, the RPE takes a snapshot of the system time
when any frame's SFD is detected on the MII. Unless the MAC filters out and drops the
frame, this time stamp is passed on to the application.
In MII mode, the RPE converts the received nibble data into bytes, then forwards the
valid frame data to the RFC module
The receive state machine of the RPE module decodes the Length/Type field of the
receiving Ethernet frame. If the Length/Type field is less than 600 (hex) and if the MAC
is programmed for the auto crc/pad stripping option, the state machine sends the data of
the frame up to the count specified in the Length/Type field, then starts dropping bytes
(including the FCS field). The state machine of the RPE module decodes the
Length/Type field and checks for the Length interpretation.
If the Length/Type field is greater than or equal to 600 (hex), the RPE module will send
all received Ethernet frame data to the RFC module, irrespective of the value on the
programmed auto-CRC strip option.
As a default, the ETH is programmed for watchdog timer to be enabled, that is, frames
above 2.048 (10.240 if Jumbo Frame is enabled) bytes (DA + SA + LT + DATA + PAD +
FCS) are cut off at the RPE module. This feature can be disabled by programming the
ETH0_MAC_CONFIGURATION.WD bit. However even if the watchdog timer is
disabled, frames greater than 16 KB in size are cut off and a watchdog time-out status
is given.
The ETH supports loopback of transmitted frames onto its receiver. As a default, the
ETH loopback function is disabled, but this feature can be enabled by programming the
ETH Configuration register, Loopback bit. The transmit and receive clocks can have an
asynchronous timing relationship, so an asynchronous FIFO is used to make the
loopback path of the PHY transmit path connected onto the receive path. The
asynchronous FIFO is 6 bits wide to accommodate the PHY transmit,receive and enable
signals. The FIFO is nine words deep and free-running to write on the write clock and
read on every read clock.
The write and read pointers gets re-initialized to have an offset of 4 at the start of each
frame read out of the FIFO. This helps to avoid overflow/underflow during the transfer of
a frame, and ensures that the overflow/underflow occurs only during the IFG period
between the frames. Please note that the FIFO depth of nine is sufficient to prevent data
corruption for frame sizes up to 9.022 bytes with a difference of 200 ppm between the
MII Transmit and Receive clock frequencies. Hence, bigger frames should not be looped
back, as they may get corrupted in this loopback FIFO.
At the end of every received frame, the RPE module generates received frame status
and sends it to the RFC module. Control, missed frame, and filter fail status are added
to the receive status in the RFC module.
RFC module. The address checking is based on different parameters (Frame Filter
register) chosen by the Application. These parameters are inputs to the AFM module as
control signals, and the AFM module reports the status of the address filtering based on
the combination of these inputs. The AFM module does not filter the receive frames by
itself, but reports the status of the address filtering (whether to drop the frame or not) to
the RFC module. The AFM module also reports whether the receiving frame is a
multicast frame or a broadcast frame, as well as the address filter status.
The AFM module probes the 8-bit receive data path between the RPE module and the
RFC module and checks the destination and source address field of each incoming
packet. In MII mode the module takes 14/26 clocks (from the start of frame) to compare
the destination/ source address of the receiving frame. The AFM module gets the
stations physical (MAC) address and the Multicast Hash table from CSR module for
address checking. The CSR module provides the Frame Filter register parameters to
AFM.
to index the content of the Hash table. A value of 000000B selects Bit 0 of the selected
register and a value of 111111B selects Bit 63 of the Hash Table register.
If the corresponding bit is set to 1, then the multicast frame is said to have passed the
Hash filter; otherwise, the frame has failed the Hash filter.
out and transferred to the ETH core when triggered. When the end-of-frame is
transferred, the status of the transmission is taken from the ETH core and transferred
back to the DMA.
The Transmit FIFO has a depth of 22K bytes. A 2 FIFO-fill level is indicated to the DMA
so that it can initiate a data fetch in required bursts from the system memory, using the
Bus interface. The data from the Bus Master interface is pushed into the FIFO with the
appropriate byte lanes qualified by the DMA. The DMA also indicates the start-of-frame
(SOF) and end-of-frame (EOF) transfers along with a few signals controlling the pad-
insertion/CRC generation for that frame in the ETH core.
Per-frame control bits, such as Automatic Pad/CRC Stripping disable, time stamp
capture, and so forth are taken as control inputs on the ATI, stored in a separate register
FIFO, and passed on to the core transmitter when the corresponding frame data is read
from the Transmit FIFO.
There are two modes of operation for popping data towards the ETH core. In Threshold
mode, as soon as the number of bytes in the FIFO crosses the configured threshold level
(or when the end-of-frame is written before the threshold is crossed), the data is ready
to be popped out and forwarded to the ETH core. The threshold level is configured using
the TTC bits of DMA ETH0_BUS_MODE Register. In store-and-forward mode, the MTL
pops the frame towards the ETH core only when one or more of the following conditions
are true:
When a complete frame is stored in the FIFO
When the TX FIFO becomes almost full
When the ATI watermark becomes low. The watermark becomes low when the
requested FIFO does not have space to accommodate the requested burst-length on
the ATI.
Therefore, the MTL never stops in the store-and-forward mode even if the Ethernet
frame length is bigger than the Tx FIFO depth.
The application can flush the Transmit FIFO of all contents by setting the
ETH0_OPERATION_MODE.FTF bit. This bit is self-clearing and initializes the FIFO
pointers to the default state. If the FTF bit is set during a frame transfer from the MTL to
the ETH core, then the MTL stops further transfer as the FIFO is considered to be empty.
Hence an underflow event occurs at the ETH transmitter and the corresponding Status
word is forwarded to the DMA.
Initialization through Transmit Status Word detail initialization and transmit operations
for the MTL Layer.
Initialization
Upon reset, the MTL is ready to manage the flow of data to and from the DMA and the
ETH .
There are no requirements for enabling the MTL. However, the ETH block and the DMA
controller must be enabled individually through their respective CSRs.
1. Because the DMA must update the descriptor status before releasing it to the CPU,
there can be at the most two frames inside a transmit FIFO. The second frame will
be fetched by the DMA and put into the FIFO only if the OSF (Operate on Second
Frame bit is set). If this bit is not set, the next frame will be fetched from the memory
only after the MAC has completely processed the frame and the DMA has released
the descriptors.
2. If the OSF bit is set, the DMA starts fetching the second frame immediately after
completing the transfer of the first frame to the FIFO. It does not wait for the status to
be updated. The MTL, in the meantime, receives the second frame into the FIFO
while transmitting the first frame. As soon as the first frame has been transferred and
the status is received from the MAC, the MTL pushes it to the DMA. If the DMA has
already completed sending the second packet to the MTL, it must wait for the status
of the first packet before proceeding to the next frame.
use of Ethernet is to encapsulate TCP and UDP over IP datagrams, the ETH has an
Checksum Offload Engine (COE) to support checksum calculation and insertion in the
transmit path, and error detection in the receive path. This section explains the operation
of the Checksum Offload Engine for transmitted frames.
Note: The checksum for TCP, UDP, or ICMP is calculated over a complete frame, then
inserted into its corresponding header field. Due to this requirement, this function
is enabled only when the Transmit FIFO is configured for Store-and-Forward
mode (that is, when the ETH0_OPERATION_MODE.TSF bit is set . ). If the core
is configured for Threshold (cut-through) mode, the Transmit COE is bypassed.
Note: You must make sure that the Transmit FIFO is deep enough to store a complete
frame before that frame is transferred to the ETH Core transmitter. The reason
being that when space is not available to accept the programmed burst length of
the data, then the MTL TxFIFO starts reading to avoid dead-lock. Once reading
starts, then checksum insertion engine fails and consequently all succeeding
frames may get corrupted due to improper recovery. Therefore, you must enable
the checksum insertion only in the frames that are less than the following number
of bytes in size (even in the store-and-forward mode):
FIFO Depth PBL 3 FIFO Locations
The ETH0_BUS_MODE.PBL is the programmed burst-length.
This checksum engine can be controlled for each frame by setting the CIC bits (Bits
28:27 of TDES1RAM, described in Transmit Descriptor 1).
Note: See IETF specifications RFC 791, RFC 793, RFC 768, RFC 792, RFC 2460, and
RFC 4443 for IPv4, TCP, UDP, ICMP, IPv6, and ICMPv6 packet header
specifications, respectively.
IP Header Checksum Engine
In IPv4 datagrams, the integrity of the header fields is indicated by the 16-bit Header
Checksum field (the eleventh and twelfth bytes of the IPv4 datagram). The COE detects
an IPv4 datagram when the Ethernet frames Type field has the value 0800H and the IP
datagrams Version field has the value 4H. The input frames checksum field is ignored
during calculation and replaced with the calculated value.
IPv6 headers do not have a checksum field; thus, the COE does not modify IPv6 header
fields.
The result of this IP header checksum calculation is indicated by the IP Header Error
status bit in the Transmit status (Bit 16 in Table 15-9). This status bit is set whenever the
values of the Ethernet Type field and the IP headers Version field are not consistent, or
when the Ethernet frame does not have enough data, as indicated by the IP header
Length field.
In other words, this bit is set when an IP header error is asserted under the following
circumstances:
Error status bit when it detects that the frame has been forwarded to the MAC
Transmitter engine in Store-and-Forward mode without the end-of-frame being written to
the FIFO, or when the packet ends before the number of bytes indicated by the Payload
Length field in the IP Header is received. When the packet is longer than the indicated
payload length, the COE ignores them as stuff bytes, and no error is reported. When this
engine detects the first type of error, it does not modify the TCP, UDP, or ICMP header.
For the second error type, it still inserts the calculated checksum into the corresponding
header field.
Receive Operation
During an Rx operation, the MTL is slaved to the ETH. The general sequence of Receive
operation events is as follows:
1. When the ETH receives a frame, it pushes in data along with byte enables. The ETH
also indicates the SOF and EOF. The MTL accepts the data and pushes it into the
Rx FIFO. After the EOF is transferred, the ETH drives the status word, which is also
pushed into the same Rx FIFO by the MTL.
2. When IEEE 1588 time stamping is enabled and the 64-bit time stamp is available
along with the receive status, it is appended to the frame received from the ETH and
is pushed into the RxFIFO before the corresponding receive status word is written.
Thus, two additional locations per frame are taken for storing the time stamp in the
RxFIFO.
3. The MTL_RX engine takes the data out of the FIFO and sends it to the DMA. In the
default Cut-Through mode, when 64 bytes (configured with the
ETH0_OPERATION_MODE.RTC bits or a full packet of data are received into the
FIFO, the MTL_RX engine pops out the data and indicates its availability to the DMA.
Once the DMA initiates the transfer to the Bus interface, the MTL_RX engine
continues to transfer data from the FIFO until a complete packet has been
transferred. Upon completion of the EOF frame transfer, the MTL pops out the status
word and sends it to the DMA controller.
4. In Rx FIFO Store-and-Forward mode (configured by the Operation Mode.RSF bit), a
frame is read out only after being written completely into the Receive FIFO. In this
mode, all error frames are dropped (if the core is configured to do so) such that only
valid frames are read out and forwarded to the application. In Cut-Through mode,
some error frames are not dropped, because the error status is received at the end-
of-frame, by which time the start of that frame has already been read out of the FIFO.
Note: The time-stamp transfer takes two clock cycles and the lower 32-bit of the time-
stamp is given out first. The status also may be extended to two cycles when
Advanced Time-stamp feature is enabled.
Error Handling
If the MTL Rx FIFO is full before it receives the EOF data from the ETH, an overflow is
declared, the whole frame (including the status word) is dropped, and the overflow
counter in the DMA
(ETH0_MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER Register) is
incremented. This is true even if the Forward Error Frame
(ETH0_OPERATION_MODE.FEF bit) is set. If the start address of such a frame has
already been transferred to the Read Controller, the rest of the frame is dropped and a
dummy EOF is written to the FIFO along with the status word. The status will indicate a
partial frame due to overflow. In such frames, the Frame Length field is invalid.
The MTL Rx Control logic can filter error and undersized frames, if enabled (using the
Operation Mode.FEF and Operation Mode.FUF bits). If the start address of such a frame
has already been transferred to the Rx FIFO Read Controller, that frame is not filtered.
The start address of the frame is transferred to the Read Controller after the frame
crosses the receive threshold (set by the Operation Mode.RTC bits).
If the MTL Receive FIFO is configured to operate in Store-and-Forward mode, all error
frames can be filtered and dropped.
and RDES4 in Receive Descriptor, except that bits 31, 14, 9, and 8 of normal
status is reserved and have a reset value of 0B. When the status of a partial frame
due to overflow is given out, the Frame Length field in the status word is not valid.
Buffer 1 Buffer 1
Descriptor 0 Descriptor 0
Buffer 2
Buffer 1
Descriptor 1
Buffer 2
Buffer 1
Descriptor 1
Buffer 1
Descriptor 2
Buffer 2
Buffer 1
Descriptor 2
Buffer 1
Descriptor n
Buffer 2
Next Descriptor
Descriptor_Ring_and_Chain_Structure.vsd
15.2.3.1 Initialization
Initialization for the ETH is as follows.
1. Write to ETH0_BUS_MODE Register to set XMC4500 bus access parameters.
2. Write to ETH0_INTERRUPT_ENABLE Register to mask unnecessary interrupt
causes.
3. The software driver creates the Transmit and Receive descriptor lists. Then it writes
to both DMA ETH0_RECEIVE_DESCRIPTOR_LIST_ADDRESS Register and DMA
ETH0_TRANSMIT_DESCRIPTOR_LIST_ADDRESS Register, providing the DMA
with the starting address of each list.
bytes, even though the buffer size is programmed as 1024 bytes, due to the start
address offset.
DMA Arbiter
The arbiter inside the DMA module performs the arbitration between the Transmit and
Receive channel accesses to the Bus Master interface. Two types of arbitrations are
possible: round-robin, and fixed-priority.
When round-robin arbitration is selected (ETH0_BUS_MODE.DA bit is reset), the arbiter
allocates the data bus in the ratio set by the Bus Mode.PR Bits , when both Transmit and
Receive DMAs are requesting for access simultaneously. When the DA bit is set, the
Receive DMA always gets priority over the Transmit DMA for data access.
15.2.3.2 Transmission
The Transmit DMA engine has two operating modes, default and Opertate Second
Frame (OSF). Both these modes are described below.
descriptor. If time stamping was not enabled for this frame, the DMA does not alter
the contents of TDES2RAM and TDES3RAM .
8. Transmit Interrupt (ETH0_STATUS.TI ) is set after completing transmission of a
frame that has Interrupt on Completion (TDES1[31]RAM ) set in its Last Descriptor. The
DMA engine then returns to Step 2.
9. In the Suspend state, the DMA tries to re-acquire the descriptor (and thereby return
to Step 2) when it receives a Transmit Poll demand and the Underflow Interrupt
Status bit is cleared.
The TxDMA transmission flow in default mode is shown in Figure 15-3.
No
(AHB)
Yes
err or?
No
Fram e xfer
No
com plete?
Yes
No
(AHB)
No Yes
err or?
Transmit Descriptor list for the second frame. If the second frame is valid, the transmit
process transfers this frame before writing the first frames status information.
In OSF mode, the Run state Transmit DMA operates in the following sequence:
1. The DMA operates as described in Step 1Step 5 of the TxDMA (default mode).
2. Without closing the previous frames last descriptor, the DMA fetches the next
descriptor.
3. If the DMA owns the acquired descriptor, the DMA decodes the transmit buffer
address in this descriptor. If the DMA does not own the descriptor, the DMA goes into
Suspend mode and skips to Step 6.
4. The DMA fetches the Transmit frame from the XMC4500 memory and transfers the
frame to the MTL until the End-of-Frame data is transferred, closing the intermediate
descriptors if this frame is split across multiple descriptors.
5. The DMA waits for the previous frames frame transmission status and time stamp.
Once the status is available, the DMA writes the time stamp to TDES2RAM and
TDES3RAM , if such time stamp was captured (as indicated by a status bit). The DMA
then writes the status, with a cleared Own bit, to the corresponding TDES0RAM , thus
closing the descriptor. If time stamping was not enabled for the previous frame, the
DMA does not alter the contents of TDES2RAM and TDES3RAM .
6. If enabled, the Transmit interrupt is set, the DMA fetches the next descriptor, then
proceeds to Step 2 (when Status is normal). If the previous transmission status
shows an underflow error, the DMA goes into Suspend mode (Step 6).
7. In Suspend mode, if a pending status and time stamp are received from the MTL, the
DMA writes the time stamp (if enabled for the current frame) to TDES2RAM and
TDES3RAM , then writes the status to the corresponding TDES0RAM . It then sets relevant
interrupts and returns to Suspend mode.
8. The DMA can exit Suspend mode and enter the Run state (go to Step 1 or Step 2
depending on pending status) only after receiving a Transmit Poll demand (
ETH0_TRANSMIT_POLL_DEMAND Register).
Note: As the DMA fetches the next descriptor in advance before closing the current
descriptor, the descriptor chain should have more than 2 different descriptors for
correct and proper operation.
The basic flow is charted in Figure 15-4.
( Re-)fetch next
descriptor
(AH B)
Po ll Ye s
er ror ?
d em an d
No
(AHB) (AH B)
No error? No
er ror ?
Yes
Yes
Frames can be data-chained and can span several buffers. Frames must be delimited
by the First Descriptor (TDES1[29]RAM ) and the Last Descriptor (TDES1[30]RAM ),
respectively.
As transmission starts, the First Descriptor must have (TDES1[29]RAM ) set. When this
occurs, frame data transfers from the XMC4500 RAM buffer to the MTL Transmit FIFO.
Concurrently, if the current frame has the Last Descriptor (TDES1[30]RAM ) clear, the
Transmit Process attempts to acquire the Next Descriptor. The Transmit Process
expects this descriptor to have TDES1[29]RAM clear. If TDES1[30]RAM is clear, it indicates
an intermediary buffer. If TDES1[30]RAM is set, it indicates the last buffer of the frame.
After the last buffer of the frame has been transmitted, the DMA writes back the final
status information to the Transmit Descriptor 0 (TDES0RAM ) word of the descriptor that
has the last segment set in Transmit Descriptor 1 (TDES1[30]RAM ). At this time, if Interrupt
on Completion (TDES1[31]RAM) was set, Transmit Interrupt (ETH0_STATUS.TI) is set, the
Next Descriptor is fetched, and the process repeats.
Actual frame transmission begins after the MTL Transmit FIFO has reached either a
programmable transmit threshold (ETH0_OPERATION_MODE.TTC ), or a full frame is
contained in the FIFO. There is also an option for Store and Forward Mode (Operation
Mode.TSF ). Descriptors are released (Own bit TDES0[31]RAM clears) when the DMA
finishes transferring the frame.
15.2.3.3 Reception
The Receive DMA engines reception sequence is depicted in Figure 15-5 and proceeds
as follows:
1. The CPU sets up Receive descriptors (RDES0RAM -RDES3RAM ) and sets the Own bit
(RDES0[31RAM ).
2. Once the ETH0_OPERATION_MODE.SR bit is set, the DMA enters the Run state.
While in the Run state, the DMA polls the Receive Descriptor list, attempting to
acquire free descriptors. If the fetched descriptor is not free (is owned by the CPU),
the DMA enters the Suspend state and jumps to Step 8.
3. The DMA decodes the receive data buffer address from the acquired descriptors.
4. Incoming frames are processed and placed in the acquired descriptors data buffers.
5. When the buffer is full or the frame transfer is complete, the Receive engine fetches
the next descriptor.
6. If the current frame transfer is complete, the DMA proceeds to Step 6. If the DMA
does not own the next fetched descriptor and the frame transfer is not complete (EOF
is not yet transferred), the DMA sets the Descriptor Error bit in the RDES0 (unless
flushing is disabled). The DMA closes the current descriptor (clears the Own bit) and
marks it as intermediate by clearing the Last Segment (LS) bit in the RDES0 value
(marks it as Last Descriptor if flushing is not disabled), then proceeds to Step 7. If the
DMA does own the next descriptor but the current frame transfer is not complete, the
DMA closes the current descriptor as intermediate and reverts to Step 3.
7. If IEEE 1588 time stamping is enabled, the DMA writes the time stamp (if available)
to the current descriptors RDES2RAM and RDES3RAM. It then takes the receive frames
status from the MTL and writes the status word to the current descriptors RDES0RAM,
with the Own bit cleared and the Last Segment bit set.
8. The Receive engine checks the latest descriptors Own bit. If the CPU owns the
descriptor (Own bit is 1'b0) the Receive Buffer Unavailable bit ( ETH0_STATUS.RU
) is set and the DMA Receive engine enters the Suspended state (Step 8). If the DMA
owns the descriptor, the engine returns to Step 3 and awaits the next frame.
9. Before the Receive engine enters the Suspend state, partial frames are flushed from
the Receive FIFO (You can control flushing using Operation Mode.DFF ).
10. The Receive DMA exits the Suspend state when a Receive Poll demand is given or
the start of next frame is available from the MTLs Receive FIFO. The engine
proceeds to Step 1 and refetches the next descriptor.
(AHB)
RxDMA suspended Yes
error?
No
Yes
Frame transfer
No Own bit set?
complete?
No Yes
Frame data
Yes Flush disabled? No
available?
No Yes
Flush the
Write data to buffer(s) Wait for frame data
remaining frame
(AHB)
Yes
error?
No
(AHB)
Yes
error?
No
No
Yes Yes Yes
No
(AHB)
No
error?
Yes
RxDMA.vsd
Otherwise (that is, if time stamping is not enabled), the RDES2RAM and RDES3RAM remain
unchanged.
15.2.3.4 Interrupts
Interrupts can be generated as a result of various events. The ETH0_STATUS Register
contains all the bits that might cause an interrupt. The ETH0_INTERRUPT_ENABLE
Register contains an enable bit for each of the events that can cause an interrupt.
There are two groups of interrupts, Normal and Abnormal, as described in the STATUS
Register. Interrupts are cleared by writing 1B to the corresponding bit position. When all
the enabled interrupts within a group are cleared, the corresponding summary bit is
cleared. When both the summary bits are cleared, the interrupt signal to the NVIC is
deasserted. If the ETH core is the cause for assertion of the interrupt, then any of the
ELI, EMI, or EPI bits of DMA STATUS Register will be set high.
Note: The interrupt signal to the NVIC will be asserted due to any event in the DMA
STATUS register only if the corresponding interrupt enable bit is set in DMA
Interrupt Enable Register.
Interrupts are not queued and if the interrupt event occurs before the driver has
responded to it, no additional interrupts are generated. For example, Receive Interrupt
(STATUS.RI) indicates that one or more frames was transferred to the XMC4500 RAM
buffer. The driver must scan all descriptors, from the last recorded position to the first
one owned by the DMA.
An interrupt is generated only once for simultaneous, multiple events. The driver must
scan the STATUS Register for the cause of the interrupt. The interrupt is not generated
again unless a new interrupting event occurs, after the driver has cleared the appropriate
bit in the STATUS Register . For example, the controller generates a Receive interrupt
(DMA STATUS.RI) and the driver begins reading the STATUS Register. Next, Receive
Buffer Unavailable ( STATUS Register ) occurs. The driver clears the Receive interrupt.
Even then, the DMA interupt signal to the NVIC is not deasserted, due to the active or
pending Receive Buffer Unavailable interrupt.
An interrupt timer ( ETH0_RECEIVE_INTERRUPT_WATCHDOG_TIMER) is given for
flexible control of Receive Interrupt (STATUS.RI). When this Interrupt timer is
programmed with a non-zero value, it will get activated as soon as the RxDMA
31 23 15 7 0
O
W Status [30:0]
DES0
N
DES1 Control Bits [9:0] Byte Count Buffer2 [10:0] Byte Count Buffer1[10:0]
Receive Descriptor
The ETH Subsystem requires at least two descriptors when receiving a frame. The
Receive state machine of the DMA (in the ETH Subsystem) always attempts to acquire
an extra descriptor in anticipation of an incoming frame. (The size of the incoming frame
is unknown). Before the RxDMA closes a descriptor, it will attempt to acquire the next
descriptor even if no frames are received.
In a single descriptor (receive) system, the subsystem will generate a descriptor error if
the receive buffer is unable to accommodate the incoming frame and the next descriptor
is not owned by the DMA. Thus, the CPU is forced to increase either its descriptor pool
or the buffer size. Otherwise, the subsystem starts dropping all incoming frames.
31 0
O
RDES0 W Status
N
The permutations of bits 5, 7, and 0 reflect the conditions discussed in Table 15-5.
RDES1RAM contains the buffer sizes and other bits that control the descriptor chain/ring.
Note: See Buffer Size Calculations for further detail on calculating buffer sizes.
Transmit Descriptor
The descriptor addresses must be aligned to the 32 bit word boundary . Figure 15-8
shows the transmit descriptor format.
Each descriptor is provided with two buffers, two byte-count buffers, and two address
pointers, which enable the adapter port to be compatible with various types of memory-
management schemes.
31 0
O
TDES0 W Status
N
31 1
DES0
DES1
Figure 15-9 Receive Descriptor Fields When DMA Clears the Own Bit
The following sections describe the details specific to receive and transmit descriptors in
this mode.
Receive Descriptor
Transmit Descriptor
In addition to the changes described in Descriptor Format With IEEE 1588 Time
Stamping Enabled on Page 15-53, the Transmit descriptor has additional control and
status bits (TTSE and TTSS, respectively) for time stamping, as shown in Figure 15-10.
Software sets the TTSE bit (when the Own bit is set), instructing the core to generate a
time stamp for the corresponding Ethernet frame being transmitted. The DMA sets the
TTSS bit if the time stamp has been updated in the TDES2RAM and TDES3RAM fields when
the descriptor is closed (Own bit is cleared).
Transmit_Descriptor_Fields_Normal_Format.vsd
Table 15-15 Transmit Time Stamp Status Normal Descriptor Format Case
(TDES0RAM)
Bit Description
17 TTSS: Transmit Time Stamp Status
This field is a status bit indicating that a time stamp was captured for the
corresponding transmit frame. When this bit is set, both TDES2RAM and
TDES3RAM have a time stamp value that was captured for the transmit frame.
This field is valid only when the Last Segment control bit (TDES1[30]RAM in the
descriptor) is set.
Table 15-16 Transmit Time Stamp Control Normal Descriptor Format Case
(TDES1RAM)
Bit Description
22 TTSE: Transmit Time Stamp Enable
When set, this field enables IEEE1588 hardware time stamping for the transmit
frame described by the descriptor.
This field is valid only when the First Segment control bit (TDES1[29]RAM in the
descriptor) is set.
(MCI). Each register is 32 bits wide. Non-32-bit accesses are allowed as long as the
address is word-aligned.
The organization of these registers is shown in Table 15-27. The MMCs are accessed
using transactions, in the same way the CSR address space is accessed. The following
sections in the chapter describe the various counters and list the address for each of the
statistics counters. This address will be used for Read/Write accesses to the desired
transmit/receive counter.
The Receive MMC counters are updated for frames that are passed by the Address Filter
(AFM) block. Statistics of frames that are dropped by the AFM module are not updated
unless they are runt frames of less than 6 bytes (DA bytes are not received fully).
The MMC module gathers statistics on encapsulated IPv4, IPv6, TCP, UDP, or ICMP
payloads in received Ethernet frames. The address map of the corresponding registers,
0200H02FCH, is given in Table 15-27.
Wake-_Up_Frame_Filter_Register .vsd
Filter i Command
This 4-bit command controls the filter i operation. Bit 3 specifies the address type,
defining the patterns destination address type. When the bit is set, the pattern applies
to only multicast frames; when the bit is reset, the pattern applies only to unicast frame.
Bit 2 and Bit 1 are reserved. Bit 0 is the enable for filter i; if Bit 0 is not set, filter i is
disabled.
Filter i Offset
This register defines the offset (within the frame) from which the frames are examined
by filter i. This 8-bit pattern-offset is the offset for the filter i first byte to examined. The
minimum allowed is 12, which refers to the 13th byte of the frame (offset value 0 refers
to the first byte of the frame).
Filter i CRC-16
This register contains the CRC_16 value calculated from the pattern, as well as the byte
mask programmed to the wake-up filter register block.
Only Magic Packets that are addressed to the device or a broadcast address will be
checked to determine whether they meet the wake-up requirements. Magic Packets that
pass the address filtering (unicast or broadcast) will be checked to determine whether
they meet the remote Wake-on-LAN data format of 6 bytes of all ones followed by a ETH
Address appearing 16 times.
The application enables Magic Packet wake-up by writing a 1 to Bit 1 of the
ETH0_PMT_CONTROL_STATUS register. The PMT block constantly monitors each
frame addressed to the node for a specific Magic Packet pattern. Each frame received
is checked for a FFFF FFFF FFFFH pattern following the destination and source address
field. The PMT block then checks the frame for 16 repetitions of the ETH address without
any breaks or interruptions. In case of a break in the 16 repetitions of the address, the
FFFF FFFF FFFFH pattern is scanned for again in the incoming frame. The 16 repetitions
can be anywhere in the frame, but must be preceded by the synchronization stream
(FFFF FFFF FFFFH). The device will also accept a multicast frame, as long as the 16
duplications of the ETH address are detected.
If the MAC address of a node is 0011 2233 4455H, then the ETH scans for the data
sequence:
Destination Address Source Address .. FF FF FF FF FF FF
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33
44 55
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33
44 55
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33
44 55
00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33
44 55
CRC
Magic Packet detection is updated in the PMT_CONTROL_STATUS register for Magic
Packet received. A PMT interrupt to the Application triggers a read to the PMT CSR to
determine whether a Magic Packet frame has been received.
1. Disable the Transmit DMA (if applicable) and wait for any previous frame
transmissions to complete. These transmissions can be detected when Transmit
Interrupt, ETH0_STATUS.TI is received.
2. Disable the MAC transmitter and MAC receiver by clearing the appropriate bits in the
ETH0_MAC_CONFIGURATION register.
3. Wait until the Receive DMA empties all the frames from the Rx FIFO (a software timer
may be required).
4. Enable Power-Down mode by appropriately configuring the PMT registers.
5. Enable the MAC Receiver and enter Power-Down mode.
6. Gate the application and transmit clock inputs to the core (and other relevant clocks
in the system) to reduce power and enter Sleep mode.
7. On receiving a valid wake-up frame, the ETH asserts the power management
interrupt signal and exits Power-Down mode.
8. On receiving the interrupt, the system must enable the application and transmit clock
inputs to the core.
9. Read the ETH0_PMT_CONTROL_STATUS register to clear the interrupt, then
enable the other modules in the system and resume normal operation.
The application sends the control data to the PHY and receives status information from
the PHY through the SMA module, as shown in Figure 15-12.
SMA_Interface_Block.vsd
PHY REG
IDLE PREAMBLE START OPCODE TA DATA IDLE
ADDR ADDR
Frame_MDIO.vsd
this point, the SMA module starts a Read operation on the MII Management Interface
using the Management Frame Format specified in the MII specifications (Section
22.2.4.5 of IEEE Standard). The application should not change the GMII_ADDRESS
register contents or the GMII_DATA register while the transaction is ongoing. Write
operations to the GMII_ADDRESS register or ETH0_GMII_DATA Register during this
period are ignored (the Busy bit is high) and the transaction completed without any error
on the MCI interface.
After the Read operation has completed, the SMA indicates this to the CSR, which then
resets the Busy bit and updates the GMII_DATA register with the data read from the
PHY. The SMA module divides the CSR (Application) clock with the clock divider
programmed (GMII_ADDRESS.CR bits) to generate the MDC clock for this interface.
The ETH drives the MDIO line for the complete duration of the frame except during the
Data fields when the PHY is driving the MDIO line. The frame format for the Read
operation is as follows:
the current received packet. The two remaining control signals are MII collision detect
(MII_COL) which is asserted by the PHY when an arbitration collision occurs and MII
carrier sense (MII_CRS) which is asserted by the PHY when either Transmit or Recive
are not idle.
MII_TXD[3:0]
MII_RXD[3:0]
MII_TX_EN
MII_RX_DV
ETHMAC MII MII_RX_ERR
CLK_MII_TX
CLK_MII_RX
MIII_CRS
MII_COL
eth_MII.vsd
rst_clk_rmii_n
rst_clk_rx_n MRT
Block rmii_txen (phy_txen_o)
clk_rx_i
rmii_txd (phy_txd[1:0])
clk_rmii_i
mii_rxd
mii_txen
mii_rxdv
mii_txd
mii_crs
mac_speed_i
MRR mii_col
rmii_rxd_i (phy_rxd_i[1:0]) Block
rmii_rxdv (phy_rxdv_i)
RMII_Pinout .vsd
rmii_txd[1:0]
LSB MSB
D0 D1 Di-Bit Stream
LSB D0
D1
mii_txd[3:0]
D2
MSB D3
clk_rx_i
mii_txen
mii_txd[3:0]
clk_rmii_i
rmii_txen (phy_txen_o)
rmii_txd_o (phy_txd_o)[1:0]
Start_MII_and_RMII_Transmission_in_100_Mbs.vsd
Figure 15-19 Start of MII and RMII Transmission in 100 Mbit/s Mode
Figure 15-20 shows the end of frame transmission for MII and RMII in 100 Mbit/s mode.
clk_rx_i
mii_txen
mii_txd[3:0]
clk_rmii_i
xen (phy_txen_o)
(phy_txd_o)[1:0]
End_MII_RMII_Transmission_100 Mbs. vsd
Figure 15-20 End of MII and RMII Transmission in 100 Mbit/s Mode
Figure 15-21 shows the start of MII transmission and the following RMII transmission in
10 Mbit/s mode.
clk_rx_i
mii_txen
mii_txd[3:0]
clk_rmii_i
mii_txen (phy_txen_o)
xd_o (phy_txd_o)[1:0]
Start_ MI_RMII_Transmission_10 Mbs.vsd
clk_rx_i
mii_txen
mii_txd[3:0]
clk_rmii_i
rmii_txen (phy_txen_o)
_txd_o (phy_txd_o)[1:0]
End_ MI_RMII_Transmission_10 Mbs.vsd
rmii_rxd[1:0]
LSB MSB
D0 D1 Di-Bit Stream
LSB D0
D1
mii_rxd[3:0]
D2
MSB D3
Receive_Bit_Ordering.vsd
Nibble Stream
to the descriptors (RDES2 and RDES3), indicating that time stamp is not correct. If the
software uses a control register bit to disable time stamping, the DMA does not alter
RDES2 or RDES3.
Note: When the alternate (enhanced) descriptor is selected, the 64-bit time-stamp is
written in RDES6 and RDES7, respectively. RDES0[7] will indicate whether the
time-stamp is updated in RDES6/7 or not.
timestamp is not required). The message type statuses provided helps you to quickly
identity the message and update the correctionField.
The message type status provided will also help in taking appropriate action
depending on the type of PTP message received.
4. Peer to peer transparent clock support: In this type of clock the computation of the
link delay is based on an exchange of Pdelay_Req, Pdelay_Resp and
Pdelay_Resp_Follow_Up messages with the link peer. Hence support for taking
snapshot for the event messages related to Pdelay is added. Table 15-21.
The transparent clock corrects only the SYNC and Follow-up message. As discussed
earlier this can be achieved using the message status provided.
The type of clock to be implemented will be configurable through
ETH0_TIMESTAMP_CONTROL register. To ensure that the snapshot is taken only
for the messages indicated in the table for the corresponding clock type, the
ETH0_TIMESTAMP_CONTROL.TSEVNTENA bit has to be set.
Table 15-19 PTP Messages for which Snapshot is Taken on Receive Side for
Ordinary Clock
Master Slave
Delay_Req SYNC
Table 15-20 PTP Messages for which Snapshot is Taken for Transparent Clock
Implementation
SYNC
FOLLOW_UP
Table 15-21 PTP Messages for which Snapshot is Taken for Peer-to-Peer
Transparent Clock Implementation
SYNC
Pdelay_Req
Pdelay_Resp
There are some fields in the PTP frame that are used to detect the type and control the
snapshot to be taken. This is different for PTP frames sent directly over Ethernet, PTP
frames sent over UDP / IPv4 and PTP frames that are sent over UDP / IPv6. The
following sections provide information on the fields that are used to control taking the
snapshot.
Table 15-23 IPv4-UDP PTP Frame Fields Required for Control and Status
Field Matched Octet Matched Value Description
Position
MAC Frame type 12, 13 0800H IPv4 datagram
IP Version and 14 45H IP version is IPv4
Header Length
Layer-4 protocol 23 11H UDP
Table 15-23 IPv4-UDP PTP Frame Fields Required for Control and Status (contd)
Field Matched Octet Matched Value Description
Position
IP Multicast address 30, 31, 32, E0H,00H, Multicast IPv4 addresses
(IEEE 1588 version 33 01H,81H allowed.
1) (or 82H or 83H or 224.0.1.129
84H) 224.0.1.130
224.0.1.131
224.0.1.132
IP Multicast address 30, 31, 32, E0H, 00H, 01H, PTP-primary multicast address:
(IEEE 1588 version 33 81H 224.0.1.129
2) E0H, 00H, 00H, PTP-Pdelay multicast address:
6BH 224.0.0.107
UDP destination 36, 37 013FH, 013FH PTP event message1)
port 0140H 0140H PTP general messages
PTP control field 74 00H/01H/02H/03H 00H SYNC,
(IEEE version 1) /04H 01H Delay_Req,
02H Follow_Up
03H Delay_Resp
04H Management
PTP Message Type 42 (nibble) 0H/1H/2H/3H/8H/9 0H SYNC
Field (IEEE version H/BH/CH/DH 1H Delay_Req
2) 2H Pdelay_Req
3H Pdelay_Resp
8H Follow_Up
9H Delay_Resp
AH Pdelay_Resp_Follow_Up
BH Announce
CH Signaling
DH - Management
PTP version field 43 (nibble) 1H or 2H 1 Supports PTP version 1
2 Supports PTP version 2
1) PTP event messages are SYNC, Delay_Req (IEEE 1588 version 1 and 2) or Pdelay_Req, Pdelay_Resp (IEEE
1588 version 2 only).
Table 15-24 IPv6-UDP PTP Frame Fields Required for Control and Status
Field Matched Octet Matched Value Description
Position
MAC Frame type 12, 13 86DDH IP datagram
IP version 14 (bits 6H IP version is IPv6
[7:4])
Layer-4 protocol 201) 11H UDP
PTP Multicast 38 53 FF0:0:0:0:0:0:0:1 PTP primary multicast
address 81H address:
FF02:0:0:0:0:0:0: FF0:0:0:0:0:0:0:0:0:181H
6BH PTP Pdelay multicast
address:
FF02:0:0:0:0:0:0:0:0:6BH
UDP destination 56, 57 013FH, 140H 013FH PTP event message
port (*) 0140H PTP general messages
PTP control field 93 (*) 00H/01H/02H/03H/ 00H SYNC,
(IEEE 1588 Version 04H 01H Delay_Req,
1) 02H Follow_Up
03H Delay_Resp
04H Management (version1)
PTP Message Type 74 (*) 0H/1H/2H/3H/8H/9 0H SYNC
Field (IEEE version (nibble) H/BH/CH/DH 1H Delay_Req
2) 2H Pdelay_Req
3H Pdelay_Resp
8H Follow_Up
9H Delay_Resp
AH Pdelay_Resp_Follow_Up
BH Announce
CH Signaling
DH - Management
PTP version field 75 (nibble) 1H or 2H 1H Supports PTP version 1
2H Supports PTP version 2
1) The Extension Header is not defined for PTP packets.
for tagged frames will be offset by 4. This is based on Appendix-E of the IEEE 1588-2008
standard and the message format defined in Table 15-22.
Table 15-25 Ethernet PTP Frame Fields Required for Control And Status
Field Matched Octet Matched Value Description
Position
MAC Frame type 12, 13 88F7H PTP Ethernet frame.
PTP control field 45 00H/01H/02H/ 00H SYNC
(IEEE Version 1) 03H/04H 01H Delay_Req
02H Follow_Up
03H Delay_Resp
04H Management
PTP Message Type 14 (nibble) 0H/1H/2H/3H/8H/9H/B 0H SYNC
Field (IEEE version H/ CH/DH 1H Delay_Req
2) 2H Pdelay_Req
3H Pdelay_Resp
8H Follow_Up
9H Delay_Resp
AH
Pdelay_Resp_Follow_Up
BH Announce
CH Signaling
DH Management
MAC Destination 0-5 01-1B-19-00-00- All except peer delay
multicast address1) 00H messages - 01-1B-19-00-00-
01-80-C2-00-00- 00H
0EH Pdelay messages - 01-80-
C2-00-00-0EH
PTP version field 15 (nibble) 1H or 2H 1H Supports PTP version 1
2H Supports PTP version 2
1) In addition, the address match of destination addresses (DA) programmed in MAC address 1 to 31 will be
used, if the control bit 18 (TSENMACADDR: Enable MAC address for PTP frame filtering) of the Time Stamp
Control register is set.
b) UInteger32-nanoseconds field
The seconds field is the integer portion of the timestamp in units of seconds. The
nanoseconds field is the fractional portion of the timestamp in units of
nanoseconds. E.g. 2.000000001 seconds is represented as secondsField = 0000
0000 0002H and nanoSeconds = 0000 0001H. Thus the maximum value in
nanoseconds field in this format will be 3B9A C9FFH value (i.e (10e9-1) nano-
seconds). This is defined as digital rollover mode of operation. It will also support
the older mode in which the nano-seconds field will roll-over and increment the
seconds field after the value of 7FFF FFFFH. (Accuracy is ~0.466 ns per bit). This
is defined as the binary rollover mode. The modes can be controlled using the
ETH0_TIMESTAMP_CONTROL.TSCTRLSSR bit.
2. When the Advanced IEEE 1588 time-stamp feature is selected time maintained in the
core will still be 64-bit wide, as the overflow to the upper 16-bits of seconds register
happens once in 130 years. The value of the upper 16-bits of the seconds field can
only be obtained from the CSR register.
3. There is also a pulse-per-second output given to indicate 1 second interval (default).
Option is provided to change the interval in the ETH0_PPS_CONTROL Register.
4.
6. Enable the node to be a Master or Slave. This will control the type of messages for
which snap-shot will be taken (this depends on the type of clock that is selected and
is valid for ordinary or boundary clock only).
Note that PTP messages over VLAN frames are also supported.
addend_val[31:0]
addend_updt
Addend register
Accumulator register
Constant value
incr_sub_sec_reg
+
Sub-second register
incr_sec_reg
Second register
System_Time_Update_Using_Fine_Method.vsd
In Figure 15-26, the constant value used to accumulate the sub-second register is
decimal 43, which achieves an accuracy of 20 ns in the system time (in other words, it is
incremented in 20-ns steps). Two different methods are used to update the System Time
register, depending on which configuration you choose (See Block Diagram).
The software must calculate the drift in frequency based on the Sync messages and
update the Addend register accordingly.
Initially, the slave clock is set with FreqCompensationValue0 in the Addend register. This
value is as follows:
FreqCompensationValue0 = 232 / FreqDivisionRatio
If MasterToSlaveDelay is initially assumed to be the same for consecutive Sync
messages, the algorithm described below must be applied. After a few Sync cycles,
frequency lock occurs. The slave clock can then determine a precise
MasterToSlaveDelay value and re-synchronize with the master using the new value.
The algorithm is as follows:
At time MasterSyncTimen the master sends the slave clock a Sync message. The
slave receives this message when its local clock is SlaveClockTimen and computes
MasterClockTimen as:
MasterClockTimen = MasterSyncTimen + MasterToSlaveDelayn
The master clock count for current Sync cycle, MasterClockCountn is given by:
MasterClockCountn = MasterClockTimen MasterClockTimen 1 (assuming that
MasterToSlaveDelay is the same for Sync cycles n and n 1)
The slave clock count for current Sync cycle, SlaveClockCountn is given by:
SlaveClockCountn = SlaveClockTimen SlaveClockTimen 1
The difference between master and slave clock counts for current Sync cycle,
ClockDiffCountn is given by:
ClockDiffCountn = MasterClockCountn SlaveClockCountn
The frequency-scaling factor for slave clock, FreqScaleFactorn is given by:
FreqScaleFactorn = (MasterClockCountn + ClockDiffCountn) / SlaveClockCountn
The frequency compensation value for Addend register, FreqCompensationValuen is
given by:
FreqCompensationValuen = FreqScaleFactorn * FreqCompensationValuen 1
In theory, this algorithm achieves lock in one Sync cycle; however, it may take several
cycles, due to changing network propagation delays and operating conditions.
This algorithm is self-correcting: if for any reason the slave clock is initially set to a value
from the master that is incorrect, the algorithm will correct it at the cost of more Sync
cycles.
CSR space. The DMA can be used in applications where DMA is required to optimize
data transfer between the ETH and system memory.
The Bus Master interface converts the internal DMA request cycles into Bus cycles.
Characteristics of this interface include the following:
You can choose fixed burst length of SINGLE, INCR4, INCR8 by programming the
ETH0_BUS_MODE.MB bits
When transfering fixed burst length data , the Bus master always initiates a burst
with SINGLE or INCR4/8type. But when such a burst is responded with
SPLIT/RETRY/early burst termination, the Bus master will re-initiate the pending
transfers of the burst with INCR or SINGLE burst-length type. It will terminate such
INCR bursts when the original requested fixed-burst is transferred. In Fixed
Burst-Length mode, if the DMA requests a burst transfer that is not equal to
INCR4/8, the Bus interface splits the transfer into multiple burst transactions. For
example, if the DMA requests a 15-beat burst transfer, the Bus interface splits it
into multiple transfers of INCR8 and INCR4 and 3 SINGLE transactions.
Takes care of Bus SPLIT, RETRY, and ERROR conditions. Any ERROR response
will halt all further transactions for that DMA, and indicate the error as fatal through
the CSR and interrupt. The application must give a hard or soft reset to the module
to restart the operation.
Takes care of Bus 1K boundary breaking
Handles all data transfers, except for Descriptor Status Write accesses (which are
always 32-bit). In any burst data transfer, the address bus value is always aligned to
the data bus width and need not be aligned to the beat size.
All Bus burst transfers can be aligned to an address value by enabling the
ETH0_BUS_MODE.AAL bit. If both the FB and AAL bits are set to 1, the Bus
interface and the DMA together ensure that all initiated beats are aligned to the
address, completing the frame transfer in the minimum number of required beats.
For example, if a data buffer transfers start address is F000 0008H and the DMA is
configured for a maximum beat size of, the Bus transfers occur in the following
sequence:
2 SINGLE transfers at addresses F000 0008H and F000 000CH
1 INCR4 transfer at address F000 0010H
The DMA Controller requests an Bus Burst Read transfer only when it can accept the
received burst data completely. Data read from the Bus is always pushed into the
DMA without any delay or BUSY cycles.
The DMA requests an Bus Burst Write transfer only when it has the sufficient data to
transfer the burst completely. The Bus interface always assumes that it has data
available to push into the bus. However, the DMA can prematurely indicate end-of-
valid data (due to the transfer of end-of-frame of an Ethernet frame) during the burst.
The Bus Master interface continues the burst with dummy data until the specified
length is completed.
The Bus 32-bit Slave interface provides access to the DMA and ETH CSR space.
Characteristics of this interface include the following:
Supports single and INCR4/8transfers
Supports busy and early terminations
Supports 32-bit, 16-bit, and 8-bit write/read transfers to the CSR; 32-bit access to the
CSR are recommended to avoid any SW synchronization problems.
Generates OKAY only response; does not generate SPLIT, RETRY, or ERROR
responses.
Transmit
Transmit Buffer Unavailable
Receive AND
Early Receive
Normal Interrupt Enable
Transmit Process stopped
Transmit Jabber Timeout
Receive Overflow
Transmit Underflow
Receive Buffer Unavailable AND
Receive process Stopped Interrupt Mask Register
Receive Watchdog Timeout
Early Transmit Abnormal Interrupt Enable
PMT Interrupt Mask
Fatal Bus Error
Interrupt Enable Register
AND
Wake Up Frame
PMT Control and Status Register
Timestamp Trigger
Timestamp Control Register AND
15.4 Debug
Module specific debug behaviour TBD
In addition the ETH has a number of intrinsic features to assist debugging, these are
described below.
The DEBUG register provides flags which indicate the operating status of the ETH
MAC and MTL.
The STATUS register provides information on the operating status of the DMA.
The MAC Management Counters provide extensive information about the Received
and transmitted Ethernet frames.
The MAC_CONFIGURATION.LM bit places the ETH in internal loopback mode for
self test and debug
External loopback is supported via the integrated MDIO controlling the PHY
TheCURRENT_HOST_TRANSMIT_DESCRIPTOR and
CURRENT_HOST_RECEIVE_DESCRIPTOR provide pointers to the current
location of the transmit and receive frame buffers held in RAM
The module, including all registers, can be reset to its default state by a system reset or
a software reset triggered through the setting of corresponding bits in PRSETx
registers.
The module has the following input clocks:
Important
After the XMC4500 is released from reset the ETH module remains held in reset. While
the ETH is held in reset the software driver must select the PHY interconnect see
Section 15.2.7.1 . Once the PHY interconnect has been selected ETH reset line must
be deasserted by setting PRCLR2.ETH0RS in the system control unit.
0000 H
ETH Core
00DCH
Reserved
0100 H
ETH MAC
Management
Counters
0288 H
Reserved
0700 H
IEEE1588
System time
module
07FCH
Reserved
1000 H
ETH DMA
1058 H
eth_Memory_map.vsd
MAC_CONFIGURATION
The MAC Configuration register establishes receive and transmit operating modes.
ETH0_MAC_CONFIGURATION
MAC Configuration Register (0H) Reset Value: 0000 8000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Rese Rese
2KP DCR
rved SARC rved CST TC WD JD BE JE IFG
E S
_31 _26
r r rw r rw r rw rw r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese
Rese
FES DO LM DM IPC DR rved ACS BL DC TE RE PRELEN
rved
_8
r rw rw rw rw rw rw r rw rw rw rw rw rw
* 10B:
- If Bit 30 is set to 0, the MAC inserts the content of the
MAC Address 0 registers
(ETH0_MAC_ADDRESS0_HIGH and
ETH0_MAC_ADDRESS0_LOW ) in the SA field of all
transmitted frames.
- If Bit 30 is set to 1 the MAC inserts the content of the
MAC Address 1 registers
(ETH0_MAC_ADDRESS1_HIGH and
ETH0_MAC_ADDRESS1_LOW) in the SA field of all
transmitted frames.
* 11B:
- If Bit 30 is set to 0, the MAC replaces the content of the
MAC Address 0 registers
(ETH0_MAC_ADDRESS0_HIGH and
ETH0_MAC_ADDRESS0_LOW) in the SA field of all
transmitted frames.
- If Bit 30 is set to 1 and the Enable MAC Address
Register 1 option is selected during core configuration,
the MAC replaces the content of the MAC Address 1
registers (ETH0_MAC_ADDRESS1_HIGH and
ETH0_MAC_ADDRESS1_LOW) in the SA field of all
transmitted frames.
Note:
- Changes to this field take effect only on the start of a
frame. If you write this register field when a frame is
being transmitted, only the subsequent frame can use
the updated value, that is, the current frame does not
use the updated value.
Reserved_ 31 r Reserved
31
MAC_FRAME_FILTER
The MAC Frame Filter register contains the filter controls for receiving frames. Some of
the controls from this register go to the address check block of the MAC, which performs
the first level of address filtering. The second level of filtering is performed on the
incoming frame, based on other controls such as Pass Bad Frames and Pass Control
Frames.
ETH0_MAC_FRAME_FILTER
MAC Frame Filter (4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DNT VTF
RA Reserved_30_22 IPFE Reserved_19_17
U E
rw r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
r rw rw rw rw rw rw rw rw rw rw
HASH_TABLE_HIGH
The 64-bit Hash table is used for group address filtering. For hash filtering, the contents
of the destination address in the incoming frame is passed through the CRC logic, and
the upper 6 bits of the CRC register are used to index the contents of the Hash table.
The most significant bit determines the register to be used (Hash Table High or Hash
Table Low), and the other 5 bits determine which bit within the register. A hash value of
00000B selects Bit 0 of the selected register, and a value of 11111B selects Bit 31 of the
selected register. The hash value of the destination address is calculated in the following
way:
1. Calculate the 32-bit CRC for the DA (See IEEE 802.3, Section 3.2.8 for the steps to
calculate CRC32).
2. Perform bitwise reversal for the value obtained in Step 1.
3. Take the upper 6 bits from the value obtained in Step 2.
For example, if the DA of the incoming frame is received as 1F52 419C B6AFH (1FH is
the first byte received on MII interface), then the internally calculated 6-bit Hash value is
2CH and Bit 12 of Hash Table High register is checked for filtering. If the DA of the
incoming frame is received as A00A 9800 0045H, then the calculated 6-bit Hash value
is 07H and Bit 7 of Hash Table Low register is checked for filtering. Note: To help you
program the hash table, a sample C routine that generates a DA's 6-bit hash is included
in the /sample_codes/ directory of your workspace. If the corresponding bit value of the
register is 1, the frame is accepted. Otherwise, it is rejected. If the PM (Pass All Multicast)
bit is set in the MAC Frame Filter Register, then all multicast frames are accepted
regardless of the multicast hash values. If the Hash Table register is configured to be
double-synchronized to the MII clock domain, the synchronization is triggered only when
Bits[31:24] (in little-endian mode) of the Hash Table High or Low registers are written.
Consecutive writes to these register should be performed only after at least four clock
cycles in the destination clock domain when double-synchronization is enabled. The
Hash Table High register contains the higher 32 bits of the Hash table.
ETH0_HASH_TABLE_HIGH
Hash Table High Register (8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HTH
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HTH
rw
HASH_TABLE_LOW
The Hash Table Low register contains the lower 32 bits of the Hash table. Both Register
2 and Register 3 are reserved if the Hash Filter Function is disabled or the 128-bit or 256-
bit Hash Table is selected during core configuration.
ETH0_HASH_TABLE_LOW
Hash Table Low Register (CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HTL
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HTL
rw
GMII_ADDRESS
The MII Address register controls the management cycles to the external PHY through
the management interface.
ETH0_GMII_ADDRESS
MII Address Register (10H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_16
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PA MR CR MW MB
rw rw rw rw rw
GMII_DATA
The MII Data register stores Write data to be written to the PHY register located at the
address specified in the MII Address Register. This register also stores the Read data
from the PHY register located at the address specified by the MII Address Register.
ETH0_GMII_DATA
MII Data Register (14H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_16
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MD
rw
FLOW_CONTROL
The Flow Control register controls the generation and reception of the Control (Pause
Command) frames by the MAC's Flow control module. A Write to a register with the Busy
bit set to '1' triggers the Flow Control block to generate a Pause Control frame. The fields
of the control frame are selected as specified in the 802.3x specification, and the Pause
Time value from this register is used in the Pause Time field of the control frame. The
Busy bit remains set until the control frame is transferred onto the cable. The CPU must
make sure that the Busy bit is cleared before writing to the register.
ETH0_FLOW_CONTROL
Flow Control Register (18H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PT
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese FCA
DZP
Reserved_15_8 rved PLT UP RFE TFE _BP
Q
_6 A
r rw r rw rw rw rw rw
VLAN_TAG
The VLAN Tag register contains the IEEE 802.1Q VLAN Tag to identify the VLAN
frames. The MAC compares the 13th and 14th bytes of the receiving frame
(Length/Type) with 8100H, and the following two bytes are compared with the VLAN tag.
If a match occurs, the MAC sets the received VLAN bit in the receive frame status. The
legal length of the frame is increased from 1,518 bytes to 1,522 bytes. If the VLAN Tag
register is configured to be double-synchronized to the MII clock domain, then
consecutive writes to these register should be performed only after at least four clock
cycles in the destination clock domain.
ETH0_VLAN_TAG
VLAN Tag Register (1CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VTH ESV
Reserved_31_20 VTIM ETV
M L
r r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VL
rw
VERSION
The VERSION registers identifies the version of the ETH. This register contains two
bytes: one that Synopsys uses to identify the core release number, and the other that
you set during core configuration.
ETH0_VERSION
Version Register (20H) Reset Value: 0000 1037H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_16
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
USERVER SNPSVER
r r
DEBUG
The DEBUG register gives the status of all main modules of the transmit and receive
data-paths and the FIFOs. An all-zero status indicates that the MAC is in idle state (and
FIFOs are empty) and no activity is going on in the data-paths.
ETH0_DEBUG
Debug Register (24H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXS Rese TXP
TXF TWC TPE
Reserved_31_26 TSF rved TRCSTS AUS TFCSTS
STS STS STS
STS _23 ED
r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese Rese
RWC RFCFCST RPE
Reserved_15_10 RXFSTS rved RRCSTS rved
STS S STS
_7 _3
r r r r r r r r
REMOTE_WAKE_UP_FRAME_FILTER
This is the address through which the application writes or reads the remote wake-up
frame filter registers (wkupfmfilter_reg). The wkupfmfilter_reg register is a pointer to
eight wkupfmfilter_reg registers. The wkupfmfilter_reg register is loaded by sequentially
loading the eight register values. Eight sequential writes to this address (0028H) writes
all wkupfmfilter_reg registers. Similarly, eight sequential reads from this address
(0028H) read all wkupfmfilter_reg registers. This register contains the higher 16 bits of
the seventh MAC address.
ETH0_REMOTE_WAKE_UP_FRAME_FILTER
Remote Wake Up Frame Filter Register (28H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
WKUPFRMFTR
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WKUPFRMFTR
rw
PMT_CONTROL_STATUS
ETH0_PMT_CONTROL_STATUS
PMT Control and Status Register (2CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RWK
FILT Reserved_30_10
RST
rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
GLB RWK MGK RWK MGK
Reserved_ Reserved_ PWR
Reserved_30_10 LUC PRC PRC PKT PKT
8_7 4_3 DWN
AST VD VD EN EN
r rw r r r r rw rw rw
INTERRUPT_STATUS
The Interrupt Status register identifies the events in the MAC that can generate
interrupt.
ETH0_INTERRUPT_STATUS
Interrupt Register (38H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_11
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese Rese MMC
MMC MMC MMC PMTI
Reserved_31_11 rved TSIS rved RXIP Reserved_2_0
TXIS RXIS IS S
_10 _8 IS
r r r r r r r r r r
INTERRUPT_MASK
The Interrupt Mask Register bits enable you to mask the interrupt signal because of the
corresponding event in the Interrupt Status Register.
ETH0_INTERRUPT_MASK
Interrupt Mask Register (3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_10
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PMTI
Reserved_31_10 TSIM Reserved_8_4 Reserved_2_0
M
r rw r rw r
MAC_ADDRESS0_HIGH
The MAC Address0 High register holds the upper 16 bits of the first 6-byte MAC
address of the station. The first DA byte that is received on the MII interface corresponds
to the LS byte (Bits [7:0]) of the MAC Address Low register. For example, if 1122 3344
5566H is received (11H in lane 0 of the first column) on the MII as the destination
address, then the MacAddress0 Register [47:0] is compared with 6655 4433 2211H. If
the MAC address registers are configured to be double-synchronized to the MII clock
domains, then the synchronization is triggered only when Bits[31:24] of the MAC
Address0 Low Register are written. For proper synchronization updates, the consecutive
writes to this Address Low Register should be performed after at least four clock cycles
in the destination clock domain.
ETH0_MAC_ADDRESS0_HIGH
MAC Address0 High Register (40H) Reset Value: 8000 FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AE Reserved_30_16
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRHI
rw
MAC_ADDRESS0_LOW
The MAC Address0 Low register holds the lower 32 bits of the first 6-byte MAC address
of the station.
ETH0_MAC_ADDRESS0_LOW
MAC Address0 Low Register (44H) Reset Value: FFFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADDRLO
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRLO
rw
ETH0_MAC_ADDRESS1_HIGH
MAC Address1 High Register (48H) Reset Value: 0000 FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AE SA MBC Reserved_23_16
rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRHI
rw
MAC_ADDRESS1_LOW
The MAC Address1 Low register holds the lower 32 bits of the second 6-byte MAC
address of the station.
ETH0_MAC_ADDRESS1_LOW
MAC Address1 Low Register (4CH) Reset Value: FFFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADDRLO
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRLO
rw
MAC_ADDRESS2_HIGH
The MAC Address2 High register holds the upper 16 bits of the third 6-byte MAC
address of the station. If the MAC address registers are configured to be double-
synchronized to the MII clock domains, then the synchronization is triggered only when
Bits[31:24] (in little-endian mode) or Bits[7:0] (in big-endian mode) of the MAC Address2
Low Register are written. For proper synchronization updates, consecutive writes to this
MAC Address2 Low Register must be performed after at least four clock cycles in the
destination clock domain.
ETH0_MAC_ADDRESS2_HIGH
MAC Address2 High Register (50H) Reset Value: 0000 FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AE SA MBC Reserved_23_16
rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRHI
rw
MAC_ADDRESS2_LOW
The MAC Address2 Low register holds the lower 32 bits of the third 6-byte MAC address
of the station.
ETH0_MAC_ADDRESS2_LOW
MAC Address2 Low Register (54H) Reset Value: FFFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADDRLO
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRLO
rw
MAC_ADDRESS3_HIGH
The MAC Address3 High register holds the upper 16 bits of the fourth 6-byte MAC
address of the station. If the MAC address registers are configured to be double-
synchronized to the MII clock domains, then the synchronization is triggered only when
Bits[31:24] of the MAC Address3 Low Register are written. For proper synchronization
updates, consecutive writes to this MAC Address3 Low Register must be performed after
at least four clock cycles in the destination clock domain.
ETH0_MAC_ADDRESS3_HIGH
MAC Address3 High Register (58H) Reset Value: 0000 FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AE SA MBC Reserved_23_16
rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRHI
rw
MAC_ADDRESS3_LOW
The MAC Address3 Low register holds the lower 32 bits of the fourth 6-byte MAC
address of the station.
ETH0_MAC_ADDRESS3_LOW
MAC Address3 Low Register (5CH) Reset Value: FFFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADDRLO
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADDRLO
rw
MMC_CONTROL
The MMC Control register establishes the operating mode of the management counters.
Note: The bit 0 (Counters Reset) has higher priority than bit 4 (Counter Preset).
Therefore, when the Software tries to set both bits in the same write cycle, all counters
are cleared and the bit 4 is not set.
ETH0_MMC_CONTROL
MMC Control Register (100H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_9
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CNT
CNT CNT RST CNT
UCD Reserved_ PRS CNT
Reserved_31_9 PRS FRE ONR STO
BC 7_6 TLV RST
T EZ D PRO
L
r rw r rw rw rw rw rw rw
MMC_RECEIVE_INTERRUPT
The MMC Receive Interrupt register maintains the interrupts that are generated when
the following happens: * Receive statistic counters reach half of their maximum values
(8000 0000H for 32-bit counter and 8000H for 16-bit counter). * Receive statistic
counters cross their maximum values (FFFF FFFFH for 32-bit counter and FFFFH for
16-bit counter). When the Counter Stop Rollover is set, then interrupts are set but the
counter remains at all-ones. The MMC Receive Interrupt register is a 32-bit wide register.
An interrupt bit is cleared when the respective MMC counter that caused the interrupt is
read. The least significant byte lane (Bits[7:0]) of the respective counter must be read in
order to clear the interrupt bit.
ETH0_MMC_RECEIVE_INTERRUPT
MMC Receive Interrupt Register (104H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX1
RXR RXV RXO
RXC RXW RXF RXP RXL RXU 024T
CVE LAN RAN
Reserved_31_26 TRL DOG OVFI AUS ENE CGFI MAX
RRFI GBFI GEFI
FIS FIS S FIS RFIS S OCT
S S S GBFI
r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX5 RX2 RX1 RX6
RX6 RXA
12T1 56T5 28T2 5T12 RXO RXU RXJ RXR RXC RXM RXB RXG RXG RXG
4OC LGN
023O 11O 55O 7OC SIZE SIZE ABE UNT RCE CGFI CGFI OCTI BOC BFR
TGB ERFI
CTG CTG CTG TGB GFIS GFIS RFIS FIS RFIS S S S TIS MIS
FIS S
BFIS BFIS BFIS FIS
r r r r r r r r r r r r r r r r
MMC_TRANSMIT_INTERRUPT
The MMC Transmit Interrupt register maintains the interrupts generated when transmit
statistic counters reach half of their maximum values (8000 0000H for 32-bit counter and
8000H for 16-bit counter), and the maximum values (FFFF FFFFH for 32-bit counter and
FFFFH for 16-bit counter). When Counter Stop Rollover is set, then interrupts are set but
the counter remains at all-ones. The MMC Transmit Interrupt register is a 32-bit wide
register. An interrupt bit is cleared when the respective MMC counter that caused the
interrupt is read. The least significant byte lane (Bits[7:0]) of the respective counter must
be read in order to clear the interrupt bit.
ETH0_MMC_TRANSMIT_INTERRUPT
MMC Transmit Interrupt Register (108H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXL
TXO TXV TXP TXE TXG TXG TXC TXE TXD
ATC
Reserved_31_26 SIZE LAN AUS XDE FRMI OCTI ARE XCO EFFI
OLFI
GFIS GFIS FIS FFIS S S RFIS LFIS S
S
r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX10 TX51 TX25 TX12 TX65
TXU TX64
TXM TXS TXB TXM TXU 24T 2T10 6T51 8T25 T127 TXM TXB TXG TXG
FLO OCT
COL COL CGB CGB CGB MAX 23O 1OC 5OC OCT CGFI CGFI BFR BOC
WER GBFI
GFIS GFIS FIS FIS FIS OCT CTG TGB TGB GBFI S S MIS TIS
FIS S
GBFI BFIS FIS FIS S
r r r r r r r r r r r r r r r r
MMC_RECEIVE_INTERRUPT_MASK
ETH0_MMC_RECEIVE_INTERRUPT_MASK
MMC Reveive Interrupt Mask Register (10CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX1
RXR RXV RXO
RXC RXW RXF RXP RXL RXU 024T
CVE LAN RAN
Reserved_31_26 TRL DOG OVFI AUS ENE CGFI MAX
RRFI GBFI GEFI
FIM FIM M FIM RFIM M OCT
M M M
GBFI
r rw rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX5 RX2 RX1 RX6
RX6 RXO RXU RXA
12T1 56T5 28T2 5T12 RXJ RXR RXC RXM RXB RXG RXG RXG
4OC SIZE SIZE LGN
023O 11O 55O 7OC ABE UNT RCE CGFI CGFI OCTI BOC BFR
TGB GFI GFI ERFI
CTG CTG CTG TGB RFIM FIM RFIM M M M TIM MIM
FIM M M M
BFIM BFIM BFIM FIM
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
MMC_TRANSMIT_INTERRUPT_MASK
The MMC Transmit Interrupt Mask register maintains the masks for the interrupts
generated when the transmit statistic counters reach half of their maximum value or
maximum value. This register is 32-bits wide.
ETH0_MMC_TRANSMIT_INTERRUPT_MASK
MMC Transmit Interrupt Mask Register (110H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXO TXV TXL
TXP TXE TXG TXG TXC TXE TXD
SIZE LAN ATC
Reserved_31_26 AUS XDE FRMI OCTI ARE XCO EFFI
GFI GFI OLFI
FIM FFIM M M RFIM LFIM M
M M M
r rw rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX10 TX51 TX25 TX12 TX65
TXM TXS TXU TX64
TXB TXM TXU 24T 2T10 6T51 8T25 T127 TXM TXB TXG TXG
COL COL FLO OCT
CGB CGB CGB MAX 23O 1OC 5OC OCT CGFI CGFI BFR BOC
GFI GFI WER GBFI
FIM FIM FIM OCT CTG TGB TGB GBFI M M MIM TIM
M M FIM GBFI BFIM FIM M
FIM M
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
TX_OCTET_COUNT_GOOD_BAD
This register maintains the number of bytes transmitted in good and bad frames
exclusive of preamble and retried bytes.
ETH0_TX_OCTET_COUNT_GOOD_BAD
Transmit Octet Count for Good and Bad Frames Register (114H) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXOCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXOCTGB
TX_FRAME_COUNT_GOOD_BAD
This register maintains the number of good and bad frames transmitted, exclusive of
retried frames.
ETH0_TX_FRAME_COUNT_GOOD_BAD
Transmit Frame Count for Goodand Bad Frames Register (118H) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXFRMGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXFRMGB
TX_BROADCAST_FRAMES_GOOD
This register maintains the number of transmitted good broadcast frames.
ETH0_TX_BROADCAST_FRAMES_GOOD
Transmit Frame Count for Good Broadcast Frames (11CH) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXBCASTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXBCASTG
TX_MULTICAST_FRAMES_GOOD
This register maintains the number of transmitted good multicast frames.
ETH0_TX_MULTICAST_FRAMES_GOOD
Transmit Frame Count for Good Multicast Frames (120H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXMCASTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXMCASTG
TX_64OCTETS_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad frames with length of
64 bytes, exclusive of preamble and retried frames.
ETH0_TX_64OCTETS_FRAMES_GOOD_BAD
Transmit Octet Count for Good and Bad 64 Byte Frames (124H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TX64OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX64OCTGB
TX_65TO127OCTETS_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad frames with length
between 65 and 127 (inclusive) bytes, exclusive of preamble and retried frames.
ETH0_TX_65TO127OCTETS_FRAMES_GOOD_BAD
Transmit Octet Count for Good and Bad 65 to 127 Bytes Frames ( 128H)Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TX65_127OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX65_127OCTGB
TX_128TO255OCTETS_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad frames with length
between 128 and 255 (inclusive) bytes, exclusive of preamble and retried frames.
ETH0_TX_128TO255OCTETS_FRAMES_GOOD_BAD
Transmit Octet Count for Good and Bad 128 to 255 Bytes Frames (12CH) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TX128_255OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX128_255OCTGB
TX_256TO511OCTETS_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad frames with length
between 256 and 511 (inclusive) bytes, exclusive of preamble and retried frames.
ETH0_TX_256TO511OCTETS_FRAMES_GOOD_BAD
Transmit Octet Count for Good and Bad 256 to 511 Bytes Frames(130H) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TX256_511OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX256_511OCTGB
TX_512TO1023OCTETS_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad frames with length
between 512 and 1,023 (inclusive) bytes, exclusive of preamble and retried frames.
ETH0_TX_512TO1023OCTETS_FRAMES_GOOD_BAD
Transmit Octet Count for Good and Bad 512 to 1023 Bytes Frames(134H) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TX512_1023OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX512_1023OCTGB
TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad frames with length
between 1,024 and maxsize (inclusive) bytes, exclusive of preamble and retried frames.
ETH0_TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD
Transmit Octet Count for Good and Bad 1024 to Maxsize Bytes Frames(138H)
Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TX1024_MAXOCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX1024_MAXOCTGB
TX_UNICAST_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad unicast frames.
ETH0_TX_UNICAST_FRAMES_GOOD_BAD
Transmit Frame Count for Good and Bad Unicast Frames (13CH) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXUCASTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXUCASTGB
TX_MULTICAST_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad multicast frames.
ETH0_TX_MULTICAST_FRAMES_GOOD_BAD
Transmit Frame Count for Good and Bad Multicast Frames(140H) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXMCASTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXMCASTGB
TX_BROADCAST_FRAMES_GOOD_BAD
This register maintains the number of transmitted good and bad broadcast frames.
ETH0_TX_BROADCAST_FRAMES_GOOD_BAD
Transmit Frame Count for Good and Bad Broadcast Frames(144H) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXBCASTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXBCASTGB
TX_UNDERFLOW_ERROR_FRAMES
This register maintains the number of frames aborted because of frame underflow error.
ETH0_TX_UNDERFLOW_ERROR_FRAMES
Transmit Frame Count for Underflow Error Frames (148H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXUNDRFLW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXUNDRFLW
TX_SINGLE_COLLISION_GOOD_FRAMES
This register maintains the number of successfully transmitted frames after a single
collision in the half-duplex mode.
ETH0_TX_SINGLE_COLLISION_GOOD_FRAMES
Transmit Frame Count for Frames Transmitted after Single Collision(14CH) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXSNGLCOLG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXSNGLCOLG
TX_MULTIPLE_COLLISION_GOOD_FRAMES
This register maintains the number of successfully transmitted frames after multiple
collisions in the half-duplex mode.
ETH0_TX_MULTIPLE_COLLISION_GOOD_FRAMES
Transmit Frame Count for Frames Transmitted after Multiple Collision(150H)
Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXMULTCOLG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXMULTCOLG
TX_DEFERRED_FRAMES
This register maintains the number of successfully transmitted frames after a deferral in
the half-duplex mode.
ETH0_TX_DEFERRED_FRAMES
Tx Deferred Frames Register (154H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXDEFRD
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXDEFRD
TX_LATE_COLLISION_FRAMES
This register maintains the number of frames aborted because of late collision error.
ETH0_TX_LATE_COLLISION_FRAMES
Transmit Frame Count for Late Collision Error Frames(158H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXLATECOL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXLATECOL
TX_EXCESSIVE_COLLISION_FRAMES
This register maintains the number of frames aborted because of excessive (16)
collision error.
ETH0_TX_EXCESSIVE_COLLISION_FRAMES
Transmit Frame Count for Excessive Collision Error Frames(15CH) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXEXSCOL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXEXSCOL
TX_CARRIER_ERROR_FRAMES
This register maintains the number of frames aborted because of carrier sense error (no
carrier or loss of carrier).
ETH0_TX_CARRIER_ERROR_FRAMES
Transmit Frame Count for Carrier Sense Error Frames(160H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXCARR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXCARR
TX_OCTET_COUNT_GOOD
This register maintains the number of bytes transmitted, exclusive of preamble, in good
frames.
ETH0_TX_OCTET_COUNT_GOOD
Tx Octet Count Good Register (164H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXOCTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXOCTG
TX_FRAME_COUNT_GOOD
This register maintains the number of transmitted good frames, exclusive of preamble.
ETH0_TX_FRAME_COUNT_GOOD
Tx Frame Count Good Register (168H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXFRMG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXFRMG
TX_EXCESSIVE_DEFERRAL_ERROR
This register maintains the number of frames aborted because of excessive deferral
error, that is, frames deferred for more than two max-sized frame times.
ETH0_TX_EXCESSIVE_DEFERRAL_ERROR
Transmit Frame Count for Excessive Deferral Error Frames(16CH) Reset Value:
0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXEXSDEF
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXEXSDEF
TX_PAUSE_FRAMES
This register maintains the number of transmitted good PAUSE frames.
ETH0_TX_PAUSE_FRAMES
Transmit Frame Count for Good PAUSE Frames(170H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXPAUSE
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXPAUSE
TX_VLAN_FRAMES_GOOD
This register maintains the number of transmitted good VLAN frames, exclusive of
retried frames.
ETH0_TX_VLAN_FRAMES_GOOD
Transmit Frame Count for Good VLAN Frames(174H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXVLANG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXVLANG
TX_OSIZE_FRAMES_GOOD
This register maintains the number of transmitted good Oversize frames, exclusive of
retried frames.
ETH0_TX_OSIZE_FRAMES_GOOD
Transmit Frame Count for Good Oversize Frames(178H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TXOSIZG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TXOSIZG
RX_FRAMES_COUNT_GOOD_BAD
This register maintains the number of received good and bad frames.
ETH0_RX_FRAMES_COUNT_GOOD_BAD
Receive Frame Count for Good and Bad Frames(180H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXFRMGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXFRMGB
RX_OCTET_COUNT_GOOD_BAD
This register maintains the number of bytes received, exclusive of preamble, in good
and bad frames.
ETH0_RX_OCTET_COUNT_GOOD_BAD
Receive Octet Count for Good and Bad Frames(184H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXOCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXOCTGB
RX_OCTET_COUNT_GOOD
This register maintains the number of bytes received, exclusive of preamble, only in
good frames.
ETH0_RX_OCTET_COUNT_GOOD
Rx Octet Count Good Register (188H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXOCTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXOCTG
RX_BROADCAST_FRAMES_GOOD
This register maintains the number of received good broadcast frames.
ETH0_RX_BROADCAST_FRAMES_GOOD
Receive Frame Count for Good Broadcast Frames(18CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXBCASTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXBCASTG
RX_MULTICAST_FRAMES_GOOD
This register maintains the number of received good multicast frames.
ETH0_RX_MULTICAST_FRAMES_GOOD
Receive Frame Count for Good Multicast Frames(190H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXMCASTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXMCASTG
RX_CRC_ERROR_FRAMES
This register maintains the number of frames received with CRC error.
ETH0_RX_CRC_ERROR_FRAMES
Receive Frame Count for CRC Error Frames(194H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXCRCERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXCRCERR
RX_ALIGNMENT_ERROR_FRAMES
This register maintains the number of frames received with alignment (dribble) error.
ETH0_RX_ALIGNMENT_ERROR_FRAMES
Receive Frame Count for Alignment Error Frames(198H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXALGNERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXALGNERR
RX_RUNT_ERROR_FRAMES
This register maintains the number of frames received with runt error(<64 bytes and
CRC error).
ETH0_RX_RUNT_ERROR_FRAMES
Receive Frame Count for Runt Error Frames(19CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXRUNTERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXRUNTERR
RX_JABBER_ERROR_FRAMES
This register maintains the number of giant frames received with length (including CRC)
greater than 1,518 bytes (1,522 bytes for VLAN tagged) and with CRC error. If Jumbo
Frame mode is enabled, then frames of length greater than 9,018 bytes (9,022 for VLAN
tagged) are considered as giant frames.
ETH0_RX_JABBER_ERROR_FRAMES
Receive Frame Count for Jabber Error Frames(1A0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXJABERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXJABERR
RX_UNDERSIZE_FRAMES_GOOD
This register maintains the number of frames received with length less than 64 bytes
and without errors.
ETH0_RX_UNDERSIZE_FRAMES_GOOD
Receive Frame Count for Undersize Frames(1A4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXUNDERSZG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXUNDERSZG
RX_OVERSIZE_FRAMES_GOOD
This register maintains the number of frames received with length greater than the
maxsize (1,518 or 1,522 for VLAN tagged frames) and without errors.
ETH0_RX_OVERSIZE_FRAMES_GOOD
Rx Oversize Frames Good Register (1A8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXOVERSZG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXOVERSZG
RX_64OCTETS_FRAMES_GOOD_BAD
This register maintains the number of received good and bad frames with length 64
bytes, exclusive of preamble.
ETH0_RX_64OCTETS_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad 64 Byte Frames(1ACH) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX64OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX64OCTGB
RX_65TO127OCTETS_FRAMES_GOOD_BAD
This register maintains the number of received good and bad frames received with
length between 65 and 127 (inclusive) bytes, exclusive of preamble.
ETH0_RX_65TO127OCTETS_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad 65 to 127 Bytes Frames(1B0H) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX65_127OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX65_127OCTGB
RX_128TO255OCTETS_FRAMES_GOOD_BAD
This register maintains the number of received good and bad frames with length
between 128 and 255 (inclusive) bytes, exclusive of preamble.
ETH0_RX_128TO255OCTETS_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad 128 to 255 Bytes Frames(1B4H) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX128_255OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX128_255OCTGB
RX_256TO511OCTETS_FRAMES_GOOD_BAD
This register maintains the number of received good and bad frames with length
between 256 and 511 (inclusive) bytes, exclusive of preamble.
ETH0_RX_256TO511OCTETS_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad 256 to 511 Bytes Frames(1B8H) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX256_511OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX256_511OCTGB
RX_512TO1023OCTETS_FRAMES_GOOD_BAD
This register maintains the number of received good and bad frames with length
between 512 and 1,023 (inclusive) bytes, exclusive of preamble.
ETH0_RX_512TO1023OCTETS_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad 512 to 1,023 Bytes Frames(1BCH) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX512_1023OCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX512_1023OCTGB
RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD
This register maintains the number of received good and bad frames with length
between 1,024 and maxsize (inclusive) bytes, exclusive of preamble.
ETH0_RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad 1,024 to Maxsize Bytes Frames(1C0H)
Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RX1024_MAXOCTGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RX1024_MAXOCTGB
RX_UNICAST_FRAMES_GOOD
This register maintains the number of received good unicast frames.
ETH0_RX_UNICAST_FRAMES_GOOD
Receive Frame Count for Good Unicast Frames(1C4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXUCASTG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXUCASTG
RX_LENGTH_ERROR_FRAMES
This register maintains the number of frames received with length error (Length type
field not equal to frame size) for all frames with valid length field.
ETH0_RX_LENGTH_ERROR_FRAMES
Receive Frame Count for Length Error Frames(1C8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXLENERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXLENERR
RX_OUT_OF_RANGE_TYPE_FRAMES
This register maintains the number of received frames with length field not equal to the
valid frame size (greater than 1,500 but less than 1,536).
ETH0_RX_OUT_OF_RANGE_TYPE_FRAMES
Receive Frame Count for Out of Range Frames(1CCH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXOUTOFRNG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXOUTOFRNG
RX_PAUSE_FRAMES
This register maintains the number of received good and valid PAUSE frames.
ETH0_RX_PAUSE_FRAMES
Receive Frame Count for PAUSE Frames(1D0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXPAUSEFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXPAUSEFRM
RX_FIFO_OVERFLOW_FRAMES
This register maintains the number of received frames missed because of FIFO
overflow.
ETH0_RX_FIFO_OVERFLOW_FRAMES
Receive Frame Count for FIFO Overflow Frames(1D4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXFIFOOVFL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXFIFOOVFL
RX_VLAN_FRAMES_GOOD_BAD
This register maintains the number of received good and bad VLAN frames.
ETH0_RX_VLAN_FRAMES_GOOD_BAD
Receive Frame Count for Good and Bad VLAN Frames(1D8H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXVLANFRGB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXVLANFRGB
RX_WATCHDOG_ERROR_FRAMES
This register maintains the number of frames received with error because of the
watchdog timeout error (frames with more than 2,048 bytes data load).
ETH0_RX_WATCHDOG_ERROR_FRAMES
Receive Frame Count for Watchdog Error Frames(1DCH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXWDGERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXWDGERR
RX_RECEIVE_ERROR_FRAMES
This register maintains the number of frames received with error because of the MII
RXER error.
ETH0_RX_RECEIVE_ERROR_FRAMES
Receive Frame Count for Receive Error Frames(1E0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXRCVERR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXRCVERR
RX_CONTROL_FRAMES_GOOD
This register maintains the number of godd control frames received.
ETH0_RX_CONTROL_FRAMES_GOOD
Receive Frame Count for Good Control Frames Frames(1E4H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXCTRLG
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXCTRLG
MMC_IPC_RECEIVE_INTERRUPT_MASK
This register maintains the mask for the interrupt generated from the receive IPC
statistic counters. This register is 32-bits wide.
ETH0_MMC_IPC_RECEIVE_INTERRUPT_MASK
MMC Receive Checksum Offload Interrupt Mask Register(200H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIP RXIP RXIP
RXIC RXT RXU RXIP RXIP RXIP
RXIC RXT RXU V6N RXIP V4U V4N RXIP
Reserved_ MPE CPE DPE V6H V4F V4H
MPG CPG DPG OPA V6G DSB OPA V4G
31_30 ROI ROI ROI EROI RAG EROI
OIM OIM OIM YOI OIM LOI YOI OIM
M M M M OIM M
M M M
r rw rw rw rw rw rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIP RXIP RXIP RXIP RXIP RXIP
RXIC RXIC RXT RXT RXU RXU RXIP RXIP
Reserved_ V6N V6H V4U V4F V4N V4H
MPE MPG CPE CPG DPE DPG V6G V4G
15_14 OPA ERFI DSB RAG OPA ERFI
RFIM FIM RFIM FIM RFIM FIM FIM FIM
YFIM M LFIM FIM YFIM M
r rw rw rw rw rw rw rw rw rw rw rw rw rw rw
MMC_IPC_RECEIVE_INTERRUPT
This register maintains the interrupt that the receive IPC statistic counters generate.
ETH0_MMC_IPC_RECEIVE_INTERRUPT
MMC Receive Checksum Offload Interrupt Register(208H)Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIP RXIP RXIP RXIP RXIP RXIP
RXIC RXIC RXT RXT RXU RXU RXIP RXIP
Reserved_ V6N V6H V4U V4F V4N V4H
MPE MPG CPE CPG DPE DPG V6G V4G
31_30 OPA EROI DSB RAG OPA EROI
ROIS OIS ROIS OIS ROIS OIS OIS OIS
YOIS S LOIS OIS YOIS S
r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIP RXIP RXIP RXIP RXIP RXIP
RXIC RXIC RXT RXT RXU RXU RXIP RXIP
Reserved_ V6N V6H V4U V4F V4N V4H
MPE MPG CPE CPG DPE DPG V6G V4G
15_14 OPA ERFI DSB RAG OPA ERFI
RFIS FIS RFIS FIS RFIS FIS FIS FIS
YFIS S LFIS FIS YFIS S
r r r r r r r r r r r r r r r
RXIPV4_GOOD_FRAMES
This register maintains the number of good IPv4 datagrams received with the TCP,
UDP, or ICMP payload.
ETH0_RXIPV4_GOOD_FRAMES
RxIPv4 Good Frames Register (210H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4GDFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4GDFRM
RXIPV4_HEADER_ERROR_FRAMES
This register maintains the number of IPv4 datagrams received with header errors
(checksum, length, or version mismatch).
ETH0_RXIPV4_HEADER_ERROR_FRAMES
Receive IPV4 Header Error Frame Counter Register(214H)Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4HDRERRFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4HDRERRFRM
RXIPV4_NO_PAYLOAD_FRAMES
This register maintains the number of received IPv4 datagram frames without a TCP,
UDP, or ICMP payload processed by the Checksum engine.
ETH0_RXIPV4_NO_PAYLOAD_FRAMES
Receive IPV4 No Payload Frame Counter Register(218H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4NOPAYFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4NOPAYFRM
RXIPV4_FRAGMENTED_FRAMES
This register maintains the number of good IPv4 datagrams received with
fragmentation.
ETH0_RXIPV4_FRAGMENTED_FRAMES
Receive IPV4 Fragmented Frame Counter Register(21CH)Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4FRAGFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4FRAGFRM
RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES
This register maintains the number of received good IPv4 datagrams which have the
UDP payload with checksum disabled.
ETH0_RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES
Receive IPV4 UDP Checksum Disabled Frame Counter Register(220H) Reset
Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4UDSBLFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4UDSBLFRM
RXIPV6_GOOD_FRAMES
This register maintains the number of good IPv6 datagrams received with TCP, UDP,
or ICMP payloads.
ETH0_RXIPV6_GOOD_FRAMES
RxIPv6 Good Frames Register (224H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV6GDFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV6GDFRM
RXIPV6_HEADER_ERROR_FRAMES
This register maintains the number of IPv6 datagrams received with header errors
(length or version mismatch).
ETH0_RXIPV6_HEADER_ERROR_FRAMES
Receive IPV6 Header Error Frame Counter Register(228H)Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV6HDRERRFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV6HDRERRFRM
RXIPV6_NO_PAYLOAD_FRAMES
This register maintains the number of received IPv6 datagram frames without a TCP,
UDP, or ICMP payload. This includes all IPv6 datagrams with fragmentation or security
extension headers.
ETH0_RXIPV6_NO_PAYLOAD_FRAMES
Receive IPV6 No Payload Frame Counter Register(22CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV6NOPAYFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV6NOPAYFRM
RXUDP_GOOD_FRAMES
This register maintains the number of good IP datagrams with a good UDP payload. This
counter is not updated when the counter is incremented.
ETH0_RXUDP_GOOD_FRAMES
RxUDP Good Frames Register (230H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXUDPGDFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXUDPGDFRM
RXUDP_ERROR_FRAMES
This register maintains the number of good IP datagrams whose UDP payload has a
checksum error.
ETH0_RXUDP_ERROR_FRAMES
RxUDP Error Frames Register (234H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXUDPERRFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXUDPERRFRM
RXTCP_GOOD_FRAMES
This register maintains the number of good IP datagrams with a good TCP payload.
ETH0_RXTCP_GOOD_FRAMES
RxTCP Good Frames Register (238H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXTCPGDFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXTCPGDFRM
RXTCP_ERROR_FRAMES
This register maintains the number of good IP datagrams whose TCP payload has a
checksum error.
ETH0_RXTCP_ERROR_FRAMES
RxTCP Error Frames Register (23CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXTCPERRFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXTCPERRFRM
RXICMP_GOOD_FRAMES
This register maintains the number of good IP datagrams with a good ICMP payload.
ETH0_RXICMP_GOOD_FRAMES
RxICMP Good Frames Register (240H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXICMPGDFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXICMPGDFRM
RXICMP_ERROR_FRAMES
This register maintains the number of good IP datagrams whose ICMP payload has a
checksum error.
ETH0_RXICMP_ERROR_FRAMES
RxICMP Error Frames Register (244H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXICMPERRFRM
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXICMPERRFRM
RXIPV4_GOOD_OCTETS
This register maintains the number of bytes received in good IPv4 datagrams
encapsulating TCP, UDP, or ICMP data.
ETH0_RXIPV4_GOOD_OCTETS
RxIPv4 Good Octets Register (250H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4GDOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4GDOCT
RXIPV4_HEADER_ERROR_OCTETS
This register maintains the number of bytes received in IPv4 datagrams with header
errors (checksum, length, or version mismatch). The value in the Length field of the IPv4
header is used to update this counter.
ETH0_RXIPV4_HEADER_ERROR_OCTETS
Receive IPV4 Header Error Octet Counter Register(254H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4HDRERROCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4HDRERROCT
RXIPV4_NO_PAYLOAD_OCTETS
This register maintains the number of bytes received in IPv4 datagrams that did not have
a TCP, UDP, or ICMP payload. The value in the IPv4 headers Length field is used to
update this counter.
ETH0_RXIPV4_NO_PAYLOAD_OCTETS
Receive IPV4 No Payload Octet Counter Register(258H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4NOPAYOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4NOPAYOCT
RXIPV4_FRAGMENTED_OCTETS
This register maintains the number of bytes received in fragmented IPv4 datagrams.
The value in the IPv4 headers Length field is used to update this counter.
ETH0_RXIPV4_FRAGMENTED_OCTETS
Receive IPV4 Fragmented Octet Counter Register(25CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4FRAGOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4FRAGOCT
RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS
This register maintains the number of bytes received in a UDP segment that had the
UDP checksum disabled.
ETH0_RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS
Receive IPV4 Fragmented Octet Counter Register(260H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV4UDSBLOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV4UDSBLOCT
RXIPV6_GOOD_OCTETS
This register maintains the number of bytes received in good IPv6 datagrams
encapsulating TCP, UDP or ICMPv6 data.
ETH0_RXIPV6_GOOD_OCTETS
RxIPv6 Good Octets Register (264H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV6GDOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV6GDOCT
RXIPV6_HEADER_ERROR_OCTETS
This register maintains the number of bytes received in IPv6 datagrams with header
errors (length or version mismatch).
ETH0_RXIPV6_HEADER_ERROR_OCTETS
Receive IPV6 Header Error Octet Counter Register(268H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV6HDRERROCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV6HDRERROCT
RXIPV6_NO_PAYLOAD_OCTETS
This register maintains the number of bytes received in IPv6 datagrams that did not have
a TCP, UDP, or ICMP payload.
ETH0_RXIPV6_NO_PAYLOAD_OCTETS
Receive IPV6 No Payload Octet Counter Register(26CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXIPV6NOPAYOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXIPV6NOPAYOCT
RXUDP_GOOD_OCTETS
This register maintains the number of bytes received in a good UDP segment.
ETH0_RXUDP_GOOD_OCTETS
Receive UDP Good Octets Register (270H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXUDPGDOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXUDPGDOCT
RXUDP_ERROR_OCTETS
This register maintains the number of bytes received in a UDP segment with checksum
errors.
ETH0_RXUDP_ERROR_OCTETS
Receive UDP Error Octets Register (274H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXUDPERROCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXUDPERROCT
RXTCP_GOOD_OCTETS
This register maintains the number of bytes received in a good TCP segment.
ETH0_RXTCP_GOOD_OCTETS
Receive TCP Good Octets Register (278H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXTCPGDOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXTCPGDOCT
RXTCP_ERROR_OCTETS
This register maintains the number of bytes received in a TCP segment with checksum
errors.
ETH0_RXTCP_ERROR_OCTETS
Receive TCP Error Octets Register (27CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXTCPERROCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXTCPERROCT
RXICMP_GOOD_OCTETS
This register maintains the number of bytes received in a good ICMP segment.
ETH0_RXICMP_GOOD_OCTETS
Receive ICMP Good Octets Register (280H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXICMPGDOCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXICMPGDOCT
RXICMP_ERROR_OCTETS
This register maintains the number of bytes received in a ICMP segment with checksum
errors. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad,
or IP pad bytes are not included in this counter.
ETH0_RXICMP_ERROR_OCTETS
Receive ICMP Error Octets Register (284H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RXICMPERROCT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RXICMPERROCT
TIMESTAMP_CONTROL
This register controls the operation of the System Time generator and the processing of
PTP packets for timestamping in the Receiver. Note: * Bits[19:8] are reserved and read-
only when Advanced Timestamp feature is not enabled.
ETH0_TIMESTAMP_CONTROL
Timestamp Control Register (700H) Reset Value: 0000 2000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSE
NMA SNAPTYP
Reserved_23_19
CAD SEL
DR
r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSM TSE TSIP TSIP TSV TSC TSE TSA TSC
TSIP Reserved_ TST TSU TSIN TSE
STR VNT V4E V6E ER2 TRL NAL DDR FUP
ENA 7_6 RIG PDT IT NA
ENA ENA NA NA ENA SSR L EG DT
rw rw rw rw rw rw rw rw r rw rw rw rw rw rw
SUB_SECOND_INCREMENT
This register is present only when the IEEE 1588 timestamp feature is selected without
an external timestamp input. In the Coarse Update mode
(TIMESTAMP_CONTROL.TSCFUPDT bit), the value in this register is added to the
system time every clock cycle of the PTP refference clock. In the Fine Update mode, the
value in this register is added to the system time whenever the Accumulator gets an
overflow.
ETH0_SUB_SECOND_INCREMENT
Sub-Second Increment Register (704H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_8
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved_31_8 SSINC
r rw
SYSTEM_TIME_SECONDS
The System Time -Seconds register, along with System-TimeNanoseconds register,
indicates the current value of the system time maintained by the MAC. Though it is
updated on a continuous basis, there is some delay from the actual time because of
clock domain transfer latencies .
ETH0_SYSTEM_TIME_SECONDS
System Time - Seconds Register (708H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSS
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSS
SYSTEM_TIME_NANOSECONDS
The value in this field has the sub second representation of time, with an accuracy of
0.46 ns. When TIMESTAMP_CONTROL.TSCTRLSSR is set, each bit represents 1 ns
and the maximum value is 3B9A C9FFH, after which it rolls-over to zero.
ETH0_SYSTEM_TIME_NANOSECONDS
System Time Nanoseconds Register (70CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Rese
rved TSSS
_31
r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSSS
SYSTEM_TIME_SECONDS_UPDATE
The System Time - Seconds Update register, along with the System_Time_
Nanoseconds_Update register, initializes or updates the system time maintained by the
MAC. You must write both of these registers before setting the
TIMESTAMP_CONTROL.TSINIT or TIMESTAMP_CONTROL.TSUPDT bits.
ETH0_SYSTEM_TIME_SECONDS_UPDATE
System Time - Seconds Update Register(710H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSS
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSS
rw
SYSTEM_TIME_NANOSECONDS_UPDATE
.
ETH0_SYSTEM_TIME_NANOSECONDS_UPDATE
System Time Nanoseconds Update Register(714H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADD
TSSS
SUB
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSSS
rw
ETH0_TIMESTAMP_ADDEND
Timestamp Addend Register (718H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSAR
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSAR
rw
TARGET_TIME_SECONDS
The Target Time Seconds register, along with Target Time Nanoseconds register, is
used to schedule an interrupt event triggered by the TimestampStatus.TSTARGT bit
when Advanced Timestamping is enabled; otherwise, the INTERRUPT_STATUS.TSIS
will trigger the interrupt when the system time exceeds the value programmed in these
registers. This register is present only when the IEEE 1588 Timestamp feature is
selected without external timestamp input.
ETH0_TARGET_TIME_SECONDS
Target Time Seconds Register (71CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSTR
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSTR
rw
TARGET_TIME_NANOSECONDS
This register is present only when the IEEE 1588 Timestamp feature is selected without
external timestamp input.
ETH0_TARGET_TIME_NANOSECONDS
Target Time Nanoseconds Register (720H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TRG
TBU TTSLO
SY
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TTSLO
rw
SYSTEM_TIME_HIGHER_WORD_SECONDS
This register is present only when the IEEE 1588 Advanced Timestamp feature is
selected without an external timestamp input.
ETH0_SYSTEM_TIME_HIGHER_WORD_SECONDS
System Time - Higher Word Seconds Register (724H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_16
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSHWR
rw
TIMESTAMP_STATUS
All bits except Bits[27:25] gets cleared when the CPU reads this register.
ETH0_TIMESTAMP_STATUS
Timestamp Status Register (728H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Rese
Reserved_
Reserved_29_25 rved Reserved_23_20 Reserved_19-16
31_30
_24
r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TST TST TST
TST TST TST TST Rese TST
RGT RGT RGT TSS
Reserved_15_10 ARG ARG ARG RGT rved ARG
ERR ERR ERR OVF
T3 T2 T1 ERR _2 T
3 2 1
r r r r r r r r r r r
PPS_CONTROL
Note: * Bits[30:24] are valid only when four Flexible PPS outputs are selected. *
Bits[22:16] are valid only when three or more Flexible PPS outputs are selected. *
Bits[14:8] are valid only when two or more Flexible PPS outputs are selected. * Bits[6:4]
are valid only when Flexible PPS feature is selected.
ETH0_PPS_CONTROL
PPS Control Register (72CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Rese Rese
TRGTMOD Reserved_ TRGTMOD Reserved_
rved PPSCMD3 rved PPSCMD2
SEL3 28_27 SEL2 20_19
_31 _23
r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese Rese
TRGTMOD Reserved_ TRGTMOD PPS
rved PPSCMD1 rved PPSCTRL_PPSCMD
SEL1 12_11 SEL0 EN0
_15 _7
r r r r r r r rw
1) In the binary rollover mode, the PPS output (ptp_pps_o) has a duty cycle of 50 percent with these frequencies.
In the digital rollover mode, the PPS output frequency is an average number. The actual clock is of different
frequency that gets synchronized every second. For example:
* When PPSCTRL = 0001, the PPS (1 Hz) has a low period of 537 ms and a high period of 463 ms
* When PPSCTRL = 0010, the PPS (2 Hz) is a sequence of:
- One clock of 50 percent duty cycle and 537 ms period
- Second clock of 463 ms period (268 ms low and 195 ms high)
* When PPSCTRL = 0011, the PPS (4 Hz) is a sequence of:
- Three clocks of 50 percent duty cycle and 268 ms period
- Fourth clock of 195 ms period (134 ms low and 61 ms high
This behavior is because of the non-linear toggling of bits in the digital rollover mode in System Time -
Nanoseconds Register].
Flexible PPS0 Output Control
Programming these bits with a non-zero value instructs the MAC to initiate an event. Once the command is
transferred or synchronized to the PTP clock domain, these bits get cleared automatically. The Software
should ensure that these bits are programmed only when they are all-zero. The following list describes the
values of PPSCMD0:
* 0000: No Command
* 0001: START Single Pulse
This command generates single pulse rising at the start point defined in Target Time Registers
(TARGET_TIME_SECONDS and TARGET_TIME_NANOSECONDS) and of a duration defined in the PPS0
Width Register.
* 0010: START Pulse Train
This command generates the train of pulses rising at the start point defined in the Target Time Registers and of
a duration defined in the PPS0 Width Register and repeated at interval defined in the PPS Interval Register.
By default, the PPS pulse train is free-running unless stopped by 'STOP Pulse train at time' or 'STOP Pulse
Train immediately' commands.
* 0011: Cancel START <br>
This command cancels the START Single Pulse and START Pulse Train commands if the system time has not
crossed the programmed start time.
* 0100: STOP Pulse train at time
This command stops the train of pulses initiated by the START Pulse Train command (PPSCMD = 0010) after the
time programmed in the Target Time registers elapses.
* 0101: STOP Pulse Train immediately
This command immediately stops the train of pulses initiated by the START Pulse Train command (PPSCMD =
0010).
* 0110: Cancel STOP Pulse train
This command cancels the STOP pulse train at time command if the programmed stop time has not elapsed. The
PPS pulse train becomes free-running on the successful execution of this command.
* 0111-1111: Reserved
BUS_MODE
The Bus Mode register establishes the bus operating modes for the DMA.
ETH0_BUS_MODE
Bus Mode Register (1000H) Reset Value: 0002 0101H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_ TXP 8xP
PRWG MB AAL USP RPBL FB
31_30 R BL
r r rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese
PR PBL rved DSL DA SWR
_7
rw rw rw rw rw rw
TRANSMIT_POLL_DEMAND
The Transmit Poll Demand register enables the Tx DMA to check whether or not the
DMA owns the current descriptor. The Transmit Poll Demand command is given to wake
up the Tx DMA if it is in the Suspend mode. The Tx DMA can go into the Suspend mode
because of an Underflow error in a transmitted frame or the unavailability of descriptors
owned by it. You can give this command anytime and the Tx DMA resets this command
when it again starts fetching the current descriptor from the XMC4500 memory.
ETH0_TRANSMIT_POLL_DEMAND
Transmit Poll Demand Register (1004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TPD
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TPD
rw
RECEIVE_POLL_DEMAND
The Receive Poll Demand register enables the receive DMA to check for new
descriptors. This command is used to wake up the Rx DMA from the SUSPEND state.
The RxDMA can go into the SUSPEND state only because of the unavailability of
descriptors it owns.
ETH0_RECEIVE_POLL_DEMAND
Receive Poll Demand Register (1008H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RPD
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RPD
rw
RECEIVE_DESCRIPTOR_LIST_ADDRESS
The Receive Descriptor List Address register points to the start of the Receive
Descriptor List. The descriptor lists reside in the XMC4500's physical memory space and
must be Word-aligned . The DMA internally converts it to bus width aligned address by
making the corresponding LS bits low. Writing to this register is permitted only when
reception is stopped. When stopped, this register must be written to before the receive
Start command is given. You can write to this register only when Rx DMA has stopped,
that is, Bit 1 (SR) is set to zero in the Operation Mode Register. When stopped, this
register can be written with a new descriptor list address. When you set the SR bit to 1,
the DMA takes the newly programmed descriptor base address. If this register is not
changed when the SR bit is set to 0, then the DMA takes the descriptor address where
it was stopped earlier.
ETH0_RECEIVE_DESCRIPTOR_LIST_ADDRESS
Receive Descriptor Address Register (100CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RDESLA_32bit
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved_
RDESLA_32bit
1_0
rw r
TRANSMIT_DESCRIPTOR_LIST_ADDRESS
The Transmit Descriptor List Address register points to the start of the Transmit
Descriptor List. The descriptor lists reside in the XMC4500's physical memory space and
must be Word-aligned . The DMA internally converts it to bus width aligned address by
making the corresponding LSB to low. You can write to this register only when the Tx
DMA has stopped, that is, OPERATION_MODE.ST is set to zero. When stopped, this
register can be written with a new descriptor list address. When you set the
OPERATION_MODE.ST bit to 1, the DMA takes the newly programmed descriptor base
address. If this register is not changed when the ST bit is set to 0, then the DMA takes
the descriptor address where it was stopped earlier.
ETH0_TRANSMIT_DESCRIPTOR_LIST_ADDRESS
Transmit descripter Address Register (1010H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TDESLA_32bit
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved_
TDESLA_32bit
1_0
rw r
STATUS
The STATUS register contains all status bits that the DMA reports to the CPU. The
Software driver reads this register during an interrupt service routine or polling. Most of
the fields in this register cause the CPU to be interrupted. The bits of this register are not
cleared when read. Writing 1 to (unreserved) Bits[16:0] of this register clears these bits
and writing 0 has no effect. Each field (Bits[16:0]) can be masked by masking the
appropriate bit in the Interrupt Enable Register.
ETH0_STATUS
Status Register (1014H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Rese Rese Rese
rved rved TTI EPI EMI rved EB TS RS NIS
_31 _30 _26
r r r r r r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved_
AIS ERI FBI ETI RWT RPS RU RI UNF OVF TJT TU TPS TI
12_11
rw rw rw r rw rw rw rw rw rw rw rw rw rw rw
OPERATION_MODE
The Operation Mode register establishes the Transmit and Receive operating modes
and commands. This register should be the last CSR to be written as part of the DMA
initialization.
ETH0_OPERATION_MODE
Operation Mode Register (1018H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_
Reserved_31_27 DT RSF DFF TSF FTF Reserved_19_17 TTC
23_22
r rw rw rw r rw rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese Rese
TTC ST Reserved_12_8 FEF FUF rved RTC OSF SR rved
_5 _0
rw rw r rw rw r rw rw rw r
INTERRUPT_ENABLE
The Interrupt Enable register enables the interrupts reported by ETH0_STATUS
Register. Setting a bit to 1 enables a corresponding interrupt. After a hardware or
software reset, all interrupts are disabled.
ETH0_INTERRUPT_ENABLE
Interrupt Enable Register (101CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_17 NIE
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved_
AIE ERE FBE ETE RWE RSE RUE RIE UNE OVE TJE TUE TSE TIE
12_11
rw rw rw r rw rw rw rw rw rw rw rw rw rw rw
MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER
The DMA maintains two counters to track the number of frames missed during
reception. This register reports the current value of the counter. The counter is used for
diagnostic purposes. Bits[15:0] indicate missed frames because of the RAM buffer being
unavailable. Bits[27:17] indicate missed frames because of buffer overflow conditions
(MTL and MAC) and runt frames (good frames of less than 64 bytes) dropped by the
MTL.
ETH0_MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER
Missed Frame and Buffer Overflow Counter Register (1020H) Reset Value: 0000
0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
OVF MIS
Reserved_31_29 CNT OVFFRMCNT CNT
OVF OVF
r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MISFRMCNT
RECEIVE_INTERRUPT_WATCHDOG_TIMER
This register, when written with non-zero value, enables the watchdog timer for the
Receive Interrupt (Bit 6) of STATUS Register]
ETH0_RECEIVE_INTERRUPT_WATCHDOG_TIMER
Receive Interrupt Watchdog Timer Register (1024H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_8
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved_31_8 RIWT
r rw
AHB_Status
This register provides the active status of the AHB master interface. This register is
useful for debugging purposes. In addition, this register is valid only in the Channel 0
DMA when multiple channels are present in the AV mode.
ETH0_AHB_Status
AHB Status Register (102CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved_31_2
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rese
AHB
Reserved_31_2 rved
MS
_1
r r r
CURRENT_HOST_TRANSMIT_DESCRIPTOR
The Current Host Transmit Descriptor register points to the start address of the current
Transmit Descriptor read by the DMA.
ETH0_CURRENT_HOST_TRANSMIT_DESCRIPTOR
Current Host Transmit Descriptor Register (1048H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CURTDESAPTR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CURTDESAPTR
CURRENT_HOST_RECEIVE_DESCRIPTOR
The Current Host Receive Descriptor register points to the start address of the current
Receive Descriptor read by the DMA.
ETH0_CURRENT_HOST_RECEIVE_DESCRIPTOR
Current Host Receive Descriptor Register (104CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CURRDESAPTR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CURRDESAPTR
CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS
The Current Host Transmit Buffer Address register points to the current Transmit Buffer
Address being read by the DMA.
ETH0_CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS
Current Host Transmit Buffer Address Register (1050H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CURTBUFAPTR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CURTBUFAPTR
CURRENT_HOST_RECEIVE_BUFFER_ADDRESS
The Current Host Receive Buffer Address register points to the current Receive Buffer
address being read by the DMA.
ETH0_CURRENT_HOST_RECEIVE_BUFFER_ADDRESS
Current Host Receive Buffer Address Register (1054H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CURRBUFAPTR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CURRBUFAPTR
HW_FEATURE
This register indicates the presence of the optional features or functions of the
DWC_ETH. The software driver can use this register to dynamically enable or disable
the programs related to the optional blocks. Note: All bits are set or reset as per the
selection of features during the DWC_ETH configuration.
ETH0_HW_FEATURE
HW Feature Register (1058H) Reset Value: 0305 2F35H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Rese SAV FLE ENH RXFI RXT RXT TXC
INTT
rved ACTPHYIF LANI XIPP DES TXCHCNT RXCHCNT FOSI YP2 YP1 OES
SEN
_31 NS SEN SEL ZE COE COE EL
r r r r r r r r rw r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ADD
TSV TSV L3L4 HAS EXT
AVS EEE MMC MGK RWK SMA PCS MAC HDS GMII MIIS
ER2 ER1 FLT HSE HAS
EL SEL SEL SEL SEL SEL SEL ADR EL SEL EL
SEL SEL REN L HEN
SEL
r r r r r r r r r r r r r r r r
15.7 Interconnects
The tables that refer to the global pins are the ones that contain the inputs/outputs of
the ETH.
References:
[15] USB 2.0 specification (April 27, 2000).
[16] On-The-Go Supplement to the USB 2.0 specification (Revision 1.3, December 5,
2006).
16.1 Overview
This section describes the features and provides a block diagram of the USB module.
16.1.1 Features
The USB module includes the following features:
Complies with the USB 2.0 Specification
Complies with the On-The-Go Supplement to the USB 2.0 Specification (Revision
1.3)
Configurable as Device only, Host only or as an OTG Dual Role Device
Support for the Full-Speed (12-Mbps) mode
Provides a USB OTG FS PHY interface
Supports up to 7 bidirectional endpoints, including control endpoint 0
Supports up to 14 Host channels
Supports Session Request Protocol (SRP).
Supports Host Negotiation Protocol (HNP).
Supports SOFs in Full-Speed modes.
Supports clock gating for power saving
Supports USB suspend/resume
Supports DMA mode in:
Descriptor-Based Scatter/Gather DMA operation
Buffer DMA operation
Dedicated transmit FIFO for each of the device IN endpoints in Slave and DMA
modes. Each FIFO can hold multiple packets.
Supports packet-based, Dynamic FIFO memory allocation for endpoints for small
FIFOs and flexible, efficient use of RAM.
Provides support to change an endpoints FIFO memory size during transfers.
Supports endpoint FIFO sizes that are not powers of 2, to allow the use of contiguous
memory locations.
clk_ahbm VBUS
PHY
Clock
Inter-
Control clk_usb face DP
USB
PHY DM
USB
Address Core ID
Decoder P0.9 / ID
VDD
DRIVEBUS External
Charge
Pump
V BUS VBUS
USB
USB AB-connector
Module in DM DM
DRD
DP DP
Configuration
ID ID
VSS
VDD
DRIVEBUS External
Charge
Pump
USB VBUS VBUS
USB A-connector
Module in
Host DM DM
Configuration DP DP
VSS
USB B-connector
Module in
Device DM DM
Configuration DP DP
VSS
Transfer-Level Operation
In DMA mode, the application is interrupted only after the programmed transfer size is
transmitted or received (provided the USB core detects no NAK/NYET/Timeout/Error
response in Host mode, or Timeout/CRC Error in Device mode). The application must
handle all transaction errors. In Device mode with dedicated FIFOs, all the USB errors
are handled by the core itself.
Transaction-Level Operation
This mode is similar to transfer-level operation with the programmed transfer size equal
to one packet size (either maximum packet size, or a short packet size). When
Scatter/Gather DMA is enabled, the transfer size is extracted from the descriptors.
Transaction-Level Operation
The application handles one data packet at a time per channel/endpoint in transaction-
level operations. Based on the handshake response received on the USB, the
application determines whether to retry the transaction or proceed with the next, until the
end of the transfer. The application is interrupted on completion of every packet. The
application performs transaction-level operations for a channel/endpoint for a
transmission (host: OUT/ device: IN) or reception (host: IN / device: OUT) as shown in
Figure 16-5 and Figure 16-6.
1) At this point, the host is up and running and the port register begins to report device disconnects, etc. The
port is active with SOFs occurring down the enabled port.
register with the total transfer size, in bytes, and the expected number of packets,
including short packets. The application must program the PID field with the initial
data PID (to be used on the first OUT transaction or to be expected from the first IN
transaction).
6. Program the selected channels' HCDMAx register(s) with the buffer start address
(Scatter/Gather DMA mode only).
7. Program the HCCHARx register of the selected channel with the device's endpoint
characteristics, such as type, speed, direction, and so forth. (The channel can be
enabled by setting the Channel Enable bit to 1B only when the application is ready to
transmit or receive any packet).
Repeat steps 1-7 for other channels.
Note: De-allocate channel means after the transfer has completed, the channel is
disabled. When the application is ready to start the next transfer, the application
re-initializes the channel by following these steps.
interrupt INs in Slave mode, once the application has received a DataTglErr interrupt
it must disable the channel and wait for a Channel Halted interrupt. The application
must be able to receive other interrupts (DataTglErr, Nak, Data, XactErr, BabbleErr)
for the same channel before receiving the halt.
3. When a GINTSTS.DisconnInt (Disconnect Device) interrupt is received. The
application must check for the HPRT.PrtConnSts, because when the device directly
connected to the host is disconnected, HPRT.PrtConnSts is reset. The software must
issue a soft reset to ensure that all channels are cleared. When the device is
reconnected, the host must issue a USB Reset.
4. When the application aborts a transfer before normal completion (Slave and DMA
modes).
Note
In buffer DMA mode, the following guidelines must be considered:
Channel disable must not be programmed for non-split periodic channels. At the end
of the next frame (in the worst case), the core generates a channel halted and
disables the channel automatically.
For split enabled channels (both non-periodic and periodic), channel disable must not
be programmed randomly. However, channel disable can be programmed for
specific scenarios such as NAK and FrmOvrn as defined in the Host programming
model.
Isochronous
Slave Isochronous IN Transactions Isochronous OUT
in Slave Mode on Page 16-46 Transactions in Slave Mode
on Page 16-43
Buffer DMA Isochronous IN Transactions Isochronous OUT
in Host DMA Mode on Transactions in DMA Mode
Page 16-50 on Page 16-48
Scatter Gather Periodic Transfers on Periodic Transfers on
DMA Mode Page 16-64 Page 16-64
Handling Interrupts
The channel-specific interrupt service routine for bulk and control OUT/SETUP
transactions in Slave mode is shown in the following code samples.
Bulk/Control OUT/SETUP
Unmask (NAK/XactErr/NYET/STALL/XferCompl)
if (XferCompl)
{
Reset Error Count
Mask ACK
De-allocate Channel
}
else if (STALL)
{
Transfer Done = 1
Unmask ChHltd
Disable Channel
}
else if (NAK or XactErr or NYET)
{
Rewind Buffer Pointers
Unmask ChHltd
Disable Channel
if (XactErr)
{
Increment Error Count
Unmask ACK
}
else
{
Reset Error Count
}
}
else if (ChHltd)
{
Mask ChHltd
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else
{
Re-initialize Channel
}
}
else if (ACK)
{
Reset Error Count
Mask ACK
}
The application is expected to write the data packets into the transmit FIFO when space
is available in the transmit FIFO and the Request queue. The application can make use
of GINTSTS.NPTxFEmp interrupt to find the transmit FIFO space.
The application is expected to write the requests as and when the Request queue space
is available and until the XferCompl interrupt is received.
The application must clear and never modify the DoPing bit after enabling the channel
and until the XferCompl or ChHltd interrupt is received. The core uses the DoPing bit to
flush the excessive IN requests after receiving the last or short packet.
5. In response to the RxFLvl interrupt, mask the RxFLvl interrupt and read the received
packet status to determine the number of bytes received, then read the receive FIFO
accordingly. Following this, unmask the RxFLvl interrupt.
6. The core generates the RxFLvl interrupt for the transfer completion status entry in the
receive FIFO.
7. The application must read and ignore the receive packet status when the receive
packet status is not an IN data packet (GRXSTSR.PktSts! = 0010B).
8. The core generates the XferCompl interrupt as soon as the receive packet status is
read.
9. In response to the XferCompl interrupt, disable the channel (see Halting a
Channel on Page 16-14) and stop writing the HCCHAR2 register for further
requests. The core writes a channel disable request to the non-periodic request
queue as soon as the HCCHAR2 register is written.
10. The core generates the RxFLvl interrupt as soon as the halt status is written to the
receive FIFO.
11. Read and ignore the receive packet status.
12. The core generates a ChHltd interrupt as soon as the halt status is popped from the
receive FIFO.
13. In response to the ChHltd interrupt, de-allocate the channel for other transfers.
Note: For Bulk/Control IN transfers, the application must write the requests when the
Request queue space is available, and until the XferCompl interrupt is received.
Handling Interrupts
The channel-specific interrupt service routine for bulk and control IN transactions in
Slave mode is shown in the following code samples.
Handling Interrupts
Overview
The core does not generate a separate interrupt when NAK or NYET is received by
the Host functionality.
Handling Interrupts
The channel-specific interrupt service routine for bulk and control OUT/SETUP
transactions in DMA mode is shown in the following code samples.
Figure 16-11 Interrupt Service Routine for Bulk/Control OUT Transaction in DMA
Mode
In Figure 16-11 that the Interrupt Service Routine is not required to handle NAK or NYET
responses. The core internally sets the HCCHARx.DoPng bit once a NAK/NYET is
received. The HCCHARx.DoPng is cleared only when the Ping token receives an ACK
response. The application is not required to set the HCCHARx.DoPng bit for NAK/NYET
scenarios. This is the difference of proposed flow with respect to current flow. Similar
flow is applicable for Control flow also.
The NAK/NYET status bits in HCINTx registers are updated. The application can
unmask these interrupts when it requires the core to generate an interrupt for
NAK/NYET. The NAK/NYET status is updated because during Xact_err scenarios, this
status provides a means for the application to determine whether the Xact_err occurred
three times consecutively or there were NAK/NYET responses in between two Xact_err.
This provides a mechanism for the application to reset the error counter accordingly. The
application must read the NAK / NYET /ACK along with the xact_err. If NAK / NYET/ ACK
is not set, the Xact_err count must be incremented otherwise application must initialize
the Xact_err count to 1.
Bulk/Control OUT/SETUP
Unmask (ChHltd)
if (ChHltd)
{
if (XferCompl or STALL)
{
Reset Error Count (Error_count=1)
Mask ACK
De-allocate Channel
}
else if (XactErr)
{
if (Nak/Nyet/Ack)
{
Error_count = 1
Re-initialize Channel
Rewind Buffer Pointers }
}
else
{
Error_count = Error_count + 1
if (Error_count == 3)
{
De allocate channel
}
else
{
Re-initialize Channel
Rewind Buffer Pointers
}
}
}
}
else if (ACK)
{
Reset Error Count (Error_count=1)
Mask ACK
}
As soon as the channel is enabled, the core attempts to fetch and write data packets, in
multiples of the maximum packet size, to the transmit FIFO when space is available in
the transmit FIFO and the Request queue. The core stops fetching as soon as the last
packet is fetched.
While continuing the transfer to a high-speed device, the application must set the DoPing
bit before enabling the channel if the previous transaction ended with XacrErr response.
In this case, the core starts with the ping protocol, then automatically switches to Data
Transfer mode.
3. The USB host starts writing the received data to the system memory as soon as the
last byte is received with no errors.
4. When the last packet is received, the USB host sets an internal flag to remove any
extra IN requests from the Request queue.
5. The USB host flushes the extra requests.
6. The final request to disable channel 2 is written to the Request queue. At this point,
channel 2 is internally masked for further arbitration.
7. The USB host generates the ChHltd interrupt as soon as the disable request comes
to the top of the queue.
8. In response to the ChHltd interrupt, de-allocate the channel for other transfers.
Handling Interrupts
The channel-specific interrupt service routine for bulk and control IN transactions in DMA
mode is shown in the following flow:
Bulk/Control IN
Unmask (ChHltd)
if (ChHltd) {
if (XferCompl or STALL or BblErr) {
Reset Error Count Mask ACK De-allocate Channel }
else if (XactErr) {
if (Error_count == 2) {
De-allocate Channel
}
else {
Unmask ACK
Unmask NAK
Unmask DataTglErr
Increment Error
Count Re-initialize Channel
}
}
}
else if (ACK or NAK or DataTglErr) {
Reset Error Count
Mask ACK
Mask NAK Mask DataTglErr
}
The application must clear and never modify the DoPing bit after enabling the channel
and until the ChHltd interrupt is received. The core uses the DoPing excessive IN
requests after receiving the last or short packet.
Handling Interrupts
The channel-specific interrupt service routine for Interrupt OUT transactions in Slave
mode is shown in the following flow:
Interrupt OUT
Unmask (NAK/XactErr/STALL/XferCompl/FrmOvrun)
if (XferCompl)
{
Reset Error Count
Mask ACK
De-allocate Channel
}
else if (STALL or FrmOvrun)
{
Mask ACK
Unmask ChHltd
Disable Channel
if ( STALL)
{
Transfer Done = 1
}
}
else if (NAK or XactErr)
{
Rewind Buffer Pointers
Reset Error Count
Mask ACK
Unmask ChHltd
Disable Channel
}
else if (ChHltd)
{
Mask ChHltd
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else
{
Re-initialize Channel (in next b_interval - 1
uF/F)
}
}
else if (ACK)
{
Reset Error Count
Mask ACK
}
The application is expected to write the data packets into the transmit FIFO when the
space is available in the transmit FIFO and the Request queue up to the count specified
in the MC field before switching to another channel. The application uses the
GINTSTS.NPTxFEmp interrupt to find the transmit FIFO space.
HCTSIZ2.PktCnt == 0, reinitialize the channel for the next transfer. This time, the
application must reset the HCCHAR2.OddFrm bit.
Handling Interrupts
The channel-specific interrupt service routine for an interrupt IN transaction in Slave
mode is as follows.
Interrupt IN
Unmask (NAK/XactErr/XferCompl/BblErr/STALL/FrmOvrun/DataTglErr)
if (XferCompl)
{
Reset Error Count
Mask ACK
if (HCTSIZx.PktCnt == 0)
{
De-allocate Channel
}
else
{
Transfer Done = 1
Unmask ChHltd
Disable Channel
}
}
else if (STALL or FrmOvrun or NAK or DataTglErr or BblErr)
{
Mask ACK
Unmask ChHltd
Disable Channel
if (STALL or BblErr)
{
Reset Error Count
Transfer Done = 1
}
else if (!FrmOvrun)
{
Reset Error Count
}
}
else if (XactErr)
{
Increment Error Count
Unmask ACK
Unmask ChHltd
Disable Channel
}
else if (ChHltd)
{
Mask ChHltd
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else Re-initialize Channel (in next b_interval - 1
uF/F)
}
}
else if (ACK)
{
Reset Error Count
Mask ACK
}
The application is expected to write the requests for the same channel when the Request
queue space is available up to the count specified in the MC field before switching to
another channel (if any).
4. After successfully transmitting the packet, the USB host generates a ChHltd interrupt.
5. In response to the ChHltd interrupt, reinitialize the channel for the next transfer.
Handling Interrupts
The following code sample shows the channel-specific ISR for an interrupt OUT
transaction in DMA mode.
Interrupt OUT
Unmask (ChHltd)
if (ChHltd)
{
if (XferCompl)
{
Reset Error Count
Mask ACK
if (Transfer Done)
{
De-allocate Channel
}
else
{
Re-initialize Channel (in next b_interval -
1 uF/F)
}
}
else if (STALL)
{
Transfer Done = 1
Reset Error Count
Mask ACK
De-allocate Channel
}
else if (NAK or FrmOvrun)
{
Mask ACK
Rewind Buffer Pointers
Re-initialize Channel (in next b_interval - 1
uF/F)
if (NAK)
{
Reset Error Count
}
}
else if (XactErr)
{
if (Error_count == 2)
{
De-allocate Channel
}
else
{
Increment Error Count
Rewind Buffer Pointers
Unmask ACK
Re-initialize Channel (in next b_interval - 1
uF/F)
}
}
}
else if (ACK)
{
Reset Error Count
Mask ACK
}
As soon as the channel is enabled, the core attempts to fetch and write data packets, in
maximum packet size multiples, to the transmit FIFO when the space is available in the
transmit FIFO and the Request queue. The core stops fetching as soon as the last
packet is fetched (the number of packets is determined by the MC field of the HCCHARx
register).
Handling Interrupts
The channel-specific interrupt service routine for Interrupt IN transactions in DMA mode
is as follows.
if (DataTglErr or NAK)
{
Reset Error Count
}
}
else if (XactErr)
{
if (Error_count == 2)
{
De-allocate Channel
}
else
{
Increment Error Count
Unmask ACK
Re-initialize Channel (in next b_interval - 1
uF/F)
}
}
}
else if (ACK)
{
Reset Error Count
Mask ACK
As soon as the channel is enabled, the core attempts to write the requests into the
Request queue when the space is available up to the count specified in the MC field.
Handling Interrupts
The channel-specific interrupt service routine for isochronous OUT transactions in Slave
mode is shown in the following flow:
Isochronous OUT
Unmask (FrmOvrun/XferCompl)
if (XferCompl)
{
De-allocate Channel
}
else if (FrmOvrun)
{
Unmask ChHltd
Disable Channel
}
else if (ChHltd)
{
Mask ChHltd
De-allocate Channel
}
5. As soon as the IN packet is received and written to the receive FIFO, the USB host
generates an RxFLvl interrupt.
6. In response to the RxFLvl interrupt, read the received packet status to determine the
number of bytes received, then read the receive FIFO accordingly. The application
must mask the RxFLvl interrupt before reading the receive FIFO, and unmask it after
reading the entire packet.
7. The core generates an RxFLvl interrupt for the transfer completion status entry in the
receive FIFO. This time, the application must read and ignore the receive packet
status when the receive packet status is not an IN data packet (GRXSTSR.PktSts!=
0010B).
8. The core generates an XferCompl interrupt as soon as the receive packet status is
read.
9. In response to the XferCompl interrupt, read the HCTSIZ2.PktCnt field. If
HCTSIZ2.PktCnt!= 0, disable the channel (as explained in Halting a Channel on
Page 16-14) before re-initializing the channel for the next transfer, if any. If
HCTSIZ2.PktCnt == 0, reinitialize the channel for the next transfer. This time, the
application must reset the HCCHAR2.OddFrm bit.
Handling Interrupts
The channel-specific interrupt service routine for an isochronous IN transaction in Slave
mode is as follows.
Isochronous IN
Unmask (XactErr/XferCompl/FrmOvrun/BblErr)
if ( XferCompl or FrmOvrun)
{
if (XferCompl and (HCTSIZx.PktCnt == 0))
{
Reset Error Count
De-allocate Channel
}
else
{
Unmask ChHltd
Disable Channel
}
}
else if (XactErr or BblErr)
{
Increment Error Count
Unmask ChHltd
Disable Channel
}
else if (ChHltd)
{
Mask ChHltd
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else
{
Re-initialize Channel
}
}
Handling Interrupts
The channel-specific interrupt service routine for Isochronous OUT transactions in DMA
mode is shown in the following flow:
Isochronous OUT
Unmask (ChHltd)
if (ChHltd)
{
if (XferCompl or FrmOvrun)
{
De-allocate Channel
}
}
Handling Interrupts
The channel-specific interrupt service routine for an isochronous IN transaction in DMA
mode is as follows.
Isochronous IN
Unmask (ChHltd)
if (ChHltd)
{
if ( XferCompl or FrmOvrun)
{
if (XferCompl and (HCTSIZx.PktCnt == 0))
{
Reset Error Count
De-allocate Channel
}
else
{
De-allocate Channel
}
}
else if (XactErr or BblErr)
{
if (Error_count == 2)
{
De-allocate Channel
}
else
{
Increment Error Count
Re-enable Channel (in next b_interval - 1 uF/F)
}
}
}
16.5.1 Overview
Note the following points when the host scatter-gather DMA mode is used:
USB core supports non-DWORD aligned address access in Scatter/Gather DMA in
Host mode only
NAK/NYET scenario is handled by USB core in Scatter/Gather DMA mode without
the application's intervention.
CONCAT mode is not supported for any of the flows, that is, a single packet cannot
span more than one descriptor.
The IN and OUT data memory structures are shown in Figure 16-17. The figure shows
the definition of status quadlet bits for non-ISO and ISO channels.
In addition, a Frame list in memory for Isochronous and Interrupt channels contains
information on the channels that need to be scheduled in a frame. For periodic channels,
USB core reads the list corresponding to the frame number and schedules the channel
that has Ch_sch=1 in the appropriate frame. Figure 16-18 shows the frame list for
periodic channels.
For a normal completion, the host controller updates the status of the qTDn with no
errors. The host controller completes a transfer normally if one of the following events
occurs:
Short or zero length packet is received for an IN channel.
The allocated buffer is fulfilled with the received data packets for an IN channel.
The allocated buffer is fully transferred to the device for an OUT channel.
When a transfer is completed normally, the host controller attempts to process the next
qTDn from the descriptor list, if the End of List (EOL) bit is not set in the completed qTDn.
where m = AQTD (if IN channel with AQTD_VLD=1 received a short packet) or m = (n +
1) mod (NTD + 1)
If EOL is set, the host controller disables the channel and generates a Channel Halt
interrupt. The transfer complete interrupt is generated for the following conditions.
IOC is set.
Short or zero length packet is received for an IN channel.
EOL is set.
For an abnormal completion, the host controller updates the status of the qTDn with
PKT_ERR. The host controller completes a transfer abnormally if one of the following
events occurs:
STALL response is received from the device.
Excessive transaction errors occurred.
Babble detected.
When a transfer is completed abnormally, the host controller disables the channel and
then generates a Channel Halt interrupt with the appropriate status in HCINT register.
The host controller executes a zero-length OUT transaction if the "Num bytes to
transmit" field of the qTD is initialized to zero for an OUT channel. For an IN channel, the
"Num of bytes received" field of the qTD must be always initialized to an integer multiple
of the maximum packet size.
The application can use one or multiple qTDs for bulk IN and OUT transfers. The number
of qTDs depends on the available consecutive data buffer space and the size of the
transfer. Each qTD can support up to 64KB of consecutive data buffer space.
Isochronous Transactions
When the application enables an isochronous channel by writing into the HCCHARx
register, the host controller begins servicing the isochronous channel based on the
programmed scheduling (periodic frame list and SCHED_INFO). The application must
use separate qTD for each frame. Each qTD handles a frame of transactions. The
application is expected to allocate a qTD with Active bit zero even if no transaction is
scheduled for a frame. The position of the active qTD determines the b-interval of the
isochronous channel.
The host controller supports high-bandwidth isochronous transfer via the multi-count
(MC) field of the HCCHARx register. The Multi Count represents a transaction count per
frame for the endpoint. If the multi- count is zero, the operation of the host controller is
undefined. Multi-count greater than one is not applicable for the FS host.
For OUT transfers, the value of the "Num bytes to transmit" field represents the total
bytes to be sent during the frame. The application is expected to program the Mult count
field to be the maximum number of packets to be sent in any frame. The host controller
automatically selects the number of packets and its data PID based on the programmed
Xfer Size.
For IN transfers, the host controller issues Mult count transactions. The application is
expected to initialize the "Num bytes received" field to (MC * MaxPktSize).
The host controller does not execute all Multi-count transactions if:
The channel is an OUT and the "Num bytes to transmit" goes to zero before all the
Multi-count transactions have executed (ran out of transmit data) or
The channel is an IN and the endpoint delivers a short packet, or an error occurs on
a transaction before all the Multi-count transaction have been executed.
The channel is an IN and the endpoint delivers a packet with DATA0 PID before all
the Multi-count transaction have been executed.
Each transfer descriptor (qTD) describes one frame of transactions. The host controller
will cache one transfer descriptor in a frame prior to the scheduled frame.
When the application is adding new isochronous transactions to the schedule, it always
performs a read of the HFNUM register to determine the current frame and frame the
host is currently executing. Because there is no information about where in the frame the
host controller is, a constant uncertainty factor of one frame for FS is assumed.
The end of frame (FS) may occur before all of the transaction opportunities are executed.
When this happens, the host controller closes the corresponding descriptor and
proceeds to processing the next scheduled descriptor. If the scheduled descriptor is not
fetched by the host controller due to high system latency, the host controller does not
execute any transaction for that scheduled frame and will skip the descriptor without any
update (that is, without clearing the Active bit).
When a transfer is completed normally, the host controller generates the transfer
complete interrupt only if IOC is set in the completed qTD.
When a transfer is completed abnormally (STALL response or Babble), the host
controller disables the channel and then generates a Channel Halt interrupt with the
appropriate status in HCINT register. The host controller updates the status of the qTD
with PKT_ERR if one of the following conditions occurs:
STALL response is received from the device
Error packet received
Babble detected
Unable to complete all the transactions in the scheduled frame
An example for the FS isochronous scheduling is shown in Figure 16-19. In this figure,
channels 2 and 15 are isochronous channels with b-interval 1ms and 4ms respectively.
The host controller fetches only the qTDs that corresponds to the scheduled frame
(Periodic Frame List entry). The host controller initiates the qTD fetch in the frame prior
to the scheduled frame. If the qTD is active and belongs to an OUT channel, the host
controller also fetches the corresponding data in the previous frame. If this qTD is not
active, the host controller ignores the qTD and does not generate any BNA interrupt.
Interrupt Transactions
When the application enables an interrupt channel by writing into the HCCHARx register,
the host controller begins servicing the interrupt channel based on the programmed
scheduling (periodic frame list and SCHLD_INFO). It reads the referenced (CTD)
transfer descriptor qTDn (pointed by the HCDMAx register) in the frame prior to the
scheduled frame.
If the read qTDn is active, the host controller caches the qTDn and then schedules a
transaction. If the read qTDn is inactive, the host controller disables the channel and
generates a Buffer Not Available (BNA) interrupt.
When the host controller completes the transfer, it updates the status quadlet of the
processed qTDn in the system memory.
For a normal completion, the host controller updates the status of the qTDn with no
errors. The host controller completes a transfer normally if one of the following events
occurs:
Short or zero length packet is received for an IN channel.
The allocated buffer is fulfilled with the received data packets for an IN channel.
The allocated buffer is fully transferred to the device for an OUT channel.
When a transfer is completed normally, the host controller attempts to process the next
qTDm from the descriptor list if the End of List (EOL) bit is not set in the completed qTDn.
Where m = (n + 1) mod (NTD + 1)
If EOL is set, the host controller disables the channel and generates Channel Halt
interrupt. The transfer complete interrupt will be generated for the following conditions.
IOC is set.
Short or zero length packet is received for an IN channel.
EOL is set.
For an abnormal completion, the host controller updates the status of the qTDn with
PKT_ERR. The host controller completes a transfer abnormally if one of the following
events occurs:
STALL response is received from the device.
Excessive transaction errors occurred.
Babble detected.
When a transfer is completed abnormally, the host controller disables the channel and
then generates a Channel Halt interrupt with the appropriate status in the HCINT
register.
The host controller supports high-bandwidth interrupt transfer through the Multi-count
(MC) field of HCCHARx register. The Multi-count represents a transaction count per
frame for the endpoint. If the Multi-count is zero, the operation of the host controller is
undefined. Multi-count greater than one is not applicable for FS host.
The host controller does not execute all Multi-count transactions in a frame if:
The channel is an OUT and the "Num bytes to transmit" goes to zero before all the
Multi-count transactions have executed (ran out of transmit data) or
The channel is an IN and the endpoint delivers a short packet, or an error occurs on
a transaction before all the Multi-count transaction have been executed.
The channel is an IN and the "Num bytes received" goes to zero before all the Multi-
count transaction are executed (ran out of receive buffer space).
e) DIEPMSK.XferCompl = 1
f) DIEPMSK.TimeOut = 1
3. To transmit or receive data, the device must initialize more registers as specified in
Device DMA/Slave Mode Initialization on Page 16-72
4. Set up the Data FIFO RAM for each of the FIFOs
a) Program the GRXFSIZ Register, to be able to receive control OUT data and setup
data. At a minimum, this must be equal to 1 max packet size of control endpoint 0
+ 2 DWORDs (for the status of the control OUT data packet) + 10 DWORDs (for
setup packets).
b) Program the dedicated FIFO size register (depending on the FIFO number
chosen) in Dedicated FIFO operation, to be able to transmit control IN data. At a
minimum, this must be equal to 1 max packet size of control endpoint 0.
5. (This step is not required if the Scatter/Gather DMA mode is used.) Program the
following fields in the endpoint-specific registers for control OUT endpoint 0 to receive
a SETUP packet
a) DOEPTSIZ0.SetUP Count = 3 (to receive up to 3 back-to-back SETUP packets)
b) In DMA mode, DOEPDMAO register with a memory address to store any SETUP
packets received
At this point, all initialization required to receive SETUP packets is done, except for
enabling control OUT endpoint 0 in DMA mode.
Isochronous
Slave Generic Periodic IN - Generic Isochronous
(Interrupt and OUT Data Transfer in
Isochronous) Data DMA and Slave
Transfers on Modes on Page 16-92
Page 16-118
Incomplete
Isochronous OUT Data
Transfers in DMA and
Slave Modes on
Page 16-100
DMA Generic Periodic IN - Generic Isochronous
(Interrupt and OUT Data Transfer in
Isochronous) Data DMA and Slave
Transfers on Modes on Page 16-92
Page 16-118
Incomplete
Generic Periodic IN Isochronous OUT Data
Data Transfers Using Transfers in DMA and
the Periodic Transfer Slave Modes on
Interrupt Feature on Page 16-100
Page 16-120
16.6.3.1 OUT Data Transfers in Device Slave and Buffer DMA Modes
This section describes the internal data flow and application-level operations during data
OUT transfers and setup transactions.
Application Requirements
1. To receive a SETUP packet, the DOEPTSIZx.SUPCnt field in a control OUT endpoint
must be programmed to a non-zero value. When the application programs the
SUPCnt field to a non-zero value, the core receives SETUP packets and writes them
to the receive FIFO, irrespective of the DOEPCTLx.NAK status and
DOEPCTLx.EPEna bit setting. The SUPCnt field is decremented every time the
control endpoint receives a SETUP packet. If the SUPCnt field is not programmed to
a proper value before receiving a SETUP packet, the core still receives the SETUP
packet and decrements the SUPCnt field, but the application possibly is not be able
to determine the correct number of SETUP packets received in the Setup stage of a
control transfer.
a) DOEPTSIZx.SUPCnt = 3
2. In DMA mode, the OUT endpoint must also be enabled, to transfer the received
SETUP packet data from the internal receive FIFO to the external memory.
a) DOEPCTLx.EPEna = 1B
3. The application must always allocate some extra space in the Receive Data FIFO, to
be able to receive up to three SETUP packets on a control endpoint.
a) The space to be Reserved is (4 * n) + 6 DWORDs, where n is the number of control
endpoints supported by the device. Three DWORDs are required for the first
SETUP packet, 1 DWORD is required for the Setup Stage Done DWORD, and 6
DWORDs are required to store two extra SETUP packets among all control
endpoints.
b) 3 DWORDs per SETUP packet are required to store 8 bytes of SETUP data and
4 bytes of SETUP status (Setup Packet Pattern). The core reserves this space in
the receive data
c) FIFO to write SETUP data only, and never uses this space for data packets.
4. In Slave mode, the application must read the 2 DWORDs of the SETUP packet from
the receive FIFO. In DMA mode, the core writes the 2 DWORDs of SETUP data to
the memory.
5. The application must read and discard the Setup Stage Done DWORD from the
receive FIFO.
b) In DMA mode, the application must also determine if the interrupt bit
DOEPINTx.Back2BackSETup is set. This bit is set if the core has received more
than three back- to-back SETUP packets. If this is the case, the application must
ignore the DOEPTSIZx.SUPCnt value and use the DOEPDMAx directly to read
out the last SETUP packet received. DOEPDMAx-8 provides the pointer to the last
valid SETUP data.
Note: If the application has not enabled EP0 before the host sends the SETUP packet,
the core ACKs the SETUP packet and stores it in the FIFO, but does not write to
the memory until EP0 is enabled. When the application enables the EP0 (first
enable) and clears the NAK bit at the same time the Host sends DATA OUT, the
DATA OUT is stored in the RxFIFO. The OTG core then writes the setup data to
the memory and disables the endpoint. Though the application expects a Transfer
Complete interrupt for the Data OUT phase, this does not occur, because the
SETUP packet, rather than the DATA OUT packet, enables EP0 the first time.
Thus, the DATA OUT packet is still in the RxFIFO until the application re-enables
EP0. The application must enable EP0 one more time for the core to process the
DATA OUT packet.
Figure 16-20 charts this flow.
can send to the same endpoint. When this condition occurs, the USB core generates an
interrupt (DOEPINTx.Back2BackSETup). In DMA mode, the core also rewinds the DMA
address for that endpoint (DOEPDMAx) and overwrites the first SETUP packet in system
memory with the fourth, second with the fifth, and so on. If the Back2BackSETup
interrupt is asserted, the application must read the OUT endpoint DMA register
(DOEPDMAx) to determine the final SETUP data in system memory.
In DMA mode, the application can mask the Back2BackSETup interrupt, but after
receiving the DOEPINT.SETUP interrupt, the application can read the
DOEPINT.Back2BackSETup interrupt bit. In Slave mode, the application can use the
GINTSTS.RxFLvl interrupt to read out the SETUP packets from the FIFO whenever the
core receives the SETUP packet.
2. Decode the last SETUP packet received before the assertion of the SETUP interrupt.
If the packet indicates a two-stage control command, the application must do the
following.
a) To transfer a new SETUP packet in DMA mode, the application must re-enable the
control OUT endpoint. See "OUT Data Transfers in Device Slave and Buffer
DMA Modes on Page 16-76 for details.
- DOEPCTLx.EPEna = 1B
b) Depending on the type of Setup command received, the application can be
required to program registers in the core to execute the received Setup command.
3. For the status IN phase, the application must program the core described in
Generic Non-Periodic (Bulk and Control) IN Data Transfers on Page 16-111 to
perform a data IN transfer.
4. Assertion of the DIEPINTx.Transfer Compl interrupt indicates the completion of the
status IN phase of the control transfer.
3. If the received packet's byte count is not 0, the byte count amount of data is popped
from the receive Data FIFO and stored in memory. If the received packet byte count
is 0, no data is popped from the Receive Data FIFO.
4. The receive FIFO's packet status readout indicates one of the following.
5. Global OUT NAK Pattern: PktSts = Global OUT NAK, BCnt = 11'h000, EPNum =
Dont Care (4'h0), DPID = Dont Care (00B). This data indicates that the global OUT
NAK bit has taken effect.
a) SETUP Packet Pattern: PktSts = SETUP, BCnt = 11'h008, EPNum = Control EP
Num, DPID = D0. This data indicates that a SETUP packet for the specified
endpoint is now available for reading from the receive FIFO.
b) Setup Stage Done Pattern: PktSts = Setup Stage Done, BCnt = 11'h0, EPNum =
Control EP Num, DPID = Don't Care (00B). This data indicates that the Setup stage
for the specified endpoint has completed and the Data stage has started. After this
entry is popped from the receive FIFO, the core asserts a Setup interrupt on the
specified control OUT endpoint.
c) Data OUT Packet Pattern: PktSts = DataOUT, BCnt = size of the Received data
OUT packet (0 < BCnt <1,024), EPNum = EPNum on which the packet was
received, DPID = Actual Data PID.
d) Data Transfer Completed Pattern: PktSts = Data OUT Transfer Done, BCnt =
11'h0, EPNum = OUT EP Num on which the data transfer is complete, DPID =
Dont Care (00B). This data indicates that a OUT data transfer for the specified OUT
endpoint has completed. After this entry is popped from the receive FIFO, the core
asserts a Transfer Completed interrupt on the specified OUT endpoint.
The encoding for the PktSts is listed in Receive Status Debug Read/Status
Read and Pop Registers (GRXSTSR/GRXSTSP) on Page 16-246.
6. After the data payload is popped from the receive FIFO, the GINTSTS.RxFLvl
interrupt must be unmasked.
7. Steps 1-5 are repeated every time the application detects assertion of the interrupt
line due to GINTSTS.RxFLvl. Reading an empty receive FIFO can result in undefined
core behavior.
4. Once the application detects this interrupt, it can assume that the core is in Global
OUT NAK mode. The application can clear this interrupt by clearing the
DCTL.SGOUTNak bit.
Application Requirements
1. Before setting up an OUT transfer, the application must allocate a buffer in the
memory to accommodate all data to be received as part of the OUT transfer, then
program that buffer's size and start address (in DMA mode) in the endpoint-specific
registers.
2. For OUT transfers, the Transfer Size field in the endpoint's Transfer Size register
must be a multiple of the maximum packet size of the endpoint, adjusted to the
DWORD boundary.
a) transfer size[epnum] = n * (mps[epnum] + 4 - (mps[epnum] mod 4))
b) packet count[epnum] = n
c) n > 0
3. In DMA mode, the core stores a received data packet in the memory, always starting
on a DWORD boundary. If the maximum packet size of the endpoint is not a multiple
of 4, the core inserts byte pads at end of a maximum-packet-size packet up to the
end of the DWORD.
4. On any OUT endpoint interrupt, the application must read the endpoint's Transfer
Size register to calculate the size of the payload in the memory. The received payload
size can be less than the programmed transfer size.
a) Payload size in memory = application-programmed initial transfer size - core
updated final transfer size
6. When the application has read all the data (equivalent to XferSize), the core
generates a DOEPINTx.XferCompl interrupt.
7. The application processes the interrupt and uses the setting of the
DOEPINTx.XferCompl interrupt bit to determine that the intended transfer is
complete.
Application Requirements
1. All the application requirements for non-isochronous OUT data transfers also apply
to isochronous OUT data transfers
2. For isochronous OUT data transfers, the Transfer Size and Packet Count fields must
always be set to the number of maximum-packet-size packets that can be received
in a single frame and no more. Isochronous OUT data transfers cannot span more
than 1 frame.
a) 1 <= packet count[epnum] <= 3
3. In Slave mode, when isochronous OUT endpoints are supported in the device, the
application must read all isochronous OUT data packets from the receive FIFO (data
and status) before the end of the periodic frame (GINTSTS.EOPF interrupt). In DMA
mode, the application must guarantee enough bandwidth to allow emptying the
isochronous OUT data packet from the receive FIFO before the end of each periodic
frame.
4. To receive data in the following frame, an isochronous OUT endpoint must be
enabled after the GINTSTS.EOPF and before the GINTSTS.SOF.
Generic Interrupt OUT Data Transfers Using Periodic Transfer Interrupt Feature
This section describes a regular INTR OUT data transfer with the Periodic Transfer
Interrupt feature.
Application Requirements
1. Before setting up a periodic OUT transfer, the application must allocate a buffer in the
memory to accommodate all data to be received as part of the OUT transfer, then
program that buffer's size and start address in the endpoint-specific registers.
2. For Interrupt OUT transfers, the Transfer Size field in the endpoint's Transfer Size
register must be a multiple of the maximum packet size of the endpoint, adjusted to
the DWORD boundary. The Transfer Size programmed can span across multiple
frames based on the periodicity after which the application want to receive the
DOEPINTx.XferCompl interrupt
3. transfer size[epnum] = n * (mps[epnum] + 4 - (mps[epnum] mod 4))
4. packet count[epnum] = n
5. n > 0 (Higher value of n reduces the periodicity of the DOEPINTx.XferCompl
interrupt)
6. 1 < packet count[epnum] < n (Higher value of n reduces the periodicity of the
DOEPINTx.XferCompl interrupt)
7. In DMA mode, the core stores a received data packet in the memory, always starting
on a DWORD boundary. If the maximum packet size of the endpoint is not a multiple
of 4, the core inserts byte pads at end of a maximum-packet-size packet up to the
end of the DWORD. The application will not be informed about the frame number on
which a specific packet has been received.
8. On DOEPINTx.XferCompl interrupt, the application must read the endpoint's
Transfer Size register to calculate the size of the payload in the memory. The
received payload size can be less than the programmed transfer size.
9. Payload size in memory = application-programmed initial transfer size - core updated
final transfer size
10. Number of USB packets in which this payload was received = application-
programmed initial packet count - core updated final packet count.
11. If for some reason, the host stops sending tokens, there are no interrupts to the
application, and the application must timeout on its own.
12. The assertion of the DOEPINTx.XferCompl interrupt marks the completion of the
interrupt OUT data transfer. This interrupt does not necessarily mean that the data in
memory is good.
13. Read the DOEPTSIZx register to determine the size of the received transfer and to
determine the validity of the data received in the frame.
packet (maximum packet size or short packet) written to the receive FIFO
decrements the Packet Count field for that endpoint by 1.
6. OUT data packets received with Bad Data CRC or any packet error are flushed from
the receive FIFO automatically.
7. Interrupt packets with PID errors are not passed to application. Core discards the
packet, sends ACK and does not decrement packet count.
8. If there is no space in the receive FIFO, interrupt data packets are ignored and not
written to the receive FIFO. Additionally, interrupt OUT tokens receive a NAK
handshake reply.
9. When the packet count becomes 0 or when a short packet is received on the
endpoint, the NAK bit for that endpoint is set. Once the NAK bit is set, the isochronous
or interrupt data packets are ignored and not written to the receive FIFO, and
interrupt OUT tokens receive a NAK handshake reply.
10. After the data is written to the receive FIFO, the core's DMA engine reads the data
from the receive FIFO and writes it to external memory, one packet at a time per
endpoint.
11. At the end of every packet write on the AHB to external memory, the transfer size for
the endpoint is decremented by the size of the written packet.
12. The OUT Data Transfer Completed pattern for an OUT endpoint is written to the
receive FIFO on one of the following conditions.
13. The transfer size is 0 and the packet count is 0.
14. The last OUT data packet written to the receive FIFO is a short packet (0 < packet
size < maximum packet size)
15. When either the application or the DMA pops this entry (OUT Data Transfer
Completed), a Transfer Completed interrupt is generated for the endpoint and the
endpoint enable is cleared.
Application Requirements
1. Before setting up ISOC OUT transfers spanned across multiple frames, the
application must allocate buffer in the memory to accommodate all data to be
received as part of the OUT transfers, then program that buffer's size and start
address in the endpoint-specific registers.
a) The application must mask the GINTSTS.incomp ISO OUT.
b) The application must enable the DCTL.IgnrFrmNum
2. For ISOC transfers, the Transfer Size field in the DOEPTSIZx.XferSize register must
be a multiple of the maximum packet size of the endpoint, adjusted to the DWORD
boundary. The Transfer Size programmed can span across multiple frames based on
the periodicity after which the application wants to receive the DOEPINTx.XferCompl
interrupt
a) transfer size[epnum] = n * (mps[epnum] + 4 - (mps[epnum] mod 4))
b) packet count[epnum] = n
c) n > 0 (Higher value of n reduces the periodicity of the DOEPINTx.XferCompl
interrupt)
d) 1 =< packet count[epnum] =< n (Higher value of n reduces the periodicity of the
DOEPINTx.XferCompl interrupt).
3. In DMA mode, the core stores a received data packet in the memory, always starting
on a DWORD boundary. If the maximum packet size of the endpoint is not a multiple
of 4, the core inserts byte pads at end of a maximum-packet-size packet up to the
end of the DWORD. The application will not be informed about the frame number and
the PID value on which a specific OUT packet has been received.
4. The assertion of the DOEPINTx.XferCompl interrupt marks the completion of the
isochronous OUT data transfer. This interrupt does not necessarily mean that the
data in memory is good.
a) On DOEPINTx.XferCompl, the application must read the endpoint's Transfer Size
register to calculate the size of the payload in the memory.
b) Payload size in memory = application-programmed initial transfer size - core
updated final transfer size
c) Number of USB packets in which this payload was received = application-
programmed initial packet count - core updated final packet count.
d) If for some reason, the host stop sending tokens, there will be no interrupt to the
application, and the application must timeout on its own.
5. The assertion of the DOEPINTx.XferCompl can also mark a packet drop on USB due
to unavailability of space in the RxFifo or due to any packet errors.
a) The application must read the DOEPINTx.PktDrpSts (DOEPINTx.Bit[11] is now
used as the DOEPINTx.PktDrpSts) register to differentiate whether the
DOEPINTx.XferCompl was generated due to the normal end of transfer or due to
dropped packets. In case of packets being dropped on the USB due to
unavailability of space in the RxFifo or due to any packet errors the endpoint
enable bit is cleared.
b) In case of packet drop on the USB application must re-enable the endpoint after
recalculating the values DOEPTSIZx.XferSize and DOEPTSIZx.PktCnt.
c) Payload size in memory = application-programmed initial transfer size - core
updated final transfer size
d) Number of USB packets in which this payload was received = application-
programmed initial packet count - core updated final packet count.
Note: Due to application latencies it is possible that DOEPINT.XferComplete interrupt is
generated without DOEPINT.PktDrpSts being set, This scenario is possible only
if back-to-back packets are dropped for consecutive frames and the PktDrpSts is
merged, but the XferSize and PktCnt values for the endpoint are nonzero. In this
case, the application must proceed further by programming the PktCnt and
XferSize register for the next frame, as it would if PktDrpSts were being set.
Figure 16-24 gives the application flow for Isochronous OUT Periodic Transfer Interrupt
feature.
Figure 16-24 ISOC OUT Application Flow for Periodic Transfer Interrupt Feature
Figure 16-25 Isochronous OUT Core Internal Flow for Periodic Transfer Interrupt
Feature
b) When the isochronous OUT data packet is received with CRC errors
c) When the isochronous OUT token received by the core is corrupted
d) When the application is very slow in reading the data from the receive FIFO
2. When the core detects an end of periodic frame before transfer completion to all
isochronous OUT endpoints, it asserts the GINTSTS.incomplete Isochronous OUT
data interrupt, indicating that a DOEPINTx.XferCompl interrupt is not asserted on at
least one of the isochronous OUT endpoints. At this point, the endpoint with the
incomplete transfer remains enabled, but no active transfers remains in progress on
this endpoint on the USB.
3. This step is applicable only if the OTG core is operating in slave mode. Application
Programming Sequence
4. This step is applicable only if the OTG core is operating in slave mode. Asserting the
GINTSTS.incomplete Isochronous OUT data interrupt indicates that in the current
frame, at least one isochronous OUT endpoint has an incomplete transfer.
5. If this occurs because isochronous OUT data is not completely emptied from the
endpoint, the application must ensure that the DMA or the application empties all
isochronous OUT data (data and status) from the receive FIFO before proceeding.
a) When all data is emptied from the receive FIFO, the application can detect the
DOEPINTx.XferCompl interrupt. In this case, the application must re-enable the
endpoint to receive isochronous OUT data in the next frame, as described in
Generic Isochronous OUT Data Transfer in DMA and Slave Modes on
Page 16-92.
6. When it receives a GINTSTS.incomplete Isochronous OUT data interrupt, the
application must read the control registers of all isochronous OUT endpoints
(DOEPCTLx) to determine which endpoints had an incomplete transfer in the current
frame. An endpoint transfer is incomplete if both the following conditions are met.
a) DOEPCTLx.Even/Odd frame bit = DSTS.SOFFN[0]
b) DOEPCTLx.Endpoint Enable = 1
7. The previous step must be performed before the GINTSTS.SOF interrupt is detected,
to ensure that the current frame number is not changed.
8. For isochronous OUT endpoints with incomplete transfers, the application must
discard the data in the memory and disable the endpoint by setting the
DOEPCTLx.Endpoint Disable bit.
9. Wait for the DOEPINTx.Endpoint Disabled interrupt and enable the endpoint to
receive new data in the next frame as explained in Generic Isochronous OUT Data
Transfer in DMA and Slave Modes on Page 16-92.
a) Because the core can take some time to disable the endpoint, the application
possibly is not able to receive the data in the next frame after receiving bad
isochronous data.
IN Endpoint Disable
Use the following sequence to disable a specific IN endpoint (periodic/non-periodic) that
has been previously enabled in dedicated FIFO operation.
a) DIEPCTLx.SetNAK = 1B
3. Wait for DIEPINTx.NAK Effective interrupt.
4. Set the following bits in the DIEPCTLx register for the endpoint that must be disabled.
a) DIEPCTLx.Endpoint Disable = 1
b) DIEPCTLx.SetNAK = 1
5. Assertion of DIEPINTx.Endpoint Disabled interrupt indicates that the core has
completely disabled the specified endpoint. Along with the assertion of the interrupt,
the core also clears the following bits.
a) DIEPCTLx.EPEnable = 0B
b) DIEPCTLx.EPDisable = 0B
6. The application must read the DIEPTSIZx register for the periodic IN EP, to calculate
how much data on the endpoint was transmitted on the USB.
7. The application must flush the data in the Endpoint transmit FIFO, by setting the
following fields in the GRSTCTL register.
a) GRSTCTL.TxFIFONum = Endpoint Transmit FIFO Number
b) GRSTCTL.TxFFlush = 1
The application must poll the GRSTCTL register, until the TxFFlush bit is cleared by the
core, which indicates the end of flush operation. To transmit new data on this endpoint,
the application can re-enable the endpoint at a later point.
Bulk IN Stall
These notes refer to Figure 16-26.
1. The application has scheduled an IN transfer on receiving the DIEPINTx.InTknRcvd
When TxFIFO Empty interrupt.
2. When the transfer is in progress, the application must force a STALL on the endpoint.
This could be because the application has received a SetFeature.Endpoint Halt
command. The application sets the Stall bit, disables the endpoint and waits for the
DIEPINTx.Endpoint Disabled interrupt. This generates STALL handshakes for the
endpoint on the USB.
3. On receiving the interrupt, the application flushes the Non-periodic Transmit FIFO
and clears the DCTL.GlobalINNPNAK bit.
4. On receiving the ClearFeature.Endpoint Halt command, the application clears the
Stall bit.
5. The endpoint behaves normally and the application can re-enable the endpoint for
new transfers
a) At this point, the application must flush the data in the associated transmit FIFO or
overwrite the existing data in the FIFO by enabling the endpoint for a new transfer
in the next frame. To flush the data, the application must use the GRSTCTL
register.
DIEPCTLx.NextEP field to the endpoint number itself. The core uses the NextEP field
irrespective of the DIEPCTLx.EPEna bit.
The application can use the following formula to calculate the value of
GUSBCFG.USBTrdTim:
4 * AHB Clock + 1 PHY Clock
= (2 clock sync + 1 clock memory address + 1 clock memory data from sync RAM) + (1
PHY Clock (next PHY clock MAC can sample the 2-clock FIFO output)
Application Requirements
1. Before setting up an IN transfer, the application must ensure that all data to be
transmitted as part of the IN transfer is part of a single buffer, and must program the
size of that buffer and its start address (in DMA mode) to the endpoint-specific
registers.
2. For IN transfers, the Transfer Size field in the Endpoint Transfer Size register denotes
a payload that constitutes multiple maximum-packet-size packets and a single short
packet. This short packet is transmitted at the end of the transfer.
a) To transmit a few maximum-packet-size packets and a short packet at the end of
the transfer:
b) Transfer size[epnum] = n * mps[epnum] + sp
(where n is an integer > 0, and 0 <sp < mps[epnum])
- If (sp > 0), then packet count[epnum] = n + 1.
Otherwise, packet count[epnum] = n
c) To transmit a single zero-length data packet:
- Transfer size[epnum] = 0
- Packet count[epnum] = 1
d) To transmit a few maximum-packet-size packets and a zero-length data packet at
the end of the transfer, the application must split the transfer in two parts. The first
sends maximum-packet- size data packets and the second sends the zero-length
data packet alone.
- First transfer: transfer size[epnum] = n * mps[epnum]; packet count = n;
- Second transfer: transfer size[epnum] = 0; packet count = 1;
3. In DMA mode, the core fetches an IN data packet from the memory, always starting
at a DWORD boundary. If the maximum packet size of the IN endpoint is not a
multiple of 4, the application must arrange the data in the memory with pads inserted
at the end of a maximum-packet-size packet so that a new packet always starts on a
DWORD boundary.
4. Once an endpoint is enabled for data transfers, the core updates the Transfer Size
register. At the end of IN transfer, which ended with an Endpoint Disabled interrupt,
the application must read the Transfer Size register to determine how much data
posted in the transmit FIFO was already sent on the USB.
5. Data fetched into transmit FIFO = Application-programmed initial transfer size - core-
updated final transfer size
a) Data transmitted on USB = (application-programmed initial packet count - Core
updated final packet count) * mps[epnum]
b) Data yet to be transmitted on USB = (Application-programmed initial transfer size
- data transmitted on USB)
space in the data FIFO. The application can optionally use DIEPINTx.TxFEmp before
writing the data.
Examples
8. When the TxFIFO level falls below the halfway mark, the core generates a
GINTSTS.NonPeriodic TxFIFO Empty interrupt. This triggers the application to start
writing additional data packets to the FIFO.
9. A data packet for the second transaction is ready in the TxFIFO.
10. A data packet for third transaction is ready in the TxFIFO while the data for the
second packet is being sent on the bus.
11. The second data packet is sent to the host.
12. The last short packet is sent to the host.
13. Because the last packet is sent and XferSize is now zero, the intended transfer is
complete. The core generates a DIEPINTx.XferCompl interrupt.
14. The application processes the interrupt and uses the setting of the
DIEPINTx.XferCompl interrupt bit to determine that the intended transfer is complete
21. With data now ready in the FIFO, the core responds with the data, which the host
ACKs.
22. Because the last endpoint one packet has been sent and XferSize is now zero, the
intended transfer is complete. The core generates a DIEPINT1.XferCompl interrupt
for this endpoint.
23. The application processes the interrupt and uses the setting of the
DIEPINT1.XferCompl interrupt bit to determine that the intended transfer on endpoint
1 is complete.
Application Requirements
1. Application requirements 1, 2, 3, and 4 of Generic Non-Periodic (Bulk and
Control) IN Data Transfers on Page 16-111 also apply to periodic IN data
transfers, except for a slight modification of Requirement 2.
a) The application can only transmit multiples of maximum-packet-size data packets
or multiples of maximum-packet-size packets, plus a short packet at the end. To
transmit a few maximum- packet-size packets and a short packet at the end of the
transfer, the following conditions must be met.
- transfer size[epnum] = n * mps[epnum] + sp
(where n is an integer > 0, and 0 <sp < mps[epnum])
- If (sp > 0), packet count[epnum] = n + 1
Otherwise, packet count[epnum] = n;
- mc[epnum] = packet count[epnum]
b) The application cannot transmit a zero-length data packet at the end of transfer. It
can transmit a single zero-length data packet by it self. To transmit a single zero-
length data packet,
c) transfer size[epnum] = 0
- packet count[epnum] = 1
- mc[epnum] = packet count[epnum]
2. The application can only schedule data transfers 1 frame at a time.
a) (DIEPTSIZx.MC - 1) * DIEPCTLx.MPS <DIEPTSIZx.XferSiz <DIEPTSIZx.MC *
DIEPCTLx.MPS
b) DIEPTSIZx. PktCnt = DIEPTSIZx.MC
c) If DIEPTSIZx.XferSiz < DIEPTSIZx.MC * DIEPCTLx.MPS, the last data packet of
the transfer is a short packet.
3. This step is not applicable for isochronous data transfers, only for interrupt transfers.
The application can schedule data transfers for multiple frames, only if multiples of
max packet sizes (up to 3 packets), must be transmitted every frame. This is can be
done, only when the core is operating in DMA mode. This is not a recommended
mode though.
a) ((n*DIEPTSIZx.MC) - 1)*DIEPCTLx.MPS <= DIEPTSIZx.Transfer Size <=
n*DIEPTSIZx.MC*DIEPCTLx.MPS
b) DIEPTSIZx.Packet Count = n*DIEPTSIZx.MC
c) n is the number of frames for which the data transfers are scheduled
4. For Periodic IN endpoints, the data must always be prefetched 1 frame ahead for
transmission in the next frame. This can be done, by enabling the Periodic IN
endpoint 1 frame ahead of the frame in which the data transfer is scheduled.
5. The complete data to be transmitted in the frame must be written into the transmit
FIFO (either by the application or the DMA), before the Periodic IN token is received.
Even when 1 DWORD of the data to be transmitted per frame is missing in the
transmit FIFO when the Periodic IN token is received, the core behaves as when the
FIFO was empty. When the transmit FIFO is empty,
6. A zero data length packet would be transmitted on the USB for ISO IN endpoints
a) A NAK handshake would be transmitted on the USB for INTR IN endpoints
7. For a High Bandwidth IN endpoint with three packets in a frame, the application can
program the endpoint FIFO size to be 2*max_pkt_size and have the third packet load
in after the first packet has been transmitted on the USB.
Generic Periodic IN Data Transfers Using the Periodic Transfer Interrupt Feature
This section describes a typical Periodic IN (ISOC / INTR) data transfer with the Periodic
Transfer Interrupt feature.
1. Before setting up an IN transfer, the application must ensure that all data to be
transmitted as part of the IN transfer is part of a single buffer, and must program the
size of that buffer and its start address (in DMA mode) to the endpoint-specific
registers.
a) The application must mask the GINTSTS.incompISOIN.
2. For IN transfers, the Transfer Size field in the Endpoint Transfer Size register denotes
a payload that constitutes multiple maximum-packet-size packets and a single short
packet. This short packet is transmitted at the end of the transfer.
Figure 16-31 Periodic IN Application Flow for Periodic Transfer Interrupt Feature
For example, in a frame, the first received token is responded to with data and data
PID value D2. If the second token is responded to with a zero-length packet, the
host is expected not to send any more tokens for the respective endpoint in the
current frame. When a token arrives in the next frame it will be responded to with
the pending data PID value of D1.
b) Similarly the second token of the current frame gets responded with D0 PID. The
host is expected to send only two tokens for this frame as the first token got
responded with D1 PID.
8. When the transfer size and packet count are both 0, the Transfer Completed interrupt
for the endpoint is generated and the endpoint enable is cleared.
9. The GINTSTS.incompISOIN will be masked by the application hence at the Periodic
Frame interval (controlled by DCFG.PerFrint), even though the core finds non-empty
any of the isochronous IN endpoint FIFOs, GINTSTS.incompISOIN interrupt will not
be generated.
Figure 16-32 Periodic IN Core Internal Flow for Periodic Transfer Interrupt Feature
Table 16-9 displays the matrix of L bit and MTRF bit options.
Table 16-12 displays the matrix of IN - L Bit, SP Bit and Tx bytes options.
The descriptions provided for the different combinations in Table 16-12 depend on the
previous descriptor L, SP, and Tx Bytes values. Consider Table 16-13. The MPS for this
example is 512.
The packet starts in a non DWORD aligned address, the core does two reads on AHB
before appending the relevant bytes to form a quadlet internally. Hence the core
stores the bytes before pushing to the TXFIFO.
The packet ends in a non DWORD aligned address and it is not the end of the buffer
or expected transfer, the core may switch to service another end point and come
back to service the initial end point. In this case, the core reads the same DWORD
location again and then samples only the relevant bytes. This eliminates the storage
of the bytes for the initial end point.
For buffer data write, the core always performs DWORD accesses.
The third list is an empty list, linked to one of the OUT descriptors when premature
SETUP comes during the data/ status phase.
Two lists are for IN and OUT data respectively.
Figure 16-36 displays setup_index 0, 1, and 2 as elements of array of pointers called
setup_index. The first two elements of this array point to SETUP descriptors. The
third element of this array is initially a NULL pointer, but is eventually linked to a
SETUP descriptor. These array elements could also point to a descriptor for Control
Read Status phase.
d) L=1.
2. Enable DMAIf current setup_index =0, then setup_index=1. The application ping-
pongs between these two descriptors. Program the address of the current setup
descriptor (specified by setup_index) to DOEPDMAx. Write to DOEPCTLx with the
following fields.
a) DOEPCTL.MPS Max Packet size of the endpoint
b) DOEPCTL.EPEna Set to 1 to enable the DMA for the endpoint.
3. Wait for InterruptWait for OUT endpoint interrupt (GINTSTS.OEPInt). Then read
the corresponding DOEPINT.
4. If Control Read Data Stage in progress
a) Case ACheck SR bit (In this case SR bit is set, because the host cannot send
OUT at this point. If it sends OUT it is NAKed. GOTO Step 24.
b) Case B GOTO Step 26.
c) Case C:-Check SR bit (In this case SR bit is set because host cannot send OUT
packets without SETUP at this stage). GOTO Step 24.
d) Case D Cannot happen at this stage because SI cannot come alone without a
SETUP, at this stage.
e) Case E Indicates that host has switched to another SETUP (Three-Stage
control write) and then has switched to status phase without and data phase (core
clears SUP with SI in this case). Decode SETUP packet and if ok, GOTO Step 11.
else If Ctrl Write Status Stage in progress OR Two-Stage Status Stage in progress
f) Case ACheck SR bit (In this case SR bit is set, because the host cannot send
OUT at this point. If it sends OUT it is NAKed.) GOTO Step 24.
g) Case B (Could happen for Two-Stage Ctrl Transfer.) GOTO Step 26.
h) Case CGOTO Step 24.
i) Case D Clear SI interrupt and wait Step 3.
j) Case E Cannot happen at this stage.
else
Read the Descriptor status quadlet corresponding to the setup_index and check
the SR field. (Application might also want to check the BS and RxSts fields and
16. Do Step 2 Step 5 (This is for handling SETUP and also Control Read Status
phase.).
17. Setup descriptor list for Data phase IN, depending on the WLength field in the SETUP
data. The setup can be for a single descriptor OR multiple descriptors. If it is multiple
descriptors, ensure that IOC for the last descriptor is set.
a) Tx_Bytes Size of data phase (Wlength field).
b) BS Host Ready
c) L=1.
d) IOC=1. It is mandatory to set the IOC when it is the last descriptor.
e) SP=1 (Depending on the Tx_Bytes).
f) Write to DIEPDMAx with the start address of the descriptor list.
g) Write to DIEPCTLx clear the NAK and enable the endpoint.
h) Flush the corresponding TX FIFO.
i) DIEPCTLx.MPS = Max_packet size of the endpoint,
j) DIEPCTLx.CNAK=1 only if SPD already set (Case C in Step 3).
k) Also set the DOEPCTLx.CNAK for the corresponding OUT endpoint after SPD
because a premature status stage (OUT) can come which must be acked.
l) DIEPCTLx.EpEna=1.
m)GOTO Step 18.
18. Wait for InterruptWait for IN endpoint interrupt (GINTSTS.IEPInt)
19. If IN endpoint interrupt, read the corresponding DIEPINTx and if XferCompl is set
GOTO Step 20.
20. Check_DescWait for the DIEPINTx.IOC interrupt. Go to Step 21.
21. Set_StallWrite to DIEPCTLx with STALL bit set. (The STALL bit is automatically
cleared by the core with the next SETUP). The function of this process initiated in
step Step 15 is over, and must be terminated. The next control transfer is already
taken care by the process that is running from Step 2.
22. Ctrl Rd Sts Desc Check Read the descriptor to check the Rxbytes and also check
the SP field. The Three-Stage control Read is complete here. GOTO Step 2, in
preparation for the next SETUP.
23. The unexpected SETUP packet now received during the control write data phase, is
sitting in the descriptor allocated for Data. Link this to the setup descriptor pointer.
setup_desc_index = 2. Point setup_desc_index to the current OUT descriptor (which
has the SETUP). GOTO Step 5.
24. Disable IN Endpoint DMA. Core flushes the corresponding Tx FIFO in order to flush
the data that was meant for Control Write Status phase OR Control Read data phase.
If Step 12 or Step 18 is active, terminate it. GOTO Step .
25. Read Modify write DOEPCTLx to clear the NAK. Then GOTO Step 8 again.
a) DOEPCTLx.CNAKSet to 1 to clear the NAK.
26. Read Modify write DIEPCTLx to clear the NAK. Then GOTO Step 3 again.
a) DIEPCTLx.CNAKSet to 1 to clear the NAK.
27. Read Modify write DIEPCTLx to clear the NAK. Then Step 12 again
a) DIEPCTLx.CNAKSet to 1 to clear the NAK.
b) DOEPCTLx.CNAK:Set to 1 to clear the NAK for the out endpoint. This clears the
NAK to accept status stage data in case of control read.
13. The core generates DOEPINTx.XferCompl for the last OUT packet transfer to system
memory.
14. The core generates DOEPINT.StsPhsRcvd interrupt after the DMA has popped the
DATA_PHASE_DONE status from the RxFIFO.
15. Application clears the NAK and enables the IN endpoint for status phase.
16. The core starts fetching the data for the Status phase
a) Fetch the descriptor pointed by DIEPDMA.
b) Fetch the packet (if size >0) to Tx fifo.
c) Close the descriptor with DMA_DONE status
d) The core generates DIEPINTx.XferCompl interrupt after closing the descriptor.
17. The core sends out data in response to the Status Phase IN token.
2. The DMA detects the RxFIFO as non-empty and does the following.
a) Fetch the descriptor pointed by DOEPMA.
b) Transfer the SETUP packet from the RxFIFO to the buffer pointed by the
descriptor.
c) Close the descriptor with DMA_DONE status.
3. On receiving the first data phase OUT token after the SETUP, the core push a
SETUP_COMPLETE status into the RxFIFO.Core NAKs the data phase OUT tokens
because of the NAK set on receiving the SETUP packet.
4. The core generates DOEPINT.XferCompl interrupt after having transferred the
SETUP packet into memory (Step 2).
5. The core generates DOEPINT.SetUp interrupt after the DMA has popped the
SETUP_COMPLETE status out of the RxFIFO.
6. Data phase IN tokens are NAKed until this point because the NAK has not yet been
cleared by the application.
7. The core starts fetching the IN data after the application enables IN DMA (In this
example it is assumed that multiple packets are in the same buffer. But it could also
be in different buffers). This involves the following steps
a) Fetch the descriptor pointed by DIEPDMA.
b) Fetch the data into the corresponding Tx FIFO.
c) Close the descriptor with DMA_DONE status...
8. The application clears the NAK after receiving the setup complete (DOEPINT.SetUp)
interrupt. The application also clears NAK of the OUT End point to accept the status
phase.
9. After all the data has been fetched for the descriptor (Step 7), core generates
DIEPINT.XferCompl interrupt.
10. The core sends data in response to the IN token for the data phase.
11. The core sends out the last packet of the IN data phase.
12. The core ACKs the status phase.
13. The core generates DOEPINTx.XferCompl interrupt after transferring the data
received for the status phase to system memory.
6. The core ACKs the next OUT/Ping token after the NAK has been cleared by the
application.
7. The DMA detects the RxFIFO as non-empty (because of the OUT packet) and does
the following.
a) Fetch the descriptor pointed by DOEPMA.
b) Transfer the SETUP packet from the RxFIFO to the buffer pointed by the
descriptor.
c) Close the descriptor with DMA_DONE status.
d) The core generates DOEPINT.XferCompl interrupt after having transferred the
OUT packet into memory (Step 11) and closing the descriptor.
The remaining steps are similar to Steps 11-18 of Application Programming
Sequence on Page 16-143.
This example shows the core behavior for a Two-Stage Control transfer.
1. On receiving SETUP, the data is pushed into the Rx FIFO and the core sets NAK on
both IN and OUT endpoint of that control endpoint.
2. The DMA detects the RxFIFO as non-empty and does the following.
a) Fetch the descriptor pointed by DOEPMA.
b) Transfer the SETUP packet from the RxFIFO to the buffer pointed by the
descriptor.
c) Close the descriptor with DMA_DONE status.
d) The core receives another SETUP, and pushes the data into the Rx FIFO, also
sets the NAK.
3. The core generates DOEPINT.XferCompl interrupt after having transferred the
SETUP packet into memory (Step 2).
4. Host sends IN token for the data phase which is NAKed by the core, because NAK
is set in Setp3. The core pushes SETUP_COMPLETE status into RxFIFO.
5. After the application has re-enabled the OUT DMA (Application flow Step 2) core
detects RxFIFO as non-empty because of the second SETUP packet and does the
following.
a) Fetch the descriptor pointed by DOEPMA.
b) Transfer the SETUP packet from the RxFIFO to the buffer pointed by the
descriptor.
c) Close the descriptor with DMA_DONE status.
d) The core generates DOEPINTx.XferCompl interrupt after having transferred the
SETUP packet into memory (Step6).
e) The core starts fetching data for IN endpoint because the IN endpoint was enabled
by application in Step-14.
6. On seeing DOEPINTx.XferCompl (Step 7) and finding that it is a SETUP packet,
application disables the endpoint in Step 20.
7. The core generates DOEPINTx.SetUP (Setup complete) interrupt after popping the
SETUP_COMPLETE status from the RxFIFO.
8. The core generates endpoint disabled interrupt (as a result of application setting
disable bit in step 9)
9. The core generates DIEPINTx.XferCompl after completing the IN data fetch and
updating the descriptor.
10. application clears NAK after seeing setup_complete interrupt (generated in Step 10.
The flow after this is same as steps 9 - 13 of Internal Data Flow on Page 16-150
10. The core ACKs the next OUT/PING token of the data phase.
11. DMA starts transferring the OUT packet to the system memory.
a) Fetch the descriptor pointed by DOEPMA.
b) Transfer the OUT packet from the RxFIFO to the buffer pointed by the descriptor.
c) Close descriptor with DMA_DONE status.
d) The core generates DOEPINTx.XferCompl interrupt after having transferred the
OUT packet to the system memory.
e) The remaining steps are similar to Steps 11-18 of Application Programming
Sequence on Page 16-143
1. Prepare Descriptor(s):
2. The application creates descriptor list(s) in the system memory pertaining to an
Endpoint.
3. Each descriptor list may have up to n descriptors and there may be up to m descriptor
lists.
4. Application may choose to set the IOC bit of the corresponding descriptor. If the IOC
is set for the last descriptor of the list, the core generates DIEPINTx.XferCompl
interrupt after the entire list is processed.
5. Program DIEPDMAx:
a) Application programs the base address of the descriptor in the corresponding IN
Endpoint DIEPDMAx register.
6. Enable DMA:
a) Application programs the corresponding endpoint DIEPCTLx register with the
following
- DIEPCTLx.MPS Max Packet size of the endpoint
- DIEPCTLx.CNAKSet to 1 to clear the NAK
- DIEPCTLx.EPEna Set to 1 to enable the DMA for the endpoint.
7. Wait for Interrupt:
a) On reception of DIEPINTx.XferCompl, application must check the Buffer status
and Tx Status field of the descriptor to ascertain that the descriptor closed
normally.
DIEPINTx.BNA interrupt gets generated by the core when it encounters a descriptor in
the list whose Buffer Status field is not Host Ready. In this case, the application is
suppose to read the DIEPDMAx register to ascertain the address for which the BNA
interrupt is asserted to take corrective action.
Bulk IN Transfers
The core handles Bulk IN transfers internally as functionally depicted in Figure 16-50
(Non ISO IN Descriptor/Data Processing). Figure 16-51 depicts this flow.
1. Prepare Descriptor(s):
2. The application creates descriptor list(s) in the system memory pertaining to an
Endpoint.
3. Each descriptor list may have up to n descriptors and there may be up to m descriptor
lists.
4. Application may choose to set the IOC bit of the corresponding descriptor. If the IOC
is set for the last descriptor of the list, the core generates DOEPINTx.XferCompl
interrupt after the entire list is processed.
a) a. Based on L bit and MTRF bit combinations, the core may disable the end point.
Refer to Table 16-8 OUT Data Memory Structure Values on Page 16-130 for
bit field descriptions.
5. Program DOEPDMAx:
a) Application programs the base address of the descriptor in the corresponding OUT
Endpoint DOEPDMAx register.
6. Enable DMA:
a) Application programs the corresponding endpoint DOEPCTLx register with the
following
- DOEPCTL.MPS Max Packet size of the endpoint
- DOEPCTL.CNAKSet to 1 to clear the NAK
- DOEPCTL.EPEna Set to 1 to enable the DMA for the endpoint.
7. Wait for Interrupt:
a) On reception of DOEPINTx.XferCompl, application must check the Buffer status
and Rx Status field of the descriptor to ascertain that the descriptor closed
normally.
DOEPINTx.BNA interrupt gets generated by the core when it encounters a descriptor in
the list whose Buffer Status field is not Host Ready. In this case, the application is
suppose to read the DOEPDMAx register to ascertain the address for which the BNA
interrupt is asserted to take corrective action.
Isochronous IN
In the case of ISO IN After descriptor is fetched, the frame number field M is compared
with current USB frame number N.
If the frame number in the fetched descriptor is already elapsed (M<N) then the
descriptor is closed with status changed to DMA Done.
If the frame number in the fetched descriptor is for future (N>M+1) then the descriptor is
left untouched. The Core suspends and re-look at this descriptor contents in the next
frame.
If the frame number in the fetched descriptor is for current or next frame (N=M or
M+1) then the descriptor is further processed as per the flow chart. At the end of data
transfer from memory to TxFIFO the above check must be performed. And if the data
fetch finished in the subsequent frame, data must be flushed and descriptor must be
closed (DMA Done) with BUFFLUSH status.
For ISO IN, the application creates a series of descriptors (D,D+1,D+2) for a given
periodic end point corresponding to successive frames (N,N+1,N+2).
Note: The series of descriptors does not correspond to the series of frames in the same
order.
For example, D and D + 1 may correspond to N, D + 2 may correspond to N + 1 and so
on except in the case where the application can create more than one descriptor for the
same frame. The core fetches the descriptor and compares the frame/ ^frame number
field with the current frame/ ^frame number.
If the fetched descriptor corresponds to a frame which has already elapsed, the core
updates the descriptor with DMA Done Buffer status and proceeds to the next descriptor.
Prepare Descriptor(s)
The application creates descriptor list(s) in the system memory pertaining to an
Endpoint.
Each descriptor list may have up to n descriptors and there may be up to m descriptor
lists.
Application may choose to set the IOC bit of the corresponding descriptor. If the IOC is
set for the last descriptor of the list, the core generates DIEPINTx.XferCompl interrupt
after the entire list is processed.
1. Program DIEPDMAx:
a) Application programs the base address of the descriptor in the corresponding IN
Endpoint DIEPDMAx register.
2. Enable DMA:
a) Application programs the corresponding endpoint DIEPCTLx register with the
following
- DIEPCTLx.MPS Max Packet size of the endpoint
- DIEPCTLx.CNAKSet to 1 to clear the NAK
- DIEPCTLx.EPEna Set to 1 to enable the DMA for the endpoint.
Isochronous OUT
For ISO OUT transactions, the core transfers the packets from the Rx FIFO to the system
memory and updates the frame number field of the descriptor with the frame number in
which the packet was received.The frame number for which data is received is extracted
from the Receive Status queue and written back to the descriptor.
6. In Negotiated mode, the USB core detects the suspend, disconnects, and switches
back to the host role. The USB core asserts the utmiotg_dppulldown and
utmiotg_dmpulldown signals to indicate its assumption of the host role.
7. The USB core sets the Connector ID Status Change interrupt in the OTG Interrupt
Status register. The application must read the connector ID status in the OTG Control
and Status register to determine the USB core's operation as an A-device. This
indicates the completion of HNP to the application. The application must read the
Current Mode bit in the OTG Control and Status register to determine Host mode
operation.
8. The B-device connects, completing the HNP process.
The USB core disconnects and the A-device detects SE0 on the bus, indicating HNP.
The USB core asserts the utmiotg_dppulldown and utmiotg_dmpulldown signals to
indicate its assumption of the host role.
The A-device responds by activating its D+ pull-up resistor within 3 ms of detecting
SE0. The USB core detects this as a connect.
The USB core sets the Host Negotiation Success Status Change interrupt in the OTG
Interrupt Status register, indicating the HNP status. The application must read the
Host Negotiation Success bit in the OTG Control and Status register to determine
host negotiation success. The application must read the Current Mode bit in the Core
Interrupt register (GINTSTS) to determine Host mode operation.
3. The application sets the reset bit (HPRT.PrtRst) and the USB core issues a USB
reset and enumerates the A-device for data traffic
4. The USB core continues the host role of initiating traffic, and when done, suspends
the bus by writing the Port Suspend bit in the Host Port Control and Status register.
5. In Negotiated mode, when the A-device detects a suspend, it disconnects and
switches back to the host role. The USB core deasserts the utmiotg_dppulldown and
utmiotg_dmpulldown signals to indicate the assumption of the device role.
6. The application must read the Current Mode bit in the Core Interrupt (GINTSTS)
register to determine the Host mode operation.
7. The USB core connects, completing the HNP process.
5. The application sets the Port Resume bit, and the core starts driving Resume
signaling.
6. The application clears the Port Resume bit after at least 20 ms.
7. The core is in normal operating mode.
Figure 16-64 Host Mode Suspend and Resume With Clock Gating
16.9.2 Host Mode Suspend and Remote Wakeup With Clock Gating
Sequence of operations:
1. The application sets the Port Suspend bit in the Host Port CSR, and the core drives
a USB suspend.
2. The application sets the Stop PHY Clock bit in the Power and Clock Gating Control
register, the core asserts the suspend_n signal to the PHY, and the PHY clock stops.
The application sets the Gate hclk bit in the Power and Clock Gating Control register,
and the core gates the hclk (hclk_ctl) to AHB- domain modules other than the BIU.
3. The core remains in Suspend mode.
4. The Remote Wakeup signaling from the device is detected. The core deasserts the
suspend_n signal to the PHY to generate the PHY clock. The core generates a
Remote Wakeup Detected interrupt.
5. The application clears the Gate hclk and Stop PHY Clock bits. The core sets the Port
Resume bit.
6. The application clears the Port Resume bit after at least 20 ms.
7. The core is in normal operating mode.
Figure 16-65 Host Mode Suspend and Remote Wakeup With Clock Gating
16.9.3 Host Mode Session End and Start With Clock Gating
Sequence of operations:
1. The application sets the Port Suspend bit in the Host Port CSR, and the core drives
a USB suspend.
2. The application clears the Port Power bit. The core turns off VBUS.
3. The application sets the Stop PHY Clock bit in the Power and Clock Gating Control
register, the core asserts the suspend_n signal to the PHY, and the PHY clock stops.
The application sets the Gate hclk bit in the Power and Clock Gating Control register,
and the core gates the hclk (hclk_ctl) to AHB- domain modules other than the BIU.
4. The core remains in Low-Power mode.
5. The application clears the Gate hclk bit and the application clears the Stop PHY
Clock bit to start the PHY clock.
6. The application sets the Port Power bit to turn on VBUS.
7. The core detects device connection and drives a USB reset.
8. The core is in normal operating mode.
16.9.4 Host Mode Session End and SRP With Clock Gating
Sequence of operations:
1. The application sets the Port Suspend bit in the Host Port CSR, and the core drives
a USB suspend.
2. The application clears the Port Power bit. The core turns off VBUS.
3. The application sets the Stop PHY Clock bit in the Power and Clock Gating Control
register, the core asserts the suspend_n signal to the PHY, and the PHY clock stops.
The application sets the Gate hclk bit in the Power and Clock Gating Control register,
and the core gates the hclk (hclk_ctl) to AHB- domain modules other than the BIU.
4. The core remains in Low-Power mode.
5. SRP (data line pulsing) from the device is detected. The core deasserts the
suspend_n signal to the PHY to generate the PHY clock. An SRP Request Detected
interrupt is generated.
6. The application clears the Gate hclk bit and the Stop PHY Clock bit.
7. The core sets the Port Power bit to turn on VBUS.
8. The core detects device connection and drives a USB reset.
9. The core is in normal operating mode.
16.9.6 Device Mode Suspend and Remote Wakeup With Clock Gating
Sequence of operations:
1. The core detects a USB suspend and generates a Suspend Detected interrupt.
2. The application sets the Stop PHY Clock bit in the Power and Clock Gating Control
register, the core asserts the suspend_n signal to the PHY, and the PHY clock stops.
The application sets the Gate hclk bit in the Power and Clock Gating Control register,
the core gates the hclk (hclk_ctl) to AHB-domain modules other than the BIU.
3. The core remains in Suspend mode.
4. The application clears the Gate hclk bit and the Stop PHY Clock bit.
5. The application sets the Remote Wakeup bit in the Device Control register, the core
starts driving Remote Wakeup signaling.
6. The host drives Resume signaling.
7. The core is in normal operating mode.
16.9.7 Device Mode Session End and Start With Clock Gating
Sequence of operations:
1. The core detects a USB suspend, and generates a Suspend Detected interrupt. The
host turns off VBUS.
2. The application sets the Stop PHY Clock bit in the Power and Clock Gating Control
register, the core asserts the suspend_n signal to the PHY, and the PHY clock stops.
The application sets the Gate hclk bit in the Power and Clock Gating Control register,
and the core gates the hclk (hclk_ctl) to AHB- domain modules other than the BIU.
3. The core remains in Low-Power mode.
4. The new session is detected (bsessvld is high). The core deasserts the suspend_n
signal to the PHY to generate the PHY clock. A New Session Detected interrupt is
generated.
5. The application clears the Gate hclk and Stop PHY Clock bits.
6. The core detects USB reset.
7. The core is in normal operating mode
16.9.8 Device Mode Session End and SRP With Clock Gating
Sequence of operations:
1. The core detects a USB suspend, and generates a Suspend Detected interrupt. The
host turns off VBUS.
2. The application sets the Stop PHY Clock bit in the Power and Clock Gating Control
register, the core asserts the suspend_n signal to the PHY, and the PHY clock stops.
The application sets the Gate hclk bit in the Power and Clock Gating Control register,
and the core gates the hclk (hclk_ctl) to AHB- domain modules other than the BIU.
3. The core remains in Low-Power mode.
4. The application clears the Gate hclk and Stop PHY Clock bits.
5. The application sets the SRP Request bit, and the core drives data line and VBUS
pulsing.
6. The host turns on Vbus, detects device connection, and drives a USB reset.
7. The core is in normal operating mode.
required on the USB. Based on the above mentioned criteria, the application must
provide a table as described below with RAM sizes for each FIFO in each mode.
USB core shares a single SPRAM between transmit FIFO(s) and receive FIFO.
In DMA mode The SPRAM is also used for storing some register information.
In non Scatter Gather mode The Device mode Endpoint DMA address registers
(DI/OEPDMAn) and Host mode Channel DMA registers (HCDMA) are stored in the
SPRAM.
In Scatter Gather DMA modeThe Base descriptor address, the Current descriptor
address, the current buffer address and the descriptor status quadlet information for
each endpoint/channel are stored in the SPRAM.
These register information are stored at the end of the SPRAM after the space
allocated for receive and Transmit FIFO. These register space must also be taken
into account when calculating the total FIFO depth of the core as explained in the
following sections.
In addition, the registers DIEPDMAx/DOEPDMAx are maintained in RAM regardless of
the enabled/disabled setting for Dynamic FIFO Sizing.
The following rules apply while calculating how much RAM space must be allocated to
store these registers.
Host Mode
Slave mode only: No space needed.
Buffer DMA mode: One location per channel.
Scatter/Gather DMA mode: Four locations per channel as listed below.
Location for storing current descriptor address.
Location for storing current buffer address.
Location for storing the status quadlet that is used by the List processor
Location for storing the transfer size used by the token request block
For example in Scatter/Gather DMA mode, if there are ten channels, then the last forty
SPRAM locations are reserved for storing these values.
Device Mode
Slave mode only: No space needed.
Buffer DMA mode: One location per end point direction.
Scatter/Gather DMA mode: Four locations per endpoint direction:
Location for storing base descriptor address.
Location for storing current descriptor address.
Location for storing the current buffer address.
Location to store the descriptor status quadlet
For example in Scatter/Gather DMA mode, if there are five bidirectional endpoints, then
the last forty SPRAM locations are reserved for storing these values.
When operating in Scatter/Gather DMA mode, four locations per channel must be
reserved.
After reallocating the FIFO data RAM, the application must flush all FIFOs in the core
using the GRSTCTL.TxFIFO Flush and GRSTCTL.RxFIFO Flush fields. Flushing is
required to reset the pointers in the FIFOs for proper FIFO operation after reallocation.
AHB Configuration
Incomplet e Isochronous OUT Transfer
Register
Incomplet e Isochronous IN Transfer
Resume/Remote Wakeup Detected
Global Interrupt
DEVI CE IN Endpoints Interrupt
Core
Interrupt
Disconnected Detected
OR
Host Port I nterrupt
Reset Detected
OTG Interrupt
Current Mode
AND
Reserved
Reserved
Core Interrupt
Register Core Interrupt
OTG Mask Register
Interrupt
Register
Device All Endpoints
Interrupt Register
22:16 6:0 Device All Endpoints
OUT Endpoints IN Endpoints Interrupt Mask Register
16.15 Registers
Register Overview
The application controls the USB core by reading from and writing to the Control and
Status Registers (CSRs) through the AHB Slave interface. These registers are 32 bits
wide and the addresses are 32-bit block aligned.
Only the Core Global, Power and Clock Gating, Data FIFO Access, and Host Port
registers can be accessed in both Host and Device modes. When the USB core is
operating in one mode, either Device or Host, the application must not access registers
from the other mode. If an illegal access occurs, a Mode Mismatch interrupt is generated
and reflected in the Core Interrupt register (GINTSTS.ModeMis).
When the core switches from one mode to another, the registers in the new mode must
be reprogrammed as they would be after a power-on reset.
The absolute register address is calculated by adding:
Module Base Address + Offset Address
Figure 16-68 shows the CSR address map. Host and Device mode registers occupy
different addresses.
0000 H
Core Global CSRs (1 KB)
0400 H
Host Mode CSRs (1 KB)
0800H
Device Mode CSRs (1.5 KB)
0E00 H
Power and Clock Gating CSRs (0.5 KB)
1000H
Device EP 0/Host Channel 0 FIFO (4 KB)
2000H
Device EP 1/Host Channel 1 FIFO (4 KB)
3000 H
7000H
Device EP 6/Host Channel 6 FIFO (4 KB) DFIFO push/pop
8000H to this region only
for slave mode
Host Channel 7 FIFO (4 KB)
9000 H
D000 H
Host Channel 12 FIFO (4 KB)
E000 H
Host Channel 13 FIFO (4 KB)
F000 H
Reserved
20000H
Direct Access to Data FIFO RAM DFIFO debug
For Debugging (128 KB) read/write to this
3FFFFH
Access Restriction
Note: The USB registers are accessible only through word accesses. Half-word and byte
accesses on USB registers will not generate a bus error. Write to unused address
space will not cause an error but be ignored.
Global Registers
These registers are available in both Host and Device modes, and do not need to be
reprogrammed when switching between these modes.
GOTGCTL
Control and Status Register (000H) Reset Value: 0001 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Dbn
OTG BSe ASe Conl
0 cTim
Ver sVld sVId DSts
e
r rw rh rh rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Dev HstS HstN Bvali Bvali Avali Avali Vbva Vbva Ses
HNP Ses
0 HNP etHN egSc dOv dOv dOv dOv lidO lidO Req
Req Req
En PEn s Val En Val En vVal vEn Scs
r rw rw rw rh rw rw rw rw rw rw rw rh
GOTGINT
OTG Interrupt Register (004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ADe
Dbn HstN
vTO
0 ceDo egDe 0
UTC
ne t
hg
r rwh rwh rwh r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HstN Ses
egSu Req SesE
0 cSts Suc 0 ndD 0
Chn StsC et
g hng
r rwh rwh r rwh r
GAHBCFG
AHB Configuration Register (008H) Reset Value: 0000 0000H
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
NPT
PTxF GlblI
xFE DMA
0 Emp 0 HBstLen ntrM
mpL En
Lvl sk
vl
r rw rw r rw rw rw
GUSBCFG
USB Configuration Register (00CH) Reset Value: 0000 1440H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Forc Forc
TxEn OtgI
eDev eHst
CTP dDel 0 2CS
Mod Mod
ay el
e e
rw rw rw rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HNP SRP PHY
0 USBTrdTim 0 0 TOutCal
Cap Cap Sel
r rw rw rw r r r rw
GRSTCTL
Reset Register (010H) Reset Value: 1000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AHBI DMA
0
dle Req
r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Frm
TxFF RxF CSft
0 TxFNum 0 Cntr 0
lsh Flsh Rst
Rst
r rw rwh rwh r rwh r rwh
GINTSTS
Interrupt Register [HOSTMODE] (014H) Reset Value: 1400 0020H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ConI
Sess Disc
WkU DSts PTxF HChI PrtIn inco
ReqI onnI 0 0 0
pInt Chn Emp nt t mplP
nt nt
g
rwh rwh rwh rwh r rh rh rh r rwh r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RxF OTGI Mod Cur
0 1 Sof
Lvl nt eMis Mod
r r rh rwh rh rwh rh
GINTSTS
Interrupt Register [DEVICEMODE] (014H) Reset Value: 1400 0020H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ConI inco
Sess inco
WkU DSts mplS OEPI IEPI
ReqI 0 0 1 0 mpIS 0
pInt Chn OOU nt nt
nt OIN
g T
rwh rwh r rwh r r r rwh rwh r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ISO Enu GOU GIN
EOP USB USB Erly RxF OTGI Mod Cur
OutD mDo 0 TNak Nak 1 Sof
F Rst Susp Susp Lvl nt eMis Mod
rop ne Eff Eff
rwh rwh rwh rwh rwh rwh r rh rh r rh rwh rh rwh rh
GINTMSK
Interrupt Mask Register [HOSTMODE](018H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ConI
Sess Disc
WkU DSts PTxF HChI inco
ReqI onnI PrtIn
pInt Chn 0 Emp ntMs 0 mplP 0
ntMs ntMs tMsk
Msk gMs Msk k Msk
k k
k
rw rw rw rw r rw rw rw r rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RxF OTGI Mod
SofM
0 LvlM ntMs eMis 0
sk
sk k Msk
r rw rw rw rw r
GINTMSK
Interrupt Mask Register [DEVICEMODE] (018H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ConI inco
Sess Disc inco
WkU DSts mplS OEPI IEPI
ReqI onnI mpIS
pInt Chn 0 OOU ntMs ntMs 0
ntMs ntMs OIN
Msk gMs TMs k k
k k Msk
k k
rw rw rw rw r rw rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ISO Enu GOU GIN
EOP USB USB Erly RxF OTGI Mod
OutD mDo TNak Nak SofM
FMs RstM Susp Susp 0 0 LvlM ntMs eMis 0
ropM neM EffM EffM sk
k sk Msk Msk sk k Msk
sk sk sk sk
rw rw rw rw rw rw r rw rw r rw rw rw rw r
Notes
1. Use of these fields vary based on whether the OTG core is functioning as a host or
a device.
2. Do not read this register's reset value before configuring the core because the read
value is "X".
Receive Status Debug Read/Status Read and Pop Registers in Host Mode
GRXSTSR
Receive Status Debug Read Register [HOSTMODE]
(01CH) Reset Value: 0000 0000H
GRXSTSP
Receive Status Read and Pop Register [HOSTMODE]
(020H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 PktSts DPID
r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
r r r
Receive Status Debug Read/Status Read and Pop Registers in Device Mode
(GRXSTSR/GRXSTSP)
GRXSTSR
Receive Status Debug Read Register [DEVICEMODE]
(01CH) Reset Value: 0000 0000H
GRXSTSP
Receive Status Read and Pop Register [DEVICEMODE]
(020H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 FN PktSts DPID
r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
r r r
GRXFSIZ
Receive FIFO Size Register (024H) Reset Value: 0000 011AH
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
0 RxFDep
r rw
GNPTXFSIZ
Non-Periodic Transmit FIFO Size Register [HOSTMODE]
(028H) Reset Value: 0010 011AH
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
NPTxFDep NPTxFStAddr
rw rw
GNPTXFSIZ
Non-Periodic Transmit FIFO Size Register [DEVICEMODE]
(028H) Reset Value: 0010 0000H
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
INEPTxF0Dep 0
rw r
GNPTXSTS
Non-Periodic Transmit FIFO/Queue Status Register(02CH) Reset Value:
0008 0010H
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
r rh rh rh
GUID
USB Module Identification Register (03CH) Reset Value: 00AE C0XXH
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
rw rw rw
GDFIFOCFG
Global DFIFO Software Config Register(05CH) Reset Value: 027A 02B2H
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
EPInfoBaseAddr GDFIFOCfg
rw rw
HPTXFSIZ
Host Periodic Transmit FIFO Size Register(100H) Reset Value: 0100 012AH
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
PTxFSize PTxFStAddr
rw rw
DIEPTXFx (x=1-6)
Device IN Endpoint Transmit FIFO Size Register(100H + x*04H) Reset Value:
0100 011AH
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
INEPnTxFDep INEPnTxFStAddr
rw rw
HCFG
Host Configuration Register (400H) Reset Value: 0000 0200H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PerS
Desc
0 ched FrListEn 0
DMA
Ena
r rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FSL
FSLSPclk
0 1 0 SSu
Sel
pp
r r r rw rw
HFIR
Host Frame Interval Register (404H) Reset Value: 0000 EA60H
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
0 FrInt
r rw
HFNUM
Host Frame Number/Frame
Time Remaining Register (408H) Reset Value: 0000 3FFFH
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
FrRem FrNum
r rw
HPTXSTS
Host Periodic Transmit FIFO/
Queue Status Register (410H) Reset Value: 0008 0100H
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
r r rw
HAINT
Host All Channels Interrupt Register (414H) Reset Value: 0000 0000H
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
0 HAINT
r rh
HAINTMSK
Host All Channels Interrupt Mask Register(418H) Reset Value: 0000 0000H
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
0 HAINTMsk
r rw
HFLBADDR
Host Frame List Base Address Register(41CH) Reset Value: 0000 0000H
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
Starting_Address
rw
HPRT
Host Port Control and Status Register(440H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 PrtSpd 0
r rh r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PrtO
PrtO PrtE PrtC PrtC
PrtP PrtR PrtS PrtR vrCu PrtE
0 PrtLnSts 0 vrCu nCh onn onn
wr st usp es rrCh na
rrAct ng Det Sts
ng
r rwh rh r rw rwh rwh rwh r rwh rwh rwh rh
HCCHARx (x=0-13)
Host Channel-x Characteristics Register(500H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ChE ChDi Odd
DevAddr MC_EC EPType 0
na s Frm
rwh rwh rw rw rw rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EPDi
EPNum MPS
r
rw rw rw
HCINTx (x=0-13)
Host Channel-x Interrupt Register(508H + x*20H) Reset Value: 0000 0000H
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
DES
XCS
C_L Data Frm Xfer
_XA BNAI BblE Xact NYE STA AHB ChHl
0 ST_ TglE Ovru ACK NAK Com
CT_ ntr rr Err T LL Err td
ROL rr n pl
ERR
LIntr
r rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh
HCINTMSKx (x=0-13)
Host Channel-x Interrupt Mask Register(50CH + x*20H) Reset Value: 0000 0000H
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
DES
Data Frm Xfer
C_L BNAI BblE Xact AHB ChHl
ST_ TglE Ovru Nyet Ack Nak Stall Com
0 0 ntrM rrMs ErrM ErrM tdMs
rrMs nMs Msk Msk Msk Msk plMs
ROL sk k sk sk k
k k k
LIntr
r rw r rw rw rw rw rw rw rw rw rw rw rw rw
HCTSIZx (x=0-13)
Host Channel-x Transfer Size Register [SCATGATHER]
(510H + x*20H) Reset Value: 0000 0000H
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
r rw r rw rw
HCTSIZx (x=0-13)
Host Channel-x Transfer Size Register [BUFFERMODE]
(510H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XferSize
rw
HCDMAx (x=0-13)
Host Channel-x DMA Address Register [BUFFERMODE]
(514H + x*20H) Reset Value: 0000 0000H
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
DMAAddr
rw
HCDMAx (x=0-13)
Host Channel-x DMA Address Register [SCATGATHER]
(514H + x*20H) Reset Value: 0000 0000H
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
DMAAddr CTD 0
rw rw r
HCDMABx (x=0-13)
Host Channel-x DMA Buffer Address Register(51CH + x*20H) Reset Value:
0000 0000H
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
Buffer_Address
DCFG
Device Configuration Register (800H) Reset Value: 0820 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PerSchInt Desc
0 1 0 0 1 0 0
vl DMA
r r r rw rw r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
NZSt
sOU
0 PerFrInt DevAddr 0 DevSpd
THS
hk
r rw rw r rw rw
DCTL
Device Control Register (804H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Nak
0 OnB
ble
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Ignr CGO SGO CGN SGN GOU GNPI Rmt
SftDi
Frm GMC 0 UTN UTN PInN PInN 0 TNak NNa WkU
scon
Num ak ak ak ak Sts kSts pSig
rw rw r w w w w r rh rh rw rw
Table 16-21 lists the minimum duration under various conditions for which the Soft
Disconnect (SftDiscon) bit must be set for the USB host to detect a device disconnect.
To accommodate clock jitter, it is recommended that the application add some extra
delay to the specified minimum duration.
DSTS
Device Status Register (808H) Reset Value: 0000 0002H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 SOFFN
r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Errti Susp
SOFFN 0 EnumSpd
cErr Sts
rh r rh rh rh
DIEPMSK
Device IN Endpoint Common
Interrupt Mask Register (810H) Reset Value: 0000 0000H
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
INTk
Txfif INEP Xfer
BNAI nTX Time AHB EPDi
NAK oUn Nak Com
0 0 nIntr 0 0 FEm OUT ErrM sbld
Msk drnM EffM plMs
Msk pMs Msk sk Msk
sk sk k
k
r rw r rw rw r rw r rw rw rw rw rw
DOEPMSK
Device OUT Endpoint Common
Interrupt Mask Register (814H) Reset Value: 0000 0000H
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
Bna Back OUT Xfer
NYE Bble OutP SetU AHB EPDi
NAK OutI 2Bac TknE Com
0 TMs ErrM 0 ktErr 0 0 PMs ErrM sbld
Msk ntrM kSE Pdis plMs
k sk Msk k sk Msk
sk Tup Msk k
r rw rw rw r rw rw r rw r rw rw rw rw rw
DAINT
Device All Endpoints Interrupt Register(818H) Reset Value: 0000 0000H
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
OutEPInt InEpInt
rh rh
DAINTMSK
Device All Endpoints Interrupt Mask Register(81CH) Reset Value: 0000 0000H
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
OutEpMsk InEpMsk
rw rw
DVBUSDIS
Device VBUS Discharge Time Register(828H) Reset Value: 0000 17D7H
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
0 DVBUSDis
r rw
DVBUSPULSE
Device VBUS Pulsing Time Register (82CH) Reset Value: 0000 05B8H
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
0 DVBUSPulse
r rw
DIEPEMPMSK
Device IN Endpoint FIFO Empty
Interrupt Mask Register (834H) Reset Value: 0000 0000H
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
0 InEpTxfEmpMsk
r rw
DIEPCTL0
Device Control IN Endpoint 0 Control Register(900H) Reset Value: 0000 8000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EPE EPDi SNA CNA NAK
0 TxFNum Stall 0 EPType 0
na s K K Sts
rwh rwh r w w rw rwh r r rh r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
USB
ActE 0 MPS
P
r r rw
DOEPCTL0
Device Control OUT Endpoint 0 Control Register(B00H) Reset Value: 0000 8000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EPE EPDi SNA CNA NAK
0 0 Stall Snp EPType 0
na s K K Sts
rwh r r w w r rwh rw r rh r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
USB
ActE 0 MPS
P
r r r
DIEPCTLx (x=1-6)
Device Endpoint-x Control Register [INTBULK]
(900H + x*20H) Reset Value: 0000 0000H
DOEPCTLx (x=1-6)
Device Endpoint-x Control Register [INTBULK]
(B00H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EPE EPDi SetD SetD SNA CNA NAK
TxFNum Stall Snp EPType DPID
na s 1PID 0PID K K Sts
rwh rwh w w w w rw rw rw rw rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
USB
ActE 0 MPS
P
rwh r rw
DIEPCTLx (x=1-6)
Device Endpoint-x Control Register [ISOCONT]
(900H + x*20H) Reset Value: 0000 0000H
DOEPCTLx (x=1-6)
Device Endpoint-x Control Register [ISOCONT]
(B00H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SetE EO_
EPE EPDi SetO SNA CNA NAK
venF TxFNum Stall Snp EPType FrNu
na s ddFr K K Sts
r m
rwh rwh w w w w rw rwh rw rw rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
USB
ActE 0 MPS
P
rwh r rw
DIEPINTx (x=0-6)
Device Endpoint-x Interrupt Register (908H + x*20H) Reset Value: 0000 0080H
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
INTk
INEP Xfer
BNAI TxFE nTX Time AHB EPDi
0 0 Nak 0 Com
ntr mp FEm OUT Err sbld
Eff pl
p
r rwh r r rwh r rwh rwh rwh rwh rwh
DOEPINTx (x=0-6)
Device Endpoint-x Interrupt Register (B08H + x*20H) Reset Value: 0000 0080H
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
Back
NYE Bble PktD StsP OUT Xfer
NAKI BNAI 2Bac SetU AHB EPDi
0 TIntr ErrIn rpSt 0 0 hseR TknE Com
ntrpt ntr kSE p Err sbld
pt trpt s cvd Pdis pl
Tup
r rwh rwh rwh rwh r rwh r rw rwh rwh rwh rwh rwh rwh
DIEPTSIZ0
Device IN Endpoint 0 Transfer Size Register(910H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 PktCnt 0
r rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 XferSize
r rw
DOEPTSIZ0
Device OUT Endpoint 0 Transfer Size Register(B10H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 SUPCnt 0 PktCnt 0
r rw r rw r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 XferSize
r rw
DIEPTSIZx (x=1-6)
Device Endpoint-x Transfer Size Register(910H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 PktCnt XferSize
r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XferSize
rw
DOEPTSIZx (x=1-6)
Device Endpoint-x Transfer Size Register [ISO]
(B10H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XferSize
rw
DOEPTSIZx (x=1-6)
Device Endpoint-x Transfer Size Register [CONT]
(B10H + x*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XferSize
rw
DIEPDMAx (x=0-6)
Device Endpoint-x DMA Address Register(914H + x*20H) Reset Value:
XXXX XXXXH
DOEPDMAx (x=0-6)
Device Endpoint-x DMA Address Register(B14H + x*20H) Reset Value:
XXXX XXXXH
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
DMAAddr
rw
DIEPDMABx (x=0-6)
Device Endpoint-x DMA Buffer Address Register(91CH + x*20H) Reset Value:
XXXX XXXXH
DOEPDMABx (x=0-6)
Device Endpoint-x DMA Buffer Address Register(B1CH + x*20H) Reset Value:
XXXX XXXXH
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
DMABufferAddr
DTXFSTSx (x=0-6)
Device IN Endpoint Transmit FIFO Status Register(918H + x*20H) Reset Value:
0000 0000H
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
0 INEPTxFSpcAvail
r rh
PCGCCTL
Power and Clock Gating Control Register(E00H) Reset Value: 0000 0100H
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
Gate Stop
0 1 0
Hclk Pclk
r r r rw rw
16.16 Interconnects
The interconnects section describes the connectivity of the module.
References
The following documents are referenced for further information
[17] IIC Bus Specification (Philips Semiconductors v2.1)
[18] IIS Bus Specification (Philips Semiconductors June 5 1996 revision)
17.1 Overview
This section gives an overview about the feature set of the USIC.
17.1.1 Features
Each USIC channel can be individually configured to match the application needs, e.g.
the protocol can be selected or changed during run time without the need for a reset. The
following protocols are supported:
UART (ASC, asynchronous serial channel)
Module capability: receiver/transmitter with max. baud rate fPB / 4
Wide baud rate range down to single-digit baud rates
Number of data bits per data frame: 1 to 63
MSB or LSB first
LIN Support by hardware (Local Interconnect Network)
Data transfers based on ASC protocol
Baud rate detection possible by built-in capture event of baud rate generator
Checksum generation under software control for higher flexibility
SSC/SPI (synchronous serial channel with or without slave select lines)
Standard, Dual and Quad SPI format supported
Module capability: maximum baud rate fPB / 2, limited by loop delay
Number of data bits per data frame 1 to 63, more with explicit stop condition
Parity bit generation supported
MSB or LSB first
IIC (Inter-IC Bus)
Application baud rate 100 kbit/s to 400 kbit/s
7-bit and 10-bit addressing supported
Full master and slave device capability
application needs. Furthermore, specific start and end of frame indications are
supported in addition to protocol-specific events.
Flexible interface routing
Each USIC channel offers the choice between several possible input and output pins
connections for the communications signals. This allows a flexible assignment of
USIC signals to pins that can be changed without resetting the device.
Input conditioning
Each input signal is handled by a programmable input conditioning stage with
programmable filtering and synchronization capability.
Baud rate generation
Each USIC channel contains its own baud rate generator. The baud rate generation
can be based either on the internal module clock or on an external frequency input.
This structure allows data transfers with a frequency that can not be generated
internally, e.g. to synchronize several communication partners.
Transfer trigger capability
In master mode, data transfers can be triggered by events generated outside the
USIC module, e.g. by an input pin or a timer unit (transmit data validation). This
feature allows time base related data transmission.
Debugger support
The USIC offers specific addresses to read out received data without interaction with
the FIFO buffer mechanism. This feature allows debugger accesses without the risk
of a corrupted receive data sequence.
To reach a desired baud rate, two criteria have to be respected, the module capability
and the application environment. The module capability is defined with respect to the
modules input clock frequency, being the base for the module operation. Although the
modules capability being much higher (depending on the module clock and the number
of module clock cycles needed to represent a data bit), the reachable baud rate is
generally limited by the application environment. In most cases, the application
environment limits the maximum reachable baud rate due to driver delays, signal
propagation times, or due to EMI reasons.
Note: Depending on the selected additional functions (such as digital filters, input
synchronization stages, sample point adjustment, data structure, etc.), the
maximum reachable baud rate can be limited. Please also take care about
additional delays, such as (internal or external) propagation delays and driver
delays (e.g. for collision detection in ASC mode, for IIC, etc.).
SRx To Interrupt
Interrupt Generation Registers
Pins
USICx
Baud Rate Generator fPB _C0
Input
Data PPP Stages
Data
Buffer Shift ( ASC,
Signal Distribution
Unit SSC. ..)
User Interface
Channel 0
USICx
Baud Rate Generator fPB _C1
Input
Data PPP Stages
Data Shift
Buffer Unit
( ASC,
SSC. ..)
Channel 1
Note: To allow a certain flexibility in assigning required USIC input functions to port pins
of the device, each input stage can select the desired input location among several
possibilities.
The available USIC signals and their port locations are listed in the interconnects
section, see Page 17-225.
Note: To allow a certain flexibility in assigning required USIC output functions to port
pins of the device, most output signals are made available on several port pins.
The port control itself defines pin-by-pin which signal is used as output signal for
a port pin (see port chapter).
The available USIC signals and their port locations are listed in the interconnects
section, see Page 17-225.
The output signals MCLKOUT and SCLKOUT of the protocol-related divider that can
be made available on pins. In order to adapt to different applications, some output
characteristics of these signals can be configured.
For device-specific details about availability of USIC signals on pins please refer to
the interconnects section.
BRG
DX1 CLKSEL fCTQIN Protocol
Input Pre-Processor
2
Enable
fD X1
fPIN Protocol
SCLK Output
Related SCLKOUT
fFD Configration
Counter s
Enable
fPB Fractional Output
MCLK
Divider Configration MCLKOUT
Out
FIFO
In
Buffered
User Interface
FIFO
In
Buffered
Receive Data RBUF1 RSR1[3:0] DX2
RBUF Input
Receive Data
longer new and the next received data word becomes visible in RBUF and can be read
out next.
5 16
Location Data
TBUF31 DS
.
.
.
.
TBUF01 RBUFSR
TBUF00 RBUF RBUF
Mirror
If a FIFO buffer structure is used, the data handling scheme (data with associated control
information) is similar to the one without FIFO. The additional FIFO buffer can be
independently enabled/disabled for transmission and reception (e.g. if data FIFO buffers
are available for a specific USIC channel, it is possible to configure the transmit data path
without and the receive data path with FIFO buffering).
The transmit FIFO buffer is addressed by using 32 consecutive address locations for INx
instead of TBUFx (x=00-31) regardless of the FIFO depth. The 32 addresses are used
to store the 5-bit TCI (together with the written data) associated with each FIFO entry.
The receive FIFO can be read out at two independent addresses, OUTR and OUTDR
instead of RBUF and RBUFD. A read from the OUTR location triggers the next data
packet to be available for the next read (general FIFO mechanism). In order to allow non-
intrusive debugging (without risk of data loss), a second address location (OUTDR) has
been introduced. A read at this location delivers the same value as OUTR, but without
modifying the FIFO contents.
The transmit FIFO also has the capability to bypass the data stream and to load bypass
data to TBUF. This can be used to generate high-priority messages or to send an
emergency message if the transmit FIFO runs empty. The transmission control of the
FIFO buffer can also use the transfer trigger and transfer gating scheme of the
transmission logic for data validation (e.g. to trigger data transfers by events).
Note: The available size of a FIFO data buffer for a USIC channel depends on the
specific device. Please refer to the implementation chapter for details about
available FIFO buffer capability.
5-bit 16-bit
TCI=
IN31 11111 TX Data
.
.
.
.
TCI=
IN01 00001 TX Data OUTR OUTDR
Mirror
TCI=
IN00 00000 TX Data OUTR OUTDR
Generally, bit field KSCFG.NOMCFG should be configured for run mode 0 as default
setting for standard operation. If a communication channel should not react to a suspend
request (and to continue its operation as in normal mode), bit field KSCFG.SUMCFG has
to be configured with the same value as KSCFG.NOMCFG. If the communication
channel should show a different behavior and stop operation when a specific stop
condition is reached, the code for stop mode 0 or stop mode 1 have to be written to
KSCFG.SUMCFG.
The stop conditions are defined for the selected protocol (see mode control description
in the protocol section).
Note: The stop mode selection strongly depends on the application needs and it is very
unlikely that different stop modes are required in parallel in the same application.
As a result, only one stop mode type (either 0 or 1) should be used in the bit fields
in register KSCFG. Do not mix stop mode 0 and stop mode 1 and avoid transitions
from stop mode 0 to stop mode 1 (or vice versa) for the same communication
channel.
To SR0
Event Condition .
.
..
. .
is met
To SR5
has not been read out before it becomes overwritten with new incoming data, this
event occurs. It is indicated by flag PSR.DLIF and, if enabled, leads to a protocol
interrupt.
Table 17-4 shows the registers, bits and bit fields indicating the data transfer events and
controlling the interrupts of a USIC channel.
Set 2
Transmit Shift
Interrupt ..
SR0
.
Transmit Shift .
.
.
Event SR5
(End of last transmit
shift clock period of
data word)
PSCR PSR CCR INPR
Clear
CTBIF TBIF TBIEN TBINP
Set 2
Transmit Buffer
Interrupt .
SR0
.
Transmit Buffer .
.
.
.
Event SR5
(First transmit shift
clock of data word)
Set 2
Standard Standard
SR0
Receive Event Receive Interrupt .. ..
. .
SR5
New Data in 0
RBUF Event 1
Alternate Alternate SR0
Receive Event Receive Interrupt .
.
.
.
. .
SR5
Set
2
Clear
CAIF AIF AIEN AINP
PSCR PSR CCR INPR
Set 2
Receive Start SR0
Receive Start Interrupt .
.
.
.
. .
Event SR5
(First receive shift
clock of data world)
Set 2
Data Lost
Interrupt .
SR0
.
. .
Data Lost Event . .
(RBUF becomes SR5
overwritten without
having been read out)
Table 17-5 shows the registers, bits and bit fields indicating the baud rate generator
event and controlling the interrupt of a USIC channel.
Figure 17-9 shows the baud rate generator event and interrupt.
DXnCR
CCR DXnCR DXnCR DXnCR
DSEL
HPCEN DPOL DSEN INSW
DXnA 000
DXnB 001
0
...
...
0 0
1 1
DXnG 110 1 1 Data Shift Unit
1 111 0
HWINn DXnS
Protocol
Pre-Processor
Digital Edge
Filter Detection
DXnINS
DXnT
DFEN CM
DXnCR DXnCR
DXnA 000
DXnB 001 0
0
...
...
1 1
1 Data Shift Unit
DXnG 110 0
1 111
DXnS Protocol
DXnINS Pre-Processor
Digital Edge
Filter Detection
DXnT
DFEN CM
DXnCR DXnCR
0 1 Receive shift
Similar to 1 clock (DSU)
0
structure of 1
0
DX2
1 Transmit shift
0 clock (DSU)
Signal from
Protocol
Pre-processor
used for other tasks, e.g. to control data transmissions in master mode (a data word can
be tagged valid for transmission, see chapter about data buffering).
A programmable edge detection indicates that the desired event has occurred by
activating the trigger signal DXnT (introducing a delay of one period of fPB before a
reaction to this event can take place).
fractional multiplication of n/1024 for a value of n between 0 and 1023. In general, the
fractional divider mode allows to program the average output clock frequency with a
finer granularity than in normal divider mode. Please note that in fractional divider
mode fFD can have a maximum period jitter of one fPB period. This jitter is not
accumulated over several cycles.
The frequency fFD is generated by an addition of FDR.STEP to FDR.RESULT with
fPB. The frequency fFD is based on the overflow of the addition result over 3FFH.
The output frequency in fractional divider mode is defined by the equation:
n
fFD = fPB with n = STEP (17.2)
1024
The output frequency fFD of the fractional divider is selected for baud rate generation by
BRG.CLKSEL = 00B.
In order to define a frequency ratio between the master clock MCLK and the shift clock
SCLK, the divider stage for MCLK is located in front of the divider by PDIV+1, whereas
the divider stage for SCLK is located at the output of this divider.
fPIN
fMCLK = (17.3)
2
fPDIV
fSCLK = (17.4)
2
In the case that the master clock is used as reference for external devices (e.g. for IIS
components) and a fixed phase relation to SCLK and other timing signals is required, it
is recommended to use the MCLK signal as input for the PDIV divider. If the MCLK signal
is not used or a fixed phase relation is not necessary, the faster frequency fPIN can be
selected as input frequency.
1
fPDIV = fPIN if PPPEN = 0
PDIV + 1
(17.5)
1
fPDIV = fMCLK if PPPEN = 1
PDIV + 1
11
10
fCTQIN
01
00
when it reaches its maximum value. Additionally, a baud rate generator interrupt event
is generated (bit PSR.BRGIF becomes set).
If an event is indicated by DX0T or DX1T, the actual timer value is captured into bit field
CMTR.CTV and the timer restarts from 0. Additionally, a transmit shift interrupt event is
generated (bit PSR.TSIF becomes set).
DX0T 1
DX1T
Clear Capture
Divide 0
Up-Counter Capture in
fPIN by 2 1 fPPP CTV
fMC L K
MCLK
PPPEN TMEN = 1
BRG BRG
PCTQ DCTQ
BRG BRG
MCLKOUT
Bit BRG. 0 1
MCLKCFG
TSR0
Shift Data Output 0
8 8 4 4
Shift Clock Domain TSR
Control 16 16
Shift Clock Input Shift and Status
Control & of TSR
Shift Control Input Status 16
Data
Transmit
Control
Optional TBUFx
FIFO
System Clock Domain
Depending on the shift mode, different transmit shift registers with different bit
composition are used as shown in Table 17-7. Note that the n in the table denotes the
shift number less one, i.e. for the first data shift n = 0, the second data shift n = 1 and
continues until the total number of shifts less one is reached.
For all transmit shift registers, whether the first bit shifted out is the MSB or LSB depends
on the setting of SCTR.SDIR.
The control and status bits for the data validation are located in register TCSR. The data
validation is based on the logic blocks shown in Figure 17-18.
DX2T Transfer TE
Trigger TDV
Shift Control TBUF
Input DX2 Data
Transfer Validation
DX2S Gating
TDEN TDSSM
TCSR TCSR
If bit TCSR.TDSSM = 0, the content of the transmit buffer TBUF is always considered
as valid for transmission. The transfer trigger mechanism can be used to start the
transfer of the same data word based on the selected event (e.g. on a timer base or
an edge at a pin) to realize a kind of life-sign mechanism. Furthermore, in slave
mode, it is ensured that always a correct data word is transmitted instead of the
passive data level.
Bit TCSR.TDSSM = 1 has to be programmed to allow word-by-word data
transmission with a kind of single-shot mechanism. After each transmission start, a
new data word has to be loaded into the transmit buffer TBUF, either by software
write actions to one of the transmit buffer input locations TBUFx or by an optional
data buffer (e.g. FIFO buffer). To avoid that data words are sent out several times or
to allow data handling with an additional data buffer (e.g. FIFO), bit TCSR.TDSSM
has to be 1.
Bit TCSR.TDV becoming automatically set when a new data word is loaded into the
transmit buffer TBUF, a transmission start can be requested by a write action of the
data to be transmitted to at least the low byte of one of the transmit buffer input
locations TBUFx. The additional information TCI can be used to control the data word
length or other parameters independently for each data word by a single write
access.
Bit field FMR.MTDV allows software driven modification (set or clear) of bit
TCSR.TDV. Together with the gating control bit field TCSR.TDEN, the user can set
up the transmit data word without starting the transmission. A possible program
sequence could be: clear TCSR.TDEN = 00B, write data to TBUFx, clear TCSR.TDV
by writing FMR.MTDV = 10B, re-enable the gating with TCSR.TDEN = 01B and then
set TCSR.TDV under software control by writing FMR.MTDV = 01B.
RSR13
Shift Data Input 3
RSR03
RSR12
Shift Data Input 2
RSR02
RSR11
Shift Data Input 1
RSR01 8 4 4
8 4 4
RSR10
Shift Data Input 0
4
RSR00
Shift 4
4
Shift Clock Input Control 8
& 4
Shift Control Input Status 8
Status of Status of 16 16 16 16 16 16
RSR0 RSR1 Data Data
RBUF01 RBUF01
SR (Lower SR (Upper RBUF0 RBUF1 SCTR
16-bit) 16-bit)
Receive
Control
RBUFSR RBUF
System Clock Domain
number of parallel data input lines. For example, to receive a 16-bit data word through
four input lines, only four shifts are required.
Depending on the shift mode, different receive shift registers with different bit
composition are used as shown in Table 17-7. Note that the n in the table denotes the
shift number less one, i.e. for the first data shift n = 0, the second data shift n = 1 and
continues until the total number of shifts less one is reached.
For all receive shift registers, whether the first bit shifted in is the MSB or LSB depends
on the setting of SCTR.SDIR.
Input pull device selection is done through the Pn_IOCRy.PCx as before, while the
output driver is fixed to push-pull-only in this mode.
One, two or four port pins can be selected with the hardware port control to support SSC
protocols with multiple bi-directional data lines, such as dual- and quad-SSC. This
selection and the enable/disable of the hardware port control is done through
CCR.HPCEN. The direction of all selected pins is controlled through a single bit
SCTR.HPCDIR.
SCTR.HPCDIR is automatically shadowed with the start of each data word to prevent
changing of the pin direction in the middle of a data word transfer.
Buffered
Receive Data Receive Data
Receive Shift Data
OUTR RBUF
FIFO Data Input (s)
Shift
Buffered Unit
Transmit Data Transmit Transmit Data (DSU) Shift Data
INx FIFO TBUF
Output (s)
Bypass
USICx_C0
User
Inter-
face
Buffered
Receive Data Receive Data
Receive Shift Data
OUTR RBUF
FIFO Data Input (s)
Shift
Buffered Unit
Transmit Data Transmit Transmit Data (DSU) Shift Data
INx FIFO TBUF
Output (s)
Bypass
USICx_C1
1) If the standard transmit buffer event is used to indicate that new data has to be written to one of the INx
locations, TBCTR.LOF = 0 should be programmed.
If the event trigger with TRBSR.STBT feature is disabled (TBCTR.STBTEN = 0), the
trigger of the standard transmit buffer event is based on the transition of the fill level from
equal to below or above the limit, not the fact of being below or above.
If TBCTR.STBTEN = 1, the transition of the fill level below or above the programmed
limit additionally sets TRBSR.STBT. This bit triggers also the standard transmit buffer
event whenever there is a transfer data to TBUF event or write data to INx event.
The way TRBSR.STBT is cleared depends on the trigger mode (selected by
TBCTR.STBTM). If TBCTR.STBTM = 0, TRBSR.STBT is cleared by hardware when the
buffer fill level equals the programmed limit again (TRBSR.TBFLVL = TBCTR.LIMIT). If
TBCTR.STBTM = 1, TRBSR.STBT is cleared by hardware when the buffer fill level
equals the buffer size (TRBSR.TBFLVL = TBCTR.SIZE).
Note: The flag TRBSR.STBI is set only when the transmit buffer fill level exceeds or falls
below the programmed limit (depending on TBCTR.LOF setting). Standard
transmit buffer events triggered by TRBSR.STBT does not set the flag.
Figure 17-22 shows examples of the standard transmit buffer event with the different
TBCTR.STBTEN and TBCTR.STBTM settings. These examples are meant to illustrate
the hardware behaviour and might not always represent real application use cases.
...
Example 1:
TBCTR settings:
SIZE = 8
LIMIT = 3
LOF = 0 D1
STBTEN = 0
STBTM = 0 D0 D0 TBUF D1 D2
D1 D1 D2 D3 ...
D2 D2 INx D3 INx D4
...
Example 2:
TBCTR settings:
SIZE = 8
LIMIT = 3
LOF = 0
STBTEN = 1
STBTM = 0 D0 D0 TBUF D2
D1 D1 D1 TBUF D2 D3 ...
D2 D2 D2 INx D3 INx D4
D1
... D1 D2 ...
Example 3: D2 D3
TBCTR settings:
SIZE = 8 D3 D4
LIMIT = 3
LOF = 0 D4 D5
STBTEN = 1
STBTM = 1 D0 D0 TBUF D1 D5 D6
D1 D1 D2 ... D6 D7 ...
D2 D2 INx D3 INx D7 INx D8
Set 2
Transmit Buffer
Transmit Buffer SR0
Error Interrupt . .
Error Event .
.
.
.
(Write to full transmit
buffer) SR5
1) If the standard receive buffer event is used to indicate that new data has to be read from OUTR,
RBCTR.LOF = 1 should be programmed.
Note: The flag TRBSR.SRBI is set only when the receive buffer fill level exceeds or falls
below the programmed limit (depending on RBCTR.LOF setting). Standard
receive buffer events triggered by TRBSR.SRBT does not set the flag.
Figure 17-24 shows examples of the standard receive buffer event with the different
RBCTR.SRBTEN and RBCTR.SRBTM settings. These examples are meant to illustrate
the hardware behaviour and might not always represent real application use cases.
...
Example 1:
RBCTR settings:
SIZE = 8
LIMIT = 3
LOF = 1 D0
D3 RBUF
SRBTEN = 0
SRBTM = 0 D2 D1
D2 D2
D1
D3
D1 D2
D1 D3
D2 ...
D0 D3
D0 D0 D4
D3
D1 D3
FIFO continues to receive data while the interrupt is Interrupt is serviced and the first
pending.
of four data reads from OUTR
takes place.
D7
D0 RBUF
... D1
D6 D7
D0 ...
Example 2: D2
D5 D1
D6
RBCTR settings:
SIZE = 8 D4 RBUF D3
D4 D2
D5
LIMIT = 3
LOF = 1 D3
D0 RBUF D3
D0 D3
D0 D3
D4
SRBTEN = 1
SRBTM = 0 D1
D2 D1
D2 D1
D2 D1
D2 D3
D0
D2
D1 D2
D1 D2
D1 ... D2
D1 D1
D2 ...
D3
D0 D3
D0 D3
D0 D3
D0 D0 D2
D1
D7
D0
D1
D6 D7
D0
D2
D5 D1
D6 D7
D3 D3
D4 D4 D2
D5 D5 D6 D6 D7 D7
For the case SRBTM = 1, SRBT remains set during these 3 instances
and interrupt is requested.
Set 2
Receive Buffer
Receive Buffer SR0
Error Interrupt . .
Error Event .
.
.
.
(Read from empty
receive buffer) SR5
Figure 17-26 shows the receiver buffer events and interrupts in RCI mode.
Set 2
Receive Buffer
Receive Buffer SR0
Error Interrupt . .
Error Event .
.
.
.
(Read from empty
receive buffer) SR5
data shifting, signal DX2S can be used for gating purposes. The transfer gating logic
is controlled by bit field BYPCR.BDEN.
A transfer trigger logic supports data word transfers related to events, e.g. timer
based or related to an input pin. If the input stage DX2 is not needed for data shifting,
signal DX2T can be used for trigger purposes. The transfer trigger logic is controlled
by bit BYPCR.BDVTR.
A bypass data validation logic combining the inputs from the gating logic, the
triggering logic and TCSR.TDV.
BYPCR TBUF
TDV
BDVTR
BYPCR
DX2T Transfer
BDV
Trigger
Shift Control Bypass
Input DX2 Data
Transfer Validation
DX2S Gating
BDEN BDSSM
BYPCR BYPCR
baud rate, the word length and the software access mechanism have to be taken into
account. Each access to the FIFO data buffer area by software or by hardware takes one
period of fPB. Especially a continuous flow of very short, consecutive data words can lead
to an access limitation.
4+ 1
WLE , EOF
BWLE
FLEMD
FLE[4:0]
0 FLE[5]
HPCMD
TCI[2:0]
3
DSM
BHPC
HPCDIR
WAMD
TCI[4]
WA
DOUT0 DOUT0
TBUF TXD TXD TBUF
Transfer Transfer
Control Control
DOUT0. Communication partner ASC A uses an internal connection with only the
transmit pin TXD, that is delivering its input value as RXD to the DX0 input stage for
reception and to DX1 to check for transmitter collisions. Communication partner ASC B
uses an external connection between the two pins TXD and RXD.
DOUT0
DOUT0
TBUF TBUF
TXD TXD
DX1 DX1
Transfer Transfer
Control Control
1
IDLE SOF DATA P STOP IDLE
0
PCR.SMD, either the current input value is directly sampled as bit value, or a majority
decision over the input values sampled at the latest three time quanta is taken into
account. The standard ASC bit timing consists of 16 time quanta with sampling after 8
or 9 time quanta with majority decision.
The bit timing setup (number of time quanta and the sampling point definition) is common
for the transmitter and the receiver. Due to independent bit timing blocks, the receiver
and the transmitter can be in different time quanta or bit positions inside their frames.
The transmission of a frame is aligned to the time quanta generation.
1 Bit Time
PCR.SP = 15
PCR.SP = 8
Time Quanta 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
The standard setting is given by CTQSEL = 00B (fCTQIN = fPDIV) and PPPEN = 0
(fPPP = fPIN). Under these conditions, the baud rate is given by:
1 1 1
fASC = fPIN (17.6)
PDIV + 1 PCTQ + 1 DCTQ + 1
fPIN 1 1 1
fASC = (17.7)
22 PDIV + 1 PCTQ + 1 DCTQ + 1
In the standard ASC signalling scheme, the 0 level is signalled during the complete bit
time with bit value 0 (ensured by programming PCR.PL = 000B). In the case
PCR.PL > 000B, the transmit output signal becomes 0 for the number of time quanta
defined by PCR.PL. In order to support correct reception with pulse shaping by the
transmitter, the sample point has to be adjusted in the receiver according to the applied
pulse length.
0-Pulse for
PL = 001 B
0-Pulse for
PL = 010 B
0-Pulse for
PL = 111 B
0-Pulse for
PL = 000 B
Time Quanta 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0
ASC Frame
STOP
SOF
D0
D1
D2
D3
D4
D5
D6
D7
Idle Idle
Bit Value
DOUT Pulse
PCR
Protocol Control Register [ASC Mode]
(3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MCL TST RST
0
K EN EN
rw r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FFIE FEIE RNIE CDE SBIE STP
PL SP IDM SMD
N N N N N B
rw rw rw rw rw rw rw rw rw rw
PSR
Protocol Status Register [ASC Mode] (48H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BRG
0
IF
r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BUS FER FER RXID TXID
AIF RIF TBIF TSIF DLIF RSIF TFF RFF RNS COL SBD
Y 1 0 LE LE
rwh rwh rwh rwh rwh rwh r rwh rwh rwh rwh rwh rwh rwh rwh rwh
If the baud rate of the slave has to be adapted to the master, the baud rate
measurement has to be enabled for falling edges by setting BRG.TMEN = 1,
DX0CR.CM = 10H and DX1CR.CM = 00H before the next symbol starts.
Synchronization byte:
The master sends this symbol after writing the data value 55H to TBUF07 (or IN07).
A slave device can either receive this symbol without any further action (and can
discard it) or it can use the falling edges for baud rate measurement. Bit
PSR.TSIF = 1 (with optionally the corresponding interrupt) indicates the detection of
a falling edge and the capturing of the elapsed time since the last falling edge in
BRG.PDIV. Valid captured values can be read out after the second, third, fourth and
fifth activation of TSIF. After the fifth activation of TSIF within this symbol, the baud
rate detection can be disabled (BRG.TMEN = 0) and BRG.PDIV can be programmed
with the formerly captured value divided by twice the number of time quanta per bit
(assuming BRG.PCTQ = 00B).
Other symbols:
The other symbols of a LIN frame can be handled with ASC data frames without
specific actions.
If LIN frames should be sent out on a frame base by the LIN master, the input DX2 can
be connected to external timers to trigger the transmit actions (e.g. the synchronization
break symbol has been prepared but is started if a trigger occurs). Please note that
during the baud rate measurement of the ASC receiver, the ASC transmitter of the same
USIC channel can still perform a transmission.
SCLKOUT SCLKIN
Baud Rate Slave Clock
DX1
Generator
SELOx SELIN
Slave Select Slave Select
Generator DX2
fPB fPB
(Master) (Slave)
A device operating in master mode controls the start and end of a data frame, as well as
the generation of the shift clock and slave select signals. This comprises the baud rate
setting for the shift clock and the delays between the shift clock and the slave select
output signals. If several SSC modules are connected together, there can be only one
SSC master at a time, but several slaves. Slave devices receive the shift clock and
optionally a slave select signal(s). For the programming of the input stages DXn please
refer to Page 17-21.
Shift
Clock
Transmit
D0 D1 Dn D0 D1 Dn
Data
Receive
D0 D1 Dn D0 D1 Dn
Data
Data Word 0 Data Word x
For dual- and quad-SSC modes that require multiple input and output data lines to be
used, additional input stages, DINx and DOUTx signals need to be set up.
Delay of
SCLKCFG
Bit Time
Input Stage
DX1
SCLK
Transfer Baud Rate
Data Shift Unit
Control Logic Generator
data bit is received in with the last falling edge of SCLKOUT. This setting can be used
in master and in slave mode. It corresponds to the behavior of the internal data shift
unit.
No delay, polarity inversion (SCLKCFG = 01B):
The inactive level of SCLKOUT is 1, while no data frame is transferred. The first data
bit of a new data frame is transmitted with the first falling clock edge of SCLKOUT
and the first data bit is received with the first rising edge of SCLKOUT. The last data
bit of a data frame is transmitted with the last falling edge of SCLKOUT and the last
data bit is received with the last rising edge of SCLKOUT. This setting can be used
in master and in slave mode.
SCLKOUT is delayed by 1/2 shift clock period, no polarity inversion
(SCLKCFG = 10B):
The inactive level of SCLKOUT is 0, while no data frame is transferred.
The first data bit of a new data frame is transmitted 1/2 shift clock period before the
first rising clock edge of SCLKOUT. Due to the delay, the next data bits seem to be
transmitted with the falling edges of SCLKOUT. The last data bit of a data frame is
transmitted 1/2 period of SCLKOUT before the last rising clock edge of SCLKOUT.
The first data bit is received 1/2 shift clock period before the first falling edge of
SCLKOUT. Due to the delay, the next data bits seem to be received with the rising
edges of SCLKOUT. The last data bit is received 1/2 period of SCLKOUT before the
last falling clock edge of SCLKOUT.
This setting can be used only in master mode and not in slave mode (the connected
slave has to provide the first data bit before the first SCLKOUT edge, e.g. as soon as
it is addressed by its slave select).
SCLKOUT is delayed by 1/2 shift clock period, polarity inversion (SCLKCFG = 11B):
The inactive level of SCLKOUT is 1, while no data frame is transferred.
The first data bit of a new data frame is transmitted 1/2 shift clock period before the
first falling clock edge of SCLKOUT. Due to the delay, the next data bits seem to be
transmitted with the rising edges of SCLKOUT. The last data bit of a data frame is
transmitted 1/2 period of SCLKOUT before the last falling clock edge of SCLKOUT.
The first data bit is received 1/2 shift clock period before the first rising edge of
SCLKOUT. Due to the delay, the next data bits seem to be received with the falling
edges of SCLKOUT. The last data bit is received 1/2 period of SCLKOUT before the
last rising clock edge of SCLKOUT.
This setting can be used only in master mode and not in slave mode (the connected
slave has to provide the first data bit before the first SCLKOUT edge, e.g. as soon as
it is addressed by its slave select).
Bit 1 Bit n
SCK
SCLKOUT
(SCLKCFG = 00B)
SCLKOUT
(SCLKCFG = 01B)
SCLKOUT
(SCLKCFG = 10B)
SCLKOUT
(SCLKCFG = 11B)
SELCFG
Input Stage
DX2
MSLS
Transfer Slave Select
Data Shift Unit Control Logic Generator
If parity generation has been enabled, the transmitter automatically extends the clock by
one cycle after the last data word of the data frame, and sends out its calculated parity
bit in this cycle.
Figure 17-41 shows how a parity bit is added to the transmitted data bits of a frame. The
number of the transmitted bits of a complete frame with parity is always one more than
that without parity. The parity bit is transmitted as the last bit of a frame, following the
data bits, independent of the shift direction (SCTR.SDIR).
Note: For dual and quad SSC protocols, the parity bit will be transmitted and received
only on DOUT0 and DX0 respectively in the extended clock cycle.
Similarly, after the receiver receives the last word of a data frame as defined by FLE, it
expects an additional one clock cycle, which will contain the parity bit. The receiver
interprets this bit as received parity and separates it from the received data. The received
parity bit value is instead monitored in the protocol-related argument (PAR) of the
receiver buffer status registers as receiver buffer status information. The receiver
compares the bit to its internally calculated parity and the result of the parity check is
indicated by the flag PSR.PARERR. The parity error event generates a protocol interrupt
if PCR.PARIEN = 1.
Parity bit generation and detection is not supported for the following cases:
When frame length is 64 data bits or greater, i.e. FLE = 63H;
When in slave mode, the end of frame occurs before the number of data bits defined
by FLE is reached.
Figure 17-42 shows an example of a Quad-SSC protocol, which requires the master
SSC to first transmit a command byte (to request a quad output read from the slave) and
a dummy byte through a single data line. At the end of the dummy byte, both master and
slave SSC switches to quad data lines, and with the roles of transmitter and receiver
reversed. The master SSC then receives the data four bits per shift clock from the slave
through the MRST[3:0] lines.
Slave
Select
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
SCLKOUT
MTSR/
Command Byte Dummy Byte 4 0 4 0
MRST0
MRST1 5 1 5 1
MRST2 6 2 6 2
MRST3 7 3 7 3
Data Data
Byte 0 Byte 1
Shadowed
00B 11B
SCTR.DSM
Shadowed
SCTR.HPCDIR
(Master)
For the master SSC, write subsequent dummy data to TBUF03 to select dual data
lines in input mode to read in valid slave data.
For the slave SSC, write valid data to TBUF07 for transmission through dual data
lines in output mode.
Figure 17-43 shows the connections for the Quad-SSC example.
DX5 DX5
MTSR3/MRST3
DOUT3 DOUT3
DX4 DX4
MTSR2/MRST2
DOUT2 DOUT2
DX3 DX3
MTSR1/MRST1
DOUT1 DOUT1
DX0 DX0
MTSR0/MRST0
DOUT0 DOUT0
clock
SCLKOUT DX1 SCLK
Slave_select
SELO DX2 SELO
receive data input pin (DIN[3:0]) with DXnCR.INSW = 1 and configure the transmit
data output pin (DOUT[3:0]). One, two or four such connections may be needed
depending on the protocol. For half-duplex configurations, hardware port control can
be also used to establish the required connections.
Baud rate generation:
The desired baud rate setting has to be selected, comprising the fractional divider
and the baud rate generator. Bit DX1CR.INSW = 0 has to be programmed to use the
baud rate generator output SCLK directly as input for the data shift unit. Configure a
shift clock output pin (signal SCLKOUT).
Slave select generation:
The slave select delay generation has to be enabled by setting PCR.MSLSEN = 1
and the programming of the time quanta counter setting. Bit DX2CR.INSW = 0 has
to be programmed to use the slave select generator output MSLS as input for the
data shift unit. Configure slave select output pins (signals SELOx) if needed.
Data format configuration:
The word length, the frame length, the shift direction and shift mode have to be set
up according to the application requirements by programming the register SCTR.
Note: The USIC can only receive in master mode if it is transmitting, because the master
frame handling refers to bit TDV of the transmitter part.
fPIN 1
fSCLK = if PPPEN = 0
2 PDIV + 1
(17.8)
fPIN 1
fSCLK = if PPPEN = 1
22 PDIV + 1
select output of the communication master becomes active a programmable time before
a data part of the frame is started (leading delay Tld), necessary to prepare the slave
device for the following communication. After the transfer of a data part of the frame, it
becomes inactive again a programmable time after the end of the last bit (trailing delay
Ttd) to respect the slave hold time requirements. If data frames are transferred back-to-
back one after the other, the minimum time between the deactivation of the slave select
and the next activation of a slave select is programmable (next-frame delay Tnf). If a data
frame consists of more than one data word, an optional delay between the data words
can also be programmed (inter-word delay Tiw).
Data Frame
Data Word 0 Data Word 1
Shift
Clock
Transmit
Data D0 D1 Dn D0 D1 Dn
Receive
Data D0 D1 Dn D0 D1 Dn
MSLS Inactive
SELOx
(SELINV = 1)
the first data bit of the next data word of the same data frame. If enabled
(TIWEN = 1), the inter-word delay starts at the end of the last SCLK cycle of a data
word. The first SCLK cycle of the following data word of the same data frame is
started when the inter-word delay has elapsed. During this time, no shift clock pulses
are generated and signal MSLS stays active. The communication partner has time to
digest the previous data word or to prepare for the next one.
Next-frame delay Tnf:
The next-frame delay starts at the end of the trailing delay. During this time, no shift
clock pulses are generated and signal MSLS stays inactive. A frame is considered as
finished after the next-frame delay has elapsed.
(PCTQ + 1) (DCTQ + 1)
Tld = Ttd =
fCTQIN
(17.9)
(PCTQ1 + 1) (DCTQ1 + 1)
Tiw = Tnf =
fCTQIN
handling, except that transmit data is not written to the locations TBUF[31:0], but to
the FIFO input locations IN[31:0] instead. In this case, software must not write to any
of the TBUF locations.
TBUF related end of frame handling:
If bit PCR.FEM = 0, an end of frame is assumed if the transmit buffer TBUF does not
contain valid transmit data at the end of a data word transmission (TCSR.TDV = 0 or
in Stop Mode). In this case, the software has to take care that TBUF does not run
empty during a data frame in Run Mode. If bit PCR.FEM = 1, signal MSLS stays
active while the transmit buffer is waiting for new data (TCSR.TDV = 1 again) or until
Stop Mode is left.
Explicit end of frame by software:
The software can explicitly stop a frame by clearing bit PSR.MSLS by writing a 1 to
the related bit position in register PSCR. This write action immediately clears bit
PSR.MSLS, whereas the internal MSLS signal becomes inactive after finishing a
currently running word transfer and respecting the slave select delays Ttd and Tnf.
MSLS event:
The MSLS generation being switched off, this event is not available.
DX2T event:
The slave select input signal SELIN is handled by the DX2 stage and the edges of
the selected signal can generate a protocol interrupt. This interrupt allows to indicate
that a data frame has started and/or that a data frame has been completely finished.
A programmable edge detection for the DX2 input signal activates DX2T, sets bit
PSR.DX2TEV and additionally, a protocol interrupt can be generated if
PCR.DX2TIEN = 1. The actual state of the selected input signal can be read out at
PSR.DX2S to take appropriate actions when this interrupt has been detected.
Parity Error Interrupt:
This interrupt indicates that there is a mismatch in the received parity bit (in
RBUFSR.PAR) with the calculated parity bit of the last received word of a data frame.
PCR
Protocol Control Register [SSC Mode]
(3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MCL TIW
0 SELO
K EN
rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DX2 MSL PARI SELI SEL MSL
DCTQ1 PCTQ1 CTQSEL1 FEM
TIEN SIEN EN NV CTR SEN
rw rw rw rw rw rw rw rw rw rw
PSR
Protocol Status Register [SSC Mode] (48H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BRG
0
IF
r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PAR DX2 MSL DX2 MSL
AIF RIF TBIF TSIF DLIF RSIF 0
ERR TEV SEV S S
rwh rwh rwh rwh rwh rwh r rwh rwh rwh rwh rwh
Tin To u t
MRST Tp ro p
RBUF TBUF
Frame Frame
Control Control
To u t Tin
Shift Clock Tp ro p
BRG
To u t Tin
Slave Select Tp ro p
SSG
The signal path between the SSC modules of the master and the slave device includes
the masters output driver, the wiring to the slave device and the slave devices input
stage. With the received shift clock edges, the slave device receives the masters
transmit data and transmits its own data back to the master device, passing by a similar
signal path in the other direction. The master module receives the slaves transmit data
related to its internal shift clock edges. In order to ensure correct data reception in the
master device, the slaves transmit data has to be stable (respecting setup and hold
times) as master receive data with the next shift clock edge of the master (generally 1/2
shift clock period). To avoid data corruption, the accumulated delays of the input and
output stages, the signal propagation on the wiring and the reaction times of the
transmitter/receiver have to be carefully considered, especially at high baud rates.
In the given example, the time between the generation of the shift clock signal and the
evaluation of the receive data by the master SSC module is given by the sum of Tout_master
+ 2 x Tprop + Tin_slave + Tout_slave + Tin_master + module reaction times + input setup times.
The input path is characterized by an input delay depending mainly on the input stage
characteristics of the pads. The output path delay is determined by the output driver
delay and its slew rate, the external load and current capability of the driver. The device
specific values for the input/output driver are given in the Data Sheet.
Figure 17-46 describes graphically the closed-loop delay and the effect of two delay
compensation options discussed in Section 17.4.6.2 and Section 17.4.6.3.
SCLK at master
(Output driver stage )
MTSR at master
Master Data
(Output driver stage )
SCLK at slave
(input driver stage )
MRST at slave
Slave Data
(Output driver stage )
MRST at master
Slave Data
(Input driver stage )
SCLK at master
(Receive data path )
Tin To u t
MRST Tp ro p
RBUF TBUF
Frame Frame
Control Control
Tin
Shift Clock Tp ro p
BRG
Tin
Slave Select Tp ro p
SSG
Tin Tou t
MRST Tprop
RBUF TBUF
Tin Tou t
Shift Clock Tp ro p
Frame (for Master Frame
Control Receive ) Control
Tin
Shift Clock Tprop
BRG
Tin
Slave Select Tprop
SSG
17.5.1 Introduction
USIC IIC Features:
Two-wire interface, with one line for shift clock transfer and synchronization (shift
clock SCL), the other one for the data transfer (shift data SDA)
Communication in standard mode (100 kBit/s) or in fast mode (up to 400 kBit/s)
Support of 7-bit addressing, as well as 10-bit addressing
Master mode operation,
where the IIC controls the bus transactions and provides the clock signal.
Slave mode operation,
where an external master controls the bus transactions and provides the clock signal.
Multi-master mode operation,
where several masters can be connected to the bus and bus arbitration can take
place, i.e. the IIC module can be master or slave. The master/slave operation of an
IIC bus participant can change from frame to frame.
Efficient frame handling (low software effort), also allowing DMA transfers
Powerful interrupt handling due to multitude of indication flags
Compensation support for input delays
(similar for SCLKOUT and DX1). The pin assignment of module IIC B shows the
connection of DOUT0 and a DX0 input at the same pin, also for SCLKOUT and a DX1
input.
TBUF TBUF
RBUF SCLKOUT + 3.3 V RBUF
SCLKOUT
SCLKIN SCLKIN
DX1 DX1
Transfer SCL Transfer
Protocol Protocol
DOUT0 + 3.3 V
PPP PPP
IIC DOUT0 IIC
DIN0 DIN0
DX0 DX0
SDA
17.5.1.2 Symbols
A symbol is a sequence of edges on the lines SDA and SCL. Symbols contain 10 or 25
time quanta tq, depending on the selected baud rate. The baud rate generator
determines the length of the time quanta tq, the sequence of edges in a symbol is
handled by the IIC protocol pre-processor, and the sequence of symbols can be
programmed by the user according to the application needs.
The following symbols are defined:
Bus idle:
SDA and SCL are high. No data transfer takes place currently.
Data bit symbol:
SDA stable during the high phase of SCL. SDA then represents the transferred bit
value. There is one clock pulse on SCL for each transferred bit of data. During data
transfers SDA may only change while SCL is low.
Start symbol:
Signal SDA being high followed by a falling edge of SDA while SCL is high indicates
a start condition. This start condition initiates a data transfer over the IIC bus after the
bus has been idle.
Repeated start symbol:
This start condition initiates a data transfer over the bus after a data symbol when the
bus has not been idle. Therefore, SDA is set high and SCL low, followed by a start
symbol.
Stop symbol:
A rising edge on SDA while SCL is high indicates a stop condition. This stop condition
terminates a data transfer to release the bus to idle state. Between a start condition
and a stop condition an arbitrary number of bytes may be transferred.
1
SDA D7 D6 Dx D0 P
Master 0
SCL 1
Master 1 2 8 9
0
1
SDA
Slave
0
SCL 1
Slave
0
as slave, 10-bit address interrupted by a stop condition after the first address byte
(PSR.ERR)
TDF slave code in master mode (PSR.WTDF)
TDF master code in slave mode (PSR.WTDF)
Reserved TDF code found (PSR.WDTF)
Start condition code during a running frame in master mode (PSR.WTDF)
Data byte transmission code after transfer direction has been changed to reception
(master read) in master mode (PSR.WTDF)
If a wrong TDF code is found in TBUF, the error event is active until the TDF value is
either corrected or invalidated. If the related interrupt is enabled, the interrupt handler
should check PSR.WDTF first and correct or invalidate TBUF, before dealing with the
other possible interrupt events.
take care about reserved addresses (refer to IIC specification for more detailed
description). Only the address 1111 0XXB is supported.
Under each of these conditions, bit PSR.SLSEL will be set when the addressing
delivered a match. This bit is cleared automatically by a (repeated) start condition.
1 1
fPCTQ = fPIN (17.10)
PDIV + 1 PCTQ + 1
To respect the specified SDA hold time of 300 ns after a falling edge of signal SCL, a
hold delay tHDEL has been introduced. It also prevents an erroneous detection of a start
or a stop condition. The length of this delay can be programmed by bit field PCR.HDEL.
Taking into account the input sampling and output update, bit field HDEL can be
programmed according to:
fPPP
HDEL 300 ns fPPP - 3 +1 with digital filter and HDELmin = 2
fPB
(17.11)
f
HDEL 300 ns fPPP - 3 PPP + 2 without digital filter and HDELmin = 1
fPB
If the digital input filter is used, HDEL compensates the filter delay of 2 filter periods (fPPP
should be used) in case of a spike on the input signal. This ensures that a data bit on the
SDA line changing just before the rising edge or behind the falling edge of SCL will not
be treated as a start or stop condition.
Start Symbol
Bus Idle
SDA
SCL
Start Symbol
SDA
tH D EL
SCL
Stop Symbol
Bus Idle
SDA
tH D EL
SCL
SDA
tH D EL
SCL
In the case of an acknowledge transmission, the USIC IIC waits for the receiver
indicating that a complete byte has been received. This adds an additional delay of 3
periods of fPB to the path. The minimum module input frequency has to be selected
properly to ensure the SDA setup time to SCL rising edge.
The following transmit data format is available in slave mode (the symbols in a frame are
controlled by the master and the slave only has to send data if it has been asked by the
master):
TDF code after a start (100B) or repeated start code (101B) in case of a write access:
If a master-write transfer is started (determined by the LSB of the address byte = 0),
the master still owns the SDA line. In this case, the transmit (000B), repeated start
(101B) and stop (110B) codes are valid. The other codes are considered as wrong.
To abort the transfer in case of a wrong code, the STOP condition is generated
immediately.
TDF code of the third and subsequent command in case of a read access with
acknowledged previous data byte:
If a master-read transfer is started (determined by the LSB of the address byte), the
transfer direction of SDA changes and the slave will actively drive the data line. To
force the slave to release the SDA line, the master has to not-acknowledge a byte
transfer. In this case, only the receive codes 010B and 011B are valid. To abort the
transfer in case of a wrong code, a dummy read must be performed by the master
before the STOP condition can be generated.
TDF code of the third and subsequent command in case of a read access with a not-
acknowledged previous data byte:
If a master-read transfer is started (determined by the LSB of the address byte), the
transfer direction of SDA changes and the slave will actively drive the data line. To
force the slave to release the SDA line, the master has to not-acknowledge a byte
transfer. In this case, only the restart (101B) and stop code (110B) are valid. To abort
the transfer in case of a wrong code, the STOP condition is generated immediately.
TDF code of the third and subsequent command in case of a write access:
If a master-write transfer is started (determined by the LSB of the address byte), the
master still owns the SDA line. In this case, the transmit (000B), repeated start (101B)
and stop (110B) codes are valid. The other codes are considered as wrong. To abort
the transfer in case of a wrong code, the STOP condition is generated immediately.
After a master device has received a non-acknowledge from a slave device, a stop
condition will be sent out automatically, except if the following TDF code requests a
repeated start condition. In this case, the TDF code is taken into account, whereas
all other TDF codes are ignored.
no
Bus idle?
yes
TDF no
= 100 B ?
yes Indicate arbitration
Send start loss and release
condition bus
yes
Arbitration
lost ? Send all 1s
with ACK = 1
no
Get new valid Send all 1s
TBUF value with ACK = 0
Transmit Receive
or receive ?
Transmit
yes TDF no
TDF yes
= 000 B ?
= 010 B?
no
Send stop yes no yes
condition TDF TDF
= 101 B? = 011 B?
no
yes
Indicate error TDF
= 110 B?
Ignore TBUF
no
In master receive mode, the IIC receives a number of data bytes from a slave transmitter.
The TDF code sequence for the master receive 7-bit and 10-bit addressing modes are
shown in Table 17-16 and Table 17-17.
Table 17-16 TDF Code Sequence for Master Receive (7-bit Addressing Mode)
TDF Code TBUF[10:8] TBUF[7:0] IIC Response Interrupt Events
Sequence (TDF Code)
1st code 100B Slave Send START SCR: Indicates a
address + condition, slave START condition is
read bit address and read bit detected
TBIF: Next word can be
written to TBUF
2nd code 010B Dont care Receive data and TBIF: Next word can be
send ACK bit written to TBUF
AIF: First data received
can be read
Table 17-16 TDF Code Sequence for Master Receive (7-bit Addressing Mode)
TDF Code TBUF[10:8] TBUF[7:0] IIC Response Interrupt Events
Sequence (TDF Code)
Subsequent 010B Dont care Receive data and TBIF: Next word can be
codes for send ACK bit written to TBUF
data receive RIF: Subsequent data
received can be read
Code for 011B Dont care Receive data and TBIF: Next word can be
last data to send NACK bit written to TBUF
be received RIF: Last data received
can be read
Last code 110B Dont care Send STOP PCR: Indicates a STOP
condition condition is detected
Table 17-17 TDF Code Sequence for Master Receive (10-bit Addressing Mode)
TDF Code TBUF[10:8] TBUF[7:0] IIC Response Interrupt Events
Sequence (TDF Code)
1st code 100B Slave Send START SCR: Indicates a
address condition, slave START condition is
(1st byte) + address (1st byte) detected
write bit and write bit TBIF: Next word can be
written to TBUF
2nd code 000B Slave Send address (2nd TBIF: Next word can be
address byte) written to TBUF
(2nd byte)
3rd code 101B 1st slave Send repeated RSCR: Indicates a
address + START condition, repeated START
read bit slave address (1st condition is detected
byte) and read bit TBIF: Next word can be
written to TBUF
4th code 010B Dont care Receive data and TBIF: Next word can be
send ACK bit written to TBUF
AIF: First data received
can be read
Subsequent 010B Dont care Receive data and TBIF: Next word can be
codes for send ACK bit written to TBUF
data receive RIF: Subsequent data
received can be read
Table 17-17 TDF Code Sequence for Master Receive (10-bit Addressing Mode)
TDF Code TBUF[10:8] TBUF[7:0] IIC Response Interrupt Events
Sequence (TDF Code)
Code for 011B Dont care Receive data and TBIF: Next word can be
last data to send NACK bit written to TBUF
be received RIF: Last data received
from slave can be read
Last code 110B Dont care Send STOP PCR: Indicates a STOP
condition condition is detected
Figure 17-56 shows the interrupt events during the master transmit-slave receive and
master receive/slave transmit sequences.
Master
Transmit
Slave
Receive
SCR AIF RIF PCR
Slave
Transmit
SCR SRR TBIF TBIF PCR
the master. The slave does not check if the master reply with an ACK or NACK to the
transmitted data.
In both cases, the data transfer is terminated by the master sending a STOP condition,
which is indicated by a PCR event. See also Figure 17-56.
PCR
Protocol Control Register [IIC Mode]
(3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MCL ACKI SAC ERRI SRRI ARLI NAC PCRI RSC SCRI ACK
HDEL STIM
K EN KDIS EN EN EN KIEN EN RIEN EN 00
rw rw rw rw rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SLAD
rw
PSR
Protocol Status Register [IIC Mode] (48H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BRG
0
IF
r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
NAC RSC WTD SLS
AIF RIF TBIF TSIF DLIF RSIF ACK ERR SRR ARL PCR SCR
K R F EL
rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh
17.6.1 Introduction
The IIS protocol is a synchronous serial communication protocol mainly for audio and
infotainment applications [18].
Master Receive /
DIN0 DOUT0
Slave Transmit
RBUF DX0 TBUF
Word Address
SELOx SELIN
WA (Word Select )
DX2
Generator
SCLKOUT SCLKIN
Shift Clock
Baud Rate DX1
Generator
MCLKOUT
Master Clock
Output fPB
(Slave)
SCLKIN
Synchronization
DX1
Clock Input
fPB
(Master)
In a USIC communication channel, data words are tagged for being transmitted for the
left or for the right channel. Also the received data words contain a tag identifying the WA
state when the data has been received.
SCK
SCK SCK
WA WA
DATA DATA
MCLKOUT MCLK_IN
R
SCLKOUT SCK_IN Analog
L Inputs
WA WA_IN
DIN0 SD_OUT
DOUT0
Audio-DAC
MCLK_IN
R
SCK_IN Analog
L Outputs
WA_IN
SD_IN
length is smaller than the device frame length, not all LSBs of the transmit data can be
transferred.
It is recommended to program bits WLEMD, FLEMD and SELMD in register TCSR to 0.
SCK
s s s s s s s
WA
TDC 0 0 0
DOUT0 X D0 D1 X D0
DIN0
sampled D0 D1 D0
s = sampling of WA
SCK
s s s s s s s
WA
DOUT0 X D0 D1 D2 X D0 D1
DIN0
sampled D0 D1 D0 D1
s = sampling of WA
baud rate generator output SCLK directly as input for the data shift unit. Configure a
shift clock output pin with the inverted signal SCLKOUT without additional delay
(BRG.SCLKCFG = 01B).
Word address WA generation:
The WA generation has to be enabled by setting PCR.WAGEN = 1 and the
programming of the number of shift clock cycles between the changes of WA. Bit
DX2CR.INSW = 0 has to be programmed to use the WA generator as input for the
data shift unit. Configure WA output pin for signal SELOx if needed.
Data format configuration:
The word length, the frame length, and the shift direction have to be set up according
to the application requirements by programming the register SCTR. Generally, the
MSB is shifted first (SCTR.SDIR = 1).
Bit TCSR.WAMD can be set to use the transmit control information TCI[4] to
distinguish the data words for transmission while WA = 0 or while WA = 1.
fPIN 1
fSCLK = if PPPEN = 0
2 PDIV + 1
(17.12)
fPIN 1
fSCLK = if PPPEN = 1
22 PDIV + 1
Note: In the IIS protocol, the master (unit generating the shift clock and the WA signal)
changes the status of its data and WA output line with the falling edge of SCK. The
slave transmitter also has to transmit on falling edges. The sampling of the
received data is done with the rising edges of SCLK. The input stage DX1 and the
SCLKOUT have to be programmed to invert the shift clock signal to fit to the
internal signals.
17.6.3.2 WA Generation
The word address (or word select) line WA regularly toggles after N cycles of signal
SCLK. The time between the changes of WA is called system word length and can be
programmed by using the following bit fields.
In IIS master mode, the system word length is defined by:
BRG.CTQSEL = 10B
to base the WA toggling on SCLK
BRG.PCTQ
to define the number N of SCLK cycles per system word length
BRG.DCTQ
to define the number N of SCLK cycles per system word length
x SCLK = x SCLK =
fPIN
(PDIV+1) x MCLK (PDIV+1) x MCLK
MCLK MCLK
SCLK SCLK
zoom in
Transmitter
DOUT0 D(n) D(n+1)
Receiver
sampled D(n) D(n+1)
DIN0
1 Period of SCLK = 1 Data Bit Length
PCR
Protocol Control Register [IIS Mode]
(3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MCL
0 TDEL
K
rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DX2 ENDI WAR WAF SELI DTE WAG
0 0
TIEN EN EIEN EIEN NV N EN
rw rw rw rw rw rw rw rw rw
The flags in the PSR register can be cleared by writing a 1 to the corresponding bit
position in register PSCR. Writing a 1 to a bit position in PSR sets the corresponding flag,
but does not lead to further actions (no interrupt generation). Writing a 0 has no effect.
These flags should be cleared by software before enabling a new protocol.
PSR
Protocol Status Register [IIS Mode] (48H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BRG
0
IF
r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WAR WAF DX2 DX2
AIF RIF TBIF TSIF DLIF RSIF 0 END 0 WA
E E TEV S
rwh rwh rwh rwh rwh rwh r rwh rwh rwh rwh r rwh rwh
17.11 Registers
Table 17-19 shows all registers which are required for programming a USIC channel, as
well as the FIFO buffer. It summarizes the USIC communication channel registers and
defines the relative addresses and the reset values.
Please note that all registers can be accessed with any access width (8-bit, 16-bit, 32-
bit), independent of the described width.
All USIC registers (except bit field KSCFG.SUMCFG) are always reset by a system
reset. Bit field KSCFG.SUMCFG is reset by a debug reset.
Note: The register bits marked w always deliver 0 when read. They are used to modify
flip-flops in other registers or to trigger internal actions.
Figure 17-64 shows the register types of the USIC module registers and channel
registers. In a specific microcontroller, module registers of USIC module x are marked
by the module prefix USICx_. Channel registers of USIC module x are marked by the
channel prefix USICx_CH0_ and USICx_CH1_.
USICx Module
Channel 0 Channel 1
Registers Registers
FIFO FIFO
Buffer Buffer
Registers Registers
Channel Channel
Registers Registers
Module Registers
U, PV U, PV Page 17-653)
U, PV U, PV Page 17-964)
U, PV U, PV Page 17-127
5)
U, PV U, PV Page 17-145
6)
U, PV U, PV Page 17-693)
U, PV U, PV Page 17-100
4)
U, PV U, PV Page 17-130
5)
U, PV U, PV Page 17-148
6)
USIC0_ID
Module Identification Register
(4003 0008H) Reset Value: 00AA C0XXH
USIC1_ID
Module Identification Register
(4802 0008H) Reset Value: 00AA C0XXH
USIC2_ID
Module Identification Register
(4802 4008H) Reset Value: 00AA C0XXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MOD_NUMBER
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOD_TYPE MOD_REV
r r
CCR
Channel Control Register (40H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BRG
0
IEN
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TBIE TSIE DLIE RSIE
AIEN RIEN PM HPCEN 0 MODE
N N N N
rw rw rw rw rw rw rw rw r rw
CCFG
Channel Configuration Register (04H) Reset Value: 0000 00CFH
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
r r r r r r r r
KSCFG
Kernel State Configuration Register (0CH) Reset Value: 0000 0000H
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
BPM
BPS BPN MOD
0 0 SUMCFG 0 NOMCFG 0 ODE
UM OM EN
N
r w r rw w r rw r w rw
INPR
Interrupt Node Pointer Register (18H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 PINP
r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
r rw r rw r rw r rw
PCR
Protocol Control Register (3CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR CTR
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
PSR
Protocol Status Register (48H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BRG
0
IF
r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AIF RIF TBIF TSIF DLIF RSIF ST9 ST8 ST7 ST6 ST5 ST4 ST3 ST2 ST1 ST0
rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh
PSCR
Protocol Status Clear Register (4CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CBR
0
GIF
r w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CTBI CTSI CDLI CRSI CST CST CST CST CST CST CST CST CST CST
CAIF CRIF
F F F F 9 8 7 6 5 4 3 2 1 0
w w w w w w w w w w w w w w w w
DX0CR
Input Control Register 0 (1CH) Reset Value: 0000 0000H
DX2CR
Input Control Register 2 (24H) Reset Value: 0000 0000H
DX3CR
Input Control Register 3 (28H) Reset Value: 0000 0000H
DX4CR
Input Control Register 4 (2CH) Reset Value: 0000 0000H
DX5CR
Input Control Register 5 (30H) Reset Value: 0000 0000H
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
SFS DPO DSE DFE INS
DXS 0 CM 0 0 DSEL
EL L N N W
rh r rw rw rw r rw rw rw r rw
DX1CR
Input Control Register 1 (20H) Reset Value: 0000 0000H
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
SFS DPO DSE DFE INS DCE
DXS 0 CM 0 DSEL
EL L N N W N
rh r rw rw rw r rw rw rw rw rw
FDR
Fractional Divider Register (10H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 RESULT
rw r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DM 0 STEP
rw r rw
BRG
Baud Rate Generator Register (14H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MCL SCL
SCLKCFG KCF KOS 0 PDIV
G EL
rw rw rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PPP TME
0 DCTQ PCTQ CTQSEL 0 0 CLKSEL
EN N
r rw rw rw r rw rw r rw
CMTR
Capture Mode Timer Register (44H) Reset Value: 0000 0000H
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
0 CTV
r rwh
SCTR
Shift Control Register (34H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 WLE 0 FLE
r rwh r rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HPC
0 TRM DOCFG 0 DSM PDL SDIR
DIR
r rw rw r rw rw rw rw
TCSR
Transmit Control/Status Register (38H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TSO
0 TE TVC TV 0 0
F
r rh rh rh r rh r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TDV TDS HPC WA FLE SEL WLE
0 WA TDEN 0 TDV EOF SOF
TR SM MD MD MD MD MD
r rwh rw rw r rw rh rwh rw rw rw rw rw rw
FMR
Flag Modification Register (68H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r w w w w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CRD CRD ATV
0 0 MTDV
V1 V0 C
w w r w r w
TBUFx (x = 00-31)
Transmit Buffer Input Location x (80H + x*4) Reset Value: 0000 0000H
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
TDATA
rwh
RBUF0
Receiver Buffer Register 0 (5CH) Reset Value: 0000 0000H
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
DSR0
rh
The receive buffer register RBUF1 contains the data received from RSR1[3:0]. A read
action does not change the status of the receive data from not yet read = valid to
already read = not valid.
RBUF1
Receiver Buffer Register 1 (60H) Reset Value: 0000 0000H
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
DSR1
rh
The receive buffer status register RBUF01SR provides the status of the data in receive
buffers RBUF0 and RBUF1.
RBUF01SR
Receiver Buffer 01 Status Register (64H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RDV RDV PER PAR SOF
DS1 0 0 0 WLEN1
11 10 R1 1 1
rh rh rh r rh rh r rh r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RDV RDV PER PAR SOF
DS0 0 0 0 WLEN0
01 00 R0 0 0
rh rh rh r rh rh r rh r rh
RBUF
Receiver Buffer Register (54H) Reset Value: 0000 0000H
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
DSR
rh
If a debugger should be used to monitor the received data, the automatic update
mechanism has to be de-activated to guaranty data consistency. Therefore, the receiver
buffer register for debugging RBUFD is available. It is similar to RBUF, but without the
automatic update mechanism by a read action. So a debugger (or other monitoring
function) can read RBUFD without disturbing the receive sequence.
RBUFD
Receiver Buffer Register for Debugger(58H) Reset Value: 0000 0000H
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
DSR
rh
The receive buffer status register RBUFSR provides the status of the data in receive
buffers RBUF and RBUFD. If bits RBUF01SR.DS0 (or RBUF01SR.DS1) are 0, the lower
16-bit content of RBUF01SR is monitored in RBUFSR, otherwise the upper 16-bit
content of RBUF01SR is shown.
RBUFSR
Receiver Buffer Status Register (50H) Reset Value: 0000 0000H
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
RDV RDV PER
DS 0 PAR 0 SOF 0 WLEN
1 0 R
rh rh rh r rh rh r rh r rh
BYP
Bypass Data Register (100H) Reset Value: 0000 0000H
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
BDATA
rw
BYPCR
Bypass Control Register (104H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 BHPC BSELO
r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BPRI BDV BDS
BDV 0 BDEN 0 0 BWLE
O TR SM
rh r rw rw rw r rw r rw
TRBSR
Transmit/Receive Buffer Status Register
(114H) Reset Value: 0000 0808H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 TBFLVL 0 RBFLVL
r rh r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
STB TBU TFU TEM TBE SRB RBU RFU REM RBE
0 0 STBI 0 ARBI SRBI
T S LL PTY RI T S LL PTY RI
r rh rh rh rh r rwh rwh r rh rh rh rh rwh rwh rwh
The bits in register TRBSCR are used to clear the notification bits in register TRBSR or
to clear the FIFO mechanism for the transmit or receive buffer. A read action always
delivers 0.
TRBSCR
Transmit/Receive Buffer Status Clear Register
(118H) Reset Value: 0000 0000H
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
FLU FLU
CBD CTB CST CAR CRB CSR
SHT SHR 0 0
V ERI BI BI ERI BI
B B
w w r w w w r w w w
TBCTR
Transmitter Buffer Control Register (108H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TBE STBI
0 LOF 0 SIZE 0 ATBINP STBINP
RIEN EN
rw rw r rw r rw r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
STB STB
LIMIT 0 DPTR
TEN TM
rw rw rw r w
RBCTR
Receiver Buffer Control Register (10CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RBE SRBI ARBI
LOF RNM SIZE RCIM ARBINP SRBINP
RIEN EN EN
rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SRB SRB
LIMIT 0 DPTR
TEN TM
rw rw rw r w
INx (x = 00-31)
Transmit FIFO Buffer Input Location x
(180H + x *4) Reset Value: 0000 0000H
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
TDATA
The receiver FIFO buffer output register OUTR shows the oldest received data word in
the FIFO buffer and contains the receiver control information RCI containing the
information selected by RBCTR.RCIM. A read action from this address location delivers
the received data. With a read access of at least the low byte, the data is declared to be
read and the next entry becomes visible. Write accesses to OUTR are ignored.
OUTR
Receiver Buffer Output Register (11CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 RCI
r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DSR
rh
If a debugger should be used to monitor the received data in the FIFO buffer, the FIFO
mechanism must not be activated in order to guaranty data consistency. Therefore, a
second address set is available, named OUTDR (D like debugger), having the same bit
fields like the original buffer output register OUTR, but without the FIFO mechanism. A
debugger can read here (in order to monitor the receive data flow) without the risk of data
corruption. Write accesses to OUTDR are ignored.
OUTDR
Receiver Buffer Output Register L for Debugger
(120H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 RCI
r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DSR
rh
TRBPTR
Transmit/Receive Buffer Pointer Register
(110H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 RDOPTR 0 RDIPTR
r rh r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 TDOPTR 0 TDIPTR
r rh r rh
17.12 Interconnects
The XMC4500 device contains three USIC modules (USIC0, USIC1 and USIC2) with 2
communication channels each.
Channel 1
Channel 0
Channel 1
Channel 0
Channel 1
Bus Interface Bus Interface Bus Interface
AHB-Lite Bus
USIC Channel
DX0A
Input HWDIR
: : Hardware HWEN0
: : Stage
Port HWEN1
DX0G
Control HWEN2
HWIN0 DX0 HWEN3
DX0INS
DX1A SR0
: : Input SR1
: : Stage Interrupt SR2
DX1G Control SR3
DX1 SR4
SR5
DX1INS
DX2A SELO0
: : Input SELO1
Slave
: : Stage : :
Select
DX2G : :
Generator SELO6
DX2
SELO7
DX2INS
DX3A
: : Input DOUT0
Output
: : Stage DOUT1
Stage
DX3G DOUT2
HWIN1 DOUT DOUT3
DX3
DX3INS
DX4A
: : Input
Baud SCLKOUT
: : Stage
Rate
DX4G
Generator MCLKOUT
HWIN2 DX4
DX4INS
DX5A
: : Input
: : Stage
DX5G
HWIN3 DX5
DX5INS
18.1 Overview
The MultiCAN module contains independently operating CAN nodes with Full-CAN
functionality that are able to exchange Data and Remote Frames via a gateway function.
Transmission and reception of CAN frames is handled in accordance with CAN
specification V2.0 B (active). Each CAN node can receive and transmit standard frames
with 11-bit identifiers as well as extended frames with 29-bit identifiers.
All CAN nodes share a common set of message objects. Each message object can be
individually allocated to one of the CAN nodes. Besides serving as a storage container
for incoming and outgoing frames, message objects can be combined to build gateways
between the CAN nodes or to setup a FIFO buffer.
The message objects are organized in double-chained linked lists, where each CAN
node has its own list of message objects. A CAN node stores frames only into message
objects that are allocated to the message object list of the CAN node, and it transmits
only messages belonging to this message object list. A powerful, command-driven list
controller performs all message object list operations.
The bit timings for the CAN nodes are derived from the module timer clock (fCAN), and
are programmable up to a data rate of 1 Mbit/s. External bus transceivers are connected
to a CAN node via a pair of receive and transmit pins.
18.1.1 Features
The MultiCAN module provides the following functionality:
3 independent CAN nodes and 64 message objects available.
Compliant with ISO 11898
CAN functionality according to CAN specification V2.0 B active
Dedicated control registers for each CAN node
Data transfer rates up to 1 Mbit/s
Flexible and powerful message transfer control and error handling capabilities
Advanced CAN bus bit timing analysis and baud rate detection for each CAN node
via a frame counter
Full-CAN functionality: A set of 64 message objects can be individually
Allocated (assigned) to any CAN node
Configured as transmit or receive object
Set up to handle frames with 11-bit or 29-bit identifier
Identified by a timestamp via a frame counter
Configured to remote monitoring mode
Advanced acceptance filtering
Each message object provides an individual acceptance mask to filter incoming
frames
A message object can be configured to accept standard or extended frames or to
accept both standard and extended frames
Message objects can be grouped into four priority classes for transmission and
reception
The selection of the message to be transmitted first can be based on frame
identifier, IDE bit and RTR bit according to CAN arbitration rules, or according to
its order in the list
Advanced message object functionality
Message objects can be combined to build FIFO message buffers of arbitrary size,
limited only by the total number of message objects
Message objects can be linked to form a gateway that automatically transfers
frames between two different CAN buses. A single gateway can link any two CAN
nodes. An arbitrary number of gateways can be defined.
Advanced data management
The message objects are organized in double-chained lists
List reorganizations can be performed at any time, even during full operation of the
CAN nodes
A powerful, command-driven list controller manages the organization of the list
structure and ensures consistency of the list
Message FIFOs are based on the list structure and can easily be scaled in size
during CAN operation
Static allocation commands offer compatibility with TwinCAN applications that are
not list-based
Advanced interrupt handling
Up to 8 interrupt output lines are available. Interrupt requests can be routed
individually to one of the 8 interrupt output lines
Message post-processing notifications can be mapped flexibly using dedicated
registers consisting of notification bits
MultiCAN_overview_x_n_noTT.vsd
returns to idle state. Therefore, the same identifier can be sent in a Data Frame only by
one node in the system. There must not be more than one node programmed to send
Data Frames with the same identifier.
Standard message identifier has a length of 11 bits. CAN specification 2.0B extends the
message identifier lengths to 29 bits, i.e. the extended identifier.
CAN protocol to the in-bit-response group of protocols. The recessive ACK delimiter
bit, which must not be overwritten by a dominant bit, completes the Acknowledge Field.
Seven recessive End-of-Frame (EOF) bits finish the Data Frame. Between any two
consecutive frames, the bus must remain in the recessive state for at least 3 bit times
(called Inter Frame Space). If after the Inter Frame Space, no other nodes attempt to
transmit the bus remains in idle state with a recessive level.
Recessive Level
Bus Idle 1 11 1 1 1 4 0 - 64 15 1 1 1 7 3 Bus Idle
Dominant Level
Recessive Level
Bus Idle 1 11 1 1 18 1 2 4 0 - 64 15 1 1 1 7 3 Bus Idle
Dominant Level
Extended Data Frame
MCT06258
significant section (as in standard CAN frame) and an 18-bit most significant section,
ensures that the Identifier Extension bit (IDE) can remain at the same bit position in both
standard and extended frames.
In the Extended CAN Data Frame, the SOF bit is followed by the 32-bit Arbitration Field.
The first 11 bits are the least significant bits of the 29-bit Identifier (Base-ID). These
11 bits are followed by the recessive Substitute Remote Request (SRR) bit. The SRR is
further followed by the recessive IDE bit, which indicates the frame to be an Extended
CAN frame. If arbitration remains unresolved after transmission of the first 11 bits of the
identifier, and if one of the nodes involved in arbitration is sending a Standard CAN
frame, then the Standard CAN frame will win arbitration due to the assertion of its
dominant IDE bit. Therefore, the SRR bit in an Extended CAN frame is recessive to allow
the assertion of a dominant RTR bit by a node that is sending a Standard CAN Remote
Frame. The SRR and IDE bits are followed by the remaining 18 bits of the extended
identifier and the RTR bit.
Control field and frame termination is identical to the Standard Data Frame.
Recessive Level
Bus Idle 1 11 1 1 1 4 15 1 1 1 7 3 Bus Idle
Dominant Level
Recessive Level
Bus Idle 1 11 1 1 18 1 2 4 15 1 1 1 7 3 Bus Idle
Dominant Level
Extended Remote Frame
MCT06259
Recessive Level
Bus Idle 6 8 Bus Idle
Dominant Level
Recessive Level
Bus Idle 6 8 Bus Idle
Dominant Level
Error Frame of "Error Passive" Node
MCT06260
Sample
Point
MCA06261
Node Bitstream
Control Processor
Unit
CAN CAN CAN Bit Error
...
Node 0 Node 1 Node x-1 Frame Timing Handling
Counter Unit Unit
Interrupt Control Unit
Message Controller
Interrupt List
Message
Control Control
RAM
Logic Logic
Address Decoder
CAN Nodes
Each CAN node consists of several sub-units.
Bitstream Processor
The Bitstream Processor performs data, remote, error and overload frame
processing according to the ISO 11898 standard. This includes conversion between
the serial data stream and the input/output registers.
Bit Timing Unit
The Bit Timing Unit determines the length of a bit time and the location of the sample
point according to the user settings, taking into account propagation delays and
phase shift errors. The Bit Timing Unit also performs resynchronization.
Message Controller
The Message Controller handles the exchange of CAN frames between the CAN nodes
and the message objects that are stored in the Message RAM. The Message Controller
performs several functions:
Receive acceptance filtering to determine the correct message object for storing of a
received CAN frame
Transmit acceptance filtering to determine the message object to be transmitted first,
individually for each CAN node
Transfer contents between message objects and the CAN nodes, taking into account
the status/control bits of the message objects
Handling of the FIFO buffering and gateway functionality
Aggregation of message-pending notification bits
List Controller
The List Controller performs all operations that lead to a modification of the double-
chained message object lists. Only the list controller is allowed to modify the list
structure. The allocation/deallocation or reallocation of a message object can be
requested via a user command interface (command panel). The list controller state
machine then performs the requested command autonomously.
Interrupt Control
The general interrupt structure is shown in Figure 18-7. The interrupt event can trigger
the interrupt generation. The interrupt pulse is generated independently of the interrupt
flag in the interrupt status register. The interrupt flag can be reset by software by writing
a 0 to it.
If enabled by the related interrupt enable bit in the interrupt enable register, an interrupt
pulse can be generated at one of the 16 interrupt output lines INT_Om of the MultiCAN
module. If more than one interrupt source is connected to the same interrupt node
pointer (in the interrupt node pointer register), the requests are combined to one
common line.
Reset Interrupt
Writing 0 INP
Flag
Set
Interrupt
Enable To INT_O0
1
To INT_O1
Other Interrupt
.....
Sources on the
same INP To INT_On1)
Note:
1) There can be 8 or 16 interrupt outputs, (i.e INT_O7/15) depending on
device configuration.
MCA 06264
1 Bit Time
TSeg1 TSeg2
TSync TProp Tb1 Tb2
Sync.
Seg
1 Time Quantum (tq)
Sample Point Transmit Point
MCT06266
To compensate phase shifts between clocks of different CAN controllers, the CAN
controller must synchronize on any edge from the recessive to the dominant bus level.
If the hard synchronization is enabled (at the start of frame), the bit time is restarted at
the synchronization segment. Otherwise, the re-synchronization jump width TSJW defines
the maximum number of time quanta, a bit time may be shortened or lengthened by one
re-synchronization. The value of SJW is defined by bit field NBTRx.SJW.
TSJW = (SJW + 1) tq
TSeg1 TSJW + Tprop
TSeg2 TSJW
The maximum relative tolerance for fCAN depends on the Phase Buffer Segments and
the re-synchronization jump width.
A valid CAN bit timing must be written to the CAN Node Bit Timing Register NBTR before
resetting the INIT bit in the Node Control Register, i.e. before enabling the operation of
the CAN node.
The Node Bit Timing Register may be written only if bit CCE (Configuration Change
Enable) is set in the corresponding Node Control Register.
bus arbitration procedure and continues with the frame transmission when the bus was
found in idle state. While the data transmission is running, the Bitstream Processor
continuously monitors the I/O line. If (outside the CAN bus arbitration phase or the
acknowledge slot) a mismatch is detected between the voltage level on the I/O line and
the logic state of the bit currently sent out by the transmit shift register, a CAN error
interrupt request is generated, and the error code is indicated by the Node x Status
Register bit field NSRx.LEC.
The data consistency of an incoming frame is verified by checking the associated CRC
field. When an error has been detected, a CAN error interrupt request is generated and
the associated error code is presented in the Node x Status Register NSRx.
Furthermore, an Error Frame is generated and transmitted on the CAN bus. After
decomposing a faultless frame into identifier and data portion, the received information
is transferred to the message buffer executing remote and Data Frame handling,
interrupt generation and status processing.
NSRx NCRx
Correct Message
Object Transfer TXOK TRIE
NIPRx
Transmit 1
TRINP
Receive
RXOK
NSRx
NSRx NCRx
LEC LECIE
3 NIPRx
CAN Error LECINP
NCRx
NSRx
EWRN 1 ALIE
NIPRx
BOFF
ALINP
List Length Error
NSRx
List Object Error
ALERT
LLE LOE
NSRx NSRx
NFCRx NFCRx
CFCOV CFCIE
NIPRx
Frame Counter
Overflow/Event CFCINP
MCA06267
18.3.4.1 Basics
The message objects of the MultiCAN module are organized in double-chained lists,
where each message object has a pointer to the previous message object in the list as
well as a pointer to the next message object in the list. The MultiCAN module provides
8 lists. Each message object is allocated to one of these lists. In the example in
Figure 18-10, the three message objects (3, 5, and 16) are allocated to the list with
index 2 (List Register LIST2).
MCA06268
indicated by PPREV = 5). PNEXT of the last message object also points to the message
object itself because the last message object has no successor (in the example, object 3
is the last message object in the list, indicated by PNEXT = 3).
Bit field MOCTRn.LIST indicates the list index number to which the message object is
currently allocated. The message object of the example are allocated to list 2. Therefore,
all LIST bit fields for the message objects assigned to list 2 are set to LIST = 2.
. . .
MultiCAN_list_to_can_x.vsd
Table 18-1 gives an overview on the available panel commands while Table 18-6 on
Page 18-64 describes the panel commands in more detail.
A panel command is started by writing the respective command code into the Panel
Control Register bit field PANCTR.PANCMD (see Page 18-63). The corresponding
command arguments must be written into bit fields PANCTR.PANAR1 and
PANCTR.PANAR2 before writing the command code, or latest along with the command
code in a single 32-bit write access to the Panel Control Register.
With the write operation of a valid command code, the PANCTR.BUSY flag is set and
further write accesses to the Panel Control Register are ignored. The BUSY flag remains
active and the control panel remains locked until the execution of the requested
command has been completed. After a reset, the list controller builds up list 0. During
this operation, BUSY is set and other accesses to the CAN RAM are forbidden. The CAN
RAM can be accessed again when BUSY becomes inactive.
Note: The CAN RAM is automatically initialized after reset by the list controller in order
to ensure correct list pointers in each message object. The end of this CAN RAM
initialization is indicated by bit PANCTR.BUSY becoming inactive.
In case of a dynamic allocation command that takes an element from the list of
unallocated objects, the PANCTR.RBUSY bit is also set along with the BUSY bit
(RBUSY = BUSY = 1). This indicates that bit fields PANAR1 and PANAR2 are going to
be updated by the list controller in the following way:
1. The message number of the message object taken from the list of unallocated
elements is written to PANAR1.
2. If ERR (bit 7 of PANAR2) is set to 1, the list of unallocated elements was empty and
the command is aborted. If ERR is 0, the list was not empty and the command will be
performed successfully.
The results of a dynamic allocation command are written before the list controller starts
the actual allocation process. As soon as the results are available, RBUSY becomes
inactive (RBUSY = 0) again, while BUSY still remains active until completion of the
command. This allows the user to set up the new message object while it is still in the
process of list allocation. The access to message objects is not limited during ongoing
list operations. However, any access to a register resource located inside the RAM
delays the ongoing allocation process by one access cycle.
As soon as the command is finished, the BUSY flag becomes inactive (BUSY = 0) and
write accesses to the Panel Control Register are enabled again. Also, the No Operation
command code is automatically written to the PANCTR.PANCMD field. A new command
may be started any time when BUSY = 0.
All fields of the Panel Control Register PANCTR except BUSY and RBUSY may be
written by the user. This makes it possible to save and restore the Panel Control Register
if the Command Panel is used within independent (mutually interruptible) interrupt
service routines. If this is the case, any task that uses the Command Panel and that may
interrupt another task that also uses the Command Panel should poll the BUSY flag until
it becomes inactive and save the whole PANCTR register to a memory location before
issuing a command. At the end of the interrupt service routine, the task should restore
PANCTR from the memory location.
Before a message object that is allocated to the list of an active CAN node shall be
moved to another list or to another position within the same list, bit MOCTRn.MSGVAL
(Message Valid) of message object n must be cleared.
0
CAN Bus 0
CAN node 0
1
NPCR1.LBM
0
CAN Bus 1
CAN node 1
1
. .
. .
. .
NPCRx.LBM
0
CAN Bus x-1
CAN node x
1
MultiCAN_loop_back_x.vsd
Synchronization Analysis
The bit time synchronization is monitored if NFCRx.CFSEL = 010B. The time between
the first dominant edge and the sample point is measured and stored in the NFCRx.CFC
bit field. The bit timing synchronization offset may be derived from this time as the first
edge after the sample point triggers synchronization and there is only one
synchronization between consecutive sample points.
Synchronization analysis can be used, for example, for fine tuning of the baud rate
during reception of the first CAN frame with the measured baud rate.
Identifier of
Received Frame 0 = Bit match
Bitwise 1 = No match
XOR
Identifier of
Message Object
The message object that is qualified for transmission and has highest transmit priority
wins the transmit acceptance filtering, and will be transmitted first. All other message
objects lose the current transmit acceptance filtering round. They get a new chance in
subsequent acceptance filtering rounds.
&
MSGVAL
TXRQ
0 = Object will not be transmitted
1 = Object is requested for transmission
TXEN0
TXEN1
MCA06272
MOSTATn MOFCRn
TXPND RXPND OVIE TXIE RXIE MMC
= 0010B
= 0001B MOIPRn
Message n
1
transmitted TXINP
&
Message n
FIFO full &
MOIPRn
1
Message n RXINP
received
0 1 0 1 0 1 0 1 0 = Transmit Event
1 = Receive Event
31
1 D
MSB
. . . . . . . .
4 E
0 M
U
4 X
3:0
0
3 2 1 0
31 0
MPSEL
The location of a pending bit is defined by two demultiplexers selecting the number k of
the MSPNDk registers (3-bit demux), and the bit location within the corresponding
MSPNDk register (5-bit demux).
Allocation Case 1
In this allocation case, bit field MCR.MPSEL = 0000B (see Page 18-67). The location
selection consists of 2 parts:
The upper three bits of MOIPRn.MPN (MPN[7:5]) select the number k of a Message
Pending Register MSPNDk in which the pending bit will be set.
The lower five bits of MOIPRn.MPN (MPN[4:0]) select the bit position (0-31) in
MSPNDk for the pending bit to be set.
Allocation Case 2
In this allocation case, bit field MCR.MPSEL is taken into account for pending bit
allocation. Bit field MCR.MPSEL makes it possible to include the interrupt request node
pointer for reception (MOIPRn.RXINP) or transmission (MOIPRn.TXINP) for pending bit
allocation in such a way that different target locations for the pending bits are used in
receive and transmit case. If MPSEL = 1111B, the location selection operates in the
following way:
At a transmit event, the upper 3 bits of TXINP determine the number k of a Message
Pending Register MSPNDk in which the pending bit will be set. At a receive event,
the upper 3 bits of RXINP determine the number k.
The bit position (0-31) in MSPNDk for the pending bit to be set is selected by the
lowest bit of TXINP or RXINP (selects between low and high half-word of MSPNDk)
and the four least significant bits of MPN.
General Hints
The Message Pending Registers MSPNDk can be written by software. Bits that are
written with 1 are left unchanged, and bits which are written with 0 are cleared. This
makes it possible to clear individual MSPNDk bits with a single register write access.
Therefore, access conflicts are avoided when the MultiCAN module (hardware) sets
another pending bit at the same time when software writes to the register.
Each Message Pending Register MSPNDk is associated with a Message Index Register
MSIDk (see Page 18-72) which indicates the lowest bit position of all set (1) bits in
Message Pending Register k. The MSIDk register is a read-only register that is updated
immediately when a value in the corresponding Message Pending Register k is changed
by software or hardware.
MSGVAL
Bit MSGVAL (Message Valid) in the Message Object n Status Register MOSTATn is the
main switch of the message object. During the frame reception, information is stored in
the message object only when MSGVAL = 1. If bit MSGVAL is reset by the CPU, the
MultiCAN module stops all ongoing write accesses to the message object. Now the
message object can be re-configured by the CPU with subsequent write accesses to it
without being disturbed by the MultiCAN.
RTSEL
When the CPU re-configures a message object during CAN operation (for example,
clears MSGVAL, modifies the message object and sets MSGVAL again), the following
scenario can occur:
1. The message object wins receive acceptance filtering.
2. The CPU clears MSGVAL to re-configure the message object.
3. The CPU sets MSGVAL again after re-configuration.
4. The end of the received frame is reached. As MSGVAL is set, the received data is
stored in the message object, a message interrupt request is generated, gateway and
FIFO actions are processed, etc.
After the re-configuration of the message object (after step 3 above) the storage of
further received data may be undesirable. This can be achieved through bit
MOCTRn.RTSEL (Receive/Transmit Selected) that makes it possible to disconnect a
message object from an ongoing frame reception.
When a message object wins the receive acceptance filtering, its RTSEL bit is set by the
MultiCAN module to indicate an upcoming frame delivery. The MultiCAN module checks
RTSEL whether it is set on successful frame reception to verify that the object is still
ready for receiving the frame. The received frame is then stored in the message object
(along with all subsequent actions such as message interrupts, FIFO & gateway actions,
flag updates) only if RTSEL = 1.
When a message object is invalidated during CAN operation (resetting bit MSGVAL),
RTSEL should be cleared before setting MSGVAL again (latest with the same write
access that sets MSGVAL) to prevent the storage of a frame that belongs to the old
context of the message object. Therefore, a message object re-configuration should
consist of the following steps:
1. Clear MSGVAL bit
2. Re-configure the message object while MSGVAL = 0
3. Clear RTSEL bit and set MSGVAL again
RXEN
Bit MOSTATn.RXEN enables a message object for frame reception. A message object
can receive CAN messages from the CAN bus only if RXEN = 1. The MultiCAN module
evaluates RXEN only during receive acceptance filtering. After receive acceptance
filtering, RXEN is ignored and has no further influence on the actual storage of a received
message in a message object.
Bit RXEN enables the soft phase out of a message object: after clearing RXEN, a
currently received CAN message for which the message object has won acceptance
filtering is still stored in the message object but for subsequent messages the message
object no longer wins receive acceptance filtering.
no Object wins
acc. Filtering ?
Time
yes Milestones
RTSEL := 1
1
no CAN rec.
successful ?
yes
no MSGVAL & no
MSGVAL = 1?
RTSEL = 1?
yes yes
RXUPD := 1 RXUPD := 1
2
yes
NEWDAT = 1? MSGLST := 1
no
NEWDAT := 1
RXUPD := 0
RXPND := 1
4
yes
RXIE = 1? Interrupt Generated
no
Done
MCA06275
RTSEL
When a message object has been identified to be transmitted next after transmission
acceptance filtering, bit MOCTRn.RTSEL (Receive/Transmit Selected) is set.
When the message object is copied into the internal transmit buffer, bit RTSEL is
checked, and the message is transmitted only if RTSEL = 1. After the successful
transmission of the message, bit RTSEL is checked again and the message
postprocessing is only executed if RTSEL = 1.
For a complete re-configuration of a valid message object, the following steps should be
executed:
1. Clear MSGVAL bit
2. Re-configure the message object while MSGVAL = 0
3. Clear RTSEL and set MSGVAL
Clearing of RTSEL ensures that the message object is disconnected from an
ongoing/scheduled transmission and no message object processing (copying message
to transmit buffer including clearing NEWDAT, clearing TXRQ, time stamp update,
message interrupt, etc.) within the old context of the object can occur after the message
object becomes valid again, but within a new context.
NEWDAT
When the contents of a message object have been transferred to the internal transmit
buffer of the CAN node, bit MOSTATn.NEWDAT (New Data) is cleared by hardware to
indicate that the transmit message object data is no longer new.
When the transmission of the frame is successful and NEWDAT is still cleared (if no new
data has been copied into the message object meanwhile), TXRQ (Transmit Request) is
cleared automatically by hardware.
If, however, the NEWDAT bit has been set again by the software (because a new frame
should be transmitted), TXRQ is not cleared to enable the transmission of the new data.
Copy Message to
internal transmit buffer
yes
no
RTSEL = 1?
yes
Request transmission
of internal buffer on
CAN bus
NEWDAT := 0 2
Transmission no
successful ?
yes
MSGVAL & no
RTSEL = 1?
yes
no
NEWDAT = 1? TXRQ := 0
yes
no
TXIE = 1?
yes 3
Issue interrupt
Done
MCA06276
Message Reception
When a received message stored in a message object is overwritten by a new received
message, the contents of the first message are lost and replaced with the contents of the
new received message (indicated by MSGLST = 1).
If SDT is set (Single Data Transfer Mode activated), bit MSGVAL of the message object
is automatically cleared by hardware after the storage of a received Data Frame. This
prevents the reception of further messages.
After the reception of a Remote Frame, bit MSGVAL is not automatically cleared.
Message Transmission
When a message object receives a series of multiple remote requests, it transmits
several Data Frames in response to the remote requests. If the data within the message
object has not been updated in the time between the transmissions, the same data can
be sent more than once on the CAN bus.
In Single Data Transfer Mode (SDT = 1), this is avoided because MSGVAL is
automatically cleared after the successful transmission of a Data Frame.
After the transmission of a Remote Frame, bit MSGVAL is not automatically cleared.
generated whenever the CUR pointer reaches the value of the SEL pointer. Thus SEL
makes it possible to detect the end of a predefined message transfer series or to issue
a warning interrupt when the FIFO becomes full.
PPREV = f[n-1]
PNEXT
Slave Object fn
..
..
PPREV
PPREV = f[i-1]
PNEXT
PNEXT = f[i+1]
TOP = fn Slave Object fi
CUR = fi
..
BOT = f1 ..
PNEXT = f3
Slave Object f2
PPREV
PNEXT = f2
Slave Object f1
MCA06277
Figure 18-19 FIFO Structure with FIFO Base Object and n FIFO Slave Objects
The gateway operates equivalent for the reception of data frames (source object is
receive object, i.e. DIR = 0) as well as for the reception of Remote Frames (source object
is transmit object).
Pointer to Destination
Message Object
CUR
Copy if IDCSource = 1
Identifier + IDE Identifier + IDE
Copy if DLCCSource = 1
DLC DLC
Copy if DATCSource = 1
Data Data
Set if GDFSSource = 1
TXRQ
Set
NEWDAT
Source
Message Object Set
MMC = 0100B TXRQ
Destination
Message Object
MCA06278
CAN 4
Node
0
1
SR0
CAN
4 1
Node SR1
1
..
..
..
..
..
CAN 4 ..
Interrupt ..
Node
2 Wiring ..
Matrix ..
..
..
..
..
Message ..
2 ..
Object
0 1
.. SR6
..
..
Message 1
2
Object SR7
63
Register 16
MITR
Mca 06284_3n_nott_64_v2.vsd
Module Kernel
Register
File
mca 06265_c
The baud rate generation of the MultiCAN being based on fPB, this frequency has to be
chosen carefully to allow correct CAN bit timing. The required value of fPB is given by an
integer multiple (n) of the CAN baud rate multiplied by the number of time quanta per
CAN bit time. For example, to reach 1 Mbit/s with 20 tq per bit time, possible values of
fPB are given by formula [n 20] MHz, with n being an integer value, starting at 1.
In order to minimize jitter, it is not recommended to use the fractional divider mode for
high baud rates.
fCLC
mca 06283_b
1
f CAN = f PB --- with n = 1024 - CAN_FDR.STEP (18.1)
n
n
f CAN = f PB ------------- with n = 0-1023 (18.2)
1024
Equation (18.1) applies to normal divider mode (CAN_FDR.DM = 01B) of the fractional
divider. Equation (18.2) applies to fractional divider mode (CAN_FDR.DM = 10B).
Note: The CAN module is disabled after reset. In general, after reset, the module control
clock fCLC must be switched on (writing to register CAN_CLC) before the
frequency of the module timer clock fCAN is defined (writing to register CAN_FDR).
MCA 06279_x.vsd
ID
The ID (Module Identification Register) defines the MultiCAN module identification
number, module type and module revision number.
ID
Module Identification Register (008H) Reset Value: 002B C0XXH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MOD_NUMBER
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MOD_TYPE MODE_REV
r rwh
PANCTR
The Panel Control Register PANCTR is used to start a new command by writing the
command arguments and the command code into its bit fields.
PANCTR
Panel Control Register (1C4H) Reset Value: 0000 0301H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PANAR2 PANAR1
rwh rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RBU BUS
0 PANCMD
SY Y
r rh rh rwh
Panel Commands
A panel operation consists of a command code (PANCMD) and up to two panel
arguments (PANAR1, PANAR2). Commands that have a return value deliver it to the
PANAR1 bit field. Commands that return an error flag deliver it to bit 31 of the Panel
Control Register, this means bit 7 of PANAR2.
MCR
The Module Control Register MCR contains basic settings that determine the operation
of the MultiCAN module.
MCR
Module Control Register (1C8H) Reset Value: 0000 0000H
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
MPSEL 0
rw r
MITR
The Interrupt Trigger Register ITR is used to trigger interrupt requests on each interrupt
output line by software.
MITR
Module Interrupt Trigger Register (1CCH) Reset Value: 0000 0000H
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
IT
LIST
Each CAN node has a list that determines the allocated message objects. Additionally,
a list of all unallocated objects is available. Furthermore, general purpose lists are
available which are not associated to a CAN node. The List Registers are assigned in
the following way:
LIST0 provides the list of all unallocated objects
LIST1 provides the list for CAN node 0
LIST2 provides the list for CAN node 1
LIST3 provides the list for CAN node 2
LIST[7:4] are not associated to a CAN node (free lists)
LIST0
List Register 0 (100H) Reset Value: 003F 3F00H
LISTx (x = 1-7)
List Register x (100H+x*4H) Reset Value: 0100 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EMP
0 SIZE
TY
r rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
END BEGIN
rh rh
MSPNDk
When a message object n generates an interrupt request upon the transmission or
reception of a message, then the request is routed to the interrupt output line selected
by the bit field MOIPRn.TXINP or MOIPRn.RXINP of the message object n. As there are
more message objects than interrupt output lines, an interrupt routine typically processes
requests from more than one message object. Therefore, a priority selection mechanism
is implemented in the MultiCAN module to select the highest priority object within a
collection of message objects.
The Message Pending Register MSPNDk contains the pending interrupt notification of
list i.
MSPNDk (k = 0-7)
Message Pending Register k (140H+k*4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PND
rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PND
rwh
MSIDk
Each Message Pending Register has a Message Index Register MSIDk associated with
it. The Message Index Register shows the active (set) pending bit with lowest bit position
within groups of pending bits.
MSIDk (k = 0-7)
Message Index Register k (180H+k*4H) Reset Value: 0000 0020H
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
0 INDEX
r rh
MSIMASK
The Message Index Mask Register MSIMASK selects individual bits for the calculation
of the Message Pending Index. The Message Index Mask Register is used commonly
for all Message Pending registers and their associated Message Index registers.
MSIMASK
Message Index Mask Register (1C0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
IM
rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
IM
rw
NCR
The Node Control Register contains basic settings that determine the operation of the
CAN node.
NCRx (x = 0-2)
Node x Control Register (200H+x*100H) Reset Value: 0000 0001H
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
SUS CAL CAN LECI
0 CCE 0 ALIE TRIE INIT
EN M DIS E
r rw rw rw r rw rw rw rw rwh
NSR
The Node Status Register NSRx reports errors as well as successfully transferred CAN
frames.
NSRx (x = 0-2)
Node x Status Register (204H+x*100H) Reset Value: 0000 0000H
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
SUS BOF EWR ALE RXO TXO
0 LOE LLE LEC
ACK F N RT K K
r rh rwh rwh rh rh rwh rwh rwh rwh
NIPR
The four interrupt pointers in the Node Interrupt Pointer Register NIPRx select one out
of the sixteen interrupt outputs individually for each type of CAN node interrupt. See also
Page 18-21 for more CAN node interrupt details.
NIPRx (x = 0-2)
Node x Interrupt Pointer Register
(208H+x*100H) Reset Value: 0000 0000H
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
r rw r rw r rw r rw
NPCR
The Node Port Control Register NPCRx configures the CAN bus transmit/receive ports.
NPCRx can be written only if bit NCRx.CCE is set.
NPCRx (x = 0-2)
Node x Port Control Register (20CH+x*100H) Reset Value: 0000 0000H
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
0 LBM 0 RXSEL
r rw r rw
NBTR
The Node Bit Timing Register NBTRx contains all parameters to set up the bit timing for
the CAN transfer. NBTRx can be written only if bit NCRx.CCE is set.
NBTRx (x = 0-2)
Node x Bit Timing Register (210H+x*100H) Reset Value: 0000 0000H
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
rw rw rw rw rw
NECNT
The Node Error Counter Register NECNTx contains the CAN receive and transmit error
counter as well as some additional bits to ease error analysis. NECNTx can be written
only if bit NCRx.CCE is set.
NECNTx (x = 0-2)
Node x Error Counter Register (214H+x*100H) Reset Value: 0060 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
LEIN LET
0 EWRNLVL
C D
r rh rh rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TEC REC
rwh rwh
NFCR
The Node Frame Counter Register NFCRx contains the actual value of the frame
counter as well as control and status bits of the frame counter.
NFCRx (x = 0-2)
Node x Frame Counter Register (218H+x*100H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CFC CFCI
0 0 CFMOD CFSEL
OV E
r rwh rw r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CFC
rwh
MOCTR
The Message Object Control Register MOCTRn and the Message Object Status
Register MOSTATn are located at the same address offset within a message object
address block (offset address 1CH). The MOCTRn is a write-only register that makes it
possible to set/reset CAN transfer related control bits through software.
MOCTR0
Message Object 0 Control Register (101CH) Reset Value: 0100 0000H
MOCTRn (n = 1-62)
Message Object n Control Register
(101CH+n*20H)
Reset Value: ((n+1)*01000000H)+((n-1)*00010000H)
MOCTR63
Message Object 63 Control Register (17FCH) Reset Value: 3F3E 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SET SET SET SET SET SET SET SET SET SET SET
SET
0 TXE TXE TXR RXE RTS MSG MSG NEW RXU TXP RXP
DIR
N1 N0 Q N EL VAL LST DAT PD ND ND
w w w w w w w w w w w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RES RES RES RES RES RES RES RES RES RES RES
RES
0 TXE TXE TXR RXE RTS MSG MSG NEW RXU TXP RXP
DIR
N1 N0 Q N EL VAL LST DAT PD ND ND
w w w w w w w w w w w w w
MOSTAT
The MOSTATn is a read-only register that indicates message object list status
information such as the number of the current message object predecessor and
successor message object, as well as the list number to which the message object is
assigned.
MOSTAT0
Message Object 0 Status Register (101CH) Reset Value: 0100 0000H
MOSTATn (n = 1-62)
Message Object n Status Register
(101CH+n*20H)
Rest Value: ((n+1)*01000000H)+((n-1)*00010000H)
MOSTAT63
Message Object 63 Status Register (17FCH) Reset Value: 3F3E 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PNEXT PPREV
rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TX TX TX RX RTS MSG MSG NEW RX TX RX
LIST DIR
EN1 EN0 RQ EN EL VAL LST DAT UPD PND PND
rh rh rh rh rh rh rh rh rh rh rh rh rh
MOIPR
The Message Object Interrupt Pointer Register MOIPRn holds the message interrupt
pointers, the message pending number, and the frame counter value of message
object n.
MOIPRn (n = 0-63)
Message Object n Interrupt Pointer Register
(1008H+n*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CFCVAL
rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw r rw r rw
MOFCR
The Message Object Function Control Register MOFCRn contains bits that select and
configure the function of the message object. It also holds the CAN data length code.
MOFCRn (n = 0-63)
Message Object n Function Control Register
(1000H+n*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FRR
0 DLC STT SDT RMM 0 OVIE TXIE RXIE
EN
rw rwh rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DAT DLC GDF
0 IDC 0 MMC
C C S
rw rw rw rw rw rw rw
MOFGPR
The Message Object FIFO/Gateway Pointer register MOFGPRn contains a set of
message object link pointers that are used for FIFO and gateway operations.
MOFGPRn (n = 0-63)
Message Object n FIFO/Gateway Pointer Register
(1004H+n*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SEL CUR
rw rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TOP BOT
rw rw
MOAMR
Message Object n Acceptance Mask Register MOAMRn contains the mask bits for the
acceptance filtering of the message object n.
MOAMRn (n = 0-63)
Message Object n Acceptance Mask Register
(100CH+n*20H) Reset Value: 3FFF FFFFH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MID
0 AM
E
rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AM
rw
MOAR
Message Object n Arbitration Register MOARn contains the CAN identifier of the
message object.
MOARn (n = 0-63)
Message Object n Arbitration Register
(1018H+n*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PRI IDE ID
rw rwh rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ID
rwh
Table 18-12 Transmit Priority of Msg. Objects Based on CAN Arbitration Rules
Settings of Arbitrarily Chosen Message Comment
Objects A and B,
(A has higher transmit priority than B)
A.MOAR[28:18] < B.MOAR[28:18] Messages with lower standard identifier
(11-bit standard identifier of A less than have higher priority than messages with
11-bit standard identifier of B) higher standard identifier. MOAR[28] is the
most significant bit (MSB) of the standard
identifier. MOAR[18] is the least significant
bit of the standard identifier.
A.MOAR[28:18] = B.MOAR[28:18] Standard Frames have higher transmit
A.MOAR.IDE = 0 (send Standard Frame) priority than Extended Frames with equal
B.MOAR.IDE = 1 (send Extended Frame) standard identifier.
A.MOAR[28:18] = B.MOAR[28:18] Standard Data Frames have higher
A.MOAR.IDE = B.MOAR.IDE = 0 transmit priority than standard Remote
A.MOCTR.DIR = 1 (send Data Frame) Frames with equal identifier.
B.MOCTR.DIR = 0 (send Remote Fame)
A.MOAR[28:0] = B.MOAR[28:0] Extended Data Frames have higher
A.MOAR.IDE = B.MOAR.IDE = 1 transmit priority than Extended Remote
A.MOCTR.DIR = 1 (send Data Frame) Frames with equal identifier.
B.MOCTR.DIR = 0 (send Remote Frame)
A.MOAR[28:0] < B.MOAR[28:0] Extended Frames with lower identifier have
A.MOAR.IDE = B.MOAR.IDE = 1 higher transmit priority than Extended
(29-bit identifier) Frames with higher identifier. MOAR[28] is
the most significant bit (MSB) of the overall
identifier (standard identifier MOAR[28:18]
and identifier extension MOAR[17:0]).
MOAR[0] is the least significant bit (LSB) of
the overall identifier.
MODATAL
Message Object n Data Register Low MODATALn contains the lowest four data bytes of
message object n. Unused data bytes are set to zero upon reception and ignored for
transmission.
MODATALn (n = 0-63)
Message Object n Data Register Low
(1010H+n*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DB3 DB2
rwh rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DB1 DB0
rwh rwh
MODATAH
Message Object n Data Register High MODATAH contains the highest four data bytes
of message object n. Unused data bytes are set to zero upon reception and ignored for
transmission.
MODATAHn (n = 0-63)
Message Object n Data Register High
(1014H+n*20H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DB7 DB6
rwh rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DB5 DB4
rwh rwh
CAN_CLC
The clock control registers makes it possible to control (enable/disable) the module
control clock fCLC.
CAN_CLC
CAN Clock Control Register (000H) Reset Value: 0000 0003H
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
SB E DIS DIS
0 0 0
WE DIS S R
r r w rw r r rw
Note: In disabled state, no registers of CAN module can be read or written except the
CAN_CLC register.
CAN_FDR
The fractional divider register allows the programmer to control the clock rate of the
module timer clock fCAN.
CAN_FDR
CAN Fractional Divider Register (00CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DIS EN SUS SUS
0 RESULT
CLK HW REQ ACK
rwh rw rh rh r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DM SC SM 0 STEP
rw rw rw r rw
MO = Message Object;
n = 0 to (Number of Message Objects -1)
3FFFH
MOBASE = 1000H + n * 20H
MO n Control Register MO BASE + 1CH
MO BASE + 20H MO n Arbitration Reg. MO BASE + 18H
MO BASE Message Object n-1 MO n Data Register High MO BASE + 14H
MO n Data Register Low MO BASE + 10H
. .
. . MO n Accept. Mask Reg. MO BASE + 0CH
. .
. Message Object . MO n Interrupt Ptr . Reg. MO BASE + 08H
. Registers .
. . MO n FIFO/Gtw. Ptr. Reg. MO BASE + 04H
1040H . .
. . MO n Function Control Reg. MO BASE + 00H
1020H Message Object 1
1000H Message Object 0 NO = CAN Node,
x = 0 to (Number of CAN Nodes -1)
NOBASE = 200 H + x * 100H
i = 0-7, k = 0-7
100H
General
Module Fractional Divider Register + 0CH
Control Module Identification Reg. + 08H
000H Clock Control Register + 00H
mca 06285_n_ver2
18.8 Interconnects
This section describes CAN module interfaces with the clock control, port connections,
and address decoding.
Note:
1) AN refers to AN/DIG_IN pad type.
mca 06281_3n_noTTCAN_64_MO _x.vsd
RXDCxA
RXDCxB
CAN .
Node x .
.
RXDCxH
CANxINS
NPCRx.RXSEL
rx_selection.vsd
Table 18-14 shows how bits and bit fields must be programmed for the required I/O
functionality of the CAN I/O lines.
19.1 Overview
Each converter of the ADC cluster can operate independent of the others, controlled by
a dedicated set of registers and triggered by a dedicated group request source. The
results of each channel can be stored in a dedicated channel-specific result register or
in a group-specific result register.
A background request source can access all analog input channels that are not assigned
to any group request source. These conversions are executed with low priority. The
background request source can, therefore, be regarded as an additional background
converter.
The Versatile Analog to Digital Converter module (VADC) of the XMC4500 comprises a
set of converter blocks that can be operated either independently or via a common
request source that emulates a background converter. Each converter block is equipped
with a dedicated input multiplexer and dedicated request sources, which together build
separate groups.
This basic structure supports application-oriented programming and operating while still
providing general access to all resources. The almost identical converter groups allow a
flexible assignment of functions to channels.
The basic module clock fADC is connected to the system clock signal fPB.
Feature List
The following features describe the functionality of the ADC cluster:
Nominal analog supply voltage 3.3 V
Input voltage range from 0 V up to analog supply voltage
Standard (VAREF) and alternate (CH0) reference voltage source selectable for each
channel to support ratiometric measurements and different signal scales
Up to 4 independent converters with up to 8 analog input channels
External analog multiplexer control, including adjusted sample time and scan support
Conversion speed and sample time adjustable to adapt to sensors and reference
Conversion time below 1 s (depending on result width and sample time)
Flexible source selection and arbitration
Programmable arbitrary conversion sequence (single or repeated)
Configurable auto scan conversion (single or repeated) on each converter
Configurable auto scan conversion (single or repeated) in the background (all
converters)
Conversions triggered by software, timer events, or external events
Cancel-inject-restart mode for reduced conversion delay on priority channels
Powerful result handling
Selectable result width of 8/10/12 bits
Fast Compare Mode
Independent result registers
Configurable limit checking against programmable border values
Data rate reduction through adding a selectable number of conversion results
FIR/IIR filter with selectable coefficients
Flexible service request generation based on selectable events
Built-in safety features
Broken wire detection with programmable default levels
Multiplexer test mode to verify signal path integrity
Support of suspend and power saving modes
Note: Additional functions are available from the out of range comparator (see
description in the SCU).
Conv.Group/Kernel Conv.Group/Kernel
Result Result
Validation Validation
Converter Converter
... Clock Control
Service Req.
Generation
... ...
...
AD converter
channels CHx handling
Conversion Request
Ext. multiplexer
control control
control MUX[2:0]
MC_ ADC_KERNEL
Background
Source (2)
(channel scan )
ADC Kernel
Request Control
Timer
Unit(s)
Request Request
Analog
Source 1 Source
Converter
(channel scan ) Arbiter
External
Request(s)
Request
Source 0
(8-stage queue )
MC_VADC_CONV_REQUEST_UNIT
Conversion Control
Conversion parameters, such as sample phase duration, reference voltage, or result
resolution can be configured for 4 input classes (2 group-specific classes, 2 global
classes). Each channel can be individually assigned to one of these input classes.
The input channels can, thus, be adjusted to the type of sensor (or other analog sources)
connected to the ADC.
1) The availablity of input channels depends on the package of the used product type. A summary can be found
in Section 19.14.2.
This unit also controls the built-in multiplexer and external analog multiplexers, if
selected.
Analog/Digital Converter
The selected input channel is converted to a digital value by first sampling the voltage
on the selected input and then generating the selected number of result bits.
For 12-bit conversions, post-calibration is executed after converting the channel.
For broken wire detection (see Section 19.10.1), the converter network can be
preloaded before sampling the selected input channel.
Result Handling
The conversion results of each analog input channel can be directed to one of 16 group-
specific result registers and one global result register to be stored there. A result register
can be used by a group of channels or by a single channel.
The wait-for-read mode avoids data loss due to result overwrite by blocking a conversion
until the previous result has been read.
Data reduction (e.g. for digital anti-aliasing filtering) can automatically add up to 4
conversion results before issuing a service request.
Alternatively, an FIR or IIR filter can be enabled that preprocesses the conversion results
before sending them to the result register.
Also, result registers can be concatenated to build FIFO structures that store a number
of conversion results without overwriting previous data. This increases the allowed CPU
latency for retrieving conversion data from the ADC.
Safety Features
Safety-aware applications are supported with mechanisms that help to ensure the
integrity of a signal path.
Broken-wire-detection (BWD) preloads the converter network with a selectable level
before sampling the input channel. The result will then reflect the preload value if the
input signal is no more connected. If buffer capacitors are used, a certain number of
conversions may be required to reach the failure indication level.
Pull Down Diagnostics (PDD) connects an additional strong pull-down device to an
input channel. A subsequent conversion can then confirm the expected modified signal
level. This allows to check the proper connection of a signal source (sensor) to the
multiplexer.
Multiplexer Diagnostics (MD) connects a weak pull-up or pull-down device to an input
channel. A subsequent conversion can then confirm the expected modified signal level.
This allows to check the proper operation of the multiplexer.
Converter Diagnostics (CD) connects an alternate signal to the converter. A
subsequent conversion can then confirm the proper operation of the converter.
Clock Generation
Unit
DIVD DIVA
Digital Analog
Clock Clock
fADCD fADCI
State Mach.,
Service Arbiter Converter
Requests
MC_ VADC_CLOCKS
Calibration
Calibration automatically compensates deviations caused by process, temperature, and
voltage variations. This ensures precise results throughout the operation time.
An initial start-up calibration is required once after a reset for all calibrated converters
and is triggered globally. All calibrated converters must be enabled (ANONS = 11B)
before initiating the start-up calibration. Conversions may be started after the initial
calibration sequence. This is indicated by bit CAL = 0B.
After that, postcalibration cycles will compensate the effects of drifting parameters.
1) The availablity of input channels depends on the package of the used product type. A summary can be found
in Section 19.14.2.
The background source can only request non-priority channels, i.e. channels that are not selected in registers
GxCHASS. Priority channels are reserved for the group-specific request sources 0 and 1.
refill
trigger inputs queue input
REQTRx
REQTRx[H:A]
E queue stage 0
gating inputs V
REQGTx[H:A] REQGTx
wait for
trigger request request
request source
request handling status source
event
arbiter
abort restart
backup stage
sequential
request source x ADC_seq_reqsrc
A sequence is defined by entering conversion requests into the queue input register
(GxQINR0 (x = 0 - 3)). Each entry selects the channel to be converted and can enable
an external trigger, generation of an interrupt, and an automatic refill (i.e. copy this entry
to the top of the queue after conversion). The entries are stored in the queue buffer
stages.
The content of stage 0 (GxQ0R0 (x = 0 - 3)) selects the channel to be converted next.
When the requested conversion is started, the contents of this queue stage is invalidated
and copied to the backup stage. Then the next queue entry can be handled (if available).
Note: The contents of the queue stages cannot be modified directly, but only by writing
to the queue input or by flushing the queue.
The current status of the queue is shown in register GxQSR0 (x = 0 - 3).
If all queue entries have automatic refill selected, the defined conversion
sequence can be repeated without re-programming.
1) If PDOUT signals from the ERU are used, initialize the ERU accordingly before enabling the gate inputs to
avoid un expected signal transitions.
Write a new entry to the queue input of an empty queue. This leads to a (new) valid
queue entry that is forwarded to queue stage 0 and starts a conversion request (if
enabled by GxQMR0.ENGT and without waiting for an external trigger).
Note: If the refill mechanism is activated, a processed entry is automatically reloaded
into the queue. This permanently repeats the respective sequence (autoscan).
In this case, do not write to the queue input while the queued source is running.
Write operations to a completely filled queue are ignored.
Stop or abort an ongoing queued sequence by executing the following actions:
If external gating is enabled, switch the gating signal to the defined inactive level. This
does not modify the queue entries, but only prevents issuing conversion requests to
the arbiter.
Disable the corresponding arbitration slot (0) in the arbiter. This does not modify the
queue entries, but only prevents the arbiter from accepting requests from the request
handling block.
Disable the queued source by clearing bitfield ENGT = 00B.
Invalidate the next pending queue entry by setting bit GxQMR0.CLRV = 1.
If the backup stage contains a valid entry, this one is invalidated, otherwise stage 0
is invalidated.
Remove all entries from the queue by setting bit GxQMR0.FLUSH = 1.
GxQBUR0. GxQBUR0.
ENSI V
MC_VADC_REQSRCQ_INT
Conversion
Ext. Trigger
Internal MUX
Request
Signals
Trigger Sequence
Gener- Control
ation Service
Request
Sequence
Internal MUX
Ext. Gate
Pending
Signals
Sequence
Select
MC_VADC_REQSRCS
1) If PDOUT signals from the ERU are used, initialize the ERU accordingly before enabling the gate inputs to
avoid un expected signal transitions.
Disable the corresponding arbitration slot (1 or 2) in the arbiter. This does not modify
the contents of the conversion pending bits, but only prevents the arbiter from
accepting requests from the request handling block.
Disable the channel scan source by clearing bitfield ENGT = 00B. Clear the pending
request bits by setting bit CLRPND = 1 (GxASMR (x = 0 - 3) or BRSMR).
arbitration round
arbitration
winner
arbitration arbitration arbitration arbitration found
slot 0 slot 1 slot 2 slot 3
t1 t3 t6 t8
request
channel B
request
channel A
conversions A B A B A
t2 t4 t5 t7 t9 t10 t11
The global input class registers define the sample time and data conversion mode for
each channel of any group that selects them via bitfield ICLSEL in its channel control
register GxCHCTRx.
Timing Examples
System assumptions:
fADC = 120 MHz i.e. tADC = 8.3 ns, DIVA = 3, fADCI = 30 MHz i.e. tADCI = 33.3 ns
According to the given formulas the following minimum conversion times can be
achieved:
12-bit calibrated conversion:
tCN12C = (2 + 12 + 2) tADCI + 2 tADC = 16 33.3 ns + 2 8.3 ns = 550 ns
10-bit uncalibrated conversion:
tCN10 = (2 + 10) tADCI + 2 tADC = 12 33.3 ns + 2 8.3 ns = 417 ns
Fast comparison:
tFCM = (2 + 2) tADCI + 2 tADC = 4 33.3 ns + 2 8.3 ns = 150 ns
PWM
timer trigger CH0
trigger CHx
ADC_alias
Standard Conversions
A standard conversion returns a result value with a predefined resolution. 8-bit, 10-bit,
and 12-bit resolution can be selected.
These result values can be accumulated, filtered, or used for digital limit checking.
Note: The calibrated converters can operate with and without post-calibration.
2 n -1
Result Range
Upper Boundary
Lower Boundary
MC_VADC_LIMITBAND
A result value is considered inside the defined band when both of the following
conditions are true:
the value is less than or equal to the selected upper boundary
the value is greater than or equal to the selected lower boundary
The result range can also be divided into two areas:
To select the lower part as valid band, set the lower boundary to the minimum value
(000H) and set the upper boundary to the highest intended value.
To select the upper part as valid band, set the upper boundary to the maximum value
(FFFH) and set the lower boundary to the lowest intended value.
2 n -1
Result Range
Upper Delta
Reference Value
Lower Delta
MC_VADC_LIMITHYST
Upper boundary
Lower boundary
Flag BFx
MC_VADC_BFLAG
Result
Converter Data
Reduction Result
Unit Registers
Set
Valid Flags
MC_ VADC_RESULTHANDLING
12-Bit 0 0 0 0 11 10 9 8 7 6 5 4 3 2 1 0
Conversions
Standard
10-Bit Left-Aligned 0 0 0 0 9 8 7 6 5 4 3 2 1 0 0 0
10-Bit Right-Aligned 0 0 0 0 0 0 9 8 7 6 5 4 3 2 1 0
8-Bit Left-Aligned 0 0 0 0 7 6 5 4 3 2 1 0 0 0 0 0
8-Bit Right-Aligned 0 0 0 0 0 0 0 0 7 6 5 4 3 2 1 0
12-Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Accumulated
Conversions
10-Bit Left-Aligned 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0
10-Bit Right-Aligned 0 0 13 12 11 10 9 8 7 6 5 4 3 2 1 0
8-Bit Left-Aligned 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0
8-Bit Right-Aligned 0 0 0 0 11 10 9 8 7 6 5 4 3 2 1 0
MC_ VADC_RESPOS
1) Repeated conversions of a single channel that use a separate result register will not destroy other results, but
rather update their own previous result value. This way, always the actual signal data is available in the result
register.
Conv. Results
CH2, 7, 10 Result Reg. 7
Result Reg. 6 F Read access
Conv. Results
CH8
Result Reg. 5 Read access
MC_VADC_RESFIFO
Note: If enabled, a result interrupt is generated for each data word in the FIFO.
Conversion
r0 r1 r2 r3 r4 r5 r6 r7 r8 Results
0 3 2 1 0 3 2 1 0 DRC
r0 + r4 +
r0 + r4 +
r0 + r1 + r4 + r5 + Contents of
0 r0 r1 + r4 r5 +
r1 r2 + r5 r6 + Result Reg.
r2 r6
r3 r7
VF
t1 t2 t3 t4 t5 t6 t7 t8 t9
MC_VADC_DRC
The final result must be read before the next data reduction sequence starts (before
t5 or t9 in the example). This automatically clears the valid flag.
Note: Software can clear the data reduction counter DRC by clearing the corresponding
valid Flag (via GxVFR (x = 0 - 3)).
The response time to read the final data reduction results can be increased by
associating the adjacent result register to build a result FIFO (see Figure 19-18). In this
case, the final result of a data reduction sequence is loaded to the adjacent register. The
value can be read from this register until the next data reduction sequence is finished (t8
in the 2nd example).
VFz
r0+r1 r4+r5
Contents of
0 + + Result Reg. x
r2+r3 r6+r7
VFx
t1 t2 t3 t4 t5 t6 t7 t8 t9
MC_VADC_DRC_FIFO
a b c
Result Register
+ +
x
FIR filter x
Conversion
r0 r1 r2 r3 r4 r5 r6 r7 r8 Results
0 r0 r1 r2 r3 r4 r5 r6 r7 Result Buffer 1
0 0 r0 r1 r2 r3 r4 r5 r6 Result Buffer 2
VF
t1 t2 t3 t4 t5 t6 t7 t8 t9
MC_VADC_FIR
:b
IIR filter x
Conversion
r0 r1 r2 r3 r4 r5 r6 r7 r8 Results
VF
t1 t2 t3 t4 t5 t6 t7 t8 t9
MC_VADC_IIR
Difference Mode
Subtracting the contents of result register 0 from the actual result puts the results of the
respective channel in relation to another signal. No software action is required.
The reference channel must store its result(s) into result register 0. The reference value
can be determined once and then be used for a series of conversions, or it can be
converted before each related conversion.
Difference
Result Register
0
MC_ VADC_DIFF
1) For a summary, please refer to Synchronization Groups in the XMC4500 on Page 19-128.
The arbiter must run permanently (bit GxARBPR (x = 0 - 3).ARBM = 0) for the
synchronization slave.
Initialize the slave before the master to have the arbiters run synchronously.
Once started, a parallel conversion cannot be aborted.
parallel conversions
requested by ADC0
conversions
CH0 CH2 CH3 CH7 CH8 CH3
kernel ADC0
parallel conversions
triggering ADC1
conversions
CH2 CH5 CH3 CH4 CH3 CH1
kernel ADC1
ADC3_ANON
ADC2_ANON
ADC1_ANON
ADC0_ANON
CI1
CI2
CI3
CI1
CI2
CI3
CI1
CI2
CI3
CI1
CI2
CI3
GLOBCTR. GLOBCTR. GLOBCTR. GLOBCTR.
ANON ANON ANON ANON
01
10
11
00
01
10
11
00
01
10
11
00
01
10
11
STSEL STSEL STSEL STSEL
R2
R3
R1
R2
R3
R1
R2
R3
R1
R2
R3
ADC0 kernel ADC1 kernel ADC2 kernel ADC3 kernel
ADC0_READY
ADC1_READY
ADC2_READY
ADC3_READY
ADC_ANON_sync
REQTRx
equidistant
ed ed ed
conversions
lower priority
c c c c
conversions
equidistant sampling equidistant sampling
period period
ADC_timer_mode
MC_VADC_BWD
Multiplexer Diagnostics
To test the proper operation of the internal analog input multiplexer, additional test
signals can be connected to channels CH1 and CH2. In combination with a known
external input signal this test function shows if the multiplexer connects any pin to the
converter input and if this is the correct pin.
Pull-Down Diagnostics
One single input channel provides a further strong pull-down (RPDD) that can be activated
to verify the external connection to a sensor.
Converter Diagnostics
To test the proper operation of the converter itself, several signals can be connected to
the converter input. The test signals can be connected to the converter input either
instead of the standard input signal or in parallel to the standard input signal.
The test signal can be selected from four different signals as shown in Figure 19-26.
VDDP
VAREF
ADC Kernel
CHx
RPDD
VAGND
VSS
REXT CEXT
Internal MUX
. ..
Direct
CH3
ADC
REXT1 CEXT1
CH4
REXT CEXT channel
External analog
8-to-1 multiplexer control
CH30
Extended input
CH31
CH37
control
REXT2 CEXT2
MC_ADC_EXTMUX
Bitfield EMUXACT determines the control information sent to the external multiplexer.
In single-step mode, EMUXACT is updated after each conversion of an enabled channel.
If EMUXACT = 000B it is reloaded from bitfield EMUXSET, otherwise it is decremented
by 1.
Additional external channels may have different properties due to the modified signal
path. Local filters may be used at the additional inputs (REXT2-CEXT2 on CH3x in
Figure 19-27). For applications where the external multiplexer is located far from the
ADC analog input, it is recommended to add an RC filter directly at the analog input of
the ADC (REXT1-CEXT1 on CH3 in Figure 19-27).
Note: Each RC filter limits the bandwidth of the analog input signal.
Conversions for external channels, therefore, use the alternate conversion mode setting
CME. This automatically selects a different conversion mode if required.
Switching the external multiplexer usually requires an additional settling time for the input
signal. Therefore, the alternate sample time setting STCE is applied each time the
external channel is changed. This automatically fulfills the different sampling time
requirements in this case.
In each group an arbitrary channel can be assigned to external multiplexer control
(register GxEMUXCTR (x = 0 - 3)). Each available port interface selects the group whose
control lines are output (register EMUXSEL).
Control Signals
The external channel number that controls the external multiplexer can be output in
standard binary format or Gray-coded. Gray code avoids intermediate multiplexer
switching when selecting a sequence of channels, because only one bit changes at a
time. Table 19-5 indicates the resulting codes.
19.13 Registers
The Versatile ADC is built from a series of converter blocks that are controlled in an
identical way. This makes programming versatile and scalable. The corresponding
registers, therefore, have an individual offset assigned (see Table 19-7). The exact
register location is obtained by adding the respective register offset to the base address
(see Table 19-6) of the corresponding group.
Due to the regular group structure, several registers appear within each group. Other
registers are provided for each channel. This is indicated in the register overview table
by placeholders:
X###H means: x 0400H + 0###H, for x = 0 - 3
###YH means: ###0H + y 0004H, for y = 0 - N (depends on register type)
ID
Module Identification Register (0008H) Reset Value: 00C5 C0XXH
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
r r r
CLC
Clock Control Register (0000H) Reset Value: 0000 0003H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
E DIS DIS
0 0 0 0 0 0 0 0 0 0 0 0 0
DIS S R
r r r r r r r r r r r r rw r r rw
The OCDS control and status register OCS controls the modules behavior in suspend
mode (used for debugging) and includes the module-related control bits for the OCDS
Trigger Bus (OTGB).
The OCDS Control and Status (OCS) register is cleared by Debug Reset.
The OCS register can only be written when the OCDS is enabled.
If OCDS is being disabled, the OCS register value will not change.
When OCDS is disabled the OCS suspend control is ineffective.
Write access is 32 bit wide only and requires Supervisor Mode.
OCS
OCDS Control and Status Register (0028H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SUS SUS
0 0 SUS 0 0 0 0 0 0 0 0
STA _P
r r rh w rw r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TG
0 0 0 0 0 0 0 0 0 0 0 0 TGB TGS
_P
r r r r r r r r r r r r w rw rw
GLOBCFG
Global Configuration Register (0080H) Reset Value: 0000 000FH
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DP DP DP DP
SU
0 0 0 0 0 0 0 0 0 0 0 CAL CAL CAL CAL
CAL
3 2 1 0
w r r r r r r r r r r r rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DIV DC
0 0 0 0 0 DIVD 0 0 DIVA
WC MSB
w r r r r r rw rw r r rw
GxCHASS (x = 0 - 3)
Channel Assignment Register, Group x
(x * 0400H + 0488H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ASS ASS ASS ASS ASS ASS ASS ASS
0 0 0 0 0 0 0 0 CH CH CH CH CH CH CH CH
7 6 5 4 3 2 1 0
r r r r r r r r rw rw rw rw rw rw rw rw
GxARBCFG (x = 0 - 3)
Arbitration Configuration Register, Group x
(x * 0400H + 0480H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SAM BU
0 CAL 0 0 0 0 0 0 0 0 0 0 ANONS
PLE SY
rh rh r rh r r r r r r r r r r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ARB
0 0 0 0 0 0 0 0 0 ARBRND 0 0 ANONC
M
r r r r r r r r rw r rw r r rw
The Arbitration Priority Register defines the request source priority and the conversion
start mode for each request source.
Note: Only change priority and conversion start mode settings of a request source while
this request source is disabled, and a currently running conversion requested by
this source is finished.
GxARBPR (x = 0 - 3)
Arbitration Priority Register, Group x
(x * 0400H + 0484H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AS AS AS
0 0 0 0 0 0 0 0 0 0 0 0 0
EN2 EN1 EN0
r r r r r rw rw rw r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CSM PRIO CSM PRIO CSM PRIO
0 0 0 0 0 0 0
2 2 1 1 0 0
r r r r rw r rw rw r rw rw r rw
The control register of the queue source selects the external gate and/or trigger signals.
Write control bits allow separate control of each function with a simple write access.
GxQCTRL0 (x = 0 - 3)
Queue 0 Source Control Register, Group x
(x * 0400H + 0500H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TM TM GT GT GT
0 0 0 0 0 0 0 0
WC EN WC LVL SEL
w r r rw r r r r w r r rh rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XT XT XT XT
0 0 0 0 0 0 0 0
WC MODE LVL SEL
w rw rh rw r r r r r r r r
The Queue Mode Register configures the operating mode of a queued request source.
GxQMR0 (x = 0 - 3)
Queue 0 Mode Register, Group x
(x * 0400H + 0504H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RPT
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
DIS
r r r r r r r r r r r r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FLU TR CLR EN
0 0 0 0 CEV 0 0 0 0 0 ENGT
SH EV V TR
r r r r w w w w r r r r r rw rw
The Queue Status Register indicates the current status of the queued source. The filling
level and the empty information refer to the queue intermediate stages (if available) and
to the queue register 0. An aborted conversion stored in the backup stage is not
indicated by these bits (therefore, see QBURx.V).
GxQSR0 (x = 0 - 3)
Queue 0 Status Register, Group x
(x * 0400H + 0508H) Reset Value: 0000 0020H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
REQ EMP
0 0 0 0 0 0 0 EV 0 0 FILL
GT TY
r r r r r r r rh rh r rh r rh
The Queue Input Register is the entry point for conversion requests of a queued request
source.
GxQINR0 (x = 0 - 3)
Queue 0 Input Register, Group x
(x * 0400H + 0510H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EX EN
0 0 0 0 0 0 0 0 RF REQCHNR
TR SI
r r r r r r r r w w w w
The queue registers 0 monitor the status of the pending request (queue stage 0).
GxQ0R0 (x = 0 - 3)
Queue 0 Register 0, Group x (x * 0400H + 050CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EX EN
0 0 0 0 0 0 0 V RF REQCHNR
TR SI
r r r r r r r rh rh rh rh rh
The Queue Backup Registers monitor the status of an aborted queued request.
GxQBUR0 (x = 0 - 3)
Queue 0 Backup Register, Group x
(x * 0400H + 0510H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EXT EN
0 0 0 0 0 0 0 V RF REQCHNR
R SI
r r r r r r r rh rh rh rh rh
GxASCTRL (x = 0 - 3)
Autoscan Source Control Register, Group x
(x * 0400H + 0520H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
TM TM GT GT GT
0 0 0 0 0 0 0 0
WC EN WC LVL SEL
w r r rw r r r r w r r rh rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XT XT XT XT
0 0 0 0 0 0 0 0
WC MODE LVL SEL
w rw rh rw r r r r r r r r
The Conversion Request Mode Register configures the operating mode of the channel
scan request source.
GxASMR (x = 0 - 3)
Autoscan Source Mode Register, Group x
(x * 0400H + 0524H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RPT
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
DIS
r r r r r r r r r r r r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LD CLR REQ SCA EN EN
0 0 0 0 0 0 0 LDM ENGT
EV PND GT N SI TR
r r r r r r w w rh r rw rw rw rw rw
The Channel Select Register selects the channels to be converted by the group scan
request source. Its bits are used to update the pending register, when a load event
occurs.
The number of valid channel bits depends on the channels available in the respective
product type (please refer to Product-Specific Configuration on Page 19-127).
GxASSEL (x = 0 - 3)
Autoscan Source Channel Select Register, Group x
(x * 0400H + 0528H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CH CH CH CH CH CH CH CH
0 0 0 0 0 0 0 0 SEL SEL SEL SEL SEL SEL SEL SEL
7 6 5 4 3 2 1 0
r r r r r r r r rw rw rw rw rw rw rw rw
The Channel Pending Register indicates the channels to be converted in the current
conversion sequence. They are updated from the select register, when a load event
occurs.
GxASPND (x = 0 - 3)
Autoscan Source Pending Register, Group x
(x * 0400H + 052CH) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CH CH CH CH CH CH CH CH
0 0 0 0 0 0 0 0 PND PND PND PND PND PND PND PND
7 6 5 4 3 2 1 0
r r r r r r r r rw rw rw rw rw rw rw rw
BRSCTRL
Background Request Source Control Register
(0200H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
GT GT GT
0 0 0 0 0 0 0 0 0 0
WC LVL SEL
r r r r r r r r w r r rh rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XT XT XT XT
0 0 0 0 0 0 0 0
WC MODE LVL SEL
w rw rh rw r r r r r r r r
The Conversion Request Mode Register configures the operating mode of the
background request source.
BRSMR
Background Request Source Mode Register
(0204H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
RPT
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
DIS
r r r r r r r r r r r r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LD CLR REQ SCA EN EN
0 0 0 0 0 0 0 LDM ENGT
EV PND GT N SI TR
r r r r r r w w rh r rw rw rw rw rw
The Channel Select Registers select the channels to be converted by the background
request source (channel scan source). Its bits are used to update the pending registers,
when a load event occurs.
The number of valid channel bits depends on the channels available in the respective
product type (please refer to Product-Specific Configuration on Page 19-127).
Note: Priority channels selected in registers GxCHASS (x = 0 - 3) will not be converted.
BRSSELx (x = 0 - 3)
Background Request Source Channel Select Register, Group x
(0180H + x * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CH CH CH CH CH CH CH CH
0 0 0 0 0 0 0 0 SEL SEL SEL SEL SEL SEL SEL SEL
G7 G6 G5 G4 G3 G2 G1 G0
r r r r r r r r rw rw rw rw rw rw rw rw
The Channel Pending Registers indicate the channels to be converted in the current
conversion sequence. They are updated from the select registers, when a load event
occurs.
BRSPNDx (x = 0 - 3)
Background Request Source Pending Register, Group x
(01C0H + x * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CH CH CH CH CH CH CH CH
0 0 0 0 0 0 0 0 PND PND PND PND PND PND PND PND
G7 G6 G5 G4 G3 G2 G1 G0
r r r r r r r r rw rw rw rw rw rw rw rw
Note: Writing to any of registers BRSPNDx generates a load event that copies all bits
from registers BRSSELx to BRSPNDx.
Use this shortcut only when writing the last word of the request pattern.
G0CHCTRy (y = 0 - 7)
Group 0, Channel y Ctrl. Reg. (0600H + y * 0004H) Reset Value: 0000 0000H
G1CHCTRy (y = 0 - 7)
Group 1, Channel y Ctrl. Reg. (0A00H + y * 0004H) Reset Value: 0000 0000H
G2CHCTRy (y = 0 - 7)
Group 2, Channel y Ctrl. Reg. (0E00H + y * 0004H) Reset Value: 0000 0000H
G3CHCTRy (y = 0 - 7)
Group 3, Channel y Ctrl. Reg. (1200H + y * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BWD BWD RES RES
0 0 0 0 0 0 0 RESREG
EN CH POS TBS
r rw rw r r r r r r rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
REF SY CHEV
0 0 0 0 BNDSELU BNDSELL 0 0 ICLSEL
SEL NC MODE
r r r r rw rw rw rw rw r r rw
GxICLASS0 (x = 0 - 3)
Input Class Register 0, Group x
(x * 0400H + 04A0H) Reset Value: 0000 0000H
GxICLASS1 (x = 0 - 3)
Input Class Register 1, Group x
(x * 0400H + 04A4H) Reset Value: 0000 0000H
GLOBICLASSy (y = 0 - 1)
Input Class Register y, Global
(00A0H + y * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 CME 0 0 0 STCE
r r r r r rw r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 CMS 0 0 0 STCS
r r r r r rw r r r rw
G0RCRy (y = 0 - 15)
Group 0 Result Control Reg. y (0680H + y * 0004H) Reset Value: 0000 0000H
G1RCRy (y = 0 - 15)
Group 1 Result Control Reg. y (0A80H + y * 0004H) Reset Value: 0000 0000H
G2RCRy (y = 0 - 15)
Group 2 Result Control Reg. y (0E80H + y * 0004H) Reset Value: 0000 0000H
G3RCRy (y = 0 - 15)
Group 3 Result Control Reg. y (1280H + y * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SRG
0 0 0 0 FEN WFR 0 0 DMM DRCTR
EN
rw r r r r rw rw r r rw rw
15 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 0
r r r r r r r r r r r r r r r r
The group result registers provide a selectable storage location for all channels of a
given group.
Note: The preset value used in fast compare mode is written to the respective result
register. The debug result registers are not writable.
G0RESy (y = 0 - 15)
Group 0 Result Register y (0700H + y * 0004H) Reset Value: 0000 0000H
G1RESy (y = 0 - 15)
Group 1 Result Register y (0B00H + y * 0004H) Reset Value: 0000 0000H
G2RESy (y = 0 - 15)
Group 2 Result Register y (0F00H + y * 0004H) Reset Value: 0000 0000H
G3RESy (y = 0 - 15)
Group 3 Result Register y (1300H + y * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rh rh rh rh rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESULT
rwh
The debug view of the group result registers provides access to all result registers of a
given group, however, without clearing the valid flag.
G0RESDy (y = 0 - 15)
Group 0 Result Reg. y, Debug (0780H + y * 0004H) Reset Value: 0000 0000H
G1RESDy (y = 0 - 15)
Group 1 Result Reg. y, Debug (0B80H + y * 0004H) Reset Value: 0000 0000H
G2RESDy (y = 0 - 15)
Group 2 Result Reg. y, Debug (0F80H + y * 0004H) Reset Value: 0000 0000H
G3RESDy (y = 0 - 15)
Group 3 Result Reg. y, Debug (1380H + y * 0004H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rh rh rh rh rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESULT
rh
The global result control register selects the behavior of the global result register.
GLOBRCR
Global Result Control Register (0280H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SRG
0 0 0 0 0 0 WFR 0 0 0 0 DRCTR
EN
rw r r r r r r rw r r r r rw
15 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 0
r r r r r r r r r r r r r r r r
The global result register provides a common storage location for all channels of all
groups.
GLOBRES
Global Result Register (0300H) Reset Value: 0000 0000H
GLOBRESD
Global Result Register, Debug (0380H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rwh rh rh rh rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESULT
rwh
The valid flag register summarizes the valid flags of all result registers.
GxVFR (x = 0 - 3)
Valid Flag Register, Group x (x * 0400H + 05F8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VF15 VF14 VF13 VF12 VF11 VF10 VF9 VF8 VF7 VF6 VF5 VF4 VF3 VF2 VF1 VF0
rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh
GxALIAS (x = 0 - 3)
Alias Register, Group x (x * 0400H + 04B0H) Reset Value: 0000 0100H
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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ALIAS1 0 0 0 ALIAS0
r r r r r r r r r r r r r r r r r r r rw r r r rw
The local boundary register GxBOUND defines group-specific boundary values or delta
limits for Fast Compare Mode.
The global boundary register GLOBBOUND defines general compare values for all
channels.
Depending on the conversion width, the respective left 12/10/8 bits of a bitfield are used.
For 10/8-bit results, the lower 2/4 bits must be zero!
GxBOUND (x = 0 - 3)
Boundary Select Register, Group x
(x * 0400H + 04B8H) Reset Value: 0000 0000H
GLOBBOUND
Global Boundary Select Register (00B8H) Reset Value: 0000 0000H
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
0 0 0 0 BOUNDARY1 0 0 0 0 BOUNDARY0
r r r r rw r r r r rw
The Boundary Flag Register holds the boundary flags themselves together with bits to
select the activation condition and the output signal polarity for each flag.
GxBFL (x = 0 - 3)
Boundary Flag Register, Group x
(x * 0400H + 04C8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BFE BFE BFE BFE
0 0 0 0 0 0 0 0 0 0 0 0
3 2 1 0
r r r r r r r r r r r r rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BFL BFL BFL BFL
0 0 0 0 0 0 0 0 0 0 0 0
3 2 1 0
r r r r r r r r r r r r rh rh rh rh
The Synchronization Control Register controls the synchronization of kernels for parallel
conversions.
Note: Program register GxSYNCTR only while bitfield GxARBCFG.ANONS = 00B in all
ADC kernels of the conversion group. Set the masters bitfield ANONC to 11B
afterwards.
GxSYNCTR (x = 0 - 3)
Synchronization Control Register, Group x
(x * 0400H + 04C0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EVA EVA EVA
0 0 0 0 0 0 0 0 0 0 0 STSEL
LR3 LR2 LR1
r r r r r r r r r rw rw rw r r rw
GLOBTF
Global Test Functions Register (0160H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MD
0 0 0 0 0 0 0 0 0 0 0 0 0 0 PDD
WC
r r r r r r r r w r r r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CD CD CD
0 0 0 0 CDGR 0 0 0 0
WC SEL EN
w r r r r rw rw rw r r r r
GxEMUXCTR (x = 0 - 3)
External Multiplexer Control Register, Group x
(x * 0400H + 05F0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EMX EMX EMX EMX EMUX EMUX
0 0 0 0 0
WC CSS ST COD MODE CH
w rw rw rw rw r r r r r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EMUX EMUX
0 0 0 0 0 0 0 0 0 0
ACT SET
r r r r r rh r r r r r rw
Register EMUXSEL is a global register which assigns an arbitrary group to each of the
EMUX interfaces.
EMUXSEL
External Multiplexer Select Register
(03F0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EMUX EMUX
0 0 0 0 0 0 0 0
GRP1 GRP0
r r r r r r r r rw rw
GxSEFLAG (x = 0 - 3)
Source Event Flag Register, Group x
(x * 0400H + 0588H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SEV SEV
0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0
r r r r r r r r r r r r r r rwh rwh
Note: Software can set all flags in register GxSEFLAG and trigger the corresponding
event by writing 1 to the respective bit. Writing 0 has no effect.
Software can clear all flags in register GxSEFLAG by writing 1 to the respective
bit in register GxSEFCLR.
GxCEFLAG (x = 0 - 3)
Channel Event Flag Register, Group x
(x * 0400H + 0580H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CEV CEV CEV CEV CEV CEV CEV CEV
0 0 0 0 0 0 0 0
7 6 5 4 3 2 1 0
r r r r r r r r rwh rwh rwh rwh rwh rwh rwh rwh
Note: Software can set all flags in register GxCEFLAG and trigger the corresponding
event by writing 1 to the respective bit. Writing 0 has no effect.
Software can clear all flags in register GxCEFLAG by writing 1 to the respective
bit in register GxCEFCLR.
GxREFLAG (x = 0 - 3)
Result Event Flag Register, Group x
(x * 0400H + 0584H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
REV REV REV REV REV REV REV REV REV REV REV REV REV REV REV REV
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh rwh
Note: Software can set all flags in register GxREFLAG and trigger the corresponding
event by writing 1 to the respective bit. Writing 0 has no effect.
Software can clear all flags in register GxREFLAG by writing 1 to the respective
bit in register GxREFCLR.
GxSEFCLR (x = 0 - 3)
Source Event Flag Clear Register, Group x
(x * 0400H + 0598H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SEV SEV
0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0
r r r r r r r r r r r r r r w w
GxCEFCLR (x = 0 - 3)
Channel Event Flag Clear Register, Group x
(x * 0400H + 0590H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CEV CEV CEV CEV CEV CEV CEV CEV
0 0 0 0 0 0 0 0
7 6 5 4 3 2 1 0
r r r r r r r r w w w w w w w w
GxREFCLR (x = 0 - 3)
Result Event Flag Clear Register, Group x
(x * 0400H + 0594H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
REV REV REV REV REV REV REV REV REV REV REV REV REV REV REV REV
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
w w w w w w w w w w w w w w w w
GLOBEFLAG
Global Event Flag Register (00E0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
REV SEV
0 0 0 0 0 0 0 GLB 0 0 0 0 0 0 0 GLB
CLR CLR
r r r r r r r w r r r r r r r w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
REV SEV
0 0 0 0 0 0 0 0 0 0 0 0 0 0
GLB GLB
r r r r r r r rwh r r r r r r r rwh
Note: Software can set flags REVGLB and SEVGLB and trigger the corresponding event
by writing 1 to the respective bit. Writing 0 has no effect.
Software can clear these flags by writing 1 to bit REVGLBCLR and SECGLBCLR,
respectively.
GxSEVNP (x = 0 - 3)
Source Event Node Pointer Register, Group x
(x * 0400H + 05C0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0 SEV1NP SEV0NP
r r r r r r r r rw rw
GxCEVNP0 (x = 0 - 3)
Channel Event Node Pointer Register 0, Group x
(x * 0400H + 05A0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw
GxREVNP0 (x = 0 - 3)
Result Event Node Pointer Register 0, Group x
(x * 0400H + 05B0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw
GxREVNP1 (x = 0 - 3)
Result Event Node Pointer Register 1, Group x
(x * 0400H + 05B4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
rw rw rw rw
GLOBEVNP
Global Event Node Pointer Register
(0140H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 REV0NP
r r r r r r r r r r r r rw
15 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 SEV0NP
r r r r r r r r r r r r rw
GxSRACT (x = 0 - 3)
Service Request Software Activation Trigger, Group x
(x * 0400H + 05C8H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AS AS AS AS AG AG AG AG
0 0 0 0 0 0 0 0
SR3 SR2 SR1 SR0 SR3 SR2 SR1 SR0
r r r r w w w w r r r r w w w w
19.14 Interconnects
This section describes the actual implementation of the ADC module into the XMC4500,
i.e. the incorporation into the microcontroller system.
VADC.EMUX02 O GPIO
VADC.EMUX10 O GPIO Control of external analog
VADC.EMUX11 O GPIO multiplexer interface 1
VADC.EMUX12 O GPIO
VADC.G0BFLOUT0 O VADC.G1REQGTK Boundary flag 0 output of group 0
VADC.BGREQGTK
CCU41.IN0L
CCU80.IN0I
CCU43.IN0H
VADC.G1BFLOUT0 O VADC.G0REQGTK Boundary flag 0 output of group 1
CCU43.IN1H
POSIF0.IN0C
POSIF1.IN0C
VADC.G2BFLOUT0 O VADC.G3REQGTK Boundary flag 0 output of group 2
CCU43.IN2H
VADC.G3BFLOUT0 O VADC.G2REQGTK Boundary flag 0 output of group 3
CCU43.IN3H
VADC.GxBFL0 O - Boundary flag 0 level of group x
VADC.GxBFSEL0 I 0 Boundary flag 0 (group x) source
select
VADC.GxBFDAT0 I 0 Boundary flag 0 (group x) alternate
data
20.1 Overview
Each converter channel can operate independent of the others, controlled by a
dedicated set of registers. The results of each channel can be stored in a dedicated
channel-specific result register.
The on-chip filter stages generate digital results from the selected modulator signal.
The DSD accepts data from different types of external modulators. Their data streams
can be fed to selectable input pins.
Features
The following features describe the functionality of a Delta-Sigma Converter:
Options to connect external standard Delta-Sigma modulators
Selectable data stream inputs
Selectable DS clock input or output
Main demodulator (concatenated hardware filter stages)
Dec.: 4...32
Service Req.
Digital Auxiliary Filter
Input and Comparator
Input Dig. Result
Select Dec.: 4...256
Adjust Service Req.
Main Filter Chain
Dig. Result
Dec.: 4...32
Service Req.
Digital Auxiliary Filter
Input and Comparator
Input Dig. Result
Select Dec.: 4...256
Adjust Service Req.
Main Filter Chain
Dig. Result
Digital
Output
PWM
Carrier Generator
MC_DSADC_CH4
Dec.: 4...256
Digital Digital
Input Input Result
Comb Data
Select/ Integrator
Filter Shift
Adjust
Bypass Bypass
MC_DSADC_OVERVM
Note: An external modulator can be used, in particular, in systems where high voltages
are to be sampled. This allows for galvanic decoupling.
Several input pins can be selected.
The modulator clock can be generated in different ways:
The modulator clock can be derived on-chip from the module clock and is output via
a modulator clock pin to be used by an external modulator.
The external modulator can generate the clock signal which is then input via one of
the modulator clock pins.
The used modulator clock also drives the on-chip carrier generator. This enables
synchronous operation of carrier generator and integrator.
A trigger signal can be input from a selectable pin. This trigger signal can be used for
different purposes:
Integration trigger:
The external signal defines the integration window, i.e. the timespan during which
result values are integrated.
Timestamp trigger:
The external signal requests the actualization of the timestamp register.
Input multiplexer trigger:
The external signal requests the switching of the analog input multiplexer to the next
lower input or to the defined start value, respectively.
Service request gate:
Service requests for the main filter chain can be restricted to the high or low times of
the selected trigger signal.
The figure below summarizes these three signal paths and indicates the source of the
corresponding control information.
Data Strobe
Data
Data
0
Clock
Clock
Control fDSD
Carrier Gen.
Integrator
.
Trigger
Timestamp
.
.
MUX ctrl.
S. Request
XOR
ITR TSTR IN
SRGM
MODE MODE MODE
DICFG MODCFG FCFGC
MC_DSD_INPUTPATHS
Clock
Outputs
50 %
prescaler
0 duty cycle
fMOD
N:1 2:1
Modulator Clock
fDSD
MCSEL
To
Demodulator
DIVM
MC_DSADC_ MODCLOCKM
fMOD
CSRC
fDSD
STROBE
MC_DSADC_DSTROBEU
Modulator
Data Input Data Samples
(DINx)
Input
Select/
Modulator Adjust Sample Clock
Clock Signal
(MCLKx)
Module Clock
CLK Divider
MC_DSADC_ INPUT_ADJUSTM
Decim.: N
Digital Digital
Input x(n) Output y(m)
Comb Result
N:1 Integrator
Filter Register
Input Output
Sample Sample
Rate fS Rate fS/N
Bypass Bypass
MC_DSADC_MAINFILTER
The decimation counter is also restarted (i.e. loaded with the start value) when the
selected integration trigger event occurs (see Section 20.5.2).
The decimation factor can be selected in a wide range from 4 to 256.
Table 20-3 Data Shifter Position1) Dep. on Filter Mode and Decimation
Decimation Comb1 Comb2 Comb3 CombF
4 - 32 15:0 15:0 15:0 15:0
33 - 40 15:0 15:0 16:1 * 15:0
41 - 50 15:0 15:0 17:2 * 15:0
51 - 64 15:0 15:0 18:3 * 15:0
65 - 80 15:0 15:0 19:4 * 15:0
81 - 101 15:0 15:0 20:5 * 15:0
102 - 128 15:0 15:0 21:6 * 15:0
129 - 181 15:0 15:0 22:7 * 16:1 *
182 - 203 15:0 16:1 * 23:8 * 17:2
204 - 256 15:0 16:1 24:9 * 17:2
1) * indicates a change. Input data width is 1 bit.
cleared. As selected by bit IWS the integration window is either restarted or the
integration is stopped (INTEN = 0).
Also, the decimation counter of the comb filter is restarted, i.e. loaded with its start value
(see Section 20.5.1).
Sample
Operation
idle discard integrate integrate integrate idle
int. control
Sample
Operation
ext. control
idle discard integrate integrate int idle
Trigger active
MC_DSADC_INTEGRATOR
2 n -1
Result Range
Upper Boundary
Lower Boundary
MC_VADC_LIMITBAND
Signal SAUL is active while the results are above the upper limit,
signal SBLL is active while the results are below the lower limit.
Upper Limit
Decim.: N
Digital > upper
Input x(n) Comb
N:1 Select
Filter
Input < lower
Sample
Rate f S
Lower Limit
Several events are assigned to each service request output. Service requests can be
generated by two types of events:
Result events: indicate a new valid result in a result register. Usually, this triggers a
read action by the CPU (or DMA). Result events are generated at the output rate of
the configured filter chain.
Alarm events: indicate that a conversion result value is within a programmable value
range. This offloads the CPU/DMA from background tasks, i.e. a service request is
only activated if the specified conversion result range is met or exceeded.
Each event is indicated by a dedicated flag that can be cleared by software. If a service
request is enabled for a certain event, the service request is generated for each event,
independent of the status of the corresponding event indication flag. This ensures
efficient DMA handling of DSD events (the event can generate a service request without
the need to clear the indication flag).
Note: The Service Request Registers provide a set of bits for each available channel.
The number of available channels depends on the chosen device type.
MC_DSADC_ CPG_EXAMPLE
The delay is realized with the sign delay counter SDCOUNT. SDCOUNT is cleared and
started upon a falling edge of the carrier generators sign signal (SGNCG), i.e. at the
begin of the positive halfwave of the carrier signal. After counting SDPOS results from
the filter chain, also the rectification signal (SGND) is cleared, indicating positive values
from now on. After counting SDNEG values, the rectification signal is set, indicating
negative values (see also Figure 20-12).
The compare values SDPOS and SDNEG are stored by the application software.
SDPOS is the delay value that accounts for the resolver signals round trip delay. This
delay is constantly measured by capturing the current counter value into bitfield SDCAP
when the first positive result (after negative results) is received in the respective channel.
Software can read these value and compute a delay value e.g. by averaging a series of
measured values to compensate noise. The delay for the negative halfwave (SGND = 0)
is determined by adding the duration of a carrier signal halfwave. This value is written to
bitfield SDNEG.
A new captured value is indicated by setting the flag SDVAL. This flag is cleared when
reading register CGSYNCx.
Capturing a new value can trigger a service request. The service request line of the
auxiliary channel is used for this purpose. This alternate request source is selected by
bitfield SRGA in register FCFGAx (x = 0 - 3).
SDNEG
SDPOS/NEG
COMP
SDPOS
SDCOUNT
SIGNCG
SDCAP
SIGND
MC_DSADC_SIGNDELAY
20.11 Registers
The DSD is built from a series of channels that are controlled in an identical way. This
makes programming versatile and scalable. The corresponding registers, therefore,
have an individual offset assigned (see Table 20-5). The exact register location is
obtained by adding the respective register offset to the base address (see Table 20-4)
of the corresponding channel.
Due to the regular structure, several registers appear within each channel. This is
indicated in the register overview table by placeholders:
0X##H means: x 0100H + 01##H, for x = 0 - 3
ID
Module Identification Register (0008H) Reset Value: 00A4 C0XXH
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
r r r
CLC
Clock Control Register (0000H) Reset Value: 0000 0003H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
E DIS DIS
0 0 0 0 0 0 0 0 0 0 0 0 0
DIS S R
r r r r r r r r r r r r rw r r rw
The OCDS control and status register OCS controls the modules behavior in suspend
mode (used for debugging).
The OCDS Control and Status (OCS) register is cleared by Debug Reset.
The OCS register can only be written when the OCDS is enabled.
If OCDS is being disabled, the OCS register value will not change.
When OCDS is disabled the OCS suspend control is ineffective.
Write access is 32 bit wide only and requires Supervisor Mode.
OCS
OCDS Control and Status Register (0028H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SUS SUS
0 0 SUS 0 0 0 0 0 0 0 0
STA _P
r r rh w rw r r r r r r r r
15 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 0
r r r r r r r r r r r r r r r r
GLOBCFG
Global Configuration Register (0080H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 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 MCSEL
r r r r r r r r r r r r r rw
GLOBRC
Global Run Control Register (0088H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
r r r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CH3 CH2 CH1 CH0
0 0 0 0 0 0 0 0 0 0 0 0
RUN RUN RUN RUN
r r r r r r r r r r r r rw rw rw rw
MODCFGx (x = 0 - 3)
Modulator Configuration Register x
(x * 0100H + 0100H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
D
0 0 0 0 0 0 0 0 0 0 0 DIVM
WC
r r r r r r r r w r r r rw
15 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 0
r r r r r r r r r r r r r r r r
The demodulator input configuration register selects input signal sources for each
channel:
Source of data stream
Trigger signal source and mode
Sample clock source
Data strobe generation mode
DICFGx (x = 0 - 3)
Demodulator Input Configuration Register x
(x * 0100H + 0108H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SC
0 0 0 0 0 0 0 STROBE CSRC
WC
w r r r r r r r rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TR TSTR ITR DS
TRSEL 0 0 0 DSRC
WC MODE MODE WC
w rw rw rw w r r r rw
FCFGCx (x = 0 - 3)
Filter Configuration Register x, Main Comb Filter
(x * 0100H + 0114H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CFMDCNT CFMSV
rh rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CF
SRGM 0 0 0 CFMC CFMDF
EN
rw r r r rw rw rw
FCFGAx (x = 0 - 3)
Filter Configuration Register x, Auxiliary Filter
(x * 0100H + 0118H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CFADCNT 0 0 0 0 0 0 0 0
rh r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
r rw rw rw rw rw
IWCTRx (x = 0 - 3)
Integration Window Control Register x
(x * 0100H + 0120H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
r r rw rw r rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
INT
REPVAL REPCNT 0 NVALCNT
EN
rw rh rh r rh
BOUNDSELx (x = 0 - 3)
Boundary Select Register x (x * 0100H + 0128H) Reset Value: 0000 0000H
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
BOUNDARYU BOUNDARYL
rw rw
RESMx (x = 0 - 3)
Result Register x Main Filter (x * 0100H + 0130H) Reset Value: 0000 0000H
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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RESULT
r r r r r r r r r r r r r r r r rh
OFFMx (x = 0 - 3)
Offset Register x Main Filter (x * 0100H + 0138H) Reset Value: 0000 0000H
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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 OFFSET
r r r r r r r r r r r r r r r r rh
RESAx (x = 0 - 3)
Result Register x Auxiliary Filter
(x * 0100H + 0140H) Reset Value: 0000 0000H
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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RESULT
r r r r r r r r r r r r r r r r rh
EVFLAG
Event Flag Register (00E0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AL AL AL AL
0 0 0 0 0 0 0 0 0 0 0 0
EV3 EV2 EV1 EV0
r r r r r r r r r r r r rwh rwh rwh rwh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RES RES RES RES
0 0 0 0 0 0 0 0 0 0 0 0
EV3 EV2 EV1 EV0
r r r r r r r r r r r r rwh rwh rwh rwh
EVFLAGCLR
Event Flag Clear Register (00E4H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AL AL AL AL
0 0 0 0 0 0 0 0 0 0 0 0
EC3 EC2 EC1 EC0
r r r r r r r r r r r r w w w w
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RES RES RES RES
0 0 0 0 0 0 0 0 0 0 0 0
EC3 EC2 EC1 EC0
r r r r r r r r r r r r w w w w
Note: Software can set flags RESEVx and ALEVx and trigger the corresponding event
by writing 1 to the respective bit. Writing 0 has no effect.
Software can clear these flags by writing 1 to bit RESECx and ALECx,
respectively.
CGCFG
Carrier Generator Configuration Register
(00A0H) Reset Value: 0710 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SGN STE STE
0 STEPCOUNT 0 0 0 BITCOUNT
CG PD PS
r rh rh rh rh r r r rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SIG B CG
RUN 0 0 0 0 0 0 0 DIVCG
POL REV MOD
rh r r r r r r r rw rw rw rw
RECTCFGx (x = 0 - 3)
Rectification Configuration Register x
(x * 0100H + 01A8H) Reset Value: 8000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SGN SGN
0 0 0 0 0 0 0 0 0 0 0 0 0 0
D CS
rh rh r r r r r r r r r r r r r r
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDC RF
0 0 0 0 0 0 0 0 0 SSRC 0 0 0
VAL EN
rh r r r r r r r r r rw r r r rw
CGSYNCx (x = 0 - 3)
Carrier Generator Synchronization Register x
(x * 0100H + 01A0H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SDNEG SDPOS
rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDCAP SDCOUNT
rh rh
TSTMPx (x = 0 - 3)
Time-Stamp Register x (x * 0100H + 0150H) Reset Value: 0000 0000H
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 0 NVALCNT CFMDCNT
r r rh rh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RESULT
rh
20.12 Interconnects
This section describes the actual implementation of the DSD module into the XMC4500,
i.e. the incorporation into the microcontroller system.
21.1 Overview
The module consists of two separate 12-bit digital to analog converters (DACs). It
converts two digital input signals into two analog voltage signal outputs at a maximum
conversion rate of 5 MHz. The available design structure is based on a current steering
architecture with internal reference generation and provides buffered voltage outputs. In
order to reduce power consumption during inactive periods, a power down mode is
available.
A built-in wave generator mode allows the CPU free generation of a selectable choice of
wave forms. Alternatively values can be feed via CPU or DMA directly to one or both
DAC channels. Additionally an offset can be added and the amplitude can be scaled.
Several time trigger sources are possible.
21.1.1 Features
Analog features
DAC resolution 12 bit;
Conversion rate up to 5 MHz with reduced accuracy;
Conversion rate up to 2 MHz at full accuracy;
Maximum settling time of 2 us for a full scale 12-bit input code transition;
Buffered voltage output;
Direct drive of 5 kOhm / 50 pF terminated load;
Segmented current steering architecture;
Low glitch energy;
Power down mode;
DAC output and ADC input share the same analog input pin. ADC measurement is
possible in parallel to DAC usage.
3.3 V analog supply;
Digital features
One Advanced Microcontroller Bus Architecture (AMBA) 32-bit AHB-Lite bus
interface for data transfer and control of both DACs;
Self triggered Direct Memory Access (DMA) handling capability with independent or
simultaneous data handling for the two DAC channels (see Chapter 21.2.4);
First In First Out (FIFO) data buffers to allow a longer service request latency and to
guarantee a continuous data transfer to the DACs (see Chapter 21.2.4);
Pattern generators available with freely programmable waveforms for both DACs
(see Chapter 21.2.5);
Independent noise generators available for both DACs (see Chapter 21.2.6);
Data scaling by shift operation (multiplication and division by 2, 4, 8,..., 128) of the
DACs input data;
Data offset value addition to the DACs input data;
8 selectable external trigger inputs;
Internal integer clock divider for DAC trigger generation;
Software trigger option;
1.2 V digital supply;
DIGDAC
DAC.SIGN_0 BANDG.
DAC_0_PAT_L
PATGEN 0 Config
DAC_0_PAT_H CONTROL
FSM 0
OUTPUT STAGE 0
DAC_0_CFG_0 Config
NOISEGEN 0
DAC_0_CFG_1
DAC0.SR0 DAC.OUT_0
AHB Slave TRIGGEN 0 RAMPGEN 0 DAC 0 P14.8
Registers
to ADC
DAC_0_DATA Clock
FIFO 0 Data[11..0]
AHB
DAC_01_DATA
FIFO 1 Data[11..0]
DAC.TRIGGER[7:0] DAC_1_DATA Clock
OUTPUT STAGE 1
DAC.OUT_1
TRIGGEN 1 RAMPGEN 1 DAC 1 P14.9
DAC0.SR1
DAC_1_CFG_1 to ADC
NOISEGEN 1 Config
DAC_1_CFG_0
CONTROL
DAC_1_PAT_H FSM 1
PATGEN 1
DAC_1_PAT_L
DAC.SIGN_1
CLOCK
RESET Frequency Counter
ENABLE (20 bit)
FREQUENCY
ext_trigger
EXT_TRIGGER_0 int_trigger
EXT_TRIGGER_1
EXT_TRIGGER_2 Sync. &
TRIGGER
Edge-Detect .
sw_trigger
EXT_TRIGGER_7
TRIGSEL
SW_TRIGGER
TRIGMOD
CLOCK FULL
FIRST IN FIRST OUT
RESET EMPTY
DATA BUFFER (FIFO)
ALMOST_FULL
WRITE
ALMOST_EMPTY
READ
INDEX
DATA0 FIFO FIFO FIFO FIFO
ERROR
REG 3 REG 2 REG 1 REG 0
DATA01 (12 bit) (12 bit) (12 bit) (12 bit) DATA_FIFO
DATMOD
BYPASS
CLOCK
OUTPUT STAGE
RESET
DATA[11..0]
DATA_FIFO[11..0] (shift operation )
PATTERN[11..0]
REG DAC_DATA
(12 bit)
NOISE[11..0]
RAMP[11..0]
MODE[2..0]
OFFS[7..0]
SCALE[2..0]
MULDIV Delay
SIGN &
TRIGGER Stretch DAC_CLOCK
This output stage is the last element in the DACs data path before the data is converted
to the analog. It consists of a multiplexer, an adder, a multiplier, an output register and
the generation of the DAC clock output.
The multiplexer selects between the five possible data sources and is programmed with
the mode parameter. The adder stage gives the possibility to add an 8-bit offset value
which is mainly needed for the PG mode in order to also process unsigned signal
patterns to the DACs. In that case a certain offset value can be added to the signed
output pattern values. The multiplier enables scaling by simple binary shifting of the data
values. Therefore it allows multiplication and division by a programmed 2n scale value.
The offset and scaling operations are possible in all functional operating modes. The
output register contains the final sample delivered together with the corresponding
trigger to the analog converter.
The clock output for operating the analog part of the DAC is generated using the DACs
trigger generator (TG). For that purpose the TGs trigger output is delayed by four system
clock periods and stretched to a high-length of eight system clock periods.
TRIGGER up/down
ENABLE
count 0 - 8 RUN
sign
sel sign
SYNC
PATTERN_0 pattern[6..0]
pattern[5..0] (signed)
PATTERN_1
(unsigned) PATTERN
PATTERN_2
PATTERN_8
in the PG is used to select one of the nine input patterns. This pattern counter is an up-
down counter with an additional sign output which is inverted every time the counter
reaches zero. Since the sign information is concatenated with the currently selected
pattern, it is possible to generate a complete pattern sequence for a full period of any 2*
periodic waveform. For a detailed description how to operate the pattern generator
please also refer to Chapter 21.2.5.
noise[11..0]
Reg unsigned
TRIGGER NOISE
(12 bit)
TRIGGER
DATMOD is set to one, data from the simultaneous data register DAC01DATA is
processed for both DACs.
Start-Stop Operation
Before the DAC is started in data mode, all configuration registers DACx_CFG_x
should be set according to the desired processing mode (see Chapter 21.6.3.2). Once
this has been done, the DAC can be started by setting the MODE parameter to data
mode. The control FSM will then start its operation until it reaches the run status
indicated by the read parameter RUN. The run state can be left either by an operation
error or by setting the MODE parameter to disable DAC again. An operation error can
be a FIFO overflow or a FIFO underflow (see Figure 21-3 and Figure 21-8).
with a write operation to DAC0DATA or DAC01DATA. This write operation itself then
triggers a write from the data registers to the FIFO buffer registers. If the FIFO stores
only one last element (FIFOIND = 0 and FIFOEMP = 0) and a trigger has occurred, a
service request is initiated and additionally FIFOEMP is set to 1. On the other hand, if
there is only one last free register in the FIFO (FIFOIND = 2) and a write operation has
been initiated, the FIFOFUL bit is set to 1. All the control signals for the FIFO handling
are generated by the DACs control FSM. This includes filling up the FIFO when data
mode is entered and emptying the FIFO when leaving data mode.
DATMOD
DATA0
DAC_01_DATA Register
TRIGGER DETECTED = 1 => INDEX = INDEX 1=> DMA_REQUEST = 1 => WRITE OPERATION= 1 => INDEX = INDEX + 1
DATA1
1 0 1 0 1 0
FIFO FIFO FIFO
RegN RegN-1 Reg0
to DAC
0 1 0 1 0 1
INDEX=N and
=> FIFO_FULL = 1 INDEX=0
=> FIFO_EMPTY = 1
pattern in unsigned mode, it is also possible to add an offset value programmed with
OFFS to the output stage before doing the scaling. All the control signals for the pattern
generators are generated by the DIGDACs control FSM.
Figure 21-9 Example 5-bit patterns and their corresponding waveform output
Figure 21-9 gives examples of lookup table entries for triangular, sine and rectangular
pattern. These values can be programmed to PAT0 to PAT8 in order to get the
corresponding waveforms at the DACs output like shown in the chart on the right hand
side. If the pattern generation is restarted / enabled again, it always starts with the first
value of the first quarter of the actual programmed pattern (positive value and up-
counting). The current sign information of the generated pattern is one of the DACs
system on chip outputs (see Chapter 21.7.2.3) and can be enabled using the parameter
SIGNEN.
12 bit DATA
STOP VALUE 2
STOP VALUE 1
START VALUE 2
21.5 Initialisation
A feasible initialisation sequence of the DAC reads as follows:
1st Step: De-assert the reset of DAC module by setting DACRS bit in PRCLR1 register
2nd Step: Write the DACxCFG0 register values. Here you select the operating mode of
the corresponding DAC channel by writing the MODE field, e.g. Patgen mode. By setting
or clearing the SIGN bit, the choice between signed and unsigned input data format is
made.
In the same step service request generation can be enabled with the SREN bit, as well
as sign output with SIGNEN bit. Also the frequency divider of the internal trigger
generator can be set up by writing the FREQ field.
3rd Step: Write the DACxCFG1 register values. Here you select the trigger source by
writing the TRIGMOD field, e.g. software trigger. The DAC channel output is enabled by
setting the ANAEN bit. You also need to choose now your values for SCALE, MULDIV,
OFFS, and DATMOD fields.
4th Step