Efr32xg22 RM
Efr32xg22 RM
Reference Manual
The EFR32xG22 Wireless Gecko SoC includes the EFR32BG22, EFR32FG22, and KEY FEATURES
EFR32MG22 Wireless Gecko families. The EFR32xG22 improves processing capability
with a Cortex M33 core, while providing for lower active current for both the MCU and • 32-bit ARM® Cortex M33 core with up to
radio. This low power and application optimized device supports Bluetooth 5.2 (including 76.8 MHz maximum operating frequency
Direction Finding), Proprietary 2.4 GHz & Zigbee PRO/Green Power protocols. • Scalable Memory and Radio configuration
options available in QFN packaging
The EFR32xG22 solution provides industry-leading energy efficiency, processing capa-
bility, and RF performance in a small form factor for IoT connected applications. • Energy-efficient radio core with low active
and sleep currents
• Secure Boot with Root of Trust and
Secure Loader (RTSL)
• Integrated PA with up to 6 dBm transmit
power
HF Crystal HF
ARM CortexTM M33 processor Oscillator RC Oscillator
Flash Program Voltage DC-DC
with DSP extensions, Regulator Converter Crypto Acceleration
Memory
FPU and TrustZone Fast Startup Precision LF
RC Oscillator RC Oscillator
32-bit bus
Radio Subsystem Serial I/O Ports Timers and Triggers Analog I/F
Interfaces
TM
RFSENSE ARM Cortex
DEMOD External
w/ OOK Detect M0+ Radio USART
Interrupts
Timer/Counter Protocol Timer ADC
Controller
IFADC General Temperature
RX/TX Frontend BUFC RAM PDM
Purpose I/O
Low Energy Timer Watchdog Timer
Sensor
with Integrated PA
AGC Real Time Back-Up Real
FRC EUART Pin Reset
Capture Counter Time Counter
Frequency
Synthesizer MOD CRC I2C Pin Wakeup
silabs.com | Building a more connected world. Copyright © 2022 by Silicon Laboratories Rev. 1.1
Table of Contents
1. About This Document . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24
1.2 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
1.3 Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . .26
2. System Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
2.2 Block Diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
2.3 MCU Features overview . . . . . . . . . . . . . . . . . . . . . . . . . . .29
3. System Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
3.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
3.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . .32
3.3.1 Interrupt Operation . . . . . . . . . . . . . . . . . . . . . . . . . . .33
3.3.2 TrustZone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
3.3.3 Interrupt Request Lines (IRQ) . . . . . . . . . . . . . . . . . . . . . . .34
5. Radio Transceiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
5.1.1 RF Frequency Synthesizer . . . . . . . . . . . . . . . . . . . . . . . .46
5.1.2 Modulation Modes . . . . . . . . . . . . . . . . . . . . . . . . . . .47
5.1.3 Transmit Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
5.1.4 Receive Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
5.1.5 Data Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
5.1.6 Unbuffered Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . .47
5.1.7 Frame Format Support . . . . . . . . . . . . . . . . . . . . . . . . . .48
5.1.8 Hardware CRC Support . . . . . . . . . . . . . . . . . . . . . . . . .48
5.1.9 Convolutional Encoding / Decoding . . . . . . . . . . . . . . . . . . . . .48
5.1.10 Binary Block Encoding / Decoding . . . . . . . . . . . . . . . . . . . . .48
5.1.11 Data Encryption and Authentication . . . . . . . . . . . . . . . . . . . . .49
5.1.12 RFSENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
5.1.13 RF Test Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
9. Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
9.2 HFXO - High Frequency Crystal Oscillator . . . . . . . . . . . . . . . . . . . . 164
9.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 .
9.2.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 .
9.2.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 165
9.2.4 HFXO Register Map . . . . . . . . . . . . . . . . . . . . . . . . . . 168
9.2.5 HFXO Register Description . . . . . . . . . . . . . . . . . . . . . . .169
9.3 HFRCO - High-Frequency RC Oscillator . . . . . . . . . . . . . . . . . . . .180
9.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .180
9.3.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 .
9.3.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 180
9.3.4 HFRCO Register Map . . . . . . . . . . . . . . . . . . . . . . . . . 183
9.3.5 HFRCO Register Description . . . . . . . . . . . . . . . . . . . . . . . 184
9.4 DPLL - Digital Phased Locked Loop . . . . . . . . . . . . . . . . . . . . . . 188
9.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
.
9.4.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
.
9.4.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 188
9.4.4 DPLL Register Map . . . . . . . . . . . . . . . . . . . . . . . . . . 190
9.4.5 DPLL Register Description . . . . . . . . . . . . . . . . . . . . . . 191
.
9.5 LFXO - Low-Frequency Crystal Oscillator . . . . . . . . . . . . . . . . . . . . 196
9.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
.
9.5.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
.
9.5.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 196
9.5.4 LFXO Register Map . . . . . . . . . . . . . . . . . . . . . . . . . . 198
9.5.5 LFXO Register Description . . . . . . . . . . . . . . . . . . . . . . 1
. 99
9.6 LFRCO - Low-Frequency RC Oscillator . . . . . . . . . . . . . . . . . . . 2
. 06
9.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 206.
9.6.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 .
9.6.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 206
9.6.4 LFRCO Register Map . . . . . . . . . . . . . . . . . . . . . . . . .209
9.6.5 LFRCO Register Description . . . . . . . . . . . . . . . . . . . . . . . 210
9.7 FSRCO - Fast Start RCO . . . . . . . . . . . . . . . . . . . . . . . . .217
9.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
.
9.7.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217.
9.7.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 217
9.7.4 FSRCO Register Map . . . . . . . . . . . . . . . . . . . . . . . . . 217
9.7.5 FSRCO Register Description . . . . . . . . . . . . . . . . . . . . . . . 218
9.8 ULFRCO - Ultra Low Frequency RC Oscillator . . . . . . . . . . . . . . . . . .218
9.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 218.
9.8.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 .
9.8.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . 218
1.1 Introduction
This document contains reference material for the EFR32xG22 devices. All modules and peripherals in the EFR32xG22 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 37), 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 25.
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 EFR32xG22 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
Quick Facts
What?
0 1 2 3 4
The EFR32 Wireless Gecko is a highly integrated,
configurable and low power wireless System-on-
Chip (SoC) with a robust set of MCU and radio pe-
ripherals.
Why?
How?
2.1 Introduction
A further introduction to the MCU and radio system is included in the following sections.
Note: Detailed performance numbers, current consumption, pinout etc. are available in the device datasheets.
The block diagram for the EFR32xG22 System-On-Chip series is shown in (Figure 2.1 EFR32xG22 System-On-Chip Block Diagram on
page 28).
HF Crystal HF
ARM CortexTM M33 processor Oscillator RC Oscillator
Flash Program Voltage DC-DC
with DSP extensions, Regulator Converter Crypto Acceleration
Memory
FPU and TrustZone Fast Startup Precision LF
RC Oscillator RC Oscillator
32-bit bus
Radio Subsystem Serial I/O Ports Timers and Triggers Analog I/F
Interfaces
RFSENSE ARM CortexTM
DEMOD External
w/ OOK Detect M0+ Radio USART
Interrupts
Timer/Counter Protocol Timer ADC
Controller
IFADC General Temperature
RX/TX Frontend BUFC RAM PDM
Purpose I/O
Low Energy Timer Watchdog Timer
Sensor
with Integrated PA
AGC Real Time Back-Up Real
FRC EUART Pin Reset
Capture Counter Time Counter
Frequency
Synthesizer MOD CRC I2C Pin Wakeup
• 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 Capture Counter (RTCC)
• 32-bit Ultra Low Energy Backup Real Time Counter (BURTC) for periodic wake-up from any Energy Mode
• 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
• Analog Bus (ABUS) signal routing
• Accurate die temperature sensor
• External thermistor interface
• 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
3. System Processor
Quick Facts
What?
0 1 2 3 4
The EFR32xG22 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 EFR32xG22 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 in-
terrupts 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 EFR32xG22 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 and interrupt through the IF
register use of the IF_SET or IF_CLR bit operation registers is required; directly writing the main interrupt flag register will have no ef-
fect.
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 33 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 10. 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* CRYPTOACC
1* TRNG
2* PKE
3* SMU_SECURE
4* SMU_S_PRIVILEGED
5* SMU_NS_PRIVILEGED
6* EMU
7* TIMER0
8* TIMER1
9* TIMER2
10* TIMER3
11* TIMER4
12* RTCC
13* USART0_RX
14* USART0_TX
15* USART1_RX
16* USART1_TX
17* ICACHE0
18* BURTC
19* LETIMER0
20* SYSCFG
21* LDMA
22* LFXO
23* LFRCO
24* ULFRCO
25* GPIO_ODD
26* GPIO_EVEN
27* I2C0
28* I2C1
29* EMUDG
30* EMUSE
31* AGC
32* BUFC
33* FRC_PRI
IRQ # Name
34* FRC
35* MODEM
36* PROTIMER
37* RAC_RSM
38* RAC_SEQ
39* RDMAILBOX
40* RFSENSE
41* PRORTC
42* SYNTH
43* WDOG0
44* HFXO0
45* HFRCO0
46* CMU
47* AES
48* IADC
49* MSC
50* DPLL0
51* PDM
52* SW0
53* SW1
54* SW2
55* SW3
56* KERNEL0
57* KERNEL1
58* M33CTI0
59* M33CTI1
60* EMUEFP
61* DCDC
62* EUART0_RX
63* EUART0_TX
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 EFR32xG22 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 37.
Figure 4.1. System Address Space with Core and Code Space Listing
Flash for the main program memory (CODE) is located at address 0x00000000 in the memory map of the EFR32xG22.
SRAM for the main data memory (RAM) is located at address 0x20000000 in the memory map of the EFR32xG22. When running code
located in RAM, the Cortex-M33 uses the System bus interface to fetch instructions. This results in reduced performance as the Cortex-
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
SEQRAM
RDMAILBOX
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 or RADIO RAM controller detects a 2 bit 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
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 512 kB of memory
• Page size of 8 KB (minimum erase unit)
• Minimum 10k erase cycles endurance
• Greater than 10 years data retention at 85°C
• 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 for various purposes including general data memory (DRAM) and various RF subsystem
rams (SEQRAM, FRCRAM). For more detailed information see 6. MSC - Memory System Controller .
• Up to 32 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
Note: Root code requires some RAM storage during a system reset. The RAM used by root code is located at the top of the DRAM
memory space. If the user application requires RAM that persists through reset, it is recommended to use a statically allocated section
at the bottom of the SRAM memory space (address 0x20000000).
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.
2. LFRCO requires EM0, EM1, or EM2 when operating in precision mode, but can operate down to EM4 when precision mode is not
used.
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 EFR32xG22 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 contained
within a single bus access. Bit access registers and their addresses are shown in the register map for each peripheral. Peripherals 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 descri-
bed in more detail in 8. 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 peripheral'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 76.8 MHz when the core is at 38.4 MHz or
at 9.6 MHz when the core is 76.8 MHz. In this case CPU stalls of several PERCLK cycles do not significantly impact overall system
performance 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 76.8 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 EFR32xG22 Wireless Gecko for more information on on-demand clock sources.
Disabling a high frequency module will stall the CPU until all pending SYNC writes have completed and any pending enable has com-
pleted. If the module is fully enabled and no SYNC writes are pending, the disable will be instantaneous. Disabling low frequency pe-
ripheral which a LFSYNC is pending will result in a bus fault. Disabling a low frequency peripherals while an enable is still pending
causes no CPU stall.
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.
5. Radio Transceiver
Quick Facts
What?
0 1 2 3 4
The Radio Transceiver provides access to transmit
and receive data, radio settings and control inter-
face.
Why?
How?
5.1 Introduction
The Radio Transceiver of the EFR32 Series 2 enables the user to control a wide range of settings and options for tailoring radio opera-
tion precisely to the users need. It provides access to the transmit and receive data buffers and supports both dynamic and static frame
lengths, as well as automatic address filtering and CRC insertion/verification.
As seen in the Radio Overview illustration (Figure 5.1 Radio Overview on page 46), the radio consists of several modules all respon-
sible for specific tasks. Please refer to the abbreviations section (Appendix 1. Abbreviations) for a comprehensive description of acro-
nyms.
Radio Transceiver
Buffer Controller
IFADC
Demodulator
(BUFC)
RFIN LNA (DEMOD)
MATCH / FILTER
Frame Controller
IFADC
(FRC)
RFOUT0 PA0
Automatic
Fractional-N Gain Control
Radio Controller
Frequency (AGC)
RFOUT1 Synthesizer
(RAC)
PA1
Modulator
(MOD)
CRC
During transmission (TX), the Radio Controller enables the SYNTH, Modulator and PA. The Modulator requests data from the Frame
Controller, which reads data from a buffer. Based upon modulation format and data to send, the Modulator manipulates the SYNTH to
output the correct frequency and phase. When the whole frame has been transmitted, the radio can automatically switch to receive
mode.
In receive mode (RX), the radio controller enables the LNA, SYNTH, Mixer, ADC and Demodulator. The Demodulator searches for valid
frames according to modulation format and data rate. If a frame is detected, the demodulated data is handed to the Frame Controller,
which stores the data in the Buffer. When the complete frame has been received (determined by the Frame Controller), it is possible to
either go to TX or stay in RX to search for a new frame.
The Radio Transceiver interface is accessible through software drivers provided by Silicon Labs.
The Fractional-N RF Frequency Synthesizer (SYNTH) provides a low phase noise LO signal to be used in both receive and transmit
modes.
• 2-FSK, 2-GFSK, 4-FSK, MSK, GMSK, O-QPSK with half-sine shaping, ASK / OOK, DBPSK TX
• NRZ or Manchester support
• UART mode over air for legacy protocols
• Baudrates ranging from below 100 Baud/s to 2 MBaud/s, allowing data rates up to 4 MBit/s
• Configurable frequency deviation
• Configurable Direct Sequence Spread Spectrum (DSSS), with spread sequences up to 32 chips encoding up to 4 information bits
• Configurable 4-FSK symbol encoding
• Automatic PA power ramping during the start and end of a frame transmit
• Programmable output power
• Optional preamble and synchronization word insertion
• Accurate transmit frame timing to support time synchronized radio protocols
• Optional Carrier Sense Multiple Access - Collision Avoidance (CSMA-CA) or Listen Before Talk (LBT) hardware support
• Integrated transmit test modes, as described in 5.1.13 RF Test Modes
• A single-ended LNA amplifies the input RF signal. The amplified signal is then mixed to a low-IF signal through the quadrature
down-coversion mixer. Further signal filtering is performed before conversion to a digital signal through the I/Q ADC.
• Digitally configurable receiver bandwidth from 100 Hz to 2.5 MHz
• Timing recovery on received data, including simultaneous support for two different frame synchronization words
• Automatic frequency offset compensation, to compensate for carrier frequency offset between the transmitter and receiver
• Support for a wide range of modulation formats as described in section 5.1.2 Modulation Modes
EFR32xG22 supports buffered transmit and receive modes through its buffer controller (BUFC), with four individually configurable buf-
fers. The BUFC uses the system RAM as storage, and each buffer can be individually configured with parameters such as:
• Buffer size
• Buffer interrupt thresholds
• Buffer RAM location
• Overflow and underflow detection
In receive mode, data following frame synchronization is moved directly from the demodulator to the buffer storage.
In transmit mode, data following the inserted preamble and synchronization word is moved directly from the buffer storage to the modu-
lator.
For most system designs it is recommended to use the data buffering within EFR32xG22 to provide a convenient user interface.
In unbuffered data transfer modes the hardware support provided by EFR32xG22 to perform preamble and frame synchronization in-
sertion in transmit mode and detection in receive mode can still optionally be used.
EFR32xG22 has an extensive support for frame handling in transmit and receive modes, which allows effective handling of even ad-
vanced protocols. The frame format support is controlled by the Frame Controller (FRC). The support includes:
EFR32xG22 supports a configurable CRC generation in transmit and verification in receive mode:
EFR32xG22 includes hardware support for convolutional encoding and decoding, for forward error correction (FEC). This feature is per-
formed by the Frame Controller (FRC) module:
EFR32xG22 includes hardware support for binary block encoding and decoding, both performed real-time in the the transmit and re-
ceive path. This is performed in the Frame Controller (FRC) module:
The block coding works on blocks of up to 16 bits of data and adds parity bits to be capable of single or multiple bit corrections by the
receiver.
EFR32xG22 has hardware support for AES encryption, decryption and authentication modes. These security operations can be per-
formed on data in RAM or any data buffer, without further CPU intervention. The key size is 128 bits.
AES modes of operations directly supported by the EFR32xG22 hardware are listed in Table 5.1 AES modes of operation with hard-
ware support on page 49. In addition to these modes, other modes can also be implemented by using combinations of modes. For
example, the CCM mode can be implemented using the CTR and CBC-MAC modes in combination.
The Cryptographic Acceleration module can operate directly on data buffers provided by the buffer controller (BUFC) module. It is also
possible to provide data directly from the embedded Cortex-M33 or via DMA.
5.1.12 RFSENSE
The RFSENSE block on the EFR32xG22 is an ultra-low energy RF signal detector which provides wake-on-RF capabilites from any
energy mode. The system can remain in low energy modes such as EM2 or EM4 for long durations while continuously monitoring for a
valid wake condition. RFSENSE can operate as a selective On Off Keying (OOK) detector, or a simple RF energy detector.
EFR32xG22 supports a wide range of RF test modes typically used for characterization and regulation compliance testing, including:
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.
6.1 Introduction
The Memory System Controller (MSC) is the program memory unit of the EFR32xG22 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.
6.2 Features
The size of the main flash block is device dependent. The largest size available is 512 kB (64 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 0x00000000 and the information block is mapped to address 0x0FE00000. Table 6.1 MSC Flash Memory Mapping on
page 51 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 0x00000000 Software, debug Yes User code and data 16 kB - 512 kB
Note:
1. 64 pages for largest device.
The SYSCFG module contains controls for configuring the various RAM blocks on the device. Options include enabling EM2/EM3 data
retention, ECC, prefetch, and cache. For a complete description see 6.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 6.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 6.4 DEVINFO - Device Info Page.
This is the user data page in the information block. The page can be erased and written by software.
This page is written in the same way as any page in the Main user code area.
6.3.5 Bootloader
The EFR32xG22 supports use of the Gecko Bootloader detailed in UG266: Silicon Labs Gecko Bootloader User’s Guide (https://
www.silabs.com/support/resources).To enable bootloader functionality the second stage of the bootloader must be configured and pro-
grammed into the beginning of flash.
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 wakeup 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, radio-only sleep, 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 or radio-only 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.
6.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 cy-
cles. With this scheme, performance is optimized at the cost of higher energy consumption as the processor fetches more instructions
from memory than it actually executes. To disable the mode, write a 1 to the DISFOLD bit in the NVIC Auxiliary Control Register; see
the Cortex-M33 Technical Reference Manual for details. Normally, it is expected that this feature is most efficient when operating 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.
The 20 MHz FSRCO is used for timing during flash write and erase operations. The default values in MSC_FLASHPROGRAMTIME
and MSC_FLASHERASETIME contain the recommended programming configuration.
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 cy-
cles. 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/
erase time, halving the write/erase 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.
Similarly, code may lock the user data page by setting UDLOCKBIT in MSC_MISCLOCKWORD, and mass erase may be disabled by
setting MELOCKBIT in MSC_MISCLOCKWORD.
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.)
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
0x0
0x0
Reset
Access
DEVINFOREV R
R
Name PRODREV
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
1 MG Mighty Gecko
2 BG Blue Gecko
5 PG Pearl 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
25
24
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
RF4CE
Name
SRI
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
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
3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
RFMCUEN R
NCPEN
Name
GWEN
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
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
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
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
30 PHYLIMITED 0x1 R
PHY Limited
0 LIMITED
1 UNLIMITED
29 PADCDC 0x1 R
PAVDD Connection
Counter allowing unique identification of module per lookup when combined with MODNUMBER
19 HFXOCALVAL 0x1 R
18 LFXOCALVAL 0x1 R
17 EXPRESS 0x1 R
16 LFXO 0x1 R
15 TYPE 0x1 R
Module Type
0 PCB PCB
1 SIP SIP
Counter allowing unique identification of module per lookup when combined with MODNUMBER MSB
1 CONNECTOR RF Connector
2 RFPAD RF Pad
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
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
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 accesses 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 6.1 Instruction Cache Block Diagram on page 83. 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 is 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 informational only, and can be used to detect the rate of corruption
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 effec-
ted.
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
The SYSCFG block is used to configure SRAM. It also contains some interrupt flags for software use. The system has the following
major SRAM blocks:
• DMEM0 - Primary system data memory (RAM)
• FRCRAM - Frame Rate Controller SRAM
• SEQRAM - Sequencer SRAM
• DEMODRAM - Demodulator SRAM
DMEM0 is broken into two 24 KB and 8 KB banks, beginning at address 0x20000000 and 0x20006000, respectively. By default both
banks are retained in EM2/EM3. Sleep mode current can be significantly reduced by powering down a bank that does not need to be
retained. RAMRETNCTRL in the SYSCFG_DMEM0RETNCTRL register controls which banks are retained in EM2/EM3.
Note: Root code requires some RAM storage during a system reset. The RAM used by root code is located at the top of the DRAM0
memory space. If the user application requires RAM that persists through reset, it is recommended to use a statically allocated section
at the bottom of the SRAM memory space (address 0x20000000).
FRCRAM and all or part of SEQRAM may be powered down in EM2/EM3 if not required. To control retention of these areas, set
FRCRAMRETNCTRL or SEQRAMRETNCTRL in SYSCFG_RADIORAMRETNCTRL to the desired value.
6.6.2 ECC
DMEM0, FRCRAM, and SEQRAM support one bit correction and two bit detection ECC. To enable error detection for DMEM0, set
RAMECCCHKEN in SYSCFG_DMEM0ECCCTRL. To enable auto-correction of one bit errors in DMEM0, set RAMECCEWEN in
SYSCFG_DMEM0ECCCTRL. To enable error detection for FRCRAM and SEQRAM, set FRCRAMECCCHKEN and SEQRA-
MECCCHKEN in SYSCFG_RADIOECCCTRL. To enable auto-correction of one bit errors in FRCRAM and SEQRAM, set FRCRAMEC-
CEWEN and SEQRAMECCEWEN in SYSCFG_RADIOECCCTRL.
When ECC error events are detected, the corresponding flags in SYSCFG_IF are set. When a flag is set, an interrupt will be triggered if
the corresponding interrupt enable bit is set in SYSCFG_IEN.
When an error occurs, the address of the detected error is written to SYSCFG_DMEM0ECCADDR, SYSCFG_FRCRAMECCADDR, or
SYSCF_SEQRAMECCERR depending on the source of the error.
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.
0x000
31
30
FRCRAMERR2B RW 0x0 29
FRCRAMERR1B RW 0x0 28
27
26
SEQRAMERR2B RW 0x0 25
SEQRAMERR1B 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
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RAMERR2B
RAMERR1B
Name
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: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
0x004 31
30
FRCRAMERR2B RW 0x0 29
FRCRAMERR1B RW 0x0 28
27
26
SEQRAMERR2B RW 0x0 25
SEQRAMERR1B 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
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
RAMERR2B
RAMERR1B
Name
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: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
12
11
10
9
8
7
6
5
4
3
2
1
0
FAMILY RW 0x30
0x0
0x1
Reset
RW
MAJOR RW
Access
MINOR
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
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
RW 0x0
FAMILY RW 0x0
MAJOR RW 0x0
Reset
Access
MINOR
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
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
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
1
RW 0x1 0
Reset
Access
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 Enable
When this bit is set, busfaults are generated if a 2-bit ECC error occurs.
4: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
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: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
DMEM0 RAM blockset retention controls in EM23 with full access in EM01.
0x210
31
30
29
28
27
26
25
24
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
DMEM0ECCADDR R
Name
Indicates the address in system RAM at which an ECC error has occurred.
0x214 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
RAMECCEWEN RW 0x0 1
RW 0x0 0
Reset
Access
RAMECCEN
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 set, 1-bit ECC errors will be corrected and written back to RAM when encountered.
When set, this bit enables the generation and checking of ECC for RAM.
0x400 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
FRCRAMRETNCTRL RW 0x0 8
7
6
5
4
3
2
1
0
SEQRAMRETNCTRL RW 0x0
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
7: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
FRCRAMECCEWEN RW 0x0 9
RW 0x0 8
7
6
5
4
3
2
SEQRAMECCEWEN RW 0x0 1
RW 0x0 0
Reset
Access
SEQRAMECCEN
FRCRAMECCEN
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
FRC ECC Error Writeback Enable. When set, errors will be corrected when encountered.
7: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
SEQRAM ECC Error Writeback Enable. When set, errors will be corrected when encountered.
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
0x0
Reset
Access
SEQRAMECCADDR R
Name
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
0x0
Reset
Access
FRCRAMECCADDR R
Name
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 31
30
29
28
27
26
25
0x1 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
0x0 4
3
0x1 2
0x1 1
0x1 0
Reset
Access
USERDBGAPLOCK R
R
R
R
R
R
R
R
ROOTMODELOCK
USERSPNIDLOCK
RADIODBGLOCK
USERSPIDLOCK
ROOTDBGLOCK
USERDBGLOCK
USERNIDLOCK
Name
MFRLOCK
REGLOCK
BUSLOCK
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: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: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 Reserved 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
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.
0x008 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
DOUTBUFEN RW 0x0 12
11
10
9
8
7
6
5
4
3
2
1
0
RW 0x2
Reset
Access
Name
MODE
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
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.
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
Flash dout buffer prefetch enable. Once disabled, every read will be a new flash read operation even the new read from
the same flash entry as previous read (prefetch hit).
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
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
Reset
Access
Name
LPWRITE
WREN
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
When set, user 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 User 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
4
3
0x0 2
0x0 1
0
Reset
Access
CLEARWDATA W
ERASEABORT 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. Before use, MSC_MASSLOCK must be unlocked. To completely prevent access
from software, clear bit 0 in the mass erase lock-word (MLW)
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
4: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_ADDR. 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
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
ERASEABORTED
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
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
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_CTRL, MSC_READCTRL, MSC_WRITECTRL. Write
the unlock code to enable access. When reading the register, bit 0 is set when the lock is enabled.
6.8.13 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 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 PWROFFSTDLY.
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
Quick Facts
What?
0 1 2 3 4
The Debug Interface is used to program and debug
EFR32xG22 devices.
Why?
How?
7.1 Introduction
The EFR32xG22 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
7.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 (TRACEDATA0): The trace data pin provides the compressed trace stream. This pin is 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?
8.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.
8.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 EFR32xG22 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 8.1 Bus Clocks on page 127.
Clock selection for peripherals with multiple high-frequency clock sources is shown in Figure 8.2 High Frequency Peripheral Clocks on
page 128. Clock selection for peripherals with multiple low-frequency clock sources is shown in Figure 8.3 Low Frequency Peripheral
Clocks on page 129. Clock selection for peripherals that can select from a high or low frequency clock source is shown in Figure
8.4 Mixed Frequency Peripheral Clocks on page 130.
· Available in EM0/EM1/EM2/EM4
I2C0 LETIMER APB
· Available in EM0/EM1/EM2/EM3/EM4 clock
prescaler LSPCLK clock IADCn APB UART APB
gate
/2 gate RTCC APB WDOGn APB
AMUXCPn APB
CMU_CLKEN*
FSRCO
USARTn GPCRC ICACHE APB
clock
prescaler PCLK clock I2C1 EMU APB IMEM APB
gate
/1, /2 gate PRS CMU APB LDMA APB
GPIO TIMERn APB LDMAXBAR
HFXO
FSRCO CMU_SYSCLKCTRL. CMU_CLKEN* SYSCFG APB
PCLKPRESC
HFXO DCDC APB
HFRCODPLL clock M33 PDM APB
switch prescaler clock
feedback CLKIN0 SYSCLK HCLK clock ICACHE RFSENSE APB
/1, /2, gate
tuning gate IMEM BURAM APB
HFRCO /4, /8, /16
DPLL
DPLL LDMA BURTC APB
reference CMU_SYSCLKCTRL. CMU_CLKEN* SMU DPLLn APB
HCLKPRESC
CLKIN0 CRYPTO AHB HFRCOn APB
CMU_SYSCLKCTRL. AES HFXOn APB
CLKSEL
RAM/ROM FSRCO APB
LFRCO APB
LFXO APB
CMU_CRYPTOCLKCTRL.
AESEN
CMU_DPLLREFCLKCTRL.
CLKSEL
clock CRYPTO PK
gate
CMU_CRYPTOCLKCTRL.
PKEN
EXPORTCLK
prescaler
CMU_EXPORTCLKCTRL.
PRESC
CMU_EM01GRPACLKCTRL.CLKSEL
HFRCODPLL
HFXO
FSRCO EM01GRPBCLK
clock PDM
CLKIN0
switch
HFRCODPLLRT
HFXORT
CMU_EM01GRPBCLKCTRL.CLKSEL
EM01GRPACLK
clock IADCCLK
IADC
FSRCO switch
CMU_IADCCLKCTRL.CLKSEL
LFXO
LFXO
LFRCO clock EM23GRPACLK
LFRCO* LETIMERn
ULFRCO switch
CMU_EM23GRPACLKCTRL.CLKSEL
ULFRCO
LFXO
LFRCO
clock
ULFRCO WDOGnCLK
switch WDOGn
HCLK prescaler
/1024
CMU_WDOGnCLKCTRL.CLKSEL
LFXO
LFRCO clock RTCCCLK
RTCC
ULFRCO switch
CMU_RTCCCLKCTRL.CLKSEL
LFXO
LFRCO clock PRORTCCLK
PRORTC
ULFRCO switch
Availability of oscillators and clocks in Energy Modes:
HFXO
LFXO clock DPLLREFCLK
DPLL
CLKIN0 switch
CMU_DPLLREFCLKCTRL.CLKSEL
EM01GRPACLK
clock EUARTCLK
EUART
EM23GRPACLK switch
CMU_UARTCLKCTRL.CLKSEL
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. By default,
the FSRCO is selected as the bootup oscillator. 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.
The HFXO clock is fed directly to the Radio Transceiver. The clock received by the Radio Transceiver is therefore not affected by the
selected clock source for SYSCLK nor by any clock prescaler.
HCLK is a prescaled version of SYSCLK. This clock drives the AHB bus interface. Example modules include the CPU, Cache, Bus
Matrix, MSC, RAM, LDMA and GPIO. 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. Example modules include USART and I2C. 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 maximum frequency when HCLK is operated at above 40 MHz. The setting can be changed dynami-
cally 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. Example modules include I2C. 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 completely when not in use. This is done by clearing the module enable (EN) bit in the module's EN register.
The radio AHB clock (RHCLK) is a prescaled version of SYSCLK. The maximum frequency for RHCLK is 40 MHz. The RHCLKPRESC
setting in CMU_SYSCLKCTRL allows for SYSCLK to pass through (DIV1) or apply a divide-by-2 (DIV2) to the clock.
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, and FSRCO. In addi-
tion, 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.
EM01GRPBCLK is the selected clock for the Group B Peripherals operating in Energy Modes 0 or 1. These are typically high clock
frequency peripheral modules. There are several selectable sources for EM01GRPBCLK: HFXO, HFRCODPLL, FSRCO, CLKIN0,
HFRCODPLLRT, and HFXORT. In addition, the EM01GRPBCLK can be disabled. The selection is configured using the CLKSEL field
in CMU_EM01GRPBCLKCTRL.
Each High Frequency Peripheral that is clocked by EM01GRPBCLK 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 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.
UARTCLK is the selected clock for the EUART peripheral, and can choose between EM01GRPACLK and EM23GRPACLK. UARTCLK
is selected via the CLKSEL field in CMU_UARTCLKCTRL. If operating in EM2, the EM23GRPACLK option must be chosen, as
EM01GRPACLK will be shut down in these lower energy modes.
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 8.5 CMU Switching From HFRCO to
HFXO Before HFXO is Ready on page 133 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 8.6 CMU Switching From HFRCO to HFXO After HFXO is
Ready on page 134.
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 8.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 8.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 (HFRCODPLL) at run-time or measure the timing of other
periodic signals routed via PRS, see Figure 8.7 Hardware Support for RC Oscillator Calibration on page 135 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 8.8 Single Calibration (CONT=0) on page 136 and Figure
8.9 Continuous Calibration (CONT=1) on page 137 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
(HFRCODPLL and HFXO) and high frequency clocks (SYSCLK, HCLK, PCLK, RADIOCLK, and EM01GRPACLK) are available down
to EM1 Sleep. From EM2 DeepSleep onwards these oscillators and clocks are normally off, although special cases exist as summar-
ized in Table 8.1 Oscillator and Clock Availability in Energy Modes on page 138. The CMU overview figure in also indicates 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 (in non-precision mode) can be requested in EM4 as
needed. When the LFRCO precision mode is used, this oscillator cannot operate in EM4. The ultra low frequency oscillator (ULFRCO)
is on in all energy modes, except for EM4 Shutoff, but it can be requested on in that state as well if needed. The low frequency clocks
(EM23GRPACLK, EM4GRPACLK, WDOGCLK, RTCCCLK, and PRORTCCLK) are in various power domains and therefore their avail-
ability not only depends on the chosen clock source, but also on the chosen energy mode as indicated in Table 8.1 Oscillator and Clock
Availability in Energy Modes on page 138.
FSRCO On 1 On 2 On 2 Off
ULFRCO On On On On 3
IADCCLK On 1 On 2 On 2 Off
EM4GRPACLK On 1 On 1 On 5 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.
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.
The CMU CLKOUTn signals can be used as PRS producers (see 13.3.3 Producers for more detail on PRS producers).
The CLKOUTSELn fields in CMU_EXPORTCLKCTRL described in 8.3.5 Clock Output are used to select the source of each CLKOUTn
signal. CLKOUTn signals used as PRS producers may be simultaneously routed to GPIO, but this is not required to use CLKOUTn as a
PRS producer.
8.3.8 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.
8.3.9 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
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.
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
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
LDMAXBAR RW 0x0 1
RW 0x0 0
Reset
Access
RADIOAES
LETIMER0
AMUXCP0
ULFRCO
HFRCO0
SYSCFG
EUART0
USART1
USART0
WDOG0
TIMER3
TIMER2
TIMER1
TIMER0
BURAM
GPCRC
FSRCO
BURTC
LFRCO
Name
HFXO0
DPLL0
IADC0
DCDC
RTCC
LDMA
LFXO
GPIO
PDM
I2C1
I2C0
PRS
0x068 31
30
29
28
27
26
25
24
23
22
21
20
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
RDSCRATCHPAD 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
IFADCDEBUG
RDMAILBOX1
RDMAILBOX0
CRYPTOACC
PROTIMER
Name
RFSENSE
ICACHE0
PRORTC
MODEM
TIMER4
RFCRC
SYNTH
BUFC
MSC
SMU
AGC
RAC
FRC
Bit Name Reset Access Description
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
0x070 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
RHCLKPRESC RW 0x0 16
15
14
13
12
11
RW 0x0 10
9
8
7
6
5
4
3
2
RW 0x1 1
0
RW 0x0
Reset
Access
HCLKPRESC
PCLKPRESC
Name
CLKSEL
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
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
PRESC RW 0x0
Reset
Access
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
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
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
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
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
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
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
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
This bit controls which clock is used for UART. EM01GRPACLK should never be selected as clock source for UART
when disabling the EM01GRACLK (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
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
AESEN RW 0x0 1
RW 0x0 0
Reset
Access
PKEN
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
0x280
DBGCLK 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
RW 0x0 0
Reset
Access
Name
EN
Bit Name Reset Access Description
When set to 1, this forces radio busmatrix and RAC clocks to run, allowing RAC sequencer debugger to stay attached.
30: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
0 EN 0x0 RW Enable
9. Oscillators
Quick Facts
What?
0 1 2 3 4
The EFR32xG22 has a wide range of high frequency
and low frequency oscillators.
Why?
How?
9.1 Introduction
The EFR32xG22 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.
9.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.
9.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.
9.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 9.1 HFXO Pin Connection on page 166.
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.
Hardware can request to enable the HFXO by setting the HFXO_STATUS.HWREQ bit field. The HFXO can also optionally be config-
ured via the HFXO_STATUS.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. On-demand HFXO enable can be used, for example,
upon wake-up of the Radio Controller (RAC). The RAC module always requires the HFXO for its operation. Any hardware request for
HFXO, including request from RAC, 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.
A typical use scenario of the on-demand feature is as follows. Set up the RTCC to periodically generate a compare match. Setup a
PRS channel which uses this RTCC compare match as its source to cause a wake-up into EM1. Setup the RAC to use the PRS chan-
nel as its source for TXEN or RXEN. Now, when the EFR32 is in EM2 and the RTCC generates a compare match, a wake-up into EM1
occurs, and the HFXO will automatically start. When HFXO is ready, the RAC performs its work and triggers a transition back into EM2
when finished. The system starts, uses, and stops the HFXO without ever being in EM0.
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.
9.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.
9.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. Next, issue the
MANUALOVERRIDE command in the HFXO_CMD register to update the control registers and configuration registers with FSM values,
allowing software direct control of the oscillator. 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.
9.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.
Note: While the HFXO can support crystals with a tuning range of 38 MHz to 40 MHz, the radio specifically requires a 38.4 MHz crystal.
There may also be specific crystal tolerance requirements for each RF protocol supported by the radio.
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.
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 0x13
0xB
0x4
0x4
0x3
0x3
Reset
RW
RW
RW
RW
COREBIASSTARTUPI 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 T125US The steady state timeout is set to 125 us minimum. The maxi-
mum can be +40%.
4 T166US The steady state timeout is set to 166 us minimum. The maxi-
mum can be +40%.
5 T208US The steady state timeout is set to 208 us minimum. The maxi-
mum can be +40%.
6 T250US The steady state timeout is set to 250 us minimum. The maxi-
mum can be +40%.
7 T333US The steady state timeout is set to 333 us minimum. The maxi-
mum can be +40%.
8 T416US The steady state timeout is set to 416 us minimum. The maxi-
mum can be +40%.
9 T500US The steady state timeout is set to 500 us minimum. The maxi-
mum can be +40%.
10 T666US The steady state timeout is set to 666 us minimum. The maxi-
mum can be +40%.
11 T833US The steady state timeout is set to 833 us minimum. The maxi-
mum can be +40%.
12 T1666US The steady state timeout is set to 1666 us minimum. The maxi-
mum can be +40%.
13 T2500US The steady state timeout is set to 2500 us minimum. The maxi-
mum can be +40%.
14 T4166US The steady state timeout is set to 4166 us minimum. The maxi-
mum can be +40%.
15 T7500US 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 0x8C
RW 0x8C
RW 0x10
0x0
0x3
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
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
SQBUFSCHTRGANA RW 0x0 3
RW 0x0 2
1
RW 0x0 0
Reset
Access
ENXIDCBIASANA
Name
MODE
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
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
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
FORCEXO2GNDANA RW 0x0 5
RW 0x0 4
3
RW 0x0 2
RW 0x1 1
RW 0x0 0
Reset
Access
FORCEXI2GNDANA
DISONDEMAND
KEEPWARM
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 to enable grounding of XI pin. Do not enable if MODE=EXTCLK and an external source is supplied.
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
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.
Set to ignore hardware request enabling the crystal oscillator. This bit must be set in order to modify various CFG and
CTRL registers while FSMLOCK is deasserted.
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
MANUALOVERRIDE W(nB) 0x0 1
W(nB) 0x0 0
Reset
Access
COREBIASOPT
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
Updates APB registers with FSM values. When update completes, switch analog control signals from FSM to APB, al-
lowing software to control the oscillator directly. Only issue this command when COREBIASOPTRDY is asserted, or the
command is ignored.
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 40degC. 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
21
20
0x0 19
18
0x0 17
0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
0x0 1
0x0 0
Reset
Access
R
R
R
R
COREBIASOPTRDY R
R
Name
FSMLOCK
ISWARM
HWREQ
LOCK
RDY
ENS
Bit Name Reset Access Description
29: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
Oscillator is currently kept in warm state. Re-eable 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.
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
Core bias optimization algorithm is complete. New core bias value updated to XTALCTRL.
Access
Name
DNSERR
RDY
Bit Name Reset Access Description
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: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
Name
DNSERR
RDY
Bit Name Reset Access Description
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: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
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.
9.3.1 Introduction
9.3.2 Features
• 1 MHz - 80 MHz High Frequency RC Oscillator with DPLL working in EM01 (HFRCODPLL)
• Low start-up time
• Run-time band change or tuning
9.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.
Hardware can request to enable the HFRCO by setting the HFRCO_STATUS.HWREQ bit field. The HFRCO can also optionally be
configured via the HFRCO_STATUS.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. 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.)
9.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
HFRCODPLLCAL1 5 MHz
HFRCODPLLCAL3 7 MHz
HFRCODPLLCAL4 10 MHz
HFRCODPLLCAL6 13 MHz
HFRCODPLLCAL7 16 MHz
HFRCODPLLCAL9 20 MHz
HFRCODPLLCAL10 26 MHz
HFRCODPLLCAL11 32 MHz
HFRCODPLLCAL12 38 MHz
HFRCODPLLCAL13 48 MHz
HFRCODPLLCAL14 56 MHz
HFRCODPLLCAL15 64 MHz
HFRCODPLLCAL16 80 MHz
9.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.
9.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.
9.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.
9.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.
9.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 the it. Which in most cases is whenever the module 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
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
DISONDEMAND RW 0x0 1
RW 0x0 0
Reset
Access
FORCEEN
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
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.
9.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.
9.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 should be used unless specific phase require-
ment exists.
9.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
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
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
0 UNLOCKED
1 LOCKED
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.
28930 UNLOCK
9.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.
9.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
9.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.
9.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.
The clock should not be used immediately after enabling LFXO, until the clock 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 TIMEOUT bit field in the LFXO_CFG register. The TIMEOUT default value is
set the 32,728 cycles, which is much more than necessary for stabilization. The stabilization time required will depend on the particular
crystal, oscillator settings, and frequency accuracy requirements. A value of 4096 clocks is generally recommended for most applica-
tions. A low timeout 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 qualify-
ing 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 dur-
ing the next instruction. 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 avail-
able in LFXO_IF register. 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
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
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 0x2
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.
9.6.1 Introduction
The LFRCO is an integrated low-frequency (32.768 kHz) RC oscillator. It can be used as a timing reference in EM0, EM1, EM2, and
EM4. On certain part numbers a precision mode is available in EM0, EM1 and EM2. Precision mode enables hardware that periodically
recalibrates the LFRCO against the HFXO crystal frequency when temperature changes to provide a fully interenal 32.768 kHz clock
source with +/-500 ppm accuracy. Consult the device data sheet for details on which part numbers support precision mode.
9.6.2 Features
9.6.3.1 Start-up
The LFRCO has a fast start-up time. Please refer to the data sheet electrical specifications for the exact start-up time. When the oscilla-
tor has started up and is ready to use, the RDY status bit will go high and the RDY interrupt will be triggered. After startup, it may take
two cycles for the clock to propagate through the CMU to the peripherals.
Hardware can request to enable the LFRCO by setting the LFRCO_STATUS.HWREQ bit field. The LFRCO can also optionally be con-
figured via the LFRCO_STATUS.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.
The LFRCO configuration registers NOMCAL, NOMCALINV and CFG can be locked or unlocked by software using the LOCKKEY field
in the LFRCO_LOCK register. By writing the UNLOCK value to LFRCO_LOCK_LOCKKEY, these registers will be unlocked and acces-
sible to software. Any other value written to LFRCO_LOCK_LOCKKEY will lock the registers against write operations.
Certain device families support a precision mode to bring the LFRCO accuracy to within +/-500 ppm, suitable for BLE sleep applica-
tions. Precision mode uses hardware to automatically re-calibrate the LFRCO against a crystal driven by the HFXO. Hardware detects
temperature changes and initiates a re-calibration of the LFRCO as needed when operating in EM0, EM1, or EM2. If a re-calibration is
necessary and the HFXO is not active, the precision mode hardware will automatilcally enable HFXO for a short time to perform the
calibration. EM4 operation is not allowed while precision mode is enabled.
To enable precision mode software should set the LFRCO_CFG_HIGHPRECEN bit to 1 while the LFRCO is disabled (LFRCO_STA-
TUS_ENS = 0). If this bit is written while the oscillator is enabled, a bus fault will be generated. In a typical application, software will only
access HIGHPRECEN at startup before any peripherals are configured to request the LFRCO.
Disabling precision mode is the inverse - software should ensure that no peripherals are requesting the LFRCO, and then clear the
LFRCO_CFG_HIGHPRECEN bit to 0.
Precision mode uses a reference clock from the HFXO as a calibration target. By default, a 38.4 MHz crystal clock source is assumed.
38.4 MHz is the only frequency supported by many of Silicon Labs' RF software stacks, and the default value should not normally be
changed. Precision mode does support operation with different frequency crystals, however. Two registers (LFRCO_NOMCALCNT and
LFRCO_NOMCALCNTINV) are used to specify the nominal relationship between the reference clock and the LFRCO frequency as
shown in Figure 9.2 LFRCO_NOMCALCNT Calculation on page 207 and Figure 9.3 LFRCO_NOMCALCNTINV Calculation on page
207. NOMCALCNT and NOMCALCNTINV must be set up while the LFRCO is not enabled.
When starting up in precision mode, the LFRCO will calibrate itself against the HFXO. After startup, the die temperature is checked
periodically and if necessary, the LFRCO will initiate a re-calibration. Periodic re-calibration is also performed if the temperature has not
changed for an extended period of time.
If a very high die temperature gradient is expected (e.g. due to high-power RF transmission), software can reduce the temperature
check interval temporarily by setting the LFRCO_CMD_REDUCETCINT bit to 1. The LFRCO will then use a shorter temperature check
interval until the chip enters EM2. When EM2 is entered, the temperature-check interval will gradually be increased based on the meas-
ured temperature gradient until it is back to the normal temperature check interval.
9.6.3.5 Interrupts
The LFRCO implements several interrupt flags in the LFRCO_IF register to report status, error events, or for debugging. Each interrupt
flag has an enable bit in LFRCO_IEN. Setting a bit in IEN to 1 enables the corresponding interrupt source to trigger an LFRCO inter-
rupt.
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). Note that enabling NEGEDGEIF or POSEDGEIF act as a clock
requester for the LFRCO oscillator, and these two interrupt enables must be disabled in order to disable the LFRCO.
RDYIF, POSEDGEIF, and NEGEDGEIF are available only in EM0 and EM1.
Three of the interrupt sources are error flags used by precision mode to alert software that there is a problem with the oscillator and it
may no longer be running with full precision. CALOORIF indicates that a calibration was performed, but the result was outside of the
oscillator's adjustment range. TCOORIF indicates that a temperature measurement was performed, but the measurement was out of
range. Finally, the SCHEDERRIF flag indicates that a temperature check could not be performed due to a prior error. These three error
flags are available when operating in precision mode in EM0, EM1, or EM2.
The remaining flags, TEMPCHANGEIF, CALDONEIF and TCDONEIF are available when operating in precision mode in EM0 and EM1
only and are provided for debugging purposes. Refer to the LFRCO_IF register description for the specific conditions of these flags.
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
DISONDEMAND RW 0x0 1
RW 0x0 0
Reset
Access
FORCEEN
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
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
0x014 31
30
29
28
27
26
25
24
23
22
21
20
19
RW 0x0 18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
TEMPCHANGE RW 0x0 10
RW 0x0 9
RW 0x0 8
7
6
5
4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
SCHEDERR
NEGEDGE
POSEDGE
CALDONE
CALOOR
TCDONE
Name
TCOOR
RDY
Bit Name Reset Access Description
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
Triggers if a scheduled Temperature Check can not be handeled because prior Termperature Check or Calibration did
not complete.
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
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
Triggers on every negative edge of the LFRCO clock. IF will only be set when corresponding IEN is set.
Triggers on every positive edge of the LFRCO clock. IF will only be set when corresponding IEN is set.
0x018 31
30
29
28
27
26
25
24
23
22
21
20
19
RW 0x0 18
RW 0x0 17
RW 0x0 16
15
14
13
12
11
TEMPCHANGE RW 0x0 10
RW 0x0 9
RW 0x0 8
7
6
5
4
3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
SCHEDERR
NEGEDGE
POSEDGE
CALDONE
CALOOR
TCDONE
Name
TCOOR
RDY
Bit Name Reset Access Description
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
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
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
Enables the negedge interrupt and will cause the oscillator to run
Enables the posedge interrupt and will cause the oscillator to run
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
Writing the lock key will unlock the LFRCO configuration registers. Writing any other value will lock them.
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
HIGHPRECEN 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
LFRCO operates in High Precision Mode when this bit is set. HIGHPRECEN should not be written while LFRCO is ena-
bled.
0x02C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
NOMCALCNT RW 0x5B8D8 10
9
8
7
6
5
4
3
2
1
0
Reset
Access
Name
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
Expected Calibration count value. Should be set based on HFXO frequency; NOMCALCNT = 2 * f(HFXO) / (32.768 kHz /
160). Default value corresponds to 38.4 MHz HFXO frequency. NOMCALCNT should not be written while LFRCO is ena-
bled.
0x030
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
NOMCALCNTINV RW 0x597A 8
7
6
5
4
3
2
1
0
Reset
Access
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
This register should always be set to the inverse of NOMCALCNT value. Due to format of this register, integer value
should be NOMCALCNTINV = (1 / NOMCALCNT) * (2**33). NOMCALCNTINV should not be written while LFRCO is en-
abled.
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
REDUCETCINT 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
Setting this register field will temporarily lower the Temperature Check interval.
9.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.
9.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.
9.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.
9.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
10.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.
10.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 10.1 Bus Level Security
Implementation on page 220. 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
10.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 10.1 Privileged Access Table on page 221.
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 status
by the BMPUs and PPUs and resolve as shown in Table 10.2 Secure Access Table on page 221 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 10.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 10.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 4 regions of fixed length and fixed security attribute to facilitate the secure access of peripherals and
RF peripherals. There is one secure (0x40000000) and one non-secure (0x50000000) region for peripherals and one secure
(0xA0000000) and non-secure (0xB0000000) region for the radio subsystem. While each peripheral can be configured independently
the radio subsystem is configured as a unit.
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 10.3 Memory Configu-
ration Regions on page 223. 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 privileged
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 another
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 pre-
vent 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 reg-
isters. 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
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
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
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 Master 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
SYSCFGCFGNS RW 0x1 26
CHIPTESTCTRL RW 0x1 25
RW 0x1 24
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
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
IFADCDEBUG
LDMAXBAR
Name
ICACHE0
SYSCFG
ULFRCO
HFRCO0
USART1
USART0
TIMER4
TIMER3
TIMER2
TIMER1
TIMER0
GPCRC
BURAM
FSRCO
BURTC
LFRCO
HFXO0
DPLL0
LDMA
LFXO
GPIO
CMU
MSC
EMU
I2C1
PRS
DCI
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
24
23
22
21
20
19
18
17
16
RW 0x1 15
CRYPTOACC 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
SMUCFGNS
AHBRADIO
RADIOAES
LETIMER0
AMUXCP0
RFSENSE
EUART0
WDOG0
Name
IADC0
DCDC
RTCC
SMU
PDM
I2C0
Bit Name Reset Access Description
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
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
0x060 RW 0x1 31
RW 0x1 30
RW 0x1 29
RW 0x1 28
RW 0x1 27
SYSCFGCFGNS RW 0x1 26
CHIPTESTCTRL RW 0x1 25
RW 0x1 24
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
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
IFADCDEBUG
LDMAXBAR
Name
ICACHE0
SYSCFG
ULFRCO
HFRCO0
USART1
USART0
TIMER4
TIMER3
TIMER2
TIMER1
TIMER0
GPCRC
BURAM
FSRCO
BURTC
LFRCO
HFXO0
DPLL0
LDMA
LFXO
GPIO
CMU
MSC
EMU
I2C1
PRS
DCI
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
RW 0x1 15
CRYPTOACC 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
SMUCFGNS
AHBRADIO
RADIOAES
LETIMER0
AMUXCP0
RFSENSE
EUART0
WDOG0
Name
IADC0
DCDC
RTCC
SMU
PDM
I2C0
Bit Name Reset Access Description
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
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
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
8
7
6
5
RW 0x1 4
RADIOIFADCDEBUG RW 0x1 3
RW 0x1 2
RW 0x1 1
RW 0x1 0
Reset
Access
RADIOSUBSYSTEM
CRYPTOACC
Name
RADIOAES
LDMA
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
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
RW 0x1 4
RADIOIFADCDEBUG RW 0x1 3
RW 0x1 2
RW 0x1 1
RW 0x1 0
Reset
Access
RADIOSUBSYSTEM
CRYPTOACC
Name
RADIOAES
LDMA
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
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 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 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 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 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 Cryptographic Accelerator provides fast, ener-
gy-efficient hardware for symmetric-key cryptograph-
ic operations, a Public Key Engine (PKE) for asym-
metric key operations, and non-deterministic random
number generation (RNG).
11.1 Introduction
The CRYPTOACC (Cryptographic Accelerator) includes hardware for symmetric-key cryptographic operations such as AES, a Public
Key Engine (PKE) for asymmetric key operations, and a non-deterministic random number generator (RNG), suitable for key genera-
tion. CRYPTOACC can also use the DMA for efficient data transfer into and out of the block.
11.2 Features
The CRYPTOACC allows efficient acceleration of common cryptographic operations with a low CPU load. CRYPTOACC can imple-
ment or accelerate Elliptic Curve Cryptography (ECC), Secure Hash Algorithm (SHA-1, SHA-224, SHA-256), and various block cipher
modes based on the Advanced Encryption Standard (AES).
Extensive software support is provided via mbed TLS plugins. Many security systems fail due to mistakes in the implementation. There-
fore implementations should be left to experts in cryptographic algorithms. The implemented security functions are described in the
mbed TLS documentation located at http://docs.silabs.com.
Control and access registers for the cryptographic acceleration functions are described in the following sections. Although the register
interface is provided here, it is highly recommended to use the APIs provided by mbed TLS.
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
OPPTRN RW 0x0
OPPTRC RW 0x0
OPPTRB RW 0x0
OPPTRA 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
When executing primitive arithmetic operations, this pointer defines the location where the modulus is located in memory
(location 0 or 0xF).
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
When executing primitive arithmetic operations, this pointer defines the location (0 to 0xF) where the result will be stored
in memory.
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 executing primitive arithmetic operations, this Pointer defines where operand B is located in memory (location 0 to
0xF).
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
When executing primitive arithmetic operations, this Pointer defines where operand A is located in memory (location 0 to
0xF).
0x004 RW 0x0 31
RW 0x0 30
RW 0x0 29
SWAPBYTES RW 0x0 28
RW 0x0 27
RW 0x0 26
25
24
23
22
RW 0x0 21
20
19
18
17
16
15
14
RW 0x0 13
12
11
10
9
8
RW 0x0 7
6
5
4
RW 0x0 3
2
1
0
Reset
Access
OPERATION
SELCURVE
EDWARDS
CALCR2
BUFSEL
Name
FLAGB
FLAGA
FIELD
SIZE
Bit Name Reset Access Description
This bit indicates if the IP has to calculate R² mod N for the next operation. This bit must be set to '1' when a new prime
number has been programmed. This bit is used for primitive operations and ignored for the other operations
Flag B
Flag A
Swap the bytes on AHB interface. This bit must be programmed before writing/reading any data in data memory. See
doc section 4.2.1
Buffer Select
Edwards
25: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
Enable accelerator for specific curve modulus. This field has no effect when the optional acceleration hardware is not
included.
0 NONE No acceleration
1 P256 P256
4 P192 P192
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 field defines the size (= number of bytes minus one) of the operands for the current operation. Possible values are
limited by the maximum supported operand size. See doc for examples.
Field
This field defines the operation to be performed. See BA414EP documentation for exhaustive enumeration listing
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
W(nB) 0x0 1
PKSTART W(nB) 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
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
0x0 17
0x0 16
15
14
0x0 13
0x0 12
0x0 11
0x0 10
0x0 9
0x0 8
0x0 7
0x0 6
0x0 5
0x0 4
3
2
1
0
0x0
Reset
Access
R
R
R
R
R
PARAMABNOTVALID R
R
R
R
R
R
R
R
NOTIMPLEMENTED
PARAMNNOTVALID
COUPLENOTVALID
NOTINVERTIBLE
NOTONCURVE
SIGNOTVALID
COMPOSITE
Name
ATINFINITY
NOTQUAD
FAILADDR
PKBUSY
PKIF
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
This bit reflects the IRQ output value. It is set to '1' when the operation is finished. It is cleared by writing IFC
This bit reflects the BUSY output value. It is set to '1' when the operation starts and it is cleared when the operation is
finished
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 to '1' when executing a modular square root if the operand is not a quadratic residue.
set to '1' when executing a modular inversion (PK_CommandReg[3:0] = 0x6 or 0x9) if the operand is not invertible
set to 1 when parameters A and B are not valid, i.e 4A³+ 27B² = 0. This flag is updated after execution of the command
Check_AB
indicates if the signature can be accepted or must be rejected. This flag is set to 1 when the signature is not valid and is
updated after execution of the command ECDSA_Generation, ECDSA_Verification, DSA_Generation, DSA_Verification,
Ed25519_CheckValid
set to '1' when the Type of operation programmed in the command register is not supported.
set to 1 when Parameter n is not valid. This flag is updated after execution of the command Check_n.
set to 1 when couple x, y is not valid (i.e. not smaller than the prime). This flag is updated after execution of the com-
mand Check_Couple_Less_Prime.
set to 1 when Point Px is at the infinity. This flag is updated after execution of an ECC operation
set to 1 when Point Px is not on the defined EC. This flag is updated after execution of the command Check_Point_On-
Curve
These bits indicate which data location generated the error flag. They are not available for all error flags.
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
Reset
Access
HW R
SW 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
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
TIMER R
Name
The CRYPTOACC includes DMA support which allows the block to autonomously fetch data, perform cipher operations and store data
across multiple blocks with little CPU intervention.
Control and access registers used for fetching and pushing data using the DMA are documented in the following sections. Although the
register interface is provided here, it is highly recommended to use the APIs provided by mbed TLS.
The register map in this section includes several read-only hardware configuration registers. These are used by mbed TLS software to
determine device capabilities.
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
ADDR RW 0x0
Reset
Access
Name
Fetch address
0x008
31
30
RW 0x0 29
CONSTADDR RW 0x0 28
27
26
25
24
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 RW 0x0
Access
REALIGN
LENGTH
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
Fetch length
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
TAG RW 0x0
Reset
Access
Name
User tag
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
ADDR RW 0x0
Reset
Access
Name
0x018 31
RW 0x0 30
RW 0x0 29
CONSTADDR RW 0x0 28
27
26
25
24
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
DISCARD
REALIGN
LENGTH
Name
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
Discard data
Realign length
Constant address
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
RW 0x0 5
RW 0x0 4
RW 0x0 3
RW 0x0 2
RW 0x0 1
FETCHERENDOFBLOCK RW 0x0 0
Reset
Access
PUSHERENDOFBLOCK
FETCHERSTOPPED
PUSHERSTOPPED
FETCHERERROR
PUSHERERROR
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
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
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
R
R
FETCHERENDOFBLOCK R
PUSHERENDOFBLOCK
FETCHERSTOPPED
PUSHERSTOPPED
FETCHERERROR
PUSHERERROR
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
Triggered when reaching a block with Stop=1 (or end of direct transfer)
Triggered at the end of each block (if enabled in the descriptor - scatter-gather only)
Triggered when reaching a block with Stop=1 (or end of direct transfer)
Triggered at the end of each block (if enabled in the descriptor - scatter-gather only)
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
W(nB) 0x0 5
W(nB) 0x0 4
W(nB) 0x0 3
W(nB) 0x0 2
W(nB) 0x0 1
FETCHERENDOFBLOCK W(nB) 0x0 0
Reset
Access
PUSHERENDOFBLOCK
FETCHERSTOPPED
PUSHERSTOPPED
FETCHERERROR
PUSHERERROR
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
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
RW 0x0 1
FETCHERSCATTERGATHER RW 0x0 0
Reset
Access
PUSHERSCATTERGATHER
STOPFETCHER
Name
STOPPUSHER
SWRESET
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
When this bit is high, the software reset of the DMA modules, the FIFO's and the processing module will be activated.
The AXI bus is not affected (pending transfers will be completed).
When this bit is high, the pusher will stop at the end of the current block (even if the STOP bit in the descriptor is low).
When this bit is high, the fetcher will stop at the end of the current block (even if the STOP bit in the descriptor is low).
When this bit is zero, the pusher runs in direct mode. When this bit is one, the pusher runs in scatter-gather mode.
When this bit is zero, the fetcher runs in direct mode. When this bit is one, the fetcher runs in scatter-gather mode.
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
0x0 1
0x0 0
Reset
Access
W
STARTFETCHER W
STARTPUSHER
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
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
0x0 6
0x0 5
0x0 4
3
2
0x0 1
0x0 0
0x0
Reset
Access
FIFODATANUM R
R
R
R
R
R
FETCHERBSY
SOFTRSTBSY
PUSHERBSY
NOTEMPTY
WAITING
Name
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
This bit is high when the pusher if waiting for more data in output FIFO.
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
0x400 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
0x1 10
0x1 9
0x0 8
0x0 7
0x0 6
0x0 5
0x1 4
0x0 3
0x0 2
0x0 1
0x1 0
Reset
Access
R
R
R
R
R
g_IncludeChachaPoly R
R
R
R
R
R
g_IncludeAESGCM
g_IncludeAESXTS
g_IncludeNDRNG
g_IncludeHASH
g_IncludeSHA3
g_IncludeSM4
g_IncludeZUC
g_IncludeDES
g_IncludePKE
g_IncludeAES
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
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
0x17F 4
3
2
1
0
0x7
0x0
0x0
Reset
Access
R
R
g_AesModesPoss R
g_UseMasking
Name
g_Keysize
g_CS
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: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: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
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
0x80
Reset
Access
g_CtrSize 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
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
0x7F 3
2
1
0
0x0
0x1
0x1
Reset
Access
g_HashVerifyDigest R
R
R
R
g_HMAC_enabled
g_HashMaskFunc
g_HashPadding
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
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
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
0x1 0
Reset
Access
g_Sha3CtxtEn 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
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
0x5F 3
2
1
0
Reset
Access
g_SM4ModesPoss R
Name
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
The CRYPTOACC provides access to a non-deterministic random number generator based on a full hardware solution. The RNG out-
put passes the NIST 800-22 and AIS31 test suites. The RNG 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
Control and access registers for the random number generator are described in the following sections. Although the register interface is
provided here, it is highly recommended to use the APIs provided by mbed TLS.
0x000
31
30
29
28
27
26
25
24
23
22
21
FIFOWRSTARTUP RW 0x0 20
19
18
17
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
1
RW 0x0 0
NB128BITBLOCKS RW 0x4
Reset
Access
HEALTHTESTSEL
REPCOUNTIEN
AIS31TESTSEL
CONDBYPASS
SOFTRESET
APT4096IEN
FORCERUN
Name
BYPAIS31
APT64IEN
BYPNIST
FULLIEN
TESTEN
ENABLE
ALMIEN
PREIEN
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
Number of 128 bit blocks used in AES-CBCMAC post-processing. This value cannot be zero
0 NORMAL AIS31 startup test is applied. No data will be written to the FIFO
until the test passes.
Set this bit to force oscillators to run even when FIFO is full.
1 RESET The continuous test, the conditioning function and the FIFO are
reset
Enables bypassing of the conditioning function (to observe entropy source directly).
Selects the input for the conditioning function and continuous tests.
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
Enable the TRNG. The module will generate random numbers unless the FIFO is full.
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
Reset
Access
FIFOLEVEL R
Name
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
0x3F
Reset
Access
FIFOTHRESH R
Name
FIFO level at which the rings are restarted when in the FIFOFull_Off state, expressed in number of 128bit blocks.
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
0x40
Reset
Access
FIFODEPTH 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
KEY RW 0x0
Reset
Access
Name
KEY0, KEY1, KEY2, and KEY3 form the 128-bit AES key used in the conditioning function. KEY0 is the MSB and KEY3
is the LSB.
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
VALUE W
Name
Test data input to conditioning function or to the continuous tests. Each word written to this register represents 32 bits of
input data for the selected test in test mode (CONTROL_TESTEN = 1). TESTDATABUSY in the STATUS register will be
set to 1 each time data is written, and will clear to 0 when the next data word can be written. Writes to this register are
ignored if the TESTEN bit in the CONTROL register is 0.
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
RW 0x0 8
0x0 7
0x0 6
0x0 5
0x0 4
3
0x0 2
1
0x0 0
Reset
Access
R
R
R
R
R
TESTDATABUSY
REPCOUNTIF
APT4096IF
Name
APT64IF
FULLIF
STATE
ALMIF
PREIF
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
Set when a preliminary noise alarm is detected in the AIS31 online test.
6 UNUSED_6 UNUSED
7 UNUSED_7 UNUSED
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
INITWAITVAL RW 0xFFFF
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
Number of clock cycles to wait before sampling data from the noise source.
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
SWOFFTMRVAL RW 0xFFFF
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
Number of clock cycles to wait before stopping the rings after the FIFO is full.
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
VALUE 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
The frequency at which the outputs of the rings are sampled is given by Fs = Fpclk/(CLKDIV + 1).
0x048 31
30
29
28
27
26
25
24
RW 0x4340 23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
STARTUPTHRES RW 0x1040 7
6
5
4
3
2
1
0
Reset
Access
ONLINETHRESH
Name
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
Online Threshold
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
Start-up Threshold
0x04C 31
30
29
28
27
26
25
24
ONLINEREPTHRESH RW 0x3C0 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 0x680
Reset
Access
HEXPECTEDVALUE
Name
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
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
HExpected Value
0x050
31
30
29
28
27
26
25
24
HMAX RW 0x440 23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
RW 0x340 7
6
5
4
3
2
1
0
Reset
Access
HMIN
Name
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
HMax
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
HMin
0x054 31
30
29
28
27
26
25
24
23
22
21
20
19
18
RW 0x0 17
PRELIMNOISEALARMRNG RW 0x0 16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
RW 0x0
Reset
Access
PRELIMNOISEALARMREP
NUMPRELIMALARMS
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
Last preliminary noise alarm occurred due to history value out of range
Quick Facts
What?
Why?
0 1 2 3 4 How?
12.1 Introduction
The Energy Management Unit (EMU) manages all the low energy modes (EM) in EFR32xG22. 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, Radio, 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
monitoring needed for optimal power configuration and protection.
12.2 Features
The EMU is responsible for managing the wide range of energy modes available in EFR32xG22. 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 12.1
EMU Overview on page 280, 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.
EFR32xG22 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 func-
tionality. The following Table 12.1 table on page 281 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.
Peripherals such as the IADC and radio have the ability to temporarily wake up the part from either EM2 or EM3 to EM1 in order to
transfer data. Once completed, the part is automatically placed back into the EM2 or EM3 mode.
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 the radio is transferring data or 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.
PDM 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. The RAC can be woken via a PRS interrupt to EM1 to transfer data. Once complete, the system will return to EM2.
4. Default off, but kept active if used by the IADC.
5. Default off, but kept active if used by the BURTC
6. Must be using ULFRCO
7. I2C0 only. Not supported on all GPIO Ports. Functionality limited to receive address recognition
8. Pin wake-up in EM4 supported only on GPIO_EM4WUx pins. Consult data sheet for complete list of pins.
9. If enabled in EMU->EM4CTRL.EM4IORETMODE.
10. Module is in Low Power Domain B (PD0B). The entire PD0B will be kept on in EM2/3 (resulting in higher current draw) if any
module in PD0B is enabled on EM2/3 entry.
12.3.1.1 EM0
12.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
• Radio functionality is available
• High and low frequency clock trees are active
• All oscillators are available
• All peripheral functionality is available
12.3.1.3 EM1P
EM1P is a subset of EM1 which allows the radio to operate while the core and high-speed peripherals are shut down to save energy. It
is entered when the radio is active and software requests to enter EM2.
• Cortex-M33 is in sleep mode. Clocks to the core and all high-speed peripherals are off
• Radio and HFXO remain active
• All peripherals and oscillators capable of EM2, EM3 or EM4 operation are available
12.3.1.4 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.
• Radio inactive
• RFSENSE available
• High frequency clock tree is inactive
• Low frequency clock tree is active
• The following oscillators are available
• LFRCO, LFXO, ULFRCO, FSRCO (on demand, if used by the IADC)
• The following low frequency peripherals are available
• RTCC, BURTC, WDOG, and LETIMER
• The following analog peripherals are available (with potential limitations on functionality)
• IADC
• Wake-up to EM0 through
• Peripheral interrupt, reset pin, power on reset, asynchronous pin interrupt, I2C0 address recognition, EUART0 interrupt, or
RFSENSE
• Wake-up to EM1 through
• Radio 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
• RTCC 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.
12.3.1.5 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.
• Radio inactive
• RFSENSE available
• 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, FSRCO (on demand, if used by the IADC)
• The following low frequency peripherals are available if clocked by the ULFRCO
• RTCC, BURTC, and WDOG
• The following analog peripherals are available (with potential limitations on functionality)
• IADC
• Wake-up to EM0 through
• Peripheral interrupt, reset pin, power on reset, asynchronous pin interrupt, I2C0 address recognition, or RFSENSE
• Wake-up to EM1 through
• Radio 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
• RTCC 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.
12.3.1.6 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
• Radio is off
• RFSENSE available
• 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 the Cortex-M33 System Control Register is cleared. The MCU can re-enter sleep automatically out of an Interrupt
Service Routine (ISR) if the SLEEPONEXIT bit in the Cortex-M33 System Control Register is set. Refer to ARM documentation on en-
tering 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 documen-
tation 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 12.3.4 Power
Domains for more information.
Software must ensure no modules are active, such as the Radio, when entering EM4.
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 EFR32 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.
The EFR32xG22 implements 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.
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. Auxiliary PD0 power do-
mains (PD0B, PD0C, etc.) 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: The number of PD0 power domains varies depending on the device family. All devices support at least the base PD0 power
domain (PD0A). Refer to the device data sheet for information on the assigment of peripherals to auxiliary PD0 power domains.
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.
The EFR32xG22 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. The voltage scale level for EM2 and EM3 is set using 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. EMU_CTRL_EMU23VSCALE should al-
ways be set to a VSCALE level at or lower than the one used in EM0/EM1. For example, if EM0 / EM1 voltage scaling is set to
VSCALE1, then EM2 / EM3 voltage scaling can be set to VSCALE1 or VSCALE0.
If the voltage scaling level for EM0 / EM1 is lower than the level set for EM2 / EM3, additional time is needed to wake up from the low
powered state (see the device data sheet for specific timing). The lowest sleep current will be obtained by setting EMU23VSCALE to
VSCALE0, and the fastest wake times will be obtained when EMU23VSCALE is set to 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 EFR32xG22 comes with a DC-DC module to power internal circuits. The
EFR32xG22 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 EFR32xG22 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 12.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 12.4 DC-DC Power Configuration on page 291, 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 EFR32xG22 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 radio and
MCU functions. The DC-DC converter is an efficient PFM (Pulse Frequency Modulation) architecture. In addition, the DC-DC converter
supports 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 EFR32xG22 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
12.5 DRVSPEED, IPKVAL, and IPKMAXCTRL Recommended Settings for buck DC-DC on page 293.
Table 12.5. DRVSPEED, IPKVAL, and IPKMAXCTRL Recommended Settings for buck DC-DC
EM01CTRL0_IPKVAL 9 (LOAD60MA)
EM01CTRL0_DRVSPEED 1 (DEFAULT_SETTING)
EM23CTRL0_IPKVAL 3 (LOAD5MA)
EM23CTRL0_DRVSPEED 3 (BEST_EFFICIENCY)
DCDC_CTRL_IPKTMAXCTRL 4 (TMAX_1P19US)
The DCDC_CTRL_DCMONLYEN field can be used to select between DCM and CCM mode. The default setting (1) is to use DCM
mode, and should not be changed for most applications.
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 EFR32xG22 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 EFR32xG22 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)
EFR32xG22'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 EFR32xG22's DECOUPLE supply. Once set,
EFR32xG22'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 EFR32xG22's DVDD supply (or DVDD along with other 1.8V sup-
ply inputs). This mode assumes that EFR32xG22's internal DCDC is not being used, so the EFR32xG22 VREGVDD and PAVDD
pins should be shorted together on the PCB.
EFR32xG22 provides a dedicated hardware IRQ vector for the EFP01's IRQ output. To use the EFR32xG22'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.
EFR32xG22 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 EFR32xG22 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 12.6 Direct Mode Energy Mode States on page 294. Because the Direct Mode feature is non-I2C compliant, it should be ena-
bled only during periods when no communciation between EFR32xG22 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 EFR32xG22.
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 EFR32xG22. After reset, the M33 loads the stack pointer and program entry point from memory and start execution.
POR
PORESETn EM4 Peripherals
DVDD DVDDLEBOD
(EMU, LFXO,
BURAM, BURTC,
DVDDBOD
etc)
RESETn FILTER
PORRESETLVn DEBUG
EM4 WAKEUP RESET_N Interface
EM2 RTCC
DCI
SYSRESETn
WDOGRST Low Voltage Logic
LOCKUPRST Soft Reset
SYSREQRST Enable
Individual
DECOUPLE DECBOD Reset
Whether a reset source trigger event leads to a system reset can be controlled via EMU_RSTCTRL 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 12.9 Polynomial Coefficients on page 298.
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.
Each EMU register requires retaining state in various energy modes and power transitions and will consequently need to be reset with a
different condition. The following reset conditions will apply to the appropriate set of registers as marked in the Register Description
table.
• Reset with POR or Hard Pin Reset
• Reset with POR, Hard Pin Reset, or any BOD reset
• Reset with SYSEXTENDEDRESETn
• Reset with FULLRESETn (default)
If a register field is not marked with a specific reset condition then it is assumed to be reset with FULLRESETn.
EMU EMU_LOCK (for user accessible registers) can be used to control access to the EMU_RSTCTRL, 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.
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
18
RSTCAUSECLR 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
EM01VSCALE2
EM01VSCALE1
TEMPAVGREQ
EM4UNLATCH
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
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
EFP Direct mode enable. EMU drives I2C SDA/SCL lines to transition EFP between energy modes
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 PD0B 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
0x0 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
RACACTIVE
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 Reserved 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 the status of the RAC state machine. System can not enter EM2 or lower if set.
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
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
RW 0x1 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
DCIRMODE
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
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
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
0x0 16
15
14
13
12
0x0 11
0x0 10
0x0 9
0x0 8
0x0 7
0x0 6
0x0 5
4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
R
DVDDLEBOD R
R
R
R
R
R
R
R
IOVDD0BOD
DVDDBOD
AVDDBOD
DECBOD
SYSREQ
LOCKUP
VREGIN
WDOG0
Name
POR
EM4
DCI
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: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: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
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
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
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
0 EN 0x0 RW Enable
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.
0 DISABLE Disable
1 ENABLE Enable
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
IPKTMAXCTRL RW 0x4 5
4
3
RW 0x1 2
1
RW 0x0 0
Reset
Access
DCMONLYEN
Name
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
Specifies the timeout duration when attempting to hit programmed peak current. Ton_max = (ipk_tmax_ctrl*4 +
1)*0.070us; The TMAX interrupt flag will be set if the timeout was hit before reaching peak current.
1 TMAX_0P35US 0.35us
2 TMAX_0P63US 0.63us
3 TMAX_0P91US 0.91us
4 TMAX_1P19US 1.19us
5 TMAX_1P47US 1.47us
6 TMAX_1P75US 1.75us
7 TMAX_2P03US 2.03us
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 DCMONLYEN DCM only mode for normal operation, this is the default setting
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
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 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
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
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
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
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
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
RUNNING
EM4ERR
Name
BYPSW
WARM
TMAX
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
EM4 entry error - software requesting EM4 entry when bypass switch is disabled
Bypass switch has turned off and DC-DC is active. Note that DC-DC might not be in regulation yet. ie output voltage may
not be in range of target voltage.
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
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
RUNNING
EM4ERR
Name
BYPSW
WARM
TMAX
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
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
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
BYPCMPOUT R
R
R
R
R
RUNNING
VREGIN
Name
BYPSW
WARM
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
DCDC is running
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
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?
13.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.
13.2 Features
The PRS contains 12 asynchronous and 4 synchronous reflex channels. An overview of an asynchronous PRS reflex channel is shown
in Figure 13.1 PRS Asynchronous Channel Overview on page 329. 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 and IADC modules.
Similarly on the consumer side, all the peripherals can listen to asynchronous channels while only the TIMER and IADC modules 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 13.1 Configurable Logic Look up Table on page 330). 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 13.3 List of Logic Functions on
page 330.
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.
13.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 25.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 asynchornous 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
SCANTABLEDONE 0x1
SINGLEDONE 0x2
CH1 0x1
CCV1 0x1
CCV2 0x2
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
RTS 0x1
TX 0x2
TXC 0x3
RXFL 0x4
IRTX 0x1
RTS 0x2
RXDATA 0x3
TX 0x4
TXC 0x5
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
CCAREQ 0x1
GAINADJUST 0x2
GAINOK 0x3
GAINREDUCED 0x4
IFPKI1 0x5
IFPKQ2 0x6
IFPKRST 0x7
PROPAGATED 0x1
RSSIDONE 0x2
THR1 0x1
THR2 0x2
THR3 0x3
CNT0 0x4
CNT1 0x5
FULL 0x6
ANT0 0x1
ANT1 0x2
COHDSADET 0x3
COHDSALIVE 0x4
DCLK 0x5
DOUT 0x6
FRAMEDET 0x7
LOWCORR 0x1
LRDSADET 0x2
LRDSALIVE 0x3
NEWSYMBOL 0x4
NEWWND 0x5
POSTPONE 0x6
PREDET 0x7
RSSIJUMP 0x1
SYNCSENT 0x2
TIMDET 0x3
WEAK 0x4
EOF 0x5
DOUT 0x1
CC0 0x1
CC1 0x2
CC2 0x3
CC3 0x4
CC4 0x5
LBTF 0x6
LBTR 0x7
POF 0x1
T0MATCH 0x2
T0UF 0x3
T1MATCH 0x4
T1UF 0x5
WOF 0x6
MUX1 0x1
LNAEN 0x1
PAEN 0x2
RX 0x3
TX 0x4
CTIOUT0 0x5
CTIOUT1 0x6
CTIOUT2 0x7
OF 0x1
CC0 0x2
CC1 0x3
CC2 0x4
SDM 0x1
TCMEAS 0x2
13.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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
0x0C8 31
30
29
28
27
26
25
24
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
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
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
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
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
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
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
0x0D8 31
30
29
28
27
26
25
24
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
0x0DC
31
30
29
28
27
26
25
24
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
0x0E0 31
30
29
28
27
26
25
24
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
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
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
0x0E8 31
30
29
28
27
26
25
24
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
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
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
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
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
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
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
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
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
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
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
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
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
0x108
31
30
29
28
27
26
25
24
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
0x10C 31
30
29
28
27
26
25
24
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
0x110
31
30
29
28
27
26
25
24
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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?
14.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).
14.2 Features
An overview of the GPCRC module is shown in Figure 14.1 GPCRC Overview on page 395.
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 14.2 Polynomial Repre-
sentation on page 396.
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.
14.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 14.3 Data Ordering Example - 32-bit MSB -first to LSB-first on page
397. 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 14.4 Data Ordering Example - 16-bit MSB -first to LSB-first on page 398. 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 14.1 Byte-Level Bit Reversal and Byte Reordering Results (B3 B2 B1 B0 Input Order)
on page 398.
Table 14.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 Real Time Clock with Capture (RTCC)) is a 32-
bit Real Time Clock ensuring timekeeping in low en-
ergy modes.
Why?
How?
15.1 Introduction
The Real Time Clock with Capture (RTCC), with three capture/compare channels, is a 32-bit counter kept running down to energy
mode EM3. It can be used as an EM2/3 wakeup source as well as a timekeeping counter during low energy mode. Time keeping over
long time periods while using as little power as possible is required in many low-power applications. The 32-bit counter is in combina-
tion with a 15-bit pre-counter to allow flexible pre-scaling of the main counter.
Three individually configurable Capture/Compare channels can be used to trigger interrupts, generate PRS signals, capture system
events, and to wake the device up from EM2, or EM3 when using the ULFRCO as a clock source.
15.2 Features
A low frequency oscillator is used as clock signal and the RTCC has three different Capture/Compare channels which can trigger wake-
up, generate PRS signalling, or capture system events. 32-bit resolution and selectable pre-scaling 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 or for use as an independent counter
• EM2/EM3 operation and wakeup (EM3 when using ULFRCO as clock source)
• Can survive system reset, only POR and EM4 wakeup will reset RTCC
• Three Capture/Compare channels
• Capture of PRS events from other parts of the system, value stored in ICVALUE
• Compare match or input capture can trigger interrupts
• Compare channel 1, RTCC_CC1_OCVALUE can be used as a top value for the main counter
• Compare channel 0, RTCC_CC0_OCVALUE can be used as a top value for the pre-counter
• Compare match events are available to other peripherals through the Peripheral Reflex System (PRS)
An overview of the RTCC is shown in Figure 15.1 RTCC Overview on page 410 .
RTCC_CFG_CCV1TOP RTCC_CFG_PRECCV0TOP
Counter Pre-Counter
LFCLKRTCC
RTCC_CNT RTCC_PRECNT
RTCC_CC_CTRL_CMOA
CNT PRECNT RTCC_CC_CFG_COMPBASE
CC2
PRS output
CC1
CC0
Output Compare
= Mask
RTCC_CCx_OCVALUE
CNT Overflow
OF
COUNT TICK RTCC_CC_CFG_COMPMASK[4:0]
CNTTICK
Interrupt CC2
Capture
generation Input Capture Capture PRS
CC1 RTCC_CCx_ICVALUE logic n Inputs
CC0
The RTCC consists of two counters; the 32-bit main counter, RTCC_CNT, and a 15-bit pre-counter, RTCC_PRECNT. The pre-counter
can be used as an independent counter, or to generate a specific frequency for the main counter. In both configurations, the pre-coun-
ter can be used to generate compare match events or be captured in the Capture/Compare channels as a result of an external PRS
event. Refer to Capture/Compare Channels for details on how to configure the Capture/Compare channels for use with the pre-counter.
RTCC_PRECNT LFCLKRTCC
.........................
RTCC_CTRL_CNTPRESC = RTCC_CC0_OCVALUE[14:0]
RTCC_CNT
The RTCC peripheral clock is requested by setting the EN bit in RTCC_EN. Then RTCC can be enabled by setting the command regis-
ter START in RTCC_CMD. When the RTCC is enabled, the pre-counter (RTCC_PRECNT) increments upon each positive clock edge
of low frequency clock. If CNTTICK in RTCC_CFG is set to PRESC, the pre-counter will continue to count up, wrapping around to zero
when it overflows. If CNTTICK in RTCC_CFG is set to CCV0MATCH, the pre-counter will wrap around when it hits the value configured
in RTCC_CC0_OCVALUE.
The main counter is available in RTCC_CNT and increments upon each tick given from the pre-counter. Refer to Normal Mode for a
description on how to configure the frequency of these ticks. The main counter can receive a tick based on different dividers from the
pre-counter, allowing the ticks to be power of 2 divisions of the LF clock. For more accurate configuration of the tick frequency,
RTCC_CC0_OCVALUE[14:0] can be used as a top value for
RTCC_PRECNT. When reaching the top value, the main counter receives a tick, and the pre-counter wraps around. Table below
shows RTCC Resolution vs Overflow, FLFCLK = 32768 Hz, which summarizes the resolutions available when using a 32768 Hz oscilla-
tor as source for LF clock of RTCC.
By default, the counter will keep counting until it reaches the top value, 0xFFFFFFFF, before it wraps around and continues counting
from zero. By setting CCV1TOP in RTCC_CFG, a Capture/Compare channel 1 compare match will result in the main counter wrapping
to 0. The timer will then wrap around on a channel 1 compare match (RTCC_CNT = RTCC_CC1_OCVALUE). If using the CCV1TOP
setting, make sure to set this bit prior to or at the same time the RTCC is enabled. Setting CCV1TOP after enabling the RTCC may
cause unintended operation (e.g. if RTCC_CNT > RTCC_CC1_OCVALUE, RTCC_CNT will wrap when reaching 0xFFFFFFFF rather
than RTCC_CC1_OCVALUE).
The counters of the RTCC, RTCC_CNT and RTCC_PRECNT, can at any time be written by software, as long as the registers are not
locked using RTCC_LOCKKEY. All RTCC registers use the new immediate synchronization scheme.
Note: Writing to the RTCC_PRECNT register may alter the frequency of the ticks for the RTCC_CNT register.
Three capture/compare channels are available in the RTCC. Each channel can be configured as input capture or output compare, by
setting the corresponding MODE in the RTCC_CCx_CTRL register.
RTCC_CNT
RTCC_CC0_OCVALUE
RTCC_CC1_OCVALUE
RTCC_CC2_OCVALUE
In input capture mode the RTCC_CNT register is captured into the RTCC_CCx_ICVALUE register when an edge is detected on the
selected PRS input channel. The active capture edge is configured in the ICEDGE control bits.
In output compare mode the compare values are set by writing to the RTCC compare channel registers RTCC_CCx_OCVALUE. These
values will be compared to the main counter, RTCC_CNT or a mixture of the main counter and the pre-counter, as illustrated in Figure
15.4 RTCC Compare Base Illustration on page 414. Compare base for the capture compare channels is set by configuring COMP-
BASE in RTCC_CCx_CTRL.
RTCC_CCx_CFG_COMPBASE = CNT
CNT PRECNT
Compare match =
CCx_OCVALUE
RTCC_CCx_CFG_COMPBASE = PRECNT
CNT 16 0 14 PRECNT 0
Compare match =
CCx_OCVALUE
Table RTCC Capture/Compare subjects summarizes which registers being subject to comparison for different configurations
RTCC_CTRL_CNTMODE NORMAL
The RTCC has interrupts for each of its 3 Capture/Compare channels (CC0, CC1, and CC2), as well as a counter tick interrupt
(CNTTICK) and an overflow interrupt (OF). The counter tick interrupt is set each time the main counter receives a tick, while the over-
flow interrupt occurs when the main counter overflows.
Each Capture/Compare channel has a PRS output with configurable actions upon compare match. The output action is determined by
the CMOA field in register RTCC_CCx_CTRL. See 13.3.3 Producers for more details on how to connect PRS channels to these out-
puts.
To prevent accidental writes to the RTCC registers, the RTCC_LOCK register can be written to any other value than the unlock value.
To unlock the register, write the unlock value to RTCC_LOCKKEY. Registers affected by this lock are:
• RTCC_CFG
• RTCC_EN
• RTCC_CMD
• RTCC_PRECNT
• RTCC_CNT
• RTCC_CCx_CTRL
• RTCC_CCx_OCVALUE
• RTCC_CCx_ICVALUE
Generally speaking, in order to use and program RTCC properly, it should follow the sequence below,
All the registers have been separated into different synchronization types. The CFG register is WSTATIC, which means only when
EN=0, it will allow the programming of CFG, otherwise there will be a bus fault for the CFG register write. Here is an example of pro-
gramming CFG prior to setting EN to 1.
RTCC->CC[0].OCVALUE = 2;
RTCC->CC[0].CTRL = RTCC_CC_CTRL_CC_MODE_OUTPUTCOMPARE;
RTCC->CC[0].OCVALUE = 5;
RTCC->EN = RTCC_EN_EN;
All the other registers with low frequency synchronization types need to be programmed after setting EN to 1. Counter will only start to
count once START command is issued. For LFRWSYNC registers, user needs to keep polling sync busy, e.g. START, before program-
ming the same register once again.
For QUICKLFWSYNC registers, when writing to it, the write will stall the bus until the write action is completed, so there is no sync busy
bit for those registers, RTCC_CCn_CTRL is an example for that.
By default, the RTCC is halted when code execution is halted from the debugger. By setting the DEBUGRUN bit in the RTCC_CTRL
register, the RTCC will continue to run even when the debugger has halted the system.
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
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
13
12
11
10
9
8
7
6
5
4
RW 0x0 3
RW 0x0 2
PRECNTCCV0TOP RW 0x0 1
RW 0x0 0
RW 0x0
Reset
Access
CNTCCV1TOP
DEBUGRUN
CNTPRESC
Name
CNTTICK
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
Select whether the main counter should tick on RTCC_CC0_OCVALUE[14:0] compare match with the pre-counter or tick
on a pre-counter tap selected in CNTPRESC bitfield in the RTCC_CTRL register.
When set, the pre-counter wraps around when PRECNT equals RTCC_CC0_OCVALUE[14:0].
Set this bit to keep the RTCC running during a debug halt.
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
RTCCLOCKSTATUS 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
0x014 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
RW 0x0 8
7
RW 0x0 6
5
RW 0x0 4
3
2
CNTTICK RW 0x0 1
RW 0x0 0
Reset
Access
Name
CC2
CC1
CC0
OF
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
This bit indicates that there has been an interrupt event on Compare/Capture channel
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
This bit indicates that there has been an interrupt event on Compare/Capture channel
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 indicates that there has been an interrupt event on Compare/Capture channel
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
0x018 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
RW 0x0 8
7
RW 0x0 6
5
RW 0x0 4
3
2
CNTTICK RW 0x0 1
RW 0x0 0
Reset
Access
Name
CC2
CC1
CC0
OF
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 Reserved 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
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
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
0x0 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
PRECNT R
CNTLSB
Name
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
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
PRECNT R
R
R
START
STOP
Name
CNT
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
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 RTCC_CFG, RTCC_EN, RTCC_CMD, RTCC_PRECNT, RTCC_CNT
and RTCC_CCx_XXX 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
COMPBASE RW 0x0 4
3
2
1
0
RW 0x0
RW 0x0
RW 0x0
Reset
Access
ICEDGE
Name
CMOA
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
These bits control which edges the PRS edge detector triggers on.
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
OC RW 0x0
Reset
Access
Name
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
0x0
Reset
Access
R
Name
IC
Quick Facts
What?
Why?
How?
16.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.
16.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 16.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.
16.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.
16.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 16.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.
16.3.6 Interrupts
The BURTC has 2 interrupts: one for Overflow and another for for 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
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
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
0x0 5
0x0 4
0x0 3
0x0 2
0x0 1
0x0 0
Reset
Access
R
R
R
PRECNT R
R
R
START
COMP
STOP
Name
CNT
EN
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
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?
Why?
How?
17.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(nB) 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?
Why?
How?
18.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 RTCC. 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 peripher-
als using PRS, allowing advanced time-keeping and wake-up functions
18.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 18.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
CLK_PER
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 18.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 18.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 18.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 18.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 18.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 (EM23GRPACLK) 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 18.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 18.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
18.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 18.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.
18.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 clearing
CMU_LFCLKSEL_LFA and setting CMU_LFCLKSEL_LFAE to 1. This will make the RTCC use the internal 1 kHz ultra low frequency
RC oscillator (ULFRCO), consuming very little energy. Please note that the ULFRCO is not accurate over temperature and voltage, and
it should be verified that the ULFRCO fulfills the timekeeping needs of the application before using this in the design.
This module is a Low Energy Peripheral, and supports immediate synchronization. For description regarding immediate synchroniza-
tion, the reader is referred to the ../../EFR32XG22-RM/EFR32XG22_xrefkeys.dita#xrefs/peripheral_access section.
Since this module is a Low Energy Peripheral, and runs off a clock which is asynchronous to the HFCORECLK, special considerations
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 18.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
LFACLKLETIMERn
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 18.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 18.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 RTCC can also be used via PRS to start the LETIMER, the RTCC and LETIMER can thus be combined to generate specific
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 18.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
LFACLKLETIMERn
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 18.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 18.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
LFACLKLETIMERn
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 18.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 18.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 18.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
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
0 EN 0x0 RW module en
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
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
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
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
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
0x0 0
Reset
Access
RUNNING 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
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
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
19.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.
19.2 Features
An overview of the TIMER module is shown in Figure 19.1 TIMER Block Overview on page 477 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.
19.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.
19.3.2.2 Operation
Figure 19.2 TIMER Hardware Timer/Counter Control on page 479 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 19.3 TIMER Clock Selection on page 479.
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 19.4 TIMER Connections on page 480), 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 19.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 19.5 TIMER TOP Value Update Functionality on page
481).
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 19.6 TIMER Quadrature Encoded Inputs on page 482).
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
19.7 TIMER Quadrature Decoder Configuration on page 482
In X2 Decoding mode, the counter increments or decrements on every edge of Channel A, see Table 19.1 TIMER Counter Response in
X2 Decoding Mode on page 483 and Figure 19.8 TIMER X2 Decoding Mode on page 483.
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 19.9 TIMER X4
Decoding Mode on page 483 and Table 19.2 TIMER Counter Response in X4 Decoding Mode on page 483.
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 19.10 TIMER Rotational Position Equation on page 484 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 19.11 TIMER Input Pin Logic on page 484). 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
19.12 TIMER Input Capture on page 485). 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 19.13 TIMER Period and/or Pulse Width Capture on page 486. 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)
19.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 19.14 TIMER Block Diagram Showing Comparison Functionality on page 487. 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 19.16 TIMER Output Compare/PWM Buffer Functionality Detail on page 488. 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 19.17 TIMER Up-count Frequency Generation on page 489) 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 19.18 TIMER Up-count Frequency Generation Equation on page 489
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 19.20 TIMER Up-count PWM Generation on page 490). 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 19.21 TIMER Up-count PWM Resolution
Equation on page 490.
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 19.22 TIMER Up-count PWM Frequency Equation on page 490:
The high duty cycle is given by Figure 19.23 TIMER Up-count Duty Cycle Equation on page 490
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 19.25 TIMER CC Out in 2x Mode on page 491
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 19.27 TIMER 2x Mode PWM Frequency Equation (Up-count) on page 491:
The high duty cycle is given by Figure 19.28 TIMER 2x Mode Duty Cycle Equation on page 491
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 19.29 TIMER Up/Down-count PWM Generation on page 492. The resolution (in bits) is given by Figure 19.30 TIMER Up/
Down-count PWM Resolution Equation on page 492.
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 19.31 TIMER Up/Down-count PWM Frequency Equation on page 492:
The high duty cycle is given by Figure 19.32 TIMER Up/Down-count Duty Cycle Equation on page 492
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
19.34 TIMER CC Out in 2x mode on page 493
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 19.36 TIMER 2x Mode PWM Frequency Equation (Up/Down-count) on page 493:
The high duty cycle is given by two equations based on the OCx values.Figure 19.37 TIMER 2x Mode Duty Cycle Equation for OCx = 1
or OCx = Even on page 493 and Figure 19.38 TIMER 2x Mode Duty Cycle Equation for all Other OCx = Odd Values on page 493
DS2xmode = (OCx*2)/(floor(TOP/2)*4)
Figure 19.37. TIMER 2x Mode Duty Cycle Equation for OCx = 1 or OCx = Even
Figure 19.38. TIMER 2x Mode Duty Cycle Equation for all Other OCx = Odd Values
PWM outputs are normally synchrous to the TIMER peripheral clock. However for radio applications, it can be desirable to synchronize
PWM edges to radio clocks to reduce the interference with RF signalling.
Re-timing is enabled by setting the RETIMEEN bit in TIMERn_CFG to 1. When RETIMEEN is enabled, PWM X2CNT mode should not
be enabled. Doing so may result in unpredictable PWM behavior.
Direct re-timing is supported at peripheral clock frequencies up to 50 MHz. For higher peripheral clock frequencies, set the RETIMESEL
bit in TIMERn_CFG to 1. This allows PWM outputs to be re-timed at frequencies up to 80 MHz, but will introduce up to 1
HFPERCLKTIMERn cycle of jitter between the PWM outputs.
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 19.39 TIMER Dead-Time In-
sertion Unit Overview on page 495.
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 19.40 TIMER Triple Half-Bridge on page 495). 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 19.41 TIMER Overview of Dead-Time Insertion Block for a Single PWM
Channel on page 496.
DTFALLT DTRISET
=0
Figure 19.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 19.42 TIMER Polarity of Both Signals are Set as Active-High on page 496.
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 19.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 19.43 TIMER Output Polarities on page 497.
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 19.4 TIMER DMA Events on page 499. 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
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
RW 0x0 17
RW 0x0 16
15
14
13
RW 0x0 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
RETIMESEL
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: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 RETIMEEN is set, the PWM output stage will be re-timed to synchronize edges with radio clocks and reduce RF
interference. This will introduce up to 1 cycle of clock jitter between PWM outputs.
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
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.
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 PDM Module accepts a PDM bitstream input
and provides PCM output samples.
Why?
PDM
CLK
Digital
Microphone
DATn
20.1 Introduction
The PDM module provides a decimation filter for Pulse Density Modulation (PDM) microphones, isolated Sigma-Delta ADCs, and other
PDM or Sigma-Delta bit stream peripherals.
The decimation filter consists of a Cascaded Integrator Comb (CIC) filter. The output width of the comb filter is selectable, supporting
16, 24, or 32 bits. The comb filter has a fixed M value of 1.
20.2 Features
20.3.1 Overview
peripheral bus
apb_clk
hfpdm_clk pdm
Clock gen
prescalar_5050 APB I/F
pdm_clk
Clock_gate
pdm_core
APB to pdm_clk sync pdm_clk to APB sync
PDM_RETCLK
pdm_cic_decimator #0
O/P Post
PDM_CLK CIC
processing
Data Async
pdm_rxdat
PDM_DAT0 a_ctl pdm_cic_decimator #1 packing FIFO
O/P Post
CIC
PDM_DAT1 processing
pdm_clk
pdm_retclk
apb_clk
The module generates a PDM output clock using an integer divider prescaler to divide down the module HFCLK_PDM. See 8. CMU -
Clock Management Unit for details on generation of the HFCLK_PDM.
The PDM module includes a 10-bit integer prescaler. The PDM clock is divided by PRESC plus 1. The PRESC field is located in the
PDMn_CFG1 register.
For optimum performance, PDM signal sources require an accurate, jitter-free clock.
The decimation filter order is programmable from 2 to 5. The selected filter order must be at least one order higher than the sigma delta
modulator. Isolated ADCs typically have a second order sigma delta modulator and require a 3rd order filter. PDM microphones typical-
ly have a fourth order modulator and require a 5th order filter. The filter also supports 1st order and 3rd order sigma delta modulators.
The filter order is programmed in the FORDER field of the PDMn_CFG0 register. The filter order must be programmed before enabling
the module and should not be modified while the module is running.
The Down Sample Rate of the decimation filter is programmable. The decimation filter supports both power of 2 (2x) and integer down
sampling rates. The advantage of using a power of two down sampling rate is that gain compensation requires only shifting the results
and the full scale value will use all available bits. The benefit of using non-power of two down sampling rates is that this allows finer
adjustment of the output word rate.
The down sample rate is programmed into the DSR field of the PDMn_CTRL register and can be changed dynamically while the filter is
running. The changed DSR setting will be loaded to the dsr counter when the dsr counter rolls over to zero.
The decimation filter includes gain compensation which will shift the final results so that a full scale output is achieved for fully modula-
ted input. When filter output option is 16-bit or 24-bit then program the shift value in gain field of CTRL register. Gain = 32 - ( 1 + ceil-
ing(((log10(G)/log10(2)),1). Where G = (DSR ^ N).
The GAIN field is in the PDMn_CTRL register and can be changed dynamically while the filter is running. The value of the GAIN field
can vary dynamically from 0 to a maximum value of the integer part of the LOG2 of the down sample rate.
The maximum down sample rate is limited by the internal width of the integrator. The maximum value depends on the filter order.
N Max DSR
3 1290
4 215
5 73
The PDM module has 2 channels. All channels use a common clock and filter settings. The channels are synchronized such that all
channels down sample and produce output data on the same filter clock cycle.
The module supports clock output mode only. There is only one clock output for all channels.
In normal mode, there is one clock output and one data input for each channel.
The two channel stereo mode samples DAT0 on both rising and falling edges of the clock, to produce data output for CH0 and CH1.
CH0 uses the rising edge data, and CH1 uses the falling edge data.
In normal mode, data is normally clocked on the rising edge of the CLK signal. There is an option to invert the data polarity which will
clock data on the falling edge of the clock signal. This may be useful for some sigma delta modulators that have insufficient hold time
on the rising clock edge.
The output width of the comb filter is selectable, supporting 16, 24, or 32 bits. When 32-bit data is selected, all 32-bits will be significant.
There are options for right or left justified 16-bit or 24-bit data.
There is also an option for raw 32-bit data directly from the integrator. This option supports a software comb filter.
20.3.7 FIFO
The PDM module has a 32-bit by four entry FIFO. The FIFO has the capacity to store up to eight 16-bit samples, four 32-bit samples, or
four 24-bit samples. Each sample is normally stored as a 32-bit word, unless the DATAFORMAT field is set to DOUBLE16 in the
PDMn_CFG0 register. The PDM module stores data in the FIFO starting with CH0. The DMA or software should read out all samples
for all enabled channels starting with CH0.
The FIFO has a programmable Data Valid Level interrupt, FIFO full interrupt, and FIFO overflow interrupt.
If the DATAFORMAT field is set to DOUBLE16, then 16-bit data from two channels are packed into a single 32-bit word and written into
the FIFO.
If NUMCH bitfield is 0 (i.e. only one channel, CH0) and the DATAFORMAT field is set to DOUBLE16, then the UPPER16BIT are zeros
and LOWER16BIT data has CH0 16-bit data.
The module will generate a DMA request when the number of samples in the FIFO is equal to the level set by the FIFODVL field in the
PDMn_CFG0 register.
The module has a PRS sync output which generates a PRS output pulse on the onset of the down sample rate clock. This PRS signal
may be used to trigger an ADC conversion, routed to a timer/counter, PCNT, or to a GPIO pin.
When CPU is halted in debug mode, the PDM will continue to run and DMA will capture the data from the FIFO.
A common GPIO pin is used as the clock output for up to 2 DATA ports.
Three route locations are available via DBUS and the DBUS connections are detailed in the device data sheet. Pin locations can be
selected using the GPIO_PDM_CLKROUTE and GPIO_PDM_DATxROUTE registers. The clock output is enabled using the
GPIO_PDM_ROUTEEN register. The slew rate for the CLK pin should be set to its maximum (fastest) setting.
All pins should be selected from the same DBUS (DBUSAB or DBUSCD). Optimal performance is achieved when all pins are routed
adjacent to each other on the same GPIO port (PA, PB, PC, or PD).
• The PDM configuration registers are considered to be static and can only be updated when the filter is not running. Only DSR/Gain
can be changed dynamically.
• Stop the filter before changing the prescale value. Stopping the filter will gate off the clock to external devices. Before re-starting the
filter, issue a Filter CLEAR command "PDMn_CMD.CLEAR" and issue a FIFO Flush command "PDMn_CMD.FIFOFL". The Filter
CLEAR command acts as soft reset to the Filter and the Flush command as soft reset to the FIFO pointers.
• When there is an Overflow error condition, without Stopping the filter, issue a FIFO Flush command.
When a FLUSH command is issued, poll for FLUSHFLBUSY, don't read STATUS bits when FLUSHFLBUSY is high.
Similarly when the DSR/GAIN fields in CTRL register are configured, poll for SYNCBUSY bit in the SYNCBUSY register.
• The START command is common for all channels of the filter. When NUMCH is set to 1, i.e. when two channels are configured, both
channel filter outputs are available at a time and hardware will take 6 cycles to write into FIFO, so there is a limitation on the mini-
mum DSR setting.
• If the DATAFORMAT selected in PDMn_CFG0 is 32-bit/24-bit/16-bit, then Minimum DSR > (NUMCH + 3).
Example: If NUMCH is 1 (two channels) and the DATAFORMAT is DOUBLE16, then Minimum DSR should be 3.
CMU->EM01GRPBCLK = CMU_EM01GRPBCLK_CLKSEL_HFRCODPLL;
while(PDM->SYNCBUSY !=0);
PDM->CFG1 = (prescale_val << _PDM_CFG1_PRESC_SHIFT);
• Configure PDM
In this example PDM is configured to single channel, data capture polarity of channel is set 0, filter output to 32-bit, FIFO data valid
level to max (3), DSR to 64 and Gain to 0, Filter order set to 5
Configure DSR/Gain, in this example DSR is set to decimal 64, since 32-bit output no need to shift, so Gain is set to 0
while(PDM->SYNCBUSY !=0);
PDM->CTRL = ((0 << _PDM_CTRL_GAIN_SHIFT) | (64 << _PDM_CTRL_DSR_SHIFT));
while(PDM->SYNCBUSY !=0);
PDM->CMD = PDM_CMD_START;
• In ISR routine, If there is overflow or underflow is set, without stopping the filter issue the FLUSH command
while(PDM->SYNCBUSY !=0);
PDM->CMD = PDM_CMD_FIFOFL;
• After the desired number of samples are collected, if PDM need to be stopped then
while(PDM->SYNCBUSY !=0);
PDM->CMD = PDM_CMD_STOP;
while(PDM->SYNCBUSY !=0);
PDM->CMD = PDM_CMD_CLEAR;
while(PDM->SYNCBUSY !=0);
PDM->CMD = PDM_CMD_FIFOFL;
20.4 Applications
Micro-Electrical Mechanical (MEMS) microphones offer lower cost, smaller packages, and better reliability than electret microphones.
These microphones are available with analog or digital PDM outputs. The PDM version does not require an expensive audio quality
ADC and offer a lower overall system cost. This PDM module works with most MEMS microphones with a PDM digital output.
Internal to the PDM microphone, an analog signal drives a sigma delta modulator and outputs a Pulse Density Modulated bit stream.
The MCU provides a clock to the microphone and the microphone provides a signal back. Some PDM microphones support stereo
using both edges of the clock. This eliminates one of the wires, which is important for some products when the wiring and/or connector
cost are significant. It also frees up on additional GPIO pin on the MCU. Note that it is also possible to support stereo using one clock
and two signal wires, one for right and one for left, this just uses more pins and more wire connects.
A high quality audio codec might use a 256x oversampling ratio with a 12.288 MHz clock for 48 kHz audio. The PDM microphones have
a limited bandwidth for the oversampling clock. Most MEMS PDM microphones have a 1-3 MHz range. It is common to use exactly
3.072 MHz for 48 kHz audio.
Because of the limited oversampling clock range, the CIC filter for PDM microphones must have a lower oversampling ratio and a high-
er order than other applications. Most PDM microphones use a 4th order sigma delta modulator and require a 5th order decimation
filter. The 5th order filter will provide a 16 bit ENOB with a 48 kHz sample rate and 1.536 MHz clock rate (32x OSR).
Fclk (MHz)
ENOB vs order
3.072 2.8224 1.536 1.024
The PDM module also supports isolated sigma delta modulators with a clock in and sigma delta output, such as the Silicon Labs
Si8940.
The desired sample frequency depends on the chip limits of the isolated sigma delta converter, and also the application. Most isolated
sigma delta modulators have a limit of 10 or 20 MHz. For industrial motor control, the common PWM and sample frequencies are 16
kHz, 12 kHz, and 8 kHz. Electric metering applications are required to measure the harmonics up to the 50th harmonic, and the sample
rate must be at least twice this frequency. So the sample frequency must be at least 5 kHz for 50 Hz, or 6 kHz for 60 Hz. The table
below summarizes the typical sampling frequencies.
A third order filter is generally sufficient for most isolated sigma delta applications. Most available sigma delta modulators are second
order. There is no need to use higher than third order to achieve a high ENOB using a low clock rate, as with the PDM microphones.
However, there is a need for higher decimation ratios to achieve the desired low sample frequencies. A max DSR of 256 will support
near 24-bit performance with an output word rate of 10 to 20 kHz.
Most available isolated sigma delta modulators are limited to an ENOB of only 14 bits. So using a higher OSR will not necessarily result
in a higher ENOB or signal to noise ration. However, using a higher OSR will result in a lower output word rate.
Fclk (MHz)
OSR Fsamp (kHz) Fsamp (kHz) Fsamp (kHz) Fsamp (kHz) Fsamp (kHz) Fsamp (kHz) 3 4 5
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
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
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
GAIN RW 0x0 2
1
0
RW 0x0
Reset
Access
DSR
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
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
0x00C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
FIFOFL W(nB) 0x0 16
15
14
13
12
11
10
9
CLEAR W(nB) 0x0 8
7
6
5
W(nB) 0x0 4
3
2
1
W(nB) 0x0 0
Reset
Access
START
STOP
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
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: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: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
0x0 9
8
7
6
0x1 5
0x0 4
3
2
1
0x0 0
Reset
Access
FIFOCNT R
R
R
R
EMPTY
Name
FULL
ACT
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: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
RW 0x0 25
RW 0x0 24
23
22
21
20
19
18
17
STEREOMODECH01 RW 0x0 16
15
14
13
12
11
10
RW 0x0 9
8
7
6
5
RW 0x0 4
3
2
1
0
RW 0x0
RW 0x0
Reset
Access
DATAFORMAT
CH1CLKPOL
CH0CLKPOL
Name
FIFODVL
FORDER
NUMCH
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: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
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
Number of Channels.
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
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
DLYMUXSEL RW 0x0
RW 0x0
Reset
Access
Name
PRESC
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: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
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
RXDATA R(r) 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
RW 0x0 3
RW 0x0 2
DVL RW 0x0 1
RW 0x0 0
Reset
Access
Name
OF
DV
UF
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
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
RW 0x0 2
DVL RW 0x0 1
RW 0x0 0
Reset
Access
Name
OF
DV
UF
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
0x0 3
2
1
0x0 0
Reset
Access
FIFOFLBUSY R
R
SYNCBUSY
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
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
Quick Facts
What?
0 1 2 3 4
The USART handles high-speed UART, SPI-bus,
SmartCards, and IrDA communication.
Why?
CLK
µC CS
21.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.
21.2 Features
An overview of the USART module is shown in Figure 21.1 USART Overview on page 552.
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 21.1 USART Asynchronous vs. Synchronous Mode on page 553. Full duplex and half duplex communication is
supported in both asynchronous and synchronous mode.
Table 21.2 USART Pin Usage on page 553 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 21.3.2.14 Local Loopback and 21.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 21.2 USART Asynchronous Frame Format on
page 554.
Frame
The number of data bits in a frame is set by DATABITS in USARTn_FRAME, see Table 21.3 USART Data Bits on page 554, and the
number of stop-bits is set by STOPBITS in USARTn_FRAME, see Table 21.4 USART Stop Bits on page 554. 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 21.5 USART Parity Bits on page 555. 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 21.3 USART Baud Rate on page 556.
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 21.6 USART Oversampling on page 556.
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 21.4 USART Desired Baud
Rate on page 556:
Table 21.7 USART Baud Rates @ 4MHz Peripheral Clock with 20 bit CLKDIV on page 556 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 21.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 21.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 21.5 USART Transmit Buffer Operation on page 558 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
21.6 USART Receive Buffer Operation on page 560.
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 21.3.2.20 Multi-Processor Mode and 21.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 21.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 21.7 USART Sampling of Start and Data Bits on page 562.
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 21.7 USART Sampling of Start and Data Bits on page 562.
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 21.8 USART Sampling of
Stop Bits when Number of Stop Bits are 1 or More on page 563. 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 21.8 USART Sampling of
Stop Bits when Number of Stop Bits are 1 or More on page 563, 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 21.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 21.9 USART Local
Loopback on page 564. 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, 21.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, 21.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, 21.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 21.10 USART Half Duplex Communication with External Driver on page 565 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 21.11 USART Transmission
of Large Frames on page 566. The first element in the transmit buffer, i.e. element 0 in Figure 21.11 USART Transmission of Large
Frames on page 566 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 21.11 USART Transmission of Large Frames on page 566, 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 21.12 USART Transmission of Large Frames, MSBF on page 566 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 21.13 USART Reception of Large Frames on
page 567. 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 21.14 USART ISO 7816 Data Frame Without
Error on page 568. 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 21.15 USART ISO 7816 Data
Frame With Error on page 568. 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 21.16 USART SmartCard Stop Bit Sampling on page 569. 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 21.17 USART Synchronous Mode Bit Rate on page 570. 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 21.18 USART Synchronous
Mode Clock Division Factor on page 570
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 21.8 USART SPI Modes on page 570. Figure 21.19 USART SPI Timing on page 570 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.
21.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
21.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.
21.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 21.9 USART I2S Modes on page 573, 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 21.22 USART Left-Justified I2S Waveform on page 574 and Figure 21.23 USART
Right-Justified I2S Waveform on page 574. 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 21.20 USART Standard I2S Waveform on page 573 and Figure 21.21 USART Standard
I2S Waveform (Reduced Accuracy) on page 573. 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 21.22 USART Left-Justified I2S Waveform on page 574. 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 21.23 USART Right-Justified I2S Waveform on page 574. 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 21.24 USART Mono I2S Waveform on page 574.
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.
21.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 21.25 USART Timer Block Diagram on page 578.
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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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
21.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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578
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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on
page 578 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 21.29 USART TXSEQ Timing on page
581 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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page
578 for details on setting up this example. For this example in Figure 21.29 USART TXSEQ Timing on page 581 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
21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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
21.29 USART TXSEQ Timing on page 581.
A response delay can be used to hold off the transmitter until a certain number of baud-times after the RX frame. See Table
21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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 21.10 USART Application Settings for USARTn_TIMING and USARTn_TIMECMPn on page 578 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.
21.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 21.31 USART Example RZI Signal for a given
Asynchronous USART Frame on page 583.
Idle Idle
USART
S 0 1 2 3 4 5 6 7 P Stop
(NRZ)
IrDA
(RZI)
Figure 21.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 21.11 USART IrDA Pulse Widths on page 583.
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 EUART handles high-speed UART and IrDA
communication.
Why?
CTS
RTS
22.1 Introduction
The Enhanced Universal Asynchronous serial Receiver and Transmitter (EUART) is a very flexible serial I/O module. It supports full
duplex asynchronous UART communication. It can also interface with IrDA devices.
22.2 Features
An overview of the EUART module is shown in Figure 22.1 EUART Overview on page 626.
This section describes all posible EUART features. Please refer to the Device Datasheet to see what features a specific EUART in-
stance supports.
Peripheral Bus
EUARTn_CTS
Baud rate
generator
Auto Baud
Detection
EUARTn_RX
IrDA
PRS inputs demodulator
The EUART 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).
The EUART operates in HF mode when the EUARTCLK clock selected in CMU_UARTCLKCTRL_CLKSEL is EM01GRPACLK. The
EUART operates in LF mode when the selected clock is EM23GRPACLK.
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.
The frame format used by the EUART 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 9 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 22.2 EUART Asynchronous Frame Format on page 627.
Frame
The number of data bits in a frame is set by DATABITS in EUARTn_FRAMECFG, see Table 22.1 EUART Data Bits on page 627, and
the number of stop-bits is set by STOPBITS in EUARTn_FRAMECFG, see Table 22.2 EUART Stop Bits on page 627. Whether or not
a parity bit should be included, and whether it should be even or odd is defined by PARITY, also in EUARTn_FRAMECFG. For reliable
communication, all parties of a transfer must agree on the frame format being used prior to the start of the transfer.
0001 4
0010 5
0011 6
0100 7
0101 8 (Default)
0110 9
01 1 (Default)
11 2
The order in which the data bits are transmitted and received is defined by MSBF in EUARTn_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 EUARTn_CFG0, and the format expected by the receiver
can be inverted by setting RXINV in EUARTn_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 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 22.3 EUART Parity Bits on page 628. 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 EUART clock defines the transmission and reception data rate. The baud rate (bit-rate) is given by Figure 22.3 EUART Baud Rate
on page 629.
br = fEUARTn/(oversample x (1 + EUARTn_CLKDIV/256))
where fEUARTn is the peripheral clock frequency and oversample is the oversampling rate as defined by OVS in EUARTn_CFG0, see
Table 22.4 EUART Oversampling on page 629.
Note: In LF mode, with oversampling disabled, the baud rate must be less than 1/3 the LF clock frequency.
The EUART has a fractional clock divider to allow the EUART clock to be controlled more accurately than what is possible with a stand-
ard integral divider. The clock divider used in the EUART 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 EUARTn_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 EUARTn_CLKDIV can be calculated by using Figure 22.4 EUART Desired Baud
Rate on page 629:
Table 22.5 EUART Baud Rates in HF mode @ 4MHz Peripheral Clock with 20 Bit CLKDIV on page 629 shows a set of desired baud
rates and how accurately the EUART is able to generate these baud rates when running at a 4 MHz peripheral clock in HF mode, using
16x or 8x oversampling.
Table 22.5. EUART Baud Rates in HF mode @ 4MHz Peripheral Clock with 20 Bit CLKDIV
Table 22.6 EUART Baud Rates in LF mode @ 32.768 kHz Peripheral Clock with 20 bit CLKDIV on page 630 shows a set of desired
baud rates and how accurately the EUART is able to generate these baud rates when running from a 32.768 kHz peripheral clock in LF
mode.
Table 22.6. EUART Baud Rates in LF mode @ 32.768 kHz Peripheral Clock with 20 bit CLKDIV
The EUART has an automatic baud detection feature, which is available when operating in HF mode. Setting AUTOBAUDEN in EU-
ARTn_CFG0 uses the first frame received to automatically set the baud rate provided that it contains 0x55 (IrDA uses 0x00). The re-
ceiver 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 EUARTn_CLKDIV will be overwritten with the new value. The OVS in EUARTn_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 detection is done over 8 baud times, only the upper 3 bits of the fractional part of the clock divider
are populated. When autobaud detection has completed, the status bit EUARTn_STATUS_AUTOBAUDDONE and interrupt flag EU-
ARTn_IF_AUTOBAUDDONE are set.
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 in LF mode.
• 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 buffer using one of the methods described in 22.3.7 Transmit
FIFO Operation. When the transmission shift register is empty and ready for new data, a frame from the transmit FIFO is loaded into
the shift register, and if the transmitter is enabled, transmission begins. When the frame has been transmitted, a new frame is loaded
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 EUARTn_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 EUARTn_STATUS.
When the EUART transmitter is enabled and there is no data in the transmit shift register or transmit FIFO, the TXC flag in EU-
ARTn_STATUS and the TXC interrupt flag in EUARTn_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 FIFO is a four entry FIFO buffer. A frame can be loaded into the FIFO by writing to EUARTn_TXDATA. Using EU-
ARTn_TXDATA allows up to 9 bits to be written to the buffer, as well as a set of control bits for the transmission of the written frame.
Every frame in the FIFO is stored with 9 data bits and the additional control bits. A frame is loaded from the FIFO into the shift register if
the transmitter is enabled.
Figure 22.5 EUART Transmit FIFO Operation on page 632 shows the basics of the transmit FIFO.
Peripheral Bus
Write CTRL
Shift register
In addition to the interrupt flag TXC in EUARTn_IF and status flag TXC in EUARTn_STATUS, which are set when the transmission is
complete, TXFL in EUARTn_STATUS and the TXFL interrupt flag in EUARTn_IF are used to indicate the level of the transmit FIFO.
The TXFIW field in EUARTn_CFG1 controls the level at which the TXFL flags are set. For example, if TXFIW is set to ONEFRAME,
TXFL will be set when the FIFO has space for at least one frame. The TXFCNT field in EUARTn_STATUS indicates the number of
entries present in the TX FIFO. If the FIFO is empty, the TXIDLE bit in EUARTn_STATUS will be set to indicate that the transmitter is
idle.
The transmit FIFO can be cleared by setting CLEARTX in EUARTn_CMD. Since this is an asynchronous FIFO, software must first is-
sue the CLEARTX command and then wait on the CLEARTXBUSY status flag until it goes low. The EUART must be enabled
(EUARTn_EN should be set) for the flush command to work. The EUART should not be transmitting when the 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, and will complete transmission. 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.
When writing more frames to the transmit buffer than there is free space for, the TXOF interrupt flag in EUARTn_IF will be set, indicat-
ing an overflow. The data already in the transmit buffer is preserved in this case, and no data is written.
The FIFO status fields TXFL and TXFCNT are dependent on hardware conditions, and persist even if the EUART is disabled (EU-
ARTn_EN is 0). TXFL will be automatically cleared by hardware if the underlying condition is not met, and TXFCNT always represents
the number of words present in the FIFO. Writing to the TX FIFO when the EUART is disabled is allowed.
Note: In LF 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 happens and the space that
becomes available in the FIFO is the same as programmed in TXFIW in EUARTn_CFG1.
The transmission control bits, which can be written using EUARTn_TXDATA, 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 UART frame are thus not supported by the EUART. Direct GPIO control 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. See 22.3.12 Blocking Incoming Data for more details.
• 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 still attempt to send the additional data. Because the output is tristated, nothing will appear at the transmitter out-
put during this time. 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 EU-
ARTn_CFG0. If AUTOTRI is set the TXTRI status flag will always read as 0.
By configuring TXDELAY in EUARTn_CFG1, the transmitter can be forced to wait a specified number of bit-periods before it transmits
the first frame in the TX FIFO. This delay is only applied to the first frame transmitted after the transmitter has been idle. When transmit-
ting 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 bit in EUARTn_CMD. When the receiver is enabled, it actively samples the input looking for
a start bit of a new frame. When a start bit 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 FIFO, making the shift register ready for another frame of
data, and the receiver starts looking for another start bit. If a frame is received when the receive FIFO is full, the received frame is
discarded and the RXOF interrupt flag in EUARTn_IF is set to indicate a receive FIFO overflow.
The receiver can be disabled by setting the command bit RXDIS in EUARTn_CMD. Any frame currently being received when the re-
ceiver is disabled is discarded. The RXENS bit in EUARTn_STATUS indicates whether or not the receiver is enabled.
The receive FIFO is a four entry FIFO buffer. Data can be read from the receive FIFO via EUARTn_RXDATA. EUARTn_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 EUARTn_RXDATA, the frame is pulled out of the FIFO, making room for a new frame. If an attempt
is made to read the receive FIFO when it is empty, the RXUF interrupt flag in EUARTn_IF is set to signal a receive buffer underflow.
The data returned from a FIFO underflow read is undefined.
Frames can be read from the receive FIFO without removing the data by using EUARTn_RXDATAP. EUARTn_RXDATAP gives access
to the first frame in the FIFO, as well as the status bits. The data read from this register when the receive FIFO is empty is undefined.
No underflow interrupt is generated by reading using this register, i.e. RXUF in EUARTn_IF is never set as a result of reading from
EUARTn_RXDATAP.
The basic operation of the receive FIFO is shown in Figure 22.6 EUART Receive FIFO Operation on page 634.
Peripheral Bus
RXDATA,
RX FIFO element 0 Status RXDATAP
Status
Shift register
The 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 the 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 EUART is disabled (i.e., EUARTn_EN is 0). It is possible to read from the receive FIFO while
EUART 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.
The receive FIFO has four associated interrupt flags in the IF register: 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 the CFG1 register. RXFULL is set when the receive
FIFO is full. Both RXFL and RXFULL remain set as long as the underlying condition is true even if the EUART 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 (and this will happen even if EUART is disabled). Reading data from the FIFO or disabling the
RXFL / RXFULL interrupts will block the respective interrupt after a software clear. RXOF is set when a new frame is received while the
receive FIFO is full, indicating a receive FIFO overflow. The new frame is discarded. RXOF triggers every time an overflow event oc-
curs. RXUF (receive FIFO underflow) is set when an attempt is made by software or DMA to read the receive FIFO when it is empty.
The data read from the FIFO is undefined. RXUF triggers every time an underflow occurs even if the EUART is disabled.
When using hardware frame recognition, as detailed in 22.3.23 Multi-Processor Mode and 22.3.24 Collision Detection, it is necessary to
be able to let the receiver sample incoming frames without pushing them into the receive FIFO. This is accomplished by blocking in-
coming data.
Incoming data is blocked as long as RXBLOCK in EUARTn_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 EUARTn_STATUS or the RXFL interrupt flag in EU-
ARTn_IF of their arrival. For data to be loaded into the receive buffer, RXBLOCK must be cleared before a frame is fully received by the
receiver. RXBLOCK is set by setting RXBLOCKEN in EUARTn_CMD and disabled by setting RXBLOCKDIS also in EUARTn_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 when operating in multi-processor mode. See 22.3.23 Multi-Processor Mode for more information.
Frames received containing framing or parity errors will not result in the FERR and PERR interrupt flags in EUARTn_IF being set while
RXBLOCK in EUARTn_STATUS is set. Hardware recognition is not applied to these erroneous frames, and they are silently discarded.
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 EUARTn_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 22.7 EUART Sampling of Start and Data Bits on page 636.
With OVS=0 in EUARTn_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 22.7 EUART Sampling of Start and Data Bits on page 636.
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 mode, oversampling must be set to 4, 6, 8, or 16x. When operating in LF mode, oversampling must be
disabled.
Software can disable the majority vote behavior by setting MVDIS in EUARTn_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 22.8 EUART Sampling of
Stop Bits when Number of Stop Bits are 1 or More on page 637. When a stop bit has been detected, the EUART is ready for a new
start bit.
As seen in Figure 22.8 EUART Sampling of Stop Bits when Number of Stop Bits are 1 or More on page 637, 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 22.8. EUART 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 EUART 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 EUARTn_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 EUARTn_RXDATA or EUARTn_RXDATAXP registers.
If ERRSTX in EUARTn_CFG0 is set, the transmitter is disabled on received parity errors. If ERRSRX in EUARTn_CFG0 is set, the
receiver is disabled on received 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-
ARTn_IF is also set. Frames with framing errors are loaded into the receive FIFO like regular frames.
FERR can be accessed by reading the frame from the receive buffer using the EUARTn_RXDATAX or EUARTn_RXDATAXP registers.
If ERRSTX in EUARTn_CFG0 is set, the transmitter is disabled on received framing errors. If ERRSRX in EUARTn_CFG0 is set, the
receiver is disabled on received framing errors.
The EUART 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 EUART by transmitting a given frame.
When SFUBRX in EUARTn_CFG1 is set, an incoming frame matching the frame defined in EUARTn_STARTFRAME will result in
RXBLOCK in EUARTn_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 EUARTn_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 EUARTn_IF being set, regardless of the value of SFUBRX in EU-
ARTn_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. EUARTn_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-
ARTn_SIGFRAME is detected by the receiver, the SIGFIF interrupt flag in EUARTn_IF is set. As with start frame detection, the interrupt
will be set even if the receiver is blocked i.e. EUARTn_STATUS_RXBLOCK = 1.
One use of the programmable signal frame is to signal the end of a multi-frame message transmitted to the EUART. 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 EUART 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, ULFRCO) is used as the EUARTn 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.
The EUART receiver samples RX by default, and the transmitter drives TX by default. This is not the only option however. When
LOOPBK in EUARTn_CFG0 is set, the receiver is connected to the TX pin as shown in Figure 22.9 EUART Local Loopback on page
638. This is useful for debugging, as the EUART can receive the data it transmits, but it is also used to allow the EUART 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
EUART EUART
TX EUARTn_TX TX EUARTn_TX
RX EUARTn_RX RX EUARTn_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 EUART both receives and transmits data on the same pin. This is enabled by setting LOOPBK in EUARTn_CFG0,
which connects the receiver to the transmitter output. Because they are both connected to the same line, it is important that the EUART
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 EUARTn_CMD, which tristates the transmitter. Before transmitting data, the command bit TXTRI-
DIS, also in EUARTn_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 EUARTn_STATUS. If TXTRI is set when transmitting data, the data is shifted out of the shift register, but is not put
out on the 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-
ARTn_TXDATA, can be used to make the EUART 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 transmission delay feature, detailed in 22.3.9 Transmission Delay, 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. Hardware flow con-
trol is another method to insert time for processing 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, 22.3.25 Hardware Flow Control, for more details.
Tristating the transmitter can also be performed automatically by the EUART by using AUTOTRI in EUARTn_CFG0. When AUTOTRI is
set, the EUART 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.
Figure 22.10 EUART Half Duplex Communication with External Driver on page 639 shows an example configuration using an exter-
nal driver.
µC
GPIO
EUART
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.
To simplify communication between multiple processors, the EUART 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 EUARTn_CFG0 is identi-
fied as an address frame. When an address frame is detected, the MPAF interrupt flag in EUARTn_IF is set, and the address frame is
loaded into the receive register. This happens regardless of the value of RXBLOCK in EUARTn_STATUS.
Multi-processor mode is enabled by setting MPM in EUARTn_CFG0, and the value of the 9th bit in address frames can be set in EU-
ARTn_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.
1. All devices on the bus enable multi-processor mode and enable and block the receiver. They will now not receive data unless it is
an address frame. MPAB in EUARTn_CFG0 is set to identify frames with the 9th bit equal to MPAB as address frames.
2. A transmitting device sends a frame containing the address of a different device and with the 9th bit set to value of MPAB.
3. All devices receive the address frame and get an interrupt. They can read the address from the receive FIFO. The selected device
unblocks the receiver to start receiving data from the transmitter.
4. The transmitter sends data with the 9th bit set to opposite value of MPAB.
5. Only the addressed device with RX enabled and unblocked receives the data. When transmission is complete, the device blocks
the receiver and waits for a new address frame.
The EUART 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 EUARTn_CFG0 or through an external connection, this feature can be used to detect whether data transmitted on
the bus by the EUART did get corrupted by a simultaneous transmission by another device on the bus.
For collision detection to be enabled, CCEN in EUARTn_CFG0 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 EUARTn_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: Collision detection is only supported for baud rates up to 1 Mbps.
Hardware flow control can be used to hold off the link partner's transmission until RX buffer space is available. Port and pin selection for
RTS and CTS are configured in GPIO_EUARTn_RTSROUTE and GPIO_EUARTn_CTSROUTE. RTSPEN in GPIO_EUARTn_ROU-
TEEN enables the RTS pin as an output.
RTS is an output signal which indicates that RX FIFO space is available to receive a frame. The link partner is being requested to send
its data when RTS is asserted. RTS activation can be made dependent on how much space is available in the receive FIFO using
RTXRXFW in EUARTn_CFG1. For debug use set DBGHALT in EUARTn_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 input signal that is used to halt transmission. The link partner controls CTS to indicate whether ot not there is space in its
receive FIFO to accept new data. It will assert CTS when there is space available, and deassert CTS if there is no more room. If CTS
deactivates in the middle of a frame, the frame currently being transmitted is completed before stopping. CTS operation needs to be
enabled using EUARTn_CFG1_CTSEN.
The RTS and CTS signals are active low by default, but their polarity can be changed with RTSINV and CTSINV in EUARTn_CFG1.
During debugging, the debug halt feature allows halting EUART reception by deactivating RTS when the core is halted and continuing
frame reception by activating RTS when the core is released. EUART debug halt can be enabled by setting DBGHALT in EU-
SART_CFG1 to '1'. The EUART receiver must be enabled for debug halting to function.
When EUSART_CFG1_DBGHALT is not set or EUSART_CFG1_DBGHALT is set but the debugger has not halted the system, RTS is
only dependent on the receive FIFO having space available to receive the specified number of frames given by EU-
SART_CFG1_RTSRXFW.
When EUSART_CFG1_DBGHALT is set, RTS will remain deactivated as long as the debugger has halted the system. When the de-
bugger releases the system temporarily while DBGHALT is set, RTS will be activated if the receive FIFO has space available to receive
at least EUSART_CFG1_RTSRXFW frames, and no frame is being received. RTS will be deactivated again when the debugger halt is
re-instated, and the receiver starts receiving a new frame or if the receive FIFO does not have space available to receive at least EU-
SART_CFG1_RTSRXFW frames. This behavior allows single stepping in the debugger to pulse the system halt signal for a cycle, and
receive the next frame.
As the incoming frame is always received until the receive FIFO is full regardless of the state of DBGHALT or whether the chip is hal-
ted, the link partner must honor the RTS signal and stop transmitting when RTS is deactivated, or the receive FIFO could overflow.
All data in the transmit FIFO is sent out even when a debugger halt is active; therefore, DMA will need to be configured to stop sending
EUART TX data during a debug 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_EUARTn_TRIGGER. When a positive edge is detected on this sig-
nal, the receiver is enabled if RXTEN in EUARTn_TRIGCTRL is set, and the transmitter is enabled if TXTEN in EUARTn_TRIGCTRL is
set. Only one signal input is supported by the EUART.
The EUART can be configured to receive data directly from a PRS channel by setting RXPRSEN in EUARTn_CFG1. The PRS channel
used is selected using PRSSEL in PRS_EUARTn_RX.
The EUART has full DMA support. The DMA controller can write to the transmit FIFO using the EUARTn_TXDATA register, and it can
read from the receive FIFO using the register EUARTn_RXDATA. This enables single byte transfers, 9 bit data + control/status bits
transfers both to and from the EUART.
A request for the DMA controller to read from the EUART receive buffer can be triggered when the receive FIFO watermark is crossed,
i.e. at least RXFIW frames of data are available in the FIFO.
A write request for the DMA controller can be triggered when the transmit FIFO watermark is crossed, i.e. at least TXFIW frames in the
transmit buffer are empty.
In some cases, it may be sensible to temporarily stop DMA access to the EUART when an error such as a framing error has occurred.
This is enabled by setting ERRSDMA in EUARTn_CFG0.
The EUART can also work with the DMA when operating in EM2 (in LF mode) so that the system does not have to wake up to EM0 or
EM1 to consume data. This functionality is enabled by setting TXDMAWU or RXDMAWU in the EUARTn_CFG1 register. The DMA will
be triggered by the EUART when the TX or RX watermark conditions are met. DMA will then temporarily power up and pop/push all the
elements of the corresponding FIFO, and then power off again without waking the CPU.
22.3.30 Interrupts
The interrupts generated by the EUART 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
• SIG
• AUTOBAUDDONE
If EUART interrupts are enabled, an interrupt will be made if one or more of the interrupt flags in EUARTn_IF and their corresponding
bits in EUARTn_IEN are set. In LE mode, all interrupts can serve to wake the system from EM2.
The EUART can operate in EM2 when running from an LF oscillator source (LF mode). Note that sending and receiving data in EM2
requires that the EUART 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 EUART 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 EUARTn_CFG1, the system will not be able to go to EM2 before all related EUART
DMA requests have been processed. This means that if RXDMAWU is set and the EUART receives a frame, the system will wait to go
to EM2 before the frame has been read from the EUART. In order for the system to go back to EM2 during or after the final transmis-
sion (i.e. when DMA will no add more data to the TX FIFO), the wake request to DMA must be removed. There are two methods 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-
ART 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.
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 EUART module, and modulates it before it leaves the EUART. In the same way, the input signal
is demodulated before it enters the actual EUART 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 EUART 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 22.11 EUART Example RZI Signal for a given
Asynchronous UART Frame on page 643.
Idle Idle
UART
S 0 1 2 3 4 5 6 7 P Stop
(NRZ)
IrDA
(RZI)
Figure 22.11. EUART Example RZI Signal for a given Asynchronous UART Frame
The IrDA module is enabled by setting IREN. The EUART 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 EUARTn_IRCTRL. Four pulse widths are availa-
ble, each defined relative to the configured bit period as listed in Table 22.7 EUART IrDA Pulse Widths on page 643.
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 EUARTn_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 EUART 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-
ARTn_CFG0 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
Access
SKIPPERRF
ERRSDMA
AUTOTRI
ERRSRX
LOOPBK
Name
ERRSTX
MVDIS
RXINV
TXINV
MPAB
CCEN
MSBF
MPM
OVS
Bit Name Reset Access Description
Detects the baud rate based on receiving a 0x55 frame (0x00 for IrDA).
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.
When set, DMA read requests will be cleared on framing and parity errors.
0 DISABLE Framing and parity errors have no effect on DMA requests from
the UART
1 ENABLE DMA requests from the UART 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.
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.
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 EUART transmitter can optionally be inverted by setting this bit.
Setting this bit will invert the input to the EUART 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 EUART bit-period. More clock cycles gives better robustness, while less clock cy-
cles gives better performance.
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.
Multi-processor mode uses the 9th bit of the EUART 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 RX FIFO 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 EUART transmitter for loopback and half duplex communication.
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
RW 0x0 15
14
13
12
RW 0x0 11
RXDMAWU RW 0x0 10
TXDMAWU RW 0x0 9
8
7
6
5
4
RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
RW 0x0
RW 0x0
RW 0x0
Reset
Access
RTSRXFW
RXPRSEN
DBGHALT
SFUBRX
RTSINV
CTSINV
CTSEN
Name
RXFIW
TXFIW
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
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.
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
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 four
frames in it.
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
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.
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 enable wakeup from EM2 to EM1 for DMA/ EUART RX interaction
Set to enable wakeup from EM2 to EM1 for DMA/ EUART TX interaction
8: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 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
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
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
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.
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: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
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 4 consecu-
tive clock cycles to be detected
Configure the pulse width generated by the modulator as a fraction of the configured EUART 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 EUART signals through it. Used when EUART has HF clock.
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
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 EUART output through pulse generator and the EUART input through the pulse extender. Used for LF operation.
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
TXDELAY 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
Configurable delay before new rtansfers. Frames sent back-to-back are not delayed.
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
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.
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
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.
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
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 for EUART. Bits [7:3] are the fractional part and bits [22:8] are the integer part. The
total divider is ([22:8] + [7:3]/32). To make the math easier the total divider can also be calculated as ([22:8] + [7:0]/256)
where bits [0:2] will always be 0. Setting AUTOBAUDEN in CFG0 register 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
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
TXTEN RW 0x0 1
RXTEN 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
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.
0x030 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. EUART must be enabled (EUARTn_EN=1) but should not be transmitting (can be achieved by
disabling transmitter).
Set to clear RXBLOCK, resulting in all incoming frames being loaded into the RX FIFO
Set to disable data reception. If a frame is under reception when the receiver is disabled, the incoming frame is discar-
ded.
0x034 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
0x0 10
0x0 9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
R
R
RXDATA R
PERR
FERR
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
Set if received data has a framing error. Can be the result of a break condition.
0x038
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
0x0 10
0x0 9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
R
R
RXDATAP R
PERRP
FERRP
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
Set if received data has a framing error. Can be the result of a break condition.
Use this register to access data read from the EUART without popping the FIFO.
0x03C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
0x0 13
0x0 12
0x0 11
0x0 10
0x0 9
8
7
6
5
0x0 4
3
2
1
0
Reset
Access
W
W
TXBREAK W
W
W
W
TXDISAT
TXTRIAT
RXENAT
UBRXAT
TXDATA
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
Set to disable trasmitter 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.
Use this register to write data to the EUART. If TXEN is set, a transfer will be initiated at the first opportunity.
0x040 31
30
29
28
27
26
25
0x0 24
23
22
21
20
0x0 19
18
0x0 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
AUTOBAUDDONE R
R
R
R
R
R
R
R
R
R
R
CLEARTXBUSY
Name
RXBLOCK
TXFCNT
RXFULL
RXIDLE
TXIDLE
RXENS
TXENS
TXTRI
RXFL
TXFL
TXC
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
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'.
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
After issuing CLEARTX command, wait on this status flag until it goes low
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: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.
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
0x044 31
30
29
28
27
26
25
AUTOBAUDDONE RW 0x0 24
23
22
21
20
RW 0x0 19
RW 0x0 18
17
16
15
14
RW 0x0 13
RW 0x0 12
11
RW 0x0 10
RW 0x0 9
RW 0x0 8
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
STARTF
RXFULL
TXIDLE
MPAF
PERR
RXOF
FERR
RXUF
TXOF
RXFL
TXFL
SIGF
CCF
TXC
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: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.
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.
17: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 Reserved 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 frame with a framing error is received while RXBLOCK is cleared.
Set when a frame with a parity error is received while RXBLOCK is cleared.
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
Set when a write is done to the TX FIFO while it is full. The data already in the TX FIFO is preserved. Also set if DMA
tries to write to the TX FIFO while a CLEARTX command is running.
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.
0x048 31
30
29
28
27
26
25
AUTOBAUDDONE RW 0x0 24
23
22
21
20
RW 0x0 19
RW 0x0 18
17
16
15
14
RW 0x0 13
RW 0x0 12
11
RW 0x0 10
RW 0x0 9
RW 0x0 8
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
STARTF
RXFULL
TXIDLE
MPAF
PERR
RXOF
FERR
RXUF
TXOF
RXFL
TXFL
SIGF
CCF
TXC
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: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: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 Reserved 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
0x04C 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
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
RXBLOCKDIS R
R
R
R
R
R
R
R
R
RXBLOCKEN
TXTRIDIS
TXTRIEN
Name
RXTEN
TXTEN
RXDIS
TXDIS
RXEN
TXEN
DIV
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
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.
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?
23.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).
23.2 Features
An overview of the I2C module is shown in Figure 23.1 I2C Overview on page 671.
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 23.2 I2C-Bus
Example on page 672. 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 23.3 I2C Pull-up Resistor Equation on page 672.
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 23.4 I2C START and STOP Conditions on page 673, 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 23.5 I2C Bit Transfer on I2C-Bus on
page 673.
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 23.6 I2C Single Byte Write to Follower on page 674, Figure 23.7 I2C Double Byte
Read from Follower on page 674, and Figure 23.8 I2C Single Byte Write, then Repeated Start and Single Byte Read on page 674.
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 23.8. I2C Single Byte Write, then Repeated Start and Single Byte Read
23.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 23.1 I2C Reserved I2C Addresses on page 675, 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 23.9 I2C Leader Transmitter/Follower Receiver with 10-bit Address on page 675.
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
23.10 I2C Leader Receiver/Follower Transmitter with 10-bit Address on page 675.
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.
23.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.
23.3.7 Buffers
The I 2C transmitter has a 2-level FIFO transmit buffer and a transmit shift register as shown in Figure 23.1 I2C Overview on page 671.
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 23.14 I2C Transmit Buffer Operation on page 678 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 23.15 I2C Receive Buffer Operation
on page 679. 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 23.16 I2C Leader State Machine on page 681. 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
23.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 23.3 I2C Leader Transmitter on page 684 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 23.2 I2C Interactions in Prioritized Order on page 682 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 23.2 I2C Interactions in Prioritized Order on page 682 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 23.2 I2C Interactions in Prioritized Order on page 682 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 23.3 I2C Leader Transmitter on page 684 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 23.4 I2C Leader Receiver on page 686. 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 23.5 I2C STATE Values on page 688. 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 23.6 I2C
Transmission Status on page 688.
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 23.17 I2C Follower State Machine on page 689. 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 23.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 23.7 I2C Follower Transmitter on page 690 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 23.8 I2C - Follower Receiver on page 692 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.
23.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 23.9 I2C Bus Error Response on page 694.
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 23.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 23.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.
23.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.
23.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?
24.1 Introduction
The IADC uses an Incremental Analog to Digital architecture, with a resolution of 12 bits when operating at one million samples per
second (1 Msps). The flexible incremental architecture uses oversampling to allow applications to trade speed for higher resolution. An
integrated input multiplexer can select from external I/Os and several internal signals.
24.2 Features
• Flexible oversampled architecture allows for tradeoffs between speed and resolution.
• 1 Msps with oversampling ratio = 2
• 555 ksps with oversampling ratio = 4
• 76.9 ksps with oversampling ratio = 32
• 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 4-entry 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 4-entry 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 24.1 IADC Overview on page 717.
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.
24.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 Figure 24.2 Clocking on page 719.
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. Because the operational mode may be different for single vs. scan conversions, or even for
different conversions within a scan, each configuration group has a PRESCALE bit field in the IADC_SCHEDx register. PRESCALE
must be set to limit ADC_CLK to no faster than 10 MHz in normal mode 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.
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
CLK_CMU_ADC divides clock to
40MHz or less
ADC_CLK FSM and
st
1 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. The OSR is configured with the
OSRHS bit field in the IADC_CFGx register.
During a conversion, the effective front-end sampling frequency (Fsample) in normal mode is equal to ADC_CLK / 4.
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 24.3 Start-up Timing on page 720. 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.
The conversion time for a single sample can be determined from the OSR and the pre-scaled CLK_ADC frequency (fCLK_ADC) as:
The minimum OSR is 2, meaning that the fastest possible conversion lasts 10 CLK_ADC clock cycles.
The IADC will automatically insert 2 additional cycles in the pipeline when changing channels to a new GPIO. This allows for hold timing
on the previous conversion and allows for time to tristate the ABUS analog buses before connecting the next GPIO to the analog bus.
Therefore the maximum sampling rate while continuously sampling on one channel (with CLK_ADC = 10 MHz) is 1 Msps, and the maxi-
mum sampling rate while switching channels is 833 ksps. Figure 24.4 Normal ADC Mode Pipeline on page 721 shows both single-
channel and channel-switching scenarios 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. The blue area in the top diagram represents the
extra time to tristate while changing channels.
AFE Stage 2 c1 c2
AFE Stage 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
ADC_SRC_CLK cycles to synchronize. This is useful for triggering conversions as needed from asynchronous peripheral sources
such as GPIO inputs, RTCC 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.
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 24.5 Immediate Single
Conversion on page 723 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 24.6 Periodic Scan Example on
page 724 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 1 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 24.7 Simple Conversion with Tailgating Enabled on page 725. 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 1 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 24.8 Conversions with Tailgating Disabled on page 726, 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 1 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 24.9 Continuous Conversions on page 726.
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 per-
forms 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 1 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.
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
multiplexer is allowed on the positive and negative input. More detailed examples may be found in 24.3.5.3 ABUS Input Selection Ex-
amples.
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 24.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 24.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 VDDIO VDDIO / 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 24.10 Single-Ended Port/Pin Selection Odd Channel
on page 730 and Figure 24.11 Single-Ended Port/Pin Selection Even Channel on page 730. 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 24.12 Single-Ended Port/Pin Selection Polarity Error on page 731 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 24.13 Differential Port/Pin Selection without Swap on
page 731 and Figure 24.14 Differential Port/Pin Selection with Swap on page 732. 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 24.15 Differential Port/Pin Selection Polarity Error on page 732 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 24.16 MASKREQ Updates on page 733 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.
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.
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.
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.
24.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 four-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 24.17 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 24.18 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
24.17 Data Alignment on page 738 and Figure 24.18 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 24.19 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.
24.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.
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
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 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
6
5
4
RW 0x0 3
2
1
0
TWOSCOMPL RW 0x0
RW 0x0
Reset
Access
ADCMODE
Name
DIGAVG
REFSEL
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: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
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 CLK_ADC. 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
5
4
RW 0x0 3
2
RW 0x0 1
0
RW 0x3
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: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
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.
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
0x0 1
0
Reset
Access
FIFOREADCNT R
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
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
5
4
RW 0x0 3
2
RW 0x0 1
0
RW 0x3
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: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
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.
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
0x0 1
0
Reset
Access
FIFOREADCNT R
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
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?
25.1 Introduction
In the EFR32xG22 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.
25.2 Features
An overview of the GPIO module is shown in Figure 25.1 Pin Configuration on page 775. 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 25.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 25.1 Pin Configuration on page 776 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 25.2 Tristated
Output with Optional Pull-up or Pull-down on page 777.
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 25.3 Push-Pull Configuration on page 777.
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 25.4 Open-drain on page 777.
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_EM4WUCAUSE
GPIO_CMD
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_IFC bit, which clears 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 25.6 Pin n Interrupt Generation on page 780.
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_IFS and GPIO_IFC registers. 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 25.2 EM4WU Interrupt Energy Mode Wakeup on page 781).
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 25.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 25.3.12.1 Digital Bus (DBUS) which allows for extreme-
ly flexible resource placement. Analog route-able resources are connected to pins though the 25.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 25.7 Digital
Bus Interconnect on page 782. There are two DBUSes on the EFR32xG22 - one serving ports A and B and the other 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 TX resource of USART1 to
PB03, set PORT to 0x1 and PIN to 0x3 in GPIO_USART1_TXROUTE. Then set the GPIO_USART1_ROUTEN.TXEN bit.
Any pin connected to a digital resource should be properly configured for that resource. For example USART1 TX should be configured
as push-pull and USART1 RX should be configured as an input.
PB0
PB1
Peripheral N
Resource A
Pn0
Pn1 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
EFR32xG22: 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.
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 25.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 EFR32xG22 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 25.3 GPIO Alternate Function Table on page 783, ABUS routing options are listed in Table 25.4 ABUS Routing Table
on page 783, and DBUS routing options are listed in Table 25.5 DBUS Routing Table on page 784
Peripheral Signal PA PB PC PD
IADC0 ana_neg 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
25.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 these HFBUSCLK. Consequently, when a pin changes state, the change will propagate to GPIO_Px_DIN after two 2
HFBUSCLK cycles. Synchronization (also running on the HFBUSCLK) is also added for interrupt input. To save power when the exter-
nal interrupts are not used, the synchronization flip-flops for these can be turned off by clearing the EXTINT field in the GPIO_IEN regis-
ter.
0x000
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
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 slew rates.
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 not using alternate modes. Higher values provide faster slew rates.
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
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
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
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
MODE0 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
MODE n
15 WIREDANDALTPULLUP- Open-drain output using alternate control with filter and pullup.
FILTER
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
DOUT 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
Data output
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
0x0 4
3
2
1
0
Reset
Access
DIN R
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
Data input
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 representer 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 representer 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
MODE4 RW 0x0
MODE3 RW 0x0
MODE2 RW 0x0
MODE1 RW 0x0
MODE0 RW 0x0
Reset
Access
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
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
7
6
5
4
3
DOUT RW 0x0 2
1
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
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
7
6
5
4
3
0x0 2
1
0
Reset
Access
DIN R
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
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 representer 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 representer 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 representer 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 representer 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
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: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
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: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
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
EXTIPSEL3 RW 0x0
EXTIPSEL2 RW 0x0
EXTIPSEL1 RW 0x0
EXTIPSEL0 RW 0x0
Reset
Access
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
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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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 OFFSET0 OFFSET=0
1 OFFSET1 OFFSET=1
2 OFFSET2 OFFSET=2
3 OFFSET3 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
EXTIPINSEL3 RW 0x0
EXTIPINSEL2 RW 0x0
EXTIPINSEL1 RW 0x0
EXTIPINSEL0 RW 0x0
Reset
Access
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 OFFSET8 OFFSET=8
1 OFFSET9 OFFSET=9
2 OFFSET10 OFFSET=10
3 OFFSET11 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 OFFSET8 OFFSET=8
1 OFFSET9 OFFSET=9
2 OFFSET10 OFFSET=10
3 OFFSET11 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 OFFSET8 OFFSET=8
1 OFFSET9 OFFSET=9
2 OFFSET10 OFFSET=10
3 OFFSET11 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 OFFSET8 OFFSET=8
1 OFFSET9 OFFSET=9
2 OFFSET10 OFFSET=10
3 OFFSET11 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: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
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: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
0x420 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
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
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
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
15
14
13
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
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
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
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
5
4
3
TRACEDATA0PEN RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
TRACECLKPEN
Name
SWVPEN
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
0x450 31
30
29
28
27
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
0x454
31
30
29
28
27
26
25
24
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
0x458 31
30
29
28
27
26
25
24
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
0x45C
31
30
29
28
27
26
25
24
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
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
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
0x46C
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
DCDCCOREHIDDENPEN 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
0x47C 31
30
29
28
27
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
DFRAMEPEN RW 0x0 1
RW 0x0 0
Reset
Access
DOUTPEN
DCLKPEN
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
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
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
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
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
0x488
31
30
29
28
27
26
25
24
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
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
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
0x494
31
30
29
28
27
26
25
24
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
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
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
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
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
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
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
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
0x4B0 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
OUT1PEN RW 0x0 1
OUT0PEN 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
0x4B4
31
30
29
28
27
26
25
24
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
0x4B8 31
30
29
28
27
26
25
24
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
0x4C0
31
30
29
28
27
26
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
RTSPEN RW 0x0 0
Reset
Access
TXPEN
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
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
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
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
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
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
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
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
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
ANTROLLOVERPEN RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
ANTTRIGSTOPPEN
ANTSWUSPEN
ANTSWENPEN
ANTTRIGPEN
ANTRR5PEN
ANTRR4PEN
ANTRR3PEN
ANTRR2PEN
ANTRR1PEN
ANTRR0PEN
Name
DOUTPEN
DCLKPEN
ANT1PEN
ANT0PEN
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
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
0x4E0 31
30
29
28
27
26
25
24
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
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
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
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
0x500 31
30
29
28
27
26
25
24
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
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
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
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
0x520
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
CLKPEN 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
0x524 31
30
29
28
27
26
25
24
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
0x528
31
30
29
28
27
26
25
24
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
0x52C 31
30
29
28
27
26
25
24
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
0x534 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RW 0x0 15
RW 0x0 14
RW 0x0 13
RW 0x0 12
ASYNCH11PEN RW 0x0 11
ASYNCH10PEN 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
ASYNCH9PEN
ASYNCH8PEN
ASYNCH7PEN
ASYNCH6PEN
ASYNCH5PEN
ASYNCH4PEN
ASYNCH3PEN
ASYNCH2PEN
ASYNCH1PEN
ASYNCH0PEN
SYNCH3PEN
SYNCH2PEN
SYNCH1PEN
SYNCH0PEN
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
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
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
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
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
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
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
0x544 31
30
29
28
27
26
25
24
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
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
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
0x554 31
30
29
28
27
26
25
24
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
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
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
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
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
CCC2PEN RW 0x0 5
CCC1PEN RW 0x0 4
CCC0PEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CC2PEN
CC1PEN
CC0PEN
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
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
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
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
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
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
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
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
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
0x594
31
30
29
28
27
26
25
24
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
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
CCC2PEN RW 0x0 5
CCC1PEN RW 0x0 4
CCC0PEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CC2PEN
CC1PEN
CC0PEN
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
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
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
CCC2PEN RW 0x0 5
CCC1PEN RW 0x0 4
CCC0PEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CC2PEN
CC1PEN
CC0PEN
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
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
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
0x5C4
31
30
29
28
27
26
25
24
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
0x5C8 31
30
29
28
27
26
25
24
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
0x5CC
31
30
29
28
27
26
25
24
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
0x5D0 31
30
29
28
27
26
25
24
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
0x5D4
31
30
29
28
27
26
25
24
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
0x5DC 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
CCC2PEN RW 0x0 5
CCC1PEN RW 0x0 4
CCC0PEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CC2PEN
CC1PEN
CC0PEN
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
0x5E0 31
30
29
28
27
26
25
24
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
0x5E4
31
30
29
28
27
26
25
24
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
0x5E8 31
30
29
28
27
26
25
24
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
0x5EC
31
30
29
28
27
26
25
24
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
0x5F0 31
30
29
28
27
26
25
24
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
0x5F4
31
30
29
28
27
26
25
24
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
0x5FC 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
CCC2PEN RW 0x0 5
CCC1PEN RW 0x0 4
CCC0PEN RW 0x0 3
RW 0x0 2
RW 0x0 1
RW 0x0 0
Reset
Access
CC2PEN
CC1PEN
CC0PEN
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
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
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
0x604
31
30
29
28
27
26
25
24
23
22
21