Efm32pg28 RM
Efm32pg28 RM
Reference Manual
silabs.com | Building a more connected world. Copyright © 2024 by Silicon Laboratories Rev. 1.1
Table of Contents
1. About This Document . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
1.2 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
1.3 Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . .31
2. System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
2.2 Block Diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
2.3 Features overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
3. System Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
3.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
3.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . .36
3.3.1 Interrupt Operation . . . . . . . . . . . . . . . . . . . . . . . . . . .37
3.3.2 TrustZone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
3.3.3 Interrupt Request Lines (IRQ) . . . . . . . . . . . . . . . . . . . . . . .38
8. Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
8.2 HFXO - High Frequency Crystal Oscillator . . . . . . . . . . . . . . . . . . . . 181
8.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 .
8.2.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 .
8.2.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 182
1.1 Introduction
This document contains reference material for the EFM32PG28 devices. All modules and peripherals in the EFM32PG28 devices are
described in general terms. Not all modules are present in all devices and the feature set for each device might vary. Such differences,
including pinout, are covered in the device data sheets.
1.2 Conventions
Register Names
Register names are given with a module name prefix followed by the short register name:
The "n" denotes the module number for modules which can exist in more than one instance.
Some registers are grouped which leads to a group name following the module prefix:
Bit Fields
Registers contain one or more bit fields which can be 1 to 32 bits wide. Bit fields wider than 1 bit are given with start (x) and stop (y) bit
[y:x].
Bit fields containing more than one bit are unsigned integers unless otherwise is specified.
Unspecified bit field settings must not be used, as this may lead to unpredictable behaviour.
Address
The address for each register can be found by adding the base address of the module found in the Memory Map (see Figure 4.1 Sys-
tem Address Space with Core and Code Space Listing on page 41), and the offset address for the register (found in module Register
Map).
Access Type
The register access types used in the register descriptions are explained in Table 1.1 Register Access Types on page 30.
RW(nB), RWH(nB), etc. "(nB)" suffix indicates that a bitfield explicitly does not support pe-
ripheral bit set/clear/toggle operations (see 4. Memory and Bus
System)
RW(r), R(r), etc. "(r)" suffix indicates that reading the register causes an action and
may alter the register value.
Number format
Reserved
Registers and bit fields marked with reserved are reserved for future use. These should be written to their reset value unless otherwise
stated in the Register Description. Read values for reserved bits may be different in future or prior devices.
Reset Value
Registers denoted with X have unknown value out of reset and need to be initialized before use. Note that read-modify-write operations
on these registers before they are initialized results in undefined register values.
Pin Connections
Pin connections are given with a module prefix followed by a short pin name:
The location for the pin names given in the module documentation can be found in the device-specific datasheet.
Further documentation on the EFM32PG28 devices and the ARM Cortex®-M33 can be found at the Silicon Labs and ARM web pages:
www.silabs.com
www.arm.com
2. System Overview
2.1 Introduction
The EFM32 MCUs are the world’s most energy friendly microcontrollers. With a unique combination of the powerful 32-bit ARM Cortex-
M33, innovative low energy techniques, short wake-up time from energy saving modes, and a wide selection of peripherals, the
EFM32PG23 microcontroller is well suited for any battery operated application as well as other systems requiring high performance and
low-energy consumption.
The block diagram for the EFM32PG28 series is shown in (Figure 2.1 EFM32PG28 System-On-Chip Block Diagram on page 32).
• Timers/Counters
• 1 × 32-bit and 4 × 16-bit Timer/Counters (TIMER)
• 3 Compare/Capture/PWM channels
• Dead-Time Insertion
• 24-bit Low Energy Timer (LETIMER)
• 32-bit Real-Time Counter (SYSRTC)
• 32-bit Ultra Low Energy Backup Real Time Counter (BURTC) for periodic wake-up from any Energy Mode
• 16-bit Pulse Counter
• Asynchronous pulse counting/quadrature decoding
• 2 × Watchdog Timer (WDOG)
• Ultra low power precision analog peripherals
• Incremental Analog to Digital Converter (IADC) with 12-bit resolution at 1 Msps and 16-bit resolution at 76.9 ksps
• Single ended or differential operation
• Conversion tailgating for predictable latency
• 12-bit 500 ksps Digital to Analog Converter (VDAC)
• 2 single ended channels/1 differential channel
• 2 × Analog Comparator (ACMP)
• Programmable speed/current
• Analog Bus (ABUS) signal routing
• Accurate die temperature sensor
• External thermistor interface
• Low-energy sensor interface
• Autonomous sensor monitoring in deep sleep mode
• Wide range of supported sensors including LC sensors
• Low-energy keypad scanner
• Up to 6 x 8 key switches supported
• Autonomous keypad scanning in EM0 / EM1
• Wake on key press from EM2 / EM3
• • Integrated LCD Controller
• Up to 8 x 24 (192) or 4 x 28 (112) segments
• Voltage boost, contrast and autonomous animation
• Patented low-energy LCD driver
• Ultra efficient Power-on Reset (POR) and Brown-Out Detector (BOD)
• Debug Interface
• 4-pin Joint Test Action Group (JTAG) interface
• 2-pin serial-wire debug (SWD) interface
• Embedded Trace (ETM) interface with 4 data lines
• Security
• Secure Boot with Root of Trust and Secure Loader (RTSL)
• Prevents malware injection and rollback
• Ensures authentic firmware execution and OTA updates
• Dedicated Secure Core
• Delivers faster, more energy efficient hardware crypto with Differential Power Analysis (DPA) countermeasures for
AES128/256, SHA-1, SHA-2 (up to 256-bit), ECC (up to 256-bit), ECDSA, ECDH and J-Pake
• Provides isolation with the application core
• Provides hardware cryptographic acceleration
• True Random Number Generator (TRNG) compliant with NIST SP800-90 and AIS-31
• ARM® TrustZone®
• Secure Debug with lock/unlock
• Allows authenticated access for enhanced Failure Analysis (FA)
3. System Processor
Quick Facts
What?
0 1 2 3 4
The EFM32PG28 features the industry leading Cor-
tex®-M33 CPU from ARM.
Why?
Hardware divider
Single cycle Combined with the ultra low energy peripherals
32-bit multiplier available in EFM32PG28 devices, the Cortex®-M33
processor's Harvard architecture, 3 stage pipeline,
single cycle instructions, Thumb-2 instruction set
Memory Protection Unit DSP extensions support, and fast interrupt handling make it perfect
for 8-bit, 16-bit, and 32-bit applications.
3.1 Introduction
The ARM Cortex®-M33 32-bit RISC processor provides outstanding computational performance and exceptional system response to
interrupts while meeting low cost requirements and low power consumption.
3.2 Features
• Harvard architecture
• Separate data and program memory buses (No memory bottleneck as in a single bus system)
• 3-stage pipeline
• Thumb-2 instruction set
• Enhanced levels of performance, energy efficiency, and code density
• Single cycle multiply and hardware divide instructions
• 32-bit multiplication in a single cycle
• Signed and unsigned divide operations between 2 and 11 cycles
• 1.5 DMIPS/MHz
• TrustZone
• Independent Secure and Privileged states
• Accelerated context switching
• 16 Region MPU
• 24-bit System Tick Timer for Real Time OS
• Excellent 32-bit migration choice for 8/16 bit architecture based designs
• Simplified stack-based programmer's model is compatible with traditional ARM architecture and retains the programming simplici-
ty of legacy 8-bit and 16-bit architectures
• Aligned or unaligned data storage and access
• Contiguous storage of data requiring different byte lengths
• Data access in a single core access cycle
• Integrated power modes
• Sleep Now mode for immediate transfer to low power state
• Sleep on Exit mode for entry into low power state after the servicing of an interrupt
• Ability to extend power savings to other system components
• Optimized for low latency, nested interrupts
For a full functional description of the ARM Cortex®-M33 implementation in the EFM32PG28 family, the reader is referred to the ARM
Cortex®-M33 documentation.
IEN[n]
Register
Write SETENA[n]/CLRENA[n]
Active interrupt
set clear Interrupt
Interrupt IRQ
request
condition IF[n] set clear
SETPEND[n]/CLRPEND[n]
The interrupt request (IRQ) lines are connected to the Cortex®-M33. Each of these lines (shown in 3.3.3 Interrupt Request Lines (IRQ))
is connected to one or more interrupt flags in one or more modules. The interrupt flags are set by hardware on an interrupt condition. It
is also possible to set/clear the interrupt flags through the IF register interface. When setting or clearing an interrupt through the IF reg-
ister use of the IF_SET or IF_CLR bit operation registers is required; directly writing the main interrupt flag register will have no effect.
Each interrupt flag is then qualified with its own interrupt enable bit (IEN register), before being OR'ed with the other interrupt flags to
generate the IRQ. A high IRQ line will set the corresponding pending bit (can also be set/cleared with the SETPEND/CLRPEND bits in
ISPRn/ICPRn) in the Cortex®-M33 NVIC. The pending bit is then qualified with an enable bit (set/cleared with SETENA/CLRENA bits in
ISERn/ICERn) before generating an interrupt request to the core. Figure 3.1 Interrupt Operation on page 37 illustrates the interrupt sys-
tem. For more information on how the interrupts are handled inside the Cortex®-M33, the reader is referred to the ARM Cortex-M33
Processor Technical Reference Manual.
There can be latencies in the system such that clearing an interrupt flag could take longer than leaving an Interrupt Service Routine
(ISR). This can lead to the ISR being re-entered as the interrupt flag has yet to clear immediately after leaving the ISR. To avoid this,
when clearing an interrupt flag at the end of an ISR, the user should execute ARM's Data Synchronization Barrier (DSB) instruction.
Another approach is to clear the interrupt flag immediately after identifying the interrupt source and then service the interrupt as shown
in the pseudo-code below. The ISR typically is sufficiently long to more than cover the few cycles it may take to clear the interrupt sta-
tus, and also allows the status to be checked for further interrupts before exiting the ISR.
irqXServiceRoutine() {
do {
clearIrqXStatus();
serviceIrqX();
} while(irqXStatusIsActive());
}
3.3.2 TrustZone
The Cortex®-M33 implements ARM TrustZone which provides the ability to restrict access to peripherals and memory regions based on
the CPU security attribute. TrustZone works in combination which the MPU which controls privileged/unprivileged execution of code to
provide a full security solution. The Security Management Unit (SMU) is used to configure access restrictions in the various modes.
Refer to 9. SMU - Security Management Unit for more information.
For information about TrustZone features in the core or information on TrustZone specific instructions please see the ARM Cortex-M33
Processor Technical Reference Manual provided by ARM
This table shows all IRQ's for the system processor. M33 High Speed interrupts are indicated by an '*'.
See the individual peripheral chapters for more information on interrupt function.
IRQ # Name
0* SMU_SECURE
1* SMU_S_PRIVILEGED
2* SMU_NS_PRIVILEGED
3* EMU
4* TIMER0
5* TIMER1
6* TIMER2
7* TIMER3
8* TIMER4
9* USART0_RX
10* USART0_TX
11* EUSART0_RX
12* EUSART0_TX
13* EUSART1_RX
14* EUSART1_TX
15* EUSART2_RX
16* EUSART2_TX
17* ICACHE0
18* BURTC
19* LETIMER0
20* SYSCFG
21* MPAHBRAM
22* LDMA
23* LFXO
24* LFRCO
25* ULFRCO
26* GPIO_ODD
27* GPIO_EVEN
28* I2C0
29* I2C1
30* EMUDG
39* HOSTMAILBOX
41* ACMP0
42* ACMP1
IRQ # Name
43* WDOG0
44* WDOG1
45* HFXO0
46* HFRCO0
47* HFRCOEM23
48* CMU
50* IADC
51* MSC
52* DPLL0
53* EMUEFP
54* DCDC
55* VDAC0
56* PCNT0
57* SW0
58* SW1
59* SW2
60* SW3
61* KERNEL0
62* KERNEL1
63* M33CTI0
64* M33CTI1
65* FPUEXH
66* SETAMPERHOST
67* SEMBRX
68* SEMBTX
69* LESENSE
70* SYSRTC_APP
71* SYSRTC_SEQ
72* LCD
73* KEYSCAN
76* AHB2AHB0
77* AHB2AHB1
78* MVP
Quick Facts
What?
0 1 2 3 4
A low latency memory system including low energy
Flash and RAM with data retention which makes the
low energy modes attractive.
Why?
4.1 Introduction
The EFM32PG28 contains a set of AMBA buses which move data between peripherals, memory, and the CPU. All memories and regis-
ter interfaces are memory mapped into a unified address space.
The internal memory segments of the Cortex®-M33 are mapped into the system memory map as shown by Figure 4.1 System Address
Space with Core and Code Space Listing on page 41.
0xfffffffe
0xe0100000
0xe00fffff
M33 Peripherals
0xe0000000
0xe0100000
0xdfffffff M33 ROM Table
0xe00ff000
0xe0042000
ETM
0xe0041000
TPIU
0xe0040000
0xe000f000
System Control Space
0xe000e000
0xe0003000
FPB
0xe0002000
DWT
0xe0001000
ITM
0xe0000000
0x60000000
0x5fffffff
Peripherals
0x50000000
0x4fffffff
Peripherals (secure)
0x40000000
0x3fffffff 0x0fe08a00
FLASH_CHIPCONFIG
0x20010000
0x0fe08400
0x2000ffff
RAM0 FLASH_DEVINFO
0x20000000
0x0fe08000
0x1fffffff
0x0fe00400
Flash FLASH_USERDATA
0x0fe00000
0x08000000
0x08100000
0x07FFFFFF
FLASH
0x00000000
0x08000000
Figure 4.1. System Address Space with Core and Code Space Listing
Flash for the main program memory (CODE) is located at address 0x08000000 in the memory map of the EFM32PG28. Flash memory
also contains a USERDATA area intended for user-defined data storage, the DEVINFO space with device characteristics and identify-
ing information, and CHIPCONFIG with internal production test and calibration information.
SRAM for the main data memory (RAM) is located at address 0x20000000 in the memory map of the EFM32PG28. When running code
located in RAM, the Cortex®-M33 uses the System bus interface to fetch instructions. This results in reduced performance as the Cor-
tex®-M33 accesses stack, other data in SRAM and peripherals using the System bus interface.
The Sequencer RAM (SEQRAM) is located at address 0xA0000000 and is used by the Sequencer for both instructions and data. This
RAM is also available for general use if not required by the RF subsystem.
A multilayer AMBA AHB bus matrix connects the manager bus interfaces to the AHB subordinates. The bus matrix allows several AHB
subordinates to be accessed simultaneously. An AMBA APB interface is used for the peripherals, which are accessed through an AHB-
to-APB bridge connected to the AHB bus matrix.
The CPU has two AHB bus managers (Code and System) so that it may retrieve instructions and data in parallel. The Code manager is
used to access all memory below address 0x20000000 and the System manager access addresses 0x20000000 and above.
Code
Cortex-M AHB Multilayer Flash
System Bus Matrix
RAM (DMEM)
LDMA
SEMAILBOX
AHB/APB Peripheral a
Bridge
(High
Frequency) Peripheral n
AHB/APB Peripheral m
Bridge
(Low
Frequency) Peripheral z
4.2.1.1 Arbitration
The Bus Matrix uses a round-robin arbitration algorithm which enables high throughput and low latency, while starvation of simultane-
ous accesses to the same bus subordinate are eliminated. Round-robin does not assign a fixed priority to each bus manager. The arbit-
er does not insert any bus wait-states during peak interaction. However, one wait state is inserted for manager accesses occurring after
a prolonged inactive time. This wait state allows for increased power efficiency during manager idle time.
System accesses from the core can receive a bus fault in the following condition(s):
• The core attempts to access an address that is not assigned to any peripheral or other system device. These faults can be enabled
or disabled by setting the ADDRFAULTEN bit in the SYSCFG_CTRL register.
• The core attempts to access a peripheral register that is LOCKED.
• The core attempts to access a peripheral or system device that has its clock disabled. This fault can be enabled or disabled by set-
ting the ADDRFAULTEN bit in the SYSCFG_CTRL register.
• System RAM controller detects a 2bit ECC error. These faults can be enabled or disabled by setting the RAMECCERRFAULTEN bit
in the SYSCFG_CTRL register.
• Registers with synchronization requirements may generate bus faults if accessed incorrectly. See 4.2.4.4 Peripheral Access Per-
formance for more details on register access types. In particular the following actions can cause bus faults:
• Config register written while peripheral enabled.
• Sync register written while peripheral disabled.
• LfSync register written while a previous write is pending.
• Peripheral disabled while any LfSync write is pending.
• Peripheral registers written or module re-enabled while DISABLING is set.
• Peripheral registers other than write-only fields or SWRST read while RESETTING is set.
• Peripheral registers other than read-only fields (including SWRST) written while RESETTING is set.
In addition to any condition-specific bus fault control bits, the bus fault interrupt itself can be enabled or disabled in the same way as all
other internal core interrupts.
4.2.2 Flash
The Flash retains data in any state and typically stores the application code and special user data. The Flash memory is typically pro-
grammed through the debug interface, but can also be erased and written to from software.
• Up to 1024 kB of memory
• Page size of 8 KB (minimum erase unit)
• Lock registers for memory protection
• Data retention in any state
4.2.3 SRAM
The primary task of the SRAM memory is to store application data. Additionally, it is possible to execute instructions from SRAM, and
the DMA may be set up to transfer data between the SRAM, Flash and peripherals.
The device contains several blocks of SRAM in data memory (DRAM) space. For more detailed information see 5. MSC - Memory Sys-
tem Controller .
• Up to 256 kB of memory (RAM)
• RAM blocks may be powered down when not in use
• Data retention of the entire memory or selected banks in EM2 and EM3
4.2.4 Peripherals
The peripherals are mapped into the peripheral memory segment, each with a fixed size address range shown in the 4.2.4.1 Peripheral
Map
This table shows the address range for each peripheral. In addition it shows the lowest energy mode in which the peripheral is pow-
ered. Note that EM3 is defined as EM2 with all clocks disabled. Therefore all peripherals powered in EM2 are also powered in EM3 but
may not function if they require a running clock.
See the individual peripheral chapters for more information on low power operation.
Note:
1. Peripherals listed as being in EM2 (PD0A) always remain powered in EM2 and EM3. Other EM2 power domains (PD0B, PD0C,
etc.) are powered down in EM2 and EM3 if all peripherals on that domain are unused.
When writing to peripheral registers, all accesses are treated as 32-bit accesses. This means that writes to a register need to be large
enough to cover all bits of register, otherwise, any uncovered bits may become corrupted from the partial-word transfer. Thus, the saf-
est practice is to always do 32-bit writes to peripheral registers.
When reading, there is generally no issue with partial word accesses, however, note that any read action (e.g. FIFO popping) will be
triggered regardless of whether the actual FIFO bit-field was included in the transfer size.
The EFM32PG28 supports bit set, bit clear, and bit toggle access to most peripheral registers. The bit set and bit clear functionality
(also called Bit Access) enables modification of bit fields without the need to perform a read-modify-write. Also, the operation is con-
tained within a single bus access. Bit access registers and their addresses are shown in the register map for each peripheral. Peripher-
als with no _SET, _CLR, or _TGL registers in the register map to not support these functions.
Each register with Bit Set functionality will have a _SET register. Whenever a bit in the SET register is written to a 1 the corresponding
bit in its target register is set. The SET register is located at TARGET + 0x1000 where TARGET is the address of the target register and
has the same name as the target register with '_SET' appended.
Each register with Bit Clear functionality will have a CLR register. Whenever a bit in the CLR register is written to a 1 the corresponding
bit in its target register is cleared. The CLR register is located at TARGET + 0x2000 where TARGET is the address of the target register
and has the same name as the target register with '_CLR' appended.
Each register with Bit Toggle functionality will have a TGL register. Whenever a bit in the TGL register is written to a 1 the correspond-
ing bit in its target register is inverted. The TGL register is located at TARGET + 0x3000 where TARGET is the address of the target
register and has the same name as the target register with '_TGL' appended.
Note: It is possible to combine bit clear and bit set operations in order to arbitrarily modify multi-bit register fields without affecting other
fields in the same register. In this case, care should be taken to ensure that the field does not have intermediate values that can lead to
erroneous behavior. For example, if bit clear and bit set operations are used to change an analog tuning register field from 0x2 to 0x4
by clearing bit 1 and then setting bit 2, the field would take on a value of zero for short time. If the analog module is active at the time,
this could lead to undesired behavior.
The Cortex®-M33, DMA Controller, and peripherals run on clocks which can be pre-scaled separately. Clocks and pre-scaling are de-
scribed in more detail in 7. CMU - Clock Management Unit. This section describes the access performance for a peripheral register
based on its frequency relative to the CPUCLK frequency and its access type. For this discussion, PERCLK refers to a selected periph-
eral's clock frequency and CPUCLK refers to the core's clock frequency.
The type of each register in a peripheral is indicated in the 'Access' column of the peripherals register table. Register types are: ENA-
BLE, CONFIG, SYNC, LFSYNC, and INTFLAG. If not type is listed then the register is a Generic register.
Registers with no type listed are generic registers. They may be read or written to at any time. Access will not stall the CPU.
CONFIG Registers contain configuration that does not change during peripheral operation.
CONFIG registers may only be written when a peripheral is disabled. Writing to a CONFIG register when a peripheral is enabled will
result in a BUSFAULT. CONFIG register writes will not stall the CPU.
CONFIG registers may be read at any time. Reads will not stall the CPU.
SYNC registers are used to communicate with running high-speed peripherals where PERCLK is expected to be either higher or mar-
ginally slower (within an order of magnitude) than CPUCLK. For example a timer running at 78 MHz when the core is at 39 MHz or at
9.75 MHz when the core is 78 MHz. In this case CPU stalls of several PERCLK cycles do not significantly impact overall system per-
formance in most systems.
SYNC registers may only be written to when the peripheral is enabled. Writing to a SYNC register when a peripheral is disabled will
result in a BUSFAULT. A write will take several (2 - 3) PERCLK cycles to complete (take effect) during which time the entire module will
be in a pending state. If a SYNC register is written to while the peripheral is already in a pending state, the CPU is stalled until the
previous write finishes. If a SYNC register is written to while the peripheral is not in a pending state, the CPU is not stalled.
SYNC registers may be read at any time. If a SYNC register is read while the peripheral is disabled, the CPU is not stalled. If a SYNC
register is read while the peripheral is enabled, the CPU will be stalled for several (2 -3) PERCLK cycles while up to date values are
retrieved from the peripheral.
LFSYNC registers are used to communicate with running low frequency peripherals where PERCLK is expected to be much lower than
the CPU clock and synchronization delays may be long. For example, a LETIMER running at 32 kHz when the core is at 78 MHz. In this
case CPU stalls of several PERCLK cycles represent a significant blockage of the CPU and need to be avoided whenever possible.
LFSYNC registers accommodate this by allowing the CPU to write the register and continue to do other work while the value is
synchronized.
LFSYNC registers may be written at any time. A write will take several (3 -4) PERCLK cycles to complete during which the register will
be in a pending state. If a LFSYNC register is written to while it is in a pending state, a BUSFAULT will occur. Each LFSYNC register
has a status bit indicating if it is currently pending.
LFSYNC registers may be read at any time. The CPU is never stalled on a read. If a LFSYNC register is read while pending, the pend-
ing (recently written) data will be returned even though it has not yet taken effect. Software may use the busy status bit to determine if
the read value has been applied to the hardware.
ENABLE registers may be written at any time. When the peripheral is enabled it takes some time for the enable to take effect during
which time the module is pending. Peripherals will be in the pending state for a few (2 - 3) PERCLK cycles when first enabled. Since the
clock source for the peripheral may not be running before the peripheral is enabled, the start up time for the clock source may increase
the pending time. See 7. CMU - Clock Management Unit for more information on on-demand clock sources.
When EN is cleared to 0, the peripheral will be disabled. The DISABLING status bit will be set to 1 until the operation is complete.
During disablement, the module will wait for any SYNCBUSY status to clear, reset the core peripheral function, and de-assert the pe-
ripheral clock. Entry into low energy modes EM2 and EM3 will be delayed while a peripheral is disabling.
While DISABLING is set, writing to any register in the module, including attempts to re-enable with EN, will cause a bus fault condition.
Any register in the module can be read while DISABLING.
SWRST registers are available in some blocks to reset the module back to the intial condition, similar to a power-on reset.
SWRST registers have a SWRST bit, which will reset the peripheral when written to 1. These registers also contain a status bit, RE-
SETTING, which indicates that a reset is in progress.
If a peripheral is resetting due to SWRST, entry into low energy modes EM2 and EM3 will be delayed. Writing to the SWRST bit or any
other writeable register while a reset is in progress will generate a bus fault condition.
INTFLAG registers contain interrupt flags. To set or clear an interrupt flag, the _SET or _CLR register alias must be used. Writing di-
rectly to the INTFLAG register will have no effect.
Note that for an interrupt to occur when a flag is set the IRQ must be enabled in the NVIC.
Quick Facts
What?
0 1 2 3 4
The user can perform flash memory read, read con-
figuration, and write operations through the Memory
System Controller (MSC). SRAM operation may be
configured though System Configuration (SYSCFG).
Why?
01000101011011100110010101110010
01100111011110010010000001001101 The MSC allows the application code and user data
to be stored in non-volatile flash memory. Certain
01101001011000110111001001101111 memory system functions, such as program memory
00100000011100100111010101101100 wait-states and flash lock bits are configured from
01100101011100110010000001110100 the MSC peripheral register interface, giving the de-
01101000011001010010000001110111 veloper the ability to dynamically customize the
memory system performance, security level, energy
01101111011100100110110001100100 consumption and error handling capabilities to the
00100000011011110110011000100000 requirements at hand.
01101100011011110111011100101101
How?
01100101011011100110010101110010
01100111011110010010000001101101 The MSC integrates a low-energy flash IP with a
01101001011000110111001001101111 charge pump, enabling minimum energy consump-
tion while eliminating the need for external program-
01100011011011110110111001110100 ming voltage to erase the memory. An easy to use
01110010011011110110110001101100 write and erase interface is supported by an internal,
01100101011100100010000001100100 fixed-frequency oscillator and autonomous flash tim-
01100101011100110110100101100111 ing and control reduces software complexity while
not using other timer resources.
01101110001000010100010101101110
A highly efficient low energy instruction cache re-
duces the number of flash reads significantly, thus
saving energy. Performance is also improved when
wait-states are used, since many of the wait-states
are eliminated. Built-in performance counters can be
used to measure the efficiency of the instruction
cache.
5.1 Introduction
The Memory System Controller (MSC) is the program memory unit of the EFM32PG28 microcontroller. The flash memory is readable
and writable from both the Cortex®-M33 and DMA. The flash memory is divided into two blocks: the main block and the information
block. Program code is normally written to the main block. The information block is available for special user data. There is also a read-
only page in the information block containing system and device calibration data. Flash read and write operations are supported in en-
ergy modes EM0 and EM1.
5.2 Features
The size of the main flash block is device dependent. The largest size available is 1024 kB (128 pages). The information block has 1 kB
available for user data. The information block also contains chip configuration data located in a reserved area. The main block is map-
ped to address 0x08000000 and the information block is mapped to address 0x0FE00000. Table 5.1 MSC Flash Memory Mapping on
page 50 outlines how the flash is mapped in the memory space. All flash memory is organized into 8 kB pages.
Block Page Base address Write/Erase by... Software Reada- Purpose/Name Size
ble?
Main 0 0x08000000 Software, debug Yes User code and data 16 kB - 1024 kB
Note:
1. 128 pages for largest device.
The SYSCFG and MPAHBRAM modules contain controls for configuring the various RAM blocks on the device. Options include ena-
bling EM2/EM3 data retention, ECC, and RAM port priorities. For a complete description see 5.6 SYSCFG - System Configuration.
The instruction cache improves the speed and power consumption of the Cortex®-M33 by providing fast, low-power access to recently
executed instructions. For detailed information see 5.5 ICACHE - Instruction Cache
This read-only page holds calibration data from the production test, several unique device IDs, and other part specific information. For a
complete description see 5.4 DEVINFO - Device Info Page.
This is the user data page in the information block. The page can be erased and written by software when MISCLOCK-
WORD.UDLOCKBIT is 0.
5.3.5 Bootloader
The EFM32PG28 supports use of the Gecko Bootloader detailed in UG489: Silicon Labs Gecko Bootloader User’s Guide for GSDK 4.0
and Higher (https://www.silabs.com/support/resources).To enable bootloader functionality, the second stage of the bootloader must be
configured and programmed into the beginning of flash. The first stage of the bootloader is provided by the SE and is not user accessi-
ble. For more details on SE bootloader support, see the SE peripheral documentation.
Calibration values are automatically written to registers by the MSC before application code start-up. The values can also be read from
the DI page by software. Other information such as the device ID and production date is also stored in the DI page and is readable from
software.
As part of the reset, hardware performs repeated flash reads to determine when flash is fully powered up and available for use by the
CPU. PWRUPCKBDFAILCOUNT in MSC_STATUS contains the number of failed reads during the last reset.
Flash wakeup on demand is supported when waking from EM2/3 to EM0. Set bit FLASHPWRUPONDEMAND of register EMU_CTRL
to enable the power up on demand. When enabled, flash will not be powered up until accessed. In this case it is possible for the MCU
to wake, execute out of RAM or cache, and return to sleep mode without ever powering on the flash. Software can force the flash to
power up by writing PWRUP in MSC_CMD. When flash is powered via MSC_CMD the MSC_IF.PWRUPF interrupt flag will be set when
power up is complete and the CPU will be interrupted if MSC_IEN.PWRUPF is set.
It is also possible to put the flash in a power-saving sleep mode when the system is in EM0 or EM1. Flash power down can be config-
ured to happen on entering EM1 or with an immediate manual operation.
During EM0, software can instruct the flash to go to power down mode with the MSC_CMD.PWROFF command. Any system IRQ or
flash read will wake the flash. The MSC_CMD.PWRUP command is used to power the flash back up in the absence of a wake event.
The MSC_PWRCTRL register allows the flash to be configured to automatically enter sleep mode on entering EM1 sleep with the bits
PWROFFONEM1ENTRY and PWROFFONEM1PENTRY, respectively. If the flash is configured to sleep during one of these states, it
may sometimes be powered back up without processor intervention in EM0 (for example, if DMA reads flash in EM1). By default, the
flash will remain powered on after such access. If the PWROFFENTRYAGAIN bit is set, it instructs the flash to re-enter the power down
state if no further access is seen during the timeout period defined by PWROFFDLY. Flash must be idle for PWROFFDLY * 64 bus
clocks before it will enter sleep again.
5.3.9 Wait-states
Since the CPU may be clocked faster than the flash can respond, it is necessary to configure wait-states for flash accesses at higher
CPU clock speeds. See the device Datasheet for information on the maximum allowed frequency for each wait-state setting. To config-
ure the flash wait-states set the MODE field in MSC_READCTRL.
When changing wait states, care should be taken that the system is never in an invalid state. To ensure this, MODE should be changed
after the clock is changed when reducing clock speed and before the clock is changed when increasing clock speed.
The Cortex®-M33 offers a mechanism known as if-then block folding. This is a form of speculative prefetching where small if-then
blocks are collapsed in the prefetch buffer if the condition evaluates to false. The instructions in the block then appear to execute in
zero cycles. With this scheme, performance is optimized at the cost of higher energy consumption as the processor fetches more in-
structions from memory than it actually executes. To disable the mode, write a 1 to the DISFOLD bit in the NVIC Auxiliary Control Reg-
ister; see the Cortex®-M33 Technical Reference Manual for details. Normally, it is expected that this feature is most efficient when op-
erating with 0 wait-states. Folding is enabled by default.
The MSC reads a 2-word line from flash on any flash access. The data being accessed is returned immediately and the other word
locally cached so that it can be provided immediately if accessed. This has the effect of pre-fetching the second word when the first is
read, resulting in fewer wait-states when executing sequential code. This feature may be disabled by setting DOUTBUFEN in
MSC_READCTRL.
To erase a page first set WREN in MSC_WRITECTRL and load any address in the page to be erased into the MSC_ADDRB register.
Next check INVADDR, LOCKED, and WREADY in MSC_STATUS to ensure that the address is valid, not locked, and the MSC is ready
to modify flash. Writing ERASEPAGE in MSC_WRITEMD will execute the page erase operation. ERASE in MSC_IF will be set when
the page erase is complete. If ERASE in MSC_IEN is set, the end of a page erase will also trigger an interrupt. Finally, clear WREN to
disable flash operations.
In addition to a page erase, a mass erase will clear the entire contents of the main flash array. A mass erase can be initiated by the
Secure Engine. User Data page contents are not included in a mass erase.
To perform a programming operation, set WREN and load the address to be programmed into the MSC_ADDRB register. Next check
INVADDR, LOCKED, WREADY, and WDATAREADY in MSC_STATUS to ensure that the address is valid, not locked, the MSC is
ready to modify flash, and the write data buffer is clear. Writing data to MSC_WDATA will begin the programming operation. If a burst
write is being performed, the next data word can be programmed to MSC_WDATA as soon as WDATAREADY is set. WRITE in
MSC_IF will be set when the programming operation is complete. If WRITE in MSC_IEN is set, the end of the program operation will
also trigger an interrupt. Finally, clear WREN to disable flash operations.
If data is written to the MSC_WDATA register faster than it can be processed, WDATAOV in MSC_IF will be set. If WDATAOV in
MSC_IEN is set an interrupt will also be fired.
The MSC_ADDRB register only has to be written once when writing to sequential words. After each word is written, ADDRB is incre-
mented automatically by 4. The INVADDR bit of the MSC_STATUS register is set if the loaded address is outside the flash. The
LOCKED bit of the MSC_STATUS register is set if the page addressed is locked. Any attempts to erase or write to the page are ignored
if INVADDR or the LOCKED bits of the MSC_STATUS register are set.
Write and erase operations may be aborted by software. To abort an erase, set the ERASEABORT bit in the MSC_WRITECMD regis-
ter. To abort a write, set WRITEEND in MSC_WRITECMD
For a DMA write, CLEARWDATA in MSC_WRITECMD to assert a DMA request and transfer the first word. Alternately the first word
may be programmed manually into MSC_WDATA by code.
By default, if any interrupt occurs during an erase operation, the erase is aborted. This feature may be disabled by clearing IRQERA-
SEABORT in MSC_WRITECTRL. When an erase is aborted due to an interrupt, ERASEABORTED in MSC_STAUTS is set by hard-
ware.
Software may observe the status of the MSC via the MSC_STATUS register. When a flash operation is in progress, BUSY will be set. If
a flash operation has been requested but not yet started, PENDING will be set. This may occur if a subsystem is performing MSC oper-
ations. When the write buffer underflows, TIMEOUT will be set. Buffer underflow is a normal part of the write procedure since it will
occur once the last word has been written and no more data is available.
The flash memory is organized into 64-bit wide double-words. Each 64-bit double-word can be written only twice between erase cycles.
The lower and upper 32-bit words may be written sequentially in any order, or one at a time. Each flash bit is 1 after erase. Writing a 0
will clear the bit. Writing a 1 will not change the bit value.
While it is possible to write twice to the lower or upper 32-bit word of the 64-bit double word, then the other 32-bit word cannot be used.
In this case, it is permitted to write to either the lower or upper 32-bit word twice between each erase, so long as no bit is ever cleared
more than once.
Note: The ERASEPAGE bit in WRITECMD and the WDATA register cannot safely be written from code in flash. It is recommended to
place a small code section in RAM to set these bits and wait for the operation to complete. Also note that DMA transfers to or from any
other address in flash while a write or erase operation is in progress will produce unpredictable results.
Note: During a write or erase, flash read accesses will be stalled, effectively halting code execution from flash. Code execution contin-
ues upon write/erase completion. Code residing in RAM or ICACHE may be executed during a write/erase operation.
To limit maximum current, the programming operations can be slowed down. Set LPWRITE in MSC_WRITECTRL to double the write
time and halve the write current.
The ability to program or erase individual flash pages may be disabled using the MSC_PAGELOCKn registers. The bits in these regis-
ters may only be set to 1 by software on the device and are cleared when the device is reset. This means that once locked, a page may
not be unlocked until a reset occurs. Users wishing to lock accesses to flash should implement code to write to the MSC_PAGELOCKn
registers immediately after a reset. Any page locked in this way cannot be written to or erased.
User Data can be locked by setting MSC_MISCLOCKWORD.UDLOCK to 1. Mass erase is enabled out of reset, however if firmware
sets MELOCKBIT in the MSC_MISCLOCKWORD register, then mass erase can only be issued by the SE.
The Device Info Page holds factory programmed information about the device. It contains the following data:
• Calibration values for reconfiguring the device
• Unique ID's
• OPN identifiers (family, feature set, flash size, etc.)
0x25C DEVINFO_RTHERM R
0x000
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
0xC
0x0
0x0
Reset
Access
DEVINFOREV R
R
PRODREV
Name
CRC
Bit Name Reset Access Description
0x004 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
0x0
0x0
0x0
Reset
Access
FAMILYNUM R
DEVICENUM R
Name
FAMILY
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 FG Flex Gecko
3 ZG Z-Wave Gecko
5 PG Pearl Gecko
8 SG Sidewalk Gecko
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Device Number. The device number is one letter and 3 digits. NUMBER = (alpha-'A')*1000 + numeric. 0 = A000; 1123 =
B123
0x008 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
0x0
0x0
0x0
Reset
Access
FLASHPAGESIZE R
UDPAGESIZE
Name
DILEN
Flash page size in bytes coded as 2^((MEMINFO.PAGESIZE +10) & 0xFF. For example, the value of 0xFF = 512 bytes
0x00C
31
30
29
28
27
26
25
24
23
22
0x0 21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0x0
Reset
Access
R
FLASH R
SRAM
Name
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 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
0x0
0x0
0x0
Reset
Access
TEMPGRADE R
PINCOUNT
PKGTYPE
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3 N0TO70 0 to 70 degC
0x014 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
0x0
Reset
Access
PARTNO R
Name
Custom part identifier as unsigned integer (eg. 903). 65535 for standard product
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018
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
0xFFFFFFFF
Reset
Access
RSV R
Name
0x01C 31
30
29
28
27
26
0x0 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
0x0
0x0
0x0
0x0
0x0
0x0
Reset
Access
CONNECT R
R
BTSMART
THREAD
ZIGBEE
ZWAVE
RF4CE
Name
SRI
Bit Name Reset Access Description
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
2 LEVEL2 N/A
3 LEVEL3 N/A
19:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
2 LEVEL2 N/A
3 LEVEL3 N/A
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
2 LEVEL2 N/A
3 LEVEL3 N/A
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
2 LEVEL2 N/A
3 LEVEL3 N/A
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
2 LEVEL2 N/A
3 LEVEL3 N/A
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 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
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
RFMCUEN R
NCPEN
Name
GWEN
XOUT
Bit Name Reset Access Description
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x028 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
0x0
0x0
0x0
Reset
Access
CONNECTION R
R
Name
TYPE
REV
Bit Name Reset Access Description
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
MCM Revision
External Component
255 NONE
0x040 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
0x0
0x0
Reset
Access
R
UNIQUEID R
OUI48L
Name
Unique identifier
0x044
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
0xFFFF
0x0
Reset
Access
RESERVED R
Name R
OUI48H
Reserved
0x048 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
0x0
Reset
Access
UNIQUEL R
Name
0x04C
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
0x0
0x0
Reset
Access
R
UNIQUEH R
Name
OUI64
0x050 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
0x0
Reset
Access
TEMP R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x054
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
0x0 6
5
4
3
2
1
0
Reset
Access
EMUTEMPROOM R
Name
31:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x058 31
30
29
28
27
26
25
24
23
0x0 22
21
20
19
0x0 18
17
16
0x0 15
14
13
12
11
10
9
8
7
6
5
4
0x0 3
2
1
0
0x0
0x0
0x0
0x0
Reset
Access
R
FREQRANGE R
R
FINETUNING
CMPBIAS
CMPSEL
TUNING
Name
IREFTC
CLKDIV
LDOHP
Bit Name Reset Access Description
Tempco Trim
Frequency Range
15 LDOHP 0x0 R
14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Tuning Value
0x0A0 31
30
29
28
27
26
25
24
23
0x0 22
21
20
19
0x0 18
17
16
0x0 15
14
13
12
11
10
9
8
7
6
5
4
0x0 3
2
1
0
0x0
0x0
0x0
0x0
Reset
Access
R
FREQRANGE R
R
FINETUNING
CMPBIAS
CMPSEL
TUNING
Name
IREFTC
CLKDIV
LDOHP
Bit Name Reset Access Description
Tempco Trim
Frequency Range
15 LDOHP 0x0 R
14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Tuning Value
0x130 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
0xFF
0xFF
0xFF
0xFF
Reset
Access
MODCHAR4 R
MODCHAR3 R
MODCHAR2 R
MODCHAR1 R
Name
Fourth character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Third character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Second character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
First character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
0x134
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
0xFF
0xFF
0xFF
0xFF
Reset
Access
MODCHAR8 R
MODCHAR7 R
MODCHAR6 R
MODCHAR5 R
Name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
0x138 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
0xFF
0xFF
0xFF
0xFF
Reset
Access
MODCHAR12 R
MODCHAR11 R
MODCHAR10 R
R
MODCHAR9
Name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
0x13C 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
0xFF
0xFF
0xFF
0xFF
Reset
Access
MODCHAR16 R
MODCHAR15 R
MODCHAR14 R
MODCHAR13 R
Name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
0x140 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
0xFF
0xFF
0xFF
0xFF
Reset
Access
MODCHAR20 R
MODCHAR19 R
MODCHAR18 R
MODCHAR17 R
Name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
0x144 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
0xFF
0xFF
0xFF
0xFF
Reset
Access
MODCHAR24 R
MODCHAR23 R
MODCHAR22 R
MODCHAR21 R
Name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
Character of Module Name, 0xFF = unwritten, 0x00 = character not used in name
0x148
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
0xFFFF
0xFF
0xFF
Reset
Access
R
MODCHAR26 R
MODCHAR25 R
Name
RSV
Last possible character of module name, 0xFF = unwritten, 0x00 = character not used in name
0x14C 31
30
29
28
27
26
25
0x1FF 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
0x7F
0x1F
0x1
0x1
0x1
0x1
0x1
0x1
0x1
0x1
0x7
Reset
Access
R
R
R
MODNUMBERMSB R
R
R
R
R
R
R
MODNUMBER
HFXOCALVAL
LFXOCALVAL
PHYLIMITED
Name
EXTVALID
ANTENNA
EXPRESS
PADCDC
HWREV
LFXO
TYPE
Bit Name Reset Access Description
31 EXTVALID 0x1 R
0 EXTUSED
1 EXTUNUSED
30 PHYLIMITED 0x1 R
PHY Limited
0 LIMITED
1 UNLIMITED
29 PADCDC 0x1 R
PAVDD Connection
0 VDCDC
1 OTHER
Counter allowing unique identification of module per lookup when combined with MODNUMBER
19 HFXOCALVAL 0x1 R
0 VALID
1 NOTVALID
18 LFXOCALVAL 0x1 R
0 VALID
1 NOTVALID
17 EXPRESS 0x1 R
0 SUPPORTED
1 NONE
16 LFXO 0x1 R
0 NONE
1 PRESENT
15 TYPE 0x1 R
Module Type
0 PCB
1 SIP
Counter allowing unique identification of module per lookup when combined with MODNUMBER MSB
0 BUILTIN None
1 CONNECTOR
2 RFPAD
3 INVERTEDF
0x150 31
30
29
28
27
26
25
24
23
22
21
20
0x7F 19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0xFF
0xFF
Reset
Access
HFXOCTUNEXOANA R
R
HFXOCTUNEXIANA
LFXOCAPTUNE
Name
31:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Tuning capacitance on XO
Tuning capacitance on XI
0x17C 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
0xFFFFFF
0x0
0x0
Reset
Access
SHUNTBIASANA R
VTRTRIMANA
RESERVED
Name
Reserved
0 I20UA
1 I30UA
2 I40UA
3 I50UA
4 I60UA
5 I70UA
6 I80UA
7 I90UA
8 I100UA
9 I110UA
10 I120UA
11 I130UA
12 I140UA
13 I150UA
14 I160UA
15 I170UA
0x180 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
0x0
0x0
Reset
Access
GAINCANA2 R
GAINCANA1 R
Name
Input Gain = 2x
0x184
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
0x0
0x0
Reset
Access
GAINCANA4 R
GAINCANA3 R
Name
Input Gain = 4x
Input Gain = 3x
0x188 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
0x0
0x0
Reset
Access
OFFSETANA1HIACC R
R
OFFSETANABASE
Name
0x18C
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
0x0
0x0
Reset
Access
OFFSETANA2NORM R
OFFSETANA1NORM R
Name
0x190 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
0x0
Reset
Access
OFFSETANA3NORM R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x194
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
0x0
0x0
Reset
Access
OFFSETANA2HISPD R
OFFSETANA1HISPD R
Name
0x198 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
0x0
Reset
Access
OFFSETANA3HISPD R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1FC 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
0x80
Reset
Access
DEVICEFAMILY R
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Device Family
100 EFM32GG11B EFM32 Giant Gecko Device Family Series 1 Device Config 1
103 EFM32TG11B EFM32 Giant Gecko Device Family Series 1 Device Config 1
128 SERIES2V0 DI page is encoded with the series 2 layout. Check alternate lo-
cation.
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
5.4.2.37 DEVINFO_RTHERM -
0x25C 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
0x0
Reset
Access
RTHERM R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The ICACHE provides fast access to recently executed instructions, improving both speed and power consumption of code execution.
The instruction cache is enabled by default, but can be disabled by setting CACHEDIS in ICACHE_CTRL. When enabled, the instruc-
tion cache typically reduces the number of flash reads significantly, thus saving energy. In most cases, a cache hit-rate of more than 70
% is achievable. When a 32-bit instruction fetch hits in the cache, the data is returned to the processor in one clock cycle, bypassing the
flash access wait-states. The cache content is retained in EM2 and EM3.
The instruction cache is connected directly to the CODE bus on the ARM core and functions as a memory access filter between the
processor and the memory system, as illustrated in Figure 5.1 Instruction Cache Block Diagram on page 85. The cache consists of an
access filter, lookup logic, SRAM, and three performance counters. The access filter checks if a transfer is an instruction fetch located
in a cacheable region. If it is the cache lookup logic and SRAM is enabled. Otherwise, the cache is bypassed and the access is forwar-
ded to the memory system. If lookup is enabled data is either returned from the cache (hit) or fetch from the memory system and cach-
ed (miss).
ARM Core
Cache Performance
Memory SRAM
Look-up Logic Counters
SYSTEM
AHB Bus
Note that while all access to code spaces use the CODE bus only instruction fetches are cached. Data accesses to the CODE region
are passed through the ICACHE.
It is highly recommended to keep the cache enabled. To improve cache-efficiency, sections of code with very low cache hit rate should
not be cached. This is achieved by placing these code sections in non-cacheable MPU regions and setting USEMPU in
ICACHE_CTRL. When USEMPU is set, instruction fetches to non-cacheable MPU regions will not be looked up or saved in cache. This
feature may also be used to avoid instructions from low-power memory taking up space from more power-hungry memory. For more
information on the MPU see the ARM Cortex®-M33 MPU documentation.
The optional loop-cache is optimized to store smaller code-loops efficiently. The loop-cache is enabled when LPLEVEL in IC-
ACHE_LPMODE is set to ADVANCED or MINACTIVITY. The difference between the two settings is that when MINACTIVITY is selec-
ted loop-cache outputs may be gated off to reduce power at the cost of more wait-states due to loop-cache misses. Having LPLEVEL
set to BASIC disables the loop-cache functionality completely. NESTFACTOR in ICACHE _LPMODE is used to decide when to stick
with the currently detected loop rather than start tracking a new loop. Optimal value will depend on the actual code running, meaning
that this setting may be tuned for optimal performance.
By default, the instruction cache is automatically invalidated when the contents of the flash are changed (i.e. written or erased). In many
cases, however, the application only makes changes to data in the flash, not code. In this case, the automatic invalidate feature can be
disabled by setting AUTOFLUSHDIS in ICACHE_CTRL. The cache can also be manually invalidated by writing 1 to FLUSH in IC-
ACHE_CMD.
In the event that a parity error in the cache is detected, the RAMERROR flag will be set in ICACHE_IF. The data is automatically reloa-
ded when this occurs so no action is required by software. This flag is informational only and can be used to detect the rate of corrup-
tion events. If RAMERROR in ICACHE_IEN is set, an interrupt will be triggered.
The cache is automatically flushed whenever a bus fault occurs. If this occurs during performance counting the counts will be effected.
To measure the hit-rate of a code-section, the built-in performance counters can be used. Before the section, start the performance
counters by setting STARTPC in ICACHE_CMD register. This starts the performance counters, counting from 0. At the end of the sec-
tion, stop the performance counters by setting STOPPC in ICACHE_CMD. The number of cache hits and cache misses for that section
can then be read from PCHITS and PCMISSES. The cache hit-ratio can be calculated as PCHITS / (PCHITS + PCMISSES). PCAHITS
contains the loopcache hits only. Any hits in PCAHITS are also counted in PCHITS. The loopcache hit-ratio can be calculated as PCA-
HITS / (PCHITS + PCMISSES). When PCHITS/PCAHITS/PCMISSES overflow, the HITOF/AHITOF/MISSOF interrupt flags are set re-
spectively. These flags must be cleared by software. The range of the performance counters can be extended by increasing a counter
in the interrupt routine. The performance counters only count when a cache lookup is performed. Access to non-cacheable regions,
data fetches, and access made while the ICACHE is disabled do not increment PCMISSES.
Software may check the if the performance counters are running using PCRUNNING in ICACHE_STATUS.
0x000
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
0x0
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004 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
AUTOFLUSHDIS RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CACHEDIS
Name
USEMPU
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x008
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
0x0
Reset
Access
PCHITS R
Name
0x00C 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
0x0
Reset
Access
PCMISSES R
Name
0x010
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
0x0
Reset
Access
PCAHITS R
Name
Hit counter value for hits due to Advanced Buffering mode. These hits are also represented in PCHITS.
0x014 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
0x0 0
Reset
Access
PCRUNNING R
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018
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
W(nB) 0x0 2
STARTPC W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
STOPPC
FLUSH
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x01C 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
NESTFACTOR RW 0x2
RW 0x3
Reset
Access
LPLEVEL
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Parameter used in the advanced buffering mode to control its estimation when a branch access is likely to be accssed in
the near future. In general, a higher number will improve performance in code with deeply nested loops.
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Controls the low-power level of the cache. In general, the default setting is best for most applications.
1 ADVANCED Advanced buffering mode, where the cache uses the fetch pat-
tern to predict highly accessed data and store it in low-energy
memory
3 MINACTIVITY Minimum activity mode, which allows the cache to minimize ac-
tivity in logic that it predicts has a low probability being used.
This mode can introduce wait-states into the instruction fetch
stream when the cache exits one of its low-activity states. The
number of wait-states introduced is small, but users running with
0-wait-state memory and wishing to reduce the variability that
the cache might introduce with additional wait-states may wish
to lower the cache low-power level. Note, this mode includes the
advanced buffering mode functionality.
0x020 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
RAMERROR RW 0x0 8
7
6
5
4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
MISSOF
AHITOF
Name
HITOF
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x024 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
RAMERROR RW 0x0 8
7
6
5
4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
MISSOF
AHITOF
Name
HITOF
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
DMEM0 is broken into 16 KB banks. By default all banks are retained in EM2/EM3. Sleep mode current can be significantly reduced by
fully powering down banks that do not need to be retained. To select the amount of RAM to be powered down in EM2/EM3, set RAM-
RETNCTRL in SYSCFG_DMEM0RETNCTRL to the desired value.
5.6.2 ECC
DMEM0 supports one bit correction and two bit detection ECC.
To enable error detection for DMEM0, set ECCEN in MPAHBRAM_CTRL. To enable auto-correction of one bit errors in DMEM0, set
ECCWEN in MPAHBRAM_CTRL.
When ECC error events in DMEM0 are detected, the corresponding bits in MPAHBRAM_IF are set. Errors arising from a specific port
'x' will be indicated by the AHBxERR1B or AHBxERR2B flags. When a flag is set, an interrupt will be triggered if the corresponding
interrupt enable bit is set in MPAHBRAM_IEN. When an error occurs, the address of the detected error is written to MPAHBRAM_EC-
CERRADDRx for the respective port 'x'. The address registers are sticky and will not be loaded with a new address until they are
cleared through MPAHBRAM_CMD.CLEARECCADDRx. If multiple ECC errors occur without ECCERRADDRn being cleared, the Px
bit in MPAHBRAM_ECCMERRIND will be set. These status bits are also sticky, and are cleared with MPAHBRAM_CMD.CLEAREC-
CADDRx.
Upon a two bit ECC error in DMEM, MPAHBRAM can also issue a bus fault. To enable this, set the ECCERRFAULTEN bit in MPAH-
BRAM_CTRL.
The recommend procedure for initializing ECC RAM is to first enable ECC, then write zeros to all locations. This will clear the RAM and
initialize the syndrome. If the ECC RAM is not written as described, then any reads to uninitialized RAM locations will result in an ECC
error.
Note: The RAM ECC feature must be enabled to achieve good long term reliability. The long term reliability of the RAM is only specified
with ECC enabled.
The SYSCFG block also provides some software interrupts that can be used to communicate between software tasks. To trigger a soft-
ware interrupt set the corresponding bit in SYSCFG_IF.
By default, two bit ECC errors and reads to unmapped addresses trigger a BusFault. These bus fault sources can be disabled by clear-
ing RAMECCERRFAULTEN and ADDRFAULTEN in SYSCFG_CTRL.
0x004
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
0x7
Reset
Access
IPVERSION R
Name
ID indicating version of IP
0x008 31
30
RW 0x0 29
RW 0x0 28
27
26
RW 0x0 25
RW 0x0 24
23
22
21
20
19
18
SRW2HOSTBUSERRIF RW 0x0 17
HOST2SRWBUSERRIF RW 0x0 16
15
14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
7
6
5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
SEQRAMERR2B
SEQRAMERR1B
FRCRAMERR2B
FRCRAMERR1B
Name
FPOFC
FPUFC
FPDZC
FPIOC
FPIDC
FPIXC
SW3
SW2
SW1
SW0
Bit Name Reset Access Description
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Software interrupts
Software interrupts
Software interrupts
Software interrupts
0x00C 31
30
RW 0x0 29
RW 0x0 28
27
26
RW 0x0 25
RW 0x0 24
23
22
21
20
19
18
SRW2HOSTBUSERRIEN RW 0x0 17
HOST2SRWBUSERRIEN RW 0x0 16
15
14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
7
6
5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
SEQRAMERR2B
SEQRAMERR1B
FRCRAMERR2B
FRCRAMERR1B
Name
FPOFC
FPUFC
FPDZC
FPIOC
FPIDC
FPIXC
SW3
SW2
SW1
SW0
Bit Name Reset Access Description
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014
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
PARTNUMBER RW 0x12
0x1
0x0
Reset
Access
R
Name
MAJOR
MINOR
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Stores the Hardwired Chip Revision Minor signal value upper 4bits, and reflects tie-block value that can change from
revision to revision.
Stores the Hardwired Chip Revision Minor signal value lower 4 bits.
0x018 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 0x0
RW 0x0
PARTNUMBER RW 0x0
Reset
Access
Name
MAJOR
MINOR
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x024
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
SYSTICEXTCLKEN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x200 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
RAMECCERRFAULTEN RW 0x1 5
4
3
2
RW 0x1 1
RW 0x1 0
Reset
Access
CLKDISFAULTEN
ADDRFAULTEN
Name
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
5 RAMECCERRFAULTEN 0x1 RW Two bit ECC error bus fault response ena
When this bit is set, busfaults are generated if 2-bit ECC error occurs.
4:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set, busfaults are generated on accesses to peripherals with disabled bus clock
When this bit is set, busfaults are generated on accesses to unmapped parts of system and code address space
0x208 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
RAMRETNCTRL RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
DMEM0 RAM blockset retention controls in EM23 with full access in EM01.Each bank has a bit to select to Retain or
Powerdown
49152 BLK14TO15 Power down RAM blocks 14 and above (address range
0x20038000-0x20040000)
57344 BLK13TO15 Power down RAM blocks 13 and above (address range
0x20034000-0x20040000)
61440 BLK12TO15 Power down RAM blocks 12 and above (address range
0x20030000-0x20040000)
63488 BLK11TO15 Power down RAM blocks 11 and above (address range
0x2002C000-0x20040000)
64512 BLK10TO15 Power down RAM blocks 10 and above (address range
0x20028000-0x20040000)
65024 BLK9TO15 Power down RAM blocks 9 and above (address range
0x20024000-0x20040000)
65280 BLK8TO15 Power down RAM blocks 8 and above (address range
0x20020000-0x20040000)
65408 BLK7TO15 Power down RAM blocks 7 and above (address range
0x2001C000-0x20040000)
65472 BLK6TO15 Power down RAM blocks 6 and above (address range
0x20018000-0x20040000)
65504 BLK5TO15 Power down RAM blocks 5 and above (address range
0x20014000-0x20040000)
65520 BLK4TO15 Power down RAM blocks 4 and above (address range
0x20010000-0x20040000)
65528 BLK3TO15 Power down RAM blocks 3 and above (address range
0x2000C000-0x20040000)
65532 BLK2TO15 Power down RAM blocks 2 and above (address range
0x20008000-0x20040000)
65534 BLK1TO15 Power down RAM blocks 1 and above (address range
0x20004000-0x20040000)
0x30C
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
RAMBIASCTRL RW 0x2
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 NO None
0x418 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
RAMRETNCTRL RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x41C 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
MVPAHBDATA2PORTSEL RW 0x1
MVPAHBDATA1PORTSEL RW 0x3
MVPAHBDATA0PORTSEL RW 0x2
RW 0x1
RW 0x0
RW 0x0
RW 0x1
RW 0x1
Reset
Access
SRWECA1PORTSEL
SRWECA0PORTSEL
AHBSRWPORTSEL
SRWAESPORTSEL
LDMAPORTSEL
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x600 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
DATA RW 0x0
Reset
Access
Name
Generic data space for user to pass to root, e.g., address of struct in mem
0x604
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
Reset DATA RW 0x0
Access
Name
Generic data space for user to pass to root, e.g., address of struct in mem
0x608 0x0 31
30
29
28
27
26
25
24
23
22
21
0x1 20
0x1 19
0x1 18
0x1 17
0x1 16
15
14
13
12
11
10
9
0x1 8
7
6
5
4
3
0x1 2
0x1 1
0x1 0
Reset
Access
EFUSEUNLOCKED R
R
R
R
R
USERDBGAPLOCK R
R
R
R
USERSPNIDLOCK
USERSPIDLOCK
ROOTDBGLOCK
USERDBGLOCK
USERNIDLOCK
Name
MFRLOCK
REGLOCK
BUSLOCK
Bit Name Reset Access Description
30:21 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x60C 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
SWVERSION RW 0x0
Reset
Access
Name
0x000
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
0x2
Reset
Access
IPVERSION R
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x004 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
CLEARECCADDR3 W(nB) 0x0 3
CLEARECCADDR2 W(nB) 0x0 2
CLEARECCADDR1 W(nB) 0x0 1
CLEARECCADDR0 W(nB) 0x0 0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x008 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
RW 0x1 6
5
AHBPORTPRIORITY RW 0x0 4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
ECCERRFAULTEN
ADDRFAULTEN
Name
ECCWEN
ECCEN
Bit Name Reset Access Description
31:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C 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
0x0
Reset
Access
ADDR R
Name
0x010
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
Reset 0x0
Access
ADDR R
Name
0x014
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
0x0
Reset
Access
ADDR R
Name
0x018 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
0x0
Reset
Access
ADDR R
Name
0x01C
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
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
R
Name
P3
P2
P1
P0
Bit Name Reset Access Description
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
AHB3ERR2B RW 0x0 7
AHB2ERR2B RW 0x0 6
AHB1ERR2B RW 0x0 5
AHB0ERR2B RW 0x0 4
AHB3ERR1B RW 0x0 3
AHB2ERR1B RW 0x0 2
AHB1ERR1B RW 0x0 1
AHB0ERR1B RW 0x0 0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x024 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
AHB3ERR2B RW 0x0 7
AHB2ERR2B RW 0x0 6
AHB1ERR2B RW 0x0 5
AHB0ERR2B RW 0x0 4
AHB3ERR1B RW 0x0 3
AHB2ERR1B RW 0x0 2
AHB1ERR1B RW 0x0 1
AHB0ERR1B RW 0x0 0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x040 MSC_MISCLOCKWORD RW Mass Erase and User Data Page Lock Word
0x1040 MSC_MISCLOCKWORD_SET RW Mass Erase and User Data Page Lock Word
0x2040 MSC_MISCLOCKWORD_CLR RW Mass Erase and User Data Page Lock Word
0x3040 MSC_MISCLOCKWORD_TGL RW Mass Erase and User Data Page Lock Word
0x000
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
0x7
Reset
Access
IPVERSION R
Name
IP Version ID
0x004 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
MODE RW 0x2
Reset
Access
Name
31:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When changing to a higher frequency, this register must be set to a large number of wait states before the core clock is
switched to the higher frequency. When changing to a lower frequency, this register should be set to a lower number of
wait states after the frequency transition has been completed. The maximum frequency for each wait state setting is lis-
ted in the datasheet.
1 WS1 One wait-state inserted for each fetch or read transfer. See
Flash Wait-States table for details
2 WS2 Two wait-states inserted for eatch fetch or read transfer. See
Flash Wait-States table for details
3 WS3 Three wait-states inserted for eatch fetch or read transfer. See
Flash Wait-States table for details
19:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x008 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
DOUTBUFEN RW 0x1 12
11
10
9
8
7
6
5
4
3
2
RW 0x0 1
0
Reset
Access
Name
AFDIS
Bit Name Reset Access Description
31:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set the cache is not automatically invalidated when a write or page erase is performed.
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C 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
RW 0x0 3
2
IRQERASEABORT RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
RANGECOUNT
Name
LPWRITE
WREN
Bit Name Reset Access Description
31:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, write times might double while reducing current consumption
2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set to 1, any Cortex-M33 interrupt aborts any current page erase operation. Executing that interrupt vec-
tor from Flash will halt the CPU.
When this bit is set, the MSC write and erase functionality is enabled
0x010 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
0x0 12
11
10
9
0x0 8
7
6
0x0 5
0x0 4
3
0x0 2
0x0 1
0
Reset
Access
CLEARWDATA W
ERASEABORT W
ERASERANGE W
W
W
ERASEMAIN0
ERASEPAGE
WRITEEND
Name
31:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Will set WDATAREADY and DMA request. Should only be used when no write is active.
11:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Initiate mass erase of flash memory. If MELOCKBIT in MSC_MISCLOCKWORD is set, user firmware cannot initiate
mass erase, and only the SE may initiate mass erase.
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Erase a range of user defined pages started from the MSC_ADDRB register. The WREN bit in the MSC_WRITECTRL
register must be set in order to use this command.
3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Erase any user defined page selected by the MSC_ADDRB register. The WREN bit in the MSC_WRITECTRL register
must be set in order to use this command.
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014 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
ADDRB RW 0x0
Reset
Access
Name
This register holds the system address for the erase or write operation. Address should be word aligned address.The
MSB bit is not ignored for ADDRB
0x018
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
DATAW RW 0x0
Reset
Access
Name
The data to be written to the address in MSC_ADDRB. This register must be written when the WDATAREADY bit of
MSC_STATUS is set.This register does not support write mask.
0x01C 31
30
29
28
0x1 27
26
25
0x0 24
23
22
21
20
19
18
17
0x0 16
15
14
13
12
11
10
9
8
0x0 7
0x0 6
0x0 5
0x0 4
0x1 3
0x0 2
0x0 1
0x0 0
0x0
Reset
Access
PWRUPCKBDFAILCOUNT R
R
R
R
R
R
R
R
R
ERASEABORTED
RANGEPARTIAL
WDATAREADY
Name
REGLOCK
PENDING
TIMEOUT
INVADDR
WREADY
LOCKED
PWRON
BUSY
Bit Name Reset Access Description
This field tells how many times checkboard pattern check fail occured after a reset sequence.
When this bit is set, flash has completed the power up sequence and is ready for write/erase commands.
26:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set, flash is powered on. If zero, flash is powered off and reads from flash return indeterminate data.
23:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 UNLOCKED
1 LOCKED
15:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set, it indicates that the last write command has completed due to a write buffer timeout. This bit is
cleared automatically when a new write command is initiated.
When this bit is set, a flash operation has been requested but not yet started. New commands are ignored when PEND-
ING is set.
When MSC_WRITECTRL_IRQERASEABORT = 1, this bit is set because an interrupt has aborted the erase operation in
progress.
When this bit is set, the content of MSC_WDATA is read by MSC Flash Write Controller and the register may be updated
with the next 32-bit word to be written to flash. This bit is cleared when writing to MSC_WDATA.
When this bit is set, software has attempted to load an invalid (unmapped) address into the MSC_ADDRB register.
When set, the last erase or write was aborted due to erase/write access constraints.
When set, an erase or write operation is in progress and new commands are ignored.
0x020
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
RW 0x0 9
RW 0x0 8
7
6
5
4
3
WDATAOV RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
PWROFF
PWRUPF
ERASE
WRITE
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set after MSC_CMD.PWRUP received, flash powered up complete and ready for read/write
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x024 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
RW 0x0 9
RW 0x0 8
7
6
5
4
3
WDATAOV RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
PWROFF
PWRUPF
ERASE
WRITE
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
interrupt enable
interrupt enable
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
interrupt enable
interrupt enable
interrupt enable
0x034 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
0x4
Reset
Access
USERDATASIZE R
Name
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This field determines user data region size. SIZE = 256B * USERDATASIZE.
0x038
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
0x0 4
3
2
1
0x0 0
Reset
Access
PWROFF W
W
PWRUP
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write to this bit to power down the Flash. User code should execute from RAM afterwards. Read from flash after flash
being powered down will cause undetermined behavior. To power up, either set CMD.PWRUP bit or try read from flash.
3:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write to this bit to power up the Flash. IRQ PWRUPF will be fired when power up sequence completed.
0x03C 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
0x0
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock access to MSC_RDATACTRL, MSC_READCTRL, and
MSC_WRITECTRL. Write the unlock code to enable access. When reading the register, bit 0 is set when the lock is ena-
bled.
0 LOCK
7025 UNLOCK
5.8.14 MSC_MISCLOCKWORD - Mass Erase and User Data Page Lock Word
0x040
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
UDLOCKBIT RW 0x1 4
3
2
1
MELOCKBIT RW 0x1 0
Reset
Access
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Zero means host can write/erase to the user data area. Host is only allowed to write one. Root and debug can clear this
bit.
3:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Zero means host can mass erase the main space. Host is only allowed to write one. Root and debug can clear this bit.
0x050 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 0x10
0x0
0x1
0x0
Reset
RW
PWROFFONEM1PENTRY RW
RW
Access
PWROFFONEM1ENTRY
PWROFFENTRYAGAIN
Name
PWROFFDLY
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Defines delay cycles before flash enters sleep mode. Works together with PWROFFENTRYAGAIN bit. The power off de-
lay is 64 * PWROFFDLY bus clock cycles.
15:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
If enabled, flash will enter sleep mode again when POWEROFFONEM1ENTRY/POWEROFFONEM1PENTRY is set and
no flash activities occur for the time determined by PWROFFDLY.
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
If enabled, flash will be in sleep mode when entering EM1P (radio-only sleep).
0x120 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
LOCKBIT RW 0x0
Reset
Access
Name
Zero means the corresponding page is allowed to write/erase. change to one will prevent corresponding page from write/
erase. bit[0] for main space page 0, and bit[1] for page 1... bit[31] for page 31. Reset to zero. Host is only allowed to write
one. Root and Debug are allowed to clear this register
0x124
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
LOCKBIT RW 0x0
Reset
Access
Name
Zero means the corresponding page is allowed to write/erase. change to one will prevent corresponding page from write/
erase. bit[0] for main space page 32, and bit[1] for page 33... bit[31] for page 63. Reset to zero. Host is only allowed to
write one. Root and Debug are allowed to clear this register
0x128 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
LOCKBIT RW 0x0
Reset
Access
Name
Zero means the corresponding page is allowed to write/erase. change to one will prevent corresponding page from write/
erase. bit[0] for main space page 64, and bit[1] for page 65... bit[31] for page 95. Reset to zero. Host is only allowed to
write one. Root and Debug are allowed to clear this register
0x12C
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
LOCKBIT RW 0x0
Reset
Access
Name
Zero means the corresponding page is allowed to write/erase. change to one will prevent corresponding page from write/
erase. bit[0] for main space page 96, and bit[1] for page 97... bit[31] for page 127. Reset to zero. Host is only allowed to
write one. Root and Debug are allowed to clear this register
Quick Facts
What?
0 1 2 3 4
The Debug Interface is used to program and debug
EFM32PG28 devices.
Why?
How?
6.1 Introduction
The EFM32PG28 devices include hardware debug support through a 2-pin serial-wire debug (SWD) interface or a 4-pin Joint Test Ac-
tion Group (JTAG) interface, as well as an Embedded Trace Module (ETM) for data/instruction tracing. In addition, there is also a Serial
Wire Viewer pin which can be used to output profiling information, data trace and software-generated messages.
For more technical information about the debug interface the reader is referred to:
• ARM Cortex®-M33 Technical Reference Manual
• ARM CoreSight Components Technical Reference Manual
• ARM Debug Interface v5 Architecture Specification
• IEEE Standard for Test Access Port and Boundary-Scan Architecture, IEEE 1149.1-2013
6.2 Features
There are debug and trace pins available on the device. Operation of these pins is described in the following sections.
The following pins are the debug connections for the device:
• Serial Wire Clock Input and Test Clock Input (SWCLKTCK) (SWCLK) : This pin is enabled after power-up and has a built-in pull-
down.
• Serial Wire Data Input/Output and Test Mode Select Input (SWDIOTMS) (SWDIO) : This pin is enabled after power-up and has a
built-in pull-up.
• Test Data Output (TDO): This pin is assigned to JTAG functionality after power-up. However, it remains in high-Z state until the first
valid JTAG command is received.
• Test Data Input (TDI): This pin is assigned to JTAG functionality after power-up. However, it remains in high-Z state until the first
valid JTAG command is received. Once enabled, the pin has a built-in pull-up.
• Serial Wire Viewer (SWV): This pin is disabled after reset.
The debug pins have integrated pull devices that are enabled by default after a reset. Leaving them enabled may increase current con-
sumption if the pins are connected to power or ground. The debug pins have enable bits in the GPIO_DBGROUTEPEN register; refer
to the GPIO chapter for more details. Upon disabling the debug pins, debug contact with the device is lost once the DAPSWJ power
request bits are deasserted. By default after a power cycle, the DAPSWJ is in JTAG mode. If during a debugging session the device is
switched to SWD mode, a power cycle is needed to return to JTAG mode.
ETM makes it possible to non-intrusively trace both instruction and data from the processor in real time. Trace can be controlled
through a set of triggering and filtering resources. The resources include 4 address comparators, 2 data value comparators, 2 counters,
a context ID comparator and a sequencer. Before enabling the ETM, the CMU_TRACECLKCTRL register must be configured to select
the desired trace clock source. (See the CMU chapter for details.)
The trace can be exported through a set of trace pins, which include:
• Trace Clock (TRACECLK): Functions as a sample clock for the trace. This pin is disabled after reset.
• Trace Data 0-3 (TRACEDATA0, TRACEDATA1, TRACEDATA2, TRACEDATA3): The trace data pins provide the compressed trace
stream. These pins are disabled after reset.
For information on how to configure the ETM, see the ARM Embedded Trace Macrocell Architecture Specification. The Trace Clock
and Trace Data pins are enabled through a GPIO register. For more information on how to enable the ETM pins, refer to the GPIO
chapter.
Debug connectivity in EM2 and EM3 is unavailable by default, to reduce current consumption. Debugging through EM2 and EM3 can
be enabled by setting the EM2DBGEN bit in the EMU_CTRL register. Setting EM2DBGEN ensures that power domain associated with
the debug circuitry will remain active, but will result in a small amount of additional current in EM2 and EM3.
Leaving the debugger connected when issuing a WFI or WFE to enter EM2 or EM3 will make the system enter a special EM2 mode.
This mode differs from regular EM2 and EM3 in that the high frequency clocks are still enabled, and certain core functionality is still
powered in order to maintain debug functionality. Because of this, the current consumption in this mode is closer to EM1, and it is,
therefore, important to deassert the power requests in the DAPSWJ and disconnect the debugger before undertaking current consump-
tion measurements.
Quick Facts
WDOG clock
What?
7.1 Introduction
The Clock Management Unit (CMU) is responsible for switching among various oscillator sources and provides clocks to the peripheral
modules. Oscillators are automatically turned on and off based on demand from the peripherals to minimize power consumption.
7.2 Features
The CMU is comprised of several programmable clock trees, which connect oscillator resources to peripherals and buses. This section
describes clock sources and peripherals available to the largest devices in the EFM32PG28 family. Please refer to the Configuration
Summary in the Device Datasheet to see which core and peripheral modules, and therefore clock connections, are present in a specific
device. Bus clock selection, including peripherals clocked directly from bus clocks, is shown in Figure 7.1 Bus Clocks on page 139.
Clock selection for peripherals with multiple high-frequency clock sources is shown in Figure 7.2 High Frequency Peripheral Clocks on
page 140. Clock selection for peripherals with multiple low-frequency clock sources is shown in Figure 7.3 Low Frequency Peripheral
Clocks on page 141. Clock selection for peripherals that can select from a high or low frequency clock source is shown in Figure
7.4 Mixed Frequency Peripheral Clocks on page 142.
CMU_DPLLREFCLKCTRL.
CLKSEL
· Available in EM0/EM1
· Available in EM0/EM1/EM2
· Available in EM0/EM1/EM2/EM3
· Available in EM0/EM1/EM2/EM4
CMU_SECLKCTRL.
CLKSEL · Available in EM0/EM1/EM2/EM3/EM4
SYSCLK
HFRCOEM23 TRACECLKIN prescaler TRACECLK ETM
clock
/1, /2, /3,/
HFRCODPLLRT switch
4
CMU_TRACECLKCTRL.PRESC
CMU_TRACECLKCTRL.CLKSEL
HFRCOEM23
HFRCODPLL
Availability of oscillators and clocks in Energy Modes: HFXO EM01GRPACLK
clock TIMERn
HFRCODPLLRT
· Available in EM0/EM1 switch KEYSCAN
HFXORT
· Available in EM0/EM1/EM2
FSRCO
· Available in EM0/EM1/EM2/EM3
· Available in EM0/EM1/EM2/EM4
· Available in EM0/EM1/EM2/EM3/EM4
CMU_EM01GRPACLKCTRL.CLKSEL
EM01GRPACLK
HFRCOEM23 clock IADCCLK
IADC0
FSRCO switch
CMU_IADCCLKCTRL.CLKSEL
HFRCOEM23
HFRCODPLL
HFXO EM01GRPCCLK
clock EUSART1,2
HFRCODPLLRT
switch
HFXORT
FSRCO
CMU_EM01GRPCCLKCTRL.CLKSEL
HFRCOEM23
clock LESENSEHFCLK
LESENSE
FSRCO switch
CMU_LESENSEHFCLKCTRL.CLKSEL
LFXO
LFRCO
clock
ULFRCO WDOGnCLK
switch WDOGn
HCLK prescaler
/1024
LFXO
CMU_WDOGnCLKCTRL.CLKSEL
LFXO
LFRCO clock SYSRTCCLK
LFRCO SYSRTC
ULFRCO switch
ULFRCODUTY
CMU_SYSRTCCLKCTRL.CLKSEL
ULFRCO
LFXO
LFRCO clock EM4GRPACLK
BURTC
ULFRCO switch
· Available in EM0/EM1
LFXO
· Available in EM0/EM1/EM2
LFRCO clock LCDCLK
· Available in EM0/EM1/EM2/EM3 switch
LCD
ULFRCO
· Available in EM0/EM1/EM2/EM4
· Available in EM0/EM1/EM2/EM3/EM4
CMU_LCDCLKCTRL.CLKSEL
LFXO
LFRCO clock EM23GRPACLK
LETIMER0 LETIMER0CLK
ULFRCO switch
LESENSE LESENSECLK
CMU_EM23GRPACLKCTRL.CLKSEL
EM23GRPACLK
S0PRS clock PCNT0CLK
PCNT0
switch
PCNT0_S0IN
CMU_PCNT0CLKCTRL.CLKSEL
PCNT0_CFG.S0PRSEN
HFXO
LFXO clock DPLLREFCLK
DPLL
CLKIN0 switch
CMU_DPLLREFCLKCTRL.CLKSEL
HFRCOEM23
Availability of oscillators and clocks in Energy Modes: EM01GRPCCLK
clock
LFXO EUSART0CLK
· Available in EM0/EM1 switch EUSART0
LFRCO
· Available in EM0/EM1/EM2
· Available in EM0/EM1/EM2/EM3
· Available in EM0/EM1/EM2/EM4
CMU_EUSART0CLKCTRL.CLKSEL
· Available in EM0/EM1/EM2/EM3/EM4
HCLK
clock SYSTICKCLK
SYSTICK
EM23GRPACLK switch
SYSCFG_CFGSYSTIC.SYSTICEXTCLKEN
HFRCOEM23
EM01GRPACLK
clock
EM23GRPACLK VDAC0CLK
switch VDAC0
FSRCO
CMU_VDAC0CLKCTRL.CLKSEL
EM23GRPACLK VDAC0_REFRESH_CLK
SYSCLK is the selected System Clock. HCLK is an optionally prescaled version of SYSCLK. PCLK is an optionally prescaled version of
HCLK. The SYSCLK, and therefore HCLK and PCLK, can be driven by a high-frequency oscillator or be driven from a pin. The system
boots using the FSRCO oscillator, and switches to HFRCODPLL before user firmware execution begins. To change the selected clock
source, write to the CLKSEL bitfield in CMU_SYSCLKCTRL. If an invalid option is programmed into CLKSEL, FSRCO will be selected.
The SYSCLK is running in EM0 Active and EM1 Sleep and is automatically stopped in EM2 DeepSleep.
The prescaler setting can be changed dynamically and the new setting takes effect immediately. When switching to a higher frequency
oscillator source, prescaler setting should be adjusted before clock selection to prevent over clocking. For the same reason, when
switching to a lower frequency oscillator source, prescaler setting cannot be adjusted until the clock selection is made.
HCLK is a prescaled version of SYSCLK. This clock drives the AHB bus interface. HCLK can be prescaled by setting HCLKPRESC in
CMU_SYSCLKCTRL to DIV2 or DIV4. This prescales HCLK to all AHB bus clocks and is typically used to save energy in applications
where the system is not required to run at the highest frequency. The setting can be changed dynamically and the new setting takes
effect immediately. Some of the modules that are driven by this clock can be clock gated completely when not in use. This is done by
clearing the module enable (EN) bit in the module's EN register.
PCLK is a prescaled version of HCLK. This clock drives the APB bus interface. PCLK can be prescaled by setting PCLKPRESC in
CMU_SYSCLKCTRL to DIV2. This prescales PCLK to all APB bus clocks and is necessary to prevent PCLK from exceeding the maxi-
mum frequency when HCLK is operated at above 40 MHz. The setting can be changed dynamically and the new setting takes effect
immediately. Some of the peripherals that are driven by this clock can be clock gated completely when not in use. This is done by
clearing the module enable (EN) bit in the module's EN register.
LSPCLK is a prescaled version of PCLK. This clock drives the Low Speed APB bus interface. LSPCLK is always prescaled by two. This
prescales LSPCLK to all Low Speed APB bus clocks. Some of the peripherals that are driven by this clock can be clock gated com-
pletely when not in use. This is done by clearing the module enable (EN) bit in the module's EN register.
EM01GRPACLK is the selected clock for the Group A Peripherals operating in Energy Modes 0 or 1. These are typically high clock
frequency peripheral modules. There are several selectable sources for EM01GRPACLK: HFXO, HFRCODPLL, HFRCOEM23, and
FSRCO. In addition, the EM01GRPACLK can be disabled. The selection is configured using the CLKSEL field in
CMU_EM01GRPACLKCTRL.
Each High Frequency Peripheral that is clocked by EM01GRPACLK may have its own prescaler setting and enable bit. The prescaler
settings, if available, can be found in the peripheral's control registers. The enable bit can be found in the module's EN register.
EM01GRPCCLK is the selected clock for the Group C Peripherals operating in Energy Modes 0 or 1. These are typically high clock
frequency peripheral modules. There are several selectable sources for EM01GRPCCLK: HFXO, HFRCODPLL, HFRCOEM23,
FSRCO, HFRCODPLLRT, and HFXORT. In addition, the EM01GRPCCLK can be disabled. The selection is configured using the
CLKSEL field in CMU_EM01GRPCCLKCTRL.
Each High Frequency Peripheral that is clocked by EM01GRPCCLK may have its own prescaler setting and enable bit. The prescaler
settings, if available, can be found in the peripheral's control registers. The enable bit can be found in the module's EN register.
EM23GRPACLK is the selected clock for the Group A Peripherals operating down to Energy Modes 2 or 3. These are typically low
energy consumption peripheral modules. There are three selectable sources for EM23GRPACLK: LFRCO, LFXO and ULFRCO. In ad-
dition, the EM23GRPACLK can be disabled. The selection is configured using the CLKSEL field in CMU_EM23GRPACLKCTRL.
Each Low Energy Peripheral that is clocked by EM23GRPACLK may have its own prescaler setting and enable bit. The prescaler set-
tings, if available, can be found in the peripheral's control registers. The enable bit can be found in the module's EN register.
EM4GRPACLK is the selected clock for the Group A Peripherals operating down to Energy Mode 4. These are typically ultra low ener-
gy consumption peripheral modules. There are three selectable sources for EM4GRPACLK: LFRCO, LFXO and ULFRCO. In addition,
the EM4GRPACLK can be disabled. The selection is configured using the CLKSEL field in CMU_EM4GRPACLKCTRL.
Note: EM4GRPACLK is in a different power domain than EM23GRPACLK, which makes it available all the way down to EM4.
Each Low Energy Peripheral that is clocked by EM4GRPACLK may have its own prescaler setting and enable bit. The prescaler set-
tings, if available, can be found in the peripheral's control registers. The enable bit can be found in the module's EN register.
Peripherals each have an individual bus clock enable bit in the CMU_CLKEN0 or CMU_CLKEN1 registers. Disabling the bus clock to a
peripheral can save energy, even when that peripheral is not active.
IADCCLK is the selected clock for the IADC. The IADCCLK source may be selected from EM01GRPACLK, HFRCOEM23, or FSRCO.
In addition, the IADCCLK can be disabled. The selection is configured using the CLKSEL field in CMU_IADCCLKCTRL.
Note: When using a Timer as the synchronous trigger for IADC conversion, EM01GRPACLK must be selected, because Timers run
from EM01GRPACLK.
IADC has its own prescaler setting and enable bit. The prescaler settings can be found in the IADC's control registers. The enable bit
can be found in the IADC's EN register.
Whichever clock source is selected as the IADC clock via the CLKSEL bitfield in the CMU_IADCCLKCTRL register, this clock will be-
come active automatically when needed. The IADC can automatically start and stop it.
VDACnCLK is the selected clock for VDACn. The VDACnCLK source may be selected from EM01GRPACLK, EM23GRPACLK,
HFRCOEM23, or FSRCO. In addition, the VDACnCLK can be disabled. The selection is configured using the CLKSEL field in
CMU_VDACnCLKCTRL.
Note: When using a Timer as the synchronous trigger for VDACn conversion, EM01GRPACLK must be selected, because Timers run
from EM01GRPACLK.
VDACn has its own prescaler setting and enable bit. The prescaler settings can be found in the VDAC's control registers. The enable
bit can be found in the VDAC's EN register.
Whichever clock source is selected as the VDACn clock via the CLKSEL bitfield in the CMU_VDACnCLKCTRL register, this clock will
become active automatically when needed. The VDACn can automatically start and stop it.
LESENSEHFCLK is the selected high-frequency clock for the LESENSE peripheral. The selection options are the HFRCOEM23 oscilla-
tor or the FSRCO oscillator. The high-frequency clock source is used for faster timing in certain LESENSE configurations. LESEN-
SEHFCLK is selected via the CLKSEL field in CMU_LESENSEHFCLKCTRL. The low-frequency clock for LESENSE is derived from
EM23GRPACLK.
SYSRTCCLK is the selected clock for the SYSRTC peripheral. This clock tree can be clocked from any of the low-frequency oscillators:
LFXO, LFRCO, or ULFRCO. SYSRTCCLK is selected via the CLKSEL field in CMU_SYSRTCCLKCTRL.
LCDCLK is the selected clock for the LCD peripheral. This clock tree can be clocked from any of the low-frequency oscillators: LFXO,
LFRCO, or ULFRCO. LCDCLK is selected via the CLKSEL field in CMU_LCDCLKCTRL.
PCNT0CLK is the selected clock for the PCNT peripheral. PCNT can be configured to clock from its S0 input signal, or the
EM23GRPACLK, selectable by the CLKSEL field in CMU_PCNT0CLKCTRL. Note that when configured to clock from the S0 input, the
clock can further be selected from the direct S0 input pin, or from a PRS channel. Selection of the S0 input is determined by S0PRSEN
in PCNT_CFG.
EUSART0CLK is the selected clock for the EUSART0 peripheral, and can choose between EM01GRPACLK, HFRCOEM23, LFXO, and
LFRCO. EUSART0CLK is selected via the CLKSEL field in CMU_EUSART0CLKCTRL. When operating EUSART0 as a high-speed
UART or SPI main interface (EM0/1 only), EM01GRPACLK or HFRCOEM23 must be selected. To operate as a low-energy UART in
EM0, EM1, or EM2, LFXO or LFRCO must be selected. To operate as a SPI secondary interface, EM01GRPACLK or HFRCOEM23
should be selected.
The CMU scales the clock used for debug trace via the PRESC field in the CMU_TRACECLKCTRL register. The debug trace clock is
limited to 40 MHz maximum. Therefore, if the SYSCLK is 40 MHz or less, the default DIV1 setting may be used. When SYSCLK is
above 40 MHz, use DIV2 to avoid data pump overflow. The selected debug trace clock will be used to run the Cortex®-M33 trace logic.
Note that this register should be configured properly before enabling ETM.
The Watchdog Timer (WDOGn) can be configured to use one of four different clock sources: LFRCO, LFXO, ULFRCO, or
HCLKDIV1024. Select option HCLKDIV1024 to track Watchdog timeout with CPU clock speed.
The FSRCO oscillator is a fixed frequency (20 MHz), low energy oscillator with extremely short start-up time. Therefore, this oscillator is
chosen by hardware as the clock source for SYSCLK when the device starts up (e.g. after reset).
Software can switch between the different clock sources at run-time. For example, when the HFRCODPLL is the clock source, software
can switch to HFXO by writing the field CLKSEL in the CMU_SYSCLKCTRL register. See Figure 7.5 CMU Switching From HFRCO to
HFXO Before HFXO is Ready on page 146 for a description of the sequence of events for this specific operation.
When switching the SYSCLK to HFXO via the CLKSEL bitfield in CMU_SYSCLKCTRL, HFXO is automatically started. Switching to an
oscillator that is not ready yet, the SYSCLK will stop for the duration of the oscillator start-up time. This effectively stalls the Core Mod-
ules. It is possible to avoid this by first enabling the target oscillator (e.g. HFXO) and then waiting for that oscillator to become ready
before switching the clock source. This way, the system continues to run on the HFRCO until the target oscillator (e.g. HFXO) is ready
and provides a reliable clock. This sequence of events is shown in Figure 7.6 CMU Switching From HFRCO to HFXO After HFXO is
Ready on page 147.
Generally, all oscillators have a separate flag that is set when the oscillator is ready. This flag can also be configured to generate an
interrupt.
CMU_SYSCLKCTRL.CLKSEL 02 03
HFRCO_CTRL.FORCEEN
control
HFRCO_CTRL.DISONDEMAND
HFXO_CTRL.FORCEEN
HFXO_CTRL.DISONDEMAND
HFRCO_STATUS.RDY
HFRCO_STATUS.ENS
status
HFXO_STATUS.RDY
HFXO_STATUS.ENS
BUSCLK
clocks
HFRCO
HFXO
Figure 7.5. CMU Switching From HFRCO to HFXO Before HFXO is Ready
CMU_SYSCLKCTRL.CLKSEL 02 03
HFRCO_CTRL.FORCEEN
control
HFRCO_CTRL.DISONDEMAND
HFXO_CTRL.FORCEEN
HFXO_CTRL.DISONDEMAND
HFRCO_STATUS.RDY
HFRCO_STATUS.ENS
status
HFXO_STATUS.RDY
HFXO_STATUS.ENS
BUSCLK
clocks
HFRCO
HFXO
Figure 7.6. CMU Switching From HFRCO to HFXO After HFXO is Ready
Switching clock source for various clock switches is done by setting the CLKSEL bitfields in CMU_*CLKCTRL. To ensure no stalls in
the peripherals, the clock source should be ready before switching to it.
Note: To save energy, remember to disable all clock switches and/or module enable bits when not in use.
The CMU has built-in hardware support to efficiently calibrate RC oscillators (LFRCO, HFRCODPLL, HFRCOEM23) at run-time or
measure the timing of other periodic signals routed via PRS, see Figure 7.7 Hardware Support for RC Oscillator Calibration on page
148 for an illustration of this circuit.
The concept is to select a reference and compare the RC frequency or PRS timing with the reference frequency. When the calibration
circuit is started, one down-counter running on a selectable clock (DOWNSEL in CMU_CALCTRL) and one up-counter running on a
selectable clock (UPSEL in CMU_CALCTRL) are started simultaneously. Reference clocks may also be routed through the PRS chan-
nels via the CALUP and CALDN consumer inputs. The top value for the down-counter must be written (CALTOP in CMU_CALCTRL)
before calibration is started. The down-counter counts for CALTOP + 1 cycles. When the down-counter has reached 0, the up-counter
is sampled and the CALRDY interrupt flag in the IF register is set. If CONT in CMU_CALCTRL is cleared, the counters are stopped
after finishing the ongoing calibration. If continuous mode is selected by setting CONT in CMU_CALCTRL, the down-counter reloads
the top value and continues counting, while the up-counter restarts from 0.
Software can then read out the sampled up-counter value from CMU_CALCNT. The up-counter has counted (the sampled value)+ 1
cycles. The ratio between the reference and the oscillator subject to the calibration can easily be found using (the top value)+1 and (the
sampled value)+1. Overflows of the up-counter will not occur. If the up-counter reaches its top value before the down-counter reaches
0, the up-counter stays at its top value. Calibration can be started and stopped by writing CALSTART and CALSTOP bitfields in
CMU_CALCMD, respectively. With this hardware support, it is simple to write efficient software calibration algorithms.
DOWNCLK Domain
Reload down-counter with
top-value in continuous
CMU_CALCTRL.DOWNSEL
mode.
ULFRCO
·
·
DOWNCLK
Write top-value using
·
20-bit down-counter CALTOP CMU_CALCTRL before
starting calibration.
PRS
HCLK =0?
Take snapshot of up-counter
in up-counter bufffer. If in
continuous mode, restart up-
counter from 0.
UPCLK Domain SYNC
CMU_CALCTRL.UPSEL
ULFRCO
·
UPCLK 20-bit up-counter
·
20-bit up-counter
· buffer
PRS
SYNC SYNC
PCLK Domain
The counter operation for single and continuous mode are shown in Figure 7.8 Single Calibration (CONT=0) on page 149 and Figure
7.9 Continuous Calibration (CONT=1) on page 150 respectively.
Up-counter
CALTOP
Down-counter
Up-counter sampled and CALRDY interrupt Up-counter sampled and CALRDY interrupt
flag set. flag set.
Sampled value available in CMU_CALCNT. Sampled value available in CMU_CALCNT.
Up-counter
CALTOP
Down-counter
Calibration Started
The availability of oscillators and system clocks depends on the chosen energy mode. By default, the high frequency oscillators and
high frequency clocks are available down to EM1 Sleep. From EM2 DeepSleep onwards these oscillators and clocks are normally off,
although special cases exist as summarized in Table 7.1 Oscillator and clock availability in Energy Modes on page 151. The CMU
figures in 7.3 Functional Description also indicate which oscillators and clocks can be used in what energy modes.
The low frequency oscillators (LFRCO and LFXO) are available in all energy modes except in EM3 Stop when they are off by definition.
By default, these oscillators are also off in EM4 Shutoff. The LFXO or LFRCO can be requested in EM4 as needed. The ultra low fre-
quency oscillator (ULFRCO) is on in all energy modes, except for EM4 Shutoff, but it can be requested on in that state as well if nee-
ded. The low frequency clocks are in various power domains and therefore their availability not only depends on the chosen clock
source, but also on the chosen energy mode as indicated in Table 7.1 Oscillator and clock availability in Energy Modes on page 151.
HFRCOEM23 On 1 On 2 On 2 Off
ULFRCO On On On On 3
EM4GRPACLK On 1 On 1 On 4 On 3
The CMU has up to three CLKOUTn signals that can be routed to the PRS or GPIO. The selections for CLKOUTn are controlled using
the CLKOUTSELn bitfields in CMU_EXPORTCLKCTRL (CLKOUTSEL0 controls CLKOUT0, for example).
• HCLK and EXPORTCLK. The HCLK is the high frequency clock for AHB. The EXPORTCLK is a prescaled version of SYSCLK as
controlled by the PRESC bitfield in the CMU_EXPORTCLKCTRL register.
• The qualified clock from any of the on-chip oscillators. A qualified clock will not have any glitches or skewed duty-cycle during start-
up. For the LFXO and HFXO, correct configuration of the TIMEOUT bitfield(s) in LFXO_CFG and HFXO_XTALCFG, respectively is
required to guarantee a properly qualified clock.
HCLK will only have a 50-50 duty cycle when HCLKPRESC in CMU_SYSCLKCTRL is DIV1. EXPORTCLK will only be 50-50 duty cycle
when the selected division factor is even.
The CLKOUTn signals may be routed to GPIO via the DBUS as CMU.CLKOUTn using controls in the GPIO registers. The required
output pins must be enabled in the GPIO_CMU_ROUTEEN register and the pin locations can be configured in the
GPIO_CMU_CLKOUTnROUTE registers.
The CLKOUTn signals can also be used as PRS producers (see 12.3.3 Producers for more detail on PRS producers). CLKOUTn sig-
nals used as PRS producers may be simultaneously routed to GPIO, but this is not required to use CLKOUTn as a PRS producer.
It is possible to configure the CMU to input a clock from the CMU_CLKI0. This clock can be selected to drive SYSCLK and DPLL refer-
ence using CMU_SYSCLKCTRL.CLKSEL and CMU_DPLLREFCLKCTRL.CLKSEL respectively. The required input pin locations can
be configured in the GPIO_CMU_CLKIN0ROUTE register.
7.3.7 Interrupts
The interrupts generated by the CMU module are combined into one interrupt vector. If CMU interrupts are enabled, an interrupt will be
made if one or more of the interrupt flags in CMU_IF and their corresponding bits in CMU_IEN are set.
7.3.8 Protection
It is possible to lock the control and command registers to prevent unintended software writes to critical clock settings. This is controlled
by the CMU_LOCK register.
The WDOGCLKCTRL registers are separately locked by CMU_WDOGLOCK register. This is to prevent EM3 Stop mode from disabling
the watch dog clocks inadvertently.
In addition to software locks, hardware locks are implemented to prevent metastability. CMU_CALCTRL is locked by hardware when
calibration is started by CMU_CALCMD.CALSTART. CMU_DPLLREFCLKCTRL is locked by hardware when DPLL is enabled via
DPLL_EN.EN. Because these switches are not glitch-less, clock selection must be configured before enabling the operation and cannot
be changed during operation.
0x000
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
0x6
Reset
Access
IPVERSION R
Name
0x008 0x0 31
0x0 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
0x0 0
Reset
Access
R
WDOGLOCK R
R
CALRDY
Name
LOCK
29:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 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
0x93F7
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock registers from editing. Write the unlock code to unlock.
0x014
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
0x5257
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock registers from editing. Write the unlock code to unlock.
0x020 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
RW 0x0 1
CALRDY RW 0x0 0
Reset
Access
CALOF
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when calibration overflow has occurred (i.e. if a new calibration completes before CMU_CALSTATUS has been read)
0x024
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
RW 0x0 1
CALRDY RW 0x0 0
Reset
Access
CALOF
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x050 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
W(nB) 0x0 1
CALSTART W(nB) 0x0 0
Reset
Access
CALSTOP
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Starts the calibration, effectively loading the CMU_CALCTRL.CALCNT into the down-counter and start decrementing.
0x054 31
30
29
28
27
26
25
24
RW 0x0 23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DOWNSEL RW 0x0
RW 0x0
RW 0x0
Reset
Access
CALTOP
UPSEL
Name
CONT
Bit Name Reset Access Description
Selects clock source for the calibration down-counter. Changing this while calibration is running results in bus fault..
Selects clock source for the calibration up-counter. Changing this while calibration is running results in bus fault.
Set this bit to enable continuous calibration. Changing this while calibration is running results in bus fault.
22:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write top value before calibration. Changing this while calibration is running results in bus fault.
0x058
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
0x0
Reset
Access
CALCNT R
Name
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Read calibration result when Calibration Ready flag has been set.
0x064 RW 0x0 31
RW 0x0 30
RW 0x0 29
RW 0x0 28
RW 0x0 27
RW 0x0 26
RW 0x0 25
RW 0x0 24
RW 0x0 23
RW 0x0 22
RW 0x0 21
RW 0x0 20
HFRCOEM23 RW 0x0 19
RW 0x0 18
RW 0x0 17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
2
RW 0x0 1
RW 0x0 0
Reset
Access
LDMAXBAR
LETIMER0
AMUXCP0
SYSRTC0
LESENSE
ULFRCO
HFRCO0
SYSCFG
USART0
WDOG0
Name
TIMER4
TIMER3
TIMER2
TIMER1
TIMER0
BURAM
GPCRC
FSRCO
BURTC
LFRCO
HFXO0
DPLL0
IADC0
DCDC
LDMA
LFXO
GPIO
I2C1
I2C0
PRS
2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x068 31
30
RW 0x0 29
28
RW 0x0 27
26
25
RW 0x0 24
RW 0x0 23
RW 0x0 22
RW 0x0 21
RW 0x0 20
RW 0x0 19
RW 0x0 18
RW 0x0 17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
11
SEMAILBOXHOST RW 0x0 10
9
RW 0x0 8
7
6
5
4
3
2
1
0
Reset
Access
HOSTMAILBOX
Name
KEYSCAN
EUSART2
EUSART1
EUSART0
ICACHE0
WDOG1
ACMP1
ACMP0
VDAC0
PCNT0
DMEM
MSC
SMU
MVP
LCD
Bit Name Reset Access Description
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
26:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x070 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
PCLKPRESC RW 0x0 10
9
8
7
6
5
4
3
2
RW 0x1 1
0
HCLKPRESC RW 0x0
Reset
Access
CLKSEL
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
9:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x080 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 0x0
CLKSEL RW 0x1
Reset
Access
PRESC
Name
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Clock prescaler for the TRACECLKIN of TPIU. Changing this while the TRCENA bit is set in the ARM M33 Debug Ex-
ception and Monitor Control Register (DEMCR) will result in a bus fault.
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Selects clock source for the TRACECLKIN of TPIU. Changing this while the TRCENA bit is set in the ARM M33 Debug
Exception and Monitor Control Register (DEMCR) will result in a bus fault.
0x090 31
30
29
28
27
RW 0x0 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
CLKOUTSEL2 RW 0x0
CLKOUTSEL1 RW 0x0
CLKOUTSEL0 RW 0x0
Reset
Access
Name
PRESC
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x100 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
CLKSEL RW 0x0
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Selects the clock source for DPLL reference. Changing this while DPLL is enabled results in bus fault.
0x120 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
CLKSEL RW 0x1 1
0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x128 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
CLKSEL RW 0x1 1
0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x140 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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x160
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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x180 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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Selects the clock source for for IADC. EM01GRPACLK should never be selected as clock source for IADC when disa-
bling the EM01GRACLK (e.g. because of EM23 entry).
0x200
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
CLKSEL RW 0x1 1
0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x208 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
CLKSEL RW 0x1 1
0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x220 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
CLKSEL RW 0x1 1
0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit controls which clock is used for EUSART0. EM01GRPCCLK should never be selected as clock source when dis-
abling the EM01GRCCLK (e.g. because of EM23 entry).
0x240 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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x250
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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x260 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
CLKSEL RW 0x1 1
0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit controls which clock is used for VDAC. EM01GRPACLK should never be selected as clock source when disa-
bling the EM01GRACLK (e.g. because of EM23 entry).
0x270 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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x290
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
CLKSEL RW 0x1
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
8. Oscillators
Quick Facts
What?
0 1 2 3 4
The EFM32PG28 has a wide range of high frequen-
cy and low frequency oscillators.
Why?
How?
8.1 Introduction
The EFM32PG28 has several oscillators. This chapter contains a detailed function description and register descriptions for each oscilla-
tor. The CMU chapter includes information on how to select clock sources. Each oscillator may require some initial configuration or
calibration before being enabled. The CMU supports clock on demand and can enable and disable oscillators. Therefore, it is important
to properly configure each oscillator before selecting it as a clock source in the CMU.
8.2.1 Introduction
The High Frequency Crystal Oscillator (HFXO) uses an external high frequency crystal and provides a sequencer for starting up the
crystal safely and reliably, while minimize energy consumption. An external sine wave clock source can also be used in the absence of
a crystal.
8.2.2 Features
While the HFXO supports on-demand clocking, it is generally recommended to manually manage the HFXO, at least initially, because it
requires software configuration and has a long start-up time. Software can set the FORCEEN to start HFXO and keep it enabled even if
it is not selected as a clock source.
However, once started and before EM2 entry, switching the HFXO to on-demand mode may be desirable. This allows the MCU to enter
EM2 and then restart the HFXO automatically upon EM2 exit. (During EM1P the HFXO can be conditionally started, depending on the
wake-up trigger source.)
The HFXO can be enabled and disabled via both hardware and software mechanisms. Enabling via software is done by setting the
FORCEEN bit in the HFXO_CTRL register. Disabling via software is done by setting the DISONDEMAND bit and clearing FORCEEN
bit in the HFXO_CTRL register. The hardware controlled on-demand mode is enabled by clearing the FORCEEN and DISONDEMAND
bits in the HFXO_CTRL register. Once configured the on-demand mode hardware can autonomously start and stop the HFXO based
on various peripheral clock requests in combination with clock switch selections in the CMU. The HFXO is automatically stopped when
entering EM2, EM3, or EM4. Hardware can also stop the HFXO via hardware in response to change in peripheral requests and clock
switch selections in the CMU.
The start-up time differs for different crystals and the HFXO has a configurable time-out to accommodate each crystal type. Software
configures the timeout by setting the various TIMEOUT bit fields of the HFXO_XTALCFG register. The time-out delays the assertion of
the RDY signal for HFXO. The programmed timeout should allow enough time for the oscillator to stabilize. The time-out can be opti-
mized for the chosen crystal used in the application.
The start-up behavior of the HFXO also depends on how and how long the HFXO is disabled.
8.2.3.3 Configuration
The High Frequency Crystal Oscillator needs to be configured to ensure safe start-up for the given crystal. Refer to the Device Data
sheet and application notes for guidelines in selecting correct components and crystals as well as for configuration trade-offs.
The HFXO crystal is connected to the HFXTAL_I/HFXTAL_O pins as shown in Figure 8.1 HFXO Pin Connection on page 183.
EFx32
HFXTAL_I
HFXTAL_O
CTUNE CTUNE
CL1 CL2
Upon enabling the HFXO, a hardware state machine sequentially applies the configurable start-up state, intermediate start-up state,
and steady state control settings from the HFXO_XTALCFG and HFXO_XTALCTRL registers. After reaching the steady operation state
of the HFXO, it is recommended to further optimize current consumption using the Core Bias Optimization Algorithm to trade off noise
and current consumption.
Refer to AN0016.2 for more information on settings for different crystals. Write the configuration values, which depends on the crystal's
CL, RESR and oscillation frequency, into HFXO_XTALCFG and HFXO_XTALCTRL registers.
• COREBIASSTARTUP (HFXO_XTALCFG) - current setting applied at start-up time
• COREBIASSTARTUPI (HFXO_XTALCFG) - current setting applied at intermediate start-up time
• COREBIASANA (HFXO_XTALCTRL) - current setting applied at steady state
• CTUNEXISTARTUP (HFXO_XTALCFG) - tuning cap setting for XI applied at start-up time
• CTUNEXIANA (HFXO_XTALCTRL) - tuning cap setting for XI applied at steady state
• CTUNEXOSTARTUP (HFXO_XTALCFG) - tuning cap setting for XO applied at start-up time
• CTUNEXOANA (HFXO_XTALCTRL) - tuning cap setting for XO applied at steady state
• CTUNEFIXANA (HFXO_XTALCTRL) - fixed tuning cap setting applied throughout
• TIMEOUTSTEADY (HFXO_XTALCFG) - duration for the steady state settling time
• TIMEOUTCBLSB (HFXO_XTALCFG) - duration for the optimization settling after each step
All HFXO configuration needs to be performed prior to enabling the HFXO, whether via software by setting FORCEEN bit field, or allow-
ing hardware request by clearing DISONDEMAND bit field in the HFXO_CTRL register.
By default, the HFXO is started in crystal mode, but it is possible to connect an active external sine or clipped sine wave clock source to
the HFXTAL_I pin of the HFXO. By configuring the MODE field in HFXO_CFG to EXTCLK, the HFXO can be bypassed and the source
clock can be provided through the HFXTAL_I pin.
The ENS flag in the HFXO_STATUS indicates if the HFXO has been successfully enabled. Once the HFXO oscillation amplitude has
exceeded the start-up threshold and intermediate start-up threshold, the steady state settling timeout begins. When the steady state
timeout has expired, the HFXO is ready for use as indicated by the RDY flag in the HFXO_STATUS. Once Core Bias Optimization is
enabled, the COREBIASOPTRDY flag in the CMU_STATUS register indicates when the optimization is ready. It is advised to wait for
this flag before using the HFXO, because optimization can cause minor disturbance to the oscillator frequency.
Software can request to enable the HFXO by setting the HFXO_CTRL.FORCEEN bit field. The HFXO can also optionally be configured
via the HFXO_CTRL.DISONDEMAND to shut down when no hardware request is present. This is known as on-demand clocking and
allows the oscillator to be controlled without any software intervention. Any hardware request for HFXO is indicated in the HWREQ bit
field of the HFXO_STATUS register. This request enables the HFXO, provided that DISONDEMAND bit field is cleared in HFXO_CTRL
register. The HFXO is only disabled by hardware upon EM2, EM3 or EM4 entry.
The HFXO analog circuitry can optionally continue operating with the clock output shut off when the HFXO is disabled. This is config-
ured by setting the KEEPWARM bit in HFXO_STATUS.
8.2.3.6 Interrupts
RDYIF and COREBIASOPTRDYIF are interrupt flags as well as status flags. This allows software flexibility to implement interrupt serv-
ice routine or polling loop for these events. When steady state timeout has exceeded, sticky RDYIF is set until it is cleared by software.
If optimization is enabled, sticky COREBIASOPTRDYIF is set when optimization is completed successfully. However, if optimization
fails to complete, sticky COREBIASOPTERRIF is set, and the HFXO control state machine stays in the error state until the oscillator is
disabled. Similarly, if HFXO fails to start-up, meaning it has not reached the steady state, sticky DNSERRIF is set. The HFXO control
state machine stays in the error state until the oscillator is disabled.
8.2.3.7 Protection
It is possible to lock the control registers, configuration registers, and command register to prevent unintended software writes to critical
clock settings. This is controlled by the HFXO_LOCK register. A LOCK bit is available in HFXO_STATUS register. Furthermore, these
registers are locked automatically by hardware to prevent clock domain crossing malfunction. To gain access to these registers while
oscillator is in steady operation state, set FORCEEN to 1, then set DISONDEMAND to 1 in the HFXO_CTRL register. A FSMLOCK bit
in HFXO_STATUS register indicates when it is safe for software to update control registers and configuration registers. When software
is finished with updates, put the oscillator back to on-demand mode by clearing DISONDEMAND to 0, followed by clearing FORCEEN
to 0 in the HFXO_CTRL register. While DISONDEMAND is 0, FSMLOCK is always set, even if hardware is not requesting. This is to
prevent a race condition between software access and hardware lock.
8.2.3.8 Tuning
While the oscillator is running in steady operation state, it may be desirable to change control settings. One example is frequency tuning
by modifying the tuning capacitance via CTUNEXIANA and CTUNEXOANA fields in the HFXO_XTALCTRL register. When tuning, care
should be taken to make small changes to the CTUNE registers. Ideally, change the CTUNE registers by one LSB at a time and alter-
nate between the XI and XO registers. Sufficient wait time for settling, on the order of TIMEOUTSTEADY, should pass before new fre-
quency measurement is taken.
0x000
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
0x3
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x010 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 0x20
COREBIASSTARTUPI RW 0x20
0xB
0xB
0x0
0x0
Reset
RW
RW
RW
RW
Access
COREBIASSTARTUP
CTUNEXOSTARTUP
CTUNEXISTARTUP
TIMEOUTSTEADY
TIMEOUTCBLSB
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
wait duration for the COREBIAS change to settle out, used at each step of COREBIAS optimization algorithm
0 T8US The core bias LSB change timeout is set to 8 us minimum. The
maximum can be +40%.
1 T20US The core bias LSB change timeout is set to 20 us minimum. The
maximum can be +40%.
2 T41US The core bias LSB change timeout is set to 41 us minimum. The
maximum can be +40%.
3 T62US The core bias LSB change timeout is set to 62 us minimum. The
maximum can be +40%.
4 T83US The core bias LSB change timeout is set to 83 us minimum. The
maximum can be +40%.
5 T104US The core bias LSB change timeout is set to 104 us minimum.
The maximum can be +40%.
6 T125US The core bias LSB change timeout is set to 125 us minimum.
The maximum can be +40%.
7 T166US The core bias LSB change timeout is set to 166 us minimum.
The maximum can be +40%.
8 T208US The core bias LSB change timeout is set to 208 us minimum.
The maximum can be +40%.
9 T250US The core bias LSB change timeout is set to 250 us minimum.
The maximum can be +40%.
10 T333US The core bias LSB change timeout is set to 333 us minimum.
The maximum can be +40%.
11 T416US The core bias LSB change timeout is set to 416 us minimum.
The maximum can be +40%.
12 T833US The core bias LSB change timeout is set to 833 us minimum.
The maximum can be +40%.
13 T1250US The core bias LSB change timeout is set to 1250 us minimum.
The maximum can be +40%.
14 T2083US The core bias LSB change timeout is set to 2083 us minimum.
The maximum can be +40%.
15 T3750US The core bias LSB change timeout is set to 3750 us minimum.
The maximum can be +40%.
3 T83US The steady state timeout is set to 125 us minimum. The maxi-
mum can be +40%.
4 T125US The steady state timeout is set to 166 us minimum. The maxi-
mum can be +40%.
5 T166US The steady state timeout is set to 208 us minimum. The maxi-
mum can be +40%.
6 T208US The steady state timeout is set to 250 us minimum. The maxi-
mum can be +40%.
7 T250US The steady state timeout is set to 333 us minimum. The maxi-
mum can be +40%.
8 T333US The steady state timeout is set to 416 us minimum. The maxi-
mum can be +40%.
9 T416US The steady state timeout is set to 500 us minimum. The maxi-
mum can be +40%.
10 T500US The steady state timeout is set to 666 us minimum. The maxi-
mum can be +40%.
11 T666US The steady state timeout is set to 833 us minimum. The maxi-
mum can be +40%.
12 T833US The steady state timeout is set to 1666 us minimum. The maxi-
mum can be +40%.
13 T1666US The steady state timeout is set to 2500 us minimum. The maxi-
mum can be +40%.
14 T2500US The steady state timeout is set to 4166 us minimum. The maxi-
mum can be +40%.
15 T4166US The steady state timeout is set to 7500 us minimum. The maxi-
mum can be +40%.
0x018 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 0x3C
RW 0x3C
RW 0x3C
0x0
0x0
0x3
Reset
SKIPCOREBIASOPT RW
RW
RW
Access
COREDGENANA
COREBIASANA
CTUNEFIXANA
CTUNEXOANA
CTUNEXIANA
Name
Set to skip the core bias current optimization algorithm at next startup. Reuse the value stored in COREBIASANA. At the
successful completion of core bias current optimization algorithm, hardware sets this bit to skip optimization during sub-
sequent startup.
30:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x01C
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
CTUNEXIBUFOUTANA RW 0x3C
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Tuning Capacitance on XI when BUFOUT is ON. Approximately 80fF per step. 0 is min. 255 is max.
0x020 31
30
29
RW 0x1 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
SQBUFSCHTRGANA RW 0x0 3
RW 0x0 2
1
0
RW 0x0
Reset
Access
FORCELFTIMEOUT
ENXIDCBIASANA
Name
MODE
Bit Name Reset Access Description
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
For deterministic timeout, clear this bit and configure PRS to trigger based on 32kHz timer (e.g., RTC).
27:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x028 31
30
29
28
27
DISONDEMANDBUFOUT RW 0x1 26
RW 0x1 25
RW 0x1 24
23
22
21
20
19
RW 0x0 18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
RW 0x1 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
1
RW 0x0 0
RW 0x0
RW 0x0
Reset
Access
FORCEXO2GNDANA
DISONDEMANDPRS
FORCEXI2GNDANA
FORCECTUNEMAX
FORCEENBUFOUT
PRSSTATUSSEL1
PRSSTATUSSEL0
EM23ONDEMAND
BUFOUTFREEZE
DISONDEMAND
FORCEENPRS
Name
KEEPWARM
FORCEEN
Bit Name Reset Access Description
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When oscillator is disabled, force tuning capacitor to maximum value. Set this bit to 1 in XTAL mode to prevent overshoot
upon disable.
Set to enable grounding of XI pin. Do not enable if MODE=EXTCLK and an external source is supplied.
Use this bit to prevent EM23 shutdown of the module’s power domain upon EM23 entry. Set this bit to 1 if on-demand
requests are supposed to be honored while in EM23.
Upon disable, if this bit is set, analog oscillator will keep running, while clock output is shutoff. Clearing this bit has no
effect until the next disable event.
1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x040
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
VTRTRIMANA RW 0x8
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Change this field to set bias levels between 200uA and 400uA. bias_current = VTRTCANA * VTRTRIMANA * scale_fac-
tor. The default setting corresponds to 200uA.
RW 0x4
RW 0x3
RW 0x1
RW 0x5
Reset
Access
PEAKDETTHRESANA
TIMEOUTSTARTUP
TIMEOUTCTUNE
XOUTBIASANA
Name
XOUTGMANA
XOUTCFANA
Bit Name Reset Access Description
If set, BUFOUT does not start until timeout expires. This prevents waste of power if BUFOUT is ready too early.
30:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Wait duration for the typical oscillator startup sequence to prevent BUFOUT starting too early, used when MINIMUM-
STARTUPDELAY is set.
Wait duration for the CTUNE change to settle out, used when CTUNE changes as result of enabling BUFOUT.
11 T104US The tuning cap change timeout is set to 104 us minimum. The
maximum can be +40%.
12 T208US The tuning cap change timeout is set to 208 us minimum. The
maximum can be +40%.
13 T313US The tuning cap change timeout is set to 313 us minimum. The
maximum can be +40%.
14 T521US The tuning cap change timeout is set to 521 us minimum. The
maximum can be +40%.
15 T938US The tuning cap change timeout is set to 938 us minimum. The
maximum can be +40%.
0 V105MV
1 V132MV
2 V157MV
3 V184MV
4 V210MV
5 V236MV
6 V262MV
7 V289MV
8 V315MV
9 V341MV
10 V367MV
11 V394MV
12 V420MV
13 V446MV
14 V472MV
15 V499MV
Buffer gain.
0x050 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
COREBIASOPT W(nB) 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
On devices with a radio, this bit is used to start the core bias current optimization algorithm and run it one time. Optimiza-
tion should be executed if the temperature changes by more than 40 degC. Do not run this command while the radio is in
RX or TX modes. Do not issue this command more than once until COREBIASOPTRDY is asserted, or the previous
command may be cancelled.
0x058 0x0 31
0x0 30
29
28
27
26
25
24
23
22
0x0 21
0x0 20
0x0 19
18
0x0 17
0x0 16
0x0 15
14
13
12
11
10
9
8
7
6
5
4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
R
R
R
R
R
R
R
COREBIASOPTRDY R
R
BUFOUTFROZEN
BUFOUTHWREQ
BUFOUTRDY
PRSHWREQ
SYNCBUSY
Name
PRSRDY
ISWARM
HWREQ
LOCK
RDY
ENS
Bit Name Reset Access Description
29:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Oscillator is currently kept in warm state. Re-enable from warm state skips startup sequence.
18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Oscillator is enabled.
14:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x070 RW 0x0 31
RW 0x0 30
RW 0x0 29
RW 0x0 28
BUFOUTFREEZEERR RW 0x0 27
26
25
24
23
22
RW 0x0 21
RW 0x0 20
19
18
17
16
RW 0x0 15
14
13
12
11
10
9
8
7
6
5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
COREBIASOPTERR
COREBIASOPTRDY
BUFOUTDNSERR
BUFOUTFROZEN
LFTIMEOUTERR
BUFOUTERR
BUFOUTRDY
Name
DNSERR
PRSERR
PRSRDY
RDY
Bit Name Reset Access Description
Low frequency timeout triggers before the steady state timeout triggers.
BUFOUTFREEZE should not be set when HWREQ is low as this can prevent service to companion chip indefinitely.
26:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
14:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x074 RW 0x0 31
RW 0x0 30
RW 0x0 29
RW 0x0 28
BUFOUTFREEZEERR RW 0x0 27
26
25
24
23
22
RW 0x0 21
RW 0x0 20
19
18
17
16
RW 0x0 15
14
13
12
11
10
9
8
7
6
5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
COREBIASOPTERR
COREBIASOPTRDY
BUFOUTDNSERR
BUFOUTFROZEN
LFTIMEOUTERR
BUFOUTERR
BUFOUTRDY
Name
DNSERR
PRSERR
PRSRDY
RDY
Bit Name Reset Access Description
Low frequency timeout triggers before the steady state timeout triggers.
BUFOUTFREEZE should not be set when HWREQ is low as this can prevent service to companion chip indefinitely.
26:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
14:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x080
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
0x580E
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock registers from editing. Write the unlock code to unlock.
8.3.1 Introduction
8.3.2 Features
• 1 MHz - 80 MHz High Frequency RC Oscillator with DPLL working in EM01 (HFRCO0/HFRCODPLL)
• 1 MHz - 40 MHz High Frequency RC Oscillator working in EM23 (HFRCOEM23)
• Low start-up time
• Run-time band change or tuning
8.3.3.1 Start-up
The HFRCO starts up quickly in a few micro-seconds (refer to device data sheet for start-up time specifications.) After the start-up time,
the RDY status bit will go high and the RDY interrupt will be triggered. It can take another two clock cycles for the clock to propagate
through the CMU before the clock is seen by peripherals.
Software can request to enable the HFRCO by setting the HFRCO_CTRL.FORCEEN bit field. The HFRCO can also optionally be con-
figured via the HFRCO_CTRL.DISONDEMAND to shut down when no hardware request is present. This is known as on-demand clock-
ing and allows the oscillator to be controlled without any software intervention. This means that HFRCO receives a request for clock
from the CMU whenever the oscillator clock is needed. These requests can come at any time from any power domain (depending on
the which peripheral is requesting the clock.)
The HFRCOEM23 can be used by certain peripherals as an on-demand, high-speed clock source in energy modes down to EM3. To
enable operation as an on-demand clock in EM2 and EM3, the EM23ONDEMAND bit in the CTRL register should be set to 1. Setting
this bit ensures that the associated PD0 power domain will remain active and allow the oscillator to honor the requesst.
Note: This feature is not available on the HFRCODPLL oscillator, which only operates in EM0 and EM1.
8.3.3.3 Calibration
Several different frequencies are calibrated during production test on every device. In order to use a factory-calibrated value, software
must read the value from the appropriate location in the DEVINFO page and write it to the CAL register.
The TUNING and FINETUNING bit fields in the CAL register can be used to trim HFRCO manually.
Software may write the CAL register at any time. If there is already a frequency updating occuring, the current change would apply
when the previous update is done. FREQBSY in STATUS register indicates if the updating is finished.
The minimum and maximum frequencies attainable for each setting of the FREQRANGE field are listed in the device data sheet.
HFRCODPLLCAL0 4 MHz
HFRCODPLLCAL3 7 MHz
HFRCODPLLCAL6 13 MHz
HFRCODPLLCAL7 16 MHz
HFRCODPLLCAL10 26 MHz
HFRCODPLLCAL11 32 MHz
HFRCODPLLCAL12 38 MHz
HFRCODPLLCAL13 48 MHz
HFRCODPLLCAL14 56 MHz
HFRCODPLLCAL15 64 MHz
HFRCODPLLCAL16 80 MHz
HFRCOEM23CAL0 4 MHz
HFRCOEM23CAL1 5 MHz
HFRCOEM23CAL3 7 MHz
HFRCOEM23CAL4 10 MHz
HFRCOEM23CAL6 13 MHz
HFRCOEM23CAL7 16 MHz
HFRCOEM23CAL9 20 MHz
HFRCOEM23CAL10 26 MHz
HFRCOEM23CAL11 32 MHz
HFRCOEM23CAL12 40 MHz
8.3.3.4 Interrupts
HFRCO has one interrupt: IF.RDY. RDY is triggered when the timeout has finished and the qualified HFRCO clock is ready. The clock
is gated until it is ready.
8.3.3.5.1 FREQBSY
The FREQBSY bit indicates the HFRCO is busy updating its frequency after writing to the CAL register. The FREQBSY bit should be
used whenever frequency is changed. E.g. After software writes to the CAL register, FREQBSY would assert immediately. Software
should wait for FREQBSY to be zero before attempting to write to the CAL register again.
For band-change, FREQBSY would not de-assert until after the timeout upon being re-enabled.
When DPLL is on, FREQBSY would not assert as the frequency change is not caused by writing to the CAL register. When disabling
DPLL the last tuning value is written back to the CAL register, which will assert FREQBSY.
8.3.3.5.2 ENS
ENS indicates the HFRCO is enabled. This flag is used to check if the HFRCO is enabled by any requester.
Note: When a band change occurs, the HFRCO is disabled and re-enabled. This will cause the ENS bit to briefly de-assert.
8.3.3.5.3 RDY
RDY indicates HFRCO is enabled and start-up timeout has exceeded. Used to check if the HFRCO clock is ready after enable.
Changing bands will de-assert RDY as the oscillator must reset and start up again.
8.3.3.5.4 SYNCBUSY
SYNCBUSY indicates ongoing synchronization of CAL register fields. Same as all other modules.
The HFRCO can be forced on and off using the FORCEEN and DISONDEMAND bits in the CTRL register.
Setting FORCEEN will force the oscillator core to run, but peripherals will still need to request the clock to un-gate the clock signal.
The HFRCO has three modes of operation, an on-demand mode (which is the normal software use case), a force on and a force off
mode.
In on-demand mode the oscillator will start whenever a peripheral requests it. Which in most cases is whenever the peripheral is ena-
bled.
In force on mode the analog core will run independently of whether it is requested or not. This can be useful for measuring analog
current without any digital load on the clocks.
In force off mode, the analog core will be shut off independently of whether it is requested or not. This can be useful for changing
analog test settings without risking glitches on the clock.
The DISONDEMAND bit can also be used to give software full control over the clock for exceptional cases where software control is
desired.
Forced On 1 X
Forced Off 0 1
0x000
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
0x2
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004
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
EM23ONDEMAND RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
DISONDEMAND
FORCEEN
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this bit to prevent EM23 shutdown of the HFRCOEM23 low power domain (PD0C) upon EM23 entry. Set this bit to 1
if on-demand requests are supposed to be honored while in EM23.
0x008 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
RW 0x7F 3
2
1
0
RW 0x1F
0xA
0x2
0x0
0x3
0x8
0x1
Reset RW
RW
RW
RW
FREQRANGE RW
RW
Access
FINETUNING
CMPBIAS
CMPSEL
TUNING
Name
IREFTC
CLKDIV
LDOHP
Bit Name Reset Access Description
Writing this field adjusts the temperature coefficient trim on comparator current.
0 DIV1 Divide by 1.
1 DIV2 Divide by 2.
2 DIV4 Divide by 4.
Settings this bit puts the HFRCO LDO in high power mode.
14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Writing this field adjusts the HFRCO fine tuning value. Higher value means lower frequency.
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Writing this field adjusts the HFRCO tuning value. Higher value means lower frequency.
0x00C 0x0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
0x0 2
0x0 1
0x0 0
Reset
Access
R
SYNCBUSY R
R
R
FREQBSY
Name
LOCK
RDY
ENS
Bit Name Reset Access Description
30:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
HFRCO is enabled.
15:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit is set when there is an ongoing synchronization of CAL register bitfields.
0x010 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
RDY RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014
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
RDY RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x01C 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
0x8195
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock registers from editing. Write the unlock code to unlock.
8.4.1 Introduction
The Digital Phase-Locked Loop (DPLL) uses a reference clock to generate a desired clock frequency at a specified ratio to the refer-
ence clock.
8.4.2 Features
The DPLL can be enabled and disabled by software via the DPLL_EN register. Before enabling DPLL, software should:
1. Select reference clock by setting the CLKSEL field in CMU_DPLLREFCLKCTRL.
2. The CMU should not be running from the HFRCO. If necessary, the CMU should switch to the FSRCO until after the DPLL has
locked to avoid over-clocking due to overshoot. If necessary, select FSRCO or HFXO in the CMU_SYSCLKCTRL register CLKSEL
field.
3. Configure the DPLL.
4. Make certain that the ENS bit in DPLL_STATUS is low.
The DPLL is disabled automatically when entering EM2, EM3, or EM4. Note that disabling the DPLL will not automatically turn off the
reference clock. The CLKSEF field in CMU_DPLLREFCLKCTRL must be set to DISABLED before entering EM2 or the selected
REFCLK may continue to run in EM2.
The DPLL provides two lock modes, referred to as frequency-lock loop mode (FREQLL) and phase-lock loop mode (PHASELL).
FREQLL mode keeps the DCO frequency-locked to the reference clock, which means the DCO frequency will be accurate. However,
the phase error can accumulate over time and cause a non-zero average frequency error. FREQLL mode also provides better jitter and
transient performance. PHASELL mode keeps the DCO phase-locked to the reference clock, which means the phase error does not
accumulate over time, which makes the average frequency error zero. FREQLL mode is usually sufficient unless specific phase re-
quirement exists.
8.4.3.3 Configurations
The formula for the DPLL output frequqncy is FREF*(N+1)/(M+1). The user should calculate N and M in DPLL_CFG1 to achieve the
target frequency. Note that with a larger value of N, the DCO lock time would increase and DCO jitter would decrease. Both effects are
approximately linear. This relationship can be used to select N for a given application to strike a compromise between lock time and
output jitter. For example if an ratio of 3 is desired, the DPLL could be configured as {N=599, M=199} for fast lock time but high jitter, or
as {N=2999, M=999} for lower jitter but longer lock time.
Note: All configuration settings should be done before enabling the DPLL. They should not be changed when DPLL is running. The
final tuning values can be read back from TUNING and FINETUNING in HFRCO_CAL, after DPLL is disabled and DPLLENS in
DPLL_STATUS is low.
The DPLL has 3 different types of output events: ready, lock fail due to period underflow, and lock fail due to period overflow. Each of
the events has its own interrupt flag. DPLLRDY is set when DPLL successfully locks to the reference clock based on the software con-
figuration. DPLLLOCKFAILLOW is set when the DPLL fails to lock because the period lower boundary is hit. DPLLLOCKFAILHIGH is
set when the DPLL fails to lock because the period upper boundary is hit. If the interrupt flags are set and the corresponding interrupt
enable bits in DPLL_IEN are set, the DPLL will request an interrupt. Based on different interrupt events, software should take different
actions:
• If the DPLLRDY interrupt is received first, it means target clock is ready and it is safe to switch to use DCO’s output.
• If the DPLLLOCKFAILLOW interrupt is received first, it indicates the RANGE in HFRCO_CAL is too small. Software should disable
the DPLL and write a larger value to RANGE, then enable the DPLL again to lock.
• If the DPLLLOCKFAILHIGH interrupt is received first, it indicates the RANGE in HFRCO_CAL is too large. Software should disable
DPLL and write a smaller value to RANGE, then enable DPLL again to lock.
• If the DPLLRDY interrupt is received first and then DPLLLOCKFAILLOW or DPLLLOCKFAILHIGH is received later, it means refer-
ence clock drifted over 1% and the DPLL has lost its locked status.
• If AUTORECOVER in DPLL_CFG is not set, software should disable the DPLL and enable DPLL again to lock.
• If AUTORECOVER in DPLL_CFG is set, hardware will re-lock automatically. When the target frequency is near the boundary of a
range, the drift may cause underflow or overflow. In this case the fail interrupt will still be received. Software should disable the
DPLL and modify RANGE in HFRCO_CAL in corresponding direction, depending on whether the DPLLLOCKFAILLOW or
DPLLLOCKFAILHIGH bit is set. Then enable DPLL again to lock.
0x000
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
0x1
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004
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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When EN is cleared, DISABLING status is set immediately, and cleared when disablement finishes. Disablement resets
peripheral cores and not APB registers except hardware updated registers such as INTFLAGs and FIFO
The ENABLE bit enables the module. Software should write to CONFIG type registers before setting the ENABLE bit.
Software should write to SYNC type registers only after setting the ENABLE bit.
0x008 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
RW 0x0 6
5
4
3
AUTORECOVER RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
EDGESEL
Name
DITHEN
MODE
Bit Name Reset Access Description
31:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
5:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C 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 0x0
RW 0x0
Reset
Access
Name
M
N
Bit Name Reset Access Description
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The locked DCO frequency is given by: Fdco = Fref * (N + 1)/(M+1). N is required to be larger than 300.
15:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The locked DCO frequency is given by: Fdco = Fref * (N + 1)/(M+1). M can be any value.
0x010
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
LOCKFAILHIGH RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
LOCKFAILLOW
Name
LOCK
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014 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
LOCKFAILHIGH RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
LOCKFAILLOW
Name
LOCK
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018 0x0 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
0x0 1
0x0 0
Reset
Access
LOCK R
R
R
RDY
ENS
Name
30:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
DPLL is enabled.
0x024
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
0x7102
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock registers from editing. Write the unlock code to unlock.
8.5.1 Introduction
The Low Frequency Crystal Oscillator (LFXO) uses an external 32.768 kHz crystal to provide an accurate low-frequency clock. The
module is available in all energy modes, except EM3. The main interaction is with the CMU through the clock requesting mechanism.
8.5.2 Features
High-level features.
• Crystal calibration
• Functional in all energy modes, except EM3
• Failure detection and EM4WU
• External CMOS mode
• Edge interrupts and EM2WU
• On-demand oscillator enabling
8.5.3.1 Modes
The LFXO can be used in three different modes. The mode can be programmed by setting MODE bit field in the LFXO_CFG register. If
MODE is set to XTAL, the LFXO is programmed to operate in crystal mode and a 32.768 kHz crystal oscillator should be connected to
LF crystal pads, LFXTAL_I and LFXTAL_O (see the device data sheet for details). If MODE is set to BUFEXTCLK, the LFXO is pro-
grammed to operate in external sine mode and the sine wave should be supplied to LFXTAL_I pin. If MODE is set to DIGEXTCLK,
LFXO is programmed to operate in external CMOS mode and the external 32.768 kHz clock should be provided on LFXTAL_I pin. See
the register descriptions for more details.
8.5.3.2 Enabling
There are two ways to turn on the LFXO clock. One is to turn it on in FORCEON mode by setting FORCEEN bit to 1 in LFXO_CTRL
register. Another is to keep it ready to be turned on in ONDEMAND mode by setting FORCEEN bit to 0 and DISONDEMAND bit to 0 in
LFXO_CTRL register. This means that the oscillator will be off unless its clock requested. When a peripheral requests the clock, hard-
ware will automatically enable the LFXO without any software intervention. The oscillator will remain on as long as the peripheral re-
quests it. DISONDEMAND setting does not have any impact when FORCEEN set to 1. LFXO is in FORCEOFF mode when FORCEEN
set to 0 and DISONDEMAND set to 1. In FORCEOFF mode all requests are blocked and LFXO will not generate the clock. The LFXO
clock is available in all energy modes, except EM3.
Once the LFXO is enabled, the clock should not be used until it has had time to stabilize. Therefore, a number of cycles are required to
qualify the clock. Before the clock is qualified, no clock requesters will receive the LFXO clock. The number of cycles used to qualify the
clock can be programmed by setting the TIMEOUT bit field in the LFXO_CFG register. The TIMEOUT default value is set to 32,728
cycles, which is much more than necessary for stabilization. The stabilization time required will depend on the particular crystal, oscilla-
tor settings, and frequency accuracy requirements. A value of 4096 clocks is generally recommended for most applications. A low time-
out of 2 cycles may be used in DIGEXTCLK mode in order to filter out the first glitch from the pad. The 2 clock cycle timeout should not
be used with crystals. There are two status bits and one interrupt associated with enabling the oscillator and qualifying its clock. Once
the oscillator gets enabled the ENS bit in LFXO_STATUS register will be set high. Note that due to the nature of on demand clocking,
the oscillator can be enabled anytime, so if software reads ENS low it is not safe to assume that ENS stays low during the next instruc-
tion. It is only safe to assume that oscillator is OFF at the time ENS is being read. Similarly, if software reads ENS high it is not safe to
assume that ENS stays high during the next instruction. Once the clock is qualified, the RDY status is set high in the LFXO_STATUS
register. The same uncertainties also apply to the RDY bit. However, software can wait for RDY bit to go high to detect that LFXO clock
is qualified. Or it can enable the interrupt with RDYIEN in LFXO_IEN register and receive RDYIF interrupt available in LFXO_IF regis-
ter. RDYIF also acts as EM2 wakeup source if RDYIEN set high. If put into FORCEON mode, the LFXO will start the qualification and
once qualified it will gate off the clock but immediately start with no qualification upon receiving a request. If in ONDEMAND mode, the
LFXO starts the qualification every time it is switched from off to on due to clock requests. The qualification can take up to 32k cycles.
Note that only enabling RDY interrupt does not act as a clock request.
There is a possibility for software to detect rising or falling edges of the LFXO clock. The edge detection is enabled if any of POSEDG-
EIEN and NEGEDGEIEN is set to 1. The corresponding flags are available in POSEDGEIF and NEGEDGEIF. If none of the interrupts
are enabled, the edge detection is disabled and POSEDGEIF and NEGEDGEIF hold their last value until cleared or set by software.
Disabling the edge detection is only allowed on NEGEDGEIF. Both flags act as EM2 wakeup sources if the corresponding IEN is set
high.
In case the oscillator or crystal stops or does not output clock when expected, a failure interrupt can be raised. The failure occurs if
fewer than 3 LFXO clock positive edges happen during one 1ms. The failure detection is enabled by setting FAILDETEN to 1 in
LFXO_CTRL register. This bit acts as a clock requester. Once enabled, failure detection status can be checked by reading FAILIF in
LFXO_IF register. If FAILIEN is set high, failure will generate both interrupt and EM2 wakeup. Failure detection is also implemented as
EM4 wakeup source. To wakeup from EM4 on LFXO failure detection, set FAILDETEM4WUEN high in LFXO_CTRL.
AGC and HIGHAMPL in LFXO_CFG are settings applied to the LFXO oscillator. Both settings provide higher crystal oscillation ampli-
tude. This will improve duty cycle in the output clock and give lower sensitivity to noise, but at the cost of higher current consumption.
The AGC bit is used to enable the Automatic Gain Control module that adjusts the amplitude of the oscillations. It is enabled by default.
When disabled, the LFXO will run at the start-up current and the crystal will oscillate rail-to-rail or limited by the start-up current. The
HIGHAMPL bit will have no effect when AGC is disabled. When AGC is enabled setting the HIGHAMPL bit will give about 70% higher
crystal oscillation amplitude.
It is not allowed to write to LFXO_CFG unless LFXO is in FORCEOFF mode. If this guideline is violated, the write access is blocked
and a bus fault is generated. Writing to CFG registers has no effect in DIGEXTCLK mode. Note: when putting the oscillators to FORCE-
OFF mode, wait for ENS status to go low for the oscillator to completely shut off. Once the oscillator is forced off, it is safe to write to the
LFXO_CFG register.
While the CFG registers are static LFXO configuration, LFXO_CAL register has GAIN and CAPTUNE bit fields which can be written to
while the oscillator is running. This is used to calibrate the LFXO clock. These registers are allowed to be written only if CALBSY in
LFXO_SYNCBUSY register is low. If this guideline is violated, the write access is blocked and a bus fault is generated. CALBSY is
guaranteed to be low in FORCEOFF mode. When exiting FORCEOFF mode, CALBSY will go high and stay high until the initial internal
synchronization is done. CALBSY is also guaranteed to be low in DIGEXTCLK mode since writing to CAL register has no effect in DI-
GEXTCLK mode. CAPTUNE is allowed to be incremented or decremented by one LSB when not in FORCEOFF mode. Note that CAP-
TUNE tunes the internal capacitors connected to LFXTAL_I and LFXTAL_O pads (see Register map for more details). By programming
GAIN bit field it is possible to optimize start-up time and power consumption for a given crystal. Internal capacitances are not provided
on all chips (see the device data sheet for more details).
See the LFXO_LOCK register on how to lock certain registers. Registers LFXO_CTRL, LFXO_CFG, and LFXO_CAL are lockable. The
LOCK bit in LFXO_STATUS register is available to check whether the registers are locked. If locked, all updates to these registers are
blocked and bus faults are issued.
Upon reset, the LFXO is configured for the safe crystal start-up. The TIMEOUT is set to 32k cycles, The MODE is set to XTAL and the
reset state is FORCEOFF. In order to minimize the start-up time and power consumption for a given crystal, it is possible to adjust the
start-up gain in the oscillator by programming GAIN in LFXO_CAL. All controls are retained in EM4, except LFXO_IEN register which is
reset after EM4 wakeup.
0x000
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
0x1
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004 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
FAILDETEM4WUEN RW 0x0 5
RW 0x0 4
3
2
RW 0x1 1
RW 0x0 0
Reset
Access
DISONDEMAND
FAILDETEN
Name
FORCEEN
Bit Name Reset Access Description
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set this bit to enable EM4 exit on the oscillator failure detection.
Set this bit to enable the oscillator failure detection feature. Note that setting this bit will enable the oscillator core.
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set this bit to enable the oscillator core. The oscillator core is enabled regardless of On-demand requests.
0x008 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
RW 0x7 9
8
7
6
5
4
3
2
HIGHAMPL RW 0x0 1
RW 0x1 0
RW 0x0
Reset
Access
TIMEOUT
Name
MODE
AGC
Bit Name Reset Access Description
31:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set this bit to enable automatic gain control which limits XTAL oscillation amplitude.
0x010
0x0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0x0 0
Reset
Access
LOCK R
R
RDY
ENS
Name
30:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
LFXO is enabled.
15:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014 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
CAPTUNE RW 0x0 3
2
1
0
RW 0x1
Reset
Access
Name
GAIN
Bit Name Reset Access Description
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Program internal load capacitance connected between X_N pin and ground and X_P pin and ground. The bus affects
tuning capacitances on both pins symmetrically. CAPTUNE value must not exceed 0x4F. When updating CAPTUNE, its
value must only be incremented or decremented by 1 which provides a tuning step of 0.25pF. The maximum value is
estimated to be 20pF. Please refer to the device Datasheet for more information.
0x018 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
RW 0x0 3
NEGEDGE RW 0x0 2
POSEDGE RW 0x0 1
RW 0x0 0
Reset
Access
Name
FAIL
RDY
Bit Name Reset Access Description
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when LFXO failure is detected. Write 1 to clear the interrupt flag.
Set when LFXO is ready (start-up time exceeded). Write 1 to clear the interrupt flag.
0x01C 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
RW 0x0 3
NEGEDGE RW 0x0 2
POSEDGE RW 0x0 1
RW 0x0 0
Reset
Access
Name
FAIL
RDY
Bit Name Reset Access Description
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020
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
0x0 0
Reset
Access
CAL R
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit is set when there is an ongoing synchronization of CAL register bitfields. Do not write to CAL register while this
bit is set.
0x024 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
0x1A20
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than UNLOCK to lock CTRL, CFG and CAL registers. Write UNLOCK value to unlock the registers.
8.6.1 Introduction
The LFRCO is an integrated low-frequency (32.768 kHz) RC oscillator that may be used as a timing reference in low energy modes
when crystal accuracy is not required.
8.6.2 Features
8.6.3.1 Start-up
The LFRCO has a fast start-up time (refer to the data sheet electrical specifications for the exact start-up time). When the oscillator has
started up and is ready to use, the RDY status bit will go high and the RDY interrupt will be triggered. After start-up, it may take two
clock cycles for the clock to propagate through the CMU to the peripherals.
Software may forceably enable the LFRCO by setting the LFRCO_CTRL.FORCEEN bit field. However, by default, the LFRCO is con-
figured to be enabled only when required by hardware, and to shut down when no hardware request is present (i.e.
LFRCO_CTRL.DISONDEMAND=0 and LFRCO_CTRL.FORCEEN=0). This is known as on-demand clocking and allows the oscillator
to be controlled without any software intervention.
8.6.3.3 Calibration
The LFRCO is trimmed in production and the trim values are automatically written to the FREQTRIM field in the LFRCO_CAL register,
before user code execution. Normally, software does not need to modify the to the LFRCO_CAL register. However, it is possible for
software to re-calibrate the LFRCO by modifying the FREQTRIM value. This might be desired, for example if re-calibration is needed at
a specific temperature, or there is a desire to use different trim values at different temperatures.
It is possible to recalibrate the LFRCO by modifying the FREQTRIM value in the LFRCO_CAL register. Software may modify the
LFRCO_CAL register while it is running. However, the LFRCO_CAL has hardware synchronization, and should only be written after
checking that SYNCBUSY_CALBSY is not set.
8.6.3.4 Interrupts
LFRCO has three interrupts, RDYIF, POSEDGEIF and NEGEDGEIF. Each will trigger an EM2 wakeup if the corresponding IEN is set.
RDYIF is triggered after start-up, when the LFRCO startup sequence is complete and the oscillator is ready to use.
POSEDGEIF and NEGEDGEIF are triggered by the rising and falling edge of LFRCO respectively. These flags will only get set if either
of the interrupts are enabled (with POSEDGEIEN or NEGEDGEIEN), as the interrupt enable acts as a clock requester and keeps the
oscillator running.
0x000
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
0x0
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x008
0x0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0x0 0
Reset
Access
LOCK R
R
RDY
ENS
Name
30:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C 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
FREQTRIM RW 0xA5
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014
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
NEGEDGE RW 0x0 2
POSEDGE RW 0x0 1
RW 0x0 0
Reset
Access
Name
RDY
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018 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
NEGEDGE RW 0x0 2
POSEDGE RW 0x0 1
RW 0x0 0
Reset
Access
Name
RDY
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enables the negedge interrupt and will cause the oscillator to run. EM2 wakeup source.
Enables the posedge interrupt and will cause the oscillator to run. EM2 wakeup source.
0x01C
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
0x0 0
Reset
Access
CAL R
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 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
0x2603
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Writing the lock key will unlock the lfrco configuration registers (CAL, CTRL and TEST). Writing any other value will lock
them.
8.7.1 Introduction
This is an RC oscillator which can start and stop very fast. It is a fixed frequency oscillator, with no frequency configurability and as
such any user of this clock can rely on it being a specific frequency independent of the system state. This is the first oscillator used
during power up and hence it minimizes dependency to other blocks.
8.7.2 Features
There are no programmable registers in this module. Software can choose to use this as system clock in the CMU block. the only way
to enable or disable the FSRCO is by requesting it as a clock source in the CMU clock select registers.
0x000
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
0x0
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
8.8.1 Introduction
The ULFRCO is an ultra low power 1 kHz oscillator which is available in all energy modes. The ULFRCO is available to many low-
frequency peripherals as a lower power alternative to one of the 32 kHz oscillators. This oscillator is also used for internal bias and
housekeeping tasks in EM0-EM3.
8.8.2 Features
There are no user programmable registers in this module. The oscillator is always on in all energy modes except EM4. In EM4, the
oscillator is available on-demand by peripheral requests.
Quick Facts
What?
Why?
How?
0 1 2 3 4
9.1 Introduction
The Security Management Unit is used to configure and extend TrustZone bus level security provided by the Cortex®-M33. In addition
it increases the effective MPU regions by providing MPU control over peripheral access.
9.2 Features
Bus level security is the ability to control the flow of information on the device. The components of bus level security are the Cortex®-
M33, the Bus Manager Protect Unit (BMPU), and the Peripheral Protection Unit (PPU) as highlighted in Figure 9.1 Bus Level Security
Implementation on page 242. The SMU controls and configures all the components used in bus level security.
BMPU BMPU
Bus Matrix
Subordinate Subordinate
SMU
0 n
The BMPU is responsible for preventing managers (CPU, DMA, Etc..) from accessing secure addresses without authorization. For ex-
ample, if a DMA configured as non-secure tries to access memory that is marked secure the BMPU will prevent access and set the
corresponding interrupt flag. The BMPU prevents access of secure addresses by non-secure managers. The Cortex®-M33 has BMPU
functionality built into the TrustZone implementation.
The PPU is primarily responsible for blocking access to privileged peripherals from unprivileged managers. In addition, it also ensures
that secure and non-secure peripherals are only accessible at the appropriate secure or non-secure addresses as described in
9.3.6 Configuring Peripherals.
Since FLASH and RAM have no PPU, bus managers of any privilege state may access those resources. The Cortex®-M33 has an
MPU which prevents execution of privileged memory when the CPU is in an unprivileged state. For more information on the MPU refer
to the ARM Cortex®-M33 documentation.
The Cortex®-M33 and all other managers can be in either the privileged or unprivileged state. All bus access to peripherals are tested
for privilege level by the PPU and resolved as shown in Table 9.1 Privileged Access Table on page 243.
If an exception is detected on a write, the write will be ignored and the appropriate interrupt flag set. If an exception is detected on a
read 0x0 will be returned and the appropriate interrupt flag set.
The Cortex®-M33 and all other managers can be in either the secure or non-secure state. All bus accesses are tested for security sta-
tus by the BMPUs and PPUs and resolve as shown in Table 9.2 Secure Access Table on page 243 Secure access is computed using
the secure attribute of the manager and the address region being accessed. If a peripheral is being accessed, the secure attribute of
the peripheral is also used. For more information on the relationship between the address regions and peripheral security attributes
please see 9.3.6 Configuring Peripherals
If an exception is detected on a write the write will be ignored and the appropriate interrupt flag set. If an exception is detected on a
read 0x0 will be returned and the appropriate interrupt flag set.
ARM TrustZone is used to control what addresses are accessible by the CPU at any given time. There are two security states: secure
and non-secure. In addition the MPU provides two privilege levels: privileged and unprivileged. This results in 4 possible states: secure-
privileged, non-secure-privileged, secure-unprivileged and non-secure-unprivileged.
Non-secure code may not directly call secure code. To call secure code, non-secure code must first call a shim located in specially
marked non-secure-callable memory. Unprivileged code may invoke privileged code and change the processor state to privileged by
either issuing an SVC instruction or taking an interrupt. The processor is returned to unprivileged state when software manually recon-
figures the security state or exits an interrupt.
For more information on secure/non-secure and privileged/unprivileged state transitions see the ARM Cortex®-M33 documentation.
There are two primary use cases for TrustZone and the MPU. The first is simply partitioning a monolithic application in to the 4 states to
protect some pieces of the system from bugs or attacks on others. The second is to use a RTOS to isolate several tasks from each
other. In this case the RTOS itself normally consumes the privileged states with all other code running in the unprivileged states. When-
ever a task switch occurs the RTOS can reconfigure the device so the new task has access to only the components it requires, protect-
ing other tasks from interference.
In both use cases the TrustZone and MPU feature of the Cortex®-M33 both secures and accelerates mode transitions while the SMU
provides the ability to configure the security and privilege attributes of peripherals and memory.
The SMU provides the ability to configure the current secure and privileged attribute of all bus managers except for the CPU which is
controlled as described in 9.3.4 ARM TrustZone.
To configure the privileged attribute of a manager set the appropriate bit in SMU_BMPUPATDn. To configure the secure attribute of a
manager set the appropriate bit in SMU_BMPUPSATDn.
The SMU provides the ability to configure the current secure and privileged state of all peripherals. To configure the privileged attribute
of a peripheral set the appropriate bit in SMU_PPUPATDn.
Each peripheral is accessible at one of two addresses: A secure address and an non-secure address. Which address is valid depends
on the security attribute of the peripheral configured in the SMU. When configured as secure a peripheral may only be accessed at its
secure address and when configured as non-secure the peripheral may only be accessed at its non-secure address. This forces code
to be aware of the security attribute of the peripheral being accessed, preventing secure code from accessing a non-secure peripheral
unintentionally.
The device memory map contains two regions of fixed length and fixed security attribute to facilitate the secure access of peripherals.
There is one secure (0x40000000) and one non-secure (0x50000000) region for peripherals. Each peripheral memory region can be
configured independently.
To configure the security attribute of a peripheral set the appropriate bit in SMU_PPUSATDn.
The SMU provides the ability to configure the security attribute of memory. There are 13 configurable regions in total. There are three
regions in FLASH (0 - 2) and three in RAM (4-6) which have pre-determined secure attributes and user selectable sizes. Regions 3 and
11 cover the flash info page and ARM EPPB space respectively and have a fixed size. These regions can be configured as secure or
non-secure by setting ESAUR3NS in SMU_ESAURTYPES0 and ESAUR11NS in SMU_ESAURTYPES1 respectively.
The size of the FLASH and RAM regions are controlled by the SMU_ESAUMRBRxy registers as shown in Table 9.3 Memory Configu-
ration Regions on page 245. Region sizes are adjusted in 4 kB increments with the lower 12 bits of SMU_ESAUMRBRxy ignored. The
non-secure-callable regions may be set to size 0 but secure and non-secure regions must be at least 4 kB.
In addition to the SMU based access controls the Cortex®-M33 has additional security features for controlling both secure and privi-
leged access.
The Security Attribution Unit (SAU) provides that ability to setup secure memory regions in addition to those configured by the SMU. To
disable the SAU and rely entirely on the SMU for security management clear ENABLE and set ALLNS in the SAU CTRL register. To
enable a combination of SMU and SAU control set ENABLE in the SAU CTRL register. If both ENABLE and ALLNS are cleared all
Cortex®-M33 will treat all transactions as secure.
When both SAU and SMU are in use, a memory address is considered secure if either the SAU or SMU have it configured as secure.
When enabled the SAU applies ONLY to access by the Cortex®-M33 and does not effect any other managers. For more information on
the SAU refer to ARM documentation.
Note: It is highly recommended that systems avoid using the SAU unless necessary. Since the SAU does not affect any managers
outside the Cortex®-M33, extreme care must be taken to ensure the SAU regions can not be trivially by bypassed through use of an-
other manager such as the DMA.
In addition to the Cortex®-M33 MPU provides the ability to control which regions of FLASH and RAM are marked as privileged and
prevent execution of privileged code by a CPU in unprivileged state. For more information on the configuration and use of the MPU
refer to ARM documentation.
When a BMPU detects a non-secure manager attempting to access a secure address, the BMPUSECIF in SMU_IF is set and the ID of
the Manager block is written to SMU_BMPUFS. If BMPUSECIEN is set and the SMU's Secure IRQ enabled, the CPU will be interrup-
ted.
When a PPU detects an access to a secure peripheral at its non-secure address or an access to a non-secure peripheral at its secure
address, PPUSECIF in SMU_IF is set and the ID of the peripheral being accessed is written to SMU_PPUFS. If PPUSECIEN is set and
the SMU's Secure IRQ enabled, the CPU will be interrupted.
If a PPU detects an attempt to fetch an instruction from a peripheral, PPUINSTIF in SMU_IF will be set and the ID of the peripheral
being accessed is written to SMU_PPUFS. If PPUINSTIEN is set and the SMU's Privileged IRQ enabled, the CPU will be interrupted.
If a PPU detects an attempt to access a privileged peripheral by an unprivileged manager, PPUPRIVIF in SMU_IF will be set and the ID
of the peripheral being accessed is written to SMU_PPUFS. If PPUPRIVIEN is set and the SMU's Privileged IRQ enabled, the CPU will
be interrupted.
When any IRQ is trigged the Cortex®-M33 is automatically placed in the privileged state. The security state is determined by configura-
tion inside the Cortex®-M33. Refer to ARM's documentation for more details.
If the SMU is configured in an inconsistent way, the SMUPRGERR flag in SMU_STATUS will be set. One example of an invalid config-
uration is setting SMU_ESAUMRBR01 to a value larger than SMU_ESAUMRBR23. SMUPRGERR should be checked after the SMU is
configured.
The SMU registers can be locked to prevent unintended modifications. SMULOCK in SMU_STATUS indicates if the SMU is currently
locked. To unlock the SMU write 0xACCE55 to the SMU_LOCK register. To lock write any other value to SMU_LOCK.
In addition to locking the SMU registers the SMU can prevent access to the Cortex®-M33 ASU, MPU, SMPU, VTOR and VTAIRCR
registers. To lock access to one or more of these blocks set the corresponding bit in SMU_M33CTRL.
0x000
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
0x6
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004 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
0x0 1
0x0 0
Reset
Access
SMUPRGERR R
R
SMULOCK
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 UNLOCKED
1 LOCKED
0x008
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
0x0
Reset
Access
SMULOCKKEY W
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
BMPUSEC RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
RW 0x0 2
1
RW 0x0 0
Reset
Access
PPUPRIV
PPUINST
PPUSEC
Name
31:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Triggered when a security fault occurs in the Bus Manager Protection Unit
15:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 31
30
29
28
27
26
25
24
23
22
21
20
19
18
BMPUSEC RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
RW 0x0 2
1
RW 0x0 0
Reset
Access
PPUPRIV
PPUINST
PPUSEC
Name
31:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 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
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
LOCKSVTAIRCR RW 0x0 0
Reset
Access
LOCKNSVTOR
LOCKNSMPU
LOCKSMPU
LOCKSAU
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x040 RW 0x1 31
RW 0x1 30
RW 0x1 29
RW 0x1 28
RW 0x1 27
RW 0x1 26
RW 0x1 25
SYSCFGCFGNS RW 0x1 24
23
RW 0x1 22
RW 0x1 21
RW 0x1 20
RW 0x1 19
RW 0x1 18
RW 0x1 17
RW 0x1 16
RW 0x1 15
RW 0x1 14
RW 0x1 13
RW 0x1 12
RW 0x1 11
RW 0x1 10
RW 0x1 9
RW 0x1 8
RW 0x1 7
RW 0x1 6
RW 0x1 5
RW 0x1 4
RW 0x1 3
RW 0x1 2
RW 0x1 1
0
Reset
Access
HOSTMAILBOX
LDMAXBAR
EUSART2
EUSART1
Name
ICACHE0
SYSCFG
ULFRCO
HFRCO0
USART0
TIMER4
TIMER3
TIMER2
TIMER1
TIMER0
GPCRC
BURAM
FSRCO
BURTC
LFRCO
DPLL0
DCDC
LDMA
LFXO
GPIO
CMU
MSC
EMU
I2C1
PRS
Bit Name Reset Access Description
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x044 31
30
29
28
27
26
25
RW 0x1 24
SEMAILBOX RW 0x1 23
RW 0x1 22
RW 0x1 21
RW 0x1 20
RW 0x1 19
RW 0x1 18
RW 0x1 17
RW 0x1 16
RW 0x1 15
RW 0x1 14
RW 0x1 13
RW 0x1 12
RW 0x1 11
RW 0x1 10
RW 0x1 9
SMUCFGNS RW 0x1 8
RW 0x1 7
6
5
4
RW 0x1 3
RW 0x1 2
RW 0x1 1
RW 0x1 0
Reset
Access
LETIMER0
AMUXCP0
KEYSCAN
EUSART0
LESENSE
HFRCO1
SYSRTC
WDOG1
WDOG0
Name
ACMP1
ACMP0
HFXO0
VDAC0
DMEM
IADC0
PCNT
SMU
MVP
I2C0
LCD
Bit Name Reset Access Description
31:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
6:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x060 RW 0x1 31
RW 0x1 30
RW 0x1 29
RW 0x1 28
RW 0x1 27
RW 0x1 26
RW 0x1 25
SYSCFGCFGNS RW 0x1 24
23
RW 0x1 22
RW 0x1 21
RW 0x1 20
RW 0x1 19
RW 0x1 18
RW 0x1 17
RW 0x1 16
RW 0x1 15
RW 0x1 14
RW 0x1 13
RW 0x1 12
RW 0x1 11
RW 0x1 10
RW 0x1 9
RW 0x1 8
RW 0x1 7
RW 0x1 6
RW 0x1 5
RW 0x1 4
RW 0x1 3
RW 0x1 2
RW 0x1 1
0
Reset
Access
HOSTMAILBOX
LDMAXBAR
EUSART2
EUSART1
Name
ICACHE0
SYSCFG
ULFRCO
HFRCO0
USART0
TIMER4
TIMER3
TIMER2
TIMER1
TIMER0
GPCRC
BURAM
FSRCO
BURTC
LFRCO
DPLL0
DCDC
LDMA
LFXO
GPIO
CMU
MSC
EMU
I2C1
PRS
Bit Name Reset Access Description
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x064 31
30
29
28
27
26
25
RW 0x1 24
SEMAILBOX RW 0x1 23
RW 0x1 22
RW 0x1 21
RW 0x1 20
RW 0x1 19
RW 0x1 18
RW 0x1 17
RW 0x1 16
RW 0x1 15
RW 0x1 14
RW 0x1 13
RW 0x1 12
RW 0x1 11
RW 0x1 10
RW 0x1 9
SMUCFGNS RW 0x1 8
RW 0x1 7
6
5
4
RW 0x1 3
RW 0x1 2
RW 0x1 1
RW 0x1 0
Reset
Access
LETIMER0
AMUXCP0
KEYSCAN
EUSART0
LESENSE
HFRCO1
SYSRTC
WDOG1
WDOG0
Name
ACMP1
ACMP0
HFXO0
VDAC0
DMEM
IADC0
PCNT
SMU
MVP
I2C0
LCD
Bit Name Reset Access Description
31:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
6:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x140
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
0x0
Reset
Access
PPUFSPERIPHID R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x150 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
RW 0x1 8
7
6
MVPAHBDATA2 RW 0x1 5
MVPAHBDATA1 RW 0x1 4
MVPAHBDATA0 RW 0x1 3
RW 0x1 2
1
0
Reset
Access
SEEXTDMA
Name
LDMA
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x170 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
RW 0x1 8
7
6
MVPAHBDATA2 RW 0x1 5
MVPAHBDATA1 RW 0x1 4
MVPAHBDATA0 RW 0x1 3
RW 0x1 2
1
0
Reset
Access
SEEXTDMA
Name
LDMA
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x250 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
0x0
Reset
Access
BMPUFSMASTERID R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x254
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
0x0
Reset
Access
BMPUFSADDR R
Name
0x260 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
ESAUR3NS RW 0x0 12
11
10
9
8
7
6
5
4
3
2
1
0
Reset
Access
Name
31:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x264
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
ESAUR11NS RW 0x0 12
11
10
9
8
7
6
5
4
3
2
1
0
Reset
Access
Name
31:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x270 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
ESAUMRB01 RW 0xA000
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Moveable Region Boundary between Region 0 and Region 1. Address Represents the start of Region 1 at a 4kB offset.
11:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x274
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
ESAUMRB12 RW 0xC000
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Moveable Region Boundary between Region 1 and Region 2. Address Represents the start of Region 2 at a 4kB offset.
11:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x280 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
ESAUMRB45 RW 0x2000
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Moveable Region Boundary between Regions 4 and 5. This represents the starting address of Region 5.
11:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x284
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
ESAUMRB56 RW 0x4000
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Moveable Region Boundary between Regions 5 and 6. This represents the starting address of Region 6.
11:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Quick Facts
What?
0 1 2 3 4
The Secure Engine Subsystem encapsulates securi-
ty peripherals providing both improved system se-
curity and ease of use.
Why?
How?
10.1 Introduction
The Secure Engine (SE) provides several security features and acts as a barrier protecting the security hardware from activity on the
Cortex®-M33. It also enables autonomous operation of security features.
All Secure Engine functions are enabled by software. These functions are fully described in the Secure Engine emlib online documenta-
tion located at the following link:
https://docs.silabs.com/mcu/latest/efr32mg21/group-SE
10.2.2 Secure Boot with Root of Trust and Secure Loader (RTSL)
The Secure Boot with RTSL authenticates a chain of trusted firmware that begins from an immutable memory (ROM).
It prevents malware injection, prevents rollback, ensures that only authentic firmware is executed, and protects Over The Air updates.
For more information about this feature, see AN1218: Series 2 Secure Boot with RTSL.
The SE provides a secure debug unlock function that allows users to grant debug access to locked devices on a device by device ba-
sis. To use this function the device must be programmed with a public Command key by the user. To unlock a device, a unique chal-
lenge (a device-unique persistent random set of bytes) must be read out and signed by the private key associated with public Com-
mand key creating an unlock token. The device can then be unlocked by providing the valid unlock token. The token can be used to
unlock the device any number of times. There is also a command to force the device to update its challenge, which revokes the previ-
ously-generated token.
More information on Secure Debug can be found in the AN1190: Secure Debug application note.
Note: Secure debug locking a device will limit the capability for Silicon Labs to perform failure analysis on the device. Provide secure
debug tokens for each device when submitting parts for failure analysis.
The Cryptographic Accelerator in Secure Engine is an autonomous hardware accelerator with Differential Power Analysis (DPA) coun-
termeasures to protect keys.
It supports AES encryption and decryption with 128/192/256-bit keys, Elliptic Curve Cryptography(ECC) to support public key opera-
tions and hashes.
The Cryptographic Accelerator accelerates Elliptical Curve Cryptography and supports the NIST (National Institute of Standards and
Technology) recommended curves including P-192 and P-256 for ECDH(Elliptic Curve Diffie-Hellman) key derivation and ECDSA (El-
liptic Curve Digital Signature Algorithm) sign and verify operations.
Secure Engine also supports ECJ-PAKE (Elliptic Curve variant of Password Authenticated Key Exchange by Juggling).
This implementation provides a fast and energy efficient solution to state of the art cryptographic needs.
Note: AES_ECB, AES_CBC, AES_CBCMAC, and SHA-1 are provided for legacy compatibility and are not recommended for crypto-
graphic purposes without thoroughly understanding their potential security weaknesses.
The SE provides access to a non-deterministic random number generator based on a full hardware solution. The TRNG output passes
the NIST 800-22 and AIS31 test suites. The TRNG module includes several built-in self tests to detect issues with the noise source,
ensure entropy, and meet cryptography standards. The Repetition Count Test and Adaptive Proportion Test with window sizes of 64
and 4096 bits described in section 6.5.1.2 of NIST-800-90B are implemented in hardware and run continuously on the data.
http://csrc.nist.gov/publications/drafts/800-90/draft-sp800-90b.pdf
The AIS31 Online Test described in section 5.5.3 of AIS 31 is also implemented in hardware, and runs continuously on the data.
https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Zertifizierung/Interpretationen/AIS_31_Functionali-
ty_classes_for_random_number_generators_e.pdf
10.3 SE Mailbox
All communication with the Secure Engine Subsystem takes place through the SE Mailbox. Operations are performed by using the
mailbox to sending a command and then receive the SE response. The mailbox is a bidirectional 64 word FIFO.
The TX FIFO has two status flags in SE_TX_STATUS register. TXFULL is set when the FIFO is full and TXINT is set if there is space in
the FIFO for at least 16 words. If TXINTEN in SE_CONFIGURATION is set an interrupt will be generated when TXINT is set.
Writing to any SE_DATAn register will result in data being placed in the FIFO. For example, to write 16 words to the FIFO software may
write SE_DATA0 16 times, or may make a single write to each of the 16 SE_DATAn registers. If the FIFO is written when no space is
available, the CPU will be stalled until spaces becomes available and the write can be completed.
To send a command, first check TXINT to ensure that there is space available in the FIFO. Then write SE_TX_HEADER with the com-
mand length and protection bit. Finally, write the command data into the SE_DATAn registers. While the command is being written,
BYTERM in SE_TX_STATUS will contain the number of bytes remaining in the command. To ensure minimal performance impact, soft-
ware should ensure that space exists in the FIFO before writing to it.
The RX FIFO has two status flags in SE_RX_STATUS register. RXEMPTY is set when the FIFO is empty and RXINT is set if there are
at least 4 words in the FIFO or if the final word of the message is present in the FIFO. If RXINTEN in SE_CONFIGURATION is set, an
interrupt will be generated when RXINT is set.
Reading from any SE_DATAn register will result in data being read from the FIFO. For example, to read 16 words from the FIFO, soft-
ware may read SE_DATA0 16 times, or may make a single read from each of the 16 SE_DATAn registers. If the FIFO is read when it is
empty and no message is available, a 0x0 will be read. If the FIFO is read when empty and a message is being processed, the CPU will
be stalled until data becomes available.
Software may check for responses by polling RXINT, RXEMPTY, or RXHEADER in SE_RX_STATUS. The RXINT interrupt may also
be used to notify the CPU when data is available. To receive a response first read the response header from SE_RX_HEADER. Soft-
ware may read the message size from SE_RX_HEADER, or use BYTERM in SE_RX_STATUS, which contains the number of words
remaining in the response.
The command status is available in both SE_RX_STATUS and SE_RX_HEADER and indicates if the command completed successful-
ly.
0x000
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
PTR RW 0x0
Reset
Access
Name
0x040 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
MBOXIF3 RW 0x0 3
MBOXIF2 RW 0x0 2
MBOXIF1 RW 0x0 1
MBOXIF0 RW 0x0 0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x044 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
MBOXIEN3 RW 0x0 3
MBOXIEN2 RW 0x0 2
MBOXIEN1 RW 0x0 1
MBOXIEN0 RW 0x0 0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Quick Facts
What?
Why?
0 1 2 3 4 How?
11.1 Introduction
The Energy Management Unit (EMU) manages all the low energy modes (EM) in EFM32PG28. Each energy mode manages whether
the CPU and the various peripherals are available. The energy modes range from EM0 to EM4. EM0 mode provides the highest
amount of features, enabling the CPU and peripherals with the highest clock frequency. EM4 Mode provides the lowest power state,
allowing the part to return to EM0 on a wake-up condition. The EMU also controls the internal regulators settings and voltage monitor-
ing needed for optimal power configuration and protection.
11.2 Features
The EMU is responsible for managing the wide range of energy modes available in EFM32PG28. The block works in harmony with the
entire platform to easily transition between energy modes in the most efficient manner possible. The following diagram Figure 11.1
EMU Overview on page 276, shows the relative connectivity to the various blocks in the system.
AVDD
VDD VREGVSS
Analog
Main +
Blocks
Supply – DVDD
DVDD
DVDD
High
Digital Analog
Flash Voltage
LDO Infrastructure
Digital
DECOUPLE
DECOUPLE
DECOUPLE
Digital
RFVDD
Logic
The EMU is available on the peripheral bus. The energy management state machine controls the internal voltage regulators, oscillators,
memories, and interrupt system. Events, interrupts, and resets can trigger the energy management state machine to return to the active
state. This is further described in the following sections.
EFM32PG28 features five main energy modes, referred to as Energy Mode 0 ( EM0) through Energy Mode 4 (EM4). The Cortex®-M33
is only available for program execution in EM0. In EM0 Active/EM1 Sleep any peripheral function can be enabled. EM2 through EM4,
also referred to as low energy modes, provide a significantly reduced energy consumption while still allowing a rich set of peripheral
functionality. The following Table 11.1 table on page 277 shows the possible transitions between different energy modes.
Enter EM0 Enter EM1 Enter EM2 Enter EM3 Enter EM4
EM4 Wake Up
Note:
1. Peripheral wake-up from EM2/3 to EM1 and then automatically back to EM2/3 when done.
Certain peripherals have the ability to temporarily turn on additional logic in EM2 or EM3 to receive and transmit data or trigger LDMA
transfers without intervention from the M33 core. The system automatically returns to the original energy mode when such operations
are complete.
The Core can always request to go to EM1 with the WFI or WFE command during EM0. The core will be prevented from entering EM2
or EM3 if flash is programming or erasing.
An overview of supported energy modes and available functionality is shown in the following table. For each energy mode, the system
will typically default to its lowest power configuration, with non-essential clocks and peripherals disabled. Functionality may be then se-
lectively enabled by software.
Modules with EM2/3/4 capability exist in a Low Power Domain (e.g., PD0x or PDHV). Refer to 11.3.4 Power Domains for more details.
MVP Available - - -
Note:
1. Leaving the debugger connected when in EM2 or EM3 will cause the system to enter a higher power EM2 mode in which the high
frequency clocks are still enabled and certain core functionality is still powered-up in order to maintain debug-functionality.
2. The LDMA can be used with some low power peripherals (e.g., IADC) in EM2/3. Features required by the LDMA which are not
supported in EM2/3 (e.g., HCLK), will be automatically enabled prior to the LDMA transfer and then automatically disabled after-
wards.
3. Default off, but kept active if used by the IADC or VDAC.
4. Default off, but kept active if used by the BURTC
5. Must be using ULFRCO
6. ACMP functionality in EM2/3 limited to edge interrupt
7. I2C0 only. Not supported on all GPIO Ports. Functionality limited to receive address recognition
8. EUSART0 only. Not supported on all GPIO Ports. Functionality limited to low-frequency UART or SPI secondary interface
9. Wake on any key press supported in EM2/3. Full key scanning operates in EM0/1.
10. Pin wake-up in EM4 supported only on GPIO_EM4WUx pins. Consult data sheet for complete list of pins.
11. If enabled in EMU->EM4CTRL.EM4IORETMODE.
12. Module is in a PD0x Low Power Domain. Refer to 11.3.4 Power Domains for more detail.
11.3.1.1 EM0
11.3.1.2 EM1
EM1 disables the core but leaves the remaining system fully available.
• Cortex®-M33 is in sleep mode. Clocks to the core are off
• High and low frequency clock trees are active
• All oscillators are available
• All peripheral functionality is available
11.3.1.3 EM2
This is the first level into the low power energy modes. Most of the high frequency peripherals are disabled or have reduced functionali-
ty. Memory and registers retain their values.
• Cortex®-M33 is in sleep mode. Clocks to the core are off.
• High frequency clock tree is inactive
• Low frequency clock tree is active
• The following oscillators are available
• LFRCO, LFXO, ULFRCO
• On-demand if used by peripherals: FSRCO, HFRCOEM23
• The following low frequency peripherals are available
• SYSRTC, BURTC, WDOG, LETIMER, PCNT, LESENSE, I2C0, EUSART0 (UART or SPI secondary only), KEYSCAN, and LCD
• The following analog peripherals are available (with potential limitations on functionality)
• ACMP, IADC, VDAC
• Wake-up to EM0 through
• Peripheral interrupt, reset pin, power on reset, asynchronous pin interrupt, I2C0 address recognition
• Wake-up to EM1 through
• Peripheral data transfer request
• Part returns to EM2 when transfers are complete
• RAM and register values are preserved
• RAM blocks may be optionally powered down for lower power
• GPIO pin state is retained
• SYSRTC memory is retained
• Debug connectivity is unavailable by default to reduce current consumption. Debug connectivity can be enabled by setting the
EM2DBGEN bit in the EMU_CTRL register, and will consume about 0.5 uA extra supply current.
11.3.1.4 EM3
In this low energy mode, all low frequency oscillators (LFXO, LFRCO) and all low frequency clocks derived from them are stopped, as
well as all high frequency clocks. Most peripherals are disabled or have reduced functionality. Memory and registers retain their values.
• Cortex®-M33 is in sleep mode. Clocks to the core are off.
• High frequency clock tree is inactive
• All low frequency clock trees derived from the low frequency oscillators (LFXO, LFRCO) are inactive
• The following oscillators are available
• ULFRCO
• On-demand if used by peripherals: FSRCO, HFRCOEM23
• The following low frequency peripherals are available if clocked by the ULFRCO
• SYSRTC, BURTC, and WDOG
• SYSRTC, BURTC, WDOG, LETIMER, PCNT, LESENSE, I2C0, EUSART0 (SPI secondary only), KEYSCAN, and LCD
• The following analog peripherals are available (with potential limitations on functionality)
• ACMP, IADC, VDAC
• Wake-up to EM0 through
• Peripheral interrupt, reset pin, power on reset, asynchronous pin interrupt, I2C0 address recognition
• Wake-up to EM1 through
• Peripheral data transfer request
• Part returns to EM3 when transfers are complete
• RAM and register values are preserved
• RAM blocks may be optionally powered down for lower power
• GPIO pin state is retained
• SYSRTC memory is retained
• Debug connectivity is unavailable by default to reduce current consumption. Debug connectivity can be enabled by setting the
EM2DBGEN bit in the EMU_CTRL register, and will consume about 0.5 uA extra supply current.
11.3.1.5 EM4
EM4 is the lowest energy mode of the part. There is no retention except for GPIO PAD state and BURAM values. Wake-up from EM4
requires a reset to the system, returning it back to EM0.
• Cortex®-M33 is off
• High frequency clock tree is off
• Low frequency clock tree may be active
• No RAM or register values are retained, except for the BURAM.
• The following oscillators are on if used by the BURTC:
• LFRCO, LFXO, ULFRCO
• The following low frequency peripherals are available
• BURTC
• Wake-up to EM0 through
• BURTC interrupt, reset pin, power on reset, asynchronous pin interrupt (on GPIO_EM4WUx pins only), or RFSENSE
• GPIO pin state may be retained (depending on EMU->EM4CTRL.EM4IORETMODE configuration)
The following sections describe the requirements for entering the various energy modes.
Energy mode EM1 is entered when the Cortex®-M33 executes the Wait For Interrupt (WFI) or Wait For Event (WFE) instruction while
the SLEEPDEEP bit in the Cortex®-M33 System Control Register is cleared. The MCU can re-enter sleep automatically out of an Inter-
rupt Service Routine (ISR) if the SLEEPONEXIT bit in the Cortex®-M33 System Control Register is set. Refer to ARM documentation
on entering Sleep modes.
Alternatively, EM1 can be entered from either EM2 or EM3 due to certain peripheral wake-up requests, allowing transfers from the pe-
ripheral to system RAM. The system will return back to EM2 or EM3 once the peripheral has completed its transfers and processing.
Energy mode EM2 or EM3 may be entered when all of the following conditions are true:
Energy mode EM2 is entered from EM0 when the Cortex®-M33 executes the Wait For Interrupt (WFI) or Wait For Event (WFE) instruc-
tion while the SLEEPDEEP bit in the Cortex®-M33 System Control Register is set. The MCU can re-enter DeepSleep automatically out
of an Interrupt Service Routine (ISR) if the SLEEPONEXIT bit in the Cortex®-M33 System Control Register is set. Refer to ARM docu-
mentation on entering Sleep modes.
Alternately, EM2 or EM3 is entered from EM1 upon the completion of a Peripheral Wake-Up Request from capable peripherals if no
EM0 wake-up happens in the meantime.
When entering EM2 or EM3, if any peripheral on an auxiliary low power domain (PD0B, PD0C, etc.) is enabled, that auxiliary low power
domain will be powered, causing higher current draw. Otherwise, the auxiliary power domain will be powered down. See 11.3.4 Power
Domains for more information.
Software may enter EM4 from EM0 by writing the sequence 2,3,2,3,2,3,2,3,2 to EM4CTRL->EM4ENTRY bit field. If the EM4BLOCK bit
in WDOGn_CTRL is set, the CPU will be prevented from entering EM4 by software request.
A system in EM2 and EM3 can be woken up to EM0 through regular interrupt requests from active peripherals. Since state and RAM
retention is available, the EFM32 Series 2 is fully restored and can continue to operate as before it went into the Low Energy Mode.
Wake-up from EM4 is performed through a reset. Wake-up from a specific module must be enabled in that module’s EM4WUEN regis-
ter.
Enabled interrupts that can cause wake-up from EM2, EM3, and EM4 are shown in the following table. The wake-up triggers always
return the device to EM0. Additionally, any reset source will return to EM0.
EMU Temperature Sensor Measured temperature outside the defined Yes Yes -
limits
Note:
1. Corresponding bit in the module's EM4WUEN must be set.
2. Available on Port A, Port B, and all EM4WU pins.
3. Only available on EM4WU pins.
Peripherals may exist on several independent power domains which are powered down to minimize supply current when not in use.
Power domains are managed automatically by the EMU.
The lowest-energy power domain is the "high-voltage" power domain (PDHV), which supports extremely low-energy infrastructure and
peripherals. Circuits powered from PDHV are always on and available in all energy modes down to EM4.
The next power domain is the low power domain (PD0), which is further divided to power subsets of peripherals. All PD0 power do-
mains are shut down in EM4. Circuits powered from PD0 power domains may be available in EM0, EM1, EM2, and EM3.
Low power domain A (PD0A) is the base power domain for EM2 and EM3 and will always remain on in EM0-EM3. It powers the most
commonly-used EM2 and EM3-capable peripherals and infrastructure required to operate in EM2 and EM3. The lowest-power EM2 and
EM3 operation is achieved when only the base PD0A power domain is active. Auxiliary PD0 power domains (PD0B, PD0C, PD0D,
PD0E) power additional EM2 and EM3-capable peripherals on demand. If any peripherals on one of the auxiliary power domains is
enabled, that power domain will be active in EM2 and EM3. Otherwise, the auxiliary PD0 power domains will be shut down to reduce
current.
Note: Power domain PD0E is also turned on when peripherals on PD0B, PD0C, or PD0D are used.
The active power domain (PD1) powers the rest of the device circuitry, including the CPU core and EM0 / EM1 peripherals. PD1 is
always powered on in EM0 and EM1. PD1 is always shut down in EM2, EM3, and EM4.
Table 11.4 Peripheral Power Subdomains on page 283 shows the peripherals on the PDHV and PD0x domains. Any peripheral not
listed is on PD1.
ACMP1 I2C0
LESENSE
VDAC0
Note:
1. Peripherals on PDHV are also available in EM4.
2. If any of PD0B, PD0C, or PD0D are enabled, PD0E will also be automatically enabled.
The EFM32PG28 supports supply voltage scaling for the LDO powering DECOUPLE. Voltage scaling helps to optimize the energy effi-
ciency of the system by operating at lower voltages when possible. Three supply voltage operating points are available:
In EM0 and EM1, the voltage scaling value should be set according to the desired operating frequency. The system defaults to
VSCALE2 out of reset. To operate above 40 MHz, VSCALE2 should always be used. If the system will operate below 40 MHz,
VSCALE1 may be used to save energy.
The voltage scaling value for EM0 and EM1 is changed via software command bits in the EMU_CMD register. Setting
EMU_CMD_EM01VSCALE1 will switch to VSCALE1, and setting EMU_CMD_EM01VSCALE2 will switch to VSCALE2.
The command initiates a voltage change operation, but some time is needed before the new supply voltage is reached. When changing
between VSCALE values in EM0, it takes approximately 150 us to ramp the voltage down and approximately 32 us to ramp the voltage
up to the new values (see the data sheet specifications for exact numbers). During this time, SRAM access is prohibited by the hard-
ware and any accesses to SRAM from the CPU or DMA will be blocked until the operation is complete. The EMU_STATUS_VSCA-
LEBUSY bit indicates when a voltage scale change is in progress. When the operation is complete the EMU_IF_VSCALEDONEIF flag
will be set.
Note: Because SRAM access is blocked during a voltage scaling operation, it is recommended to configure the desired EM0 / EM1
voltage scaling once during initial boot-up for systems operating at VSCALE1.
The current VSCALE setting can be read at any time from the EMU_STATUS_VSCALE field.
A separate voltage scaling value is used during EM2 and EM3. This allows the core to run at a higher voltage when in EM0 / EM1 and
reduce the voltage in EM2 and EM3 for power savings, or maintain the same voltage for faster wakeup. The voltage scale level for EM2
and EM3 is defined by the EMU_CTRL_EMU23VSCALE field. The new voltage scaling level will be applied when the system is in EM2
or EM3, and return to the EM0 / EM1 voltage scaling level automatically when the system exits the low energy mode.
Hardware will only allow the VSCALE level to remain the same or be reduced when entering EM2 and EM3. If
EMU_CTRL_EMU23VSCALE is set to a higher VSCALE setting than the current EM0 / EM1 VSCALE level, the DECOUPLE voltage
will remain the same as the EM0 / EM1 setting.
If the voltage scaling level for EM2 / EM3 is lower than the level set for EM0 / EM1, additional time is needed to wake up from the low
powered state (see the device data sheet for specific timing). The lowest current during sleep will be obtained by setting
EMU23VSCALE to VSCALE0, and the fastest wake times will be obtained when EMU23VSCALE is equal to or higher than the EM0 /
EM1 voltage scaling value.
When the device enters EM2 or EM3, all peripherals will retain their register configurations by default. Retention for peripherals on the
PD1 power domain (i.e. those which do not operate in EM2 and EM3), can optionally be disabled by setting bit 0 of the EMU_PD1PAR-
ETCTRL_PD1PARETDIS field. Disabling retention reduces the supply current in EM2 and EM3 slightly. However, the peripheral regis-
ter interfaces will be reset upon exit to EM0.
Important: This feature is not currently supported by Silicon Labs software stacks. It is the responsibility of the user software to re-
configure any peripherals as necessary when the device wakes to EM0.
In order to provide the lowest power solutions, the EFM32PG28 comes with a DC-DC module to power internal circuits. The
EFM32PG28 may be operated with or without the DC-DC. When used, the DC-DC requires an external inductor and capacitor (refer to
the data sheet for recommended values).
The EFM32PG28 has multiple power supply rails: a DC-DC regulator input (VREGVDD), IO Supply (IOVDD), Analog (AVDD), RF Ana-
log Supply (RFVDD), RF Power Amplifier Supply (PAVDD), Digital LDO and flash (DVDD), and Low Voltage Digital Supply (DECOU-
PLE). Additional detail for each configuration and option is given in the following sections.
Due to on-chip circuitry (e.g., diodes), some power supply pins have a dependent relationship with one or more other power supply
pins. These internal relationships between the external voltages applied to the various EFR32 supply pins are defined below. Exceed-
ing the below constraints can result in damage to the device and/or increased current draw.
Additionally, there are other system-level considerations when assigning power supplies.
• The usable range for analog signals connected to GPIO (such as IADC inputs) will be limited to the lower of AVDD and IOVDD.
• The RESETn pin has an internal pullup to the DVDD supply. If RESETn is driven by external circuitry above DVDD, additional cur-
rent may flow into the pin due to this pullup.
Upon power-on reset (POR), the system is configured in a safe Startup Configuration that supports all of the available Power Configura-
tions. The Startup Configuration is shown in the simplified diagram below.
In the Startup configuration the DC-DC converter's Bypass switch is ON (i.e., the VREGVDD pin is shorted internally to the DVDD pin).
After power on, firmware can elect to turn on the DC-DC if the external hardware configuration supports it.
VDD
Main +
Supply –
DC-DC
VREGVSS Analog
Infrastructure
DVDD
DECOUPLE
In Power Configuration 1, the DC-DC converter is unused, and all power is supplied by external sources. The DVDD pin must be shor-
ted to VREGVDD.
Other supplies may be supplied by the same supply as VREGIN and DVDD (as shown in 11.3.7.2 Power Configuration 1: No DC-DC),
or they may be powered from a separate source.
VDD
Main +
Supply –
DECOUPLE
RFVDD PAVDD
For the lowest power applications, the DC-DC converter can be used to power the rest of the supplies on the device. When the DC-DC
converter is used to regulate the voltage at DVDD, the maximum supply voltage may be limited by the operating temperature and/or the
average lifetime load conditions. Refer to the device datasheet for additional details.
In Power Configuration 2, the DC-DC Output (VDCDC) is connected to DVDD and optionally, to all the other supplies on the chip. In the
configuration shown in Figure 11.4 DC-DC Power Configuration on page 288, the AVDD and IOVDD supplies are connected to the
main supply to support higher voltage external interfaces.
VDD
Main +
Supply –
VDCDC
DC-DC OFF Analog Blocks
Driver
VREGSW
DC-DC
VREGVSS Analog
Infrastructure
DVDD
RF
Digital Digital Flash / RF
Power
LDO Logic HV Digital Analog
Amplifier
DECOUPLE
RFVDD PAVDD
As the Main Supply voltage approaches the DC-DC output voltage, it eventually reaches a point where becomes inefficient (or impossi-
ble) for the DC-DC module to regulate VDCDC. At this point, firmware can enable bypass mode, which effectively disables the DC-DC
and shorts the Main Supply voltage directly to the DC-DC output. If and when sufficient voltage margin on the Main Supply returns, the
system can be switched back into DC-DC regulation mode.
The EFM32PG28 devices feature a DC-DC buck converter which requires a single external inductor and a single external capacitor.
The input supply is the VREGVDD pin, and the DC-DC converter will produce a nominal 1.8 V output at the DVDD pin to power MCU
functions. The DC-DC converter is an efficient PFM (Pulse Frequency Modulation) architecture. In addition, the DC-DC converter sup-
ports an unregulated bypass mode, in which the input voltage is directly shorted to the DC-DC output. An integrated programmable
supply monitor and dedicated interrupt allows software to enable the bypass switch when the VREGVDD supply voltage is below the
minimum allowable voltage for the output current load.
The input supply VREGVDD has a maximum range between 1.8 V and 3.8 V, but is limited by application parameters, including transi-
ent current load, operating junction temperature, and the lifetime average current load.
Refer to the device datasheet for more details on the input supply voltage range.
The buck DC-DC converter implements a bypass mode which shorts the VREGVDD input voltage directly to the DC-DC converter out-
put through an internal switch. Bypass mode is enabled automatically during a power-on-reset. Bypass mode can also be enabled and
disabled through software, using the DCDC_CTRL_MODE field. When set to BYPASS, the bypass switch is enabled and DC-DC regu-
lation will be disabled. Consult the data sheet for the bypass switch impedance specification.
The EFM32PG28 includes a supply comparator circuit to help software determine when the VREGVDD supply is high enough to enable
the buck DC-DC, or when to change to bypass mode. The THRESSEL field in the EMU_VREGVDDCMPCTRL register sets the compa-
rator threshold between 2.0 and 2.3 V, and the VREGINCMPEN bit is used to enable the supply comparator. When the VREGVDD
comparator is used, DCDC_STATUS_VREGIN can be read by software to determine whether VREGVDD is above or below the estab-
lished threshold.
The VREGVDD comparator can also generate interrupt events when the input supply is above or below the specified threshold. The
VREGINHIGHIEN and VREGINLOWIEN bits in DCDC_IEN are used to enable the above / below threshold interrupts, respectively. The
VREGVDD comparator will be active and generate interrupts in EM0 and EM1 only.
The VREGVDD Comparator status is always captured and stored in RMURSTCAUSE.VREGIN on any reset event, even if the reset is
not caused by VREGVDD being too low. At startup, the firmware should determine if the last reset was caused by a low VREGVDD
condition by checking the following:
If true, the part should remain in bypass mode with the DCDC disabled.
Out of power-on-reset (POR), the DC-DC converter defaults to bypass mode and the DC-DC block is disabled. Before enabling the DC-
DC, software should first configure and enable the VREGVDD comparator. Once the thresholds for the VREGVDD comparator have
been configured and the comparator enabled, the DCDC_STATUS.VREGIN bit should be checked to ensure that the input supply is
above the threshold. When the input supply is sufficient, the DC-DC may be configured and enabled. The following steps outline this
procedure:
1. Set VREGVDD comparator threshold with EMU_VREGVDDCMPCTRL.THRESSEL
2. Enable VREGVDD comparator with EMU_VREGVDDCMPCTRL.VREGINCMPEN
3. Check DCDC_STATUS.VREGIN:
• If low, VREGIN is above the programmed threshold and it is safe to enter DC-DC mode
• If high, VREGIN is below the programmed threshold and firmware should remain in bypass mode
4. Enable the DC-DC module with DCDC_EN_EN = 1
5. Configure the IPKVAL and DRVSPEED settings in DCDC_EM01CTRL0 and DCDC_EM23CTRL0.
6. Enable any required interrupts via DCDC_IEN.
7. Start the DC-DC by setting DCDC_CTRL.MODE to DCDCREGULATION.
The DC-DC will enter a warmup phase for approximately 100 us, then disable the bypass switch and begin using the DC-DC core to
regulate the output voltage. The DCDC_IF.RUNNINGIF interrupt flag will indicate when the switch from bypass to DC-DC is complete,
however this does not indicate that the output is regulated. Until the output capacitor discharges due to normal current draw from the
system, the voltage may be higher than 1.8 V. The DCDC_IF.REGULATIONIF interrupt flag will indicate when the DC-DC has reached
regulation and is providing the desired output voltage.
If the VREGINLOWIF interrupt occurs, software should immediately switch back to bypass mode by clearing DCDC_CTRL.MODE to
BYPASS.
Certain DC-DC parameters are adjustable for fine-tuning of performance, but the majority of applications will not need to use any other
than the recommended settings. All datasheet parameters are specified using the recommended settings detailed in this section. The
configuration settings must be set before DC-DC regulation is started, and must not be changed while the DC-DC is active.
The DCDC_EM01CTRL0 and DCDC_EM23CTRL0 registers each have an IPKVAL field to adjust the maximum peak / load current,
and a DRVSPEED field to adjust the driver speed. DCDC_EM01CTRL0 sets the configuration for EM0 and EM1 operation while
DCDC_EM23CTRL0 sets the configuration for EM2 and EM3 operation. The DCDC_CTRL.IPKTMAXCTRL field adjusts the maximum
time for peak current detection, which impacts the voltage ripple at the DC-DC output. The recommended settings are shown in Table
11.6 DRVSPEED, IPKVAL, and IPKMAXCTRL Recommended Settings for buck DC-DC on page 290.
Table 11.6. DRVSPEED, IPKVAL, and IPKMAXCTRL Recommended Settings for buck DC-DC
DCDC_EM01CTRL0.IPKVAL 9 (LOAD60MA)
DCDC_EM01CTRL0.DRVSPEED 1 (DEFAULT_SETTING)
DCDC_EM23CTRL0.IPKVAL 3 (LOAD5MA)
DCDC_EM23CTRL0.DRVSPEED 1 (DEFAULT_SETTING)
The buck DC-DC is available in all energy modes except for EM4. If the system wants to enter EM4, the DC-DC converter must first be
turned off and switched over to bypass mode. The system will not enter EM4 if the DC-DC is active. If an attempt is made to go into
EM4 with DC-DC active, it will be blocked, and the DCDC_IF_EM4ERR flag will be set.
The EFP01 Energy Friendly Power Management IC (PMIC) is an extremely flexible, highly efficient, multi-output power management
IC, providing complete system power and primary cell battery Coulomb counting for EFM32PG28 devices. The dual-DCDC converter
outputs available on certain EFP01 OPNs can, for example, provide power to both the 1.8 V supplies (e.g., DVDD/AVDD/IOVDD) as
well as the 1.1/1.0/0.9 V supply (DECOUPLE) for improved efficiency. EFP01 uses an I2C interface for communciation and also has a
unidirectional, open-drain IRQ# output to indicate status flag changes. Consult EFP01 Datasheet for more detailed information and
available OPNs.
The EFM32PG28 has additional built-in hardware support for the EFP01 Energy Friendly PMICs, including:
• Direct Mode Energy Mode transition supporting all energy modes (including EM4) on dedicated pins (PC1 / PC2)
• Hardware IRQ with (dedicated IRQ vector) in all energy modes (included EM4) on dedicated pin (PC5)
EFM32PG28's EFP01 hardware support must be enabled by setting one (or both) of the EFPDRVDECOUPLE or the EFPDRVDVDD
bits in the EMU_CTRL register:
1. EFPDRVDECOUPLE: Set this bit if EFP01's DCDC output will be powering EFM32PG28's DECOUPLE supply. Once set,
EFM32PG28's internal LDOs will be disabled, and any voltage changes (due to voltage-scaling and/or energy mode transitions) will
be managed by EFP01. Note that because this bit disables in the internal LDO's powering the core, it should be set until after
EFP01's DECOUPLE output has been configured and enabled.
2. EFPDRVDVDD: Set this bit if EFP01's DCDC output is powering EFM32PG28's DVDD supply (or DVDD along with other 1.8V
supply inputs). This mode assumes that EFM32PG28's internal DCDC is not being used, so the EFM32PG28 VREGVDD and
PAVDD pins should be shorted together on the PCB.
EFM32PG28 provides a dedicated hardware IRQ vector for the EFP01's IRQ output. To use the EFM32PG28's hardware support for
EFP01's IRQ output:
1. The PC5 pin should be configured as an input with no pull-up/pull-down enabled and connected on the PCB to EFP01's IRQ pin.
Note that although this pin exists on Port C, which typically doesn't support EM2/3 operation, when used as a EFP01 IRQ input the
PC5 pin can operate in EM2/3. In addition, the PC5 pin can operate in EM4, without the need to be configured as a EM4Wakeup.
2. EFP01 Hardware support must be enabled by setting either the EFPDRVDECOUPLE or the EFPDRVDVDD bits as described
above.
Once enabled, the EFP01 interrupt flag in the EMU_EFPIF register will be set whenever the EFP01 IRQ line goes low. A processor
interrupt can be generated to the EMUEFP_IRQHandler() by setting the EFPIEN bit in the EMU_EFPIEN register.
EFM32PG28 includes hardware support for EFP01's optional Direct Mode interface to allow fast-energy mode transitions into and out of
all energy modes (EM0/1, EM2/3, EM4). Ordinarilly, I2C transactions are used to manage EFP01's energy mode state - however, a
single I2C transaction can take over 100 us. In Direct Mode, the EFM32PG28 retasks the I2C pins as push-pull outputs with pull-ups
disabled to control the EFP01's energy mode state directly, allowing much faster energy mode transistions. State definitions are defined
in Table 11.7 Direct Mode Energy Mode States on page 291. Because the Direct Mode feature is non-I2C compliant, it should be ena-
bled only during periods when no communciation between EFM32PG28 and EFP01 is required (e.g., an energy mode transition from
EM0 to EM2/4), and it is recommended that EFP01 be the only I2C device on the bus. It is also recommended for firmware to wait for
the I2C STOP interrupt ensure no I2C transaction is in progress before switching to Direct Mode.
Direct Mode State I2C SCL Level I2C SDA Level Allowed State Transitions
EM0 1 1 • EM2
• I2C Start Condition
EM2 0 1 • EM0
• EM4
EM4 0 0 • EM22
1 Direct mode transitions between EM0 and EM4 are not allowed. The system must briefly go through the EM2 state on EM4 exit or
entrance.
2 Direct mode transitions between EM0 and EM4 are not allowed. The system must briefly go through the EM2 state on EM4 exit or
entrance.
Brown out detectors ensure that the minimum supply required for the chip to operate properly and safely is provided to the
EFM32PG28. Once triggered, a BOD will generate a system reset.
All BODs detect when the supply falls below a programmed threshold except DECOVMBOD (Over Voltage Monitoring),which detects
when the supply goes above a predefined threshold.
All BODs except DVDDBOD and DVDDLEBOD can be individually enabled by firmware.
DVDDBOD n/a EM0/1 Monitors the DVDD supply in EM0 and EM1. Hardware enables this BOD automatically
in EM0/EM1 and disables it in EM2/EM3/EM4
DVDDLEBOD n/a EM2/3/4 Low Energy BOD monitors the DVDD supply in EM2/EM3/ EM4. DVDDLEBOD is auto-
matically masked by hardware for ~100us after it is enabled to allow it to settle
DECBOD EMU_DECBOD EM0/1/2/3 Monitors the DECOUPLE supply. DECBOD is automatically masked by hardware for
~20us after it is enabled to allow it to settle.
DECOVMBOD EMU_DECBOD EM0/1/2/3 Monitors the DECOUPLE supply Over Voltage by detecting DECOUPLE going over a
specified threshold. DECOVMBOD is automatically masked by hardware for ~20us after
it is enabled to allow it to settle.
AVDDBOD EMU_BOD3SENSE EM0/1/2/3/4 Monitors the AVDD supply. Automatically masked by hardware for ~100us after it is ena-
bled to allow it to settle.
IOVDDBOD EMU_BOD3SENSE EM0/1/2/3/4 Monitors the IOVDD supply. Automatically masked by hardware for ~100us after it is en-
abled to allow it to settle. (Note that some devices may have multiple IOVDD supplies.)
EMU RMU (Reset Management Unit) ensures correct reset operation. It is responsible for connecting the different reset sources to the
reset lines of the EFM32PG28. After reset, the M33 loads the stack pointer and program entry point from memory and start execution.
Secure
Tamper Detect
Engine
POR
EM4 Peripherals
DVDD DVDDLEBOD PORESETn (EMU, LFXO,
BURAM, BURTC,
DVDDBOD etc)
RESETn FILTER
PORRESETLVn DEBUG
EM4 WAKEUP RESET_N Interface
EM2 SYSRTC
SYSRESETn
WDOGRST Low Voltage Logic
LOCKUPRST Soft Reset
SYSREQRST Enable
Individual
DECOUPLE DECBOD Reset
Whether a reset source trigger event lead to a system reset can be controlled via EMU_RMUCTRL register.
EMU_RSTCAUSE register
User can determine the cause of the last reset by querying the EMU_RSTCAUSE register. Once read, EMU_RSTCAUSE should be
cleared via EMU_CMD_RCCLR.
EMU provides a low energy periodic temperature measurement. A temperature measurement is taken once every 250 ms, with the 9-
bit result stored in TEMP bit-field in EMU_TEMP register. The temperature value is expressed in degrees Kelvin.
EMU_TEMP_TEMPLSB represents the measured temperature fractional part (in ¼ degree Kelvin).
Note: The EMU temperature sensor is always periodically taking single temperature measurements, except in EM4 (shutoff) mode.
To obtain better noise resolution, the temperature sensor also implements a hardware averaging function, and averaged results can be
requested using the EMU_CMD_TEMPAVGREQ command. When TEMPAVGREQ is set by software, the temperature sensor will take
16 or 64 samples as quickly as possible. The TEMPAVGNUM field in EMU_CTRL determines how many temperature measurements
will be averaged. The averaged result is stored in the 11-bit field EMU_TEMP_TEMPAVG, which represents the full temperature with
resolution of ¼ degree Kelvin.
High and Low thresholds are specified as 9-bit degree Kelvin values and compared against the single temperature result
(EMU_IF_TEMP).
Measured temperature can be converted to degrees Celsius by subtracting 273.15 (TCelsius = TKelvin - 273.15).
The raw value reported by the EMU temperature sensor follows a predictable curve. The output may be linearized and the systematic
offset removed to achieve die temperature readings with better than +/- 2.5 degrees C accuracy over the full operating temperature
range. Further accuracy can be achieved using in-system calibration.
To linearize the measurement and correct for the systematic offset, a second or third-order polynomial equation representing the nomi-
nal curve is used. For example, a third-order correction equation takes the form:
Where:
• Tcorr is the corrected temperature (in degrees Celsius)
• x is the measured temperature (in degrees Celsius)
• a is the x3 term
• b is the x2 term
• c is the x1 term
• d is the x0 term
Polynomial coefficients for both third and second-order polynomials are shown in Table 11.10 Polynomial Coefficients on page 295.
Note that the polynomial coefficients provided assume the raw output (in Kelvin) has been converted to Celsius prior to linearization.
Additional accuracy may be achieved by performing an in-system calibration at known temperatures and operating conditions after lin-
earization.
EMU EMU_LOCK (for user accessible registers) can be used to control access to the EMU_RMUCTRL, EMU_CTRL, and EMU_DEC-
BOD registers. The DCDC_LOCK register can be used to control access to the DC-DC registers.
0x010
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
DECOVMBODMASK RW 0x1 5
RW 0x0 4
3
2
RW 0x1 1
RW 0x0 0
Reset
Access
DECOVMBODEN
DECBODMASK
DECBODEN
Name
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
DECOUPLE BOD Over Voltage Monitor enable. Enables LVBOD below vref high. BOD is masked for 20us after enable
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
DECOUPLE BOD enable. Enables LVBOD above vref low. BOD is masked for 20us after enable
0x020 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
VDDIO1BODEN RW 0x0 2
VDDIO0BODEN RW 0x0 1
RW 0x0 0
Reset
Access
AVDDBODEN
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x03C
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
VREGINCMPEN RW 0x0 0
RW 0x3
Reset
Access
Name THRESSEL
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
VREGVDD comparator enable. Output is masked for 5us after enabled. Automatically disabled in EM2.
0x040 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
PD1PARETDIS RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Select PD1 register groups that are NOT retained in EM2/EM3. Each bit controls a register group. MCU core group is
always retained. Bit[0]: Disables PD1 retention for MCU Peripherals group. Bit[1]: Disables PD1 retention for RADIO
group (only on devices with a radio). Bit [15:2]: Unused. Setting PD1 retention for MCU Peripherals group will also allow
PD0B/C/D power domains to be turned OFF in EM23 if all peripherals on those power domains are turned off on EM23
entry
2 RADIONORETAIN Bit[1]. When set, do not retain RADIO associated registers when
in EM2/3
0x05C
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
0x7
Reset
Access
IPVERSION R
Name
IP Version
0x060 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
0xADE8
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x064 RW 0x0 31
RW 0x0 30
RW 0x0 29
28
RW 0x0 27
26
VSCALEDONE RW 0x0 25
EM23WAKEUP RW 0x0 24
23
22
21
20
19
18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reset
Access
IOVDD0BOD
TEMPHIGH
TEMPLOW
AVDDBOD
TEMPAVG
Name
TEMP
Temperature Update
28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
EM23 wake up
23:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x068 RW 0x0 31
RW 0x0 30
RW 0x0 29
28
RW 0x0 27
26
VSCALEDONE RW 0x0 25
EM23WAKEUP RW 0x0 24
23
22
21
20
19
18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reset
Access
IOVDD0BOD
TEMPHIGH
TEMPLOW
AVDDBOD
TEMPAVG
Name
TEMP
28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x06C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
BOD3SENSEEM4WU RW 0x0 8
7
6
5
4
3
2
1
0
RW 0x0
RW 0x0
Reset
Access
EM4IORETMODE
Name
EM4ENTRY
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 EM4EXIT Retention through EM4: Pads enter reset state when exiting
EM4
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This field is used to enter the Energy Mode 4 sequence. Writing the sequence 2,3,2,3,2,3,2,3,2 will enter the part into
Energy Mode 4
0x070 31
30
29
28
27
26
25
24
23
22
21
20
19
TAMPERRCCLR W(nB) 0x0 18
W(nB) 0x0 17
16
15
14
13
12
W(nB) 0x0 11
W(nB) 0x0 10
9
8
7
6
5
W(nB) 0x0 4
3
2
W(nB) 0x0 1
0
Reset
Access
RSTCAUSECLR
EM01VSCALE2
EM01VSCALE1
TEMPAVGREQ
EM4UNLATCH
Name
31:19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set this bit to clear the TAMPERRSTCAUSE register. Root access only
16:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
9:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
GPIO unlatch request after EM4 wakeup. Only valid when EM4IORETMODE== SWUNLATCH
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x074 RW 0x0 31
RW 0x0 30
RW 0x0 29
28
27
26
25
24
23
22
21
20
19
18
17
FLASHPWRUPONDEMAND RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
RW 0x0 3
2
1
RW 0x0 0
RW 0x2
Reset
Access
EFPDIRECTMODEEN
EFPDRVDECOUPLE
TEMPAVGNUM
Name
EFPDRVDVDD
EM23VSCALE
EM2DBGEN
Bit Name Reset Access Description
EFP01 Drives DVDD. EFP IRQ is enabled on PC5. VREGVDD and DVDD pins should be shorted together on the PCB.
EFP01 Direct mode enable. EMU drive I2C lines to transition EFP01 between energy modes. Firmware must use I2C1
module with SDA routed to PC1 and SCL routed to SC2.
28:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, during wake up, Flash will be in power down mode until either incoming Flash data fetch or when software
issue powerup command to IMEM->MSC_CMD register
15:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 N16 16 measurements
1 N64 64 measurements
2:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Force debug power domain to stay on on EM2 entry. This allows debugger to remain connected in EM2.
0x078
31
30
29
28
27
26
25
24
23
22
21
TEMPHIGH RW 0x1FF 20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0x0
Reset
RW
Access
TEMPLOW
Name
31:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Temp threshold in degree Kelvin. The TEMPHIGH interrupt flag is set when a periodic temperature measurement is
equal to or higher than this value.
15:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Temp threshold in degree Kelvin. The TEMPLOW interrupt flag is set when a periodic temperature measurement is equal
to or lower than this value.
0x084 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
0x0 14
13
0x0 12
11
10
9
8
7
6
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
0x2
Reset
Access
R
R
TEMPAVGACTIVE R
R
FIRSTTEMPDONE R
R
VSCALEFAILED
EM2ENTERED
VSCALEBUSY
TEMPACTIVE
EM4IORET
Name
VSCALE
LOCK
Bit Name Reset Access Description
31:15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Confirm chip entered EM2 state. EM2 Entry request can be delayed or denied by peripherals.
13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The status of IO retention. Will be set upon EM4 entry based on EM4IORETMODE in EMU_EM4CTRL. Cleared by set-
ting EM4UNLATCH in EMU_CMD
11:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x088
31
30
29
28
27
26
25
24
23
22
0x0 21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
0x0 6
5
4
3
2
1
0
0x0
Reset
Access
TEMPAVG R
R
TEMPLSB
Name
TEMP
Bit Name Reset Access Description
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Averaged Temperature Measurement. Temperature in Kelvin. 9 integer bits and 2 decimal bits (0.25 Degree resolution)
15:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Temperature in Kelvin. Value of last periodic temperature measurement. Value is asynchronously updated.
0x090 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
RW 0x1 10
9
8
IOVDD0BODRMODE RW 0x0 7
RW 0x0 6
5
4
RW 0x0 3
RW 0x1 2
1
RW 0x1 0
Reset
Access
AVDDBODRMODE
DECBODRMODE
LOCKUPRMODE
WDOG0RMODE
SYSRMODE
Name
31:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
LVBOD Reset Mode. DECOUPLE monitoring. BOD must be trimmed before it is used as a reset source.
9:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
LEBOD2 Reset Mode. IOVDD0 monitoring. BOD must be trimmed before it is used as a reset source.
LEBOD1 Reset Mode. AVDD monitoring. BOD must be trimmed before it is used as a reset source.
5:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x094 0x0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
0x0 13
12
0x0 11
0x0 10
0x0 9
0x0 8
0x0 7
0x0 6
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
R
DVDDLEBOD R
R
R
R
R
R
R
R
R
IOVDD0BOD
SETAMPER
DVDDBOD
AVDDBOD
DECBOD
SYSREQ
LOCKUP
VREGIN
WDOG1
WDOG0
Name
POR
EM4
PIN
Bit Name Reset Access Description
DCDC VREGIN comparator below threshold. For Information only, not a direct source for reset. Should be used to deter-
mine whether the previous reset was caused by DCDC input being too low to support current load. In this case it is ad-
vised to keep the chip in BYPASS mode and check battery level before re-enabling integrated DCDC
30:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x098
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
0x0
Reset
Access
TAMPERRST R
Name
Tamper reset vector. Reset cause indicator defining which tamper response index triggered the previous tamper reset.
Cleared with TAMPERRCCLR
0x0A0 RW 0x0 31
RW 0x0 30
RW 0x0 29
28
27
26
25
EM23WAKEUPDGIF RW 0x0 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
Reset
Access
TEMPHIGHDGIF
TEMPLOWDGIF
Name
TEMPDGIF
Temperature Update
28:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
EM23 wake up
23:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0A4 RW 0x0 31
RW 0x0 30
RW 0x0 29
28
27
26
25
EM23WAKEUPDGIEN RW 0x0 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
Reset
Access
TEMPHIGHDGIEN
TEMPLOWDGIEN
TEMPDGIEN
Name
Temperature Update
28:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
EM23 wake up
23:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x100
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
EFPIF RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
EFP Interrupt
0x104 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
EFPIEN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x000
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
0x4
Reset
Access
IPVERSION R
Name
IPVERSION number
0x004 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
IPKTMAXCTRL RW 0x10 6
5
4
3
2
1
0
0x0
Reset
RW
Access
Name
MODE
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Ton_max = (ipk_tmax_ctrl + 1)*0.07us; specifies the timeout duration when attempting to hit programmed peak current;
TMAX interrupt flag gives user information whether timeout was hit before reaching peak current
3:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Used to switch between bypass and dcdc regulation, this triggers a sequence of controls. IF/STATUS registers can be
used to check the true status of DCDC regulator/bypass switch
0x008 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
DRVSPEED RW 0x1
RW 0x9
Reset
Access
IPKVAL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Used to configure drive speed for tradeoff between EMI and Efficiency
1 DEFAULT_SETTING Recommended for use for best efficiency and low EMI
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Used to configure for required peak/load current in EM01; Max load current is approximately 0.4*Ipk
0x010 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
DRVSPEED RW 0x1
RW 0x3
Reset
Access
IPKVAL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Used to configure drive speed for tradeoff between EMI and Efficiency
1 DEFAULT_SETTING Recommended for use for best efficiency and low EMI
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
IPKTMAXCTRL RW 0xC 10
9
8
7
6
5
4
3
2
1
0
RW 0xC
Reset
Access
Name
IPKVAL
Bit Name Reset Access Description
31:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x028 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
REGULATION RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
VREGINHIGH
VREGINLOW
PFMXMODE
RUNNING
PPMODE
EM4ERR
Name
BYPSW
WARM
TMAX
Bit Name Reset Access Description
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
EM4 entry error - software requesting EM4 entry when bypass switch is disabled
biasen, vcmpen, buckmodeen=1, bypass switch has been turned off.. Note that DCDC might not be in regulation yet. ie
output voltage may not be in range of target voltage
0x02C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
REGULATION RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
VREGINHIGH
VREGINLOW
PFMXMODE
RUNNING
PPMODE
EM4ERR
Name
BYPSW
WARM
TMAX
Bit Name Reset Access Description
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x030 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
0x0 9
0x0 8
7
6
5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
BYPCMPOUT R
R
R
R
R
PFMXMODE
RUNNING
PPMODE
VREGIN
Name
BYPSW
WARM
Bit Name Reset Access Description
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x034 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
0x0 7
6
5
4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
EM23CTRL0 R
EM01CTRL1 R
EM01CTRL0 R
R
PFMXCTRL
Name
CTRL
Bit Name Reset Access Description
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
6:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x040 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
0x0
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock all DCDC registers
43981 UNLOCKKEY
0x044
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
0x0 0
Reset
Access
LOCK R
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Quick Facts
What?
0 1 2 3 4
The PRS (Peripheral Reflex System) allows configu-
rable, fast, and autonomous communication be-
tween peripherals.
Why?
12.1 Introduction
The Peripheral Reflex System is a signal routing network allowing direct communication between different peripheral modules without
involving the CPU. Peripheral modules which send out reflex signals to the PRS are called producers, and modules accepting reflex
signals are called consumers. The PRS routes the reflex signals from producer to consumer peripherals, which perform actions de-
pending on the reflex signals received.
12.2 Features
The PRS contains 12 asynchronous and 4 synchronous reflex channels. An overview of an asynchronous PRS reflex channel is shown
in Figure 12.1 PRS Asynchronous Channel Overview on page 331. Synchronous channels are similar but do not include the configura-
ble logic block or SWLEVEL / SWPULSE features. Asynchronous channels can be connected to any signal offered by the producers
while the synchronous channels are restricted to special signals from the TIMER, IADC, and VDAC modules.
Similarly on the consumer side, all the peripherals can listen to asynchronous channels while only the TIMER, IADC, and VDAC mod-
ules can listen to synchronous channels. The consumers of a channel (synchronous or asynchronous) can choose which PRS channel
to listen to and perform actions based on the reflex signals routed through that channel. Synchronous channels are only available in
EM0 and EM1 while asynchronous channels are available in EM0, EM1, EM2 and EM3.
ASYNC_CHx_SOURCESEL ASYNC_CHx_SIGSEL
ASYNC_SWLEVEL_CHxLEVEL ASYNC_SWPULSE_CHxPULSE
ASYNC_CHx_FNSEL
Producer
Signals
A
Async
Configurable
PRS[x]
Logic
Async PRS[0]
B
Async PRS[1]
Async PRS[N]
ASYNC_CHx_AUXSEL
Different functions can be applied to a reflex signal within the PRS. The asynchronous PRS channels can be manually triggered by
writing to PRS_ASYNC_SWPULSE or PRS_ASYNC_SWLEVEL. SWLEVEL[n] is a programmable level for each asynchronous chan-
nel and holds the value it is programmed to. Setting SWPULSE[n] will cause the asynchronous channel to output a high pulse that is
one EM01GRPACLK clock cycle wide. The SWLEVEL[n] and SWPULSE[n] signals are then XOR'ed with the output from the configura-
ble logic block to form the output signal and is sent to the channel selection logic for every consumer signal. For example, when SWLE-
VEL[n] is set, if configurable logic produces a signal of 1, this will cause a channel output of 0.
The configurable logic feature enables a PRS channel to perform logic operations on the signal coming from the selected producer.
Every asynchronous channel has a configurable logic block that can be programmed using the FNSEL field in the asynchronous chan-
nel control register. The configurable logic block for each channel has two inputs. Input A is the signal from the selected producer deter-
mined by SOURCESEL and SIGSEL of PRS_ASYNCHn_CTRL. Input B may be selected from the output of any other asynchronous
PRS channel using the ASYNC_CHx_AUXSEL field. This allows for more complex logic functions to be created using multiple PRS
channels.
A B FNSEL
0 0 FNSEL[0]
0 1 FNSEL[1]
1 0 FNSEL[2]
1 1 FNSEL[3]
The configurable logic feature is implemented as a 2 input look up table, with each bit of FNSEL representing the outcome for a specific
input combination (see Table 12.1 Configurable Logic Look up Table on page 332). For example, if input A is 0 and input B is 1, then
the PRS output will assume the value of bit 1 of FNSEL (FNSEL[1]).
To calculate the FNSEL field for an "A NAND B" function, the truth table can be filled out as:
A B FNSEL = (A NAND B)
0 0 FNSEL[0] = 1
0 1 FNSEL[1] = 1
1 0 FNSEL[2] = 1
1 1 FNSEL[3] = 0
In this example, the value of FNSEL has been calculated to be 0111 (binary), or 0x7.
Using the FNSEL field, a total of 16 two-input logic functions can be implemented, as shown in Table 12.3 List of Logic Functions on
page 332.
0x0 0
0x1 A NOR B
0x3 NOT A
0x5 (NOT B)
0x6 A XOR B
0x7 A NAND B
0x8 A AND B
0x9 A XNOR B
0xA B
0xB (NOT A) OR B
0xC A
0xD A OR (NOT B)
0xE A OR B
0xF 1
The default value of FNSEL is 0xC, meaning that the input from the selected producer goes through unchanged. This feature can be
used to combine multiple channels to get even more complex functions.
12.3.3 Producers
Through SOURCESEL in PRS_SYNCHx_CTRL or PRS_ASYNCHx_CTRL, each PRS channel (synchronous and asynchronous re-
spectively) selects its signal producers. Each producer outputs one or more signals which can be selected by setting the SIGSEL field.
Setting the SOURCESEL bits to 0 (Off) leads to a constant 0 output from the input mux regardless of SIGSEL.
The GPIO producer signals depend on settings in the GPIO module. They are selected using the edge interrupt configuration settings
described in 23.3.10.1 Standard Interrupt Generation. PIN0 uses settings for the EXTI0 interrupt, PIN1 uses settings for EXTI1, and so
on.
For example, to route PB00 as a producer for PRS channel 2, EXTI0, EXTI1, EXTI2, or EXTI3 should be configured to connect to
PB00, and the corresponding GPIO PINx should be selected as the PRS channel 2 producer. If we choose EXTI1 via PRS producer
"GPIO PIN1":
1. GPIO_EXTIPSELL_EXTIPSEL1 = PORTB, and GPIO_EXTIPINSELL_EXTIPINSEL1 = PIN0 connect PB00 through the EXTI1 sig-
nal.
2. PRS_ASYNC_CH2_CTRL_SOURCESEL = GPIO, and PRS_ASYNC_CH2_CTRL_SIGSEL = PIN1 connects the PIN1 (EXTI1)
signal to asynchronous PRS channel 2 as a producer.
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
SCANTABLEDONE 0x1
SINGLEDONE 0x2
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
CH1DONESYNC 0x1
SCANTABLEDONE 0x1
SINGLEDONE 0x2
CH1 0x1
OVERFLOW 0x1
PIN1 0x1
PIN2 0x2
PIN3 0x3
PIN4 0x4
PIN5 0x5
PIN6 0x6
PIN7 0x7
CLKOUT1 0x1
CLKOUT2 0x2
ASYNCH1 0x1
ASYNCH2 0x2
ASYNCH3 0x3
ASYNCH4 0x4
ASYNCH5 0x5
ASYNCH6 0x6
ASYNCH7 0x7
ASYNCH9 0x1
ASYNCH10 0x2
ASYNCH11 0x3
CH1WARM 0x1
CH0DONEASYNC 0x2
CH1DONEASYNC 0x3
INTERNALTIMEROF 0x4
REFRESHTIMEROF 0x5
UFOF 0x1
GRP0OUT1 0x1
GRP1OUT0 0x2
GRP1OUT1 0x3
DECOUT1 0x1
DECOUT2 0x2
DECCMP 0x3
STATUS1 0x1
IRDATX 0x1
RTS 0x2
RXDATAV 0x3
TX 0x4
TXC 0x5
RXFL 0x6
TXFL 0x7
IRTX 0x1
RTS 0x2
RXDATA 0x3
TX 0x4
TXC 0x5
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
CTIOUT1 0x1
CTIOUT2 0x2
CTIOUT3 0x3
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
IRDATX 0x1
RTS 0x2
RXDATAV 0x3
TX 0x4
TXC 0x5
RXFL 0x6
TXFL 0x7
IRDATX 0x1
RTS 0x2
RXDATAV 0x3
TX 0x4
TXC 0x5
RXFL 0x6
TXFL 0x7
12.3.4 Consumers
Consumer peripherals can be set to listen to a PRS channel and perform an action based on the signal received on that channel. This
is done by programming the PRSSEL or SPRSSEL in the consumer registers. SPRSSEL is only present for signals with the ability to
listen to synchronous channels. The consumer registers follow the naming convention PRS_CONSUMER_<peripheral_name>_<sig-
nal_name>. For example, the PRS_CONSUMER_TIMER0_CC0 register is used to select which PRS channel output is sent to the TIM-
ER0 peripheral's CC0 signal. In turn, the target peripheral should be configured to use the associated PRS trigger as desired. This is
described in the individual peripheral chapters.
Note: When configuring the synchronous PRS consumer registers, the target peripheral should be disabled or configured to not use the
affected PRS signal. This will ensure that no false triggers occur at the consumer.
The PRS can be used to send events to the MCU to wake the system. This is very useful in combination with the Wait For Event (WFE)
instruction. Any asynchronous PRS channel can be selected for this using PRSSEL in PRS_CONSUMER_CORE_M33RXEV.
Using this feature, one can e.g. set up a timer to trigger an event to the MCU periodically, every time letting the MCU continue from a
WFE instruction in its program. This can help in performance-critical sections where timing is known, and the goal is to wait for an
event, execute some code, then wait for another event, execute some code, and so on.
Up to two independent DMA requests can be generated by the PRS. The PRS asynchronous channels triggering the DMA requests are
selected with the PRSSEL fields in the PRS_CONSUMER_LDMAXBAR_DMAREQx registers.The requests are set whenever the se-
lected asynchronous PRS outputs are high.
0x000
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
0x2
Reset
Access
IPVERSION R
Name
The read only IPVERSION field goves the version for this module. There may be minor software changes required for
modules with different values of IPVERSION
0x008 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
CH11PULSE W(nB) 0x0 11
CH10PULSE W(nB) 0x0 10
W(nB) 0x0 9
W(nB) 0x0 8
W(nB) 0x0 7
W(nB) 0x0 6
W(nB) 0x0 5
W(nB) 0x0 4
W(nB) 0x0 3
W(nB) 0x0 2
W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
CH9PULSE
CH8PULSE
CH7PULSE
CH6PULSE
CH5PULSE
CH4PULSE
CH3PULSE
CH2PULSE
CH1PULSE
CH0PULSE
Name
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
CH11LEVEL RW 0x0 11
CH10LEVEL RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CH9LEVEL
CH8LEVEL
CH7LEVEL
CH6LEVEL
CH5LEVEL
CH4LEVEL
CH3LEVEL
CH2LEVEL
CH1LEVEL
CH0LEVEL
Name
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
0x0 11
0x0 10
0x0 9
0x0 8
0x0 7
0x0 6
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
CH11VAL R
CH10VAL R
R
R
R
R
R
R
R
R
R
R
CH9VAL
CH8VAL
CH7VAL
CH6VAL
CH5VAL
CH4VAL
CH3VAL
CH2VAL
CH1VAL
CH0VAL
Name
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
See bit 0.
Sample the current output value of channel 0. This value may be one or two clock delayed
0x014 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
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
CH3VAL R
CH2VAL R
CH1VAL R
CH0VAL R
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
SOURCESEL RW 0x0 11
10
9
8
7
6
5
4
3
2
1
0
RW 0xC
RW 0x0
RW 0x0
Reset
Access
Name AUXSEL
SIGSEL
FNSEL
Bit Name Reset Access Description
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Select Asynchronous PRS channel as input B of LUT function. Async PRS[n] is selected with AUXSEL = n.
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Look up table function select. Signal A is the selected producer input. Signal B is the output of the previous PRS channel.
0 LOGICAL_ZERO Logical 0
1 A_NOR_B A NOR B
3 NOT_A !A
5 NOT_B !B
6 A_XOR_B A XOR B
7 A_NAND_B A NAND B
8 A_AND_B A AND B
9 A_XNOR_B A XNOR B
10 B B
11 NOT_A_OR_B (!A) OR B
12 A A
13 A_OR_NOT_B A OR (!B)
14 A_OR_B A OR B
15 LOGICAL_ONE Logical 1
15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Select input source for asynchronous PRS channel. See Asynchronous Producers table for details.
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Select signal input for asynchronous PRS channel. See Asynchronous Producers table for details.
0 NONE
0x048
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
SOURCESEL RW 0x0 11
10
9
8
7
6
5
4
3
2
RW 0x0 1
0
Reset
Access
Name
SIGSEL
Bit Name Reset Access Description
31:15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 NONE
0x058 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x05C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x060 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x064
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x068 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x06C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x070 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x074
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x078 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x07C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x080 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x088
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x08C 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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x090
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x094 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0A8
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0AC 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0B0
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0B4 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0BC
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0C0 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x114
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x118 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x11C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x120 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x124
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x128 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x12C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x130 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x134
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x138 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x13C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x140 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x144
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x148 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x14C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x150 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x154
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x158 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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x15C
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x160 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x164
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x168 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x16C
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x170 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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x174
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x178 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x17C
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x180 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x184
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x188 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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x18C
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x190 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x194
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x198 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x19C
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1A0 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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1A4
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1A8 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1AC
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1B0 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1B4
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1B8 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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1BC
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
SPRSSEL RW 0x0
RW 0x0
Reset
Access
PRSSEL
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1C0 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1C4
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1C8 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1CC
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1D0 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1D4
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1D8 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1E8
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1EC 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1F0
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
SPRSSEL RW 0x0
Reset
Access
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1F4 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
SPRSSEL RW 0x0
Reset
Access
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1F8
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x1FC 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x200
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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x204 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
PRSSEL RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Quick Facts
What?
0 1 2 3 4
The GPCRC is an error-detecting module commonly
used in digital networks and storage systems to de-
tect accidental changes to data.
Why?
How?
13.1 Introduction
The GPCRC module implements a Cyclic Redundancy Check (CRC) function. It supports both 32-bit and 16-bit polynomials. The sup-
ported 32-bit polynomial is 0x04C11DB7(IEEE 802.3), while the 16-bit polynomial can be programmed to any value, depending on the
needs of the application. Common 16-bit polynomials are 0x1021 (CCITT-16), 0x3D65 (IEC16-MBus), and 0x8005 (zigbee, 802.15.4,
and USB).
13.2 Features
An overview of the GPCRC module is shown in Figure 13.1 GPCRC Overview on page 402.
GPCRC Module
DATAREV
bit reversal
DATA
byte reversal
DATABYTEREV
INPUTDATA
byte
reorder byte-level
bit
reversal Hardware CRC
Seed
Calculation Unit
16-bit Programmable
POLY
0x04C11DB7
Polynomial
32-bit Fixed
Selection
POLYSEL in GPCRC_CTRL selects between 32-bit and 16-bit polynomial functions. When a 32-bit polynomial is selected, the fixed
IEEE 802.3 polynomial(0x04C11DB7) is used. When a 16-bit polynomial is selected, any valid polynomial can be defined by the user in
GPCRC_POLY.
A valid 16-bit CRC polynomial must have an x^16 term and an x^0 term. Theoretically, a 16-bit polynomial has 17 terms total. The
convention used is to omit the x^16 term. The polynomial should be written in reversed (little endian) bit order. The most significant bit
corresponds to the lowest order term. Thus, the most significant bit in CRC_POLY represents the x^0 term, and the least significant bit
in CRC_POLY represents the x^15 term. The highest significant bit of CRC_POLY should always set to 1.The polynomial representa-
tion for the CRC-16-CCIT polynomial x^16 + x^12 + x^5 + 1, or 0x8408 in reversed order, is shown in Figure 13.2 Polynomial Repre-
sentation on page 403.
POLY
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1
The CRC input data can be written to the GPCRC_INPUTDATA, GPCRC_INPUTDATAHWORD or GPCRC_INPUTDATABYTE regis-
ter via the APB bus based on different data size. If BYTEMODE in GPCRC_CTRL is set, only the least significant byte of the data word
will be used for the CRC calculation no matter which input register is written. There are also three output registers for different ordering.
Reading from GPCRC_DATA will get the result based on the polynomial in reversed order, while reading from GPCRC_DATAREV will
get the result based on the polynomial in normal order. The CRC calculation completes in one clock cycle. Reads from the
GPCRC_DATA, GPCRC_DATAREV or GPCRC_DATABYTEREV registers and writes to the GPCRC_CMD register are halted while
the calculation is in progress.
13.3.3 Initialization
The CRC can be pre-loaded or re-initialized by first writing a 32-bit programmable init value to INIT in GPCRC_INIT and then setting
INIT in GPCRC_CMD. It can also be re-initialized automatically when read from DATA, DATAREV or DATABYTEREV provided that
AUTOINIT in GPCRC_CTRL is set, the CRC would be re-initialized with the stored init value.
A DMA channel may be used to transfer data into the CRC engine. All bytes and half-word writes must be word-aligned. The recom-
mended DMA usage model is to use the DMA to transfer all available words of data and use software writes to capture any remaining
bytes.
The byte-level bit reversal and byte reordering operations occur before the data is used in the CRC calculation. Byte reordering can
occur on words or half words. The hardware ignores the BYTEREVERSE field with any byte writes or operations with byte mode ena-
bled (BYTEMODE = 1), but the bit reversal settings (BITREVERSE) are still applied to the byte. 32-bit little endian MSB-first data can
be treated like 32-bit little endian LSB-first data, as shown in Figure 13.3 Data Ordering Example - 32-bit MSB -first to LSB-first on page
404. In this example, 32-bit data is written to GPCRC_INPUTDATA, BYTEREVERSE is set for byte ordering, and BITREVERSE is set
for byte-level bit reversal.
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
BYTEREVERSE = 1
When handling 16-bit data, the byte reordering function only swap the two lowest bytes and clear the two highest bytes, as shown in
Figure 13.4 Data Ordering Example - 16-bit MSB -first to LSB-first on page 405. In this example, 16-bit data is written to GPCRC_IN-
PUTDATAHWORD, BYTEREVERSE is set for byte ordering, and BITREVERSE is set for byte-level bit reversal.
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
BYTEREVERSE = 1
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
BITREVERSE = 1
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
calculation
Assuming a word input byte order of B3 B2 B1 B0, the values used in the CRC calculation for the various settings of the byte-level bit
reversal and byte reordering are shown in Table 13.1 Byte-Level Bit Reversal and Byte Reordering Results (B3 B2 B1 B0 Input Order)
on page 405.
Table 13.1. Byte-Level Bit Reversal and Byte Reordering Results (B3 B2 B1 B0 Input Order)
32 0 0 B3 B2 B1 B0
32 1 0 B0 B1 B2 B3
16 0 0 XX XX B1 B0
16 1 1 XX XX 'B0 'B1
16 1 0 XX XX B0 B1
16 0 1 XX XX 'B1 'B0
8 - 0 XX XX XX XX B0
8 - 1 XX XX XX XX 'B0
Notes:
1. X indicates a "don't care".
2. Bn is the byte field within the word.
3. 'Bn is the bit-reversed byte field within the word.
0x000
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
0x0
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004 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
EN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The ENABLE bit enables the module. Software should write to CONFIG type registers before setting the ENABLE bit.
Software should write to SYNC type registers only after setting the ENABLE bit.
0x008 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
RW 0x0 13
12
11
BYTEREVERSE RW 0x0 10
RW 0x0 9
RW 0x0 8
7
6
5
RW 0x0 4
3
2
1
0
Reset
Access
BITREVERSE
BYTEMODE
AUTOINIT
POLYSEL
Name
31:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enables auto init by re-seeding the CRC result based on the value in INIT after reading of DATA, DATAREV or DATABY-
TEREV.
12:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Allows byte level reverse of bytes B3, B2, B1, B0 within the 32-bit data word
1 REVERSED Reverse byte order. For 32-bit: B0, B1, B2, B3; For 16-bit: 0, 0,
B0, B1
0 NORMAL No reverse
Treats all writes as bytes. Only the least significant byte of the data-word will be used for CRC calculation for all writes
7:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x00C
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
0x0 0
Reset
Access
INIT W
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Writing 1 to this bit initialize the CRC by writing the INIT value in CRC_INIT to CRC_DATA.
0x010
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
INIT RW 0x0
Reset
Access
Name
This value is loaded into CRC_DATA upon issuing the INIT command in CRC_CMD
0x014 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
POLY RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This value defines 16-bit POLY, which is used as the polynomial during the 16-bit CRC calculation. The polynomial is
defined in reversed representation, meaning that the lowest degree term is in the highest bit position of POLY. Addition-
ally, the highest degree term in the polynomial is implicit. Further examples of the CRC configuration can be found in the
documentation.
0x018
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
0x0
Reset
Access
INPUTDATA W
Name
CRC Input 32-bit Data can be written to this register. Each time this register is written, the CRC value is updated.
0x01C 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
0x0
Reset
Access
INPUTDATAHWORD W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
CRC Input 16-bit Data can be written to this register. Each time this register is written, the CRC value is updated.
0x020
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
0x0
Reset
Access
INPUTDATABYTE W
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
CRC Input 8-bit Data can be written to this register. Each time this register is written, the CRC value is updated.
0x024 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
DATA R(r) 0x0
Reset
Access
Name
CRC Data Register, read only. The CRC data register may still be indirectly written from software, by writing the INIT
register and then issue an INITIALIZE command.
0x028
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
DATAREV R(r) 0x0
Reset
Access
Name
Bit reversed version of CRC Data register. When a 32-bit CRC polynomial is selected, the reversal occurs on the entire
32-bit word. When a 16-bit CRC polynomial is selected, the bits [15:0] are reversed.
0x02C 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
DATABYTEREV R(r) 0x0
Reset
Access
Name
Byte reversed version of CRC Data register. When a 32-bit CRC polynomial is selected, the bytes are swizzled to {B0,
B1, B2, B3}. When a 16-bit CRC polynomial is selected, the bytes are swizzled to {0, 0, B0, B1}.
Quick Facts
What?
0 1 2 3 4
The System Real-Time Counter (SYSRTC) is a 32-
bit Real Time Clock ensuring timekeeping in low en-
ergy modes.
Why?
How?
14.1 Introduction
The SYSRTC (System Real Time Counter), is a 32-bit counter kept running down to energy mode EM3. It can be used as a sleep
timer / wakeup source as well as a timekeeping counter during low energy modes. Multiple groups of capture / compare registers are
available to different cores in the system, allowing the peripheral and time base to be shared across cores and save energy. Only group
0 registers are directly accessible to the main processor core, but compare / capture signals and interrupts from group 1 are also availa-
ble to the main processor.
Capture compare channels can be used to trigger interrupts, generate PRS signals, capture PRS events, and to wake the device up
from EM1, EM2, or EM3.
Note: Critical portions of the EFR32/EFM32 software stack related to system timing and power management make use of
SYSRTC in such a way that it is effectively unavailable to user software. Please refer to relevant software documentation for
additional information.
14.2 Features
• 32-bit counter
• Debug mode
• 32.768 kHz LFXO or LFRCO / 1 kHz ULFRCO
• Low energy wake-up source
• Separate groups of capture / compare registers and signals
• 2 compare channels per group
• 1 capture channel per group
• Capture / compare available in PRS
Each group has a dedicated, independent interrupt line, and has the ability to wake the system. The Group 0 interrupt line
(SYSRTC_APP) is used and fully controlled by user code running on the main processor. The Group 1 interrupt line (SYSRTC_SEQ) is
also available to the main processor, but Group 1 registers and configuration are not directly available to the user application.
14.3.2 Counter
A single counter value (CNT) is used across all groups. The SYSRTC module is enabled by setting its EN bit field. The counter value is
asserted to 0x00000000 on reset. The counter can be started/stopped by writing to the START/STOP bit fields in the CMD register. The
RUNNING field in the STATUS register indicates that the counter is running when it is set.
Once started, the counter increments by 1 on each cycle (typically 32.768 kHz). The counter value can be programmed directly by writ-
ing to the CNT register. Once the programmed value is applied and the counter is running, the counter will increment on every clock
starting from the newly programmed value.
When the counter reaches its maximum value of 0xFFFFFFFF, an overflow event is generated, followed by a counter wrap-around to
its reset value (from which counting continues) and the OVF interrupt flag (OVFIF) on the next cycle. The overflow event is common for
all the groups, i.e. OVFIF flags in all groups get set.
The normal operation of SYSRTC is to configure it, enable it, start it, and then leave it running. This should be done by a single core so
that other cores only access the registers for their designated group as needed. If SYSRTC needs to be disabled, it is recommended to
stop it first using the STOP command.
A compare event for channel "x" of group "n" is generated whenever the counter is RUNNING, the CMPxEN bit is set / enabled in the
GRPn_CTRL register, and the CNT value is equal to the GRPn_CMPxVALUE register setting. This event is followed by
GRPn_IF.CMPxIF being set on the next counter clock cycle.
Compare events can be routed as PRS producers on the GRPnOUTx signals. There are several options for the match action, selected
by CMPxCMOA in GRPn_CTRL. Note that when using the PULSE option, the PRS output should already be cleared for the pulse to
get set and the PULSE option should remain configured until the pulse is cleared (otherwise if the PULSE option is reprogrammed to
the SET option, the "pulse" remains set). A possible use case when using the CMPIF option is to signal early events prior to the follow-
ing wake-up. After wakeup, the compare flag should be processed and cleared. To avoid a race condition on the PRS output, the com-
pare flag should be cleared away from the next possible compare event.
Note that when setting the compare value to the current counter value, a compare event may not get generated until the counter over-
flows and reaches the current value again. To generate a compare event quickly, it is recommended to program the compare value to
the current counter value + 1. Compare events are group-specific.
SYSRTC groups support counter value capture triggered by PRS consumer signals. For group "n" the SYSRTC0 "INn" PRS consumer
is used to trigger captures. Capture can be triggered on RISING, FALLING, or BOTH edges, according to the setting programmed in
CAP0EDGE of the GRPn_CTRL register. A capture event for group "n" is generated whenever the counter is RUNNING, the CAP0EN
bit is set / enabled in the GRPn_CTRL register, and the desired event occurs on the PRS output.
A capture event is followed by GRPn_IF_CAP0IF being set after up to 3 counter clock cycles. At the same time the flag is set, the
GRPn_CAP0VALUE register captures the current counter value. Note that PRS input edges should not occur more frequently than
once every three counter cycles. If the counter is being started/stopped or GRPn_CTRL.CAP0EN / GRPn_CTRL.CAP0EDGE is
changed close to the PRS input edge, a race condition may occur. Capture events are group-specific.
On SWRST / Disablement, the counter is reset to 0x00000000, PRS outputs are cleared, compare/capture events are disabled, com-
pare/capture flags are reset, and the CAP0VALUE register is reset.
When the counter is stopped using the STOP command in the CMD register, all other settings remain unchanged, except that the RUN-
NING status will return to 0, which blocks any compare/capture events until the counter is started again.
By default, the counter value is frozen when the main processor is halted during debugging. The RUNNING status bit is not affected by
debug halt, and will continue to indicate that the counter is active. If DEBUGRUN in the CFG register is set, the counter will not halt
when the main processor is halted, and SYSRTC will continue to count clocks.
Note that the main processor runs on a much higher frequency than the counter and that the halt condition needs to last long enough
(more than 3 counter cycles) for the counter to reach the frozen state.
0x000
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
0x1
Reset
Access
IPVERSION R
Name
0x004
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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when EN cleared and cleared when the peripheal core reset is finished
0x008 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
0x0 1
0x0 0
Reset
Access
W
RESETTING R
SWRST
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When SWRST command is issued, resetting logic sets this status immediately and it is later cleared when the reset proc-
ess is finished
A software reset command field resets the module back to the initial condition, similar to the power-on reset condition
0x00C
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
DEBUGRUN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set this bit to keep the SYSRTC running during a debug halt.
0x010 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
W(nB) 0x0 1
START W(nB) 0x0 0
Reset
Access
STOP
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014
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
0x0 1
0x0 0
Reset
Access
LOCKSTATUS R
R
RUNNING
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018 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
CNT RW 0x0
Reset
Access
Name
0x01C
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
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
START R
STOP
Name
CNT
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 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
0x0
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock EN, SWRST, CFG, CMD, CNT registers from editing. Write the unlock
code to unlock.
0x040
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
RW 0x0 3
CMP1 RW 0x0 2
CMP0 RW 0x0 1
RW 0x0 0
Reset
Access
CAP0
OVF
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x044 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
RW 0x0 3
CMP1 RW 0x0 2
CMP0 RW 0x0 1
RW 0x0 0
Reset
Access
CAP0
OVF
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x048 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
CMP1CMOA RW 0x0 7
6
5
CMP0CMOA RW 0x0 4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
CAP0EDGE
CMP1EN
CMP0EN
CAP0EN
Name
31:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x04C
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
CMP0VALUE RW 0x0
Reset
Access
Name
0x050
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
CMP1VALUE RW 0x0
Reset
Access
Name
0x054 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
0x0
Reset
Access
CAP0VALUE R
Name
0x058
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
0x0 2
0x0 1
0x0 0
Reset
Access
CMP1VALUE R
CMP0VALUE R
R
Name
CTRL
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Quick Facts
What?
0 1 2 3 4
The BURTC is a 32 bit counter which operates on a
low frequency oscillator, and is capable of running in
all Energy Modes.
Why?
How?
15.1 Introduction
The Back-Up Real Time Counter (BURTC) is a 32-bit counter which operates on a low frequency oscillator, and is capable of running in
all Energy Modes. It can provide periodic Wakeup events and PRS signals which can be used to wake up peripherals from any energy
mode. The BURTC provides a very wide range of periods for the interrupts facilitating flexible ultra-low energy operation. The availabili-
ty of the BURTC in EM4, where most of the device is powered down, makes it ideal for keeping track of time in EM4. A single compare
channel is available which can be used to trigger an interrupt and/or wake the device up from a low energy mode.
15.2 Features
A low frequency oscillator is used as clock signal and the BURTC with one compare channel which can trigger wake-up, generate PRS
signalling, or capture system events. 32-bit resolution and selectable prescaling allows the system to stay in low energy modes for long
periods of time and still maintain reliable timekeeping.
• 32-bit Real Time Counter
• 15-bit pre-counter for flexible frequency scaling of main counter
• EM2/3/4 operation and wakeup
• Reset only by External Pin and Power-On Resets
• Interrupt/wake up event after deterministic intervals
• PRS Outputs
• Debug mode
• Configurable to either run or stop when processor is stopped (break)
An overview of the BURTC module is shown in Figure 15.1 BURTC Overview on page 430.
0xFFFFFFFF
BURTC_COMP
BURTC_CFG.CNTPRESC
Clear
BURTC_CFG.COMPTOP
Counter Pre-Counter
BURTCCLK
BURTC_CNT BURTC_PRECNT
[31:0]
CNT
BURTC_COMP
= COMP
PRS output
OF
0xFFFFFFFF
Compare
COMP Interrupt
= CNT Overflow
generation
OF
The BURTC source clock (BURTCCLK) can be selected to be the LFXO, LFRCO, or ULFRCO by configuring the
CMU_EM4GRPACLKCTRL.CLKSEL bitfield. Note that in EM3, only ULFRCO is a valid source clock.
15.3.2 Configuration
To configure and use the BURTC properly, the following programming sequence must be followed:
1. Configure any desired options in the BURTC_CFG register. Note that the BURTC_CFG register can only be written when
BURTC_EN.EN = 0 - a bus fault will occur if writing BURTC_CFG register while BURTC_EN.EN = 1.
2. Set BURTC_EN.EN = 1.
3. Set BURTC_CMD.START = 1 to start the BURTC counter.
Note: All low frequency synchronization registers can only be programmed after EN is set to 1. The BURTC counter will only start
to count once START command is issued. For HV Sync registers (e.g., BURTC_CMD), the first bitfield write will occur without is-
sue. However, on subsequent bitfield writes to HV Sync registers, the firmware needs to poll the corresponding bit in
BURTC_SYNCBUSY before programming the same bitfield once again.
By default, the BURTC is halted when code execution is halted from the debugger. By setting the DEBUGRUN bit in the BURTC_CFG
register, the BURTC will continue to run even when the debugger has halted the system.
15.3.4 Counter
The BURTC consists of two counters: the 32-bit main counter, BURTC_CNT, and a 15-bit pre-counter, BURTC_PRECNT. The pre-
counter is a free running counter clocked by low frequency clock, used to generate a specific frequency for the main counter. The pre-
counter will be counting only when the BURTC_CFG.CNTPRESC value is set greater than 0.
The BURTC peripheral clock is requested by setting the EN bit in BURTC_EN. Then the BURTC counters can be started by setting the
command register START in BURTC_CMD. When BURTC_CMD.START has been initiated and BURTC_CFG.CNTPRESC > 0, the
pre-counter (BURTC_PRECNT) increments upon each positive clock edge of the BURTCCLK, wrapping around to zero when it over-
flows.
The main counter can be accessed in BURTC_CNT register, and counts at frequency determined by the CNTPRESC bitfiled in
BURTC_CFG. Setting CNTPRESC to 0 gives the maximum resolution, with the main counter clocked at the same frequency as the
BURTCCLK. When CNTPRESC > 0, the main counter increments upon each tick given from the pre-counter, allowing the main counter
ticks to be power-of-2 divisions of the BURTCCLK.
The Table 15.1 BURTC Resolution vs Overflow, FBURTCCLK = 32768 Hz on page 431 table below shows the BURTC Resolution vs
Overflow Time when using a 32768 Hz oscillator as the source clock of BURTC.
By default, the counter will keep counting until it reaches the top value, 0xFFFFFFFF, and then it wrap around and continue counting
from zero. If COMPTOP in BURTC_CFG is set, the main counter will wrap to 0 on a Compare value match (i.e., BURTC_CNT =
BURTC_COMP). If using the Compare value match, make sure to set COMPTOP prior to or at the same time the BURTC is enabled.
Setting COMPTOP after enabling the BURTC will result in a bus fault error.
The counters of the BURTC, BURTC_CNT and BURTC_PRECNT, can at any time be written by software, as long as the registers are
not locked using BURTC_LOCKKEY. All BURTC control registers with Sync Type HV uses the 2 FF synchronization scheme.
Note: Writing to the BURTC_PRECNT register may alter the frequency of the ticks for the BURTC_CNT register.
A single compare channel is available in the BURTC. The compare value is set in BURTC_COMP register. If BURTC_CFG.COMPTOP
is set, the main counter will clear to 0 when it matches the value set in BURTC_COMP.
15.3.6 Interrupts
The BURTC has two interrupts: one for counter overflow and another for the compare match event. Individual interrupts are enabled by
BURTC_IEN register bits, and the respective bits can be used as EM2 wakeup. BURTC_EM4WUEN enables the wakeup enable from
EM4 for those events.
To prevent accidental writes to the BURTC registers, the BURTC_LOCK register can be written to any other value than the unlock val-
ue. To unlock the register, write the unlock value to BURTC_LOCKKEY. Registers affected by this lock are:
• BURTC_CFG
• BURTC_EN
• BURTC_CMD
• BURTC_PRECNT
• BURTC_CNT
• BURTC_COMP
• BURTC_IEN
0x000
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
0x1
Reset
Access
IPVERSION R
Name
0x004 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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When EN is cleared, DISABLING is set immediately, and cleared when disablement finishes. Disablement resets periph-
eral cores and not APB registers except hardware updated registers such as INTFLAGs and FIFOs. The CNT and
PRECNT count registers are not reset during disablement.
Enable the BURTC to make the peripheral clock available to the module
0x008 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
RW 0x0 1
DEBUGRUN RW 0x0 0
RW 0x0
Reset
Access
CNTPRESC
COMPTOP
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, the counter is cleared in the clock cycle after a compare match with compare channel
0x00C
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
W(nB) 0x0 1
START W(nB) 0x0 0
Reset
Access
STOP
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 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
0x0 1
0x0 0
Reset
Access
R
RUNNING R
Name
LOCK
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014
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
COMP RW 0x0 1
RW 0x0 0
Reset
Access
Name
0x018 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
COMP RW 0x0 1
RW 0x0 0
Reset
Access
Name
OF
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x01C
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
PRECNT RW 0x0 7
6
5
4
3
2
1
0
Reset
Access
Name
31:15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 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
CNT RW 0x0
Reset
Access
Name
0x024
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
COMPEM4WUEN RW 0x0 1
RW 0x0 0
Reset
Access
OFEM4WUEN
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Compare Match EM4 wakeup requests. No Synchronization done into peripheral clock domain.
Overflow EM4 Wakeup request. No Synchronization done into peripheral clock domain.
0x028 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
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
PRECNT R
R
R
START
COMP
STOP
Name
CNT
Bit Name Reset Access Description
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x02C 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
0xAEE8
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock BURTC_EN, BURTC_CFG, BURTC_CMD, BURTC_PRECNT,
BURTC_CNT and BURTC_COMP registers from editing. Write the unlock code to unlock.
0x030
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
COMP RW 0x0
Reset
Access
Name
A compare match event occurs when CNT is equal to this value. This event sets the COMP interrupt flag. It is also avail-
able as a PRS signal.
Quick Facts
What?
0 1 2 3 4
The BURAM is a dedicated 128-byte low-power
RAM that is retained in EM4.
Why?
How?
16.1 Introduction
The Back-Up RAM (BURAM) is a dedicated 128-byte RAM that remains powered when the system enters EM4. Upon exit from EM4,
the data retained in the BURAM can be accessed by the application software.
The BURAM consists of 32 x 32-bit registers, which are retained in all energy modes, including EM4. Each word in the BURAM is ac-
cessible through the corresponding 32 RETx_REG register. Note that each RETx_REG register has an undefined state out of reset.
0x000
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
RETREG RW 0x0
Reset
Access
Name
The RETREG registers are undefined out of reset. Any written RETREG values will be retained through any event other
than a brownout or power-on reset.
Quick Facts
What?
0 1 2 3 4
The LETIMER is a down-counter that can keep track
of time and output configurable waveforms. Running
on a 32768 Hz clock, the LETIMER is available in
EM0 Active, EM1 Sleep, EM2 DeepSleep, and EM3
Stop.
Why?
How?
17.1 Introduction
The LETIMER is a down-counter that can keep track of time and output configurable waveforms with minimal software intervention.
Running on a Low Frequency clock, the LETIMER is available in Energy Mode0, Energy Mode 1 and optionally available in Energy
Mode 2 and Energy Mode 3. Because of this, it can be used for timing and output generation when most of the device is powered
down, allowing simple tasks to be performed while the power consumption of the system is kept at an absolute minimum. It is well suit-
ed for applications such as metering systems or to provide more compare values than available in the SYSRTC. With buffered repeat
and top value registers, the LETIMER can provide glitch-free waveforms at frequencies up to 16 kHz. It can be coupled with other pe-
ripherals using PRS, allowing advanced time-keeping and wake-up functions
17.2 Features
High-level features
• 24-bit Down counter
• 8-bit prescalar
• 2 Compare match registers
• TOP register can be Timer top value
• TOP register can be double buffered using TOPBUFF register
• Double buffered 8-bit Repeat Register
• Timer Start/Stop/Clear trigger can be from PRS or Software
• Configurable 2 Output pins - Toggle/Pulse/PWM
• Interrupt - Compare match/Timer underflow/Repeat done
• Optionally runs during debug
• 2 output pins can optionally be configured to provide different waveforms on timer underflow:
• Toggle output pin
• Pulse output with width of One Prescaled clock period
• PWM
• 2 PRS Output
An overview of the LETIMER module is shown in Figure 17.1 LETIMER Overview on page 446. The LETIMER is a 24-bit down-counter
with two compare registers, LETIMERn_COMP0 and LETIMERn_COMP1. The LETIMERn_TOP register can optionally act as a top
value for the counter. The repeat counter LETIMERn_REP0 allows the timer to count a specified number of times before it stops. Both
the LETIMERn_TOP and LETIMERn_REP0 registers can be double buffered by the LETIMERn_TOPBUFF and LETIMERn_REP1 reg-
isters to allow continuous operation. The timer can generate a single pin output, or two linked outputs.
COMP1 Match
=
(COMP1 interrupt flag)
Top Buffer
COMP0
Top load
logic
COMP0 Match
=
(COMP0 interrupt flag)
TOP
Underflow
PRS event Start
(UF interrupt flag)
SW Pulse
CNT (Counter) =0 PRS CH0/OUT0
Control
LETIMERn_CLK
Pulse
PRS event Control PRS CH1/OUT1
PRS event
Clear Stop
SW
REP1
=1 REP1 Zero
(Repeat Buffer)
(REP1 interrupt flag)
Timer
The timer value can be read using the LETIMERn_CNT register. The value can be written, and it can also be cleared by setting the
CLEAR command bit in LETIMERn_CMD. If the CLEAR and START commands are issued at the same time, the timer will be cleared,
then start counting at the top value.
Compare Registers
• The LETIMER has two compare match registers, LETIMERn_COMP0 and LETIMERn_COMP1. Each of these compare registers
are capable of generating an interrupt when the counter value LETIMERn_CNT is equal to their value. When LETIMERn_CNT is
equal to the value of LETIMERn_COMP0, the interrupt flag COMP0 in LETIMERn_IF is set, and when LETIMERn_CNT is equal to
the value of LETIMERn_COMP1, the interrupt flag COMP1 in LETIMERn_IF is set.
• Top Value
If CNTTOPEN in LETIMERn_CTRL is set, the value of LETIMERn_TOP acts as the top value of the timer, and LETIMERn_TOP is
loaded into LETIMERn_CNT on timer underflow. If CNTTOPEN is cleared to 0, the timer wraps around to 0xFFFFFF. The underflow
interrupt flag UF in LETIMERn_IF is set when the timer reaches zero.
• Repeat Modes
By default, the timer wraps around to the top value or 0xFFFFFF on each underflow, and continues counting. The repeat counters
can be used to get more control of the operation of the timer, including defining the number of times the counter should wrap around.
Four different repeat modes are available, see Table 17.1 LETIMER Repeat Modes on page 447.
The interrupt flags REP0 and REP1 in LETIMERn_IF are set whenever LETIMERn_REP0 or LETIMERn_REP1 are decremented to
0 respectively. REP0 is also set when the value of LETIMERn_REP1 is loaded into LETIMERn_REP0 in buffered mode.
Write operations to LETIMERn_REP0 have priority over buffer loads from LETIMERn_REP1.
• Buffered Top Value
In Buffered Mode, If BUFTOP in LETIMERn_CTRL is set, the value of LETIMERn_TOP is buffered by LETIMERn_TOPBUFF. In this
mode, the value of LETIMERn_TOPBUFF is loaded into LETIMERn_TOP every time LETIMERn_REP0 is about to decrement to 0.
This can be used to generate continually changing output waveforms.
Write operations to LETIMERn_TOP have priority over buffer loads from LETIMERn__TOPBUFF.
In free-running mode, the LETIMER acts as a regular timer and the repeat operation is disabled. When started, the timer runs until it is
stopped using the STOP command bit in LETIMERn_CMD/PRS. A state machine for this mode is shown in Figure 17.2 LETIMER State
Machine for Free-running Mode on page 448 .
START = 0
YES
STOP = 0
Note that the CLEAR command bit in LETIMERn_CMD always has priority over Decrement and Load TOP to LETIMERn_CNT. When
the clear command is used, LETIMERn_CNT is set to 0 and an underflow event will not be generated when LETIMERn_CNT wraps
around to the top value or 0xFFFFFF. Since no underflow event is generated, no output action is performed. LETIMERn_REP0, LETI-
MERn_REP1, LETIMERn_COMP0 and LETIMERn_COMP1 are also left untouched.
The one-shot repeat mode is the most basic repeat mode. In this mode, the repeat register LETIMERn_REP0 is decremented every
time the timer underflows, and the timer stops when LETIMERn_REP0 goes from 1 to 0. In this mode, the timer counts down LETI-
MERn_REP0 times, i.e. the timer underflows LETIMERn_REP0 times.
Note: Note that write operations to LETIMERn_REP0 have priority over the timer decrement event. If LETIMERn_REP0 is assigned a
new value in the same cycle as a timer decrement event occurs, the timer decrement will not occur and the new value is assigned.
LETIMERn_REP0 can be written while the timer is running to allow the timer to run for longer periods at a time without stopping. Write
to LETIMERn_REP0 should be done after checking SYNC busy statusFigure 17.3 LETIMER One-shot Repeat State Machine on page
449 .
If (STOP)
RUNNING = 0
NO RUNNING Else if (START)
RUNNING = 1
End if
YES
NO START START = 0
STOP = 0
YES
YES YES
CNT = TOP*
CNT = TOP* NO REP0 == 0 REP0 < 2 NO If (!START)
REP0 = REP0 - 1
YES YES
STOP = 1
REP0 = 0
TOP*
If (COMP0TOP)
TOP* = COMP0
Else
TOP* = 0xFFFF
The Buffered repeat mode allows buffered timer operation. When started, the timer runs LETIMERn_REP0 number of times. If LETI-
MERn_REP1 has been written since the last time it was used and if it is nonzero, LETIMERn_REP1 is then loaded into LETI-
MERn_REP0, and counting continues the new number of times. The timer keeps going as long as LETIMERn_REP1 is updated with a
nonzero value before LETIMERn_REP0 is finished counting down. The timer top value (LETIMERn_TOP) may also optionally be buf-
fered using Top buff value (LETIMERn_TOPBUFF) by setting BUFTOP in LETIMERn_CTRL.
If the timer is started when both LETIMERn_CNT and LETIMERn_REP0 are zero but LETIMERn_REP1 is non-zero, LETIMERn_REP1
is loaded into LETIMERn_REP0, and the counter counts the loaded number of times.
Used in conjunction with a buffered top value, both the top and repeat values of the timer may be buffered, and the timer can for in-
stance be set to run 4 times with period 7 (top value 6), 6 times with period 200, then 3 times with period 50.
A state machine for the buffered repeat mode is shown in Figure 17.4 LETIMER Buffered Repeat State Machine on page 450.
REP1USED shown in the state machine is an internal variable that keeps track of whether the value in LETIMERn_REP1 has been loa-
ded into LETIMERn_REP0 or not. The purpose of this is that a value written to LETIMERn_REP1 should only be counted once.
REP1USED is cleared whenever LETIMERn_REP1 is used.
YES YES
CNT = TOP*
CNT = TOP* NO REP0 == 0 REP0 < 2 NO If (!START)
REP0 = REP0 - 1
YES
YES
CNT = TOP** CNT = TOP**
If (BUFTOP) If (BUFTOP)
COMP0 = COMP1 COMP0 = COMP1
NO REP1 == 0 !REP1USED and !REP1 != 0 YES
REP0 = REP1 REP0 = REP1
REP1USED = 1 REP1USED = 1
YES NO
STOP = 1
REP0 = 0
TOP* TOP**
If (COMP0TOP) If (!COMP0TOP)
TOP* = COMP0 TOP** = 0xFFFF
Else Else if (BUFTOP)
TOP* = 0xFFFF TOP** = COMP1
Else
TOP** = COMP0
The Double repeat mode works much like the one-shot repeat mode. The difference is that, where the one-shot mode counts as long
as LETIMERn_REP0 is larger than 0, the double mode counts as long as either LETIMERn_REP0 or LETIMERn_REP1 is larger than
0. As an example, say LETIMERn_REP0 is 3 and LETIMERn_REP1 is 10 when the timer is started. If no further interaction is done with
the timer, LETIMERn_REP0 will now be decremented 3 times, and LETIMERn_REP1 will be decremented 10 times. The timer counts a
total of 10 times, and LETIMERn_REP0 is 0 after the first three timer underflows and stays at 0. LETIMERn_REP0 and LETI-
MERn_REP1 can be written at any time. After a write to either of these, the timer is guaranteed to underflow at least the written number
of times if the timer is running. Use the Double repeat mode to generate output on both the LETIMER outputs at the same time. The
state machine for this repeat mode can be seen in Figure 17.5 LETIMER Double Repeat State Machine on page 451.
YES YES
CNT = TOP*
REP0 == 0 REP0 < 2 If (REP0 > 0)
CNT = TOP* NO and And NO REP0 = REP0 - 1
REP1 == 0 REP1 < 2 If (REP1 > 0)
REP1 = REP1 - 1
YES YES
STOP = 1
REP0 = 0
TOP*
If (COMP0TOP)
TOP* = COMP0
Else
TOP* = 0xFFFF
The LETIMER clock source is derived from EM23GRPACLK, which is selected in the Clock Management Unit (CMU), and is typically
configured to have a frequency of 32 kHz in EM0/1/2 and 1 kHz in EM3. The LETIMER clock prescaler is defined by LETIMERn_CTRL-
>CNTPRESC.
The LETIMER Prescaled clock frequency is given by Figure 17.6 LETIMER Clock Frequency on page 452.
fLETIMERn_CLK = 32768/2CNTPRESC
fLETIMERn_CLK = 1024/2CNTPRESC
The LETIMER can be configured to start, stop, and/or clear based on PRS inputs. The diagram showing the functions of the PRS input
triggers is shown in Figure 17.7 LETIMER PRS input triggers. on page 453.
There are 3 PRS inputs to the LETIMER, allowing the LETIMER to be started, stopped, or cleared based on the PRS inputs. The
PRSSTARTMODE, PRSSTOPMODE, and PRSCLEARMODE bitfields in LETIMERn->PRSMODE select which edge or edge(s) will
trigger the start, stop, and/or clear action.
PRSSTARTMODE
PRSSTARTSEL PRSSTARTEN
None
Rising
Falling PRS_START
PRS_IN[11:0] Synchronizer Edge Detect Both
EM23GRPACLK
PRSSTOPMODE
PRSSTOPSEL PRSSTOPEN
None
Rising
Falling PRS_STOP
PRS_IN[11:0] Synchronizer Edge Detect Both
EM23GRPACLK
PRSCLEARMODE
PRSCLEARSEL PRSCLEAREN
None
Rising
Falling PRS_CLEAR
PRS_IN[11:0] Synchronizer Edge Detect Both
EM23GRPACLK
17.6 Debug
If DEBUGRUN in LETIMERn_CTRL is cleared, the LETIMER automatically stops counting when the CPU is halted during a debug ses-
sion, and resumes operation when the CPU continues. Because of synchronization, the LETIMER is halted two clock cycles after the
CPU is halted, and continues running two clock cycles after the CPU continues. RUNNING in LETIMERn_STATUS is not cleared when
the LETIMER stops because of a debug-session.
Set DEBUGRUN in LETIMERn_CTRL to allow the LETIMER to continue counting even when the CPU is halted in debug mode.
The output actions can be set by configuring UFOA0 and UFOA1 in LETIMERn_CTRL. UFOA0 defines the action on output 0, while
UFOA1 defines the action on output 1. The possible actions are defined in Table 17.2 LETIMER Underflow Output Actions on page
454.
Note: For the Pulse output Disabling LETIMER, Clearing Output while pulse output is generated can affect the pulse width.
Note: For Double mode, OUT0/1 generation is enabled when LETIMERn_REP0/1 != 0 respectively.
The polarity of the outputs can be set individually by configuring OPOL0 and OPOL1 in LETIMERn_CTRL. When these are cleared,
their respective outputs have a low idle value and a high active value. When they are set, the idle value is high, and the active value is
low. It is recommended to Clear outputs after changing polarity to makesure outputs take their default value.
When using the toggle action, the outputs can be driven to their idle values by setting their respective CTO0/CTO1 command bits in
LETIMERn_CTRL. This can be used to put the output in a well-defined state before beginning to generate toggle output, which may be
important in some applications. The command bit can also be used while the timer is running.
The LETIMER outputs can be routed out onto the PRS system. LETn_O0 can be routed to PRS channel 0, and LETn_O1 can be rout-
ed to PRS channel 1. Enabling the PRS connection can be done by setting SOURCESEL to LETIMERx and SIGSEL to LETIMERxCHn
in PRS_CHx_CTRL.
17.9 Interrupts
The interrupts generated by the LETIMER are combined into one interrupt vector. If the interrupt for the LETIMER is enabled, an inter-
rupt will be made if one or more of the interrupt flags in LETIMERn_IF and their corresponding bits in LETIMER_IEN are set.
The LETIMER can be enabled all the way down to EM3 by using the ULFRCO as clock source. This is done by setting
CMU_EM23GRPACLKCTRL.CLKSEL to ULFRCO before enabling the LETIMER block.
This module is a Low Energy Peripheral, and supports immediate synchronization. For description regarding immediate synchroniza-
tion, refer to 4.2.4.4 Peripheral Access Performance.
Since this module is a Low Energy Peripheral, and runs off a clock which is asynchronous to the APB register clock, special considera-
tions must be taken when accessing registers.
Important Note : Before writing any LFSYNC register, the module must be enabled ( LETIMER_EN->EN) and the LETIMER_SYN-
CBUSY register should be polled to ensure the SYNC busy of that particular register field is not high.
LETIMER operation in Free running Mode with different output modes are shown in Figure 17.8 LETIMER - Free Running Mode Wave-
form on page 455. In this example, REPMODE in LETIMERn_CTRL is set to FREE, CNTTOPEN also in LETIMERn_CTRL has been
set and LETIMERn_TOP has been written to 3. As seen in the figure, LETIMERn_TOP now decides the length of the signal periods.
For the toggle mode, the period of the output signal is 2(LETIMERn_TOP + 1), and for the pulse modes, the periods of the output sig-
nals are LETIMERn_TOP+1. Note that the pulse outputs are delayed by one period relative to the toggle output. The pulses come at
the end of their periods.
Initial configuration
COMP0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
CNT 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
LETIMERn_CLK
LETn_O0
UFOA0 = 00
LETn_O0
UFOA0 = 01
LETn_O0
UFOA0 = 10
LETIMER operation in ONESHOT Mode with different output modes are shown in Figure 17.9 LETIMER - One Shot Mode Waveform
on page 456. In this example, REPMODE in LETIMERn_CTRL is set to ONESHOT, CNTTOPEN also in LETIMERn_CTRL has been
set and LETIMERn_TOP has been written to 3 and LETIMERn_REP0 has been written to 3. The resulting behavior is pretty similar to
that shown in Figure 6, but in this case, the timer stops after counting to zero LETIMERn_REP0 times. By using LETIMERn_REP0 the
user has full control of the number of pulses/toggles generated on the output.
CNT 0 3 2 1 0 3 2 1 0 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0
REP0 3 3 3 3 3 2 2 2 2 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
LETn_O0
UFOA0 = 00
LETn_O0
UFOA0 = 01
LETn_O0
UFOA0 = 10
LETIMER operation in DOUBLE Mode with both outputs is shown in Figure 17.10 LETIMER - Double Mode Waveform on page 456.
UFOA0 and UFOA1 in LETIMERn_CTRL are configured for pulse output and the outputs are configured for low idle polarity. As seen in
the figure, the number written to the repeat registers determine the number of pulses generated on each of the outputs.
UFOA0 = 10
UFOA1 = 10
REP0 = 2 REP0 = 2
REP1 = 7 REP0 = 3 REP1 = 3
START START START
LETn_O0
LETn_O1
In BUFFERED Mode LETIMERn_TOPBUFF and LETIMERn_REP1 registers are used as Buffers for LETIMERn_TOP and LETI-
MERn_REP0 respectiverly. If both LETIMERn_TOP and LETIMERn_REP0 are 0 in buffered mode, and CNTTOPEN and BUFTOP in
LETIMERn_CTRL are set, the values of LETIMERn_TOPBUFF and LETIMERn_REP1 are loaded into LETIMERn_TOP and LETI-
MERn_REP0 respectively when the timer is started. If no additional writes to LETIMERn_REP1 are done before the timer stops, LETI-
MERn_REP1 determines the number of pulses/toggles generated on the output, and LETIMERn_TOPBUFF determines the period
lengths.
As the SYSRTC can also be used via PRS to start the LETIMER, the SYSRTC and LETIMER can thus be combined to generate specif-
ic pulse-trains at given intervals. Software can update LETIMERn_TOPBUFF and LETIMERn_REP1 to change the number of pulses
and pulse-period in each train, but if changes are not required, software does not have to update the registers between each pulse
train.
For the example in Figure 17.11 LETIMER - Buffered Mode Waveform on page 457, the initial values cause the LETIMER to generate
two pulses with 3 cycle periods, or a single pulse 3 cycles wide every time the LETIMER is started. After the output has been gener-
ated, the LETIMER stops, and is ready to be triggered again.
TOP1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
TOP0 X 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
CNT 0 2 1 0 2 1 0 0 0 0 0 0 2 1 0 2 1 0 0 0 0 2 1 0
REP0 0 2 2 2 1 1 1 0 0 0 0 0 2 2 2 1 1 1 0 0 0 2 2 2
REP1 2 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u 2u
LETIMERn_CLK
LETn_O0
UFOA0 = 01
LETn_O1
UFOA0 = 10
In some scenarios, it might be desired to make LETIMER generate a continuous waveform. Very simple constant waveforms can be
generated without the repeat counter as shown in Figure 17.8 LETIMER - Free Running Mode Waveform on page 455, but to generate
changing waveforms, using the repeat counter and buffer registers can prove advantageous.
For the example in Figure 17.12 LETIMER - Continuous Operation on page 458, the goal is to produce a pulse train consisting of 3
sequences with the following properties:
• 3 pulses with periods of 3 cycles
• 4 pulses with periods of 2 cycles
• 2 pulses with periods of 3 cycles
Write
COMP1 = 2
Initial configuration, REP1 = 2 Stop,
REPB just written
final values
COMP1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2
COMP0 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2
CNT 0 2 1 0 2 1 0 2 1 0 1 0 1 0 1 0 1 0 2 1 0 2 1 0 0
REP0 3 3 3 3 2 2 2 1 1 1 4 4 3 3 2 2 1 1 2 2 2 1 1 1 0
REP1 4 4 4 4 4 4 4 4 4 4 4u 4u 4u 2 2 2 2 2 2u 2u 2u 2u 2u 2u 2u
LETIMERn_CLK
LETn_O0
UFOA0 = 01
LETn_O1
UFOA0 = 10
The first two sequences are loaded into the LETIMER before the timer is started.
LETIMERn_TOP is set to 2 (cycles – 1), and LETIMERn_REP0 is set to 3 for the first sequence, and the second sequence is loaded
into the buffer registers, i.e. TOPBUFF is set to 1 and LETIMERn_REP1 is set to 4.
The LETIMER is set to trigger an interrupt when LETIMERn_REP0 is done by setting REP0 in LETIMERn_IEN. This interrupt is a good
place to update the values of the buffers. Last but not least REPMODE in LETIMERn_CTRL is set to buffered mode, and the timer is
started.
In the interrupt routine the buffers are updated with the values for the third sequence. If this had not been done, the timer would have
stopped after the second sequence.
The final result is shown in Figure 17.12 LETIMER - Continuous Operation on page 458. The pulse output is grouped to show which
sequence generated which output. Toggle output is also shown in the figure. Note that the toggle output is not aligned with the pulse
outputs.
Note: Multiple LETIMER cycles are required to write a value to the LETIMER registers. The example in Figure 17.12 LETIMER - Con-
tinuous Operation on page 458 assumes that writes are done in advance so they arrive in the LETIMER as described in the figure.
Figure 17.13 LETIMERn_CNT Not Initialized to 0 on page 459 shows an example where the LETIMER is started while LETI-
MERn_CNT is nonzero. In this case the length of the first repetition is given by the value in LETIMERn_CNT.
Initial configuration,
Stop,
REP1 just written
final values
TOP1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
TOP0 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3
CNT 4 3 2 1 0 2 1 0 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 0
REP0 3 3 3 3 3 2 2 2 1 1 1 3 3 3 3 2 2 2 2 1 1 1 1 0
REP1 3 3 3 3 3 3 3 3 3 3 3 3u 3u 3u 3u 3u 3u 3u 3u 3u 3u 3u 3u 3u
LETn_O0
UFOA0 = 01
LETn_O1
UFOA0 = 10
There are several ways of generating PWM output with the LETIMER, but the most straight-forward way is to use the PWM output
mode. This mode is enabled by setting UFOA0 or UFOA1 in LETIMERn_CTRL to 3. In PWM mode, the output is set to idle on timer
underflow, and active on LETIMERn_COMP0/1 match, so if for instance CNTTOPEN = 1 and OPOL0 = 0 in LETIMERn_CTRL, LETI-
MERn_TOP determines the PWM period, and LETIMERn_COMP0/1 determines the active period.
The PWM period in PWM mode is LETIMERn_TOP + 1. There is no special handling of the case where LETIMERn_COMP0/1 > LETI-
MERn_TOP, so if LETIMERn_COMP0/1 > LETIMERn_TOP, the PWM output is given by the idle output value. This means that for
OPOLx = 0 in LETIMERn_CTRL, the PWM output will always be 0 for at least one clock cycle, and for OPOLx = 1 LETIMERn_CTRL,
the PWM output will always be 1 for at least one clock cycle.
To generate a PWM signal using the full PWM range, invert OPOLx when LETIMERn_COMP0/1 is set to a value larger than LETI-
MERn_TOP.
0x000
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
0x1
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004
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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When EN is cleared, DISABLING is set immediately, and cleared when disablement finishes. Disablement resets periph-
eral cores and not APB registers except hardware updated registers such as INTFLAGs, FIFOs etc.
0 EN 0x0 RW module en
Enable the LETIMER module. Software should write to CONFIG type registers before setting the ENABLE bit. Software
should write to SYNC type registers only after setting the ENABLE bit. When EN is cleared(disablement), it halts module
operation immediately, and initialize the core domain such that when the is re-enabled, it starts cleanly.
0x008 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
0x0 1
0x0 0
Reset
Access
W
RESETTING R
SWRST
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When SWRST command is issued, resetting logic sets RESETTING status immediately, and later it is cleared when re-
set process finishes.
A software reset command field resets the module back to the initial condition, similar to a power on reset condition
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
DEBUGRUN RW 0x0 12
11
10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
5
4
3
2
1
0
RW 0x0
RW 0x0
RW 0x0
RW 0x0
Reset
Access
CNTPRESC
CNTTOPEN
REPMODE
BUFTOP
Name
OPOL1
OPOL0
UFOA1
UFOA0
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Configure counting frequency of the CNT register. - Note - its not recommended to change this setting on the fly.
15:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to load TOPBUFF into TOP when REP0 reaches 0 in BUFFERED mode, allowing a buffered top value.
1 ONESHOT The counter counts REP0 times. When REP0 reaches zero, the
counter stops
2 BUFFERED The counter counts REP0 times. If REP1 has been written, it is
loaded into REP0 when REP0 reaches zero, otherwise the
counter stops
3 DOUBLE Both REP0 and REP1 are decremented when the LETIMER
wraps around. The LETIMER counts until both REP0 and REP1
are zero
0x010
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
W(nB) 0x0 4
W(nB) 0x0 3
CLEAR W(nB) 0x0 2
W(nB) 0x0 1
START W(nB) 0x0 0
Reset
Access
STOP
CTO1
CTO0
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014 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
0x0 1
0x0 0
Reset
Access
LETIMERLOCKSTATUS R
R
Name
RUNNING
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018
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
CNT RW 0x0
Reset
Access
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x01C 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
COMP0 RW 0x0
Reset
Access
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020
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
COMP1 RW 0x0
Reset
Access
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x024 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
TOP RW 0x0
Reset
Access
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x028
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
TOPBUFF RW 0x0
Reset
Access
Name
31:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
TOPBUFF will be used as Counter TOP Value in BUFFERED Mode if CNTTOPEN and BUFFTOP is set set to 1
0x02C 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
REP0 RW 0x0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x030
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
REP1 RW 0x0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x034 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
RW 0x0 4
RW 0x0 3
RW 0x0 2
COMP1 RW 0x0 1
COMP0 RW 0x0 0
Reset
Access
REP1
REP0
Name
UF
Bit Name Reset Access Description
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when repeat counter 0 reaches zero or when the REP1 interrupt flag is loaded into the REP0 interrupt flag.
0x038 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
RW 0x0 4
RW 0x0 3
RW 0x0 2
COMP1 RW 0x0 1
COMP0 RW 0x0 0
Reset
Access
REP1
REP0
Name
UF
Bit Name Reset Access Description
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x03C 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
0x0
Reset
Access
LETIMERLOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock LETIMER_EN, LETIMER_SWRST, LETIMER_CTRL, LETIM-
ER_CMD, LETIMER_CNT, LETIMER_COMP0, LETIMER_COMP1, LETIMER_TOP, LETIMER_TOPBUFF, LETIM-
ER_REP0, LETIMER_REP1 and PRSMODE registers from editing. Write the unlock code to unlock.
0x040 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
0x0 9
0x0 8
0x0 7
0x0 6
0x0 5
0x0 4
0x0 3
0x0 2
1
0x0 0
Reset
Access
R
R
CLEAR R
R
START R
R
R
R
R
STOP
CTO1
CTO0
REP1
REP0
Name
TOP
CNT
Bit Name Reset Access Description
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x050 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
PRSCLEARMODE RW 0x0
RW 0x0
PRSSTARTMODE RW 0x0
Reset
Access
PRSSTOPMODE
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Mode-NONE/RISING/FALLING/BOTH
1 RISING Rising edge of selected PRS input can clear the LETIMER
2 FALLING Falling edge of selected PRS input can clear the LETIMER
3 BOTH Both the rising or falling edge of the selected PRS input can
clear the LETIMER
25:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Mode-NONE/RISING/FALLING/BOTH
1 RISING Rising edge of selected PRS input can stop the LETIMER
2 FALLING Falling edge of selected PRS input can stop the LETIMER
3 BOTH Both the rising or falling edge of the selected PRS input can
stop the LETIMER
21:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Mode-NONE/RISING/FALLING/BOTH
1 RISING Rising edge of selected PRS input can start the LETIMER
2 FALLING Falling edge of selected PRS input can start the LETIMER
3 BOTH Both the rising or falling edge of the selected PRS input can
start the LETIMER
17:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Quick Facts
What?
0 1 2 3 4
The TIMER (Timer/Counter) keeps track of timing
and counts events, generates output waveforms,
and triggers timed actions in other peripherals.
Why?
Counter
Clock
Input capture
Capture values
18.1 Introduction
The general purpose timer has 3 or 4 compare/capture channels for input capture and compare/Pulse-Width Modulation (PWM) output.
The TIMER module may be 16 or 32 bits wide. Some timers also include a Dead-Time Insertion module suitable for motor control appli-
cations.
Refer to the device data sheet to determine the capabilities (capture/compare channel count, width, and DTI) of each timer instance.
18.2 Features
An overview of the TIMER module is shown in Figure 18.1 TIMER Block Overview on page 479 and it consists of a 16/32 bit up/down
counter with 3 compare/capture channels connected to pins TIMn_CC0, TIMn_CC1, and TIMn_CC2.
Quadrature
Decoder = Overflow
=0 Underflow
Input Capture
TIMERn.CC0
Edge Compare Match x
Input logic
detect
PRS inputs
Compare and
TnCCR1[15:0
TIMERn_CCx = TIMERn.CC0
TIMERn.CC1
TnCCR0[15:0
] == PWM config
Edge ]
Input logic
detect Compare and
PRS inputs TIMERn.CC1
PWM config
The timer module interface consists of multiple register types. Registers of type "RW CONFIG" should only be written when the module
is disabled (TIMERn_EN_EN = 0). Registers of type "W SYNC", "R SYNC" or "RW SYNC" should only be read or written when the
module is enabled (TIMERn_EN_EN = 1). A typical setup sequence for a TIMER module is as follows:
1. With the TIMER disabled (TIMERn_EN_EN = 0), program any CONFIG registers required for the application.
2. Enable the TIMER by setting EN in TIMERn_EN to 1.
3. Program any non-CONFIG registers required for the application.
4. The TIMER is then ready for use.
The timer consists of a counter that can be configured to the following modes, using the MODE field in TIMERn_CFG:
• Up-count: Counter counts up until it reaches the value in TIMERn_TOP, where it is reset to 0 before counting up again.
• Down-count: The counter starts at the value in TIMERn_TOP and counts down. When it reaches 0, it is reloaded with the value in
TIMERn_TOP.
• Up/Down-count: The counter starts at 0 and counts up. When it reaches the value in TIMERn_TOP, it counts down until it reaches 0
and starts counting up again.
• Quadrature Decoder: Two input channels where one determines the count direction, while the other pin triggers a clock event.
In addition to the TIMER modes listed above, the TIMER also supports a 2x count mode. In this mode the counter increments/decre-
ments by 2 on each clock edge. The 2x count mode can be used to double the PWM frequency when the compare/capture channel is
put into PWM mode. The 2x count mode is enabled by setting the X2CNT bitfield in the TIMERn_CTRL register.
The counter value can be read or written by software any time the module is enabled by accessing the CNT field in TIMERn_CNT.
18.3.2.1 Events
The main counter can generate overflow and underflow events during operation.
Overflow (TIMERn_IF_OF) is set when the counter value shifts from TIMERn_TOP to the next value when counting up. In up-count
mode and quadrature decoder mode the next value is 0. In up/down-count mode, the next value is TIMERn_TOP-1.
Underflow (TIMERn_IF_UF) is set when the counter value shifts from 0 to the next value when counting down. In down-count mode and
quadrature decoder mode, the next value is TIMERn_TOP. In up/down-count mode the next value is 1.
An update event occurs on overflow in up-count mode and on underflow in down-count or up/down count mode. Additionally, an update
event also occurs on overflow and underflow in quadrature decoder . This event is used to time updates of buffered values.
18.3.2.2 Operation
Figure 18.2 TIMER Hardware Timer/Counter Control on page 481 shows the hardware timer/counter control. Software can start or stop
the counter by setting the START or STOP bits in TIMERn_CMD. The counter value (CNT in TIMERn_CNT) can always be written by
software to any 16/32-bit value.
It is also possible to control the counter through either an external pin or PRS input. This is done through the input logic for the com-
pare/capture Channel 0. The timer/counter allows individual actions (start, stop, reload) to be taken for rising and falling input edges.
This is configured in the RISEA and FALLA fields in TIMERn_CTRL. The reload value is 0 in up-count and up/down-count mode and
TOP in down-count mode.
The RUNNING bit in TIMERn_STATUS indicates if the timer is running or not. If the SYNC bit in TIMERn_CFG is set, the timer is star-
ted/stopped/reloaded (external pin or PRS) when any of the other timers are started/stopped/reloaded.
The DIR bit in TIMERn_STATUS indicates the counting direction of the timer at any given time. The counter value can be read or writ-
ten by software through the CNT field in TIMERn_CNT. In Up/Down-Count mode the count direction will be set to up if the CNT value is
written by software.
Counter
RISEA FALLA
Start Counter
Stop
Reload&Start
Compare/Capture channel 0
INSEL
ICEDGE
TIMERn.CC0
Input
PRS channels
Capture 0
Filter
FILT
The counter can be clocked from several sources, which are all synchronized with the incoming peripheral clock for the timer. See
Figure 18.3 TIMER Clock Selection on page 481.
Counter
PRESC CLKSEL
Compare/Capture channel 1
INSEL
ICEDGE
TIMERN.CC1
Input
PRS channels
Capture 1
Filter
FILT
The peripheral clock for the timer (HFPERCLKTIMERn) clocks the logic for the timer block, even when it is not the selected clock source.
All TIMER instances in this device family use EM01GRPACLK selected in CMU_EM01GRPACLKCTRL_CLKSEL as their peripheral
clock source (HFPERCLKTIMERn).
The peripheral clock to each timer can be used as a source with a configurable 10-bit prescaler. The PRESC bitfield in TIMERn_CFG
sets the prescaler value, and the incoming peripheral clock will be divided by a factor of (PRESC+1). However, if 2x count mode is
enabled and the compare/capture channels are configured for PWM mode, the CC output is updated on both clock edges, so prescal-
ing the peripheral clock will produce an incorrect result. The internal prescale counter is stopped and reset when the timer is stopped.
The timer can also be clocked by positive and/or negative edges on the compare/capture channel 1 input. This input can either come
from the TIMn_CC1 pin or one of the PRS channels. The input signal must not have a higher frequency than fHFPERCLK_TIMERn/3 when
running from a pin input or a PRS input with FILT enabled in TIMERn_CCx_CFG. When running from PRS without FILT, the frequency
can be as high as fHFPERCLK_TIMERn. Note that when clocking the timer from the same pulse that triggers a start (through RISEA/FALLA
in TIMERn_CTRL), the starting pulse will not update the counter value.
All timers are linked together (see Figure 18.4 TIMER Connections on page 482), allowing timers to count on overflow/underflow from
the lower numbered neighbouring timers to form a larger timer. Note that all timers must be set to count the same direction and less
significant timer(s) can only be set to count up or down.
Underflow Underflow
By default, the counter counts continuously until it is stopped. If the OSMEN bit is set in the TIMERn_CFG register, however, the coun-
ter is disabled by hardware on the first update event (see 18.3.2.1 Events). Note that when the counter is running with CC1 as clock
source and OSMEN is set, a CC1 capture event will not take place on the update event (CC1 rising edge) that stops the timer.
The TIMERn_TOP register can be altered either by writing it directly or by writing to the TIMER_TOPB (buffer) register. When writing to
the buffer register the TIMERn_TOPB register will be written to TIMERn_TOP on the next update event. Buffering ensures that the TOP
value is not set below the actual count value. The TOPBV flag in TIMERn_STATUS indicates whether the TIMERn_TOPB register con-
tains data that has not yet been written to the TIMERn_TOP register (see Figure 18.5 TIMER TOP Value Update Functionality on page
483).
Note: When writing to TIMERn_TOP register directly, the TIMERn_TOPB register value will be invalidated and the TOPBV flag will be
cleared. This prevents TIMERn_TOP register from being immediately updated by an existing valid TIMERn_TOPB value during the
next update event.
APB Data
Set
TOPBV
Update event Clear
Load TOPB
TOP
APB Write (TOP) Load APB
Quadrature decoding mode is used to track motion and determine both rotation direction and position. The quadrature decoder uses
two input channels that are 90 degrees out of phase (see Figure 18.6 TIMER Quadrature Encoded Inputs on page 484).
Channel A
90°
Channel B
Channel A
Channel B 90°
In the timer these inputs are tapped from the compare/capture channel 0 (Channel A) and 1 (Channel B) inputs before edge detection.
The timer/counter then increments or decrements the counter, based on the phase relation between the two inputs. The DIRCHG flag
in TIMERn_IF is set if the count direction changes in quadrature decoder mode. The quadrature decoder supports two channels, but if a
third channel (Z-terminal) is available, this can be connected to an external interrupt and trigger a counter reset from the interrupt serv-
ice routine. By connecting a periodic signal from another timer as input capture on compare/capture Channel 2, it is also possible to
calculate speed and acceleration.
Note: In quadrature decoder mode, overflow and underflow triggers an update event.
Compare/Capture channel 0
INSEL
ICEDGE
TIMERn.CC0
Input
PRS channels Counter
Capture 0
Filter
QDM MODE
FILT
FILT
The quadrature decoder can be set in either X2 or X4 mode, which is configured in the QDM bit in TIMERn_CFG. See Figure
18.7 TIMER Quadrature Decoder Configuration on page 484
In X2 Decoding mode, the counter increments or decrements on every edge of Channel A, see Table 18.1 TIMER Counter Response in
X2 Decoding Mode on page 485 and Figure 18.8 TIMER X2 Decoding Mode on page 485.
Channel A
Channel B
Rising Falling
0 Increment Decrement
1 Decrement Increment
Channel A
Channel B
CNT 3 4 5 6 7 8 8 7 6 5 4 3 2
In X4 Decoding mode, the counter increments or decrements on every edge of Channel A and Channel B, see Figure 18.9 TIMER X4
Decoding Mode on page 485 and Table 18.2 TIMER Counter Response in X4 Decoding Mode on page 485.
Channel A
Channel B
CNT 2 3 4 5 6 7 8 9 10 11 11 10 9 8 7 6 5 4 3 2
To calculate a position Figure 18.10 TIMER Rotational Position Equation on page 486 can be used.
The timer contains compare/capture channels, which can be independently configured in the following modes:
1. Input Capture
2. Output Compare
3. PWM
Each compare/capture channel can be configured as an input source for the Capture Unit or as external clock source for the timer (see
Figure 18.11 TIMER Input Pin Logic on page 486). Compare/capture channels 0 and 1 are the inputs for the quadrature decoder . The
input channel can be filtered before it is used, which requires the input to remain stable for up to 5 cycles in a row before the input is
propagated to the output.
INSEL
ICEDGE
TIMERn.CCx
Input
PRS channels
Capture x
Filter
FILT
The capture input to the timer may be selected from the dedicated CCx signal for the channel, or a PRS signal. INSEL in
TIMERn_CCx_CFG determines the input to the channel. When set to PIN, the selected CCx pin will be used. When INSEL is set to
PRSSYNC, a synchronous PRS channel is selected as the source. The synchronous PRS channel is determined by the SPRSSEL field
in the PRS_TIMERn_CCx register. Setting INSEL to PRSASYNCLEVEL or PRSASYNCPULSE selects an asynchronous PRS channel
as the source. The aynchronous PRS channel is determined by the PRSSEL field in the PRS_TIMERn_CCx register.
The PIN and PRSASYNCLEVEL selections are qualified by a 2-clock input sampler. To recognize and capture the incoming signal, it
must be at the new level for at least 2 HFPERCLKTIMERn clock cycles. An additional 5 HFPERCLKTIMERn cycles of filtering can be
applied to the signal by enabling the FILT bit in TIMERn_CCx_CFG.
The PRSASYNCPULSE selection can be used to capture higher-speed pulses on an asynchronous PRS input. The input logic for this
selection does not qualify the level of the incoming signal. Instead, it will recognize positive or negative edges directly. While the pulse
time can be shorter than 1 HFPERCLKTIMERn, this mode requires at least 3 HFPERCLKTIMERn clocks between adjacent events. The
FILT option is not used in this mode.
Synchronous PRS signals are inherently synchronized to the module clock, and the 2-clock input sampler is not used. However, it is
possible to use FILT to enable the 5 HFPERCLKTIMERn filter when using the PRSSYNC option.
The compare/capture channel registers are prefixed with TIMERn_CCx_, where the x stands for the channel number. Since the com-
pare/capture channels serve three functions (input capture, compare, PWM), different registers are used, depending on the mode the
channel is set in.
In input capture, the counter value (TIMERn_CNT) can be captured in the Input Capture Register (TIMERn_CCx_ICF) (see Figure
18.12 TIMER Input Capture on page 487). The CCPOL bits in TIMERn_STATUS indicate the polarity of the edge that triggered the
capture in TIMERn_CCx_ICF.
Input
y
n
TIMERn_CNT m
TIMERn_CCx_ICOF m y
Read TIMERn_CCx_IC
Input captures are buffered into a 2-entry FIFO, allowing 2 subsequent capture events to take place before a read-out is required.
Reading TIMERn_CCx_ICF from software or DMA pops the oldest unread value from the FIFO. If TIMERn_CCx_ICF is read when the
FIFO is empty (ICFEMPTY in TIMERn_STATUS = 1), the FIFO underflow flag for the channel (ICFUF in TIMERn_IF) will be set. The
Input Capture Overflow Register (TIMERn_CCx_ICOF) always contains the newest value in the FIFO. If a new capture is triggered
while the FIFO is full, the value in TIMERn_CCx_ICOF will be over-written with the latest value and the FIFO overflow flag (ICFOF in
TIMERn_IF) for the channel will be set. Reading TIMERn_CCx_ICOF does not alter the FIFO contents.
The input capture FIFO also has a programmable watermark level that can be configured to generate interrupts or trigger DMA re-
quests when a certain number of empty spots are left in the FIFO. The ICFWLFULL flag inTIMERn_IF will be set when the number of
empty spots left in the FIFO is less than or equal to the watermark level programmed in TIMERn_CCx_CFG_ICFWL. At a minimum, a
TIMER module will have two FIFO entries, but may have more on future devices.
The ICFEMPTY flag in TIMERn_STATUS indicates when the capture buffer is empty. When this bit reads '0', there is a valid unread
capture in the FIFO.
Note: In input capture mode, the timer will only trigger interrupts when it is running.
Period and/or pulse-width capture can only be possible with Channel 0 (CC0), because this is the only channel that can start and stop
the timer. This can be done by setting the RISEA field in TIMERn_CTRL to Clear&Start, and selecting the desired input from either
external pin or PRS, see Figure 18.13 TIMER Period and/or Pulse Width Capture on page 488. For period capture, the compare/
capture channel should then be set to input capture on a rising edge of the same input signal. To capture the width of a high pulse, the
compare/capture channel should be set to capture on a falling edge of the input signal. To measure the low pulse-width of a signal,
opposite polarities should be chosen.
CNT
0
Input
Clear&Start
Input Capture (frequency capture)
Input Capture (pulse-width capture)
18.3.3.5 Compare
Each compare/capture channel contains a comparator which outputs a compare match if the contents of TIMERn_CCx_OC matches
the counter value, see Figure 18.14 TIMER Block Diagram Showing Comparison Functionality on page 489. In compare mode, each
compare channel can be configured to either set, clear or toggle the output on an event (compare match, overflow or underflow). The
output from each channel is represented as an alternative function on the port it is connected to, which needs to be enabled for the CC
outputs to propagate to the pins.
Update
Condition
= Overflow
=0 Underflow
Note: For simplicity, all
TIMERn_CCx registers are
grouped together in the figure, Compare Match x
but they all have individual
Compare Register and logic
Compare and
TnCCR1[15:0
TIMERn_CCx = TIMERn.CC0
TnCCR0[15:0
] == PWM config
]
Compare and
TIMERn.CC1
PWM config
Compare and
TIMERn.CC2
PWM config
The compare output is delayed by one cycle to allow for full 0% to 100% PWM generation. If occurring in the same cycle, match action
will have priority over overflow or underflow action.
The input selected (through PRSSEL in PRS_CONSUMER_TIMERn_CCx, INSEL and FILT in TIMERn_CCx_CFG) for the CC channel
will also be sampled on compare match and the result is found in the CCPOL bits in TIMERn_STATUS. It is also possible to configure
the CCPOL to always track the inputs by setting ATI in TIMERn_CFG.
Note: When using synchronous PRS sources, it is recommended to configure the PRS consumer registers prior to selecting PRS trig-
gering to avoid any false triggers.
The COIST bit in TIMERn_CCx_CFG is the initial state of the compare/PWM output. The COIST bit can also be used as an initial value
to the compare outputs on a reload-start when RSSCOIST is set in TIMERn_CFG. Also the resulting output can be inverted by setting
OUTINV in TIMERn_CCx_CTRL. It is recommended to turn off the CC channel before configuring the output state to avoid any unwan-
ted pulses on the output. The CC channel can be turned off by setting MODE to OFF in TIMER_CCx_CFG. The following figure shows
the output logic for the TIMER module.
COIST
OUTINV
Output
Compare/ 0
PWM x TIMERN.CCx
1
When running in output compare or PWM mode, the value in TIMERn_CCx_OC will be compared against the count value. In Compare
mode the output can be configured to toggle, clear or set on compare match, overflow, and underflow through the CMOA, COFOA and
CUFOA fields in TIMERn_CCx_CTRL. TIMERn_CCx_OC can be accessed directly or through the buffer register TIMERn_CCx_OCB,
see Figure 18.16 TIMER Output Compare/PWM Buffer Functionality Detail on page 490. When writing to the buffer register, the value
in TIMERn_CCx_OCB will be written to TIMERn_CCx_OC on the next update event. This functionality ensures glitch free PWM out-
puts. The OCBV flag in TIMERn_STATUS indicates whether the TIMERn_CCx_OCB register contains data that has not yet been writ-
ten to the TIMERn_CCx_OC register. Note that when writing 0 to TIMERn_CCx_OCB in up-down count mode the OC value is updated
when the timer counts from 0 to 1. Thus, the compare match for the next period will not happen until the timer reaches 0 again on the
way down.
APB Data
Set
Update event Clear OCBV
Load CCB
APB Write (CC) Load APB OC
Frequency generation (see Figure 18.17 TIMER Up-count Frequency Generation on page 491) can be achieved in compare mode by:
• Setting the counter in up-count mode
• Enabling buffering of the TOP value.
• Setting the CC channels overflow action to toggle
TIMERn_TOP
TIMERn.CCx Output
The output frequency is given by Figure 18.18 TIMER Up-count Frequency Generation Equation on page 491
The figure below provides cycle accurate timing and event generation information for frequency generation.
TIMERn_TOP = 4
3
2 TIMERn_CCx
1
0
TIMERn.CCx Output
In PWM mode, TIMERn_CCx_OC is buffered to avoid glitches in the output. The settings in the Compare Output Action configuration
bits are ignored in PWM mode and PWM generation is only supported for up-count and up/down-count mode.
If the counter is set to up-count and the compare/capture channel is put in PWM mode, single slope PWM output will be generated (see
Figure 18.20 TIMER Up-count PWM Generation on page 492). In up-count mode the PWM period is TOP+1 cycles and the PWM out-
put will be high for a number of cycles equal to TIMERn_CCx_OC. This means that a constant high output is achieved by setting
TIMERn_CCx_OC to TOP+1 or higher. The PWM resolution (in bits) is then given by Figure 18.21 TIMER Up-count PWM Resolution
Equation on page 492.
TIMERn.CCx
Output
TIMERn_TOP
TIMERn_CCx_OC
0
Compare match
Overflow
Buffer update
RPWMup = log(TOP+1)/log(2)
The PWM frequency is given by Figure 18.22 TIMER Up-count PWM Frequency Equation on page 492:
The high duty cycle is given by Figure 18.23 TIMER Up-count Duty Cycle Equation on page 492
DSup = OCx/(TOP+1)
The figure below provides cycle accurate timing and event generation information for up-count mode.
TIMERn.CCx
Output
TIMERn_TOP = 4
TIMERn_CCx_OC = 3
TIMERn_CCx
2
1
0
Compare match
Overflow
Buffer update
When the timer is set in 2x mode, the TIMER will count up by two for every (prescaled) clock. This will in effect make any odd Top value
be rounded down to the closest even number. Similarly, any odd OC value will generate a match on the closest lower even value as
shown in Figure 18.25 TIMER CC Out in 2x Mode on page 493
Clock
0 2 4 0 2 4 0 0 2 4 0 2 4 0
CC Out
Top = 5 Top = 5
OC = 1 OC = 2
RPWM2xmode = log(TOP/2+1)/log(2)
The PWM frequency is given by Figure 18.27 TIMER 2x Mode PWM Frequency Equation (Up-count) on page 493:
The high duty cycle is given by Figure 18.28 TIMER 2x Mode Duty Cycle Equation on page 493
DS2xmode = OCx/((floor(TOP/2)+1)*2)
If the counter is set to up-down count and the compare/capture channel is put in PWM mode, dual slope PWM output will be generated
by Figure 18.29 TIMER Up/Down-count PWM Generation on page 494. The resolution (in bits) is given by Figure 18.30 TIMER Up/
Down-count PWM Resolution Equation on page 494.
TIMERn.CCx Output
TIMERn_TOP
TIMERn_CCx_OC
0
Compare match
Overflow
Buffer update
RPWMup/down = log(TOP+1)/log(2)
The PWM frequency is given by Figure 18.31 TIMER Up/Down-count PWM Frequency Equation on page 494:
The high duty cycle is given by Figure 18.32 TIMER Up/Down-count Duty Cycle Equation on page 494
DSup/down = OCx/TOP
The figure below provides cycle accurate timing and event generation information for up-count mode.
TIMERn.CCx Output
TIMERn_TOP = 4
TIMERn_CCx_OC = 3 TIMERn_CCx
2
1
0
Overflow
Compare match
Buffer update
When the timer is set in 2x mode, the TIMER will count up/down by two. This will in effect make any odd Top value be rounded down to
the closest even number. Similarly, any odd OC value will generate a match on the closest lower even value as shown in Figure
18.34 TIMER CC Out in 2x mode on page 495
Clock
0 2 4 2 0 2 4 0 2 4 2 0 2 4
CC Out
Top = 5 Top = 5
OC = 1 OC = 2
RPWM2xmode = log(TOP/2+1)/log(2)
The PWM frequency is given by Figure 18.36 TIMER 2x Mode PWM Frequency Equation (Up/Down-count) on page 495:
The high duty cycle is given by two equations based on the OCx values.Figure 18.37 TIMER 2x Mode Duty Cycle Equation for OCx = 1
or OCx = Even on page 495 and Figure 18.38 TIMER 2x Mode Duty Cycle Equation for all Other OCx = Odd Values on page 495
DS2xmode = (OCx*2)/(floor(TOP/2)*4)
Figure 18.37. TIMER 2x Mode Duty Cycle Equation for OCx = 1 or OCx = Even
Figure 18.38. TIMER 2x Mode Duty Cycle Equation for all Other OCx = Odd Values
To prevent software errors from making changes to the timer configuration, a configuration lock is available. Writing any value but
0xCE80 to LOCKKEY in TIMERn_LOCK will lock writes to TIMERn_CTRL, TIMERn_CFG, TIMERn_CMD, TIMERn_TOP,
TIMERn_TOPB, TIMERn_CNT, TIMERn_CCx_CTRL, TIMERn_CCx_CFG, TIMERn_CCx_OC, and TIMERn_CCx_OCB. To unlock the
registers, write 0xCE80 to LOCKKEY in TIMERn_LOCK. The value of TIMERLOCKSTATUS in TIMERn_STATUS is 1 when the lock is
active, and 0 when the registers are unlocked.
Some timer modules include a Dead-Time Insertion unit suitable for motor control applications. Refer to the device data sheet to check
which timer instances have this feature. The example settings in this section are for TIMER0, but identical settings can be used for
other timers with DTI as well. The Dead-Time Insertion Unit aims to make control of brushless DC (BLDC) motors safer and more effi-
cient by introducing complementary PWM outputs with dead-time insertion and fault handling, see Figure 18.39 TIMER Dead-Time In-
sertion Unit Overview on page 496.
Fault sources
When used for motor control, the PWM outputs TIM0_CC0, TIM0_CC1 and TIM0_CC2 are often connected to the high-side transistors
of a triple half-bridge setup (UH, VH and WH), and the complementary outputs connected to the respective low-side transistors (UL, VL,
WL shown in Figure 18.40 TIMER Triple Half-Bridge on page 496). Transistors used in such a bridge often do not open/close instanta-
neously, and using the exact complementary inputs for the high and low side of a half-bridge may result in situations where both gates
are open. This can give unnecessary current-draw and short circuit the power supply. The DTI unit provides dead-time insertion to deal
with this problem.
UH VH WH
W
UL VL WL
For each of the 3 compare-match outputs of TIMER0, an additional complementary output is provided by the DTI unit. These outputs,
named TIM0_CDTI0, TIM0_CDTI1 and TIM0_CDTI2 are provided to make control of e.g. 3-channel BLDC or permanent magnet AC
(PMAC) motors possible using only a single timer, see Figure 18.41 TIMER Overview of Dead-Time Insertion Block for a Single PWM
Channel on page 497.
DTFALLT DTRISET
=0
Figure 18.41. TIMER Overview of Dead-Time Insertion Block for a Single PWM Channel
The DTI unit is enabled by setting DTEN in TIMER0_DTCFG. In addition to providing the complementary outputs, the DTI unit then also
overrides the compare match outputs from the timer.
The DTI unit gives the rising edges of the PWM outputs and the rising edges of the complementary PWM outputs a configurable time
delay. By doing this, the DTI unit introduces a dead-time where both the primary and complementary outputs in a pair are inactive as
seen in Figure 18.42 TIMER Polarity of Both Signals are Set as Active-High on page 497.
Original PWM
dt1
TIMER0.CC0
dt2
TIMER0.CDTI0
Dead-time is specified individually for the rising and falling edge of the original PWM. These values are shared across all the three
PWM channels of the DTI unit. A single prescaler value is provided for the DTI unit, meaning that both the rising and falling edge dead-
times share prescaler value. The prescaler divides the HFPERCLKTIMER0 by a configurable factor between 1 and 1024, which is set in
the DTPRESC field in TIMER0_DTTIMECFG. The rising and falling edge dead-times are configured in DTRISET and DTFALLT in TIM-
ER0_DTTIMECFG to any number between 1-64 HFPERCLKTIMER0 cycles.
The DTAR and DTFATS bits in TIMER0_DTCFG control the DTI output behavior when the timer stops. By default the DTI block stops
when the timer is stopped. Setting the DTAR bit will cause the DTI output on channel 0 to continue when the timer is stopped. DTAR
effects only channel 0. See 18.3.4.2 PRS Channel as a Source for an example of when this can be used. While in this mode the undivi-
ded HFPERCLKTIMER0 (DTPRESC=0) is always used regardless of the programmed DTPRESC value in TIMER0_DTTIMECFG. This
means that rise and fall dead times are calculated assuming DTPRESC = 0.
When the timer stops, DTI outputs are frozen by default, preserving their last state. To allow the outputs to go to a safe state, program
the DTFA field of the TIMER0_DTFCFG register to the safe values and set the DTFATS bitfield in the TIMER0_DTCFG register. Note
that when DTAR is also set, DTAR has priority over DTFATS for DTI channel 0 output.
The following table shows the DTI output when the timer is halted.
0 0 frozen
0 1 safe
1 0 running
1 1 running
The value of the primary and complementary outputs in a pair will never be set active at the same time by the DTI unit. The polarity of
the outputs can be changed if this is required by the application. The active values of the primary and complementary outputs are set by
the DTIPOL and DTCINV bits in the TIMER0_DTCTRL register. The DTIPOL bit of this register specifies the base polarity. If DTIPOL =
0, then the outputs are active-high, and if DTIPOL = 1 they are active-low. The relative phase of the primary and complementary out-
puts is not changed by DTIPOL, as the polarity of both outputs is changed, see Figure 18.43 TIMER Output Polarities on page 498.
In some applications, it may be required that the primary outputs are active-high, while the complementary outputs are active-low. This
can be accomplished by manipulating the DTCINV bit of the TIMER0_DTCTRL register, which inverts the polarity of the complementary
outputs relative to the primary outputs. As an example, DTIPOL = 0 and DTCINV = 0 results in outputs with opposite phase and active-
high states. Similarly, DTIPOL = 1 and DTCINV = 1 results in outputs with equal phase and the primary output will be active-high while
the complementary will be active-low.
Original PWM
DTIPOL = 0 TIMER0.CC0
DTCINV = 0
TIMER0.CDTI0
DTIPOL = 1 TIMER0.CC0
DTCINV = 0
TIMER0.CDTI0
DTIPOL = 0 TIMER0.CC0
DTCINV = 1
TIMER0.CDTI0
TIMER0.CC0
DTIPOL = 1
DTCINV = 1
TIMER0.CDTI0
Output generation on the individual DTI outputs can be disabled by configuring TIMER0_DTOGEN. When output generation on an out-
put is disabled that output will go to and stay in its inactive state.
A PRS channel can be used as input to the DTI module instead of the PWM output from the timer for DTI channel 0. Setting DTPRSEN
in TIMER0_DTCFG will override the source of the first DTI channel, driving TIM0_CC0 and TIM0_CDTI0, with the value on the PRS
channel. The rest of the DTI channels will continue to be driven by the PWM output from the timer. The input PRS channel is chosen
within the PRS module with PRSSEL in the PRS_CONSUMER_TIMERn_DTI register. Note that the timer must be running even when
PRS is used as the DTI source. However, if it is required to keep the DTI channel 0 running even when the timer is stopped, set DTAR
in TIMER0_DTCFG. When this bit is set, it uses DTPRESC=0 regardless of the value programmed in DTPRESC in TIMER0_DTTI-
MECFG.
Note: When using synchronous PRS sources, it is recommended to configure the PRS consumer registers prior to selecting PRS trig-
gering to avoid any false triggers.
The DTI prescaler, set by DTPRESC in TIMER0_DTTIMECFG determines the accuracy with which the DTI can insert dead-time into a
PRS signal. The maximum dead-time error equals DTIPRESC+1 clock cycles. With DTIPRESC = 0, the inserted dead-times are there-
fore accurate, but they may be inaccurate for larger prescaler settings.
The fault handling system of the DTI unit allows the outputs of the DTI unit to be put in a well-defined state in case of a fault. This
hardware fault handling system enables a fast reaction to faults, reducing the possibility of damage to the system.
The fault sources which trigger a fault in the DTI module are determined by the bitfields of TIMER0_DTFCFG register. Any combination
of the available error sources can be selected:
• PRS source 1, determined by PRSSEL in PRS_CONSUMER_TIMERn_DTIFS1
• PRS source 2, determined by PRSSEL in PRS_CONSUMER_TIMERn_DTIFS2
• Debugger
• Core Lockup
• EM2 or EM3 Entry
One or two PRS channels can be used as an error source. When PRS source 1 is selected as an error source, PRSSEL in PRS_CON-
SUMER_TIMERn_DTIFS1 determines which PRS channel is used for this source. PRSSEL in PRS_CONSUMER_TIMERn_DTIFS2
determines which PRS channel is selected as PRS source 2. Note that for Core Lockup, the LOCKUPRDIS in RMU_CTRL must be set.
Otherwise this will generate a full reset of the chip.
Note: When using synchronous PRS sources, it is recommended to configure the PRS consumer registers prior to selecting PRS trig-
gering to avoid any false triggers.
When a fault occurs, the bit representing the fault source is set in TIMER0_DTFAULT register, and the outputs from the DTI unit are set
to a well-defined state. The following options are available, and can be enabled by configuring DTFA in TIMER0_DTFCFG:
• Set outputs to inactive level
• Clear outputs
• Tristate outputs
With the first option enabled, the output state in case of a fault depends on the polarity settings for the individual outputs. An output set
to be active high will be set low if a fault is detected, while an output set to be active low will be driven high.
When a fault occurs, the fault source(s) can be read out from TIMER0_DTFAULT register.
Additionally a fault action can also be triggered when the timer stops if DTFATS in TIMER0_DTCFG is set. This allows the DTI output to
go to safe state specified by DTFA in TIMER0_DTFCFG when the timer stops. When DTAR and DTFATS in TIMER0_DTCFG are both
set, DTI channel 0 keeps running even when the timer stops. This is useful when DTI channel 0 has an input coming from PRS.
When a fault is triggered by the PRS system, software intervention is required to re-enable the outputs of the DTI unit. This is done by
manually clearing bits in the TIMER0_DTFAULT register. If the fault source as determined by checking TIMER0_DTFAULT is the de-
bugger alone, the outputs can be automatically restarted when the debugger exits. To enable automatic restart set DTDAS in TIM-
ER0_DCTFG. When an automatic restart occurs the DTDBGF bit in TIMER0_DTFAULT will be automatically cleared by hardware. If
any other bits in the TIMER0_DTFAULT register are set when the hardware clears DTDBGF the DTI module will not exit the fault state.
To prevent software errors from making changes to the DTI configuration, a configuration lock is available. Writing any value but
0xCE80 to LOCKKEY in TIMER0_DTLOCK locks writes to registers TIMER0_DTCFG, TIMER0_DTFCFG, TIMER0_DTCTRL, and
TIMER0_DTTIMECFG. To unlock the registers, write 0xCE80 to LOCKKEY in TIMER0_DTLOCK. The value of DTILOCKSTATUS in
TIMERn_STATUS is 1 when the lock is active, and 0 when the registers are unlocked.
When the CPU is halted in debug mode, the timer can be configured to either continue to run or to be frozen. This is configured in
DEBUGRUN in TIMERn_CFG.
Each of the events has its own interrupt flag. Also, there are interrupt flags for each compare/capture channel which are set on FIFO
overflow or underflow in capture mode. FIFO overflow happens when a new capture over-writes an old unread capture in
TIMERn_CCx_ICF. FIFO underflow happens when software reads TIMERn_CCx_ICF while the FIFO is empty.
If the interrupt flags are set and the corresponding interrupt enable bits in TIMERn_IEN are set high, the timer will send out an interrupt
request. Each of the events may optionally trigger signals to PRS channels. The PRSCONF field in TIMERn_CCx_CFG determines
how PRS events are generated. When PRSCONF is set to PULSE, and event will lead to a one HFPERCLKTIMERn cycle high pulse on
individual PRS outputs. Setting PRSCONF to LEVEL will make the PRS output follow the compare match output. Interrupts are cleared
by setting the corresponding bit in the TIMERn_IFC register.
Each of the events will also set a DMA request when they occur. The different DMA requests are cleared when certain acknowledge
conditions are met, see Table 18.4 TIMER DMA Events on page 500. Events which clear the DMA requests do not clear interrupt
flags. Software must still manually clear the interrupt flag if interrupts are in use.
If DMACLRACT is set in TIMERn_CFG, the DMA request is cleared when the triggered DMA channel is active, without having to ac-
cess any timer registers. This is useful in cases where a timer event is used to trigger a DMA transfer in output compare or PWM mode
that does not target the OC or OCB registers. DMACLRACT is not applicable in input capture mode.
Event Acknowledge/Clear
CC0 Input Capture - ICFWLFULL0 flag set ICFEMPTY0 flag set (read FIFO via TIMERn_CC0_ICF)
CC1 Input Capture - ICFWLFULL1 flag set ICFEMPTY1 flag set (read FIFO via TIMERn_CC1_ICF)
CC2 Input Capture - ICFWLFULL2 flag set ICFEMPTY2 flag set (read FIFO via TIMERn_CC2_ICF)
CC3 Input Capture - ICFWLFULL3 flag set ICFEMPTY3 flag set (read FIFO via TIMERn_CC3_ICF)
The TIMn_CCx inputs/outputs and TIMn_CDTIx outputs are accessible as alternate functions through GPIO. Each pin connection can
be enabled/disabled separately using the GPIO module control registers. See the device data sheet for the available locations for each
signal.
0x000
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
0x1
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004 31
30
29
28
27
26
25
24
23
22
21
20
19
18
RW 0x0 17
RW 0x0 16
15
14
13
12
DISSYNCOUT RW 0x0 11
RW 0x0 10
9
8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
2
1
0
RW 0x0
RW 0x0
RW 0x0
Reset
Access
DMACLRACT
DEBUGRUN
RETIMEEN
RSSCOIST
Name
CLKSEL
OSMEN
PRESC
MODE
SYNC
QDM
ATI
Bit Name Reset Access Description
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
These bits select the prescaling factor for the counter clock. The selected timer clock will be divided by PRESC+1 before
clocking the counter. The following modes are provided for easier software porting from Series 0 or Series 1 devices.
However, the prescaler is not limited to these options.
0 DIV1 No prescaling
1 DIV2 Prescale by 2
3 DIV4 Prescale by 4
7 DIV8 Prescale by 8
15 DIV16 Prescale by 16
31 DIV32 Prescale by 32
63 DIV64 Prescale by 64
Enabling ATI makes CCPOL always track the polarity of the inputs.
15:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set, the Timer does not start/stop/reload other timers with SYNC bit set.
1 DIS Timer cannot start/stop/reload other timers with SYNC bit set
When this bit is set, the DMA requests are cleared when the corresponding DMA channel is active. This enables the
timer DMA requests to be cleared without accessing the timer.
0 X2 X2 mode selected
1 X4 X4 mode selected
When this bit is set, the Timer is started/stopped/reloaded by start/stop/reload commands in the other timers.
1 ENABLE Timer may be started, stopped and re-loaded from other timer
instances.
2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
These bits set the counting mode for the Timer. Note, when Quadrature Decoder Mode is selected (MODE = 'b11), the
CLKSEL is don't care. The Timer is clocked by the Decoder Mode clock output.
0 UP Up-count mode
0x008 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
X2CNT RW 0x0 4
3
2
1
0
RW 0x0
RW 0x0
Reset
Access
FALLA
RISEA
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
These bits select the action taken in the counter when a falling edge occurs on the input.
0 NONE No action
These bits select the action taken in the counter when a rising edge occurs on the input.
0 NONE No action
0x00C 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
W(nB) 0x0 1
START W(nB) 0x0 0
Reset
Access
STOP
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 31
30
29
28
27
0x0 26
0x0 25
0x0 24
23
22
21
20
19
0x0 18
0x0 17
0x0 16
15
14
13
12
11
0x0 10
0x0 9
0x0 8
7
0x0 6
0x0 5
0x0 4
3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
R
R
R
R
R
R
R
R
TIMERLOCKSTATUS R
R
R
R
DTILOCKSTATUS
ICFEMPTY2
ICFEMPTY1
ICFEMPTY0
Name
SYNCBUSY
RUNNING
CCPOL2
CCPOL1
CCPOL0
OCBV2
OCBV1
OCBV0
TOPBV
DIR
Bit Name Reset Access Description
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
In Input Capture mode, this bit indicates the polarity of the edge that triggered capture in TIMERn_CCx_CCV. In Com-
pare/PWM mode, this bit indicates the polarity of the selected input to CC channel x. These bits are cleared when
CCMODE is written to 0b00 (Off).
In Input Capture mode, this bit indicates the polarity of the edge that triggered capture in TIMERn_CCx_CCV. In Com-
pare/PWM mode, this bit indicates the polarity of the selected input to CC channel x. These bits are cleared when
CCMODE is written to 0b00 (Off).
In Input Capture mode, this bit indicates the polarity of the edge that triggered capture in TIMERn_CCx_CCV. In Com-
pare/PWM mode, this bit indicates the polarity of the selected input to CC channel x. These bits are cleared when
CCMODE is written to 0b00 (Off).
23:19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This field indicates that the TIMERn_CCx_CCVB registers contain data which have not been written to
TIMERn_CCx_CCV. These bits are only used in OUTPUTCOMPARE or PWM mode and are cleared when CCMODE is
written to 0b00 (Off).
This field indicates that the TIMERn_CCx_CCVB registers contain data which have not been written to
TIMERn_CCx_CCV. These bits are only used in OUTPUTCOMPARE or PWM mode and are cleared when CCMODE is
written to 0b00 (Off).
This field indicates that the TIMERn_CCx_CCVB registers contain data which have not been written to
TIMERn_CCx_CCV. These bits are only used in OUTPUTCOMPARE or PWM mode and are cleared when CCMODE is
written to 0b00 (Off).
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This indicates that TIMERn_TOPB contains valid data that has not been written to TIMERn_TOP. This bit is also cleared
when TIMERn_TOP is written.
0 UP Counting up
0x014 31
30
29
28
27
RW 0x0 26
RW 0x0 25
RW 0x0 24
23
RW 0x0 22
RW 0x0 21
RW 0x0 20
19
ICFWLFULL2 RW 0x0 18
ICFWLFULL1 RW 0x0 17
ICFWLFULL0 RW 0x0 16
15
14
13
12
11
10
9
8
7
RW 0x0 6
RW 0x0 5
RW 0x0 4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
DIRCHG
Name
ICFOF2
ICFOF1
ICFOF0
ICFUF2
ICFUF1
ICFUF0
CC2
CC1
CC0
OF
UF
Bit Name Reset Access Description
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Indicates that input capture FIFO for channel 2 has overflown, and a prior captured value was lost. The latest captured
value can be read from the ICOF register.
Indicates that input capture FIFO for channel 1 has overflown, and a prior captured value was lost. The latest captured
value can be read from the ICOF register.
Indicates that input capture FIFO for channel 0 has overflown, and a prior captured value was lost. The latest captured
value can be read from the ICOF register.
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit indicates that the Input capture FIFO watermark for channel 2 has been exceeded.
This bit indicates that the Input capture FIFO watermark for channel 1 has been exceeded.
This bit indicates that the Input capture FIFO watermark for channel 0 has been exceeded.
15:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
In INPUT CAPTURE mode this bit indicates that a new Capture event has taken place. In OUTPUTCOMPARE or PWM
mode this bit indicates that a match event has taken place
In INPUT CAPTURE mode this bit indicates that a new Capture event has taken place. In OUTPUTCOMPARE or PWM
mode this bit indicates that a match event has taken place
In INPUT CAPTURE mode this bit indicates that a new Capture event has taken place. In OUTPUTCOMPARE or PWM
mode this bit indicates that a match event has taken place
3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit is set when count direction changes. Set only in Quadrature Decoder mode
0x018 31
30
29
28
27
RW 0x0 26
RW 0x0 25
RW 0x0 24
23
RW 0x0 22
RW 0x0 21
RW 0x0 20
19
ICFWLFULL2 RW 0x0 18
ICFWLFULL1 RW 0x0 17
ICFWLFULL0 RW 0x0 16
15
14
13
12
11
10
9
8
7
RW 0x0 6
RW 0x0 5
RW 0x0 4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
DIRCHG
Name
ICFOF2
ICFOF1
ICFOF0
ICFUF2
ICFUF1
ICFUF0
CC2
CC1
CC0
OF
UF
Bit Name Reset Access Description
31:27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x01C
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
TOP RW 0xFFFF
Reset
Access
Name
0x020
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
TOPB RW 0x0
Reset
Access
Name
0x024 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
CNT RW 0x0
Reset
Access
Name
0x02C
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
0x0
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock TIMERn_CTRL, TIMERn_CFG, TIMERn_CMD, TIMERn_TOP,
TIMERn_CNT, TIMERn_CCx_CTRL, TIMERn_CCx_CFG, and TIMERn_CCx_OC from editing. Write the unlock code to
unlock these registers.
0x030 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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When EN is cleared, DISABLING status is set immediately, and cleared when disablement finishes. Disablement resets
peripheral cores and not APB registers except hardware updated registers such as INTFLAGs and FIFO
The ENABLE bit enables the module. Software should write to CONFIG type registers before setting the ENABLE bit.
Software should write to SYNC type registers only after setting the ENABLE bit.
0x060 31
30
29
28
27
26
25
24
23
22
RW 0x0 21
RW 0x0 20
PRSCONF RW 0x0 19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
RW 0x0 4
3
2
1
0
RW 0x0
RW 0x0
Reset
Access
ICFWL
Name
COIST
MODE
INSEL
FILT
Bit Name Reset Access Description
31:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Sets the watermark level for generation of the ICFWLFULL interrupt and DMA requests. ICFWLFULL will be set and
DMA requests may be generated if the number of free FIFO entries is less than or equal to ICFWL.
16:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit is only used in Output Compare and PWM mode. When this bit is set in Compare or PWM mode,the output is set
high when the counter is disabled. When counting resumes, this value will represent the initial value for the output. If the
bit is cleared, the output will be cleared when the counter is disabled.
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x064 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
RW 0x0 2
1
0
ICEVCTRL RW 0x0
RW 0x0
RW 0x0
RW 0x0
RW 0x0
Reset
Access
ICEDGE
OUTINV
COFOA
CUFOA
Name
CMOA
Bit Name Reset Access Description
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
These bits control when a Compare/Capture PRS output pulse and interrupt flag is set. DMA request however is set on
every capture.
0 EVERYEDGE PRS output pulse and interrupt flag set on every capture
1 EVERYSECONDEDGE PRS output pulse and interrupt flag set on every second capture
2 RISING PRS output pulse and interrupt flag set on rising edge only (if
ICEDGE = BOTH)
3 FALLING PRS output pulse and interrupt flag set on falling edge only (if
ICEDGE = BOTH)
These bits control which edges the edge detector triggers on. The output is used for input capture and external clock
input.
23:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Setting this bit inverts the output from the CC channel (Output compare or PWM mode).
1:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x068
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
OC RW 0x0
Reset
Access
Name
0x070 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
OCB RW 0x0
Reset
Access
Name
This field holds the Output Compare buffer value which will be written to TIMERn_CCx_OC on an update event if
TIMERn_CCx_OCB contains valid data
0x074
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
ICF R(r) 0x0
Reset
Access
Name
This FIFO holds captured values in input capture mode. Reading this register will pop the oldest unread value from the
FIFO.
0x078
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
0x0
Reset
Access
ICOF R
Name
This register always contains the most recent input capture value. If the input capture FIFO is full and a new capture
occurs, this register will be updated and the previous caputre value is over-written.
0x0E0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
DTPRSEN RW 0x0 11
RW 0x0 10
RW 0x0 9
8
7
6
5
4
3
2
RW 0x0 1
RW 0x0 0
Reset
Access
DTFATS
DTDAS
Name
DTAR
DTEN
Bit Name Reset Access Description
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When Timer stops, DTI block outputs go to safe state as programmed in DTFA field of TIMERn_DTFC register. Howev-
er, when DTAR is also set,DTAR having higher priority allows channel0 to output the incoming PRS input while the other
channels go to safe state
This is used only for DTI channel 0. It Allows DTI channel 0 to keep running even when the timer is stopped. This is
useful when its input source is PRS. However, here the undivided peripheral clock is always used regardless of the pro-
grammed value in DTPRESC.
8:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enable/disable DTI.
0x0E4 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 0x0
RW 0x0
DTPRESC RW 0x0
Reset
Access
DTFALLT
DTRISET
Name
31:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set time span for the falling edge. The fall time is DTFALLT+1 prescaled peripheral clock cycles
Set time span for the rising edge. The rise time is DTRISET+1 prescaled peripheral clock cycles
These bits select the prescaling factor for DTI. The selected timer clock will be divided by DTPRESC+1 before clocking
the DTI logic.
0x0E8 31
30
29
RW 0x0 28
DTLOCKUPFEN RW 0x0 27
RW 0x0 26
RW 0x0 25
RW 0x0 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 0x0
Reset
Access
DTEM23FEN
DTPRS1FEN
DTPRS0FEN
DTDBGFEN
Name
DTFA
Bit Name Reset Access Description
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0EC 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
DTIPOL RW 0x0 1
DTCINV RW 0x0 0
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0F0 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
DTOGCDTI2EN RW 0x0 5
DTOGCDTI1EN RW 0x0 4
DTOGCDTI0EN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
DTOGCC2EN
DTOGCC1EN
DTOGCC0EN
Name
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit enables/disables output generation for the CDTI output from the DTI.
This bit enables/disables output generation for the CDTI output from the DTI.
This bit enables/disables output generation for the CDTI output from the DTI.
This bit enables/disables output generation for the CC output from the DTI.
This bit enables/disables output generation for the CC output from the DTI.
This bit enables/disables output generation for the CC output from the DTI.
0x0F4 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
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
DTLOCKUPF R
R
R
R
DTEM23F
DTPRS1F
DTPRS0F
DTDBGF
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit is set to 1 if EM2 or EM3 entry has occurred and DTEM23FEN is set to 1. The TIMER0_DTFAULTC register can
be used to clear fault bits.
This bit is set to 1 if a core lockup fault has occurred and DTLOCKUPFEN is set to 1. The TIMER0_DTFAULTC register
can be used to clear fault bits.
This bit is set to 1 if a debugger fault has occurred and DTDBGFEN is set to 1. The TIMER0_DTFAULTC register can be
used to clear fault bits.
This bit is set to 1 if a PRS 1 fault has occurred and DTPRS1FEN is set to 1. The TIMER0_DTFAULTC register can be
used to clear fault bits.
This bit is set to 1 if a PRS 0 fault has occurred and DTPRS0FEN is set to 1. The TIMER0_DTFAULTC register can be
used to clear fault bits.
0x0F8 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
W(nB) 0x0 4
DTLOCKUPFC W(nB) 0x0 3
W(nB) 0x0 2
W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
DTEM23FC
DTPRS1FC
DTPRS0FC
DTDBGFC
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0FC 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
0x0
Reset
Access
DTILOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock TIMER_ROUTE, TIMER_DTCTRL, TIMER_DTCFG, TIMER_DTTI-
MECFG and TIMER_DTFCFG from editing. Write the unlock code to unlock the DTI registers.
Quick Facts
What?
0 1 2 3 4
The USART handles high-speed UART, SPI-bus,
SmartCards, and IrDA communication.
Why?
CLK
µC CS
19.1 Introduction
The Universal Synchronous Asynchronous serial Receiver and Transmitter (USART) is a very flexible serial I/O module. It supports full
duplex asynchronous UART communication as well as RS-485, SPI, MicroWire and 3-wire. It can also interface with ISO7816 Smart-
Cards, and IrDA devices.
19.2 Features
An overview of the USART module is shown in Figure 19.1 USART Overview on page 534.
This section describes all posible USART features. Please refer to the Device Datasheet to see what features a specific USART in-
stance supports.
USn_CTS
Peripheral Bus
USn_RTS
USn_CS
UART Control TX Buffer RX Buffer
and status (2-level FIFO) (2-level FIFO)
!RXBLOCK
U(S)n_TX
IrDA TX Shift Register RX Shift Register
Pin modulator
ctrl
USn_CLK
TIMECMP0
Baud rate
Timer TIMECMP1 generator
TIMECMP2
U(S)n_RX Auto Baud
Detection
IrDA
PRS inputs demodulator
In synchronous mode, a separate clock signal is transmitted with the data. This clock signal is generated by the main interface on the
bus, and both the main and secondary devices sample and transmit data according to this clock. Both main and secondary interface
modes are supported by the USART. The synchronous communication mode is compatible with the Serial Peripheral Interface Bus
(SPI) standard.
In asynchronous mode, no separate clock signal is transmitted with the data on the bus. The USART receiver thus has to determine
where to sample the data on the bus from the actual data. To make this possible, additional synchronization bits are added to the data
when operating in asynchronous mode, resulting in a slight overhead.
Asynchronous or synchronous mode can be selected by configuring SYNC in USARTn_CTRL. The options are listed with supported
protocols in Table 19.1 USART Asynchronous vs. Synchronous Mode on page 535. Full duplex and half duplex communication is
supported in both asynchronous and synchronous mode.
Table 19.2 USART Pin Usage on page 535 explains the functionality of the different USART pins when the USART operates in differ-
ent modes. Pin functionality enclosed in square brackets is optional, and depends on additional configuration parameters. LOOPBK and
MASTER are discussed in 19.3.2.14 Local Loopback and 19.3.3.3 Synchronous Main Interface Mode respectively.
Pin functionality
SYNC LOOPBK MASTER
U(S)n_TX (MOSI) U(S)n_RX (MISO) USn_CLK USn_CS
The frame format used in asynchronous mode consists of a set of data bits in addition to bits for synchronization and optionally a parity
bit for error checking. A frame starts with one start-bit (S), where the line is driven low for one bit-period. This signals the start of a
frame, and is used for synchronization. Following the start bit are 4 to 16 data bits and an optional parity bit. Finally, a number of stop-
bits, where the line is driven high, end the frame. An example frame is shown in Figure 19.2 USART Asynchronous Frame Format on
page 536.
Frame
The number of data bits in a frame is set by DATABITS in USARTn_FRAME, see Table 19.3 USART Data Bits on page 536, and the
number of stop-bits is set by STOPBITS in USARTn_FRAME, see Table 19.4 USART Stop Bits on page 536. Whether or not a parity
bit should be included, and whether it should be even or odd is defined by PARITY, also in USARTn_FRAME. For communication to be
possible, all parties of an asynchronous transfer must agree on the frame format being used.
0001 4
0010 5
0011 6
0100 7
0101 8 (Default)
0110 9
0111 10
1000 11
1001 12
1010 13
1011 14
1100 15
1101 16
00 0.5
01 1 (Default)
10 1.5
11 2
The order in which the data bits are transmitted and received is defined by MSBF in USARTn_CTRL. When MSBF is cleared, data in a
frame is sent and received with the least significant bit first. When it is set, the most significant bit comes first.
The frame format used by the transmitter can be inverted by setting TXINV in USARTn_CTRL, and the format expected by the receiver
can be inverted by setting RXINV in USARTn_CTRL. These bits affect the entire frame, not only the data bits. An inverted frame has a
low idle state, a high start-bit, inverted data and parity bits, and low stop-bits.
When parity bits are enabled, hardware automatically calculates and inserts any parity bits into outgoing frames, and verifies the re-
ceived parity bits in incoming frames. This is true for both asynchronous and synchronous modes, even though it is mostly used in
asynchronous communication. The possible parity modes are defined in Table 19.5 USART Parity Bits on page 537. When even pari-
ty is chosen, a parity bit is inserted to make the number of high bits (data + parity) even. If odd parity is chosen, the parity bit makes the
total number of high bits odd.
01 Reserved
10 Even parity
11 Odd parity
The USART clock defines the transmission and reception data rate. When operating in asynchronous mode, the baud rate (bit-rate) is
given by Figure 19.3 USART Baud Rate on page 538.
br = fPCLK/(oversample x (1 + USARTn_CLKDIV/256))
where fPCLK is the peripheral clock (PCLKUSARTn) frequency and oversample is the oversampling rate as defined by OVS in
USARTn_CTRL, see Table 19.6 USART Oversampling on page 538.
00 16
01 8
10 6
11 4
The USART has a fractional clock divider to allow the USART clock to be controlled more accurately than what is possible with a stand-
ard integral divider.
The clock divider used in the USART is a 20-bit value, with a 15-bit integral part and an 5-bit fractional part. The fractional part is config-
ured in the lower 5 bits of DIV in USART_CLKDIV. The lowest achievable baud rate at 32 MHz is about 61 bauds/sec.
Fractional clock division is implemented by distributing the selected fraction over four baud periods. The fractional part of the divider
tells how many of these periods should be extended by one peripheral clock cycle.
Given a desired baud rate brdesired, the clock divider USARTn_CLKDIV can be calculated by using Figure 19.4 USART Desired Baud
Rate on page 538:
Table 19.7 USART Baud Rates @ 4MHz Peripheral Clock with 20 bit CLKDIV on page 538 shows a set of desired baud rates and
how accurately the USART is able to generate these baud rates when running at a 4 MHz peripheral clock, using 16x or 8x oversam-
pling.
Table 19.7. USART Baud Rates @ 4MHz Peripheral Clock with 20 bit CLKDIV
Setting AUTOBAUDEN in USARTn_CLKDIV uses the first frame received to automatically set the baud rate provided that it contains
0x55 (IrDA uses 0x00). AUTOBAUDEN can be used in a simple LIN configuration to auto detect the SYNC byte. The receiver will
measure the number of local clock cycles between the beginning of the START bit and the beginning of the 8th data bit. The DIV field in
USARTn_CLKDIV will be overwritten with the new value. The OVS in USARTn_CTRL and the +1 count of the Baud Rate equation are
already factored into the result that gets written into the DIV field. To restart autobaud detection, clear AUTOBAUDEN and set it high
again. Since the auto baud detection is done over 8 baud times, only the upper 3 bits of the fractional part of the clock divider are
populated.
Asynchronous data transmission is initiated by writing data to the transmit buffer using one of the methods described in 19.3.2.6 Trans-
mit Buffer Operation. When the transmission shift register is empty and ready for new data, a frame from the transmit buffer is loaded
into the shift register, and if the transmitter is enabled, transmission begins. When the frame has been transmitted, a new frame is loa-
ded into the shift register if available, and transmission continues. If the transmit buffer is empty, the transmitter goes to an idle state,
waiting for a new frame to become available.
Transmission is enabled through the command register USARTn_CMD by setting TXEN, and disabled by setting TXDIS in the same
command register. When the transmitter is disabled using TXDIS, any ongoing transmission is aborted, and any frame currently being
transmitted is discarded. When disabled, the TX output goes to an idle state, which by default is a high value. Whether or not the trans-
mitter is enabled at a given time can be read from TXENS in USARTn_STATUS.
When the USART transmitter is enabled and there is no data in the transmit shift register or transmit buffer, the TXC flag in
USARTn_STATUS and the TXC interrupt flag in USARTn_IF are set, signaling that the transmission is complete. The TXC status flag is
cleared when a new frame becomes available for transmission, but the TXC interrupt flag must be cleared by software.
The transmit-buffer is a multiple entry FIFO buffer. A frame can be loaded into the buffer by writing to USARTn_TXDATA,
USARTn_TXDATAX, USARTn_TXDOUBLE or USARTn_TXDOUBLEX. Using USARTn_TXDATA allows 8 bits to be written to the buf-
fer, while using USARTn_TXDOUBLE will write 2 frames of 8 bits to the buffer. If 9-bit frames are used, the 9th bit of the frames will in
these cases be set to the value of BIT8DV in USARTn_CTRL.
To set the 9th bit directly and/or use transmission control, USARTn_TXDATAX and USARTn_TXDOUBLEX must be used.
USARTn_TXDATAX allows 9 data bits to be written, as well as a set of control bits regarding the transmission of the written frame.
Every frame in the buffer is stored with 9 data bits and additional transmission control bits. USARTn_TXDOUBLEX allows two frames,
complete with control bits to be written at once. When data is written to the transmit buffer using USARTn_TXDATAX and
USARTn_TXDOUBLEX, the 9th bit(s) written to these registers override the value in BIT8DV in USARTn_CTRL, and alone define the
9th bits that are transmitted if 9-bit frames are used. Figure 19.5 USART Transmit Buffer Operation on page 540 shows the basics of
the transmit buffer when DATABITS in USARTn_FRAME is configured to less than 10 bits.
Peripheral Bus
TXDOUBLE, TXDATA,
TXDOUBLEX TXDATAX
TX buffer element 1 Write CTRL
Shift register
Write CTRL
When writing more frames to the transmit buffer than there is free space for, the TXOF interrupt flag in USARTn_IF will be set, indicat-
ing the overflow. The data already in the transmit buffer is preserved in this case, and no data is written.
In addition to the interrupt flag TXC in USARTn_IF and status flag TXC in USARTn_STATUS which are set when the transmission is
complete, TXBL in USARTn_STATUS and the TXBL interrupt flag in USARTn_IF are used to indicate the level of the transmit buffer.
TXBIL in USARTn_CTRL controls the level at which these bits are set. If TXBIL is cleared, they are set whenever the transmit buffer
becomes empty, and if TXBIL is set, they are set whenever the transmit buffer goes from full to half-full or empty. Both the TXBL status
flag and the TXBL interrupt flag are cleared automatically when their condition becomes false.
The transmit buffer, including the transmit shift register can be cleared by setting CLEARTX in USARTn_CMD. This will prevent the
USART from transmitting the data in the buffer and shift register, and will make them available for new data. Any frame currently being
transmitted will not be aborted. Transmission of this frame will be completed.
The transmission control bits, which can be written using USARTn_TXDATAX and USARTn_TXDOUBLEX, affect the transmission of
the written frame. The following options are available:
• Generate break: By setting TXBREAK, the output will be held low during the stop-bit period to generate a framing error. A receiver
that supports break detection detects this state, allowing it to be used e.g. for framing of larger data packets. The line is driven high
before the next frame is transmitted so the next start condition can be identified correctly by the recipient. Continuous breaks lasting
longer than a USART frame are thus not supported by the USART. GPIO can be used for this.
• Disable transmitter after transmission: If TXDISAT is set, the transmitter is disabled after the frame has been fully transmitted.
• Enable receiver after transmission: If RXENAT is set, the receiver is enabled after the frame has been fully transmitted. It is enabled
in time to detect a start-bit directly after the last stop-bit has been transmitted.
• Unblock receiver after transmission: If UBRXAT is set, the receiver is unblocked and RXBLOCK is cleared after the frame has been
fully transmitted.
• Tristate transmitter after transmission: If TXTRIAT is set, TXTRI is set after the frame has been fully transmitted, tristating the trans-
mitter output. Tristating of the output can also be performed automatically by setting AUTOTRI. If AUTOTRI is set TXTRI is always
read as 0.
Note: When in SmartCard mode with repeat enabled, none of the actions, except generate break, will be performed until the frame is
transmitted without failure. Generation of a break in SmartCard mode with repeat enabled will cause the USART to detect a NACK on
every frame.
Data reception is enabled by setting RXEN in USARTn_CMD. When the receiver is enabled, it actively samples the input looking for a
transition from high to low indicating the start baud of a new frame. When a start baud is found, reception of the new frame begins if the
receive shift register is empty and ready for new data. When the frame has been received, it is pushed into the receive buffer, making
the shift register ready for another frame of data, and the receiver starts looking for another start baud. If the receive buffer is full, the
received frame remains in the shift register until more space in the receive buffer is available. If an incoming frame is detected while
both the receive buffer and the receive shift register are full, the data in the shift register is overwritten, and the RXOF interrupt flag in
USARTn_IF is set to indicate the buffer overflow.
The receiver can be disabled by setting the command bit RXDIS in USARTn_CMD. Any frame currently being received when the re-
ceiver is disabled is discarded. Whether or not the receiver is enabled at a given time can be read out from RXENS in USARTn_STA-
TUS.
When data becomes available in the receive buffer, the RXDATAV flag in USARTn_STATUS, and the RXDATAV interrupt flag in
USARTn_IF are set, and when the buffer becomes full, RXFULL in USARTn_STATUS and the RXFULL interrupt flag in USARTn_IF
are set. The status flags RXDATAV and RXFULL are automatically cleared by hardware when their condition is no longer true. This
also goes for the RXDATAV interrupt flag, but the RXFULL interrupt flag must be cleared by software. When the RXFULL flag is set,
notifying that the buffer is full, space is still available in the receive shift register for one more frame.
Data can be read from the receive buffer in a number of ways. USARTn_RXDATA gives access to the 8 least significant bits of the
received frame, and USARTn_RXDOUBLE makes it possible to read the 8 least significant bits of two frames at once, pulling two
frames from the buffer. To get access to the 9th, most significant bit, USARTn_RXDATAX must be used. This register also contains
status information regarding the frame. USARTn_RXDOUBLEX can be used to get two frames complete with the 9th bits and status
bits.
When a frame is read from the receive buffer using USARTn_RXDATA or USARTn_RXDATAX, the frame is pulled out of the buffer,
making room for a new frame. USARTn_RXDOUBLE and USARTn_RXDOUBLEX pull two frames out of the buffer. If an attempt is
done to read more frames from the buffer than what is available, the RXUF interrupt flag in USARTn_IF is set to signal the underflow,
and the data read from the buffer is undefined.
Frames can be read from the receive buffer without removing the data by using USARTn_RXDATAXP and USARTn_RXDOUBLEXP.
USARTn_RXDATAXP gives access the first frame in the buffer with status bits, while USARTn_RXDOUBLEXP gives access to both
frames with status bits. The data read from these registers when the receive buffer is empty is undefined. If the receive buffer contains
one valid frame, the first frame in USARTn_RXDOUBLEXP will be valid. No underflow interrupt is generated by a read using these
registers, i.e. RXUF in USARTn_IF is never set as a result of reading from USARTn_RXDATAXP or USARTn_RXDOUBLEXP.
The basic operation of the receive buffer when DATABITS in USARTn_FRAME is configured to less than 10 bits is shown in Figure
19.6 USART Receive Buffer Operation on page 542.
Peripheral Bus
RXDOUBLE RXDATA,
RXDOUBLEX RXDATAX,
RXDOUBLEXP RX buffer element 0 Status RXDATAXP
Shift register
Status
The receive buffer, including the receive shift register can be cleared by setting CLEARRX in USARTn_CMD. Any frame currently being
received will not be discarded.
When using hardware frame recognition, as detailed in 19.3.2.20 Multi-Processor Mode and 19.3.2.21 Collision Detection, it is necessa-
ry to be able to let the receiver sample incoming frames without passing the frames to software by loading them into the receive buffer.
This is accomplished by blocking incoming data.
Incoming data is blocked as long as RXBLOCK in USARTn_STATUS is set. When blocked, frames received by the receiver will not be
loaded into the receive buffer, and software is not notified by the RXDATAV flag in USARTn_STATUS or the RXDATAV interrupt flag in
USARTn_IF at their arrival. For data to be loaded into the receive buffer, RXBLOCK must be cleared in the instant a frame is fully re-
ceived by the receiver. RXBLOCK is set by setting RXBLOCKEN in USARTn_CMD and disabled by setting RXBLOCKDIS also in
USARTn_CMD. There is one exception where data is loaded into the receive buffer even when RXBLOCK is set. This is when an ad-
dress frame is received when operating in multi-processor mode. See 19.3.2.20 Multi-Processor Mode for more information.
Frames received containing framing or parity errors will not result in the FERR and PERR interrupt flags in USARTn_IF being set while
RXBLOCK in USARTn_STATUS is set. Hardware recognition is not applied to these erroneous frames, and they are silently discarded.
Note: If a frame is received while RXBLOCK in USARTn_STATUS is cleared, but stays in the receive shift register because the receive
buffer is full, the received frame will be loaded into the receive buffer when space becomes available even if RXBLOCK is set at that
time. The overflow interrupt flag RXOF in USARTn_IF will be set if a frame in the receive shift register, waiting to be loaded into the
receive buffer is overwritten by an incoming frame even though RXBLOCK in USARTn_STATUS is set.
The receiver samples the incoming signal at a rate 16, 8, 6 or 4 times higher than the given baud rate, depending on the oversampling
mode given by OVS in USARTn_CTRL. Lower oversampling rates make higher baud rates possible, but give less room for errors.
When a high-to-low transition is registered on the input while the receiver is idle, this is recognized as a start-bit, and the baud rate
generator is synchronized with the incoming frame.
For oversampling modes 16, 8 and 6, every bit in the incoming frame is sampled three times to gain a level of noise immunity. These
samples are aimed at the middle of the bit-periods, as visualized in Figure 19.7 USART Sampling of Start and Data Bits on page 544.
With OVS=0 in USARTn_CTRL, the start and data bits are thus sampled at locations 8, 9 and 10 in the figure, locations 4, 5 and 6 for
OVS=1 and locations 3, 4, and 5 for OVS=2. The value of a sampled bit is determined by majority vote. If two or more of the three bit-
samples are high, the resulting bit value is high. If the majority is low, the resulting bit value is low.
Majority vote is used for all oversampling modes except 4x oversampling. In this mode, a single sample is taken at position 3 as shown
in Figure 19.7 USART Sampling of Start and Data Bits on page 544.
If the value of the start bit is found to be high, the reception of the frame is aborted, filtering out false start bits possibly generated by
noise on the input.
0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13
OVS = 1
0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7
OVS = 2
0 1 2 3 4 5 6 1 2 3 4 5
OVS = 3
1 2 3 4 1 2 3 4
If the baud rate of the transmitter and receiver differ, the location each bit is sampled will be shifted towards the previous or next bit in
the frame. This is acceptable for small errors in the baud rate, but for larger errors, it will result in transmission errors.
When the number of stop bits is 1 or more, stop bits are sampled like the start and data bits as seen in Figure 19.8 USART Sampling of
Stop Bits when Number of Stop Bits are 1 or More on page 545. When a stop bit has been detected by sampling at positions 8, 9 and
10 for normal mode, or 4, 5 and 6 for smart mode, the USART is ready for a new start bit. As seen in Figure 19.8 USART Sampling of
Stop Bits when Number of Stop Bits are 1 or More on page 545, a stop-bit of length 1 normally ends at c, but the next frame will be
received correctly as long as the start-bit comes after position a for OVS=0 and OVS=3, and b for OVS=1 and OVS=2.
a b c
OVS = 0
13 14 15 16 1 2 3 4 5 6 7 8 9 10 0/1 X X X X X
OVS = 1
7 8 1 2 3 4 5 6 0/1 X
OVS = 2
6 1 2 3 4 5 0/1 1
OVS = 3
4 1 2 3 0/1 1
Figure 19.8. USART Sampling of Stop Bits when Number of Stop Bits are 1 or More
When working with stop bit lengths of half a baud period, the above sampling scheme no longer suffices. In this case, the stop-bit is not
sampled, and no framing error is generated in the receiver if the stop-bit is not generated. The line must still be driven high before the
next start bit however for the USART to successfully identify the start bit.
When parity bits are enabled, a parity check is automatically performed on incoming frames. When a parity error is detected in an in-
coming frame, the data parity error bit PERR in the frame is set, as well as the interrupt flag PERR in USARTn_IF. Frames with parity
errors are loaded into the receive buffer like regular frames.
PERR can be accessed by reading the frame from the receive buffer using the USARTn_RXDATAX, USARTn_RXDATAXP,
USARTn_RXDOUBLEX or USARTn_RXDOUBLEXP registers.
If ERRSTX in USARTn_CTRL is set, the transmitter is disabled on received parity and framing errors. If ERRSRX in USARTn_CTRL is
set, the receiver is disabled on parity and framing errors.
A framing error is the result of an asynchronous frame where the stop bit was sampled to a value of 0. This can be the result of noise
and baud rate errors, but can also be the result of a break generated by the transmitter on purpose.
When a framing error is detected in an incoming frame, the framing error bit FERR in the frame is set. The interrupt flag FERR in
USARTn_IF is also set. Frames with framing errors are loaded into the receive buffer like regular frames.
FERR can be accessed by reading the frame from the receive buffer using the USARTn_RXDATAX, USARTn_RXDATAXP,
USARTn_RXDOUBLEX or USARTn_RXDOUBLEXP registers.
If ERRSTX in USARTn_CTRL is set, the transmitter is disabled on parity and framing errors. If ERRSRX in USARTn_CTRL is set, the
receiver is disabled on parity and framing errors.
The USART receiver samples U(S)n_RX by default, and the transmitter drives U(S)n_TX by default. This is not the only option howev-
er. When LOOPBK in USARTn_CTRL is set, the receiver is connected to the U(S)n_TX pin as shown in Figure 19.9 USART Local
Loopback on page 546. This is useful for debugging, as the USART can receive the data it transmits, but it is also used to allow the
USART to read and write to the same pin, which is required for some half duplex communication modes. In this mode, the U(S)n_TX
pin must be enabled as an output in the GPIO.
LOOBPK = 0 LOOBPK = 1
µC µC
USART USART
TX U(S)n_TX TX U(S)n_TX
RX U(S)n_RX RX U(S)n_RX
When doing full duplex communication, two data links are provided, making it possible for data to be sent and received at the same
time. In half duplex mode, data is only sent in one direction at a time. There are several possible half duplex setups, as described in the
following sections.
In this setup, the USART both receives and transmits data on the same pin. This is enabled by setting LOOPBK in USARTn_CTRL,
which connects the receiver to the transmitter output. Because they are both connected to the same line, it is important that the USART
transmitter does not drive the line when receiving data, as this would corrupt the data on the line.
When communicating over a single data-link, the transmitter must thus be tristated whenever not transmitting data. This is done by
setting the command bit TXTRIEN in USARTn_CMD, which tristates the transmitter. Before transmitting data, the command bit TXTRI-
DIS, also in USARTn_CMD, must be set to enable transmitter output again. Whether or not the output is tristated at a given time can be
read from TXTRI in USARTn_STATUS. If TXTRI is set when transmitting data, the data is shifted out of the shift register, but is not put
out on U(S)n_TX.
When operating a half duplex data bus, it is common to have a main bus controller, which first transmits a request to one of the secon-
dary devices on the bus, then receives a reply. In this case, the frame transmission control bits, which can be set by writing to
USARTn_TXDATAX, can be used to make the USART automatically disable transmission, tristate the transmitter and enable reception
when the request has been transmitted, making it ready to receive a response from the secondary device.
The timer, 19.3.10 Timer, can also be used to add delay between the RX and TX frames so that the interrupt service routine has time to
process data that was just received before transmitting more data. Also hardware flow control is another method to insert time for pro-
cessing the frame. RTS and CTS can be used to halt either the link partner's transmitter or the local transmitter. See the section on
hardware flow control, 19.3.4 Hardware Flow Control, for more details.
Tristating the transmitter can also be performed automatically by the USART by using AUTOTRI in USARTn_CTRL. When AUTOTRI is
set, the USART automatically tristates U(S)n_TX whenever the transmitter is idle, and enables transmitter output when the transmitter
goes active. If AUTOTRI is set TXTRI is always read as 0.
Note: Another way to tristate the transmitter is to enable wired-and or wired-or mode in GPIO. For wired-and mode, outputting a 1 will
be the same as tristating the output, and for wired-or mode, outputting a 0 will be the same as tristating the output. This can only be
done on buses with a pull-up or pull-down resistor respectively.
Some communication schemes, such as RS-485 rely on an external driver. Here, the driver has an extra input which enables it, and
instead of tristating the transmitter when receiving data, the external driver must be disabled.
This can be done manually by assigning a GPIO to turn the driver on or off, or it can be handled automatically by the USART. If AU-
TOCS in USARTn_CTRL is set, the USn_CS output is automatically activated a configurable number of baud periods before the
transmitter starts transmitting data, and deactivated a configurable number of baud periods after the last bit has been transmitted and
there is no more data in the transmit buffer to transmit. The number of baud periods are controlled by CSSETUP and CSHOLD in
USARTn_TIMING. This feature can be used to turn the external driver on when transmitting data, and turn it off when the data has
been transmitted.
The timer, 19.3.10 Timer, can also be used to configure CSSETUP and CSHOLD values between 1 to 256 baud-times by using
TCMPVAL0, TCMPVAL1, or TCMPVAL2 for the TX sequencer.
Figure 19.10 USART Half Duplex Communication with External Driver on page 547 shows an example configuration where USn_CS
is used to automatically enable and disable an external driver.
µC
USART
CS
TX
RX
The USn_CS output is active low by default, but its polarity can be changed with CSINV in USARTn_CTRL. AUTOCS works regardless
of which mode the USART is in, so this functionality can also be used for automatic chip select when in synchronous mode (e.g. SPI).
Some limited devices only support half duplex communication even though two data links are available. In this case software is respon-
sible for making sure data is not transmitted when incoming data is expected.
TXARXnEN in USARTn_TRIGCTRL may be used to automatically start transmission after the end of the RX frame plus any TXSTDE-
LAY and CSSETUP delay in USARTn_TIMING. For enabling the receiver either use RXENAT in USARTn_TXDATAX or RXATXnEN in
USARTn_TRIGCTRL.
As each frame in the transmit and receive buffers holds a maximum of 9 bits, both the elements in the buffers are combined when
working with USART-frames of 10 or more data bits.
To transmit such a frame, at least two elements must be available in the transmit buffer. If only one element is available, the USART will
wait for the second element before transmitting the combined frame. Both the elements making up the frame are consumed when
transmitting such a frame.
When using large frames, the 9th bits in the buffers are unused. For an 11 bit frame, the 8 least significant bits are thus taken from the
first element in the buffer, and the 3 remaining bits are taken from the second element as shown in Figure 19.11 USART Transmission
of Large Frames on page 548. The first element in the transmit buffer, i.e. element 0 in Figure 19.11 USART Transmission of Large
Frames on page 548 is the first element written to the FIFO, or the least significant byte when writing two bytes at a time using
USARTn_TXDOUBLE.
Peripheral Bus
Shift register
0 1 2 3 4 5 6 7 0 1 2 Write CTRL
As shown in Figure 19.11 USART Transmission of Large Frames on page 548, frame transmission control bits are taken from the sec-
ond element in FIFO.
The two buffer elements can be written at the same time using the USARTn_TXDOUBLE or USARTn_TXDOUBLEX register. The
TXDATAX0 bitfield then refers to buffer element 0, and TXDATAX1 refers to buffer element 1.
Peripheral Bus
TX buffer element 1 0 1 2
TX buffer element 0 0 1 2 3 4 5 6 7
Shift register
2 1 0 7 6 5 4 3 2 1 0
Figure 19.12 USART Transmission of Large Frames, MSBF on page 548 illustrates the order of the transmitted bits when an 11 bit
frame is transmitted with MSBF set. If MSBF is set and the frame is smaller than 10 bits, only the contents of transmit buffer 0 will be
transmitted.
When receiving a large frame, BYTESWAP in USARTn_CTRL determines the order the way the large frame is split into the two buffer
elements. If BYTESWAP is cleared, the least significant 8 bits of the received frame are loaded into the first element of the receive
buffer, and the remaining bits are loaded into the second element, as shown in Figure 19.13 USART Reception of Large Frames on
page 549. The first byte read from the buffer thus contains the 8 least significant bits. Set BYTESWAP to reverse the order.
The status bits are loaded into both elements of the receive buffer. The frame is not moved from the receive shift register before there
are two free spaces in the receive buffer.
Peripheral Bus
Shift register
Status 0 1 2 3 4 5 6 7 0 1 2
The two buffer elements can be read at the same time using the USARTn_RXDOUBLE or USARTn_RXDOUBLEX register. RXDATA0
then refers to buffer element 0 and RXDATA1 refers to buffer element 1.
To simplify communication between multiple processors, the USART supports a special multi-processor mode. In this mode the 9th
data bit in each frame is used to indicate whether the content of the remaining 8 bits is data or an address.
When multi-processor mode is enabled, an incoming 9-bit frame with the 9th bit equal to the value of MPAB in USARTn_CTRL is identi-
fied as an address frame. When an address frame is detected, the MPAF interrupt flag in USARTn_IF is set, and the address frame is
loaded into the receive register. This happens regardless of the value of RXBLOCK in USARTn_STATUS.
Multi-processor mode is enabled by setting MPM in USARTn_CTRL, and the value of the 9th bit in address frames can be set in MPAB.
Note that the receiver must be enabled for address frames to be detected. The receiver can be blocked however, preventing data from
being loaded into the receive buffer while looking for address frames.
When a device has received an address frame and wants to receive the following data, it must make sure the receiver is unblocked
before the next frame has been completely received in order to prevent data loss.
BIT8DV in USARTn_CTRL can be used to specify the value of the 9th bit without writing to the transmit buffer with USARTn_TXDATAX
or USARTn_TXDOUBLEX, giving higher efficiency in multi-processor mode, as the 9th bit is only set when writing address frames, and
8-bit writes to the USART can be used when writing the data frames.
The USART supports a basic form of collision detection. When the receiver is connected to the output of the transmitter, either by using
the LOOPBK bit in USARTn_CTRL or through an external connection, this feature can be used to detect whether data transmitted on
the bus by the USART did get corrupted by a simultaneous transmission by another device on the bus.
For collision detection to be enabled, CCEN in USARTn_CTRL must be set, and the receiver enabled. The data sampled by the receiv-
er is then continuously compared with the data output by the transmitter. If they differ, the CCF interrupt flag in USARTn_IF is set. The
collision check includes all bits of the transmitted frames. The CCF interrupt flag is set once for each bit sampled by the receiver that
differs from the bit output by the transmitter. When the transmitter output is disabled, i.e. the transmitter is tristated, collisions are not
registered.
In SmartCard mode, the USART supports the ISO 7816 I/O line T0 mode. With exception of the stop-bits (guard time), the 7816 data
frame is equal to the regular asynchronous frame. In this mode, the receiver pulls the line low for one baud, half a baud into the guard
time to indicate a parity error. This NAK can for instance be used by the transmitter to re-transmit the frame. SmartCard mode is a half
duplex asynchronous mode, so the transmitter must be tristated whenever not transmitting data.
To enable SmartCard mode, set SCMODE in USARTn_CTRL, set the number of databits in a frame to 8, and configure the number of
stopbits to 1.5 by writing to STOPBITS in USARTn_FRAME.
The SmartCard mode relies on half duplex communication on a single line, so for it to work, both the receiver and transmitter must work
on the same line. This can be achieved by setting LOOPBK in USARTn_CTRL or through an external connection. The TX output
should be configured as open-drain in the GPIO module.
When no parity error is identified by the receiver, the data frame is as shown in Figure 19.14 USART ISO 7816 Data Frame Without
Error on page 550. The frame consists of 8 data bits, a parity bit, and 2 stop bits. The transmitter does not drive the output line during
the guard time.
S 0 1 2 3 4 5 6 7 P Stop
If a parity error is detected by the receiver, it pulls the line I/O line low after half a stop bit, see Figure 19.15 USART ISO 7816 Data
Frame With Error on page 550. It holds the line low for one bit-period before it releases the line. In this case, the guard time is exten-
ded by one bit period before a new transmission can start, resulting in a total of 3 stop bits.
S 0 1 2 3 4 5 6 7 P NAK Stop
Stop
On a parity error, the NAK is generated by hardware. The NAK generated by the receiver is sampled as the stop-bit of the frame. Be-
cause of this, parity errors when in SmartCard mode are reported with both a parity error and a framing error.
When transmitting a T0 frame, the USART receiver on the transmitting side samples position 16, 17 and 18 in the stop-bit to detect the
error signal when in 16x oversampling mode as shown in Figure 19.16 USART SmartCard Stop Bit Sampling on page 551. Sampling
at this location places the stop-bit sample in the middle of the bit-period used for the error signal (NAK).
If a NAK is transmitted by the receiver, it will thus appear as a framing error at the transmitter, and the FERR interrupt flag in
USARTn_IF will be set. If SCRETRANS USARTn_CTRL is set, the transmitter will automatically retransmit a NACK’ed frame. The
transmitter will retransmit the frame until it is ACK’ed by the receiver. This only works when the number of databits in a frame is config-
ured to 8.
Set SKIPPERRF in USARTn_CTRL to make the receiver discard frames with parity errors. The PERR interrupt flag in USARTn_IF is
set when a frame is discarded because of a parity error.
OVS = 0
P 1/2 stop bit NAK or stop Stop
13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 X X X X X X
OVS = 1
7 8 1 2 3 4 5 6 7 8 9 10 X X
OVS = 2
6 1 2 3 4 5 6 7 8 x
OVS = 3
4 1 2 3 4 5 x
For communication with a SmartCard, a clock signal needs to be generated for the card. This clock output can be generated using one
of the timers. See the ISO 7816 specification for more info on this clock signal.
SmartCard T1 mode is also supported. The T1 frame format used is the same as the asynchronous frame format with parity bit enabled
and one stop bit. The USART must then be configured to operate in asynchronous half duplex mode.
Most of the features in asynchronous mode are available in synchronous mode. Multi-processor mode can be enabled for 9-bit frames,
loopback is available and collision detection can be performed.
The frames used in synchronous mode need no start and stop bits since a single clock is available to all parts participating in the com-
munication. Parity bits cannot be used in synchronous mode.
The USART supports frame lengths of 4 to 16 bits per frame. Larger frames can be simulated by transmitting multiple smaller frames,
i.e. a 22 bit frame can be sent using two 11-bit frames, and a 21 bit frame can be generated by transmitting three 7-bit frames. The
number of bits in a frame is set using DATABITS in USARTn_FRAME.
The frames in synchronous mode are by default transmitted with the least significant bit first like in asynchronous mode. The bit-order
can be reversed by setting MSBF in USARTn_CTRL.
The frame format used by the transmitter can be inverted by setting TXINV in USARTn_CTRL, and the format expected by the receiver
can be inverted by setting RXINV, also in USARTn_CTRL.
The bit-rate in synchronous mode is given by Figure 19.17 USART Synchronous Mode Bit Rate on page 552. As in the case of asyn-
chronous operation, the clock division factor have a 15-bit integral part and a 5-bit fractional part.
br = fPCLK/(2 x (1 + USARTn_CLKDIV/256))
Given a desired baud rate brdesired, the clock divider USARTn_CLKDIV can be calculated using Figure 19.18 USART Synchronous
Mode Clock Division Factor on page 552
When the USART operates as a synchronous main interface, the highest possible bit rate is half the peripheral clock rate. When operat-
ing as a secondary interface however, the highest bit rate is one sixth of the peripheral clock:
• Main interface mode: brmax = fPCLK/2
• Secondary interface mode: brmax = fPCLK/6
On every clock edge data on the data lines, MOSI and MISO, is either set up or sampled. When CLKPHA in USARTn_CTRL is cleared,
data is sampled on the leading clock edge and set-up is done on the trailing edge. If CLKPHA is set however, data is set-up on the
leading clock edge, and sampled on the trailing edge. In addition to this, the polarity of the clock signal can be changed by setting
CLKPOL in USARTn_CTRL, which also defines the idle state of the clock. This results in four different modes which are summarized in
Table 19.8 USART SPI Modes on page 552. Figure 19.19 USART SPI Timing on page 552 shows the resulting timing of data set-
up and sampling relative to the bus clock.
CLKPOL = 0
USn_CLK
CLKPOL = 1
USn_CS
CLKPHA = 0 X 0 1 2 3 4 5 6 7 X
USn_TX/
USn_RX
CLKPHA = 1 X 0 1 2 3 4 5 6 7 X
If CPHA=1, the TX underflow flag, TXUF, will be set on the first setup clock edge of a frame in secondary mode if TX data is not availa-
ble. If CPHA=0, TXUF is set if data is not available in the transmit buffer three PCLK cycles prior to the first sample clock edge. The
RXDATAV flag is updated on the last sample clock edge of a transfer, while the RX overflow interrupt flag, RXOF, is set on the first
sample clock edge if the receive buffer overflows. When a transfer has been performed, interrupt flags TXBL and TXC are updated on
the first setup clock edge of the succeeding frame, or when CS is deasserted.
When configured as a main interface, the USART is in full control of the data flow on the synchronous bus. When operating in full du-
plex mode, the secondary devices cannot transmit data to the main device without the main device transmitting to the secondary. The
main device outputs the bus clock on USn_CLK.
Communication starts whenever there is data in the transmit buffer and the transmitter is enabled. The USART clock then starts, and
the main device shifts bits out from the transmit shift register using the internal clock.
When there are no more frames in the transmit buffer and the transmit shift register is empty, the clock stops, and communication ends.
When the receiver is enabled, it samples data using the internal clock when the transmitter transmits data. Operation of the RX and TX
buffers is as in asynchronous mode.
When operating as a synchronous main interface, the USn_CS pin can have one of two functions, or it can be disabled.
If USn_CS is configured as an output, it can be used to automatically generate a chip select for a secondary device by setting AUTOCS
in USARTn_CTRL. If AUTOCS is set, USn_CS is activated before a transmission begins, and deactivated after the last bit has been
transmitted and there is no more data in the transmit buffer.
The time between when CS is asserted and the first bit is transmitted can be controlled using the USART Timer and with CSSETUP in
USARTn_TIMING. Any of the three comparators can be used to set this delay. If new data is ready for transmission before CS is deas-
serted, the data is sent without deasserting CS in between. CSHOLD in USARTn_TIMING keeps CS asserted after the end of frame for
the number of baud-times specified.
By default, USn_CS is active low, but its polarity can be inverted by setting CSINV in USARTn_CTRL.
When USn_CS is configured as an input, it can be used by another synchronous main device that wants control of the bus to make the
USART release it. When USn_CS is driven low, or high if CSINV is set, the interrupt flag SSM in USARTn_IF is set, and if CSMA in
USARTn_CTRL is set, the USART goes to secondary mode.
19.3.3.5 AUTOTX
The main device on a synchronous bus is required to transmit data to a secondary device in order to receive data from that device. In
some cases, only a few words are transmitted and a lot of data is then received from the secondary device. In that case, one solution is
to keep feeding the TX with data to transmit, but that consumes system bandwidth. Instead AUTOTX can be used.
When AUTOTX in USARTn_CTRL is set, the USART transmits data as long as there is available space in the RX shift register for the
chosen frame size. This happens even though there is no data in the TX buffer. The TX underflow interrupt flag TXUF in USARTn_IF is
set on the first word that is transmitted which does not contain valid data.
During AUTOTX the USART will always send the previous sent bit, thus reducing the number of transitions on the TX output. So if the
last bit sent was a 0, 0's will be sent during AUTOTX and if the last bit sent was a 1, 1's will be sent during AUTOTX.
When the USART is in synchronous secondary interface mode, data transmission is not controlled by the USART, but by an external
synchronous main device. The USART is therefore not able to initiate a transmission, and has no control over the number of bytes
written to the external main device.
The output and input to the USART are also swapped when in secondary mode, making the receiver take its input from USn_TX (MO-
SI) and the transmitter drive USn_RX (MISO).
To transmit data when in secondary mode, the device must load data into the transmit buffer and enable the transmitter. The data will
remain in the USART until the main device starts a transmission by pulling the USn_CS input low and transmitting data. For every
frame transmitted from main to secondary device, a frame is transferred from secondary to main as well. After a transmission, MISO
remains in the same state as the last bit transmitted. This also applies if the main transmits to the secondary and the secondary TX
buffer is empty.
If the transmitter is enabled in secondary synchronous mode and the main device starts transmission of a frame, the underflow interrupt
flag TXUF in USARTn_IF will be set if no data is available for transmission.
If the secondary device needs to control its own chip select signal, this can be achieved by clearing CSPEN in the
GPIO_USARTn_ROUTEEN register. The internal chip select signal can then be controlled through CSINV in the CTRL register. The
chip select signal will be CSINV inverted, i.e. if CSINV is cleared, the chip select is active and vice versa.
Half duplex communication in synchronous mode is very similar to half duplex communication in asynchronous mode as detailed in
19.3.2.15 Asynchronous Half Duplex Communication. The main difference is that in this mode, the main interface must generate the
bus clock even when it is not transmitting data, i.e. it must provide the secondary device with a clock to receive data. To generate the
bus clock, the main device should transmit data with the transmitter tristated, i.e. TXTRI in USARTn_STATUS set, when receiving data.
If 2 bytes are expected from the secondary device, then transmit 2 bytes with the transmitter tristated, and the secondary uses the gen-
erated bus clock to transmit data to the main. TXTRI can be set by setting the TXTRIEN command bit in USARTn_CMD.
Note: When operating as SPI secondary interface in half duplex mode, TX has to be tristated (not disabled) during data reception if the
device is to transmit data in the current transfer.
19.3.3.8 I2S
I2S is a synchronous format for transmission of audio data. The frame format is 32-bit, but since data is always transmitted with MSB
first, an I2S device operating with 16-bit audio may choose to only process the 16 msb of the frame, and only transmit data in the 16
msb of the frame.
In addition to the bit clock used for regular synchronous transfers, I2S mode uses a separate word clock. When operating in mono
mode, with only one channel of data, the word clock pulses once at the start of each new word. In stereo mode, the word clock toggles
at the start of new words, and also gives away whether the transmitted word is for the left or right audio channel; A word transmitted
while the word clock is low is for the left channel, and a word transmitted while the word clock is high is for the right.
When operating in I2S mode, the CS pin is used as a the word clock. In main mode, this is automatically driven by the USART, and in
secondary mode, the word clock is expected from an external main device.
The general I2S word format is 32 bits wide, but the USART also supports 16-bit and 8-bit words. In addition to this, it can be specified
how many bits of the word should actually be used by the USART. These parameters are given by FORMAT in USARTn_I2SCTRL.
As an example, configuring FORMAT to using a 32-bit word with 16-bit data will make each word on the I2S bus 32-bits wide, but when
receiving data through the USART, only the 16 most significant bits of each word can be read out of the USART. Similarly, only the 16
most significant bits have to be written to the USART when transmitting. The rest of the bits will be transmitted as zeroes.
The USART supports a set of different I2S formats as shown in Table 19.9 USART I2S Modes on page 555, but it is not limited to
these modes. MONO, JUSTIFY and DELAY in USARTn_I2SCTRL can be mixed and matched to create an appropriate format. MONO
enables mono mode, i.e. one data stream instead of two which is the default. JUSTIFY aligns data within a word on the I2S bus, either
left or right which can bee seen in figures Figure 19.22 USART Left-Justified I2S Waveform on page 556 and Figure 19.23 USART
Right-Justified I2S Waveform on page 556. Finally, DELAY specifies whether a new I2S word should be started directly on the edge
of the word-select signal, or one bit-period after the edge.
Regular I2S 0 0 1 0
Left-Justified 0 0 0 1
Right-Justified 0 1 0 1
Mono 1 0 0 0
The regular I2S waveform is shown in Figure 19.20 USART Standard I2S Waveform on page 555 and Figure 19.21 USART Standard
I2S Waveform (Reduced Accuracy) on page 555. The first figure shows a waveform transmitted with full accuracy. The wordlength
can be configured to 32-bit, 16-bit or 8-bit using FORMAT in USARTn_I2SCTRL. In the second figure, I2S data is transmitted with re-
duced accuracy, i.e. the data transmitted has less bits than what is possible in the bus format.
Note that the msb of a word transmitted in regular I2S mode is delayed by one cycle with respect to word select
USn_CLK
USn_CS
(word select)
USn_CLK
USn_CS
(word select)
A left-justified stream is shown in Figure 19.22 USART Left-Justified I2S Waveform on page 556. Note that the MSB comes directly
after the edge on the word-select signal in contradiction to the regular I2S waveform where it comes one bit-period after.
USn_CLK
USn_CS
(word select)
A right-justified stream is shown in Figure 19.23 USART Right-Justified I2S Waveform on page 556. The left and right justified
streams are equal when the data-size is equal to the word-width.
USn_CLK
In mono-mode, the word-select signal pulses at the beginning of each word instead of toggling for each word. Mono I2S waveform is
shown in Figure 19.24 USART Mono I2S Waveform on page 556.
USn_CLK
USn_CS
(word select)
When using the USART in I2S mode, DATABITS in USARTn_FRAME must be set to 8 or 16 data-bits. 8 databits can be used in all
modes, and 16 can be used in the modes where the number of bytes in the I2S word is even. In addition to this, MSBF in
USARTn_CTRL should be set, and CLKPOL and CLKPHA in USARTn_CTRL should be cleared.
The USART does not have separate TX and RX buffers for left and right data, so when using I2S in stereo mode, the application must
keep track of whether the buffers contain left or right data. This can be done by observing TXBLRIGHT, RXDATAVRIGHT and
RXFULLRIGHT in USARTn_STATUS. TXBLRIGHT tells whether TX is expecting data for the left or right channel. It will be set with
TXBL if right data is expected. The receiver will set RXDATAVRIGHT if there is at least one right element in the buffer, and RXFULL-
RIGHT if the buffer is full of right elements.
When using I2S with DMA, separate DMA requests can be used for left and right data by setting DMASPLIT in USARTn_I2SCTRL.
In both main and secondary mode the USART always starts transmitting on the LEFT channel after being enabled. In main mode, the
transmission will stop if TX becomes empty. In that case, TXC is set. Continuing the transmission in this case will make the data-stream
continue where it left off. To make the USART start on the LEFT channel after going empty, disable and re-enable TX.
Hardware flow control can be used to hold off the link partner's transmission until RX buffer space is available. The RTS and CTS sig-
nals are enabled and configured using the GPIO_USARTn_ROUTEEN, GPIO_USARTn_RTSROUTEx and
GPIO_USARTn_CTSROUTE registers. RTS is an out going signal which indicates that RX buffer space is available to receive a frame.
The link partner is being requested to send its data when RTS is asserted. CTS is an incoming signal to stop the next TX data from
going out. When CTS is negated, the frame currently being transmitted is completed before stopping. CTS indicates that the link partner
has RX buffer space available, and the local transmitter is clear to send. Also use CTSEN in USARTn_CTLX to enable the CTS input
into the TX sequencer. For debug use set DBGHALT in USARTn_CTRLX which will force the RTS to request one frame from the link
partner when the CPU core single steps.
When DBGHALT in USART_CTRLX is clear, RTS is only dependent on the RX buffer having space available to receive data. Incoming
data is always received until both the RX buffer is full and the RX shift register is full regardless of the state of DBGHALT or chip halt.
Additional incoming data is discarded. When DBGHALT is set, RTS deasserts on RX buffer full or when chip halt is high. However, a
low pulse detected on chip halt will keep RTS asserted when no frame is being received. At the start of frame reception, RTS will deas-
sert if chip halt is high and DBGHALT is set. This behavior allows single stepping to pulse the chip halt low for a cycle, and receive the
next frame. The link partner must stop transmitting when RTS is deasserted, or the RX buffer could overflow. All data in the transmit
buffer is sent out even when chip halt is asserted; therefore, the DMA will need to be set to stop sending the USART TX data during
chip halt.
If a transmission must be started on an event with very little delay, the PRS system can be used to trigger the transmission. The PRS
channel to use as a trigger can be selected using PRSSEL in PRS_USARTn_TRIGGER. When a positive edge is detected on this sig-
nal, the receiver is enabled if RXTEN in USARTn_TRIGCTRL is set, and the transmitter is enabled if TXTEN in USARTn_TRIGCTRL is
set. Only one signal input is supported by the USART.
The AUTOTX feature can also be enabled via PRS. If an external SPI device sets a pin high when there is data to be read from the
device, this signal can be routed to the USART through the PRS system and be used to make the USART clock data out of the external
device. If AUTOTXTEN in USARTn_TRIGCTRL is set, the USART will transmit data whenever the PRS signal selected by
PRS_USARTn_TRIGGER is high given that there is enough room in the RX buffer for the chosen frame size. Note that if there is no
data in the TX buffer when using AUTOTX, the TX underflow interrupt will be set.
AUTOTXTEN can also be combined with TXTEN to make the USART transmit a command to the external device prior to clocking out
data. To do this, disable TX using the TXDIS command, load the TX buffer with the command and enable AUTOTXTEN and TXTEN.
When the selected PRS input goes high, the USART will now transmit the loaded command, and then continue clocking out while both
the PRS input is high and there is room in the RX buffer
The USART can be configured to receive data directly from a PRS channel by setting RXPRSEN in USARTn_CTRLX. The PRS chan-
nel used is selected using PRSSEL in PRS_USARTn_RX.
The USART can be configured to receive clock directly from a PRS channel by setting CLKPRSEN in USARTn_CTRLX. The PRS
channel used is selected using PRSSEL in PRS_USARTn_CLK. This is useful in synchronous secondary mode and can together with
RX PRS input be used to input data from PRS.
The USART has full DMA support. The DMA controller can write to the transmit buffer using the registers USARTn_TXDATA,
USARTn_TXDATAX, USARTn_TXDOUBLE and USARTn_TXDOUBLEX, and it can read from the receive buffer using the registers
USARTn_RXDATA, USARTn_RXDATAX, USARTn_RXDOUBLE and USARTn_RXDOUBLEX. This enables single byte transfers, 9 bit
data + control/status bits, double byte and double byte + control/status transfers both to and from the USART.
A request for the DMA controller to read from the USART receive buffer can come from the following source:
• Data available in the receive buffer
• Data available in the receive buffer and data is for the RIGHT I2S channel. Only used in I2S mode.
Even though there are two sources for write requests to the DMA, only one should be used at a time, since the requests from both
sources are cleared even though only one of the requests are used.
In some cases, it may be sensible to temporarily stop DMA access to the USART when an error such as a framing error has occurred.
This is enabled by setting ERRSDMA in USARTn_CTRL.
Note: For Synchronous mode full duplex operation, if both receive buffer and transmit buffer are served by DMA, to make sure receive
buffer is not overflowed the settings below should be followed.
• The DMA channel that serves receive buffer should have higher priority than the DMA channel that serves transmit buffer.
• TXBL should be used as write request for transmit buffer DMA channel.
• IGNORESREQ should be set for both DMA channel.
19.3.10 Timer
In addition to the TX sequence timer, there is a versatile 8 bit timer that can generate up to three event pulses. These pulses can be
used to create timing for a variety of uses such as RX timeout, break detection, response timeout, and RX enable delay. Transmission
delay, CS setup, inter-character spacing, and CS hold use the TX sequence counter. The TX sequencer counter can use the three 8 bit
compare values or preset values for delays. There is one general counter with three comparators. Each comparator has a start source,
a stop source, a restart enable, and a timer compare value. The start source enables the comparator, resets the counter, and starts the
counter. If the counter is already running, the start source will reset the counter and restart it.
Any comparator could start the counter using the same start source but have different timing events programmed into TCMPVALn in
USARTn_TIMECMPn. The TCMP0, TCMP1, or TCMP2 events can be preempted by using the comparator stop source to disable the
comparator before the counter reaches TCMPVAL0, TCMPVAL1, or TCMPVAL2. If one comparator gets disabled while the other com-
parator is still enabled, the counter continues counting. By default the counter will count up to 256 and stop unless a RESTARTEN is
set in one of the USARTn_TIMECMPn registers. By using RESTARTEN and an interval programmed into TCMPVAL, an interval timer
can be set up. The TSTART field needs to be changed to DISABLE to stop the interval timer. The timer stops running once all of the
comparators are disabled. If a comparator's start and stop sources both trigger the same cycle, the TCMPn event triggers, the compa-
rator stays enabled, and the counter begins counting from zero.
The TXDELAY, CSSETUP, ICS, and CSHOLD in USARTn_TIMING are used to program start of transmission delay, chip select setup
delay, inter-character space, and chip select hold delay. Either a preset value of 0, 1, 2, 3, or 7 can be used for any of these delays; or
the value in TCMPVALn may be used to set the delay. Using the preset values leaves the TCMPVALn free for other uses. The same
TCMPVALn may be used for multiple events that require the same timing. The transmit sequencer's counter can run in parallel with the
timer's counter. The counters and controls are shown in Figure 19.25 USART Timer Block Diagram on page 560.
TIMECMP2
TIMECMP1
TIMECMP0
TCMPn
TXST
RXACT
RXACTN TCMPVALn
TSTOP
GP_CNT[7:0]
clear
DISABLE
TXEOF TCMP
TXC Compare TCMPn
enable
RXACT
RXEOF
TSTART
START_An START_Bn RESTARTEN
START_A2
START_B2
START_A1 start
START_B1 event
START_A0
START_B0 bit time 8 bit GP_CNT[7:0]
Counter
TCMPVAL2
TCMPVAL1 TXSEQ TXEOF
TXARX2EN TCMPVAL0
TXC
TCMP2 TX Counter
TXARX1EN TXST
TCMP1 TXENS
TX
TXARX0EN
TCMP0
RX RXSEQ
RXATX2EN RXEOF
TCMP2
RXATX1EN
TCMP1 RXENS
RXATX0EN
TCMP0
The following sections will go into more details on programming the various usage cases.
Large Receiver Timeout TSTART1 = TSTOP1 = RXACT TCMPVAL1 TCMP1 in USARTn_IEN; TIME-
RXEOF, TCMP1 = 0xFF RRESTARTED in USARTn_STA-
TUS; RESTART1EN in
USARTn_TIMECMP1
TX delayed start of transmission and TSTART0 = DISA- TSTOP0 = TCMP0, TCMPVAL0 TXDELAY = TCMP0, CSSETUP =
CS setup BLE, TSTART1 = TSTOP1 = TCMP1 = 0x04, TCMP1 in USARTn_TIMING; AU-
DISABLE TCMPVAL1 TOCS in USARTn_CTRL
= 0x02
TX inter-character spacing TSTART2 = DISA- TSTOP2 = TCMP2 TCMPVAL2 ICS = TCMP2 in USARTn_TIMING;
BLE = 0x03 AUTOCS in USARTn_CTRL
TX Chip Select End Delay TSTART1 = DISA- TSTOP1 = TCMP1 TCMPVAL1 CSHOLD = TCMP1 in
BLE = 0x04 USARTn_TIMING; AUTOCS in
USARTn_CTRL
Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 shows some examples of how
the USART timer can be programmed for various applications. The following sections will describe more details for each applications
shown in the table.
Response Timeout is when a UART transmitter sends a frame and expects another device to respond within a certain number of baud-
times. Refer to Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 for specific reg-
ister settings. Comparator 0 will be looking for TX end of frame to use as the timer start source. For this example, a receiver start of
frame RXACT has not been detected for 8 baud-times, and the TCMP0 interrupt in USARTn_IF is set. If an RX start bit is detected
before the 8 baud-times, comparator 0 is disabled before the TCMP0 event can trigger.
TX
T
IN
Pn
M
RX
TC
RESPONSE TIMEOUT
19.3.10.2 RX Timeout
A receiver timeout function can be implemented by using the RX end of frame to start comparator 1 and look for the RX start bit RXACT
to disable the comparator. See Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560
for details on setting up this example. As long as the next RX start bit occurs before the counter reaches the comparator 1 value
TCMPVAL1, the interrupt will not get set. In this example the RX Timeout was set to 8 baud-times. To get an RX timeout larger than
256 baud-times, RESTART1EN in USARTn_TIMER can used to restart the counter when it reaches TCMPVAL1. By setting
TCMPVAL1 in USARTn_TIMING to 0xFF, an interrupt will be generated after 256 baud-times. An interrupt service routine can then
increment a memory location until the desired timeout is reached. Once the RX start bit is detected, comparator 1 will be disabled. If
TIMERRESTARTED in USARTn_STATUS is clear, the TCMP1 interrupt is the first interrupt after RXEOF.
T
IN
Pn
M
RX RX
TC
RECEIVER TIMEOUT
LIN bus and half-duplex UARTs can take advantage of the timer configured for break detection where RX is held low for a number of
baud-times to indicate a break condition. Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on
page 560 shows the settings for this mode. Each time RX is active (default of low) such as for a start bit, the timer begins counting. If
the counter reaches 12 baud-times before RX goes to inactive RXACTN (default of high), an interrupt is asserted.
T
IN
Pn
M
RX
TC
BREAK DETECT
Some applications may require a delay before the start of transmission. This example in Figure 19.29 USART TXSEQ Timing on page
563 shows the TXSEQ timer used to delay the start of transmission by 4 baud times before the start of CS, and by 2 baud times with
CS asserted. See Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 for details on
how to configure this mode. The TX sequencer could be enabled on PRS and start the TXSEQ counter running for 4 baud times as
programmed in TCMPVAL0. Then CS is asserted for 2 baud times before the transmitter begins sending TX data. TXDELAY in
USARTn_TIMING is the initial delay before any CS assertion, and CSSETUP is the delay during CS assertion. There are several small
preset timing values such as 1, 2, 3, or 7 that can be used for some of the TX sequencer timing which leaves TCMPVAL0, TCMPVAL1,
and TCMPVAL2 free for other uses.
TX_DELAY
TX TX
TX
SETUP ICS HOLD
CS
In addition to delaying the start of frame transmission, it is sometimes necessary to also delay the time between each transmit character
(inter-character space). After the first transmission, the inter-character space will delay the start of all subsequent transmissions until
the transmit buffer is empty. See Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page
560 for details on setting up this example. For this example in Figure 19.29 USART TXSEQ Timing on page 563 ICS is set to TCMP2 in
USARTn_TIMING. To keep CS asserted during the inter-character space, set AUTOCS in USARTn_CTRL. There are a few small pre-
set timing values provided for TX sequence timing. Using these preset timing values can free up the TCMPVALn for other uses. For this
example, the inter-character space is set to 0x03 and a preset value could be used.
The assertion of CS can be extended after the final character of the frame by using CSHOLD in USARTn_TIMING. See Table
19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 for details on setting up this example.
AUTOCS in USARTn_CTRL needs to be set to extend the CS assertion after the last TX character is transmitted as shown in Figure
19.29 USART TXSEQ Timing on page 563.
A response delay can be used to hold off the transmitter until a certain number of baud-times after the RX frame. See Table
19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 for details on setting up this example.
TXARX1EN in USARTn_TRIGCTRL tells the TX sequencer to trigger after RX EOF plus tcmp1val baud times.
RX
S
EN
TX
TX
RESPONSE DELAY
This example describes how to alternate between TX and RX frames. This has a 28 baud-time space after RX and a 16 baud-time
space after TX. The TSTART1 in USARTn_TIMECMP1 is set to RXEOF which uses the the receiver end of frame to start the timer.
The TSTOP1 is set to TCMP1 to generate an event after 28 baud times. Set TXARX1EN in USARTn_TRIGCTRL, and the transmitter is
held off until 28 baud times. TCMPVAL in USARTn_TIMECMP1 is set to 0x1C for 28 baud times. By setting TSTART0 in
USARTn_TIMECMP0 to TXEOF, the timer will be started after the transmission has completed. RXATX0EN in USARTn_TRIGCTRL is
used to delay enabling of the receiver until 16 baud times after the transmitter has completed. Write 0x10 into TCMPVAL of
USARTn_TIMECMP0 for a 16 baud time delay. CS is also asserted 7 baud-times before start of transmission by setting CSSETUP to
0x7 in USARTn_TIMING. To keep CS asserted for 3 baud-times after transmission completes, CSHOLD is set to 0x3 in USARTn_TIM-
ING. See Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 for details on setting
up this example.
This example describes how to delay TX transmission after an RX frame and how to have a break condition signal an interrupt. See
Table 19.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 560 for details on setting up this
example. The TX delay is set up by using transmit after RX, TXARX0EN in USARTn_TRIGCTRL to start the timer. TSTART0 in
USARTn_TIMECMP0 is set to RXEOF which enables the transitter of the timer delay. For this example TCMPVAL in
USARTn_TIMECMP0 is set to 0x20 to create a 32 baud-time delay between the end of the RX frame and the start of the TX frame. The
break detect is configured by setting TSTART1 to RXACT to detect the start bit, and setting TSTOP1 to RXACTN to detect RX going
high. In this case the interrupt asserts after RX stays low for 12 baud-times, so TCMPVAL1 is set to 0x0C.
There is also a timer stop on TX start using the TXST setting in TSTOP of USARTn_TIMECMPn. This can be used to see that the DMA
has not written to the TXBUFFER for a given time.
19.3.11 Interrupts
The interrupts generated by the USART are combined into two interrupt vectors. Interrupts related to reception are assigned to one
interrupt vector, and interrupts related to transmission are assigned to the other. Separating the interrupts in this way allows different
priorities to be set for transmission and reception interrupts.
The transmission interrupt vector groups the transmission-related interrupts generated by the following interrupt flags:
• TXC
• TXBL
• TXOF
• CCF
• TXIDLE
The reception interrupt on the other hand groups the reception-related interrupts, triggered by the following interrupt flags:
• RXDATAV
• RXFULL
• RXOF
• RXUF
• PERR
• FERR
• MPAF
• SSM
• TCMPn
If USART interrupts are enabled, an interrupt will be made if one or more of the interrupt flags in USART_IF and their corresponding
bits in USART_IEN are set.
The IrDA modulator implements the physical layer of the IrDA specification, which is necessary for communication over IrDA. The mod-
ulator takes the signal output from the USART module, and modulates it before it leaves the USART. In the same way, the input signal
is demodulated before it enters the actual USART module. The modulator implements the original Rev. 1.0 physical layer and one high
speed extension which supports speeds from 2.4 kbps to 1.152 Mbps.
The data from and to the USART is represented in a NRZ (Non Return to Zero) format, where the signal value is at the same level
through the entire bit period. For IrDA, the required format is RZI (Return to Zero Inverted), a format where a “1” is signalled by holding
the line low, and a “0” is signalled by a short high pulse. An example is given in Figure 19.31 USART Example RZI Signal for a given
Asynchronous USART Frame on page 565.
Idle Idle
USART
S 0 1 2 3 4 5 6 7 P Stop
(NRZ)
IrDA
(RZI)
Figure 19.31. USART Example RZI Signal for a given Asynchronous USART Frame
The IrDA module is enabled by setting IREN. The USART transmitter output and receiver input is then routed through the IrDA modula-
tor.
The width of the pulses generated by the IrDA modulator is set by configuring IRPW in USARTn_IRCTRL. Four pulse widths are availa-
ble, each defined relative to the configured bit period as listed in Table 19.11 USART IrDA Pulse Widths on page 565.
IRPW Pulse width OVS=0 Pulse width OVS=1 Pulse width OVS=2 Pulse width OVS=3
By default, no filter is enabled in the IrDA demodulator. A filter can be enabled by setting IRFILT in USARTn_IRCTRL. When the filter is
enabled, an incoming pulse has to last for 4 consecutive clock cycles to be detected by the IrDA demodulator.
Note that by default, the idle value of the USART data signal is high. This means that the IrDA modulator generates negative pulses,
and the IrDA demodulator expects negative pulses. To make the IrDA module use RZI signalling, both TXINV and RXINV in
USARTn_CTRL must be set.
0x000
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
0x0
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004
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
EN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x008 RW 0x0 31
RW 0x0 30
RW 0x0 29
RW 0x0 28
27
26
RW 0x0 25
RW 0x0 24
RW 0x0 23
RW 0x0 22
RW 0x0 21
RW 0x0 20
SCRETRANS RW 0x0 19
RW 0x0 18
RW 0x0 17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
7
6
5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
SKIPPERRF
BYTESWAP
SMSDELAY
SSSEARLY
ERRSDMA
SCMODE
AUTOTRI
ERRSRX
AUTOCS
LOOPBK
AUTOTX
ERRSTX
CLKPHA
CLKPOL
Name
BIT8DV
MVDIS
CSINV
RXINV
TXINV
CSMA
MPAB
CCEN
TXBIL
MSBF
SYNC
MPM
OVS
Bit Name Reset Access Description
Delay Synchronous Main interface sample point to the next setup edge to improve timing and allow communication at
higher speeds
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Setup data on sample edge in synchronous secondary interface mode to improve MOSI setup time
When set, the transmitter is disabled on framing and parity errors (asynchronous mode only) in the receiver.
When set, the receiver is disabled on framing and parity errors (asynchronous mode only).
When set, DMA requests will be cleared on framing and parity errors (asynchronous mode only).
0 DISABLE Framing and parity errors have no effect on DMA requests from
the USART
1 ENABLE DMA requests from the USART are blocked while the PERR or
FERR interrupt flags are set
The default value of the 9th bit. If 9-bit frames are used, and an 8-bit write operation is done, leaving the 9th bit unspeci-
fied, the 9th bit is set to the value of BIT8DV.
When set, the receiver discards frames with parity errors (asynchronous mode only). The PERR interrupt flag is still set.
When in SmartCard mode, a NACK'ed frame will be kept in the shift register and retransmitted if the transmitter is still
enabled.
When enabled, TXTRI is set by hardware whenever the transmitter is idle, and TXTRI is cleared by hardware when
transmission starts.
When enabled, the output on USn_CS will be activated one baud-period before transmission starts, and deactivated
when transmission ends.
Default value is active low. This affects both the selection of external secondaries, as well as the selection of the micro-
controller as a secondary interface.
The output from the USART transmitter can optionally be inverted by setting this bit.
Setting this bit will invert the input to the USART receiver.
0 EMPTY TXBL and the TXBL interrupt flag are set when the transmit buf-
fer becomes empty. TXBL is cleared when the buffer becomes
nonempty.
1 HALFFULL TXBL and TXBLIF are set when the transmit buffer goes from
full to half-full or empty. TXBL is cleared when the buffer be-
comes full.
This register determines the action to be performed when chip select is configured as an input and driven low while in
main interface mode.
Decides whether data is sent with the least significant bit first, or the most significant bit first.
Determines where data is set-up and sampled according to the bus clock when in synchronous mode.
0 SAMPLELEADING Data is sampled on the leading edge and set-up on the trailing
edge of the bus clock in synchronous mode
1 SAMPLETRAILING Data is set-up on the leading edge and sampled on the trailing
edge of the bus clock in synchronous mode
Determines the clock polarity of the bus clock used in synchronous mode.
0 IDLELOW The bus clock used in synchronous mode has a low base value
1 IDLEHIGH The bus clock used in synchronous mode has a high base value
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Sets the number of clock periods in a UART bit-period. More clock cycles gives better robustness, while less clock cycles
gives better performance.
Defines the value of the multi-processor address bit. An incoming frame with its 9th bit equal to the value of this bit marks
the frame as a multi-processor address frame.
Multi-processor mode uses the 9th bit of the USART frames to tell whether the frame is an address frame or a data
frame.
1 ENABLE An incoming frame with the 9th bit equal to MPAB will be loaded
into the receive buffer regardless of RXBLOCK and will result in
the MPAB interrupt flag being set
1 ENABLE Collision check is enabled. The receiver must be enabled for the
check to be performed
Allows the receiver to be connected directly to the USART transmitter for loopback and half duplex communication.
0x00C 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
STOPBITS RW 0x1
RW 0x0
DATABITS RW 0x5
Reset
Access
PARITY
Name
31:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 HALF The transmitter generates a half stop bit. Stop-bits are not veri-
fied by receiver
2 ONEANDAHALF The transmitter generates one and a half stop bit. The receiver
verifies the first stop bit
3 TWO The transmitter generates two stop bits. The receiver checks the
first stop-bit only
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Determines whether parity bits are enabled, and whether even or odd parity should be used. Only available in asynchro-
nous mode.
2 EVEN Even parity are used. Parity bits are automatically generated
and checked by hardware.
3 ODD Odd parity is used. Parity bits are automatically generated and
checked by hardware.
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x010 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
AUTOTXTEN RW 0x0 6
RW 0x0 5
RW 0x0 4
3
2
1
0
Reset
Access
RXATX2EN
RXATX1EN
RXATX0EN
TXARX2EN
TXARX1EN
TXARX0EN
Name
RXTEN
TXTEN
Bit Name Reset Access Description
31:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, a TX end of frame will trigger the receiver after a TCMPVAL2 baud-time delay
When set, a TX end of frame will trigger the receiver after a TCMPVAL1 baud-time delay
When set, a TX end of frame will trigger the receiver after a TCMPVAL0 baud-time delay
When set, an RX end of frame will trigger the transmitter after TCMP2VAL bit times to force a minimum response delay
When set, an RX end of frame will trigger the transmitter after TCMP1VAL bit times to force a minimum response delay
When set, an RX end of frame will trigger the transmitter after TCMP0VAL bit times to force a minimum response delay
When set, AUTOTX is enabled as long as the PRS channel selected by TSEL has a high value
When set, the PRS channel selected by TSEL sets TXEN, enabling the transmitter on positive trigger edges.
When set, the PRS channel selected by TSEL sets RXEN, enabling the receiver on positive trigger edges.
3:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
W(nB) 0x0 11
W(nB) 0x0 10
W(nB) 0x0 9
W(nB) 0x0 8
RXBLOCKDIS W(nB) 0x0 7
W(nB) 0x0 6
W(nB) 0x0 5
W(nB) 0x0 4
W(nB) 0x0 3
W(nB) 0x0 2
W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
RXBLOCKEN
MASTERDIS
MASTEREN
CLEARRX
CLEARTX
TXTRIDIS
TXTRIEN
Name
RXDIS
TXDIS
RXEN
TXEN
Bit Name Reset Access Description
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to clear RXBLOCK, resulting in all incoming frames being loaded into the receive buffer.
Set to disable main interface mode, clearing the MASTER status bit and putting the USART in secondary interface mode.
Set to enable main interface mode, setting the MASTER status bit. Main mode should not be enabled while TXENS is set
to 1. To enable both main interface and TX mode, write MASTEREN before TXEN, or enable them both in the same
write operation.
Set to disable data reception. If a frame is under reception when the receiver is disabled, the incoming frame is discar-
ded.
0x018 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
0x0 14
0x1 13
0x0 12
0x0 11
0x0 10
0x0 9
0x0 8
0x0 7
0x1 6
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
0x0
Reset
Access
TIMERRESTARTED R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
RXDATAVRIGHT
RXFULLRIGHT
TXBDRIGHT
TXBSRIGHT
TXBUFCNT
Name
RXBLOCK
RXDATAV
MASTER
RXFULL
TXIDLE
RXENS
TXENS
TXTRI
TXBL
TXC
Bit Name Reset Access Description
31:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Count of TX buffer entry 0, entry 1, and TX shift register. For large frames, the count is only of TX buffer entry 0 and the
TX shifter register.
15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When the timer is restarting itself on each TCMP event, a TIMERRESTARTED value of 0x0 indicates the first TCMP
event in the sequence of multiple TCMP events. Any non TCMP timer start events will clear TIMERRESTARTED. When
there is a TCMP interrupt and TIMERRESTARTED is 0x0, an interrupt service routine can set a TCMP event counter
variable in memory to 0x1 to indicate the first TCMP interrupt of the sequence.
When set, the entire RX buffer contains right data. Only used in I2S mode
When set, reading RXDATA or RXDATAX gives right data. Else left data is read. Only used in I2S mode
When set, the TX buffer expects at least a single right data. Else it expects left data. Only used in I2S mode
When set, the TX buffer expects double right data. Else it may expect a single right data or left data. Only used in I2S
mode
Set when the RXFIFO is full. Cleared when the receive buffer is no longer full. When this bit is set, there is still room for
one more frame in the receive shift register.
Set when data is available in the receive buffer. Cleared when the receive buffer is empty.
Indicates the level of the transmit buffer. If TXBIL is 0x0, TXBL is set whenever the transmit buffer is completely empty.
Otherwise TXBL is set whenever the TX Buffer becomes half full.
Set when a transmission has completed and no more data is available in the transmit buffer and shift register. Cleared
when data is written to the transmit buffer.
Set when the transmitter is tristated, and cleared when transmitter output is enabled. If AUTOTRI in USARTn_CTRL is
set this bit is always read as 0.
When set, the receiver discards incoming frames. An incoming frame will not be loaded into the receive buffer if this bit is
set at the instant the frame has been completely received.
Set when the USART operates as a main interface. Set using the MASTEREN command and clear using the MASTER-
DIS command.
0x01C
AUTOBAUDEN RW 0x0 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 0x0
Reset
Access
Name
DIV
Detects the baud rate based on receiving a 0x55 frame (0x00 for IrDA). This is used in Asynchronous mode.
30:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Specifies the fractional clock divider for the USART. Setting AUTOBAUDEN in USARTn_CLKDIV will overwrite the DIV
field.
2:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
0x0 15
0x0 14
13
12
11
10
9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
R
R
RXDATA R
PERR
FERR
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set if data in buffer has a framing error. Can be the result of a break condition.
13:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to access data read from the USART. Buffer is cleared on read access.
0x024
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
0x0
Reset
Access
RXDATA R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to access data read from USART. Buffer is cleared on read access. Only the 8 LSB can be read using
this register.
0x028 0x0 31
0x0 30
29
28
27
26
25
24
23
22
21
0x0 20
19
18
17
16
0x0 15
0x0 14
13
12
11
10
9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
R
R
RXDATA1 R
R
R
RXDATA0 R
PERR1
PERR0
FERR1
FERR0
Name
Set if data in buffer has a framing error. Can be the result of a break condition.
29:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set if data in buffer has a framing error. Can be the result of a break condition.
13:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x02C 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
0x0
0x0
Reset
Access
RXDATA1 R
RXDATA0 R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x030
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
0x0 15
0x0 14
13
12
11
10
9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
R
R
RXDATAP R
PERRP
FERRP
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set if data in buffer has a framing error. Can be the result of a break condition.
13:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x034 0x0 31
0x0 30
29
28
27
26
25
24
23
22
21
0x0 20
19
18
17
16
0x0 15
0x0 14
13
12
11
10
9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
R
R
RXDATAP1 R
R
R
RXDATAP0 R
PERRP1
PERRP0
FERRP1
FERRP0
Name
Set if data in buffer has a framing error. Can be the result of a break condition.
29:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set if data in buffer has a framing error. Can be the result of a break condition.
13:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x038 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
W(nB) 0x0 15
W(nB) 0x0 14
TXBREAK W(nB) 0x0 13
W(nB) 0x0 12
W(nB) 0x0 11
10
9
8
7
6
5
TXDATAX W(nB) 0x0 4
3
2
1
0
Reset
Access
TXDISAT
TXTRIAT
RXENAT
UBRXAT
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to disable transmitter and release data bus directly after transmission.
Set to send data as a break. Recipient will see a framing error or a break condition depending on its configuration and
the value of TXDATA.
10:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to write data to the USART. If TXEN is set, a transfer will be initiated at the first opportunity.
0x03C 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
TXDATA W(nB) 0x0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This frame will be added to TX buffer. Only 8 LSB can be written using this register. 9th bit and control bits will be
cleared.
Access
TXDISAT1
TXDISAT0
TXTRIAT1
TXTRIAT0
RXENAT1
UBRXAT1
RXENAT0
UBRXAT0
TXDATA1
TXDATA0
Name
Set to disable transmitter and release data bus directly after transmission.
Set to send data as a break. Recipient will see a framing error or a break condition depending on its configuration and
the value of USARTn_TXDATA.
26:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to disable transmitter and release data bus directly after transmission.
Set to send data as a break. Recipient will see a framing error or a break condition depending on its configuration and
the value of TXDATA.
10:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x044
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
0x0
0x0
Reset
Access
TXDATA1 W
TXDATA0 W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x048 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RXDATAV RW 0x0 2
RW 0x1 1
RW 0x0 0
Reset
Access
RXFULL
TXIDLE
TCMP2
TCMP1
TCMP0
Name
MPAF
PERR
RXOF
FERR
RXUF
TXOF
TXUF
TXBL
SSM
CCF
TXC
Bit Name Reset Access Description
31:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when the chip select is pulled active when in main interface mode.
Set when a frame with a framing error is received while RXBLOCK is cleared.
Set when a frame with a parity error (asynchronous mode only) is received while RXBLOCK is cleared.
Set when operating as a synchronous secondary, no data is available in the transmit buffer when the main interface
starts transmission of a new frame.
Set when a write is done to the transmit buffer while it is full. The data already in the transmit buffer is preserved.
Set when trying to read from the receive buffer when it is empty.
Set when data is incoming while the receive shift register is full. The data previously in the shift register is lost.
Set when buffer becomes empty if buffer level is set to 0x0, or when the number of empty TX buffer elements equals
specified buffer level.
This interrupt is set after a transmission when both the TX buffer and shift register are empty.
0x04C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RXDATAV RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RXFULL
TXIDLE
TCMP2
TCMP1
TCMP0
Name
MPAF
PERR
RXOF
FERR
RXUF
TXOF
TXUF
TXBL
SSM
CCF
TXC
Bit Name Reset Access Description
31:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when the chip select is pulled active when in main interface mode.
Set when a frame with a framing error is received while RXBLOCK is cleared.
Set when a frame with a parity error (asynchronous mode only) is received while RXBLOCK is cleared.
Set when operating as a synchronous secondary, no data is available in the transmit buffer when the main interface
starts transmission of a new frame.
Set when a write is done to the transmit buffer while it is full. The data already in the transmit buffer is preserved.
Set when trying to read from the receive buffer when it is empty.
Set when data is incoming while the receive shift register is full. The data previously in the shift register is lost.
Set when buffer becomes empty if buffer level is set to 0x0, or when the number of empty TX buffer elements equals
specified buffer level.
This interrupt is set after a transmission when both the TX buffer and shift register are empty.
0x050
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
IRFILT RW 0x0 3
2
1
RW 0x0 0
RW 0x0
Reset
Access
IRPW
IREN
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 ENABLE Filter enabled. IrDA pulse must be high for at least 5 consecu-
tive clock cycles to be detected
Configure the pulse width generated by the IrDA modulator as a fraction of the configured USART bit period.
0 ONE IrDA pulse width is 1/16 for OVS=0 and 1/8 for OVS=1
1 TWO IrDA pulse width is 2/16 for OVS=0 and 2/8 for OVS=1
2 THREE IrDA pulse width is 3/16 for OVS=0 and 3/8 for OVS=1
3 FOUR IrDA pulse width is 4/16 for OVS=0 and 4/8 for OVS=1
0x054 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
RW 0x0 9
8
7
6
5
RW 0x0 4
DMASPLIT RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
FORMAT
JUSTIFY
DELAY
Name
MONO
EN
Bit Name Reset Access Description
31:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to add a one-cycle delay between a transition on the word-clock and the start of the I2S word. Should be set for
standard I2S format
When set DMA requests for right-channel data are put on the TXBLRIGHT and RXDATAVRIGHT DMA requests.
0x058 31
30
RW 0x0 29
28
27
26
RW 0x0 25
24
23
22
CSSETUP RW 0x0 21
20
19
18
RW 0x0 17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reset
Access
TXDELAY
CSHOLD
Name
ICS
31 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Chip Select will be asserted after the end of frame transmission. When using TCMPn, normally set TIMECMPn_TSTART
to DISABLE to stop general timer and to prevent unwanted interrupts.
27 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Inter-character spacing after each TX frame while the TX buffer is not empty. When using USART_TIMECMPn, normally
set TSTART to DISABLE to stop general timer and to prevent unwanted interrupts.
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Chip Select will be asserted before the start of frame transmission. When using USART_TIMECMPn, normally set
TSTART to DISABLE to stop general timer and to prevent unwanted interrupts.
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Number of baud-times to delay the start of frame transmission. When using USART_TIMECMPn, normally set TSTART
to DISABLE to stop general timer and to prevent unwanted interrupts.
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x05C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
CLKPRSEN RW 0x0 15
14
13
12
11
10
9
8
RW 0x0 7
6
5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RXPRSEN
DBGHALT
RTSINV
CTSINV
CTSEN
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
14:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
6:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, frames in the TXBUFn will not be sent until link partner asserts CTS. Any data in the TX shift register will
continue transmitting, the next TXBUFn data will not load into the TX shift register
0x060 31
30
29
28
27
26
25
RESTARTEN RW 0x0 24
23
22
RW 0x0 21
20
19
18
RW 0x0 17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
RW 0x0
Reset
Access
TCMPVAL
TSTART
Name
TSTOP
Bit Name Reset Access Description
31:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When the timer equals TCMPVAL, this signals a TCMP0 event and sets the TCMP0 flag. This event can also be used to
enable various USART functionality. A value of 0x00 represents 256 baud times.
0x064 31
30
29
28
27
26
25
RESTARTEN RW 0x0 24
23
22
RW 0x0 21
20
19
18
RW 0x0 17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
RW 0x0
Reset
Access
TCMPVAL
TSTART
Name
TSTOP
Bit Name Reset Access Description
31:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When the timer equals TCMPVAL, this signals a TCMP1 event and sets the TCMP1 flag. This event can also be used to
enable various USART functionality. A value of 0x00 represents 256 baud times.
0x068 31
30
29
28
27
26
25
RESTARTEN RW 0x0 24
23
22
RW 0x0 21
20
19
18
RW 0x0 17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
RW 0x0
Reset
Access
TCMPVAL
TSTART
Name
TSTOP
Bit Name Reset Access Description
31:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When the timer equals TCMPVAL, this signals a TCMP2 event and sets the TCMP2 flag. This event can also be used to
enable various USART functionality. A value of 0x00 represents 256 baud times.
Quick Facts
What?
0 1 2 3 4
The EUSART handles high-speed UART, SPI-bus,
and IrDA communication.
Why?
TX/
MOSI
CLK
µC CS
20.1 Introduction
The Enhanced Universal Synchronous Asynchronous serial Receiver and Transmitter (EUSART) is a very flexible serial I/O module. It
supports full duplex asynchronous UART communication as well as SPI, MicroWire. It can also interface with IrDA devices.
20.2 Features
An overview of the EUSART module is shown in Figure 20.1 EUSART Overview on page 608.
This section describes all posible EUSART features. Please refer to the Device Datasheet to see what features a specific EUSART
instance supports.
Peripheral Bus
CS
Control and
TX FIFO RXFIFO
status
!RXBLOCK
TX/MOSI
IrDA TX Shift Register RX Shift Register
modulator
Pin
SCLK ctrl
Baud rate
generator
RX/MISO
IrDA
demodulator
In synchronous mode, a separate clock signal is transmitted with the data. This clock signal is generated by the main interface on the
bus, and both the main and secondary devices sample and transmit data according to this clock. Both main and secondary interface
modes are supported by the EUSART. The synchronous communication mode is compatible with the Serial Peripheral Interface Bus
(SPI) standard.
In asynchronous mode, no separate clock signal is transmitted with the data on the bus. The EUSART receiver thus has to determine
where to sample the data on the bus from the actual data. To make this possible, additional synchronization bits are added to the data
when operating in asynchronous mode, resulting in a slight overhead.
Asynchronous or synchronous mode can be selected by configuring SYNC in EUSARTn_CFG0. The options are listed with supported
protocols in Table 20.1 EUSART Asynchronous vs. Synchronous Mode on page 609. Full duplex and half duplex communication is
supported in both asynchronous and synchronous mode.
Table 20.2 EUSART Pin Usage on page 609 explains the functionality of the different EUSART pins when the EUSART operates in
different modes. Pin functionality enclosed in square brackets is optional, and depends on additional configuration parameters.
LOOPBK and MASTER are discussed in 20.3.2.7 Local Loopback and 20.3.3.3 Main SPI Interface Mode (Clock Driver) respectively.
Pin Functionality
SYNC LOOPBK MASTER
TX (MOSI) RX (MISO) CLK CS
0 1 x Data out/in - - -
EUSART0 may operate as either a high-speed peripheral running from a high-frequency clock source (HF mode, available in EM0 an
EM1), or as a low-energy peripheral operating from a low-frequency clock source (LF mode, available in EM0, EM1, or EM2). EU-
SART0 operates in HF mode when the EUSART0CLK clock selected in CMU_EUSART0CLKCTRL_CLKSEL is EM01GRPACLK or
HFRCOEM23. EUSART0 operates in LF mode when the selected clock is LFXO or LFRCO. Baud rate generation differs between
these two modes, and there are certain operational restrictions in LF mode discussed in this chapter. It is not generally useful to switch
between modes on-the-fly in a single application.
Other EUSART instances operate only as a high-speed peripheral running from the EM01GRPCCLK selected using
CMU_EM01GRPCCLKCTRL_CLKSEL.
The frame format used in asynchronous mode consists of a set of data bits in addition to bits for synchronization and optionally a parity
bit for error checking. A frame starts with one start-bit (S), where the line is driven low for one bit-period. This signals the start of a
frame, and is used for synchronization. Following the start bit are 7 to 9 data bits and an optional parity bit. Finally, a number of stop-
bits, where the line is driven high that indicates the end of the frame. An example frame is shown in Figure 20.2 Frame Format on page
610.
Frame
The number of data bits in a frame is set by DATABITS in EUSARTn_FRAMECFG, see Table 20.3 Data Bits on page 610, and the
number of stop-bits is set by STOPBITS in EUSARTn_FRAMECFG, see Table 20.4 Stop Bits on page 610. Whether or not a parity
bit should be included, and whether it should be even or odd is defined by PARITY, also in EUSARTn_FRAMECFG. For proper and
reliable communication, all parties of a transfer must agree on the frame format prior to the start of the transfer.
0001 7
0010 8 (Default)
0011 9
01 1 (Default)
11 2
The order in which the data bits are transmitted and received is defined by MSBF in EUSARTn_CFG0. When MSBF is cleared, data in
a frame is sent and received with the least significant bit first. When it is set, the most significant bit comes first.
The frame format used by the transmitter can be inverted by setting TXINV in EUSARTn_CFG0, and the format expected by the receiv-
er can be inverted by setting RXINV in EUSARTn_CFG0. These bits affect the entire frame, not only the data bits. An inverted frame
has a low idle state, a high start-bit, inverted data and parity bits, and low stop-bits.
When parity bit is enabled, hardware automatically calculates and inserts a parity bit into outgoing frames, and verifies the received
parity bit in incoming frames. The possible parity modes are defined in Table 20.5 Parity Bits on page 611. When even parity is chos-
en, a parity bit is inserted to make the number of high bits (data + parity) even. If odd parity is chosen, the parity bit makes the total
number of high bits odd. When parity bit is disabled, which is the default configuration, the parity bit is omitted.
EUSARTn_FRAMECFG_PARITY[1:0] Description
01 Reserved
10 Even parity
11 Odd parity
The EUSART clock defines the transmission and reception data rate. The baud rate is given by Figure 20.3 EUSART Baud Rate on
page 612.
br = fEUSARTn/(oversample x (1 + EUSARTn_CLKDIV/256))
where fEUSARTn is the peripheral clock frequency and oversample is the oversampling rate as defined by OVS in EUSARTn_CFG0, see
Table 20.6 Oversampling (EUSARTn_CFG0_OVS) on page 612. Note that different instances of the EUSART inside a device may
use different peripheral clocks. The peripheral clock may be generically referred to in this chapter as clk_per.
Note: Please note that high frequency clocks should not be selected as UART clock source when nominal voltage is 0.9V.
Note:
Please note that when EUSARTn_CFG0_OVS is set to OVS_DISABLE (0x4), the peripheral clock frequency must be at least three
times higher than the chosen baud rate. This condition is given in Figure 20.4 Requirement for EUSARTn_CFG0_OVS = OVS_DISA-
BLE on page 612.
OVS[2:0] Oversample
Note: Please note that EUSARTn_CFG0_OVS must not be set to OVS_DISABLE (0x4) when one of the high frequency clocks is se-
lected as EUSARTn peripheral clock source. When one of the low frequency clocks (LFXO/LFRCO) is selected as EUSARTn peripher-
al clock source, EUSARTn_CFG0_OVS must be set to OVS_DISABLE (0x4).
The EUSART has a fractional clock divider to allow the EUSART clock to be controlled more accurately than what is possible with a
standard integral divider. The clock divider used in the EUSART is a 20-bit value, with a 15-bit integral part and an 5-bit fractional part.
The fractional part is configured in the lower 5 bits of DIV in EUSARTn_CLKDIV. Fractional clock division is implemented by distributing
the selected fraction over thirty two baud periods. The fractional part of the divider tells how many of these periods should be extended
by one peripheral clock cycle.
Given a desired baud rate brdesired, the clock divider EUSARTn_CLKDIV can be calculated by using Figure 20.5 EUSART Desired
Baud Rate on page 612:
Table 20.7 EUSART Baud Rates @ 4 MHz Peripheral Clock with 20 Bit CLKDIV on page 613 shows a set of desired baud rates and
how accurately the EUSART is able to generate these baud rates when running at a 4 MHz peripheral clock, using 16x or 8x oversam-
pling.
Table 20.7. EUSART Baud Rates @ 4 MHz Peripheral Clock with 20 Bit CLKDIV
Table 20.8 EUSART0 Baud Rates in LF mode @ 32.768 kHz Peripheral Clock with 20 bit CLKDIV on page 613 shows a set of de-
sired baud rates and how accurately the EUSART0 is able to generate these baud rates when running from a 32.768 kHz peripheral
clock in LF mode.
Table 20.8. EUSART0 Baud Rates in LF mode @ 32.768 kHz Peripheral Clock with 20 bit CLKDIV
Desired baud rate [baud/s] EUSART0_CLKDIV/256 Actual baud rate [baud/s] Error1 [%]
Setting AUTOBAUDEN in EUSARTn_CFG0 uses the first frame received to automatically set the baud rate provided that it contains
0x55 (IrDA uses 0x00) and is sent out as LSB first and there is no break in the frame. The receiver will measure the number of local
clock cycles between the beginning of the START bit and the beginning of the 8th data bit. The DIV field in EUSARTn_CLKDIV will be
overwritten with the new value. The OVS in EUSARTn_CFG0 and the +1 count of the Baud Rate equation are already factored into the
result that gets written into the DIV field. To restart autobaud detection, clear AUTOBAUDEN and set it high again. Since the auto baud
rate detection is done over 8 baud times, only the upper 3 bits of the fractional part of the clock divider are populated.
Auto baud detection has associated status bit EUSARTn_STATUS_AUTOBAUDDONE and interrupt flag EUSARTn_IF_AUTOBAUD-
DONE. Both the status and the interrupt flag get set after auto baud detection is complete and DIV field in EUSARTn_CLKDIV is over-
written with the new value.
Note:
• If autobaud detection is enabled, software must wait for autobaud detection to complete before transmitting any data.
• Autobaud should be used only during times when it is known that the transmitter will be sending the required data word.
• Autobaud detection is not available when operating with LF clock source.
• For autobaud to work with IrDA, there should be odd parity or no parity in the received data frame.
Asynchronous data transmission is initiated by writing data to the transmit FIFO using one of the methods described in
20.3.2.5.1 Transmit FIFO Operation. When the transmission shift register is empty and if the transmitter is enabled, a frame from the
transmit FIFO is loaded into the shift register and transmission begins. Note that the frame loading in to the shift register can also be
blocked if CTSEN is set in EUSARTn_CFG0 but the CTS input is inactive. When the frame has been transmitted, a new frame is loa-
ded into the shift register if available, and transmission continues. If the transmit FIFO is empty, the transmitter goes to an idle state,
waiting for a new frame to become available.
Transmission is enabled through the command register EUSARTn_CMD by setting TXEN, and disabled by setting TXDIS in the same
command register. When the transmitter is disabled using TXDIS, any ongoing transmission is aborted, and any frame currently being
transmitted is discarded. When disabled, the TX output goes to an idle state, which by default is a high value. Whether or not the trans-
mitter is enabled at a given time can be read from TXENS in EUSARTn_STATUS.
When the EUSART transmitter is enabled and there is no data in the transmit shift register or transmit FIFO, the TXC status flag in
EUSARTn_STATUS and the TXC interrupt flag in EUSARTn_IF are set, signaling that the transmission is complete. The TXC status
flag is cleared when a new frame becomes available for transmission, but the TXC interrupt flag must be cleared by software.
Note: (1) Condition for TX to send data out: TX is enabled and there is data available in the TX FIFO and CTS is either not enabled, or
if it is enabled, then it is active. (2) If TX output is tri-stated using TXDIS command or TXDISAT setting, then the TX module will still
send out data (emptying the FIFO) if condition in point 1 is satisfied, even though the pad is tristated. Restriction: User should not set
TXEN when the output is tristated.
The transmit FIFO is a 16 deep FIFO. A frame can be loaded into the FIFO by writing to EUSARTn_TXDATA. Using EUSARTn_TXDA-
TA allows 9 bits to be written to the FIFO, as well as a set of control bits regarding the transmission of the written frame. Every frame in
the FIFO is stored with 9 data bits and additional transmission control bits. A frame is loaded from the FIFO in to the shift register if the
transmitter is enabled.
Figure 20.6 Transmit FIFO Operation on page 615 shows the basics of the transmit FIFO.
Peripheral Bus
Write CTRL
Shift register
In addition to the interrupt flag TXC in EUSARTn_IF and status flag TXC in EUSARTn_STATUS which are set when the transmission is
complete, TXFL in EUSARTn_STATUS and the TXFL interrupt flag in EUSARTn_IF are used to indicate the level of the transmit FIFO.
TXFIW in EUSARTn_CFG1 controls the level at which these bits are set. The user can choose a transmit FIFO watermark level in
TXFIW field of EUSARTn_CFG1 register in order to program when the TXFL interrupt should be triggered.
There is a TXIDLE status bit in EUSARTn_STATUS to provide an indication of when the transmitter is idle. The count of TX valid FIFO
entries is called TXFCNT in EUSARTn_STATUS.
The transmit FIFO can be cleared by setting CLEARTX in EUSARTn_CMD. Since this is an Async FIFO, the user needs to first issue
the CLEARTX command and then wait on the CLEARTXBUSY status flag until it goes low. EUSART must be enabled (EUSARTn_EN
should be set) for the flush to work. EUSART should not be transmitting when CLEARTX command gets issued (can be achieved by
disabling the trasmitter). Any frame present in the transmit shift register currently being transmitted will not be aborted due to the flush.
Transmission of this frame will be completed. Note that the transmit shift register is never used to store a transmit frame, i.e., if the
transmitter is not enabled then the data stays in the transmit FIFO until the transmitter gets enabled. Whenever a frame is loaded in to
the transmit shift register, the transmission starts immediately.
TX FIFO has two associated status flags: TXFL (set when there is space for data in the TX FIFO, depends on the setting in the TXFIW
in CFG1 register) and TXFCNT (count of number of TX frames in the FIFO). These status flags remain set as long as the underlying
condition is true, even if the EUSART is disabled (i.e., EUSARTn_EN is 0). It is possible to write to the TX FIFO while EUSART is
disabled, this will impact the two flags mentioned above.
TX FIFO has two associated interrupt flags: TXFL and TXOF. TXFL is set when space becomes available in the FIFO, depends on
TXFIW in CFG1 register. Reset value for TXFIW is such that TXFL gets set as soon the chip comes out of reset (so the interrupt should
be cleared once TXFIW is updated). TXFL remains set as long as the underlying condition is true even if the EUSART is disabled. This
means that if a software clear is done for TXFL, then the interrupt will get set again after the clear if the underlying condition is still true
(this will happen even if the EUSART is disabled). Writing more data to the FIFO or disabling the TXFL will make the TXFL go away
(even if the EUSART is disabled). When writing more frames to the transmit FIFO than there is free space for, the TXOF interrupt flag in
EUSARTn_IF will be set, indicating the overflow. The data already in the transmit FIFO is preserved in this case, and no data is written.
Note that TXOF can also trigger if DMA tries to write to the FIFO while a TX Flush operation is going on (Flush is activated by setting
CMD.CLEARTX). No data will be written to the FIFO in this case. TXOF triggers only once every time an overflow occurs.
Note: (EUSART0 only) In LF clock mode, the TXFL interrupt flag and the TXFL wakeup flag differ slightly in their behavior. IF.TXFL is
always set out of reset since there is space available in the FIFO. However, the TXFL wakeup flag is only set after a FIFO read hap-
pens and the space that becomes available in the FIFO is the same as programmed in TXFIW in EUSART0_CFG1.
The transmission control bits, which can be written using EUSARTn_TXDATA, affect the transmission of the written frame. The follow-
ing options are available:
• Generate break: By setting TXBREAK, the output will be held low during the stop-bit period to generate a framing error. A receiver
that supports break detection detects this state, allowing it to be used e.g. for framing of larger data packets. The line is driven high
before the next frame is transmitted so the next start condition can be identified correctly by the recipient. Continuous breaks lasting
longer than a EUSART frame are thus not supported. GPIO can be used for this.
• Disable transmitter after transmission: If TXDISAT is set, the transmitter is disabled after the frame has been fully transmitted.
• Enable receiver after transmission: If RXENAT is set, the receiver is enabled after the frame has been fully transmitted. It is enabled
in time to detect a start-bit directly after the last stop-bit has been transmitted.
• Unblock receiver after transmission: If UBRXAT is set, the receiver is unblocked and RXBLOCK is cleared after the frame has been
fully transmitted.
• Tristate transmitter after transmission: If TXTRIAT is set, TXTRI is set after the frame has been fully transmitted, tristating the trans-
mitter output. Note that if there are more frames in the TX FIFO after the tristating has happened and the transmitter is enabled, then
the transmitter will try to send them out but since the output is tristated, nothing will show up at the transmitter output. The FIFO
however will get emptied because of the transmitter attempting to send these frames out. If the target is to automatically tristate the
TX line whenever the transmitter is idle, then that can be done by setting AUTOTRI in EUSARTn_CFG0. If AUTOTRI is set TXTRI
status flag is always read as 0.
The following status flags should be used with care keeping in mind the external sources that can impact these flags as well as the
synchronization delay when the status signal crosses over from the EUSART Core clock domain to the APB clock domain. FIFO related
status flags were already discussed in 20.3.2.5.1 Transmit FIFO Operation, the remaining flags are mentioned below:
• TXENS: Enable sources: (1) TXEN command from software, (2) PRS trigger (when TXTEN=1). Disable Sources: (1) TXDIS com-
mand from software, (2) PERR/FERR (when ERRSTX=1), (3) Software when TXDISAT is set to 1 for a frame.
• TXTRI: Enable sources: (1) TXTRIEN command from software, (2) Software when TXTRIAT is set to 1 for a frame. Disable sources:
(1) TXTRIDIS command from software.
• TXIDLE: Set whenever the TX module is idle.
• TXC: Set whenever the TX module goes to idle and both the TX FIFO and the TX shift register are empty. Cleared when either TX
FIFO or the TX shift register has data.
By configuring TXDELAY in EUSARTn_CFG1, the transmitter can be forced to wait a number of bit-periods from when it is ready to
transmit data, to when it actually transmits the data. This delay is only applied to the first frame transmitted after the transmitter has
been idle. When transmitting frames back-to-back the delay is not introduced between the transmitted frames.
This is useful on half duplex buses, because the receiver always returns received frames to software during the first stop-bit. The bus
may still be driven for up to 3 bit periods, depending on the current frame format. Using the transmission delay, a transmission can be
started when a frame is received, and it is possible to make sure that the transmitter does not begin driving the output before the frame
on the bus is completely transmitted.
Data reception is enabled by setting RXEN in EUSARTn_CMD. When the receiver is enabled, it actively samples the input looking for a
transition from high to low indicating the start baud of a new frame. When a start baud is found, reception of the new frame begins.
When the frame has been received, it is pushed into the receive FIFO, making the shift register ready for another frame of data, and the
receiver starts looking for another start baud. If a frame is received while the receive FIFO is full, the received frame is discarded and
the RXOF interrupt flag in EUSARTn_IF is set to indicate the FIFO overflow.
The receiver can be disabled by setting the command bit RXDIS in EUSARTn_CMD. Any frame currently being received, when the
receiver is disabled, is discarded. Whether or not the receiver is enabled at a given time can be read out from RXENS in EU-
SARTn_STATUS.
The receive-FIFO is a 16 deep FIFO. Data can be read from the receive FIFO via EUSARTn_RXDATA. EUSARTn_RXDATA gives
access to the received frame. This register also contains parity error and framing error information of the received frame. When a frame
is read from the receive FIFO using EUSARTn_RXDATA, the frame is pulled out of the FIFO, making room for a new frame. If an at-
tempt is done to read more frames from the FIFO than what is available, the RXUF interrupt flag in EUSARTn_IF is set to signal the
underflow, and the data read from the FIFO is undefined.
Frames can be read from the receive FIFO without removing the data by using EUSARTn_RXDATAP. EUSARTn_RXDATAP gives ac-
cess to the first frame in the FIFO with status bits. The data read from this register when the receive FIFO is empty is undefined. No
underflow interrupt is generated by a read using this register, i.e. RXUF in EUSARTn_IF is never set as a result of reading from EU-
SARTn_RXDATAP.
The basic operation of the receive FIFO is shown in Figure 20.7 EUSART Receive FIFO Operation on page 618.
Peripheral Bus
RXDATA,
RX FIFO element 0 Status RXDATAP
Status
Shift register
Receive FIFO has two associated status flags: RXFL (set when number of available frames in the receive FIFO is at least number of
frames set by RXFIW in CFG1 register) and RXFULL (set when receive FIFO is full). These status flags remain set as long as the
underlying condition is true, even if the EUSART is disabled (i.e., EUSARTn_EN is 0). It is possible to read from the receive FIFO while
EUSART is disabled, this will impact the two status flags mentioned above. The status flags RXFL and RXFULL are automatically
cleared by hardware when their condition is no longer true.
Receive FIFO has four associated interrupt flags: RXFL, RXFULL, RXOF and RXUF. RXFL is set when number of available frames in
the receive FIFO is at least number of frames set by RXFIW in CFG1 register. RXFULL is set when receive FIFO is full. Both RXFL and
RXFULL remains set as long as the underlying condition is true even if EUSART is disabled. This means that if a software clear is done
for RXFL / RXFULL while the undelying condition of respective interrupt is still true, the corresponding interrupt will get set again after
the clear (this will happen even if EUSART is disabled). Reading data from the FIFO or disabling the RXFL / RXFULL will block the
respective interrupt to get set after a software clear (even if EUSART is disabled). RXOF is set when a new frame is received while the
receive FIFO is full, indicating overflow. The new frame is discarded. RXOF triggers only once every time an overflow occurs. RXUF is
set when an attempt (via RXDATA or DMA) is done to read more frames from the receive FIFO than what is available, indicating under-
flow. The data read from the FIFO is undefined. RXUF triggers every time an underflow occurs even if EUSART is disabled.
When using hardware frame recognition, as detailed in 20.3.2.6.9 Multi-Processor Mode and 20.3.2.8 Collision Detection, it is necessa-
ry to be able to let the receiver sample incoming frames without loading them into the receive FIFO. This is accomplished by blocking
incoming data.
Incoming data is blocked as long as RXBLOCK in EUSARTn_STATUS is set. When blocked, frames received by the receiver will not
be loaded into the receive FIFO, and software is not notified by the RXFL flag in EUSARTn_STATUS or the RXFL interrupt flag in EU-
SARTn_IF at their arrival. For data to be loaded into the receive FIFO, RXBLOCK must be cleared in the instant a frame is fully re-
ceived by the receiver. RXBLOCK is set by setting RXBLOCKEN in EUSARTn_CMD and disabled by setting RXBLOCKDIS also in
EUSARTn_CMD. There is one exception where data is loaded into the receive FIFO even when RXBLOCK is set. This is when an
address frame is received while operating in multi-processor mode. See 20.3.2.6.9 Multi-Processor Mode for more information.
Frames received containing framing or parity errors will not result in the FERR and PERR interrupt flags in EUSARTn_IF being set
while RXBLOCK in EUSARTn_STATUS is set. Hardware recognition is not applied to these erroneous frames, and they are silently
discarded.
The overflow interrupt flag RXOF in EUSARTn_IF will also not be set while RXBLOCK in EUSARTn_STATUS is set.
The receiver can sample incoming signal at a rate 16, 8, 6 or 4 times higher than the given baud rate, depending on the oversampling
mode given by OVS in EUSARTn_CFG0. Lower oversampling rates make higher baud rates possible, but give less room for errors.
When a high-to-low transition is registered on the input while the receiver is idle, this is recognized as a start-bit, and the baud rate
generator is synchronized with the incoming frame.
For oversampling modes 16, 8 and 6, every bit in the incoming frame is sampled three times to gain a level of noise immunity. These
samples are aimed at the middle of the bit-periods, as visualized in Figure 20.8 EUSART Sampling of Start and Data Bits on page
620. With OVS=0 in EUSARTn_CFG0, the start and data bits are thus sampled at locations 8, 9 and 10 in the figure, locations 4, 5
and 6 for OVS=1 and locations 3, 4, and 5 for OVS=2. The value of a sampled bit is determined by majority vote. If two or more of the
three bit-samples are high, the resulting bit value is high. If the majority is low, the resulting bit value is low.
Majority vote is used for all oversampling modes except 4X oversampling and when oversampling is disabled. In 4X oversampling
mode, a single sample is taken at position 3 as shown in Figure 20.8 EUSART Sampling of Start and Data Bits on page 620.
When oversampling is disabled i.e. OVS = DISABLE, there is only one available location for sampling the start and data bits and so
majority vote is not used.
Note: When operating in HF clock mode, oversampling must be set to 4, 6, 8, or 16x. When operating in LF clock mode, oversampling
must be disabled.
Software can disable majority vote by setting MVDIS in EUSARTn_CFG0. When majority vote is disabled by software, a single sample
is taken at location 9 in the figure for OVS=0, location 5 for OVS=1 and location 4 for OVS=2.
If the value of the start bit is found to be high, the reception of the frame is aborted, filtering out false start bits possibly generated by
noise on the input.
0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13
OVS = 1
0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7
OVS = 2
0 1 2 3 4 5 6 1 2 3 4 5
OVS = 3
1 2 3 4 1 2 3 4
If the baud rate of the transmitter and receiver differ, the location each bit is sampled will be shifted towards the previous or next bit in
the frame. This is acceptable for small errors in the baud rate, but for larger errors, it will result in transmission errors.
When the number of stop bits is 1 or more, stop bits are sampled like the start and data bits as seen in Figure 20.9 EUSART Sampling
of Stop Bits when Number of Stop Bits are 1 or More on page 621. When a stop bit has been detected, EUSARTn is ready for a new
start bit.
a b c
OVS = 0
13 14 15 16 1 2 3 4 5 6 7 8 9 10 0/1 X X X X X
OVS = 1
7 8 1 2 3 4 5 6 0/1 X
OVS = 2
6 1 2 3 4 5 0/1 1
OVS = 3
4 1 2 3 0/1 1
Figure 20.9. EUSART Sampling of Stop Bits when Number of Stop Bits are 1 or More
When working with stop bit lengths of half a baud period, the above sampling scheme no longer suffices. In this case, the stop-bit is not
sampled, and no framing error is generated in the receiver if the stop-bit is not generated. However, the line must still be driven high
before the next start bit for the EUSART to successfully identify the start bit.
The following status flags should be used with care keeping in mind the external sources that can impact these flags as well as the
synchronization delay when the status signal crosses over from the EUSART Core clock domain to the APB clock domain. FIFO related
status flags were already discussed in 20.3.2.6.1 Receive FIFO Operation, the remaining flags are mentioned below:
• RXENS: set when RX is enabled. Enable sources: (1) RXEN command from software, (2) PRS trigger (when RXTEN=1), (3) TX
(when RXENAT=1). Disable Sources: (1) RXDIS command from software, (2) Parity / framing error (when ERRSRX=1).
• RXBLOCK: set when RX is blocked which means RX keeps receiving frames but does not push received frame to receive FIFO.
Enable sources: (1) RXBLOCKEN command from software. Disable Sources: (1) RXBLOCKDIS command from software, (2)
STARTFRAME match (when SFUBRX=1), (3) TX (when UBRXAT=1).
• RXIDLE: Set when RX module completes pushing the last received frame to receive FIFO (if receive FIFO has space) and is not
receiving any new frame or when RX gets disabled.
• AUTOBAUDDONE: Set when auto baud detection is complete and DIV field in EUSARTn_CLKDIV is overwritten with the detected
value.
When parity bits are enabled, a parity check is automatically performed on incoming frames. When a parity error is detected in an in-
coming frame, the data parity error bit PERR in the frame is set, as well as the interrupt flag PERR in EUSARTn_IF. Frames with parity
errors are loaded into the receive FIFO like regular frames.
PERR can be accessed by reading the frame from the receive FIFO using the EUSARTn_RXDATA, or EUSARTn_RXDATAP registers.
If ERRSTX in EUSARTn_CFG0 is set, the transmitter is disabled on received parity errors. If ERRSRX in EUSARTn_CFG0 is set, the
receiver is disabled on parity errors.
A framing error is the result of an asynchronous frame where the stop bit was sampled to a value of 0. This can be the result of noise
and baud rate errors, but can also be the result of a break generated by the transmitter on purpose.
When a framing error is detected in an incoming frame, the framing error bit FERR in the frame is set. The interrupt flag FERR in EU-
SARTn_IF is also set. Frames with framing errors are loaded into the receive FIFO like regular frames.
If ERRSTX in EUSARTn_CFG0 is set, the transmitter is disabled on received framing errors. If ERRSRX in EUSARTn_CFG0 is set, the
receiver is disabled on framing errors.
The EUSART can be configured to start receiving data when a special start frame is detected on the input. This can be useful when
operating in low energy modes, allowing other devices to gain the attention of the EUSART by transmitting a given frame.
When SFUBRX in EUSARTn_CFG1 is set, an incoming frame matching the frame defined in EUSARTn_STARTFRAME will result in
RXBLOCK in EUSARTn_STATUS being cleared. This can be used to enable reception when a specified start frame is detected. If the
receiver is enabled and blocked, i.e. RXENS and RXBLOCK in EUSARTn_STATUS are set, the receiver will receive all incoming
frames, but unless an incoming frame is a start frame it will be discarded and not loaded into the receive FIFO. When a start frame is
detected, the block is cleared, and frames received from that point, including the start frame, are loaded into the receive FIFO.
An incoming start frame results in the STARTFIF interrupt flag in EUSARTn_IF being set, regardless of the value of SFUBRX in EU-
SARTn_CFG1. This allows an interrupt to be made when the start frame is detected. The interrupt will be set even if the receiver is
blocked i.e. EUSARTn_STATUS_RXBLOCK = 1.
Note: The receiver must be enabled for start frames to be detected. Please note that, if another UART device sends a start frame but a
parity and/or framing error occurs during the receiption, the received frame is not detected as a start frame.
As well as the configurable start frame, a special signal frame can be specified. When a frame matching the frame defined in EU-
SARTn_SIGFRAME is detected by the receiver, the SIGF interrupt flag in EUSARTn_IF is set. As like start frame detection, the inter-
rupt will be set even if the receiver is blocked i.e. EUSARTn_STATUS_RXBLOCK = 1.
One use of the programmable signal frame is to signal the end of a multi-frame message transmitted to the EUSART. An interrupt will
then be triggered when the packet has been completely received, allowing software to process it. Used in conjunction with the program-
mable start frame and DMA, this makes it possible for the EUSART to automatically begin the reception of a packet on a specified start
frame, load the entire packet into memory, and give an interrupt when reception of a packet has completed. When one of the low fre-
quency oscillators (LFXO,LFRCO) is used as EUSART0 peripheral clock source, the device can thus wait for data packets in EM2, and
only be woken up when a packet has been completely received.
Note: The receiver must be enabled for a signal frame to be detected. If a parity and/or framing error occurs during the reception of a
signal frame, the received frame is not detected as a signal frame.
To simplify communication between multiple processors, the EUSART supports a special multi-processor mode. In this mode the 9th
data bit in each frame is used to indicate whether the content of the remaining 8 bits is data or an address.
When multi-processor mode is enabled, an incoming 9-bit frame with the 9th bit equal to the value of MPAB in EUSARTn_CFG0 is
identified as an address frame. When an address frame is detected, the MPAF interrupt flag in EUSARTn_IF is set, and the address
frame is loaded into the receive register. This happens regardless of the value of RXBLOCK in EUSARTn_STATUS.
Multi-processor mode is enabled by setting MPM in EUSARTn_CFG0, and the value of the 9th bit in address frames can be configured
in EUSARTn_CFG0_MPAB. Note that the receiver must be enabled for address frames to be detected. The receiver can be blocked
however, preventing data from being loaded into the receive FIFO while looking for address frames.
When a device has received an address frame and wants to receive the following data, it must make sure the receiver is unblocked
before the next frame has been completely received in order to prevent data loss. One option is to set SFUBRX in EUSARTn_CFG1
and set the address frame as start frame in EUSARTn_STARTFRAME. This will handle automatic unblocking of RX when address
frame is received.
20.3.2.6.10 RX Timeout
A RX timeout function can be enabled by setting EUSART_CFG1_RXTIMEOUT to desired value. When enabled, a timer gets started
after every successful frame reception. If timeout occurs before the next RX start bit is received, EUSART_IF_RXTO gets set which can
be used to wake-up the system to handle received data. This is shown in Figure 20.10 RX Timeout on page 623 If the next RX start
bit is received before timeout occurs, no interrupt gets generated, the timer is reset and will only be started again after the on-going
frame reception is complete.
RXTOIF
RX RX
RX TIMEOUT
Figure 20.10. RX Timeout
Please note that the timer does not get started in following scnearios:
• If auto baud rate detection is enabled and auto baud rate has not been found, the timer does not get started after the first frame
which is used to detect the baud rate automatically.
• If a frame is received while RX is blocked, the timer does not get started.
• If EUSART_CFG0_SKIPPERRF is set to '1' and a frame is received with a parity error, the timer does not get started.
Please also note that the UART RX input line must be in idle state after frame reception for the timer to start.
Note: When EUSARTn_FRAMECFG_STOPBITS is set to a fractional value i.e. 'HALF' or 'ONEANDHALF', the fractional value is roun-
ded to nearest value and so RX timeout is extended by 0.5 baud width per frame.
The EUSARTn receiver samples RX by default, and the transmitter drives TX by default. This is not the only option however. When
LOOPBK in EUSARTn_CFG0 is set, the RX pin is connected to the TX pin as shown in Figure 20.11 EUSART Local Loopback on page
624. This is useful for debugging, as the EUSARTn can receive the data it transmits, but it is also used to allow the EUSARTn to read
and write to the same pin, which is required for some half duplex communication modes. In this mode, the TX pin must be enabled as
an output in the GPIO.
LOOBPK = 0 LOOBPK = 1
µC µC
UART UART
TX UARTn_TX TX UARTn_TX
RX UARTn_RX RX UARTn_RX
EUSARTn supports a basic form of collision detection. When the receiver is connected to the output of the transmitter, either by using
the LOOPBK bit in EUSARTn_CFG0 or through an external connection, this feature can be used to detect whether data transmitted on
the bus by the EUSARTn did get corrupted by a simultaneous transmission by another device on the bus.
For collision detection to be enabled, CCEN in EUSARTn_CFG0 must be set, and the receiver enabled. The data sampled by the re-
ceiver is then continuously compared with the data output by the transmitter. If they differ, the CCF interrupt flag in EUSARTn_IF is set.
The collision check includes all bits of the transmitted frames. The CCF interrupt flag is set once for each bit sampled by the receiver
that differs from the bit output by the transmitter. When the transmitter output is disabled, i.e. the transmitter is tristated, collisions are
not registered.
Note: Please note that collision detection supports only baudrates up to 1mbps.
When doing full duplex communication, two data links are provided, making it possible for data to be sent and received at the same
time. In half duplex mode, data is only sent in one direction at a time. There are several possible half duplex setups, as described in the
following sections.
In this setup, the EUSART both receives and transmits data on the same pin. This is enabled by setting LOOPBK in EUSARTn_CFG0,
which connects the receiver to the transmitter output. Because they are both connected to the same line, it is important that the EU-
SART transmitter does not drive the line when receiving data, as this would corrupt the data on the line.
When communicating over a single data-link, the transmitter must thus be tristated whenever not transmitting data. This is done by
setting the command bit TXTRIEN in EUSARTn_CMD, which tristates the transmitter. Before transmitting data, the command bit
TXTRIDIS, also in EUSARTn_CMD, must be set to enable transmitter output again. Whether or not the output is tristated at a given
time can be read from TXTRI in EUSARTn_STATUS. If TXTRI is set when transmitting data, the data is shifted out of the shift register,
but is not put out on TX line.
When operating a half duplex data bus, it is common to have a main bus controller, which first transmits a request to one of the secon-
dary devices on the bus, then receives a reply. In this case, the frame transmission control bits, which can be set by writing to EU-
SARTn_TXDATA, can be used to make the EUSART automatically disable transmission, tristate the transmitter and enable reception
when the request has been transmitted, making it ready to receive a response from the secondary device.
Tristating the transmitter can also be performed automatically by the EUSART by using AUTOTRI in EUSARTn_CFG0. When AUTO-
TRI is set, the EUSART automatically tristates TX line whenever the transmitter is idle, and enables transmitter output when the trans-
mitter goes active. If AUTOTRI is set TXTRI is always read as 0.
Note: Another way to tristate the transmitter is to enable wired-and or wired-or mode in GPIO. For wired-and mode, outputting a 1 will
be the same as tristating the output, and for wired-or mode, outputting a 0 will be the same as tristating the output. This can only be
done on buses with a pull-up or pull-down resistor respectively.
Some communication schemes, such as RS-485 rely on an external driver. Here, the driver has an extra input which enables it, and
instead of tristating the transmitter when receiving data, the external driver must be disabled.
This can be done manually by assigning a GPIO to turn the driver on or off.
Figure 20.12 EUSART Half Duplex Communication with External Driver on page 625 shows an example configuration using an exter-
nal driver.
µC
GPIO
UART
TX
RX
Some limited devices only support half duplex communication even though two data links are available. In this case software is respon-
sible for making sure data is not transmitted when incoming data is expected.
Hardware flow control can be used to hold off the link partner's transmission until receive FIFO space is available. Use RTSPEN in
GPIO_DBUSEUSARTn_ROUTEEN to enable RTS pin (CTS is an input so its pin is enabled by default). Port and Pin selection for RTS
and CTS can be done in GPIO_DBUSEUSARTn_RTSROUTE/CTSROUTE. RTS is an out going signal which indicates that receive
FIFO space is available to receive a frame. The link partner is being requested to send its data when RTS is active. RTS activation can
be made dependent on how much space is available in the receive FIFO using RTSRXFW in EUSARTn_CFG1. For debug use set
DBGHALT in EUSARTn_CFG1 which will force the RTS to request one frame from the link partner when the CPU core single steps.
RTS is deactivated when RX is disabled.
CTS is an incoming signal to stop the next TX data from going out. CTS indicates that the link partner has receive FIFO space availa-
ble, and the local transmitter is clear to send. When CTS deactivates in the middle of a frame, the frame currently being transmitted is
completed before stopping. CTS operation needs to be enabled using CFG1.CTSEN.
The RTS and CTS are active low by default, but their polarity can be changed with RTSINV and CTSINV in EUSARTn_CFG1 respec-
tively.
During single stepping, debug halt feature allows halting EUSART frame reception by deactivating RTS when the core is halted and
continuing frame reception by activating RTS when the core is unhalted. EUSART debug halt can be enabled by setting DBGHALT in
EUSART_CFG1 to '1'. EUSART receiver must be enabled for debug halting.
When EUSART_CFG1_DBGHALT is not set or EUSART_CFG1_DBGHALT is set but chip halt is low, RTS is only dependent on the
receive FIFO having space available to receive at least number of frames given by EUSART_CFG1_RTSRXFW settings.
When EUSART_CFG1_DBGHALT is set, RTS will remain deactivated as long as chip halt is high. When a low pulse is detected on
chip halt while DBGHALT is set, RTS will be activated if receive FIFO has space available to receive at least number of frames given by
EUSART_CFG1_RTSRXFW settings and no frame is being received. RTS will be deactivated again if chip halt goes back to high and
receiver starts receiving a new frame or if receive FIFO does not have space available to receive at least number of frames given by
EUSART_CFG1_RTSRXFW settings. This behavior allows single stepping to pulse the chip halt low for a cycle, and receive the next
frame.
Please note that, if chip halt remains low for a short duration after RX is enabled while DBGHALT is set, initial low value of chip halt will
be treated the same as a low pulse on chip halt.
As incoming frame is always received until receive FIFO is full regardless of the state of DBGHALT or chip halt, the link partner must
stop transmitting when RTS is deactivated, or the receive FIFO could overflow.
All data in the transmit FIFO is sent out even when chip halt is asserted; therefore, DMA will need to be set to stop sending EUSART
TX data during chip halt.
If a transmission must be started on an event with very little delay, the PRS system can be used to trigger the transmission. The PRS
channel to use as a trigger can be selected using EUSARTn_TRIGGER.PRSSEL in PRS. When a positive edge is detected on PRS
signal, the receiver is enabled if RXTEN in EUSARTn_TRIGCTRL is set, and the transmitter is enabled if TXTEN in EU-
SARTn_TRIGCTRL is set. Only one signal input is supported by the EUSART.
The EUSART can be configured to receive data directly from a PRS channel by setting RXPRSEN in EUSARTn_CFG1. The PRS
channel used is selected using EUSARTn_RX.PRSSEL in PRS.
The EUSART has full DMA support. The DMA controller can write to the transmit FIFO using the register EUSARTn_TXDATA, and it
can read from the receive FIFO using the register EUSARTn_RXDATA. This enables 9 bit data + control/status bits transfers both to
and from the EUSART.
A request for the DMA controller to read from the EUSART receive buffer can come from the following source:
• Receive FIFO is loaded with at least number of frames set by RXFIW.
In some cases, it may be sensible to temporarily stop DMA read access to the EUSART when an error such as parity or framing error
has occurred. This is enabled by setting ERRSDMA in EUSARTn_CFG0.
EUSART0 (EM2 Capable instance only) can also work with the DMA in low power mode so that the system does not have to wake up
to EM0 to consume data. This can happen if TXDMAWU or RXDMAWU in the EUSARTn_CFG1 is set. The DMA will be triggered when
TXFIW/RXFIW samples are in the corresponding FIFO. The chip will enter EM1, DMA will then pop/ push all the elements of the corre-
sponding FIFO and then the system will be put back to EM2.
20.3.2.15 Interrupts
The interrupts generated by the EUSART are combined into two interrupt vectors. Interrupts related to reception are assigned to one
interrupt vector, and interrupts related to transmission are assigned to the other. Separating the interrupts in this way allows different
priorities to be set for transmission and reception interrupts.
The transmission interrupt vector groups the transmission-related interrupts generated by the following interrupt flags:
• TXC
• TXFL
• TXOF
• CCF
• TXIDLE
The reception interrupt on the other hand groups the reception-related interrupts, triggered by the following interrupt flags:
• RXFL
• RXFULL
• RXOF
• RXUF
• PERR
• FERR
• MPAF
• START
• SIGF
• AUTOBAUDDONE
• RXTO
If EUSARTn interrupts are enabled, an interrupt will be made if one or more of the interrupt flags in EUSARTn_IF and their correspond-
ing bits in EUSARTn_IEN are set. All interrupts can serve as wake up interupts if enabled (EM2 Capable instance only).
EUSART0 can operate in EM2 when running from an LF oscillator source (LF mode). Note that sending and receiving data in EM2
requires that the EUSART be connected to GPIO that are capable of operating in EM2. This includes all pins on Port A and Port B. Pins
on Port C and Port D are not available for digital peripheral signalling in EM2 or EM3.
EM2 operation allows the EUSART to wait for an incoming UART frame, or even wait on the programmable start or signal frames while
the system is consumiung very little energy. When a UART frame is completely received, or a start/signal frame is detected, the CPU
can quickly be woken up. Alternatively, multiple frames can be transferred via the Direct Memory Access (DMA) module into RAM
memory before waking up the CPU. Similarly, data can be transmitted in EM2 with data from the CPU or through use of the DMA.
All interrupts can be used as wake up interrupts if enabled. None of the interrupts are sticky, i.e., the interrupt triggers only once when-
ever the interrupt condition is reached.
Note: When RXDMAWU or TXDMAWU is set in EUSART0_CFG1, the system will not be able to go to EM2 before all related EU-
SART0 DMA requests have been processed. This means that if RXDMAWU is set and the EUSART receives a frame, the system will
wait to go to EM2 before the frame has been read from the EUSART. In order for the system to go back to EM2 during or after the final
transmission (i.e. when DMA will no add more data to the TX FIFO), the wake request to DMA must be removed. There are two meth-
ods for doing this:
1. If RX does not need to remain active, software can disable the peripheral and clear the TXDMAWU bit in the ISR to prevent further
DMA requests. The peripheral may be re-enabled after TXDMAWU is cleared. Note that while the peripheral is disabled, the EU-
SART cannot receive any new data, so this option should only be used if no data is expected.
2. If RX must remain active, it is recommended to disable TX, and then write dummy information into the FIFO until the TXFL flag will
no longer trigger a new wakeup. This will prevent new DMA requests.
20.3.2.17 PRS
All PRS inputs are synchronized to the peripheral clock (clk_per) for the EUSART instance.
• RX PRS: Input goes to RX module for data reception if RXPRSEN set to 1
• TRIGGER PRS: Can be used to Enable TX and/or RX if TXTEN/RXTEN are set to 1
The EUSART supports IrDA operation using both HF and LF clocks. For IrDA with HF clock, the controls are given in IRHFCFG regis-
ter. For IrDA with LF clock (32.768 kHz), only RX is supported and the controls are given in IRLFCFG register. Note that OVS must be
disabled for LF operation.
Note: Note that break generation/ detection feature is not supported while IrDA is enabled, i.e., either IRHFEN or IRLFEN is set.
20.3.2.18.1 IRHF
The IRHF modulator implements the physical layer of the IrDA specification, which is necessary for communication over IrDA. The
modulator takes the signal output from the EUSART module, and modulates it before it leaves the EUSART. In the same way, the input
signal is demodulated before it enters the actual EUSART module. The modulator implements the original Rev. 1.0 physical layer and
one high speed extension which supports speeds from 2.4 kbps to 1.152 Mbps.
The data from and to the EUSART is represented in a NRZ (Non Return to Zero) format, where the signal value is at the same level
through the entire bit period. For IrDA, the required format is RZI (Return to Zero Inverted), a format where a “1” is signalled by holding
the line low, and a “0” is signalled by a short high pulse. An example is given in Figure 20.13 EUSART Example RZI Signal for a given
EUSART Frame on page 628.
Idle Idle
UART
S 0 1 2 3 4 5 6 7 P Stop
(NRZ)
IrDA
(RZI)
Figure 20.13. EUSART Example RZI Signal for a given EUSART Frame
The IrDA HF module is enabled by setting IRHFEN in IRHFCFG. The EUSART transmitter output and receiver input is then routed
through the IrDA HF modulator.
The width of the pulses generated by the IrDA HF modulator is set by configuring IRHFPW in IRHFCFG register. Four pulse widths are
available, each defined relative to the configured bit period as listed in Table 20.9 EUSART IrDA Pulse Widths on page 628.
IRHFPW Pulse width OVS=0 Pulse width OVS=1 Pulse width OVS=2 Pulse width OVS=3
By default, no filter is enabled in the IrDA HF demodulator. A filter can be enabled by setting IRHFFILT in IRHFCFG. When the filter is
enabled, an incoming pulse has to last for 5 consecutive clock cycles to be detected by the IrDA demodulator. When the filter is ena-
bled, the minimum clock frequency required is based on the baud rate and OVS chosen. The frequency requirements are listed in table
Table 20.10 EUSART IrDA IRHFFILT=1, Min Clock Frequency Requirement (MHz) on page 628.
Table 20.10. EUSART IrDA IRHFFILT=1, Min Clock Frequency Requirement (MHz)
OVS 2.4 kb/s 9.6 kb/s 19.2 kb/s 38.4 kb/s 57.6 kb/s 115.2 kb/s 0.576 Mb/s 1.152 Mb/s
3 (x4) 1.0 MHz 1.0 MHz 1.0 MHz 1.0 MHz 1.4 MHz 2.8 MHz 13.8 MHz 27.6 MHz
2 (x6) 1.0 MHz 1.0 MHz 1.0 MHz 1.4 MHz 2.1 MHz 4.1 MHz 20.7 MHz 41.5 MHz
1 (x8) 1.0 MHz 1.0 MHz 1.0 MHz 1.0 MHz 1.4 MHz 2.8 MHz 13.8 MHz 27.6 MHz
0 (x16) 1.0 MHz 1.0 MHz 1.0 MHz 1.0 MHz 1.1 MHz 2.2 MHz 11.1 MHz 22.1 MHz
Note that by default, the idle value of the EUSART data signal is high. This means that the IrDA modulator generates negative pulses,
and the IrDA demodulator expects negative pulses. To make the IrDA module use RZI signalling, both TXINV and RXINV in EU-
SARTn_CFG0 must be set.
Since the incoming signal is only sampled on positive clock edges, the width of the incoming pulses must be at least two clk_per peri-
ods wide for reliable detection by the receiver.
20.3.2.18.2 IRLF
IRLF only supports RX operation. This feature will stay operational even in EM2. It is possible to cause a wake up when a certain frame
is received and then switch to IRHF if TX is required. IRLFEN in IRLFCFG must be set for this to work.
Synchronous mode shares some common features with asynchronous mode such as: Loopback, inversion of RX/TX, MSBF, TX/RX
Interrupt watermarks. They both share the EUSARTn_TRIGCTRL, CMD, TXDATA, RXDATA, STATUS and Interrupt registers.
In synchronous mode, EUSART can be configured to work either as a main (clock driver) or secondary (clock receiver) interface
through EUSARTn_CFG2.MASTER.
The frames used in synchronous mode need no start and stop bits since a single clock is available to all parts participating in the com-
munication. Parity bits cannot be used in synchronous mode.
The EUSART supports frame lengths of 8 to 16 bits per frame. Larger frames can be simulated by transmitting multiple smaller frames,
i.e. a 22 bit frame can be sent using two 11-bit frames, and a 24 bit frame can be generated by transmitting three 8-bit frames. The
number of bits in a frame is set using DATABITS in EUSARTn_FRAMECFG.
The frames in synchronous mode are by default transmitted with the least significant bit first like in asynchronous mode. The bit-order
can be reversed by setting MSBF in EUSARTn_CFG0.
The frame format used by the transmitter can be inverted by setting TXINV in EUSARTn_CFG0, and the format expected by the receiv-
er can be inverted by setting RXINV, also in EUSARTn_CFG0.
The bit-rate in synchronous mode is given by Figure 20.14 EUSART Synchronous Mode Bit Rate on page 630. The clock division is
derived from EUSARTn_CFG2.SDIV, which is applicable when acting as a Main interface only.
br = fHFPERCLK/(1 + EUSARTn_CFG2.SDIV)
Given a desired baud rate brdesired, the clock divider EUSARTn_CFG2.SDIV can be calculated using Figure 20.15 EUSART Synchro-
nous Mode Clock Division Factor on page 630
EUSARTn_CFG2.SDIV = (fHFPERCLK/brdesired - 1)
On every clock edge data on the data lines, MOSI and MISO, is either set up or sampled. When CLKPHA in EUSARTn_CTRL is
cleared, data is sampled on the leading clock edge and set-up is done on the trailing edge. If CLKPHA is set however, data is set-up on
the leading clock edge, and sampled on the trailing edge. In addition to this, the polarity of the clock signal can be changed by setting
CLKPOL in EUSARTn_CTRL, which also defines the idle state of the clock. This results in four different modes which are summarized
in Table 20.11 EUSART SPI Modes on page 630. Figure 20.16 EUSART SPI Timing on page 630 shows the resulting timing of data
set-up and sampling relative to the bus clock.
CLKPOL = 0
SCLK
CLKPOL = 1
CS
CLKPHA = 0 X 0 1 2 3 4 5 6 7 X
TX/RX
CLKPHA = 1 X 0 1 2 3 4 5 6 7 X
The RX overflow interrupt flag, RXOF, is set at the end of the overflow frame if the receive FIFO is full. When a transfer has been
performed, interrupt flags TXC are updated on the first setup clock edge of the succeeding frame, or when CS is deasserted.
EUSART operating as a main SPI interface is available only in EM0/EM1 with an HF clock source selected. When configured as a main
interface, the EUSART is in full control of the data flow on the synchronous bus. When operating in full duplex mode, the secondary
devices cannot transmit data to the main device without the main device transmitting to the secondary. The main device outputs the bus
clock on SCLK.
Communication starts whenever there is data in the transmit FIFO and the transmitter is enabled. The EUSART clock then starts, and
the main device shifts bits out from the transmit shift register using the internal clock.
When there are no more frames in the transmit FIFO and the transmit shift register is empty, the clock stops, and communication ends.
When the receiver is enabled, it samples incoming data when the transmitter transmits data. Operation of the RX and TX FIFOs is as in
asynchronous mode.
EUSARTn_CFG2.RXBLOCK can be used to block incoming RX data from pushing into RX FIFO.
When operating as a main interface, the CS pin can have one of two functions, or it can be disabled by clearing CSPEN in GPIO_EU-
SARn_ROUTEEN register.
If CS is disabled and there is a need to disable TX during the operation, then TX should be disabled at the end of transaction only
indicated by the trigger of TXC interrupt to maintain synchronicity between TX and RX and avoid causing sudden stop to secondary
devices.
If CS is configured as an output, it can be used to automatically generate a chip select for a single secondary device by setting AU-
TOCS in EUSARTn_CTRL. If AUTOCS is set, CS is activated before a transmission begins, and deactivated after the last bit has been
transmitted and there is no more data in the transmit FIFO.
The time duration between assertion of CS and the start of transmission can be controlled using CSSETUP in EUSARTn_TIMINGCFG.
If new data is ready for transmission before CS is deasserted, the data is sent without deasserting CS in between. CSHOLD in EU-
SARTn_TIMINGCFG keeps CS asserted after the end of frame for the number of baud-times specified.
By default, CS is active low, but its polarity can be inverted by setting CSINV in EUSARTn_CFG2.
20.3.3.5 AUTOTX
The main device on a synchronous bus is required to transmit data (send a clock) to a secondary device in order to receive data from
that device. In some cases, only a few words are transmitted and a lot of data is then received from the secondary device. In that case,
one solution is to keep feeding the TX with data to transmit, but that consumes system bandwidth. Instead AUTOTX can be used.
When AUTOTX in EUSARTn_CFG2 is set and TX FIFO is filled with initial data, EUSART will fully transmit the loaded data and then
continue transmitting the last sent bit as long as there is available space in the RX FIFO for the chosen frame size. This happens even
though there is no more data in the TX FIFO. The TX underflow interrupt flag TXUF in EUSARTn_IF is set on the first word that is
transmitted which does not contain valid data.
During AUTOTX the EUSART will always send the previous sent bit, thus reducing the number of transitions on the TX output. So if the
last bit sent was a 0, 0's will be sent during AUTOTX and if the last bit sent was a 1, 1's will be sent during AUTOTX.
When the EUSART is in secondary interface mode, data transmission is not controlled by the EUSART, but by an external main SPI
device. The EUSART is therefore not able to initiate a transmission, and has no control over the number of bytes written to the external
main device.
The output and input to the EUSART are also swapped when in secondary mode, making the receiver take its input from TX (MOSI)
and the transmitter drive RX (MISO).
To transmit data when in secondary mode, the device must load data into the transmit FIFO and enable the transmitter. The data will
remain in the EUSART until the main device starts a transmission by pulling the CS input low and transmitting data. For every frame
transmitted from main to secondary device, a frame is transferred from secondary to main as well.
If the transmitter is enabled in synchronous secondary mode and the main device starts transmission of a frame, the underflow interrupt
flag TXUF in EUSARTn_IF will be set if no data is available for transmission. At the same time, the secondary device will transmit the
default TX data, which can be set through EUSARTn_DTXDATCFG for the current and subsequent frames until the FIFO is filled. Note
that when TX is enabled (with or without data in TXFIFO) in the middle of transaction, TXUF can be triggered if it's transmitting default
TX data.
Similar to when operating as a synchronous main interface, EUSARTn_CFG2.RXBLOCK can be used to block incoming RX data from
pushing into RX FIFO.
If the secondary device needs to control its own chip select signal, this can be achieved by clearing CSPEN in the GPIO_EU-
SARTn_ROUTEEN register. The internal chip select signal can then be controlled through CSINV in the CTRL register. The chip select
signal will be CSINV inverted, i.e. if CSINV is cleared, the chip select is active and vice versa. In such cases, SCLK could arrive any-
time that the device doesn't have prior notification from CS. Hence, EUSARTn_CFG2.FORCELOAD bit can be used to control how the
device transmits the first dataword. If this bit is not set, the next outgoing dataword will be a DEFAULT TX data even if the FIFO had
been loaded before SCLK arrives, followed by the loaded TX data. EUSARTn_IF.LOADERRIF Interrupt will never be triggered when
EUSARTn_CFG2.FORCELOAD is not set. If this bit is set, as soon as the transmitter becomes ready the shift register will be loaded
immediately and send data once SCLK arrives. The transmitter becomes ready when TX is enabled and TXFIFO is filled. On top of
that, at word-boundary it will automatically trigger setup window check against the programmed EUSARTn_TIMINGCFG.SETUPWIND-
OW, which specifies the minimum duration (in APB bus clock cycles) between transmitter becoming ready and the incoming SCLK. If
the measured duration is less than SETUPWINDOW bus clock cycles, an EUSARTn_IF.LOADERRIF Interrupt will be triggered. Be-
sides, if the transmitter is enabled or disabled or the empty TXFIFO is loaded not at word-boundary during a transaction (SCLK is tog-
gling), LOADERRIF will also be triggered immediately without checking for SETUPWINDOW. It's recommended that the transmitter
should be ready while SCLK is idling or at word-boundary and at sufficient margin before SCLK toggles. Once LOADERRIF Interrupt is
set, it may require to reset the secondary interface by disabling the module and re-enabling it because the transmitted data could be un-
determistic.
When DBGHALT in EUSART_CTRLX is clear, RTS is only dependent on the RX FIFO having space available to receive data. Incom-
ing data is always received until both the RX FIFO is full and the RX shift register is full regardless of the state of DBGHALT or chip
halt. Additional incoming data is discarded. When DBGHALT is set, RTS deasserts on RX FIFO full or when chip halt is high. However,
a low pulse detected on chip halt will keep RTS asserted when no frame is being received. At the start of frame reception, RTS will
deassert if chip halt is high and DBGHALT is set. This behavior allows single stepping to pulse the chip halt low for a cycle, and receive
the next frame. The link partner must stop transmitting when RTS is deasserted, or the RX FIFO could overflow. All data in the transmit
FIFO is sent out even when chip halt is asserted; therefore, the DMA will need to be set to stop sending the EUSART TX data during
chip halt.
If a transmission must be started on an event with very little delay, the PRS system can be used to trigger the transmission. The PRS
channel to use as a trigger can be selected using TSEL in EUSARTn_TRIGCTRL. When a positive edge is detected on this signal, the
receiver is enabled if RXTEN in EUSARTn_TRIGCTRL is set, and the transmitter is enabled if TXTEN in EUSARTn_TRIGCTRL is set.
Only one signal input is supported by the EUSART.
AUTOTXTEN can also be combined with TXTEN to make the EUSART transmit a command to the external device prior to clocking out
data. To do this, disable TX using the TXDIS command, load the TX FIFO with the command and enable AUTOTXTEN and TXTEN.
When the selected PRS input goes high, the EUSART will now transmit the loaded command, and then continue clocking out while
both the PRS input is high and there is room in the RX FIFO
The EUSART can be configured to receive data directly from a PRS channel by setting RXPRS in EUSARTn_INPUT. The PRS channel
used is selected using RXPRSSEL in EUSARTn_INPUT. This way, for example, a differential RX signal can be input to the ACMP and
the output routed via PRS to the EUSART.
The EUSART can be configured to receive clock directly from a PRS channel by setting CLKPRS in EUSARTn_INPUT. The PRS chan-
nel used is selected using CLKPRSSEL in EUSARTn_INPUT. This is useful in secondary synchronous mode and can together with RX
PRS input be used to input data from PRS.
The EUSART has full DMA support. The DMA controller can write to the transmit FIFO using the registers EUSARTn_TXDATA and it
can read from the receive FIFO using the registers EUSARTn_RXDATA. This enables single byte transfers, 9 bit data + control/status
bits, double byte and double byte + control/status transfers both to and from the EUSART.
A request for the DMA controller to read from the EUSART receive FIFO can come from the following source:
• Receive FIFO level satisfying EUSARTn_CFG1.RXFIW setting
Even though there are two sources for write requests to the DMA, only one should be used at a time, since the requests from both
sources are cleared even though only one of the requests are used.
In some cases, it may be sensible to temporarily stop DMA access to the EUSART when an error such as a framing error has occurred.
This is enabled by setting ERRSDMA in EUSARTn_CTRL.
Note: For Synchronous mode full duplex operation, if both receive FIFO and transmit FIFO are served by DMA, to make sure receive
FIFO is not overflowed the settings below should be followed.
• The DMA channel that serves receive FIFO should have higher priority than the DMA channel that serves transmit FIFO.
• IGNORESREQ should be set for both DMA channel.
0x000
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
0x1
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004 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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Access
SKIPPERRF
ERRSDMA
AUTOTRI
ERRSRX
LOOPBK
Name
ERRSTX
MVDIS
RXINV
TXINV
MPAB
CCEN
MSBF
SYNC
MPM
OVS
Bit Name Reset Access Description
Detects the baud rate based on receiving a 0x55 frame (0x00 for IrDA). Only applicable when CFG0.SYNC bit is set to
'ASYNC'.
Disable majority vote for 16x, 8x and 6x oversampling modes. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
29:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, the transmitter is disabled on framing and parity errors in the receiver. Only applicable when CFG0.SYNC bit
is set to 'ASYNC'.
When set, the receiver is disabled on framing and parity errors. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
When set, DMA read requests will be cleared on framing and parity errors. Only applicable when CFG0.SYNC bit is set
to 'ASYNC'.
0 DISABLE Framing and parity errors have no effect on DMA requests from
the EUSART
1 ENABLE DMA requests from the EUSART are blocked while the PERR
or FERR interrupt flags are set
21 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, the receiver discards frames with parity errors. The PERR interrupt flag is still set. Only applicable when
CFG0.SYNC bit is set to 'ASYNC'.
19:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When enabled, TXTRI is set by hardware whenever the transmitter is idle, and TXTRI is cleared by hardware when
transmission starts. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
16:15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The output from the EUSART transmitter can optionally be inverted by setting this bit.
Setting this bit will invert the input to the EUSART receiver.
12:11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Decides whether data is sent with the least significant bit first, or the most significant bit first.
9:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Sets the number of clock periods in a EUSART bit-period. More clock cycles gives better robustness, while less clock
cycles gives better performance. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
1 X8 8X oversampling
2 X6 6X oversampling
3 X4 4X oversampling
Defines the value of the multi-processor address bit. An incoming frame with its 9th bit equal to the value of this bit marks
the frame as a multi-processor address frame. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
Multi-processor mode uses the 9th bit of the EUSART frames to tell whether the frame is an address frame or a data
frame. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
1 ENABLE An incoming frame with the 9th bit equal to MPAB will be loaded
into the RX FIFO regardless of RXBLOCK and will result in the
MPAB interrupt flag being set
Enables collision checking on data when operating in half duplex modus. Only applicable when CFG0.SYNC bit is set to
'ASYNC'.
1 ENABLE Collision check is enabled. The receiver must be enabled for the
check to be performed
Allows the receiver to be connected directly to the EUSART transmitter for loopback and half duplex communication.
Determines whether the EUSART is operating in asynchronous or synchronous mode. When switching between SYNC
and ASYNC mode, module Disablement is required.
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RW 0x0 15
14
13
12
RW 0x0 11
RW 0x0 10
RW 0x0 9
8
7
6
RXTIMEOUT RW 0x0 5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
RW 0x0
RW 0x0
Reset
Access
RXDMAWU
TXDMAWU
RTSRXFW
RXPRSEN
DBGHALT
SFUBRX
RTSINV
CTSINV
Name
CTSEN
RXFIW
TXFIW
Bit Name Reset Access Description
31 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Determines the interrupt and status level of the Receive FIFO. Also impacts RX DMA request.
0 ONEFRAME RXFL status flag and IF are set when the RX FIFO has at least
one frame in it.
1 TWOFRAMES RXFL status flag and IF are set when the RX FIFO has at least
two frames in it.
2 THREEFRAMES RXFL status flag and IF are set when the RX FIFO has at least
three frames in it.
3 FOURFRAMES RXFL status flag and IF are set when the RX FIFO has at least
four frames in it.
4 FIVEFRAMES RXFL status flag and IF are set when the RX FIFO has at least
five frames in it.
5 SIXFRAMES RXFL status flag and IF are set when the RX FIFO has at least
six frames in it.
6 SEVENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
seven frames in it.
7 EIGHTFRAMES RXFL status flag and IF are set when the RX FIFO has at least
eight frames in it.
8 NINEFRAMES RXFL status flag and IF are set when the RX FIFO has at least
nine frames in it.
9 TENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
ten frames in it.
10 ELEVENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
eleven frames in it.
11 TWELVEFRAMES RXFL status flag and IF are set when the RX FIFO has at least
twelve frames in it.
12 THIRTEENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
thriteen frames in it.
13 FOURTEENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
fourteen frames in it.
14 FIFTEENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
fifteen frames in it.
15 SIXTEENFRAMES RXFL status flag and IF are set when the RX FIFO has at least
sixteen frames in it.
26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set Request-to-send watermark level. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
0 ONEFRAME RTS is set if there is space for at least one more frame in the
RX FIFO.
1 TWOFRAMES RTS is set if there is space for at least two more frames in the
RX FIFO.
2 THREEFRAMES RTS is set if there is space for at least three more frames in the
RX FIFO.
3 FOURFRAMES RTS is set if there is space for four more frames in the RX FIFO.
4 FIVEFRAMES RTS is set if there is space for five more frames in the RX FIFO.
5 SIXFRAMES RTS is set if there is space for six more frames in the RX FIFO.
6 SEVENFRAMES RTS is set if there is space for seven more frames in the RX
FIFO.
7 EIGHTFRAMES RTS is set if there is space for eight more frames in the RX
FIFO.
8 NINEFRAMES RTS is set if there is space for nine more frames in the RX
FIFO.
9 TENFRAMES RTS is set if there is space for ten more frames in the RX FIFO.
10 ELEVENFRAMES RTS is set if there is space for eleven more frames in the RX
FIFO.
11 TWELVEFRAMES RTS is set if there is space for twelve more frames in the RX
FIFO.
12 THIRTEENFRAMES RTS is set if there is space for thirteen more frames in the RX
FIFO.
13 FOURTEENFRAMES RTS is set if there is space for fourteen more frames in the RX
FIFO.
14 FIFTEENFRAMES RTS is set if there is space for fifteen more frames in the RX
FIFO.
15 SIXTEENFRAMES RTS is set if there is space for sixteen more frames in the RX
FIFO.
21:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Determines the interrupt and status level of the transmit FIFO. Also impacts TX DMA request.
0 ONEFRAME TXFL status flag and IF are set when the TX FIFO has space for
at least one more frame.
1 TWOFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least two more frames.
2 THREEFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least three more frames.
3 FOURFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least four more frames.
4 FIVEFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least five more frames.
5 SIXFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least six more frames.
6 SEVENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least seven more frames.
7 EIGHTFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least eight more frames.
8 NINEFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least nine more frames.
9 TENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least ten more frames.
10 ELEVENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least eleven more frames.
11 TWELVEFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least twelve more frames.
12 THIRTEENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least thriteen more frames.
13 FOURTEENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least fourteen more frames.
14 FIFTEENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least fifteen more frames.
15 SIXTEENFRAMES TXFL status flag and IF are set when the TX FIFO has space for
at least sixteen more frames.
14:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to unblock RX on Start frame reception. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
Set to enable wakeup from EM2 to EM1 for DMA/ RX interaction. Only applicable when CFG0.SYNC bit is set to
'ASYNC'.
Set to enable wakeup from EM2 to EM1 for DMA/ TX interaction. Only applicable when CFG0.SYNC bit is set to
'ASYNC'.
8:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When enabled, determines how long, in units of frame, RX needs to remain idle after a frame reception before RXTOIF
gets set. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
0 DISABLED
1 ONEFRAME
2 TWOFRAMES
3 THREEFRAMES
4 FOURFRAMES
5 FIVEFRAMES
6 SIXFRAMES
7 SEVENFRAMES
When set, the RTS pin polarity is inverted. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
When set, frames in the TX FIFO will not be sent until link partner asserts CTS. Any data in the TX shift register will
continue transmitting, the next TX FIFO data will not load into the TX shift register. Only applicable when CFG0.SYNC bit
is set to 'ASYNC'.
When set, the CTS pin polarity is inverted. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
Set to halt operation when core is halted. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
1 ENABLE If core is halted, receive one frame and then halt reception by
deactivating RTS. Next frame reception happens when the core
is unhalted during single stepping.
0x010 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
FORCELOAD RW 0x0 7
RW 0x0 6
RW 0x1 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
CLKPRSEN
AUTOCS
MASTER
AUTOTX
CLKPHA
CLKPOL
Name
CSINV
SDIV
Sets the clock rate for synchronous main mode operation only (To set the clock rate for asynchronous operation, see the
CLKDIV field). Clock division value = SDIV + 1. Only applicable when CFG0.SYNC bit is set to 'SYNC' and CFG2.MAS-
TER is set to 'MASTER'.
23:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When this bit is set, if TXEN is already enabled, any loading of an empty FIFO will immediately load the data into the shift
register. This bit is recommended to be used in 3-wire setting where CS is not used, or in a custom 4-wire mode where
SCLK is in long idle state between two transactions with CS always in active mode (this typically happens between 2
transactions where the main interface holds SCLK idling to give additional time for the secondary interface to load data).
If FORCELOAD bit is not set, the next out-going frame will be a DEFAULT TX data, followed by the loaded TX data in TX
FIFO. When FORCELOAD is set, it will automatically trigger setup window check against the programmed EUSARTn_TI-
MINGCFG.SETUPWINDOW, which specifies the minimum duration between empty fifo loading event and first encoun-
tered edge of SCLK. If the measured duration is less than SETUPWINDOW bus clock cycles, a EUSARTn_IF.LOADER-
RIF Interrupt will be triggered. Only applicable when CFG0.SYNC bit is set to 'SYNC' and CFG2.MASTER is set to
'SLAVE'.
When set, the PRS channel selected as input to CLK. Only applicable when CFG0.SYNC bit is set to 'SYNC' and
CFG2.MASTER is set to 'SLAVE'.
When enabled, the output on CS will be activated one baud-period before transmission starts, and deactivated when
transmission ends. Only applicable when CFG0.SYNC bit is set to 'SYNC' and CFG2.MASTER is set to 'MASTER'.
Transmits as long as RXFIFO is not full. If TX is empty, underflows are generated. Only applicable when CFG0.SYNC bit
is set to 'SYNC' and CFG2.MASTER is set to 'MASTER'.
Default value is active low. This affects both the selection of external secondary devices, as well as the selection of the
microcontroller in secondary mode. Only applicable when CFG0.SYNC bit is set to 'SYNC'.
Determines where data is set-up and sampled according to the bus clock when in synchronous mode. Only applicable
when CFG0.SYNC bit is set to 'SYNC'.
0 SAMPLELEADING Data is sampled on the leading edge and set-up on the trailing
edge of the bus clock in synchronous mode
1 SAMPLETRAILING Data is set-up on the leading edge and sampled on the trailing
edge of the bus clock in synchronous mode
Determines the clock polarity of the bus clock used in synchronous mode. Only applicable when CFG0.SYNC bit is set to
'SYNC'.
0 IDLELOW The bus clock used in synchronous mode has a low base value
1 IDLEHIGH The bus clock used in synchronous mode has a high base value
Set this bit to put EUSART to main interface mode. When unset, EUSART operates in secondary interface mode. When
changing between Main and Secondary mode, module Disablement is required. Only applicable when CFG0.SYNC bit is
set to 'SYNC'.
0x014 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
STOPBITS RW 0x1
RW 0x0
DATABITS RW 0x2
Reset
Access
PARITY
Name
31:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Determines the number of stop-bits used. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
0 HALF The transmitter generates a half stop bit. Stop-bits are not veri-
fied by receiver
2 ONEANDAHALF The transmitter generates one and a half stop bit. The receiver
verifies the first stop bit
3 TWO The transmitter generates two stop bits. The receiver checks the
first stop-bit only
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Determines whether parity bits are enabled, and whether even or odd parity should be used. Only applicable when
CFG0.SYNC bit is set to 'ASYNC'.
2 EVEN Even parity are used. Parity bits are automatically generated
and checked by hardware.
3 ODD Odd parity is used. Parity bits are automatically generated and
checked by hardware.
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x018
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
DTXDAT RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This is the default transmitted data when the TXFIFO is empty. Only applicable when CFG0.SYNC bit is set to 'SYNC'
and CFG2.MASTER is set to 'SLAVE'.
0x01C 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
IRHFFILT RW 0x0 3
2
1
RW 0x0 0
RW 0x0
Reset
Access
IRHFPW
IRHFEN
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 ENABLE Filter enabled. IrDA pulse must be high for at least 5 consecu-
tive clock cycles to be detected
Configure the pulse width generated by the modulator as a fraction of the configured EUSART bit period.
0 ONE IrDA pulse width is 1/16 for OVS=0 and 1/8 for OVS=1
1 TWO IrDA pulse width is 2/16 for OVS=0 and 2/8 for OVS=1
2 THREE IrDA pulse width is 3/16 for OVS=0 and 3/8 for OVS=1
3 FOUR IrDA pulse width is 4/16 for OVS=0 and 4/8 for OVS=1
Enable IrDA module and route EUSART signals through it. Used when EUSART has HF clock. Only applicable when
CFG0.SYNC bit is set to 'ASYNC'
0x020 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
IRLFEN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Filter EUSART output through pulse generator and the EUSART input through the pulse extender. Used for LF opera-
tion. Only applicable when CFG0.SYNC bit is set to 'ASYNC'
0x024 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
RW 0x0 13
12
11
10
RW 0x0 9
8
7
6
RW 0x0 5
4
3
2
1
0
SETUPWINDOW RW 0x5
RW 0x0
Reset
Access
CSSETUP
TXDELAY
Name
CSHOLD
ICS
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When CFG2.FORCELOAD is set, this defines the number of bus clock cycles that empty FIFO load or enabling of TX or
disabling of TX must be performed before the sampling edge of SCLK at word-boundary to avoid load error. Word boun-
dary is defined as followings:before the transaction starts, or between 2 transactions or the first bit between 2 datawords.
If baud-rate is more than 5 MHz, a value of 4 is recommended, any values smaller than that can be tried out but avoid
using 0. If baud-rate is less than 5 MHz, value of 5 is recommended, any values higher than 5 can be used but it may
make the load error easy to occur. The recommended values for frequency bands should be sufficient to work all the
time. Only applicable when CFG0.SYNC bit is set to 'SYNC' and CFG2.MASTER is set to 'SLAVE' and CFG2.FORCE-
LOAD is set.
15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Inter-character spacing after each TX frame while the TX FIFO is not empty. Only applicable when CFG0.SYNC bit is set
to 'SYNC' and CFG2.MASTER is set to 'MASTER'.
11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Chip Select will be de-asserted after the end of frame transmission. Only applicable when CFG0.SYNC bit is set to
'SYNC' and CFG2.MASTER is set to 'MASTER'.
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Chip Select will be asserted before the start of frame transmission. Only applicable when CFG0.SYNC bit is set to
'SYNC' and CFG2.MASTER is set to 'MASTER'.
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Configurable delay before new rtansfers. Frames sent back-to-back are not delayed. Only applicable when CFG0.SYNC
bit is set to 'ASYNC'.
0x028
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
STARTFRAME RW 0x0 4
3
2
1
0
Reset
Access
Name
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When a frame matching STARTFRAME is received, the receiver detects that and STARTF interrupt flag is set. If
SFUBRX is set, RXBLOCK is cleared and the start frame is loaded in to the RX FIFO. Only applicable when
CFG0.SYNC bit is set to 'ASYNC'.
0x02C
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
SIGFRAME RW 0x0 4
3
2
1
0
Reset
Access
Name
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When a frame matching SIGFRAME is detected by the receiver, SIGF interrupt flag is set. Only applicable when
CFG0.SYNC bit is set to 'ASYNC'.
0x030 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
DIV RW 0x0
Reset
Access
Name
31:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Specifies the fractional clock divider. Setting AUTOBAUDEN in CFG1 register will overwrite the DIV field. Only applicable
when CFG0.SYNC bit is set to 'ASYNC'.
2:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x034
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
AUTOTXTEN RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
Name
RXTEN
TXTEN
Bit Name Reset Access Description
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When set, AUTOTX is enabled as long as the selected PRS channel has a high value. Only applicable when
CFG0.SYNC bit is set to 'SYNC' and CFG2.MASTER is set to 'MASTER'.
When set, the positive edge of the selected PRS channel sets TXEN, enabling the transmitter.
When set, the positive edge of the selected PRS channel sets RXEN, enabling the receiver.
0x038 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
W(nB) 0x0 8
W(nB) 0x0 7
W(nB) 0x0 6
RXBLOCKDIS W(nB) 0x0 5
W(nB) 0x0 4
W(nB) 0x0 3
W(nB) 0x0 2
W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
RXBLOCKEN
CLEARTX
TXTRIDIS
TXTRIEN
Name
RXDIS
TXDIS
RXEN
TXEN
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to clear TX FIFO. Only applicable when CFG0.SYNC bit is set to 'ASYNC'. Note that before issuing this command,
firmware should first set the transmitter disable bit (CMD.TXDIS) and then poll the transmitter enable status bit until
cleared (STATUS.TXENS).
Tristates the transmitter output. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
Set to clear RXBLOCK, resulting in all incoming frames being loaded into the RX FIFO.
Set to disable transmission. STATUS.TXENS should be polled to ensure disabled status in Synchrounous mode.
Set to enable data transmission. STATUS.TXENS should be polled to ensure enabled status in Synchrounous mode.
Set to disable data reception. If a frame is under reception when the receiver is disabled, the incoming frame is discar-
ded. STATUS.RXENS should be polled to ensure disabled status in Synchrounous mode.
Set to activate data reception. STATUS.RXENS should be polled to ensure enabled status in Synchrounous mode.
0x03C 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
0x0
Reset
Access
RXDATA R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to access data read from the EUSART, cleared on read access. In Synchronous mode, Bit 15:0 is ac-
tual RXDATA. In Asynchronous mode, Bit 8:0 is actual RXDATA, bit 9 is PERR (set if received data has a parity error.),
bit 10 is FERR (set if received data has a framing error, can be result of a break condition). Note that FIFO is not retained
in EM2.
0x040
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
0x0
Reset
Access
Name RXDATAP R
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to access data read from the EUSART without popping the FIFO.
0x044 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
0x0
Reset
Access
TXDATA W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to write data to the EUSART. If TXEN is set, a transfer will be initiated at the first opportunity. In Syn-
chronous mode, 15:0 is TXDATA. In asynchronous mode, 8:0 is TXDATA, bit 9 is UBRXAT (Set to clear RXBLOCK after
transmission, unblocking the receiver), bit 10 is TXTRIAT (Set to tristate transmitter by setting TXTRI after tranmission),
bit 11 is TXBREAK (Set to send data as a break. Recipient will see a framing error or a break condition depending on its
configuration and the value of TXDATA), bit 12 is TXDISAT (Set to disable trasmitter and release data bus directly after
transmission), bit 13 is RXENAT (Set to enable reception after transmission). Note that FIFO is not retained in EM2
0x048 31
30
29
28
27
26
0x0 25
0x0 24
23
22
21
20
19
0x0 18
17
16
15
14
0x1 13
0x1 12
11
10
9
0x0 8
0x0 7
0x1 6
0x0 5
0x0 4
0x0 3
2
0x0 1
0x0 0
Reset
Access
R
AUTOBAUDDONE R
R
R
R
R
R
R
R
R
R
R
Name CLEARTXBUSY
RXBLOCK
TXFCNT
RXFULL
RXIDLE
TXIDLE
RXENS
TXENS
TXTRI
RXFL
TXFL
TXC
Bit Name Reset Access Description
31:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
After issuing CLEARTX command, wait on this status flag until it goes low.
Set when auto baud rate has been detected and CLKDIV has been updated with required value. If AUTOBAUDEN is not
set in CFG0 register, this bit is always read as '0'. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
23:21 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when TX idle. In Synchronous secondary mode, TX is not considered idle when transmitting Default TX data.
11:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when data is available in the RX FIFO. Depends on the RXFIW setting in the CFG1 register.
Set when there is space for data in the TX FIFO. Depends on the TXFIW setting in CFG1 register.
Set when a transmission has completed and no more data is available in the TX FIFO and shift register.
Set when the transmitter is tristated, and cleared when transmitter output is enabled. If AUTOTRI in UARTn_CFG is set,
then this bit is always read as 0. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
When set, the receiver discards incoming frames. An incoming frame will not be loaded into the RX FIFO if this bit is set
at the instant the frame has been completely received.
2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when the transmitter is enabled. In Synchronous secondary mode, default TX data will be transmitted when the
transmitter is disabled.
0x04C 31
30
29
28
27
26
RW 0x0 25
AUTOBAUDDONE RW 0x0 24
23
22
21
20
RW 0x0 19
RW 0x0 18
17
RW 0x0 16
15
14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
Name
LOADERR
STARTF
RXFULL
TXIDLE
CSWU
RXTO
MPAF
PERR
RXOF
FERR
RXUF
TXOF
TXUF
RXFL
TXFL
SIGF
CCF
TXC
Bit Name Reset Access Description
31:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when RX timeout occurs. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
Set when auto baud rate detection is complete. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when a signal frame is detected. Please note that when MPA, START, and SIGNAL are set to match the same
frame, corresponding interrupts might get triggered in arbitrary sequence due to synchronization uncertainty. Only appli-
cable when CFG0.SYNC bit is set to 'ASYNC'.
Set when a start frame is detected. Please note that when MPA, START, and SIGNAL are set to match the same frame,
corresponding interrupts might get triggered in arbitrary sequence due to synchronization uncertainty. Only applicable
when CFG0.SYNC bit is set to 'ASYNC'.
17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when the CS asserts. Only applicable when CFG0.SYNC bit is set to 'SYNC' and CFG2.MASTER is set to 'SLAVE'.
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when TX goes idle. In Synchronous mode, if TX is disabled during the middle of the transactions, TXIDLEIF won't be
triggered when the engine becomes disabled.
Set when a collision check notices an error in the transmitted data. Only applicable when CFG0.SYNC bit is set to
'ASYNC'.
Set when the empty TX FIFO is loaded less than the required TIMINGCFG.SETUPWINDOW bus clock cycles before the
first edge of the incoming SCLK. Only applicable when CFG0.SYNC bit is set to 'SYNC' and CFG2.MASTER is set to
'SLAVE' and CFG2.FORCELOAD is set.
Set when a multi-processor address frame is detected. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
Set when a frame with a framing error is received while RXBLOCK is cleared. Only applicable when CFG0.SYNC bit is
set to 'ASYNC'.
Set when a frame with a parity error is received while RXBLOCK is cleared. Only applicable when CFG0.SYNC bit is set
to 'ASYNC'.
In Sync secondary mode, Set when reading an empty TX FIFO with TX enabled. In Synchronous main Mode with AU-
TOTX enabled, set when transmitting the word that does not contain valid data.
Set when a write is done to the TX FIFO while it is full. The data already in the TX FIFO is preserved.
Set when data is complettly received in the receive shift register but the RX FIFO is full. RX FIFO is not overwirtten by
new data.
Set when data becomes available in the RX FIFO. This field depends on the RXFIW field in the CFG1 register.
Set when space becomes available in the TX FIFO. This depends on the TXFIW field in the CFG1 register.
This interrupt is set after a transmission when both the TX FIFO and shift register are empty.
0x050 31
30
29
28
27
26
RW 0x0 25
AUTOBAUDDONE RW 0x0 24
23
22
21
20
RW 0x0 19
RW 0x0 18
17
RW 0x0 16
15
14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
Name
LOADERR
STARTF
RXFULL
TXIDLE
CSWU
RXTO
MPAF
PERR
RXOF
FERR
RXUF
TXOF
TXUF
RXFL
TXFL
SIGF
CCF
TXC
Bit Name Reset Access Description
31:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x054 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
0x0 11
0x0 10
0x0 9
0x0 8
0x0 7
0x0 6
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
RXBLOCKDIS R
R
R
R
R
R
R
R
R
RXBLOCKEN
AUTOTXTEN
TXTRIDIS
TXTRIEN
Name
RXTEN
TXTEN
RXDIS
TXDIS
RXEN
TXEN
DIV
Bit Name Reset Access Description
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This bit is set when there is an ongoing synchronization of AUTOTXTEN field. Do not do another write to the same field
while this bit is set.
This bit is set when there is an ongoing synchronization of TXTRIDIS field. Do not do another write to the same field
while this bit is set. Only applicable when CFG0.SYNC bit is set to 'ASYNC'.
This bit is set when there is an ongoing synchronization of TXTRIEN field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of RXBLOCKDIS field. Do not do another write to the same field
while this bit is set.
This bit is set when there is an ongoing synchronization of RXBLOCKEN field. Do not do another write to the same field
while this bit is set.
This bit is set when there is an ongoing synchronization of TXDIS field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of TXEN field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of RXDIS field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of RXEN field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of TXTEN field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of RXTEN field. Do not do another write to the same field while
this bit is set.
This bit is set when there is an ongoing synchronization of DIV field. Do not do another write to the same field while this
bit is set.
Quick Facts
What?
0 1 2 3 4
The I2C interface allows communication on I2C-
buses with the lowest energy consumption possible.
Why?
21.1 Introduction
The I2C module provides an interface between the MCU and a serial I2C-bus. It is capable of acting as both a leader and a follower and
supports multi-leader buses. Standard-mode, fast-mode and fast-mode plus speeds are supported, allowing transmission rates all the
way from 10 kbit/s up to 1 Mbit/s. Follower arbitration and timeouts are also provided to allow implementation of an SMBus compliant
system. The interface provided to software by the I2C module allows precise control of the transmission process and highly automated
transfers. Automatic recognition of follower addresses is provided in all energy modes (except EM4).
21.2 Features
An overview of the I2C module is shown in Figure 21.1 I2C Overview on page 668.
Peripheral Bus
Pin
Ctrl
I2Cn_SCL
Receive
Controller Clock Generator
Address
Recognizer
The I2C-bus uses two wires for communication; a serial data line (SDA) and a serial clock line (SCL) as shown in Figure 21.2 I2C-Bus
Example on page 669. As a true multi-leader bus it includes collision detection and arbitration to resolve situations where multiple
leaders transmit data at the same time without data loss.
VDD
SDA
SCL
Each device on the bus is addressable by a unique address, and an I2C leader can address all the devices on the bus, including other
leaders.
Both the bus lines are open-drain. The maximum value of the pull-up resistor can be calculated as a function of the maximal rise-time tr
for the given bus speed, and the estimated bus capacitance Cb as shown in Figure 21.3 I2C Pull-up Resistor Equation on page 669.
The maximal rise times for 100 kHz, 400 kHz and 1 MHz I2C are 1 µs, 300 ns and 120 ns respectively.
Note: The GPIO slew rate control should be set for the desired slew rate..
Note: If Vdd drops below the voltage on SCL and SDA lines, the MCU could become back powered and pull the SCL and SDA lines
low.
START and STOP conditions are used to initiate and stop transactions on the I2C-bus. All transactions on the bus begin with a START
condition (S) and end with a STOP condition (P). As shown in Figure 21.4 I2C START and STOP Conditions on page 670, a START
condition is generated by pulling the SDA line low while SCL is high, and a STOP condition is generated by pulling the SDA line high
while SCL is high.
SDA
SCL
S P
START condition STOP condition
The START and STOP conditions are easily identifiable bus events as they are the only conditions on the bus where a transition is
allowed on SDA while SCL is high. During the actual data transmission, SDA is only allowed to change while SCL is low, and must be
stable while SCL is high. One bit is transferred per clock pulse on the I2C-bus as shown in Figure 21.5 I2C Bit Transfer on I2C-Bus on
page 670.
SDA
SCL
When a leader wants to initiate a transfer on the bus, it waits until the bus is idle and transmits a START condition on the bus. The
leader then transmits the address of the follower it wishes to interact with and a single R/W bit telling whether it wishes to read from the
follower (R/W bit set to 1) or write to the follower (R/W bit set to 0).
After the 7-bit address and the R/W bit, the leader releases the bus, allowing the follower to acknowledge the request. During the next
bit-period, the follower pulls SDA low (ACK) if it acknowledges the request, or keeps it high if it does not acknowledge it (NACK).
Following the address acknowledge, either the follower or leader transmits data, depending on the value of the R/W bit. After every 8
bits (one byte) transmitted on the SDA line, the transmitter releases the line to allow the receiver to transmit an ACK or a NACK. Both
the data and the address are transmitted with the most significant bit first.
The number of bytes in a bus transfer is unrestricted. The leader ends the transmission after a (N)ACK by sending a STOP condition on
the bus. After a STOP condition, any leader wishing to initiate a transfer on the bus can try to gain control of it. If the current leader
wishes to make another transfer immediately after the current, it can start a new transfer directly by transmitting a repeated START
condition (Sr) instead of a STOP followed by a START.
Examples of I2C transfers are shown in Figure 21.6 I2C Single Byte Write to Follower on page 671, Figure 21.7 I2C Double Byte
Read from Follower on page 671, and Figure 21.8 I2C Single Byte Write, then Repeated Start and Single Byte Read on page 671.
The identifiers used are:
• ADDR - Address
• DATA - Data
• S - Start bit
• Sr - Repeated start bit
• P - Stop bit
• W/R - Read(1)/Write(0)
• A - ACK
• N - NACK
S ADDR W A DATA A P
Figure 21.8. I2C Single Byte Write, then Repeated Start and Single Byte Read
21.3.1.3 Addresses
I2C supports both 7-bit and 10-bit addresses. When using 7-bit addresses, the first byte transmitted after the START-condition contains
the address of the follower that the leader wants to contact. In the 7-bit address space, several addresses are reserved. These ad-
dresses are summarized in Table 21.1 I2C Reserved I2C Addresses on page 672, and include a General Call address which can be
used to broadcast a message to all followers on the I2C-bus.
To address a follower using a 10-bit address, two bytes are required to specify the address instead of one. The seven first bits of the
first byte must then be 1111 0XX, where XX are the two most significant bits of the 10-bit address. As with 7-bit addresses, the eighth
bit of the first byte determines whether the leader wishes to read from or write to the follower. The second byte contains the eight least
significant bits of the follower address.
When a follower receives a 10-bit address, it must acknowledge both the address bytes if they match the address of the follower.
When performing a leader transmitter operation, the leader transmits the two address bytes and then the remaining data, as shown in
Figure 21.9 I2C Leader Transmitter/Follower Receiver with 10-bit Address on page 672.
When performing a leader receiver operation however, the leader first transmits the two address bytes in a leader transmitter operation,
then sends a repeated START followed by the first address byte and then receives data from the addressed follower. The follower ad-
dressed by the 10-bit address in the first two address bytes must remember that it was addressed, and respond with data if the address
transmitted after the repeated start matches its own address. An example of this (with one byte transmitted) is shown in Figure
21.10 I2C Leader Receiver/Follower Transmitter with 10-bit Address on page 672.
S ADDR (1st 7 bits) W A Addr (2nd byte) A Sr ADDR (1st 7 bits) R A DATA N P
Arbitration and clock synchronization are features aimed at allowing multi-leader buses. Arbitration occurs when two devices try to drive
the bus at the same time. If one device drives it low, while the other drives it high, the one attempting to drive it high will not be able to
do so due to the open-drain bus configuration. Both devices sample the bus, and the one that was unable to drive the bus in the desired
direction detects the collision and backs off, letting the other device continue communication on the bus undisturbed.
Clock synchronization is a means of synchronizing the clock outputs from several leaders driving the bus at once, and is a requirement
for effective arbitration.
Followers on the bus are allowed to force the clock output on the bus low in order to pause the communication on the bus and give
themselves time to process data or perform any real-time tasks they might have. This is called clock stretching.
Arbitration is supported by the I2C module for both leaders and followers. Clock synchronization and clock stretching is also supported.
To reset the internal state of the I2C module and terminate any ongoing transfers, set the CORERST bit in I2C_CTRL. After resetting,
the CORERST bit must be cleared to resume I2C operation.
Note: When enabling the I2C, the ABORT command or the Bus Idle Timeout feature must be applied prior to use even if the BUSY flag
is not set.
The I2C SDA and SCL pins are configured and enabled in the GPIO_I2Cn_ROUTEEN, GPIO_I2Cn_SCLROUTE, and
GPIO_I2Cn_SDAROUTE registers.
The I2C module must be configured to use pins on either Port A or B if wakeup on address recognition from EM2/3 is desired. All other
ports are available only in EM0/1. See GPIO chapter for more details on Port limitations.
If the I2C module is configured to use pins other than Port A or B, firmware should reset the module before entering EM2/3 by setting
the CORERST bit in I2C_CTRL. After resuming EM0/1 operation, firmware should then clear CORERST.
The I2C follower is partially asynchronous, and some precautions are necessary to always ensure a safe follower disable or follower
configuration change. These measures should be taken, if (while the follower is enabled) the user cannot guarantee that an address
match will not occur at the exact time of follower disable or follower configuration change.
Worst case consequences for an address match while disabling follower or changing configuration is that the follower may end up in an
undefined state. To reset the follower back to a known state, the EN bit in I2C_EN must be cleared. This should be done regardless of
whether the follower is going to be re-enabled or not.
The I2C peripheral clock (I2CCLK) for I2C0 is derived from the LSPCLK, and for I2C1 is derived from the PCLK.
The SCL signal generated by the I2C leader determines the maximum transmission rate on the bus. The clock is generated as a divi-
sion of the peripheral clock (I2CCLK), and is given by the following equation:
Where DIV is the clock divider value set in I2C_CLKDIV, the values of Nlow and Nhigh (and thus the ratio between the high and low
parts of the clock signal) are controlled by CLHR in the I2C_CTRL register, and Nfall and Nrise represent the number of I2CCLK cycles
required for clock synchronization.
The values of Nlow and Nhigh specify the number of prescaled clock cycles in the low and high periods of the clock signal respectively.
The worst case low and high periods of the signal are:
Clock synchronization is used to ensure that requested low and high times are met on the bus. The counters establishing high and low
time are only active once the pin logic has reached the high or low logic levels, and so the rise and fall times will impact the maximum
transmission rate on the bus. The clock logic level is sampled at a rate of fI2CCLK, and will therefore be quantized to an integer number
of I2CCLK clock cycles, as:
Nrise = CEILING(trise/tI2CCLK)
Nfall = CEILING(tfall/tI2CCLK)
Note that there is an inherent propagation delay between driving SCL and sampling the signal, so the above equations can result in N =
0 for fast rise or fall times.
For example, a system with a weak pull-up on SCL may result in long trise, requiring several Nrise synchronization cycles, and subse-
quently impact the I2C transmission rate. In the same system, tfall may be faster than the sampling delay, resulting in Nfall = 0.
21.3.6 Arbitration
Arbitration is enabled by default, but can be disabled by setting the ARBDIS bit in I2C_CTRL. When arbitration is enabled, the value on
SDA is sensed every time the I2C module attempts to change its value. If the sensed value is different than the value the I2C module
tried to output, it is interpreted as a simultaneous transmission by another device, and that the I2C module has lost arbitration.
Whenever arbitration is lost, the ARBLOST interrupt flag in I2C_IF is set, any lines held are released, and the I2C device goes idle. If an
I2C leader loses arbitration during the transmission of an address, another leader may be trying to address it. The leader therefore re-
ceives the rest of the address, and if the address matches the follower address of the leader, the leader goes into either follower trans-
mitter or follower receiver mode.
Note:
Arbitration can be lost both when operating as a leader and when operating as a follower.
21.3.7 Buffers
The I 2C transmitter has a 2-level FIFO transmit buffer and a transmit shift register as shown in Figure 21.1 I2C Overview on page 668.
A byte is loaded into the transmit buffer by writing to I2C_TXDATA or 2 bytes can be loaded simultaneously in the transmit buffer by
writing to I2C_TXDOUBLE. Figure 21.14 I2C Transmit Buffer Operation on page 675 shows the basics of the transmit buffer. When
the transmit shift register is empty and ready for new data, the byte from the transmit buffer is then loaded into the shift register. The
byte is then kept in the shift register until it is transmitted. When a byte has been transmitted, a new byte is loaded into the shift register
(if available in the transmit buffer). If the transmit buffer is empty, then the shift register also remains empty. The TXC flag in I2C_STA-
TUS and the TXC interrupt flags in I2C_IF are then set, signaling that the transmit shift register is out of data. TXC is cleared when new
data becomes available, but the TXC interrupt flag must be cleared by software.
Peripheral bus
TXDOUBLE
TX buffer element 0
Shift register
The TXBL flags in I2C_STATUS and I2C_IF are used to indicate the level of the transmit buffer. The TXBIL bit in I2C_CTRL controls
the level at which these flag bits are set:
• If TXBIL is cleared, the TXBL flags are set whenever the transmit buffer becomes empty (used when transmitting using
I2C_TXDOUBLE).
• If TXBIL is set, the TXBL flags are set whenever the transmit buffer goes from full to half-empty or empty (used when transmitting
with I2C_TXDATA).
The TXBL status flag in I2C_STATUS is cleared automatically when the condition becomes false. After the transmit FIFOs are filled,
software needs to manually clear the TXBL interrupt flag. Note that the TXBL interrupt flag is 0 by default, but immediately after soft-
ware sets I2C_EN.EN = 1, the TXBL interrupt flag will be set to indicate the transmit FIFO is empty. When the I2C module is disabled
(I2C_EN.EN= 0), software needs to manually clear the TXBL interrupt flag (or ignore it).
Additionally, the TXBUFCNT bitfield in I2C_STATUS can be read to determine the exact number of transmit buffers filled with valid
data. This is particularly useful for determining whether the transmit buffers are full. For example, if TXBUFCNT = '2', firmware can de-
termine that both transmit buffers are filled, and that any additional data written to the transmit buffer would result in an overflow condi-
tion. Note that the TXBUFCNT count does not include the TX shift register.
If an attempt is made to write more bytes to the transmit buffer than the space available, the TXOF interrupt flag in I2C_IF is set, indi-
cating the overflow. The data already in the buffer remains preserved, and no new data is written.
The transmit buffer and the transmit shift register can be cleared by setting command bit CLEARTX in I2C_CMD. This will prevent the
I2C module from transmitting the data in the buffer and the shift register, and will make them available for new data. Any byte currently
being transmitted will not be aborted. Transmission of this byte will be completed.
The I2C receiver uses a 2-level FIFO receive buffer and a receive shift register as shown in Figure 21.15 I2C Receive Buffer Operation
on page 676. When a byte has been fully received by the receive shift register, it is loaded into the receive buffer if there is room for it,
making the shift register empty to receive another byte. Otherwise, the byte waits in the shift register until space becomes available in
the buffer.
Peripheral bus
RXDOUBLE
RX buffer element 1
Shift register
When a byte becomes available in the receive buffer, the RXDATAV flags in I2C_STATUS and I2C_IF are set. When the buffer be-
comes full, the RXFULL flags in I2C_STATUS and I2C_IF are set. The RXDATAV and RXFULL flags in I2C_STATUS are automatically
cleared by hardware when their condition is no longer true. The RXDATAV and RXFULL flags in I2C_IF must be manually cleared by
software after the receive FIFO is emptied. Note that when the RXFULL flag is set, indicating the buffer is full, space is still available in
the receive shift register for one more byte.
The data can be fetched from the buffer in two ways. I2C_RXDATA gives access to the received byte (if two bytes are received then
the one received first is fetched first). I2C_RXDOUBLE makes it possible to read the two received bytes simultaneously. If an attempt is
made to read more bytes from the buffer than available, the RXUF interrupt flag in I2C_IF is set to signal the underflow, and the data
read from the buffer is undefined.
When using I2C_RXDOUBLE to pick data, AUTOACK in I2C_CTRL should be set to 1. This ensures that an ACK is automatically sent
out after the first byte is received so that the reception of the next byte can begin. In order to stop receiving data bytes, a NACK must be
sent out through the I2C_CMD register.
I2C_RXDATAP and I2C_RXDOUBLEP can be used to read data from the receive buffer without removing it from the buffer. The RXUF
interrupt flag in I2C_IF will never be set as a result of reading from I2C_RXDATAP and I2C_RXDOUBLEP, but the data read through
I2C_RXDATAP when the receive buffer is empty is still undefined.
Once a transaction is complete (STOP sent or received), the receive buffer needs to be flushed (all received data must be read) before
starting a new transaction.
A bus transaction is initiated by transmitting a START condition (S) on the bus. This is done by setting the START bit in I2C_CMD. The
command schedules a START condition, and makes the I2C module generate a start condition whenever the bus becomes free.
The I2C-bus is considered busy whenever another device on the bus transmits a START condition. Until a STOP condition is detected,
the bus is owned by the leader issuing the START condition. The bus is considered free when a STOP condition is transmitted on the
bus. After a STOP is detected, all leaders that have data to transmit send a START condition and begin transmitting data. Arbitration
ensures that collisions are avoided.
When the START condition has been transmitted, the leader must transmit a follower address (ADDR) with an R/W bit on the bus. If
this address is available in the transmit buffer, the leader transmits it immediately, but if the buffer is empty, the leader holds the I2C-bus
while waiting for software to write the address to the transmit buffer.
After the address has been transmitted, a sequence of bytes can be read from or written to the follower, depending on the value of the
R/W bit (bit 0 in the address byte). If the bit was cleared, the leader has entered a leader transmitter role, where it now transmits data to
the follower. If the bit was set, it has entered a leader receiver role, where it now should receive data from the follower. In either case,
an unlimited number of bytes can be transferred in one direction during the transmission.
At the end of the transmission, the leader either transmits a repeated START condition (Sr) if it wishes to continue with another transfer,
or transmits a STOP condition (P) if it wishes to release the bus. When operating in the leader mode, I2CCLK frequency must be higher
than 2 MHz for Standard-mode, 9 MHz for Fast-mode, and 20 MHz for Fast-mode Plus.
The leader state machine is shown in Figure 21.16 I2C Leader State Machine on page 678. A leader operation starts in the far left of
the state machine, and follows the solid lines through the state machine, ending the operation or continuing with a new operation when
arriving at the right side of the state machine.
Branches in the path through the state machine are the results of bus events and choices made by software, either directly or indirectly.
The dotted lines show where I2C-specific interrupt flags are set along the path and the full-drawn circles show places where interaction
may be required by software to let the transmission proceed.
Leader transmitter
0/1 63/67 97 D7
Waiting
Idle/busy S ADDR W A DATA A P 0
for idle
Sr 67
DF
Bus state/event
9F N
Transmitted by self N
START STOP
S P Leader receiver
condition condition
A3 B3
Sr Repeated START condition
ADDR R A DATA A P 0
A ACK N NACK
Sr 67
Follower address +
ADDR W
write (R/W bit cleared) N
Follower address + 9B
ADDR R
read (R/W bit set) N
Bus state (STATE) X Arb. lost 1
Arbitration lost
Interrupt flag set
ADDR R Arb. lost, ADDR match 75 Follower transmitter
Interaction required. Wait-
states inserted until manual
or automatic interaction has ADDR W Arb. lost, ADDR match 71 Follower receiver
been performed
Bus reset
P 0
21.3.8.2 Interactions
Whenever the I2C module is waiting for interaction from software, it holds the bus clock SCL low, freezing all bus activities, and the
BUSHOLD interrupt flag in I2C_IF is set. The action(s) required by software depends on the current state the of the I2C module. This
state can be read from the I2C_STATE register.
As an example, Table 21.3 I2C Leader Transmitter on page 681 shows the different states the I2C goes through when operating as a
Leader Transmitter, i.e., a leader that transmits data to a follower. As seen in the table, when a start condition has been transmitted, a
requirement is that there is an address and an R/W bit in the transmit buffer. If the transmit buffer is empty, then the BUSHOLD inter-
rupt flag is set, and the bus is held until data becomes available in the buffer. While waiting for the address, I2C_STATE has a value
0x67, which can be used to identify exactly what the I2C module is waiting for.
Note: The bus would never stop at state 0x67 if the address was available in the transmit buffer.
The BUSHOLD interrupt flag needs to be manually cleared by software after the appropriate action has been taken.
The different interactions used by the I2C module are listed in Table 21.2 I2C Interactions in Prioritized Order on page 679 in a priori-
tized order. If the I2C module is in such a state that multiple courses of action are possible, then the action chosen is the one that has
the highest priority. For example, after sending out a START, if an address is present in the buffer and a STOP is also pending, then
the I2C will send out the STOP since it has the higher priority.
STOP* 1 Set the STOP command bit in PSTOP is set (STOP pending)
I2C_CMD in I2C_STATUS
ABORT 2 Set the ABORT command bit in Never, the transmission is abor-
I2C_CMD ted
ADDR+W -> TXDATA 6 Write an address to the transmit Address is available in transmit
buffer with the R/W bit set buffer with R/W bit set
ADDR+R -> TXDATA 7 Write an address to the transmit Address is available in transmit
buffer with the R/W bit cleared buffer with R/W bit cleared
TXDATA/ TXDOUBLE 9 Write data to the transmit buffer Data is available in transmit buf-
fer
RXDATA/ RXDOUBLE 10 Read data from receive buffer Space is available in receive
buffer
The commands marked with a * in Table 21.2 I2C Interactions in Prioritized Order on page 679 can be issued before an interaction is
required. When such a command is issued before it can be used/consumed by the I2C module, the command is set in a pending state,
which can be read from the STATUS register. A pending START command can for instance be identified by PSTART having a high
value.
Whenever the I2C module requires an interaction, it checks the pending commands. If one or a combination of these can fulfill an inter-
action, they are consumed by the module and the transmission continues without setting the BUSHOLD interrupt flag in I2C_IF to get
an interaction from software. The pending status of a command goes low when it is consumed.
When several interactions are possible from a set of pending commands, the interaction with the highest priority, i.e., the interaction
closest to the top of Table 21.2 I2C Interactions in Prioritized Order on page 679 is applied to the bus.
Pending commands can be cleared by setting the CLEARPC command bit in I2C_CMD.
When receiving addresses and data, an ACK command in I2C_CMD is normally required after each received byte. When AUTOACK is
set in I2C_CTRL, an ACK is always pending, and the ACK-pending bit PACK in I2C_STATUS is thus always set, even after an ACK
has been consumed. This is used when data is picked using I2C_RXDOUBLE and can also be used with I2C_RXDATA in order to
reduce the amount of software interaction required during a transfer.
After a reset, the state of the I2C-bus is unknown. To avoid interrupting transfers on the I2C-bus after a reset of the I2C module or the
entire MCU, the I2C-bus is assumed to be busy when coming out of a reset, and the BUSY flag in I2C_STATUS is thus set. To be able
to carry through leader operations on the I2C-bus, the bus must be idle.
The bus goes idle when a STOP condition is detected on the bus, but on buses with little activity, the time before the I2C module de-
tects that the bus is idle can be significant. There are two ways of assuring that the I2C module gets out of the busy state.
• Use the ABORT command in I2C_CMD. When the ABORT command is issued, the I2C module is instructed that the bus is idle. The
I2C module can then initiate leader operations.
• Use the Bus Idle Timeout. When SCL has been high for a long period of time, it is very likely that the bus is idle. Set BITO in
I2C_CTRL to an appropriate timeout period and set GIBITO in I2C_CTRL. If activity has not been detected on the bus within the
timeout period, the bus is then automatically assumed idle, and leader operations can be initiated.
Note: If operating in follower mode, the above approach is not necessary.
To transmit data to a follower, the leader must operate as a leader transmitter. Table 21.3 I2C Leader Transmitter on page 681 shows
the states the I2C module goes through while acting as a leader transmitter. Every state where an interaction is required has the possi-
ble interactions listed, along with the result of the interactions. The table also shows which interrupt flags are set in the different states.
The interrupt flags enclosed in parenthesis may be set. If the BUSHOLD interrupt in I2C_IF is set, the module is waiting for an interac-
tion, and the bus is frozen. The value of I2C_STATE will be equal to the values given in the table when the BUSHOLD interrupt flag is
set, and can be used to determine which interaction is required to make the transmission continue.
The interrupt flag START in I2C_IF is set when the I2C module transmits the START.
A leader operation is started by issuing a START command by setting START in I2C_CMD. ADDR+W, i.e., the address of the follower
+ the R/W bit is then required by the I2C module. If this is not available in the transmit buffer, then the bus is held and the BUSHOLD
interrupt flag is set. The value of I2C_STATE will then be 0x67. As seen in the table, the I2C module also stops in this state if the ad-
dress is not available after a repeated start condition.
To continue, write a byte to I2C_TXDATA with the address of the follower in the 7 most significant bits and the least significant bit
cleared (ADDR+W). This address will then be transmitted, and the follower will reply with an ACK or a NACK. If no follower replies to
the address, the response will also be NACK. If the address was acknowledged, the leader now has four choices. It can send data by
placing it in I2C_TXDATA/ I2C_TXDOUBLE (the leader should check the TXBL interrupt flag before writing to the transmit buffer), this
data is then transmitted. The leader can also stop the transmission by sending a STOP, it can send a repeated start by sending
START, or it can send a STOP and then a START as soon as possible. If the leader wishes to make another transfer immediately after
the current, the preferred way is to start a new transfer directly by transmitting a repeated START instead of a STOP followed by a
START. This is so because if a STOP is sent out, then any leader wishing to initiate a transfer on the bus can try to gain control of it.
If a NACK was received, the leader has to issue a CONT command in addition to providing data in order to continue transmission. This
is not standard I2C, but is provided for flexibility. The rest of the options are similar to when an ACK was received.
If a new byte was transmitted, an ACK or NACK is received after the transmission of the byte, and the leader has the same options as
for when the address was sent.
The leader may lose arbitration at any time during transmission. In this case, the ARBLOST interrupt flag in I2C_IF is set. If the arbitra-
tion was lost during the transfer of an address, and SLAVE in I2C_CTRL is set, the leader then checks which address was transmitted.
If it was the address of the leader, then the leader goes to follower mode.
After a leader has transmitted a START and won any arbitration, it owns the bus until it transmits a STOP. After a STOP, the bus is
released, and arbitration decides which bus leader gains the bus next. The MSTOP interrupt flag in I2C_IF is set when a STOP condi-
tion is transmitted by the leader.
0x67 Start transmitted START interrupt flag ADDR+W -> ADDR+W will be sent
(BUSHOLD interrupt TXDATA
flag)
STOP STOP will be sent and bus released.
0x67 Repeated start trans- START interrupt flag ADDR+W -> ADDR+W will be sent
mitted (BUSHOLD interrupt TXDATA
flag)
STOP STOP will be sent and bus released.
0x97 ADDR+W transmitted, ACK interrupt flag TXDATA DATA will be sent
ACK received (BUSHOLD interrupt
flag) STOP STOP will be sent. Bus will be released
0x9F ADDR+W transmit- NACK (BUSHOLD in- CONT + DATA will be sent
ted,NACK received terrupt flag) TXDATA
0xD7 Data transmitted,ACK ACK interrupt flag TXDATA DATA will be sent
received (BUSHOLD interrupt
flag) STOP STOP will be sent. Bus will be released
To receive data from a follower, the leader must operate as a leader receiver, see Table 21.4 I2C Leader Receiver on page 683. This
is done by transmitting ADDR+R as the address byte instead of ADDR+W, which is transmitted to become a leader transmitter. The
address byte loaded into the data register thus has to contain the 7-bit follower address in the 7 most significant bits of the byte, and
have the least significant bit set.
When the address has been transmitted, the leader receives an ACK or a NACK. If an ACK is received, the ACK interrupt flag in I2C_IF
is set, and if space is available in the receive shift register, reception of a byte from the follower begins. If the receive buffer and shift
register is full however, the bus is held until data is read from the receive buffer or another interaction is made. Note that the STOP and
START interactions have a higher priority than the data-available interaction, so if a STOP or START command is pending, the highest
priority interaction will be performed, and data will not be received from the follower.
If a NACK was received, the CONT command in I2C_CMD has to be issued in order to continue receiving data, even if there is space
available in the receive buffer and/or shift register.
After a data byte has been received the leader must ACK or NACK the received byte. If an ACK is pending or AUTOACK in I2C_CTRL
is set, an ACK is sent automatically and reception continues if space is available in the receive buffer.
If a NACK is sent, the CONT command must be used in order to continue transmission. If an ACK or NACK is issued along with a
START or STOP or both, then the ACK/NACK is transmitted and the reception is ended. If START in I2C_CMD is set alone, a repeated
start condition is transmitted after the ACK/NACK. If STOP in I2C_CMD is set, a stop condition is sent regardless of whether START is
set. If START is set in this case, it is set as pending.
As when operating as a leader transmitter, arbitration can be lost as a leader receiver. When this happens the ARBLOST interrupt flag
in I2C_IF is set, and the leader has a possibility of being selected as a follower given the correct conditions.
0x63 START transmitted START interrupt flag ADDR+R -> ADDR+R will be sent
(BUSHOLD interrupt TXDATA
flag)
STOP STOP will be sent and bus released.
0x67 Repeated START START interrupt ADDR+R -> ADDR+R will be sent
transmitted flag(BUSHOLD inter- TXDATA
rupt flag)
STOP STOP will be sent and bus released.
0xB3 Data received RXDATA interrupt ACK + RXDA- ACK will be transmitted, reception continues
flag(BUSHOLD inter- TA
rupt flag)
NACK + NACK will be transmitted, reception continues
CONT +
RXDATA
The I2C module supports an SDA and SCL monitoring function. Note that this functionality is only supported when the I2C module is in
single leader mode, and when the follower doesn't use clock stretching. Additionally, firmware should set the ARBDIS bit in I2C_CTRL
when using the SDA/SCL monitoring to prevent the bus being released.
The SDA monitor is enabled by setting the SDAMONEN in I2C_CTRL. Once enabled, the SDA monitor will check the status of the SDA
line at the following points:
• At a Start Condition, before SDA falls
• At Stop Condition, after SDA rises
After checking, the monitor will set the SDAERR flag in I2C_IF it fails to read SDA==1. To allow the SDAERR flag to generate an IRQ,
set the SDAERR bit in I2C_IEN.
Similarly, the SCL monitor is enabled by setting the SCLMONEN in I2C_CTRL. Once enabled, the SCL monitor will check the status of
the SCL line at the following points:
• At a Start Condition, before SCL falls
• At every clock cycle, before SCL falls
• At Stop Condition, after SCL rises
After checking, the monitor will set the SCLERR flag in I2C_IF it fails to read SCL==1. To allow the SCLERR flag to generate an IRQ,
set the SCLERR bit in I2C_IEN.
The I2C_STATE register can be used to determine which state the I2C module and the I2C bus are in at a given time. The register
consists of the STATE bit-field, which shows which state the I2C module is at in any ongoing transmission, and a set of single-bits,
which reveal the transmission mode, whether the bus is busy or idle, and whether the bus is held by this I2C module waiting for a soft-
ware response.
The possible values of the STATE field are summarized in Table 21.5 I2C STATE Values on page 685. When this field is cleared, the
I2C module is not a part of any ongoing transmission. The remaining status bits in the I2C_STATE register are listed in Table 21.6 I2C
Transmission Status on page 685.
WAIT 1 Waiting for idle. Will send a start condition as soon as the bus is idle.
Bit Description
BUSY Set whenever there is activity on the bus. Whether or not this module is responsible for
the activity cannot be determined by this byte.
TRANSMITTER Set when operating as a transmitter; either a leader transmitter or a follower transmitter.
Cleared at all other times
BUSHOLD Set when the bus is held by this I2C module because an action is required by software.
NACK Only valid when bus is held and STATE is ADDRACK or DATAACK. In that case it is set
if a NACK was received. In all other cases, the bit is cleared.
Note: I2C_STATE reflects the internal state of the I2C module, and therefore only held constant as long as the bus is held, i.e., as long
as BUSHOLD in I2C_STATUS is set.
The I2C module operates in leader mode by default. To enable follower operation, i.e., to allow the device to be addressed as an I2C
follower, the SLAVE bit in I2C_CTRL must be set. In this case the I2C module operates in a mixed mode, both capable of starting trans-
missions as a leader, and being addressed as a follower. When operating in the follower mode, I2CCLK frequency must be higher than
2 MHz for Standard-mode, 5 MHz for Fast-mode, and 14 MHz for Fast-mode Plus.
The follower state machine is shown in Figure 21.17 I2C Follower State Machine on page 686. The dotted lines show where I2C-
specific interrupt flags are set. The full-drawn circles show places where interaction may be required by software to let the transmission
proceed.
Follower transmitter
0/1 75 D5
Idle/busy S ADDR R A DATA A P 0
Sr 1
DD
Bus state/event
N
Transmitted by self
N
Received from leader Arb. lost 1
The I2C module provides automatic address recognition for 7-bit addresses. 10-bit address recognition is not fully automatic, but can be
assisted by the 7-bit address comparator as shown in 21.3.12 Using 10-bit Addresses. Address recognition is supported in EM2/3 for
I2C0 - however, the I2C0 module must be configured to use pins on either Port A or B if wakeup on address recognition from EM2/3 is
desired. All other ports are available only in EM0/1. See GPIO chapter for more details.
The follower address, i.e., the address which the I2C module should be addressed with, is defined in the I2C_SADDR register. In addi-
tion to the address, a mask must be specified, telling the address comparator which bits of an incoming address to compare with the
address defined in I2C_SADDR. The mask is defined in I2C_SADDRMASK, and for every zero in the mask, the corresponding bit in the
follower address is treated as a don’t-care, i.e., the 0-masked bits are ignored.
An incoming address that fails address recognition is automatically replied to with a NACK. Since only the bits defined by the mask are
checked, a mask with a value 0x00 will result in all addresses being accepted. A mask with a value 0x7F will only match the exact
address defined in I2C_SADDR, while a mask 0x70 will match all addresses where the three most significant bits in I2C_SADDR and
the incoming address are equal.
If GCAMEN in I2C_CTRL is not set, the start-byte, i.e., the general call address with the R/W bit set is ignored unless it is included in
the defined follower address and the address mask.
When an address is accepted by the address comparator, the decision of whether to ACK or NACK the address is passed to software.
When SLAVE in I2C_CTRL is set, the RSTART interrupt flag in I2C_IF will be set when repeated START conditions are detected. After
a START or repeated START condition, the bus leader will transmit an address along with an R/W bit. If there is no room in the receive
shift register for the address, the bus will be held by the follower until room is available in the shift register. Transmission then continues
and the address is loaded into the shift register. If this address does not pass address recognition, it is automatically NACK’ed by the
follower, and the follower goes to an idle state. The address byte is in this case discarded, making the shift register ready for a new
address. It is not loaded into the receive buffer.
If the address was accepted and the R/W bit was set (R), indicating that the leader wishes to read from the follower, the follower now
goes into the follower transmitter mode. Software interaction is now required to decide whether the follower wants to acknowledge the
request or not. The accepted address byte is loaded into the receive buffer like a regular data byte. If no valid interaction is pending, the
bus is held until the follower responds with a command. The follower can reject the request with a single NACK command.
The follower will in that case go to an idle state, and wait for the next start condition. To continue the transmission, the follower must
make sure data is loaded into the transmit buffer and send an ACK. The loaded data will then be transmitted to the leader, and an ACK
or NACK will be received from the leader.
Data transmission can also continue after a NACK if a CONT command is issued along with the NACK. This is not standard I2C howev-
er.
If the leader responds with an ACK, it may expect another byte of data, and data should be made available in the transmit buffer. If data
is not available, the bus is held until data is available.
If the response is a NACK however, this is an indication of that the leader has received enough bytes and wishes to end the transmis-
sion. The follower now automatically goes idle, unless CONT in I2C_CMD is set and data is available for transmission. The latter is not
standard I2C.
The leader ends the transmission by sending a STOP or a repeated START. The SSTOP interrupt flag in I2C_IF is set when the leader
transmits a STOP condition. If the transmission is ended with a repeated START, then the SSTOP interrupt flag is not set.
Note: The SSTOP interrupt flag in I2C_IF will be set regardless of whether the follower is participating in the transmission or not, as
long as SLAVE in I2C_CTRL is set and a STOP condition is detected
If arbitration is lost at any time during transmission, the ARBLOST interrupt flag in I2C_IF is set, the bus is released and the follower
goes idle.
See Table 21.7 I2C Follower Transmitter on page 687 for more information.
0x01 Repeated START re- RSTART interrupt flag RXDATA Receive and compare address
ceived (BUSHOLD interrupt
flag)
0x75 ADDR + R received ADDR interrupt flag ACK + TXDA- ACK will be sent, then DATA
TA
RXDATA interrupt flag NACK NACK will be sent, follower goes idle
0xD5 Data transmitted, ACK ACK interrupt flag TXDATA DATA will be transmitted
received (BUSHOLD interrupt
flag)
0xDD Data transmitted, NACK NACK interrupt flag None The follower goes idle
received
(BUSHOLD interrupt CONT + DATA will be transmitted
flag) TXDATA
- Stop received SSTOP interrupt flag None The follower goes idle
- Arbitration lost ARBLOST interrupt flag None The follower goes idle
A follower receiver operation is started in the same way as a follower transmitter operation, with the exception that the address trans-
mitted by the leader has the R/W bit cleared (W), indicating that the leader wishes to write to the follower. The follower then goes into
follower receiver mode.
To receive data from the leader, the follower should respond to the address with an ACK and make sure space is available in the re-
ceive buffer. Transmission will then continue, and the follower will receive a byte from the leader.
If a NACK is sent without a CONT, the transmission is ended for the follower, and it goes idle. If the follower issues both the NACK and
CONT commands and has space available in the receive buffer, it will be open for continuing reception from the leader.
When a byte has been received from the leader, the follower must ACK or NACK the byte. The responses here are the same as for the
reception of the address byte.
The leader ends the transmission by sending a STOP or a repeated START. The SSTOP interrupt flag is set when the leader transmits
a STOP condition. If the transmission is ended with a repeated START, then the SSTOP interrupt flag in I2C_IF is not set.
Note: The SSTOP interrupt flag in I2C_IF will be set regardless of whether the follower is participating in the transmission or not, as
long as SLAVE in I2C_CTRL is set and a STOP condition is detected
If arbitration is lost at any time during transmission, the ARBLOST interrupt flag in I2C_IF is set, the bus is released and the follower
goes idle.
See Table 21.8 I2C - Follower Receiver on page 689 for more information.
0x01 Repeated START re- RSTART interrupt flag RXDATA Receive and compare address
ceived (BUSHOLD interrupt
flag)
0x71 ADDR + W received ADDR interrupt flag ACK + ACK will be sent and data will be received
RXDATA interrupt flag RXDATA
(BUSHOLD interrupt
flag) NACK NACK will be sent, follower goes idle
0xB1 Data received RXDATA interrupt flag ACK + ACK will be sent and data will be received
(BUSHOLD interrupt RXDATA
flag)
NACK NACK will be sent and follower will go idle
- Stop received SSTOP interrupt flag None The follower goes idle
- Arbitration lost ARBLOST interrupt flag None The follower goes idle
The I2C can be set up to complete transfers with a minimal amount of interaction.
21.3.11.1 DMA
DMA can be used to automatically load data into the transmit buffer and load data out from the receive buffer. When using DMA, soft-
ware is thus relieved of moving data to and from memory after each transferred byte.
When AUTOACK in I2C_CTRL is set, an ACK is sent automatically whenever an ACK interaction is possible and no higher priority
interactions are pending.
A STOP can be generated automatically on two conditions. These apply only to the leader transmitter.
If AUTOSN in I2C_CTRL is set, the I2C module ends a transmission by transmitting a STOP condition when operating as a leader
transmitter and a NACK is received.
If AUTOSE in I2C_CTRL is set, the I2C module always ends a transmission when there is no more data in the transmit buffer. If data
has been transmitted on the bus, the transmission is ended after the (N)ACK has been received by the follower. If a START is sent
when no data is available in the transmit buffer and AUTOSE is set, then the STOP condition is sent immediately following the START.
Software must thus make sure data is available in the transmit buffer before the START condition has been fully transmitted if data is to
be transferred.
When using 10-bit addresses in follower mode, set the I2C_SADDR register to 1111 0XX where XX are the two most significant bits of
the 10-bit address, and set I2C_SADDRMASK to 0xFF. Address matches will now be given on all 10-bit addresses where the two most
significant bits are correct.
When receiving an address match, the follower must acknowledge the address and receive the first data byte. This byte contains the
second part of the 10-bit address. If it matches the address of the follower, the follower should ACK the byte to continue the transmis-
sion, and if it does not match, the follower should NACK it.
When the leader is operating as a leader transmitter, the data bytes will follow after the second address byte. When the leader is oper-
ating as a leader receiver however, a repeated START condition is sent after the second address byte. The address sent after this
repeated START is equal to the first of the address bytes transmitted previously, but now with the R/W byte set, and only the follower
that found a match on the entire 10-bit address in the previous message should ACK this address. The repeated start should take the
leader into a leader receiver mode, and after the single address byte sent this time around, the follower begins transmission to the lead-
er.
Note: Some registers in the I2C module are considered static. This means that these need to be set before an I2C transaction starts
and need to stay stable during the entire transaction.
Specifically:
• The GCAMEN and SLAVE fields in the I2C_CTRL register
• The I2C_SADDR register
• The GPIO_I2Cn_ROUTEEN, GPIO_I2Cn_SCLROUTE, and GPIO_I2Cn_SDAROUTE registers
Some bus errors may require software intervention to be resolved. The I2C module provides an ABORT command, which can be set in
I2C_CMD, to help resolve bus errors.
When the bus for some reason is locked up and the I2C module is in the middle of a transmission it cannot get out of, or for some other
reason the I2C wants to abort a transmission, the ABORT command can be used.
Setting the ABORT command will make the I2C module discard any data currently being transmitted or received, release the SDA and
SCL lines and go to an idle mode. ABORT effectively makes the I2C module forget about any ongoing transfers.
A bus reset can be performed by setting the START and STOP commands in I2C_CMD while the transmit buffer is empty. A START
condition will then be transmitted, immediately followed by a STOP condition. A bus reset can also be performed by transmitting a
START command with the transmit buffer empty and AUTOSE set.
An I2C-bus error occurs when a START or STOP condition is misplaced, which happens when the value on SDA changes while SCL is
high during bit-transmission on the I2C-bus. If the I2C module is part of the current transmission when a bus error occurs, any data
currently being transmitted or received is discarded, SDA and SCL are released, the BUSERR interrupt flag in I2C_IF is set to indicate
the error, and the module automatically takes a course of action as defined in Table 21.9 I2C Bus Error Response on page 691.
In a leader/follower operation Treated as START. Receive address. Go idle. Perform any pending actions.
A lockup occurs when a leader or follower on the I2C-bus has locked the SDA or SCL at a low value, preventing other devices from
putting high values on the bus, and thus making communication on the bus impossible.
Many follower-only devices operating on an I2C-bus are not capable of driving SCL low, but in the rare case that SCL is stuck LOW, the
advice is to apply a hardware reset signal to the followers on the bus. If this does not work, cycle the power to the devices in order to
make them release SCL.
When SDA is stuck low and SCL is free, a leader should send 9 clock pulses on SCL while tristating the SDA. This procedure is per-
formed in the GPIO module after clearing the GPIO_I2Cn_ROUTEEN register and disabling the I2C module. The device that held the
bus low should release it sometime within those 9 clocks. If not, use the same approach as for when SCL is stuck, resetting and possi-
bly cycling power to the followers.
Lockup of SDA can be detected by keeping count of the number of continuous arbitration losses during address transmission. If arbitra-
tion is also lost during the transmission of a general call address, i.e., during the transmission of the STOP condition, which should
never happen during normal operation, this is a good indication of SDA lockup.
Detection of SCL lockups can be done using the timeout functionality defined in 21.3.13.6 Clock Low Timeout
When SCL has been high for a significant amount of time, this is a good indication of that the bus is idle. On an SMBus system, the bus
is only allowed to be in this state for a maximum of 50 µs before the bus is considered idle.
The bus idle timeout BITO in I2C_CTRL can be used to detect situations where the bus goes idle in the middle of a transmission. The
timeout can be configured in BITO, and when the bus has been idle for the given amount of time, the BITO interrupt flag in I2C_IF is
set. The bus can also be set idle automatically on a bus idle timeout. This is enabled by setting GIBITO in I2C_CTRL.
When the bus idle timer times out, it wraps around and continues counting as long as its condition is true. If the bus is not set idle using
GIBITO or the ABORT command in I2C_CMD, this will result in periodic timeouts.
Note: This timeout will be generated even if SDA is held low.
The bus idle timeout is active as long as the bus is busy, i.e., BUSY in I2C_STATUS is set. The timeout can be used to get the I2C
module out of the busy-state it enters when reset, see 21.3.8.4 Reset State.
The clock timeout, which can be configured in CLTO in I2C_CTRL, starts counting whenever SCL goes low, and times out if SCL does
not go high within the configured timeout. A clock low timeout results in CLTOIF in I2C_IF being set, allowing software to take action.
When the timer times out, it wraps around and continues counting as long as SCL is low. An SCL lockup will thus result in periodic
clock low timeouts as long as SCL is low.
The I2C module can continue transmission in parallel with another device for the entire transaction, as long as the two communications
are identical. A case may arise when (before an arbitration has been decided upon) the I2C module decides to send out a repeated
START or a STOP condition while the other device is still sending data. In the I2C protocol specifications, such a combination results in
an undefined condition. The I2C deals with this by generating a clock low error. This means that if the I2C is transmitting a repeated
START or a STOP condition and another device (another leader or a misbehaving follower) pulls SCL low before the I2C sends out the
START/STOP condition on SDA, a clock low error is generated. The CLERR interrupt flag is then set in the I2C_IF register, any held
lines are released and the I2C device goes to idle.
The I2C module has full DMA support. A request for the DMA controller to write to the I2C transmit buffer can come from TXBL (transmit
buffer has room for more data). The DMA controller can write to the transmit buffer using the I2C_TXDATA or the I2C_TXDOUBLE
register. DMA must be configured to transfer one byte of data when writing to the I2C_TXDATA and configured for transferring two
bytes of data when writing to the I2C_TXDOUBLE.
A request for the DMA controller to read from the I2C receive buffer can come from RXDATAV (data available in the receive buffer).
DMA must be configured to transfer one byte of data when reading from I2C_RXDATA and configured for transferring two bytes of data
when reading from I2C_RXDOUBLE.
21.3.15 Interrupts
The interrupts generated by the I2C module are combined into one interrupt vector, I2C_INT. If I2C interrupts are enabled, an interrupt
will be made if one or more of the interrupt flags in I2C_IF and their corresponding bits in I2C_IEN are set.
21.3.16 Wake-up
The I2C receive section can be active all the way down to energy mode EM3 stop, and can wake up the CPU on address interrupt. All
address match modes are supported.
0x000
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
0x0
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004
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
EN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The ENABLE bit enables the module. Software should write to CONFIG type registers before setting the ENABLE bit.
Software should write to SYNC type registers only after setting the ENABLE bit.
0x008 31
30
29
28
27
26
25
24
23
22
SDAMONEN RW 0x0 21
SCLMONEN RW 0x0 20
19
18
RW 0x0 17
16
RW 0x0 15
14
13
12
11
10
9
8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
RW 0x0
Reset
Access
CORERST
AUTOACK
GCAMEN
AUTOSN
AUTOSE
ARBDIS
Name
GIBITO
SLAVE
TXBIL
CLHR
CLTO
BITO
Bit Name Reset Access Description
31:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to enable SDA monitor feature. This will enable SDA rise check at loopback path. This monitor can not be enabled in
Multi-Leader application
Set to enable SCL monitor feature. This will enable SCL rise check at loopback path. This monitor can not be enabled in
Multi-Leader application
19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use to generate a timeout when CLK has been low for the given amount of time. Wraps around and continues counting
when the timeout is reached. The timeout value can be calculated by timeout = PCC/(Fscl x (Nlow + Nhigh))
When set, the bus automatically goes idle on a bus idle timeout, allowing new transfers to be initiated.
1 ENABLE A bus idle timeout tells the I2C module that the bus is idle, al-
lowing new transfers to be initiated.
14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use to generate a timeout when SCL has been high for a given amount time between a START and STOP condition.
When in a bus transaction, i.e. the BUSY flag is set, a timer is started whenever SCL goes high. When the timer reaches
the value defined by BITO, it sets the BITO interrupt flag. The BITO interrupt flag will then be set periodically as long as
SCL remains high. The bus idle timeout is active as long as BUSY is set. It is thus stopped automatically on a timeout if
GIBITO is set. It is also stopped a STOP condition is detected and when the ABORT command is issued. The timeout is
activated whenever the bus goes BUSY, i.e. a START condition is detected. The timeout value can be calculated by
timeout = PCC/(Fscl x (Nlow + Nhigh))
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Determines the values of (and ratio between) the low and high parts of the clock signal generated on SCL as leader.
0 EMPTY TXBL status and the TXBL interrupt flag are set when the trans-
mit buffer becomes empty. TXBL is cleared when the buffer be-
comes nonempty.
1 HALF_FULL TXBL status and the TXBL interrupt flag are set when the trans-
mit buffer goes from full to half-full or empty. TXBL is cleared
when the buffer becomes full
Set to enable address match on general call in addition to the programmed follower address.
A leader or follower will not release the bus upon losing arbitration.
0 DISABLE When a device loses arbitration, the ARBIF interrupt flag is set
and the bus is released.
1 ENABLE When a device loses arbitration, the ARBIF interrupt flag is set,
but communication proceeds.
Write to 1 to make a leader transmitter send a STOP when a NACK is received from a follower.
Write to 1 to make a leader transmitter send a STOP when no more data is available for transmission.
0 DISABLE Software must give one ACK command for each ACK transmit-
ted on the I2C bus.
1 ENABLE Addresses that are not automatically NACK'ed, and all data is
automatically acknowledged.
Set to reset the I2C_STATE register, and return the I2C module to the IDLE state. Must clear this bit to resume normal
operation condition
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
CLEARPC W(nB) 0x0 7
CLEARTX W(nB) 0x0 6
W(nB) 0x0 5
W(nB) 0x0 4
W(nB) 0x0 3
W(nB) 0x0 2
W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
ABORT
START
Name
CONT
NACK
STOP
ACK
Bit Name Reset Access Description
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set to clear transmit buffer and shift register. Will not abort ongoing transfer.
Abort the current transmission making the bus go idle. When used in combination with STOP, a STOP condition is sent
as soon as possible before aborting the transmission. The stop condition is subject to clock synchronization.
Set to send start condition as soon as possible. If a transmission is ongoing and not owned, the start condition will be
sent as soon as the bus is idle. If the current transmission is owned by this module, a repeated start condition will be
sent. Use in combination with a STOP command to automatically send a STOP, then a START when the bus becomes
idle.
0x010 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
0x0 6
5
0x0 4
0x0 3
0x0 2
0x0 1
0x1 0
Reset
Access
R
R
TRANSMITTER R
R
R
BUSHOLD
Name
NACKED
MASTER
STATE
BUSY
Bit Name Reset Access Description
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The state of any current transmission. Cleared if the I2C module is idle.
1 WAIT Waiting for idle. Will send a start condition as soon as the bus is
idle.
Set when operating as a leader transmitter or a follower transmitter. When cleared, the system may be operating as a
leader receiver, a follower receiver or the current mode is not known.
Set when operating as an I2C leader. When cleared, the system may be operating as an I2C follower.
Set when the bus is busy. Whether the I2C module is in control of the bus or not has no effect on the value of this bit.
When the MCU comes out of reset, the state of the bus is not known, and thus BUSY is set. Use the ABORT command
or a bus idle timeout to force the I2C module out of the BUSY state.
0x014 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
0x0 9
0x0 8
0x1 7
0x0 6
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
0x0
Reset
Access
TXBUFCNT R
R
R
R
R
R
R
R
R
R
R
RXDATAV
PABORT
PSTART
RXFULL
PCONT
PNACK
PSTOP
Name
PACK
TXBL
TXC
Bit Name Reset Access Description
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Indicates the number of buffers filled with valid data and not transmit to tx shift register
Set when the receive buffer is full. Cleared when the receive buffer is no longer full. When this bit is set, there is still room
for one more frame in the receive shift register.
Set when data is available in the receive buffer. Cleared when the receive buffer is empty.
Indicates the level of the transmit buffer. if TXBIL==0, set when the transmit buffer is empty. if TXBIL==1, set when the
transmit buffer is half full
Set when a transmission has completed and no more data is available in the transmit buffer. Cleared when a new trans-
mission starts.
0x018 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
DIV RW 0x0 4
3
2
1
0
Reset
Access
Name
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Specifies the clock divider for the I2C. Note that DIV must be 1 or higher when follower is enabled.
0x01C
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
ADDR RW 0x0 4
3
2
1
0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x020 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
SADDRMASK RW 0x0 4
3
2
1
0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Specifies the significant bits of the follower address. Setting the mask to 0x00 will match all addresses, while setting it to
0x7F will only match the exact address specified by ADDR.
0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x024
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
0x0
Reset
Access
RXDATA R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to read from the receive buffer. Buffer is emptied on read access.
0x028 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
0x0
0x0
Reset
Access
RXDATA1 R
RXDATA0 R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x02C
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
0x0
Reset
Access
RXDATAP R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Use this register to read from the receive buffer. Buffer is not emptied on read access.
0x030 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
0x0
0x0
Reset
Access
RXDATAP1 R
RXDATAP0 R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Second byte read from buffer. Buffer is not emptied on read access.
First byte read from buffer. Buffer is not emptied on read access.
0x034
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
TXDATA W(nB) 0x0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x038 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
TXDATA1 W(nB) 0x0
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x03C 31
30
29
28
27
26
25
24
23
22
21
RW 0x0 20
RW 0x0 19
RW 0x0 18
RW 0x0 17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
BUSHOLD RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RXDATAV RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
ARBLOST
SDAERR
BUSERR
SCLERR
RSTART
RXFULL
MSTOP
CLERR
SSTOP
START
Name
ADDR
NACK
RXUF
CLTO
TXOF
TXBL
BITO
ACK
TXC
Bit Name Reset Access Description
31:21 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when the SDA at loopback path is not equal to SDA output
Set when the SCL at loopback path is not equal to SCL output
Set when the clock is pulled low before a START or a STOP condition could be transmitted.
Set when a STOP condition has been received. Will be set regardless of the follower being involved in the transaction or
not.
Set on each clock low timeout. The timeout value can be set in CLTO bit field in the I2Cn_CTRL register.
Set on each bus idle timeout. The timeout value can be set in the BITO bit field in the I2Cn_CTRL register.
Set when data is read from the receive buffer through the I2Cn_RXDATA register while the receive buffer is empty. It is
also set when data is read through the I2Cn_RXDOUBLE while the buffer is not full.
Set when data is written to the transmit buffer while the transmit buffer is full.
Set when a bus error is detected. The bus error is resolved automatically, but the current transfer is aborted.
Set when a STOP condition has been successfully transmitted. If arbitration is lost during the transmission of the STOP
condition, then the MSTOP interrupt flag is not set.
if TXBIL==0, set when the transmit buffer is empty. if TXBIL==1, set when the transmit is half full
Set when the transmit shift register becomes empty and there is no more data in the transmit buffer.
Set when incoming address is accepted, i.e. own address or general call address is received.
0x040 31
30
29
28
27
26
25
24
23
22
21
RW 0x0 20
RW 0x0 19
RW 0x0 18
RW 0x0 17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
BUSHOLD RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RXDATAV RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
ARBLOST
SDAERR
BUSERR
SCLERR
RSTART
RXFULL
MSTOP
CLERR
SSTOP
START
Name
ADDR
NACK
RXUF
CLTO
TXOF
TXBL
BITO
ACK
TXC
Bit Name Reset Access Description
31:21 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Set when the clock is pulled low before a START or a STOP condition could be transmitted.
Set when a STOP condition has been received. Will be set regardless of the follower being involved in the transaction or
not.
Set on each clock low timeout. The timeout value can be set in CLTO bit field in the I2Cn_CTRL register.
Set on each bus idle timeout. The timeout value can be set in the BITO bit field in the I2Cn_CTRL register.
Set when data is read from the receive buffer through the I2Cn_RXDATA register while the receive buffer is empty. It is
also set when data is read through the I2Cn_RXDOUBLE while the buffer is not full.
Set when data is written to the transmit buffer while the transmit buffer is full.
Set when a bus error is detected. The bus error is resolved automatically, but the current transfer is aborted.
Set when a STOP condition has been successfully transmitted. If arbitration is lost during the transmission of the STOP
condition, then the MSTOP interrupt flag is not set.
Set when data is available in the receive buffer. Cleared automatically when the receive buffer is read.
Set when the transmit buffer becomes empty. Cleared automatically when new data is written to the transmit buffer.
Set when the transmit shift register becomes empty and there is no more data in the transmit buffer.
Set when incoming address is accepted, i.e. own address or general call address is received.
Quick Facts
What?
0 1 2 3 4
The IADC is used to convert analog voltages into a
digital representation and features high-speed, low-
power operation.
Why?
22.1 Introduction
The IADC uses an Incremental Successive Approximation Architecture, with a resolution of up to 12 bits when operating at two million
samples per second (2 Msps). The flexible incremental architecture uses oversampling to allow applications to trade speed for higher
resolution. A high-accuracy mode enables greater than 15 bits of noise-free resolution. An integrated input multiplexer can select from
external I/Os and several internal signals.
22.2 Features
• Flexible oversampled architecture allows for tradeoffs between speed and resolution.
• Normal Mode
• 1 Msps with oversampling ratio = 2
• 76.9 ksps with oversampling ratio = 32
• High Speed Mode
• 2 Msps with oversampling ratio = 2
• 153.8 ksps with oversampling ratio = 32
• High Accuracy Mode
• 10.7 ksps with oversampling ratio = 92
• 3.8 ksps with oversampling ratio = 256
• Digital post-averaging
• Internal and external conversion trigger sources
• Immediate (software triggered)
• Local IADC timer
• External TIMER module (synchronous with output / PWM generation)
• General PRS hardware signal
• Integrated prescaler for conversion clock generation
• Can be run during EM2 and EM3, waking up the system on interrupts as needed
• Selectable reference sources
• 1.21 V internal reference
• External precision reference
• Analog supply
• Support for offset and gain calibration
• Programmable input gain: 0.5x, 1x, 2x, 3x, or 4x
• Flexible output formatting
• Unipolar or 2's complement bipolar data
• Results can be saved in 12 bit, 16 bit, or 20 bit format
• Programmable left or right justification
• Optional channel ID tag
• Digital window comparison function detects when results are inside/outside a programmable window
• Two independent groups of configuration registers for setting IADC mode, clock prescaler, reference selection, oversample rate, uni-
polar/bipolar output formatting, and analog gain
• Programmable single channel conversion
• Can use either configuration group
• Triggered by any conversion trigger source
• Can be tailgated after a scan sequence
• One shot or continuous mode
• Local FIFO for immediate data storage
• Programmable watermark level to generate interrupt or initiate DMA transfer
• Supports overflow and underflow interrupt generation
• Supports window compare function
• Autonomous multi-channel scan
• Up to 16 configurable slots in scan sequence
• Each slot allows independent selection of configuration group, channel selection, and window compare enable
• Triggered by any conversion trigger source
• One shot or continuous mode
• Local FIFO for immediate data storage
• Programmable watermark level to generate interrupt or initiate DMA transfer
• Supports overflow and underflow interrupt generation
• Conversion tailgating support for predictable periodic scans
The incremental ADC module block diagram is shown in Figure 22.1 IADC Overview on page 714.
Scheduling
16x Scan Queue Entries
1x Single Queue Entry
Input Output Compare Config Group
Input Output Compare Config Group Selection Enable Selection
Selection Enable Selection
Scan Mask
Immediate Immediate
trigger
trigger
Single Queue Scan Queue
Sync. PRS Sync. PRS
Conversions Conversions
Async. PRS Queue Async. PRS
Select
SINGLEDATA SCANDATA
Bus CD (odd)
Internal
refsel
Ground
External
AVDD
Many of the IADC module's configuration registers can only be written while the module is disabled (IADC_EN_EN = 0). These are
IADC_CTRL, IADC_TIMER, IADC_CMPTHR, IADC_TRIGGER, IADC_CFGx, IADC_SCALEx, IADC_SCHEDx, and IADC_SCANx. A
typical setup sequence for the IADC module is:
1. With the IADC disabled (IADC_EN_EN = 0), program all configuration registers listed above.
2. Enable the IADC by setting EN in IADC_EN to 1.
3. Program the remaining configuration registers.
4. Enable the single or scan queue.
5. The IADC is ready for use.
22.3.2 Clocking
The IADC logic is partitioned into two clock domains: CLK_BUS (APBIF) and CLK_SRC_ADC (CORE). The APBIF domain contains the
IADC registers and FIFO read logic. The rest of the IADC is clocked mainly by CLK_SRC_ADC and ADC_CLK, both of which are de-
rived from CLK_CMU_ADC, as shown in .
CLK_CMU_ADC is the incoming clock routed to the ADC by the CMU, and may be up to 80 MHz. It is selected within the CMU module.
If the ADC is to be used synchronously with an external TIMER module, the clock should be configured to derive from the group A
clock. If configuring for operation in EM2 or EM3, a clock source available in EM2 and EM3 must be used directly, as the group A clock
multiplexer will be shut down in EM2 and EM3.
CLK_SRC_ADC is derived from CLK_CMU_ADC, and must be no faster than 40 MHz. The HSCLKRATE field in IADC_CTRL sets the
prescaler to divide CLK_CMU_ADC. If CLK_CMU_ADC is already 40 MHz or slower, HSCLKRATE can be set to 0x0 to pass the clock
through to CLK_SRC_ADC without dividing it. CLK_SRC_ADC is the clock source used for the TIMEBASE prescaler as well as the
local IADC timer.
ADC_CLK is used to drive the ADC front-end and state machine logic. Another prescaler is used to reduce CLK_SRC_ADC to a suita-
ble frequency for the ADC operating mode. Different operational modes have different restrictions on the IADC clock speed. Because
the operational mode may be different for single vs. scan conversions, or even for different conversions within a scan, each configura-
tion group has a PRESCALE bit field in the IADC_SCHEDx register.
When IADC_CFGx.ADCMODE is set to NORMAL, PRESCALE must be set to limit ADC_CLK to no faster than 10 MHz for 0.5x and 1x
analog gain settings. For analog gain of 2x, 3x, and 4x, the maximum ADC_CLK is 5 MHz, 2.5 MHz, or 2.5 MHz respectively.
When IADC_CFGx.ADCMODE is set to HIGHSPEED, everything from NORMAL mode is scaled by a factor of 2. PRESCALE must be
set to limit ADC_CLK to no faster than 20 MHz for 0.5x and 1x analog gain settings. For analog gain of 2x, 3x, and 4x, the maximum
ADC_CLK is 10 MHz, 5 MHz, or 5 MHz respectively. It is recommended to run ADC_CLK no slower than 100 kHz.
When IADC_CFGx.ADCMODE is set to HIGHACCURACY, PRESCALE must be set to limit ADC_CLK to no faster than 5 MHz, regard-
less of the analog gain setting.
These restrictions are summarized in Table 22.1 Maximum ADC_CLK Speed vs Analog Gain and ADCMODE Settings on page 716.
Table 22.1. Maximum ADC_CLK Speed vs Analog Gain and ADCMODE Settings
Note: If HSCLKRATE is configured to divide CLK_CMU_ADC by more than 1 (HSCLKRATE != 0), then PRESCALE must not be set to
divide by 1 (PRESCALE = 0). When this condition is detected, a PRESCALE value of 1 (divide by 2) will be automatically be used
instead of the programmed PRESCALE value.
The suspend mode fields IADC_CTRL_ADCCLKSUSPEND0 (for scan conversions) or IADC_CTRL_ADCCLKSUSPEND1 (for single
conversions) can be used to shut down the clock between conversions and save power. The ADC logic will wake up the clock before
starting IADC warmup and performing a conversion. If the suspend mode is set, the clock will shut down again once the conversion is
complete.
CMU IADC
IADC_CTRL.HSCLKRATE
1st prescaler
IADCCLK CLK_CMU_ADC divides clock to
40MHz or less
ADC_CLK FSM and
1st prescaler cycle timing
IADC_CTRL.TIMEBASE
warm up
2nd prescaler 2nd prescaler
timing divides clock
to meet AFE
requirement
TIMER
CLK_SRC_ADC
IADC_SCHED1.PRESCALE
IADC_SCHED0.PRESCALE
The IADC takes multiple samples of the analog signal to produce each output. The number of input samples contributing to an output
word is determined by the oversampling ratio (OSR). Higher OSR settings will improve the ADC's INL and DNL, and reduce system-
level noise, but require more time for each conversion. Different OSRs may be specified for each configuration group. It is important to
note that oversampling is an analog process which provides more input samples to the digital filter. For Normal and High-Speed modes,
the OSR is configured with the OSRHS bit field in the IADC_CFGx register. The OSR options for High-Accuracy mode are different,
and are configured with the OSRHA bit field in the IADC_CFGx register.
During a conversion, the effective front-end sampling frequency (Fsample) in Normal and High-Speed modes is equal to ADC_CLK / 4.
In High-Accuracy mode, Fsample is ADC_CLK / 5.
To save energy, the IADC can be configured to power down completely or enter a standby state between conversions, if full speed
operation is not required for the application. The required ADC warm up time from a full powered-down state is 5 us. Warmup from a
standby state requires 1 us. Warmup is automatically timed by the ADC logic when it is required, but software must configure the TIME-
BASE field in IADC_CTRL for a minimum 1 us interval. Note that the TIMEBASE counter receives CLK_SRC_ADC, and should be pro-
grammed based on that frequency. For example, if CLK_SRC_ADC is 40 MHz, TIMEBASE should be set to at least 0x27 (39) to pro-
duce the minimum 1 us interval. When transitioning from a powered-down state, the IADC will use five TIMEBASE intervals. When in
standby the IADC will use one TIMEBASE interval.
The WARMUPMODE field in the IADC_CTRL register defines whether the IADC is powered down between conversions (WARMUP-
MODE = NORMAL), in standby between conversions (WARMUPMODE = KEEPINSTANDBY), or remains powered up (WARMUP-
MODE = KEEPWARM). The resulting start-up time is shown in Figure 22.3 Start-up Timing on page 718. Note that even in WAR-
MUPMODE = KEEPWARM or KEEPINSTANDBY, the ADC will implement 5 TIMEBASE intervals of warmup on initial power up, or any
configuration change affecting PRESCALE, ADCMODE, or REFSEL. IADC_STATUS_ADCWARM reflects the current warmup status of
the IADC.
The IADC uses a pipelined architecture to perform different stages of the ADC conversion in parallel.
In Normal and High-Speed modes, the conversion time for a single sample can be determined from the OSR and the pre-scaled
ADC_CLK frequency (fADC_CLK) as:
The minimum OSR is 2, meaning that the fastest possible conversion lasts 10 ADC_CLK clock cycles.
In Normal or High Speed mode, the IADC will automatically insert 2 additional cycles in the pipeline when changing channels to a new
input. This allows for hold timing on the previous conversion and allows for time to tristate the ABUS analog buses before connecting
the next input to the analog bus. Therefore the maximum sampling rate while continuously sampling on one channel in Normal mode
(with ADC_CLK = 10 MHz) is 1 Msps, and the maximum sampling rate while switching channels is 833 ksps.
In High-Speed mode the allowed ADC_CLK speed is doubled to 20 MHz. The maximum sampling rate while continunously converting a
single channel is 2 Msps, and the maximum sampling rate while switching channels is 1.67 Msps.
Figure 22.4 Normal Mode ADC Pipeline on page 719 and Figure 22.5 High-Speed Mode ADC Pipeline on page 720 show both
single-channel and channel-switching scenarios powering up from a shutdown state with WARMUPMODE = NORMAL. The 5 us warm-
up is shown in pink, a first conversion pipeline in green, and a second conversion in orange. The blue area in the top diagram repre-
sents the extra time to tristate while changing channels.
AFE Stage 2 c1 c2
AFE Stage 2
AFE Stage 2
Digital Back End
result #1
AFE Stage 2
Digital Back End
result #1
In High-Accuracy mode, the conversion time for a single sample can be determined from the OSR and the pre-scaled ADC_CLK fre-
quency (fADC_CLK) as:
The minimum OSR is 16, meaning that the fastest possible conversion in High-Accuracy mode lasts 87 ADC_CLK clock cycles.
In High-Accuracy mode, there are no additional cycles required to change channels to a new input. Figure 22.6 High-Accuracy Mode
ADC Pipeline on page 720 shows the pipeline timing when powering up from a shutdown state with WARMUPMODE = NORMAL.
The 5 us warmup is shown in pink, a first conversion pipeline in green, and a second conversion in orange.
High accuracy mode switching channel between conversions does not require any extra cycles
warmup = 5us AFE AFE
OSRHA=16 17.5us 17.5us
result #1 result #2
The IADC has several triggering options available for both the Single queue and the Scan queue. When a conversion trigger occurs
and there are no other conversions active or pending, the request is serviced immediately. If both the single and scan queues are being
used in an application, it is possible to serve the conversion requests as needed, and specify their priority.
Conversion triggering is configured using bit fields in the IADC_TRIGGER register. The SINGLETRIGSEL and SCANTRIGSEL fields
specify the trigger source for Single and Scan conversion queues, respectively. The options for trigger source are:
• IMMEDIATE - Trigger from software. This is useful for triggering conversions on-demand from software with no specific sampling
frequency requirements, or initiating continuous conversions at full speed.
• TIMER - Use the IADC local timer to trigger conversions. This is useful for triggering conversions at precise intervals.
• PRSCLKGRP - Use a synchronous PRS channel to trigger from an external peripheral in the same clock group domain (i.e. clock
group A). This is useful for synchronizing conversions precisely with external TIMER events or PWM outputs.
Note: It is recommended to configure the PRS consumer registers prior to enabling synchronous PRS triggers to avoid false trig-
gers.
• PRSPOS - Use a positive edge of an asynchronous PRS channel to trigger conversions. The trigger source will require 1-2
CLK_SRC_ADC cycles to synchronize. This is useful for triggering conversions as needed from asynchronous peripheral sources
such as GPIO inputs, SYSRTC events, etc.
• PRSNEG - Use a negative edge of an asynchronous PRS channel to trigger conversions. This is the same as PRSPOS, but oper-
ates on negative edges of the selected input.
• LESENSE (SCAN Only) - Use signalling from the LESENSE peripheral to trigger conversions. When using this mode, only one entry
in the SCAN table (specified by the LESENSE channel) is converted per conversion request, and the SCAN queue is unavailable for
normal operation.
Both the single and scan trigger sources can be configured to generate one request per trigger, or begin continuous conversions. Set-
ting SINGLETRIGACTION to ONCE will make one conversion request each time the selected single trigger occurs, and a single ADC
output will be converted. Setting SINGLETRIGACTION to CONTINUOUS allows the single trigger to begin the first conversion, and
when a conversion completes a new one will be requested immediately without requiring a new trigger. Channel selections and configu-
ration should not be changed while SINGLETRIGACTION is set to CONTINUOUS. Doing so can produce conversion errors. The scan
queue should be used if channel or configuration switching is required.
The SCANTRIGACTION field works to request conversion scans in a similar manner. Setting SCANTRIGACTION to ONCE will make
one request each time the selected scan trigger occurs, and the IADC will perform all conversions specified in the scan once before
stopping. Setting SCANTRIGACTION to CONTINUOUS allows the scan trigger to initiate continuous scans. When a scan cycle com-
pletes, a new one will be requested immediately without requiring a new trigger.
Conversion priority can be adjusted using the SINGLETAILGATE bit. By default, SINGLETAILGATE is set to TAILGATEOFF, meaning
that conversion triggers are queued in the order they are received. Any conversion trigger for the Single queue or the Scan queue will
initiate a conversion as soon as possible. If any conversion is already in progress or pending, the new conversion will be handled after
the current operation.
Setting SINGLETAILGATE to TAILGATEON gives ultimate priority to the Scan queue. The IADC will only perform single conversions
immediately after completion of a scan. This allows systems to use the scan queue for high-priority conversions with tight timing re-
quirements, and the single queue for low-priority, on-demand conversion events. Note that this setting should only be used when scan
conversions are guaranteed to trigger. If no scan sequence is triggered, any single conversion trigger will remain pending indefinitely. It
is also important to note that if there is not enough time between scan conversions to service a single conversion, the next scan conver-
sion will be delayed.
The simplest use case for the IADC is performing one conversion on-demand from the Single queue. Figure 22.7 Immediate Single
Conversion on page 722 shows the configuration and timing of this use case. The IADC warmup mode is configured for normal (shuts
down between conversions). The single queue trigger is configured for immediate triggering of one conversion, and tailgating is turned
off. When the conversion is requested (by setting IADC_CMD_SINGLESTART), the IADC block warms up and then begins converting.
During the conversion, the CONVERTING bit in IADC_STATUS is set. When the conversion is complete, the queue is disabled, and
SINGLEQEN returns low.
Single sample
sample
SINGLEQEN
CONVERTING
positive negative
cfg port pin port pin QUEUE TRIGSEL trigger action
single 0 C 0 C 3 SCAN IMMEDIATE once
SINGLE IMMEDIATE once
singlestart
scanstopped warmup
tailgating = OFF
Periodic Scans
Another common use case is to periodically trigger the IADC to perform a multi-channel scan. Figure 22.8 Periodic Scan Example on
page 723 shows the timing of a periodic scan triggered by the IADC's local timer. The scanner is configured to sample four different
channels; two using configuration 0 and two using configuration 1. Note that a single TIMER trigger is used to initiate each scan, and all
four samples are taken for each trigger. Note also that the IADC inserts another warmup time between conversions 1 and 2, when it
switches from configuration 0 to configuration 1. The single queue is disabled and not used in this example.
Each time the timer count reaches zero, the SCAN Queue is scheduled
01 23 01 23 01 23
sample
TIMER
SCANQEN
positive negative
ID cfg port pin port pin mask
0 0 A 2 A 3 1
1 0 A 0 A 1 1 QUEUE Trigger Source trigger action
2 1 A 4 GND --- 1 SCAN INTERNAL TIMER once
3 1 C 5 GND --- 1 SINGLE INTERNAL TIMER once
scanstart
Tailgating Examples
An example using conversion tailgating is shown in Figure 22.9 Simple Conversion with Tailgating Enabled on page 724. In the ex-
ample, the Scan queue is configured to trigger a two-channel conversion periodically on the IADC local timer, while the Single queue is
configured to trigger on-demand from software. When a single conversion is requested, it waits until after the scan sequence is com-
plete, and then the single conversion is performed. The scan conversions are using configuration 0, and the single conversion is using
configuration 1, so a warmup delay is inserted between the end of the scan and the beginning of the single conversion cycle. Note that
this example provides plenty of time between IADC scan conversions for the single conversion to occur, and no scan conversions are
delayed.
TIMER
SCANQEN
SINGLEQEN
positive negative
ID cfg port pin port pin mask
QUEUE Trigger Source trigger action
0 0 A 2 A 3 1
SCAN INTERNAL TIMER once
1 0 A 0 A 1 1
SINGLE IMMEDIATE once
2 1 A 4 GND --- 0
3 1 C 5 GND --- 0
warmup, or changing between configurations
scanstart
tailgating = ON
single 1 C 0 C 3
singlestart
Another example, shown in Figure 22.10 Conversions with Tailgating Disabled on page 725, demonstrates how requests are handled
on the different conversion queues with tailgating disabled.
In this example, the scan queue is being triggered on the internal timer while the single queue is being triggered on a PRS positive
edge. Since tailgating is not enabled, the queues will be serviced on a first come first served basis. The first single queue trigger falls
between two scan queue triggers and does not interfere with scan queue timing. The second single queue trigger happens just before
the scan queue trigger. The IADC will complete this single queue conversion and delay the next scan queue conversions.
TIMER
PRS1
SCANQEN
SINGLEQEN
positive negative
ID cfg port pin port pin mask QUEUE Trigger Source trigger action
0 0 A 2 A 3 1 SCAN INTERNAL TIMER once
1 0 A 0 A 1 1 SINGLE PRSPOS once
2 1 A 4 GND --- 0
3 1 C 5 GND --- 0 warmup, or changing between configurations
scanstart
tailgating = OFF
single 1 C 0 C 3
singlestart
Continuous Conversions
An example of continuous conversions triggered from the scan queue is shown in Figure 22.11 Continuous Conversions on page
725. In this example the SCANTRIGACTION field in IADC_TRIGGER is set to CONTINUOUS, and the conversion trigger source is
software (SCANTRIGSEL = IMMEDIATE). When the scan queue is enabled with IADC_CMD_SCANSTART, the ADC warms up and
then performs repeated back-to-back scans until software disables the scan queue using IADC_CMD_SCANSTOP. While this example
shows only one channel converted continuously, it is possible to enable multiple channels for the scan sequence.
Continuous
sample
SCANQEN
positive negative
ID cfg port pin port pin mask
QUEUE Trigger Source trigger action
0 0 A 2 A 3 1
SCAN IMMEDIATE continuous
1 0 A 0 A 1 0
SINGLE IMMEDIATE once
2 0 A 4 GND --- 0
3 0 C 5 GND --- 0
warmup
scanstart
tailgating = OFF
single 0 C 0 C 3
singlestop
The default IADC reference is to use the internal band gap circuit. The analog power supply voltage can also be used as a voltage
reference. The reference voltage is selected using the REFSEL field in IADC_CFGx.
VREF External 1.0V - AVDD (1.25V Nominal) 1.0V - 1.25V (1.25V Nominal)
VREF2P5 External 1.0V - AVDD (1.25V Nominal) 1.0V - 2.5V1 (2.5V Nominal)
Note:
1. In high-accuracy mode with VREF2P5 selected, the AVDD supply must be at least 3V.
The IADC also has analog gain selection, controlled via the ANALOGGAIN field in IADC_CFGx. The analog gain can be set to 0.5x, 1x,
2x, 3x, or 4x. Note that 2x, 3x, and 4x gain modes may require slower ADC_CLK. The analog gain impacts where the full-scale input
reading occurs. For example, with a 1.25 V external reference and ANALOGGAIN set to 2x, the analog input to the IADC is multiplied
by a factor of 2, and a full-scale reading occurs at 1.25 V / 2 = 0.625 V. If ANALOGGAIN is set to 0.5x, the full-scale reading of the ADC
will not occur until the input reaches 2.5 V. Note that the ADC is only capable of measuring inputs within the supply rails of the device. If
the full scale is configured to be greater than the supply voltage, the maximum input will be limited to the supply.
The sampling capacitance (Csample) is changed according to the analog gain setting.
0.5x 1 pF
1x 2 pF
2x 4 pF
3x 6 pF
4x 8 pF
Given the sampling capacitance and the front-end sampling rate (Fsample), the input impedance of the converter can be calculated as:
Note that the input is not sampled when the converter is inactive between conversions and operating with WARMUPMODE = NORMAL
or KEEPINSTANDBY with longer intervals between conversion triggers can increase the effective input impedance of the converter.
The IADC supports measurement on a number of internal and external signals. External signals are routed to GPIO through shared
ABUS resources on the device, or (on some devices) through dedicated analog inputs available to the IADC block.
The single queue and the scan queue have separate registers available to select inputs and configurations. The IADC_SINGLE register
is used to select the input and configuration for the single queue. The IADC_SCANx registers are used to select the inputs and configu-
rations for each of the scan table entries. In both cases, the register contents and setup are similar. The PORTPOS and PINPOS fields
are used to select a signal for the positive ADC input, while PORTNEG and PINNEG are used to select a signal for the negative ADC
input. The CFG field selects which of the two configuration sets will be used with the input (i.e. configuration options specified in
IADC_CFGx, IADC_SCALEx, and IADC_SCHEDx).
To perform single-ended conversions, the PORTNEG field should be set to GND. This indicates that the positive ADC input will be
measured with reference to chip ground. PORTPOS and PINPOS should be used to select the desired input signal. The PINNEG field
is not used for single-ended conversions.
To perform differential conversions, PORTPOS, PINPOS are used to select the positive input to the ADC, while PORTNEG and PIN-
NEG are used to select the negative input. Note that there are two independent multiplexers in the ADC, and firmware cannot select
two signals from the same multiplexer for a differential measurement. The "even" multiplexer consists of all EVEN ABUS selections,
Supply voltage options, and GND. The "odd" multiplexer consists of all ODD ABUS selections and GND. One selection from each multi-
plexer is allowed on the positive and negative input. More detailed examples may be found in 22.3.5.3 ABUS Input Selection Examples.
The scan queue has one additional register, IADC_MASKREQ, to specify which of the 16 possible channel slots will be converted dur-
ing a scan operation. Each channel in the scan queue is enabled by writing the corresponding bit in the IADC_MASKREQ register to 1.
Enabled channels will be converted in sequence from lowest to highest, during a scan. See 22.3.5.4 Scan Queue for more details on
using the scan queue.
GPIO input selections are routed through shared ABUS resources. In order for the IADC to use any GPIO as an input, the IADC must
be allocated appropriate analog bus resources in the GPIO_ABUSALLOC, GPIO_BBUSALLOC, or GPIO_CDBUSALLOC registers. For
example, if IADC0 will be using both odd and even numbered pins on GPIO port PA, then AEVEN0 and AODD0 in GPIO_ABUSALLOC
could both be set to IADC0. This gives IADC0 access to these two buses. Generally, bus access is set to specific peripherals at config-
uration time and left alone - it is not normally required to change the bus allocation on the fly. If the IADC requests a pin from a bus that
has not been allocated to the IADC, an error will be generated, the PORTALLOCERRIF in IADC_IF will be set, and any conversion
result will be 0. For more details on analog bus structure and capabilities, refer to the GPIO section.
When the appropriate analog buses have been configured to route to the IADC, GPIO selection is a simple matter of programming the
desired port and pin into the PORTPOS, PINPOS, PORTNEG, and PINNEG fields. For example, to configure a channel to convert the
differential voltage between pins PA5 and PA4, PORTPOS = PORTA, PINPOS = 5, PORTNEG = PORTA, PINNEG = 4. If an invalid
selection is made, a polarity error will be generated. More specific examples are described in 22.3.5.3 ABUS Input Selection Examples.
Internal signals and dedicated inputs are not routed through the shared ABUS resources. In general, these resources are selected di-
rectly by the settings of PORTPOS and PORTNEG, while the PINPOS and PINNEG fields are not used. When PORTPOS is set to
SUPPLY, PINPOS is used to select which of the power supplies is connected. To facilitate power supply measurements using internal
reference options, higher voltage supplies are attenuated by a factor of 4.
0 AVDD AVDD / 4
1 IOVDD IOVDD / 4
2 VSS VSS
3 VSS VSS
4 DVDD DVDD / 4
7 DECOUPLE DECOUPLE
If an internal signal is selected for PORTPOS or PORTNEG, selecting GND on the opposite input will instruct the converter to perform a
single-ended conversion. In the case where PORTPOS = GND, the IADC logic will automatically swap the direct input selected by
PORTNEG to the positive input of the ADC. Otherwise, a differential conversion is performed with PORTPOS selecting the positive and
PORTNEG selecting the negative input.
When configuring to measure a single-ended signal through the ABUS, the positive input selection should always point to the desired
input, and PORTNEG should be programmed to GND.
Correct configuration examples for single-ended conversions are shown in Figure 22.12 Single-Ended Port/Pin Selection Odd Channel
on page 729 and Figure 22.13 Single-Ended Port/Pin Selection Even Channel on page 729. Note that the IADC logic will automati-
cally swap the appropriate multiplexer to the positive input of the ADC.
Single Ended
PC5 PC3 PA6 PA2 ADC
GPIOCTRL:
CD_ODD1 to ADC Positive Negative
port pin port pin
C 5 GND ---
A_EVEN0
A_EVEN1 even
VINT=GND +
ADC
CD_ODD0 -
odd
CD_ODD1
Single Ended
PC5 PC3 PA6 PA2 GPIOCTRL: ADC
A_EVEN0 to ADC Positive Negative
port pin port pin
A 6 GND ---
A_EVEN0
A_EVEN1 even
+
ADC
C_ODD0 -
odd
C_ODD1
VINT=GND
Figure 22.14 Single-Ended Port/Pin Selection Polarity Error on page 730 shows an example where the PORTPOS input has been
configured to GND, with PORTNEG and PINNEG configured for a GPIO pin. This will result in a polarity error (POLARITYERRIF in
IADC_IF will be set) and any conversion result will be 0.
VINT=GND +
ADC
CD_ODD0 -
odd Result = 0
CD_ODD1
POLARITYERROR
Single Ended is only
allowed on positive side
Correct configuration examples for differential conversions are shown in Figure 22.15 Differential Port/Pin Selection without Swap on
page 730 and Figure 22.16 Differential Port/Pin Selection with Swap on page 731. In both these examples, the inputs were selec-
ted from one EVEN multiplexer channel and one ODD multiplexer channel. As with single-ended mode, the IADC logic will automatical-
ly swap the multiplexer connections to the IADC input if needed.
Differential
PC5 PC3 PA6 PA2 GPIOCTRL: ADC
A_EVEN0 to ADC Positive Negative
CD_ODD1 to ADC port pin port pin
A 2 C 5
A_EVEN0
A_EVEN1 even
+
ADC
CD_ODD0 -
odd
CD_ODD1
Differential
PC5 PC3 PA6 PA2 GPIOCTRL: ADC
A_EVEN0 to ADC Positive Negative
CD_ODD0 to ADC port pin port pin
C 3 A 6
A0_EVEN
A1_EVEN even
+
ADC
C0_ODD -
odd
C1_ODD
Figure 22.17 Differential Port/Pin Selection Polarity Error on page 731 shows an example where the both the positive and the nega-
tive input selections point to ODD buses. Even though the IADC has been allocated both buses, they both route through the ODD input
multiplexer and cannot be measured against one another. This will result in a polarity error (POLARITYERRIF in IADC_IF will be set)
and any conversion result will be 0x7FFFF. Likewise, a polarity error will occur if both inputs are selected from EVEN buses.
+
ADC
CD_ODD0 -
odd Result = 0
CD_ODD1
POLARITYERROR
Differential must have both
even and odd inputs
The scan queue allows the IADC to automatically convert up to 16 channels in sequence without CPU intervention. Input and configura-
tion selection for each channel in the scan table is specified by the IADC_SCANx register for that channel (channel 0 is configured with
IADC_SCAN0, channel 1 is configured with IADC_SCAN1, and so on). The IADC_MASKREQ register allows software to define which
of the scan table entries (IADC_SCANx) to convert during a scan. For example, channels 0, 1, and 7 can be enabled by writing bits 0,
1, and 7 of IADC_MASKREQ to 1 (IADC_MASKREQ = 0x0083).
The IADC_SCANx registers must be configured when the IADC module is disabled (IADC_EN_EN = 0). IADC_MASKREQ can be writ-
ten while IADC_EN_EN is set to 1. If a scan operation is in progress, MASKREQ will be synchronized and held until the current scan
operation has completed. Then MASKREQ is copied into the STMASK register for the next scan operation. IADC_STMASK is the work-
ing copy of the MASKREQ used by the IADC during a scan. MASKREQ will only transfer to STMASK when the scan queue is not
scanning and converting the scan table. IADC_STATUS_MASKWRITEPENDING can be used by software to see when the MASKREQ
write has been transferred to STMASK. Writing a new MASKREQ in the middle of a scan will not corrupt the current scan. Software
which writes to MASKREQ during a scan operation must ensure IADC_STATUS_MASKWRITEPENDING returns to 0 before updating
IADC_MASKREQ again. Figure 22.18 MASKREQ Updates on page 732 shows a time line of when the MASKREQ write is updated.
scan_trigger
1 0 1 0
MASKREQWRITEPENDING
The IADC has built in gain and offset correction capabilities. Each of the two configuration groups contains its own correction values
stored in the IADC_SCALEx register, allowing the IADC to automatically apply the appropriate correction for the IADC configuration that
is being used.
Gain correction is performed through a fixed-point 16-bit value with a range from 0.75x to 1.2499x. The 3 MSBs of the gain value are
not directly writeable. The GAIN3MSB bit in IADC_SCALEx is used to select between 011 and 100 for the 3 MSBs, and the lower 13
bits are programmed directly into IADC_SCALEx_GAIN13LSB. Clearing GAIN3MSB to 0 selects the most significant bits of the gain as
011, representing a range from 0.75x to 0.9999x. Setting GAIN3MSB to 1 selects the most significant bits of the gain as 100, represent-
ing a range from 1.00x to 1.2499x.
Offset correction is controlled by the OFFSET field in IADC_SCALEx. It is important to note that the offset correction does not have a
direct 1-to-1 relationship with the LSB of the IADC output, and depends on both the OSR and gain correction settings. The offset cor-
rection range is +/- 12.5% of full scale. OFFSET is encoded as a 2's complement, 18-bit number with the LSB representing 1 / 220 of full
scale. Thus, bit 8 of OFFSET aligns with bit 0 of the 12-bit IADC output word.
IADC calibration is performed on every device during Silicon Labs production test and production calibration parameters are stored in
the flash DI page. The production calibration values are useful for a wide variety of possible IADC configurations, but do not map direct-
ly to the offset and gain correction fields in the IADC_SCALEx registers. Software must calculate the actual offset and gain correction
values from the factory calibration values.
Gain error is measured during production test at various settings of ANALOGGAIN, and stored in the DEVINFO_IADC0GAIN0 and DE-
VINFO_IADC0GAIN1 locations. The GAINCANA1 field is used for 0.5x and 1x ANALOGGAIN settings, while GAINCANA2, GAINCA-
NA3, and GANCANA4 are used for ANALOGGAIN settings of 2x, 3x, and 4x, respectively.
The GAINCANAn values are expressed as the full 16-bit fixed-point gain, and must be compressed before writing to the IADC_SCALEx
register.
When the IADC is operated in Normal / High Speed mode, a 1st order filter is employed in the decimation. The nominal gain value in
these modes for all OSRHS settings is 1.0, or 0x8000 as expressed in the fixed-point 16-bit format. The IADC gain error is designed to
be minimal with the digital gain correction set to 1.0 (GAIN3MSB = 1 and GAIN13LSB = 0). Tighter gain error is achieved by adjusting
these values in IADC_SCALEx. Using this gain correction mechanism will result in a slight increase to the DNL of the converter, which
is reduced by higher OSR settings.
When the IADC is operated in High Accuracy mode, a 2nd order filter is employed in the decimation. The nominal gain value of the filter
is dependent on the OSRHA setting. The gain value stored in DEVINFO space must be adjusted before applying to the IADC_SCALEx
register.
1. Read the appropriate GAINCANAn field from the DEVINFO locations for the selected ANALOGGAIN.
2. Multiply the value by the OSR gain correction factor (ha_gain) found in Table 22.5 Ideal High Accuracy Gain Correction on page
733.
3. Write the MSB (bit 15) of the result to GAIN3MSB in IADC_SCALEx.
4. Write the 13 LSBs (bits 12-0) of the result to GAIN13LSB in IADC_SCALEx.
HIACC16 16 x 0x7879
HIACC32 32 x 0x7C1F
HIACC64 64 x 0x7E08
HIACC92 92 x 0x7A8E
Offset is impacted by the selected ANALOGGAIN and OSR settings in IADC_CFGx, the GAIN3MSB and GAIN13LSB values in
IADC_SCALEx, and the voltage reference. Offset is production calibrated for any combination of possibilities, but the OFFSET register
value must be calculated for the given situation before it can be effectively used.
The production offset calibration consists of four 16-bit terms written to the DEVINFO space: OFFSETANA1NORM, OFFSETA-
NA2NORM, OFFSETANA3NORM, and OFFSETANABASE. The following procedures will determine the setting for the OFFSET regis-
ter based on production calibration values.
Step 1: Determine the offset gain adjustment term (off_gain) based on ANALOGGAIN.
off_gain = 0
ANALOGGAIN Setting Analog front-end gain Offset Gain Adjustment Term (off_gain)
ANAGAIN0P5 0.5 x 0
ANAGAIN1 1x 0
ANAGAIN2 2x OFFSETANA2NORM * 1
ANAGAIN3 3x OFFSETANA2NORM * 2
ANAGAIN4 4x OFFSETANA2NORM * 3
Step 2: Calculate the analog offset adjustment term (off_ana) based on OSR and off_gain.
The off_ana term represents the offset at the input of the ADC, meaning that the reference voltage will have an impact on the magni-
tude of the offset at the output. Production calibration values are determined with a 1.25 V reference source. If a voltage significantly
different than 1.25 V is used for VREF, adjust the off_ana term by a factor of 1.25 / VREF.
Step 4: Calculate total offset by adding the analog offset to the systematic offset.
Systematic offset is a fixed number dependent on OSR, and calculated according to the following equation:
off_sys = 640*(256/OSR)
Before writing the OFFSET field, the total uncorrected offset must be multiplied by the gain calibration factor. If the gain calibration fac-
tor is equal to 1.0 (0x8000 in 16-bit hex, or GAIN3MSB = 1 and GAIN13LSB = 0), this step may be skipped. Otherwise, adjust off_tot
according to the following equation:
The OFFSET field holds an 18-bit 2's complement number, which should be the negation of the total offset, or -(off_tot). Before writing
to the SCALE register, any leading sign bits should be masked off to avoid corrupting the programmed gain settings.
Offset correction for High Speed mode is identical to the procedure for Normal mode, with the exception of the calibration terms used in
the DEVINFO space. The same OFFSETANABASE term is used, but OFFSETANA1HISPD, OFFSETANA2HISPD and OFFSETA-
NA3HISPD are used instead of the OFFSETANAxNORM values. Refer to 22.3.6.1.2.1 Offset Correction in Normal Mode for the proce-
dure, replacing OFFSETANAxNORM with OFFSETANAxHISPD.
The production offset calibration for High Accuracy mode uses two 16-bit terms written to the DEVINFO space: OFFSETANA1HIACC
and OFFSETANABASE. The following procedure will determine the setting for the OFFSET register based on production calibration
values.
Step 1: Calculate the analog offset adjustment term (off_ana) based on the OSR setting (OSRHA in IADC_CFGn).
The off_ana term represents the offset at the input of the ADC, meaning that the reference voltage will have an impact on the magni-
tude of the offset at the output. Production calibration values are determined with a 1.25 V reference source. If a voltage significantly
different than 1.25 V is used for VREF, adjust the off_ana term by a factor of 1.25 / VREF.
Step 3: Calculate total offset by adding the analog offset to the systematic offset.
Systematic offset is a fixed number dependent on OSR, and calculated according to the following equation:
Before writing the OFFSET field, the total uncorrected offset must be multiplied by the gain calibration factor according to the following
equation:
The OFFSET field holds an 18-bit 2's complement number, which should be the negation of the total offset, or -(off_tot). Before writing
to the SCALE register, any leading sign bits should be masked off to avoid corrupting the programmed gain settings.
22.3.6.2 Calibration
Calibration can be performed in-system to correct for external errors and provide more accurate measurements. The general calibration
procedure is as follows:
1. Configure the ADC to the desired mode, OSR, analog gain settings, reference source, etc.
2. Force the IADC to use bipolar output for the conversion: IADC_CFGx_TWOSCOMPL = FORCEBIPOLAR.
3. Set the initial offset to the maximum negative value (IADC_SCALEx_OFFSET = 0x20000), and the initial gain to 1.0 (GAIN3MSB =
1, GAIN13LSB = 0x0000). This will prevent output saturation when measuring full scale.
4. Apply a full-scale positive input to the IADC and perform a conversion (result_fullscale). Multiple conversions can be performed and
averaged together to reduce any system-level noise.
5. Apply a zero input to the IADC and perform a conversion (result_zero). Multiple conversions can be performed and averaged to-
gether to reduce any system-level noise.
6. Calculate the gain correction factor: Divide the expected value by the difference in the measured values (result_fullscale - re-
sult_zero). Note that the offset adjustment in Step 3 will be canceled out by this calculation.
7. Write the gain correction factor to the IADC using the GAIN3MSB and GAIN13LSB fields in IADC_SCALEx.
8. Set IADC_SCALEx_OFFSET to 0x00000 in preparation for the offset calibration.
9. Apply the desired zero voltage to the IADC input and perform a conversion (result_offset). Multiple conversions can be performed
and averaged together to reduce any system-level noise.
10. Multiply result_offset to convert to a 20-bit value (result_offset_20). For example, a 12-bit result should be multiplied by 256.
11. Negate result_offset_20 and write the value to IADC_SCALEx_OFFSET.
Note that the IADC_SCALEx_OFFSET field is 18 bits. If the result is greater than (217 - 1) or less than (-217), the offset is too large
to be corrected.
The single and scan queues each have a eight-word data FIFO. Conversions results are written to the output data FIFO associated with
the queue. Single queue results are written to the single FIFO and scan queue results are written to the scan data FIFO. The two
queues are identical in operation, but independent.
Conversion results are read from the single FIFO using IADC_SINGLEFIFODATA. Reading SINGLEFIFODATA will pop the oldest re-
sult from the FIFO. It is also possible to read the most recent valid data word using IADC_SINGLEDATA. Reading SINGLEDATA does
not pop a conversion from the FIFO. Similarly, the scan FIFO results are read with IADC_SCANFIFODATA, which reads the oldest
result and pops the FIFO. The most recent scan result can be read using IADC_SCANDATA.
When the single FIFO has valid data, the SINGLEFIFODV flag in IADC_STATUS is set to 1. When the scan FIFO has valid data
SCANFIFODV in IADC_STATUS is set to 1. These data valid status bits are cleared automatically whenever the associated FIFO is
empty. For more granular FIFO status, the number of data words present in the FIFO is indicated in IADC_SINGLEFIFOSTAT (for sin-
gle FIFO) or IADC_SCANFIFOSTAT (for scan FIFO).
A programmable data level watermark is also available for the FIFOs, allowing hardware to trigger interrupts or DMA operations when a
specified number of conversion results are available. The DVL field in register SINGLEFIFOCFG or SCANFIFOCFG sets the watermark
level, between 1 and 4 conversions. If the number of valid entries in the FIFO reaches or exceeds the level set in DVL, the SINGLEFI-
FODVLIF (for single FIFO) or SCANFIFODVLIF (for scan FIFO) flag in the IADC_IF register will be set to 1. If enabled, an interrupt or
DMA request will be triggered when the flag is set.
By default, DMA requests are turned off for operation in EM2 or EM3. However, the DMAWUFIFOSINGLE or DMAWUFIFOSCAN bits
in SINGLEFIFOCFG or SCANFIFOCFG may be used to enable DMA operations in these lower energy modes.
Overflow and underflow status flags are also available in IADC_IF. An overflow condition occurs when an IADC conversion completes,
but the associated FIFO is already full. In an overflow case the SINGLEFIFOOFIF or SCANFIFOOFIF flag will be set. The most recent
conversion will still be available in the SINGLEDATA or SCANDATA register, but the FIFO will not be updated with the new data. An
underflow condition occurs when software or hardware attempts to read from an empty FIFO. In an underflow case the SINGLEFIFOU-
FIF or SCANFIFOUFIF flag will be set.
The IADC has data alignment options and the ability to include a channel ID along with the conversion data. For the single queue,
alignment and channel ID are configured in the IADC_SINGLEFIFOCFG register. For the scan queue, alignment and channel ID are
configured in the IADC_SCANFIFOCFG register.
The ALIGNMENT bit field specifies the data justification and the number of data bits as shown in Figure 22.19 Data Alignment on page
738. By default, the converter will produce 12-bit right-justified data, corresponding to ALIGNMENT = RIGHT12.
sign extend
RIGHT12 S.............S DATA[11:0]
The SHOWID bit controls whether the conversion channel ID is included in the output data word. This option is primarily used with the
scan FIFO to help software determine which channel each conversion result came from. If SHOWID is enabled for single conversions,
the ID will always be set to 0x20. Figure 22.20 Data Alignment With ID on page 738 shows output data formatting including the ID,
when SHOWID = 1.
The output polarity of the IADC is controlled by the TWOSCOMPL field in the IADC_CFGx register. The IADC supports unipolar and
bipolar output formatting independent of the input configuration. By default, the TWOSCOMPL field is set to AUTO, meaning that sin-
gle-ended conversions will produce unipolar output, and differential conversions will produce bipolar output. The polarity can be forced
to unipolar or bipolar mode by setting TWOSCOMPL to FORCEUNIPOLAR or FORCEBIPOLAR, respectively.
Unipolar samples are unsigned integers representing zero to positive full-scale. Bipolar samples are two's-complement signed integers,
representing negative full-scale to positive full-scale. Using unipolar mode on a differential input signal allows for more dynamic range
when the signal is positive, but will saturate to zero when the signal is negative.
Note: If bipolar output is used with a single-ended input configuration, it is possible to see negative output values when the input is
close to ground. However, the input voltage is still limited by the supply range of the device.
The IADC may optionally accumulate and average several conversion results before posting an output word to the FIFO. Digital averag-
ing is controlled by the DIGAVG field in the IADC_CFGx register. It can be configured to average 1, 2, 4, 8, or 16 samples. The IADC
will collect the number of samples specified by DIGAVG on the selected channel slot back-to-back, and produce only one averaged
output word.
The usable output resolution of the IADC is a minimum of 12 bits, when the oversampling ratio is set to 2 and no digital averaging is
used (DIGAVG = AVG1). An extra bit of output resolution is produced for every power of 2 increase in either of these settings. In other
words, the output resolution of the ADC can be determined as:
The MSB is always left-aligned within the DATA field, and the output word will be truncated to 12, 16, or 20 bits, as shown in Figure
22.19 Data Alignment on page 738 and Figure 22.20 Data Alignment With ID on page 738. When using 16 or 20 bit alignment with
lower oversampling ratio and digital averaging settings, LSBs of the output can contain residual effects of the offset and gain computa-
tion. These residual effects do not represent additional information about the input signal. Any extra LSBs can be masked to 0 by soft-
ware.
Alignment Setting Oversampling Ra- Digital Averaging Number of aver- Output Resolution Recommended
tio aged samples Mask for DATA
field
Each FIFO has a command bit in the IADC_CMD register that can be used to trigger a FIFO flush. The FIFO data may be flushed
independently for each queue. To flush a FIFO:
1. The IADC must be enabled with the clock running.
2. Disable the queue associated with the FIFO using the SCANSTOP or SINGLESTOP bits in the IADC_CMD register.
3. Ensure the queue is disabled by reading the associated flag in the IADC_STATUS register (SINGLEQEN or SCANQEN).
4. Set the command bit to flush the desired FIFO (SINGLEFIFOFLUSH or SCANFIFOFLUSH) in the IADC_CMD register.
5. Wait for the corresponding status bit (SINGLEFIFOFLUSHING or SCANFIFOFLUSHING) in IADC_STATUS to go low.
The IADC has a window comparison unit that can trigger interrupts conditional on the output data of the converter. The window compar-
ison unit has two thresholds - greater than or equal (ADGT), and less than or equal (ADLT), which are programmable through the
IADC_CMPTHR register. The ADGT and ADLT thresholds always use a 16 bit, left-justified format, regardless of the format specified
by the FIFO. The 12-bit conversion result will be compared against the upper 12 bits of the window comparator.
The window comparison unit is active on the ADC output on a conversion-by-conversion basis, and is shared between the two FIFOs. It
is not possible to set different window comparison thresholds for different channels or for each FIFO. However, each channel specified
in the IADC has a CMP bit field to enable the window comparison on results from that channel. For example, it is possible to only apply
the window comparison and associated interrupt to scan channel #3 by setting the CMP field in IADC_SCAN3 to 1. When the CMP field
associated with a channel is 0, the window comparator will not be active for results from that channel.
The window comparator supports conditional triggering on output results which are inside or outside a specified window. When ADLT is
greater than or equal to ADGT, the comparator will trigger on an "inside" condition, or when DATA <= ADLT and DATA >= GT. When
ADLT is less than ADGT, the comparator will trigger on an "outside" condition, or when DATA <= ADLT or DATA >= GT.
Figure 22.21 Window Comparison Examples on page 740 shows different configurations of the ADLT and ADGT values and the
resulting windows. When the window comparator detects that the appropriate conditions are met (shown by the shaded region in the
figure), it will generate an interrupt via the SINGLECMPIF flag for conversions on the single queue, or via the SCANCMPIF flag for
conversions on the scan queue.
22.3.9 Interrupts
Interrupts are enabled in the IADC_IEN register, allowing interrupts to be generated on several different IADC conditions. Each of the
flags in IADC_IF has a corresponding enable bit in the IADC_IEN register. A brief overview of the available interrupt sources is shown
in the list below; more details can be found in the relevant sections of this chapter.
• SINGLEFIFODVLIF - The single FIFO watermark specified in SINGLEFIFOCFG_DVL has been reached or exceeded.
• SCANFIFODVLIF - The scan FIFO watermark specified in SCANFIFOCFG_DVL has been reached or exceeded.
• SINGLECMPIF - A conversion result from the single queue tripped the window comparator.
• SCANCMPIF - A conversion result from the scan queue tripped the window comparator.
• SCANENTRYDONEIF - A scan queue conversion has completed.
• SCANTABLEDONEIF - A scan queue operation has completed (all channels specified in the scan mask have been converted once).
• POLARITYERRIF - A channel polarity selection error has occurred (two channels from the EVEN multiplexer or two channels from
the ODD multiplexer were selected for positive and negative inputs).
• PORTALLOCERRIF - A port allocation error has occurred (a pin not allocated to the IADC in the GPIO bus allocation registers was
requested).
• SINGLEFIFOOFIF - A single FIFO overflow has occurred.
• SCANFIFOOFIF - A scan FIFO overflow has occurred.
• SINGLEFIFOUFIF - A single FIFO underflow has occurred.
• SCANFIFOUFIF - A scan FIFO underflow has occurred.
• EM23ABORTERRORIF - The system entered EM2 or EM3 while the IADC was converting and using a clock not supported in EM2
or EM3.
Hardware sets the interrupt flags in IADC_IF, and the flags remain set (sticky) until cleared by software. The interrupts flags should be
cleared before enabling the IADC to remove any previous interrupt history. Clearing or setting interrupt bits can be done by writing to
IADC_IF with a set or clear mask.
The LESENSE peripheral can be set up to trigger IADC0 conversions and use data from IADC0 to evaluate sensor status. The channel
scanner hardware is used by LESENSE in this mode and the IADC SCAN trigger must be set to LESENSE. The SCAN queue can only
be used for LESENSE when operated in this mode, but the SINGLE queue may still be used independently.
When an LESENSE channel is active, the OFFSET field in LESENSE_CHx_INTERACT field is used to determine which of the ADC's
16 scanner channels is sampled. OFFSET = 0 corresponds to IADC_SCAN0, OFFSET = 1 corresponds to IADC_SCAN1, and so on.
The IADC sample is triggered when the sample delay configured in LESENSE_CHx_TIMING_SAMPLEDLY has expired. Results from
the conversion are sent to the LESENSE result FIFO for further processing by LESENSE, and are not available in the SCAN FIFO.
0x000
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
0x3
Reset
Access
IPVERSION R
Name
The read only IPVERSION field gives the version for this module. There may be minor software changes required for
modules with different values of IPVERSION.
0x004
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
0x0 1
RW 0x0 0
Reset
Access
R
DISABLING
Name
EN
Bit Name Reset Access Description
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
When EN is cleared, DISABLING status is set immediately, and cleared when disablement finishes. Disablement resets
peripheral cores and not APB registers except hardware updated registers such as INTFLAGS and FIFOs.
The EN bit enables the module. Software should write to CONFIG type registers before setting the EN bit. Software
should write to SYNC type registers only after setting the EN bit.
0 DISABLE Disable
1 ENABLE Enable
0x008 31
30
RW 0x0 29
28
27
26
25
24
23
22
21
20
RW 0x0 19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
RW 0x0 3
ADCCLKSUSPEND1 RW 0x0 2
ADCCLKSUSPEND0 RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
EM23WUCONVERT
WARMUPMODE
HSCLKRATE
Name
TIMEBASE
DBGHALT
Bit Name Reset Access Description
31 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Ratio to divide incoming CLK_CMU_ADC clock by. The resulting clock (CLK_SRC_ADC) must be 40 MHz or less.
27:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
ADC clock cycles (TIMEBASE + 1) needed to generate a 1 us interval for warm up and start up timing. Does not allow
less than 2 cycles. A setting of 0x0 (1 cycle) is replaced with 0x1 (2 cycles).
15:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 HALT Complete the current conversion and then halt during debug
mode
This only functions with single trigger select set to PRSPOS or PRSNEG. In EM0 and EM1, this gates the local clock
while clock source remains running. In EM2 and EM3, this disables the clock source until the PRSPOS or PRSNEG
event is detected. This bit has no effect if the local IADC timer is running.
1 PRSWUEN ADCCLKWUEN will gate off ADC_CLK until the trigger is detec-
ted provided the internal timer is not selected as the trigger.
Once the trigger is detected the ADC_CLK will be started, the
band gap will be started, the ADC will be warmed up, and the
SCAN Table and the Single entry will be converted. Once the
conversions are done, the ADC_CLK will be gated off.
This only functions with scan trigger select set to PRSPOS or PRSNEG. In EM0 and EM1, this gates the local clock while
clock source remains running. In EM2 and EM3, this disables the clock source until the PRSPOS or PRSNEG event is
detected. This bit has no effect if the local IADC timer is running.
1 PRSWUEN ADCCLKWUEN will gate off ADC_CLK until the trigger is detec-
ted provided the internal timer is not selected as the trigger.
Once the trigger is detected the ADC_CLK will be started, the
band gap will be started, the ADC will be warmed up, and the
SCAN Table and the Single entry will be converted. Once the
conversions are done, the ADC_CLK will be gated off.
0x00C 31
30
29
28
27
26
W(nB) 0x0 25
SINGLEFIFOFLUSH W(nB) 0x0 24
23
22
21
20
19
18
W(nB) 0x0 17
W(nB) 0x0 16
15
14
13
12
11
10
9
8
7
6
5
W(nB) 0x0 4
W(nB) 0x0 3
2
W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
SCANFIFOFLUSH
SINGLESTART
SINGLESTOP
SCANSTART
SCANSTOP
Name
TIMERDIS
TIMEREN
Bit Name Reset Access Description
31:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Flush the Scan FIFO. The IADC must be enabled, not suspended, and the IADC clock must be running. Operation has
completed when STATUS.SCANFIFOFLUSHING has gone low. The scan queue should be disabled. Any incoming scan
queue data will be discarded during the flush.
Flush the Single FIFO. The IADC must be enabled, not suspended, and the IADC clock must be running. Operation has
completed when STATUS.SINGLEFIFOFLUSHING has gone low. The Single queue should be disabled. Any incoming
single queue data will be discarded during the flush.
23:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Disable the local timer and reset the counter to timer reload value.
15:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Stop the Scan queue. Disables Scan triggers and clears pending conversions in the Scan queue. Any conversion that
has already started will continue until it is complete. If the scan queue is stopped before all entries of the scan table have
completed, the remaining entries will not be converted.
2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Stop the Single queue. Disables Single queue triggers and clears pending conversions in the Single queue. Any conver-
sion that has already started will continue until it is complete.
0x010
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
TIMER RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x014 31
0x0 30
29
28
27
26
25
0x0 24
23
22
0x0 21
0x0 20
19
18
17
0x0 16
0x0 15
0x0 14
13
12
11
10
0x0 9
0x0 8
7
0x0 6
5
0x0 4
0x0 3
2
0x0 1
0x0 0
Reset
Access
R
MASKREQWRITEPENDING R
R
R
R
R
R
R
R
R
R
R
SINGLEQUEUEPENDING
SINGLEWRITEPENDING
SINGLEFIFOFLUSHING
SCANQUEUEPENDING
SCANFIFOFLUSHING
SINGLEFIFODV
Name
TIMERACTIVE
CONVERTING
SCANFIFODV
SINGLEQEN
SYNCBUSY
ADCWARM
SCANQEN
Bit Name Reset Access Description
31 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The ADC analog front end and reference require a delay before converting when coming from a powered down or stand-
by state. This status bit indicates that the analog front end and reference are ready.
29:25 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
A write to MASKREQ is pending. The ADC converts using a local working mask register, and only transfers MASKREQ
to the local working version when the SCAN queue is not converting.
The SINGLE register write is pending. The ADC converts using a local working version of the SINGLE register, and only
transfer SINGLE to the local working version when the SINGLE queue is not being converted.
19:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
13:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The Scan queue has been triggered and is waiting to start conversion.
2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
The Single queue has been triggered and is waiting to start conversion. When tailgating is used, SINGLEQUEUEPEND-
ING will remain high until the a scan operation has completed.
0x018
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
MASKREQ RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Allows software to specify which entries in the Scan table should be converted. For example MASKREQ = 0x8014
means that scan table entries 15, 4, and 2 will be converted. The other entries will not be converted.
0x01C 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
0x0
Reset
Access
STMASK R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
This is the active / working copy of the MASKREQ register that the ADC uses. It will only be updated at the end of a scan
sequence or when no scan is in progress.
0x020
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
ADGT RW 0x0
RW 0x0
Reset
Access
ADLT
Name
Compare threshold value for greater-than or equal to comparison. ADGT should be specified in a left-justified, 16-bit for-
mat regardless of the FIFO ALIGNMENT setting. Comparisons with 12-bit formats will ignore the 4 LSBs of the ADGT
value. Comparisons with 20-bit formats will ignore the 4 LSBs of the 20-bit result. Unipolar or bipolar mode is considered
in the comparison. When ADGT is greater than ADLT, the comparison is true if the result is either greater than ADGT or
less than ADLT, but false if the result falls between the values.
Compare threshold value for less-than or equal to comparison. ADLT should be specified in a left-justified, 16-bit format
regardless of the FIFO ALIGNMENT setting. Comparisons with 12-bit formats will ignore the 4 LSBs of the ADLT value.
Comparisons with 20-bit formats will ignore the 4 LSBs of the 20-bit result. Unipolar or bipolar mode is considered in the
comparison. When ADGT is greater than ADLT, the comparison is true if the result is either greater than ADGT or less
than ADLT, but false if the result falls between the values.
Access
SCANENTRYDONE
SCANTABLEDONE
PORTALLOCERR
SINGLEFIFODVL
SINGLEFIFOOF
SINGLEFIFOUF
POLARITYERR
SCANFIFODVL
SINGLEDONE
SCANFIFOOF
SCANFIFOUF
SINGLECMP
Name
SCANCMP
Bit Name Reset Access Description
The system entered EM2 or EM3 during a conversion with an unsupported clock. Conversion results may be corrupted.
30:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
A pin was selected on a port which has not been allocated to the IADC in GPIO control.
Either two even channels or two odd channels were programmed into the channel mux selection. The ADC result will be
set to 0xFFFF.
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
A scan sequence completed. Set at the end of a scan sequence after all valid entries of the scan table have completed.
A scan table conversion completed. Set at the completion of each valid entry of the scan table.
6:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
A minimum of (DVL+1) entries are ready to be read from the Scan FIFO.
A minimum of (DVL+1) entries are ready to be read from the Single FIFO.
Access
SCANENTRYDONE
SCANTABLEDONE
PORTALLOCERR
SINGLEFIFODVL
SINGLEFIFOOF
SINGLEFIFOUF
POLARITYERR
SCANFIFODVL
SINGLEDONE
SCANFIFOOF
SCANFIFOUF
SINGLECMP
Name
SCANCMP
Bit Name Reset Access Description
30:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
6:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x02C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
RW 0x0 16
15
14
13
SINGLETRIGACTION RW 0x0 12
11
10
RW 0x0 9
8
7
6
5
RW 0x0 4
3
2
RW 0x0 1
0
Reset
Access
SCANTRIGACTION
SINGLETAILGATE
SINGLETRIGSEL
SCANTRIGSEL
Name
31:17 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enables tailgating.
1 TAILGATEON After the single queue's trigger is detected, it must wait until the
end of a scan operation before the Single queue can be conver-
ted.
15:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 CONTINUOUS Converts the single queue, then checks for a pending scan
queue before converting the single queue again continuously.
The queues are first come first serve. If both queues are contin-
uous, the IADC alternates between them.
11 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
2 PRSCLKGRP Triggers on PRS1 from a timer module that is using the same
clock group as the ADC and has been programmed to use the
same clock source as the ADC. The prescale may be different
between the ADC and the timer module.
7:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
1 CONTINUOUS Goes through the scan table, converts each entry with a mask
bit set, and puts it back into the scan queue to repeat again con-
tinuously. The queues are first come first serve. If both queues
are triggered, the single queue will get to convert after each
scan table completes. The scan queue will get to convert after
each single conversion completes.
3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 IMMEDIATE Immediate triggering. The scan queue will be disabled once all
conversions in the scan table are complete, unless TRIGGER-
ACTION is set to continuous.
2 PRSCLKGRP Triggers on PRS0 from a timer module that is using the same
clock group as the ADC and has been programmed to use the
same clock source as the ADC. The prescale may be different
between the ADC and the timer module.
0x048 31
30
29
28
27
26
25
24
23
RW 0x0 22
21
20
19
18
RW 0x0 17
16
15
14
ANALOGGAIN RW 0x2 13
12
11
10
9
8
7
RW 0x3 6
5
4
RW 0x0 3
2
1
0
TWOSCOMPL RW 0x0
RW 0x0
Reset
Access
ADCMODE
Name
DIGAVG
REFSEL
OSRHA
OSRHS
Bit Name Reset Access Description
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:24 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
20:19 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x050
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 0x2C000
0x1
0x0
Reset
RW
GAIN13LSB RW
Access
GAIN3MSB
OFFSET
Name
3 MSBs of the 16-bit gain value (0=011 or 0.75; 1=1xx or 1.00). Example {GAIN3MSB, GAIN13LSB} = {100,
0_1001_0000_0000} = 1.07031x. Example {GAIN3MSB, GAIN13LSB} = {011, 0_0000_1010_0010} = 0.75494x.
Offset
0x054 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
PRESCALE RW 0x0
Reset
Access
Name
31:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Second level prescaler - divides the CLK_SRC_ADC by (PRESCALE + 1) to generate ADC_CLK. PRESCALE=0 should
only be used with HSCLKRATE=0. (See text.)
0x070 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
DMAWUFIFOSINGLE RW 0x0 8
7
6
RW 0x3 5
4
RW 0x0 3
2
RW 0x0 1
0
Reset
Access
ALIGNMENT
Name
SHOWID
DVL
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 DISABLED While in EM2 or EM3, the DMA controller will not be requested.
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data valid level before requesting DMA transfer. If the number of words in the FIFO reaches or exceeds DVL+1, DMA
requests will be generated.
0 VALID1 When 1 entry in the single FIFO is valid, set the SINGLEFI-
FODVL interrupt and request DMA.
1 VALID2 When 2 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
2 VALID3 When 3 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
3 VALID4 When 4 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
4 VALID5 When 5 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
5 VALID6 When 6 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
6 VALID7 When 7 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
7 VALID8 When 8 entries in the single FIFO are valid, set the SINGLEFI-
FODVL interrupt and request DMA.
0x074
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
DATA R(r) 0x0
Reset
Access
Name
Reads and pops the oldest value from the single FIFO.
0x078 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
0x0
Reset
Access
FIFOREADCNT R
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x07C
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
0x0
Reset
Access
DATA R
Name
Reads the most recent data word from the single FIFO, but does not pop a value. Even if the FIFO has overflowed and
stopped updating, the most recent conversion will continue to overwrite SINGLEDATA.
0x080 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
DMAWUFIFOSCAN RW 0x0 8
7
6
RW 0x3 5
4
RW 0x0 3
2
RW 0x0 1
0
Reset
Access
ALIGNMENT
Name
SHOWID
DVL
Bit Name Reset Access Description
31:9 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 DISABLED While in EM2 or EM3, the DMA controller will not be requested.
7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data valid level before requesting DMA transfer. If the number of words in the FIFO reaches or exceeds DVL+1, DMA
requests will be generated.
0 VALID1 When 1 entry in the scan FIFO is valid, set the SCANFIFODVL
interrupt and request DMA.
1 VALID2 When 2 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
2 VALID3 When 3 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
3 VALID4 When 4 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
4 VALID5 When 5 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
5 VALID6 When 6 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
6 VALID7 When 7 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
7 VALID8 When 8 entries in the scan FIFO are valid, set the SCANFI-
FODVL interrupt and request DMA.
0x084
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
DATA R(r) 0x0
Reset
Access
Name
Reads and pops the oldest value from the scan FIFO.
0x088 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
0x0
Reset
Access
FIFOREADCNT R
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x08C
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
0x0
Reset
Access
DATA R
Name
Reads the most recent data word from the scan FIFO, but does not pop a value. Even if the FIFO has overflowed and
stopped updating, the most recent conversion will continue to overwrite SCANDATA.
0x098 31
30
29
28
27
26
25
24
23
22
21
20
19
18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
PORTPOS RW 0x0
RW 0x0
PORTNEG RW 0x0
RW 0x0
Reset
Access
PINNEG
PINPOS
Name
CMP
CFG
Bit Name Reset Access Description
31:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Select which configuration group (CFGx, SCALEx, SCHEDx registers) is used with this entry.
Port (A, B, C, D) or special signal assigned to the positve input of the ADC
0 GND Ground
Port (A, B, C, D) or special signal assigned to the negative input of the ADC
0x0A0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
PORTPOS RW 0x0
RW 0x0
PORTNEG RW 0x0
RW 0x0
Reset
Access
PINNEG
PINPOS
Name
CMP
CFG
Bit Name Reset Access Description
31:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Select which configuration group (CFGx, SCALEx, SCHEDx registers) is used with this entry.
Port (A, B, C, D) or special signal assigned to the positve input of the ADC
0 GND Ground
Port (A, B, C, D) or special signal assigned to the negative input of the ADC
Quick Facts
What?
0 1 2 3 4
The General Purpose Input/Output (GPIO) is used
for pin configurations as well as routing for peripher-
al pin connections.
Why?
23.1 Introduction
In the EFM32PG28 devices the General Purpose Input/Output (GPIO) pins are organized into ports with up to 16 pins each. These
GPIO pins can be individually configured as either an output or input. More advanced configurations like open-drain, open-source, and
glitch filtering can be configured for each individual GPIO pin. Peripheral resources, like Timer PWM outputs or USART RX/TX can be
routed to the GPIO pins as desired by the user. Finally, the input value of a pin can be routed through the Peripheral Reflex System to
other peripherals or used to trigger an external interrupt.
23.2 Features
An overview of the GPIO module is shown in Figure 23.1 Pin Configuration on page 776. The GPIO pins are grouped into 16-pin
ports. Each individual GPIO pin is called Pxn where x indicates the port (A, B, C ...) and n indicates the pin number (0,1,....,15). Fewer
than 16 pins may be available on some ports depending on the total number of I/O pins on the package. After a reset, both input and
output are disabled for all pins on the device, except for the Serial Wire Debug pins.
To use a pin, the Mode Register (GPIO_Px_MODEL/GPIO_Px_MODEH) must be configured for the pin to make it an input or output.
These registers can also do more advanced configuration, which is covered in 23.3.1 Pin Configuration. When the port is configured as
an input or an output, the Data In Register (GPIO_Px_DIN) can be used to read the level of each pin in the port (bit n in the register is
connected to pin n on the port). When configured as an output, the value of the Data Out Register (GPIO_Px_DOUT) will be driven to
the pin.
Reading the GPIO_Px_DOUT register will return its contents. Reading the GPIO_Px_DOUTTGL register will return 0.
GPIO
Output enable
Output enable 1
VDD
Data out
Output value
DOUT ESD diode
Pull-up enable
Pull-down enable
MODEn[3:0] Input enable
ESD diode
Filter enable
DIN
VSS
Glitch
Alternate function input
suppression
filter
Interrupt input
PRS
Analog connections
In addition to setting the pins as either outputs or inputs, the GPIO_Px_MODEL and GPIO_Px_MODEH registers can be used for more
advanced configurations. GPIO_Px_MODEL contains 8 bit fields named MODEn (n=0,1,..7) which control pins 0-7, while
GPIO_Px_MODEH contains 8 bit fields named MODEn (n=8,9,..15) which control pins 8-15. In some modes GPIO_Px_DOUT is also
used for extra configurations like pull-up/down and glitch suppression filter enable. Table 23.1 Pin Configuration on page 777 shows
the available configurations.
MODEn Input Output DOUT Pull- Pull- Alt Port Input Description
down up Ctrl Filter
MODEn determines which mode the pin is in at a given time. Setting MODEn to DISABLED disables the pin, reducing power consump-
tion to a minimum. When the output driver and input driver are disabled, the pin can be used as a connection for an analog module. An
input is enabled by setting MODEn to any value other than DISABLED while DINDIS for the given port is cleared. Set DINDIS to disable
the input of a GPIO port. The pull-up, pull-down and glitch filter function can optionally be applied to the input, see Figure 23.2 Tristated
Output with Optional Pull-up or Pull-down on page 778.
VDD
Filter enable
Optional
Input enable pull-up
Glitch
DIN suppression
filter
Optional
Analog connections
pull-down
VSS
When MODEn is PUSHPULL or PUSHPULLALT, the pin operates in push-pull mode. In this mode, the pin can have alternate port
control values and can be driven either high or low, dependent on the value of GPIO_Px_DOUT. The push-pull configuration is shown
in Figure 23.3 Push-Pull Configuration on page 778.
Output Enable
DOUT
Input Enable
DIN
When MODEn is WIREDOR or WIREDORPULLDOWN, the pin operates in open-source mode (with a pull-down resistor for WIRE-
DORPULLDOWN). When driving a high value in open-source mode, the pull-down is disconnected to save power.
When the mode is prefixed with WIREDAND, the pin operates in open-drain mode as shown in Figure 23.4 Open-drain on page 778.
In open-drain mode, the pin can have an input filter, a pull-up, alternate port control values or any combination of these. When driving a
low value in open-drain mode, the pull-up is disconnected to save power.
VDD
Filter enable
Optional
pull-up
Glitch
DIN suppression
filter
DOUT
VSS
The Alternate Port Control allows for additional flexibility of port level settings. A user may setup two different port configurations (nor-
mal and alternate modes) and select which is applied on a pin by pin bases. For example you may configure half of port A to use the
slowest slew rate while the other half uses a faster slew rate.
Alternate port control is enabled when MODEn is set to any of the ALT enumerated modes (i.e.. PUSHPULLALT). When MODEn is an
alternate mode, the pin uses the alternate port control values specified in the DINDISALT and SLEWRATEALT fields in
GPIO_Px_CTRL. In all other modes, the port control values are used from the DINDIS and SLEWRATE fields in GPIO_Px_CTRL.
The slewrate can be applied to pins on a port-by-port basis. The slew rate applied to pins configured using normal MODEn settings can
be controlled using the SLEWRATE fields in GPIO_Px_CTRL. The slewrate applied to pins configured using the alternate MODEn set-
tings can be controlled using the SLEWRATEALT field.
The lowest slew rate setting has limited drive strength. That is the current is limited to about 1 mA. This setting provides slow switching
and limited drive. A slew rate setting of 1 provides the slowest switching with full drive capability. The maximum recommended setting
for most digital I/O is 6. A slew rate setting of 7 should only be used for high-speed clock signals, above 10 MHz. A setting of 7 should
not be used on more than one pin per port. Please refer to the datasheet for GPIO rise and fall times.
The pin inputs can be disabled on a port-by-port basis. The input of pins configured using the normal MODEn settings can be disabled
by setting DINDIS in GPIO_Px_CTRL. The input of pins configured using the alternate MODEn settings can be disabled by setting DIN-
DISALT.
While all GPIO pins retain their state in EM2, only pins on port A and B remain fully functional in EM2. Digital peripherals which are
active in EM2 must have their resources routed to pins on port A or B to function correctly in EM2. Analog peripherals may use any
GPIO pin while in EM2 provided that the ABUS was configured prior to entering EM2. However, analog peripherals that are configured
to scan multiple pins while in EM2 (such as the ADC) dynamically reconfigure the ABUS while in EM2 and thus must use only pins on
port A and B.
By default GPIO pins revert back to their reset state when EM4 is entered. The GPIO pins can be configured to retain the settings for
output enable, output value, pull enable, and pull direction while in EM4.
EM4 GPIO retention is controlled with the EM4IORETMODE field in the EMU_EM4CTRL register:
• Setting EM4IORETMODE to EM4EXIT will cause GPIO retention to persist while in EM4. GPIO state will be reset during wakeup.
• Setting EM4IORETMODE to SWUNLATCH will cause the GPIO retention to persist through EM4 and wakeup, until the EM4UN-
LATCH bit is written by software. When using SWUNLATCH, the GPIO register values are still reset on wakeup. To ensure the
GPIO state does not change, software must re-write the GPIO registers before setting EM4UNLATCH and ending EM4 GPIO reten-
tion. Note that the GPIO state cannot be retained through an EM4 wakeup due to a reset (e.g., pin reset or POR reset) - only non-
reset methods of EM4 wakeup are supported (e.g., EM4WU IRQ or BURTC IRQ).
See the EMU chapter for additional documentation on EM4IORETMODE and the EM4UNLATCH bit.
It is possible to trigger a wake-up from EM4 using any of the selectable EM4WU GPIO pins. The wake-up request can be triggered
through the pins by enabling the corresponding bit in the GPIO_EM4WUEN register. When EM4 wake-up is enabled for the pin, the
input filter is enabled during EM4. This is done to avoid false wake-up caused by glitches. In addition, the polarity of the EM4 wake-up
request can be selected using the GPIO_EM4WUPOL register.
GPIO_IF.EM4WU
GPIO_IF_CLR
GPIO_EM4WUPOL GPIO_EM4WUEN
Wake-up Logic
Wake-up request
The pins used for EM4 wake-up must be configured as inputs with glitch filters using the GPIO_Px_MODEL register. If the input is disa-
bled and the wakeup polarity is low, a false wakeup will occur when entering EM4. If the input is enabled, the glitch filtered is disabled,
and the polarity is set low, a glitch will occur when going into EM4 that will cause an immediate wake-up. Before going down to EM4, it
is important to clear the wake-up logic by setting the GPIO_IF_CLR bits, which clear the wake-up logic, including the GPIO_IF register.
It is possible to determine which pin caused the EM4WU by reading the GPIO_IF register.
Each EM4WU signal is connected to a fixed pin. Refer to the Alternate Function Table in the device Datasheet for the location of each
EM4 wakeup signal.
The JTAG Debug Port is a fixed location resource connected directly to specific GPIO pins. Refer to the Alternate Function Table in the
device Datasheet for the location of the JTAG signals. By default TMS, TCK, TDO, and TDI pin connections are enabled with internal
pull up, pull down, no pull, and pull up resistors, respectively. It is possible to disable these pin connections (and disable the pull resis-
tors) by setting the SWDIOTMSPEN, SWCLKTCKPEN, TDOPEN, and TDIPEN bits in GPIO_DEBUGROUTEPEN to 0.
The SW Debug Port is a fixed location resource connected directly to specific GPIO pins. Refer to the Alternate Function Table in the
device Datasheet for the location of the SW Debug port signals. The SWDIO and SWCLK pin connections are enabled by default with
internal pull up and pull down resistors, respectively. It is possible to disable these pin connections (and disable the pull resistors) by
setting the SWDIOTMSPEN and SWCLKTCKPEN bits in GPIO_DEBUGROUTEPEN to 0.
The Serial Wire Viewer pin, SWV, can be enabled by setting the SWVPEN bit in GPIO_TRACEROUTEPEN.
Note: The SWV pin is not affected by debug lock, so the SWV pin should not be enabled for production devices.
When the debug pins are disabled, the device can no longer be accessed by a debugger. A reset will set the debug pins back to their
enabled default state. The GPIO_DBGROUTEPEN register can only be updated when the debugger is disconnected from the system.
Any attempts to modify GPIO_DBGROUTEPEN when the debugger is connected will not occur. If you do disable the debug pins, make
sure you have at least a 3 second timeout at the start of your program code before you disable the debug pins. This way the debugger
will have time to connect to the device after a reset and before the pins are disabled.
The device includes ETM trace pins. The trace clock can be enabled by setting the TRACECLKPEN bit-field in GPIO_TRACEROUTEP-
EN. The data pin(s) can be enabled individually by setting TRACEDATAxPEN in GPIO_TRACEROUTEPEN. The trace pins are fixed
location resources connected to specific pins. Refer to the Alternate Function Table in the device Datasheet for the location of the ETM
trace port signals.
The GPIO can generate an interrupt from any edge of the input of any GPIO pin on the device. The standard interrupts have asynchro-
nous sense capability, enabling wake-up from energy modes as low as EM3, see Figure 23.6 Pin n Interrupt Generation on page 781.
Note: In EM2 and EM3, only signals on Port A and Port B are available as standard interrupts. Standard interrutps are available to all
pins in EM0 and EM1.
EXTIPINSEL[n]
PA[p+3:p]
4
set clear IRQ_GPIO_EVEN/
Synch IF[n] IRQ_GPIO_ODD
PB[p+3:p]
Odd/even inputs
p = 4 * int( n / 4 ) EXTIFALL[n]
PRS
The standard external pin interrupts are numbered starting with 0. Each interrupt has a corresponding enable bit in the GPIO_IEN regis-
ter and an interrupt flag bit in the GPIO_IF register. Each interrupt may be used with one of four possible pins on any available port.
First select the desired port for each interrupt using the corresponding EXTIPSELx field in the GPIO_EXTIPSELL register. (Some devi-
ces with many pins may also have a GPIO_EXTIPSELH register.)
Each interrupt can be mapped to one of four possible pins on the selected port. External interrupts EXTI0 through EXTI3 may be map-
ped to pins 0,1,2, or 3 on any available port. External interrupts EXTI4 through EXTI7 may be mapped to pins 4,5,6 or 7 on any availa-
ble port.
Note: Note that while the EXTIEN field in the GPIO_IEN register has 15 bits, the number of useful bits is limited by the number of pins
available in the widest port. If the widest port is 8 bits wide, only the first 8 external interrupts are useful.
The selected pin for each interrupt is the base plus the offset. The base for EXTI0 through EXTI3 is 0, while the base for interrupts
EXTI4 through EXTI7 is 4. The base may be calculated by taking the interrupt number, dividing by four, then using only the integer
portion of the quotient. (BASE = Integer(N/4)
The offset is selected using the corresponding field in the GPIO_EXTIPINSELL register, (Some devices with many pins may also have
a GPIO_EXTIPINSELH register.) Subtract the base from the desired pin number to get the offset. For example, to map EXTI5 to pin 7
of PORTA, the base is 4 and the offset will be 3.
The GPIO_EXTIRISE[n] and GPIO_EXTIFALL[n] registers enable sensing of rising and falling edges. By setting the EXT[n] bit in
GPIO_IEN, a high interrupt flag n, will trigger one of two interrupt lines. The even interrupt line is triggered by any enabled even num-
bered interrupt flag index, while the odd interrupt line is triggered by odd flag indexes. The interrupt flags can be set and cleared by
software when writing the GPIO_IF_SET and GPIO_IF_CLR register locations. Since the external interrupts are asynchronous, they are
sensitive to noise. To increase noise tolerance, the MODEx field(s) in the GPIO_Px_MODEL register, should be set to include glitch
filtering for pins that have external interrupts enabled.
In addition to being an EM4 wake source, any of the dedicated EM4WU (EM4 wake-up) signals on PA, PB, PC or PD may be used to
generate edge-sensitive interrupts in EM0, EM1, EM2, and EM3.
In order to enable an EM4WU pin as an interrupt, set the EM4WUIENn field in the GPIO_IEN register and the EM4WUENn field in the
EM4WUEN register. The EM4WUPOLn field in the GPIO_EM4WUPOL register is used to set the desired polarity for the interrupt (0 for
a falling edge, and 1 for a rising edge).
Upon an interrupt occurring, the corresponding EM4WU index in the GPIO_IF register will be set along with the odd or even interrupt
line depending on the index inside of GPIO_IF. For example, by setting the. EM4WU8 in GPIO_EM4WUPOL and EM4WU[8] in
GPIO_IEN, the interrupt flag EM4WU[8] in GPIO_IF will be triggered by a rising edge on pin EM4WU8 and a interrupt request will be
sent on IRQ_GPIO_EVEN.
The wake-up granularity of the EM4WU interrupts is based on the settings of the EM4WU field in the GPIO_IEN register and the
EM4WUEN field in the GPIO_EM4WUEN register (see Table 23.2 EM4WU Interrupt Energy Mode Wakeup on page 782).
x 0 No Wake No Interrupt
For example, to configure the device to wake up and generate an interrupt when PD02 (EM4WU9) sees a falling edge:
1. Set bit 9 of EM4WUEN in the GPIO_EM4WUEN register to '1'. This enables the asynchronous wake logic.
2. Set bit 9 of EM4WUIEN in the GPIO_IEN register to '1'. This enables routing of the wake signal to the GPIO_ODD IRQ.
3. Clear bit 9 of EM4WUPOL in the GPIO_EM4WUPOL register to '0'. This indicates that the interrupt should occur when a falling
edge is detected at the pin.
4. Enable the GPIO.ODD IRQ. The ODD interrupt is used because the bit index of EM4WUIF in GPIO_IF is odd.
All pins within a group of four(0-3,4-7,8-11,12-15) from all ports are grouped together to form one PRS producer which outputs to the
PRS. The pin from which the output should be taken is selected in the same fashion as the edge interrupts.
PRS output is not affected by the interrupt edge detection logic or gated by the IEN bits. See 23.3.10 Interrupt Generation for an illustra-
tion of where the PRS output signal is generated.
Most peripherals have resources that need to be connected to GPIO pins to function. For example, the I2C has SDA and SCL which
need to be connected to pins for the I2C to communicate with other ICs. Resources come in three types. Fixed resources are hard-
wired to a pin and can only be accessed in that location. For example the LFXO LFXTAL_I and LFXTAL_O resources are only available
on one pin each. Digital route-able resources are connected to pins through the 23.3.12.1 Digital Bus (DBUS) which allows for extreme-
ly flexible resource placement. Analog route-able resources are connected to pins though the 23.3.12.2 Analog Bus (ABUS) which pro-
vides extremely flexible resource placement.
The locations of fixed resources and the limitations of ABUS and DBUS on each device can be found in the device data sheet.
The Digital Bus (DBUS) is an any-to-any switch matrix between peripheral resources and GPIO pins as shown in Figure 23.7 Digital
Bus Interconnect on page 783. There are two DBUSes on the EFM32PG28 - DBUSAB serves ports A and B, while DBUSCD serves
ports C and D. Not all peripherals have access to both DBUSes.
To connect a resource to a pin, first select the desired PORT and PIN in the GPIO_x_yROUTE register, where x is the peripheral name
and y is the resource name. The PORT field is encoded as PA = 0, PB = 1, PC = 2, etc. Once the pin is selected, the resource must be
enabled by setting its enable bit in the appropriate GPIO_x_ROUTEEN register. For example, to route the SDA resource of I2C0 to
PB03, set PORT to 0x1 and PIN to 0x3 in GPIO_I2C0_SDAROUTE. Then set the GPIO_I2C0_ROUTEN.SDAPEN bit.
Any pin connected to a digital resource should be properly configured for that resource (refer to 23.3.1 Pin Configuration). For example,
an I2C SDA should be configured as open-drain, a USART (or EUSART) TX should be configured as push-pull, and a USART (or EU-
SART) RX should be configured as an input.
PB00
PB01
Peripheral N
Resource A
Pn00
Pn01 Resource B
Analog peripherals may be connected to any pins on port A, B, C, or D via the Analog Bus. There are three analog buses on the
EFM32PG28: one dedicated to Port A (ABUSA), one dedicated to port B (ABUSB), and one that serves both ports C and D (ABUSCD).
The specific pin and port selection for analog resources are configured in the analog peripherals. Refer to the respective analog periph-
eral chapter for this information. However, the GPIO block must be configured to grant the peripheral access to an ABUS before any
connection can be made.
Note: The analog signals on ABUSes will be voltage limited by the lowest supply voltage of IOVDD and AVDD.
Up to two analog peripherals may be given access to an ABUS at any one time and the even/odd pins of each bus are configured
independently. This means that a single bus may have up to four different analog peripherals connected to it: two on the even pins and
two on the odd pins. The GPIO_ABUSxALLOC register, where x is the port, determines which peripherals have access to the bus. To
grant a peripheral access to the bus even pins select it in either the EVEN0 or EVEN1 field. To grant a peripheral access to the bus odd
pins select it in either the ODD0 or ODD1 fields.
When a differential connection is being used, positive inputs are restricted to the EVEN pins and negative inputs are restricted to the
ODD pins. When a single ended connection is being used, the positive input is avaliable on all pins.
Peripherals may be given access to as many buses as desired. For example the ADC may be given access to ABUSA, ABUSB, and
ABUSCD allowing it to select any pin on ports A-D. If two peripherals select the same port and pin the ABUS will make both connec-
tions simultaneously, effectively connecting the two peripherals together.
Any pin connected to an analog resource should be configured to input DISABLED as described in 23.3.1 Pin Configuration
The process for configuring an analog peripheral to access a pin through the ABUS is as follows:
• Configure the desired analog port pins to input DISABLED mode in the corresponding GPIO_PORTx_MODEL/H register.
• Configure the corresponding GPIO_xBUSALLOC field to grant access to the desired peripheral on the desired ABUS.
• Configure the analog peripheral to select the desired port and channel as described in the peripheral chapter.
This section details the functions and GPIO pins available on the most fully-featured devices in the EFM32PG28 family. Availability of
GPIO and signals varies. Refer to the device datasheet for specific peripheral and GPIO availability. Fixed-pin peripheral resources are
shown in Table 23.3 GPIO Alternate Function Table on page 785, ABUS routing options are listed in Table 23.4 ABUS Routing Table
on page 787, and DBUS routing options are listed in Table 23.5 DBUS Routing Table on page 788
PA00 LCD.SEG8
GPIO.SWCLK
PA01
LCD.SEG9
PA02 GPIO.SWDIO
GPIO.SWV
GPIO.TDO
PA03
GPIO.TRACEDATA0
LESENSE.EN_0
GPIO.TDI
GPIO.TRACECLK
PA04
LCD.SEG10
LESENSE.EN_1
GPIO.TRACEDATA1
GPIO.EM4WU0
PA05
LCD.SEG11
LESENSE.EN_2
GPIO.TRACEDATA2
PA06
LCD.LCD_CP
GPIO.TRACEDATA3
PA07
LCD.SEG12
PA08 LCD.SEG13
PA09 LCD.SEG20
PA10 LCD.SEG21
PA11 LCD.SEG22
PA12 LCD.SEG23
LCD.COM4
PA13
LCD.SEG24
LCD.COM5
PA14
LCD.SEG25
LCD.SEG14
PB00
VDAC0.CH0_MAIN_OUT
GPIO.EM4WU3
PB01 LCD.SEG15
VDAC0.CH1_MAIN_OUT
PB02 LCD.SEG16
GPIO.EM4WU4
PB03
LCD.SEG17
LCD.COM6
PB04
LCD.SEG26
LCD.COM7
PB05
LCD.SEG27
GPIO.EM4WU6
PC00
LCD.SEG0
GPIO.EFP_TX_SDA
PC01
LCD.SEG1
GPIO.EFP_TX_SCL
PC02
LCD.SEG2
PC03 LCD.SEG3
PC04 LCD.SEG4
GPIO.EFP_INT
PC05 GPIO.EM4WU7
LCD.SEG5
PC06 LCD.SEG6
GPIO.EM4WU8
PC07
LCD.SEG7
PC08 LCD.SEG18
PC09 LCD.SEG19
GPIO.THMSW_EN
PC11
GPIO.THMSW_HALFSWITCH
PD00 LFXO.LFXTAL_O
LFXO.LFXTAL_I
PD01
LFXO.LF_EXTCLK
GPIO.EM4WU9
PD02
LCD.COM0
PD03 LCD.COM1
PD04 LCD.COM2
GPIO.EM4WU10
PD05
LCD.COM3
Peripheral Signal PA PB PC PD
ACMP0 ana_neg Yes Yes Yes Yes Yes Yes Yes Yes
ACMP1 ana_neg Yes Yes Yes Yes Yes Yes Yes Yes
IADC0 ana_neg Yes Yes Yes Yes Yes Yes Yes Yes
VDAC0 ch0_abus_out Yes Yes Yes Yes Yes Yes Yes Yes
Peripheral.Resource PORT
PA PB PC PD
Peripheral.Resource PORT
PA PB PC PD
Peripheral.Resource PORT
PA PB PC PD
Peripheral.Resource PORT
PA PB PC PD
23.4 Synchronization
To avoid metastability in synchronous logic connected to the pins, all inputs are synchronized with double flip-flops. The flip-flops for the
input data run on the selected APB clock for the GPIO module (PCLK). Consequently, when a pin changes state, the change will propa-
gate to GPIO_Px_DIN after two 2 PCLK cycles. Synchronization (also running on the PCLK) is also added for interrupt input. To save
power when the external interrupts are not used, the synchronization flip-flops for these can be turned off by clearing the EXTINT field
in the GPIO_IEN register.
0x000
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
0x6
Reset
Access
IPVERSION R
Name
IPVERSION ID
0x030 31
30
29
RW 0x0 28
27
26
25
24
23
22
SLEWRATEALT RW 0x4 21
20
19
18
17
16
15
14
13
RW 0x0 12
11
10
9
8
7
6
RW 0x4 5
4
3
2
1
0
Reset
Access
SLEWRATE
DINDISALT
Name
DINDIS
Bit Name Reset Access Description
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using alternate modes. Higher values provide faster slewrates.
19:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input disable for port pins not using alternate modes.
11:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using not alternate modes. Higher values provide faster slewrates.
3:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x034 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
MODE7 RW 0x0
MODE6 RW 0x0
MODE5 RW 0x0
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x03C 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
MODE6 RW 0x0
MODE5 RW 0x0
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x040
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
DOUT RW 0x0 7
6
5
4
3
2
1
0
Reset
Access
Name
31:15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data output
0x044
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
0x0 7
6
5
4
3
2
1
0
Reset
Access
DIN R
Name
31:15 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input
0x060 31
30
29
RW 0x0 28
27
26
25
24
23
22
SLEWRATEALT RW 0x4 21
20
19
18
17
16
15
14
13
RW 0x0 12
11
10
9
8
7
6
RW 0x4 5
4
3
2
1
0
Reset
Access
SLEWRATE
DINDISALT
Name
DINDIS
Bit Name Reset Access Description
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using alternate modes. Higher values provide faster slewrates.
19:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input disable for port pins not using alternate modes.
11:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using not alternate modes. Higher values provide faster slewrates.
3:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x064 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
MODE7 RW 0x0
MODE6 RW 0x0
MODE5 RW 0x0
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x070 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
DOUT RW 0x0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data output
0x074
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
0x0
Reset
Access
DIN R
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input
0x090 31
30
29
RW 0x0 28
27
26
25
24
23
22
SLEWRATEALT RW 0x4 21
20
19
18
17
16
15
14
13
RW 0x0 12
11
10
9
8
7
6
RW 0x4 5
4
3
2
1
0
Reset
Access
SLEWRATE
DINDISALT
Name
DINDIS
Bit Name Reset Access Description
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using alternate modes. Higher values provide faster slewrates.
19:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input disable for port pins not using alternate modes.
11:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using not alternate modes. Higher values provide faster slewrates.
3:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x094 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
MODE7 RW 0x0
MODE6 RW 0x0
MODE5 RW 0x0
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x09C 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
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x0A0
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
DOUT RW 0x0
Reset
Access
Name
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data output
0x0A4 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
0x0
Reset
Access
DIN R
Name
31:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input
0x0C0 31
30
29
RW 0x0 28
27
26
25
24
23
22
SLEWRATEALT RW 0x4 21
20
19
18
17
16
15
14
13
RW 0x0 12
11
10
9
8
7
6
RW 0x4 5
4
3
2
1
0
Reset
Access
SLEWRATE
DINDISALT
Name
DINDIS
Bit Name Reset Access Description
31:29 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:23 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using alternate modes. Higher values provide faster slewrates.
19:13 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input disable for port pins not using alternate modes.
11:7 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Slewrate limit for port pins using not alternate modes. Higher values provide faster slewrates.
3:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x0C4 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
MODE7 RW 0x0
MODE6 RW 0x0
MODE5 RW 0x0
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x0CC 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
MODE7 RW 0x0
MODE6 RW 0x0
MODE5 RW 0x0
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
Name
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
0x0D0 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
DOUT RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data output
0x0D4
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
0x0
Reset
Access
DIN R
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Data input
0x300 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
0xA534
Reset
Access
LOCKKEY W
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write any other value than the unlock code to lock configuration registers. Write the unlock code to unlock (See text for
detailed list of configuration registers.)
0x310
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
0x0 0
Reset
Access
LOCK R
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x320 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 0x0
RW 0x0
AEVEN1 RW 0x0
AEVEN0 RW 0x0
Reset
Access
AODD1
AODD0
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x324 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 0x0
RW 0x0
BEVEN1 RW 0x0
BEVEN0 RW 0x0
Reset
Access
BODD1
BODD0
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x328 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 0x0
RW 0x0
CDEVEN1 RW 0x0
CDEVEN0 RW 0x0
Reset
Access
CDODD1
CDODD0
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:12 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x400 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
EXTIPSEL7 RW 0x0
EXTIPSEL6 RW 0x0
EXTIPSEL5 RW 0x0
EXTIPSEL4 RW 0x0
EXTIPSEL3 RW 0x0
EXTIPSEL2 RW 0x0
EXTIPSEL1 RW 0x0
EXTIPSEL0 RW 0x0
Reset
Access
Name
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x404 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
EXTIPSEL7 RW 0x0
EXTIPSEL6 RW 0x0
EXTIPSEL5 RW 0x0
EXTIPSEL4 RW 0x0
EXTIPSEL3 RW 0x0
EXTIPSEL2 RW 0x0
EXTIPSEL1 RW 0x0
EXTIPSEL0 RW 0x0
Reset
Access
Name
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
19:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x408 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
EXTIPINSEL7 RW 0x0
EXTIPINSEL6 RW 0x0
EXTIPINSEL5 RW 0x0
EXTIPINSEL4 RW 0x0
EXTIPINSEL3 RW 0x0
EXTIPINSEL2 RW 0x0
EXTIPINSEL1 RW 0x0
EXTIPINSEL0 RW 0x0
Reset
Access
Name
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
19:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN0 OFFSET=0
1 PIN1 OFFSET=1
2 PIN2 OFFSET=2
3 PIN3 OFFSET=3
0x40C 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
EXTIPINSEL7 RW 0x0
EXTIPINSEL6 RW 0x0
EXTIPINSEL5 RW 0x0
EXTIPINSEL4 RW 0x0
EXTIPINSEL3 RW 0x0
EXTIPINSEL2 RW 0x0
EXTIPINSEL1 RW 0x0
EXTIPINSEL0 RW 0x0
Reset
Access
Name
31:30 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
27:26 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
23:22 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
19:18 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
15:14 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
11:10 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
7:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
3:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0 PIN8 OFFSET=8
1 PIN9 OFFSET=9
2 PIN10 OFFSET=10
3 PIN11 OFFSET=11
0x410
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
EXTIRISE RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x414 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
EXTIFALL RW 0x0
Reset
Access
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x420 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
EXTIF15 RW 0x0 15
EXTIF14 RW 0x0 14
EXTIF13 RW 0x0 13
EXTIF12 RW 0x0 12
EXTIF11 RW 0x0 11
EXTIF10 RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
EM4WU
EXTIF9
EXTIF8
EXTIF7
EXTIF6
EXTIF5
EXTIF4
EXTIF3
EXTIF2
EXTIF1
EXTIF0
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x424 31
30
29
28
EM4WUIEN11 RW 0x0 27
EM4WUIEN10 RW 0x0 26
RW 0x0 25
RW 0x0 24
RW 0x0 23
RW 0x0 22
RW 0x0 21
RW 0x0 20
RW 0x0 19
RW 0x0 18
RW 0x0 17
RW 0x0 16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
RW 0x0 11
RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
EM4WUIEN9
EM4WUIEN8
EM4WUIEN7
EM4WUIEN6
EM4WUIEN5
EM4WUIEN4
EM4WUIEN3
EM4WUIEN2
EM4WUIEN1
EM4WUIEN0
EXTIEN15
EXTIEN14
EXTIEN13
EXTIEN12
EXTIEN11
EXTIEN10
EXTIEN9
EXTIEN8
EXTIEN7
EXTIEN6
EXTIEN5
EXTIEN4
EXTIEN3
EXTIEN2
EXTIEN1
EXTIEN0
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x42C 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
EM4WUEN RW 0x0
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Write 1 to enable EM4 wake up request, write 0 to disable EM4 wake up request
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x430
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
EM4WUPOL RW 0x0
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:0 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x440 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
RW 0x1 3
RW 0x1 2
SWDIOTMSPEN RW 0x1 1
SWCLKTCKPEN RW 0x1 0
Reset
Access
Name
TDOPEN
TDIPEN
Bit Name Reset Access Description
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enable Serial Wire Data and JTAG Test Mode Select connection to pin. WARNING: When the pin is disabled, the device
can no longer be accessed by a debugger. A reset will set the pin back to a default state as enabled. If you disable this
pin, make sure you have at least a 3 second timeout at the start of your program code before you disable the pin. This
way, the debugger will have time to halt the device after a reset before the pin is disabled.
Enable Serial Wire and JTAG CLock connection to pin. WARNING: When the pin is disabled, the device can no longer
be accessed by a debugger. A reset will set the pin back to a default state as enabled. If you disable this pin, make sure
you have at least a 3 second timeout at the start of your program code before you disable the pin. This way, the debug-
ger will have time to halt the device after a reset before the pin is disabled.
0x444 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
TRACEDATA3PEN RW 0x0 5
TRACEDATA2PEN RW 0x0 4
TRACEDATA1PEN RW 0x0 3
TRACEDATA0PEN RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
TRACECLKPEN
Name
SWVPEN
Bit Name Reset Access Description
31:6 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x460 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
LCDSEGALLOC RW 0x0
Reset
Access
Name
31:28 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enables individual LCD_SEGx pins. Bit 0 enables SEG0, bit 1 enables SEG1, etc.
0x470
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
LCDCOMALLOC RW 0x0
Reset
Access
Name
31:4 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
Enables individual LCD_COMx pins. Bit 0 enables COM0, bit 1 enables COM1, etc.
0x480 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
ACMPOUTPEN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x484
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x48C 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
ACMPOUTPEN RW 0x0 0
Reset
Access
Name
31:1 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x490
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x498 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
CLKOUT2PEN RW 0x0 2
CLKOUT1PEN RW 0x0 1
CLKOUT0PEN RW 0x0 0
Reset
Access
Name
31:3 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x49C
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4A0 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4A4
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4A8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4C4 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
RW 0x0 4
SCLKPEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RTSPEN
RXPEN
CSPEN
TXPEN
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4C8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4CC
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4D0 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4D4
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4D8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4DC
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4E4 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
RW 0x0 4
SCLKPEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RTSPEN
RXPEN
CSPEN
TXPEN
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4E8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4EC
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4F0 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4F4
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4F8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x4FC
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x504 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
RW 0x0 4
SCLKPEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RTSPEN
RXPEN
CSPEN
TXPEN
Name
31:5 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x508 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x50C
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x510 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x514
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x518 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x51C
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x538 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
SDAPEN RW 0x0 1
SCLPEN RW 0x0 0
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x53C
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x540 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x548
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
SDAPEN RW 0x0 1
SCLPEN RW 0x0 0
Reset
Access
Name
31:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x54C 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x550
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x558 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
COLOUT7PEN RW 0x0 7
COLOUT6PEN RW 0x0 6
COLOUT5PEN RW 0x0 5
COLOUT4PEN RW 0x0 4
COLOUT3PEN RW 0x0 3
COLOUT2PEN RW 0x0 2
COLOUT1PEN RW 0x0 1
COLOUT0PEN RW 0x0 0
Reset
Access
Name
31:8 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x55C 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x560
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x564 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x568
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x56C 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x570
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x574 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x578
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x57C 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x580
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x584 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x588
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x58C 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x590
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x598 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
CH15OUTPEN RW 0x0 15
CH14OUTPEN RW 0x0 14
CH13OUTPEN RW 0x0 13
CH12OUTPEN RW 0x0 12
CH11OUTPEN RW 0x0 11
CH10OUTPEN RW 0x0 10
RW 0x0 9
RW 0x0 8
RW 0x0 7
RW 0x0 6
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CH9OUTPEN
CH8OUTPEN
CH7OUTPEN
CH6OUTPEN
CH5OUTPEN
CH4OUTPEN
CH3OUTPEN
CH2OUTPEN
CH1OUTPEN
CH0OUTPEN
Name
31:16 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x59C
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5A0 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5A4
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5A8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5AC
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5B0 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5B4
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5B8 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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
Bit Name Reset Access Description
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5BC
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 0x0
PORT RW 0x0
Reset
Access
Name
PIN
31:20 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
15:2 Reserved To ensure compatibility with future devices, always write Reserved bits to their reset value, un-
less otherwise stated. More information in 1.2 Conventions
0x5C0 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