# SMART ARM-Based Microcontroller

DATASHEET

## Description

The Atmel<sup>®</sup> | SMART<sup>™</sup> SAM D11 is a series of low-power microcontrollers using the 32-bit ARM<sup>®</sup> Cortex<sup>®</sup>-M0+ processor, and ranging from 14- to 24-pins with 16KB Flash and 4KB of SRAM. The SAM D11 devices operate at a maximum frequency of 48MHz and reach 2.46 Coremark/MHz. They are designed for simple and intuitive migration with identical peripheral modules, hex compatible code, identical linear address map and pin compatible migration paths between all devices in the product series. All devices include intelligent and flexible peripherals, Atmel Event System for inter-peripheral signaling, and support for capacitive touch button, slider and wheel user interfaces. The SAM D11 series is compatible to the other product series in the SAM D family, enabling easy migration to larger device with added features.

The Atmel SAM D11 devices provide the following features: In-system programmable Flash, sixchannel direct memory access (DMA) controller, 6 channel Event System, programmable interrupt controller, up to 22 programmable I/O pins, 32-bit real-time clock and calendar, two 16- bit Timer/Counters (TC) and one 24-bit Timer/Counter for Control (TCC), where each TC can be configured to perform frequency and waveform generation, accurate program execution timing or input capture with time and frequency measurement of digital signals. The TCs can operate in 8- or 16-bit mode, selected TCs can be cascaded to form a 32-bit TC, and one timer/counter has extended functions optimized for motor, lighting and other control applications. The series provide one full-speed crystal-less USB 2.0 device interface; up to three Serial Communication Modules (SERCOM) that each can be configured to act as an USART, UART, SPI, I<sup>2</sup>C up to 3.4MHz, SMBus, PMBus and LIN slave; up to 10-channel 350ksps 12-bit ADC with programmable gain and optional oversampling and decimation supporting up to 16-bit resolution, one 10-bit 350ksps DAC, two analog comparators with window mode, Peripheral Touch Controller supporting up to 72 buttons, sliders, wheels and proximity sensing; programmable Watchdog Timer, brown-out detector and power-on reset and two-pin Serial Wire Debug (SWD) program and debug interface.

All devices have accurate and low-power external and internal oscillators. All oscillators can be used as a source for the system clock. Different clock domains can be independently configured to run at different frequencies, enabling power saving by running each peripheral at its optimal clock frequency, and thus maintaining a high CPU frequency while reducing power consumption.

The SAM D11 devices have two software-selectable sleep modes, idle and standby. In idle mode the CPU is stopped while all other functions can be kept running. In standby all clocks and functions are stopped expect those selected to continue running. The device supports SleepWalking. This feature allows the peripheral to wake up from sleep based on predefined conditions, and thus allows the CPU to wake up only when needed, e.g. when a threshold is crossed or a result is ready. The Event System supports synchronous and asynchronous events, allowing peripherals to receive, react to and send events even in standby mode.

The Flash program memory can be reprogrammed in-system through the SWD interface. The same interface can be used for non-intrusive on-chip debug and trace of application code. A boot loader running in the device can use any communication interface to download and upgrade the application program in the Flash memory.

The Atmel SAM D11 devices are supported with a full suite of program and system development tools, including C compilers, macro assemblers, program debugger/simulators, programmers and evaluation kits.

## Features

## z Processor

z ARM Cortex-M0+ CPU running at up to 48MHz

z Single-cycle hardware multiplier

z Micro Trace Buffer

## z Memories

z 16KB in-system self-programmable Flash

z 4KB SRAM Memory

## z System

z Power-on reset (POR) and brown-out detection (BOD)

z Internal and external clock options with 48MHz Digital Frequency Locked Loop (DFLL48M) and 48MHz to 96MHz Fractiona Digital Phase Locked Loop (FDPLL96M)

z External Interrupt Controller (EIC)

z 8 external interrupts

z One non-maskable interrupt

z Two-pin Serial Wire Debug (SWD) programming, test and debugging interface

## z Low Power

z Idle and standby sleep modes

z SleepWalking peripherals

## z Peripherals

z 6-channel Direct Memory Access Controller (DMAC)

z 6-channel Event System

z Two 16-bit Timer/Counters (TC), configurable as either:

z One 16-bit TC with compare/capture channels

z One 8-bit TC with compare/capture channels

z One 32-bit TC with compare/capture channels, by using two TCs

z One 24-bit Timer/Counters for Control (TCC), with extended functions:

z Up to four compare channels with optional complementary output

z Generation of synchronized pulse width modulation (PWM) pattern across port pins

z Deterministic fault protection, fast decay and configurable dead-time between complementary output

z Dithering that increase resolution with up to 5 bit and reduce quantization error

z 32-bit Real Time Counter (RTC) with clock/calendar function

z Watchdog Timer (WDT)

z CRC-32 generator

z One full-speed (12Mbps) Universal Serial Bus (USB) 2.0 interface

z Embedded device function

z Eight endpoints

z Can run from internal RC oscillato

z Up to three Serial Communication Interfaces (SERCOM), each configurable to operate as either:

z USART with full-duplex and single-wire half-duplex configuration

z I<sup>2</sup>C Bus up to 3.4MHz

z SMBUS/PMBUS

z SPI

z LIN slave

z 12-bit, 350ksps Analog-to-Digital Converter (ADC) with up to 10 channels

z Differential and single-ended input

z 1/2x to 16x programmable gain stage

z Automatic offset and gain error compensation

z Oversampling and decimation in hardware to support 13-, 14-, 15- or 16-bit resolution

z 10-bit, 350ksps Digital-to-Analog Converter (DAC)

z Two Analog Comparators (AC) with window compare function

z Peripheral Touch Controller (PTC)

z Up to 72-channel capacitive touch and proximity sensing

## z I/O

z Up to 22 programmable I/O pins

## z Packages

z 24-pin QFN

z 20-pin SOIC

z 20-ball WLCSP

z 14-pin SOIC

z Operating Voltage

z 1.62V – 3.63V

## 1. Configuration Summary

Table 1-1. Configuration Summary

<table><tr><td></td><td>SAM D11D – 24-pin QFN</td><td>SAM D11D – 20-pin SOIC / WLCSP</td><td>SAM D11C – 14-pin SOIC</td></tr><tr><td>Pins</td><td>24</td><td>20</td><td>14</td></tr><tr><td>General Purpose I/O-pins (GPIOs)</td><td>22</td><td>18</td><td>12</td></tr><tr><td>Flash</td><td>16KB</td><td>16KB</td><td>16KB</td></tr><tr><td>SRAM</td><td>4KB</td><td>4KB</td><td>4KB</td></tr><tr><td>Timer Counter (TC)</td><td>2</td><td>2</td><td> $2^{(3)}$ </td></tr><tr><td>Waveform output channels for TC</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Timer Counter for Control (TCC)</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Waveform output channels per TCC</td><td>8</td><td>8</td><td>8</td></tr><tr><td>DMA channels</td><td>6</td><td>6</td><td>6</td></tr><tr><td>USB interface</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Serial Communication Interface (SERCOM)</td><td>3</td><td>3</td><td>2</td></tr><tr><td>Analog-to-Digital Converter (ADC) channels</td><td>10</td><td>8</td><td>5</td></tr><tr><td>Analog Comparators (AC)</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Digital-to-Analog Converter (DAC) channels</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Real-Time Counter (RTC)</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>RTC alarms</td><td>1</td><td>1</td><td>1</td></tr><tr><td>RTC compare values</td><td>1 32-bit value or2 16-bit values</td><td>1 32-bit value or2 16-bit values</td><td>1 32-bit value or2 16-bit values</td></tr><tr><td>External Interrupt lines</td><td>8</td><td>8</td><td>8</td></tr><tr><td>Peripheral Touch Controller (PTC) channels (X- x Y-lines) for mutual capacitance(1)</td><td>72 (9x8)</td><td>42 (7x6)</td><td>12 (4x3)</td></tr><tr><td>Peripheral Touch Controller (PTC) channels for self capacitance (Y-lines only)(2)</td><td>16</td><td>13</td><td>7</td></tr><tr><td>Maximum CPU frequency</td><td>48MHz</td><td>48MHz</td><td>48MHz</td></tr><tr><td>Packages</td><td>QFN</td><td>SOIC / WLCSP</td><td>SOIC</td></tr><tr><td>Oscillators</td><td colspan="3">32.768kHz crystal oscillator (XOSC32K)0.4-32MHz crystal oscillator (XOSC)32.768kHzinternal oscillator (OSC32K)32kHz ultra-low-power internal oscillator (OSCULP32K)8MHz high-accuracy internal oscillator (OSC8M)48MHz Digital Frequency Locked Loop (DFLL48M)96MHz Fractional Digital Phased Locked Loop (FDPLL96M)</td></tr><tr><td>Event System channels</td><td>6</td><td>6</td><td>6</td></tr><tr><td>SW Debug Interface</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>Watchdog Timer (WDT)</td><td>Yes</td><td>Yes</td><td>Yes</td></tr></table>

3. The signals for TC2 are not routed out on the 14-pin package.  
2. The number of Y-lines depends on the configuration of the device, as some I/O lines can be configured as either X-lines or Y-lines. The number given here is the maximum number of Y-lines that can be obtained.  
Notes: 1. The number of X- and Y-lines depends on the configuration of the device, as some I/O lines can be configured as either X-lines or Y-lines. Refer to “I/O Multiplexing and Considerations” on page 13 for details. The number in the “Configuration Summary” on page 3 is the maximum number of channels that can be obtained.

## 2. Ordering Information

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_22d9b9605d03b44d5eae430695fb4086c7965bd2dbae582cf2b452bb25f22bef.jpg)

## 2.1 SAM D11C – 14-pin SOIC

<table><tr><td>Ordering Code</td><td>FLASH (bytes)</td><td>SRAM (bytes)</td><td>Package</td><td>Carrier Type</td></tr><tr><td>ATSAMD11C14A-SSUT</td><td>16K</td><td>4K</td><td>SOIC14</td><td>Tape &amp; Reel</td></tr><tr><td>ATSAMD11C14A-SSNT</td><td>16K</td><td>4K</td><td>SOIC14</td><td>Tape &amp; Reel</td></tr></table>

## 2.2 SAM D11D – 20-pin SOIC

<table><tr><td>Ordering Code</td><td>FLASH (bytes)</td><td>SRAM (bytes)</td><td>Package</td><td>Carrier Type</td></tr><tr><td>ATSAMD11D14A-SSUT</td><td>16K</td><td>4K</td><td>SOIC20</td><td>Tape &amp; Reel</td></tr><tr><td>ATSAMD11D14A-SSNT</td><td>16K</td><td>4K</td><td>SOIC20</td><td>Tape &amp; Reel</td></tr></table>

## 2.3 SAM D11D – 20-ball WLCSP

<table><tr><td>Ordering Code</td><td>FLASH (bytes)</td><td>SRAM (bytes)</td><td>Package</td><td>Carrier Type</td></tr><tr><td>ATSAMD11D14A-UUT</td><td>16K</td><td>4K</td><td>WLCSP20</td><td>Tape &amp; Reel</td></tr></table>

## 2.4 SAM D11D – 24-pin QFN

<table><tr><td>Ordering Code</td><td>FLASH (bytes)</td><td>SRAM (bytes)</td><td>Package</td><td>Carrier Type</td></tr><tr><td>ATSAMD11D14A-MUT</td><td>16K</td><td>4K</td><td>QFN24</td><td>Tape &amp; Reel</td></tr><tr><td>ATSAMD11D14A-MNT</td><td>16K</td><td>4K</td><td>QFN24</td><td>Tape &amp; Reel</td></tr></table>

## 2.5 Device Identification

The DSU - Device Service Unit peripheral provides the Device Selection bits in the Device Identification register (DID.DEVSEL) in order to identify the device by software. The device variants have a reset value of DID=0x1001drxx, with the LSB identifying the die number ('d'), the die revision ('r') and the device selection ('xx').

Table 2-1. Device Identification Values

<table><tr><td>Device Variant</td><td>DID.DEVSEL</td><td>Device ID (DID)</td></tr><tr><td>SAMD11D14AM</td><td>0x00</td><td>0x10030r00</td></tr><tr><td>Reserved</td><td>0x01 - 0x02</td><td></td></tr><tr><td>SAMD11D14ASS</td><td>0x03</td><td>0x10030r03</td></tr><tr><td>Reserved</td><td>0x04 - 0x05</td><td></td></tr><tr><td>SAMD11C14A</td><td>0x06</td><td>0x10030r06</td></tr><tr><td>Reserved</td><td>0x07 - 0x08</td><td></td></tr><tr><td>SAMD11D14AU</td><td>0x09</td><td>0x10030r09</td></tr></table>

Note: The device variant (last letter of the ordering number) is independent of the die revision (DSU.DID.REVISION): The device variant denotes functional differences, whereas the die revision marks evolution of the die. The device variant denotes functional differences, whereas the die revision marks evolution of the die

## 3. Block Diagram

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_07ed257b7802997bd9edb500a4ecec8b22bdcccef537a9fea9172f8bcf495048.jpg)  
Notes: 1. Some products have different number of SERCOM instances, PTC signals and ADC signals.  
2. The number of PTC X- and Y-lines depend on the configuration of the device, as some I/O lines can be configured as either X-lines or Y-lines. Refer to “I/O Multiplexing and Considerations” on page 13 for details.

## 4. Pinout

## 4.1 SAM D11C 14-pin SOIC

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_6a9fe60a77d40832154772523426b47fdcf8896042b29c71d285ff7c355e16f0.jpg)

## 4.2 SAM D11D 20-pin SOIC

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_a25a93a3d40c6eef47e1e3d08839106422aa7fc2b1c97ef57eb3b8736d5826ec.jpg)

## 4.3 SAM D11D 20-ball WLCSP

A

B

C

D

E

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_9f54d3c6ae7f9a28eb2ea37b671fa014ecb3216e07cd98317acf9b0900e4913c.jpg)

4

DIGITAL PIN

ANALOG PIN

OSCILLATOR

GROUND

INPUT SUPPLY

REGULATED OUTPUT SUPPLY

RESET PIN

4.4 SAM D11D 24-pin QFN  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_a71ead00a20f7bf47e1f97078fd1479983974a70b0e240c35b7b210ffe7ecc32.jpg)

## 5. Signal Descriptions List

The following table gives details on signal names classified by peripheral.

Table 5-1. Signal Descriptions List

<table><tr><td>Signal Name</td><td>Function</td><td>Type</td><td>Active Level</td></tr><tr><td colspan="4">Analog Comparators - AC</td></tr><tr><td>AIN[3:0]</td><td>AC Analog Inputs</td><td>Analog</td><td></td></tr><tr><td>CMP[1:0]</td><td>AC Comparator Outputs</td><td>Digital</td><td></td></tr><tr><td colspan="4">Analog Digital Converter - ADC</td></tr><tr><td>AIN[19:0]</td><td>ADC Analog Inputs</td><td>Analog</td><td></td></tr><tr><td>VREFA</td><td>ADC Voltage External Reference A</td><td>Analog</td><td></td></tr><tr><td>VREFB</td><td>ADC Voltage External Reference B</td><td>Analog</td><td></td></tr><tr><td colspan="4">Digital Analog Converter - DAC</td></tr><tr><td>VOUT</td><td>DAC Voltage output</td><td>Analog</td><td></td></tr><tr><td>VREFA</td><td>DAC Voltage External Reference A</td><td>Analog</td><td></td></tr><tr><td colspan="4">External Interrupt Controller</td></tr><tr><td>EXTINT[7:0]</td><td>External Interrupts</td><td>Input</td><td></td></tr><tr><td>NMI</td><td>External Non-Maskable Interrupt</td><td>Input</td><td></td></tr><tr><td colspan="4">Generic Clock Generator - GCLK</td></tr><tr><td>GCLK_IO[5:0]</td><td>Generic Clock (source clock or generic clock generator output)</td><td>I/O</td><td></td></tr><tr><td colspan="4">Power Manager - PM</td></tr><tr><td> $\overline{\text{RESET}}$ </td><td>Reset</td><td>Input</td><td>Low</td></tr><tr><td colspan="4">Serial Communication Interface - SERCOMx</td></tr><tr><td>PAD[3:0]</td><td>SERCOM I/O Pads</td><td>I/O</td><td></td></tr><tr><td colspan="4">System Control - SYSCTRL</td></tr><tr><td>XIN</td><td>Crystal Input</td><td>Analog/ Digital</td><td></td></tr><tr><td>XIN32</td><td>32kHz Crystal Input</td><td>Analog/ Digital</td><td></td></tr><tr><td>XOUT</td><td>Crystal Output</td><td>Analog</td><td></td></tr><tr><td>XOUT32</td><td>32kHz Crystal Output</td><td>Analog</td><td></td></tr><tr><td colspan="4">Timer Counter - TCx</td></tr><tr><td>WO[1:0]</td><td>Waveform Outputs</td><td>Output</td><td></td></tr><tr><td colspan="4">Timer Counter - TCCx</td></tr><tr><td>WO[1:0]</td><td>Waveform Outputs</td><td>Output</td><td></td></tr><tr><td colspan="4">Peripheral Touch Controller - PTC</td></tr><tr><td>X[15:0]</td><td>PTC Input</td><td>Analog</td><td></td></tr><tr><td>Y[15:0]</td><td>PTC Input</td><td>Analog</td><td></td></tr><tr><td colspan="4">General Purpose I/O - PORT</td></tr><tr><td>PA25 - PA00</td><td>Parallel I/O Controller I/O Port A</td><td>I/O</td><td></td></tr><tr><td>PA28 - PA27</td><td>Parallel I/O Controller I/O Port A</td><td>I/O</td><td></td></tr><tr><td>PA31 - PA30</td><td>Parallel I/O Controller I/O Port A</td><td>I/O</td><td></td></tr><tr><td>PB17 - PB00</td><td>Parallel I/O Controller I/O Port B</td><td>I/O</td><td></td></tr><tr><td>PB23 - PB22</td><td>Parallel I/O Controller I/O Port B</td><td>I/O</td><td></td></tr><tr><td>PB31 - PB30</td><td>Parallel I/O Controller I/O Port B</td><td>I/O</td><td></td></tr><tr><td colspan="4">Universal Serial Bus - USB</td></tr><tr><td>DP</td><td>DP for USB</td><td>I/O</td><td></td></tr><tr><td>DM</td><td>DM for USB</td><td>I/O</td><td></td></tr><tr><td>SOF 1kHz</td><td>USB Start of Frame</td><td>I/O</td><td></td></tr></table>

## 6<sub>.</sub> I/O M u lti <sub>p</sub>lexi n<sub>g</sub> and Cons iderations

## 6<sub>.</sub> 1 M u lti <sub>p</sub>lexed S i<sub>g</sub> nals

Each <sub>p</sub>i n is b<sub>y</sub> defau lt control led b<sub>y</sub> the PO RT as a <sub>g</sub>eneral <sub>p</sub>u r<sub>p</sub>ose I/O and alternativel<sub>y</sub> it can be assi<sub>g</sub> ned to one of the <sub>p</sub>eri <sub>p</sub>heral fu nctions A B C D E F G or H To e n a b l e a <sub>p</sub>e ri <sub>p</sub> h e ra l fu n ction on a <sub>p</sub> i n th e Pe ri <sub>p</sub> h e ra l M u lti <sub>p</sub>l exe r E na b l e b it i n th e P i n Confi<sub>g</sub> u ration re<sub>g</sub> iste r corres <sub>p</sub>ond i n<sub>g</sub> to that <sub>p</sub> i n ( P I N C FG n P M UXE N n = 0-3 1 ) i n the PO RT m ust be written to one The selection of peri pheral fu nction A to H is done by writi ng to the Peri pheral M u lti plexi ng Odd and Even bits i n the Peri pheral M u lti plexi ng reg ister ( P M UXn P M UXE/O ) i n the PO RT

Table 5- 1 on <sub>p</sub>a<sub>g</sub>e 1 1 descri bes the <sub>p</sub>eri <sub>p</sub>heral si<sub>g</sub> nals m u lti <sub>p</sub>lexed to the PO RT I/O <sub>p</sub>i ns

Table 6-1 <sub>.</sub> PORT F u nction M u lti <sub>p</sub>lexi n<sub>g</sub>

<table><tr><td colspan="3">Pin</td><td></td><td></td><td></td><td>A</td><td colspan="5">B</td><td>C</td><td>D</td><td>E</td><td>F</td><td>G</td><td>H</td></tr><tr><td>SAMD11C 14-pin SOIC</td><td>SAMD11D 20-pin SOIC/ WLCSP</td><td>SAMD11D 24-pin QFN</td><td>I/O Pin</td><td>Supply</td><td>Type</td><td>EIC</td><td>REF</td><td>ADC</td><td>AC</td><td>PTC</td><td>DAC</td><td> $SERCOM^{(1)}$ </td><td>SERCOM-ALT</td><td>TC/TCC</td><td>TCC</td><td>COM</td><td>GCLK</td></tr><tr><td>13</td><td>18 / A1</td><td>1</td><td>PA02</td><td>VDD</td><td></td><td>EXTINT[2]</td><td></td><td>AIN[0]</td><td></td><td>Y[0]</td><td>VOUT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>19 / A2</td><td>2</td><td>PA03</td><td>VDD</td><td></td><td>EXTINT[3]</td><td>ADC/VREFADAC/VREFA</td><td>AIN[1]</td><td></td><td>Y[1]</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>14</td><td>20 / A3</td><td>3</td><td>PA04</td><td>VDD</td><td></td><td>EXTINT[4]</td><td>ADC/VREFB</td><td>AIN[2]</td><td>AIN[0]</td><td>Y[2]</td><td></td><td>SERCOM0/PAD[2]</td><td>SERCOM0/PAD[0]</td><td>TC1/WO[0]</td><td>TCC0/WO[0]</td><td></td><td></td></tr><tr><td>1</td><td>1 / B2</td><td>4</td><td>PA05</td><td>VDD</td><td></td><td>EXTINT[5]</td><td></td><td>AIN[3]</td><td>AIN[1]</td><td>Y[3]</td><td></td><td>SERCOM0/PAD[3]</td><td>SERCOM0/PAD[1]</td><td>TC1/WO[1]</td><td>TCC0/WO[1]</td><td></td><td></td></tr><tr><td></td><td>2 / A4</td><td>5</td><td>PA06</td><td>VDD</td><td></td><td>EXTINT[6]</td><td></td><td>AIN[4]</td><td>AIN[2]</td><td>Y[4]</td><td></td><td>SERCOM0/PAD[0]</td><td>SERCOM0/PAD[2]</td><td>TC2/WO[0]</td><td>TCC0/WO[2]</td><td></td><td></td></tr><tr><td></td><td>3 / B3</td><td>6</td><td>PA07</td><td>VDD</td><td></td><td>EXTINT[7]</td><td></td><td>AIN[5]</td><td>AIN[3]</td><td>Y[5]</td><td></td><td>SERCOM0/PAD[1]</td><td>SERCOM0/PAD[3]</td><td>TC2/WO[1]</td><td>TCC0/WO[3]</td><td></td><td></td></tr><tr><td>2</td><td>4 / B4</td><td>7</td><td>PA08</td><td>VDD</td><td></td><td>EXTINT[6]</td><td></td><td></td><td></td><td></td><td></td><td>SERCOM1/PAD[2]</td><td>SERCOM0/PAD[2]</td><td>TCC0/WO[2]</td><td>TCC0/WO[4]</td><td></td><td>GCLK_IO[0]</td></tr><tr><td>3</td><td>5 / C4</td><td>8</td><td>PA09</td><td>VDD</td><td></td><td>EXTINT[7]</td><td></td><td></td><td></td><td></td><td></td><td>SERCOM1/PAD[3]</td><td>SERCOM0/PAD[3]</td><td>TCC0/WO[3]</td><td>TCC0/WO[5]</td><td></td><td>GCLK_IO[1]</td></tr><tr><td></td><td></td><td>9</td><td>PA10</td><td>VDD</td><td></td><td>EXTINT[2]</td><td></td><td>AIN[8]</td><td>CMP[0]</td><td>X[2]/Y[8]</td><td></td><td>SERCOM0/PAD[2]</td><td>SERCOM2/PAD[2]</td><td>TC2/WO[0]</td><td>TCC0/WO[2]</td><td></td><td>GCLK_IO[4]</td></tr><tr><td></td><td></td><td>10</td><td>PA11</td><td>VDD</td><td></td><td>EXTINT[3]</td><td></td><td>AIN[9]</td><td>CMP[1]</td><td>X[3]/Y[9]</td><td></td><td>SERCOM0/PAD[3]</td><td>SERCOM2/PAD[3]</td><td>TC2/WO[1]</td><td>TCC0/WO[3]</td><td></td><td>GCLK_IO[5]</td></tr><tr><td>4</td><td>6 / D4</td><td>11</td><td>PA14</td><td>VDD</td><td> $I^2C$ </td><td>NMI</td><td></td><td>AIN[6]</td><td>CMP[0]</td><td>X[0]/Y[6]</td><td></td><td>SERCOM0/PAD[0]</td><td>SERCOM2/PAD[0]</td><td>TC1/WO[0]</td><td>TCC0/WO[0]</td><td></td><td>GCLK_IO[4]</td></tr><tr><td>5</td><td>7 / E4</td><td>12</td><td>PA15</td><td>VDD</td><td> $I^2C$ </td><td>EXTINT[1]</td><td></td><td>AIN[7]</td><td>CMP[1]</td><td>X[1]/Y[7]</td><td></td><td>SERCOM0/PAD[1]</td><td>SERCOM2/PAD[1]</td><td>TC1/WO[1]</td><td>TCC0/WO[1]</td><td></td><td>GCLK_IO[5]</td></tr><tr><td></td><td>8 / C3</td><td>13</td><td>PA16</td><td>VDD</td><td></td><td>EXTINT[0]</td><td></td><td></td><td></td><td>X[4]/Y[10]</td><td></td><td>SERCOM1/PAD[2]</td><td>SERCOM2/PAD[2]</td><td>TC1/WO[0]</td><td>TCC0/WO[6]</td><td></td><td>GCLK_IO[2]</td></tr><tr><td></td><td></td><td>14</td><td>PA17</td><td>VDD</td><td></td><td>EXTINT[1]</td><td></td><td></td><td></td><td>X[5]/Y[11]</td><td></td><td>SERCOM1/PAD[3]</td><td>SERCOM2/PAD[3]</td><td>TC1/WO[1]</td><td>TCC0/WO[7]</td><td></td><td>GCLK_IO[3]</td></tr><tr><td></td><td>9 / E3</td><td>15</td><td>PA22</td><td>VDD</td><td> $I^2C$ </td><td>EXTINT[6]</td><td></td><td></td><td></td><td>X[6]/Y[12]</td><td></td><td>SERCOM1/PAD[0]</td><td>SERCOM2/PAD[0]</td><td>TC1/WO[0]</td><td>TCC0/WO[4]</td><td></td><td>GCLK_IO[1]</td></tr></table>

Table 6-1 <sub>.</sub> PORT Fu nction M u lti plexi ng (Conti n ued)

<table><tr><td colspan="3">Pin</td><td rowspan="2">I/O Pin</td><td rowspan="2">Supply</td><td rowspan="2">Type</td><td>A</td><td colspan="5">B</td><td>C</td><td>D</td><td>E</td><td>F</td><td>G</td><td>H</td></tr><tr><td>SAMD11C 14-pin SOIC</td><td>SAMD11D 20-pin SOIC/ WLCSP</td><td>SAMD11D 24-pin QFN</td><td>EIC</td><td>REF</td><td>ADC</td><td>AC</td><td>PTC</td><td>DAC</td><td> $SERCOM^{(1)}$ </td><td>SERCOM-ALT</td><td>TC/TCC</td><td>TCC</td><td>COM</td><td>GCLK</td></tr><tr><td></td><td>10 / D3</td><td>16</td><td>PA23</td><td>VDD</td><td> $I^2C$ </td><td>EXTINT[7]</td><td></td><td></td><td></td><td>X[7]/Y[13]</td><td></td><td>SERCOM1/ PAD[1]</td><td>SERCOM2/ PAD[1]</td><td>TC1/WO[1]</td><td>TCC0/ WO[5]</td><td>USB/SOF 1kHz</td><td>GCLK_IO[2]</td></tr><tr><td></td><td></td><td>17</td><td>PA27</td><td>VDD</td><td></td><td>EXTINT[7]</td><td></td><td></td><td></td><td>X[10]</td><td></td><td></td><td></td><td></td><td></td><td></td><td>GCLK_IO[0]</td></tr><tr><td>6</td><td>11 / E2</td><td>18</td><td>PA28</td><td>VDD</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>7</td><td>12 / D2</td><td>19</td><td>PA30</td><td>VDD</td><td></td><td>EXTINT[2]</td><td></td><td></td><td></td><td></td><td></td><td>SERCOM1/ PAD[0]</td><td>SERCOM1/ PAD[2]</td><td>TC2/WO[0]</td><td>TCC0/ WO[2]</td><td>CORTEX_ MOP/ SWCLK</td><td>GCLK_IO[0]</td></tr><tr><td>8</td><td>13 / E1</td><td>20</td><td>PA31</td><td>VDD</td><td></td><td>EXTINT[3]</td><td></td><td></td><td></td><td></td><td></td><td>SERCOM1/ PAD[1]</td><td>SERCOM1/ PAD[3]</td><td>TC2/WO[1]</td><td>TCC0/ WO[3]</td><td>SWDIO(2)</td><td>GCLK_IO[0]</td></tr><tr><td>9</td><td>14 / D1</td><td>21</td><td> $PA24^{(3)}$ </td><td>VDD</td><td></td><td>EXTINT[4]</td><td></td><td></td><td></td><td>X[8]/Y[14]</td><td></td><td>SERCOM1/ PAD[2]</td><td>SERCOM2/ PAD[2]</td><td>TCC0/WO[2]</td><td>TCC0/ WO[4]</td><td>USB/DM</td><td>GCLK_IO[0]</td></tr><tr><td>10</td><td>15 / C1</td><td>22</td><td> $PA25^{(3)}$ </td><td>VDD</td><td></td><td>EXTINT[5]</td><td></td><td></td><td></td><td>X[9]/Y[15]</td><td></td><td>SERCOM1/ PAD[3]</td><td>SERCOM2/ PAD[3]</td><td>TCC0/WO[3]</td><td></td><td>USB/DP</td><td>GCLK_IO[0]</td></tr></table>

N otes : 1 . Refe r to <sup>“</sup> E l ectri ca l C h aracteristi cs<sup>”</sup> on <sub>p</sub>a<sub>g</sub>e 858 for d eta i ls o n the I<sup>2</sup>C <sub>p</sub> i n ch a racte risti cs . O n l<sub>y</sub> so me <sub>p</sub> i ns can be u sed i n S E RCO M I <sup>2</sup>C mod e . See th e T<sub>yp</sub>e col u m n for u s i n<sub>g</sub> a S E RCO M <sub>p</sub> i n i n I<sup>2</sup>C mod e 2 Th is fu nctio n is o n l<sub>y</sub> activated i n th e <sub>p</sub> resen ce of a d e b u<sub>gg</sub> e r.

## 6.2 Other Functions

## 6.2.1 Oscillator Pinout

The oscillators are not mapped to the normal PORT functions and their multiplexing are controlled by registers in the System Controller (SYSCTRL).

<table><tr><td>Oscillator</td><td>Supply</td><td>Signal</td><td>I/O Pin</td></tr><tr><td rowspan="2">XOSC</td><td rowspan="2">VDDIO/IN/ANA</td><td>XIN</td><td>PA08</td></tr><tr><td>XOUT</td><td>PA09</td></tr><tr><td rowspan="2">XOSC32K</td><td rowspan="2">VDDIO/IN/ANA</td><td>XIN32</td><td>PA08</td></tr><tr><td>XOUT32</td><td>PA09</td></tr></table>

## 6.2.2 Serial Wire Debug Interface Pinout

Only the SWCLK pin is mapped to the normal PORT functions. A debugger cold-plugging or hot-plugging detection will automatically switch the SWDIO port to the SWDIO function.

<table><tr><td>Signal</td><td>Supply</td><td>I/O Pin</td></tr><tr><td>SWCLK</td><td>VDDIO</td><td>PA30</td></tr><tr><td>SWDIO</td><td>VDDIO</td><td>PA31</td></tr></table>

## 7. Power Supply and Start-Up Considerations

## 7.1 Power Domain Overview

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_a8c78ad163002a23259e50f8a543a43a9288e242c8df2d4c956ff86908a3b2ce.jpg)

## 7.2 Power Supply Considerations

## 7.2.1 Power Supplies

The Atmel<sup>®</sup> SAMD11 has single power supply pins

z VDDIO/IN/ANA: Powers I/O lines, OSC8M and XOSC, the internal regulator, ADC, AC, DAC, PTC, OSCULP32K, OSC32K, XOSC32K. Voltage is 1.62V to 3.63V.

z Internal regulated voltage output. Powers the core, memories, peripherals, DFLL48M and FDPLL96M. Voltage is 1.2V.

The ground pin is GND.

## 7.2.2 Voltage Regulator

The voltage regulator has two different modes:

z Normal mode: To be used when the CPU and peripherals are running

Low Power (LP) mode: To be used when the regulator draws small static current. It can be used in standby mode

## 7.2.3 Typical Powering Schematics

The SAM D11 uses a single supply from 1.62V to 3.63V.

The following figure shows the recommended power supply connection.

Figure 7-1. Power Supply Connection  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_f839bfbe9bc738aff659312b3608e55cad6e774711a619d7f1aca67e4002c507.jpg)

## 7.2.4 Power-Up Sequence

## 7.2.4.1 Minimum Rise Rate

The integrated power-on reset (POR) circuitry monitoring the VDDIO/IN/ANA power supply requires a minimum rise rate. Refer to the “Electrical Characteristics” on page 858 for details.

## 7.2.4.2 Maximum Rise Rate

The rise rate of the power supply must not exceed the values described in Electrical Characteristics. Refer to the “Electrical Characteristics” on page 858 for details.

## 7.3 Power-Up

This section summarizes the power-up sequence of the SAM D11. The behavior after power-up is controlled by the Power Manager. Refer to “PM – Power Manager” on page 110 for details.

## 7.3.1 Starting of Clocks

After power-up, the device is set to its initial state and kept in reset, until the power has stabilized throughout the device. Once the power has stabilized, the device will use a 1MHz clock. This clock is derived from the 8MHz Internal

Oscillator (OSC8M), which is divided by eight and used as a clock source for generic clock generator 0. Generic clock generator 0 is the main clock for the Power Manager (PM).

Some synchronous system clocks are active, allowing software execution.

Refer to the “Clock Mask Register” section in “PM – Power Manager” on page 110 for the list of default peripheral clocks running. Synchronous system clocks that are running are by default not divided and receive a 1MHz clock through generic clock generator 0. Other generic clocks are disabled except GCLK\_WDT, which is used by the Watchdog Timer (WDT).

## 7.3.2 I/O Pins

After power-up, the I/O pins are tri-stated.

## 7.3.3 Fetching of Initial Instructions

After reset has been released, the CPU starts fetching PC and SP values from the reset address, which is 0x00000000. This address points to the first executable address in the internal flash. The code read from the internal flash is free to configure the clock system and clock sources. Refer to “PM – Power Manager” on page 110, “GCLK – Generic Clock Controller” on page 88 and “SYSCTRL – System Controller” on page 143 for details. Refer to the ARM Architecture Reference Manual for more information on CPU startup (http://www.arm.com).

## 7.4 Power-On Reset and Brown-Out Detector

The SAM D11 embeds three features to monitor, warn and/or reset the device:

z POR: Power-on reset on VDDIO/IN/ANA

BOD33: Brown-out detector

z BOD12: Voltage Regulator Internal Brown-out detector on VDDCORE. The Voltage Regulator Internal BOD is calibrated in production and its calibration configuration is stored in the NVM User Row. This configuration should not be changed if the user row is written to assure the correct behavior of the BOD12.

## 7.4.1 Power-On Reset on VDDIO/IN/ANA

POR monitors VDDIO/IN/ANA. It is always activated and monitors voltage at startup and also during all the sleep modes. If VDDIO/IN/ANA goes below the threshold voltage, the entire chip is reset.

## 7.4.2 Brown-Out Detector

BOD33 monitors 3.3V. Refer to “SYSCTRL – System Controller” on page 143 for details.

## 7.4.3 Brown-Out Detector on VDDCORE

Once the device has started up, BOD12 monitors the internal VDDCORE.

## 8. Product Mapping

Figure 8-1. Atmel D11 Product Mapping

<table><tr><td colspan="2">Global Memory Space</td></tr><tr><td rowspan="2">Code</td><td>Internal Flash</td></tr><tr><td>Reserved</td></tr><tr><td>SRAM</td><td>Internal SRAM</td></tr><tr><td>Peripherals</td><td>0x20001000</td></tr><tr><td>Reserved</td><td>0x20001000</td></tr><tr><td rowspan="3">AHB-APB</td><td>AHB-APB Bridge A</td></tr><tr><td>AHB-APB Bridge B</td></tr><tr><td>AHB-APB Bridge C</td></tr></table>

AHB-APB Bridge C

<table><tr><td>0x42000000</td><td>PAC2</td></tr><tr><td>0x42000400</td><td>EVSYS</td></tr><tr><td>0x42000800</td><td>SERCOM0</td></tr><tr><td>0x42000C00</td><td>SERCOM1</td></tr><tr><td>0x42001000</td><td>SERCOM2</td></tr><tr><td>0x42001400</td><td>TCC0</td></tr><tr><td>0x42001800</td><td>TC1</td></tr><tr><td>0x42001C00</td><td>TC2</td></tr><tr><td>0x42002000</td><td>ADC</td></tr><tr><td>0x42002400</td><td>AC</td></tr><tr><td>0x42002800</td><td>DAC</td></tr><tr><td>0x42002C00</td><td>PTC</td></tr><tr><td>0x42003000</td><td>Reserved</td></tr><tr><td>0x40FFFFFF</td><td></td></tr></table>

AHB-APB Bridge A

<table><tr><td>0x40000000</td><td>PAC0</td></tr><tr><td>0x40000400</td><td>PM</td></tr><tr><td>0x40000800</td><td>SYSCTRL</td></tr><tr><td>0x40000C00</td><td>GCLK</td></tr><tr><td>0x40001000</td><td>WDT</td></tr><tr><td>0x40001400</td><td>RTC</td></tr><tr><td>0x40001800</td><td>EIC</td></tr><tr><td>0x40001C00</td><td>Reserved</td></tr><tr><td>0x40FFFFFF</td><td></td></tr></table>

<table><tr><td colspan="2">AHB-APB Bridge B</td></tr><tr><td>0x41000000</td><td>PAC1</td></tr><tr><td>0x41002000</td><td>DSU</td></tr><tr><td>0x41004000</td><td>NVMCTRL</td></tr><tr><td>0x41004400</td><td>PORT</td></tr><tr><td>0x41004800</td><td>DMAC</td></tr><tr><td>0x41005000</td><td>USB</td></tr><tr><td>0x41006000</td><td>MTB</td></tr><tr><td>0x41004700</td><td>Reserved</td></tr><tr><td>0x41FFFFFF</td><td></td></tr></table>

## 9. Memories

## 9.1 Embedded Memories

Internal high-speed flash

z Internal high-speed RAM, single-cycle access at full speed

z Dedicated flash area for EEPROM emulation

## 9.2 Physical Memory Map

The High-Speed bus is implemented as a bus matrix. All High-Speed bus addresses are fixed, and they are never remapped in any way, even during boot. The 32-bit physical address space is mapped as follow:

Table 9-1. SAM D11 physical memory map

<table><tr><td rowspan="2">Memory</td><td rowspan="2">Start address</td><td>Size</td></tr><tr><td>SAMD11x14</td></tr><tr><td>Embedded Flash</td><td>0x00000000</td><td>16Kbytes</td></tr><tr><td>Embedded SRAM</td><td>0x20000000</td><td>4Kbytes</td></tr><tr><td>Peripheral Bridge A</td><td>0x40000000</td><td>64Kbytes</td></tr><tr><td>Peripheral Bridge B</td><td>0x41000000</td><td>64Kbytes</td></tr><tr><td>Peripheral Bridge C</td><td>0x42000000</td><td>64Kbytes</td></tr></table>

Table 9-2. Flash memory parameters

<table><tr><td>Device</td><td>Flash size (FLASH_PM)</td><td>Number of pages (FLASH_P)</td><td>Page size (FLASH_W)</td></tr><tr><td>SAMD11x14</td><td>16Kbytes</td><td>256</td><td>64 bytes</td></tr></table>

Note: 1. x = C, D

## 9.3 NVM Calibration and Auxiliary Space

The device calibration data are stored in different sections of the NVM calibration and auxiliary space presented in the following figure.

Figure 9-1. Calibration and Auxiliary space  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_541ee4b242b918bebbc703c159193654e2df0d0823471b505a97dae69d36d765.jpg)  
The values from the automatic calibration row is loaded into their respective registers on startup.

## 9.4 NVM User Row Mapping

The NVM User Row contains calibration data that are automatically read at device power on.

The NVM User Row can be read at address 0x804000.

To write the NVM User Row refer to “NVMCTRL – Non-Volatile Memory Controller” on page 355.

Note that when writing to the user row the values do not get loaded by the other modules on the device until a device reset occurs.

Table 9-3. NVM User Row Mapping

<table><tr><td>Bit Position</td><td>Name</td><td>Usage</td><td>Production setting</td></tr><tr><td>2:0</td><td>BOOTPROT</td><td>Used to select one of eight different bootloader sizes. Refer to “NVMCTRL – Non-Volatile Memory Controller” on page 355.</td><td>7</td></tr><tr><td>3</td><td>Reserved</td><td></td><td>1</td></tr><tr><td>6:4</td><td>EEPROM</td><td>Used to select one of eight different EEPROM sizes. Refer to “NVMCTRL – Non-Volatile Memory Controller” on page 355.</td><td>7</td></tr><tr><td>7</td><td>Reserved</td><td></td><td>1</td></tr><tr><td>13:8</td><td>BOD33 Level</td><td>BOD33 Threshold Level at power on. Refer to SYSCTRL.BOD33 register.</td><td>7</td></tr><tr><td>14</td><td>BOD33 Enable</td><td>BOD33 Enable at power on. Refer to SYSCTRL.BOD33 register.</td><td>1</td></tr><tr><td>16:15</td><td>BOD33 Action</td><td>BOD33 Action at power on. Refer to SYSCTRL.BOD33 register.</td><td>1</td></tr><tr><td>24:17</td><td>Reserved</td><td>Voltage Regulator Internal BOD(BOD12) configuration. These bits are written in production and must not be changed. Default value = 0x70.</td><td>0x70</td></tr><tr><td>25</td><td>WDT Enable</td><td>WDT Enable at power on. Refer to WDT.CTRL register.</td><td>0</td></tr><tr><td>26</td><td>WDT Always-On</td><td>WDT Always-On at power on. Refer to WDT.CTRL register.</td><td>0</td></tr><tr><td>30:27</td><td>WDT Period</td><td>WDT Period at power on. Refer to WDT.CONFIG register.</td><td>0xB</td></tr><tr><td>34:31</td><td>WDT Window</td><td>WDT Window mode time-out at power on. Refer to WDT.CONFIG register. Default value, WINDOW_1 = 0x5</td><td>0xB</td></tr><tr><td>38:35</td><td>WDT EWOFFSET</td><td>WDT Early Warning Interrupt Time Offset at power on. Refer to WDT.EWCTRL register.</td><td>0xB</td></tr><tr><td>39</td><td>WDT WEN</td><td>WDT Timer Window Mode Enable at power on. Refer to WDT.CTRL register.</td><td>0</td></tr><tr><td>40</td><td>BOD33 Hysteresis</td><td>BOD33 Hysteresis configuration at power on. Refer to SYSCTRL.BOD33 register.</td><td>0</td></tr><tr><td>41</td><td>Reserved</td><td>Voltage Regulator Internal BOD(BOD12) configuration. This bit is written in production and must not be changed. Default value = 0.</td><td>0</td></tr><tr><td>47:42</td><td>Reserved</td><td></td><td>0x3F</td></tr><tr><td>63:48</td><td>LOCK</td><td>NVM Region Lock Bits. Refer to “NVMCTRL – Non-Volatile Memory Controller” on page 355.</td><td>0xFFFF</td></tr></table>

## 9.5 NVM Software Calibration Row Mapping

The NVM Software Calibration Row contains calibration data that are measured and written during production test. These calibration values should be read by the application software and written back to the corresponding register. The NVM Software Calibration Row can be read at address 0x806020.

The NVM Software Calibration Row can not be written.

Table 9-4. NVM Software Calibration Row Mapping

<table><tr><td>Bit Position</td><td>Name</td><td>Description</td></tr><tr><td>2:0</td><td>Reserved</td><td></td></tr><tr><td>14:3</td><td>Reserved</td><td></td></tr><tr><td>26:15</td><td>Reserved</td><td></td></tr><tr><td>34:27</td><td>ADC LINEARITY</td><td>ADC Linearity Calibration. Should be written to CALIB register.</td></tr><tr><td>37:35</td><td>ADC BIASCAL</td><td>ADC Bias Calibration. Should be written to CALIB register.</td></tr><tr><td>44:38</td><td>OSC32K CAL</td><td>OSC32KCalibration. Should be written to OSC32K register.</td></tr><tr><td>49:45</td><td>USB TRANSN</td><td>USB TRANSN calibration value. Should be written to the USB PADCAL register.</td></tr><tr><td>54:50</td><td>USB TRANSP</td><td>USB TRANSP calibration value. Should be written to the USB PADCAL register.</td></tr><tr><td>57:55</td><td>USB TRIM</td><td>USB TRIM calibration value. Should be written to the USB PADCAL register.</td></tr><tr><td>63:58</td><td>DFLL48M COARSE CAL</td><td>DFLL48M Coarse calibration value. Should be written to the SYSCTRL DFLLVAL register.</td></tr><tr><td>73:64</td><td>Reserved</td><td></td></tr><tr><td>127:74</td><td>Reserved</td><td></td></tr></table>

## 9.6 Serial Number

Each device has a unique 128-bit serial number which is a concatenation of four 32-bit words contained at the following addresses:

Word 0: 0x0080A00C

Word 1: 0x0080A040

Word 2: 0x0080A044

Word 3: 0x0080A048

The uniqueness of the serial number is guaranteed only when using all 128 bits.

## 10. Processor And Architecture

## 10.1 Cortex M0+ Processor

The Atmel SAM D11 implements the ARM<sup>®</sup> Cortex™-M0+ processor, based on the ARMv6 Architecture and Thumb<sup>®</sup>- 2 ISA. The Cortex M0+ is 100% instruction set compatible with its predecessor, the Cortex-M0 core, and upward compatible to Cortex-M3 and M4 cores. The ARM Cortex-M0+ implemented is revision r0p1. For more information refer to www.arm.com.

## 10.1.1 Cortex M0+ Configuration

Table 10-1. Cortex M0+ Configuration

<table><tr><td>Features</td><td>Configurable option</td><td>Atmel SAM D11 configuration</td></tr><tr><td>Interrupts</td><td>External interrupts 0-32</td><td>32</td></tr><tr><td>Data endianness</td><td>Little-endian or big-endian</td><td>Little-endian</td></tr><tr><td>SysTick timer</td><td>Present or absent</td><td>Present</td></tr><tr><td>Number of watchpoint comparators</td><td>0, 1, 2</td><td>2</td></tr><tr><td>Number of breakpoint comparators</td><td>0, 1, 2, 3, 4</td><td>4</td></tr><tr><td>Halting debug support</td><td>Present or absent</td><td>Present</td></tr><tr><td>Multiplier</td><td>Fast or small</td><td>Fast (single cycle)</td></tr><tr><td>Single-cycle I/O port</td><td>Present or absent</td><td>Present</td></tr><tr><td>Wake-up interrupt controller</td><td>Supported or not supported</td><td>Not supported</td></tr><tr><td>Vector Table Offset Register</td><td>Present or absent</td><td>Present</td></tr><tr><td>Unprivileged/Privileged support</td><td>Present or absent</td><td>Absent(1)</td></tr><tr><td>Memory Protection Unit</td><td>Not present or 8-region</td><td>Not present</td></tr><tr><td>Reset all registers</td><td>Present or absent</td><td>Absent</td></tr><tr><td>Instruction fetch width</td><td>16-bit only or mostly 32-bit</td><td>32-bit</td></tr></table>

Note: 1. All software run in privileged mode only.

The ARM Cortex-M0+ core has two bus interfaces:

Single 32-bit AMBA-3 AHB-Lite system interface that provides connections to peripherals and all system memory, which includes flash and RAM

z Single 32-bit I/O port bus interfacing to the PORT with 1-cycle loads and stores

## 10.1.2 Cortex-M0+ Peripherals

z System Control Space (SCS)

The processor provides debug through registers in the SCS. Refer to the Cortex-M0+ Technical Reference Manual for details (www.arm.com).

z System Timer (SysTick)

The System Timer is a 24-bit timer that extends the functionality of both the processor and the NVIC. Refer to the Cortex-M0+ Technical Reference Manual for details (www.arm.com).

z Nested Vectored Interrupt Controller (NVIC)

External interrupt signals connect to the NVIC, and the NVIC prioritizes the interrupts. Software can set the priority of each interrupt. The NVIC and the Cortex-M0+ processor core are closely coupled, providing low latency interrupt processing and efficient processing of late arriving interrupts. Refer to “Nested Vector Interrupt Controller” on page 26 and the Cortex-M0+ Technical Reference Manual for details (www.arm.com.).

System Control Block (SCB)

The System Control Block provides system implementation information, and system control. This includes configuration, control, and reporting of the system exceptions. Refer to the Cortex-M0+ Devices Generic User Guide for details (www.arm.com.).

## 10.1.3 Cortex-M0+ Address Map

Table 10-2. Cortex-M0+ Address Map

<table><tr><td>Address</td><td>Peripheral</td></tr><tr><td>0xE000E000</td><td>System Control Space (SCS)</td></tr><tr><td>0xE000E010</td><td>System Timer (SysTick)</td></tr><tr><td>0xE000E100</td><td>Nested Vectored Interrupt Controller (NVIC)</td></tr><tr><td>0xE000ED00</td><td>System Control Block (SCB)</td></tr></table>

## 10.1.4 I/O Interface

## 10.1.4.1 Overview

Because accesses to the AMBA<sup>®</sup> AHB-Lite™ and the single cycle I/O interface can be made concurrently, the Cortex-M0+ processor can fetch the next instructions while accessing the I/Os. This enables single cycle I/O accesses to be sustained for as long as needed.

## 10.1.4.2 Description

Direct access to PORT registers.

## 10.2 Nested Vector Interrupt Controller

## 10.2.1 Overview

The ARMv6-M Nested Vectored Interrupt Controller (NVIC) in Atmel SAM D11 supports 32 external interrupts with 4 different priority levels. For more details refer to the Cortex-M0 Technical Reference Manual.

## 10.2.2 Interrupt Line Mapping

Table 10-3. Interrupt Line Mapping

<table><tr><td>Peripheral Source</td><td>NVIC Line</td></tr><tr><td>EIC NMI – External Interrupt Controller</td><td>NMI</td></tr><tr><td>PM – Power Manager</td><td>0</td></tr><tr><td>SYSCTRL – System Control</td><td>1</td></tr><tr><td>WDT – Watchdog Timer</td><td>2</td></tr><tr><td>RTC – Real Time Clock</td><td>3</td></tr><tr><td>EIC – External Interrupt Controller</td><td>4</td></tr><tr><td>NVMCTRL – Non-Volatile Memory Controller</td><td>5</td></tr><tr><td>DMAC - Direct Memory Access Controller</td><td>6</td></tr><tr><td>USB - Universal Serial Bus</td><td>7</td></tr><tr><td>EVSYS – Event System</td><td>8</td></tr><tr><td>SERCOM0 – Serial Communication Controller 0</td><td>9</td></tr><tr><td>SERCOM1 – Serial Communication Controller 1</td><td>10</td></tr><tr><td>SERCOM2 – Serial Communication Controller 2</td><td>11</td></tr><tr><td>TCC0 – Timer Counter for Control 0</td><td>12</td></tr><tr><td>TC1 – Timer Counter 1</td><td>13</td></tr><tr><td>TC2 – Timer Counter 2</td><td>14</td></tr><tr><td>ADC – Analog-to-Digital Converter</td><td>15</td></tr><tr><td>AC – Analog Comparator</td><td>16</td></tr><tr><td>DAC – Digital-to-Analog Converter</td><td>17</td></tr><tr><td>PTC – Peripheral Touch Controller</td><td>18</td></tr></table>

## 10.3 High-Speed Bus System

## 10.3.1 Features

High-Speed Bus Matrix has the following features:

z Symmetric crossbar bus switch implementation

z Allows concurrent accesses from different masters to different slaves

32-bit data bus

z Operation at a 1-to-1 clock frequency with the bus masters

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_577f4acbb6276643c97b6ff09ab1efb4ace9150e79f89c99eb0eab920476a907.jpg)

Table 10-4. Bus Matrix Masters

<table><tr><td>Bus Matrix Masters</td><td>Master ID</td></tr><tr><td>CM0+ - Cortex M0+ Processor</td><td>0</td></tr><tr><td>DSU - Device Service Unit</td><td>1</td></tr><tr><td>DMAC - Direct Memory Access Controller / Data Access</td><td>2</td></tr></table>

Table 10-5. Bus Matrix Slaves

<table><tr><td>Bus Matrix Slaves</td><td>Slave ID</td></tr><tr><td>Internal Flash Memory</td><td>0</td></tr><tr><td>AHB-APB Bridge A</td><td>1</td></tr><tr><td>AHB-APB Bridge B</td><td>2</td></tr><tr><td>AHB-APB Bridge C</td><td>3</td></tr><tr><td>SRAM Port 4 - CM0+ Access</td><td>4</td></tr><tr><td>SRAM Port 5 - DMAC Data Access</td><td>5</td></tr><tr><td>SRAM Port 6 - DSU Access</td><td>6</td></tr></table>

Table 10-6. SRAM Port Connection

<table><tr><td>SRAM Port Connection</td><td>Port ID</td><td>Connection Type</td></tr><tr><td>MTB - Memory Trace Buffer</td><td>0</td><td>Direct</td></tr><tr><td>USB - Universal Serial Bus</td><td>1</td><td>Direct</td></tr><tr><td>DMAC - Direct Memory Access Controller - Write-Back Access</td><td>2</td><td>Direct</td></tr><tr><td>DMAC - Direct Memory Access Controller - Fetch Access</td><td>3</td><td>Direct</td></tr><tr><td>CM0+ - Cortex M0+ Processor</td><td>4</td><td>Bus Matrix</td></tr><tr><td>DMAC - Direct Memory Access Controller - Data Access</td><td>5</td><td>Bus Matrix</td></tr><tr><td>DSU - Device Service Unit</td><td>6</td><td>Bus Matrix</td></tr></table>

## 10.3.3 SRAM Quality of Service

To ensure that masters with latency requirements get sufficient priority when accessing RAM, the different masters can be configured to have a given priority for different type of access.

The Quality of Service (QoS) level is independently selected for each master accessing the RAM. For any access to the RAM the RAM also receives the QoS level. The QoS levels and their corresponding bit values for the QoS level configuration is shown in Table 10-7.

Table 10-7. Quality of Service

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>00</td><td>DISABLE</td><td>Background (no sensitive operations)</td></tr><tr><td>01</td><td>LOW</td><td>Sensitive Bandwidth</td></tr><tr><td>10</td><td>MEDIUM</td><td>Sensitive Latency</td></tr><tr><td>11</td><td>HIGH</td><td>Critical Latency</td></tr></table>

If a master is configured with QoS level 0x00 or 0x01 there will be minimum one cycle latency for the RAM access. The priority order for concurrent accesses are decided by two factors. First the QoS level for the master and then a static priority given by table nn-mm (table: SRAM port connection) where the lowest port ID has the highest static priority.

The MTB has fixed QoS level 3 and the DSU has fixed QoS level 1.

The CPU QoS level can be written/read at address 0x41007110, bits [1:0]. Its reset value is 0x0.

Refer to different master QOSCTRL registers for configuring QoS for the other masters (USB, DMAC).

## 10.4 AHB-APB Bridge

The AHB-APB bridge is an AHB slave, providing an interface between the high-speed AHB domain and the low-power APB domain. It is used to provide access to the programmable control registers of peripherals (see “Product Mapping” on page 20).

AHB-APB bridge is based on AMBA APB Protocol Specification V2.0 (ref. as APB4) including:

z Wait state support

z Error reporting

z Transaction protection

z Sparse data transfer (byte, half-word and word)

Additional enhancements:

z Address and data cycles merged into a single cycle

z Sparse data transfer also apply to read access

to operate the AHB-APB bridge, the clock (CLK\_HPBx\_AHB) must be enabled. See “PM – Power Manager” on page 110 for details.

## 10.5 PAC – Peripheral Access Controller

## 10.5.1 Overview

There is one PAC associated with each AHB-APB bridge. The PAC can provide write protection for registers of each peripheral connected on the same bridge.

The PAC peripheral bus clock (CLK\_PACx\_APB) is enabled by default, and can be enabled and disabled in the Power Manager. Refer to “PM – Power Manager” on page 110 for details. CLK\_PAC0\_APB and CLK\_PAC1\_APB are enabled at reset, while CLK\_PAC2\_APB is disabled at reset. The PAC will continue to operate in any sleep mode where the selected clock source is running.

Write-protection does not apply for debugger access. When the debugger makes an access to a peripheral, writeprotection is ignored so that the debugger can update the register.

Write-protect registers allow the user to disable a selected peripheral’s write-protection without doing a read-modifywrite operation. These registers are mapped into two I/O memory locations, one for clearing and one for setting the register bits. Writing a one to a bit in the Write Protect Clear register (WPCLR) will clear the corresponding bit in both registers (WPCLR and WPSET) and disable the write-protection for the corresponding peripheral, while writing a one to a bit in the Write Protect Set (WPSET) register will set the corresponding bit in both registers (WPCLR and WPSET) and enable the write-protection for the corresponding peripheral. Both registers (WPCLR and WPSET) will return the same value when read.

If a peripheral is write-protected, and if a write access is performed, data will not be written, and the peripheral will return an access error (CPU exception).

The PAC also offers a safety feature for correct program execution, with a CPU exception generated on double write protection or double unprotection of a peripheral. If a peripheral n is write-protected and a write to one in WPSET[n] is detected, the PAC returns an error. This can be used to ensure that the application follows the intended program flow by always following a write-protect with an unprotect, and vice versa. However, in applications where a write-protected peripheral is used in several contexts, e.g., interrupts, care should be taken so that either the interrupt can not happen while the main application or other interrupt levels manipulate the write-protection status, or when the interrupt handler needs to unprotect the peripheral, based on the current protection status, by reading WPSET.

## 10.6 Register Description

Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register, and the 8-bit halves of a 16-bit register can be accessed directly.

Refer to “Product Mapping” on page 20 for PAC locations.

## 10.6.1 PAC0 Register Description

Write Protect Clear

Name: WPCLR

Offset: 0x00

Reset: 0x00000000

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>EIC</td><td>RTC</td><td>WDT</td><td>GCLK</td><td>SYSCTRL</td><td>PM</td><td></td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:7 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 6:1 – EIC, RTC, WDT, GCLK, SYSCTRL, PM: Write Protect Disable

0: Write-protection is disabled.

1: Write-protection is enabled.

Writing a zero to these bits has no effect.

Writing a one to these bits will clear the Write Protect bits for the corresponding peripherals.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Write Protect Set

Name: WPSET

Offset: 0x04

Reset: 0x00000000

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>EIC</td><td>RTC</td><td>WDT</td><td>GCLK</td><td>SYSCTRL</td><td>PM</td><td></td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:7 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 6:1 – EIC, RTC, WDT, GCLK, SYSCTRL, PM: Write Protect Enable

0: Write-protection is disabled.

1: Write-protection is enabled.

Writing a zero to these bits has no effect.

Writing a one to these bits will set the Write Protect bit for the corresponding peripherals.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 10.6.2 PAC1 Register Description

Write Protect Clear

Name: WPCLR

Offset: 0x00

Reset: 0x00000002

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>MTB</td><td>USB</td><td>DMAC</td><td>PORT</td><td>NVMCTRL</td><td>DSU</td><td></td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td></tr></table>

## z Bits 31:7– Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 6:1 – MTB, USB, DMAC, PORT, NVMCTRL, DSU: Write Protect

0: Write-protection is disabled.

1: Write-protection is enabled.

Writing a zero to these bits has no effect.

Writing a one to these bits will clear the Write Protect bit for the corresponding peripherals.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

Write Protect Set

Name: WPSET

Offset: 0x04

Reset: 0x00000002

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>MTB</td><td>USB</td><td>DMAC</td><td>PORT</td><td>NVMCTRL</td><td>DSU</td><td></td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td></tr></table>

## z Bits 31:7– Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 6:1 – MTB, USB, DMAC, PORT, NVMCTRL, DSU: Write Protect

0: Write-protection is disabled.

1: Write-protection is enabled.

Writing a zero to these bits has no effect.

Writing a one to these bits will set the Write Protect bit for the corresponding peripherals.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 10.6.3 PAC2 Register Description

Write Protect Clear

Name: WPCLR

Offset: 0x00

Reset: 0x00100000

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>PTC</td><td>DAC</td><td>AC</td><td>ADC</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>TC2</td><td>TC1</td><td>TCC0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>SERCOM3</td><td>SERCOM2</td><td>SERCOM1</td><td>SERCOM0</td><td>EVSYS</td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:20, 15:11, 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to reset value when this register is written. These bits will always return reset value when read.

z Bits 19:16, 10:8, 5:1 – PTC, DAC, AC, ADC, TC2, TC1, TCC0, SERCOM2, SERCOM1, SERCOM0, EVSYS: Write Protect

0: Write-protection is disabled.

1: Write-protection is enabled.

Writing a zero to these bits has no effect.

Writing a one to these bits will clear the Write Protect bit for the corresponding peripherals.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Write Protect Set

Name: WPSET

Offset: 0x04

Reset: 0x00100000

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>PTC</td><td>DAC</td><td>AC</td><td>ADC</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>TC2</td><td>TC1</td><td>TCC0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>SERCOM3</td><td>SERCOM2</td><td>SERCOM1</td><td>SERCOM0</td><td>EVSYS</td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:20, 15:11, 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to reset value when this register is written. These bits will always return reset value when read.

Bits 19:16, 10:8, 5:1 – PTC, DAC, AC, ADC, TC2, TC1, TCC0, SERCOM2, SERCOM1, SERCOM0, EVSYS: Write Protect

0: Write-protection is disabled.

1: Write-protection is enabled.

Writing a zero to these bits has no effect.

Writing a one to these bits will set the Write Protect bit for the corresponding peripherals.

## Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 1 1 <sub>.</sub> Peri <sub>p</sub>herals Confi<sub>g</sub> u ration S u m mar<sub>y</sub>

Table 1 1 -1 <sub>.</sub> Peri <sub>p</sub>herals Confi<sub>g</sub> u ration S u m mar<sub>y</sub>

<table><tr><td rowspan="2">Peripheral Name</td><td rowspan="2">Base Address</td><td rowspan="2">IRQ Line</td><td colspan="2">AHB Clock</td><td colspan="2">APB Clock</td><td>Generic Clock</td><td colspan="2">PAC</td><td colspan="2">Events</td><td>DMA</td><td rowspan="2">SleepWalking</td></tr><tr><td>Index</td><td>Enabled at Reset</td><td>Index</td><td>Enabled at Reset</td><td>Index</td><td>Index</td><td>Prot at Reset</td><td>User</td><td>Generator</td><td>Index</td></tr><tr><td>AHB-APB Bridge A</td><td>0x40000000</td><td></td><td>0</td><td>Y</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PAC0</td><td>0x40000000</td><td></td><td></td><td></td><td>0</td><td>Y</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PM</td><td>0x40000400</td><td>0</td><td></td><td></td><td>1</td><td>Y</td><td></td><td>1</td><td>N</td><td></td><td></td><td></td><td>Y</td></tr><tr><td>SYSCTRL</td><td>0x40000800</td><td>1</td><td></td><td></td><td>2</td><td>Y</td><td>0: DFLL48M reference1: FDPLL96M clk source2: FDPLL96M 32kHz</td><td>2</td><td>N</td><td></td><td></td><td></td><td>Y</td></tr><tr><td>GCLK</td><td>0x40000C00</td><td></td><td></td><td></td><td>3</td><td>Y</td><td></td><td>3</td><td>N</td><td></td><td></td><td></td><td>Y</td></tr><tr><td>WDT</td><td>0x40001000</td><td>2</td><td></td><td></td><td>4</td><td>Y</td><td>3</td><td>4</td><td>N</td><td></td><td></td><td></td><td></td></tr><tr><td>RTC</td><td>0x40001400</td><td>3</td><td></td><td></td><td>5</td><td>Y</td><td>4</td><td>5</td><td>N</td><td></td><td>1: CMP0/ALARM02: CMP13: OVF4-11: PER0-7</td><td></td><td>Y</td></tr><tr><td>EIC</td><td>0x40001800</td><td>NMI, 4</td><td></td><td></td><td>6</td><td>Y</td><td>5</td><td>6</td><td>N</td><td></td><td>12-27: EXTINT0-15</td><td></td><td>Y</td></tr><tr><td>AHB-APB Bridge B</td><td>0x41000000</td><td></td><td>1</td><td>Y</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PAC1</td><td>0x41000000</td><td></td><td></td><td></td><td>0</td><td>Y</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>DSU</td><td>0x41002000</td><td></td><td>3</td><td>Y</td><td>1</td><td>Y</td><td></td><td>1</td><td>Y</td><td></td><td></td><td></td><td></td></tr><tr><td>NVMCTRL</td><td>0x41004000</td><td>5</td><td>4</td><td>Y</td><td>2</td><td>Y</td><td>13</td><td>2</td><td>N</td><td></td><td></td><td></td><td></td></tr><tr><td>PORT</td><td>0x41004400</td><td></td><td></td><td></td><td>3</td><td>Y</td><td></td><td>3</td><td>N</td><td></td><td></td><td></td><td></td></tr><tr><td>DMAC</td><td>0x41004800</td><td>6</td><td>5</td><td>Y</td><td>4</td><td>Y</td><td></td><td>4</td><td>N</td><td>0-3: CH0-3</td><td>30-33: CH0-3</td><td></td><td></td></tr><tr><td>USB</td><td>0x41005000</td><td>7</td><td>6</td><td>Y</td><td>5</td><td>Y</td><td>6</td><td>5</td><td>N</td><td></td><td></td><td></td><td>Y</td></tr><tr><td>MTB</td><td>0x41006000</td><td></td><td></td><td></td><td></td><td></td><td></td><td>6</td><td>N</td><td></td><td></td><td></td><td></td></tr><tr><td>AHB-APB Bridge C</td><td>0x42000000</td><td></td><td>2</td><td>Y</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PAC2</td><td>0x42000000</td><td></td><td></td><td></td><td>0</td><td>N</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EVSYS</td><td>0x42000400</td><td>8</td><td></td><td></td><td>1</td><td>N</td><td>7-12: one per CHANNEL</td><td>1</td><td>N</td><td></td><td></td><td></td><td>Y</td></tr><tr><td>SERCOM0</td><td>0x42000800</td><td>9</td><td></td><td></td><td>2</td><td>N</td><td>14: CORE13: SLOW</td><td>2</td><td>N</td><td></td><td></td><td>1: RX2: TX</td><td>Y</td></tr><tr><td>SERCOM1</td><td>0x42000C00</td><td>10</td><td></td><td></td><td>3</td><td>N</td><td>15: CORE13: SLOW</td><td>3</td><td>N</td><td></td><td></td><td>3: RX4: TX</td><td>Y</td></tr><tr><td>SERCOM2</td><td>0x42001000</td><td>11</td><td></td><td></td><td>4</td><td>N</td><td>16: CORE13: SLOW</td><td>4</td><td>N</td><td></td><td></td><td>5: RX6: TX</td><td>Y</td></tr></table>

Table 1 1 -1 <sub>.</sub> Peri pherals Config u ration Su m mary (Conti n ued)

<table><tr><td rowspan="2">Peripheral Name</td><td rowspan="2">Base Address</td><td rowspan="2">IRQ Line</td><td colspan="2">AHB Clock</td><td colspan="2">APB Clock</td><td>Generic Clock</td><td colspan="2">PAC</td><td colspan="2">Events</td><td>DMA</td><td rowspan="2">SleepWalking</td></tr><tr><td>Index</td><td>Enabled at Reset</td><td>Index</td><td>Enabled at Reset</td><td>Index</td><td>Index</td><td>Prot at Reset</td><td>User</td><td>Generator</td><td>Index</td></tr><tr><td>TCC0</td><td>0x42001400</td><td>12</td><td></td><td></td><td>5</td><td>N</td><td>17</td><td>5</td><td>N</td><td>4-5: EV0-16-9: MC0-3</td><td>34: OVF35: TRG36: CNT37-40: MC0-3</td><td>13: OVF14-17: MC0-3</td><td>Y</td></tr><tr><td>TC1</td><td>0x42001800</td><td>13</td><td></td><td></td><td>6</td><td>N</td><td>18</td><td>6</td><td>N</td><td>18: EV</td><td>51: OVF52-53: MC0-1</td><td>24: OVF25-26: MC0-1</td><td>Y</td></tr><tr><td>TC2</td><td>0x42001C00</td><td>14</td><td></td><td></td><td>7</td><td>N</td><td>18</td><td>7</td><td>N</td><td>19: EV</td><td>54: OVF55-56: MCX0-1</td><td>27: OVF28-29: MC0-1</td><td>Y</td></tr><tr><td>ADC</td><td>0x42002000</td><td>15</td><td></td><td></td><td>8</td><td>Y</td><td>19</td><td>8</td><td>N</td><td>23: START24: SYNC</td><td>66: RESRDY67: WINMON</td><td>39: RESRDY</td><td>Y</td></tr><tr><td>AC</td><td>0x42002400</td><td>16</td><td></td><td></td><td>9</td><td>N</td><td>20: DIG21: ANA</td><td>9</td><td>N</td><td>25-26: SOC0-1</td><td>68-69: COMP0-170: WIN0</td><td></td><td>Y</td></tr><tr><td>DAC</td><td>0x42002800</td><td>17</td><td></td><td></td><td>10</td><td>N</td><td>22</td><td>10</td><td>N</td><td>27: START</td><td>71: EMPTY</td><td>40: EMPTY</td><td>Y</td></tr><tr><td>PTC</td><td>0x42002C00</td><td>18</td><td></td><td></td><td>11</td><td>N</td><td>23</td><td>11</td><td>N</td><td>28: STCONV</td><td>72: EOC73: WCOMP</td><td></td><td></td></tr></table>

Th e SAM D 1 1 has on e i nsta n ce of TCC its confi<sub>g</sub> u ration is su m marized be low.

Table 1 1 -2<sub>.</sub> TCCs Confi<sub>g</sub> u ration Su m mar<sub>y</sub>

<table><tr><td>TCC Number</td><td>Compare/Capture Channels</td><td>Output Waveform</td><td>Resolution Size</td><td>Fault</td><td>Dithering</td><td>Pattern Generation</td><td>Output Matrix</td><td>Dead Time Insertion</td><td>Swap</td></tr><tr><td>0</td><td>8</td><td>8</td><td>24 bits</td><td>Y</td><td>Y</td><td>Y</td><td>Y</td><td>Y</td><td>Y</td></tr></table>

Refer to <sup>“</sup>TCC – Ti mer/Cou nter for Control A<sub>pp</sub>l ications<sup>”</sup> on <sub>p</sub>a<sub>g</sub>e 6 1 4 for detai ls

## 12. DSU – Device Service Unit

## 12.1 Overview

The Device Service Unit (DSU) provides a means to detect debugger probes. This enables the ARM Debug Access Port (DAP) to have control over multiplexed debug pads and CPU reset. The DSU also provides system-level services to debug adapters in an ARM debug system. It implements a CoreSight Debug ROM that provides device identification as well as identification of other debug components in the system. Hence, it complies with the ARM Peripheral Identification specification. The DSU also provides system services to applications that need memory testing, as required for IEC60730 Class B compliance, for example. The DSU can be accessed simultaneously by a debugger and the CPU, as it is connected on the High-Speed Bus Matrix. For security reasons, some of the DSU features will be limited or unavailable when the device is protected by the NVMCTRL security bit (refer to “Security Bit” on page 361).

## 12.2 Features

z CPU reset extension

z Debugger probe detection (Cold- and Hot-Plugging)

z Chip-Erase command and status

z 32-bit cyclic redundancy check (CRC32) of any memory accessible through the bus matrix

$\mathsf { A R M } ^ { \mathbb { O } }$ CoreSight™ compliant device identification

z Two debug communications channels

z Debug access port security filter

z Onboard memory built-in self-test (MBIST)

## 12.3 Block Diagram

Figure 12-1. DSU Bock Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_f41c15bbb7bab3efea1970798f4ff115f87fbb06583a86680ced98fb7a28410a.jpg)

## 12.4 Signal Description

Table 12-1. Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td> $\overline{\text{RESET}}$ </td><td>Digital Input</td><td>External reset</td></tr><tr><td>SWCLK</td><td>Digital Input</td><td>SW clock</td></tr><tr><td>SWDIO</td><td>Digital I/O</td><td>SW bidirectional data pin</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral.

## 12.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 12.5.1 I/O Lines

The SWCLK pin is by default assigned to the DSU module to allow debugger probe detection and the condition to stretch the CPU reset phase. For more information, refer to “Debugger Probe Detection” on page 41. The Hot-Plugging feature depends on the PORT configuration. If the SWCLK pin function is changed in the PORT or if the PORT\_MUX is disabled, the Hot-Plugging feature is disabled until a power-reset or an external reset.

## 12.5.2 Power Management

The DSU will continue to operate in any sleep mode where the selected source clock is running.

Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 12.5.3 Clocks

The DSU bus clocks (CLK\_DSU\_APB and CLK\_DSU\_AHB) can be enabled and disabled in the Power Manager. For more information on the CLK\_DSU\_APB and CLK\_DSU\_AHB clock masks, refer to “PM – Power Manager” on page 110.

## 12.5.4 DMA

Not applicable.

## 12.5.5 Interrupts

Not applicable.

## 12.5.6 Events

Not applicable.

## 12.5.7 Register Access Protection

All registers with write access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

z Debug Communication Channel 0 register (DCC0)

z Debug Communication Channel 1 register (DCC1)

Write-protection is denoted by the Write-Protection property in the register description.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 12.5.8 Analog Connections

Not applicable.

## 12.6 Debug Operation

## 12.6.1 Principle of Operation

The DSU provides basic services to allow on-chip debug using the ARM Debug Access Port and the ARM processor debug resources:

CPU reset extension

z Debugger probe detection

For more details on the ARM debug components, refer to the ARM Debug Interface v5Architecture Specification.

## 12.6.2 CPU Reset Extension

“CPU reset extension” refers to the extension of the reset phase of the CPU core after the external reset is released. This ensures that the CPU is not executing code at startup while a debugger connects to the system. It is detected on a RESET release event when SWCLK is low. At startup, SWCLK is internally pulled up to avoid false detection of a debugger if SWCLK is left unconnected. When the CPU is held in the reset extension phase, the CPU Reset Extension bit (CRSTEXT) of the Status A register (STATUSA.CRSTEXT) is set. To release the CPU, write a one to STATUSA.CRSTEXT. STATUSA.CRSTEXT will then be set to zero. Writing a zero to STATUSA.CRSTEXT has no effect. For security reasons, it is not possible to release the CPU reset extension when the device is protected by the NVMCTRL security bit (refer to “Security Bit” on page 361). Trying to do so sets the Protection Error bit (PERR) of the Status A register (STATUSA.PERR).

Figure 12-2. Typical CPU Reset Extension Set and Clear Timing Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_7a57dd24cf89276a559de76f2e56196dc033c49e4e60fea3b3686fec7876fb36.jpg)

## 12.6.3 Debugger Probe Detection

## 12.6.3.1 Cold-Plugging

Cold-Plugging is the detection of a debugger when the system is in reset. Cold-Plugging is detected when the CPU reset extension is requested, as described above.

## 12.6.3.2 Hot-Plugging

Hot-Plugging is the detection of a debugger probe when the system is not in reset. Hot-Plugging is not possible under reset because the detector is reset when POR or RESET are asserted. Hot-Plugging is active when a SWCLK falling edge is detected. The SWCLK pad is multiplexed with other functions and the user must ensure that its default function is assigned to the debug system. If the SWCLK function is changed, the Hot-Plugging feature is disabled until a power-reset or external reset occurs. Availability of the Hot-Plugging feature can be read from the Hot-Plugging Enable bit of the Status B register (STATUSB.HPE).

Figure 12-3. Hot-Plugging Detection Timing Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_6fee9bb0345ae470eeb37685ef4d0aeeaa5ed95854d2ac8abd06352db7c0181e.jpg)

The presence of a debugger probe is detected when either Hot-Plugging or Cold-Plugging is detected. Once detected, the Debugger Present bit of the Status B register (STATUSB.DBGPRES) is set. For security reasons, Hot-Plugging is not available when the device is protected by the NVMCTRL security bit (refer to “Security Bit” on page 361).

This detection requires that pads are correctly powered. Thus, at cold startup, this detection cannot be done until POR is released. If the device is protected, Cold-Plugging is the only way to detect a debugger probe, and so the external reset timing must be longer than the POR timing. If external reset is deasserted before POR release, the user must retry the procedure above until it gets connected to the device.

## 12.7 Chip-Erase

Chip-Erase consists of removing all sensitive information stored in the chip and clearing the NVMCTRL security bit (refer to “Security Bit” on page 361). Hence, all volatile memories and the flash array (including the EEPROM emulation area) will be erased. The flash auxiliary rows, including the user row, will not be erased. When the device is protected, the debugger must reset the device in order to be detected. This ensures that internal registers are reset after the protected state is removed. The Chip-Erase operation is triggered by writing a one to the Chip-Erase bit in the Control register (CTRL.CE). This command will be discarded if the DSU is protected by the Peripheral Access Controller (PAC). Once issued, the module clears volatile memories prior to erasing the flash array. To ensure that the Chip-Erase operation is completed, check the Done bit of the Status A register (STATUSA.DONE). The Chip-Erase operation depends on clocks and power management features that can be altered by the CPU. For that reason, it is recommended to issue a Chip-Erase after a Cold-Plugging procedure to ensure that the device is in a known and safe state.

The recommended sequence is as follows:

1. Issue the Cold-Plugging procedure (refer to “Cold-Plugging” on page 41). The device then:

1. Detects the debugger probe

2. Holds the CPU in reset

2. Issue the Chip-Erase command by writing a one to CTRL.CE. The device then:

1. Clears the system volatile memories

2. Erases the whole flash array (including the EEPROM emulation area, not including auxiliary rows)

3. Erases the lock row, removing the NVMCTRL security bit protection

3. Check for completion by polling STATUSA.DONE (read as one when completed).

4. Reset the device to let the NVMCTRL update fuses.

## 12.8 Programming

Programming of the flash or RAM memories is available when the device is not protected by the NVMCTRL securit bit (refer to “Security Bit” on page 361).

1. At power up, RESET is driven low by a debugger. The on-chip regulator holds the system in a POR state until the input supply is above the POR threshold (refer to “Power-On Reset (POR) Characteristics” on page 872). The system continues to be held in this static state until the internally regulated supplies have reached a safe operating state.

2. The PM starts, clocks are switched to the slow clock (Core Clock, System Clock, Flash Clock and any Bus Clocks that do not have clock gate control). Internal resets are maintained due to the external reset.

3. The debugger maintains a low level on SWCLK. Releasing RESET results in a debugger Cold-Plugging procedure.

4. The debugger generates a clock signal on the SWCLK pin, the Debug Access Port (DAP) receives a clock.

5. The CPU remains in reset due to the Cold-Plugging procedure; meanwhile, the rest of the system is released.

6. A Chip-Erase is issued to ensure that the flash is fully erased prior to programming.

7. Programming is available through the AHB-AP.

8. After operation is completed, the chip can be restarted either by asserting RESET, toggling power or writing a one to the Status A register CPU Reset Phase Extension bit (STATUSA.CRSTEXT). Make sure that the SWCLK pin is high when releasing RESET to prevent extending the CPU reset.

## 12.9 Intellectual Property Protection

Intellectual property protection consists of restricting access to internal memories from external tools when the device is protected, and is accomplished by setting the NVMCTRL security bit (refer to “Security Bit” on page 361). This protected state can be removed by issuing a Chip-Erase (refer to “Chip-Erase” on page 42). When the device is protected, read/write accesses using the AHB-AP are limited to the DSU address range and DSU commands are restricted.

The DSU implements a security filter that monitors the AHB transactions generated by the ARM AHB-AP inside the DAP. If the device is protected, then AHB-AP read/write accesses outside the DSU external address range are discarded, causing an error response that sets the ARM AHB-AP sticky error bits (refer to the ARM Debug Interface v5 Architecture Specification on http://www.arm.com).

The DSU is intended to be accessed either:

z Internally from the CPU, without any limitation, even when the device is protected

z Externally from a debug adapter, with some restrictions when the device is protected

For security reasons, DSU features have limitations when used from a debug adapter. To differentiate externa accesses from internal ones, the first 0x100 bytes of the DSU register map have been replicated at offset 0x100:

z The first 0x100 bytes form the internal address range

z The next 0x100 bytes form the external address range

When the device is protected, the DAP can only issue MEM-AP accesses in the DSU address range limited to the 0x100-0x2000 offset range.

The DSU operating registers are located in the 0x00-0xFF area and remapped in 0x100-0x1FF to differentiate accesses coming from a debugger and the CPU. If the device is protected and an access is issued in the region 0x100-0x1FF, it is subject to security restrictions. For more information, refer to Table 12-2.

Figure 12-4. APB Memory Mapping

$$
\begin{array}{c c} \text {0x0000} & \text {DSU operating registers} \\ \text {0x00FC} & \\ \text {0x0100} & \text {Replicated DSU operating registers} \\ \text {0x01FD} & \\ \text {0x1000} & \text {DSU CoreSight ROM} \\ \text {0x1FFC} & \end{array}
$$

Some features not activated by APB transactions are not available when the device is protected:

Table 12-2. Feature Availability Under Protection

<table><tr><td>Features</td><td>Availability When the Device is Protected</td></tr><tr><td>CPU reset extension</td><td>Yes</td></tr><tr><td>Debugger Cold-Plugging</td><td>Yes</td></tr><tr><td>Debugger Hot-Plugging</td><td>No</td></tr></table>

## 12.10 Device Identification

Device identification relies on the ARM CoreSight component identification scheme, which allows the chip to be identified as an ATMEL device implementing a DSU. The DSU contains identification registers to differentiate the device.

## 12.10.1 CoreSight Identification

A system-level ARM CoreSight ROM table is present in the device to identify the vendor and the chip identification method. Its address is provided in the MEM-AP BASE register inside the ARM Debug Access Port. The CoreSight ROM implements a 64-bit conceptual ID composed as follows from the PID0 to PID7 CoreSight ROM Table registers:

Figure 12-5. Conceptual 64-Bit Peripheral ID  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_62a08c7184d1bb9cc4e386a0e76db53a617d4446691cfccde56700a32cad3920.jpg)

Table 12-3. Conceptual 64-Bit Peripheral ID Bit Descriptions

<table><tr><td>Field</td><td>Size</td><td>Description</td><td>Location</td></tr><tr><td>JEP-106 CC code</td><td>4</td><td>Atmel continuation code: 0x0</td><td>PID4</td></tr><tr><td>JEP-106 ID code</td><td>7</td><td>Atmel device ID: 0x1F</td><td>PID1+PID2</td></tr><tr><td>4KB count</td><td>4</td><td>Indicates that the CoreSight component is a ROM: 0x0</td><td>PID4</td></tr><tr><td>RevAnd</td><td>4</td><td>Not used; read as 0</td><td>PID3</td></tr><tr><td>CUSMOD</td><td>4</td><td>Not used; read as 0</td><td>PID3</td></tr><tr><td>PARTNUM</td><td>12</td><td>Contains 0xCD0 to indicate that DSU is present</td><td>PID0+PID1</td></tr><tr><td>REVISION</td><td>4</td><td>DSU revision (starts at 0x0 and increments by 1 at both major and minor revisions). Identifies DSU identification method variants. If 0x0, this indicates that device identification can be completed by reading the Device Identification register (DID)</td><td>PID3</td></tr></table>

For more information, refer to the ARM Debug Interface Version 5 Architecture Specification.

## 12.10.2 DSU Chip Identification Method:

The DSU DID register identifies the device by implementing the following information:

z Processor identification

z Family identification

z Subfamily identification

z Device select

## 12.11 Functional Description

## 12.11.1 Principle of Operation

The DSU provides memory services such as CRC32 or MBIST that require almost the same interface. Hence, the Address, Length and Data registers are shared. They must be configured first; then a command can be issued by writing the Control register. When a command is ongoing, other commands are discarded until the current operation is completed. Hence, the user must wait for the STATUSA.DONE bit to be set prior to issuing another one.

## 12.11.2 Basic Operation

## 12.11.2.1 Initialization

The module is enabled by enabling its clocks. For more details, refer to “Clocks” on page 40. The DSU registers can be write-protected. Refer to “PAC – Peripheral Access Controller” on page 30.

## 12.11.2.2 Operation from a debug adapter

Debug adapters should access the DSU registers in the external address range 0x100 – 0x2000. If the device is protected by the NVMCTRL security bit (refer to “Security Bit” on page 361), accessing the first 0x100 bytes causes the system to return an error (refer to “Intellectual Property Protection” on page 43).

## 12.11.2.3 Operation from the CPU

There are no restrictions when accessing DSU registers from the CPU. However, the user should access DSU registers in the internal address range (0x0 – 0x100) to avoid external security restrictions (refer to “Intellectua Property Protection” on page 43).

## 12.11.3 32-bit Cyclic Redundancy Check (CRC32)

The DSU unit provides support for calculating a cyclic redundancy check (CRC32) value for a memory area (including flash and AHB RAM).

When the CRC32 command is issued from:

z The internal range, the CRC32 can be operated at any memory location

The external range, the CRC32 operation is restricted; DATA, ADDR and LENGTH values are forced (see below)

Table 12-4. AMOD Bit Descriptions when Operating CRC32

<table><tr><td>AMOD[1:0]</td><td>Short Name</td><td>External Range Restrictions</td></tr><tr><td>0</td><td>ARRAY</td><td>CRC32 is restricted to the full flash array area (EEPROM emulation area not included)DATA forced to 0xFFFFFFFF before calculation (no seed)</td></tr><tr><td>1</td><td>EEPROM</td><td>CRC32 of the whole EEPROM emulation areaDATA forced to 0xFFFFFFFF before calculation (no seed)</td></tr><tr><td>2-3</td><td>Reserved</td><td></td></tr></table>

The algorithm employed is the industry standard CRC32 algorithm using the generator polynomial 0xEDB88320 (reversed representation).

## 12.11.3.1 Starting CRC32 Calculation

CRC32 calculation for a memory range is started after writing the start address into the Address register (ADDR) and the size of the memory range into the Length register (LENGTH). Both must be word-aligned.

The initial value used for the CRC32 calculation must be written to the Data register. This value will usually be 0xFFFFFFFF, but can be, for example, the result of a previous CRC32 calculation if generating a common CRC32 of separate memory blocks.

Once completed, the calculated CRC32 value can be read out of the Data register. The read value must be complemented to match standard CRC32 implementations or kept non-inverted if used as starting point for subsequent CRC32 calculations.

If the device is in protected state by the NVMCTRL security bit (refer to “Security Bit” on page 361), it is only possible to calculate the CRC32 of the whole flash array when operated from the external address space. In most cases, this area will be the entire onboard non-volatile memory. The Address, Length and Data registers will be forced to predefined values once the CRC32 operation is started, and values written by the user are ignored. This allows the user to verify the contents of a protected device.

The actual test is started by writing a one in the 32-bit Cyclic Redundancy Check bit of the Control register (CTRL.CRC). A running CRC32 operation can be canceled by resetting the module (writing a one to CTRL.SWRST)

## 12.11.3.2 Interpreting the Results

The user should monitor the Status A register. When the operation is completed, STATUSA.DONE is set. Then the Bus Error bit of the Status A register (STATUSA.BERR) must be read to ensure that no bus error occurred.

## 12.11.4 Debug Communication Channels

The Debug Communication Channels (DCCO and DCC1) consist of a pair of registers with associated handshake logic, accessible by both CPU and debugger even if the device is protected by the NVMCTRL security bit (refer to “Security Bit” on page 361). The registers can be used to exchange data between the CPU and the debugger, during run time as well as in debug mode. This enables the user to build a custom debug protocol using only these registers. The DCC0 and DCC1 registers are accessible when the protected state is active. When the device is protected, however, it is not possible to connect a debugger while the CPU is running (STATUSA.CRSTEXT is not writable and the CPU is held under reset). Dirty bits in the status registers indicate whether a new value has been written in DCC0 or DCC1. These bits,DCC0D and DCC1D, are located in the STATUSB registers. They are automatically set on write and cleared on read. The DCC0 and DCC1 registers are shared with the onboard memory testing logic (MBIST). Accordingly, DCC0 and DCC1 must not be used while performing MBIST operations.

## 12.11.5 Testing of Onboard Memories (MBIST)

The DSU implements a feature for automatic testing of memory also known as MBIST. This is primarily intended for production test of onboard memories. MBIST cannot be operated from the external address range when the device is protected by the NVMCTRL security bit (refer to “Security Bit” on page 361). If a MBIST command is issued when the device is protected, a protection error is reported in the Protection Error bit in the Status A register (STATUSA.PERR).

## 1. Algorithm

The algorithm used for testing is a type of March algorithm called "March LR". This algorithm is able to detect a wide range of memory defects, while still keeping a linear run time. The algorithm is:

1. Write entire memory to 0, in any order.

2. Bit for bit read 0, write 1, in descending order.

3. Bit for bit read 1, write 0, read 0, write 1, in ascending order.

4. Bit for bit read 1, write 0, in ascending order.

5. Bit for bit read 0, write 1, read 1, write 0, in ascending order.

6. Read 0 from entire memory, in ascending order.

The specific implementation used has a run time that depends on CPU clock frequency and on the number of bytes tested in RAM. The detected faults are:

z Address decoder faults

z Stuck-at faults

z Transition faults

z Coupling faults

z Linked Coupling faults

z Stuck-open faults

## 2. Starting MBIST

To test a memory, you need to write the start address of the memory to the ADDR.ADDR bit group, and the size of the memory into the Length register. See “Physical Memory Map” on page 21 to know which memories are available, and which address they are at.

For best test coverage, an entire physical memory block should be tested at once. It is possible to test only a subset of a memory, but the test coverage will then be somewhat lower.

The actual test is started by writing a one to CTRL.MBIST. A running MBIST operation can be canceled by writing a one to CTRL.SWRST.

## 3. Interpreting the Results

The tester should monitor the STATUSA register. When the operation is completed, STATUSA.DONE is set. There are two different modes:

## z ADDR.AMOD=0: exit-on-error (default)

In this mode, the algorithm terminates either when a fault is detected or on successful completion. In both cases, STATUSA.DONE is set. If an error was detected, STATUSA.FAIL will be set. User then can read the DATA and ADDR registers to locate the fault. Refer to “Locating Errors” on page 47.

## z ADDR.AMOD=1: pause-on-error

In this mode, the MBIST algorithm is paused when an error is detected. In such a situation, only STA-TUSA.FAIL is asserted. The state machine waits for user to clear STATUSA.FAIL by writing a one in STATUSA.FAIL to resume. Prior to resuming, user can read the DATA and ADDR registers to locate the fault. Refer to “Locating Errors” on page 47.

## 4. Locating Errors

If the test stops with STATUSA.FAIL set, one or more bits failed the test. The test stops at the first detected error. The position of the failing bit can be found by reading the following registers:

z ADDR: Address of the word containing the failing bit.

DATA: contains data to identify which bit failed, and during which phase of the test it failed. The DATA register will in this case contains the following bit groups:

Table 12-5. DATA bits Description When MBIST Operation Returns An Error

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">phase</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">bit_index</td></tr></table>

z bit\_index: contains the bit number of the failing bit  
z phase: indicates which phase of the test failed and the cause of the error. See Table 12-6 on page 48.

Table 12-6. MBIST Operation Phases

<table><tr><td>Phase</td><td>Test Actions</td></tr><tr><td>0</td><td>Write all bits to zero. This phase cannot fail.</td></tr><tr><td>1</td><td>Read 0, write 1, increment address</td></tr><tr><td>2</td><td>Read 1, write 0</td></tr><tr><td>3</td><td>Read 0, write 1, decrement address</td></tr><tr><td>4</td><td>Read 1, write 0, decrement address</td></tr><tr><td>5</td><td>Read 0, write 1</td></tr><tr><td>6</td><td>Read 1, write 0, decrement address</td></tr><tr><td>7</td><td>Read all zeros. bit_index is not used</td></tr></table>

## 12.11.6 System Services Availability When Accessed Externally

External access: Access performed in the DSU address offset 0x200-0x1FFF range. Internal access: Access performed in the DSU address offset 0x0-0x100 range.

Table 12-7. Available Features When Operated From The External Address Range

<table><tr><td>Features</td><td>Availability From The External Address Range</td></tr><tr><td>Chip-Erase command and status</td><td>Yes</td></tr><tr><td>CRC32</td><td>Yes, only full array or full EEPROM</td></tr><tr><td>CoreSight Compliant Device identification</td><td>Yes</td></tr><tr><td>Debug communication channels</td><td>Yes</td></tr><tr><td>Testing of onboard memories (MBIST)</td><td>No</td></tr><tr><td>STATUS.CRSTEXT clearing</td><td>No (STATUS.PERR is set when attempting to do so)</td></tr></table>

## 12.12 Register Summary

Table 12-8. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0000</td><td>CTRL</td><td>7:0</td><td>SMSA</td><td>ARR</td><td></td><td>CE</td><td>MBIST</td><td>CRC</td><td></td><td>SWRST</td></tr><tr><td>0x0001</td><td>STATUS</td><td>7:0</td><td></td><td></td><td></td><td>PERR</td><td>FAIL</td><td>BERR</td><td>CRSTEXT</td><td>DONE</td></tr><tr><td>0x0002</td><td>STATUS</td><td>7:0</td><td></td><td></td><td></td><td>HPE</td><td>DCCD1</td><td>DCCD0</td><td>DBG PRES</td><td>PROT</td></tr><tr><td>0x0003</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0004</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="6">ADDR[5:0]</td><td colspan="2">AMOD[1:0]</td></tr><tr><td>0x0005</td><td>15:8</td><td colspan="8">ADDR[13:6]</td></tr><tr><td>0x0006</td><td>23:16</td><td colspan="8">ADDR[21:14]</td></tr><tr><td>0x0007</td><td>31:24</td><td colspan="8">ADDR[29:22]</td></tr><tr><td>0x0008</td><td rowspan="4">LENGTH</td><td>7:0</td><td colspan="6">LENGTH[5:0]</td><td></td><td></td></tr><tr><td>0x0009</td><td>15:8</td><td colspan="8">LENGTH[13:6]</td></tr><tr><td>0x000A</td><td>23:16</td><td colspan="8">LENGTH[21:14]</td></tr><tr><td>0x000B</td><td>31:24</td><td colspan="8">LENGTH[29:22]</td></tr><tr><td>0x000C</td><td rowspan="4">DATA</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x000D</td><td>15:8</td><td colspan="8">DATA[15:8]</td></tr><tr><td>0x000E</td><td>23:16</td><td colspan="8">DATA[23:16]</td></tr><tr><td>0x000F</td><td>31:24</td><td colspan="8">DATA[31:24]</td></tr><tr><td>0x0010</td><td rowspan="4">DCC0</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x0011</td><td>15:8</td><td colspan="8">DATA[15:8]</td></tr><tr><td>0x0012</td><td>23:16</td><td colspan="8">DATA[23:16]</td></tr><tr><td>0x0013</td><td>31:24</td><td colspan="8">DATA[31:24]</td></tr><tr><td>0x0014</td><td rowspan="4">DCC1</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x0015</td><td>15:8</td><td colspan="8">DATA[15:8]</td></tr><tr><td>0x0016</td><td>23:16</td><td colspan="8">DATA[23:16]</td></tr><tr><td>0x0017</td><td>31:24</td><td colspan="8">DATA[31:24]</td></tr><tr><td>0x0018</td><td rowspan="4">DID</td><td>7:0</td><td colspan="8">DEVSEL[7:0]</td></tr><tr><td>0x0019</td><td>15:8</td><td colspan="4">DIE[3:0]</td><td colspan="4">Revision[3:0]</td></tr><tr><td>0x001A</td><td>23:16</td><td>FAMILY</td><td></td><td colspan="6">SERIES[5:0]</td></tr><tr><td>0x001B</td><td>31:24</td><td colspan="4">PROCESSOR[3:0]</td><td colspan="4">FAMILY[4:1]</td></tr><tr><td>0x001C ... 0x00EF</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00F0</td><td rowspan="4">DCFG0</td><td>7:0</td><td colspan="8">DCFG[7:0]</td></tr><tr><td>0x00F1</td><td>15:8</td><td colspan="8">DCFG[15:8]</td></tr><tr><td>0x00F2</td><td>23:16</td><td colspan="8">DCFG[23:16]</td></tr><tr><td>0x00F3</td><td>31:24</td><td colspan="8">DCFG[31:24]</td></tr><tr><td>0x00F4</td><td rowspan="4">DCFG1</td><td>7:0</td><td colspan="8">DCFG[7:0]</td></tr><tr><td>0x00F5</td><td>15:8</td><td colspan="8">DCFG[15:8]</td></tr><tr><td>0x00F6</td><td>23:16</td><td colspan="8">DCFG[23:16]</td></tr><tr><td>0x00F7</td><td>31:24</td><td colspan="8">DCFG[31:24]</td></tr><tr><td>0x00F8 ... 0x0FFF</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1000</td><td rowspan="4">ENTRY0</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>FMT</td><td>EPRES</td></tr><tr><td>0x1001</td><td>15:8</td><td colspan="4">ADDOFF[3:0]</td><td></td><td></td><td></td><td></td></tr><tr><td>0x1002</td><td>23:16</td><td colspan="8">ADDOFF[11:4]</td></tr><tr><td>0x1003</td><td>31:24</td><td colspan="8">ADDOFF[19:12]</td></tr><tr><td>0x1004</td><td rowspan="4">ENTRY1</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>FMT</td><td>EPRES</td></tr><tr><td>0x1005</td><td>15:8</td><td colspan="4">ADDOFF[3:0]</td><td></td><td></td><td></td><td></td></tr><tr><td>0x1006</td><td>23:16</td><td colspan="8">ADDOFF[11:4]</td></tr><tr><td>0x1007</td><td>31:24</td><td colspan="8">ADDOFF[19:12]</td></tr><tr><td>0x1008</td><td rowspan="4">END</td><td>7:0</td><td colspan="8">END[7:0]</td></tr><tr><td>0x1009</td><td>15:8</td><td colspan="8">END[15:8]</td></tr><tr><td>0x100A</td><td>23:16</td><td colspan="8">END[23:16]</td></tr><tr><td>0x100B</td><td>31:24</td><td colspan="8">END[31:24]</td></tr><tr><td>0x100C ... 0x1FCB</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FCC</td><td rowspan="4">MEMTYPE</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SMEMP</td></tr><tr><td>0x1FCD</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FCE</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FCF</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD0</td><td rowspan="4">PID4</td><td>7:0</td><td colspan="4">FKBC[3:0]</td><td colspan="4">JEPCC[3:0]</td></tr><tr><td>0x1FD1</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD2</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD3</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD4</td><td rowspan="4">PID5</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD5</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD6</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD7</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD8</td><td rowspan="4">PID6</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FD9</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FDA</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FDB</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FDC</td><td rowspan="4">PID7</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FDD</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FDE</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FDF</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE0</td><td rowspan="4">PID0</td><td>7:0</td><td colspan="8">PARTNBL[7:0]</td></tr><tr><td>0x1FE1</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE2</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE3</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE4</td><td rowspan="4">PID1</td><td>7:0</td><td colspan="4">JEPIDCL[3:0]</td><td colspan="4">PARTNBH[3:0]</td></tr><tr><td>0x1FE5</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE6</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE7</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1FE8</td><td rowspan="4">PID2</td><td>7:0</td><td colspan="3">REVISION[3:0]</td><td>JEPU</td><td colspan="4">JEPIDCH[2:0]</td></tr><tr><td>0x1FE9</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FEA</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FEB</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FEC</td><td rowspan="4">PID3</td><td>7:0</td><td colspan="3">REVAND[3:0]</td><td colspan="5">CUSMOD[3:0]</td></tr><tr><td>0x1FED</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FEE</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FEF</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF0</td><td rowspan="4">CID0</td><td>7:0</td><td colspan="8">PREAMBLEB0[7:0]</td></tr><tr><td>0x1FF1</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF2</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF3</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF4</td><td rowspan="4">CID1</td><td>7:0</td><td colspan="3">CCLASS[3:0]</td><td colspan="5">PREAMBLE[3:0]</td></tr><tr><td>0x1FF5</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF6</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF7</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FF8</td><td rowspan="4">CID2</td><td>7:0</td><td colspan="8">PREAMBLEB2[7:0]</td></tr><tr><td>0x1FF9</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FFA</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FFB</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FFC</td><td rowspan="4">CID3</td><td>7:0</td><td colspan="8">PREAMBLEB3[7:0]</td></tr><tr><td>0x1FFD</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FFE</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x1FFF</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr></table>

## 12.13 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 40 for details.

## 12.13.1 Control

Name: CTRL

Offset: 0x0000

Reset: 0x00

Access: Write-Only

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SMSA</td><td>ARR</td><td></td><td>CE</td><td>MBIST</td><td>CRC</td><td></td><td>SWRST</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>R</td><td>W</td><td>W</td><td>W</td><td>R</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bit 7 – SMSA: Start Memory Stream Access

Bit 6 – ARR: Auxiliary Row Read

## z Bit 5 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 4 – CE: Chip-Erase

Writing a zero to this bit has no effect.

Writing a one to this bit starts the Chip-Erase operation.

## z Bit 3 – MBIST: Memory built-in self-test

Writing a zero to this bit has no effect.

Writing a one to this bit starts the memory BIST algorithm.

## ● Bit 2 – CRC: 32-bit Cyclic Redundancy Code

Writing a zero to this bit has no effect.

Writing a one to this bit starts the cyclic redundancy check algorithm.

## z Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 0 – SWRST: Software Reset

Writing a zero to this bit has no effect.

Writing a one to this bit resets the module.

## 12.13.2 Status A

Name: STATUSA

Offset: 0x0001

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>PERR</td><td>FAIL</td><td>BERR</td><td>CRSTEXT</td><td>DONE</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – PERR: Protection Error

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Protection Error bit.

This bit is set when a command that is not allowed in protected state is issued.

## z Bit 3 – FAIL: Failure

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Failure bit.

This bit is set when a DSU operation failure is detected.

## z Bit 2 – BERR: Bus Error

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Bus Error bit.

This bit is set when a bus error is detected.

## z Bit 1 – CRSTEXT: CPU Reset Phase Extension

Writing a zero to this bit has no effect.

Writing a one to this bit clears the CPU Reset Phase Extension bit.

This bit is set when a debug adapter Cold-Plugging is detected, which extends the CPU reset phase.

## z Bit 0 – DONE: Done

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Done bit.

This bit is set when a DSU operation is completed.

## 12.13.3 Status B

Name: STATUSB

Offset: 0x0002

Reset: 0X000000XX

Access: Read-Only

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>HPE</td><td>DCCD1</td><td>DCCD0</td><td>DBGPRES</td><td>PROT</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td></tr></table>

## Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 4 – HPE: Hot-Plugging Enable

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

This bit is set when Hot-Plugging is enabled.

This bit is cleared when Hot-Plugging is disabled. This is the case when the SWCLK function is changed. Only a power-reset or a external reset can set it again.

## ● Bits 3:2 – DCCDx [x=1..0]: Debug Communication Channel x Dirty

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

This bit is set when DCCx is written.

This bit is cleared when DCCx is read.

## z Bit 1 – DBGPRES: Debugger Present

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

This bit is set when a debugger probe is detected.

This bit is never cleared.

## z Bit 0 – PROT: Protected

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

This bit is set at powerup when the device is protected.

This bit is never cleared.

## 12.13.4 Address

Name: ADDR

Offset: 0x0004

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">ADDR[29:22]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">ADDR[21:14]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">ADDR[13:6]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="6">ADDR[5:0]</td><td colspan="2">AMOD[1:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bits 31:2 – ADDR[29:0]: Address

Initial word start address needed for memory operations.

Bits 1:0 – AMOD[1:0]: Access Mode

## 12.13.5 Length

Name: LENGTH

Offset: 0x0008

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">LENGTH[29:22]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">LENGTH[21:14]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">LENGTH[13:6]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="6">LENGTH[5:0]</td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:2 – LENGTH[29:0]: Length Length in words needed for memory operations.

## z Bits 1:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 12.13.6 Data

Name: DATA

Offset: 0x000C

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DATA[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DATA[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DATA[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – DATA[31:0]: Data Memory operation initial value or result value.

## 12.13.7 Debug Communication Channel n

Name: DCCn

Offset: 0x0010+n\*0x4 [n=0..1]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DATA[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DATA[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DATA[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – DATA[31:0]: Data Data register.

## 12.13.8 Device Identification

Name: DID

Offset: 0x0018

Reset:

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="4">PROCESSOR[3:0]</td><td colspan="4">FAMILY[4:1]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td>FAMILY</td><td></td><td colspan="6">SERIES[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="4">DIE[3:0]</td><td colspan="4">REVISION[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DEVSEL[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

The information in this register is related to the ordering code. Refer to the “Ordering Information” on page 5 for details.

z Bits 31:28 – PROCESSOR[3:0]: Processor

The value of this field defines the processor used on the device. For this device, the value of this field is 0x1, corresponding to the ARM Cortex-M0+ processor.

Table 12-9. Processor

<table><tr><td>PROCESSOR[3:0]</td><td>Description</td></tr><tr><td>0x0</td><td>Cortex-M0</td></tr><tr><td>0x1</td><td>Cortex-M0+</td></tr><tr><td>0x2</td><td>Cortex-M3</td></tr><tr><td>0x3</td><td>Cortex-M4</td></tr><tr><td>0x4-0xF</td><td>Reserved</td></tr></table>

## ● Bits 27:23 – FAMILY[4:0]: Family

The value of this field corresponds to the Product Family part of the ordering code. For this device, the value of this field is 0x0, corresponding to the SAM D family of base line microcontrollers.

Table 12-10. Family

<table><tr><td>FAMILY[4:0]</td><td>Description</td></tr><tr><td>0x0</td><td>General purpose microcontroller</td></tr><tr><td>0x1</td><td>PicoPower</td></tr><tr><td>0x2-0x1F</td><td>Reserved</td></tr></table>

## ● Bit 22 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bits 21:16 – SERIES[5:0]: Series

The value of this field corresponds to the Product Series part of the ordering code. For this device, the value of this field is 0x00, corresponding to a product with the Cortex-M0+ processor and a basic feature set.

Table 12-11. Series

<table><tr><td>SERIES[5:0]</td><td>Description</td></tr><tr><td>0x0</td><td>Cortex-M0+ processor, basic feature set</td></tr><tr><td>0x1</td><td>Cortex-M0+ processor, USB</td></tr><tr><td>0x2-0x3F</td><td>Reserved</td></tr></table>

## z Bits 15:12 – DIE[3:0]: Die Number Identifies the die in the family.

z Bits 11:8 – REVISION[3:0]: Revision Number Identifies the die revision number.

## Bits 7:0 – DEVSEL[7:0]: Device Select

DEVSEL is used to identify a device within a product family and product series. The value corresponds to the Flash memory density, pin count and device variant parts of the ordering code. Refer to “Ordering Information” on page 5 for details.

DEVSEL is used to identify a device within a product family and product series. The value corresponds to the Flash memory density, pin count and device variant parts of the ordering code. Refer to “Ordering Information” on page 5 for details.

Table 12-12. Device Selection

<table><tr><td>DEVSEL</td><td>Device</td><td>Device ID</td><td>Flash</td><td>RAM</td><td>Pincount</td><td>DAC</td><td>SERCOM2</td><td>USB</td></tr><tr><td>0x0</td><td>SAMD11D14AM</td><td>0x10030000</td><td>16KB</td><td>4KB</td><td>24</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>0x1</td><td colspan="8">Reserved</td></tr><tr><td>0x2</td><td colspan="8">Reserved</td></tr><tr><td>0x3</td><td>SAMD11D14ASS</td><td>0x10030003</td><td>16KB</td><td>4KB</td><td>20</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>0x4</td><td colspan="8">Reserved</td></tr><tr><td>0x5</td><td colspan="8">Reserved</td></tr><tr><td>0x6</td><td>SAMD11D14A</td><td>0x10030006</td><td>16KB</td><td>4KB</td><td>14</td><td>Yes</td><td>No</td><td>Yes</td></tr><tr><td>0x7</td><td colspan="8">Reserved</td></tr><tr><td>0x8-0xFF</td><td colspan="8">Reserved</td></tr></table>

## 12.13.9 Device Configuration

Name: DCFGn

Offset: 0x00F0+n\*0x4 [n=0..1]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DCFG[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DCFG[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DCFG[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DCFG[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

● Bits 31:0 – DCFG[31:0]: Device Configuration

## 12.13.10Coresight ROM Table Entry n

Name: ENTRYn

Offset: 0x1000+n\*0x4 [n=0..1]

Reset:

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">ADDOFF[19:12]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">ADDOFF[11:4]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="4">ADDOFF[3:0]</td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>FMT</td><td>EPRES</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:12 – ADDOFF[19:0]: Address Offset

The base address of the component, relative to the base address of this ROM table.

## z Bits 11:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – FMT: Format

Always read as one, indicates a 32-bit ROM table.

## Bit 0 – EPRES: Entry Present

This bit indicates whether an entry is present at this location in the ROM table.

This bit is set at powerup if the device is not protected indicating that the entry is not present.

This bit is cleared at powerup if the device is not protected indicating that the entry is present.

## 12.13.11Coresight ROM Table End

Name: END

Offset: 0x1008

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">END[31:24]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">END[23:16]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">END[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">END[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – END[31:0]: End Marker Indicates the end of the CoreSight ROM table entries.

## 12.13.12Coresight ROM Table Memory Type

Name: MEMTYPE

Offset: 0x1FCC

Reset: 0X0000000000000000000000000000000X

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SMEMP</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td></tr></table>

## z Bits 31:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – SMEMP: System Memory Present

This bit indicates whether system memory is present on the bus that connects to the ROM table.

This bit is set at powerup if the device is not protected indicating that the system memory is accessible from a debug adapter.

This bit is cleared at powerup if the device is protected indicating that the system memory is not accessible from a debug adapter.

## 12.13.13Peripheral Identification 4

Name: PID4

Offset: 0x1FD0

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">FKBC[3:0]</td><td colspan="4">JEPCC[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:4 – FKBC[3:0]: 4KB count

These bits will always return zero when read, indicating that this debug component occupies one 4KB block.

z Bits 3:0 – JEPCC[3:0]: JEP-106 Continuation Code

These bits will always return zero when read, indicating a Atmel device.

## 12.13.14Peripheral Identification 5

Name: PID5

Offset: 0x1FD4

Reset:

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 12.13.15Peripheral Identification 6

Name: PID6

Offset: 0x1FD8

Reset:

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 12.13.16Peripheral Identification 7

Name: PID7

Offset: 0x1FDC

Reset:

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 12.13.17Peripheral Identification 0

Name: PID0

Offset: 0x1FE0

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">PARTNBL[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 7:0 – PARTNBL[7:0]: Part Number Low

These bits will always return 0xD0 when read, indicating that this device implements a DSU module instance.

## 12.13.18Peripheral Identification 1

Name: PID1

Offset: 0x1FE4

Reset: 0x000000FC

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">JEPIDCL[3:0]</td><td colspan="4">PARTNBH[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:4 – JEPIDCL[3:0]: Low part of the JEP-106 Identity Code These bits will always return 0xF when read, indicating a Atmel device (Atmel JEP-106 identity code is 0x1F).

## ● Bits 3:0 – PARTNBH[3:0]: Part Number High

These bits will always return 0xC when read, indicating that this device implements a DSU module instance.

## 12.13.19Peripheral Identification 2

Name: PID2

Offset: 0x1FE8

Reset: 0x00000009

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">Revision[3:0]</td><td>JEPU</td><td colspan="3">JEPIDCH[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td></tr></table>

z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:4 – REVISION[3:0]: Revision Number

Revision of the peripheral. Starts at 0x0 and increments by one at both major and minor revisions.

Bit 3 – JEPU: JEP-106 Identity Code is used

This bit will always return one when read, indicating that JEP-106 code is used.

z Bits 2:0 – JEPIDCH[2:0]: JEP-106 Identity Code High

These bits will always return 0x1 when read, indicating an Atmel device (Atmel JEP-106 identity code is 0x1F).

## 12.13.20Peripheral Identification 3

Name: PID3

Offset: 0x1FEC

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">REVAND[3:0]</td><td colspan="4">CUSMOD[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:4 – REVAND[3:0]: Revision Number These bits will always return 0x0 when read.

z Bits 3:0 – CUSMOD[3:0]: ARM CUSMOD These bits will always return 0x0 when read.

## 12.13.21Component Identification 0

Name: CID0

Offset: 0x1FF0

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">PREAMBLEB0[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:0 – PREAMBLEB0[7:0]: Preamble Byte 0 These bits will always return 0xD when read.

## 12.13.22Component Identification 1

Name: CID1

Offset: 0x1FF4

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">CCLASS[3:0]</td><td colspan="4">PREAMBLE[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 7:4 – CCLASS[3:0]: Component Class

These bits will always return 0x1 when read indicating that this ARM CoreSight component is ROM table (refer to the ARM Debug Interface v5 Architecture Specification at http://www.arm.com).

## z Bits 3:0 – PREAMBLE[3:0]: Preamble

These bits will always return 0x0 when read.

## 12.13.23Component Identification 2

Name: CID2

Offset: 0x1FF8

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">PREAMBLEB2[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:0 – PREAMBLEB2[7:0]: Preamble Byte 2 These bits will always return 0x05 when read.

## 12.13.24Component Identification 3

Name: CID3

Offset: 0x1FFC

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">PREAMBLEB3[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:0 – PREAMBLEB3[7:0]: Preamble Byte 3 These bits will always return 0xB1 when read.

## 13. Clock System

This chapter only aims to summarize the clock distribution and terminology in the SAM D11 device. It will not explain every detail of its configuration. For in-depth documentation, see the referenced module chapters.

## 13.1 Clock Distribution

Figure 13-1. Clock distribution  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_8580af8c89429fa78eec35812acb1c2dd69fff67220c8606b3ff5909e370805c.jpg)

The clock system on the SAM D11 consists of:

z Clock sources, controlled by SYSCTRL

z A Clock source is the base clock signal used in the system. Example clock sources are the internal 8MHz oscillator (OSC8M), External crystal oscillator (XOSC) and the Digital frequency locked loop (DFLL48M).

z Generic Clock Controller (GCLK) which controls the clock distribution system, made up of:

Generic Clock generators: A programmable prescaler, that can use any of the system clock sources as its source clock. The Generic Clock Generator 0, also called GCLK\_MAIN, is the clock feeding the Power Manager used to generate synchronous clocks.

Generic Clocks: Typically the clock input of a peripheral on the system. The generic clocks, through the Generic Clock Multiplexer, can use any of the Generic Clock generators as its clock source. Multiple instances of a peripheral will typically have a separate generic clock for each instance. The DFLL48M clock input (when multiplying another clock source) is generic clock 0.

## z Power Manager (PM)

The PM controls synchronous clocks on the system. This includes the CPU, bus clocks (APB, AHB) as well as the synchronous (to the CPU) user interfaces of the peripherals. It contains clock masks that can turn on/off the user interface of a peripheral as well as prescalers for the CPU and bus clocks.

Figure 13-2 shows an example where SERCOM0 is clocked by the DFLL48M in open loop mode. The DFLL48M is enabled, the Generic Clock Generator 1 uses the DFLL48M as its clock source, and the generic clock 20, also called GCLK\_SERCOM0\_CORE, that is connected to SERCOM0 uses generator 1 as its source. The SERCOM0 interface, clocked by CLK\_SERCOM0\_APB, has been unmasked in the APBC Mask register in the PM.

Figure 13-2. Example of SERCOM clock  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_802925f4a8ce02e71d7c3664c6022535116ad8803f136ad2173e51026a7d1541.jpg)

## 13.2 Synchronous and Asynchronous Clocks

As the CPU and the peripherals can be clocked from different clock sources, possibly with widely different clock speeds, some peripheral accesses by the CPU needs to be synchronized between the different clock domains. In these cases the peripheral includes a SYNCBUSY status flag that can be used to check if a sync operation is in progress. As the nature of the synchronization might vary between different peripherals, detailed description for each peripheral can be found in the sub-chapter “synchronization” for each peripheral where this is necessary.

In the datasheet references to synchronous clocks are referring to the CPU and bus clocks, while asynchronous clocks are clock generated by generic clocks.

## 13.3 Register Synchronization

There are two different register synchronization schemes implemented on this device: some modules use a common synchronizer register synchronization scheme, while other modules use a distributed synchronizer register synchronization scheme.

The modules using a common synchronizer register synchronization scheme are: GCLK, WDT, RTC, EIC, TC, ADC, AC, DAC.

The modules using a distributed synchronizer register synchronization scheme are: SERCOM USART, SERCOM SPI, SERCOM I2C, I2S, TCC, USB.

## 13.3.1 Common Synchronizer Register Synchronization

## 13.3.1.1 Overview

All peripherals are composed of one digital bus interface, which is connected to the APB or AHB bus and clocked using a corresponding synchronous clock, and one core clock, which is clocked using a generic clock. Access between these clock domains must be synchronized. As this mechanism is implemented in hardware the synchronization process takes place even if the different clocks domains are clocked from the same source and on the same frequency. All registers in the bus interface are accessible without synchronization. All core registers in the generic clock domain must be synchronized when written. Some core registers must be synchronized when read. Registers that need synchronization has this denoted in each individual register description. Two properties are used: write-synchronization and read-synchronization.

A common synchronizer is used for all registers in one peripheral, as shown in Figure 13-3. Therefore, only one register per peripheral can be synchronized at a time.

Figure 13-3. Synchronization  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_383755dc4bebcd00e45eec2d328e7e22331dd0d7ac1f1cff9bab3900e8a11feb.jpg)

## 13.3.1.2 Write-Synchronization

The write-synchronization is triggered by a write to any generic clock core register. The Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set when the write-synchronization starts and cleared when the write-synchronization is complete. Refer to “Synchronization Delay” on page 84 for details on the synchronization delay.

When the write-synchronization is ongoing (STATUS.SYNCBUSY is one), any of the following actions will cause the peripheral bus to stall until the synchronization is complete:

z Writing a generic clock core register

Reading a read-synchronized core register

z Reading the register that is being written (and thus triggered the synchronization)

Core registers without read-synchronization will remain static once they have been written and synchronized, and can be read while the synchronization is ongoing without causing the peripheral bus to stall. APB registers can also be read while the synchronization is ongoing without causing the peripheral bus to stall.

## 13.3.1.3 Read-Synchronization

Reading a read-synchronized core register will cause the peripheral bus to stall immediately until the readsynchronization is complete. STATUS.SYNCBUSY will not be set. Refer to “Synchronization Delay” on page 84 for details on the synchronization delay. Note that reading a read-synchronized core register while STATUS.SYNCBUSY is one will cause the peripheral bus to stall twice; first because of the ongoing synchronization, and then again because reading a read-synchronized core register will cause the peripheral bus to stall immediately.

## 13.3.1.4 Completion of synchronization

The user can either poll STATUS.SYNCBUSY or use the Synchronisation Ready interrupt (if available) to check when the synchronization is complete. It is also possible to perform the next read/write operation and wait, as this next operation will be started once the previous write/read operation is synchronized and/or complete.

## 13.3.1.5 Read Request

The read request functionality is only available to peripherals that have the Read Request register (READREQ) implemented. Refer to the register description of individual peripheral chapters for details.

To avoid forcing the peripheral bus to stall when reading read-synchronized core registers, the read request mechanism can be used.

## Basic Read Request

Writing a one to the Read Request bit in the Read Request register (READREQ.RREQ) will request readsynchronization of the register specified in the Address bits in READREQ (READREQ.ADDR) and set STATUS.SYNCBUSY. When read-synchronization is complete, STATUS.SYNCBUSY is cleared. The readsynchronized value is then available for reading without delay until READREQ.RREQ is written to one again.

The address to use is the offset to the peripheral's base address of the register that should be synchronized.

## Continuous Read Request

Writing a one to the Read Continuously bit in READREQ (READREQ.RCONT) will force continuous readsynchronization of the register specified in READREQ.ADDR. The latest value is always available for reading without stalling the bus, as the synchronization mechanism is continuously synchronizing the given value.

SYNCBUSY is set for the first synchronization, but not for the subsequent synchronizations. If another synchronization is attempted, i.e. by executing a write-operation of a write-synchronized register, the read request wil be stopped, and will have to be manually restarted.

Note that continuous read-synchronization is paused in sleep modes where the generic clock is not running. This means that a new read request is required if the value is needed immediately after exiting sleep.

## 13.3.1.6 Enable Write-Synchronization

Writing to the Enable bit in the Control register (CTRL.ENABLE) will also trigger write-synchronization and set STATUS.SYNCBUSY. CTRL.ENABLE will read its new value immediately after being written. The Synchronisation Ready interrupt (if available) cannot be used for Enable write-synchronization.

When the enable write-synchronization is ongoing (STATUS.SYNCBUSY is one), attempt to do any of the following will cause the peripheral bus to stall until the enable synchronization is complete:

z Writing a core register

z Writing an APB register

z Reading a read-synchronized core register

APB registers can be read while the enable write-synchronization is ongoing without causing the peripheral bus to stall.

## 13.3.1.7 Software Reset Write-Synchronization

Writing a one to the Software Reset bit in CTRL (CTRL.SWRST) will also trigger write-synchronization and set STATUS.SYNCBUSY. When writing a one to the CTRL.SWRST bit it will immediately read as one. CTRL.SWRST and STATUS.SYNCBUSY will be cleared by hardware when the peripheral has been reset. Writing a zero to the

CTRL.SWRST bit has no effect. The Synchronisation Ready interrupt (if available) cannot be used for Software Reset write-synchronization.

When the software reset is in progress (STATUS.SYNCBUSY and CTRL.SWRST are one), attempt to do any of the following will cause the peripheral bus to stall until the Software Reset synchronization and the reset is complete:

z Writing a core register

z Writing an APB register

z Reading a read-synchronized register

APB registers can be read while the software reset is being write-synchronized without causing the peripheral bus to stall.

## 13.3.1.8 Synchronization Delay

The synchronization will delay the write or read access duration by a delay D, given by the equation:

$$
5 \cdot P _ {G C L K} + 2 \cdot P _ {A P B} <   D <   6 \cdot P _ {G C L K} + 3 \cdot P _ {A P B}
$$

Where $P _ { G C L K }$ is the period of the generic clock and $P _ { A P B }$ is the period of the peripheral bus clock. A normal peripheral bus register access duration is $2 \cdot P _ { A P B }$

## 13.3.2 Distributed Synchronizer Register Synchronization

## 13.3.2.1 Overview

All peripherals are composed of one digital bus interface, which is connected to the APB or AHB bus and clocked using a corresponding synchronous clock, and one core clock, which is clocked using a generic clock. Access between these clock domains must be synchronized. As this mechanism is implemented in hardware the synchronization process takes place even if the different clocks domains are clocked from the same source and on the same frequency. All registers in the bus interface are accessible without synchronization. All core registers in the generic clock domain must be synchronized when written. Some core registers must be synchronized when read. Registers that need synchronization has this denoted in each individual register description.

## 13.3.2.2 General Write synchronization

Inside the same module, each core register, denoted by the Write-Synchronized property, use its own synchronization mechanism so that writing to different core registers can be done without waiting for the end of synchronization of previous core register access.

To write again to the same core register in the same module, user must wait for the end of synchronization or the write will be discarded.

For each core register, that can be written, a synchronization status bit is associated

Example:

REGA, REGB are 8-bit core registers. REGC is 16-bit core register.

<table><tr><td>Offset</td><td>Register</td></tr><tr><td>0x00</td><td>REGA</td></tr><tr><td>0x01</td><td>REGB</td></tr><tr><td>0x02</td><td rowspan="2">REGC</td></tr><tr><td>0x03</td></tr></table>

Since synchronization is per register, user can write REGA (8-bit access) then immediately write REGB (8-bit access) without error.

User can write REGC (16-bit access) without affecting REGA or REGB. But if user writes REGC in two consecutive 8- bit accesses, second write will be discarded and generate an error.

When user makes a 32-bit access to offset 0x00, all registers are written but REGA, REGB, REGC can be updated at a different time because of independent write synchronization

## 13.3.2.3 General read synchronization

Before any read of a core register, the user must check that the related bit in SYNCBUSY register is cleared.

Read access to core register is always immediate but the return value is reliable only if a synchonization of this core register is not going.

## 13.3.2.4 Completion of synchronization

The user can either poll SYNCBUSY register or use the Synchronisation Ready interrupt (if available) to check when the synchronization is complete.

## 13.3.2.5 Enable Write-Synchronization

Writing to the Enable bit in the Control register (CTRL.ENABLE) will also trigger write-synchronization and set SYNCBUSY.ENABLE. CTRL.ENABLE will read its new value immediately after being written. The Synchronisation Ready interrupt (if available) cannot be used for Enable write-synchronization.

## 13.3.2.6 Software Reset Write-Synchronization

Writing a one to the Software Reset bit in CTRL (CTRL.SWRST) will also trigger write-synchronization and set SYNCBUSY.SWRST. When writing a one to the CTRL.SWRST bit it will immediately read as one. CTRL.SWRST and SYNCBUSY.SWRST will be cleared by hardware when the peripheral has been reset. Writing a zero to the CTRL.SWRST bit has no effect. The Synchronisation Ready interrupt (if available) cannot be used for Software Reset write-synchronization.

## 13.3.2.7 Synchronization Delay

The synchronization will delay the write or read access duration by a delay D, given by the equation:

$$
5 \cdot P _ {G C L K} + 2 \cdot P _ {A P B} <   D <   6 \cdot P _ {G C L K} + 3 \cdot P _ {A P B}
$$

Where $P _ { G C L K }$ is the period of the generic clock and $P _ { A P B }$ is the period of the peripheral bus clock. A normal peripheral bus register access duration is $2 \cdot P _ { A P B }$

## 13.4 Enabling a Peripheral

To enable a peripheral clocked by a generic clock, the following parts of the system needs to be configured:

z A running clock source.

A clock from the Generic Clock Generator must be configured to use one of the running clock sources, and the generator must be enabled.

z The generic clock, through the Generic Clock Multiplexer, that connects to the peripheral needs to be configured with a running clock from the Generic Clock Generator, and the generic clock must be enabled.

z The user interface of the peripheral needs to be unmasked in the PM. If this is not done the peripheral registers will read as all 0’s and any writes to the peripheral will be discarded.

## 13.5 On-demand, Clock Requests

Figure 13-4. Clock request routing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_b6a93b016868b2831a364fc153e81c834ecdbaf6b1c689866c60cdea3347aeca.jpg)

All the clock sources in the system can be run in an on-demand mode, where the clock source is in a stopped state when no peripherals are requesting the clock source. Clock requests propagate from the peripheral, via the GCLK, to the clock source. If one or more peripheral is using a clock source, the clock source will be started/kept running. As soon as the clock source is no longer needed and no peripheral have an active request the clock source will be stopped until requested again. For the clock request to reach the clock source, the peripheral, the generic clock and the clock from the Generic Clock Generator in-between must be enabled. The time taken from a clock request being asserted to the clock source being ready is dependent on the clock source startup time, clock source frequency as well as the divider used in the Generic Clock Generator. The total startup time from a clock request to the clock is available for the peripheral is:

Delay\_start\_max = Clock source startup time + 2 \* clock source periods + 2 \* divided clock source periods

Delay\_start\_min = Clock source startup time + 1 \* clock source period + 1 \* divided clock source period

The delay for shutting down the clock source when there is no longer an active request is:

Delay\_stop\_min = 1 \* divided clock source period + 1 \* clock source period

Delay\_stop\_max = 2 \* divided clock source periods + 2 \* clock source periods

The On-Demand principle can be disabled individually for each clock source by clearing the ONDEMAND bit located in each clock source controller. The clock is always running whatever is the clock request. This has the effect to remove the clock source startup time at the cost of the power consumption.

In standby mode, the clock request mechanism is still working if the modules are configured to run in standby mode (RUNSTDBY bit).

## 13.6 Power Consumption vs Speed

Due to the nature of the asynchronous clocking of the peripherals there are some considerations that needs to be taken if either targeting a low-power or a fast-acting system. If clocking a peripheral with a very low clock, the active power consumption of the peripheral will be lower. At the same time the synchronization to the synchronous (CPU) clock domain is dependent on the peripheral clock speed, and will be longer with a slower peripheral clock; giving lower response time and more time waiting for the synchronization to complete.

## 13.7 Clocks after Reset

On any reset the synchronous clocks start to their initial state:

z OSC8M is enabled and divided by 8

z GCLK\_MAIN uses OSC8M as source

CPU and BUS clocks are undivided

On a power reset the GCLK starts to their initial state:

z All generic clock generators disabled except:

z the generator 0 (GCLK\_MAIN) using OSC8M as source, with no division

z the generator 2 using OSCULP32K as source, with no division

All generic clocks disabled except:

z the WDT generic clock using the generator 2 as source

On a user reset the GCLK starts to their initial state, except for:

generic clocks that are write-locked (WRTLOCK is written to one prior to reset or the WDT generic clock if the WDT Always-On at power on bit set in the NVM User Row)

z The generic clock dedicated to the RTC if the RTC generic clock is enabled

On any reset the clock sources are reset to their initial state except the 32KHz clock sources which are reset only by a power reset.

## 14. GCLK – Generic Clock Controller

## 14.1 Overview

Several peripherals may require specific clock frequencies to operate correctly. The Generic Clock Controller consists of number of generic clock generators and generic clock multiplexers that can provide a wide range of clock frequencies. The generic clock generators can be set to use different external and internal clock sources. The selected clock can be divided down in the generic clock generator. The outputs from the generic clock generators are used as clock sources for the generic clock multiplexers, which select one of the sources to generate a generic clock (GCLK\_PERIPHERAL), as shown in Figure 14-2. The number of generic clocks, m, depends on how many peripherals the device has.

## 14.2 Features

z Provides generic clocks

z Wide frequency range

z Clock source for the generator can be changed on the fly

## 14.3 Block Diagram

The Generic Clock Controller can be seen in the clocking diagram, which is shown in Figure 14-1 .

Figure 14-1. Device Clocking Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_f578b17b7668d2019e48d4d7f075e3f2ddd7bb8090d2ed15b09b4bb3c0592334.jpg)  
The Generic Clock Controller block diagram is shown in Figure 14-2.

Figure 14-2. Generic Clock Controller Block Diagram<sup>(1)</sup>  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_c1e3371177031081fe829c0bc17fbe69f7bc31cac6b01fc7651868047324f2ea.jpg)  
Note: 1. If the GENCTRL.SRC=GCLKIN the GCLK\_IO is set as an input.

## 14.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>GCLK_IO[5:0]</td><td>Digital I/O</td><td>Source clock when inputGeneric clock when output</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 14.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 14.5.1 I/O Lines

Using the Generic Clock Controller’s I/O lines requires the I/O pins to be configured. Refer to “PORT” on page 378 for details.

## 14.5.2 Power Management

The Generic Clock Controller can operate in all sleep modes, if required. Refer to Table 15-4 for details on the different sleep modes.

## 14.5.3 Clocks

The Generic Clock Controller bus clock (CLK\_GCLK\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_GCLK\_APB can be found in the Peripheral Clock Masking section in APBAMASK.

## 14.5.4 DMA

Not applicable.

## 14.5.5 Interrupts

Not applicable.

## 14.5.6 Events

Not applicable.

## 14.5.7 Debug Operation

Not applicable.

## 14.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC).

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode or the CPU reset is extended, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 14.5.9 Analog Connections

Not applicable.

## 14.6 Functional Description

## 14.6.1 Principle of Operation

The GCLK module is comprised of eight generic clock generators sourcing m generic clock multiplexers.

A clock source selected as input to one of the generic clock generators can be used directly, or it can be prescaled in the generic clock generator before the generator output is used as input to one or more of the generic clock multiplexers.

A generic clock multiplexer provides a generic clock to a peripheral (GCLK\_PERIPHERAL). A generic clock can act as the clock to one or several of peripherals.

## 14.6.2 Basic Operation

## 14.6.2.1 Initialization

Before a generic clock is enabled, the clock source of its generic clock generator should be enabled. The generic clock must be configured as outlined by the following steps:

1. The generic clock generator division factor must be set by performing a single 32-bit write to the Generic Clock Generator Division register (GENDIV):

The generic clock generator that will be selected as the source of the generic clock must be written to the ID bit group (GENDIV.ID).

z The division factor must be written to the DIV bit group (GENDIV.DIV)

Refer to GENDIV register for details.

2. The generic clock generator must be enabled by performing a single 32-bit write to the Generic Clock Generator Control register (GENCTRL):

The generic clock generator that will be selected as the source of the generic clock must be written to the ID bit group (GENCTRL.ID)

z The generic clock generator must be enabled by writing a one to the GENEN bit (GENCTRL.GENEN) Refer to GENCTRL register for details.

3. The generic clock must be configured by performing a single 16-bit write to the Generic Clock Control register (CLKCTRL):

z The generic clock that will be configured must be written to the ID bit group (CLKCTRL.ID)

z The generic clock generator used as the source of the generic clock must be written to the GEN bit group (CLKCTRL.GEN)

Refer to CLKCTRL register for details.

## 14.6.2.2 Enabling, Disabling and Resetting

The GCLK module has no enable/disable bit to enable or disable the whole module.

The GCLK is reset by writing a one to the Software Reset bit in the Control register (CTRL.SWRST). All registers in the GCLK will be reset to their initial state except for generic clocks and associated generators that have their Write Lock bit written to one. Refer to “Configuration Lock” on page 93 for details.

## 14.6.2.3 Generic Clock Generator

Each generic clock generator (GCLKGEN) can be set to run from one of eight different clock sources except GCLKGEN[1] which can be set to run from one of seven sources. GCLKGEN[1] can act as source to the other generic clock generators but can not act as source to itself.

Each generic clock generator GCLKGEN[x] can be connected to one specific GCLK\_IO[x] pin. The GCLK\_IO[x] can be set to act as source to GCLKGEN[x] or GCLK\_IO[x] can be set up to output the clock generated by GCLKGEN[x].

The selected source (GCLKGENSRC see Figure 14-3) can optionally be divided. Each generic clock generator can be independently enabled and disabled.

Each GCLKGEN clock can then be used as a clock source for the generic clock multiplexers. Each generic clock is allocated to one or several peripherals.

GCLKGEN[0], is used as GCLK\_MAIN for the synchronous clock controller inside the Power Manager.

Refer to “PM – Power Manager” on page 110 for details on the synchronous clock generation.

Figure 14-3. Generic Clock Generator  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_45fabd2c8e149981d75b261ad5f8ea3c98239ad3e3851ba832f39fc74cd2e845.jpg)

## 14.6.2.4 Enabling a Generic Clock Generator

A generic clock generator is enabled by writing a one to the Generic Clock Generator Enable bit in the Generic Clock Generator Control register (GENCTRL.GENEN).

## 14.6.2.5 Disabling a Generic Clock Generator

A generic clock generator is disabled by writing a zero to GENCTRL.GENEN. When GENCTRL.GENEN is read as zero, the GCLKGEN clock is disabled and clock gated.

## 14.6.2.6 Selecting a Clock Source for the Generic Clock Generator

Each generic clock generator can individually select a clock source by writing to the Source Select bit group in GENCTRL (GENCTRL.SRC). Changing from one clock source, A, to another clock source, B, can be done on the fly. If clock source B is not ready, the generic clock generator will continue running with clock source A. As soon as clock source B is ready, however, the generic clock generator will switch to it. During the switching, the generic clock generator holds clock requests to clock sources A and B and then releases the clock source A request when the switch is done.

The available clock sources are device dependent (usually the crystal oscillators, RC oscillators, PLL and DFLL clocks). GCLKGEN[1] can be used as a common source for all the generic clock generators except generic clock generator 1.

## 14.6.2.7 Changing Clock Frequency

The selected generic clock generator source, GENCLKSRC can optionally be divided by writing a division factor in the Division Factor bit group in the Generic Clock Generator Division register (GENDIV.DIV).

Depending on the value of the Divide Selection bit in GENCTRL (GENCTRL.DIVSEL), it can be interpreted in two ways by the integer divider.

Note that the number of DIV bits for each generic clock generator is device dependent.

Refer to Table 14-10 for details.

## 14.6.2.8 Duty Cycle

When dividing a clock with an odd division factor, the duty-cycle will not be 50/50. Writing a one to the Improve Duty Cycle bit in GENCTRL (GENCTRL.IDC) will result in a 50/50 duty cycle.

## 14.6.2.9 Generic Clock Output on I/O Pins

Each Generic Clock Generator's output can be directed to a GCLK\_IO pin. If the Output Enable bit in GENCTRL (GENCTRL.OE) is one and the generic clock generator is enabled (GENCTRL.GENEN is one), the generic clock generator requests its clock source and the GCLKGEN clock is output to a GCLK\_IO pin. If GENCTRL.OE is zero, GCLK\_IO is set according to the Output Off Value bit. If the Output Off Value bit in GENCTRL (GENCTRL.OOV) is zero, the output clock will be low when generic clock generator is turned off. If GENCTRL.OOV is one, the output clock will be high when generic clock generator is turned off.

In standby mode, if the clock is output (GENCTRL.OE is one), the clock on the GCLK\_IO pin is frozen to the OOV value if the Run In Standby bit in GENCTRL (GENCTRL.RUNSTDBY) is zero. If GENCTRL.RUNSTDBY is one, the GCLKGEN clock is kept running and output to GCLK\_IO.

## 14.6.3 Generic Clock

Figure 14-4. Generic Clock Multiplexer  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_396cfcfcbc83983a54eb3c8beb01921d4c24018bea542ce5f4efe65f1a533240.jpg)

## 14.6.3.1 Enabling a Generic Clock

Before a generic clock is enabled, one of the generic clock generators must be selected as the source for the generic clock by writing to CLKCTRL.GEN. The clock source selection is individually set for each generic clock.

When a generic clock generator has been selected, the generic clock is enabled by writing a one to the Clock Enable bit in CLKCTRL (CLKCTRL.CLKEN). The CLKCTRL.CLKEN bit must be synchronized to the generic clock domain. CLKCTRL.CLKEN will continue to read as its previous state until the synchronization is complete.

## 14.6.3.2 Disabling a Generic Clock

A generic clock is disabled by writing a zero to CLKCTRL.CLKEN. The SYNCBUSY bit will be cleared when this writesynchronization is complete. CLKCTRL.CLKEN will continue to read as its previous state until the synchronization is complete. When the generic clock is disabled, the generic clock is clock gated.

## 14.6.3.3 Selecting a Clock Source for the Generic Clock

When changing a generic clock source by writing to CLKCTRL.GEN, the generic clock must be disabled before being re-enabled with the new clock source setting. This prevents glitches during the transition:

a. Write a zero to CLKCTRL.CLKEN

b. Wait until CLKCTRL.CLKEN reads as zero

c. Change the source of the generic clock by writing CLKCTRL.GEN

d. Re-enable the generic clock by writing a one to CLKCTRL.CLKEN

## 14.6.3.4 Configuration Lock

The generic clock configuration is locked for further write accesses by writing the Write Lock bit (WRTLOCK) in the CLKCTRL register. All writes to the CLKCTRL register will be ignored. It can only be unlocked by a power reset.

The generic clock generator sources of a locked generic clock are also locked. The corresponding GENCTRL and GENDIV are locked, and can be unlocked only by a power reset.

There is one exception concerning the GCLKGEN[0]. As it is used as GCLK\_MAIN, it can not be locked. It is reset by any reset to startup with a known configuration.

The SWRST can not unlock the registers.

## 14.6.4 Additional Features

## 14.6.4.1 Indirect Access

The Generic Clock Generator Control and Division registers (GENCTRL and GENDIV) and the Generic Clock Control register (CLKCTRL) are indirectly addressed as shown in Figure 14-5.

Figure 14-5. GCLK Indirect Access  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_c7c3bd9fafe84c02c8943d667c0ef609dcced54efed17c422c79a44569225a2a.jpg)

Writing these registers is done by setting the corresponding ID bit group.

To read a register, the user must write the ID of the channel, i, in the corresponding register. The value of the register for the corresponding ID is available in the user interface by a read access.

For example, the sequence to read the GENCTRL register of generic clock generator i is:

a. Do an 8-bit write of the i value to GENCTRL.ID

b. Read GENCTRL

## 14.6.4.2 Generic Clock Enable after Reset

The Generic Clock Controller must be able to provide a generic clock to some specific peripherals after a reset. Tha means that the configuration of the generic clock generators and generic clocks after reset is device-dependent.

Refer to Table 14-8 and Table 14-9 for details on GENCTRL reset.

Refer to Table 14-12 and Table 14-13 for details on GENDIV reset.

Refer to Table 14-4 and Table 14-5 for details on CLKCTRL reset.

## 14.6.5 Sleep Mode Operation

## 14.6.5.1 SleepWalking

The GCLK module supports the SleepWalking feature. During a sleep mode where the generic clocks are stopped, a peripheral that needs its generic clock to execute a process must request it from the Generic Clock Controller.

The Generic Clock Controller will receive this request and then determine which generic clock generator is involved and which clock source needs to be awakened. It then wakes up the clock source, enables the generic clock generator and generic clock stages successively and delivers the generic clock to the peripheral.

## 14.6.5.2 Run in Standby Mode

In standby mode, the GCLK can continuously output the generic clock generator output to GCLK\_IO.

Refer to “Generic Clock Output on I/O Pins” on page 92 for details.

## 14.6.6 Synchronization

Due to the asynchronicity between CLK\_GCLK\_APB and GCLKGENSRC some registers must be synchronized when accessed. A register can require:

z Synchronization when written

Synchronization when read

z Synchronization when written and read

z No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete.

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following registers need synchronization when written:

z Generic Clock Generator Control register (GENCTRL)

z Generic Clock Generator Division register (GENDIV)

z Control register (CTRL)

Write-synchronization is denoted by the Write-Synchronization property in the register description.

Refer to “Register Synchronization” on page 81 for further details.

## 14.7 Register Summary

Table 14-1. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0</td><td>CTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SWRST</td></tr><tr><td>0x1</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2</td><td rowspan="2">CLKCTRL</td><td>7:0</td><td></td><td></td><td colspan="6">ID[5:0]</td></tr><tr><td>0x3</td><td>15:8</td><td>WRTLOCK</td><td>CLKEN</td><td></td><td></td><td colspan="4">GEN[3:0]</td></tr><tr><td>0x4</td><td rowspan="4">GENCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="4">ID[3:0]</td></tr><tr><td>0x5</td><td>15:8</td><td></td><td></td><td></td><td colspan="5">SRC[4:0]</td></tr><tr><td>0x6</td><td>23:16</td><td></td><td></td><td>RUNSTDBY</td><td>DIVSEL</td><td>OE</td><td>OOV</td><td>IDC</td><td>GENEN</td></tr><tr><td>0x7</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x8</td><td rowspan="4">GENDIV</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="4">ID[3:0]</td></tr><tr><td>0x9</td><td>15:8</td><td colspan="8">DIV[7:0]</td></tr><tr><td>0xA</td><td>23:16</td><td colspan="8">DIV[15:8]</td></tr><tr><td>0xB</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

## 14.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-protected property in each individual register description. Refer to “Register Access Protection” on page 90 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Refer to “Synchronization” on page 94 for details.

## 14.8.1 Control

Name: CTRL

Offset: 0x0

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: There is a reset operation ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the GCLK to their initial state after a power reset, except for generic clocks and associated generators that have their WRTLOCK bit in CLKCTRL read as one.

Refer to Table 14-8 for details on GENCTRL reset.

Refer to Table 14-12 for details on GENDIV reset.

Refer to Table 14-4 for details on CLKCTRL reset.

Due to synchronization, there is a delay from writing CTRL.SWRST until the reset is complete. CTRL.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

## 14.8.2 Status

Name: STATUS

Offset: 0x1

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy Status

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 14.8.3 Generic Clock Control

Name: CLKCTRL

Offset: 0x2

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>WRTLOCK</td><td>CLKEN</td><td></td><td></td><td colspan="4">GEN[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="6">ID[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to configure one of the generic clocks, as specified in the CLKCTRL.ID bit group. To write to the CLKCTRL register, do a 16-bit write with all configurations and the ID.

To read the CLKCTRL register, first do an 8-bit write to the CLKCTRL.ID bit group with the ID of the generic clock whose configuration is to be read, and then read the CLKCTRL register.

## z Bit 15 – WRTLOCK: Write Lock

When this bit is written, it will lock from further writes the generic clock pointed to by CLKCTRL.ID, the generic clock generator pointed to in CLKCTRL.GEN and the division factor used in the generic clock generator. It can only be unlocked by a power reset.

One exception to this is generic clock generator 0, which cannot be locked.

0: The generic clock and the associated generic clock generator and division factor are not locked.

1: The generic clock and the associated generic clock generator and division factor are locked.

## z Bit 14 – CLKEN: Clock Enable

This bit is used to enable and disable a generic clock.

0: The generic clock is disabled.

1: The generic clock is enabled.

## z Bits 13:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 11:8 – GEN[3:0]: Generic Clock Generator

Table 14-2. Generic Clock Generator

<table><tr><td>GEN[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>GCLK0</td><td>Generic clock generator 0</td></tr><tr><td>0x1</td><td>GCLK1</td><td>Generic clock generator 1</td></tr><tr><td>0x2</td><td>GCLK2</td><td>Generic clock generator 2</td></tr><tr><td>0x3</td><td>GCLK3</td><td>Generic clock generator 3</td></tr><tr><td>0x4</td><td>GCLK4</td><td>Generic clock generator 4</td></tr><tr><td>0x5</td><td>GCLK5</td><td>Generic clock generator 5</td></tr><tr><td>0x6 - 0xF</td><td></td><td>Reserved</td></tr></table>

Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 5:0 – ID[5:0]: Generic Clock Selection ID These bits select the Generic Clock that needs to be configured, as shown in Table 14-3 .

Table 14-3. Generic Clock Selection ID

<table><tr><td>ID[5:0]</td><td>Name</td><td>Module Instance</td></tr><tr><td>0x0</td><td>GCLK_DFLL48M_REF</td><td>DFLL48MReference</td></tr><tr><td>0x1</td><td>GCLK_DPLL</td><td>FDPLL96M input clock source for reference</td></tr><tr><td>0x2</td><td>GCLK_DPLL_32K</td><td>FDPLL96M 32kHz clock for FDPLL96M internal lock timer</td></tr><tr><td>0x3</td><td>GCLK_WDT</td><td>WDT</td></tr><tr><td>0x4</td><td>GCLK_RTC</td><td>RTC</td></tr><tr><td>0x5</td><td>GCLK_EIC</td><td>EIC</td></tr><tr><td>0x6</td><td>GCLK_USB</td><td>USB</td></tr><tr><td>0x07</td><td>GCLK_EVSYS_CHANNEL_0</td><td>EVSYS_CHANNEL_0</td></tr><tr><td>0x08</td><td>GCLK_EVSYS_CHANNEL_1</td><td>EVSYS_CHANNEL_1</td></tr><tr><td>0x09</td><td>GCLK_EVSYS_CHANNEL_2</td><td>EVSYS_CHANNEL_2</td></tr><tr><td>0x0A</td><td>GCLK_EVSYS_CHANNEL_3</td><td>EVSYS_CHANNEL_3</td></tr><tr><td>0x0B</td><td>GCLK_EVSYS_CHANNEL_4</td><td>EVSYS_CHANNEL_4</td></tr><tr><td>0x0C</td><td>GCLK_EVSYS_CHANNEL_5</td><td>EVSYS_CHANNEL_5</td></tr><tr><td>0x0D</td><td>GCLK_SERCOMx_SLOW</td><td>SERCOMx_SLOW</td></tr><tr><td>0x0E</td><td>GCLK_SERCOM0_CORE</td><td>SERCOM0_CORE</td></tr><tr><td>0x0F</td><td>GCLK_SERCOM1_CORE</td><td>SERCOM1_CORE</td></tr><tr><td>0x10</td><td>GCLK_SERCOM2_CORE</td><td>SERCOM2_CORE</td></tr><tr><td>0x11</td><td>GCLK_TCC0</td><td>TCC0</td></tr><tr><td>0x12</td><td>GCLK_TCC1, GCLK_TC2</td><td>TC1,TC2</td></tr><tr><td>0x13</td><td>GCLK_ADC</td><td>ADC</td></tr><tr><td>0x14</td><td>GCLK_AC_DIG</td><td>AC_DIG</td></tr><tr><td>0x15</td><td>GCLK_AC_ANA</td><td>AC_ANA</td></tr><tr><td>0x16</td><td>GCLK_DAC</td><td>DAC</td></tr><tr><td>0x17</td><td>GCLK_PTC</td><td>PTC</td></tr><tr><td>0x18-0x3F</td><td></td><td>Reserved</td></tr></table>

A power reset will reset the CLKCTRL register for all IDs, including the RTC. If the WRTLOCK bit of the corresponding ID is zero and the ID is not the RTC, a user reset will reset the CLKCTRL register for this ID.  
After a power reset, the reset value of the CLKCTRL register versus module instance is as shown in Table 14-4.

Table 14-4. CLKCTRL Reset Value after a Power Reset

<table><tr><td rowspan="2">Module Instance</td><td colspan="3">Reset Value after a Power Reset</td></tr><tr><td>CLKCTRL.GEN</td><td>CLKCTRL.CLKEN</td><td>CLKCTRL.WRTLOCK</td></tr><tr><td>RTC</td><td>0x00</td><td>0x00</td><td>0x00</td></tr><tr><td>WDT</td><td>0x02</td><td>0x01 if WDT Enable bit in NVMUser Row written to one0x00 if WDT Enable bit in NVMUser Row written to zero</td><td>0x01 if WDT Always-On bit inNVM User Row written to one0x00 if WDT Always-On bit inNVM User Row written to zero</td></tr><tr><td>Others</td><td>0x00</td><td>0x00</td><td>0x00</td></tr></table>

After a user reset, the reset value of the CLKCTRL register versus module instance is as shown in Table 14-5.

Table 14-5. CLKCTRL Reset Value after a User Reset

<table><tr><td rowspan="2">Module Instance</td><td colspan="3">Reset Value after a User Reset</td></tr><tr><td>CLKCTRL.GEN</td><td>CLKCTRL.CLKEN</td><td>CLKCTRL.WRTLOCK</td></tr><tr><td>RTC</td><td>0x00 if WRTLOCK=0 and CLKEN=0No change if WRTLOCK=1 or CLKEN=1</td><td>0x00 if WRTLOCK=0 and CLKEN=0No change if WRTLOCK=1 or CLKEN=1</td><td>No change</td></tr><tr><td>WDT</td><td>0x02 if WRTLOCK=0No change if WRTLOCK=1</td><td>If WRTLOCK=00x01 if WDT Enable bit in NVM User Row written to one0x00 if WDT Enable bit in NVM User Row written to zeroIf WRTLOCK=1 no change</td><td>No change</td></tr><tr><td>Others</td><td>0x00 if WRTLOCK=0No change if WRTLOCK=1</td><td>0x00 if WRTLOCK=0No change if WRTLOCK=1</td><td>No change</td></tr></table>

## 14.8.4 Generic Clock Generator Control

Name: GENCTRL

Offset: 0x4

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td>RUNSTDBY</td><td>DIVSEL</td><td>OE</td><td>OOV</td><td>IDC</td><td>GENEN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">SRC[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">ID[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to configure one of the generic clock generators, as specified in the GENCTRL.ID bit group. To write to the GENCTRL register, do a 32-bit write with all configurations and the ID.

To read the GENCTRL register, first do an 8-bit write to the GENCTRL.ID bit group with the ID of the generic clock generator those configuration is to be read, and then read the GENCTRL register.

## z Bits 31:22 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 21 – RUNSTDBY: Run in Standby

This bit is used to keep the generic clock generator running when it is configured to be output to its dedicated GCLK\_IO pin. If GENCTRL.OE is zero, this bit has no effect and the generic clock generator will only be running if a peripheral requires the clock.

0: The generic clock generator is stopped in standby and the GCLK\_IO pin state (one or zero) will be dependent on the setting in GENCTRL.OOV.

1: The generic clock generator is kept running and output to its dedicated GCLK\_IO pin during standby mode.

## z Bit 20 – DIVSEL: Divide Selection

This bit is used to decide how the clock source used by the generic clock generator will be divided. If the clock source should not be divided, the DIVSEL bit must be zero and the GENDIV.DIV value for the corresponding generic clock generator must be zero or one.

0: The generic clock generator equals the clock source divided by GENDIV.DIV.

1: The generic clock generator equals the clock source divided by 2^(GENDIV.DIV+1).

## Bit 19 – OE: Output Enable

This bit is used to enable output of the generated clock to GCLK\_IO when GCLK\_IO is not selected as a source in the GENCLK.SRC bit group.

0: The generic clock generator is not output.

1: The generic clock generator is output to the corresponding GCLK\_IO, unless the corresponding GCLK\_IO is selected as a source in the GENCLK.SRC bit group.

## z Bit 18 – OOV: Output Off Value

This bit is used to control the value of GCLK\_IO when GCLK\_IO is not selected as a source in the GENCLK.SRC bit group.

0: The GCLK\_IO will be zero when the generic clock generator is turned off or when the OE bit is zero.

1: The GCLK\_IO will be one when the generic clock generator is turned off or when the OE bit is zero.

## Bit 17 – IDC: Improve Duty Cycle

This bit is used to improve the duty cycle of the generic clock generator when odd division factors are used.

0: The generic clock generator duty cycle is not 50/50 for odd division factors.

1: The generic clock generator duty cycle is 50/50.

## z Bit 16 – GENEN: Generic Clock Generator Enable

This bit is used to enable and disable the generic clock generator.

0: The generic clock generator is disabled.

1: The generic clock generator is enabled.

## z Bits 15:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 12:8 – SRC[4:0]: Source Select

hese bits define the clock source to be used as the source for the generic clock generator, as shown in Table 14-6.

Table 14-6. Source Select

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x00</td><td>XOSC</td><td>XOSC oscillator output</td></tr><tr><td>0x01</td><td>GCLKIN</td><td>Generator input pad</td></tr><tr><td>0x02</td><td>GCLKGEN1</td><td>Generic clock generator 1 output</td></tr><tr><td>0x03</td><td>OSCULP32K</td><td>OSCULP32K oscillator output</td></tr><tr><td>0x04</td><td>OSC32K</td><td>OSC32K oscillator output</td></tr><tr><td>0x05</td><td>XOSC32K</td><td>XOSC32K oscillator output</td></tr><tr><td>0x06</td><td>OSC8M</td><td>OSC8M oscillator output</td></tr><tr><td>0x07</td><td>DFLL48M</td><td>DFLL48M output</td></tr><tr><td>0x08</td><td>FDPLL96M</td><td>FDPLL96M output</td></tr><tr><td>0x09-0x1F</td><td>Reserved</td><td>Reserved for future use</td></tr></table>

Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 3:0 – ID[3:0]: Generic Clock Generator Selection These bits select the generic clock generator that will be configured or read. The value of the ID bit group versus which generic clock generator is configured is shown in Table 14-7.

Table 14-7. Generic Clock Generator Selection

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>GCLKGEN0</td><td>Generic clock generator 0</td></tr><tr><td>0x1</td><td>GCLKGEN1</td><td>Generic clock generator 1</td></tr><tr><td>0x2</td><td>GCLKGEN2</td><td>Generic clock generator 2</td></tr><tr><td>0x3</td><td>GCLKGEN3</td><td>Generic clock generator 3</td></tr><tr><td>0x4</td><td>GCLKGEN4</td><td>Generic clock generator 4</td></tr><tr><td>0x5</td><td>GCLKGEN5</td><td>Generic clock generator 5</td></tr><tr><td>0x6 - 0xF</td><td></td><td>Reserved</td></tr></table>

A power reset will reset the GENCTRL register for all IDs, including the generic clock generator used by the RTC. If a generic clock generator ID other than generic clock generator 0 is not a source of a “locked” generic clock or a source of the RTC generic clock, a user reset will reset the GENCTRL for this ID.

After a power reset, the reset value of the GENCTRL register is as shown in Table 14-8.

Table 14-8. GENCTRL Reset Value after a Power Reset

<table><tr><td>GCLK Generator ID</td><td>Reset Value after a Power Reset</td></tr><tr><td>0x00</td><td>0x00010600</td></tr><tr><td>0x01</td><td>0x00000001</td></tr><tr><td>0x02</td><td>0x00010302</td></tr><tr><td>0x03</td><td>0x00000003</td></tr><tr><td>0x04</td><td>0x00000004</td></tr><tr><td>0x05</td><td>0x00000005</td></tr></table>

After a user reset, the reset value of the GENCTRL register is as shown in Table 14-9.

Table 14-9. GENCTRL Reset Value after a User Reset

<table><tr><td>GCLK Generator ID</td><td>Reset Value after a User Reset</td></tr><tr><td>0x00</td><td>0x00010600</td></tr><tr><td>0x01</td><td>0x00000001 if the generator is not used by the RTCNo change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x02</td><td>0x00010302 if the generator is not used by the RTCNo change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x03</td><td>0x00000003 if the generator is not used by the RTCNo change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x04</td><td>0x00000004 if the generator is not used by the RTCNo change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x05</td><td>0x00000005 if the generator is not used by the RTCNo change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr></table>

## 14.8.5 Generic Clock Generator Division

Name: GENDIV

Offset: 0x8

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIV[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DIV[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">ID[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to configure one of the generic clock generators, as specified in the GENDIV.ID bit group. To write to the GENDIV register, do a 32-bit write with all configurations and the ID.

To read the GENDIV register, first do an 8-bit write to the GENDIV.ID bit group with the ID of the generic clock generator whose configuration is to be read, and then read the GENDIV register.

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:8 – DIV[15:0]: Division Factor

These bits apply a division on each selected generic clock generator. The number of DIV bits each generator has can be seen in Table 14-10. Writes to bits above the specified number will be ignored.

Table 14-10. Division Factor

<table><tr><td>Generator</td><td>Division Factor Bits</td></tr><tr><td>Generic clock generator 0</td><td>8 division factor bits - DIV[7:0]</td></tr><tr><td>Generic clock generator 1</td><td>16 division factor bits - DIV[15:0]</td></tr><tr><td>Generic clock generators 2</td><td>5 division factor bits - DIV[4:0]</td></tr><tr><td>Generic clock generators 3 - 8</td><td>8 division factor bits - DIV[7:0]</td></tr></table>

## Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 3:0 – ID[3:0]: Generic Clock Generator Selection These bits select the generic clock generator on which the division factor will be applied, as shown in Table 14-11.

Table 14-11. Generic Clock Generator Selection

<table><tr><td>ID[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>GCLKGEN0</td><td>Generic clock generator 0</td></tr><tr><td>0x1</td><td>GCLKGEN1</td><td>Generic clock generator 1</td></tr><tr><td>0x2</td><td>GCLKGEN2</td><td>Generic clock generator 2</td></tr><tr><td>0x3</td><td>GCLKGEN3</td><td>Generic clock generator 3</td></tr><tr><td>0x4</td><td>GCLKGEN4</td><td>Generic clock generator 4</td></tr><tr><td>0x5</td><td>GCLKGEN5</td><td>Generic clock generator 5</td></tr><tr><td>0x6 - 0xF</td><td></td><td>Reserved</td></tr></table>

A power reset will reset the GENDIV register for all IDs, including the generic clock generator used by the RTC. If a generic clock generator ID other than generic clock generator 0 is not a source of a ‚“locked” generic clock or a source of the RTC generic clock, a user reset will reset the GENDIV for this ID.

After a power reset, the reset value of the GENDIV register is as shown in Table 14-12.

Table 14-12. GENDIV Reset Value after a Power Reset

<table><tr><td>GCLK Generator ID</td><td>Reset Value after a Power Reset</td></tr><tr><td>0x00</td><td>0x00000000</td></tr><tr><td>0x01</td><td>0x00000001</td></tr><tr><td>0x02</td><td>0x00000002</td></tr><tr><td>0x03</td><td>0x00000003</td></tr><tr><td>0x04</td><td>0x00000004</td></tr><tr><td>0x05</td><td>0x00000005</td></tr></table>

After a user reset, the reset value of the GENDIV register is as shown in Table 14-13.

Table 14-13. GENDIV Reset Value after a User Reset

<table><tr><td>GCLK Generator ID</td><td>Reset Value after a User Reset</td></tr><tr><td>0x00</td><td>0x00000000</td></tr><tr><td>0x01</td><td>0x00000001 if the generator is not used by the RTC and not a source of a &#x27;locked&#x27; generic clock No change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x02</td><td>0x00000002 if the generator is not used by the RTC and not a source of a &#x27;locked&#x27; generic clock No change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x03</td><td>0x00000003 if the generator is not used by the RTC and not a source of a &#x27;locked&#x27; generic clock No change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x04</td><td>0x00000004 if the generator is not used by the RTC and not a source of a &#x27;locked&#x27; generic clock No change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr><tr><td>0x05</td><td>0x00000005 if the generator is not used by the RTC and not a source of a &#x27;locked&#x27; generic clock No change if the generator is used by the RTC or used by a GCLK with a WRTLOCK as one</td></tr></table>

## 15. PM – Power Manager

## 15.1 Overview

The Power Manager (PM) controls the reset, clock generation and sleep modes of the microcontroller.

Utilizing a main clock chosen from a large number of clock sources from the GCLK, the clock controller provides synchronous system clocks to the CPU and the modules connected to the AHB and the APBx bus. The synchronous system clocks are divided into a number of clock domains; one for the CPU and AHB and one for each APBx. Any synchronous system clock can be changed at run-time during normal operation. The clock domains can run at different speeds, enabling the user to save power by running peripherals at a relatively low clock frequency, while maintaining high CPU performance. In addition, the clock can be masked for individual modules, enabling the user to minimize power consumption. If for some reason the main clock stops oscillating, the clock failure detector allows switching the main clock to the safe OSC8M clock.

Before entering the STANDBY sleep mode the user must make sure that a significant amount of clocks and peripherals are disabled, so that the voltage regulator is not overloaded. This is because during STANDBY sleep mode the internal voltage regulator will be in low power mode.

Various sleep modes and clock gating are provided in order to fit power consumption requirements. This enables the microcontroller to stop unused modules to save power. In ACTIVE mode, the CPU is executing application code. When the device enters a sleep mode, program execution is stopped and some modules and clock domains are automatically switched off by the PM according to the sleep mode. The application code decides which sleep mode to enter and when. Interrupts from enabled peripherals and all enabled reset sources can restore the microcontroller from a sleep mode to ACTIVE mode.

The PM also contains a reset controller, which collects all possible reset sources. It issues a microcontroller reset and sets the device to its initial state, and allows the reset source to be identified by software.

## 15.2 Features

z Reset control

z Reset the microcontroller and set it to an initial state according to the reset source

z Multiple reset sources

z Power reset sources: POR, BOD12, BOD33

z User reset sources: External reset (RESET), Watchdog Timer reset, software reset

z Reset status register for reading the reset source from the application code

## z Clock control

z Controls CPU, AHB and APB system clocks

z Multiple clock sources and division factor from GCLK

z Clock prescaler with 1x to 128x division

z Safe run-time clock switching from GCLK

z Module-level clock gating through maskable peripheral clocks

z Clock failure detector

z Power management control

z Sleep modes: IDLE, STANDBY

z SleepWalking support on GCLK clocks

## 15.3 Block Diagram

Figure 15-1. PM Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_357fdf73842fc3f9dfcd3fa46b22d946e0232c19657752e7499057d0c16cd410.jpg)

15.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td> $\overline{\text{RESET}}$ </td><td>Digital input</td><td>External reset</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 15.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 15.5.1 I/O Lines

Not applicable.

## 15.5.2 Power Management

Not applicable.

## 15.5.3 Clocks

The PM bus clock (CLK\_PM\_APB) can be enabled and disabled in the power manager, and the default state of CLK\_PM\_APB can be found in Table 15-1. If this clock is disabled in the Power Manager, it can only be re-enabled by a reset.

A generic clock (GCLK\_MAIN) is required to generate the main clock. The clock source for GCLK\_MAIN is configured by default in the Generic Clock Controller, and can be re-configured by the user if needed. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

## 15.5.3.1 Main Clock

The main clock (CLK\_MAIN) is the common source for the synchronous clocks. This is fed into the common 8-bit prescaler that is used to generate synchronous clocks to the CPU, AHB and APBx modules.

## 15.5.3.2 CPU Clock

The CPU clock (CLK\_CPU) is routed to the CPU. Halting the CPU clock inhibits the CPU from executing instructions.

## 15.5.3.3 AHB Clock

The AHB clock (CLK\_AHB) is the root clock source used by peripherals requiring an AHB clock. The AHB clock is always synchronous to the CPU clock and has the same frequency, but may run even when the CPU clock is turned off. A clock gate is inserted from the common AHB clock to any AHB clock of a peripheral.

## 15.5.3.4 APBx Clocks

The APBx clock (CLK\_APBX) is the root clock source used by modules requiring a clock on the APBx bus. The APBx clock is always synchronous to the CPU clock, but can be divided by a prescaler, and will run even when the CPU clock is turned off. A clock gater is inserted from the common APB clock to any APBx clock of a module on APBx bus.

## 15.5.4 DMA

Not applicable.

## 15.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the PM interrupt requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 15.5.6 Events

Not applicable.

## 15.5.7 Debug Operation

When the CPU is halted in debug mode, the PM continues normal operation. In sleep mode, the clocks generated from the PM are kept running to allow the debugger accessing any modules. As a consequence, power measurements are not possible in debug mode.

## 15.5.8 Register Access Protection

All registers with write access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

Interrupt Flag register (INTFLAG). Refer to INTFLAG for details

z Reset Cause register (RCAUSE). Refer to RCAUSE for details

Write-protection is denoted by the Write-Protection property in the register description.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 15.5.9 Analog Connections

Not applicable.

## 15.6 Functional Description

## 15.6.1 Principle of Operation

## 15.6.1.1 Synchronous Clocks

The GCLK\_MAIN clock from GCLK module provides the source for the main clock, which is the common root for the synchronous clocks for the CPU and APBx modules. The main clock is divided by an 8-bit prescaler, and each of the derived clocks can run from any tapping off this prescaler or the undivided main clock, as long as $\mathsf { f } _ { \mathsf { C P U } } \geq \mathsf { f } _ { \mathsf { A P B x } }$ . The synchronous clock source can be changed on the fly to respond to varying load in the application. The clocks for each module in each synchronous clock domain can be individually masked to avoid power consumption in inactive modules. Depending on the sleep mode, some clock domains can be turned off (see Table 15-4 on page 119).

## 15.6.1.2 Reset Controller

The Reset Controller collects the various reset sources and generates reset for the device. The device contains a power-on-reset (POR) detector, which keeps the system reset until power is stable. This eliminates the need for external reset circuitry to guarantee stable operation when powering up the device.

## 15.6.1.3 Sleep Mode Controller

In ACTIVE mode, all clock domains are active, allowing software execution and peripheral operation. The PM Sleep Mode Controller allows the user to choose between different sleep modes depending on application requirements, to save power (see Table 15-4 on page 119).

## 15.6.2 Basic Operation

## 15.6.2.1 Initialization

After a power-on reset, the PM is enabled and the Reset Cause (RCAUSE - refer to RCAUSE for details) register indicates the POR source. The default clock source of the GCLK\_MAIN clock is started and calibrated before the CPU starts running. The GCLK\_MAIN clock is selected as the main clock without any division on the prescaler. The device is in the ACTIVE mode.

By default, only the necessary clocks are enabled (see Table 15-1).

## 15.6.2.2 Enabling, Disabling and Resetting

The PM module is always enabled and can not be reset.

## 15.6.2.3 Selecting the Main Clock Source

Refer to “GCLK – Generic Clock Controller” on page 88 for details on how to configure the main clock source.

## 15.6.2.4 Selecting the Synchronous Clock Division Ratio

The main clock feeds an 8-bit prescaler, which can be used to generate the synchronous clocks. By default, the synchronous clocks run on the undivided main clock. The user can select a prescaler division for the CPU clock by writing the CPU Prescaler Selection bits in the CPU Select register (CPUSEL.CPUDIV), resulting in a CPU clock frequency determined by this equation:

$$
f _ {C P U} = \frac {f _ {m a i n}}{2 ^ {C P U D I V}}
$$

Similarly, the clock for the APBx can be divided by writing their respective registers (APBxSEL.APBxDIV). To ensure correct operation, frequencies must be selected so that $\mathsf { f } _ { \mathsf { C P U } } \geq \mathsf { f } _ { \mathsf { A P B x } } .$ . Also, frequencies must never exceed the specified maximum frequency for each clock domain.

Note that the AHB clock is always equal to the CPU clock.

CPUSEL and APBxSEL can be written without halting or disabling peripheral modules. Writing CPUSEL and APBxSEL allows a new clock setting to be written to all synchronous clocks at the same time. It is possible to keep one or more clocks unchanged. This way, it is possible to, for example, scale the CPU speed according to the required performance, while keeping the APBx frequency constant.

Figure 15-2. Synchronous Clock Selection and Prescaler  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_0e85346890b2b0e5e2ad4124564884aefa6243225bed981e684c2407b8d690c2.jpg)

## 15.6.2.5 Clock Ready Flag

There is a slight delay from when CPUSEL and APBxSEL are written until the new clock setting becomes effective. During this interval, the Clock Ready flag in the Interrupt Flag Status and Clear register (INTFLAG.CKRDY) will read as zero. If CKRDY in the INTENSET register is written to one, the Power Manager interrupt can be triggered when the new clock setting is effective. CPUSEL must not be re-written while CKRDY is zero, or the system may become unstable or hang.

## 15.6.2.6 Peripheral Clock Masking

It is possible to disable or enable the clock for a peripheral in the AHB or APBx clock domain by writing the corresponding bit in the Clock Mask register (APBxMASK - refer to APBAMASK for details) to zero or one. Refer to Table 15-1 for the default state of each of the peripheral clocks.

Table 15-1. Peripheral Clock Default State

<table><tr><td>Peripheral Clock</td><td>Default State</td></tr><tr><td>CLK_PAC0_APB</td><td>Enabled</td></tr><tr><td>CLK_PM_APB</td><td>Enabled</td></tr><tr><td>CLK_SYSCTRL_APB</td><td>Enabled</td></tr><tr><td>CLK_GCLK_APB</td><td>Enabled</td></tr><tr><td>CLK_WDT_APB</td><td>Enabled</td></tr><tr><td>CLK_RTC_APB</td><td>Enabled</td></tr><tr><td>CLK_EIC_APB</td><td>Enabled</td></tr><tr><td>CLK_PAC1_APB</td><td>Enabled</td></tr><tr><td>CLK_DSU_APB</td><td>Enabled</td></tr><tr><td>CLK_NVMCTRL_APB</td><td>Enabled</td></tr><tr><td>CLK_PORT_APB</td><td>Enabled</td></tr><tr><td>CLK_HMATRIX_APB</td><td>Enabled</td></tr><tr><td>CLK_PAC2_APB</td><td>Disabled</td></tr><tr><td>CLK_SERCOMx_APB</td><td>Disabled</td></tr><tr><td>CLK_TCx_APB</td><td>Disabled</td></tr><tr><td>CLK_ADC_APB</td><td>Enabled</td></tr><tr><td>CLK_AC_APB</td><td>Disabled</td></tr><tr><td>CLK_DAC_APB</td><td>Disabled</td></tr><tr><td>CLK_PTC_APB</td><td>Disabled</td></tr><tr><td>CLK_USB_APB</td><td>Enabled</td></tr><tr><td>CLK_DMAC_APB</td><td>Enabled</td></tr><tr><td>CLK_TCC_APB</td><td>Disabled</td></tr></table>

When the APB clock for a module is not provided its registers cannot be read or written. The module can be reenabled later by writing the corresponding mask bit to one.

A module may be connected to several clock domains (for instance, AHB and APB), in which case it will have several mask bits.

Note that clocks should only be switched off if it is certain that the module will not be used. Switching off the clock for the NVM Controller (NVMCTRL) will cause a problem if the CPU needs to read from the flash memory. Switching off the clock to the Power Manager (PM), which contains the mask registers, or the corresponding APBx bridge, will make it impossible to write the mask registers again. In this case, they can only be re-enabled by a system reset.

## 15.6.2.7 Clock Failure Detector

This mechanism allows the main clock to be switched automatically to the safe OSC8M clock when the main clock source is considered off. This may happen for instance when an external crystal oscillator is selected as the clock source for the main clock and the crystal fails. The mechanism is to designed to detect, during a OSCULP32K clock period, at least one rising edge of the main clock. If no rising edge is seen, the clock is considered failed.

The clock failure detector is enabled by writing a one to the Clock Failure Detector Enable bit in CTRL (CFDEN\_CTRL). Refer to CTRL for detailed information.

As soon as the Clock Failure Detector Enable bit (CTRL.CFDEN) is one, the clock failure detector (CFD) will monito the undivided main clock. When a clock failure is detected, the main clock automatically switches to the OSC8M clock and the Clock Failure Detector flag in the interrupt Flag Status and Clear register (INTFLAG.CFD) is set and the corresponding interrupt request will be generated if enabled. The BKUPCLK bit in the CTRL register is set by hardware to indicate that the main clock comes from OSC8M. The GCLK\_MAIN clock source can be selected again by writing a zero to the CTRL.BKUPCLK bit. Writing the bit does not fix the failure, however.

Note 1: The detector does not monitor while the main clock is temporarily unavailable (startup time after a wake-up, etc.) or in sleep mode. The Clock Failure Detector must be disabled before entering standby mode.

Note 2: The clock failure detector must not be enabled if the source of the main clock is not significantly faster than the OSCULP32K clock. For instance, if GCLK\_MAIN is the internal 32kHz RC, then the clock failure detector must be disabled.

Note 3: The OSC8M internal oscillator should be enabled to allow the main clock switching to the OSC8M clock.

## 15.6.2.8 Reset Controller

The latest reset cause is available in RCAUSE, and can be read during the application boot sequence in order to determine proper action.

There are two groups of reset sources:

z Power Reset: Resets caused by an electrical issue.

z User Reset: Resets caused by the application.

The table below lists the parts of the device that are reset, depending on the reset type.

Table 15-2. Effects of the Different Reset Events

<table><tr><td></td><td>Power Reset</td><td colspan="2">User Reset</td></tr><tr><td></td><td>POR, BOD12, BOD33</td><td>External Reset</td><td>WDT Reset, SysResetReq</td></tr><tr><td>RTCAll the 32kHz sourcesWDT with ALWAYSON featureGeneric Clock with WRTLOCK feature</td><td>Y</td><td>N</td><td>N</td></tr><tr><td>Debug logic</td><td>Y</td><td>Y</td><td>N</td></tr><tr><td>Others</td><td>Y</td><td>Y</td><td>Y</td></tr></table>

The external reset is generated when pulling the RESET pin low. This pin has an internal pull-up, and does not need to be driven externally during normal operation.

The POR, BOD12 and BOD33 reset sources are generated by their corresponding module in the System Controller Interface (SYSCTRL).

The WDT reset is generated by the Watchdog Timer.

The System Reset Request (SysResetReq) is a software reset generated by the CPU when asserting the SYSRESETREQ bit located in the Reset Control register of the CPU (See the ARM<sup>®</sup> Cortex<sup>®</sup> Technical Reference Manual on http://www.arm.com).

Figure 15-3. Reset Controller  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_001e73a168eaf042b3f896d8b571257a9de443e7d7df6954ba396f94120c2d04.jpg)

## 15.6.2.9 Sleep Mode Controller

Sleep mode is activated by the Wait For Interrupt instruction (WFI). The Idle bits in the Sleep Mode register (SLEEP.IDLE) and the SLEEPDEEP bit of the System Control register of the CPU should be used as argument to select the level of the sleep mode.

There are two main types of sleep mode:

z IDLE mode: The CPU is stopped. Optionally, some synchronous clock domains are stopped, depending on the IDLE argument. Regulator operates in normal mode.

z STANDBY mode: All clock sources are stopped, except those where the RUNSTDBY bit is set. Regulator operates in low-power mode. Before entering standby mode the user must make sure that a significant amount of clocks and peripherals are disabled, so that the voltage regulator is not overloaded.

Table 15-3. Sleep Mode Entry and Exit Table

<table><tr><td>Mode</td><td>Level</td><td>Mode Entry</td><td>Wake-Up Sources</td></tr><tr><td rowspan="3">IDLE</td><td>0</td><td rowspan="3">SCR.SLEEPDEEP = 0SLEEP.IDLE=LevelWFI</td><td> $Synchronous^{(2)}$  (APB, AHB),  $asynchronous^{(1)}$ </td></tr><tr><td>1</td><td>Synchronous (APB), asynchronous</td></tr><tr><td>2</td><td>Asynchronous</td></tr><tr><td>STANDBY</td><td></td><td>SCR.SLEEPDEEP = 1WFI</td><td>Asynchronous</td></tr></table>

Notes: 1. Asynchronous: interrupt generated on generic clock or external clock or external event.  
2. Synchronous: interrupt generated on the APB clock.

Table 15-4. Sleep Mode Overview

<table><tr><td rowspan="3">Sleep Mode</td><td rowspan="3">CPU Clock</td><td rowspan="3">AHB Clock</td><td rowspan="3">APB Clock</td><td colspan="4">Oscillators</td><td rowspan="3">Main Clock</td><td rowspan="3">Regulator Mode</td><td rowspan="3">RAM Mode</td></tr><tr><td colspan="2">ONDEMAND = 0</td><td colspan="2">ONDEMAND = 1</td></tr><tr><td>RUNSTDBY=0</td><td>RUNSTDBY=1</td><td>RUNSTDBY=0</td><td>RUNSTDBY=1</td></tr><tr><td>Idle 0</td><td>Stop</td><td>Run</td><td>Run</td><td>Run</td><td>Run</td><td>Run if requested</td><td>Run if requested</td><td>Run</td><td>Normal</td><td>Normal</td></tr><tr><td>Idle 1</td><td>Stop</td><td>Stop</td><td>Run</td><td>Run</td><td>Run</td><td>Run if requested</td><td>Run if requested</td><td>Run</td><td>Normal</td><td>Normal</td></tr><tr><td>Idle 2</td><td>Stop</td><td>Stop</td><td>Stop</td><td>Run</td><td>Run</td><td>Run if requested</td><td>Run if requested</td><td>Run</td><td>Normal</td><td>Normal</td></tr><tr><td>Standby</td><td>Stop</td><td>Stop</td><td>Stop</td><td>Stop</td><td>Run</td><td>Stop</td><td>Run if requested</td><td>Stop</td><td>Low power</td><td>Low power</td></tr></table>

## IDLE Mode

The IDLE modes allow power optimization with the fastest wake-up time.

The CPU is stopped. To further reduce power consumption, the user can disable the clocking of modules and clock sources by configuring the SLEEP.IDLE bit group. The module will be halted regardless of the bit settings of the mask registers in the Power Manager (PM.AHBMASK, PM.APBxMASK).

Regulator operates in normal mode.

z Entering IDLE mode: The IDLE mode is entered by executing the WFI instruction. Additionally, if the SLEEPONEXIT bit in the ARM Cortex System Control register (SCR) is set, the IDLE mode will also be entered when the CPU exits the lowest priority ISR. This mechanism can be useful for applications that only require the processor to run when an interrupt occurs. Before entering the IDLE mode, the user must configure the IDLE mode configuration bit group and must write a zero to the SCR.SLEEPDEEP bit.

z Exiting IDLE mode: The processor wakes the system up when it detects the occurrence of any interrupt that is not masked in the NVIC Controller with sufficient priority to cause exception entry. The system goes back to the ACTIVE mode. The CPU and affected modules are restarted.

## STANDBY Mode

The STANDBY mode allows achieving very low power consumption.

In this mode, all clocks are stopped except those which are kept running if requested by a running module or have the ONDEMAND bit set to zero. For example, the RTC can operate in STANDBY mode. In this case, its Generic Clock clock source will also be enabled

The regulator and the RAM operate in low-power mode.

A SLEEPONEXIT feature is also available.

Entering STANDBY mode: This mode is entered by executing the WFI instruction with the SCR.SLEEPDEEP bit of the CPU is written to 1.

z Exiting STANDBY mode: Any peripheral able to generate an asynchronous interrupt can wake up the system. For example, a module running on a Generic clock can trigger an interrupt. When the enabled asynchronous wake-up event occurs and the system is woken up, the device will either execute the interrupt service routine or continue the normal program execution according to the Priority Mask Register (PRIMASK) configuration of the CPU.

## 15.6.3 SleepWalking

SleepWalking is the capability for a device to temporarily wakeup clocks for peripheral to perform a task without waking-up the CPU in STANDBY sleep mode. At the end of the sleepwalking task, the device can either be waken-up by an interrupt (from a peripheral involved in SleepWalking) or enter again into STANDBY sleep mode.

In Atmel SAM D11 devices, SleepWalking is supported only on GCLK clocks by using the on-demand clock principle of the clock sources. Refer to “On-demand, Clock Requests” on page 86 for more details.

## 15.6.4 DMA Operation

Not applicable.

## 15.6.5 Interrupts

The peripheral has the following interrupt sources:

z Clock Ready flag

Clock failure detector

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear (INTFLAG) register is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set (INTENSET) register, and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear (INTENCLR) register. An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the peripheral is reset. An interrupt flag is cleared by writing a one to the corresponding bit in the INTFLAG register. Each peripheral can have one interrupt request line per interrupt source or one common interrupt request line for all the interrupt sources. Refer to “Nested Vector Interrupt Controller” on page 26 for details. If the peripheral has one common interrupt request line for all the interrupt sources, the user must read the INTFLAG register to determine which interrupt condition is present.

## 15.6.6 Events

Not applicable.

## 15.6.7 Sleep Mode Operation

In all IDLE sleep modes, the power manager is still running on the selected main clock.

In STANDDBY sleep mode, the power manager is frozen and is able to go back to ACTIVE mode upon any asynchronous interrupt.

## 15.7 Register Summary

Table 15-5. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td>CTRL</td><td>7:0</td><td></td><td></td><td></td><td>BKUPCLK</td><td></td><td>CFDEN</td><td></td><td></td></tr><tr><td>0x01</td><td>SLEEP</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">IDLE[1:0]</td></tr><tr><td>0x02</td><td>EXTCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SETDIS</td></tr><tr><td>0x03 ... 0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>CPUSEL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">CPUDIV[2:0]</td></tr><tr><td>0x09</td><td>APBASEL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">APBADIV[2:0]</td></tr><tr><td>0x0A</td><td>APBBSEL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">APBBDIV[2:0]</td></tr><tr><td>0x0B</td><td>APBCSEL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">APBCDIV[2:0]</td></tr><tr><td>0x0C ... 0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="4">AHBMASK</td><td>7:0</td><td></td><td>USB</td><td>DMAC</td><td>NVMCTRL</td><td>DSU</td><td>HPB2</td><td>HPB1</td><td>HPB0</td></tr><tr><td>0x15</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">APBAMASK</td><td>7:0</td><td></td><td>EIC</td><td>RTC</td><td>WDT</td><td>GCLK</td><td>SYSCTRL</td><td>PM</td><td>PAC0</td></tr><tr><td>0x19</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1A</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td rowspan="4">APBBMASK</td><td>7:0</td><td></td><td></td><td>USB</td><td>DMAC</td><td>PORT</td><td>NVMCTRL</td><td>DSU</td><td>PAC1</td></tr><tr><td>0x1D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="4">APBCMASK</td><td>7:0</td><td>TC2</td><td>TC1</td><td>TCC0</td><td>SERCOM2</td><td>SERCOM1</td><td>SERCOM0</td><td>EVSYS</td><td>PAC2</td></tr><tr><td>0x21</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td>DAC</td><td>AC</td><td>ADC</td></tr><tr><td>0x22</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24 ... 0x33</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x34</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>CFD</td><td>CKRDY</td></tr><tr><td>0x35</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>CFD</td><td>CKRDY</td></tr><tr><td>0x36</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>CFD</td><td>CKRDY</td></tr><tr><td>0x37</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x38</td><td>RCAUSE</td><td>7:0</td><td></td><td>SYST</td><td>WDT</td><td>EXT</td><td></td><td>BOD33</td><td>BOD12</td><td>POR</td></tr></table>

## 15.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register, and the 8-bit halves of a 16-bit register can be accessed directly.

Exception for APBASEL, APBBSEL and APBCSEL: These registers must only be accessed with 8-bit access.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 112 for details.

## 15.8.1 Control

Name: CTRL

Offset: 0x00

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>BKUPCLK</td><td></td><td>CFDEN</td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – BKUPCLK: Backup Clock Select

This bit is set by hardware when a clock failure is detected.

0: The GCLK\_MAIN clock is selected for the main clock.

1: The OSC8M backup clock is selected for the main clock.

## Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 2 – CFDEN: Clock Failure Detector Enable

0: The clock failure detector is disabled.

1: The clock failure detector is enabled.

## Bits 1:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 15.8.2 Sleep Mode

Name: SLEEP

Offset: 0x01

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">IDLE[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 1:0 – IDLE[1:0]: Idle Mode Configuration

These bits select the Idle mode configuration after a WFI instruction.

Table 15-6. Idle Mode Configuration

<table><tr><td>IDLE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>CPU</td><td>The CPU clock domain is stopped</td></tr><tr><td>0x1</td><td>AHB</td><td>The CPU and AHB clock domains are stopped</td></tr><tr><td>0x2</td><td>APB</td><td>The CPU, AHB and APB clock domains are stopped</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## 15.8.3 External Reset Controller

Name: EXTCTRL

Offset: 0x02

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SETDIS</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bit 0 – SETDIS: External Reset Disable

## 15.8.4 CPU Clock Select

Name: CPUSEL

Offset: 0x08

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">CPUDIV[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 2:0 – CPUDIV[2:0]: CPU Prescaler Selection

These bits define the division ratio of the main clock prescaler (2<sup>n</sup>).

Table 15-7. CPU Prescaler Selection

<table><tr><td>CPUDIV[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>Divide by 1</td></tr><tr><td>0x1</td><td>DIV2</td><td>Divide by 2</td></tr><tr><td>0x2</td><td>DIV4</td><td>Divide by 4</td></tr><tr><td>0x3</td><td>DIV8</td><td>Divide by 8</td></tr><tr><td>0x4</td><td>DIV16</td><td>Divide by 16</td></tr><tr><td>0x5</td><td>DIV32</td><td>Divide by 32</td></tr><tr><td>0x6</td><td>DIV64</td><td>Divide by 64</td></tr><tr><td>0x7</td><td>DIV128</td><td>Divide by 128</td></tr></table>

## 15.8.5 APBA Clock Select

Name: APBASEL

Offset: 0x09

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">APBADIV[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 2:0 – APBADIV[2:0]: APBA Prescaler Selection

These bits define the division ratio of the APBA clock prescaler (2<sup>n</sup>).

Table 15-8. APBA Prescaler Selection

<table><tr><td>APBADIV[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>Divide by 1</td></tr><tr><td>0x1</td><td>DIV2</td><td>Divide by 2</td></tr><tr><td>0x2</td><td>DIV4</td><td>Divide by 4</td></tr><tr><td>0x3</td><td>DIV8</td><td>Divide by 8</td></tr><tr><td>0x4</td><td>DIV16</td><td>Divide by 16</td></tr><tr><td>0x5</td><td>DIV32</td><td>Divide by 32</td></tr><tr><td>0x6</td><td>DIV64</td><td>Divide by 64</td></tr><tr><td>0x7</td><td>DIV128</td><td>Divide by 128</td></tr></table>

## 15.8.6 APBB Clock Select

Name: APBBSEL

Offset: 0x0A

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">APBBDIV[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 2:0 – APBBDIV[2:0]: APBB Prescaler Selection

These bits define the division ratio of the APBB clock prescaler (2<sup>n</sup>).

Table 15-9. APBB Prescaler Selection

<table><tr><td>APBBDIV[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>Divide by 1</td></tr><tr><td>0x1</td><td>DIV2</td><td>Divide by 2</td></tr><tr><td>0x2</td><td>DIV4</td><td>Divide by 4</td></tr><tr><td>0x3</td><td>DIV8</td><td>Divide by 8</td></tr><tr><td>0x4</td><td>DIV16</td><td>Divide by 16</td></tr><tr><td>0x5</td><td>DIV32</td><td>Divide by 32</td></tr><tr><td>0x6</td><td>DIV64</td><td>Divide by 64</td></tr><tr><td>0x7</td><td>DIV128</td><td>Divide by 128</td></tr></table>

## 15.8.7 APBC Clock Select

Name: APBCSEL

Offset: 0x0B

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">APBCDIV[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 2:0 – APBCDIV[2:0]: APBC Prescaler Selection

These bits define the division ratio of the APBC clock prescaler (2<sup>n</sup>).

Table 15-10. APBC Prescaler Selection

<table><tr><td>APBCDIV[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>Divide by 1</td></tr><tr><td>0x1</td><td>DIV2</td><td>Divide by 2</td></tr><tr><td>0x2</td><td>DIV4</td><td>Divide by 4</td></tr><tr><td>0x3</td><td>DIV8</td><td>Divide by 8</td></tr><tr><td>0x4</td><td>DIV16</td><td>Divide by 16</td></tr><tr><td>0x5</td><td>DIV32</td><td>Divide by 32</td></tr><tr><td>0x6</td><td>DIV64</td><td>Divide by 64</td></tr><tr><td>0x7</td><td>DIV128</td><td>Divide by 128</td></tr></table>

## 15.8.8 AHB Mask

Name: AHBMASK

Offset: 0x14

Reset: 0x0000007F

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>USB</td><td>DMAC</td><td>NVMCTRL</td><td>DSU</td><td>HPB2</td><td>HPB1</td><td>HPB0</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:7 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 6 – USB: USB AHB Clock Mask

0: The AHB clock for the USB is stopped.

1: The AHB clock for the USB is enabled.

## Bit 5 – DMAC: DMAC AHB Clock Mask

0: The AHB clock for the DMAC is stopped.

1: The AHB clock for the DMAC is enabled.

## ● Bit 4 – NVMCTRL: NVMCTRL AHB Clock Mask

0: The AHB clock for the NVMCTRL is stopped.

1: The AHB clock for the NVMCTRL is enabled.

## z Bit 3 – DSU: DSU AHB Clock Mask

0: The AHB clock for the DSU is stopped.

1: The AHB clock for the DSU is enabled.

z Bit 2 – HPB2: HPB2 AHB Clock Mask 0: The AHB clock for the HPB2 is stopped. 1: The AHB clock for the HPB2 is enabled.

z Bit 1 – HPB1: HPB1 AHB Clock Mask 0: The AHB clock for the HPB1 is stopped. 1: The AHB clock for the HPB1 is enabled.

z Bit 0 – HPB0: HPB0 AHB Clock Mask 0: The AHB clock for the HPB0 is stopped. 1: The AHB clock for the HPB0 is enabled.

## 15.8.9 APBA Mask

Name: APBAMASK

Offset: 0x18

Reset: 0x0000007F

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>EIC</td><td>RTC</td><td>WDT</td><td>GCLK</td><td>SYSCTRL</td><td>PM</td><td>PAC0</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:7 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 6 – EIC: EIC APB Clock Enable

0: The APBA clock for the EIC is stopped.

1: The APBA clock for the EIC is enabled.

## ● Bit 5 – RTC: RTC APB Clock Enable

0: The APBA clock for the RTC is stopped.

1: The APBA clock for the RTC is enabled.

z Bit 4 – WDT: WDT APB Clock Enable

0: The APBA clock for the WDT is stopped.

1: The APBA clock for the WDT is enabled.

z Bit 3 – GCLK: GCLK APB Clock Enable 0: The APBA clock for the GCLK is stopped.

1: The APBA clock for the GCLK is enabled.

z Bit 2 – SYSCTRL: SYSCTRL APB Clock Enable 0: The APBA clock for the SYSCTRL is stopped. 1: The APBA clock for the SYSCTRL is enabled.

z Bit 1 – PM: PM APB Clock Enable 0: The APBA clock for the PM is stopped. 1: The APBA clock for the PM is enabled.

z Bit 0 – PAC0: PAC0 APB Clock Enable 0: The APBA clock for the PAC0 is stopped. 1: The APBA clock for the PAC0 is enabled.

## 15.8.10 APBB Mask

Name: APBBMASK

Offset: 0x1C

Reset: 0x0000007F

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>USB</td><td>DMAC</td><td>PORT</td><td>NVMCTRL</td><td>DSU</td><td>PAC1</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 5 – USB: USB APB Clock Enable

0: The APBB clock for the USB is stopped.

1: The APBB clock for the USB is enabled.

## ● Bit 4 – DMAC: DMAC APB Clock Enable

0: The APBB clock for the DMAC is stopped.

1: The APBB clock for the DMAC is enabled.

z Bit 3 – PORT: PORT APB Clock Enable

0: The APBB clock for the PORT is stopped.

1: The APBB clock for the PORT is enabled.

## z Bit 2 – NVMCTRL: NVMCTRL APB Clock Enable

0: The APBB clock for the NVMCTRL is stopped.

1: The APBB clock for the NVMCTRL is enabled.

z Bit 1 – DSU: DSU APB Clock Enable 0: The APBB clock for the DSU is stopped. 1: The APBB clock for the DSU is enabled.

z Bit 0 – PAC1: PAC1 APB Clock Enable 0: The APBB clock for the PAC1 is stopped. 1: The APBB clock for the PAC1 is enabled.

## 15.8.11 APBC Mask

Name: APBCMASK

Offset: 0x20

Reset: 0x00000100

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>DAC</td><td>AC</td><td>ADC</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>TC2</td><td>TC1</td><td>TCC0</td><td>SERCOM2</td><td>SERCOM1</td><td>SERCOM0</td><td>EVSYS</td><td>PAC2</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R//W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bit 10 – DAC: DAC APB Clock Enable

0: The APBC clock for the DAC is stopped.

1: The APBC clock for the DAC is enabled.

● Bit 9 – AC: AC APB Clock Enable

0: The APBC clock for the AC is stopped.

1: The APBC clock for the AC is enabled.

## z Bit 8 – ADC: ADC APB Clock Enable

0: The APBC clock for the ADC is stopped.

1: The APBC clock for the ADC is enabled.

● Bit 7 – TC2: TC2 APB Clock Enable

## ● Bit 6 – TC1: TC1 APB Clock Enable

## Bits 5:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 5 – TCC0: TCC0 APB Clock Enable

0: The APBC clock for the TCC0 is stopped. 1: The APBC clock for the TCC0 is enabled.

## Bit 4 – SERCOM2: SERCOM2 APB Clock Enable

0: The APBC clock for the SERCOM2 is stopped. 1: The APBC clock for the SERCOM2 is enabled.

## Bit 3 – SERCOM1: SERCOM1 APB Clock Enable

0: The APBC clock for the SERCOM1 is stopped. 1: The APBC clock for the SERCOM1 is enabled.

## ● Bit 2 – SERCOM0: SERCOM0 APB Clock Enable

0: The APBC clock for the SERCOM0 is stopped. 1: The APBC clock for the SERCOM0 is enabled.

## z Bit 1 – EVSYS: EVSYS APB Clock Enable

0: The APBC clock for the EVSYS is stopped. 1: The APBC clock for the EVSYS is enabled.

## z Bit 0 – PAC2: PAC2 APB Clock Enable

0: The APBC clock for the PAC2 is stopped.

1: The APBC clock for the PAC2 is enabled.

## 15.8.12 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x34

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>CFD</td><td>CKRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set (INTENSET) register.

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – CFD: Clock Failure Detector Interrupt Enable

0: The Clock Failure Detector interrupt is disabled.

1: The Clock Failure Detector interrupt is enabled and an interrupt request will be generated when the Clock Failure Detector Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Clock Failure Detector Interrupt Enable bit and the corresponding interrupt request.

## ● Bit 0 – CKRDY: Clock Ready Interrupt Enable

0: The Clock Ready interrupt is disabled.

1: The Clock Ready interrupt is enabled and will generate an interrupt request when the Clock Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Clock Ready Interrupt Enable bit and the corresponding interrupt request.

## 15.8.13 Interrupt Enable Set

Name: INTENSET

Offset: 0x35

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>CFD</td><td>CKRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear (INTENCLR) register.

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – CFD: Clock Failure Detector Interrupt Enable

0: The Clock Failure Detector interrupt is disabled.

1: The Clock Failure Detector interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Clock Failure Detector Interrupt Enable bit and enable the Clock Failure Detector interrupt.

## ● Bit 0 – CKRDY: Clock Ready Interrupt Enable

0: The Clock Ready interrupt is disabled.

1: The Clock Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Clock Ready Interrupt Enable bit and enable the Clock Ready interrupt.

## 15.8.14 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x36

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>CFD</td><td>CKRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 1 – CFD: Clock Failure Detector

This flag is cleared by writing a one to the flag.

This flag is set on the next cycle after a clock failure detector occurs and will generate an interrupt request if INTENCLR/SET.CFD is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Clock Failure Detector Interrupt flag.

## z Bit 0 – CKRDY: Clock Ready

This flag is cleared by writing a one to the flag.

This flag is set when the synchronous CPU and APBx clocks have frequencies as indicated in the CPUSEL and APBxSEL registers, and will generate an interrupt if INTENCLR/SET.CKRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Clock Ready Interrupt flag.

## 15.8.15 Reset Cause

Name: RCAUSE

Offset: 0x38

Reset: 0x01

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>SYST</td><td>WDT</td><td>EXT</td><td></td><td>BOD33</td><td>BOD12</td><td>POR</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td></tr></table>

z Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bit 6 – SYST: System Reset Request

This bit is set if a system reset request has been performed. Refer to the Cortex processor documentation for more details.

## z Bit 5 – WDT: Watchdog Reset

This flag is set if a Watchdog Timer reset occurs.

Bit 4 – EXT: External Reset

This flag is set if an external reset occurs.

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bit 2 – BOD33: Brown Out 33 Detector Reset This flag is set if a BOD33 reset occurs.

z Bit 1 – BOD12: Brown Out 12 Detector Reset This flag is set if a BOD12 reset occurs.

z Bit 0 – POR: Power On Reset This flag is set if a POR occurs.

## 16. SYSCTRL – System Controller

## 16.1 Overview

The System Controller (SYSCTRL) provides a user interface to the clock sources, brown out detectors, on-chip voltage regulator and voltage reference of the device.

Through the interface registers, it is possible to enable, disable, calibrate and monitor the SYSCTRL sub-peripherals.

All sub-peripheral statuses are collected in the Power and Clocks Status register (PCLKSR - refer to PCLKSR). They can additionally trigger interrupts upon status changes via the INTENSET (INTENSET), INTENCLR (INTENCLR) and INTFLAG (INTFLAG) registers.

Additionally, BOD33 and BOD12 interrupts can be used to wake up the device from standby mode upon a programmed brown-out detection.

## 16.2 Features

z 0.4-32MHz Crystal Oscillator (XOSC)

z Tunable gain contro

z Programmable start-up time

z Crystal or external input clock on XIN I/O

z 32.768kHz Crystal Oscillator (XOSC32K)

z Automatic or manual gain control

z Programmable start-up time

z Crystal or external input clock on XIN32 I/O

z 32.768kHz High Accuracy Internal Oscillator (OSC32K)

z Frequency fine tuning

z Programmable start-up time

z 32.768kHz Ultra Low Power Internal Oscillator (OSCULP32K)

z Ultra low power, always-on oscillator

z Frequency fine tuning

z Calibration value loaded from Flash Factory Calibration at reset

z 8MHz Internal Oscillator (OSC8M)

z Fast startup

z Output frequency fine tuning

z 4/2/1MHz divided output frequencies available

z Calibration value loaded from Flash Factory Calibration at reset

z Digital Frequency Locked Loop (DFLL48M)

z Internal oscillator with no external components

z 48MHz output frequency

z Operates standalone as a high-frequency programmable oscillator in open loop mode

z Operates as an accurate frequency multiplier against a known frequency in closed loop mode

z Fractional Digital Phase Locked Loop (FDPLL96M)

z 48MHz to 96MHz output clock frequency

z 32KHz to 2MHz input reference clock frequency range

z Three possible sources for the reference clock

z Adjustable proportional integral controller

z Fractional part used to achieve 1/16th of reference clock step

z 3.3V Brown-Out Detector (BOD33)

z Programmable threshold

z Threshold value loaded from Flash User Calibration at startup

z Triggers resets or interrupts

z Operating modes:

z Continuous mode

z Sampled mode for low power applications (programmable refresh frequency) z Hysteresis

## z 1.2V Brown-Out Detector (BOD12)

z Programmable threshold

z Threshold value loaded from Flash User Calibration at startup

z Triggers resets or interrupts

z Operating modes:

z Continuous mode

z Sampled mode for low power applications (programmable refresh frequency)

z Hysteresis

## z Voltage Reference System (VREF)

z Bandgap voltage generator with programmable calibration value

z Temperature sensor

z Bandgap calibration value loaded from Flash Factory Calibration at startup

z Voltage Regulator System (VREG)

z Trimable core supply voltage level

z Voltage regulator trim value loaded from Flash Factory Calibration at startup

## 16.3 Block Diagram

Figure 16-1. SYSCTRL Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_e5ca932f727b1a4f5eecd1f55f3c02b5bbe69f3af97552f6817dc8056d6f3a9d.jpg)

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_0b9002a5ebb585eaa0a240b06848619acc45dd0ad46bccd9ea6029010c3cab7c.jpg)

16.4 Signal Description

<table><tr><td>Signal Name</td><td>Types</td><td>Description</td></tr><tr><td>XIN</td><td>Analog Input</td><td>Multipurpose Crystal Oscillator or external clock generator input</td></tr><tr><td>XOUT</td><td>Analog Output</td><td>External Multipurpose Crystal Oscillator output</td></tr><tr><td>XIN32</td><td>Analog Input</td><td>32kHz Crystal Oscillator or external clock generator input</td></tr><tr><td>XOUT32</td><td>Analog Output</td><td>32kHz Crystal Oscillator output</td></tr></table>

The I/O lines are automatically selected when XOSC or XOSC32K are enabled.

## 16.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 16.5.1 I/O Lines

I/O lines are configured by SYSCTRL when either XOSC or XOSC32K are enabled, and need no user configuration.

## 16.5.2 Power Management

The SYSCTRL can continue to operate in any sleep mode where the selected source clock is running. The SYSCTRL interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 16.5.3 Clocks

The SYSCTRL gathers controls for all device oscillators and provides clock sources to the Generic Clock Controller (GCLK). The available clock sources are: XOSC, XOSC32K, OSC32K, OSCULP32K, OSC8M, and DFLL48M and FDPLL96M.

The SYSCTRL bus clock (CLK\_SYSCTRL\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_SYSCTRL\_APB can be found in the Peripheral Clock Masking section in the “PM – Power Manager” on page 110.

The clock used by BOD33 and BOD12 in sampled mode is asynchronous to the user interface clock

(CLK\_SYSCTRL\_APB). Likewise, the DFLL48M control logic uses the DFLL oscillator output, which is also asynchronous to the user interface clock (CLK\_SYSCTRL\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 161 for further details.

The FDPLL96M reference clock (CLK\_FDPLL96M\_REF) can be selected among three different clock sources:

Table 16-1. Oscillators and Generic Clock inputs for FDPLL96M clock sources connections

<table><tr><td>Oscillator / Generic Clock</td><td>CLK_FDPLL96M_REF Reference Clock source connection</td></tr><tr><td>XOSC32K</td><td>CLK_DPLL_REF0</td></tr><tr><td>XOSC</td><td>CLK_DPLL_REF1</td></tr><tr><td>GCLK (FDPLL96M)</td><td>GCLK_DPLL</td></tr></table>

The selected clock must be configured and enabled before using the FDPLL96M. If the GCLK is selected as reference clock, it must be configured and enabled in the Generic Clock Controller before using the FDPLL96M. Refer to “GCLK – Generic Clock Controller” on page 88 for details.If the GCLK\_DPLL is selected as the source for the

CLK\_FDPLL96M\_REF, care must be taken to make sure the source for this GCLK is within the valid frequency range for the FDPLL96M.

The XOSC source can be divided inside the FDPLL96M. The user must make sure that the programmable clock divider and XOSC frequency provides a valid CLK\_FDPLL96M\_REF clock frequency that meets the FDPLL96M input frequency range.

The FDPLL96M requires a 32kHz clock from the GCLK when the FDPLL96M internal lock timer is used. This clock must be configured and enabled in the Generic Clock Controller before using the FDPLL96M. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

Table 16-2. Generic Clock Input for FDPLL96M

<table><tr><td>Generic Clock</td><td>FDPLL96M</td></tr><tr><td>FDPLL96M 32kHz clock</td><td>GCLK_DPLL_32K for internal lock timer</td></tr><tr><td>FDPLL96M</td><td>GCLK_DPLL for CLK_FDPLL96M_REF</td></tr></table>

## 16.5.4 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the SYSCTRL interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 16.5.5 Debug Operation

When the CPU is halted in debug mode, the SYSCTRL continues normal operation. If the SYSCTRL is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

If debugger cold-plugging is detected by the system, BOD33 reset will be masked. The BOD reset keeps running under hot-plugging.

## 16.5.6 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

z Interrupt Flag Status and Clear register (INTFLAG - refer to INTFLAG)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 16.5.7 Analog Connections

When used, the 32.768kHz crystal must be connected between the XIN32 and XOUT32 pins, and the 0.4-32MHz crystal must be connected between the XIN and XOUT pins, along with any required load capacitors. For details on recommended oscillator characteristics and capacitor load, refer to the “Electrical Characteristics” on page 858 for details.

## 16.6 Functional Description

## 16.6.1 Principle of Operation

XOSC, XOSC32K, OSC32K, OSCULP32K, OSC8M, DFLL48M, FDPLL96M, BOD33, BOD12, VREG and VREF are configured via SYSCTRL control registers. Through this interface, the sub-peripherals are enabled, disabled or have their calibration values updated.

The Power and Clocks Status register gathers different status signals coming from the sub-peripherals controlled by the SYSCTRL. The status signals can be used to generate system interrupts, and in some cases wake up the system from standby mode, provided the corresponding interrupt is enabled.

The oscillator must be enabled to run. The oscillator is enabled by writing a one to the ENABLE bit in the respective oscillator control register, and disabled by writing a zero to the oscillator control register. In idle mode, the default operation of the oscillator is to run only when requested by a peripheral. In standby mode, the default operation of the oscillator is to stop. This behavior can be changed by the user, see below for details.

The behavior of the oscillators in the different sleep modes is shown in Table 16-3 on page 149

Table 16-3. Behavior of the Oscillators

<table><tr><td>Oscillator</td><td>Idle 0, 1, 2</td><td>Standby</td></tr><tr><td>XOSC</td><td>Run on request</td><td>Stop</td></tr><tr><td>XOSC32K</td><td>Run on request</td><td>Stop</td></tr><tr><td>OSC32K</td><td>Run on request</td><td>Stop</td></tr><tr><td>OSCULP32K</td><td>Run</td><td>Run</td></tr><tr><td>OSC8M</td><td>Run on request</td><td>Stop</td></tr><tr><td>DFLL48M</td><td>Run on request</td><td>Stop</td></tr><tr><td>FDPLL96M</td><td>Run on request</td><td>Stop</td></tr></table>

To force an oscillator to always run in idle mode, and not only when requested by a peripheral, the oscillator ONDEMAND bit must be written to zero. The default value of this bit is one, and thus the default operation in idle mode is to run only when requested by a peripheral.

To force the oscillator to run in standby mode except for DFLL and DPLL, the RUNSTDBY bit must be written to one The oscillator will then run in standby mode when requested by a peripheral (ONDEMAND is one). To force an oscillator to always run in standby mode, and not only when requested by a peripheral, the ONDEMAND bit must be written to zero and RUNSTDBY must be written to one.

Table 16-4 on page 149 shows the behavior in the different sleep modes, depending on the settings of ONDEMAND and RUNSTDBY.

Table 16-4. Behavior in the different sleep modes

<table><tr><td>Sleep mode</td><td>ONDEMAND</td><td>RUNSTDBY</td><td>Behavior</td></tr><tr><td>Idle 0, 1, 2</td><td>0</td><td>X</td><td>Run</td></tr><tr><td>Idle 0, 1, 2</td><td>1</td><td>X</td><td>Run when requested by a peripheral</td></tr><tr><td>Standby</td><td>0</td><td>0</td><td>Stop</td></tr><tr><td>Standby</td><td>0</td><td>1</td><td>Run</td></tr><tr><td>Standby</td><td>1</td><td>0</td><td>Stop</td></tr><tr><td>Standby</td><td>1</td><td>1</td><td>Run when requested by a peripheral</td></tr></table>

Note that this does not apply to the OSCULP32K oscillator, which is always running and cannot be disabled.

## 16.6.2 External Multipurpose Crystal Oscillator (XOSC) Operation

The XOSC can operate in two different modes:

z External clock, with an external clock signal connected to the XIN pin

Crystal oscillator, with an external 0.4-32MHz crysta

The XOSC can be used as a clock source for generic clock generators, as described in the “GCLK – Generic Clock Controller” on page 88.

At reset, the XOSC is disabled, and the XIN/XOUT pins can be used as General Purpose I/O (GPIO) pins or by other peripherals in the system. When XOSC is enabled, the operating mode determines the GPIO usage. When in crysta oscillator mode, the XIN and XOUT pins are controlled by the SYSCTRL, and GPIO functions are overridden on both pins. When in external clock mode, only the XIN pin will be overridden and controlled by the SYSCTRL, while the XOUT pin can still be used as a GPIO pin.

The XOSC is enabled by writing a one to the Enable bit in the External Multipurpose Crystal Oscillator Control register (XOSC.ENABLE). To enable the XOSC as a crystal oscillator, a one must be written to the XTAL Enable bit (XOSC.XTALEN). If XOSC.XTALEN is zero, external clock input will be enabled.

When in crystal oscillator mode (XOSC.XTALEN is one), the External Multipurpose Crystal Oscillator Gain (XOSC.GAIN) must be set to match the external crystal oscillator frequency. If the External Multipurpose Crystal Oscillator Automatic Amplitude Gain Control (XOSC.AMPGC) is one, the oscillator amplitude will be automatically adjusted, and in most cases result in a lower power consumption.

The XOSC will behave differently in different sleep modes based on the settings of XOSC.RUNSTDBY, XOSC.ONDEMAND and XOSC.ENABLE:

<table><tr><td>XOSC.RUNSTDBY</td><td>XOSC.ONDEMAND</td><td>XOSC.ENABLE</td><td>Sleep Behavior</td></tr><tr><td>-</td><td>-</td><td>0</td><td>Disabled</td></tr><tr><td>0</td><td>0</td><td>1</td><td>Always run in IDLE sleep modes. Disabled in STANDBY sleep mode.</td></tr><tr><td>0</td><td>1</td><td>1</td><td>Only run in IDLE sleep modes if requested by a peripheral. Disabled in STANDBY sleep mode.</td></tr><tr><td>1</td><td>0</td><td>1</td><td>Always run in IDLE and STANDBY sleep modes.</td></tr><tr><td>1</td><td>1</td><td>1</td><td>Only run in IDLE or STANDBY sleep modes if requested by a peripheral.</td></tr></table>

After a hard reset, or when waking up from a sleep mode where the XOSC was disabled, the XOSC will need a certain amount of time to stabilize on the correct frequency. This start-up time can be configured by changing the Oscillator Start-Up Time bit group (XOSC.STARTUP) in the External Multipurpose Crystal Oscillator Control register. During the start-up time, the oscillator output is masked to ensure that no unstable clock propagates to the digital logic. The External Multipurpose Crystal Oscillator Ready bit in the Power and Clock Status register (PCLKSR.XOSCRDY) is set when the user-selected startup time is over. An interrupt is generated on a zero-to-one transition on PCLKSR.XOSCRDY if the External Multipurpose Crystal Oscillator Ready bit in the Interrupt Enable Set register (INTENSET.XOSCRDY) is set.

Note: Do not enter standby mode when an oscillator is in startup:

Wait for the OSCxRDY bit in SYSCTRL.PCLKSR register to be set before going into standby mode.

## 16.6.3 32kHz External Crystal Oscillator (XOSC32K) Operation

The XOSC32K can operate in two different modes:

z External clock, with an external clock signal connected to XIN32

z Crystal oscillator, with an external 32.768kHz crystal connected between XIN32 and XOUT32

The XOSC32K can be used as a source for generic clock generators, as described in the “GCLK – Generic Clock Controller” on page 88.

At power-on reset (POR) the XOSC32K is disabled, and the XIN32/XOUT32 pins can be used as General Purpose I/O (GPIO) pins or by other peripherals in the system. When XOSC32K is enabled, the operating mode determines the GPIO usage. When in crystal oscillator mode, XIN32 and XOUT32 are controlled by the SYSCTRL, and GPIO functions are overridden on both pins. When in external clock mode, only the XIN32 pin will be overridden and controlled by the SYSCTRL, while the XOUT32 pin can still be used as a GPIO pin.

The external clock or crystal oscillator is enabled by writing a one to the Enable bit (XOSC32K.ENABLE) in the 32kHz External Crystal Oscillator Control register. To enable the XOSC32K as a crystal oscillator, a one must be written to the XTAL Enable bit (XOSC32K.XTALEN). If XOSC32K.XTALEN is zero, external clock input will be enabled.

The oscillator is disabled by writing a zero to the Enable bit (XOSC32K.ENABLE) in the 32kHz External Crystal Oscillator Control register while keeping the other bits unchanged. Writing to the XOSC32K.ENABLE bit while writing to other bits may result in unpredictable behavior. The oscillator remains enabled in all sleep modes if it has been enabled beforehand. The start-up time of the 32kHz External Crystal Oscillator is selected by writing to the Oscillator Start-Up Time bit group (XOSC32K.STARTUP) in the in the 32kHz External Crystal Oscillator Control register. The SYSCTRL masks the oscillator output during the start-up time to ensure that no unstable clock propagates to the digital logic. The 32kHz External Crystal Oscillator Ready bit (PCLKSR.XOSC32KRDY) in the Power and Clock Status register is set when the user-selected startup time is over. An interrupt is generated on a zero-to-one transition of PCLKSR.XOSC32KRDY if the 32kHz External Crystal Oscillator Ready bit (INTENSET.XOSC32KRDY) in the Interrupt Enable Set Register is set.

As a crystal oscillator usually requires a very long start-up time (up to one second), the 32kHz External Crysta Oscillator will keep running across resets, except for power-on reset (POR).

XOSC32K can provide two clock outputs when connected to a crystal. The XOSC32K has a 32.768kHz output enabled by writing a one to the 32kHz External Crystal Oscillator 32kHz Output Enable bit (XOSC32K.EN32K) in the 32kHz External Crystal Oscillator Control register. The XOSC32K also has a 1.024kHz clock output enabled by writing a one to the 32kHz External Crystal Oscillator 1kHz Output Enable bit (XOSC32K.EN1K) in the External 32kHz Crystal Oscillator Control register. XOSC32K.EN32K and XOSC32K.EN1K are only usable when XIN32 is connected to a crystal, and not when an external digital clock is applied on XIN32.

Note: Do not enter standby mode when an oscillator is in startup:

Wait for the OSCxRDY bit in SYSCTRL.PCLKSR register to be set before going into standby mode.

## 16.6.4 32kHz Internal Oscillator (OSC32K) Operation

The OSC32K provides a tunable, low-speed and low-power clock source.

The OSC32K can be used as a source for the generic clock generators, as described in the “GCLK – Generic Clock Controller” on page 88.

The OSC32K is disabled by default. The OSC32K is enabled by writing a one to the 32kHz Internal Oscillator Enable bit (OSC32K.ENABLE) in the 32kHz Internal Oscillator Control register. It is disabled by writing a zero to OSC32K.ENABLE. The OSC32K has a 32.768kHz output enabled by writing a one to the 32kHz Internal Oscillator 32kHz Output Enable bit (OSC32K.EN32K). The OSC32K also has a 1.024kHz clock output enabled by writing a one to the 32kHz Internal Oscillator 1kHz Output Enable bit (OSC32K.EN1K).

The frequency of the OSC32K oscillator is controlled by the value in the 32kHz Internal Oscillator Calibration bits (OSC32K.CALIB) in the 32kHz Internal Oscillator Control register. The OSC32K.CALIB value must be written by the user. Flash Factory Calibration values are stored in the NVM Software Calibration Area (refer to “NVM Software Calibration Row Mapping” on page 24). When writing to the Calibration bits, the user must wait for the PCLKSR.OSC32KRDY bit to go high before the value is committed to the oscillator.

## 16.6.5 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) Operation

The OSCULP32K provides a tunable, low-speed and ultra-low-power clock source. The OSCULP32K is factorycalibrated under typical voltage and temperature conditions. The OSCULP32K should be preferred to the OSC32K whenever the power requirements are prevalent over frequency stability and accuracy.

The OSCULP32K can be used as a source for the generic clock generators, as described in the “GCLK – Generic Clock Controller” on page 88.

The OSCULP32K is enabled by default after a power-on reset (POR) and will always run except during POR. The OSCULP32K has a 32.768kHz output and a 1.024kHz output that are always running.

The frequency of the OSCULP32K oscillator is controlled by the value in the 32kHz Ultra Low Power Internal Oscillator Calibration bits (OSCULP32K.CALIB) in the 32kHz Ultra Low Power Internal Oscillator Control register. OSCULP32K.CALIB is automatically loaded from Flash Factory Calibration during startup, and is used to compensate for process variation, as described in the “Electrical Characteristics” on page 858. The calibration value can be overridden by the user by writing to OSCULP32K.CALIB.

## 16.6.6 8MHz Internal Oscillator (OSC8M) Operation

OSC8M is an internal oscillator operating in open-loop mode and generating an 8MHz frequency. The OSC8M is factory-calibrated under typical voltage and temperature conditions.

OSC8M is the default clock source that is used after a power-on reset (POR). The OSC8M can be used as a source for the generic clock generators, as described in the “GCLK – Generic Clock Controller” on page 88, as well as function as the backup clock if a main clock failure is detected.

In order to enable OSC8M, the Oscillator Enable bit in the OSC8M Control register (OSC8M.ENABLE) must be written to one. OSC8M will not be enabled until OSC8M.ENABLE is set. In order to disable OSC8M, OSC8M.ENABLE must be written to zero. OSC8M will not be disabled until OSC8M is cleared.

The frequency of the OSC8M oscillator is controlled by the value in the calibration bits (OSC8M.CALIB) in the OSC8M Control register. CALIB is automatically loaded from Flash Factory Calibration during startup, and is used to compensate for process variation, as described in the “Electrical Characteristics” on page 858.

The user can control the oscillation frequency by writing to the Frequency Range (FRANGE) and Calibration (CALIB) bit groups in the 8MHz RC Oscillator Control register (OSC8M). It is not recommended to update the FRANGE and CALIB bits when the OSC8M is enabled. As this is in open-loop mode, the frequency will be voltage, temperature and process dependent. Refer to the “Electrical Characteristics” on page 858 for details.

OSC8M is automatically switched off in certain sleep modes to reduce power consumption, as described in the “PM – Power Manager” on page 110.

## 16.6.7 Digital Frequency Locked Loop (DFLL48M) Operation

The DFLL48M can operate in both open-loop mode and closed-loop mode. In closed-loop mode, a low-frequency clock with high accuracy can be used as the reference clock to get high accuracy on the output clock (CLK\_DFLL48M).

The DFLL48M can be used as a source for the generic clock generators, as described in the “GCLK – Generic Clock Controller” on page 88.

## 16.6.7.1 Basic Operation

## Open-Loop Operation

After any reset, the open-loop mode is selected. When operating in open-loop mode, the output frequency of the DFLL48M will be determined by the values written to the DFLL Coarse Value bit group and the DFLL Fine Value bit group (DFLLVAL.COARSE and DFLLVAL.FINE) in the DFLL Value register.

Using "DFLL48M COARSE CAL" value from Table in DFLL.COARSE helps to output a frequency close to 48 MHz.

It is possible to change the values of DFLLVAL.COARSE and DFLLVAL.FINE and thereby the output frequency of the DFLL48M output clock, CLK\_DFLL48M, while the DFLL48M is enabled and in use. CLK\_DFLL48M is ready to be used when PCLKSR.DFLLRDY is set after enabling the DFLL48M.

## Closed-Loop Operation

In closed-loop operation, the output frequency is continuously regulated against a reference clock. Once the multiplication factor is set, the oscillator fine tuning is automatically adjusted. The DFLL48M must be correctly configured before closed-loop operation can be enabled. After enabling the DFLL48M, it must be configured in the following way:

1. Enable and select a reference clock (CLK\_DFLL48M\_REF). CLK\_DFLL48M\_REF is Generic Clock Channel 0 (DFLL48M\_Reference). Refer to “GCLK – Generic Clock Controller” on page 88 for details.

2. Select the maximum step size allowed in finding the Coarse and Fine values by writing the appropriate values to the DFLL Coarse Maximum Step and DFLL Fine Maximum Step bit groups (DFLLMUL.CSTEP and DFLL-MUL.FSTEP) in the DFLL Multiplier register. A small step size will ensure low overshoot on the output frequency, but will typically result in longer lock times. A high value might give a large overshoot, but will typically provide faster locking. DFLLMUL.CSTEP and DFLLMUL.FSTEP should not be higher than 50% of the maximum value of DFLLVAL.COARSE and DFLLVAL.FINE, respectively.

3. Select the multiplication factor in the DFLL Multiply Factor bit group (DFLLMUL.MUL) in the DFLL Multiplier register. Care must be taken when choosing DFLLMUL.MUL so that the output frequency does not exceed the maximum frequency of the DFLL. If the target frequency is below the minimum frequency of the DFLL48M, the output frequency will be equal to the DFLL minimum frequency.

4. Start the closed loop mode by writing a one to the DFLL Mode Selection bit (DFLLCTRL.MODE) in the DFLL Control register.

The frequency of CLK\_DFLL48M $( \mathsf { F _ { c l k d f l 4 8 m } } )$ is given by:

$$
F _ {c l k d f l 4 8 m} = D F L L M U L \cdot M U L \times F _ {c l k d f l 4 8 m r e f}
$$

where $\mathsf { F } _ { \mathsf { c l k d f l l 4 8 m r e f } }$ is the frequency of the reference clock (CLK\_DFLL48M\_REF). DFLLVAL.COARSE and DFLLVAL.FINE are read-only in closed-loop mode, and are controlled by the frequency tuner to meet user specified frequency. In closed-loop mode, the value in DFLLVAL.COARSE is used by the frequency tuner as a starting point for Coarse. Writing DFLLVAL.COARSE to a value close to the final value before entering closed-loop mode will reduce the time needed to get a lock on Coarse.

Using "DFLL48M COARSE CAL" from Table for DFLL.COARSE will start DFLL with a frequency close to 48 MHz. Following Software sequence should be followed while using the same.

1. load "DFLL48M COARSE CAL" from Table in DFLL.COARSE register

2. Set DFLLCTRL.BPLCKC bit

3. Start DFLL close loop

This procedure will reduce DFLL Lock time to DFLL Fine lock time.

## Frequency Locking

The locking of the frequency in closed-loop mode is divided into two stages. In the first, coarse stage, the control logic quickly finds the correct value for DFLLVAL.COARSE and sets the output frequency to a value close to the correct frequency. On coarse lock, the DFLL Locked on Coarse Value bit (PCLKSR.DFLLLOCKC) in the Power and Clocks Status register will be set.

In the second, fine stage, the control logic tunes the value in DFLLVAL.FINE so that the output frequency is very close to the desired frequency. On fine lock, the DFLL Locked on Fine Value bit (PCLKSR.DFLLLOCKF) in the Power and Clocks Status register will be set.

Interrupts are generated by both PCLKSR.DFLLLOCKC and PCLKSR.DFLLLOCKF if INTENSET.DFLLOCKC or INTENSET.DFLLOCKF are written to one.

CLK\_DFLL48M is ready to be used when the DFLL Ready bit (PCLKSR.DFLLRDY) in the Power and Clocks Status register is set, but the accuracy of the output frequency depends on which locks are set. For lock times, refer to the “Electrical Characteristics” on page 858.

## Frequency Error Measurement

The ratio between CLK\_DFLL48M\_REF and CLK48M\_DFLL is measured automatically when the DFLL48M is in closed-loop mode. The difference between this ratio and the value in DFLLMUL.MUL is stored in the DFLL

Multiplication Ratio Difference bit group(DFLLVAL.DIFF) in the DFLL Value register. The relative error on CLK\_DFLL48M compared to the target frequency is calculated as follows:

$$
E R R O R = \frac {D I F F}{M U L}
$$

## Drift Compensation

If the Stable DFLL Frequency bit (DFLLCTRL.STABLE) in the DFLL Control register is zero, the frequency tuner will automatically compensate for drift in the CLK\_DFLL48M without losing either of the locks. This means that DFLLVAL.FINE can change after every measurement of CLK\_DFLL48M.

The DFLLVAL.FINE value overflows or underflows can occur in close loop mode when the clock source reference drifts or is unstable. This will set the DFLL Out Of Bounds bit (PCLKSR.DFLLOOB) in the Power and Clocks Status register.

To avoid this error, the reference clock in close loop mode must be stable, an external oscillator is recommended and internal oscillator forbidden. The better choice is to use an XOSC32K.

## Reference Clock Stop Detection

If CLK\_DFLL48M\_REF stops or is running at a very low frequency (slower than CL $\mathsf { \backslash D F L L 4 8 M / ( 2 \cdot M U L _ { M A X } ) } )$ , the DFLL Reference Clock Stopped bit (PCLKSR.DFLLRCS) in the Power and Clocks Status register will be set. Detecting a stopped reference clock can take a long time, on the order of $2 ^ { 1 7 }$ CLK\_DFLL48M cycles. When the reference clock is stopped, the DFLL48M will operate as if in open-loop mode. Closed-loop mode operation will automatically resume if the CLK\_DFLL48M\_REF is restarted. An interrupt is generated on a zero-to-one transition on PCLKSR.DFLLRCS if the DFLL Reference Clock Stopped bit (INTENSET.DFLLRCS) in the Interrupt Enable Set register is set.

## 16.6.7.2 Additional Features

## Dealing with Delay in the DFLL in Closed-Loop Mode

The time from selecting a new CLK\_DFLL48M frequency until this frequency is output by the DFLL48M can be up to several microseconds. If the value in DFLLMUL.MUL is small, this can lead to instability in the DFLL48M locking mechanism, which can prevent the DFLL48M from achieving locks. To avoid this, a chill cycle, during which the CLK\_DFLL48M frequency is not measured, can be enabled. The chill cycle is enabled by default, but can be disabled by writing a one to the DFLL Chill Cycle Disable bit (DFLLCTRL.CCDIS) in the DFLL Control register. Enabling chill cycles might double the lock time.

Another solution to this problem consists of using less strict lock requirements. This is called Quick Lock (QL), which is also enabled by default, but it can be disabled by writing a one to the Quick Lock Disable bit (DFLLCTRL.QLDIS) in the DFLL Control register. The Quick Lock might lead to a larger spread in the output frequency than chill cycles, but the average output frequency is the same.

## USB Clock Recovery Mode

USB Clock Recovery mode can be used to create the 48MHz USB clock from the USB Start Of Frame (SOF). The mode is enabled by writing a one to the USB Clock Recovery Mode bit in DFLL Control register (DFLLCTRL.USBCRM).

The SOF signal from USB device will be used as reference clock (CLK\_DFLL\_REF), ignoring the selected generic clock reference. When the USB device is connected, a SOF will be sent every 1ms, thus DFLLVAL.MUX bits should be written to 0xBB80 to obtain a 48MHz clock. In USB clock recovery mode, the DFLLCTRL.BPLCKC bit state is ignored and the value stored in the DFLLVAL.COARSE will be used as COARSE final value. The lock procedure will also go instantaneously to the fine lock search. The COARSE calibration value can be loaded from NVM OTP row by software. DFLLCTRL.QLDIS bit must be cleared and DFLLCTRL.CCDIS should be set to speed up the lock phase. The DFLLCTRL.STABLE bit state is ignored to let an auto jitter reduction mechanism working instead.

## Wake from Sleep Modes

DFLL48M can optionally reset its lock bits when it is disabled. This is configured by the Lose Lock After Wake bit (DFLLCTRL.LLAW) in the DFLL Control register. If DFLLCTRL.LLAW is zero, the DFLL48M will be re-enabled and start running with the same configuration as before being disabled, even if the reference clock is not available. The locks will not be lost. When the reference clock has restarted, the Fine tracking will quickly compensate for any frequency drift during sleep if DFLLCTRL.STABLE is zero. If DFLLCTRL.LLAW is one when the DFLL is turned off, the DFLL48M will lose all its locks, and needs to regain these through the full lock sequence.

## Accuracy

There are three main factors that determine the accuracy of $\mathsf { F } _ { \mathsf { c l k d f l l 4 8 m } }$ . These can be tuned to obtain maximum accuracy when fine lock is achieved.

z Fine resolution: The frequency step between two Fine values. This is relatively smaller for high output frequencies.

Resolution of the measurement: If the resolution of the measured $\mathsf { F } _ { \mathsf { c l k d f l } \mathsf { 4 8 m } }$ is low, i.e., the ratio between the CLK\_DFLL48M frequency and the CLK\_DFLL48M\_REF frequency is small, then the DFLL48M might lock at a frequency that is lower than the targeted frequency. It is recommended to use a reference clock frequency of 32kHz or lower to avoid this issue for low target frequencies.

z The accuracy of the reference clock.

## 16.6.8 FDPLL96M – Fractional Digital Phase-Locked Loop Controller

## 16.6.8.1 Overview

The FDPLL96M controller allows flexible interface to the core digital function of the Digital Phase Locked Loop (DPLL). The FDPLL96M integrates a digital filter with a proportional integral controller, a Time-to-Digital Converter (TDC), a test mode controller, a Digitally Controlled Oscillator (DCO) and a PLL controller. It also provides a fractional multiplier of frequency N between the input and output frequency. The CLK\_FDPLL96M\_REF is the DPLL input clock reference. The selectable sources for the reference clock are CLK\_DPLL\_REF0, CLK\_DPLL\_REF1 and GCLK\_DPLL. The path between CLK\_DPLL\_REF1 and input multiplexer integrates a clock divider. The output clock of the FDPLL96M is CK\_GATED. The state of the CK\_GATED clock only depends on the FDPLL96M internal control of the final clock gater CG. A valid 32khz clock is required (GCLK\_DPLL\_32K clock) when the FDPLL96M internal lock timer is used.

## 16.6.8.2 Block Diagram

Figure 16-2. FDPLL96M Block Diagram.  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_442ff426610e5adf1a15254312224f5221fd1b7f1ab0afacbf9cb0523f54d4df.jpg)

## 16.6.8.3 Principle of Operation

The task of the FDPLL96M is to maintain coherence between the input reference clock signal

(CLK\_FDPLL96M\_REF) and the respective output frequency CK via phase comparison. The FDPLL96M supports three independent sources of clocks CLK\_DPLL\_REF0, CLK\_DPLL\_REF1 and GCLK\_DPLL. When the FDPLL96M is enabled, the relationship between the reference clock (CLK\_FDPLL96M\_REF) frequency and the output clock (CK\_GATED) frequency is defined below.

$$
f _ {c k \_ g a t e d} = f _ {c l k \_ f d p l l 9 6 m \_ r e f} \times \left(L D R + 1 + \frac {L D R F R A C}{1 6}\right)
$$

Where LDR is the loop divider ratio integer part, LDRFRAC is the loop divider ratio fractional part, $\mathsf { f } _ { \mathsf { c k r x } }$ is the frequency of the selected reference clock and $\mathsf { f } _ { \mathsf { c k } }$ is the frequency of the FDPLL96M output clock. As previously stated a clock divider exist between CLK\_DPLL\_REF1 and CLK\_FDPLL96M\_REF. The frequency between the two clocks is defined below.

$$
f _ {c l k \_ f d p l l 9 6 m \_ r e f} = f _ {c l k \_ d p l l \_ r e f 1} \times \left(\frac {1}{2 \times (D I V + 1)}\right)
$$

When the FDPLL96M is disabled, the output clock is reset. If the loop divider ratio fractional part (DPLLRATIO.LDRFRAC) field is reset, the FDPLL96M works in integer mode, otherwise the fractional mode is activated. It shall be noted that fractional part has a negative impact on the jitter of the FDPLL96M.

Example (integer mode only): assuming $\mathsf { f } _ { \mathtt { c k r } } = 3 2 \mathsf { k H z }$ and $\mathsf { f } _ { \mathtt { c k } } = 4 8 \mathsf { M H z } .$ , the multiplication ratio is 1500. It means that LDR shall be set to 1499.

Example (fractional mode): assuming $\mathsf { f } _ { \mathtt { c k r } } = 3 2$ kHz and $\mathsf { f } _ { \mathsf { c k } } = 4 8 . 0 0 6 \mathsf { M H } z$ , the multiplication ratio is 1500.1875 (1500 + 3/16). Thus LDR is set to 1499 and LDRFRAC to 3.

## 16.6.8.4 Initialization, Enabling, Disabling and Resetting

The FDPLL96M is enabled by writing a one to the Enable bit in the DPLL Control A register (DPLLCTRLA.ENABLE). The FDPLL96M is disabled by writing a zero to DPLLCTRLA.ENABLE. The frequency of the FDPLL96M output clock CK is stable when the module is enabled and when the DPLL Lock Status bit in the DPLL Status register (DPLLSTATUS.LOCK) bit is set. When DPLLCTRLB.LTIME is different from 0, a user defined lock time is used to validate the lock operation. In this case the lock time is constant. If DPLLCTRLB.LTIME is reset, the lock signal is linked with the status bit of the DPLL, the lock time vary depending on the filter selection and final target frequency.

When DPLLCTRLB.WUF is set, the wake up fast mode is activated. In that mode the clock gating cell is enabled at the end of the startup time. At that time, the final frequency is not stable as it is still in the acquisition period, but it allows to save several milliseconds. After first acquisition, DPLLCTRLB.LBYPASS indicates if the Lock signal is discarded from the control of the clock gater generating the output clock CK\_GATED.

Table 16-5. CK\_GATED behavior from startup to first edge detection.

<table><tr><td>WUF</td><td>LTIME</td><td>CK_GATED Behavior</td></tr><tr><td>0</td><td>0</td><td>Normal Mode: First Edge when lock is asserted</td></tr><tr><td>0</td><td>Not Equal To Zero</td><td>Lock Timer Timeout mode: First Edge when the timer downcounts to 0.</td></tr><tr><td>1</td><td>X</td><td>Wake Up Fast Mode: First Edge when CK is active (startup time)</td></tr></table>

Table 16-6. CK\_GATED behavior after First Edge detection.

<table><tr><td>LBYPASS</td><td>CK_GATED Behavior</td></tr><tr><td>0</td><td>Normal Mode: the CK_GATED is turned off when lock signal is low.</td></tr><tr><td>1</td><td>Lock Bypass Mode: the CK_GATED is always running, lock is irrelevant.</td></tr></table>

Figure 16-3. CK and CK\_GATED Output from FDPLL96M Off Mode to Running Mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_f02673fedf6a7913894b9f6e2516bab09b66cdb7c7069e4faf52b54e4a8f514d.jpg)

Figure 16-4. CK and CK\_GATED Output from FDPLL96M Off Mode to Running Mode when Wake-Up Fast is Activated  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_c7f177c6820d58fca11b0e799bb2540b2a006d650253c6ab9e777b7bfaf42a57.jpg)

Figure 16-5. CK and CK\_GATED Output from Running Mode to FDPLL96M Off Mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_e812c19e7510a1b8b0f7077732de00021107b616f7b314d0ab1b5ef447eb82d5.jpg)

## 16.6.8.5 Reference Clock Switching

When a software operation requires reference clock switching, the normal operation is to disable the FDPLL96M, modify the DPLLCTRLB.REFCLK to select the desired reference source and activate the FDPLL96M again.

## 16.6.8.6 Loop Divider Ratio updates

The FDPLL96M supports on-the-fly update of the DPLLRATIO register, so it is allowed to modify the loop divider ratio and the loop divider ratio fractional part when the FDPLL96M is enabled. At that time, the DPLLSTATUS.LOCK bit is cleared and set again by hardware when the output frequency reached a stable state. The DPLL Lock Fail bit in the Interrupt Flag Status and Clear register (INTFLAG.DPLLLCK) is set when a falling edge has been detected. The flag is cleared when the software write a one to the interrupt flag bit location.

Figure 16-6. RATIOCTRL Register Update Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_ede8861fba71c1201c7ee63205ba4529670cdd0a773c9da27be26b8f24eaa437.jpg)

## 16.6.8.7 Digital Filter Selection

The PLL digital filter (PI controller) is automatically adjusted in order to provide a good compromise between stability and jitter. Nevertheless a software operation can override the filter setting using the DPLLCTRLB.FILTER field. The DPLLCTRLB.LPEN field can be use to bypass the TDC module.

## 16.6.9 Brown-Out Detector Operation

The SYSCTRL provides user control to two Brown-Out Detectors (BOD) monitoring two supply domains. One BOD monitors the 3.3V VDDANA supply (BOD33), and a second BOD monitors the 1.2V VDDCORE supply (BOD12).

Both Brown-Out Detectors support continuous or sampling modes.

For each BOD, the threshold value action (reset the device or generate an interrupt), the Hysteresis configuration, as well as the enable/disable settings are loaded from Flash User Calibration at startup, and can be overridden by writing to the corresponding user register bit groups.

## 16.6.10 3.3V Brown-Out Detector Operation

The 3.3V BOD monitors the 3.3V VDDANA supply (BOD33). It supports continuous or sampling modes.

The threshold value action (reset the device or generate an interrupt), the Hysteresis configuration, as well as the enable/disable settings are loaded from Flash User Calibration at startup, and can be overridden by writing to the corresponding BOD33 register bit groups.

## 16.6.10.1 3.3V Brown-Out Detector (BOD33)

The 3.3V Brown-Out Detector (BOD33) monitors the VDDANA supply and compares the voltage with the brown-out threshold level set in the BOD33 Level bit group (BOD33.LEVEL) in the BOD33 register. The BOD33 can generate either an interrupt or a reset when VDDANA crosses below the brown-out threshold level. The BOD33 detection status can be read from the BOD33 Detection bit (PCLKSR.BOD33DET) in the Power and Clocks Status register.

At startup or at power-on reset (POR), the BOD33 register values are loaded from the Flash User Row. Refer to “NVM User Row Mapping” on page 23 for more details.

## 16.6.10.2 Continuous Mode

When the BOD33 Mode bit (BOD33.MODE) in the BOD33 register is written to zero and the BOD33 is enabled, the BOD33 operates in continuous mode. In this mode, the BOD33 is continuously monitoring the VDDANA supply voltage.

When the BOD12 Mode bit (BOD12.MODE) in the BOD12 register is written to zero and the BOD12 is enabled(BOD12.ENABLE is written to one), the BOD12 operates in continuous mode. In this mode, the BOD12 is continuously monitoring the VDDCORE supply voltage. Continues mode is not available for BOD12 when running in standby sleep mode.

Continuous mode is the default mode for both BOD12 and BOD33.

## 16.6.10.3 Sampling Mode

The sampling mode is a low-power mode where the BOD33 or BOD12 is being repeatedly enabled on a sampling clock’s ticks. The BOD33 or BOD12 will monitor the supply voltage for a short period of time and then go to a lowpower disabled state until the next sampling clock tick.

Sampling mode is enabled by writing one to BOD33.MODE for BOD33, and by writing one to BOD12.MODE for BOD12. The frequency of the clock ticks $( \mathsf { F _ { c l k s a m p l i n g } } )$ is controlled by the BOD33 Prescaler Select bit group (BOD33.PSEL) in the BOD33 register and Prescaler Select bit group(BOD12.PSEL) in the BOD12 BOD12 register for BOD33 and BOD12, respectively.

$$
F _ {c l k s a m p l i n g} = \frac {F _ {c l k p r e s c a l e r}}{2 ^ {(P S E L + 1)}}
$$

The prescaler signal $( \mathsf { F } _ { \mathsf { c l k p r e s c a l e r } } )$ is a 1kHz clock, output from the32kHz Ultra Low Power Oscillator, OSCULP32K.

As the sampling mode clock is different from the APB clock domain, synchronization among the clocks is necessary. Figure 16-7 shows a block diagram of the sampling mode. The BOD33 and BOD12 Synchronization Ready bits (PCLKSR.B33SRDY and PCLKSR.B12SRDY, respectively) in the Power and Clocks Status register show the synchronization ready status of the synchronizer. Writing attempts to the BOD33 register are ignored while PCLKSR.B33SRDY is zero. Writing attempts to the BOD12 register are ignored while PCLKSR.B12SRDY is zero.

Figure 16-7. Sampling Mode Block diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_01_adf04c12794cc982f098e0a01289c9f1aab9447d5cb5adf3a2e02809270d8f16.jpg)

The BOD33 Clock Enable bit (BOD33.CEN) in the BOD33 register and the BOD12 Clock Enable bit (BOD12.CEN) in the BOD12 register should always be disabled before changing the prescaler value. To change the prescaler value for the BOD33 or BOD12 during sampling mode, the following steps need to be taken:

1. Wait until the PCLKSR.B33SRDY bit or the PCLKSR.B12SRDY bit is set.

2. Write the selected value to the BOD33.PSEL or BOD12.PSEL bit group.

## 16.6.10.4 Hysteresis

The hysteresis functionality can be used in both continuous and sampling mode. Writing a one to the BOD33 Hysteresis bit (BOD33.HYST) in the BOD33 register will add hysteresis to the BOD33 threshold level. Writing a one to the BOD12 Hysteresis bit (BOD12.HYST) in the BOD12 register will add hysteresis to the BOD12 threshold level.

## 16.6.11 Voltage Regulator System Operation

The embedded Voltage Regulator (VREG) is an internal voltage regulator that provides the core logic supply (VDDCORE).

## 16.6.11.1 User Control of the Voltage Regulator System

The Voltage Regulator is enabled after any reset, and can be disabled by writing a zero to the Enable bit (VREG.ENABLE) of the VREG register.

The Voltage Regulator output supply level is determined by the LEVEL bit group (VREG.LEVEL) value in the VREG register. At reset, the VREG.LEVEL register value is loaded from Flash Factory Calibration.

Via the VDDCORE Monitoring bit group (VREG.VDDMON), it is possible to monitor the core supply voltage so that if it drops below a critical level, a power-on reset is applied. The device is allowed to restart executing code only after the core supply voltage is restored to an acceptable level. The threshold at which this system triggers is significantly lower than the 1.2V Brown-Out Detector's own threshold (BOD12). This can, therefore, be seen as a complementary voltage monitoring feature.

## 16.6.12 Voltage Reference System Operation

The Voltage Reference System (VREF) consists of a Bandgap Reference Voltage Generator and a temperature sensor.

The Bandgap Reference Voltage Generator is factory-calibrated under typical voltage and temperature conditions.

At reset, the VREF.CAL register value is loaded from Flash Factory Calibration.

The temperature sensor can be used to get an absolute temperature in the temperature range of CMIN to CMAX degrees Celsius. The sensor will output a linear voltage proportional to the temperature. The output voltage and temperature range are located in the “Electrical Characteristics” on page 858. To calculate the temperature from a measured voltage, the following formula can be used:

$$
C _ {M I N} + (V m e s - V o u t _ {M A X}) \frac {\Delta t e m p e r a t u r e}{\Delta v o l t a g e}
$$

## 16.6.12.1 User Control of the Voltage Reference System

To enable the temperature sensor, write a one the Temperature Sensor Enable bit (VREF.TSEN) in the VREF register.

The temperature sensor can be redirected to the ADC for conversion. The Bandgap Reference Voltage Generator output can also be routed to the ADC if the Bandgap Output Enable bit (VREF.BGOUTEN) in the VREF register is set. The Bandgap Reference Voltage Generator output level is determined by the CALIB bit group (VREF.CALIB) value in the VREF register.The default calibration value can be overridden by the user by writing to the CALIB bit group.

## 16.6.13 DMA Operation

Not applicable.

## 16.6.14 Interrupts

The SYSCTRL has the following interrupt sources:

z XOSCRDY - Multipurpose Crystal Oscillator Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 } ^ { \mathrm { \Pi } ^ { \mathrm { * } } }$ transition on the PCLKSR.XOSCRDY bit is detected

z XOSC32KRDY - 32kHz Crystal Oscillator Ready: $\mathsf { A } ^ { \mathrm { * } } 0 \mathrm { - } \mathsf { t } 0 \mathrm { - } 1 ^ { \mathrm { * } }$ transition on the PCLKSR.XOSC32KRDY bit is detected

z OSC32KRDY - 32kHz Internal Oscillator Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 } ^ { \mathrm { \Pi } ^ { \mathrm { * } } }$ transition on the PCLKSR.OSC32KRDY bit is detected

z OSC8MRDY - 8MHz Internal Oscillator Ready: $\mathsf { A } ^ { \mathrm { * } } 0 \mathrm { - } \mathsf { t } 0 \mathrm { - } 1 ^ { \mathrm { * } }$ transition on the PCLKSR.OSC8MRDY bit is detected

z DFLLRDY - DFLL48M Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 ^ { \mathrm { \Pi } ^ { \mathrm { * } } } }$ transition on the PCLKSR.DFLLRDY bit is detected

z DFLLOOB - DFLL48M Out Of Boundaries: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { s } } } 0 \mathrm { - } \mathsf { t } 0 \mathrm { - } 1 ^ { \mathrm { \Pi } ^ { \mathrm { s } } }$ transition on the PCLKSR.DFLLOOB bit is detected

z DFLLLOCKF - DFLL48M Fine Lock: $\mathsf { A } ^ { \ast } 0 – \mathsf { t } 0 – 1 ^ { \ast }$ transition on the PCLKSR.DFLLLOCKF bit is detected

z DFLLLOCKC - DFLL48M Coarse Lock: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { s } } } 0 \mathrm { - } \mathsf { t } 0 \mathrm { - } 1 ^ { \mathrm { \Pi } ^ { \mathrm { s } } }$ transition on the PCLKSR.DFLLLOCKC bit is detected

z DFLLRCS - DFLL48M Reference Clock has Stopped: $\mathsf { A } ^ { \mathrm { * } } 0 \mathrm { - } \mathsf { t } 0 \mathrm { - } 1 ^ { \mathrm { * } }$ transition on the PCLKSR.DFLLRCS bit is detected

z BOD33RDY - BOD33 Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 ^ { \mathrm { \Pi } ^ { \mathrm { * } } } }$ transition on the PCLKSR.BOD33RDY bit is detected

z BOD33DET - BOD33 Detection: $\mathsf { A } ^ { \ast } 0 – \mathsf { t } 0 – 1 ^ { \ast }$ transition on the PCLKSR.BOD33DET bit is detected

z B33SRDY - BOD33 Synchronization Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 } ^ { \mathrm { \Pi } ^ { \mathrm { * } } }$ transition on the PCLKSR.B33SRDY bit is detected

z BOD12RDY - BOD12 Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 ^ { \mathrm { \Pi } ^ { \mathrm { * } } } }$ transition on the PCLKSR.BOD12RDY bit is detected

z BOD12DET - BOD12 Detection: $\mathsf { A } ^ { \ast } 0 – \mathsf { t } 0 – 1 ^ { \ast }$ transition on the PCLKSR.BOD12DET bit is detected

z B12SRDY - BOD12 Synchronization Ready: $\mathsf { A } ^ { \mathrm { \Pi } ^ { \mathrm { * } } 0 - \mathsf { t } 0 - 1 } ^ { \mathrm { \Pi } ^ { \mathrm { * } } }$ transition on the PCLKSR.B12SRDY bit is detected

z PLL Lock (LOCK): Indicates that the DPLL Lock bit is asserted.

z PLL Lock Lost (LOCKL): Indicates that a falling edge has been detected on the Lock bit during normal operation mode.

z PLL Lock Timer Timeout (LTTO): This interrupt flag indicates that the software defined time DPLLCTRLB.LTIME has elapsed since the start of the FDPLL96M.

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear (INTFLAG) register is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set (INTENSET) register, and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear (INTENCLR) register. An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled, or the SYSCTRL is reset. See Interrupt Flag Status and Clear (INTFLAG) register for details on how to clear interrupt flags.

All interrupt requests from the peripheral are ORed together on system level to generate one combined interrupt request to the NVIC. Refer to “Nested Vector Interrupt Controller” on page 26 for details. The user must read the INTFLAG register to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 16.6.15 Synchronization

Due to the multiple clock domains, values in the DFLL48M control registers need to be synchronized to other clock domains. The status of this synchronization can be read from the Power and Clocks Status register (PCLKSR). Before writing to any of the DFLL48M control registers, the user must check that the DFLL Ready bit (PCLKSR.DFLLRDY) in PCLKSR is set to one. When this bit is set, the DFLL48M can be configured and CLK\_DFLL48M is ready to be used. Any write to any of the DFLL48M control registers while DFLLRDY is zero will be ignored. An interrupt is generated on a zero-to-one transition of DFLLRDY if the DFLLRDY bit (INTENSET.DFLLDY) in the Interrupt Enable Set register is set.

In order to read from any of the DFLL48M configuration registers, the user must request a read synchronization by writing a one to DFLLSYNC.READREQ. The registers can be read only when PCLKSR.DFLLRDY is set. If

DFLLSYNC.READREQ is not written before a read, a synchronization will be started, and the bus will be halted until the synchronization is complete. Reading the DFLL48M registers when the DFLL48M is disabled will not halt the bus.

If the bus does not support waiting, a one must be written to the READREQ bit in the DFLL Synchronization register (DFLLSYNC.READREQ) before reading the value of a DFLL core register. The DFLL control registers are ready to be read when PCLKSR.DFLLRDY is set. If the bus does support waiting, this method can still be used to save time, but it would then also be possible to simply read the register directly. In this case, the bus will be halted until the synchronization has completed.

The prescaler counter used to trigger one-shot brown-out detections also operates asynchronously from the peripheral bus. As a consequence, the prescaler registers require synchronization when written or read. The synchronization results in a delay from when the initialization of the write or read operation begins until the operation is complete.

The write-synchronization is triggered by a write to the BOD12 or BOD33 control register. The Synchronization Ready bit (PCLKSR.B12SRDY or PCLKSR.B33SRDY) in the PCLKSR register will be cleared when the write synchronization starts and set when the write-synchronization is complete. When the write-synchronization is ongoing (PCLKSR.B33SRDY or PCLKSR.B12SRDY is zero), an attempt to do any of the following will cause the peripheral bus to stall until the synchronization is complete:

Writing to the BOD33 or BOD12 control register

Reading the BOD33 or BOD12 control register that was written

The user can either poll PCLKSR.B12SRDY or PCLKSR.B33SRDY or use the INTENSET.B12SRDY or INTENSET.B33SRDY interrupts to check when the synchronization is complete. It is also possible to perform the next read/write operation and wait, as this next operation will be completed after the ongoing read/write operation is synchronized.

## 16.7 Register Summary

Table 16-7. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">INTENCLR</td><td>7:0</td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>0x01</td><td>15:8</td><td>DPLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>0x02</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLTO</td><td>DPLLCKF</td></tr><tr><td>0x03</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="4">INTENSET</td><td>7:0</td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>0x05</td><td>15:8</td><td>DPLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLTO</td><td>DPLLCKF</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td rowspan="4">INTFLAG</td><td>7:0</td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>0x09</td><td>15:8</td><td>DPLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>0x0A</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLTO</td><td>DPLLCKF</td></tr><tr><td>0x0B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td rowspan="4">PCLKSR</td><td>7:0</td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>0x0D</td><td>15:8</td><td>DPLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>0x0E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLTO</td><td>DPLLCKF</td></tr><tr><td>0x0F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="2">XOSC</td><td>7:0</td><td>ONDEMAND</td><td>RUNSTDBY</td><td></td><td></td><td></td><td>XTALEN</td><td>ENABLE</td><td></td></tr><tr><td>0x11</td><td>15:8</td><td colspan="4">STARTUP[3:0]</td><td>AMPGC</td><td colspan="3">GAIN[2:0]</td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="2">XOSC32K</td><td>7:0</td><td>ONDEMAND</td><td>RUNSTDBY</td><td>AAMPEN</td><td>EN1K</td><td>EN32K</td><td>XTALEN</td><td>ENABLE</td><td></td></tr><tr><td>0x15</td><td>15:8</td><td></td><td></td><td></td><td>WRTLOCK</td><td></td><td colspan="3">STARTUP[2:0]</td></tr><tr><td>0x16</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">OSC32K</td><td>7:0</td><td>ONDEMAND</td><td>RUNSTDBY</td><td></td><td></td><td>EN1K</td><td>EN32K</td><td>ENABLE</td><td></td></tr><tr><td>0x19</td><td>15:8</td><td></td><td></td><td></td><td>WRTLOCK</td><td></td><td colspan="3">STARTUP[2:0]</td></tr><tr><td>0x1A</td><td>23:16</td><td></td><td colspan="7">CALIB[6:0]</td></tr><tr><td>0x1B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td>OSCULP32K</td><td>7:0</td><td>WRTLOCK</td><td></td><td></td><td colspan="5">CALIB[4:0]</td></tr><tr><td>0x1D ... 0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="4">OSC8M</td><td>7:0</td><td>ONDEMAND</td><td>RUNSTDBY</td><td></td><td></td><td></td><td></td><td>ENABLE</td><td></td></tr><tr><td>0x21</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">PRESC[1:0]</td></tr><tr><td>0x22</td><td>23:16</td><td colspan="8">CALIB[7:0]</td></tr><tr><td>0x23</td><td>31:24</td><td colspan="2">FRANGE[1:0]</td><td></td><td></td><td colspan="4">CALIB[11:8]</td></tr><tr><td>0x24</td><td rowspan="2">DFLLCTRL</td><td>7:0</td><td>ONDEMAND</td><td></td><td>USBCRM</td><td>LLAW</td><td>STABLE</td><td>MODE</td><td>ENABLE</td><td></td></tr><tr><td>0x25</td><td>15:8</td><td></td><td></td><td></td><td></td><td>WAITLOCK</td><td>BPLCKC</td><td>QLDIS</td><td>CCDIS</td></tr><tr><td>0x26</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x27</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x28</td><td rowspan="4">DFLLVAL</td><td>7:0</td><td colspan="8">FINE[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td colspan="6">COARSE[5:0]</td><td colspan="2">FINE[9:8]</td></tr><tr><td>0x2A</td><td>23:16</td><td colspan="8">DIFF[7:0]</td></tr><tr><td>0x2B</td><td>31:24</td><td colspan="8">DIFF[15:8]</td></tr><tr><td>0x2C</td><td rowspan="4">DFLLMUL</td><td>7:0</td><td colspan="8">MUL[7:0]</td></tr><tr><td>0x2D</td><td>15:8</td><td colspan="8">MUL[15:8]</td></tr><tr><td>0x2E</td><td>23:16</td><td colspan="8">FSTEP[7:0]</td></tr><tr><td>0x2F</td><td>31:24</td><td colspan="6">CSTEP[5:0]</td><td colspan="2">FSTEP[9:8]</td></tr><tr><td>0x30</td><td>DFLLSYNC</td><td>7:0</td><td>READREQ</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x31 ... 0x33</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x34</td><td rowspan="4">BOD33</td><td>7:0</td><td></td><td>RUNSTDBY</td><td></td><td colspan="2">ACTION[1:0]</td><td>HYST</td><td>ENABLE</td><td></td></tr><tr><td>0x35</td><td>15:8</td><td colspan="4">PSEL[3:0]</td><td></td><td></td><td>CEN</td><td>MODE</td></tr><tr><td>0x36</td><td>23:16</td><td></td><td></td><td colspan="6">LEVEL[5:0]</td></tr><tr><td>0x37</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x38 ... 0x3F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x40</td><td rowspan="4">VREF</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>BGOUTEN</td><td>TSEN</td><td></td></tr><tr><td>0x41</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x42</td><td>23:16</td><td colspan="8">CALIB[7:0]</td></tr><tr><td>0x43</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">CALIB[10:8]</td></tr><tr><td>0x44</td><td>DPLLCTRLA</td><td>7:0</td><td>ONDEMAND</td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td></td></tr><tr><td>0x45 ... 0x47</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x48</td><td rowspan="4">DPLLRATIO</td><td>7:0</td><td colspan="8">LDR[7:0]</td></tr><tr><td>0x49</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">LDR[11:8]</td></tr><tr><td>0x4A</td><td>23:16</td><td></td><td></td><td></td><td></td><td colspan="4">LDRFRAC[3:0]</td></tr><tr><td>0x4B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x4C</td><td rowspan="4">DPLLCTRLB</td><td>7:0</td><td></td><td></td><td colspan="2">REFCLK[1:0]</td><td>WUF</td><td>LPEN</td><td colspan="2">FILTER[1:0]</td></tr><tr><td>0x4D</td><td>15:8</td><td></td><td></td><td></td><td>LBYPASS</td><td></td><td colspan="3">LTIME[2:0]</td></tr><tr><td>0x4E</td><td>23:16</td><td colspan="8">DIV[7:0]</td></tr><tr><td>0x4F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">DIV[10:8]</td></tr><tr><td>0x50</td><td>DPLLSTATUS</td><td>7:0</td><td></td><td></td><td></td><td></td><td>DIV</td><td>ENABLE</td><td>CLKRDY</td><td>LOCK</td></tr></table>

## 16.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 148 and the “PAC – Peripheral Access Controller” on page 30 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Synchronized property in each individual register description. Refer to “Synchronization” on page 161 for details.

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLLTO</td><td>DPLLLCKF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>DPLLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## 16.8.1 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x00

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 31:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 17 – DPLLLTO: DPLL Lock Timeout Interrupt Enable

0: The DPLL Lock Timeout interrupt is disabled.

1: The DPLL Lock Timeout interrupt is enabled, and an interrupt request will be generated when the DPLL Lock Timeout Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DPLL Lock Timeout Interrupt Enable bit, which disables the DPLL Lock Timeout interrupt.

## Bit 16 – DPLLLCKF: DPLL Lock Fall Interrupt Enable

0: The DPLL Lock Fall interrupt is disabled.

1: The DPLL Lock Fall interrupt is enabled, and an interrupt request will be generated when the DPLL Lock Fall Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DPLL Lock Fall Interrupt Enable bit, which disables the DPLL Lock Fall interrupt.

## z Bit 15 – DPLLLCKR: DPLL Lock Rise Interrupt Enable

0: The DPLL Lock Rise interrupt is disabled.

1: The DPLL Lock Rise interrupt is enabled, and an interrupt request will be generated when the DPLL Lock Rise Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DPLL Lock Rise Interrupt Enable bit, which disables the DPLL Lock Rise interrupt.

## Bits 14:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 11 – B33SRDY: BOD33 Synchronization Ready Interrupt Enable

0: The BOD33 Synchronization Ready interrupt is disabled.

1: The BOD33 Synchronization Ready interrupt is enabled, and an interrupt request will be generated when the BOD33 Synchronization Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the BOD33 Synchronization Ready Interrupt Enable bit, which disables the BOD33 Synchronization Ready interrupt.

## z Bit 10 – BOD33DET: BOD33 Detection Interrupt Enable

0: The BOD33 Detection interrupt is disabled.

1: The BOD33 Detection interrupt is enabled, and an interrupt request will be generated when the BOD33 Detection Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the BOD33 Detection Interrupt Enable bit, which disables the BOD33 Detection interrupt.

## z Bit 9 – BOD33RDY: BOD33 Ready Interrupt Enable

0: The BOD33 Ready interrupt is disabled.

1: The BOD33 Ready interrupt is enabled, and an interrupt request will be generated when the BOD33 Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the BOD33 Ready Interrupt Enable bit, which disables the BOD33 Ready interrupt.

## z Bit 8 – DFLLRCS: DFLL Reference Clock Stopped Interrupt Enable

0: The DFLL Reference Clock Stopped interrupt is disabled.

1: The DFLL Reference Clock Stopped interrupt is enabled, and an interrupt request will be generated when the DFLL Reference Clock Stopped Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DFLL Reference Clock Stopped Interrupt Enable bit, which disables the DFLL Reference Clock Stopped interrupt.

## Bit 7 – DFLLLCKC: DFLL Lock Coarse Interrupt Enable

0: The DFLL Lock Coarse interrupt is disabled.

1: The DFLL Lock Coarse interrupt is enabled, and an interrupt request will be generated when the DFLL Lock Coarse Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DFLL Lock Coarse Interrupt Enable bit, which disables the DFLL Lock Coarse interrupt.

## z Bit 6 – DFLLLCKF: DFLL Lock Fine Interrupt Enable

0: The DFLL Lock Fine interrupt is disabled.

1: The DFLL Lock Fine interrupt is enabled, and an interrupt request will be generated when the DFLL Lock Fine Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DFLL Lock Fine Interrupt Enable bit, which disables the DFLL Lock Fine interrupt.

## z Bit 5 – DFLLOOB: DFLL Out Of Bounds Interrupt Enable

0: The DFLL Out Of Bounds interrupt is disabled.

1: The DFLL Out Of Bounds interrupt is enabled, and an interrupt request will be generated when the DFLL Out Of Bounds Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DFLL Out Of Bounds Interrupt Enable bit, which disables the DFLL Out Of Bounds interrupt.

## z Bit 4 – DFLLRDY: DFLL Ready Interrupt Enable

0: The DFLL Ready interrupt is disabled.

1: The DFLL Ready interrupt is enabled, and an interrupt request will be generated when the DFLL Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the DFLL Ready Interrupt Enable bit, which disables the DFLL Ready interrupt.

## Bit 3 – OSC8MRDY: OSC8M Ready Interrupt Enable

0: The OSC8M Ready interrupt is disabled.

1: The OSC8M Ready interrupt is enabled, and an interrupt request will be generated when the OSC8M Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the OSC8M Ready Interrupt Enable bit, which disables the OSC8M Ready interrupt.

## ● Bit 2 – OSC32KRDY: OSC32K Ready Interrupt Enable

0: The OSC32K Ready interrupt is disabled.

1: The OSC32K Ready interrupt is enabled, and an interrupt request will be generated when the OSC32K Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the OSC32K Ready Interrupt Enable bit, which disables the OSC32K Ready interrupt.

## ● Bit 1 – XOSC32KRDY: XOSC32K Ready Interrupt Enable

0: The XOSC32K Ready interrupt is disabled.

1: The XOSC32K Ready interrupt is enabled, and an interrupt request will be generated when the XOSC32K Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the XOSC32K Ready Interrupt Enable bit, which disables the XOSC32K Ready interrupt.

## z Bit 0 – XOSCRDY: XOSC Ready Interrupt Enable

0: The XOSC Ready interrupt is disabled.

1: The XOSC Ready interrupt is enabled, and an interrupt request will be generated when the XOSC Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the XOSC Ready Interrupt Enable bit, which disables the XOSC Ready interrupt.

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLLTO</td><td>DPLLLCKF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>DPLLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## 16.8.2 Interrupt Enable Set

Name: INTENSET

Offset: 0x04

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 31:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 17 – DPLLLTO: DPLL Lock Timeout Interrupt Enable

0: The DPLL Lock Timeout interrupt is disabled.

1: The DPLL Lock Timeout interrupt is enabled, and an interrupt request will be generated when the DPLL Lock Timeout Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DPLL Lock Timeout Interrupt Enable bit, which enables the DPLL Lock Timeout interrupt.

## Bit 16 – DPLLLCKF: DPLL Lock Fall Interrupt Enable

0: The DPLL Lock Fall interrupt is disabled.

1: The DPLL Lock Fall interrupt is enabled, and an interrupt request will be generated when the DPLL Lock Fall Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DPLL Lock Fall Interrupt Enable bit, which enables the DPLL Lock Fall interrupt.

## ● Bit 15 – DPLLLCKR: DPLL Lock Rise Interrupt Enable

0: The DPLL Lock Rise interrupt is disabled.

1: The DPLL Lock Rise interrupt is enabled, and an interrupt request will be generated when the DPLL Lock Rise Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DPLL Lock Rise Interrupt Enable bit, which enables the DPLL Lock Rise interrupt.

## Bits 14:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 11 – B33SRDY: BOD33 Synchronization Ready Interrupt Enable

0: The BOD33 Synchronization Ready interrupt is disabled.

1: The BOD33 Synchronization Ready interrupt is enabled, and an interrupt request will be generated when the BOD33 Synchronization Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the BOD33 Synchronization Ready Interrupt Enable bit, which enables the BOD33 Synchronization Ready interrupt.

## Bit 10 – BOD33DET: BOD33 Detection Interrupt Enable

0: The BOD33 Detection interrupt is disabled.

1: The BOD33 Detection interrupt is enabled, and an interrupt request will be generated when the BOD33 Detection Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the BOD33 Detection Interrupt Enable bit, which enables the BOD33 Detection interrupt.

## z Bit 9 – BOD33RDY: BOD33 Ready Interrupt Enable

0: The BOD33 Ready interrupt is disabled.

1: The BOD33 Ready interrupt is enabled, and an interrupt request will be generated when the BOD33 Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the BOD33 Ready Interrupt Enable bit, which enables the BOD33 Ready interrupt.

## z Bit 8 – DFLLRCS: DFLL Reference Clock Stopped Interrupt Enable

0: The DFLL Reference Clock Stopped interrupt is disabled.

1: The DFLL Reference Clock Stopped interrupt is enabled, and an interrupt request will be generated when the DFLL Reference Clock Stopped Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DFLL Reference Clock Stopped Interrupt Enable bit, which enables the DFLL Reference Clock Stopped interrupt.

## ● Bit 7 – DFLLLCKC: DFLL Lock Coarse Interrupt Enable

0: The DFLL Lock Coarse interrupt is disabled.

1: The DFLL Lock Coarse interrupt is enabled, and an interrupt request will be generated when the DFLL Lock Coarse Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DFLL Lock Coarse Interrupt Enable bit, which enables the DFLL Lock Coarse interrupt.

## z Bit 6 – DFLLLCKF: DFLL Lock Fine Interrupt Enable

0: The DFLL Lock Fine interrupt is disabled.

1: The DFLL Lock Fine interrupt is enabled, and an interrupt request will be generated when the DFLL Lock Fine Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DFLL Lock Fine Interrupt Disable/Enable bit, disable the DFLL Lock Fine interrupt and set the corresponding interrupt request.

## z Bit 5 – DFLLOOB: DFLL Out Of Bounds Interrupt Enable

0: The DFLL Out Of Bounds interrupt is disabled.

1: The DFLL Out Of Bounds interrupt is enabled, and an interrupt request will be generated when the DFLL Out Of Bounds Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DFLL Out Of Bounds Interrupt Enable bit, which enables the DFLL Out Of Bounds interrupt.

## ● Bit 4 – DFLLRDY: DFLL Ready Interrupt Enable

0: The DFLL Ready interrupt is disabled.

1: The DFLL Ready interrupt is enabled, and an interrupt request will be generated when the DFLL Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the DFLL Ready Interrupt Enable bit, which enables the DFLL Ready interrupt and set the corresponding interrupt request.

## ● Bit 3 – OSC8MRDY: OSC8M Ready Interrupt Enable

0: The OSC8M Ready interrupt is disabled.

1: The OSC8M Ready interrupt is enabled, and an interrupt request will be generated when the OSC8M Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the OSC8M Ready Interrupt Enable bit, which enables the OSC8M Ready interrupt.

## ● Bit 2 – OSC32KRDY: OSC32K Ready Interrupt Enable

0: The OSC32K Ready interrupt is disabled.

1: The OSC32K Ready interrupt is enabled, and an interrupt request will be generated when the OSC32K Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the OSC32K Ready Interrupt Enable bit, which enables the OSC32K Ready interrupt.

## Bit 1 – XOSC32KRDY: XOSC32K Ready Interrupt Enable

0: The XOSC32K Ready interrupt is disabled.

1: The XOSC32K Ready interrupt is enabled, and an interrupt request will be generated when the XOSC32K Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the XOSC32K Ready Interrupt Enable bit, which enables the XOSC32K Ready interrupt.

## z Bit 0 – XOSCRDY: XOSC Ready Interrupt Enable

0: The XOSC Ready interrupt is disabled.

1: The XOSC Ready interrupt is enabled, and an interrupt request will be generated when the XOSC Ready Interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the XOSC Ready Interrupt Enable bit, which enables the XOSC Ready interrupt.

## 16.8.3 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x08

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLLTO</td><td>DPLLLCKF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>DPLLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Note: Depending on the fuse settings, various bits of the INTFLAG register can be set to one at startup. Therefore the user should clear those bits before using the corresponding interrupts.

## z Bits 31:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 17 – DPLLLTO: DPLL Lock Timeout

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DPLL Lock Timeout bit in the Status register (PCLKSR.DPLLLTO) and will generate an interrupt request if INTENSET.DPLLLTO is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DPLL Lock Timeout interrupt flag.

## z Bit 16 – DPLLLCKF: DPLL Lock Fall

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DPLL Lock Fall bit in the Status register (PCLKSR.DPLLLCKF) and will generate an interrupt request if INTENSET.DPLLLCKF is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DPLL Lock Fall interrupt flag.

## z Bit 15 – DPLLLCKR: DPLL Lock Rise

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DPLL Lock Rise bit in the Status register (PCLKSR.DPLLLCKR) and will generate an interrupt request if INTENSET.DPLLLCKR is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DPLL Lock Rise interrupt flag.

## Bits 14:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 11 – B33SRDY: BOD33 Synchronization Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the BOD33 Synchronization Ready bit in the Status register (PCLKSR.B33SRDY) and will generate an interrupt request if INTENSET.B33SRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the BOD33 Synchronization Ready interrupt flag

## ● Bit 10 – BOD33DET: BOD33 Detection

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the BOD33 Detection bit in the Status register (PCLKSR.BOD33DET) and will generate an interrupt request if INTENSET.BOD33DET is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the BOD33 Detection interrupt flag.

## z Bit 9 – BOD33RDY: BOD33 Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the BOD33 Ready bit in the Status register (PCLKSR.BOD33RDY) and will generate an interrupt request if INTENSET.BOD33RDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the BOD33 Ready interrupt flag.

## Bit 8 – DFLLRCS: DFLL Reference Clock Stopped

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DFLL Reference Clock Stopped bit in the Status register (PCLKSR.DFLLRCS) and will generate an interrupt request if INTENSET.DFLLRCS is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DFLL Reference Clock Stopped interrupt flag.

## z Bit 7 – DFLLLCKC: DFLL Lock Coarse

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DFLL Lock Coarse bit in the Status register (PCLKSR.DFLLL-CKC) and will generate an interrupt request if INTENSET.DFLLLCKC is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DFLL Lock Coarse interrupt flag.

## z Bit 6 – DFLLLCKF: DFLL Lock Fine

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DFLL Lock Fine bit in the Status register (PCLKSR.DFLLLCKF) and will generate an interrupt request if INTENSET.DFLLLCKF is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DFLL Lock Fine interrupt flag.

## z Bit 5 – DFLLOOB: DFLL Out Of Bounds

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DFLL Out Of Bounds bit in the Status register (PCLKSR.DFL-LOOB) and will generate an interrupt request if INTENSET.DFLLOOB is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DFLL Out Of Bounds interrupt flag.

## z Bit 4 – DFLLRDY: DFLL Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the DFLL Ready bit in the Status register (PCLKSR.DFLLRDY) and will generate an interrupt request if INTENSET.DFLLRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the DFLL Ready interrupt flag.

## ● Bit 3 – OSC8MRDY: OSC8M Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the OSC8M Ready bit in the Status register (PCLKSR.OSC8MRDY) and will generate an interrupt request if INTENSET.OSC8MRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the OSC8M Ready interrupt flag.

## z Bit 2 – OSC32KRDY: OSC32K Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the OSC32K Ready bit in the Status register (PCLKSR.OSC32KRDY) and will generate an interrupt request if INTENSET.OSC32KRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the OSC32K Ready interrupt flag.

## ● Bit 1 – XOSC32KRDY: XOSC32K Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the XOSC32K Ready bit in the Status register

(PCLKSR.XOSC32KRDY) and will generate an interrupt request if INTENSET.XOSC32KRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the XOSC32K Ready interrupt flag.

## z Bit 0 – XOSCRDY: XOSC Ready

This flag is cleared by writing a one to it.

This flag is set on a zero-to-one transition of the XOSC Ready bit in the Status register (PCLKSR.XOSCRDY) and will generate an interrupt request if INTENSET.XOSCRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the XOSC Ready interrupt flag.

## 16.8.4 Power and Clocks Status

Name: PCLKSR

Offset: 0x0C

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DPLLLTO</td><td>DPLLLCKF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>DPLLLCKR</td><td></td><td></td><td></td><td>B33SRDY</td><td>BOD33DET</td><td>BOD33RDY</td><td>DFLLRCS</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>DFLLLCKC</td><td>DFLLLCKF</td><td>DFLLOOB</td><td>DFLLRDY</td><td>OSC8MRDY</td><td>OSC32KRDY</td><td>XOSC32KRDY</td><td>XOSCRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 17 – DPLLLTO: DPLL Lock Timeout

0: DPLL Lock time-out not detected.

1: DPLL Lock time-out detected.

● Bit 16 – DPLLLCKF: DPLL Lock Fall

0: DPLL Lock fall edge not detected.

1: DPLL Lock fall edge detected.

z Bit 15 – DPLLLCKR: DPLL Lock Rise

0: DPLL Lock rise edge not detected.

1: DPLL Lock fall edge detected.

## z Bits 14:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 11 – B33SRDY: BOD33 Synchronization Ready

0: BOD33 synchronization is complete.

1: BOD33 synchronization is ongoing.

## z Bit 10 – BOD33DET: BOD33 Detection

0: No BOD33 detection.

1: BOD33 has detected that the I/O power supply is going below the BOD33 reference value.

## Bit 9 – BOD33RDY: BOD33 Ready

0: BOD33 is not ready.

1: BOD33 is ready.

## z Bit 8 – DFLLRCS: DFLL Reference Clock Stopped

0: DFLL reference clock is running.

1: DFLL reference clock has stopped.

## z Bit 7 – DFLLLCKC: DFLL Lock Coarse

0: No DFLL coarse lock detected.

1: DFLL coarse lock detected.

## z Bit 6 – DFLLLCKF: DFLL Lock Fine

0: No DFLL fine lock detected.

1: DFLL fine lock detected.

## ● Bit 5 – DFLLOOB: DFLL Out Of Bounds

0: No DFLL Out Of Bounds detected.

1: DFLL Out Of Bounds detected.

## Bit 4 – DFLLRDY: DFLL Ready

0: The Synchronization is ongoing.

1: The Synchronization is complete.

This bit is cleared when the synchronization of registers between clock domains is complete.

This bit is set when the synchronization of registers between clock domains is started.

## z Bit 3 – OSC8MRDY: OSC8M Ready

0: OSC8M is not ready.

1: OSC8M is stable and ready to be used as a clock source.

## z Bit 2 – OSC32KRDY: OSC32K Ready

0: OSC32K is not ready.

1: OSC32K is stable and ready to be used as a clock source.

## z Bit 1 – XOSC32KRDY: XOSC32K Ready

0: XOSC32K is not ready.

1: XOSC32K is stable and ready to be used as a clock source.

## z Bit 0 – XOSCRDY: XOSC Ready

0: XOSC is not ready.

1: XOSC is stable and ready to be used as a clock source.

## 16.8.5 External Multipurpose Crystal Oscillator (XOSC) Control

Name: XOSC

Offset: 0x10

Reset: 0x0080

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="4">STARTUP[3:0]</td><td>AMPGC</td><td colspan="3">GAIN[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ONDEMAND</td><td>RUNSTDBY</td><td></td><td></td><td></td><td>XTALEN</td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:12 – STARTUP[3:0]: Start-Up Time

These bits select start-up time for the oscillator according to the table below. The OSCULP32K oscillator is used to clock the start-up counter.

Table 16-8. Start-UpTime for External Multipurpose Crystal Oscillator

<table><tr><td>STARTUP[3:0]</td><td>Number of OSCULP32K Clock Cycles</td><td>Number of XOSC Clock Cycles</td><td>Approximate Equivalent Time(1)(2)(3)</td></tr><tr><td>0x0</td><td>1</td><td>3</td><td>31μs</td></tr><tr><td>0x1</td><td>2</td><td>3</td><td>61μs</td></tr><tr><td>0x2</td><td>4</td><td>3</td><td>122μs</td></tr><tr><td>0x3</td><td>8</td><td>3</td><td>244μs</td></tr><tr><td>0x4</td><td>16</td><td>3</td><td>488μs</td></tr><tr><td>0x5</td><td>32</td><td>3</td><td>977μs</td></tr><tr><td>0x6</td><td>64</td><td>3</td><td>1953μs</td></tr><tr><td>0x7</td><td>128</td><td>3</td><td>3906μs</td></tr><tr><td>0x8</td><td>256</td><td>3</td><td>7813μs</td></tr><tr><td>0x9</td><td>512</td><td>3</td><td>15625μs</td></tr><tr><td>0xA</td><td>1024</td><td>3</td><td>31250μs</td></tr><tr><td>0xB</td><td>2048</td><td>3</td><td>62500μs</td></tr><tr><td>0xC</td><td>4096</td><td>3</td><td>125000μs</td></tr><tr><td>0xD</td><td>8192</td><td>3</td><td>250000μs</td></tr><tr><td>0xE</td><td>16384</td><td>3</td><td>500000μs</td></tr><tr><td>0xF</td><td>32768</td><td>3</td><td>1000000μs</td></tr></table>

Notes: 1. Number of cycles for the start-up counter  
2. Number of cycles for the synchronization delay, before PCLKSR.XOSCRDY is set.  
3. Actual start-up time is n OSCULP32K cycles + 3 XOSC cycles, but given the time neglects the 3 XOSC cycles.

## z Bit 11 – AMPGC: Automatic Amplitude Gain Control

0: The automatic amplitude gain control is disabled.

1: The automatic amplitude gain control is enabled. Amplitude gain will be automatically adjusted during Crystal Oscillator operation.

## z Bits 10:8 – GAIN[2:0]: Oscillator Gain

These bits select the gain for the oscillator. The listed maximum frequencies are recommendations, and might vary based on capacitive load and crystal characteristics. Setting this bit group has no effect when the Automatic Ampli tude Gain Control is active.

Table 16-9. Oscillator Gain

<table><tr><td>GAIN[2:0]</td><td>Name</td><td>Recommended Max Frequency</td></tr><tr><td>0x0</td><td>0</td><td>2MHz</td></tr><tr><td>0x1</td><td>1</td><td>4MHz</td></tr><tr><td>0x2</td><td>2</td><td>8MHz</td></tr><tr><td>0x3</td><td>3</td><td>16MHz</td></tr><tr><td>0x4</td><td>4</td><td>30MHz</td></tr><tr><td>0x5-0x7</td><td></td><td>Reserved</td></tr></table>

## ● Bit 7 – ONDEMAND: On Demand Contro

The On Demand operation mode allows an oscillator to be enabled or disabled, depending on peripheral clock requests.

In On Demand operation mode, i.e., if the XOSC.ONDEMAND bit has been previously written to one, the oscillator will be running only when requested by a peripheral. If there is no peripheral requesting the oscillator s clock source, the oscillator will be in a disabled state.

If On Demand is disabled, the oscillator will always be running when enabled.

In standby sleep mode, the On Demand operation is still active if the XOSC.RUNSTDBY bit is one. If

XOSC.RUNSTDBY is zero, the oscillator is disabled.

0: The oscillator is always on, if enabled.

1: The oscillator is enabled when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is disabled if no peripheral is requesting the clock source.

## z Bit 6 – RUNSTDBY: Run in Standby

This bit controls how the XOSC behaves during standby sleep mode:

0: The oscillator is disabled in standby sleep mode.

1: The oscillator is not stopped in standby sleep mode. If XOSC.ONDEMAND is one, the clock source will be running when a peripheral is requesting the clock. If XOSC.ONDEMAND is zero, the clock source will always be running in standby sleep mode.

## z Bits 5:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – XTALEN: Crystal Oscillator Enable

This bit controls the connections between the I/O pads and the external clock or crystal oscillator:

0: External clock connected on XIN. XOUT can be used as general-purpose I/O.

1: Crystal connected to XIN/XOUT.

## ● Bit 1 – ENABLE: Oscillator Enable

0: The oscillator is disabled.

1: The oscillator is enabled.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.6 32kHz External Crystal Oscillator (XOSC32K) Control

Name: XOSC32K

Offset: 0x14

Reset: 0x0080

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td>WRTLOCK</td><td></td><td colspan="3">STARTUP[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ONDEMAND</td><td>RUNSTDBY</td><td>AAMPEN</td><td>EN1K</td><td>EN32K</td><td>XTALEN</td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 15:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 12 – WRTLOCK: Write Lock

This bit locks the XOSC32K register for futur writes to fix the XOSC32K configuration.

0: The XOSC32K configuration is not locked.

1: The XOSC32K configuration is locked.

## z Bit 11 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 10:8 – STARTUP[2:0]: Oscillator Start-Up Time

These bits select the start-up time for the oscillator according to Table 16-10.

The OSCULP32K oscillator is used to clock the start-up counter.

Table 16-10. Start-Up Time for 32kHz External Crystal Oscillator

<table><tr><td>STARTUP[2:0]</td><td>Number of OSCULP32K Clock Cycles</td><td>Number of XOSC32K Clock Cycles</td><td>Approximate Equivalent Time (OSCULP = 32kHz) $^{(1)(2)(3)}$ </td></tr><tr><td>0x0</td><td>1</td><td>3</td><td>122μs</td></tr><tr><td>0x1</td><td>32</td><td>3</td><td>1068μs</td></tr><tr><td>0x2</td><td>2048</td><td>3</td><td>62592μs</td></tr><tr><td>0x3</td><td>4096</td><td>3</td><td>125092μs</td></tr><tr><td>0x4</td><td>16384</td><td>3</td><td>500092μs</td></tr><tr><td>0x5</td><td>32768</td><td>3</td><td>1000092μs</td></tr><tr><td>0x6</td><td>65536</td><td>3</td><td>2000092μs</td></tr><tr><td>0x7</td><td>131072</td><td>3</td><td>4000092μs</td></tr></table>

Notes: 1. Number of cycles for the start-up counter.  
2. Number of cycles for the synchronization delay, before PCLKSR.XOSC32KRDY is set.  
3. Start-up time is n OSCULP32K cycles + 3 XOSC32K cycles.

## ● Bit 7 – ONDEMAND: On Demand Control

The On Demand operation mode allows an oscillator to be enabled or disabled depending on peripheral clock requests.

In On Demand operation mode, i.e., if the ONDEMAND bit has been previously written to one, the oscillator will only be running when requested by a peripheral. If there is no peripheral requesting the oscillator s clock source, the oscillator will be in a disabled state.

If On Demand is disabled the oscillator will always be running when enabled.

In standby sleep mode, the On Demand operation is still active if the XOSC32K.RUNSTDBY bit is one. If XOSC32K.RUNSTDBY is zero, the oscillator is disabled.

0: The oscillator is always on, if enabled.

1: The oscillator is enabled when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is disabled if no peripheral is requesting the clock source.

## Bit 6 – RUNSTDBY: Run in Standby

This bit controls how the XOSC32K behaves during standby sleep mode:

0: The oscillator is disabled in standby sleep mode.

1: The oscillator is not stopped in standby sleep mode. If XOSC32K.ONDEMAND is one, the clock source will be running when a peripheral is requesting the clock. If XOSC32K.ONDEMAND is zero, the clock source will always be running in standby sleep mode.

## z Bit 5 – AAMPEN: Automatic Amplitude Control Enable

0: The automatic amplitude control for the crystal oscillator is disabled.

1: The automatic amplitude control for the crystal oscillator is enabled.

## Bit 4 – EN1K: 1kHz Output Enable

0: The 1kHz output is disabled.

1: The 1kHz output is enabled.

## z Bit 3 – EN32K: 32kHz Output Enable

0: The 32kHz output is disabled.

1: The 32kHz output is enabled.

## ● Bit 2 – XTALEN: Crystal Oscillator Enable

This bit controls the connections between the I/O pads and the external clock or crystal oscillator:

0: External clock connected on XIN32. XOUT32 can be used as general-purpose I/O.

1: Crystal connected to XIN32/XOUT32.

## Bit 1 – ENABLE: Oscillator Enable

0: The oscillator is disabled.

1: The oscillator is enabled.

## Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.7 32kHz Internal Oscillator (OSC32K) Control

Name: OSC32K

Offset: 0x18

Reset: 0x003F0080

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td colspan="7">CALIB[6:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td>WRTLOCK</td><td></td><td colspan="3">STARTUP[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ONDEMAND</td><td>RUNSTDBY</td><td></td><td></td><td>EN1K</td><td>EN32K</td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:23 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 22:16 – CALIB[6:0]: Oscillator Calibration

These bits control the oscillator calibration.

This value must be written by the user.

Factory calibration values can be loaded from the non-volatile memory. Refer to “NVM Software Calibration Row Mapping” on page 24.

## z Bits 15:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 12 – WRTLOCK: Write Lock

This bit locks the OSC32K register for futur writes to fix the OSC32K configuration.

0: The OSC32K configuration is not locked.

1: The OSC32K configuration is locked.

## z Bit 11 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bits 10:8 – STARTUP[2:0]: Oscillator Start-Up Time

These bits select start-up time for the oscillator according to Table 16-11.

The OSCULP32K oscillator is used as input clock to the startup counter.

Table 16-11. Start-Up Time for 32kHz Internal Oscillator

<table><tr><td>STARTUP[2:0]</td><td>Number of OSC32K clock cycles</td><td>Approximate Equivalent Time (OSCULP= 32 kHz) $^{(1)(2)(3)}$ </td></tr><tr><td>0x0</td><td>3</td><td>92μs</td></tr><tr><td>0x1</td><td>4</td><td>122μs</td></tr><tr><td>0x2</td><td>6</td><td>183μs</td></tr><tr><td>0x3</td><td>10</td><td>305μs</td></tr><tr><td>0x4</td><td>18</td><td>549μs</td></tr><tr><td>0x5</td><td>34</td><td>1038μs</td></tr><tr><td>0x6</td><td>66</td><td>2014μs</td></tr><tr><td>0x7</td><td>130</td><td>3967μs</td></tr></table>

Notes: 1. Number of cycles for the start-up counter.  
2. Number of cycles for the synchronization delay, before PCLKSR.OSC32KRDY is set.  
3. Start-up time is n OSC32K cycles + 2 OSC32K cycles.

## ● Bit 7 – ONDEMAND: On Demand Contro

The On Demand operation mode allows an oscillator to be enabled or disabled depending on peripheral clock requests.

In On Demand operation mode, i.e., if the ONDEMAND bit has been previously written to one, the oscillator will only be running when requested by a peripheral. If there is no peripheral requesting the oscillator s clock source, the oscillator will be in a disabled state.

If On Demand is disabled the oscillator will always be running when enabled.

In standby sleep mode, the On Demand operation is still active if the OSC32K.RUNSTDBY bit is one. If OSC32K.RUNSTDBY is zero, the oscillator is disabled.

0: The oscillator is always on, if enabled.

1: The oscillator is enabled when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is disabled if no peripheral is requesting the clock source.

## z Bit 6 – RUNSTDBY: Run in Standby

This bit controls how the OSC32K behaves during standby sleep mode:

0: The oscillator is disabled in standby sleep mode.

1: The oscillator is not stopped in standby sleep mode. If OSC32K.ONDEMAND is one, the clock source will be running when a peripheral is requesting the clock. If OSC32K.ONDEMAND is zero, the clock source will always be running in standby sleep mode.

## z Bits 5:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 3 – EN1K: 1kHz Output Enable

0: The 1kHz output is disabled.

1: The 1kHz output is enabled.

## z Bit 2 – EN32K: 32kHz Output Enable

0: The 32kHz output is disabled.

1: The 32kHz output is enabled.

## z Bit 1 – ENABLE: Oscillator Enable

0: The oscillator is disabled.

1: The oscillator is enabled.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.8 32kHz Ultra Low Power Internal Oscillator (OSCULP32K) Control

Name: OSCULP32K

Offset: 0x1C

Reset: 0X000XXXXX

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>WRTLOCK</td><td></td><td></td><td colspan="5">CALIB[4:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

● Bit 7 – WRTLOCK: Write Lock

This bit locks the OSCULP32K register for futur writes to fix the OSCULP32K configuration.

0: The OSCULP32K configuration is not locked.

1: The OSCULP32K configuration is locked.

## z Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 4:0 – CALIB[4:0]: Oscillator Calibration

These bits control the oscillator calibration.

These bits are loaded from Flash Calibration at startup.

## 16.8.9 8MHz Internal Oscillator (OSC8M) Control

Name: OSC8M

Offset: 0x20

Reset: 0x87070382

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="2">FRANGE[1:0]</td><td></td><td></td><td colspan="4">CALIB[11:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CALIB[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">PRESC[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ONDEMAND</td><td>RUNSTDBY</td><td></td><td></td><td></td><td></td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td></tr></table>

Bits 31:30 – FRANGE[1:0]: Oscillator Frequency Range These bits control the oscillator frequency range according to the table below. These bits are loaded from Flash Calibration at startup.

Table 16-12. Oscillator Frequency Range

<table><tr><td>FRANGE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>0</td><td>4 to 6MHz</td></tr><tr><td>0x1</td><td>1</td><td>6 to 8MHz</td></tr><tr><td>0x2</td><td>2</td><td>8 to 11MHz</td></tr><tr><td>0x3</td><td>3</td><td>11 to 15MHz</td></tr></table>

## z Bits 29:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 27:16 – CALIB[11:0]: Oscillator Calibration

These bits control the oscillator calibration. The calibration field is split in two:

CALIB[11:6] is for temperature calibration

CALIB[5:0] is for overall process calibration

These bits are loaded from Flash Calibration at startup.

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 9:8 – PRESC[1:0]: Oscillator Prescaler

These bits select the oscillator prescaler factor setting according to the table below.

Table 16-13. Oscillator Prescaler

<table><tr><td>PRESC[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>0</td><td>1</td></tr><tr><td>0x1</td><td>1</td><td>2</td></tr><tr><td>0x2</td><td>2</td><td>4</td></tr><tr><td>0x3</td><td>3</td><td>8</td></tr></table>

## z Bit 7 – ONDEMAND: On Demand Control

The On Demand operation mode allows an oscillator to be enabled or disabled depending on peripheral clock requests.

In On Demand operation mode, i.e., if the ONDEMAND bit has been previously written to one, the oscillator will only be running when requested by a peripheral. If there is no peripheral requesting the oscillator s clock source, the oscillator will be in a disabled state.

If On Demand is disabled the oscillator will always be running when enabled.

In standby sleep mode, the On Demand operation is still active if the OSC8M.RUNSTDBY bit is one. If OSC8M.RUNSTDBY is zero, the oscillator is disabled.

0: The oscillator is always on, if enabled.

1: The oscillator is enabled when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is disabled if no peripheral is requesting the clock source.

## ● Bit 6 – RUNSTDBY: Run in Standby

This bit controls how the OSC8M behaves during standby sleep mode:

0: The oscillator is disabled in standby sleep mode.

1: The oscillator is not stopped in standby sleep mode. If OSC8M.ONDEMAND is one, the clock source will be run ning when a peripheral is requesting the clock. If OSC8M.ONDEMAND is zero, the clock source will always be running in standby sleep mode.

## Bits 5:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – ENABLE: Oscillator Enable

0: The oscillator is disabled or being enabled.

1: The oscillator is enabled or being disabled.

The user must ensure that the OSC8M is fully disabled before enabling it, and that the OSC8M is fully enabled before disabling it by reading OSC8M.ENABLE.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>WAITLOCK</td><td>BPLCKC</td><td>QLDIS</td><td>CCDIS</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ONDEMAND</td><td></td><td>USBCRM</td><td>LLAW</td><td>STABLE</td><td>MODE</td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## 16.8.10 DFLL48M Control

Name: DFLLCTRL

Offset: 0x24

Reset: 0x0080

Access: Read-Write

Property: Write-Protected

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 11 – WAITLOCK: Wait Lock

This bit controls the DFLL output clock, depending on lock status:

0: Output clock before the DFLL is locked.

1: Output clock when DFLL is locked.

## ● Bit 10 – BPLCKC: Bypass Coarse Lock

This bit controls the coarse lock procedure:

0: Bypass coarse lock is disabled.

1: Bypass coarse lock is enabled.

## ● Bit 9 – QLDIS: Quick Lock Disable

0: Quick Lock is enabled.

1: Quick Lock is disabled.

## z Bit 8 – CCDIS: Chill Cycle Disable

0: Chill Cycle is enabled.

1: Chill Cycle is disabled.

## ● Bit 7 – ONDEMAND: On Demand Control

The On Demand operation mode allows an oscillator to be enabled or disabled depending on peripheral clock requests.

In On Demand operation mode, i.e., if the ONDEMAND bit has been previously written to one, the oscillator will only be running when requested by a peripheral. If there is no peripheral requesting the oscillator s clock source, the oscillator will be in a disabled state.

If On Demand is disabled the oscillator will always be running when enabled.

In standby sleep mode, the On Demand operation is still active if the DFLLCTRL.RUNSTDBY bit is one. If DFLLCTRL.RUNSTDBY is zero, the oscillator is disabled.

0: The oscillator is always on, if enabled.

1: The oscillator is enabled when a peripheral is requesting the oscillator to be used as a clock source. The oscillator is disabled if no peripheral is requesting the clock source.

## z Bit 6 – Reserved

This bits is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 5 – USBCRM: USB Clock Recovery Mode

0: USB Clock Recovery Mode is disabled.

1: USB Clock Recovery Mode is enabled.

## ● Bit 4 – LLAW: Lose Lock After Wake

0: Locks will not be lost after waking up from sleep modes if the DFLL clock has been stopped.

1: Locks will be lost after waking up from sleep modes if the DFLL clock has been stopped.

## z Bit 3 – STABLE: Stable DFLL Frequency

0: FINE calibration tracks changes in output frequency.

1: FINE calibration register value will be fixed after a fine lock.

## Bit 2 – MODE: Operating Mode Selection

0: The DFLL operates in open-loop operation.

1: The DFLL operates in closed-loop operation.

## z Bit 1 – ENABLE: DFLL Enable

0: The DFLL oscillator is disabled.

## 1: The DFLL oscillator is enabled.

Due to synchronization, there is delay from updating the register until the peripheral is enabled/disabled. The value written to DFLLCTRL.ENABLE will read back immediately after written.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.11 DFLL48M Value

Name: DFLLVAL

Offset: 0x28

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DIFF[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIFF[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="6">COARSE[5:0]</td><td colspan="2">FINE[9:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">FINE[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:16 – DIFF[15:0]: Multiplication Ratio Difference

In closed-loop mode (DFLLCTRL.MODE is written to one), this bit group indicates the difference between the ideal number of DFLL cycles and the counted number of cycles. This value is not updated in open-loop mode, and should be considered invalid in that case.

## z Bits 15:10 – COARSE[5:0]: Coarse Value

Set the value of the Coarse Calibration register. In closed-loop mode, this field is read-only.

z Bits 9:0 – FINE[9:0]: Fine Value

Set the value of the Fine Calibration register. In closed-loop mode, this field is read-only.

## 16.8.12 DFLL48M Multiplier

Name: DFLLMUL

Offset: 0x2C

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="6">CSTEP[5:0]</td><td colspan="2">FSTEP[9:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">FSTEP[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">MUL[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">MUL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:26 – CSTEP[5:0]: Coarse Maximum Step

This bit group indicates the maximum step size allowed during coarse adjustment in closed-loop mode. When adjusting to a new frequency, the expected output frequency overshoot depends on this step size.

## ● Bits 25:16 – FSTEP[9:0]: Fine Maximum Step

This bit group indicates the maximum step size allowed during fine adjustment in closed-loop mode. When adjust ing to a new frequency, the expected output frequency overshoot depends on this step size.

## Bits 15:0 – MUL[15:0]: DFLL Multiply Factor

This field determines the ratio of the CLK\_DFLL output frequency to the CLK\_DFLL\_REF input frequency. Writing to the MUL bits will cause locks to be lost and the fine calibration value to be reset to its midpoint.

## 16.8.13 DFLL48M Synchronization

Name: DFLLSYNC

Offset: 0x30

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>READREQ</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – READREQ: Read Request

To be able to read the current value of DFLLVAL in closed-loop mode, this bit should be written to one. The updated value is available in DFLLVAL when PCLKSR.DFLLRDY is set.

## z Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 16.8.14 3.3V Brown-Out Detector (BOD33) Control

Name: BOD33

Offset: 0x34

Reset: 0X0000000000XXXXXX00000000000XXXX0

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td colspan="6">LEVEL[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="4">PSEL[3:0]</td><td></td><td></td><td>CEN</td><td>MODE</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>RUNSTDBY</td><td></td><td colspan="2">ACTION[1:0]</td><td>HYST</td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td><td>X</td><td>X</td><td>0</td></tr></table>

## Bits 31:22 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 21:16 – LEVEL[5:0]: BOD33 Threshold Level

This field sets the triggering voltage threshold for the BOD33. See the “Electrical Characteristics” on page 858 for actual voltage levels. Note that any change to the LEVEL field of the BOD33 register should be done when the BOD33 is disabled in order to avoid spurious resets or interrupts.

These bits are loaded from Flash User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## Bits 15:12 – PSEL[3:0]: Prescaler Select

Selects the prescaler divide-by output for the BOD33 sampling mode according to the table below. The input clock comes from the OSCULP32K 1kHz output.

Table 16-14. Prescaler Select

<table><tr><td>PSEL[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV2</td><td>Divide clock by 2</td></tr><tr><td>0x1</td><td>DIV4</td><td>Divide clock by 4</td></tr><tr><td>0x2</td><td>DIV8</td><td>Divide clock by 8</td></tr><tr><td>0x3</td><td>DIV16</td><td>Divide clock by 16</td></tr><tr><td>0x4</td><td>DIV32</td><td>Divide clock by 32</td></tr><tr><td>0x5</td><td>DIV64</td><td>Divide clock by 64</td></tr><tr><td>0x6</td><td>DIV128</td><td>Divide clock by 128</td></tr><tr><td>0x7</td><td>DIV256</td><td>Divide clock by 256</td></tr><tr><td>0x8</td><td>DIV512</td><td>Divide clock by 512</td></tr><tr><td>0x9</td><td>DIV1K</td><td>Divide clock by 1024</td></tr><tr><td>0xA</td><td>DIV2K</td><td>Divide clock by 2048</td></tr><tr><td>0xB</td><td>DIV4K</td><td>Divide clock by 4096</td></tr><tr><td>0xC</td><td>DIV8K</td><td>Divide clock by 8192</td></tr><tr><td>0xD</td><td>DIV16K</td><td>Divide clock by 16384</td></tr><tr><td>0xE</td><td>DIV32K</td><td>Divide clock by 32768</td></tr><tr><td>0xF</td><td>DIV64K</td><td>Divide clock by 65536</td></tr></table>

## z Bits 11:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 9 – CEN: Clock Enable

0: The BOD33 sampling clock is either disabled and stopped, or enabled but not yet stable.

1: The BOD33 sampling clock is either enabled and stable, or disabled but not yet stopped.

Writing a zero to this bit will stop the BOD33 sampling clock.

Writing a one to this bit will start the BOD33 sampling clock.

## Bit 8 – MODE: Operation Mode

0: The BOD33 operates in continuous mode.

1: The BOD33 operates in sampling mode.

## Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bit 6 – RUNSTDBY: Run in Standby

0: The BOD33 is disabled in standby sleep mode.

1: The BOD33 is enabled in standby sleep mode.

## z Bit 5 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bits 4:3 – ACTION[1:0]: BOD33 Action

These bits are used to select the BOD33 action when the supply voltage crosses below the BOD33 threshold. These bits are loaded from Flash User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

Table 16-15. BOD33 Action

<table><tr><td>ACTION[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No action</td></tr><tr><td>0x1</td><td>RESET</td><td>The BOD33 generates a reset</td></tr><tr><td>0x2</td><td>INTERRUPT</td><td>The BOD33 generates an interrupt</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 2 – HYST: Hysteresis

This bit indicates whether hysteresis is enabled for the BOD33 threshold voltage:

0: No hysteresis.

1: Hysteresis enabled.

This bit is loaded from Flash User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## Bit 1 – ENABLE: Enable

0: BOD33 is disabled.

1: BOD33 is enabled.

This bit is loaded from Flash User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.15 Voltage References System (VREF) Control

Name: VREF

Offset: 0x40

Reset: 0X00000XXXXXXXXXXX0000000000000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">CALIB[10:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CALIB[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>BGOUTEN</td><td>TSEN</td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:27 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 26:16 – CALIB[10:0]: Bandgap Voltage Generator Calibration

These bits are used to calibrate the output level of the bandgap voltage reference. These bits are loaded from Flash Calibration Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## z Bits 15:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – BGOUTEN: Bandgap Output Enable

0: The bandgap output is not available as an ADC input channel.

1: The bandgap output is routed to an ADC input channel.

## Bit 1 – TSEN: Temperature Sensor Enable

0: Temperature sensor is disabled.

1: Temperature sensor is enabled and routed to an ADC input channel.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.16 DPLL Control A

Name: DPLLCTRLA

Offset: 0x44

Reset: 0x80

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ONDEMAND</td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – ONDEMAND: On Demand Clock Activation

0: The DPLL is always on when enabled.

1: The DPLL is activated only when a peripheral request the DPLL as a source clock. The DPLLCTRLA.ENABLE bit must be one to validate that operation, otherwise the peripheral request has no effect.

## z Bits 6:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – ENABLE: DPLL Enable

0: The DPLL is disabled.

1: The DPLL is enabled.

The software operation of enabling or disabling the DPLL takes a few clock cycles, so check the DPLLSTA-TUS.ENABLE status bit to identify when the DPLL is successfully activated or disabled.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 16.8.17 DPLL Ratio Control

Name: DPLLRATIO

Offset: 0x48

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">LDRFRAC[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">LDR[11:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">LDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 19:16 – LDRFRAC[3:0]: Loop Divider Ratio Fractional Part Write this field with the fractional part of the frequency multiplier.

z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 11:0 – LDR[11:0]: Loop Divider Ratio

Write this field with the integer part of the frequency multiplier.

## 16.8.18 DPLL Control B

Name: DPLLCTRLB

Offset: 0x4C

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">DIV[10:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIV[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td>LBYPASS</td><td></td><td colspan="3">LTIME[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="2">REFCLK[1:0]</td><td>WUF</td><td>LPEN</td><td colspan="2">FILTER[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:27 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 26:16 – DIV[10:0]: Clock Divider

These bits are used to set the CLK\_DPLL\_REF1 clock division factor and can be calculated with the following formula:

f\_div = f\_CLKDPLLREF1/(2x(DIV+1))

## z Bits 15:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 12 – LBYPASS: Lock Bypass

0: Normal Mode: the CK\_GATED is turned off when lock signal is low.

1: Lock Bypass Mode: the CK\_GATED is always running, lock is irrelevant.

## ● Bit 11 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 10:8 – LTIME[2:0]: Lock Time These bits select the DPLL lock timeout.

Table 16-16. Lock Time

<table><tr><td>LTIME[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DEFAULT</td><td>No time-out</td></tr><tr><td>0x1 - 0x3</td><td></td><td>Reserved</td></tr><tr><td>0x4</td><td>8MS</td><td>Time-out if no lock within 8ms</td></tr><tr><td>0x5</td><td>9MS</td><td>Time-out if no lock within 9ms</td></tr><tr><td>0x6</td><td>10MS</td><td>Time-out if no lock within 10ms</td></tr><tr><td>0x7</td><td>11MS</td><td>Time-out if no lock within 11ms</td></tr></table>

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 5:4 – REFCLK[1:0]: Reference Clock Selection These bits select the DPLL clock reference.

Table 16-17. Reference Clock Selection

<table><tr><td>REFCLK[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>REF0</td><td>CLK_DPLL_REF0 clock reference</td></tr><tr><td>0x1</td><td>REF1</td><td>CLK_DPLL_REF1 clock reference</td></tr><tr><td>0x2</td><td>GCLK</td><td>GCLK_DPLL clock reference</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 3 – WUF: Wake Up Fast

0: DPLL CK output is gated until complete startup time and lock time.

1: DPLL CK output is gated until startup time only.

## z Bit 2 – LPEN: Low-Power Enable

0: The time to digital converter is selected.

1: The time to digital converter is not selected, this will improve power consumption but increase the output jitter.

z Bits 1:0 – FILTER[1:0]: Proportional Integral Filter Selection These bits select the DPLL filter type.

Table 16-18. Proportional Integral Filter Selection

<table><tr><td>FILTER[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DEFAULT</td><td>Default filter mode</td></tr><tr><td>0x1</td><td>LBFILT</td><td>Low bandwidth filter</td></tr><tr><td>0x2</td><td>HBFILT</td><td>High bandwidth filter</td></tr><tr><td>0x3</td><td>HDFILT</td><td>High damping filter</td></tr></table>

## 16.8.19 DPLL Status

Name: DPLLSTATUS

Offset: 0x50

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>DIV</td><td>ENABLE</td><td>CLKRDY</td><td>LOCK</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bit 3 – DIV: Divider Enable

0: The reference clock divider is disabled.

1: The reference clock divider is enabled.

Bit 2 – ENABLE: DPLL Enable 0: The DPLL is disabled. 1: The DPLL is enabled.

z Bit 1 – CLKRDY: Output Clock Ready 0: The DPLL output clock is off 1: The DPLL output clock in on.

z Bit 0 – LOCK: DPLL Lock Status 0: The DPLL Lock signal is cleared.

1: The DPLL Lock signal is asserted.

## 17. WDT – Watchdog Timer

## 17.1 Overview

The Watchdog Timer (WDT) is a system function for monitoring correct program operation. It makes it possible to recover from error situations such as runaway or deadlocked code. The WDT is configured to a predefined time-out period, and is constantly running when enabled. If the WDT is not cleared within the time-out period, it will issue a system reset. An early-warning interrupt is available to indicate an upcoming watchdog time-out condition.

The window mode makes it possible to define a time slot (or window) inside the total time-out period during which the WDT must be cleared. If the WDT is cleared outside this window, either too early or too late, a system reset will be issued. Compared to the normal mode, this can also catch situations where a code error causes the WDT to be cleared frequently.

When enabled, the WDT will run in active mode and all sleep modes. It is asynchronous and runs from a CPUindependent clock source.The WDT will continue operation and issue a system reset or interrupt even if the main clocks fail.

## 17.2 Features

z Issues a system reset if the Watchdog Timer is not cleared before its time-out period

z Early Warning interrupt generation

z Asynchronous operation from dedicated oscillator

z Two types of operation:

z Normal mode

z Window mode

z Selectable time-out periods, from 8 cycles to 16,000 cycles in normal mode or 16 cycles to 32,000 cycles in window mode

z Always-on capability

## 17.3 Block Diagram

Figure 17-1. WDT Block Diagram

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_7e5fdca96390993e8752fec59913dbb60c890d92d339398e32ae9718ee5e8601.jpg)

## 17.4 Signal Description

Not applicable.

## 17.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 17.5.1 I/O Lines

Not applicable.

## 17.5.2 Power Management

The WDT can continue to operate in any sleep mode where the selected source clock is running. The WDT interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 17.5.3 Clocks

The WDT bus clock (CLK\_WDT\_APB) is enabled by default, and can be enabled and disabled in the Power Manager. Refer to “PM – Power Manager” on page 110 for details.

A generic clock (GCLK\_WDT) is required to clock the WDT. This clock must be configured and enabled in the Generic Clock Controller before using the WDT. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the user interface clock (CLK\_WDT\_APB). Due to this asynchronicity, accessing certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 214 for further details.

GCLK\_WDT is intended to be sourced from the clock of the internal ultra-low-power (ULP) oscillator. Due to the ultralow-power design, the oscillator is not very accurate, and so the exact time-out period may vary from device to device. This variation must be kept in mind when designing software that uses the WDT to ensure that the time-out periods used are valid for all devices. For more information on ULP oscillator accuracy, consult the “Ultra Low Power Internal 32kHz RC Oscillator (OSCULP32K) Characteristics” on page 890.

GCLK\_WDT can also be clocked from other sources if a more accurate clock is needed, but at the cost of higher power consumption.

## 17.5.4 DMA

Not applicable.

## 17.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the WDT interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 17.5.6 Events

Not applicable.

## 17.5.7 Debug Operation

When the CPU is halted in debug mode, the WDT will halt normal operation. This peripheral can be forced to continue operation during debugging.

## 17.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

Interrupt Flag Status and Clear register (INTFLAG)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 17.5.9 Analog Connections

Not applicable.

## 17.6 Functional Description

## 17.6.1 Principle of Operation

The Watchdog Timer (WDT) is a system for monitoring correct program operation, making it possible to recover from error situations such as runaway code by issuing a reset. When enabled, the WDT is a constantly running timer that is configured to a predefined time-out period. Before the end of the time-out period, the WDT should be reconfigured.

The WDT has two modes of operation, normal and window. Additionally, the user can enable Early Warning interrupt generation in each of the modes. The description for each of the basic modes is given below. The settings in the Control register (CTRL) and the Interrupt Enable register (INTENCLR/SET - refer to INTENCLR) determine the mode of operation, as illustrated in Table 17-1.

Table 17-1. WDT Operating Modes

<table><tr><td>CTRL.ENABLE</td><td>CTRL.WEN</td><td>INTENSET.EW</td><td>Mode</td></tr><tr><td>0</td><td>x</td><td>x</td><td>Stopped</td></tr><tr><td>1</td><td>0</td><td>0</td><td>Normal</td></tr><tr><td>1</td><td>0</td><td>1</td><td>Normal with Early Warning interrupt</td></tr><tr><td>1</td><td>1</td><td>0</td><td>Window</td></tr><tr><td>1</td><td>1</td><td>1</td><td>Window with Early Warning interrupt</td></tr></table>

## 17.6.2 Basic Operation

## 17.6.2.1 Initialization

The following bits are enable-protected:

z Window Mode Enable in the Control register (CTRL.WEN)

● Always-On in the Control register (CTRL.ALWAYSON)

The following registers are enable-protected:

Control register (CTRL), except the Enable bit (CTRL.ENABLE)

Configuration register (CONFIG)

Early Warning Interrupt Control register (EWCTRL)

Any writes to these bits or registers when the WDT is enabled or is being enabled (CTRL.ENABLE is one) will be discarded. Writes to these registers while the WDT is being disabled will be completed after the disabling is complete

Enable-protection is denoted by the Enable-Protected property in the register description.

Initialization of the WDT can be done only while the WDT is disabled.

## Normal Mode

z Defining the required Time-Out Period bits in the Configuration register (CONFIG.PER).

## Normal Mode with Early Warning interrupt

z Defining the required Time-Out Period bits in the Configuration register (CONFIG.PER).

Defining Early Warning Interrupt Time Offset bits in the Early Warning Interrupt Control register (EWCTRL. EWOFFSET).

z Setting Early Warning Interrupt Enable bit in the Interrupt Enable Set register (INTENSET.EW).

## Window Mode

● Defining Time-Out Period bits in the Configuration register (CONFIG.PER).

z Defining Window Mode Time-Out Period bits in the Configuration register (CONFIG.WINDOW).

z Setting Window Enable bit in the Control register (CTRL.WEN).

## Window Mode with Early Warning interrupt

Defining Time-Out Period bits in the Configuration register (CONFIG.PER).

z Defining Window Mode Time-Out Period bits in the Configuration register (CONFIG.WINDOW).

z Setting Window Enable bit in the Control register (CTRL.WEN).

z Defining Early Warning Interrupt Time Offset bits in the Early Warning Interrupt Control register (EWCTRL. EWOFFSET).

z Setting Early Warning Interrupt Enable bit in the Interrupt Enable Set register (INTENSET.EW).

## 17.6.2.2 Configurable Reset Values

On a power-on reset, some registers will be loaded with initial values from the NVM User Row. Refer to “NVM User Row Mapping” on page 23 for more details.

This encompasses the following bits and bit groups:

z Enable bit in the Control register (CTRL.ENABLE)

● Always-On bit in the Control register (CTRL.ALWAYSON)

z Watchdog Timer Windows Mode Enable bit in the Control register (CTRL.WEN)

z Watchdog Timer Windows Mode Time-Out Period bits in the Configuration register (CONFIG.WINDOW)

z Time-Out Period in the Configuration register (CONFIG.PER)

z Early Warning Interrupt Time Offset bits in the Early Warning Interrupt Control register (EWCTRL.EWOFFSET)

For more information about fuse locations, see “NVM User Row Mapping” on page 23.

## 17.6.2.3 Enabling and Disabling

The WDT is enabled by writing a one to the Enable bit in the Control register (CTRL.ENABLE). The WDT is disabled by writing a zero to CTRL.ENABLE.

The WDT can be disabled only while the Always-On bit in the Control register (CTRL.ALWAYSON) is zero.

## 17.6.2.4 Normal Mode

In normal-mode operation, the length of a time-out period is configured in CONFIG.PER. The WDT is enabled by writing a one to the Enable bit in the Control register (CTRL.ENABLE). Once enabled, if the WDT is not cleared from the application code before the time-out occurs, the WDT will issue a system reset. There are 12 possible WDT time out (TO ) periods, selectable from 8ms to 16s, and the WDT can be cleared at any time during the time-out period. A new WDT time-out period will be started each time the WDT is cleared by writing 0xA5 to the Clear register (CLEAR). Writing any value other than 0xA5 to CLEAR will issue an immediate system reset.

By default, WDT issues a system reset upon a time-out, and the early warning interrupt is disabled. If an early warning interrupt is required, the Early Warning Interrupt Enable bit in the Interrupt Enable register (INTENSET.EW) must be enabled. Writing a one to the Early Warning Interrupt bit in the Interrupt Enable Set register (INTENSET.EW) enables the interrupt, and writing a one to the Early Warning Interrupt bit in the Interrupt Enable Clear register (INTENCLR.EW) disables the interrupt. If the Early Warning Interrupt is enabled, an interrupt is generated prior to a watchdog time-out condition. In normal mode, the Early Warning Offset bits in the Early Warning Interrupt Control register (EWCTRL.EWOFFSET) define the time where the early warning interrupt occurs. The normal-mode operation is illustrated in Figure 17-2.

Figure 17-2. Normal-Mode Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_c1506aae53fd6a0c562123f47fb396b1e0e2c1bdc7640c72fe3fd965190669ce.jpg)

## 17.6.2.5 Window Mode

In window-mode operation, the WDT uses two different time-out periods, a closed window time-out period (TOWDTW) and the normal, or open, time-out period (TOWDT). The closed window time-out period defines a duration from 8ms to 16s where the WDT cannot be reset. If the WDT is cleared during this period, the WDT will issue a system reset. The normal WDT time-out period, which is also from 8ms to 16s, defines the duration of the open period during which the WDT can be cleared. The open period will always follow the closed period, and so the total duration of the time-out period is the sum of the closed window and the open window time-out periods. The closed window is defined by the Window Period bits in the Configuration register (CONFIG.WINDOW), and the open window is defined by the Period bits in the Configuration register (CONFIG.PER).

By default, the WDT issues a system reset upon a time-out and the Early Warning interrupt is disabled. If an Early Warning interrupt is required, INTENCLR/SET.EW must be set. Writing a one to INTENSET.EW enables the interrupt and writing a one to INTENCLR.EW disables the interrupt. If the Early Warning interrupt is enabled in window mode, the interrupt is generated at the start of the open window period.

The window mode operation is illustrated in Figure 17-3.

Figure 17-3. Window-Mode Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_907b37fb5565146a101bb6f2504f8b76e43081afdc1c2a77c3c6f08b275ee541.jpg)

## 17.6.3 Additional Features

## 17.6.3.1 Always-On Mode

The always-on mode is enabled by writing a one to the Always-On bit in the Control register (CTRL.ALWAYSON). When the always-on mode is enabled, the WDT runs continuously, regardless of the state of CTRL.ENABLE. Once written, the Always-On bit can only be cleared by a power-on reset. The Configuration (CONFIG) and Early Warning Control (EWCTRL) registers are read-only registers while the CTRL.ALWAYSON bit is set. Thus, the time period configuration bits (CONFIG.PER, CONFIG.WINDOW, EWCTRL.EWOFFSET) of the WDT cannot be changed.

Enabling or disabling window-mode operation by writing the Window Enable bit (CTRL.WEN) is allowed while in the always-on mode, but note that CONFIG.PER cannot be changed.

The Interrupt Clear and Interrupt Set registers are accessible in the always-on mode. The Early Warning interrupt can still be enabled or disabled while in the always-on mode, but note that EWCTRL.EWOFFSET cannot be changed. Table 17-2 shows the operation of the WDT when CTRL.ALWAYSON is set.

Table 17-2. WDT Operating Modes With Always-On

<table><tr><td>CTRL.WEN</td><td>INTENSET.EW</td><td>Mode</td></tr><tr><td>0</td><td>0</td><td>Always-on and normal mode</td></tr><tr><td>0</td><td>1</td><td>Always-on and normal mode with Early Warning interrupt</td></tr><tr><td>1</td><td>0</td><td>Always-on and window mode</td></tr><tr><td>1</td><td>1</td><td>Always-on and window mode with Early Warning interrupt</td></tr></table>

## 17.6.4 Interrupts

The WDT has the following interrupt sources:

z Early Warning

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the WDT is reset. See INTFLAG for details on how to clear interrupt flags.

The WDT has one common interrupt request line for all the interrupt sources. The user must read INTFLAG to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

The Early Warning interrupt behaves differently in normal mode and in window mode. In normal mode, the Early Warning interrupt generation is defined by the Early Warning Offset in the Early Warning Control register (EWCTRL.EWOFFSET). The Early Warning Offset bits define the number of GCLK\_WDT clocks before the interrupt is generated, relative to the start of the watchdog time-out period. For example, if the WDT is operating in normal mode with CONFIG.PER = 0x2 and EWCTRL.EWOFFSET = 0x1, the Early Warning interrupt is generated 16 GCLK\_WDT clock cycles from the start of the watchdog time-out period, and the watchdog time-out system reset is generated 32 GCLK\_WDT clock cycles from the start of the watchdog time-out period. The user must take caution when programming the Early Warning Offset bits. If these bits define an Early Warning interrupt generation time greater than the watchdog time-out period, the watchdog time-out system reset is generated prior to the Early Warning interrupt. Thus, the Early Warning interrupt will never be generated.

In window mode, the Early Warning interrupt is generated at the start of the open window period. In a typical application where the system is in sleep mode, it can use this interrupt to wake up and clear the Watchdog Timer, after which the system can perform other tasks or return to sleep mode.

## 17.6.5 Synchronization

Due to the asynchronicity between CLK\_WDT\_APB and GCLK\_WDT some registers must be synchronized when accessed. A register can require:

Synchronization when written

Synchronization when read

z Synchronization when written and read

z No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete. The synchronization Ready interrupt can be used to signal when sync is complete. This can be accessed via the Synchronization Ready Interrupt Flag in the Interrupt Flag Status and Clear register (INTFLAG.SYNCRDY).

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following registers need synchronization when written:

Control register (CTRL)

Clear register (CLEAR)

Write-synchronization is denoted by the Write-Synchronized property in the register description.

## 17.7 Register Summary

Table 17-3. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0</td><td>CTRL</td><td>7:0</td><td>ALWAYSON</td><td></td><td></td><td></td><td></td><td>WEN</td><td>ENABLE</td><td></td></tr><tr><td>0x1</td><td>CONFIG</td><td>7:0</td><td colspan="4">WINDOW[3:0]</td><td colspan="4">PER[3:0]</td></tr><tr><td>0x2</td><td>EWCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="4">EWOFFSET[3:0]</td></tr><tr><td>0x3</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x4</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EW</td></tr><tr><td>0x5</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EW</td></tr><tr><td>0x6</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EW</td></tr><tr><td>0x7</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x8</td><td>CLEAR</td><td>7:0</td><td colspan="8">CLEAR[7:0]</td></tr></table>

## 17.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Please refer to “Register Access Protection” on page 209 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Please refer to “Synchronization” on page 214 for details.

Some registers are enable-protected, meaning they can be written only when the WDT is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 17.8.1 Control

Name: CTRL

Offset: 0x0

Reset: 0xXX

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ALWAYSON</td><td></td><td></td><td></td><td></td><td>WEN</td><td>ENABLE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>X</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td><td>0</td></tr></table>

## z Bit 7 – ALWAYSON: Always-On

This bit allows the WDT to run continuously. After being written to one, this bit cannot be written to zero, and the WDT will remain enabled until a power-on reset is received. When this bit is one, the Control register (CTRL), the Configuration register (CONFIG) and the Early Warning Control register (EWCTRL) will be read-only, and any writes to these registers are not allowed. Writing a zero to this bit has no effect.

0: The WDT is enabled and disabled through the ENABLE bit.

1: The WDT is enabled and can only be disabled by a power-on reset (POR).

This bit is not enable-protected.

This bit is loaded from NVM User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## z Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – WEN: Watchdog Timer Window Mode Enable

This bit enables window mode.

This bit can only be written when CTRL.ENABLE is zero or CTRL.ALWAYSON is one:

When CTRL.ALWAYSON=0, this bit is enable-protected by CTRL.ENABLE.

When CTRL.ALWAYSON=1 this bit is not enable-protected by CTRL.ENABLE.

The initial value of this bit is loaded from Flash Calibration.

The initial value of this bit is loaded from Flash Calibration.

0: Window mode is disabled (normal operation).

1: Window mode is enabled.

This bit is loaded from NVM User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## ● Bit 1 – ENABLE: Enable

This bit enables or disables the WDT. Can only be written while CTRL.ALWAYSON is zero.

0: The WDT is disabled.

1: The WDT is enabled.

Due to synchronization, there is delay from writing CTRL.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately, and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete.

This bit is not enable-protected.

This bit is loaded from NVM User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 17.8.2 Configuration

Name: CONFIG

Offset: 0x1

Reset: 0xXX

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">WINDOW[3:0]</td><td colspan="4">PER[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

z Bits 7:4 – WINDOW[3:0]: Window Mode Time-Out Period

In window mode, these bits determine the watchdog closed window period as a number of oscillator cycles. The closed window periods are defined in Table 17-4.

These bits are loaded from NVM User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

Table 17-4. Window Mode Time-Out Period

<table><tr><td>WINDOW[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>8</td><td>8 clock cycles</td></tr><tr><td>0x1</td><td>16</td><td>16 clock cycles</td></tr><tr><td>0x2</td><td>32</td><td>32 clock cycles</td></tr><tr><td>0x3</td><td>64</td><td>64 clock cycles</td></tr><tr><td>0x4</td><td>128</td><td>128 clock cycles</td></tr><tr><td>0x5</td><td>256</td><td>256 clock cycles</td></tr><tr><td>0x6</td><td>512</td><td>512 clock cycles</td></tr><tr><td>0x7</td><td>1K</td><td>1024 clock cycles</td></tr><tr><td>0x8</td><td>2K</td><td>2048 clock cycles</td></tr><tr><td>0x9</td><td>4K</td><td>4096 clock cycles</td></tr><tr><td>0xA</td><td>8K</td><td>8192 clock cycles</td></tr><tr><td>0xB</td><td>16K</td><td>16384 clock cycles</td></tr><tr><td>0xc-0xf</td><td></td><td>Reserved</td></tr></table>

## z Bits 3:0 – PER[3:0]: Time-Out Period

These bits determine the watchdog time-out period as a number of GCLK\_WDT clock cycles. In window mode operation, these bits define the open window period. The different typical time-out periods are found in Table 17-5. These bits are loaded from NVM User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

Table 17-5. Time-Out Period

<table><tr><td>PER[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>8</td><td>8 clock cycles</td></tr><tr><td>0x1</td><td>16</td><td>16 clock cycles</td></tr><tr><td>0x2</td><td>32</td><td>32 clock cycles</td></tr><tr><td>0x3</td><td>64</td><td>64 clock cycles</td></tr><tr><td>0x4</td><td>128</td><td>128 clock cycles</td></tr><tr><td>0x5</td><td>256</td><td>256 clock cycles</td></tr><tr><td>0x6</td><td>512</td><td>512 clock cycles</td></tr><tr><td>0x7</td><td>1K</td><td>1024 clock cycles</td></tr><tr><td>0x8</td><td>2K</td><td>2048 clock cycles</td></tr><tr><td>0x9</td><td>4K</td><td>4096 clock cycles</td></tr><tr><td>0xA</td><td>8K</td><td>8192 clock cycles</td></tr><tr><td>0xB</td><td>16K</td><td>16384 clock cycles</td></tr><tr><td>0xc-0xf</td><td></td><td>Reserved</td></tr></table>

## 17.8.3 Early Warning Interrupt Control

Name: EWCTRL

Offset: 0x2

Reset: 0x0X

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">EWOFFSET[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 3:0 – EWOFFSET[3:0]: Early Warning Interrupt Time Offset

These bits determine the number of GCLK\_WDT clocks in the offset from the start of the watchdog time-out period to when the Early Warning interrupt is generated. The Early Warning Offset is defined in Table 17-6. These bits are loaded from NVM User Row at startup. Refer to “NVM User Row Mapping” on page 23 for more details.

Table 17-6. Early Warning Interrupt Time Offset

<table><tr><td>EWOFFSET[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>8</td><td>8 clock cycles</td></tr><tr><td>0x1</td><td>16</td><td>16 clock cycles</td></tr><tr><td>0x2</td><td>32</td><td>32 clock cycles</td></tr><tr><td>0x3</td><td>64</td><td>64 clock cycles</td></tr><tr><td>0x4</td><td>128</td><td>128 clock cycles</td></tr><tr><td>0x5</td><td>256</td><td>256 clock cycles</td></tr><tr><td>0x6</td><td>512</td><td>512 clock cycles</td></tr><tr><td>0x7</td><td>1K</td><td>1024 clock cycles</td></tr><tr><td>0x8</td><td>2K</td><td>2048 clock cycles</td></tr><tr><td>0x9</td><td>4K</td><td>4096 clock cycles</td></tr><tr><td>0xA</td><td>8K</td><td>8192 clock cycles</td></tr><tr><td>0xB</td><td>16K</td><td>16384 clock cycles</td></tr><tr><td>0xc-0xf</td><td></td><td>Reserved</td></tr></table>

## 17.8.4 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x4

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EW</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 0 – EW: Early Warning Interrupt Enable

0: The Early Warning interrupt is disabled.

1: The Early Warning interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit disables the Early Warning interrupt.

## 17.8.5 Interrupt Enable Set

Name: INTENSET

Offset: 0x5

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EW</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – EW: Early Warning Interrupt Enable

0: The Early Warning interrupt is disabled.

1: The Early Warning interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit enables the Early Warning interrupt.

## 17.8.6 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x6

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EW</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 0 – EW: Early Warning

This flag is set when an Early Warning interrupt occurs, as defined by the EWOFFSET bit group in EWCTRL. Writing a zero to this bit has no effect.

Writing a one to this bit clears the Early Warning interrupt flag.

## 17.8.7 Status

Name: STATUS

Offset: 0x7

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy

This bit is cleared when the synchronization of registers between clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 17.8.8 Clear

Name: CLEAR

Offset: 0x8

Reset: 0x00

Access: Write-Only

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CLEAR[7:0]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bits 7:0 – CLEAR[7:0]: Watchdog Clear

Writing 0xA5 to this register will clear the Watchdog Timer and the watchdog time-out period is restarted. Writing any other value will issue an immediate system reset.

Table 17-7. Watchdog Clear

<table><tr><td>CLEAR[7:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0-0xa4</td><td></td><td>Reserved</td></tr><tr><td>0xA5</td><td>KEY</td><td>Clear Key</td></tr><tr><td>0xa6-0xff</td><td></td><td>Reserved</td></tr></table>

## 18. RTC – Real-Time Counter

## 18.1 Overview

The Real-Time Counter (RTC) is a 32-bit counter with a 10-bit programmable prescaler that typically runs continuously to keep track of time. The RTC can wake up the device from sleep modes using the alarm/compare wake up, periodic wake up or overflow wake up mechanisms.

The RTC is typically clocked by the 1.024kHz output from the 32.768kHz High-Accuracy Internal Crystal Oscillator(OSC32K) and this is the configuration optimized for the lowest power consumption. The faster 32.768kHz output can be selected if the RTC needs a resolution higher than 1ms. The RTC can also be clocked from other sources, selectable through the Generic Clock module (GCLK).

The RTC can generate periodic peripheral events from outputs of the prescaler, as well as alarm/compare interrupts and peripheral events, which can trigger at any counter value. Additionally, the timer can trigger an overflow interrupt and peripheral event, and be reset on the occurrence of an alarm/compare match. This allows periodic interrupts and peripheral events at very long and accurate intervals.

The 10-bit programmable prescaler can scale down the clock source, and so a wide range of resolutions and time-out periods can be configured. With a 32.768kHz clock source, the minimum counter tick interval is 30.5µs, and time-out periods can range up to 36 hours. With the counter tick interval configured to 1s, the maximum time-out period is more than 136 years.

## 18.2 Features

z 32-bit counter with 10-bit prescaler

z Multiple clock sources

z 32-bit or 16-bit Counter mode

z One 32-bit or two 16-bit compare values

z Clock/Calendar mode

z Time in seconds, minutes and hours (12/24)

z Date in day of month, month and year

z Leap year correction

z Digital prescaler correction/tuning for increased accuracy

z Overflow, alarm/compare match and prescaler interrupts and events

z Optional clear on alarm/compare match

## 18.3 Block Diagram

Figure 18-1. RTC Block Diagram (Mode 0 — 32-Bit Counter)

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_0da230d3f2e8dae5f492bd81fa33510c9848e96c44cb836c22ca5b66b2e596fb.jpg)

Figure 18-2. RTC Block Diagram (Mode 1 — 16-Bit Counter)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_ba51b0a81bfc78a8fde382bd9646d88db8efb7c7280b700b7cca7a055519e331.jpg)

Figure 18-3. RTC Block Diagram (Mode 2 — Clock/Calendar)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_d18fd525a7cc3c011ac29a4fa1b582faedf5bebe7ea5b85d6a75d4c1d2199ad7.jpg)

## 18.4 Signal Description

Not applicable.

## 18.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 18.5.1 I/O Lines

Not applicable.

## 18.5.2 Power Management

The RTC can continue to operate in any sleep mode. The RTC interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

The RTC will be reset only at power-on (POR) or by writing a one to the Software Reset bit in the Control register (CTRL.SWRST).

## 18.5.3 Clocks

The RTC bus clock (CLK\_RTC\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_RTC\_APB can be found in the Peripheral Clock Masking section in the “PM – Power Manager” on page 110.

A generic clock (GCLK\_RTC) is required to clock the RTC. This clock must be configured and enabled in the Generic Clock Controller before using the RTC. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the user interface clock (CLK\_RTC\_APB). Due to this asynchronicity, accessing certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 234 for further details.

The RTC should never be used with the generic clock generator 0.

## 18.5.4 DMA

Not applicable.

## 18.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the RTC interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 18.5.6 Events

To use the RTC event functionality, the corresponding events need to be configured in the event system. Refer to “EVSYS – Event System” on page 405 for details.

## 18.5.7 Debug Operation

When the CPU is halted in debug mode the RTC will halt normal operation. The RTC can be forced to continue operation during debugging. Refer to the DBGCTRL register for details.

## 18.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

Interrupt Flag Status and Clear register ( INTFLAG)

Read Request register (READREQ)

Status register (STATUS)

Debug register (DBGCTRL)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 18.5.9 Analog Connections

A 32.768kHz crystal can be connected to the XIN32 and XOUT32 pins, along with any required load capacitors. For details on recommended crystal characteristics and load capacitors, refer to “Electrical Characteristics” on page 858 for details.

## 18.6 Functional Description

## 18.6.1 Principle of Operation

The RTC keeps track of time in the system and enables periodic events, as well as interrupts and events at a specified time. The RTC consists of a 10-bit prescaler that feeds a 32-bit counter. The actual format of the 32-bit counter depends on the RTC operating mode.

## 18.6.2 Basic Operation

## 18.6.2.1 Initialization

The following bits are enable-protected, meaning that they can only be written when the RTC is disabled (CTRL.ENABLE is zero):

Operating Mode bits in the Control register (CTRL.MODE)

Prescaler bits in the Control register (CTRL.PRESCALER)

Clear on Match bit in the Control register (CTRL.MATCHCLR)

z Clock Representation bit in the Control register (CTRL.CLKREP)

The following register is enable-protected:

● Event Control register (EVCTRL)

Any writes to these bits or registers when the RTC is enabled or being enabled (CTRL.ENABLE is one) will be discarded. Writes to these bits or registers while the RTC is being disabled will be completed after the disabling is complete.

Enable-protection is denoted by the Enable-Protection property in the register description.

Before the RTC is enabled, it must be configured, as outlined by the following steps:

z RTC operation mode must be selected by writing the Operating Mode bit group in the Control register (CTRL.MODE)

z Clock representation must be selected by writing the Clock Representation bit in the Control register (CTRL.CLKREP)

z Prescaler value must be selected by writing the Prescaler bit group in the Control register (CTRL.PRESCALER)

The RTC prescaler divides down the source clock for the RTC counter. The frequency of the RTC clock (CLK\_RTC\_CNT) is given by the following formula:

$$
f _ {\mathrm {CLK\_RTC\_CNT}} = \frac {f _ {\mathrm {GCLK\_RTC}}}{2 ^ {\mathrm{PRESCALER}}}
$$

The frequency of the generic clock, GCLK\_RTC, is given by f<sub>GCLK\_RTC</sub>, and $\mathsf { f } _ { \mathsf { C L K \_ R T C \_ C N T } }$ is the frequency of the internal prescaled RTC clock, CLK\_RTC\_CNT.

Note that in the Clock/Calendar mode, the prescaler must be configured to provide a 1Hz clock to the counter for correct operation.

## 18.6.2.2 Enabling, Disabling and Resetting

The RTC is enabled by writing a one to the Enable bit in the Control register (CTRL.ENABLE). The RTC is disabled by writing a zero to CTRL.ENABLE.

The RTC should be disabled before resetting it.

The RTC is reset by writing a one to the Software Reset bit in the Control register (CTRL.SWRST). All registers in the RTC, except DBGCTRL, will be reset to their initial state, and the RTC will be disabled.

Refer to the CTRL register for details.

## 18.6.3 Operating Modes

The RTC counter supports three RTC operating modes: 32-bit Counter, 16-bit Counter and Clock/Calendar. The operating mode is selected by writing to the Operating Mode bit group in the Control register (CTRL.MODE).

## 18.6.3.1 32-Bit Counter (Mode 0)

When the RTC Operating Mode bits in the Control register (CTRL.MODE) are zero, the counter operates in 32-bit Counter mode. The block diagram of this mode is shown in Figure 18-1. When the RTC is enabled, the counter wil increment on every 0-to-1 transition of CLK\_RTC\_CNT. The counter will increment until it reaches the top value of 0xFFFFFFFF, and then wrap to 0x00000000. This sets the Overflow interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.OVF).

The RTC counter value can be read from or written to the Counter Value register (COUNT) in 32-bit format.

The counter value is continuously compared with the 32-bit Compare registers (COMP0n, n=0–1). When a compare match occurs, the Compare 0n interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.CMP0n) is set on the next 0-to-1 transition of CLK\_RTC\_CNT.

If the Clear on Match bit in the Control register (CTRL.MATCHCLR) is one, the counter is cleared on the next counter cycle when a compare match with COMP0n occurs. This allows the RTC to generate periodic interrupts or events with longer periods than are possible with the prescaler events. Note that when CTRL.MATCHCLR is one, INTFLAG.CMP0n and INTFLAG.OVF will both be set simultaneously on a compare match with COMP0n.

## 18.6.3.2 16-Bit Counter (Mode 1)

When CTRL.MODE is one, the counter operates in 16-bit Counter mode as shown in Figure 18-2. When the RTC is enabled, the counter will increment on every 0-to-1 transition of CLK\_RTC\_CNT. In 16-bit Counter mode, the 16-bit Period register (PER) holds the maximum value of the counter. The counter will increment until it reaches the PER value, and then wrap to 0x0000. This sets the Overflow interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.OVF).

The RTC counter value can be read from or written to the Counter Value register (COUNT) in 16-bit format.

The counter value is continuously compared with the 16-bit Compare registers (COMPn, n=0–1). When a compare match occurs, the Compare n interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.CMPn, n=0–1) is set on the next 0-to-1 transition of CLK\_RTC\_CNT.

## 18.6.3.3 Clock/Calendar (Mode 2)

When CTRL.MODE is two, the counter operates in Clock/Calendar mode, as shown in Figure 18-3. When the RTC is enabled, the counter will increment on every 0-to-1 transition of CLK\_RTC\_CNT. The selected clock source and RTC prescaler must be configured to provide a 1Hz clock to the counter for correct operation in this mode.

The time and date can be read from or written to the Clock Value register (CLOCK) in a 32-bit time/date format. Time is represented as:

Seconds

z Minutes

Hours

Hours can be represented in either 12- or 24-hour format, selected by the Clock Representation bit in the Control register (CTRL.CLKREP). This bit can be changed only while the RTC is disabled.

Date is represented as:

z Day as the numeric day of the month (starting at 1)

● Month as the numeric month of the year (1 = January, 2 = February, etc.)

z Year as a value counting the offset from a reference value that must be defined in software

The date is automatically adjusted for leap years, assuming every year divisible by 4 is a leap year. Therefore, the reference value must be a leap year, e.g. 2000. The RTC will increment until it reaches the top value of 23:59:59 December 31<sup>st</sup> of year 63, and then wrap to 00:00:00 January 1<sup>st</sup> of year 0. This will set the Overflow interrupt flag in the Interrupt Flag Status and Clear registers (INTFLAG.OVF).

The clock value is continuously compared with the 32-bit Alarm registers (ALARM0n, n=0–1). When an alarm match occurs, the Alarm 0n Interrupt flag in the Interrupt Flag Status and Clear registers (INTFLAG.ALARMn0) is set on the next 0-to-1 transition of CLK\_RTC\_CNT. For a 1 Hz clock counter, it means the Alarm 0 Interrupt flag is set with a delay of 1 sec after the occurrence of alarm match.

A valid alarm match depends on the setting of the Alarm Mask Selection bits in the Alarm 0n Mask register (MASK0n.SEL). These bits determine which time/date fields of the clock and alarm values are valid for comparison and which are ignored.

If the Clear on Match bit in the Control register (CTRL.MATCHCLR) is one, the counter is cleared on the next counter cycle when an alarm match with ALARM0n occurs. This allows the RTC to generate periodic interrupts or events with longer periods than are possible with the prescaler events (see “Periodic Events” on page 232). Note that when CTRL.MATCHCLR is one, INTFLAG.ALARM0 and INTFLAG.OVF will both be set simultaneously on an alarm match with ALARM0n.

## 18.6.4 Additional Features

## 18.6.4.1 Periodic Events

The RTC prescaler can generate events at periodic intervals, allowing flexible system tick creation. Any of the upper eight bits of the prescaler (bits 2 to 9) can be the source of an event. When one of the Periodic Event Output bits in the Event Control register (EVCTRL.PEREOn) is one, an event is generated on the 0-to1 transition of the related bit in the prescaler, resulting in a periodic event frequency of:

$$
f _ {P E R I O D I C} = \frac {f _ {G C L K \_ R T C}}{2 ^ {n + 3}}
$$

$\mathsf { f } _ { \mathsf { G C L K \_ R T C } }$ is the frequency of the internal prescaler clock, GCLK\_RTC, and n is the position of the EVCTRL.PEREOn bit. For example, PEREO will generate an event every 8 GCLK\_RTC cycles, PEREO1 every 16 cycles, etc. This is shown in Figure 18-4. Periodic events are independent of the prescaler setting used by the RTC counter, except if CTRL.PRESCALER is zero. Then, no periodic events will be generated.

Figure 18-4. Example Periodic Events  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_a2a5e6cb61eeeb7ac60529d8401f17a83dab4f8f1aba06cc01455131a90c296a.jpg)

## 18.6.4.2 Frequency Correction

The RTC Frequency Correction module employs periodic counter corrections to compensate for a too-slow or too-fast oscillator. Frequency correction requires that CTRL.PRESCALER is greater than 1.

The digital correction circuit adds or subtracts cycles from the RTC prescaler to adjust the frequency in approximately 1PPM steps. Digital correction is achieved by adding or skipping a single count in the prescaler once every 1024 GCLK\_RTC cycles. The Value bit group in the Frequency Correction register (FREQCORR.VALUE) determines the number of times the adjustment is applied over 976 of these periods. The resulting correction is as follows:

$$
\text { Correction   in   PPM } = \frac {\text { FREQCORR.VALUE }}{1 0 2 4 \cdot 9 7 6} \cdot 1 0 ^ {6} \text { PPM }
$$

This results in a resolution of 1.0006PPM.

The Sign bit in the Frequency Correction register (FREQCORR.SIGN) determines the direction of the correction. A positive value will speed up the frequency, and a negative value will slow down the frequency.

Digital correction also affects the generation of the periodic events from the prescaler. When the correction is applied at the end of the correction cycle period, the interval between the previous periodic event and the next occurrence may also be shortened or lengthened depending on the correction value.

## 18.6.5 DMA Operation

Not applicable.

## 18.6.6 Interrupts

The RTC has the following interrupt sources:

z Overflow (INTFLAG.OVF)

z Compare n (INTFLAG.CMPn)

z Alarm n (INTFLAG.ALARMn)

z Synchronization Ready (INTFLAG.SYNCRDY)

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the RTC is reset. See INTFLAG for details on how to clear interrupt flags. The RTC has one common interrupt request line for all the interrupt sources. The user must read INTFLAG to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 18.6.7 Events

The RTC can generate the following output events, which are generated in the same way as the corresponding interrupts:

z Overflow (OVF)

z Period n (PERn)

z Compare n (CMPn)

z Alarm n (ALARMn)

Output events must be enabled to be generated. Writing a one to an Event Output bit in the Event Control register (EVCTRL.xxEO) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event. Refer to “EVSYS – Event System” on page 405 for details.

## 18.6.8 Sleep Mode Operation

The RTC will continue to operate in any sleep mode where the source clock is active. The RTC interrupts can be used to wake up the device from a sleep mode, or the RTC events can trigger other operations in the system without exiting the sleep mode.

An interrupt request will be generated after the wake-up if the Interrupt Controller is configured accordingly. Otherwise the CPU will wake up directly, without triggering an interrupt. In this case, the CPU will continue executing from the instruction following the entry into sleep.

The periodic events can also wake up the CPU through the interrupt function of the Event System. In this case, the event must be enabled and connected to an event channel with its interrupt enabled. See “EVSYS – Event System” on page 405 for more information.

## 18.6.8.1 Shutdown Mode

Any of the RTC interrupt sources can wake up the device from the Shutdown mode if the RTC clock is configured to use a clock that is available in Shutdown mode. The wake-up sources are enabled if the corresponding bit in the Interrupt Enable registers (INTENCLR/SET) is one

When waking up from Shutdown mode, all RTC registers will have the same value as before the Shutdown mode was entered, except the following registers: Interrupt Enable (INTENCLR/SET), Read Request (READREQ), Interrupt Flag Status and Clear (INTFLAG) and Debug (DBGCTRL). Note that INTENCLR/SET will be reset, with all interrupts turned off. The software must first reconfigure the Interrupt Controller, and then enable the interrupts again in the RTC. The Status register (STATUS) will show the status of the RTC, including the status bits set during shutdown operation.

When waking up the system from shutdown, the CPU will start executing code from the reset start address.

## 18.6.9 Synchronization

Due to the asynchronicity between CLK\_RTC\_APB and GCLK\_RTC some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete. The synchronization Ready interrupt can be used to signal when sync is complete. This can be accessed via the Synchronization Ready Interrupt Flag in the Interrupt Flag Status and Clear register (INTFLAG.SYNCRDY).

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following bits need synchronization when written:

Software Reset bit in the Control register (CTRL.SWRST)

● Enable bit in the Control register (CTRL.ENABLE)

The following registers need synchronization when written:

The Counter Value register (COUNT)

z The Clock Value register (CLOCK)

z The Counter Period register (PER)

z The Compare n Value registers (COMPn)

z The Alarm n Value registers (ALARMn)

z The Frequency Correction register (FREQCORR)

z The Alarm n Mask register (MASKn)

Write-synchronization is denoted by the Write-Synchronization property in the register description.

The following registers need synchronization when read:

The Counter Value register (COUNT)

The Clock Value register (CLOCK)

Read-synchronization is denoted by the Read-Synchronization property in the register description.

## 18.7 Register Summary

The register mapping depends on the Operating Mode bits in the Control register (CTRL.MODE). The register summary is presented for each of the three modes.

Table 18-1. MODE0 - Mode Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRL</td><td>7:0</td><td>MATCHCLR</td><td></td><td></td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">PRESCALER[3:0]</td></tr><tr><td>0x02</td><td rowspan="2">READREQ</td><td>7:0</td><td></td><td></td><td colspan="6">ADDR[5:0]</td></tr><tr><td>0x03</td><td>15:8</td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="2">EVCTRL</td><td>7:0</td><td>PEREO7</td><td>PEREO6</td><td>PEREO5</td><td>PEREO4</td><td>PEREO3</td><td>PEREO2</td><td>PEREO1</td><td>PEREO0</td></tr><tr><td>0x05</td><td>15:8</td><td>OVFEO</td><td></td><td></td><td></td><td></td><td></td><td></td><td>CMPEO0</td></tr><tr><td>0x06</td><td>INTENCLR</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>CMP0</td></tr><tr><td>0x07</td><td>INTENSET</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>CMP0</td></tr><tr><td>0x08</td><td>INTFLAG</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>CMP0</td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x0C</td><td>FREQCORR</td><td>7:0</td><td>SIGN</td><td colspan="7">VALUE[6:0]</td></tr><tr><td>0x0D ... 0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">COUNT</td><td>7:0</td><td colspan="8">COUNT[7:0]</td></tr><tr><td>0x11</td><td>15:8</td><td colspan="8">COUNT[15:8]</td></tr><tr><td>0x12</td><td>23:16</td><td colspan="8">COUNT[23:16]</td></tr><tr><td>0x13</td><td>31:24</td><td colspan="8">COUNT[31:24]</td></tr><tr><td>0x14 ... 0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">COMP0</td><td>7:0</td><td colspan="8">COMP[7:0]</td></tr><tr><td>0x19</td><td>15:8</td><td colspan="8">COMP[15:8]</td></tr><tr><td>0x1A</td><td>23:16</td><td colspan="8">COMP[23:16]</td></tr><tr><td>0x1B</td><td>31:24</td><td colspan="8">COMP[31:24]</td></tr></table>

Table 18-2. MODE1 - Mode Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">PRESCALER[3:0]</td></tr><tr><td>0x02</td><td rowspan="2">READREQ</td><td>7:0</td><td></td><td></td><td colspan="6">ADDR[5:0]</td></tr><tr><td>0x03</td><td>15:8</td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="2">EVCTRL</td><td>7:0</td><td>PEREO7</td><td>PEREO6</td><td>PEREO5</td><td>PEREO4</td><td>PEREO3</td><td>PEREO2</td><td>PEREO1</td><td>PEREO0</td></tr><tr><td>0x05</td><td>15:8</td><td>OVFEO</td><td></td><td></td><td></td><td></td><td></td><td>CMPEO1</td><td>CMPEO0</td></tr><tr><td>0x06</td><td>INTENCLR</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td>CMP1</td><td>CMP0</td></tr><tr><td>0x07</td><td>INTENSET</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td>CMP1</td><td>CMP0</td></tr><tr><td>0x08</td><td>INTFLAG</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td>CMP1</td><td>CMP0</td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x0C</td><td>FREQCORR</td><td>7:0</td><td>SIGN</td><td colspan="7">VALUE[6:0]</td></tr><tr><td>0x0D ... 0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="2">COUNT</td><td>7:0</td><td colspan="8">COUNT[7:0]</td></tr><tr><td>0x11</td><td>15:8</td><td colspan="8">COUNT[15:8]</td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="2">PER</td><td>7:0</td><td colspan="8">PER[7:0]</td></tr><tr><td>0x15</td><td>15:8</td><td colspan="8">PER[15:8]</td></tr><tr><td>0x16</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="2">COMP0</td><td>7:0</td><td colspan="8">COMP[7:0]</td></tr><tr><td>0x19</td><td>15:8</td><td colspan="8">COMP[15:8]</td></tr><tr><td>0x1A</td><td rowspan="2">COMP1</td><td>7:0</td><td colspan="8">COMP[7:0]</td></tr><tr><td>0x1B</td><td>15:8</td><td colspan="8">COMP[15:8]</td></tr></table>

Table 18-3. MODE2 - Mode Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRL</td><td>7:0</td><td>MATCHCLR</td><td>CLKREP</td><td></td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">PRESCALER[3:0]</td></tr><tr><td>0x02</td><td rowspan="2">READREQ</td><td>7:0</td><td></td><td></td><td colspan="6">ADDR[5:0]</td></tr><tr><td>0x03</td><td>15:8</td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="2">EVCTRL</td><td>7:0</td><td>PEREO7</td><td>PEREO6</td><td>PEREO5</td><td>PEREO4</td><td>PEREO3</td><td>PEREO2</td><td>PEREO1</td><td>PEREO0</td></tr><tr><td>0x05</td><td>15:8</td><td>OVFEO</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ALARMEO0</td></tr><tr><td>0x06</td><td>INTENCLR</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>ALARM0</td></tr><tr><td>0x07</td><td>INTENSET</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>ALARM0</td></tr><tr><td>0x08</td><td>INTFLAG</td><td>7:0</td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>ALARM0</td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x0C</td><td>FREQCORR</td><td>7:0</td><td>SIGN</td><td colspan="7">VALUE[6:0]</td></tr><tr><td>0x0D ... 0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">CLOCK</td><td>7:0</td><td colspan="2">MINUTE[1:0]</td><td colspan="6">SECOND[5:0]</td></tr><tr><td>0x11</td><td>15:8</td><td colspan="3">HOUR[3:0]</td><td colspan="5">MINUTE[5:2]</td></tr><tr><td>0x12</td><td>23:16</td><td colspan="2">MONTH[1:0]</td><td colspan="5">DAY[4:0]</td><td>HOUR[4]</td></tr><tr><td>0x13</td><td>31:24</td><td colspan="6">YEAR[5:0]</td><td colspan="2">MONTH[3:2]</td></tr><tr><td>0x14...0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">ALARM</td><td>7:0</td><td colspan="2">MINUTE[1:0]</td><td colspan="6">SECOND[5:0]</td></tr><tr><td>0x19</td><td>15:8</td><td colspan="3">HOUR[3:0]</td><td colspan="5">MINUTE[5:2]</td></tr><tr><td>0x1A</td><td>23:16</td><td colspan="2">MONTH[1:0]</td><td colspan="5">DAY[4:0]</td><td>HOUR[4]</td></tr><tr><td>0x1B</td><td>31:24</td><td colspan="5">YEAR[5:0]</td><td colspan="3">MONTH[3:2]</td></tr><tr><td>0x1C</td><td>MASK</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="4">SEL[2:0]</td></tr></table>

## 18.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Please refer to “Register Access Protection” on page 229 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Please refer to “Synchronization” on page 234 for details.

Some registers are enable-protected, meaning they can only be written when the RTC is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 18.8.1 Control - MODE0

Name: CTRL

Offset: 0x00

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">PRESCALER[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>MATCHCLR</td><td></td><td></td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 11:8 – PRESCALER[3:0]: Prescaler

These bits define the prescaling factor for the RTC clock source (GCLK\_RTC) to generate the counter clock (CLK\_RTC\_CNT).

These bits are not synchronized.

Table 18-4. Prescaler

<table><tr><td>PRESCALER[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>CLK_RTC_CNT = GCLK_RTC/1</td></tr><tr><td>0x1</td><td>DIV2</td><td>CLK_RTC_CNT = GCLK_RTC/2</td></tr><tr><td>0x2</td><td>DIV4</td><td>CLK_RTC_CNT = GCLK_RTC/4</td></tr><tr><td>0x3</td><td>DIV8</td><td>CLK_RTC_CNT = GCLK_RTC/8</td></tr><tr><td>0x4</td><td>DIV16</td><td>CLK_RTC_CNT = GCLK_RTC/16</td></tr><tr><td>0x5</td><td>DIV32</td><td>CLK_RTC_CNT = GCLK_RTC/32</td></tr><tr><td>0x6</td><td>DIV64</td><td>CLK_RTC_CNT = GCLK_RTC/64</td></tr><tr><td>0x7</td><td>DIV128</td><td>CLK_RTC_CNT = GCLK_RTC/128</td></tr><tr><td>0x8</td><td>DIV256</td><td>CLK_RTC_CNT = GCLK_RTC/256</td></tr><tr><td>0x9</td><td>DIV512</td><td>CLK_RTC_CNT = GCLK_RTC/512</td></tr><tr><td>0xA</td><td>DIV1024</td><td>CLK_RTC_CNT = GCLK_RTC/1024</td></tr><tr><td>0xb-0xf</td><td></td><td>Reserved</td></tr></table>

## z Bit 7 – MATCHCLR: Clear on Match

This bit is valid only in Mode 0 and Mode 2.

0: The counter is not cleared on a Compare/Alarm 0 match.

1: The counter is cleared on a Compare/Alarm 0 match.

This bit is not synchronized.

## Bits 6:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 3:2 – MODE[1:0]: Operating Mode

These bits define the operating mode of the RTC.

These bits are not synchronized.

Table 18-5. Operating Mode

<table><tr><td>MODE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>COUNT32</td><td>Mode 0: 32-bit Counter</td></tr><tr><td>0x1</td><td>COUNT16</td><td>Mode 1: 16-bit Counter</td></tr><tr><td>0x2</td><td>CLOCK</td><td>Mode 2: Clock/Calendar</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization, there is delay from writing CTRL.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately, and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete. This bit is not enable-protected.

## ● Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the RTC, except DBGCTRL, to their initial state, and the RTC will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded.

Due to synchronization, there is a delay from writing CTRL.SWRST until the reset is complete. CTRL.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

This bit is not enable-protected.

## 18.8.2 Control - MODE1

Name: CTRL

Offset: 0x00

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">PRESCALER[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 11:8 – PRESCALER[3:0]: Prescaler

These bits define the prescaling factor for the RTC clock source (GCLK\_RTC) to generate the counter clock (CLK\_RTC\_CNT).

These bits are not synchronized.

Table 18-6. Prescaler

<table><tr><td>PRESCALER[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>CLK_RTC_CNT = GCLK_RTC/1</td></tr><tr><td>0x1</td><td>DIV2</td><td>CLK_RTC_CNT = GCLK_RTC/2</td></tr><tr><td>0x2</td><td>DIV4</td><td>CLK_RTC_CNT = GCLK_RTC/4</td></tr><tr><td>0x3</td><td>DIV8</td><td>CLK_RTC_CNT = GCLK_RTC/8</td></tr><tr><td>0x4</td><td>DIV16</td><td>CLK_RTC_CNT = GCLK_RTC/16</td></tr><tr><td>0x5</td><td>DIV32</td><td>CLK_RTC_CNT = GCLK_RTC/32</td></tr><tr><td>0x6</td><td>DIV64</td><td>CLK_RTC_CNT = GCLK_RTC/64</td></tr><tr><td>0x7</td><td>DIV128</td><td>CLK_RTC_CNT = GCLK_RTC/128</td></tr><tr><td>0x8</td><td>DIV256</td><td>CLK_RTC_CNT = GCLK_RTC/256</td></tr><tr><td>0x9</td><td>DIV512</td><td>CLK_RTC_CNT = GCLK_RTC/512</td></tr><tr><td>0xA</td><td>DIV1024</td><td>CLK_RTC_CNT = GCLK_RTC/1024</td></tr><tr><td>0xb-0xf</td><td></td><td>Reserved</td></tr></table>

## Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 3:2 – MODE[1:0]: Operating Mode

These bits define the operating mode of the RTC.

These bits are not synchronized.

Table 18-7. Operating Mode

<table><tr><td>MODE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>COUNT32</td><td>Mode 0: 32-bit Counter</td></tr><tr><td>0x1</td><td>COUNT16</td><td>Mode 1: 16-bit Counter</td></tr><tr><td>0x2</td><td>CLOCK</td><td>Mode 2: Clock/Calendar</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization, there is delay from writing CTRL.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately, and the Synchronization Busy bit in the Status registe (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete.

This bit is not enable-protected.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the RTC, except DBGCTRL, to their initial state, and the RTC will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded.

Due to synchronization, there is a delay from writing CTRL.SWRST until the reset is complete. CTRL.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

This bit is not enable-protected.

## 18.8.3 Control - MODE2

Name: CTRL

Offset: 0x00

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">PRESCALER[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>MATCHCLR</td><td>CLKREP</td><td></td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 11:8 – PRESCALER[3:0]: Prescaler

These bits define the prescaling factor for the RTC clock source (GCLK\_RTC) to generate the counter clock (CLK\_RTC\_CNT).

These bits are not synchronized.

Table 18-8. Prescaler

<table><tr><td>PRESCALER[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>CLK_RTC_CNT = GCLK_RTC/1</td></tr><tr><td>0x1</td><td>DIV2</td><td>CLK_RTC_CNT = GCLK_RTC/2</td></tr><tr><td>0x2</td><td>DIV4</td><td>CLK_RTC_CNT = GCLK_RTC/4</td></tr><tr><td>0x3</td><td>DIV8</td><td>CLK_RTC_CNT = GCLK_RTC/8</td></tr><tr><td>0x4</td><td>DIV16</td><td>CLK_RTC_CNT = GCLK_RTC/16</td></tr><tr><td>0x5</td><td>DIV32</td><td>CLK_RTC_CNT = GCLK_RTC/32</td></tr><tr><td>0x6</td><td>DIV64</td><td>CLK_RTC_CNT = GCLK_RTC/64</td></tr><tr><td>0x7</td><td>DIV128</td><td>CLK_RTC_CNT = GCLK_RTC/128</td></tr><tr><td>0x8</td><td>DIV256</td><td>CLK_RTC_CNT = GCLK_RTC/256</td></tr><tr><td>0x9</td><td>DIV512</td><td>CLK_RTC_CNT = GCLK_RTC/512</td></tr><tr><td>0xA</td><td>DIV1024</td><td>CLK_RTC_CNT = GCLK_RTC/1024</td></tr><tr><td>0xb-0xf</td><td></td><td>Reserved</td></tr></table>

## Bit 7 – MATCHCLR: Clear on Match

This bit is valid only in Mode 0 and Mode 2. This bit can be written only when the peripheral is disabled. 0: The counter is not cleared on a Compare/Alarm 0 match.

1: The counter is cleared on a Compare/Alarm 0 match.

This bit is not synchronized.

## z Bit 6 – CLKREP: Clock Representation

This bit is valid only in Mode 2 and determines how the hours are represented in the Clock Value (CLOCK) register. This bit can be written only when the peripheral is disabled.

0: 24 Hour

1: 12 Hour (AM/PM)

This bit is not synchronized.

## z Bits 5:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 3:2 – MODE[1:0]: Operating Mode

These bits define the operating mode of the RTC.

These bits are not synchronized.

Table 18-9. Operating Mode

<table><tr><td>MODE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>COUNT32</td><td>Mode 0: 32-bit Counter</td></tr><tr><td>0x1</td><td>COUNT16</td><td>Mode 1: 16-bit Counter</td></tr><tr><td>0x2</td><td>CLOCK</td><td>Mode 2: Clock/Calendar</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization, there is delay from writing CTRL.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately, and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete. This bit is not enable-protected.

## Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the RTC, except DBGCTRL, to their initial state, and the RTC will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded.

Due to synchronization, there is a delay from writing CTRL.SWRST until the reset is complete. CTRL.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

This bit is not enable-protected.

## 18.8.4 Read Request

Name: READREQ

Offset: 0x02

Reset: 0x0010

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="6">ADDR[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 15 – RREQ: Read Request

Writing a zero to this bit has no effect.

Writing a one to this bit requests synchronization of the register pointed to by the Address bit group (READ REQ.ADDR) and sets the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY).

## ● Bit 14 – RCONT: Read Continuously

Writing a zero to this bit disables continuous synchronization.

Writing a one to this bit enables continuous synchronization of the register pointed to by READREQ.ADDR. The register value will be synchronized automatically every time the register is updated. READREQ.RCONT prevents READREQ.RREQ from clearing automatically.

This bit is cleared when the register pointed to by READREQ.ADDR is written.

## Bits 13:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 5:0 – ADDR[5:0]: Address

These bits select the offset of the register that needs read synchronization. In the RTC only COUNT and CLOCK, which share the same address, are available for read synchronization. Therefore, ADDR is a read-only constant of 0x10.

## 18.8.5 Event Control - MODE0

Name: EVCTRL

Offset: 0x04

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>OVFEO</td><td></td><td></td><td></td><td></td><td></td><td></td><td>CMPEO0</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PEREO7</td><td>PEREO6</td><td>PEREO5</td><td>PEREO4</td><td>PEREO3</td><td>PEREO2</td><td>PEREO1</td><td>PEREO0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 15 – OVFEO: Overflow Event Output Enable

0: Overflow event is disabled and will not be generated.

1: Overflow event is enabled and will be generated for every overflow.

## z Bits 14:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bit 8 – CMPEO: Compare x Event Output Enable

0: Compare 0 event is disabled and will not be generated.

1: Compare 0 event is enabled and will be generated for every compare match.

## z Bits 7:0 – PEREOx [x=7..0]: Periodic Interval x Event Output Enable

0: Periodic Interval x event is disabled and will not be generated.

1: Periodic Interval x event is enabled and will be generated.

## 18.8.6 Event Control - MODE1

Name: EVCTRL

Offset: 0x04

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>OVFEO</td><td></td><td></td><td></td><td></td><td></td><td>CMPEO1</td><td>CMPEO0</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PEREO7</td><td>PEREO6</td><td>PEREO5</td><td>PEREO4</td><td>PEREO3</td><td>PEREO2</td><td>PEREO1</td><td>PEREO0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 15 – OVFEO: Overflow Event Output Enable

0: Overflow event is disabled and will not be generated.

1: Overflow event is enabled and will be generated for every overflow.

## z Bits 14:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 9:8 – CMPEOx [x=1..0]: Compare x Event Output Enable

0: Compare x event is disabled and will not be generated.

1: Compare x event is enabled and will be generated for every compare match.

z Bits 7:0 – PEREOx [x=7..0]: Periodic Interval x Event Output Enable

0: Periodic Interval x event is disabled and will not be generated.

1: Periodic Interval x event is enabled and will be generated.

## 18.8.7 Event Control - MODE2

Name: EVCTRL

Offset: 0x04

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>OVFEO</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ALARME00</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PEREO7</td><td>PEREO6</td><td>PEREO5</td><td>PEREO4</td><td>PEREO3</td><td>PEREO2</td><td>PEREO1</td><td>PEREO0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 15 – OVFEO: Overflow Event Output Enable

0: Overflow event is disabled and will not be generated.

1: Overflow event is enabled and will be generated for every overflow.

## z Bits 14:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 8 – ALARMEO: Alarm x Event Output Enable

0: Alarm 0 event is disabled and will not be generated.

1: Alarm 0 event is enabled and will be generated for every alarm.

## z Bits 7:0 – PEREOx [x=7..0]: Periodic Interval x Event Output Enable

0: Periodic Interval x event is disabled and will not be generated.

1: Periodic Interval x event is enabled and will be generated.

## 18.8.8 Interrupt Enable Clear - MODE0

Name: INTENCLR

Offset: 0x06

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>CMP0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## ● Bit 7 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled, and an interrupt request will be generated when the Overflow interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overflow Interrupt Enable bit and disable the corresponding interrupt.

## z Bit 6 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled, and an interrupt request will be generated when the Synchroni zation Ready interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready Interrupt Enable bit and disable the corresponding interrupt.

## z Bits 5:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 0 – CMP: Compare x Interrupt Enable

0: The Compare 0 interrupt is disabled.

1: The Compare 0 interrupt is enabled, and an interrupt request will be generated when the Compare x interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Compare 0 Interrupt Enable bit and disable the corresponding interrupt.

## 18.8.9 Interrupt Enable Clear - MODE1

Name: INTENCLR

Offset: 0x06

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td>CMP1</td><td>CMP0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled, and an interrupt request will be generated when the Overflow interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overflow Interrupt Enable bit and disable the corresponding interrupt.

## z Bit 6 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled, and an interrupt request will be generated when the Synchronization Ready interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready Interrupt Enable bit and disable the corresponding interrupt.

## Bits 5:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 1:0 – CMPx [x=1..0]: Compare x Interrupt Enable

0: The Compare x interrupt is disabled.

1: The Compare x interrupt is enabled, and an interrupt request will be generated when the Compare x interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Compare x Interrupt Enable bit and disable the corresponding interrupt.

## 18.8.10 Interrupt Enable Clear - MODE2

Name: INTENCLR

Offset: 0x06

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>ALARM0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled, and an interrupt request will be generated when the Overflow interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overflow Interrupt Enable bit and disable the corresponding interrupt.

## z Bit 6 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The synchronization ready interrupt is disabled.

1: The synchronization ready interrupt is enabled, and an interrupt request will be generated when the Synchroni zation Ready interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready Interrupt Enable bit and disable the corresponding interrupt.

## Bits 5:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – ALARM: Alarm x Interrupt Enable

0: The Alarm 0 interrupt is disabled.

1: The Alarm 0 interrupt is enabled, and an interrupt request will be generated when the Alarm 0 interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit disables the Alarm 0 interrupt.

## 18.8.11 Interrupt Enable Set - MODE0

Name: INTENSET

Offset: 0x07

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>CMP0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear (INTENCLR) register.

## ● Bit 7 – OVF: Overflow Interrupt Enable

0: The overflow interrupt is disabled.

1: The overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overflow Interrupt Enable bit and enable the Overflow interrupt.

## Bit 6 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The synchronization ready interrupt is disabled.

1: The synchronization ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Synchronization Ready Interrupt Enable bit and enable the Synchronization Ready interrupt.

## z Bits 5:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – CMP: Compare x Interrupt Enable

0: The compare 0 interrupt is disabled.

1: The compare 0 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Compare 0 Interrupt Enable bit and enable the Compare 0 interrupt.

## 18.8.12 Interrupt Enable Set - MODE1

Name: INTENSET

Offset: 0x07

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td>CMP1</td><td>CMP0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow Interrupt Enable

0: The overflow interrupt is disabled.

1: The overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overflow interrupt bit and enable the Overflow interrupt.

## z Bit 6 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The synchronization ready interrupt is disabled.

1: The synchronization ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Synchronization Ready Interrupt Enable bit and enable the Synchronization Ready interrupt.

## z Bits 5:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 1:0 – CMPx [x=1..0]: Compare x Interrupt Enable

0: The compare x interrupt is disabled.

1: The compare x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Compare x Interrupt Enable bit and enable the Compare x interrupt.

## 18.8.13 Interrupt Enable Set - MODE2

Name: INTENSET

Offset: 0x07

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>ALARM0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow Interrupt Enable

0: The overflow interrupt is disabled.

1: The overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overflow Interrupt Enable bit and enable the Overflow interrupt.

## z Bit 6 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The synchronization ready interrupt is disabled.

1: The synchronization ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Synchronization Ready Interrupt bit and enable the Synchronization Ready interrupt.

## z Bits 5:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – ALARM: Alarm x Interrupt Enable

0: The alarm 0 interrupt is disabled.

1: The alarm 0 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Alarm 0 Interrupt Enable bit and enable the Alarm 0 interrupt.

## 18.8.14 Interrupt Flag Status and Clear - MODE0

Name: INTFLAG

Offset: 0x08

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>CMP0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow

This flag is cleared by writing a one to the flag.

This flag is set on the next CLK\_RTC\_CNT cycle after an overflow condition occurs, and an interrupt request will be generated if INTENCLR/SET.OVF is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Overflow interrupt flag.

## z Bit 6 – SYNCRDY: Synchronization Ready

This flag is cleared by writing a one to the flag.

This flag is set on a 1-to-0 transition of the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY), except when caused by enable or software reset, and an interrupt request will be generated if INTEN-CLR/SET.SYNCRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Synchronization Ready interrupt flag.

## Bits 5:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 0 – CMP: Compare x

This flag is cleared by writing a one to the flag.

This flag is set on the next CLK\_RTC\_CNT cycle after a match with the compare condition, and an interrupt request will be generated if INTENCLR/SET.CMP0 is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Compare 0 interrupt flag.

## 18.8.15 Interrupt Flag Status and Clear - MODE1

Name: INTFLAG

Offset: 0x08

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td>CMP1</td><td>CMP0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow

This flag is cleared by writing a one to the flag.

This flag is set on the next CLK\_RTC\_CNT cycle after an overflow condition occurs, and an interrupt request will be generated if INTENCLR/SET.OVF is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Overflow interrupt flag.

## z Bit 6 – SYNCRDY: Synchronization Ready

This flag is cleared by writing a one to the flag.

This flag is set on a 1-to-0 transition of the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY), except when caused by enable or software reset, and an interrupt request will be generated if INTEN-CLR/SET.SYNCRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Synchronization Ready interrupt flag.

## ● Bits 5:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 1:0 – CMPx [x=1..0]: Compare x

This flag is cleared by writing a one to the flag.

This flag is set on the next CLK\_RTC\_CNT cycle after a match with the compare condition , and an interrupt request will be generated if INTENCLR/SET.CMPx is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Compare x interrupt flag.

## 18.8.16 Interrupt Flag Status and Clear - MODE2

Name: INTFLAG

Offset: 0x08

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>OVF</td><td>SYNCRDY</td><td></td><td></td><td></td><td></td><td></td><td>ALARM0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – OVF: Overflow

This flag is cleared by writing a one to the flag.

This flag is set on the next CLK\_RTC\_CNT cycle after an overflow condition occurs, and an interrupt request will be generated if INTENCLR/SET.OVF is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Overflow interrupt flag.

## z Bit 6 – SYNCRDY: Synchronization Ready

This flag is cleared by writing a one to the flag.

This flag is set on a 1-to-0 transition of the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY), except when caused by enable or software reset, and an interrupt request will be generated if INTEN-CLR/SET.SYNCRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Synchronization Ready interrupt flag.

## z Bits 5:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – ALARM: Alarm x

This flag is cleared by writing a one to the flag.

This flag is set on the next CLK\_RTC\_CNT cycle after a match with ALARM0 condition occurs , and an interrupt request will be generated if INTENCLR/SET.ALARM0 is also one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Alarm 0 interrupt flag.

## 18.8.17 Status

Name: STATUS

Offset: 0x0A

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 18.8.18 Debug Control

Name: DBGCTRL

Offset: 0x0B

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 0 – DBGRUN: Run During Debug

This bit is not reset by a software reset.

Writing a zero to this bit causes the RTC to halt during debug mode.

Writing a one to this bit allows the RTC to continue normal operation during debug mode.

## 18.8.19 Frequency Correction

Name: FREQCORR

Offset: 0x0C

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SIGN</td><td colspan="7">VALUE[6:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SIGN: Correction Sign

0: The correction value is positive, i.e., frequency will be increased.

1: The correction value is negative, i.e., frequency will be decreased.

## z Bits 6:0 – VALUE[6:0]: Correction Value

These bits define the amount of correction applied to the RTC prescaler.

0: Correction is disabled and the RTC frequency is unchanged.

1–127: The RTC frequency is adjusted according to the value.

## 18.8.20 Counter Value - MODE0

Name: COUNT

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">COUNT[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COUNT[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – COUNT[31:0]: Counter Value These bits define the value of the 32-bit RTC counter.

## 18.8.21 Counter Value - MODE1

Name: COUNT

Offset: 0x10

Reset: 0x0000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – COUNT[15:0]: Counter Value These bits define the value of the 16-bit RTC counter.

## 18.8.22 Clock Value - MODE2

Name: CLOCK

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="6">YEAR[5:0]</td><td colspan="2">MONTH[3:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="2">MONTH[1:0]</td><td colspan="5">DAY[4:0]</td><td>HOUR[4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="4">HOUR[3:0]</td><td colspan="4">MINUTE[5:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">MINUTE[1:0]</td><td colspan="6">SECOND[5:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:26 – YEAR[5:0]: Year

The year offset with respect to the reference year (defined in software). The year is considered a leap year if YEAR[1:0] is zero.

z Bits 25:22 – MONTH[3:0]: Month

1 – January

2 – February

12 – December

● Bits 21:17 – DAY[4:0]: Day

Day starts at 1 and ends at 28, 29, 30 or 31, depending on the month and year.

z Bits 16:12 – HOUR[4:0]: Hour

When CTRL.CLKREP is zero, the Hour bit group is in 24-hour format, with values 0-23. When CTRL.CLKREP is one, HOUR[3:0] has values 1-12 and HOUR[4] represents AM (0) or PM (1).

Table 18-10. Hour

<table><tr><td>HOUR[4:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0-0xf</td><td></td><td>Reserved</td></tr><tr><td>0x10</td><td>PM</td><td>Afternoon Hour</td></tr><tr><td>0x11-0x1f</td><td></td><td>Reserved</td></tr></table>

z Bits 11:6 – MINUTE[5:0]: Minute 0 – 59.

Bits 5:0 – SECOND[5:0]: Second 0– 59.

## 18.8.23 Counter Period - MODE1

Name: PER

Offset: 0x14

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PER[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">PER[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – PER[15:0]: Counter Period These bits define the value of the 16-bit RTC period.

## 18.8.24 Compare n Value - MODE0

Name: COMP

Offset: 0x18

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">COMP[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COMP[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COMP[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COMP[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – COMP[31:0]: Compare Value The 32-bit value of COMPn is continuously compared with the 32-bit COUNT value. When a match occurs, the Compare n interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.CMPn) is set on the next counte cycle, and the counter value is cleared if CTRL.MATCHCLR is one.

## 18.8.25 Compare n Value - MODE1

Name: COMPn

Offset: 0x18+n\*0x2 [n=0..1]

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COMP[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COMP[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – COMP[15:0]: Compare Value

The 16-bit value of COMPn is continuously compared with the 16-bit COUNT value. When a match occurs, the Compare n interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.CMPn) is set on the next counter cycle.

## 18.8.26 Alarm n Value - MODE2

Name: ALARM

Offset: 0x18

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="6">YEAR[5:0]</td><td colspan="2">MONTH[3:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="2">MONTH[1:0]</td><td colspan="5">DAY[4:0]</td><td>HOUR[4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="4">HOUR[3:0]</td><td colspan="4">MINUTE[5:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">MINUTE[1:0]</td><td colspan="6">SECOND[5:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

The 32-bit value of ALARM0 is continuously compared with the 32-bit CLOCK value, based on the masking set by MASKn.SEL. When a match occurs, the Alarm 0 interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.ALARMn) is set on the next counter cycle, and the counter is cleared if CTRL.MATCHCLR is one.

● Bits 31:26 – YEAR[5:0]: Year

The alarm year. Years are only matched if MASKn.SEL is 6.

z Bits 25:22 – MONTH[3:0]: Month

The alarm month. Months are matched only if MASKn.SEL is greater than 4.

● Bits 21:17 – DAY[4:0]: Day

The alarm day. Days are matched only if MASKn.SEL is greater than 3.

z Bits 16:12 – HOUR[4:0]: Hour

The alarm hour. Hours are matched only if MASKn.SEL is greater than 2.

z Bits 11:6 – MINUTE[5:0]: Minute

The alarm minute. Minutes are matched only if MASKn.SEL is greater than 1.

## ● Bits 5:0 – SECOND[5:0]: Second

The alarm second. Seconds are matched only if MASKn.SEL is greater than 0.

## 18.8.27 Alarm n Mask - MODE2

Name: MASK

Offset: 0x1C

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">SEL[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 2:0 – SEL[2:0]: Alarm Mask Selection

These bits define which bit groups of Alarm n are valid.

Table 18-11. Alarm Mask Selection

<table><tr><td>SEL[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>OFF</td><td>Alarm Disabled</td></tr><tr><td>0x1</td><td>SS</td><td>Match seconds only</td></tr><tr><td>0x2</td><td>MMSS</td><td>Match seconds and minutes only</td></tr><tr><td>0x3</td><td>HHMMSS</td><td>Match seconds, minutes, and hours only</td></tr><tr><td>0x4</td><td>DDHHMMSS</td><td>Match seconds, minutes, hours, and days only</td></tr><tr><td>0x5</td><td>MMDDHHMMSS</td><td>Match seconds, minutes, hours, days, and months only</td></tr><tr><td>0x6</td><td>YYMMDDHHMMSS</td><td>Match seconds, minutes, hours, days, months, and years</td></tr><tr><td>0x7</td><td></td><td>Reserved</td></tr></table>

## 19. DMAC – Direct Memory Access Controller

## 19.1 Overview

The Direct Memory Access Controller (DMAC) contains both a Direct Memory Access engine and a Cyclic Redundancy Check (CRC) engine. The DMAC can transfer data between memories and peripherals, and thus offload these tasks from the CPU. It enables high data transfer rates with minimum CPU intervention, and frees up CPU time. With access to all peripherals, the DMAC can handle automatic transfer of data between communication modules.

For the DMA part of the DMAC, it has several DMA channels which all can receive different types of transfer triggers, which will result in transfer requests from the DMA channels to the arbiter. Refer to Figure 19-1. The arbiter will grant one DMA channel at a time to act as the active channel. When the active channel has been granted, the fetch engine of the DMAC will fetch a transfer descriptor from SRAM into the internal memory of the active channel, before the active channel starts its data transmission. A DMA channel's data transfer can be interrupted by a higher prioritized channel. The DMAC will write back the updated transfer descriptor from the internal memory of the active channel to SRAM, before the higher prioritized channel gets to start its transfer. Once a DMA channel is done with its transfer optionally interrupts and events can be generated.

As one can see from Figure 19-1, the DMAC has four bus interfaces. The data transfer bus, which is used for performing the actual DMA transfer is an AHB master interface. The AHB/APB Bridge bus is an APB slave interface and is the bus used when writing and reading the I/O registers of the DMAC. The descriptor fetch bus is an AHB master interface and is used by the fetch engine, to fetch transfer descriptors from SRAM before a transfer can be started or continued. At last there is the write-back bus, which is an AHB master interface and it is used to write the transfer descriptor back to SRAM.

As mentioned, the DMAC also has a CRC module available. This can be used by software to detect an accidenta error in the transferred data and to take corrective action, such as requesting the data to be sent again or simply not using the incorrect data.

## 19.2 Features

z Data transfer between

z Peripheral to peripheral

z Peripheral to memory

z Memory to peripheral

z Memory to memory

z Transfer trigger sources

z Software

z Events from Event System

z Dedicated requests from peripherals

z SRAM based transfer descriptors

z Single transfer using one descriptor

z Multi-buffer or circular buffer modes by linking multiple descriptors

z 6 channels

z Enable 6 independent transfers

z Automatic descriptor fetch for each channel

z Suspend/resume operation support for each channel

z Flexible arbitration scheme

z 4 configurable priority levels for each channel

z Fixed or round-robin priority scheme within each priority level

z From 1 to 256kB data transfer in a single block transfer

z Multiple addressing modes

z Static

z Configurable increment scheme

z Optional interrupt generation

z On block transfer complete

z On error detection

z On channel suspend

## z 4 event inputs

z One event input for each of the 4 least significant DMA channels

z Can be selected to trigger normal transfers, periodic transfers or conditional transfers

z Can be selected to suspend or resume channel operation

## z 4 event outputs

z One output event for each of the 4 least significant DMA channels

z Selectable generation on AHB, burst, block or transaction transfer complete

z Error management supported by write-back function

z Dedicated Write-Back memory section for each channel to store ongoing descriptor transfer

z CRC polynomial software selectable to

z CRC-16 (CRC-CCITT)

z CRC-32 (IEEE 802.3)

## 19.3 Block Diagram

Figure 19-1. DMAC Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_808afae994ed8be73c5be6ded9b1fb0d6a87a80a757b6a2ddf5d9f7011eeea8c.jpg)

## 19.4 Signal Description

Not applicable.

## 19.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 19.5.1 I/O Lines

Not applicable.

## 19.5.2 Power Management

The DMAC will continue to operate in any sleep mode where the selected source clock is running. The DMAC’s interrupts can be used to wake up the device from sleep modes. Events connected to the event system can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes. On hardware or software reset, all registers are set to their reset value.

## 19.5.3 Clocks

The DMAC bus clock (CLK\_DMAC\_APB) can be enabled and disabled in the power manager, and the default state of CLK\_DMAC\_APB can be found in “Peripheral Clock Masking” on page 116.

An AHB clock (CLK\_DMAC\_AHB) is required to clock the DMAC. This clock must be configured and enabled in the power manager before using the DMAC, and the default state of CLK\_DMAC\_AHB can be found in “Peripheral Clock Masking” on page 116.

This bus clock (CLK\_DMAC\_APB) is always synchronous to the module clock (CLK\_DMAC\_AHB), but can be divided by a prescaler and may run even when the module clock is turned off.

## 19.5.4 DMA

Not applicable.

## 19.5.5 Interrupts

The interrupt request line is connected to the interrupt controller. Using the DMAC interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 19.5.6 Events

The events are connected to the event system. Refer to “EVSYS – Event System” on page 405 for details on how to configure the Event System.

## 19.5.7 Debug Operation

When the CPU is halted in debug mode the DMAC will halt normal operation. The DMAC can be forced to continue operation during debugging. Refer to DBGCTRL for details.

## 19.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

z Interrupt Pending (INTPEND) register

Channel ID (CHID) register

Channel Interrupt Flag Status and Clear (CHINTFLAG) register

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply to accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 19.5.9 Analog Connections

Not applicable.

## 19.6 Functional Description

## 19.6.1 Principle of Operation

The DMAC consists of a DMA module and a CRC module.

The DMAC can, without interaction from the CPU, transfer data between peripherals and memories. The data transferred by the DMAC are called transactions, and these transactions can be split into smaller data transfers. Figure 19-2 shows the relationship between the different transfer sizes.

Figure 19-2. DMA Transfer Sizes  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_2e1a680ac7e9e8d8a5320077f44c5cfb13df5587e857d817f5a55325a641fb15.jpg)

z Beat transfer: Defined as the size of one data transfer bus access, and the size is selected by writing the Beat Size bit group in the Block Transfer Control register (BTCTRL.BEATSIZE)

z Burst transfer: Defined as n beat transfers, where n will differ from one device family to another. For this device family, n is 1. A burst transfer is atomic, and cannot be interrupted.

z Block transfer: The amount of data one transfer descriptor can transfer, and the amount can range from 1 to 64k beats. In contrast to the burst transfer, a block transfer can be interrupted.

z Transaction: The DMAC can link several transfer descriptors by having the first descriptor pointing to the second and so forth, as shown in Figure 19-2. A DMA transaction is defined as all block transfers within a linked list, being completed.

A transfer descriptor describes how a block transfer should be carried out by the DMAC, and it must remain in SRAM. For further details on the transfer descriptor refer to “Transfer Descriptors” on page 276.

Figure 19-2 shows several block transfers linked together, which are called linked descriptors. For further information about linked descriptors, refer to “Linked Descriptors” on page 283.

A DMA transfer is initiated by an incoming transfer trigger on one of the DMA channels. This trigger can be configured to be either a software trigger, an event trigger or one of the dedicated peripheral triggers. The transfer trigger will result in a DMA transfer request from the specific channel to the arbiter, and if there are several DMA channels with pending transfer requests, the arbiter has to choose which channel to grant access to become the active channel. The DMA channel granted access as the active channel will carry out the transaction as configured in the transfer descriptor. The DMA channel can be interrupted by a higher prioritized channel after each burst transfer, but will resume its block transfer when it is granted access as the active channel again.

For each beat transfer an optional output event can be generated, and for each block transfer optional interrupts and an optional output event can be generated. When a transaction is completed, dependent of the configuration, the DMA channel will either be suspended or disabled.

## 19.6.1.2 CRC

The internal CRC supports two commonly used CRC polynomials; CRC-16 (CRC-CCITT) and CRC-32 (IEEE 802.3). It can be used with selectable DMA channel or independently, with I/O interface.

## 19.6.2 Basic Operation

## 19.6.2.1 Initialization

The following DMAC registers are enable-protected, meaning that they can only be written when the DMAC is disabled (CTRL.DMAENABLE is zero):

z Descriptor Base Memory Address (BASEADDR) register

Write-Back Memory Base Address (WRBADDR) register

The following DMAC bit is enable-protected, meaning that it can only be written when both the DMAC and CRC are disabled (CTRL.DMAENABLE and CTRL.CRCENABLE is zero):

Software Reset bit in Control register (CTRL.SWRST)

The following DMA channel register is enable-protected, meaning that it can only be written when the corresponding DMA channel is disabled (CHCTRLA.ENABLE is zero):

z Channel Control B (CHCTRLB) register, except the Command (CHCTRLB.CMD) and Channel Arbitration Level (CHCTRLB.LVL) bits

The following DMA channel bit is enable-protected, meaning that it can only be written when the corresponding DMA channel is disabled:

z Channel Software Reset bit in Channel Control A register (CHCTRLA.SWRST)

The following CRC registers are enable-protected, meaning that they can only be written when the CRC is disabled (CTRL.CRCENABLE is zero):

CRC Control (CRCCTRL) register

CRC Checksum (CRCCHKSUM) register

Enable-protection is denoted by the Enable-Protected property in the register description.

Before the DMAC is enabled, it must be configured, as outlined by the following steps:

z The SRAM address of where the descriptor memory section is located must be written to the Description Base Address (BASEADDR) register

z The SRAM address of where the write-back section should be located must be written to the Write-Back Memory Base Address (WRBADDR) register

Priority level x of the arbiter can be enabled by writing a one to the Priority Level x Enable bit in the Contro register(CTRL.LVLENx)

Before a DMA channel is enabled, the DMA channel and the corresponding first transfer descriptor must be configured, as outlined by the following steps:

z DMA channel configurations

z The channel number of the DMA channel to configure must be written to the Channel ID (CHID) register

z Trigger action must be selected by writing the Trigger Action bit group in the Channel Control B register (CHCTRLB.TRIGACT)

z Trigger source must be selected by writing the Trigger Source bit group in the Channel Control B register (CHCTRLB.TRIGSRC)

## Transfer Descriptor

The size of each access of the data transfer bus must be selected by writing the Beat Size bit group in the Block Transfer Control register (BTCTRL.BEATSIZE)

The transfer descriptor must be made valid by writing a one to the Valid bit in the Block Transfer Contro register (BTCTRL.VALID)

Number of beats in the block transfer must be selected by writing the Block Transfer Count (BTCNT) register

Source address for the block transfer must be selected by writing the Block Transfer Source Address (SRCADDR) register

Destination address for the block transfer must be selected by writing the Block Transfer Destination Address (DSTADDR) register

If CRC calculation is needed the CRC module must be configured before it is enabled, as outlined by the following steps:

z CRC input source must selected by writing the CRC Input Source bit group in the CRC Control register (CRCCTRL.CRCSRC)

Type of CRC calculation must be selected by writing the CRC Polynomial Type bit group in the CRC Control register (CRCCTRL.CRCPOLY)

If I/O is chosen as input source, the beat size must be selected by writing the CRC Beat Size bit group in the CRC Control register (CRCCTRL.CRCBEATSIZE)

## 19.6.2.2 Enabling, Disabling and Resetting

The DMAC is enabled by writing a one to the DMA Enable bit in the Control register (CTRL.DMAENABLE). The DMAC is disabled by writing a zero to CTRL.DMAENABLE.

A DMA channel is enabled by writing a one to Enable bit in the Channel Control A register (CHCTRLA.ENABLE), after writing the corresponding channel id to the Channel ID bit group in the Channel ID register (CHID.ID). A DMA channel is disabled by writing a zero to CHCTRLA.ENABLE.

The CRC is enabled by writing a one to the CRC Enable bit in the Control register (CTRL.CRCENABLE). The CRC is disabled by writing a zero to CTRL.CRCENABLE.

The DMAC is reset by writing a one to the Software Reset bit in the Control register (CTRL.SWRST), when the DMAC and CRC are disabled. All registers in the DMAC, except DBGCTRL, will be reset to their initial state.

A DMA channel is reset by writing a one to the Software Reset bit in the Channel Control A register (CHCTRLA.SWRST), after writing the corresponding channel id to the Channel ID bit group in the Channel ID register (CHID.ID). The channel registers will be reset to their initial state. The corresponding DMA channel must be disabled in order for the reset to take effect.

## 19.6.2.3 Transfer Descriptors

Together with the channel configurations the transfer descriptors decides how a block transfer should be executed. Before a DMA channel is enabled (CHCTRLA.ENABLE is written to one), and receives a transfer trigger, its first transfer descriptor has to be initialized and valid (BTCTRL.VALID). The first transfer descriptor describes the first block transfer of a transaction. For further details on the content of a transfer descriptor, refer to “Block Transfer Control” on page 329.

All transfer descriptors must reside in SRAM and the addresses stored in the Descriptor Memory Section Base Address (BASEADDR) and Write-Back Memory Section Base Address (WRBADDR) registers tells the DMAC where to find the descriptor memory section and the write-back memory section.

The descriptor memory section is where the DMAC expects to find the first transfer descriptors for all DMA channels. As BASEADDR points only to the first transfer descriptor of channel 0, refer to Figure 19-3, all first transfer descriptors must be stored in a contiguous memory section, where the transfer descriptors must be ordered according to their channel number. Figure 19-3 shows an example of linked descriptors on DMA channel 0. For further details on linked descriptors, refer to “Linked Descriptors” on page 283.

The write-back memory section is the section where the DMAC stores the transfer descriptors for the ongoing block transfers. WRBADDR points to the ongoing transfer descriptor of channel 0. All ongoing transfer descriptors will be stored in a contiguous memory section where the transfer descriptors are ordered according to their channel number. Figure 19-3 shows an example of linked descriptors on DMA channel 0. For further details on linked descriptors, refer to “Linked Descriptors” on page 283.

Figure 19-3. Memory Sections  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_150dfc642654e666fff4d4d93a86626f6d02f934f54fba16881327c61fa601c1.jpg)  
The size of the descriptor and write-back memory sections is dependant on most significant enabled DMA channel, as shown below:

$$
\text { Size } = 1 2 8 \text { bits } \cdot (\text { MostSignificantEnabledChannelNumber } + 1)
$$

For memory optimization, it is recommended to always use the less significant DMA channels if not all channels are required.

The descriptor and write-back memory sections can either be two separate memory sections, or they can share memory section (BASEADDR=WRBADDR). The benefit of having them in two separate sections, is that the same transaction for a channel can be repeated without having to modify the first transfer descriptor. The benefit of having descriptor memory and write-back memory in the same section is that it requires less SRAM. In addition, the latency from fetching the first descriptor of a transaction to the first burst transfer is executed, is reduced.

## 19.6.2.4 Arbitration

If a DMA channel is enabled and not suspended when it receives a transfer trigger, it will send a transfer request to the arbiter. When the arbiter receives the transfer request it will include the DMA channel in the queue of channels having pending transfers, and the corresponding Pending Channel x bit in the Pending Channels registers (PENDCH.PENDCHx) will be set. Dependent of the arbitration scheme, the arbiter will choose which DMA channel will be the next active channel. Refer to Figure 19-4. The active channel is the DMA channel being granted access to perform its next burst transfer. When the arbiter has granted a DMA channel access to the DMAC, the corresponding PENDCH.PENDCHx will be cleared. Depending on if the upcoming burst transfer is the first for the transfer request or not, the corresponding Busy Channel x bit in the Busy Channels register (BUSYCH.BUSYCHx) will either be set or remain one. When the channel has performed its granted burst transfer(s) it will either be fed into the queue of channels with pending transfers, set to be waiting for a new transfer trigger, it will be suspended or it will be disabled. This depends on the channel and block transfer configuration. If the DMA channel is fed into the queue of channels with pending transfers, the corresponding BUSYCH.BUSYCHx will remain one. If the DMA channel is set to wait for a new transfer trigger, suspended or disabled, the corresponding BUSYCH.BUSYCHx will be cleared.

If a DMA channel is suspended while it has a pending transfer, it will be removed from the queue of pending channels, but the corresponding PENDCH.PENDCHx will remain set. When the same DMA channel is resumed, it will be added to the queue of pending channels again. If a DMA channel gets disabled(CHCTRLA.ENABLE is zero) while it has a pending transfer, it will be removed from the queue of pending channels, and the corresponding PENDCH.PENDCHx will be cleared.

Figure 19-4. Arbiter overview  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_8895ae5558db269122dcfcfc518c3d5cd16d4a7f8ee4f8e844153329259c87ca.jpg)

When a channel level is pending or the channel is transferring data, the corresponding Level Executing bit is set in the Active Channel and Levels register (ACTIVE.LVLEXx).

Each DMA channel supports a 4-level priority scheme. The priority level for a channel is configured by writing to the Channel Arbitration Level bit group in the Channel Control B register(CHCTRLB.LVL). As long as all priority levels are enabled, a channel with lower priority level number will have priority over a channel with higher priority level number. A priority level is enabled by writing the Priority Level x Enable bit in the Control register(CTRL.LVLENx) to one, for the corresponding level.

Within each priority level the DMAC's arbiter can be configured to prioritize statically or dynamically. For the arbiter to perform static arbitration within a priority level, the Level x Round-Robin Scheduling Enable bit in the Priority Control 0 register (PRICTRL0.RRLVLENx) has to be written to zero. When static arbitration is enabled (PRICTRL0.RRLVLENx is zero), the arbiter will prioritize a low channel number over a high channel number as shown in Figure 19-5. When using the static scheme there is a risk of high channel numbers never being granted access as the active channel. This can be avoided using a dynamic arbitration scheme.

## Figure 19-5. Static priority

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_9a561bdfa6edc92426e3ac3bf7a48c4ac115da9fa624c3de5b7f9aeea71e85c0.jpg)

The dynamic arbitration scheme available in the DMAC is round-robin. Round-robin arbitration is enabled by writing PRICTRL0.RRLVLENx to one, for a given priority level x. With the round-robin scheme, the channel number of the last channel being granted access will have the lowest priority the next time the arbiter has to grant access to a channel within the same priority level, as shown in Figure 19-6. The channel number of the last channel being granted access as the active channel, will be stored in the Level x Channel Priority Number bit group in the Priority Control 0 register(PRICTRL0.LVLPRIx), for the corresponding priority level.

Figure 19-6. Round-robin scheduling  
Channel (x+1) last acknowledged request  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_85987293e495248eb2971c63c965addcc35c2577a678ba8c47df32e0c5ad0185.jpg)

## 19.6.2.5 Data Transmission

Before the DMAC can perform a data transmission, a DMA channel has to be configured and enabled, its corresponding transfer descriptor has to be initialized and the arbiter has to grant the DMA channel access as the active channel.

Once the arbiter has granted a DMA channel access as the active channel (refer to Figure 19-1) the transfer descriptor for the DMA channel will be fetched from SRAM using the fetch bus, and stored in the internal memory fo the active channel. Depending on if it is a new or ongoing block transfer, the transfer descriptor will either be fetched from the descriptor memory section (BASEADDR) or the write-back memory section (WRBADDR). By using the data transfer bus, the DMAC will read the data from the current source address and write it to the current destination address. For further details on how the current source and destination addresses are calculated, refer to “Addressing” on page 281.

The arbitration procedure is performed after each burst transfer. If the current DMA channel is granted access again, the block transfer counter (BTCNT) of the internal transfer descriptor will be decremented with the number of beats in a burst, and the active channel will perform a new burst transfer. If a different DMA channel than the current active channel is granted access, the BTCNT of the internal transfer descriptor will be decremented with the number of beats in a burst. The block transfer counter value will be written to the write-back section before the transfer descriptor of the newly granted DMA channel is fetched into the internal memory of the active channel. The optional output event, Beat, will be generated if configured and enabled.

When a block transfer has come to its end, BTCNT has reached zero, the Valid bit in the Block Transfer Contro register will be written to zero in the internal transfer descriptor for the active channel before the entire transfer descriptor is written to the write-back memory. The optional interrupts, Channel Transfer Complete and Channel Suspend, and the optional output event, Block, will be generated if configured and enabled. If it was the last block transfer in a transaction, Next Address (DESCADDR) register will hold the value 0x00000000, and the DMA channel will either be suspended or disabled, depending on the configuration in the Block Action bit group in the Block Transfer Control register(BTCTRL.BLOCKACT). If the transaction has further block transfers pending, DESCADDR will hold the SRAM address to the next transfer descriptor to be fetched. The DMAC will fetch the next descriptor into the internal memory of the active channel and write its content to the write-back section for the channel, before the arbiter gets to choose the next active channel.

## 19.6.2.6 Transfer Triggers and Actions

A DMA transfer can be started only when a DMA transfer request is detected. A transfer request can be triggered from software, from peripheral, or from an event. There are dedicated Trigger Source selections for each DMA Channel Control B (CHCTRLB.TRIGSRC).

The trigger actions are available in the Trigger Action bit group in the Channel Control B register (CHCTRLB.TRIGACT). By default, a trigger starts a block transfer operation. If a single descriptor is defined for a channel, the channel is automatically disabled when a block transfer is complete. If a list of linked descriptors is defined for a channel, the channel is automatically disabled if the last descriptor in the list is executed or the channel will be waiting for the next block transfer trigger if the list still has descriptors to execute. When enabled again, the channel will wait for the next block transfer trigger. It is also possible to select the trigger to start beat or transaction transfers instead of a block transfer.

If the trigger source generates a transfer request during an ongoing transfer, this will be kept pending

(CHSTATUS.PEND is one), and the transfer can start when the ongoing one is done. Only one pending transfer can be kept, and so if the trigger source generates more transfer requests when one is already pending, these will be lost All channels pending status flags are also available in the Pending Channels register (PENDCH).

When the transfer starts, the corresponding Channel Busy status flag is set in Channel Status register (CHSTATUS.BUSY). When the trigger action is complete, the Channel Busy status flag is cleared. All channels busy status flags are also available in the Busy Channels register (BUSYCH) in DMAC.

Figure 19-7 on page 281 shows an example where triggers are used with two linked block descriptors.

Figure 19-7. Trigger action and transfers Beat Trigger Action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_c212ef0eb950c8130611339a18e4ce5e90e2139035b6a2be80149a720eb2f107.jpg)

Block Trigger Action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_16fc0dd2ec25f0eed0447df4098d8b8e64b6b7e6221282f365edac95b0716307.jpg)

Transaction Trigger Action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_b912379d31d8266c4a1f133b72625f7f433020a6a4ff9d9f3325a18555302915.jpg)

## 19.6.2.7 Addressing

For the DMAC to know from where to where it should transfer the data, each block transfer needs to have a source and destination address defined. The source address can be set by writing the Transfer Source Address (SRCADDR) register, and the destination address can be set by writing the Transfer Destination Address (SRCADDR) register.

The addressing of this DMAC module can be static or incremental, for either source or destination of a block transfer, or both.

Incrementation for the source address of a block transfer is enabled by writing the Source Address Incrementation Enable bit in the Block Transfer Control register (BTCTRL.SRCINC) to one. The step size of the incrementation is configurable and can be chosen by writing the Step Selection bit in the Block Transfer Contro

register(BTCTRL.STEPSEL) to one, and the Address Increment Step Size bit group in the Block Transfer Contro register (BTCTRL.STEPSIZE), to the desired step size. If BTCTRL.STEPSEL is zero, the step size for the source incrementation will be the size of one beat.

When source address incrementation is configured (BTCTRL.SRCINC is one), SRCADDR must be set to the source address of the last beat transfer in the block transfer. The source address should be calculated as follows:

$$
S R C A D D R = S R C A D D R _ {S T A R T} + B T C N T \cdot (B E A T S I Z E + 1) \cdot 2 ^ {S T E P S I Z E}
$$

, where BTCTRL.STEPSEL is one

$$
S R C A D D R = S R C A D D R _ {S T A R T} + B T C N T \cdot (B E A T S I Z E + 1)
$$

, where BTCTRL.STEPSEL is zero

z SRCADDRSTART is the source address of the first beat transfer in the block transfer

z BTCNT is the initial number of beats remaining in the block transfer

z BEATSIZE is the configured number of bytes in a beat

z STEPSIZE is the configured number of beats for each incrementation

Figure 19-8 shows an example where DMA channel 0 is configured to increment the source address by one beat (BTCTRL.SRCINC is one) after each beat transfer, and DMA channel 1 is configured to increment source address by two beats (BTCTRL.SRCINC is one, BTCTRL.STEPSEL is one, and BTCTRL.STEPSIZE is 0x1). As the destination address for both channels are peripherals, destination incrementation is disabled(BTCTRL.DSTINC is zero).

Figure 19-8. Source address increment  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_6bb08a233c9a9030575b416cc0bba68a3147de1be8adaf3f068927df88374e72.jpg)

Incrementation for the destination address of a block transfer is enabled by writing the Destination Address Incrementation Enable bit in the Block Transfer Control register (BTCTRL.DSTINC) to one. The step size of the incrementation is configurable and can be chosen by writing BTCTRL.STEPSEL to zero, and BTCTRL.STEPSIZE to the desired step size. If BTCTRL.STEPSEL is one, the step size for the destination incrementation will be the size of one beat.

When destination address incrementation is configured (BTCTRL.DSTINC is one), SRCADDR must be set to the destination address of the last beat transfer in the block transfer. The destination address should be calculated as follows:

$$
D S T A D D R = D S T A D D R _ {S T A R T} + B T C N T \cdot (B E A T S I Z E + 1) \cdot 2 ^ {S T E P S I Z E}
$$

, where BTCTRL.STEPSEL is zero

$$
D S T A D D R = D S T A D D R _ {S T A R T} + B T C N T \cdot (B E A T S I Z E + 1)
$$

, where BTCTRL.STEPSEL is one

z DSTADDRSTART is the destination address of the first beat transfer in the block transfer

z BTCNT is the initial number of beats remaining in the block transfer

z BEATSIZE is the configured number of bytes in a beat

z STEPSIZE is the configured number of beats for each incrementation

Figure 19-9 shows an example where DMA channel 0 is configured to increment destination address by one beat (BTCTRL.DSTINC is one) and DMA channel 1 is configured to increment destination address by two beats (BTCTRL.DSTINC is one, BTCTRL.STEPSEL is zero, and BTCTRL.STEPSIZE is 0x1). As the source address for both channels are peripherals, source incrementation is disabled(BTCTRL.SRCINC is zero).

Figure 19-9. Destination address increment  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_166a2f3ddb39511a1f86512dd5931add546ced7febd3d8ccbee533b7580ccbb2.jpg)

## 19.6.2.8 Error Handling

If a bus error is received from AHB slave during a DMA data transfer, the corresponding active channel is disabled and the corresponding Channel Transfer Error Interrupt flag in the Channel Interrupt Status and Clear register (CHINTFLAG.TERR) is set. If transfer error interrupt is enabled, optional error interrupt is generated. The transfer counter will not be decremented and its current value is written-back in the write-back memory section before the channel is disabled.

When the DMAC fetches an invalid descriptor (BTCTRL.VALID is zero) or when the channel is resumed and the DMA fetches the next descriptor with null address (DESCADDR is 0x00000000), the corresponding channel operation is suspended, the Channel Suspend Interrupt Flag in the Channel Interrupt Flag Status and Clear register (CHINTFLAG.SUSP) is set and the Channel Fetch Error bit in the Channel Status register (CHSTATUS.FERR) is set. If enabled, optional suspend interrupt is generated.

## 19.6.3 Additional Features

## 19.6.3.1 Linked Descriptors

A transaction can either consist of a single block transfer, or it can consist of several block transfers. When a transaction consist of several block transfers it is called linked descriptors.

Figure 19-3 shows how linked descriptors work. When the first block transfer is completed on DMA channel 0, the DMAC fetches the next transfer descriptor which is pointed to by the value stored in the Next Descriptor Address (DESCADDR) register, in the first transfer descriptor. Fetching the next transfer descriptor (DESCADDR) is continued until the last transfer descriptor. When the block transfer for the last transfer descriptor is executed and DESCADDR=0x00000000, the transaction is terminated. For further details on how the next descriptor is fetched from SRAM, refer to “Data Transmission” on page 279.

## Adding Descriptor to the End of a List

To add a new descriptor at the end of the descriptor list, create the descriptor in SRAM, with

DESCADDR=0x00000000 indicating it is the new last descriptor in the list, and modify the DESCADDR value of the current last descriptor to the address of the newly created descriptor.

## Modifying a Descriptor in a List

In order to add descriptors to a list, the following actions must be performed:

1. Before enabling a channel, the Suspend interrupt must be enabled

2. Reserve memory space addresses to configure a new descriptor

3. Configure the new descriptor

z Set the next descriptor address (DESCADDR)

z Set the destination address (DSTADDR)

z Set the source address (SRCADDR)

z Configure the block transfer control (BTCTRL) including

z Optionally enable the Suspend block action

z Set the descriptor VALID bit

4. In the existing list and for the descriptor which has to be updated, set the VALID bit to zero

5. Read DESCADDR from the Write-Back memory

z If the DMA has not already fetched the descriptor which requires changes:

z Update the DESCADDR location of the descriptor from the List

z Optionally clear the Suspend block action

z Set the descriptor VALID bit to one

z Optionally enable the Resume software command

z If the DMA is executing the same descriptor as the one which requires changes:

z Set the Channel Suspend software command and wait for the Suspend interrupt

z Update the Write-Back next descriptor address (DESCRADDR)

z Clear the interrupt sources and set the Resume software command

z Update the DESCADDR location of the descriptor from the List

z Optionally clear the Suspend block action

Set the descriptor VALID bit to one

## 6. Go to step 3 if needed

## Adding a Descriptor Between Existing Descriptors

To insert a descriptor C between 2 existing descriptors (A & B), the descriptor currently executed by the DMA must be identified.

1. If DMA is executing descriptor B, descriptor C cannot be inserted.

2. If DMA has not started to execute descriptor A, follow the steps:

a. Set the descriptor A VALID bit to 0

b. Set the DESCADDR value of descriptor A to point descriptor C instead of descriptor B

c. Set the DESCADDR value of descriptor C to point descriptor B

d. Set the descriptor A VALID bit to 1.

3. If DMA is executing descriptor A,

a. Apply the software suspend command to the channel and

b. Perform steps 2a through 2d

Apply the software resume command to the channel.

## 19.6.3.2 Channel Suspend

The channel operation can be suspended at anytime by software, by setting the Suspend command in Command bit field of Channel Control B register (CHCTRLB.CMD). When the ongoing burst transfer is completed, the channel operation is suspended and the suspend command is automatically cleared.

It is also possible to suspend a channel operation after a block transfer completes. The software must set the Suspend Block Action in the corresponding Block Transfer Control location (BTCTRL.BLOCKACT). When the block transfer is completed, the channel operation is suspended. The channel is kept enabled, can receive transfer triggers but it will be removed from the arbitration scheme. The channel will automatically suspend the operation if an invalid transfer control descriptor is fetched from system memory (BTCTRL.VALID=0). The Channel Fetch Error bit in the Channel Status register (CHSTATUS.FERR) is set when an invalid descriptor is fetched. Only an enabled channe can be suspended. If the channel is disabled when suspended, the internal suspend command is cleared. When suspended, the Channel Suspend Interrupt flag in the Channel Interrupt Status and Clear register (CHINTFLAG.SUSP) is set and optional suspend interrupt is generated.

For more details on transfer descriptors, refer to “Transfer Descriptors” on page 276.

## 19.6.3.3 Channel Resume and Next Suspend Skip

A channel operation can be resumed by software by setting the Resume command in Command bitfield of Channel Control B register (CHCTRLB.CMD). If the channel is already suspended, the channel operation resumes from where it previously stopped when the Resume command is detected. When the Resume command is issued before the channel is suspended, the next suspend action is skipped and the channel continues the normal operation.

Figure 19-10.Channel suspend/resume operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_e08ad4bb06fdaec372e710e2385b802eb7d3148e5197ea6d66aa97b093377c7f.jpg)

## 19.6.3.4 Event Input Actions

The event input actions are available only for channels supporting event inputs. For details on channels with event input support, refer to Table 23-6 and Table 23-4.

The Event Actions bits in the Channel Control B register (CHCTRLB.EVACT) specify the actions the DMA will take on an input event. Before using event actions, the event controller must be configured first and the corresponding Channel Event Input Enable bit (CHCTRLB.EVIE) must be set. The DMA supports only resynchronized events. For details on how to configure the resynchronized event path, refer to the Event System.

Normal transfer: When this event action is selected for a channel, the event input is used to trigger a beat or burst transfer on peripherals.

The transfer trigger is selected by setting the Trigger Source bits in Channel Control B register to zero (CHCTRLB.TRIGSRC). The event is acknowledged as soon as the event is received. When received, the Channel Pending status bit is set (CHSTATUS.PEND). If the event is received while the channel is pending, the event trigger is lost. Figure 19-11 shows an example where beat transfers are enabled by internal events.

Figure 19-11.Beat event trigger action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_20650b5da1f4a3061f0f56a0b311c78da8bbf3d79f0ff5a0ef96fa4e97d75cce.jpg)

Periodic transfers: When this event action is selected for a channel, the event input is used to trigger a transfer on peripherals with pending transfer requests. This type of event is intended to be used with peripheral triggers for example, for timed communication protocols or periodic transfers between peripherals, as examples. The periphera trigger is selected by the Trigger Source bits in the Channel Control B register (CHCTRLB.TRIGSRC).

The event is acknowledged as soon as the event is received. The peripheral trigger request is stored internally when the previous trigger action is completed (i.e. channel is not pending) and when an active event is received. If the peripheral trigger is active, the DMA will wait for an event before the peripheral trigger is internally registered. When both event and peripheral transfer trigger are active, the Channel Pending status bit is set (CHSTATUS.PEND). A software trigger will now trigger a transfer.

Figure 19-12 shows an example where the peripheral beat transfers are enabled by periodic events.

Figure 19-12.Periodic event with beat peripheral triggers  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_49ac4dad607ee8fb66cc8bb81256a3c7018b2672d33f7119b3ee22a6598cb788.jpg)

Conditional transfer: When the conditional transfer event action is selected, the event input is used to trigger a conditional transfer on peripherals with pending transfer requests. As example, this type of event can be used for peripheral to peripheral transfers, where one peripheral is source of event and the second peripheral is source of DMA trigger.

The peripheral Trigger Source must be set in Channel Control B register (CHCTRLB.TRIGSRC). Each peripheral trigger is stored internally when the event is received. When the peripheral trigger is stored internally, the Channel Pending status bit is set (CHSTATUS.PEND) and the event is acknowledged. A software trigger will now trigger a transfer.

Figure 19-13 shows an example where conditional event is enabled with peripheral beat trigger requests.

Figure 19-13.Conditional event with beat peripheral triggers  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_047ee7d36fd5371183cf3674b0d3b0b98f22e78c2cf9950a1c15eeed5629c122.jpg)

Conditional block transfer: When the conditional block event action is selected, the event input is used to trigger a conditional block transfer on peripherals. The peripheral Trigger Source must be set in Channel Control B register (CHCTRLB.TRIGSRC).

Before starting transfers within a block, an event must be received. When received, the event is acknowledged when the block transfer is completed. A software trigger will trigger a transfer.

Figure 19-14 shows an example where conditional event block transfer is enabled with peripheral beat trigger requests.

Figure 19-14.Conditional block transfer with beat peripheral triggers  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_97d08236911b42f3400c87197f83ef29f4931b3d151119941f748fa754d825a3.jpg)

Channel suspend: When the channel suspend event action is selected, the event input is used to suspend an ongoing channel operation. The event is acknowledged when the current AHB access is completed. For further details on channel suspend, refer to “Channel Suspend” on page 284.

Channel resume: When the channel resume event action is selected, the event input is used to resume a suspended channel operation. The event is acknowledged as soon as the event is received and the Channel Suspend Interrupt Flag (CHINTFLAG.SUSP) is cleared. For further details on channel suspend, refer to “Channel Suspend” on page 284.

Skip next block suspend: This event can be used to skip the next block suspend action. If the channel is suspended before the event rises, the channel operation is resumed and the event is acknowledged. If the event rises before a suspend block action is detected, the event is kept until the next block suspend detection. When the block transfer is completed, the channel continues the operation (not suspended) and the event is acknowledged.

## 19.6.3.5 Event Output Selections

The event output selections are available only for channels supporting event outputs. The pulse width of an event output from a channel is one AHB clock cycle.

The Channel Event Output Enable can be set in Control B register (CHCTRLB.EVOE). The Event Output Selection is available in each Descriptor Block Control location (BTCTRL.EVOSEL). It is possible to generate events after each beat, burst or block transfer. To enable an event when the transaction is complete, the block event selection must be set in the last transfer descriptor only. Figure 19-15 shows an example where the event output generation is enabled in the first block transfer, and disabled in the second block.

Figure 19-15.Event output generation

Beat Event Output  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_c7b671d2bec2942c76000ce0e212f8a9a6aff5de01ea2ab1480fbefabf499f75.jpg)

Block Event Output

Data Transfer

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_368241ea654f7692e41004646556e1137046654f9eb22e67f2a685d586424ced.jpg)

## 19.6.3.6 Aborting Transfers

Transfers on any channel can be gracefully aborted by software, by disabling the corresponding DMA channel. It is also possible to abort all ongoing or pending transfers, by disabling the DMAC.

When DMAC disable request is detected:

z Active channel with ongoing transfers will be disabled when the ongoing beat access is completed and the Write-Back memory section is updated. This prevents transfer corruption before the channel is disabled.

z All other enabled channels will be disabled in the next clock cycle.

The corresponding Channel Enable bit in the Channel Control A register (CHCTRLA.ENABLE) is read as zero when the channel is disabled.

The corresponding DMAC Enable bit in the Control register (CTRL.DMAENABLE) is read as zero when the entire DMAC module is disabled

## 19.6.3.7 CRC Operation

A cyclic redundancy check (CRC) is an error detection technique used to find accidental errors in data. It is commonly used to determine whether the data during a transmission, or data present in data and programme memories has been corrupted or not. A CRC takes a data stream or a block of data as input and generates a 16- or 32-bit output that can be appended to the data and used as a checksum. When the same data are later received or read, the device or application repeats the calculation. If the new CRC result does not match the one calculated earlier, the block contains a data error. The application will then detect this and may take a corrective action, such as requesting the data to be sent again or simply not using the incorrect data.

Typically, a CRC-n applied to a data block of arbitrary length will detect any single error burst not longer than n bits (any single alteration that spans no more than n bits of the data), and will detect the fraction 1-2<sup>-n</sup> of all longer error bursts. The CRC module in DMAC supports two commonly used CRC polynomials: CRC-16 (CRC-CCITT) and CRC-32 (IEEE 802.3).

z CRC-16:

z Polynomial: $\mathsf { x } ^ { 1 6 } + \mathsf { x } ^ { 1 2 } + \mathsf { x } ^ { 5 } + 1$

z Hex value: 0x1021

CRC-32:

z Polynomial: $\mathbf { x } ^ { 3 2 } + \mathbf { x } ^ { 2 6 } + \mathbf { x } ^ { 2 3 } + \mathbf { x } ^ { 2 2 } + \mathbf { x } ^ { 1 6 } + \mathbf { x } ^ { 1 2 } + \mathbf { x } ^ { 1 1 } + \mathbf { x } ^ { 1 0 } + \mathbf { x } ^ { 8 } + \mathbf { x } ^ { 7 } + \mathbf { x } ^ { 5 } + \mathbf { x } ^ { 4 } + \mathbf { x } ^ { 2 } + \mathbf { x } + 1$

z Hex value: 0x04C11DB7

The data source for the CRC module must be selected in software as either the DMA channels or the APB bus interface. The CRC module then takes data input from the selected source and generates a checksum based on these data. The checksum is available in the CRC Checksum register (CRCCHKSUM). When CRC-32 polynomial is used, the final checksum read is bit reversed and complemented, as shown in Figure 19-16 on page 289.

The CRC polynomial to be used is configurable, and the default setting is CRC-16. The CRC module operates on byte only. When the DMA is used as data source for the CRC module, the DMA channel beat size setting will be used. When used with APB bus interface, the application must set the CRC Beat Size bit field of CRC Control register (CRCCTRL.CRCBEATSIZE). 8-, 16- or 32-bit bus transfer access type is supported. The corresponding number of bytes will be written in the CRCDATAIN register and the CRC module will operate on the input data in a byte by byte manner.

Figure 19-16.CRC generator block diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_7de978c016f3ca9790a94383f452500d2aeba840af409bca2b27c48e2ea181c2.jpg)

CRC on DMA data: CRC-16 or CRC-32 calculations can be performed on data passing through any DMA channel. Once a DMA channel is selected as the source, the CRC module will continuously generate the CRC on the data passing through the DMA channel. The checksum is available for readout once the DMA transaction is completed or aborted. A CRC can also be generated on SRAM, Flash or I/O memory by passing these data through a DMA channel. If the latter is done, the destination register for the DMA data can be the data input (CRCDATAIN) register in the CRC module.

CRC using the I/O interface: Before using the CRC module with the I/O interface, the application must set the CRC Beat Size bits in the CRC Control register (CRCCTRL.CRCBEATSIZE). 8/16/32-bit bus transfer type can be selected

CRC can be performed on any data by loading them into the CRC module using the CPU and writing the data to the CRCDATAIN register. Using this method, an arbitrary number of bytes can be written to the register by the CPU, and CRC is done continuously for each byte. This means if a 32-bit data is written to the CRCDATAIN register the CRC module takes 4 cycles to calculate the CRC. The CRC complete is signaled by the CRCBUSY bit in the CRCSTATUS register. New data can be written only when CRCBUSY flag is not set.

## 19.6.4 DMA Operation

Not applicable.

## 19.6.5 Interrupts

The DMAC has the following interrupt sources:

z Transfer Complete (TCMPL): Indicates that a block transfer is completed on the corresponding channel. Refe to “Data Transmission” on page 279 for details.

z Transfer Error (TERR): Indicates that a bus error has occurred during a burst transfer, or that an invalid descriptor has been fetched. Refer to “Error Handling” on page 283 for details.

Channel Suspend (SUSP): Indicates that the corresponding channel has been suspended. Refer to“Channel Suspend” on page 284and “Data Transmission” on page 279 for details.

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Channel Interrupt Flag Status and Clear (CHINTFLAG) register is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Channel Interrupt Enable Set (CHINTENSET) register, and disabled by writing a one to the corresponding bit in the Channel Interrupt Enable Clear (CHINTENCLR) register. An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled, the DMAC is reset or the corresponding DMA channel is reset. See CHINTFLAG for details on how to clear interrupt flags. All interrupt requests are ORed together on system level to generate one combined interrupt request to the NVIC. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

The user must read the Channel Interrupt Status (INTSTATUS) register to identify the channels with pending interrupts and must read the Channel Interrupt Flag Status and Clear (CHINTFLAG) register to determine which interrupt condition is present for the corresponding channel. It is also possible to read the Interrupt Pending register (INTPEND), which provides the lowest channel number with pending interrupt and the respective interrupt flags.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 19.6.6 Events

The DMAC can generate the following output events:

z Channel (CH): Generated when a block transfer for a given channel has been completed, or when a beat transfer within a block transfer for a given channel has been completed. Refer to “Event Output Selections” on page 288 for details.

Writing a one to the Channel Control B Event Output Enable bit (CHCTRLB.EVOE) enables the corresponding output event configured in the Event Output Selection bit group in the Block Transfer Control register (BTCTRL.EVOSEL). Writing a zero to CHCTRLB.EVOE disables the corresponding output event. Refer to “EVSYS – Event System” on page 405 for details on configuring the event system.

The DMAC can take the following actions on an input event:

z Transfer and Periodic Transfer Trigger (TRIG): normal transfer or periodic transfers on peripherals are enabled

z Conditional Transfer Trigger (CTRIG): conditional transfers on peripherals are enabled

z Conditional Block Transfer Trigger (CBLOCK): conditional block transfers on peripherals are enabled

z Channel Suspend Operation (SUSPEND): suspend a channel operation

Channel Resume Operation (RESUME): resume a suspended channel operation

z Skip Next Block Suspend Action (SSKIP): skip the next block suspend transfer condition

Writing a one to the Channel Control B Event Input Enable bit (CHCTRLB.EVIE) enables the corresponding action on input event. Writing a zero to this bit disables the corresponding action on input event. Note that several actions can be enabled for incoming events. If several events are connected to the peripheral, any enabled action will be taken for any of the incoming events. For further details on event input actions, refer to “Event Input Actions” on page 285. Refer to the Event System chapter for details on configuring the event system.

## 19.6.7 Sleep Mode Operation

In standby sleep mode, the DMAC will be internally disabled, but maintains its current configuration.

## 19.6.8 Synchronization

Not applicable.

## 19.7 Register Summary

Table 19-1. DMAC Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>CRCENABLE</td><td>DMAENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td>LVLEN3</td><td>LVLEN2</td><td>LVLEN1</td><td>LVLEN0</td></tr><tr><td>0x02</td><td rowspan="2">CRCCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="2">CRCPOLY[1:0]</td><td colspan="2">CRCBEATSIZE[1:0]</td></tr><tr><td>0x03</td><td>15:8</td><td></td><td></td><td colspan="6">CRCSRC[5:0]</td></tr><tr><td>0x04</td><td rowspan="4">CRCDATAIN</td><td>7:0</td><td colspan="8">CRCDATAIN[7:0]</td></tr><tr><td>0x05</td><td>15:8</td><td colspan="8">CRCDATAIN[15:8]</td></tr><tr><td>0x06</td><td>23:16</td><td colspan="8">CRCDATAIN[23:16]</td></tr><tr><td>0x07</td><td>31:24</td><td colspan="8">CRCDATAIN[31:24]</td></tr><tr><td>0x08</td><td rowspan="4">CRCCHKSUM</td><td>7:0</td><td colspan="8">CRCCHKSUM[7:0]</td></tr><tr><td>0x09</td><td>15:8</td><td colspan="8">CRCCHKSUM[15:8]</td></tr><tr><td>0x0A</td><td>23:16</td><td colspan="8">CRCCHKSUM[23:16]</td></tr><tr><td>0x0B</td><td>31:24</td><td colspan="8">CRCCHKSUM[31:24]</td></tr><tr><td>0x0C</td><td>CRCSTATUS</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>CRCZERO</td><td>CRCBUSY</td></tr><tr><td>0x0D</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x0E</td><td>QOSCTRL</td><td>7:0</td><td></td><td></td><td colspan="2">DQOS[1:0]</td><td colspan="2">FQOS[1:0]</td><td colspan="2">WRBQOS[1:0]</td></tr><tr><td>0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">SWTRIGCTRL</td><td>7:0</td><td></td><td></td><td>SWTRIG5</td><td>SWTRIG4</td><td>SWTRIG3</td><td>SWTRIG2</td><td>SWTRIG1</td><td>SWTRIG0</td></tr><tr><td>0x11</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x12</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="4">PRICTRL0</td><td>7:0</td><td>RRLVLEN0</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPRI0[2:0]</td></tr><tr><td>0x15</td><td>15:8</td><td>RRLVLEN1</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPRI1[2:0]</td></tr><tr><td>0x16</td><td>23:16</td><td>RRLVLEN2</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPRI2[2:0]</td></tr><tr><td>0x17</td><td>31:24</td><td>RRLVLEN3</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPRI3[2:0]</td></tr><tr><td>0x18 ... 0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="2">INTPEND</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">ID[2:0]</td></tr><tr><td>0x21</td><td>15:8</td><td>PEND</td><td>BUSY</td><td>FERR</td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td rowspan="4">INTSTATUS</td><td>7:0</td><td></td><td></td><td>CHINT5</td><td>CHINT4</td><td>CHINT3</td><td>CHINT2</td><td>CHINT1</td><td>CHINT0</td></tr><tr><td>0x25</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x26</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x27</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x28</td><td rowspan="4">BUSYCH</td><td>7:0</td><td></td><td></td><td>BUSYCH5</td><td>BUSYCH4</td><td>BUSYCH3</td><td>BUSYCH2</td><td>BUSYCH1</td><td>BUSYCH0</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2A</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2C</td><td rowspan="4">PENDCH</td><td>7:0</td><td></td><td></td><td>PENDCH5</td><td>PENDCH4</td><td>PENDCH3</td><td>PENDCH2</td><td>PENDCH1</td><td>PENDCH0</td></tr><tr><td>0x2D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x30</td><td rowspan="4">ACTIVE</td><td>7:0</td><td></td><td></td><td></td><td></td><td>LVLEX3</td><td>LVLEX2</td><td>LVLEX1</td><td>LVLEX0</td></tr><tr><td>0x31</td><td>15:8</td><td>ABUSY</td><td></td><td></td><td colspan="5">ID[4:0]</td></tr><tr><td>0x32</td><td>23:16</td><td colspan="8">BTCNT[7:0]</td></tr><tr><td>0x33</td><td>31:24</td><td colspan="8">BTCNT[15:8]</td></tr><tr><td>0x34</td><td rowspan="4">BASEADDR</td><td>7:0</td><td colspan="8">BASEADDR[7:0]</td></tr><tr><td>0x35</td><td>15:8</td><td colspan="8">BASEADDR[15:8]</td></tr><tr><td>0x36</td><td>23:16</td><td colspan="8">BASEADDR[23:16]</td></tr><tr><td>0x37</td><td>31:24</td><td colspan="8">BASEADDR[31:24]</td></tr><tr><td>0x38</td><td rowspan="4">WRBADDR</td><td>7:0</td><td colspan="8">WRBADDR[7:0]</td></tr><tr><td>0x39</td><td>15:8</td><td colspan="8">WRBADDR[15:8]</td></tr><tr><td>0x3A</td><td>23:16</td><td colspan="8">WRBADDR[23:16]</td></tr><tr><td>0x3B</td><td>31:24</td><td colspan="8">WRBADDR[31:24]</td></tr><tr><td>0x3C ... 0x3E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x3F</td><td>CHID</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">ID[2:0]</td></tr><tr><td>0x40</td><td>CHCTRLA</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x41 ... 0x43</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x44</td><td rowspan="4">CHCTRLB</td><td>7:0</td><td></td><td colspan="2">LVL[1:0]</td><td>EVOE</td><td>EVIE</td><td colspan="3">EVACT[2:0]</td></tr><tr><td>0x45</td><td>15:8</td><td></td><td></td><td></td><td colspan="5">TRIGSRC[4:0]</td></tr><tr><td>0x46</td><td>23:16</td><td colspan="2">TRIGACT[1:0]</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x47</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">CMD[1:0]</td></tr><tr><td>0x48 ... 0x4B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x4C</td><td>CHINTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>0x4D</td><td>CHINTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>0x4E</td><td>CHINTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>0x4F</td><td>CHSTATUS</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>FERR</td><td>BUSY</td><td>PEND</td></tr></table>

Table 19-2. DMAC SRAM Register Summary - Descriptor/Write-Back Memory Section

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">BTCTRL</td><td>7:0</td><td></td><td></td><td></td><td colspan="2">BLOCKACT[1:0]</td><td colspan="2">EVOSEL[1:0]</td><td>VALID</td></tr><tr><td>0x01</td><td>15:8</td><td colspan="3">STEPSIZE[2:0]</td><td>STEPSEL</td><td>DSTINC</td><td>SRCINC</td><td colspan="2">BEATSIZE[1:0]</td></tr><tr><td>0x02</td><td rowspan="2">BTCNT</td><td>7:0</td><td colspan="8">BTCNT[7:0]</td></tr><tr><td>0x03</td><td>15:8</td><td colspan="8">BTCNT[15:8]</td></tr><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2"></td></tr><tr><td>0x04</td><td rowspan="4">SRCADDR</td><td>7:0</td><td colspan="8">SRCADDR[7:0]</td></tr><tr><td>0x05</td><td>15:8</td><td colspan="8">SRCADDR[15:8]</td></tr><tr><td>0x06</td><td>23:16</td><td colspan="8">SRCADDR[23:16]</td></tr><tr><td>0x07</td><td>31:24</td><td colspan="8">SRCADDR[31:24]</td></tr><tr><td>0x08</td><td rowspan="4">DSTADDR</td><td>7:0</td><td colspan="8">DSTADDR[7:0]</td></tr><tr><td>0x09</td><td>15:8</td><td colspan="8">DSTADDR[15:8]</td></tr><tr><td>0x0A</td><td>23:16</td><td colspan="8">DSTADDR[23:16]</td></tr><tr><td>0x0B</td><td>31:24</td><td colspan="8">DSTADDR[31:24]</td></tr><tr><td>0x0C</td><td rowspan="4">DESCADDR</td><td>7:0</td><td colspan="8">DESCADDR[7:0]</td></tr><tr><td>0x0D</td><td>15:8</td><td colspan="8">DESCADDR[15:8]</td></tr><tr><td>0x0E</td><td>23:16</td><td colspan="8">DESCADDR[23:16]</td></tr><tr><td>0x0F</td><td>31:24</td><td colspan="8">DESCADDR[31:24]</td></tr></table>

## 19.8 Register Description

Registers can be 8, 16, or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register, and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Please refer to “Register Access Protection” on page 273 for details.

Some registers are enable-protected, meaning they can only be written when the DMAC is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 19.8.1 DMAC Registers

## 19.8.1.1 Control

Name: CTRL

Offset: 0x00

Reset: 0x0000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>LVLEN3</td><td>LVLEN2</td><td>LVLEN1</td><td>LVLEN0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>CRCENABLE</td><td>DMAENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 11:8 – LVLENx [x=3..0]: Priority Level x Enable

0: Transfer requests for Priority level x will not be handled.

1: Transfer requests for Priority level x will be handled.

When this bit is set, all requests with the corresponding level will be fed into the arbiter block. When cleared, all requests with the corresponding level will be ignored.

For details on arbitration schemes, refer to “Arbitration” on page 278 section.

These bits are not enable-protected.

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – CRCENABLE: CRC Enable

0: The CRC module is disabled.

1: The CRC module is enabled.

Writing a zero to this bit will disable the CRC module if the CRC Status Busy bit in the CRC Status register (CRC-STATUS.CRCBUSY) is zero. If the CRCSTATUS.CRCBUSY is one, the write will be ignored and the CRC module will not be disabled.

Writing a one to this bit will enable the CRC module.

This bit is not enable-protected.

## z Bit 1 – DMAENABLE: DMA Enable

0: The peripheral is disabled.

1: The peripheral is enabled.

Writing a zero to this bit during an ongoing transfer, the bit will not be cleared until the internal data transfer buffer is empty and the DMA transfer is aborted. The internal data transfer buffer will be empty once the ongoing burst transfer is completed.

Writing a one to this bit will enable the DMA module.

This bit is not enable-protected.

## ● Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit when both the DMAC and the CRC module are disabled (DMAENABLE and CRCENABLE is zero), resets all registers in the DMAC, except DBGCTRL, to their initial state If either the DMAC or CRC module is enabled, the reset request will be ignored and the DMAC will return an access error.

## 19.8.1.2 CRC Control

Name: CRCCTRL

Offset: 0x02

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td colspan="6">CRCSRC[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="2">CRCPOLY[1:0]</td><td colspan="2">CRCBEATSIZE[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 13:8 – CRCSRC[5:0]: CRC Input Source

These bits select the input source for generating the CRC, as shown in Table 19-3. The selected source is locked until either the CRC generation is completed or the CRC module is disabled. This means the CRCSRC cannot be modified when the CRC operation is ongoing. The lock is signaled by the CRCBUSY status bit. CRC generation complete is generated and signaled from the selected source when used with the DMA channel.

Table 19-3. CRC Input Source

<table><tr><td>CRCSRC[5:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NOACT</td><td>No action</td></tr><tr><td>0x1</td><td>IO</td><td>I/O interface</td></tr><tr><td>0x2-0x1f</td><td></td><td>Reserved</td></tr><tr><td>0x20-0x3F</td><td>CHN</td><td>DMA channel n</td></tr><tr><td>0x21-0x3f</td><td></td><td>Reserved</td></tr></table>

## z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 3:2 – CRCPOLY[1:0]: CRC Polynomial Type

These bits select the CRC polynomial type, as shown in Table 19-4.

Table 19-4. CRC Polynomial Type

<table><tr><td>CRCPOLY[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>CRC16</td><td>CRC-16 (CRC-CCITT)</td></tr><tr><td>0x1</td><td>CRC32</td><td>CRC32 (IEEE 802.3)</td></tr><tr><td>0x2-0x3</td><td></td><td>Reserved</td></tr></table>

## z Bits 1:0 – CRCBEATSIZE[1:0]: CRC Beat Size

These bits define the size of the data transfer for each bus access when the CRC is used with I/O interface, as shown in Table 19-5.

Table 19-5. CRC Beat Size

<table><tr><td>CRCBEATSIZE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>BYTE</td><td>Byte bus access</td></tr><tr><td>0x1</td><td>HWORD</td><td>Half-word bus access</td></tr><tr><td>0x2</td><td>WORD</td><td>Word bus access</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## 19.8.1.3 CRC Data Input

Name: CRCDATAIN

Offset: 0x04

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">CRCDATAIN[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CRCDATAIN[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CRCDATAIN[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CRCDATAIN[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:0 – CRCDATAIN[31:0]: CRC Data Input

These bits store the data for which the CRC checksum is computed. After the CRCDATAIN register has been written, the number of cycles for the new CRC checksum to be ready is dependent of the configuration of the CRC Beat Size bit group in the CRC Control register(CRCCTRL.CRCBEATSIZE). Each byte needs one clock cycle to be calculated.

## 19.8.1.4 CRC Checksum

Name: CRCCHKSUM

Offset: 0x08

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">CRCCHKSUM[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CRCCHKSUM[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CRCCHKSUM[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CRCCHKSUM[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

The CRCCHKSUM represents the 16- or 32-bit checksum value and the generated CRC.

## z Bits 31:0 – CRCCHKSUM[31:0]: CRC Checksum

These bits store the generated CRC result. The 16 MSB bits are always read zero when CRC-16 is enabled. These bits should only be read when CRC Module Busy bit in the CRC Status register (CRCSTATUS.BUSY) is zero.

If CRC-16 is selected and CRCSTATUS.BUSY is zero (CRC generation is completed), this bit group will contain a valid checksum.

If CRC-32 is selected and CRCSTATUS.BUSY is zero (CRC generation is completed), this bit group will contain a valid reversed checksum. Bit 31 is swapped with bit 0, bit 30 with bit 1, etc.

## 19.8.1.5 CRC Status

Name: CRCSTATUS

Offset: 0x0C

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>CRCZERO</td><td>CRCBUSY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – CRCZERO: CRC Zero

This bit is cleared when a new CRC source is selected.

This bit is set when the CRC generation is complete and the CRC Checksum is zero.

## z Bit 0 – CRCBUSY: CRC Module Busy

When used with an I/O interface (CRCCTRL.CRCSRC is 0x1), this bit is cleared by writing a one to it.

When used with an I/O interface (CRCCTRL.CRCSRC is 0x1), this bit is set when the CRC Data Input (CRC-DATAIN) register is written.

When used with a DMA channel (CRCCTRL.CRCSRC is 0x20 to 0x3F), this bit is cleared when the corresponding DMA channel is disabled.

When used with a DMA channel (CRCCTRL.CRCSRC is 0x20 to 0x3F), this bit is set when the corresponding DMA channel is enabled.

Writing a zero to this bit has no effect.

When used with an I/O interface(CRCCTRL.CRCSRC is 0x1), writing a one to this bit will clear the CRC Module Busy bit.

When used with a DMA channel, writing a one to this bit has no effect.

## 19.8.1.6 Debug Control

Name: DBGCTRL

Offset: 0x0D

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – DBGRUN: Debug Run

This bit is not reset by a software reset.

This bit controls the functionality when the CPU is halted by an external debugger.

0: The DMAC is halted when the CPU is halted by an external debugger.

1: The DMAC continues normal operation when the CPU is halted by an external debugger.

Name: QOSCTRL

Offset: 0x0E

Reset: 0x15

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="2">DQOS[1:0]</td><td colspan="2">FQOS[1:0]</td><td colspan="2">WRBQOS[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td></tr></table>

z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

● Bits 5:4 – DQOS[1:0]: Data Transfer Quality of Service

These bits define the memory priority access during the data transfer operation, as shown in Table 19-6 on page 304

Table 19-6. Data Transfer Quality of Service

<table><tr><td>DQOS[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Background (no sensitive operation)</td></tr><tr><td>0x1</td><td>LOW</td><td>Sensitive Bandwidth</td></tr><tr><td>0x2</td><td>MEDIUM</td><td>Sensitive Latency</td></tr><tr><td>0x3</td><td>HIGH</td><td>Critical Latency</td></tr></table>

z Bits 3:2 – FQOS[1:0]: Fetch Quality of Service

These bits define the memory priority access during the fetch operation, as shown in Table 19-7 on page 304

Table 19-7. Fetch Quality of Service

<table><tr><td>FQOS[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Background (no sensitive operation)</td></tr><tr><td>0x1</td><td>LOW</td><td>Sensitive Bandwidth</td></tr><tr><td>0x2</td><td>MEDIUM</td><td>Sensitive Latency</td></tr><tr><td>0x3</td><td>HIGH</td><td>Critical Latency</td></tr></table>

z Bits 1:0 – WRBQOS[1:0]: Write-Back Quality of Service

These bits define the memory priority access during the write-back operation, as shown in Table 19-8 on page 305

Table 19-8. Write-Back Quality of Service

<table><tr><td>WRBQOS[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Background (no sensitive operation)</td></tr><tr><td>0x1</td><td>LOW</td><td>Sensitive Bandwidth</td></tr><tr><td>0x2</td><td>MEDIUM</td><td>Sensitive Latency</td></tr><tr><td>0x3</td><td>HIGH</td><td>Critical Latency</td></tr></table>

## 19.8.1.8 Software Trigger Control

Name: SWTRIGCTRL

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>SWTRIG5</td><td>SWTRIG4</td><td>SWTRIG3</td><td>SWTRIG2</td><td>SWTRIG1</td><td>SWTRIG0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:0 – SWTRIGx [x=5..0]: Channel x Software Trigger

This bit is cleared when the Channel Pending bit in the Channel Status register (CHSTATUS.PEND) for the corresponding channel is set, or by writing a one to it.

This bit is set if CHSTATUS.PEND is already one, when writing a one to this bit.

Writing a zero to this bit will clear the bit.

Writing a one to this bit will generate a DMA software trigger on channel x, if CHSTATUS.PEND is zero for channel x.

## 19.8.1.9 Priority Control 0

Name: PRICTRL0

Offset: 0x14

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td>RRLVLEN3</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPR13[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td>RRLVLEN2</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPR12[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>RRLVLEN1</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPR11[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RRLVLEN0</td><td></td><td></td><td></td><td></td><td colspan="3">LVLPR10[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 31 – RRLVLEN3: Level 3 Round-Robin Scheduling Enable

0: Static scheduling scheme for channels with level 3 priority.

1: Round-robin scheduling scheme for channels with level 3 priority.

For details on scheduling schemes, refer to “Arbitration” on page 278.

## z Bits 30:27 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 26:24 – LVLPRI3[2:0]: Level 3 Channel Priority Number

When round-robin arbitration is enabled (PRICTRL0.RRLVLEN3 is one) for priority level 3, this register holds the channel number of the last DMA channel being granted access as the active channel with priority level 3.

When static arbitration is enabled (PRICTRL0.RRLVLEN3 is zero) for priority level 3, and the value of this bit group is non-zero, it will affect the static priority scheme. If the value of this bit group is x, channel x will have the highest priority. The priority will decrease as the channel number increases from x to n, where n is the maximum number of channels. Channel n has higher priority than channel 0, and the priority will continue to decrease from channel 0 to channel (x-1).

This bit group is not reset when round-robin scheduling gets disabled (PRICTRL0.RRLVLEN3 written to zero).

## z Bit 23 – RRLVLEN2: Level 2 Round-Robin Scheduling Enable

0: Static scheduling scheme for channels with level 2 priority.

1: Round-robin scheduling scheme for channels with level 2 priority.

For details on scheduling schemes, refer to “Arbitration” on page 278.

## z Bits 22:19 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 18:16 – LVLPRI2[2:0]: Level 2 Channel Priority Number

When round-robin arbitration is enabled (PRICTRL0.RRLVLEN2 is one) for priority level 2, this register holds the channel number of the last DMA channel being granted access as the active channel with priority level 2.

When static arbitration is enabled (PRICTRL0.RRLVLEN2 is zero) for priority level 2, and the value of this bit group is non-zero, it will affect the static priority scheme. If the value of this bit group is x, channel x will have the highest priority. The priority will decrease as the channel number increases from x to n, where n is the maximum number of channels. Channel n has higher priority than channel 0, and the priority will continue to decrease from channel 0 to channel (x-1).

This bit group is not reset when round-robin scheduling gets disabled (PRICTRL0.RRLVLEN2 written to zero).

## z Bit 15 – RRLVLEN1: Level 1 Round-Robin Scheduling Enable

0: Static scheduling scheme for channels with level 1 priority.

1: Round-robin scheduling scheme for channels with level 1 priority.

For details on scheduling schemes, refer to “Arbitration” on page 278.

## z Bits 14:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 10:8 – LVLPRI1[2:0]: Level 1 Channel Priority Number

When round-robin arbitration is enabled (PRICTRL0.RRLVLEN1 is one) for priority level 1, this register holds the channel number of the last DMA channel being granted access as the active channel with priority level 1.

When static arbitration is enabled (PRICTRL0.RRLVLEN1 is zero) for priority level 1, and the value of this bit group is non-zero, it will affect the static priority scheme. If the value of this bit group is x, channel x will have the highest priority. The priority will decrease as the channel number increases from x to n, where n is the maximum number of channels. Channel n has higher priority than channel 0, and the priority will continue to decrease from channel 0 to channel (x-1).

This bit group is not reset when round-robin scheduling gets disabled (PRICTRL0.RRLVLEN1 written to zero).

## z Bit 7 – RRLVLEN0: Level 0 Round-Robin Scheduling Enable

0: Static scheduling scheme for channels with level 0 priority.

1: Round-robin scheduling scheme for channels with level 0 priority.

For details on scheduling schemes, refer to “Arbitration” on page 278.

## z Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 2:0 – LVLPRI0[2:0]: Level 0 Channel Priority Number

When round-robin arbitration is enabled (PRICTRL0.RRLVLEN0 is one) for priority level 0, this register holds the channel number of the last DMA channel being granted access as the active channel with priority level 0. When static arbitration is enabled (PRICTRL0.RRLVLEN0 is zero) for priority level 0, and the value of this bit group is non-zero, it will affect the static priority scheme. If the value of this bit group is x, channel x will have the highest priority. The priority will decrease as the channel number increases from x to n, where n is the maximum number of channels. Channel n has higher priority than channel 0, and the priority will continue to decrease from channel 0 to channel (x-1).

This bit group is not reset when round-robin scheduling gets disabled (PRICTRL0.RRLVLEN0 written to zero).

## 19.8.1.10 Interrupt Pending

Name: INTPEND

Offset: 0x20

Reset: 0x0000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>PEND</td><td>BUSY</td><td>FERR</td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">ID[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to identify the lowest DMA channel with pending interrupt.

## ● Bit 15 – PEND: Pending

This bit is read one when the channel selected by Channel ID field (ID) is pending.

## z Bit 14 – BUSY: Busy

This bit is read one when the channel selected by Channel ID field (ID) is busy.

## z Bit 13 – FERR: Fetch Error

This bit is read one when the channel selected by Channel ID field (ID) fetched an invalid descriptor.

## z Bits 12:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 10 – SUSP: Channel Suspend

This bit is read one when the channel selected by Channel ID field (ID) has pending Suspend interrupt.

Writing a one to this bit will clear the Channel ID (ID) Suspend interrupt flag.

## Bit 9 – TCMPL: Transfer Complete

This bit is read one when the channel selected by Channel ID field (ID) has pending Transfer Complete interrupt. Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Channel ID (ID) Transfer Complete interrupt flag.

## ● Bit 8 – TERR: Transfer Error

This bit is read one when the channel selected by Channel ID field (ID) has pending Transfer Error interrupt.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Channel ID (ID) Transfer Error interrupt flag.

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 2:0 – ID[2:0]: Channel ID

These bits store the lowest channel number with pending interrupts. The number is valid if Suspend (SUSP), Transfer Complete (TCMPL) or Transfer Error (TERR) bits are set. The Channel ID field is refreshed when a new channel (with channel number less than the current one) with pending interrupts is detected, or when the application clears the corresponding channel interrupt sources. When no pending channels interrupts are available, these bits will always return zero value when read.

When the bits are written, indirect access to the corresponding Channel Interrupt Flag register is enabled.

## 19.8.1.11 Interrupt Status

Name: INTSTATUS

Offset: 0x24

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>CHINT5</td><td>CHINT4</td><td>CHINT3</td><td>CHINT2</td><td>CHINT1</td><td>CHINT0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:0 – CHINTx [x=5..0]: Channel x Pending Interrupt

This bit is set when Channel x has pending interrupt.

This bit is cleared when the corresponding Channel x interrupts are disabled or the interrupts sources are cleared.

## 19.8.1.12 Busy Channels

Name: BUSYCH

Offset: 0x28

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>BUSYCH5</td><td>BUSYCH4</td><td>BUSYCH3</td><td>BUSYCH2</td><td>BUSYCH1</td><td>BUSYCH0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bits 31:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:0 – BUSYCHx [x=5..0]: Busy Channel x

This bit is cleared when the channel trigger action for DMA channel x is complete, when a bus error for DMA channel x is detected, or when DMA channel x is disabled.

This bit is set when DMA channel x starts a DMA transfer.

## 19.8.1.13 Pending Channels

Name: PENDCH

Offset: 0x2C

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>PENDCH5</td><td>PENDCH4</td><td>PENDCH3</td><td>PENDCH2</td><td>PENDCH1</td><td>PENDCH0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bits 31:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:0 – PENDCHx [x=5..0]: Pending Channel x

This bit is cleared when trigger execution defined by channel trigger action settings for DMA channel x is started, when a bus error for DMA channel x is detected or when DMA channel x is disabled. For details on trigger action settings, refer to Table 19-10.

This bit is set when a transfer is pending on DMA channel x.

## 19.8.1.14 Active Channel and Levels

Name: ACTIVE

Offset: 0x30

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">BTCNT[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">BTCNT[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>ABUSY</td><td></td><td></td><td colspan="5">ID[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>LVLEX3</td><td>LVLEX2</td><td>LVLEX1</td><td>LVLEX0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:16 – BTCNT[15:0]: Active Channel Block Transfer Count

These bits hold the 16-bit block transfer count of the ongoing transfer. This value is stored in the active channel and written back in the corresponding Write-Back channel memory location when the arbiter grants a new channe access. The value is valid only when the active channel active busy flag (ABUSY) is set.

## z Bit 15 – ABUSY: Active Channel Busy

This bit is cleared when the active transfer count is written back in the Write-Back memory section.

This flag is set when the next descriptor transfer count is read from the Write-Back memory section.

## Bits 14:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 12:8 – ID[4:0]: Active Channel ID

These bits hold the channel index currently stored in the active channel registers. The value is updated each time the arbiter grants a new channel transfer access request.

## Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

0 Bits 3:0 – LVLEXx [x=3..0]: Level x Channel Trigger Request Executing This bit is set when a level-x channel trigger request is executing or pending.

## 19.8.1.15 Descriptor Memory Section Base Address

Name: BASEADDR

Offset: 0x34

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">BASEADDR[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">BASEADDR[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">BASEADDR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">BASEADDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – BASEADDR[31:0]: Descriptor Memory Base Address These bits store the Descriptor memory section base address. The value must be 128-bit aligned.

## 19.8.1.16 Write-Back Memory Section Base Address

Name: WRBADDR

Offset: 0x38

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">WRBADDR[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">WRBADDR[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">WRBADDR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">WRBADDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – WRBADDR[31:0]: Write-Back Memory Base Address These bits store the Write-Back memory base address. The value must be 128-bit aligned.

## 19.8.1.17 Channel ID

Name: CHID

Offset: 0x3F

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">ID[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 2:0 – ID[2:0]: Channel ID

These bits define the channel number that will be accessed. Before reading or writing a channel register, the channel ID bit group must be written first.

## 19.8.1.18 Channel Control A

Name: CHCTRLA

Offset: 0x40

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – ENABLE: Channel Enable

0: DMA channel is disabled.

1: DMA channel is enabled.

Writing a zero to this bit during an ongoing transfer, the bit will not be cleared until the internal data transfer buffer is empty and the DMA transfer is aborted. The internal data transfer buffer will be empty once the ongoing burst transfer is completed.

Writing a one to this bit will enable the DMA channel.

This bit is not enable-protected.

## z Bit 0 – SWRST: Channel Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets the channel registers to their initial state. The bit can be set when the channel is disabled (ENABLE = 0). Writing a one to this bit will be ignored as long as the channel is enabled (ENABLE = 1). This bit is automatically cleared when the reset is completed.

Writing a one to this bit when the corresponding DMA channel is disabled (ENABLE is zero), resets all registers for the corresponding DMA channel to their initial state If the corresponding DMA channel is enabled, the reset request will be ignored.

## 19.8.1.19 Channel Control B

Name: CHCTRLB

Offset: 0x44

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">CMD[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="2">TRIGACT[1:0]</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">TRIGSRC[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td colspan="2">LVL[1:0]</td><td>EVOE</td><td>EVIE</td><td colspan="3">EVACT[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:26 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 25:24 – CMD[1:0]: Software Command

These bits define the software commands, as shown in Table 19-9.

These bits are not enable-protected.

Table 19-9. Software Command

<table><tr><td>CMD[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NOACT</td><td>No action</td></tr><tr><td>0x1</td><td>SUSPEND</td><td>Channel suspend operation</td></tr><tr><td>0x2</td><td>RESUME</td><td>Channel resume operation</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## Bits 23:22 – TRIGACT[1:0]: Trigger Action

These bits define the trigger action used for a transfer, as shown in Table 19-10.

Table 19-10. Trigger Action

<table><tr><td>TRIGACT[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>BLOCK</td><td>One trigger required for each block transfer</td></tr><tr><td>0x1</td><td></td><td>Reserved</td></tr><tr><td>0x2</td><td>BEAT</td><td>One trigger required for each beat transfer</td></tr><tr><td>0x3</td><td>TRANSACTION</td><td>One trigger required for each transaction</td></tr></table>

## z Bits 21:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 12:8 – TRIGSRC[4:0]: Peripheral Trigger Source

These bits define the peripheral trigger which is source of the transfer. For details on trigger selection and trigger modes, refer to “Transfer Triggers and Actions” on page 280 and Table 19-10.

Table 19-11. Peripheral trigger source

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x00</td><td>DISABLE</td><td>Only software/event triggers</td></tr><tr><td>0x01</td><td>SERCOM0 RX</td><td>SERCOM0 RX Trigger</td></tr><tr><td>0x02</td><td>SERCOM0 TX</td><td>SERCOM0 TX Trigger</td></tr><tr><td>0x03</td><td>SERCOM1 RX</td><td>SERCOM1 RX Trigger</td></tr><tr><td>0x04</td><td>SERCOM1 TX</td><td>SERCOM1 TX Trigger</td></tr><tr><td>0x05</td><td>SERCOM2 RX</td><td>SERCOM2 RX Trigger</td></tr><tr><td>0x06</td><td>SERCOM2 TX</td><td>SERCOM2 TX Trigger</td></tr><tr><td>0x07</td><td>TCC0 OVF</td><td>TCC0 Overflow Trigger</td></tr><tr><td>0x08</td><td>TCC0 MC0</td><td>TCC0 Match/Compare 0 Trigger</td></tr><tr><td>0x09</td><td>TCC0 MC1</td><td>TCC0 Match/Compare 1 Trigger</td></tr><tr><td>0x0A</td><td>TCC0 MC2</td><td>TCC0 Match/Compare 2 Trigger</td></tr><tr><td>0x0B</td><td>TCC0 MC3</td><td>TCC0 Match/Compare 3 Trigger</td></tr><tr><td>0x0C</td><td>TC1 OVF</td><td>TC1 Overflow Trigger</td></tr><tr><td>0x0D</td><td>TC1 MC0</td><td>TC1 Match/Compare 0 Trigger</td></tr><tr><td>0x0E</td><td>TC1 MC1</td><td>TC1 Match/Compare 1 Trigger</td></tr><tr><td>0x0F</td><td>TC2 OVF</td><td>TC2 Overflow Trigger</td></tr><tr><td>0x10</td><td>TC2 MC0</td><td>TC2 Match/Compare 0 Trigger</td></tr><tr><td>0x11</td><td>TC2 MC1</td><td>TC2 Match/Compare 1 Trigger</td></tr><tr><td>0x12</td><td>ADC RESRDY</td><td>ADC Result Ready Trigger</td></tr><tr><td>0x13</td><td>DAC EMPTY</td><td>DAC Empty Trigger</td></tr></table>

## Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bits 6:5 – LVL[1:0]: Channel Arbitration Level

These bits define the arbitration level used for the DMA channel. The available levels are shown in Table 19-12, where a high level has priority over a low level. For further details on arbitration schemes, refer to “Arbitration” on page 278.

These bits are not enable-protected.

Table 19-12. Channel Arbitration Level

<table><tr><td>LVL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>LVL0</td><td>Channel Priority Level 0</td></tr><tr><td>0x1</td><td>LVL1</td><td>Channel Priority Level 1</td></tr><tr><td>0x2</td><td>LVL2</td><td>Channel Priority Level 2</td></tr><tr><td>0x3</td><td>LVL3</td><td>Channel Priority Level 3</td></tr><tr><td>0x4-0x7</td><td></td><td>Reserved</td></tr></table>

## z Bit 4 – EVOE: Channel Event Output Enable

This bit indicates if the Channel event generation is enabled. The event will be generated for every condition defined in the descriptor Event Output Selection (BTCTRL.EVOSEL).

0: Channel event generation is disabled.

1: Channel event generation is enabled.

This bit is available only on channels with event output support. Refer to Table 23-6 and Table 23-4 for details.

## z Bit 3 – EVIE: Channel Event Input Enable

0: Channel event action will not be executed on any incoming event.

1: Channel event action will be executed on any incoming event.

This bit is available only on channels with event input support. Refer to Table 23-6 and Table 23-4 for details.

## Bits 2:0 – EVACT[2:0]: Event Input Action

These bits define the event input action, as shown in Table 19-13. The action is executed only if the corresponding EVIE bit in CHCTRLB register of the channel is set. For details on event actions, refer to “Event Input Actions” on page 285.

These bits are available only for channels with event input support. Refer to Table 23-6 and Table 23-4 for details.

Table 19-13. Event Input Action

<table><tr><td>EVACT[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NOACT</td><td>No action</td></tr><tr><td>0x1</td><td>TRIG</td><td>Transfer and periodic transfer trigger</td></tr><tr><td>0x2</td><td>CTRIG</td><td>Conditional transfer trigger</td></tr><tr><td>0x3</td><td>CBLOCK</td><td>Conditional block transfer</td></tr><tr><td>0x4</td><td>SUSPEND</td><td>Channel suspend operation</td></tr><tr><td>0x5</td><td>RESUME</td><td>Channel resume operation</td></tr><tr><td>0x6</td><td>SSKIP</td><td>Skip next block suspend action</td></tr><tr><td>0x7</td><td></td><td>Reserved</td></tr></table>

## 19.8.1.20 Channel Interrupt Enable Clear

Name: CHINTENCLR

Offset: 0x4C

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Channel Interrupt Enable Set (CHINTENSET) register.

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 2 – SUSP: Channel Suspend Interrupt Enable

0: The Channel Suspend interrupt is disabled.

1: The Channel Suspend interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Channel Suspend Interrupt Enable bit, which disables the Channel Suspend interrupt.

## Bit 1 – TCMPL: Transfer Complete Interrupt Enable

0: The Channel Transfer Complete interrupt is disabled. When block action is set to none, the TCMPL flag will not be set when a block transfer is completed.

1: The Channel Transfer Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Channel Transfer Complete Interrupt Enable bit, which disables the Channe Transfer Complete interrupt.

## z Bit 0 – TERR: Transfer Error Interrupt Enable

0: The Channel Transfer Error interrupt is disabled.

1: The Channel Transfer Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Channel Transfer Error Interrupt Enable bit, which disables the Channel Transfer Error interrupt.

## 19.8.1.21 Channel Interrupt Enable Set

Name: CHINTENSET

Offset: 0x4D

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Channel Interrupt Enable Clear (CHINTENCLR) register.

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 2 – SUSP: Channel Suspend Interrupt Enable

0: The Channel Suspend interrupt is disabled.

1: The Channel Suspend interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Channel Suspend Interrupt Enable bit, which enables the Channel Suspend interrupt.

## Bit 1 – TCMPL: Transfer Complete Interrupt Enable

0: The Channel Transfer Complete interrupt is disabled.

1: The Channel Transfer Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Channel Transfer Complete Interrupt Enable bit, which enables the Channel Transfer Complete interrupt.

## Bit 0 – TERR: Transfer Error Interrupt Enable

0: The Channel Transfer Error interrupt is disabled.

1: The Channel Transfer Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Channel Transfer Error Interrupt Enable bit, which enables the Channel Transfer Error interrupt.

## 19.8.1.22 Channel Interrupt Flag Status and Clear

Name: CHINTFLAG

Offset: 0x4E

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SUSP</td><td>TCMPL</td><td>TERR</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 2 – SUSP: Channel Suspend

This flag is cleared by writing a one to it.

This bit is set when a block transfer with suspend block action is completed, when a software suspend command is executed, when a suspend event is received or when an invalid descriptor is fetched by the DMA.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Channel Suspend interrupt flag for the corresponding channel.

For details on available software commands, refer to Table 19-9.

For details on available event input actions, refer to Table 19-13.

For details on available block actions, refer to Table 19-17.

## ● Bit 1 – TCMPL: Transfer Complete

This flag is cleared by writing a one to it.

This flag is set when a block transfer is completed and the corresponding interrupt block action is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transfer Complete interrupt flag for the corresponding channel.

## ● Bit 0 – TERR: Transfer Error

This flag is cleared by writing a one to it.

This flag is set when a bus error is detected during a beat transfer or when the DMAC fetches an invalid descriptor. Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transfer Error interrupt flag for the corresponding channel.

## 19.8.1.23 Channel Status

Name: CHSTATUS

Offset: 0x4F

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>FERR</td><td>BUSY</td><td>PEND</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – FERR: Fetch Error

This bit is cleared when the software resume command is executed.

This bit is set when an invalid descriptor is fetched.

## z Bit 1 – BUSY: Channel Busy

This bit is cleared when the channel trigger action is complete, when a bus error is detected or when the channel is disabled.

This bit is set when the DMA channel starts a DMA transfer.

## ● Bit 0 – PEND: Channel Pending

This bit is cleared when trigger execution defined by channel trigger action settings is started, when a bus error is detected or when the channel is disabled. For details on trigger action settings, refer to Table 19-10. This bit is set when a transfer is pending on the DMA channel.

## 19.8.2 DMAC SRAM Registers

## 19.8.2.1 Block Transfer Control

Name: BTCTRL

Offset: 0x00

<table><tr><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td colspan="3">STEPSIZE[2:0]</td><td>STEPSEL</td><td>DSTINC</td><td>SRCINC</td><td colspan="2">BEATSIZE[1:0]</td></tr></table>

<table><tr><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="2">BLOCKACT[1:0]</td><td colspan="2">EVOSEL[1:0]</td><td>VALID</td></tr></table>

The BTCTRL register offset is relative to (BASEADDR or WRBADDR) + Channel Number \* 0x10

z Bits 15:13 – STEPSIZE[2:0]: Address Increment Step Size

These bits select the address increment step size, as shown in Table 19-14. The setting apply to source or desti nation address, depending on STEPSEL setting.

Table 19-14. Address Increment Step Size

<table><tr><td>STEPSIZE[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>X1</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 1</td></tr><tr><td>0x1</td><td>X2</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 2</td></tr><tr><td>0x2</td><td>X4</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 4</td></tr><tr><td>0x3</td><td>X8</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 8</td></tr><tr><td>0x4</td><td>X16</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 16</td></tr><tr><td>0x5</td><td>X32</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 32</td></tr><tr><td>0x6</td><td>X64</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 64</td></tr><tr><td>0x7</td><td>X128</td><td>Next ADDR &lt;- ADDR + BEATSIZE * 128</td></tr></table>

## ● Bit 12 – STEPSEL: Step Selection

This bit selects if source or destination addresses are using the step size settings, according to Table 19-15.

Table 19-15. Step Selection

<table><tr><td>STEPSEL</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DST</td><td>Step size settings apply to the destination address</td></tr><tr><td>0x1</td><td>SRC</td><td>Step size settings apply to the source address</td></tr></table>

z Bit 11 – DSTINC: Destination Address Increment Enable

0: The Destination Address Increment is disabled.

1: The Destination Address Increment is enabled.

Writing a zero to this bit will disable the destination address incrementation. The address will be kept fixed during the data transfer.

Writing a one to this bit will enable the destination address incrementation. By default, the destination address is incremented by 1. If the STEPSEL bit is cleared, flexible step-size settings are available in the STEPSIZE register, as shown in Table 19-14.

## ● Bit 10 – SRCINC: Source Address Increment Enable

0: The Source Address Increment is disabled.

1: The Source Address Increment is enabled.

Writing a zero to this bit will disable the source address incrementation. The address will be kept fixed during the data transfer.

Writing a one to this bit will enable the source address incrementation. By default, the source address is incremented by 1. If the STEPSEL bit is set, flexible step-size settings are available in the STEPSIZE register, as shown in Table 19-14.

## ● Bits 9:8 – BEATSIZE[1:0]: Beat Size

These bits define the size of one beat, as shown in Table 19-16. A beat is the size of one data transfer bus access, and the setting apply to both read and write accesses.

Table 19-16. Beat Size

<table><tr><td>BEATSIZE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>BYTE</td><td>8-bit access</td></tr><tr><td>0x1</td><td>HWORD</td><td>16-bit access</td></tr><tr><td>0x2</td><td>WORD</td><td>32-bit access</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 4:3 – BLOCKACT[1:0]: Block Action

These bits define what actions the DMAC should take after a block transfer has completed. The available actions are listed in Table 19-17.

Table 19-17. Block Action

<table><tr><td>BLOCKACT[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NOACT</td><td>No action</td></tr><tr><td>0x1</td><td>INT</td><td>Channel in normal operation and block interrupt</td></tr><tr><td>0x2</td><td>SUSPEND</td><td>Channel suspend operation is completed</td></tr><tr><td>0x3</td><td>BOTH</td><td>Both channel suspend operation and block interrupt</td></tr></table>

## ● Bits 2:1 – EVOSEL[1:0]: Event Output Selection

These bits define the event output selection, as shown in Table 19-18.

Table 19-18. Event Output Selection

<table><tr><td>EVOSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Event generation disabled</td></tr><tr><td>0x1</td><td>BLOCK</td><td>Event strobe when block transfer complete</td></tr><tr><td>0x2</td><td></td><td>Reserved</td></tr><tr><td>0x3</td><td>BEAT</td><td>Event strobe when beat transfer complete</td></tr></table>

## z Bit 0 – VALID: Descriptor Valid

0: The descriptor is not valid.

1: The descriptor is valid.

Writing a zero to this bit in the Descriptor or Write-Back memory will suspend the DMA channel operation when fetching the corresponding descriptor.

The bit is automatically cleared in the Write-Back memory section when channel is aborted, when an error is detected during the block transfer, or when the block transfer is completed.

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_895d26cc64e2eff3473a90b1063cbcca70b888b6ecd7a62915bdd364125579e3.jpg)

## 19.8.2.2 Block Transfer Count

The BTCNT register offset is relative to (BASEADDR or WRBADDR) + Channel Number \* 0x10

## z Bits 15:0 – BTCNT[15:0]: Block Transfer Count

This bit group holds the 16-bit block transfer count.

During a transfer, the internal counter value is decremented by one after each beat transfer. The internal counter is written to the corresponding write-back memory section for the DMA channel when the DMA channel loses priority, is suspended or gets disabled. The DMA channel can be disabled by a complete transfer, a transfer error or by software.

## 19.8.2.3 Transfer Source Address

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">SRCADDR[31:24]</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">SRCADDR[23:16]</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">SRCADDR[15:8]</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">SRCADDR[7:0]</td></tr></table>

The SRCADDR register offset is relative to (BASEADDR or WRBADDR) + Channel Number \* 0x10

Bits 31:0 – SRCADDR[31:0]: Transfer Source Address

This bit group holds the source address corresponding to the last beat transfer address in the block transfer.

19.8.2.4 Transfer Destination Address

<table><tr><td>Name:</td><td colspan="8">DSTADDR</td></tr><tr><td>Offset:</td><td colspan="8">0x08</td></tr><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DSTADDR[31:24]</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DSTADDR[23:16]</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DSTADDR[15:8]</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DSTADDR[7:0]</td></tr></table>

The DSTADDR register offset is relative to (BASEADDR or WRBADDR) + Channel Number \* 0x10

z Bits 31:0 – DSTADDR[31:0]: Transfer Destination Address This bit group holds the destination address corresponding to the last beat transfer address in the block transfer.

19.8.2.5 Next Descriptor Address

<table><tr><td>Name:</td><td colspan="8">DESCADDR</td></tr><tr><td>Offset:</td><td colspan="8">0x0C</td></tr><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DESCADDR[31:24]</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DESCADDR[23:16]</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DESCADDR[15:8]</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DESCADDR[7:0]</td></tr></table>

The DESCADDR register offset is relative to (BASEADDR or WRBADDR) + Channel Number \* 0x10

## z Bits 31:0 – DESCADDR[31:0]: Next Descriptor Address

This bit group holds the SRAM address of the next descriptor. The value must be 128-bit aligned. If the value of this SRAM register is 0x00000000, the transaction will be terminated when the DMAC tries to load the next trans fer descriptor.

## 20. EIC – External Interrupt Controller

## 20.1 Overview

The External Interrupt Controller (EIC) allows external pins to be configured as interrupt lines. Each interrupt line can be individually masked and can generate an interrupt on rising, falling or both edges, or on high or low levels. Each external pin has a configurable filter to remove spikes. Each external pin can also be configured to be asynchronous in order to wake up the device from sleep modes where all clocks have been disabled. External pins can also generate an event.

A separate non-maskable interrupt (NMI) is also supported. It has properties similar to the other external interrupts, but is connected to the NMI request of the CPU, enabling it to interrupt any other interrupt mode.

## 20.2 Features

z 8 external pins, plus one non-maskable pin

z Dedicated interrupt line for each pin

z Individually maskable interrupt lines

z Interrupt on rising, falling or both edges

Interrupt on high or low levels

Asynchronous interrupts for sleep modes without clock

z Filtering of external pins

● Event generation

z Configurable wake-up for sleep modes

## 20.3 Block Diagram

Figure 20-1. EIC Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_9cf2ec1174f5a7a4cac5fc1b99cba883c89f579916ab9b9949c36ff76e1b5ca0.jpg)

20.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>EXTINT[7..0]</td><td>Digital Input</td><td>External interrupt pin</td></tr><tr><td>NMI</td><td>Digital Input</td><td>Non-maskable interrupt pin</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 20.5 Product Dependencies

In order to use this EIC, other parts of the system must be configured correctly, as described below.

## 20.5.1 I/O Lines

Using the EIC’s I/O lines requires the I/O pins to be configured. Refer to “PORT” on page 378 for details.

## 20.5.2 Power Management

All interrupts are available in all sleep modes, but the EIC can be configured to automatically mask some interrupts in order to prevent device wake-up.

The EIC will continue to operate in any sleep mode where the selected source clock is running. The EIC’s interrupts can be used to wake up the device from sleep modes. Events connected to the Event System can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 20.5.3 Clocks

The EIC bus clock (CLK\_EIC\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_EIC\_APB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110.

A generic clock (GCLK\_EIC) is required to clock the peripheral. This clock must be configured and enabled in the Generic Clock Controller before using the peripheral. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the user interface clock (CLK\_EIC\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 341 for further details.

## 20.5.4 DMA

Not applicable.

## 20.5.5 Interrupts

There are two interrupt request lines, one for the external interrupts (EXTINT) and one for non-maskable interrupt (NMI).

The EXTINT interrupt request line is connected to the interrupt controller. Using the EIC interrupt requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

The NMI interrupt request line is also connected to the interrupt controller, but does not require the interrupt to be configured.

## 20.5.6 Events

The events are connected to the Event System. Using the events requires the Event System to be configured first. The External Interrupt Controller generates events as pulses.

Refer to “EVSYS – Event System” on page 405 for details.

## 20.5.7 Debug Operation

When the CPU is halted in debug mode, the EIC continues normal operation. If the EIC is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

## 20.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

z Interrupt Flag Status and Clear register (INTFLAG - refer to INTFLAG)

z Non-Maskable Interrupt Flag Status and Clear register (NMIFLAG - refer to NMIFLAG)

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply to accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 20.5.9 Analog Connections

Not applicable.

## 20.6 Functional Description

## 20.6.1 Principle of Operation

The EIC detects edge or level condition to generate interrupts to the CPU Interrupt Controller or events to the Event System. Each external interrupt pin (EXTINT) can be filtered using majority vote filtering, clocked by generic clock GCLK\_EIC.

## 20.6.2 Basic Operation

## 20.6.2.1 Initialization

The EIC must be initialized in the following order:

1. Enable CLK\_EIC\_APB

2. If edge detection or filtering is required, GCLK\_EIC must be enabled

3. Write the EIC configuration registers (EVCTRL, WAKEUP, CONFIGy)

4. Enable the EIC

When NMI is used, GCLK\_EIC must be enabled after EIC configuration (NMICTRL).

## 20.6.2.2 Enabling, Disabling and Resetting

The EIC is enabled by writing a one to the Enable bit in the Control register (CTRL.ENABLE). The EIC is disabled by writing a zero to CTRL.ENABLE.

The EIC is reset by writing a one to the Software Reset bit in the Control register (CTRL.SWRST). All registers in the EIC will be reset to their initial state, and the EIC will be disabled.

Refer to CTRL register for details.

## 20.6.3 External Pin Processing

Each external pin can be configured to generate an interrupt/event on edge detection (rising, falling or both edges) or level detection (high or low). The sense of external pins is configured by writing the Interrupt Sense x bits in the Config y register (CONFIGy.SENSEx). The corresponding interrupt flag (INTFLAG.EXTINT[x]) in the Interrupt Flag Status

and Clear register (INTFLAG) is set when the interrupt condition is met (CONFIGy.SENSEx must be different from zero).

When the interrupt has been cleared in edge-sensitive mode, INTFLAG.EXTINT[x] will only be set if a new interrupt condition is met. In level-sensitive mode, when interrupt has been cleared, INTFLAG.EXTINT[x] will be set immediately if the EXTINTx pin still matches the interrupt condition.

Each external pin can be filtered by a majority vote filtering, clocked by GCLK\_EIC. Filtering is enabled if bit Filter Enable x in the Configuration y register (CONFIGy.FILTENx) is written to one. The majority vote filter samples the external pin three times with GCLK\_EIC and outputs the value when two or more samples are equal.

Table 20-1. Majority Vote Filter

<table><tr><td>Samples [0, 1, 2]</td><td>Filter Output</td></tr><tr><td>[0,0,0]</td><td>0</td></tr><tr><td>[0,0,1]</td><td>0</td></tr><tr><td>[0,1,0]</td><td>0</td></tr><tr><td>[0,1,1]</td><td>1</td></tr><tr><td>[1,0,0]</td><td>0</td></tr><tr><td>[1,0,1]</td><td>1</td></tr><tr><td>[1,1,0]</td><td>1</td></tr><tr><td>[1,1,1]</td><td>1</td></tr></table>

When an external interrupt is configured for level detection, or if filtering is disabled, detection is made asynchronously, and GCLK\_EIC is not required.  
If filtering or edge detection is enabled, the EIC automatically requests the GCLK\_EIC to operate (GCLK\_EIC must be enabled in the GCLK module, see “GCLK – Generic Clock Controller” on page 88 for details). If level detection is enabled, GCLK\_EIC is not required, but interrupt and events can still be generated.

Figure 20-2. Interrupt detections  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_21026f8e8f41b29ced83aada50b1f62e802d8cf344ceb787143267eca3367936.jpg)

The detection delay depends on the detection mode.

Table 20-2. Interrupt Latency

<table><tr><td>Detection Mode</td><td>Latency (Worst Case)</td></tr><tr><td>Level without filter</td><td>3 CLK_EIC_APB periods</td></tr><tr><td>Level with filter</td><td>4 GCLK_EIC periods + 3 CLK_EIC_APB periods</td></tr><tr><td>Edge without filter</td><td>4 GCLK_EIC periods + 3 CLK_EIC_APB periods</td></tr><tr><td>Edge with filter</td><td>6 GCLK_EIC periods + 3 CLK_EIC_APB periods</td></tr></table>

## 20.6.4 Additional Features

The non-maskable interrupt pin can also generate an interrupt on edge or level detection, but it is configured with the dedicated NMI Control register (NMICTRL - refer to NMICTRL). To select the sense for NMI, write to the NMISENSE bit group in the NMI Control register (NMICTRL.NMISENSE). NMI filtering is enabled by writing a one to the NMI Filter Enable bit (NMICTRL.NMIFILTEN).

NMI detection is enabled only by the NMICTRL.NMISENSE value, and the EIC is not required to be enabled.

After reset, NMI is configured to no detection mode.

When an NMI is detected, the non-maskable interrupt flag in the NMI Flag Status and Clear register is set (NMIFLAG.NMI). NMI interrupt generation is always enabled, and NMIFLAG.NMI generates an interrupt request when set.

## 20.6.5 DMA Operation

Not applicable.

## 20.6.6 Interrupts

The EIC has the following interrupt sources:

External interrupt pins (EXTINTx). See “Basic Operation” on page 338

Non-maskable interrupt pin (NMI). See “Additional Features” on page 340

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when an interrupt condition occurs (NMIFLAG for NMI). Each interrupt, except NMI, can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the EIC is reset. See the INTFLAG register for details on how to clear interrupt flags. The EIC has one common interrupt request line for all the interrupt sources (except the NMI interrupt request line). Refer to “Processor And Architecture” on page 25 for details. The user must read the INTFLAG (or NMIFLAG) register to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Processor And Architecture” on page 25 for details.

## 20.6.7 Events

The EIC can generate the following output events:

z External event from pin (EXTINTx).

Writing a one to an Event Output Control register (EVCTRLEXTINTEO) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event. Refer to “EVSYS – Event System” on page 405 fo details on configuring the Event System.

When the condition on pin EXTINTx matches the configuration in the CONFIGy register, the corresponding event is generated, if enabled.

## 20.6.8 Sleep Mode Operation

In sleep modes, an EXTINTx pin can wake up the device if the corresponding condition matches the configuration in CONFIGy register. Writing a one to a Wake-Up Enable bit (WAKEUP.WAKEUPEN[x]) enables the wake-up from pin EXTINTx. Writing a zero to a Wake-Up Enable bit (WAKEUP.WAKEUPEN[x]) disables the wake-up from pin EXTINTx.

Using WAKEUPEN[x]=1 with INTENSET=0 is not recommended.

Figure 20-3. Wake-Up Operation Example (High-Level Detection, No Filter, WAKEUPEN[x]=1)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_f9f9290912dc0dc74786d72d94f17bbac25e674e573c0f35117cf3ef618c3027.jpg)

## 20.6.9 Synchronization

Due to the asynchronicity between CLK\_EIC\_APB and GCLK\_EIC, some registers must be synchronized when accessed. A register can require:

Synchronization when written

z Synchronization when read

z Synchronization when written and read

● No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete.

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled, and interrupts will be pending as long as the bus is stalled.

The following bits need synchronization when written:

Software Reset bit in the Control register (CTRL.SWRST)

● Enable bit in the Control register (CTRL.ENABLE)

No register needs synchronization when written.

No register needs synchronization when read.

## 20.7 Register Summary

Table 20-3. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td>CTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x02</td><td>NMICTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td>NMIFILTEN</td><td colspan="3">NMISENSE[2:0]</td></tr><tr><td>0x03</td><td>NMIFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>NMI</td></tr><tr><td>0x04</td><td rowspan="4">EVCTRL</td><td>7:0</td><td>EXTINTEO7</td><td>EXTINTEO6</td><td>EXTINTEO5</td><td>EXTINTEO4</td><td>EXTINTEO3</td><td>EXTINTEO2</td><td>EXTINTEO1</td><td>EXTINTEO0</td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td rowspan="4">INTENCLR</td><td>7:0</td><td>EXTINT7</td><td>EXTINT6</td><td>EXTINT5</td><td>EXTINT4</td><td>EXTINT3</td><td>EXTINT2</td><td>EXTINT1</td><td>EXTINT0</td></tr><tr><td>0x09</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td rowspan="4">INTENSET</td><td>7:0</td><td>EXTINT7</td><td>EXTINT6</td><td>EXTINT5</td><td>EXTINT4</td><td>EXTINT3</td><td>EXTINT2</td><td>EXTINT1</td><td>EXTINT0</td></tr><tr><td>0x0D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">INTFLAG</td><td>7:0</td><td>EXTINT7</td><td>EXTINT6</td><td>EXTINT5</td><td>EXTINT4</td><td>EXTINT3</td><td>EXTINT2</td><td>EXTINT1</td><td>EXTINT0</td></tr><tr><td>0x11</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x12</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="4">WAKEUP</td><td>7:0</td><td>WAKEUPEN7</td><td>WAKEUPEN6</td><td>WAKEUPEN5</td><td>WAKEUPEN4</td><td>WAKEUPEN3</td><td>WAKEUPEN2</td><td>WAKEUPEN1</td><td>WAKEUPEN0</td></tr><tr><td>0x15</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">CONFIG0</td><td>7:0</td><td>FILTEN1</td><td colspan="3">SENSE1[2:0]</td><td>FILTEN0</td><td colspan="3">SENSE0[2:0]</td></tr><tr><td>0x19</td><td>15:8</td><td>FILTEN3</td><td colspan="3">SENSE3[2:0]</td><td>FILTEN2</td><td colspan="3">SENSE2[2:0]</td></tr><tr><td>0x1A</td><td>23:16</td><td>FILTEN5</td><td colspan="3">SENSE5[2:0]</td><td>FILTEN4</td><td colspan="3">SENSE4[2:0]</td></tr><tr><td>0x1B</td><td>31:24</td><td>FILTEN7</td><td colspan="3">SENSE7[2:0]</td><td>FILTEN6</td><td colspan="3">SENSE6[2:0]</td></tr></table>

## 20.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-protected property in each individual register description. Refer to “Register Access Protection” on page 338 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Synchronized property in each individual register description. Refer to “Synchronization” on page 341 for details.

Some registers are enable-protected, meaning they can be written only when the EIC is disabled. Enable-protection is denoted by the Enabled-Protected property in each individual register description.

## 20.8.1 Control

Name: CTRL

Offset: 0x00

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 1 – ENABLE: Enable

0: The EIC is disabled.

1: The EIC is enabled.

Due to synchronization, there is delay from writing CTRL.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately, and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete.

## Bit 0 – SWRST: Software Reset

0: There is no ongoing reset operation.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the EIC to their initial state, and the EIC will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write operation will be discarded.

Due to synchronization, there is a delay from writing CTRL.SWRST until the reset is complete. CTRL.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

## 20.8.2 Status

Name: STATUS

Offset: 0x01

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 20.8.3 Non-Maskable Interrupt Control

Name: NMICTRL

Offset: 0x02

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>NMIFILTEN</td><td></td><td colspan="2">NMISENSE[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bit 3 – NMIFILTEN: Non-Maskable Interrupt Filter Enable

0: NMI filter is disabled.

1: NMI filter is enabled.

z Bits 2:0 – NMISENSE[2:0]: Non-Maskable Interrupt Sense These bits define on which edge or level the NMI triggers.

Table 20-4. Non-Maskable Interrupt Sense

<table><tr><td>NMISENSE[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No detection</td></tr><tr><td>0x1</td><td>RISE</td><td>Rising-edge detection</td></tr><tr><td>0x2</td><td>FALL</td><td>Falling-edge detection</td></tr><tr><td>0x3</td><td>BOTH</td><td>Both-edges detection</td></tr><tr><td>0x4</td><td>HIGH</td><td>High-level detection</td></tr><tr><td>0x5</td><td>LOW</td><td>Low-level detection</td></tr><tr><td>0x6-0x7</td><td></td><td>Reserved</td></tr></table>

## 20.8.4 Non-Maskable Interrupt Flag Status and Clear

Name: NMIFLAG

Offset: 0x03

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>NMI</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – NMI: Non-Maskable Interrupt

This flag is cleared by writing a one to it.

This flag is set when the NMI pin matches the NMI sense configuration, and will generate an interrupt request. Writing a zero to this bit has no effect.

Writing a one to this bit clears the non-maskable interrupt flag.

## 20.8.5 Event Contro

Name: EVCTRL

Offset: 0x04

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>EXTINTEO7</td><td>EXTINTEO6</td><td>EXTINTEO5</td><td>EXTINTEO4</td><td>EXTINTEO3</td><td>EXTINTEO2</td><td>EXTINTEO1</td><td>EXTINTEO0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 7:0 – EXTINTEOx [x=7..0]: External Interrupt x Event Output Enable These bits indicate whether the event associated with the EXTINTx pin is enabled or not to generated for every detection.

0: Event from pin EXTINTx is disabled.

1: Event from pin EXTINTx is enabled.

## 20.8.6 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x08

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>EXTINT7</td><td>EXTINT6</td><td>EXTINT5</td><td>EXTINT4</td><td>EXTINT3</td><td>EXTINT2</td><td>EXTINT1</td><td>EXTINT0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 7:0 – EXTINTx [x=7..0]: External Interrupt x Enable

0: The external interrupt x is disabled.

1: The external interrupt x is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the External Interrupt x Enable bit, which enables the external interrupt.

## 20.8.7 Interrupt Enable Set

Name: INTENSET

Offset: 0x0C

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>EXTINT7</td><td>EXTINT6</td><td>EXTINT5</td><td>EXTINT4</td><td>EXTINT3</td><td>EXTINT2</td><td>EXTINT1</td><td>EXTINT0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear (INTENCLR) register.

## Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 7:0 – EXTINTx [x=7..0]: External Interrupt x Enable

0: The external interrupt x is disabled.

1: The external interrupt x is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the External Interrupt x Enable bit, which enables the external interrupt.

## 20.8.8 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>EXTINT7</td><td>EXTINT6</td><td>EXTINT5</td><td>EXTINT4</td><td>EXTINT3</td><td>EXTINT2</td><td>EXTINT1</td><td>EXTINT0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 7:0 – EXTINTx [x=7..0]: External Interrupt x

This flag is cleared by writing a one to it.

This flag is set when EXTINTx pin matches the external interrupt sense configuration and will generate an interrupt request if INTENCLR/SET.EXTINT[x] is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the External Interrupt x flag.

## 20.8.9 Wake-Up Enable

Name: WAKEUP

Offset: 0x14

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>WAKEUPEN7</td><td>WAKEUPEN6</td><td>WAKEUPEN5</td><td>WAKEUPEN4</td><td>WAKEUPEN3</td><td>WAKEUPEN2</td><td>WAKEUPEN1</td><td>WAKEUPENO</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 7:0 – WAKEUPENx [x=7..0]: External Interrupt x Wake-up Enable

This bit enables or disables wake-up from sleep modes when the EXTINTx pin matches the external interrupt sense configuration.

0: Wake-up from the EXTINTx pin is disabled.

1: Wake-up from the EXTINTx pin is enabled.

## 20.8.10 Configuration n

Name: CONFIG

Offset: 0x18

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td>FILTEN7</td><td colspan="3">SENSE7[2:0]</td><td>FILTEN6</td><td colspan="3">SENSE6[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td>FILTEN5</td><td colspan="3">SENSE5[2:0]</td><td>FILTEN4</td><td colspan="3">SENSE4[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>FILTEN3</td><td colspan="3">SENSE3[2:0]</td><td>FILTEN2</td><td colspan="3">SENSE2[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>FILTEN1</td><td colspan="3">SENSE1[2:0]</td><td>FILTENO</td><td colspan="3">SENSE0[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31, 27, 23, 19, 15, 11, 7 – FILTENx: Filter 0 Enable 0: Filter is disabled for EXTINT[n\*8+x] input. 1: Filter is enabled for EXTINT[n\*8+x] input.

z Bits 30:28, 26:24, 22:20, 18:16, 14:12, 10:8, 6:4 – SENSEx: Input Sense 0 Configuration These bits define on which edge or level the interrupt or event for EXTINT[n\*8+x] will be generated.

Table 20-5. Input Sense 0 Configuration

<table><tr><td>SENSE0[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No detection</td></tr><tr><td>0x1</td><td>RISE</td><td>Rising-edge detection</td></tr><tr><td>0x2</td><td>FALL</td><td>Falling-edge detection</td></tr><tr><td>0x3</td><td>BOTH</td><td>Both-edges detection</td></tr><tr><td>0x4</td><td>HIGH</td><td>High-level detection</td></tr><tr><td>0x5</td><td>LOW</td><td>Low-level detection</td></tr><tr><td>0x6-0x7</td><td></td><td>Reserved</td></tr></table>

## 21. NVMCTRL – Non-Volatile Memory Controller

## 21.1 Overview

Non-volatile memory (NVM) is a reprogrammable flash memory that retains program and data storage even with power off. The NVM Controller (NVMCTRL) connects to the AHB and APB bus interfaces for system access to the NVM block. The AHB interface is used for reads and writes to the NVM block, while the APB interface is used for commands and configuration.

## 21.2 Features

z 32-bit AHB interface for reads and writes

z All NVM sections are memory mapped to the AHB, including calibration and system configuration

z 32-bit APB interface for commands and control

z Programmable wait states for read optimization

z 16 regions can be individually protected or unprotected

z Additional protection for boot loader

z Supports device protection through a security bit

z Interface to Power Manager for power-down of flash blocks in sleep modes

z Can optionally wake up on exit from sleep or on first access

z Direct-mapped cache

## 21.3 Block Diagram

Figure 21-1. Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_d203883b66991337d7bb1c5849351d4f6899a1cd7259ea4c504bfc272663107d.jpg)

## 21.4 Signal Description

Not applicable

## 21.5 Product Dependencies

In order to use this module, other parts of the system must be configured correctly, as described below.

## 21.5.1 Power Management

The NVMCTRL will continue to operate in any sleep mode where the selected source clock is running. The NVMCTRL’s interrupts can be used to wake up the device from sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

The Power Manager will automatically put the NVM block into a low-power state when entering sleep mode. This is based on the Control B register (CTRLB - refer to CTRLB) SLEEPPRM bit setting. Read the CTRLB register description for more details.

## 21.5.2 Clocks

Two synchronous clocks are used by the NVMCTRL. One is provided by the AHB bus (CLK\_NVMCTRL\_AHB) and the other is provided by the APB bus (CLK\_NVMCTRL\_APB). For higher system frequencies, a programmable number of wait states can be used to optimize performance. When changing the AHB bus frequency, the user must ensure that the NVM Controller is configured with the proper number of wait states. Refer to the “Electrical Characteristics” on page 858 for the exact number of wait states to be used for a particular frequency range.

## 21.5.3 Interrupts

The NVM Controller interrupt request line is connected to the interrupt controller. Using the NVMCTRL interrupt requires the interrupt controller to be programmed first.

Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 21.5.4 Debug Operation

When an external debugger forces the CPU into debug mode, the peripheral continues normal operation.

Access to the NVM block can be protected by the security bit. In this case, the NVM block will not be accessible. See “Security Bit” on page 361 for details.

## 21.5.5 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

● Interrupt Flag Status and Clear register (INTFLAG - refer to INTFLAG)

Status register (STATUS - refer to STATUS)

Write-protection is denoted by the Write-Protected property in the register description. Write-protection does not apply for accesses through an external debugger.

When the CPU is halted in debug mode, all write-protection is automatically disabled. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 21.5.6 Analog Connections

Not applicable.

## 21.6 Functional Description

## 21.6.1 Principle of Operation

The NVM Controller is a slave on the AHB and APB buses. It responds to commands, read requests and write requests, based on user configuration.

## 21.6.2 Basic Operations

## 21.6.2.1 Initialization

After power up, the NVM Controller goes through a power-up sequence. During this time, access to the NVM Controller from the AHB bus is halted. Upon power-up completion, the NVM Controller is operational without any need for user configuration.

## 21.6.2.2 Enabling, Disabling and Resetting

Not applicable.

## 21.6.3 Memory Organization

Refer to “Physical Memory Map” on page 21 for memory sizes and addresses for each device.

The NVM is organized into rows, where each row contains four pages, as shown in Figure 21-2. The NVM has a rowerase granularity, while the write granularity is by page. In other words, a single row erase will erase all four pages in the row, while four write operations are used to write the complete row.

Figure 21-2. Row Organization

<table><tr><td>Row n</td><td>Page (n * 4) + 3</td><td>Page (n * 4) + 2</td><td>Page (n * 4) + 1</td><td>Page (n * 4) + 0</td></tr></table>

The NVM block contains a calibration and auxiliary space that is memory mapped. Refer to Figure 21-3for details.

The calibration and auxiliary space contains factory calibration and system configuration information. This space can be read from the AHB bus in the same way as the main NVM main address space.

In addition, a boot loader section can be allocated at the beginning of the main array, and an EEPROM emulation area can be allocated at the end of the NVM main address space.

Figure 21-3. NVM Memory Organization  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_37ef61977efa5296b8cb4075f9c62d68d32db5ae64f3b73b66008f7c8343f33c.jpg)

The lower rows in the NVM main address space can be allocated as a boot loader section by using the BOOTPROT fuses, and the upper rows can be allocated to EEPROM emulation, as shown in Figure 21-4. The boot loader section is protected by the lock bit(s) corresponding to this address space and by the BOOTPROT[2:0] fuse. The EEPROM rows can be written regardless of the region lock status. The number of rows protected by BOOTPROT and the number of rows allocated to EEPROM emulation are given in Table 21-2 and Table 21-3, respectively.

Figure 21-4. EEPROM Emulation and Boot Loader Allocation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_0e25aaa5691f9e86a52e4005fe2b31d68f8538f758c6426f1dfdc96acf06d0ba.jpg)

## 21.6.4 Region Lock Bits

The NVM block is grouped into 16 equally sized regions. The region size is dependent on the flash memory size, and is given in the table below. Each region has a dedicated lock bit preventing writing and erasing pages in the region. After production, all regions will be unlocked.

Table 21-1. Region Size

<table><tr><td>Memory Size [KB]</td><td>Region Size [KB]</td></tr><tr><td>256</td><td>16</td></tr><tr><td>128</td><td>8</td></tr><tr><td>64</td><td>4</td></tr><tr><td>32</td><td>2</td></tr></table>

To lock or unlock a region, the Lock Region and Unlock Region commands are provided. Writing one of these commands will temporarily lock/unlock the region containing the address loaded in the ADDR register. ADDR can be written by software, or the automatically loaded value from a write operation can be used. The new setting will stay in effect until the next reset, or the setting can be changed again using the lock and unlock commands. The current status of the lock can be determined by reading the LOCK register.

To change the default lock/unlock setting for a region, the user configuration section of the auxiliary space must be written using the Write Auxiliary Page command. Writing to the auxiliary space will take effect after the next reset. Therefore, a boot of the device is needed for changes in the lock/unlock setting to take effect. See “Physical Memory Map” on page 21 for calibration and auxiliary space address mapping.

## 21.6.5 Command and Data Interface

The NVM Controller is addressable from the APB bus, while the NVM main address space is addressable from the AHB bus. Read and automatic page write operations are performed by addressing the NVM main address space directly, while other operations such as manual page writes and row erase must be performed by issuing commands through the NVM Controller.

To issue a command, the CTRLA.CMD bits must be written along with the CTRLA.CMDEX value. When a command is issued, INTFLAG.READY will be cleared until the command has completed. Any commands written while INTFLAG.READY is low will be ignored. Read the CTRLA register description for more details.

The CTRLB register must be used to control the power reduction mode, read wait states and the write mode.

## 21.6.5.1 NVM Read

Reading from the NVM main address space is performed via the AHB bus by addressing the NVM main address space or auxiliary address space directly. Read data is available after the configured number of read wait states (CTRLB.RWS) set in the NVM Controller, has passed.

The number of cycles data are delayed to the AHB bus is determined by the read wait states. Examples of using zero and one wait states are shown in Figure 21-5.

Figure 21-5. Read Wait State Examples  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_b881552e92b88835a0a103c861957e6d07aaa0df404aed1ba5fe19cce3703ae4.jpg)

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_8c06cb18b6adc0d001174f94d34219b103cb4601720763bca8cad917d1eeb6ec.jpg)

## 21.6.5.2 NVM Write

The NVM Controller requires that an erase must be done before programming. The entire NVM main address space can be erased by a debugger Chip Erase command. Alternatively, rows can be individually erased by the Erase Row command.

After programming, the region that the page resides in can be locked to prevent spurious write or erase sequences. Locking is performed on a per-region basis, and so locking a region locks all pages inside the region.

Data to be written to the NVM block are first written and stored in an internal buffer called the page buffer. The page buffer contains the same number of bytes as an NVM page. Writes to the page buffer must be 16 or 32 bits. 8-bit writes to the page buffer is not allowed, and will cause a system exception.

Writing to the NVM block via the AHB bus is performed by a load operation to the page buffer. For each AHB bus write, the address is stored in the ADDR register. After the page buffer has been loaded with the required number of bytes, the page can be written to the addressed location by setting CMD to Write Page and setting the key value to CMDEX. The LOAD bit in the STATUS register indicates whether the page buffer has been loaded or not. Before writing the page to memory, the accessed row must be erased.

By default, automatic page writes are enabled (MANW=0). This will trigger a write operation to the page addressed by ADDR when the last location of the page is written.

Because the address is automatically stored in ADDR during the I/O bus write operation, the last given address will be present in the ADDR register. There is no need to load the ADDR register manually, unless a different page in memory is to be written.

## Procedure for Manual Page Writes (MANW=1)

The row to be written must be erased before the write command is given.

z Write to the page buffer by addressing the NVM main address space directly

z Write the page buffer to memory: CMD=Write Page and CMDEX

z The READY bit in the INTFLAG register will be low while programming is in progress, and access through the AHB will be stalled

## Procedure for Automatic Page Writes (MANW=0)

The row to be written must be erased before the last write to the page buffer is performed.

Note that partially written pages must be written with a manual write.

z Write to the page buffer by addressing the NVM main address space directly.

When the last location in the page buffer is written, the page is automatically written to NVM main address space.

z INTFLAG.READY will be zero while programming is in progress and access through the AHB will be stalled.

## 21.6.5.3 Page Buffer Clear

The page buffer is automatically cleared to all ones after a page write is performed. If a partial page has been written and it is desired to clear the contents of the page buffer, the Page Buffer Clear command can be used.

## 21.6.5.4 Erase Row

Before a page can be written, the row that contains the page must be erased. The Erase Row command can be used to erase the desired row. Erasing the row sets all bits to one. If the row resides in a region that is locked, the erase will not be performed and the Lock Error bit in the Status register (STATUS.LOCKE) will be set.

## Procedure for Erase Row

z Write the address of the row to erase ADDR. Any address within the row can be used.

● Issue an Erase Row command.

## 21.6.5.5 Lock and Unlock Region

These commands are used to lock and unlock regions as detailed in section “Region Lock Bits” on page 358.

## 21.6.5.6 Set and Clear Power Reduction Mode

The NVM Controller and block can be taken in and out of power reduction mode through the set and clear powe reduction mode commands. When the NVM Controller and block are in power reduction mode, the Power Reduction Mode bit in the Status register (STATUS.PRM) is set.

## 21.6.6 NVM User Configuration

The NVM user configuration resides in the auxiliary space. See “Physical Memory Map” on page 21 for calibration and auxiliary space address mapping.

The bootloader resides in the main array starting at offset zero. The allocated boot loader section is protected against write.

Table 21-2. Boot Loader Size

<table><tr><td>BOOTPROT [2:0]</td><td>Rows Protected by BOOTPROT</td><td>Boot Loader Size in Bytes</td></tr><tr><td>7</td><td>None</td><td>0</td></tr><tr><td>6</td><td>2</td><td>512</td></tr><tr><td>5</td><td>4</td><td>1024</td></tr><tr><td>4</td><td>8</td><td>2048</td></tr><tr><td>3</td><td>16</td><td>4096</td></tr><tr><td>2</td><td>32</td><td>8192</td></tr><tr><td>1</td><td>64</td><td>16384</td></tr><tr><td>0</td><td>128</td><td>32768</td></tr></table>

The EEPROM bits indicates the Flash size reserved for EEPROM emulation according to the Table 21-3. EEPROM resides in the upper rows of the NVM main address space and are writable, regardless of the region lock status.

Table 21-3. Flash size for EEPROM emulation

<table><tr><td>EEPROM[2:0]</td><td>Rows Allocated to EEPROM</td><td>EEPROM Size in Bytes for EEPROM emulation(1)</td></tr><tr><td>7</td><td>None</td><td>0</td></tr><tr><td>6</td><td>1</td><td>256</td></tr><tr><td>5</td><td>2</td><td>512</td></tr><tr><td>4</td><td>4</td><td>1024</td></tr><tr><td>3</td><td>8</td><td>2048</td></tr><tr><td>2</td><td>16</td><td>4096</td></tr><tr><td>1</td><td>32</td><td>8192</td></tr><tr><td>0</td><td>64</td><td>16384</td></tr></table>

Note: 1. the actual size of the EEPROM depends on the emulation software. For more information see Application Note AT03265

## 21.6.7 Security Bit

The security bit allows the entire chip to be locked from external access for code security. The security bit can be written by a dedicated command, Set Security Bit (SSB). Once set, the only way to clear the security bit is through a debugger Chip Erase command. After issuing the SSB command, the PROGE error bit can be checked. Refer to “DSU – Device Service Unit” on page 39 for details.

## 21.6.8 Cache

The NVM Controller cache reduces the device power consumption and improves system performance when wait states are required. It is a direct-mapped cache that implements 8 lines of 64 bits (i.e., 64 bytes). NVM Controller cache can be enabled by writing a zero in the CACHEDIS bit in the CTRLB register (CTRLB.CACHEDIS). Cache can be configured to three different modes using the READMODE bit group in the CTRLB register. Refer to CTRLB register description for more details. The INVALL command can be issued through the CTRLA register to invalidate all cache lines. Commands affecting NVM content automatically invalidate cache lines.

## 21.7 Register Summary

Table 21-4. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRLA</td><td>7:0</td><td></td><td colspan="7">CMD[6:0]</td></tr><tr><td>0x01</td><td>15:8</td><td colspan="8">CMDEX[7:0]</td></tr><tr><td>0x02</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x03</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="4">CTRLB</td><td>7:0</td><td>MANW</td><td></td><td></td><td colspan="4">RWS[3:0]</td><td></td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">SLEEPPRM[1:0]</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td>CACHEDIS</td><td colspan="2">READMODE[1:0]</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td rowspan="4">PARAM</td><td>7:0</td><td colspan="8">NVMP[7:0]</td></tr><tr><td>0x09</td><td>15:8</td><td colspan="8">NVMP[15:8]</td></tr><tr><td>0x0A</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">PSZ[2:0]</td></tr><tr><td>0x0B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROR</td><td>READY</td></tr><tr><td>0x0D ... 0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROR</td><td>READY</td></tr><tr><td>0x11 ... 0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROR</td><td>READY</td></tr><tr><td>0x15 ... 0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="2">STATUS</td><td>7:0</td><td></td><td></td><td></td><td>NVME</td><td>LOCKE</td><td>PROGE</td><td>LOAD</td><td>PRM</td></tr><tr><td>0x19</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SB</td></tr><tr><td>0x1A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="8">ADDR[7:0]</td></tr><tr><td>0x1D</td><td>15:8</td><td colspan="8">ADDR[15:8]</td></tr><tr><td>0x1E</td><td>23:16</td><td></td><td></td><td colspan="6">ADDR[21:16]</td></tr><tr><td>0x1F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="2">LOCK</td><td>7:0</td><td colspan="8">LOCK[7:0]</td></tr><tr><td>0x21</td><td>15:8</td><td colspan="8">LOCK[15:8]</td></tr></table>

## 21.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to the “Register Access Protection” on page 356 and the “PAC – Peripheral Access Controller” on page 30 for details.

## 21.8.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CMDEX[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CMD[6:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:8 – CMDEX[7:0]: Command Execution

This bit group should be written with the key value 0xA5 to enable the command written to CMD to be executed. If the bit group is written with a different key value, the write is not performed and the PROGE status bit is set. PROGE is also set if the a previously written command is not complete.

The key value must be written at the same time as CMD. If a command is issued through the APB bus on the same cycle as an AHB bus access, the AHB bus access will be given priority. The command will then be executed when the NVM block and the AHB bus are idle.

The READY status must be one when the command is issued.

Bit 0 of the CMDEX bit group will read back as one until the command is issued.

Table 21-5. Command Execution

<table><tr><td>CMDEX[7:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0-0xa4</td><td></td><td>Reserved</td></tr><tr><td>0xA5</td><td>KEY</td><td>Execution Key</td></tr><tr><td>0xa6-0xff</td><td></td><td>Reserved</td></tr></table>

## z Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 6:0 – CMD[6:0]: Command

These bits define the command to be executed when the CMDEX key is written, as shown in Table 21-6.

Table 21-6. Command

<table><tr><td>CMD[6:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0-0x1</td><td></td><td>Reserved</td></tr><tr><td>0x2</td><td>ER</td><td>Erase Row - Erases the row addressed by the ADDR register.</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr><tr><td>0x4</td><td>WP</td><td>Write Page - Writes the contents of the page buffer to the page addressed by the ADDR register.</td></tr><tr><td>0x5</td><td>EAR</td><td>Erase Auxiliary Row - Erases the auxiliary row addressed by the ADDR register. This command can be given only when the security bit is not set and only to the user configuration row.</td></tr><tr><td>0x6</td><td>WAP</td><td>Write Auxiliary Page - Writes the contents of the page buffer to the page addressed by the ADDR register. This command can be given only when the security bit is not set and only to the user configuration row.</td></tr><tr><td>0x7-0x9</td><td></td><td>Reserved</td></tr><tr><td>0xA</td><td>SF</td><td>Security Flow Command</td></tr><tr><td>0xb-0xe</td><td></td><td>Reserved</td></tr><tr><td>0xF</td><td>WL</td><td>Write lockbits</td></tr><tr><td>0x10-0x3f</td><td></td><td>Reserved</td></tr><tr><td>0x40</td><td>LR</td><td>Lock Region - Locks the region containing the address location in the ADDR register.</td></tr><tr><td>0x41</td><td>UR</td><td>Unlock Region - Unlocks the region containing the address location in the ADDR register.</td></tr><tr><td>0x42</td><td>SPRM</td><td>Sets the power reduction mode.</td></tr><tr><td>0x43</td><td>CPRM</td><td>Clears the power reduction mode.</td></tr><tr><td>0x44</td><td>PBC</td><td>Page Buffer Clear - Clears the page buffer.</td></tr><tr><td>0x45</td><td>SSB</td><td>Set Security Bit - Sets the security bit by writing 0x00 to the first byte in the lockbit row.</td></tr><tr><td>0x46</td><td>INVALL</td><td>Invalidates all cache lines.</td></tr><tr><td>0x47-0x7f</td><td></td><td>Reserved</td></tr></table>

## 21.8.2 Control B

Name: CTRLB

Offset: 0x04

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>CACHEDIS</td><td colspan="2">READMODE[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">SLEEPPRM[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>MANW</td><td></td><td></td><td colspan="4">RWS[3:0]</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:19 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 18 – CACHEDIS: Cache Disable

This bit is used to disable the cache.

0: The cache is enabled.

1: The cache is disabled.

## z Bits 17:16 – READMODE[1:0]: NVMCTRL Read Mode

Table 21-7. NVMCTRL Read Mode

<table><tr><td>READMODE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NO_MISS_PENALTY</td><td>The NVM Controller (cache system) does not insert wait states on a cache miss. Gives the best system performance.</td></tr><tr><td>0x1</td><td>LOW_POWER</td><td>Reduces power consumption of the cache system, but inserts a wait state each time there is a cache miss. This mode may not be relevant if CPU performance is required, as the application will be stalled and may lead to increase run time.</td></tr><tr><td>0x2</td><td>DETERMINISTIC</td><td>The cache system ensures that a cache hit or miss takes the same amount of time, determined by the number of programmed flash wait states. This mode can be used for real-time applications that require deterministic execution timings.</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 9:8 – SLEEPPRM[1:0]: Power Reduction Mode during Sleep Indicates the power reduction mode during sleep.

Table 21-8. Power Reduction Mode during Sleep

<table><tr><td>SLEEPPRM[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>WAKEONACCESS</td><td>NVM block enters low-power mode when entering sleep.NVM block exits low-power mode upon first access.</td></tr><tr><td>0x1</td><td>WAKEUPINSTANT</td><td>NVM block enters low-power mode when entering sleep.NVM block exits low-power mode when exiting sleep.</td></tr><tr><td>0x2</td><td></td><td>Reserved</td></tr><tr><td>0x3</td><td>DISABLED</td><td>Auto power reduction disabled.</td></tr></table>

## ● Bit 7 – MANW: Manual Write

0: Writing to the last word in the page buffer will initiate a write operation to the page addressed by the last write operation. This includes writes to memory and auxiliary rows. 1: Write commands must be issued through the CMD register.

## Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 4:1 – RWS[3:0]: NVM Read Wait States

These bits give the number of wait states for a read operation. Zero indicates zero wait states, one indicates one wait state, etc., up to 15 wait states.

This register is initialized to 0 wait states. Software can change this value based on the NVM access time and system frequency.

## z Bit 0 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## 21.8.3 NVM Parameter

Name: PARAM

Offset: 0x08

Reset: 0X0000000000000XXXXXXXXXXXXXXXXXXX

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">PSZ[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">NVMP[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">NVMP[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

z Bits 31:19 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 18:16 – PSZ[2:0]: Page Size

Indicates the page size. Not all device families will provide all the page sizes indicated in the table.

Table 21-9. Page Size

<table><tr><td>PSZ[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>8</td><td>8 bytes</td></tr><tr><td>0x1</td><td>16</td><td>16 bytes</td></tr><tr><td>0x2</td><td>32</td><td>32 bytes</td></tr><tr><td>0x3</td><td>64</td><td>64 bytes</td></tr><tr><td>0x4</td><td>128</td><td>128 bytes</td></tr><tr><td>0x5</td><td>256</td><td>256 bytes</td></tr><tr><td>0x6</td><td>512</td><td>512 bytes</td></tr><tr><td>0x7</td><td>1024</td><td>1024 bytes</td></tr></table>

## ● Bits 15:0 – NVMP[15:0]: NVM Pages

Indicates the number of pages in the NVM main address space.

## 21.8.4 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x0C

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROR</td><td>READY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – ERROR: Error Interrupt Enable

Writing a zero to this bit has no effect.

Writing a one to this bit clears the ERROR interrupt enable.

This bit will read as the current value of the ERROR interrupt enable.

## ● Bit 0 – READY: NVM Ready Interrupt Enable

Writing a zero to this bit has no effect.

Writing a one to this bit clears the READY interrupt enable.

This bit will read as the current value of the READY interrupt enable.

## 21.8.5 Interrupt Enable Set

Name: INTENSET

Offset: 0x10

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROR</td><td>READY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – ERROR: Error Interrupt Enable

Writing a zero to this bit has no effect.

Writing a one to this bit sets the ERROR interrupt enable.

This bit will read as the current value of the ERROR interrupt enable.

## ● Bit 0 – READY: NVM Ready Interrupt Enable

Writing a zero to this bit has no effect.

Writing a one to this bit sets the READY interrupt enable.

This bit will read as the current value of the READY interrupt enable.

## 21.8.6 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x14

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROR</td><td>READY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 1 – ERROR: Error

This flag is set on the occurrence of an NVME, LOCKE or PROGE error.

0: No errors have been received since the last clear.

1: At least one error has occurred since the last clear.

This bit can be cleared by writing a one to its bit location.

## z Bit 0 – READY: NVM Ready

0: The NVM controller is busy programming or erasing.

1: The NVM controller is ready to accept a new command.

## 21.8.7 Status

Name: STATUS

Offset: 0x18

Reset: 0X0000000X00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SB</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>X</td></tr></table>

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>NVME</td><td>LOCKE</td><td>PROGE</td><td>LOAD</td><td>PRM</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 8 – SB: Security Bit Status

0: The Security bit is inactive.

1: The Security bit is active.

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – NVME: NVM Error

0: No programming or erase errors have been received from the NVM controller since this bit was last cleared. 1: At least one error has been registered from the NVM Controller since this bit was last cleared.

This bit can be cleared by writing a one to its bit location.

## z Bit 3 – LOCKE: Lock Error Status

0: No programming of any locked lock region has happened since this bit was last cleared.

1: Programming of at least one locked lock region has happened since this bit was last cleared.

This bit can be cleared by writing a one to its bit location.

## z Bit 2 – PROGE: Programming Error Status

0: No invalid commands or bad keywords were written in the NVM Command register since this bit was last cleared.

1: An invalid command and/or a bad keyword was/were written in the NVM Command register since this bit was last cleared.

This bit can be cleared by writing a one to its bit location.

## z Bit 1 – LOAD: NVM Page Buffer Active Loading

This bit indicates that the NVM page buffer has been loaded with one or more words. Immediately after an NVM load has been performed, this flag is set, and it remains set until a page write or a page buffer clear (PBCLR) command is given.

This bit can be cleared by writing a one to its bit location.

## z Bit 0 – PRM: Power Reduction Mode

This bit indicates the current NVM power reduction state. The NVM block can be set in power reduction mode in two ways: through the command interface or automatically when entering sleep with SLEEPPRM set accordingly. PRM can be cleared in three ways: through AHB access to the NVM block, through the command interface (SPRM and CPRM) or when exiting sleep with SLEEPPRM set accordingly.

0: NVM is not in power reduction mode.

1: NVM is in power reduction mode.

## 21.8.8 Address

Name: ADDR

Offset: 0x1C

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td colspan="6">ADDR[21:16]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">ADDR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">ADDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:22 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 21:0 – ADDR[21:0]: NVM Address

ADDR drives the hardware (16-bit) address to the NVM when a command is executed using CMDEX. 8-bit addresses must be shifted one bit to the right before writing to this register.

This register is automatically updated when writing to the page buffer, and can also be manually written. This register holds the address offset for the section addressed.

## 21.8.9 Lock Section

Name: LOCK

Offset: 0x20

Reset:

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">LOCK[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">LOCK[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bits 15:0 – LOCK[15:0]: Region Lock Bits

In order to set or clear these bits, the CMD register must be used.

0: The corresponding lock region is locked.

1: The corresponding lock region is not locked.

## 22. PORT

## 22.1 Overview

The Port (PORT) controls the I/O pins of the microcontroller. The I/O pins are organized in a series of groups, collectively referred to as a line bundle, and each group can have up to 32 pins that can be configured and controlled individually or as a group. Each pin may either be used for general-purpose I/O under direct application control or assigned to an embedded device peripheral. When used for general-purpose I/O, each pin can be configured as input or output, with highly configurable driver and pull settings

All I/O pins have true read-modify-write functionality when used for general-purpose I/O; the direction or the output value of one or more pins may be changed (set, reset or toggled) without unintentionally changing the state of any other pins in the same line bundle via a single, atomic 8-, 16- or 32-bit write.

The PORT is connected to the high-speed bus matrix through an AHB/APB bridge. The Pin Direction, Data Output Value and Data Input Value registers may also be accessed using the low-latency CPU local bus (IOBUS; ARM<sup>®</sup> single-cycle I/O port).

## 22.2 Features

z Selectable input and output configuration individually for each pin

z Software-controlled multiplexing of peripheral functions on I/O pins

z Flexible pin configuration through a dedicated Pin Configuration register

z Configurable output driver and pull settings:

z Totem-pole (push-pull)

z Pull configuration

z Driver strength

z Configurable input buffer and pull settings:

z Internal pull-up or pull-down

z Input sampling criteria

z Input buffer can be disabled if not needed for lower power consumption

z Read-modify-write support for pin configuration, output value and pin direction

## 22.3 Block Diagram

Figure 22-1. PORT Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_9c7b2b159f9ef7c830790daab6224e2bab6ecae9736bf5d0faf0311743b4438e.jpg)

## 22.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>Pxy</td><td>Digital I/O</td><td>General-purpose I/O pin y</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 22.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 22.5.1 I/O Lines

The I/O lines of the PORT are mapped to pins of the physical device package according to a simple naming scheme. Each line bundle of up to 32 pins is assigned a letter identifier, starting with A, that monotonically increases through the alphabet for each subsequent line bundle. Within each line bundle, each pin is assigned a numerical identifier according to its bit position.

The resulting PORT pins are mapped as Pxy, where $\mathsf { x } { = } \mathsf { A } , \mathsf { B } , \mathsf { C } , \ldots$ and $\mathsf { y } { = } 0 0 , 0 1 , . . . , 3 1$ to uniquely identify each pin in the device, e.g., PA24, PC03, etc.

Each pin may have one or more peripheral multiplexer settings, which allow the pad to be routed internally to a dedicated peripheral function. When enabled, the selected peripheral is given control over the output state of the pad, as well as the ability to read the current physical pad state. Refer to “I/O Multiplexing and Considerations” on page 13 for details.

Device-specific configurations may result in some pins (and the corresponding Pxy pin) not being implemented.

## 22.5.2 Power Management

During reset, all PORT lines are configured as inputs with input buffers, output buffers and pull disabled.

If the PORT peripheral is shut down, the latches contained in the pad will retain their current configuration, such as the output value and pull settings. However, the PORT configuration registers and input synchronizers will lose their contents, and these will not be restored when PORT is powered up again. The user must, therefore, reconfigure the PORT peripheral at power up to ensure it is in a well-defined state before use.

The PORT will continue to operate in any sleep mode where the selected module source clock is running.

## 22.5.3 Clocks

The PORT bus clock (CLK\_PORT\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_PORT\_APB can be found in the Peripheral Clock Masking section in the “PM – Power Manager” on page 110.

The PORT is fed by two different clocks: a CPU main clock, which allows the CPU to access the PORT through the low-latency CPU local bus (IOBUS), and an APB clock, which is a divided clock of the CPU main clock and allows the CPU to access the PORT registers through the high-speed matrix and the AHB/APB bridge.

IOBUS accesses have priority over APB accesses. The latter must insert wait states in the event of concurrent PORT accesses.

The PORT input synchronizers use the CPU main clock so that the resynchronization delay is minimized with respect to the APB clock.

## 22.5.4 DMA

Not applicable.

## 22.5.5 Interrupts

Not applicable.

## 22.5.6 Events

Not applicable.

## 22.5.7 Debug Operation

When the CPU is halted in debug mode, the PORT continues normal operation. If the PORT is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

## 22.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC).

Write-protection is denoted by the Write-Protected property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 22.5.9 Analog Connections

Analog functions are connected directly between the analog blocks and the I/O pads using analog buses. However, selecting an analog peripheral function for a given pin will disable the corresponding digital features of the pad.

## 22.5.10 CPU Local Bus

The CPU local bus (IOBUS) is an interface that connects the CPU directly to the PORT. It is a single-cycle bus interface, and does not support wait states. It supports byte, half word and word sizes.

The CPU accesses the PORT module through the IOBUS when it performs read or write from address 0x60000000. The PORT register map is equivalent to the one described in the register description section.

This bus is generally used for low latency. The Data Direction (DIRn) and Data Output Value (OUTn) registers can be read, written, set, cleared or toggled using this bus, and the Data Input Value (INn) registers can be read.

Since the IOBUS cannot wait for IN register resynchronization, the Control register (CTRLn) must be configured to enable continuous sampling of all pins that will need to be read via the IOBUS to prevent stale data from being read.

## 22.6 Functional Description

Figure 22-2. Overview of the PORT  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_8641b1066cf53dd65fc0865b3222c70b357017b85d4e4a7d829a78ceb6555f38.jpg)

## 22.6.1 Principle of Operation

The I/O pins of the device are controlled by reads and writes of the PORT peripheral registers. For each port pin, a corresponding bit in the Data Direction (DIRn) and Data Output Value (OUTn) registers are used to enable that pin as an output and to define the output state.

The direction of each pin in a port group is configured via the DIR register. If a bit in DIR is written to one, the corresponding pin is configured as an output pin. If a bit in DIR is written to zero, the corresponding pin is configured as an input pin.

When the direction is set as output, the corresponding bit in the OUT register is used to set the level of the pin. If bit y of OUT is written to one, pin y is driven high. If bit y of OUT is written to zero, pin y is driven low.

Additional pin configuration can be set by writing to the Pin Configuration (PINCFG0) registers.

The Data Input Value bit (INn) is used to read the port pin with resynchronization to the PORT clock. By default, these input synchronizers are clocked only when an input value read is requested in order to reduce power consumption. Input value can always be read, whether the pin is configured as input or output, except if digital input is disabled by writing a zero to the INEN bit in the Pin Configuration registers (PINCFGy).

The PORT also allows peripheral functions to be connected to individual I/O pins by writing a one to the corresponding PMUXEN bit in the PINCFGy registers and by writing the chosen selection to the Peripheral Multiplexing registers (PMUX0) for that pin. This will override the connection between the PORT and that I/O pin, and connect the selected peripheral line bundle to the pad instead of the PORT line bundle.

Each group of up to 32 pins is controlled by a set of registers, as described in Figure 22-3. This set of registers is duplicated for each group of pins, with increasing base addresses.

Figure 22-3. Overview of the Peripheral Functions Multiplexing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_dd0980644f13fdff19f82fea62960dbae8a923a1e41b11f6a63699f1fc11e7be.jpg)

## 22.6.2 Basic Operation

## 22.6.2.1 Initialization

After reset, all standard-function device I/O pins are connected to the PORT with outputs tri-stated and input buffers disabled, even if no clocks are running. Specific pins, such as the ones used for connection to a debugger, may be configured differently, as required by their special function.

## 22.6.3 Basic Operation

Each I/O pin y can be configured and accessed by reading or writing PORT registers. Because PORT registers are grouped into sets of registers for each group of up to 32 pins, the base address of the register set for pin y is at byte address PORT + (y / 32) \* 0x80. (y%32) will be used as the index within that register set.

To use pin y as an output, configure it as output by writing the (y%32) bit in the DIR register to one. To avoid disturbing the configuration of other pins in that group, this can also be done by writing the (y%32) bit in the DIRSET register to one. The desired output value can be set by writing the (y%32) bit to that value in register OUT.

Similarly, writing an OUTSET bit to one will set the corresponding bit in the OUT register to one, while writing an OUTCLR bit to one will set it to zero, and writing an OUTTGL bit to one will toggle that bit in OUT.

To use pin y as an input, configure it as input by writing the (y%32) bit in the DIR register to zero. To avoid disturbing the configuration of other pins in that group, this can also be done by writing the (y%32) bit in DIRCLR register to one The desired input value can be read from the (y%32) bit in register IN as soon as the INEN bit in the Pin Configuration register (PINCFGy) is written to one. Refer to “I/O Multiplexing and Considerations” on page 13 for details on pin configuration.

By default, the input synchronizer is clocked only when an input read is requested, which will delay the read operation by two CLK\_PORT cycles. To remove that delay, the input synchronizers for each group of eight pins can be configured to be always active, but this comes at the expense of higher power consumption. This is controlled by writing a one to the corresponding SAMPLINGn bit group of the CTRL register, where n = (y%32) / 8.

To use pin y as one of the available peripheral functions for that pin, configure it by writing a one to the corresponding PMUXEN bit of the PINCFGy register. The PINCFGy register for pin y is at byte offset (PINCFG0 + (y%32)).

The peripheral function can be selected by writing to the PMUXO or PMUXE bit group in the PMUXn register. The PMUXO/PMUXE bit group is at byte offset (PMUX0 + (y%32) / 2), in bits 3:0 if y is even and in bits 7:4 if y is odd. The chosen peripheral must also be configured and enabled.

## 22.6.4 I/O Pin Configuration

The Pin Configuration register (PINCFGy) is used for additional I/O pin configuration. A pin can be set in a totem-pole, open-drain or pull configuration.

Because pull configuration is done through the Pin Configuration register, all intermediate PORT states during switching of pin direction and pin values are avoided.

The I/O pin configurations are described further in this chapter, and summarized in Table 22-1.

## 22.6.4.1 Pin Configurations Summary

Table 22-1. Pin Configurations Summary

<table><tr><td>DIR</td><td>INEN</td><td>PULLEN</td><td>OUT</td><td>Configuration</td></tr><tr><td>0</td><td>0</td><td>0</td><td>X</td><td>Reset or analog I/O; all digital disabled</td></tr><tr><td>0</td><td>0</td><td>1</td><td>0</td><td>Pull-down; input disabled</td></tr><tr><td>0</td><td>0</td><td>1</td><td>1</td><td>Pull-up; input disabled</td></tr><tr><td>0</td><td>1</td><td>0</td><td>X</td><td>Input</td></tr><tr><td>0</td><td>1</td><td>1</td><td>0</td><td>Input with pull-down</td></tr><tr><td>0</td><td>1</td><td>1</td><td>1</td><td>Input with pull-up</td></tr><tr><td>1</td><td>0</td><td>X</td><td>X</td><td>Output; input disabled</td></tr><tr><td>1</td><td>1</td><td>X</td><td>X</td><td>Output; input enabled</td></tr></table>

22.6.4.2 Input Configuration

Figure 22-4. I/O Configuration - Standard Input  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_84e2392b1524dcdff85da794d1cb8b281e56313785b91ff85b1451c23b6b818f.jpg)

Figure 22-5. I/O Configuration - Input with Pull  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_fff1c06b1aedb3d4cd00233d4e49c104245b8a619d7c601cbc6958f2a1364291.jpg)  
Note that when pull is enabled, the pull value is defined by the OUTx value.

## 22.6.4.3 Totem-Pole Output

When configured for totem-pole (push-pull) output, the pin is driven low or high according to the corresponding bit setting in the OUT register. In this configuration, there is no current limitation for sink or source other than what the pin is capable of. If the pin is configured for input, the pin will float if no external pull is connected. Note, that enabling the output driver automatically disables pull.

Figure 22-6. I/O Configuration - Totem-Pole Output with Disabled Input  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_3eba61bc36bda4c41a7d76a94e084d4e29a5f8fe6f75eec9a8df8d6e62c89a56.jpg)

Figure 22-7. I/O Configuration - Totem-Pole Output with Enabled Input  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_9f1d5a132338ab21f02d07573f07b294bd7b46ea9a95f75971abc1ba3fa5cfa1.jpg)

Figure 22-8. I/O Configuration - Output with Pull  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_fbdbc32b788b712e814d1b6ae77c1a8cea4af08f7bd2aa7dc25f6c32f59c0aa3.jpg)  
22.6.4.4 Digital Functionality Disabled

Figure 22-9. I/O Configuration - Reset or Analog I/O: Digital Output, Input and Pull Disabled  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_02_c637c548d5afa35e7509f4d156400baae2d4eee9c37bc30e5bdb81780d13f2ef.jpg)

## 22.7 Register Summary

The I/O pins are organized in groups with up to 32 pins. Group 0 consists of the PA pins, group 1 the PB pins, etc. Each group has its own set of registers. For example, the register address offset for the Data Direction (DIR) register for group 0 (PA00 to PA31) is 0x00, while the register address offset for the DIR register for group 1 (PB00 to PB31) is 0x80.

Table 22-2. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="10">Mode GROUP</td></tr><tr><td>0x00</td><td rowspan="4">DIR</td><td>7:0</td><td colspan="7">DIR[7:0]</td></tr><tr><td>0x01</td><td>15:8</td><td colspan="7">DIR[15:8]</td></tr><tr><td>0x02</td><td>23:16</td><td colspan="7">DIR[23:16]</td></tr><tr><td>0x03</td><td>31:24</td><td colspan="7">DIR[31:24]</td></tr><tr><td>0x04</td><td rowspan="4">DIRCLR</td><td>7:0</td><td colspan="7">DIRCLR[7:0]</td></tr><tr><td>0x05</td><td>15:8</td><td colspan="7">DIRCLR[15:8]</td></tr><tr><td>0x06</td><td>23:16</td><td colspan="7">DIRCLR[23:16]</td></tr><tr><td>0x07</td><td>31:24</td><td colspan="7">DIRCLR[31:24]</td></tr><tr><td>0x08</td><td rowspan="4">DIRSET</td><td>7:0</td><td colspan="7">DIRSET[7:0]</td></tr><tr><td>0x09</td><td>15:8</td><td colspan="7">DIRSET[15:8]</td></tr><tr><td>0x0A</td><td>23:16</td><td colspan="7">DIRSET[23:16]</td></tr><tr><td>0x0B</td><td>31:24</td><td colspan="7">DIRSET[31:24]</td></tr><tr><td>0x0C</td><td rowspan="4">DIRTGL</td><td>7:0</td><td colspan="7">DIRTGL[7:0]</td></tr><tr><td>0x0D</td><td>15:8</td><td colspan="7">DIRTGL[15:8]</td></tr><tr><td>0x0E</td><td>23:16</td><td colspan="7">DIRTGL[23:16]</td></tr><tr><td>0x0F</td><td>31:24</td><td colspan="7">DIRTGL[31:24]</td></tr><tr><td>0x10</td><td rowspan="4">OUT</td><td>7:0</td><td colspan="7">OUT[7:0]</td></tr><tr><td>0x11</td><td>15:8</td><td colspan="7">OUT[15:8]</td></tr><tr><td>0x12</td><td>23:16</td><td colspan="7">OUT[23:16]</td></tr><tr><td>0x13</td><td>31:24</td><td colspan="7">OUT[31:24]</td></tr><tr><td>0x14</td><td rowspan="4">OUTCLR</td><td>7:0</td><td colspan="7">OUTCLR[7:0]</td></tr><tr><td>0x15</td><td>15:8</td><td colspan="7">OUTCLR[15:8]</td></tr><tr><td>0x16</td><td>23:16</td><td colspan="7">OUTCLR[23:16]</td></tr><tr><td>0x17</td><td>31:24</td><td colspan="7">OUTCLR[31:24]</td></tr><tr><td>0x18</td><td rowspan="4">OUTSET</td><td>7:0</td><td colspan="7">OUTSET[7:0]</td></tr><tr><td>0x19</td><td>15:8</td><td colspan="7">OUTSET[15:8]</td></tr><tr><td>0x1A</td><td>23:16</td><td colspan="7">OUTSET[23:16]</td></tr><tr><td>0x1B</td><td>31:24</td><td colspan="7">OUTSET[31:24]</td></tr><tr><td>0x1C</td><td rowspan="4">OUTTGL</td><td>7:0</td><td colspan="7">OUTTGL[7:0]</td></tr><tr><td>0x1D</td><td>15:8</td><td colspan="7">OUTTGL[15:8]</td></tr><tr><td>0x1E</td><td>23:16</td><td colspan="7">OUTTGL[23:16]</td></tr><tr><td>0x1F</td><td>31:24</td><td colspan="7">OUTTGL[31:24]</td></tr><tr><td>0x20</td><td rowspan="4">IN</td><td>7:0</td><td colspan="7">IN[7:0]</td></tr><tr><td>0x21</td><td>15:8</td><td colspan="7">IN[15:8]</td></tr><tr><td>0x22</td><td>23:16</td><td colspan="7">IN[23:16]</td></tr><tr><td>0x23</td><td>31:24</td><td colspan="7">IN[31:24]</td></tr></table>

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td rowspan="4">CTRL</td><td>7:0</td><td colspan="8">SAMPLING[7:0]</td></tr><tr><td>0x25</td><td>15:8</td><td colspan="8">SAMPLING[15:8]</td></tr><tr><td>0x26</td><td>23:16</td><td colspan="8">SAMPLING[23:16]</td></tr><tr><td>0x27</td><td>31:24</td><td colspan="8">SAMPLING[31:24]</td></tr><tr><td>0x28</td><td rowspan="4">WRCONFIG</td><td>7:0</td><td colspan="8">PINMASK[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td colspan="8">PINMASK[15:8]</td></tr><tr><td>0x2A</td><td>23:16</td><td></td><td>DRVSTR</td><td></td><td></td><td></td><td>PULLEN</td><td>INEN</td><td>PMUXEN</td></tr><tr><td>0x2B</td><td>31:24</td><td>HWSEL</td><td>WRPINCFG</td><td></td><td>WRPMUX</td><td colspan="4">PMUX[3:0]</td></tr><tr><td>0x2C ... 0x2F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x30</td><td>PMUX0</td><td>7:0</td><td colspan="4">PMUXO[3:0]</td><td colspan="4">PMUXE[3:0]</td></tr><tr><td>0x31</td><td>PMUX1</td><td>7:0</td><td colspan="4">PMUXO[3:0]</td><td colspan="4">PMUXE[3:0]</td></tr><tr><td>...</td><td>...</td><td>...</td><td colspan="8"></td></tr><tr><td>0x3F</td><td>PMUX15</td><td>7:0</td><td colspan="4">PMUXO[3:0]</td><td colspan="4">PMUXE[3:0]</td></tr><tr><td>0x40</td><td>PINCFG0</td><td>7:0</td><td></td><td>DRVSTR</td><td></td><td></td><td></td><td>PULLEN</td><td>INEN</td><td>PMUXEN</td></tr><tr><td>0x41</td><td>PINCFG1</td><td>7:0</td><td></td><td>DRVSTR</td><td></td><td></td><td></td><td>PULLEN</td><td>INEN</td><td>PMUXEN</td></tr><tr><td>...</td><td>...</td><td>...</td><td colspan="8"></td></tr><tr><td>0x5F</td><td>PINCFG31</td><td>7:0</td><td></td><td>DRVSTR</td><td></td><td></td><td></td><td>PULLEN</td><td>INEN</td><td>PMUXEN</td></tr><tr><td>0x60 ... 0x7F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

## 22.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 380 for details.

## 22.8.1 Data Direction

Name: DIRn

Offset: 0x00+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DIR[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIR[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DIR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DIR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:0 – DIR[31:0]: Port Data Direction

These bits set the data direction for the individual I/O pins in the PORT group.

0: The corresponding I/O pin in the group is configured as an input.

1: The corresponding I/O pin in the group is configured as an output.

## 22.8.2 Data Direction Clear

Name: DIRCLRn

Offset: 0x04+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DIRCLR[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIRCLR[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DIRCLR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DIRCLR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to set one or more I/O pins as an input, without doing a read-modify-write operation. Changes in this register will also be reflected in the Data Direction (DIR), Data Direction Toggle (DIRTGL) and Data Direction Set (DIRSET) registers.

## z Bits 31:0 – DIRCLR[31:0]: Port Data Direction Clear

0: The I/O pin direction is cleared.

1: The I/O pin direction is set.

Writing a zero to a bit has no effect.

Writing a one to a bit will clear the corresponding bit in the DIR register, which configures the I/O pin as an input.

## 22.8.3 Data Direction Set

Name: DIRSETn

Offset: 0x08+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DIRSET[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIRSET[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DIRSET[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DIRSET[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to set one or more I/O pins as an output, without doing a read-modify-write operation. Changes in this register will also be reflected in the Data Direction (DIR), Data Direction Toggle (DIRTGL) and Data Direction Clear (DIRCLR) registers.

z Bits 31:0 – DIRSET[31:0]: Port Data Direction Set

0: The I/O pin direction is cleared.

1: The I/O pin direction is set.

Writing a zero to a bit has no effect.

Writing a one to a bit will set the corresponding bit in the DIR register, which configures the I/O pin as an output.

## 22.8.4 Data Direction Toggle

Name: DIRTGLn

Offset: 0x0C+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DIRTGL[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DIRTGL[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DIRTGL[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DIRTGL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to toggle the direction of one or more I/O pins, without doing a read-modify-write operation. Changes in this register will also be reflected in the Data Direction (DIR), Data Direction Set (DIRSET) and Data Direction Clear (DIRCLR) registers.

z Bits 31:0 – DIRTGL[31:0]: Port Data Direction Toggle

0: The I/O pin direction is cleared.

1: The I/O pin direction is set.

Writing a zero to a bit has no effect.

Writing a one to a bit will toggle the corresponding bit in the DIR register, which reverses the direction of the I/O pin.

## 22.8.5 Data Output Value

Name: OUTn

Offset: 0x10+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">OUT[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">OUT[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">OUT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">OUT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register sets the data output drive value for the individual I/O pins in the PORT.

## z Bits 31:0 – OUT[31:0]: Port Data Output Value

These bits set the logical output drive level of I/O pins configured as outputs via the Data Direction register (DIR). For pins configured as inputs via the Data Direction register (DIR) with pull enabled via the Pull Enable register (PULLEN), these bits will set the input pull direction.

0: The I/O pin output is driven low, or the input is connected to an internal pull-down.

1: The I/O pin output is driven high, or the input is connected to an internal pull-up.

## 22.8.6 Data Output Value Clear

Name: OUTCLRn

Offset: 0x14+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">OUTCLR[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">OUTCLR[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">OUTCLR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">OUTCLR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to set one or more output I/O pin drive levels low, without doing a read-modify-write operation. Changes in this register will also be reflected in the Data Output Value (OUT), Data Output Value Toggle (OUTTGL) and Data Output Value Set (OUTSET) registers.

● Bits 31:0 – OUTCLR[31:0]: Port Data Output Value Clear

0: The I/O pin output is driven low.

1: The I/O pin output is driven high.

Writing a zero to a bit has no effect.

Writing a one to a bit will clear the corresponding bit in the OUT register, which sets the output drive level low for I/O pins configured as outputs via the Data Direction register (DIR). For pins configured as inputs via the Data Direction register (DIR) and with pull enabled via the Pull Enable register (PULLEN), these bits will set the input pull direction to an internal pull-down.

## 22.8.7 Data Output Value Set

Name: OUTSETn

Offset: 0x18+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">OUTSET[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">OUTSET[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">OUTSET[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">OUTSET[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to set one or more output I/O pin drive levels high, without doing a read-modify-write operation. Changes in this register will also be reflected in the Data Output Value (OUT), Data Output Value Toggle (OUTTGL) and Data Output Value Clear (OUTCLR) registers.

## Bits 31:0 – OUTSET[31:0]: Port Data Output Value Set

0: The I/O pin output is driven low.

1: The I/O pin output is driven high.

Writing a zero to a bit has no effect.

Writing a one to a bit will set the corresponding bit in the OUT register, which sets the output drive level high for I/O pins configured as outputs via the Data Direction register (DIR). For pins configured as inputs via the Data Direction register (DIR) and with pull enabled via the Pull Enable register (PULLEN), these bits will set the input pull direction to an internal pull-up.

## 22.8.8 Data Output Value Toggle

Name: OUTTGLn

Offset: 0x1C+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">OUTTGL[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">OUTTGL[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">OUTTGL[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">OUTTGL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to toggle the drive level of one or more output I/O pins, without doing a read-modify-write operation. Changes in this register will also be reflected in the Data Output Value (OUT), Data Output Value Set (OUTSET) and Data Output Value Clear (OUTCLR) registers.

z Bits 31:0 – OUTTGL[31:0]: Port Data Output Value Toggle

0: The I/O pin output is driven low.

1: The I/O pin output is driven high.

Writing a zero to a bit has no effect.

Writing a one to a bit will toggle the corresponding bit in the OUT register, which inverts the output drive level for I/O pins configured as outputs via the Data Direction register (DIR). For pins configured as inputs via the Data Direction register (DIR) and with pull enabled via the Pull Enable register (PULLEN), these bits will toggle the input pull direction.

## 22.8.9 Data Input Value

Name: INn

Offset: 0x20+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">IN[31:24]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">IN[23:16]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">IN[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">IN[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – IN[31:0]: Port Data Input Value These bits are cleared when the corresponding I/O pin input sampler detects a logical low level on the input pin. These bits are set when the corresponding I/O pin input sampler detects a logical high level on the input pin.

## 22.8.10 Control

Name: CTRLn

Offset: 0x24+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">SAMPLING[31:24]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">SAMPLING[23:16]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">SAMPLING[15:8]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">SAMPLING[7:0]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:0 – SAMPLING[31:0]: Input Sampling Mode

Configures the input sampling functionality of the I/O pin input samplers for pins configured as inputs via the Data Direction register (DIR).

0: The I/O pin input synchronizer is disabled.

1: The I/O pin input synchronizer is enabled.

The input samplers are enabled and disabled in sub-groups of eight. Thus, if any pins within a byte request continuous sampling, all pins in that eight pin sub-group will be continuously sampled.

## 22.8.11 Write Configuration

Name: WRCONFIGn

Offset: 0x28+n\*0x80 [n=0..0]

Reset: 0x00000000

Access: Write-Only

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td>HWSEL</td><td>WRPINCFG</td><td></td><td>WRPMUX</td><td colspan="4">PMUX[3:0]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>R</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td>DRVSTR</td><td></td><td></td><td></td><td>PULLEN</td><td>INEN</td><td>PMUXEN</td></tr><tr><td>Access</td><td>R</td><td>W</td><td>R</td><td>R</td><td>R</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PINMASK[15:8]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">PINMASK[7:0]</td></tr><tr><td>Access</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This write-only register is used to configure several pins simultaneously with the same configuration and/or peripheral multiplexing.

In order to avoid the side effect of non-atomic access, 8-bit or 16-bit writes to this register will have no effect. Reading this register always returns zero.

## z Bit 31 – HWSEL: Half-Word Select

This bit selects the half-word field of a 32-pin group to be reconfigured in the atomic write operation.

0: The lower 16 pins of the PORT group will be configured.

1: The upper 16 pins of the PORT group will be configured.

This bit will always read as zero.

## z Bit 30 – WRPINCFG: Write PINCFG

This bit determines whether the atomic write operation will update the Pin Configuration register (PINCFGy) or not for all pins selected by the WRCONFIG.PINMASK and WRCONFIG.HWSEL bits.

0: The PINCFGy registers of the selected pins will not be updated.

1: The PINCFGy registers of the selected pins will be updated.

Writing a zero to this bit has no effect.

Writing a one to this bit updates the configuration of the selected pins with the written WRCONFIG.DRVSTR, WRCONFIG.SLEWLIM, WRCONFIG.ODRAIN, WRCONFIG.PULLEN, WRCONFIG.INEN, WRCONFIG.PMUXEN and WRCONFIG.PINMASK values.

This bit will always read as zero.

## z Bit 29 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 28 – WRPMUX: Write PMUX

This bit determines whether the atomic write operation will update the Peripheral Multiplexing register (PMUXn) or not for all pins selected by the WRCONFIG.PINMASK and WRCONFIG.HWSEL bits.

0: The PMUXn registers of the selected pins will not be updated.

1: The PMUXn registers of the selected pins will be updated.

Writing a zero to this bit has no effect.

Writing a one to this bit updates the pin multiplexer configuration of the selected pins with the written WRCON-FIG.PMUX value.

This bit will always read as zero.

## z Bits 27:24 – PMUX[3:0]: Peripheral Multiplexing

These bits determine the new value written to the Peripheral Multiplexing register (PMUXn) for all pins selected by the WRCONFIG.PINMASK and WRCONFIG.HWSEL bits, when the WRCONFIG.WRPMUX bit is set.

These bits will always read as zero.

## ● Bit 23 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 22 – DRVSTR: Output Driver Strength Selection

This bit determines the new value written to PINCFGy.DRVSTR for all pins selected by the WRCONFIG.PINMASK and WRCONFIG.HWSEL bits the WRCONFIG.WRPINCFG bit is set.

This bit will always read as zero.

## z Bits 21:19 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 18 – PULLEN: Pull Enable

This bit determines the new value written to PINCFGy.PULLEN for all pins selected by the WRCONFIG.PINMASK and WRCONFIG.HWSEL bits when the WRCONFIG.WRPINCFG bit is set.

This bit will always read as zero.

## z Bit 17 – INEN: Input Enable

This bit determines the new value written to PINCFGy.INEN for all pins selected by the WRCONFIG.PINMASK and WRCONFIG.HWSEL bits when the WRCONFIG.WRPINCFG bit is set.

This bit will always read as zero.

## Bit 16 – PMUXEN: Peripheral Multiplexer Enable

This bit determines the new value written to PINCFGy.PMUXEN for all pins selected by the WRCONFIG.PIN-MASK and WRCONFIG.HWSEL bits when the WRCONFIG.WRPINCFG bit is set.

This bit will always read as zero.

## z Bits 15:0 – PINMASK[15:0]: Pin Mask for Multiple Pin Configuration

These bits select the pins to be configured within the half-word group selected by the WRCONFIG.HWSEL bit. 0: The configuration of the corresponding I/O pin in the half-word group will be left unchanged.

1: The configuration of the corresponding I/O pin in the half-word pin group will be updated. These bits will always read as zero.

## 22.8.12 Peripheral Multiplexing n

Name: PMUXnm

Offset: 0x30+n\*0x80 [n=0..0]+m\*0x1 [m=0..15]

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">PMUXO[3:0]</td><td colspan="4">PMUXE[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

There are up to 16 Peripheral Multiplexing registers in each group, one for every set of two subsequent I/O lines. The n denotes the number of the set of I/O lines, while the x denotes the number of the group.

## z Bits 7:4 – PMUXO[3:0]: Peripheral Multiplexing Odd

These bits select the peripheral function for odd-numbered pins (2\*n + 1) of a PORT group, if the corresponding PINCFGy.PMUXEN bit is one.

Not all possible values for this selection may be valid. For more details, refer to “I/O Multiplexing and Considerations” on page 13.

Table 22-3. Peripheral Multiplexing Odd

<table><tr><td>PMUXO[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>A</td><td>Peripheral function A selected</td></tr><tr><td>0x1</td><td>B</td><td>Peripheral function B selected</td></tr><tr><td>0x2</td><td>C</td><td>Peripheral function C selected</td></tr><tr><td>0x3</td><td>D</td><td>Peripheral function D selected</td></tr><tr><td>0x4</td><td>E</td><td>Peripheral function E selected</td></tr><tr><td>0x5</td><td>F</td><td>Peripheral function F selected</td></tr><tr><td>0x6</td><td>G</td><td>Peripheral function G selected</td></tr><tr><td>0x7</td><td>H</td><td>Peripheral function H selected</td></tr><tr><td>0x8-0xf</td><td></td><td>Reserved</td></tr></table>

## z Bits 3:0 – PMUXE[3:0]: Peripheral Multiplexing Even

These bits select the peripheral function for even-numbered pins (2\*n) of a PORT group, if the corresponding PINCFGy.PMUXEN bit is one.

Not all possible values for this selection may be valid. For more details, refer to “I/O Multiplexing and Considerations” on page 13.

Table 22-4. Peripheral Multiplexing Even

<table><tr><td>PMUXE[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>A</td><td>Peripheral function A selected</td></tr><tr><td>0x1</td><td>B</td><td>Peripheral function B selected</td></tr><tr><td>0x2</td><td>C</td><td>Peripheral function C selected</td></tr><tr><td>0x3</td><td>D</td><td>Peripheral function D selected</td></tr><tr><td>0x4</td><td>E</td><td>Peripheral function E selected</td></tr><tr><td>0x5</td><td>F</td><td>Peripheral function F selected</td></tr><tr><td>0x6</td><td>G</td><td>Peripheral function G selected</td></tr><tr><td>0x7</td><td>H</td><td>Peripheral function H selected</td></tr><tr><td>0x8-0xf</td><td></td><td>Reserved</td></tr></table>

## 22.8.13 Pin Configuration n

Name: PINCFGnm

Offset: 0x40+n\*0x80 [n=0..0]+m\*0x1 [m=0..31]

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>DRVSTR</td><td></td><td></td><td></td><td>PULLEN</td><td>INEN</td><td>PMUXEN</td></tr><tr><td>Access</td><td>R</td><td>W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

There are up to 32 Pin Configuration registers in each group, one for each I/O line. The n denotes the number of the I/O line, while the x denotes the number of the Port group.

## Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 6 – DRVSTR: Output Driver Strength Selection

This bit controls the output driver strength of an I/O pin configured as an output.

0: Pin drive strength is set to normal drive strength.

1: Pin drive strength is set to stronger drive strength.

## z Bits 5:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – PULLEN: Pull Enable

This bit enables the internal pull-up or pull-down resistor of an I/O pin configured as an input.

0: Internal pull resistor is disabled, and the input is in a high-impedance configuration.

1: Internal pull resistor is enabled, and the input is driven to a defined logic level in the absence of external input.

## Bit 1 – INEN: Input Enable

This bit controls the input buffer of an I/O pin configured as either an input or output.

0: Input buffer for the I/O pin is disabled, and the input value will not be sampled.

1: Input buffer for the I/O pin is enabled, and the input value will be sampled when required.

Writing a zero to this bit disables the input buffer completely, preventing read-back of the physical pin state when the pin is configured as either an input or output.

## z Bit 0 – PMUXEN: Peripheral Multiplexer Enable

This bit enables or disables the peripheral multiplexer selection set in the Peripheral Multiplexing register (PMUXn) to enable or disable alternative peripheral control over an I/O pin direction and output drive value.

0: The peripheral multiplexer selection is disabled, and the PORT registers control the direction and output drive value.

1: The peripheral multiplexer selection is enabled, and the selected peripheral controls the direction and output drive value.

Writing a zero to this bit allows the PORT to control the pad direction via the Data Direction register (DIR) and output drive value via the Data Output Value register (OUT). The peripheral multiplexer value in PMUXn is ignored. Writing a one to this bit enables the peripheral selection in PMUXn to control the pad. In this configuration, the physical pin state may still be read from the Data Input Value register (IN) if PINCFGy.INEN is set.

## 23. EVSYS – Event System

## 23.1 Overview

The Event System (EVSYS) allows autonomous, low-latency and configurable communication between peripherals. Several peripherals can be configured to emit and/or respond to signals known as events. The exact condition to generate an event, or the action taken upon receiving an event, is specific to each module. Peripherals that respond to events are called event users. Peripherals that emit events are called event generators. A peripheral can have one or more event generators and can have one or more event users.

Communication is made without CPU intervention and without consuming system resources such as bus or RAM bandwidth. This reduces the load on the CPU and other system resources, compared to a traditional interrupt-based system.

## 23.2 Features

z System for direct peripheral-to-peripheral communication and signaling

z 6 configurable event channels, where each channel can:

z Be connected to any event generator

z Provide a pure asynchronous, resynchronized or synchronous path

z 18 event generators

z 44 event users

z Configurable edge detector

z Peripherals can be event generators, event users or both

z SleepWalking and interrupt for operation in low-power modes

z Software event generation

z Each event user can choose which event channel to listen to

## 23.3 Block Diagram

Figure 23-1. Event System Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_da810745546ea459b3105ebcff90e96dc924d9a507d8dd280013f3725ee60952.jpg)

## 23.4 Signal Description

Not applicable.

## 23.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 23.5.1 I/O Lines

Not applicable.

## 23.5.2 Power Management

The EVSYS can be used to wake up the CPU from all sleep modes, even if the clock used by the EVSYS channel and the EVSYS bus clock are disabled. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

In all sleep modes where the clock for the EVSYS is stopped, the device can wake up the EVSYS clock.

Some event generators can generate an event when the system clock is stopped. The generic clock (GCLK\_EVSYS\_CHANNELx) for this channel will be restarted if the channel uses a synchronized path or a resynchronized path, without waking the system from sleep. The clock remains active only as long as necessary to handle the event. After the event has been handled, the clock will be turned off and the system will remain in the original sleep mode. This is known as SleepWalking. When an asynchronous path is used, there is no need for the clock to be activated for the event to be propagated to the user.

On a software reset, all registers are set to their reset values and any ongoing events are canceled.

## 23.5.3 Clocks

The EVSYS bus clock (CLK\_EVSYS\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_EVSYS\_APB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110.

Each EVSYS channel has a dedicated generic clock (GCLK\_EVSYS\_CHANNELx). These are used for detection and propagation of events for each channel. These clocks must be configured and enabled in the generic clock controller before using the EVSYS. Refer to “Enabling a Generic Clock” on page 93 for details.

## 23.5.4 DMA

Not applicable.

## 23.5.5 Interrupts

The interrupt request line is connected to the interrupt controller. Using the EVSYS interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 23.5.6 Events

Not applicable.

## 23.5.7 Debug Operation

When the CPU is halted in debug mode, the EVSYS continues normal operation. If the EVSYS is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

## 23.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following register:

z Interrupt Flag Status and Clear register (INTFLAG)

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 23.5.9 Analog Connections

Not applicable.

## 23.6 Functional Description

## 23.6.1 Principle of Operation

The EVSYS allows for communication between peripherals via events. Peripherals that respond to events (event users) are connected to multiplexers which have all event channels as input. Each each event channel can be configured to route signals from any peripheral emitting events (event generator) to one or more event users.

## 23.6.2 Basic Operation

## 23.6.2.1 Initialization

The peripheral that is to act as event generator must be configured to be able to generate events. The peripheral to act as event user must be configured to handle incoming events.

When this has been done, the event system is ready to be configured. The configuration must follow this order:

1. Configure the event user by performing a single 16-bit write to the User Multiplexer register (USER) with:

1.1. The channel to be connected to a user is written to the Channel bit group (USER.CHANNEL)

1.2. The user to connect the channel is written to the User bit group (USER.USER)

2. Configure the channel by performing a single 32-bit write to the Channel (CHANNEL) register with:

2.1. The channel to be configured is written to the Channel Selection bit group (CHANNEL.CHANNEL)

2.2. The path to be used is written to the Path Selection bit group (CHANNEL.PATH)

2.3. The type of edge detection to use on the channel is written to the Edge Selection bit group (CHANNEL.EDGSEL)

2.4. The event generator to be used is written to the Event Generator bit group (CHANNEL.EVGEN)

## 23.6.2.2 Enabling, Disabling and Resetting

The EVSYS is always enabled.

The EVSYS is reset by writing a one to the Software Reset bit in the Control register (CTRL.SWRST). All registers in the EVSYS will be reset to their initial state and any ongoing events will be canceled. Refer to the CTRL register for details.

## 23.6.2.3 User Multiplexer Setup

Each user multiplexer is dedicated to one event user. A user multiplexer receives all event channel outputs and must be configured to select one of these channels. The user must always be configured before the channel is configured. A full list of selectable users can be found in the User Multiplexer register (USER) description. Refer to Table 23-6 for details.

To configure a user multiplexer, the USER register must be written in a single 16-bit write.

It is possible to read out the configuration of a user by first selecting the user by writing to USER.USER using an 8-bit write and then performing a read of the 16-bit USER register.

Figure 23-2. User MUX

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_44171f7e49781fa69b21ab721084fb7426d7cb90920ae8c9bbb0f2ae5aa26327.jpg)

## 23.6.2.4 Channel Setup

The channel to be used with an event user must be configured with an event generator. The path of the channel should be configured, and when using a synchronous path or resynchronized path, the edge selection should be configured. All these configurations are available in the Channel register (CHANNEL).

To configure a channel, the Channel register must be written in a single 32-bit write.

It is possible to read out the configuration of a channel by first selecting the channel by writing to CHANNEL.CHANNEL using a, 8-bit write, and then performing a read of the CHANNEL register.

## Event Generators

The event generator is selected by writing to the Event Generator bit group in the Channel register (CHANNEL.EVGEN).

A full list of selectable generators can be found in the CHANNEL register description. Refer to Table 23-4 for details.

The channels are not connected to any of the event generators (CHANNEL.EVGEN = 0x00) by default.

## 23.6.2.5 Channel Path

There are three different ways to propagate the event provided by an event generator:

z Asynchronous path

z Synchronous path

Resynchronized path

Figure 23-3. Channel  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_24042e3ebf292e4ff65a7fc01bd1dfa797f727042a60a04c86763f8c1bfedc4a.jpg)

The path is selected by writing to the Path Selection bit group in the Channel register (CHANNEL.PATH).

## Asynchronous Path

When using the asynchronous path, the events are propagated from the event generator to the event user with no intervention from the event system. This means that if the GCLK\_EVSYS\_CHANNELx for the channel used is inactive, the event will still be propagated to the user.

Events propagated in the asynchronous path cannot generate any interrupts, and no channel status bits will indicate the state of the channel. No edge detection is available; this must be handled in the event user.

When the event generator and the event user share the same generic clock, using the asynchronous path will propagate the event with the least amount of latency.

## Synchronous Path

The synchronous path should be used when the event generator and the event channel share the same generic clock. If they do not share the same clock, a logic change from the event generator to the event channel might not be detected in the channel, which means that the event will not be propagated to the event user.

When using the synchronous path, the channel is capable of generating interrupts. The channel status bits in the Channel Status register (CHSTATUS) are also updated and available for use.

If the Generic Clocks Request bit in the Control register (CTRL.GCLKREQ) is zero, the channel operates in SleepWalking mode and request the configured generic clock only when an event is to be propagated through the channel. If CTRL.GCLKREQ is one, the generic clock will always be on for the configured channel.

## Resynchronized Path

The resynchronized path should be used when the event generator and the event channel do not share the same clock. When the resynchronized path is used, resynchronization of the event from the event generator is done in the channel.

When the resynchronized path is used, the channel is capable of generating interrupts. The channel status bits in the Channel Status register (CHSTATUS) are also updated and available for use.

If the Generic Clocks Request bit in the Control register (CTRL.GCLKREQ) is zero, the channel operates in SleepWalking mode and request the configured generic clock only when an event is to be propagated through the channel. If CTRL.GCLKREQ is one, the generic clock will always be on for the configured channel.

## 23.6.2.6 Edge Detection

When synchronous or resynchronized paths are used, edge detection must be used. The event system can perform edge detection in three different ways:

Generate an event only on the rising edge

z Generate an event only on the falling edge

z Generate an event on rising and falling edges.

Edge detection is selected by writing to the Edge Selection bit group in the Channel register (CHANNEL.EDGSEL).

If the generator event is a pulse, both edges cannot be selected. Use the rising edge or falling edge detection methods, depending on the generator event default level.

## 23.6.2.7 Channel Status

The Channel Status register (CHSTATUS) contains the status of the channels when a synchronous or resynchronized path is in use. There are two different status bits in CHSTATUS for each of the available channels: The Channel Busy bit (CHSTATUS.CHBUSYx) is set to one if an event on the corresponding channel x has not been handled by al event users connected to that channel.

The CHSTATUS.USRRDYx bit is set to one if all event users connected to the corresponding channel x are ready to handle incoming events on that channel.

## 23.6.2.8 Software Event

A software event can be initiated on a channel by writing a one to the Software Event bit in the Channel register (CHANNEL.SWEVT) at the same time as writing the Channel bits (CHANNEL.CHANNEL). This will generate a software event on the selected channel.

The software event can be used for application debugging, and functions like any event generator. To use the software event, the event path must be configured to either a synchronous path or resynchronized path

(CHANNEL.PATH = 0x0 or 0x1), edge detection must be configured to rising-edge detection (CHANNEL.EDGSEL= 0x1) and the Generic Clock Request bit must be set to one (CTRL.GCLKREQ=0x1).

## 23.6.3 Interrupts

The EVSYS has the following interrupt sources:

Overrun Channel x interrupt (INTFLAG)

z Event Detected Channel x interrupt (INTFLAG)

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the EVSYS is reset.

See the INTFLAG register for details on how to clear interrupt flags. The EVSYS has one common interrupt request line for all the interrupt sources. The user must read the INTFLAG register to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated.

Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 23.6.3.1 The Overrun Channel x Interrupt

The Overrun Channel x interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.OVRx) is set and the optional interrupt is generated in the following two cases:

z At least one of the event users on channel x is not ready when a new event occurs

z An event occurs when the previous event on channel x has not yet been handled by all event users

INTFLAG.OVRx will be set when using a synchronous or resynchronized path, but not when using an asynchronous path.

## 23.6.3.2 The Event Detected Channel x Interrupt

The Event Detected Channel x interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.EVDx) is set when an event coming from the event generator configured on channel x is detected.

INTFLAG.EVDx will be set when using a synchronous and resynchronized path, but not when using an asynchronous path.

## 23.6.4 Sleep Mode Operation

The EVSYS can generate interrupts to wake up the device from any sleep mode.

## 23.7 Register Summary

Table 23-1. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td>CTRL</td><td>7:0</td><td></td><td></td><td></td><td>GCLKREQ</td><td></td><td></td><td></td><td>SWRST</td></tr><tr><td>0x01 ... 0x03</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="4">CHANNEL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">CHANNEL[2:0]</td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SWEVT</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td colspan="6">EVGEN[5:0]</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td colspan="2">EDGSEL[1:0]</td><td colspan="2">PATH[1:0]</td></tr><tr><td>0x08</td><td rowspan="2">USER</td><td>7:0</td><td></td><td></td><td></td><td colspan="5">USER[4:0]</td></tr><tr><td>0x09</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">CHANNEL[3:0]</td></tr><tr><td>0x0A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td rowspan="4">CHSTATUS</td><td>7:0</td><td></td><td></td><td>USRRDY5</td><td>USRRDY4</td><td>USRRDY3</td><td>USRRDY2</td><td>USRRDY1</td><td>USRRDY0</td></tr><tr><td>0x0D</td><td>15:8</td><td></td><td></td><td>CHBUSY5</td><td>CHBUSY4</td><td>CHBUSY3</td><td>CHBUSY2</td><td>CHBUSY1</td><td>CHBUSY0</td></tr><tr><td>0x0E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">INTENCLR</td><td>7:0</td><td></td><td></td><td>OVR5</td><td>OVR4</td><td>OVR3</td><td>OVR2</td><td>OVR1</td><td>OVR0</td></tr><tr><td>0x11</td><td>15:8</td><td></td><td></td><td>EVD5</td><td>EVD4</td><td>EVD3</td><td>EVD2</td><td>EVD1</td><td>EVD0</td></tr><tr><td>0x12</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="4">INTENSET</td><td>7:0</td><td></td><td></td><td>OVR5</td><td>OVR4</td><td>OVR3</td><td>OVR2</td><td>OVR1</td><td>OVR0</td></tr><tr><td>0x15</td><td>15:8</td><td></td><td></td><td>EVD5</td><td>EVD4</td><td>EVD3</td><td>EVD2</td><td>EVD1</td><td>EVD0</td></tr><tr><td>0x16</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">INTFLAG</td><td>7:0</td><td></td><td></td><td>OVR5</td><td>OVR4</td><td>OVR3</td><td>OVR2</td><td>OVR1</td><td>OVR0</td></tr><tr><td>0x19</td><td>15:8</td><td></td><td></td><td>EVD5</td><td>EVD4</td><td>EVD3</td><td>EVD2</td><td>EVD1</td><td>EVD0</td></tr><tr><td>0x1A</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

## 23.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 407 and “PAC – Peripheral Access Controller” on page 30 for details.

## 23.8.1 Control

Name: CTRL

Offset: 0x00

Reset: 0x00

Access: Write-Only

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>GCLKREQ</td><td></td><td></td><td></td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – GCLKREQ: Generic Clock Requests

This bit is used to determine whether the generic clocks used for the different channels should be on all the time or only when an event needs the generic clock. Events propagated through asynchronous paths will not need a generic clock.

0: Generic clock is requested and turned on only if an event is detected.

1: Generic clock for a channel is always on.

## Bits 3:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – SWRST: Software Reset

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the EVSYS to their initial state.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded.

## 23.8.2 Channel

Name: CHANNEL

Offset: 0x04

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="2">EDGSEL[1:0]</td><td colspan="2">PATH[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td colspan="6">EVGEN[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>SWEVT</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">CHANNEL[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to configure the channel specified in the CHANNEL bit group. To write to this register, do a single 32-bit write of all the configuration and channel selection data.

To read from this register, first do an 8-bit write to the CHANNEL.CHANNEL bit group specifying the channe configuration to be read, and then read the Channel register (CHANNEL).

z Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 27:26 – EDGSEL[1:0]: Edge Detection Selection

These bits set the type of edge detection to be used on the channel.

These bits must be written to zero when using the asynchronous path.

Table 23-2. Edge Detection Selection

<table><tr><td>EDGSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NO_EVT_OUTPUT</td><td>No event output when using the resynchronized or synchronous path</td></tr><tr><td>0x1</td><td>RISING_EDGE</td><td>Event detection only on the rising edge of the signal from the event generator when using the resynchronized or synchronous path</td></tr><tr><td>0x2</td><td>FALLING_EDGE</td><td>Event detection only on the falling edge of the signal from the event generator when using the resynchronized or synchronous path</td></tr><tr><td>0x3</td><td>BOTH_EDGES</td><td>Event detection on rising and falling edges of the signal from the event generator when using the resynchronized or synchronous path</td></tr></table>

## z Bits 25:24 – PATH[1:0]: Path Selection

These bits are used to choose the path to be used by the selected channel.

The path choice can be limited by the channel source, see Table 23-6.

Table 23-3. Path Selection

<table><tr><td>PATH[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>SYNCHRONOUS</td><td>Synchronous path</td></tr><tr><td>0x1</td><td>RESYNCHRONIZED</td><td>Resynchronized path</td></tr><tr><td>0x2</td><td>ASYNCHRONOUS</td><td>Asynchronous path</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## ● Bits 23:22 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 21:16 – EVGEN[5:0]: Event Generator Selection

These bits are used to choose which event generator to connect to the selected channel.

Table 23-4. Event Generator Selection

<table><tr><td>Value</td><td>Event Generator</td><td>Description</td></tr><tr><td>0x00</td><td>NONE</td><td>No event generator selected</td></tr><tr><td>0x01</td><td>RTC CMP0</td><td>Compare 0 (mode 0 and 1) or Alarm 0 (mode 2)</td></tr><tr><td>0x02</td><td>RTC CMP1</td><td>Compare 1</td></tr><tr><td>0x03</td><td>RTC OVF</td><td>Overflow</td></tr><tr><td>0x04</td><td>RTC PER0</td><td>Period 0</td></tr><tr><td>0x05</td><td>RTC PER1</td><td>Period 1</td></tr><tr><td>0x06</td><td>RTC PER2</td><td>Period 2</td></tr><tr><td>0x07</td><td>RTC PER3</td><td>Period 3</td></tr><tr><td>0x08</td><td>RTC PER4</td><td>Period 4</td></tr><tr><td>0x09</td><td>RTC PER5</td><td>Period 5</td></tr><tr><td>0x0A</td><td>RTC PER6</td><td>Period 6</td></tr><tr><td>0x0B</td><td>RTC PER7</td><td>Period 7</td></tr><tr><td>0x0C</td><td>EIC EXTINT0</td><td>External Interrupt 0</td></tr><tr><td>0x0D</td><td>EIC EXTINT1</td><td>External Interrupt 1</td></tr><tr><td>0x0E</td><td>EIC EXTINT2</td><td>External Interrupt 2</td></tr><tr><td>0x0F</td><td>EIC EXTINT3</td><td>External Interrupt 3</td></tr><tr><td>0x10</td><td>EIC EXTINT4</td><td>External Interrupt 4</td></tr><tr><td>0x11</td><td>EIC EXTINT5</td><td>External Interrupt 5</td></tr><tr><td>0x12</td><td>EIC EXTINT6</td><td>External Interrupt 6</td></tr><tr><td>0x13</td><td>EIC EXTINT7</td><td>External Interrupt 7</td></tr><tr><td>0x14</td><td>DMAC CH0</td><td>Channel 0</td></tr><tr><td>0x15</td><td>DMAC CH1</td><td>Channel 1</td></tr><tr><td>0x16</td><td>DMAC CH2</td><td>Channel 2</td></tr><tr><td>0x17</td><td>DMAC CH3</td><td>Channel 3</td></tr><tr><td>0x18</td><td>TCC0 OVF</td><td>Overflow</td></tr><tr><td>0x19</td><td>TCC0 TRG</td><td>Trig</td></tr><tr><td>0x1A</td><td>TCC0 CNT</td><td>Counter</td></tr><tr><td>0x1B</td><td>TCC0_MCX0</td><td>Match/Capture 0</td></tr><tr><td>0x1C</td><td>TCC0_MCX1</td><td>Match/Capture 1</td></tr><tr><td>0x1D</td><td>TCC0_MCX2</td><td>Match/Capture 2</td></tr><tr><td>0x1E</td><td>TCC0_MCX3</td><td>Match/Capture 3</td></tr><tr><td>0x1F</td><td>TC1 OVF</td><td>Overflow/Underflow</td></tr><tr><td>0x20</td><td>TC1 MC0</td><td>Match/Capture 0</td></tr><tr><td>0x21</td><td>TC1 MC1</td><td>Match/Capture 1</td></tr><tr><td>0x22</td><td>TC2 OVF</td><td>Overflow/Underflow</td></tr><tr><td>0x23</td><td>TC2 MC0</td><td>Match/Capture 0</td></tr><tr><td>0x24</td><td>TC2 MC1</td><td>Match/Capture 1</td></tr><tr><td>0x25</td><td>ADC RESRDY</td><td>Result Ready</td></tr><tr><td>0x26</td><td>ADC WINMON</td><td>Window Monitor</td></tr><tr><td>0x27</td><td>AC COMP0</td><td>Comparator 0</td></tr><tr><td>0x28</td><td>AC COMP1</td><td>Comparator 1</td></tr><tr><td>0x29</td><td>AC WIN</td><td>Window</td></tr><tr><td>0x2A</td><td>DAC EMPTY</td><td>Data Buffer Empty</td></tr><tr><td>0x2B</td><td>PTC EOC</td><td>End of Conversion</td></tr><tr><td>0x2C</td><td>PTC WCOMP</td><td>Window Comparator</td></tr><tr><td>0x2D-0x7F</td><td>Reserved</td><td></td></tr></table>

## z Bits 15:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 8 – SWEVT: Software Event

This bit is used to insert a software event on the channel selected by the CHANNEL.CHANNEL bit group.

This bit must be written together with CHANNEL.CHANNELusing a 16-bit write.

Writing a zero to this bit has no effect.

Writing a one to this bit will trigger a software event for the corresponding channel.

This bit will always return zero when read.

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 2:0 – CHANNEL[2:0]: Channel Selection

These bits are used to select the channel to be set up or read from.

## 23.8.3 User Multiplexer

Name: USER

Offset: 0x08

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">CHANNEL[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">USER[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register is used to configure a specified event user. To write to this register, do a single 16-bit write of all the configuration and event user selection data.

To read from this register, first do an 8-bit write to the USER.USER bit group specifying the event user configuration to be read, and then read USER.

z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 11:8 – CHANNEL[3:0]: Channel Event Selection

These bits are used to select the channel to connect to the event user.

Note that to select channel n, the value (n+1) must be written to the USER.CHANNEL bit group.

Table 23-5. Channel Event Selection

<table><tr><td>CHANNEL[3:0]</td><td>Channel Number</td></tr><tr><td>0x0</td><td>No Channel Output Selected</td></tr><tr><td>0x1-0x5</td><td>Channel n-1 selected</td></tr><tr><td>0x2-0xff</td><td>Reserved</td></tr></table>

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 4:0 – USER[4:0]: User Multiplexer Selection

These bits select the event user to be configured with a channel, or the event user to read the channel value from.

Table 23-6. User Multiplexer Selection

<table><tr><td>USER[7:0]</td><td>User Multiplexer</td><td>Description</td><td>Path Type</td></tr><tr><td>0x00</td><td>DMAC CH0</td><td>Channel 0</td><td>Resynchronized path only</td></tr><tr><td>0x01</td><td>DMAC CH1</td><td>Channel 1</td><td>Resynchronized path only</td></tr><tr><td>0x02</td><td>DMAC CH2</td><td>Channel 2</td><td>Resynchronized path only</td></tr><tr><td>0x03</td><td>DMAC CH3</td><td>Channel 3</td><td>Resynchronized path only</td></tr><tr><td>0x04</td><td>TCC0 EV0</td><td></td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x05</td><td>TCC0 EV1</td><td></td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x06</td><td>TCC0 MC0</td><td>Match/Capture 0</td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x07</td><td>TCC0 MC1</td><td>Match/Capture 1</td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x08</td><td>TCC0 MC2</td><td>Match/Capture 2</td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x09</td><td>TCC0 MC3</td><td>Match/Capture 3</td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x0A</td><td>TC1_EVU</td><td></td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x0B</td><td>TC2_EVU</td><td></td><td>Asynchronous, synchronous and resynchronized paths</td></tr><tr><td>0x0C</td><td>ADC_START</td><td></td><td>Asynchronous path only</td></tr><tr><td>0x0D</td><td>ADC_SYNC</td><td></td><td>Asynchronous path only</td></tr><tr><td>0x0E</td><td>AC_SOC_0</td><td></td><td>Asynchronous path only</td></tr><tr><td>0x0F</td><td>AC_SOC_1</td><td></td><td>Asynchronous path only</td></tr><tr><td>0x10</td><td>DAC_START</td><td></td><td>Asynchronous path only</td></tr><tr><td>0x11</td><td>PTC_STCONV</td><td></td><td>Asynchronous path only</td></tr><tr><td>0x12-0x1F</td><td>Reserved</td><td></td><td>Reserved</td></tr></table>

## 23.8.4 Channel Status

Name: CHSTATUS

Offset: 0x0C

Reset: 0x0000003F

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td>CHBUSY5</td><td>CHBUSY4</td><td>CHBUSY3</td><td>CHBUSY2</td><td>CHBUSY1</td><td>CHBUSY0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>USRRDY5</td><td>USRRDY4</td><td>USRRDY3</td><td>USRRDY2</td><td>USRRDY1</td><td>USRRDY0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## Bits 31:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 13:8 – CHBUSYx [x=5..0]: Channel x Busy

This bit is cleared when channel x is idle

This bit is set if an event on channel x has not been handled by all event users connected to channel x.

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:0 – USRRDYx [x=5..0]: Channel x User Ready

This bit is cleared when at least one of the event users connected to the channel is not ready.

This bit is set when all event users connected to channel x are ready to handle incoming events on channel x.

## 23.8.5 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td>EVD5</td><td>EVD4</td><td>EVD3</td><td>EVD2</td><td>EVD1</td><td>EVD0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>OVR5</td><td>OVR4</td><td>OVR3</td><td>OVR2</td><td>OVR1</td><td>OVR0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 31:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 13:8 – EVDx [x=5..0]: Channel x Event Detection Interrupt Enable

0: The Event Detected Channel x interrupt is disabled.

1: The Event Detected Channel x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Event Detected Channel x Interrupt Enable bit, which disables the Event Detected Channel x interrupt.

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:0 – OVRx [x=5..0]: Channel x Overrun Interrupt Enable

0: The Overrun Channel x interrupt is disabled.

1: The Overrun Channel x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overrun Channel x Interrupt Enable bit, which disables the Overrun Channel x interrupt.

## 23.8.6 Interrupt Enable Set

Name: INTENSET

Offset: 0x14

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td>EVD5</td><td>EVD4</td><td>EVD3</td><td>EVD2</td><td>EVD1</td><td>EVD0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>OVR5</td><td>OVR4</td><td>OVR3</td><td>OVR2</td><td>OVR1</td><td>OVR0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 31:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 13:8 – EVDx [x=5..0]: Channel x Event Detection Interrupt Enable

0: The Event Detected Channel x interrupt is disabled.

1: The Event Detected Channel x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Event Detected Channel x Interrupt Enable bit, which enables the Event Detected Channel x interrupt.

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:0 – OVRx [x=5..0]: Channel x Overrun Interrupt Enable

0: The Overrun Channel x interrupt is disabled.

1: The Overrun Channel x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overrun Channel x Interrupt Enable bit, which enables the Overrun Channel x interrupt.

## 23.8.7 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x18

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td>EVD5</td><td>EVD4</td><td>EVD3</td><td>EVD2</td><td>EVD1</td><td>EVD0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>OVR5</td><td>OVR4</td><td>OVR3</td><td>OVR2</td><td>OVR1</td><td>OVR0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 13:8 – EVDx [x=5..0]: Channel x Event Detection

This flag is set on the next CLK\_EVSYS\_APB cycle when an event is being propagated through the channel, and an interrupt request will be generated if INTENCLR/SET.EVDx is one.

When the event channel path is asynchronous, the EVDx interrupt flag will not be set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Event Detected Channel n interrupt flag.

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:0 – OVRx [x=5..0]: Channel x Overrun

This flag is set on the next CLK\_EVSYS cycle after an overrun channel condition occurs, and an interrupt request will be generated if INTENCLR/SET.OVRx is one.

When the event channel path is asynchronous, the OVRx interrupt flag will not be set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overrun Channel x interrupt flag.

## 24. SERCOM – Serial Communication Interface

## 24.1 Overview

The serial communication interface (SERCOM) can be configured to support a number of modes; I<sup>2</sup>C, SPI, and USART. Once configured and enabled, all SERCOM resources are dedicated to the selected mode.

The SERCOM serial engine consists of a transmitter and receiver, baud-rate generator and address matching functionality. It can be configured to use the internal generic clock or an external clock, making operation in all sleep modes possible.

## 24.2 Features

z Combined interface configurable as one of the following:

z I<sup>2</sup>C – Two-wire serial interface

z SMBus<sup>™</sup> compatible.

z SPI – Serial peripheral interface

z USART – Universal synchronous and asynchronous serial receiver and transmitter

z Single transmit buffer and double receive buffer

z Baud-rate generator

z Address match/mask logic

z Operational in all sleep modes

z Can be used with DMA

## 24.3 Block Diagram

Figure 24-1. SERCOM Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_26a33eea08a955bf8da465fb53b184b1d18ebb68a8bb8d34f39903c0cf8a34a2.jpg)

## 24.4 Signal Description

See the respective SERCOM mode chapters for details:

z “SERCOM USART – SERCOM Universal Synchronous and Asynchronous Receiver and Transmitter” on page 438

“SERCOM SPI – SERCOM Serial Peripheral Interface” on page 476

“SERCOM I2C – SERCOM Inter-Integrated Circuit” on page 509

## 24.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 24.5.1 I/O Lines

Using the SERCOM I/O lines requires the I/O pins to be configured using port configuration (PORT). Refer to “PORT” on page 378 for details.

From Figure 24-1 one can see that the SERCOM has four internal pads, PAD[3:0]. The signals from I<sup>2</sup>C, SPI and USART are routed through these SERCOM pads via a multiplexer. The configuration of the multiplexer is available from the different SERCOM modes. Refer to the mode specific chapters for details:

z “SERCOM USART – SERCOM Universal Synchronous and Asynchronous Receiver and Transmitter” on page 438

“SERCOM SPI – SERCOM Serial Peripheral Interface” on page 476

“SERCOM I2C – SERCOM Inter-Integrated Circuit” on page 509

## 24.5.2 Power Management

The SERCOM can operate in any sleep mode.SERCOM interrupts can be used to wake up the device from sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 24.5.3 Clocks

The SERCOM bus clock (CLK\_SERCOMx\_APB) is enabled by default, and can be enabled and disabled in the Power Manager. Refer to “PM – Power Manager” on page 110 for details.

Two generic clocks are used by the SERCOM: GCLK\_SERCOMx\_CORE and GCLK\_SERCOMx\_SLOW. The core clock (GCLK\_SERCOMx\_CORE) is required to clock the SERCOM while operating as a master, while the slow clock (GCLK\_SERCOMx\_SLOW) is only required for certain functions. See specific mode chapters for details.

These clocks must be configured and enabled in the Generic Clock Controller (GCLK) before using the SERCOM. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

These generic clocks are asynchronous to the user interface clock (CLK\_SERCOMx\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 437 for further details.

## 24.5.4 DMA

The DMA request lines are connected to the DMA controller (DMAC). Using the SERCOM DMA requests, requires the DMA controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details.

## 24.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the SERCOM interrupts requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 24.5.6 Events

Not applicable.

## 24.5.7 Debug Operation

When the CPU is halted in debug mode, the SERCOM continues normal operation. If the SERCOM is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging. The SERCOM can be forced to halt operation during debugging.

## 24.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

● Interrupt Flag Status and Clear register (INTFLAG)

z Address register (ADDR)

● Data register (DATA)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 24.5.9 Analog Connections

Not applicable.

## 24.6 Functional Description

## 24.6.1 Principle of Operation

The basic structure of the SERCOM serial engine is shown in Figure 24-2. Fields shown in capital letters are synchronous to the system clock and accessible by the CPU, while fields with lowercase letters can be configured to run on the GCLK\_SERCOMx\_CORE clock or an external clock.

Figure 24-2. SERCOM Serial Engine

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_f380c281a0b2c16abdcaa8a103fd0db8812c883fe09efb6ea6aab3aad9781743.jpg)

The transmitter consists of a single write buffer and a shift register. The receiver consists of a two-level receive buffer and a shift register. The baud-rate generator is capable of running on the GCLK\_SERCOMx\_CORE clock or an external clock. Address matching logic is included for SPI and I<sup>2</sup>C operation.

## 24.6.2 Basic Operation

## 24.6.2.1 Initialization

The SERCOM must be configured to the desired mode by writing to the Operating Mode bits in the Control A register (CTRLA.MODE). Refer to Figure 24-1 for details.

Table 24-1. SERCOM Modes

<table><tr><td>CTRLA.MODE</td><td>Description</td></tr><tr><td>0x0</td><td>USART with external clock</td></tr><tr><td>0x1</td><td>USART with internal clock</td></tr><tr><td>0x2</td><td>SPI in slave operation</td></tr><tr><td>0x3</td><td>SPI in master operation</td></tr><tr><td>0x4</td><td> $I^{2}C$  slave operation</td></tr><tr><td>0x5</td><td> $I^{2}C$  master operation</td></tr><tr><td>0x6-0x7</td><td>Reserved</td></tr></table>

For further initialization information, see the respective SERCOM mode chapters.

## 24.6.2.2 Enabling, Disabling and Resetting

The SERCOM is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The SERCOM is disabled by writing a zero to CTRLA.ENABLE.

The SERCOM is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the SERCOM, except DBGCTRL, will be reset to their initial state, and the SERCOM will be disabled. Refer to the CTRLA register descriptions for details.

## 24.6.2.3 Clock Generation – Baud-Rate Generator

The baud-rate generator, as shown in Figure 24-3, is used for internal clock generation for asynchronous and synchronous communication. The generated output frequency (f ) is determined by the Baud register (BAUD) setting and the baud reference frequency (f ). The baud reference clock is the serial engine clock, and it can be internal or external.

For asynchronous operation, the /16 (divide-by-16) output is used when transmitting and the /1 (divide-by-1) output is used when receiving. For synchronous operation the /2 (divide-by-2) output is used. This functionality is automatically configured, depending on the selected operating mode.

Figure 24-3. Baud Rate Generator  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_c65e7da69c6283c99e694ffb928967710385ff303c6d8352a661735b4661a16d.jpg)  
Table 24-2 contains equations for calculating the baud rate (in bits per second) and for calculating the BAUD registe value for each mode of operation.

For asynchronous operation there are two different modes. Using the arithmetic mode, the BAUD register value is 16 bits (0 to 65,535). Using the fractional mode, the BAUD register is 13 bits, while the fractional adjustment is 3 bits. In this mode the BAUD setting must be greater than or equal to 1.

For synchronous mode, the BAUD register value is 8 bits (0 to 255).

Table 24-2. Baud Rate Equations

<table><tr><td>Operating Mode</td><td>Condition</td><td>Baud Rate (Bits Per Second)</td><td>BAUD Register Value Calculation</td></tr><tr><td>Asynchronous Arithmetic</td><td> $f_{\text{BAUD}} \leq \frac{f_{\text{REF}}}{S}$ </td><td> $f_{\text{BAUD}} = \frac{f_{\text{REF}}}{S}(1 - \text{BAUD} / 65,536)$ </td><td> $BAUD = 65,536 \left( 1 - S \frac{f_{\text{BAUD}}}{f_{\text{REF}}} \right)$ </td></tr><tr><td>Asynchronous Fractional</td><td> $f_{\text{BAUD}} \leq \frac{f_{\text{REF}}}{S}$ </td><td> $f_{\text{BAUD}} = \frac{f_{\text{REF}}}{S(\text{BAUD} + (\text{FP}/8))}$ </td><td> $BAUD = \frac{f_{\text{REF}}}{S \times f_{\text{BAUD}}} - \frac{\text{FP}}{8}$ </td></tr><tr><td>Synchronous</td><td> $f_{\text{BAUD}} \leq \frac{f_{\text{REF}}}{2}$ </td><td> $f_{\text{BAUD}} = \frac{f_{\text{REF}}}{2(\text{BAUD} + 1)}$ </td><td> $BAUD = \frac{f_{\text{REF}}}{2 f_{\text{BAUD}}} - 1$ </td></tr></table>

S – Number of samples per bit. Can be 16, 8, or 3.  
The Asynchronous Fractional option is used for auto-baud detection.

The baud rate error is represented by the following formula:

$$
E r r o r = 1 - \left(\frac {\text { ExpectedBaudRate }}{\text { ActualBaudRate }}\right)
$$

## Asynchronous Arithmetic Mode BAUD Value Selection

The formula given for $\mathsf { f } _ { \mathsf { B A U D } }$ calculates the average frequency over 65,536 $\mathsf { f } _ { \mathsf { R E F } }$ cycles. Although the BAUD register can be set to any value between 0 and 65,536, the values that will change the average frequency of $\mathsf { f } _ { \mathsf { B A U D } }$ over a single frame are more constrained. The BAUD register values that will affect the average frequency over a single frame lead to an integer increase in the cycles per frame (CPF).

$$
C P F = \frac {f _ {R E F}}{f _ {B A U D}} (D + S)
$$

where

z D represent the data bits per frame

z S represent the sum of start and first stop bits, if present

Table 24-3 shows the BAUD register value versus baud frequency at a serial engine frequency of 48MHz. This assumes a D value of 8 bits and an S value of 2 bits (10 bits, including start and stop bits).

Table 24-3. BAUD Register Value vs. Baud Frequency

<table><tr><td>BAUD Register Value</td><td>Serial Engine CPF</td><td> $f_{\text{BAUD}}$  at 48MHz Serial Engine Frequency ( $f_{\text{REF}}$ )</td></tr><tr><td>0 – 406</td><td>160</td><td>3MHz</td></tr><tr><td>407 – 808</td><td>161</td><td>2.981MHz</td></tr><tr><td>809 – 1205</td><td>162</td><td>2.963MHz</td></tr><tr><td>...</td><td></td><td></td></tr><tr><td>65206</td><td>31775</td><td>15.11kHz</td></tr><tr><td>65207</td><td>31871</td><td>15.06kHz</td></tr><tr><td>65208</td><td>31969</td><td>15.01kHz</td></tr></table>

## 24.6.3 Additional Features

## 24.6.3.1 Address Match and Mask

The SERCOM address match and mask feature is capable of matching one address with a mask, two unique addresses or a range of addresses, based on the mode selected. The match uses seven or eight bits, depending on the mode.

## Address With Mask

An address written to the Address bits in the Address register (ADDR.ADDR) with a mask written to the Address Mask bits in the Address register (ADDR.ADDRMASK) will yield an address match. All bits that are masked are not included in the match. Note that setting the ADDR.ADDRMASK to all zeros will match a single unique address, while setting ADDR.ADDRMASK to all ones will result in all addresses being accepted.

## Figure 24-4. Address With Mask

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_dcd592ee08dd72a63f2a9523c2c9204442a9eba720e0b3f36ad965769b046c69.jpg)

## Two Unique Addresses

The two addresses written to ADDR and ADDRMASK will cause a match.

## Figure 24-5. Two Unique Addresses

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_ec634b0ec0f5c74a147575f495756e30c0208635e532ce61c6d81b42a8330ad1.jpg)

## Address Range

The range of addresses between and including ADDR.ADDR and ADDR.ADDRMASK will cause a match. ADDR.ADDR and ADDR.ADDRMASK can be set to any two addresses, with ADDR.ADDR acting as the upper limit and ADDR.ADDRMASK acting as the lower limit.

Figure 24-6. Address Range  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_453351de7c9d0f68007eb2154ec9a0abd394cc29c840c84052e995329daa447c.jpg)

## 24.6.4 DMA Operation

Not applicable.

## 24.6.5 Interrupts

Interrupt sources are mode-specific. See the respective SERCOM mode chapters for details.

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the SERCOM is reset. See the register description for details on how to clear interrupt flags.

The SERCOM has one common interrupt request line for all the interrupt sources. The user must read the INTFLAG register to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details

## 24.6.6 Events

Not applicable.

## 24.6.7 Sleep Mode Operation

The peripheral can operate in any sleep mode where the selected serial clock is running. This clock can be external or generated by the internal baud-rate generator.

The SERCOM interrupts can be used to wake up the device from sleep modes. Refer to the different SERCOM mode chapters for details.

## 24.6.8 Synchronization

Due to the asynchronicity between CLK\_SERCOMx\_APB and GCLK\_SERCOMx\_CORE, some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

● No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete. The Synchronization Ready interrupt can be used to signal when synchronization is complete.

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

# 25. SERCOM USART – SERCOM Universal Synchronous and Asynchronous Receiver and Transmitter

## 25.1 Overview

The universal synchronous and asynchronous receiver and transmitter (USART) is one of the available modes in the Serial Communication Interface (SERCOM).

Refer to “SERCOM – Serial Communication Interface” on page 430 for details.

The USART uses the SERCOM transmitter and receiver configured as shown in Figure 25-1. Fields shown in capital letters are synchronous to the CLK\_SERCOMx\_APB and accessible by the CPU, while fields with lowercase letters can be configured to run on the internal generic clock or an external clock.

The transmitter consists of a single write buffer, a shift register and control logic for handling different frame formats. The write buffer allows continuous data transmission without any delay between frames.

The receiver consists of a two-level receive buffer and a shift register. Status information for the received data is available for error checking. Data and clock recovery units ensure robust synchronization and noise filtering during asynchronous data reception.

## 25.2 Features

z Full-duplex operation

z Asynchronous (with clock reconstruction) or synchronous operation

z Internal or external clock source for asynchronous and synchronous operation

z Baud-rate generator

z Supports serial frames with 5, 6, 7, 8 or 9 data bits and 1 or 2 stop bits

z Odd or even parity generation and parity check

z Selectable LSB- or MSB-first data transfer

z Buffer overflow and frame error detection

z Noise filtering, including false start-bit detection and digital low-pass filter

z Collision detection

z Can operate in all sleep modes

z Operation at speeds up to half the system clock for internally generated clocks

z Operation at speeds up to the system clock for externally generated clocks

z RTS and CTS flow control

z IrDA modulation and demodulation up to 115.2 kbps

z LIN slave support

z Auto-baud and break character detection

z Start-of-frame detection

z Can be used with DMA

## 25.3 Block Diagram

Figure 25-1. USART Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_63ab18be8bb96c8c3dc18f07c0f25cddb0100386c33f781be7f633e8268484dd.jpg)

## 25.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>PAD[3:0]</td><td>Digital I/O</td><td>General SERCOM pins</td></tr></table>

Please refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 25.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 25.5.1 I/O Lines

Using the USART’s I/O lines requires the I/O pins to be configured using port configuration (PORT).

Refer to “PORT” on page 378 for details.

When the SERCOM is used in USART mode, the pins should be configured according to Table 25-1. If the receiver or transmitter is disabled, these pins can be used for other purposes.

Table 25-1. USART Pin Configuration

<table><tr><td>Pin</td><td>Pin Configuration</td></tr><tr><td>TxD</td><td>Output</td></tr><tr><td>RxD</td><td>Input</td></tr><tr><td>XCK</td><td>Output or input</td></tr></table>

The combined configuration of PORT and the Transmit Data Pinout and Receive Data Pinout bit groups (refer to the Control A register description) will define the physical position of the USART signals in Table 25-1.

## 25.5.2 Power Management

The USART can continue to operate in any sleep mode where the selected source clock is running. The USART interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 25.5.3 Clocks

The SERCOM bus clock (CLK\_SERCOMx\_APB, where x represents the specific SERCOM instance number) can be enabled and disabled in the Power Manager, and the default state of CLK\_SERCOMx\_APB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110.

A generic clock (GCLK\_SERCOMx\_CORE) is required to clock the SERCOMx\_CORE. This clock must be configured and enabled in the Generic Clock Controller before using the SERCOMx\_CORE. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the bus clock (CLK\_SERCOMx\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 451 for further details.

## 25.5.4 DMA

The DMA request lines are connected to the DMA controller (DMAC). Using the SERCOM DMA requests, requires the DMA controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details..

## 25.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the USART interrupts requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 25.5.6 Events

Not applicable.

## 25.5.7 Debug Operation

When the CPU is halted in debug mode, the USART continues normal operation. If the USART is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging. The USART can be forced to halt operation during debugging. Refer to DBGCTRL. for details

## 25.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

Interrupt Flag Status and Clear register (INTFLAG)

z Status register (STATUS)

Data register (DATA)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 25.5.9 Analog Connections

Not applicable.

## 25.6 Functional Description

## 25.6.1 Principle of Operation

The USART uses three communication lines for data transfer:

RxD for receiving

TxD for transmitting

z XCK for the transmission clock in synchronous operation

USART data transfer is frame based, where a serial frame consists of:

z 1 start bit

5, 6, 7, 8 or 9 data bits

● MSB or LSB first

z No, even or odd parity bit

z 1 or 2 stop bits

A frame starts with the start bit followed by one character of data bits. If enabled, the parity bit is inserted after the data bits and before the first stop bit. One frame can be directly followed by a new frame, or the communication line can return to the idle (high) state. Figure 25-2 illustrates the possible frame formats. Bits inside brackets are optional.

Figure 25-2. Frame Formats  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_efdfe855cf12a44ebeab10b85320aa689803d8e9e59849152985a05ba8ac28f7.jpg)

St Start bit; always low

(n) Data bits; 0 to 8

P Parity bit; odd or even

Sp Stop bit; always high

IDLE No transfers on the communication line; always high in this state

## 25.6.2 Basic Operation

## 25.6.2.1 Initialization

The following registers are enable-protected, meaning they can only be written when the USART is disabled (CTRL.ENABLE is zero):

z Control A register (CTRLA), except the Enable (ENABLE) and Software Reset (SWRST) bits

z Control B register (CTRLB), except the Receiver Enable (RXEN) and Transmitter Enable (TXEN) bits

Baud register (BAUD)

Any writes to these registers when the USART is enabled or is being enabled (CTRL.ENABLE is one) will be discarded. Writes to these registers) while the peripheral is being disabled will be completed after the disabling is complete.

Before the USART is enabled, it must be configured, as outlined in the following steps:

z USART mode with external or internal clock must be selected first by writing 0x0 or 0x1 to the Operating Mode bit group in the Control A register (CTRLA.MODE)

Communication mode (asynchronous or synchronous) must be selected by writing to the Communication Mode bit in the Control A register (CTRLA.CMODE)

z SERCOM pad to use for the receiver must be selected by writing to the Receive Data Pinout bit group in the Control A register (CTRLA.RXPO)

z SERCOM pads to use for the transmitter and external clock must be selected by writing to the Transmit Data Pinout bit in the Control A register (CTRLA.TXPO)

z Character size must be selected by writing to the Character Size bit group in the Control B register (CTRLB.CHSIZE)

MSB- or LSB-first data transmission must be selected by writing to the Data Order bit in the Control A register (CTRLA.DORD)

When parity mode is to be used, even or odd parity must be selected by writing to the Parity Mode bit in the Control B register (CTRLB.PMODE) and enabled by writing 0x1 to the Frame Format bit group in the Control A register (CTRLA.FORM)

z Number of stop bits must be selected by writing to the Stop Bit Mode bit in the Control B register (CTRLB.SBMODE)

z When using an internal clock, the Baud register (BAUD) must be written to generate the desired baud rate

z The transmitter and receiver can be enabled by writing ones to the Receiver Enable and Transmitter Enable bits in the Control B register (CTRLB.RXEN and CTRLB.TXEN)

## 25.6.2.2 Enabling, Disabling and Resetting

The USART is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The USART is disabled by writing a zero to CTRLA.ENABLE.

The USART is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the USART, except DBGCTRL, will be reset to their initial state, and the USART will be disabled. Refer to the CTRLA register for details.

## 25.6.2.3 Clock Generation and Selection

For both synchronous and asynchronous modes, the clock used for shifting and sampling data can be generated internally by the SERCOM baud-rate generator or supplied externally through the XCK line. Synchronous mode is selected by writing a one to the Communication Mode bit in the Control A register (CTRLA.CMODE) and asynchronous mode is selected by writing a zero to CTRLA.CMODE. The internal clock source is selected by writing 0x1 to the Operation Mode bit group in the Control A register (CTRLA.MODE) and the external clock source is selected by writing 0x0 to CTRLA.MODE.

The SERCOM baud-rate generator is configured as shown in Figure 25-3. When CTRLA.CMODE is zero, the baudrate generator is automatically set to asynchronous mode and the 16-bit Baud register value is used. When CTRLA.CMODE is one, the baud-rate generator is automatically set to synchronous mode and the eight LSBs of the Baud register are used. Refer to “Clock Generation – Baud-Rate Generator” on page 433 for details on configuring the baud rate.

Figure 25-3. Clock Generation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_e1bf71ea2c4a87dc23b640a14727a89b4865e199cf5f6c192de4d5c0f565c7df.jpg)

## Synchronous Clock Operation

When synchronous mode is used, the CTRLA.MODE bit group controls whether the transmission clock (XCK line) is an input or output. The dependency between the clock edges and data sampling or data change is the same for internal and external clocks. Data input on the RxD pin is sampled at the opposite XCK clock edge as data is driven on the TxD pin.

The Clock Polarity bit in the Control A register (CTRLA.CPOL) selects which XCK clock edge is used for RxD sampling and which is used for TxD change. As shown in Figure 25-4, when CTRLA.CPOL is zero, the data will be changed on the rising XCK edge and sampled on the falling XCK edge. If CTRLA.CPOL is one, the data will be changed on the falling edge of XCK and sampled on the rising edge of XCK.

Figure 25-4. Synchronous Mode XCK Timing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_aacbccf120d234c1d973791cba573894d79a0f1d6ae6e1ad75beadff70cfbd67.jpg)

When the clock is provided through XCK (CTRLA.MODE is 0x0), the shift registers operate directly on the XCK clock. This means that XCK is not synchronized with the system clock and, therefore, can operate at frequencies up to the system frequency.

## 25.6.2.4 Data Register

The USART Transmit Data register (TxDATA) and USART Receive Data register(RxDATA) share the same I/O address, referred to as the Data register (DATA). Writing the DATA register will update the Transmit Data register. Reading the DATA register will return the contents of the Receive Data register.

## 25.6.2.5 Data Transmission

A data transmission is initiated by loading the DATA register with the data to be sent. The data in TxDATA is moved to the shift register when the shift register is empty and ready to send a new frame. When the shift register is loaded with data, one complete frame will be transmitted.

The Transmit Complete interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.TXC) is set, and the optional interrupt is generated, when the entire frame plus stop bit(s) have been shifted out and there is no new data written to the DATA register.

The DATA register should only be written when the Data Register Empty flag in the Interrupt Flag Status and Clear register (INTFLAG.DRE) is set, which indicates that the register is empty and ready for new data.

## Disabling the Transmitter

Disabling the transmitter will not become effective until any ongoing and pending transmissions are completed, i.e., when the transmit shift register and TxDATA do not contain data to be transmitted. The transmitter is disabled by writing a zero to the Transmitter Enable bit in the Control B register (CTRLB.TXEN).

## 25.6.2.6 Data Reception

The receiver starts data reception when a valid start bit is detected. Each bit that follows the start bit will be sampled at the baud rate or XCK clock, and shifted into the receive shift register until the first stop bit of a frame is received. When the first stop bit is received and a complete serial frame is present in the receive shift register, the contents of the shift register will be moved into the two-level receive buffer. The Receive Complete interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.RXC) is set, and the optional interrupt is generated. A second stop bit will be ignored by the receiver.

The received data can be read by reading the DATA register. DATA should not be read unless the Receive Complete interrupt flag is set.

## Disabling the Receiver

Disabling the receiver by writing a zero to the Receiver Enable bit in the Control B register (CTRLB.RXEN) will flush the two-level receive buffer, and data from ongoing receptions will be lost.

## Error Bits

The USART receiver has three error bits. The Frame Error (FERR), Buffer Overflow (BUFOVF) and Parity Error (PERR) bits can be read from the Status (STATUS) register. Upon error detection, the corresponding bit will be set until it is cleared by writing a one to it. These bits are also automatically cleared when the receiver is disabled.

There are two methods for buffer overflow notification. When the immediate buffer overflow notification bit (CTRLA.IBON) is set, STATUS.BUFOVF is raised immediately upon buffer overflow. Software can then empty the receive FIFO by reading RxDATA until the receive complete interrupt flag (INTFLAG.RXC) goes low.

When CTRLA.IBON is zero, the buffer overflow condition travels with data through the receive FIFO. After the received data is read, STATUS.BUFOVF will be set along with INTFLAG.RXC.

## Asynchronous Data Reception

The USART includes a clock recovery and data recovery unit for handling asynchronous data reception. The clock recovery logic is used to synchronize the incoming asynchronous serial frames at the RxD pin to the internally generated baud-rate clock. The data recovery logic samples and applies a low-pass filter to each incoming bit, thereby improving the noise immunity of the receiver. The asynchronous reception operational range depends on the accuracy of the internal baud-rate clock, the rate of the incoming frames and the frame size (in number of bits).

## Asynchronous Operational Range

The operational range of the receiver depends on the difference between the received bit rate and the internally generated baud rate. If the baud rate of an external transmitter is too high or too low compared to the internally generated baud rate, the receiver will not be able to synchronize the frames to the start bit.

There are two possible sources for a mismatch in baud rate. The reference clock will always have some minor instability. In addition, the baud-rate generator can not always do an exact division of the reference clock frequency to get the baud rate desired. In this case, the BAUD register value should be selected to give the lowest possible error. Refer to “Asynchronous Arithmetic Mode BAUD Value Selection” on page 435 for details.

Recommended maximum receiver baud-rate errors for various character sizes are shown in the table below.

Table 25-2. Asynchronous Receiver Error for x16 Oversampling

<table><tr><td>D (Data bits + Parity)</td><td> $R_{SLOW}$ (%)</td><td> $R_{FAST}$ (%)</td><td>Max Total Error (%)</td><td>Recommended Max Rx Error (%)</td></tr><tr><td>5</td><td>94.12</td><td>107.69</td><td>+5.88/-7.69</td><td>±2.5</td></tr><tr><td>6</td><td>94.92</td><td>106.67</td><td>+5.08/-6.67</td><td>±2.0</td></tr><tr><td>7</td><td>95.52</td><td>105.88</td><td>+4.48/-5.88</td><td>±2.0</td></tr><tr><td>8</td><td>96.00</td><td>105.26</td><td>+4.00/-5.26</td><td>±2.0</td></tr><tr><td>9</td><td>96.39</td><td>104.76</td><td>+3.61/-4.76</td><td>±1.5</td></tr><tr><td>10</td><td>96.70</td><td>104.35</td><td>+3.30/-4.35</td><td>±1.5</td></tr></table>

The recommended maximum receiver baud-rate error assumes that the receiver and transmitter equally divide the maximum total error.

The following equations can be used to calculate the ratio of the incoming data rate and internal receiver baud rate:

$$
R _ {S L O W} = \frac {1 6 (D + 1)}{1 6 (D + 1) + 6} \quad R _ {F A S T} = \frac {1 6 (D + 2)}{1 6 (D + 1) + 8}
$$

where:

S is the number of samples per bit $( \mathsf { S } = 1 6 , 8 \mathsf { o r } 3 )$

z ${ \mathsf S } _ { \mathsf F }$ is the first sample number used for majority voting $( \mathsf { S } _ { \mathsf { F } } = 7 , 3 _ { \mathsf { m } }$ , or 2) when CTRLA.SAMPA=0.

z $\mathsf { S } _ { \mathsf { M } }$ is the middle sample number used for majority voting $( \mathsf { S } _ { \mathsf { M } } = 8 , 4 , 0 \mathsf { r } 2 )$ when CTRLA.SAMPA=0.

z D is the sum of character size and parity size $( \mathsf { D } = 5$ to 10 bits)

$\mathsf { R } _ { \mathsf { S L O W } }$ is the ratio of the slowest incoming data rate that can be accepted in relation to the receiver baud rate

z $\mathsf { R } _ { \mathsf { F A S T } }$ is the ratio of the fastest incoming data rate that can be accepted in relation to the receiver baud rate

## 25.6.3 Additional Features

## 25.6.3.1 Parity

Even or odd parity can be selected for error checking by writing 0x1 to the Frame Format bit group in the Control A register (CTRLA.FORM). If even parity is selected by writing a zero to the Parity Mode bit in the Control B register (CTRLB.PMODE), the parity bit of the outgoing frame is set to one if the number of data bits that are one is odd (making the total number of ones even). If odd parity is selected by writing a one to CTRLB.PMODE, the parity bit of the outgoing frame is set to one if the number of data bits that are one is even (making the total number of ones odd).

When parity checking is enabled, the parity checker calculates the parity of the data bits in incoming frames and compares the result with the parity bit of the corresponding frame. If a parity error is detected, the Parity Error bit in the Status register (STATUS.PERR) is set.

## 25.6.3.2 Hardware Handshaking

The USART features an out-of-band hardware handshaking flow control mechanism, implemented by connecting the RTS and CTS pins with the remote device, as shown in Figure 25-5.

Figure 25-5. Connection with a Remote Device for Hardware Handshaking

<table><tr><td colspan="2">USART</td><td>Remote Device</td></tr><tr><td>TXD</td><td></td><td>RXD</td></tr><tr><td>RXD</td><td></td><td>TXD</td></tr><tr><td>CTS</td><td></td><td>RTS</td></tr><tr><td>RTS</td><td></td><td>CTS</td></tr></table>

Hardware handshaking is only available with the following configuration:

● USART with internal clock (CTRLA.MODE = 1).

z Asynchronous mode (CTRLA.CMODE = 0).

z Flow control pinout (CTRLA.TXPO = 2).

The receiver drives its RTS pin high when disabled, or when the receive FIFO is full. This indicates to the remote device that it must stop transmitting after the ongoing transmission is complete. Enabling and disabling the receiver by writing RXEN will set/clear the RTS pin after a synchronization delay. When the receive FIFO goes full, RTS is immediately set and the frame that is currently being received will be stored in the shift register until the receive FIFO is no longer full.

Figure 25-6. Receiver Behavior when Operating with Hardware Handshaking  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_6b48f2c446daac564745f0c8753d7ed8e2d969aae723dc4833e3f7a277e7708b.jpg)

The current CTS level is available in the STATUS register (STATUS.CTS). Character transmission will only start if CTS is low. When CTS goes high, the transmitter will stop transmitting after the ongoing transmission is complete.

Figure 25-7. Transmitter Behavior when Operating with Hardware Handshaking  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_29ec89cf9b22a01d0e4c225278a7f10d201221b25d54655f71c7254aca21de4e.jpg)

## 25.6.3.3 IrDA Modulation and Demodulation

IrDA modulation and demodulation is available with the following configuration. When enabled, transmission and reception is IrDA compliant up to 115.2 kb/s.

z IrDA encoding enabled (CTRLB.ENC=1).

● Asynchronous mode (CTRLA.CMODE = 0).

z 16x sample rate (CTRLA.SAMPR[0] = 0).

During transmission, each low bit is transmitted as a high pulse with width as 3/16 of the baud rate period as illustrated in Figure 25-8.

Figure 25-8. IrDA Transmit Encoding  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_ae3818ab3211e5f0bad06fe524f4f70fcc2ef30a233e2b7b8f8668886e4e8fef.jpg)

The reception decoder has two main functions. The first is to synchronize the incoming data to the IrDA baud rate counter. Synchronization is performed at the start of each zero pulse. The second function is to decode incoming Rx data. If a pulse width meets the minimum length set by configuration (RXPL.RXPL), it is accepted. When the baud rate counter reaches its middle value (1/2 bit length), it is transferred to the receiver.

Figure 25-9 illustrates reception where RXPL.RXPL is set to 19. This indicates that the pulse width should be at least 20 SE clock cycles. When assuming BAUD = 0xE666 or 160 SE cycles per bit, this corresponds to 2/16 baud clock as minimum pulse width required. In this case the first bit is accepted as a zero, the second bit is a one, and the third bit is also a one. A low pulse is rejected since it does not meet the minimum requirement of 2/16 baud clock.

Figure 25-9. IrDA Receive Decoding  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_f2ff1c9e8abe3f3ec38b686719dcacfc93c9ff5ca7a9d7f0a3f4006e55f5b73d.jpg)

Note that the polarity of the transmitter and receiver are opposite. During transmission, a zero bit is transmitted as a one pulse. During reception, an accepted zero pulse is received as a zero bit.

## 25.6.3.4 Break Character Detection and Auto-baud

Break character detection and auto-baud are available with the following configuration:

● Auto-baud frame format (CTRLA.FORM = 0x04 or 0x05)

z Asynchronous mode (CTRLA.CMODE = 0).

z 16x sample rate using fractional baud rate generation (CTRLA.SAMPR = 1).

The auto-baud follows the LIN format. All LIN Frames start with a Break Field followed by a Sync Field. The USART uses a break detection threshold of greater than 11 nominal bit times at the configured baud rate. At any time, if more than 11 consecutive dominant bits are detected on the bus, the USART detects a Break Field. When a Break Field has been detected, the Receive Break interrupt flag (INTFLAG.RXBRK) is set and the USART expects the Sync Field character to be 0x55. This field is used to update the actual baud rate in order to stay synchronized. If the received Sync character is not 0x55, then the Inconsistent Sync Field error flag (STATUS.ISF) is set along with the Error interrupt flag (INTFLAG.ERROR) and the baud rate is unchanged.

Figure 25-10.LIN Break and Sync Fields  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_4b9f981490ee4109c91ed34e1225d564a45b14e643f6d218e8b798d5180d22a5.jpg)

After a break field is detected and the start bit of the Sync Field is detected, a counter is started. The counter is then incremented for the next 8 bit times of the Sync Field. At the end of these 8 bit times, the counter is stopped. At this moment, the 13 most significant bits of the counter (value divided by 8) gives the new clock divider (BAUD.BAUD) and the 3 least significant bits of this value (the remainder) gives the new Fractional Part (BAUD.FP). When the Sync Field has been received, the clock divider (BAUD.BAUD) and the Fractional Part (BAUD.FP) are updated in the Baud Rate Generator register (BAUD) after a synchronization delay.

After the Break and Sync Fields, n characters of data can be received.

## 25.6.3.5 Collision Detection

When the receiver and transmitter are connected either through pin configuration or externally, transmit collision can be detected by setting the Collision Detection Enable bit (CTRLB.COLDEN). For collision to be detected, the receiver and transmitter must be enabled (CTRLB.RXEN=1 and CTRLB.TXEN=1).

Collision detection is performed for each bit transmitted by checking the received value vs the transmit value as shown in Figure 25-11. While the transmitter is idle (no transmission in progress), characters can be received on RxD without triggering a collision.

Figure 25-11.Collision Checking  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_879c2fbd1589ed5fd59205396e7baadf1d63710039aefa78f43c399495b78d9a.jpg)

Figure 25-12 shows the conditions for a collision detection. In this case, the start bit and the first data bit are received with the same value as transmitted. The second received data bit is found to be different than the transmitted bit at the detection point which indicates a collision.

Figure 25-12.Collision Detected  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_a56571b9a455f8e78b7e480879c26e9511276478c993925a75693a4649733704.jpg)

When a collision is detected, the USART automatically follows this sequence:

The current transfer is aborted.

z The transmit buffer is flushed.

z The transmitter is disabled (CTRLB.TXEN=0).

This commences immediately and is complete after synchronization time. The CTRLB Synchronization Busy bit (SYNCBUSY.CTRLB) will be set until this is complete.

z This results in the TxD pin being tri-stated.

z The Collision Detected bit (STATUS.COLL) is set along with the Error interrupt flag (INTFLAG.ERROR).

7 Since the transmit buffer no longer contains data, the Transmit Complete interrupt flag (INTFLAG.TXC) is set.

After a collision, software must manually enable the transmitter before continuing. Software must ensure CTRLB Synchronization Busy bit (SYNCBUSY.CTRLB) is not asserted before re-enabling the transmitter.

## 25.6.3.6 Loop-back Mode

By configuring the Receive Data Pinout (CTRLA.RXPO) and Transmit Data Pinout (CTRLA.TXPO) to use the same data pins for transmit and receive, loop-back is achieved. The loop-back is through the pad, so the signal is also available externally.

## 25.6.3.7 Start-of-Frame Detection

The USART start-of-frame detector can wake up the CPU when it detects a start bit. In standby sleep mode, the internal fast startup oscillator must be selected as the GCLK\_SERCOMx\_CORE source.

When a 1-to-0 transition is detected on RxD, the 8MHz Internal Oscillator is powered up and the USART clock is enabled. After startup, the rest of the data frame can be received, provided that the baud rate is slow enough in relation to the fast startup internal oscillator start-up time. Refer to “Electrical Characteristics” on page 858 for details. The start-up time of this oscillator varies with supply voltage and temperature.

The USART start-of-frame detection works both in asynchronous and synchronous modes. It is enabled by writing a one to the Start of Frame Detection Enable bit in the Control B register (CTRLB.SFDE). If the Receive Start Interrup Enable bit in the Interrupt Enable Set register (INTENSET.RXS) is set, the Receive Start interrupt is generated immediately when a start is detected. When using start-of-frame detection without the Receive Start interrupt, start detection will force the 8MHz Internal Oscillator and USART clock active while the frame is being received, but the CPU will not wakeup until the Receive Complete interrupt is generated, if enabled.

## 25.6.3.8 Sample Adjustment

In asynchronous mode (CTRLA.CMODE=0), three samples in the middle are used to determine the value based on majority voting. The three samples used for voting can be selected using the Sample Adjustment bit field in Control A register (CTRLA.SAMPA). When CTRLA.SAMPA is set to zero, samples 7-8-9 are used for 16x over sampling and samples 3-4-5 are used for 8x over sampling.

## 25.6.4 DMA, Interrupts and Events

Table 25-3. Module Request for SERCOM USART

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Data Register Empty</td><td>x</td><td></td><td></td><td>x</td><td>When data is written</td></tr><tr><td>Transmit Complete</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Receive Complete</td><td>x</td><td></td><td></td><td>x</td><td>When data is read</td></tr><tr><td>Receive Start</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Clear to Send Input Change</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Receive Break</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Error</td><td>x</td><td></td><td></td><td></td><td></td></tr></table>

## 25.6.4.1 DMA Operation

The USART generates the following DMA requests.

z Data received (RX): The request is set when data is available in the receive FIFO. The request is cleared when DATA is read.

Data transmit (TX): The request is set when the transmit buffer (TX DATA) is empty. The request is cleared when DATA is written.

## 25.6.4.2 Interrupts

The USART has the following interrupt sources:

Error

Received Break

z Clear to Send Input Change

Receive Start

● Receive Complete

z Transmit Complete

Data Register Empty

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the USART is reset. See the register description for details on how to clear interrupt flags.

The USART has one common interrupt request line for all the interrupt sources. The user must read INTFLAG to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 25.6.4.3 Events

Not applicable.

## 25.6.5 Sleep Mode Operation

When using internal clocking, writing the Run In Standby bit in the Control A register (CTRLA.RUNSTDBY) to one will allow GCLK\_SERCOMx\_CORE to be enabled in all sleep modes. Any interrupt can wake up the device.

When using external clocking, writing a one to CTRLA.RUNSTDBY will allow the Receive Start or Receive Complete interrupt.to wake up the device

If CTRLA.RUNSTDBY is zero, the internal clock will be disabled when any ongoing transfer is finished. A Receive Start or Transfer Complete interrupt can wake up the device. When using external clocking, this will be disconnected when any ongoing transfer is finished, and all reception will be dropped.

## 25.6.6 Synchronization

Due to the asynchronicity between CLK\_SERCOMx\_APB and GCLK\_SERCOMx\_CORE, some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

● No synchronization

When executing an operation that requires synchronization, the corresponding Synchronization Busy bit in the Synchronization Busy register (SYNCBUSY) will be set immediately, and cleared when synchronization is complete. If an operation that requires synchronization is executed while the corresponding SYNCBUSY bit is one, a peripheral bus error is generated.

The following bits need synchronization when written:

z Software Reset bit in the Control A register (CTRLA.SWRST). SYNCBUSY.SWRST is set to one while synchronization is in progress.

Enable bit in the Control A register (CTRLA.ENABLE). SYNCBUSY.ENABLE is set to one while synchronization is in progress.

z Receiver Enable bit in the Control B register (CTRLB.RXEN). SYNCBUSY.CTRLB is set to one while synchronization is in progress.

z Transmitter Enable bit in the Control B register (CTRLB.TXEN). SYNCBUSY.CTRLB is set to one while synchronization is in progress.

Synchronization is denoted by the Write-Synchronized property in the register description.

## 25.7 Register Summary

Table 25-4. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">CTRLA</td><td>7:0</td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td colspan="3">SAMPR[2:0]</td><td></td><td></td><td></td><td></td><td>IBON</td></tr><tr><td>0x02</td><td>23:16</td><td colspan="2">SAMPA[1:0]</td><td colspan="2">RXPO[1:0]</td><td></td><td></td><td colspan="2">TXPO[1:0]</td></tr><tr><td>0x03</td><td>31:24</td><td></td><td>DORD</td><td>CPOL</td><td>CMODE</td><td colspan="4">FORM[3:0]</td></tr><tr><td>0x04</td><td rowspan="4">CTRLB</td><td>7:0</td><td></td><td>SBMODE</td><td></td><td></td><td></td><td colspan="3">CHSIZE[2:0]</td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td>PMODE</td><td></td><td></td><td>ENC</td><td>SFDE</td><td>COLDEN</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>RXEN</td><td>TXEN</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td rowspan="4">CTRLB</td><td>7:0</td><td></td><td>SBMODE</td><td></td><td></td><td></td><td colspan="3">CHSIZE[2:0]</td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td>PMODE</td><td></td><td></td><td>ENC</td><td></td><td>COLDEN</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>RXEN</td><td>TXEN</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td rowspan="2">BAUD</td><td>7:0</td><td colspan="8">BAUD[7:0]</td></tr><tr><td>0x0D</td><td>15:8</td><td colspan="3">FP[2:0]/BAUD[15:13]</td><td colspan="5">BAUD[12:8]</td></tr><tr><td>0x0E</td><td>RXPL</td><td>7:0</td><td colspan="8">RXPL[7:0]</td></tr><tr><td>0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x11</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>INTENCLR</td><td>7:0</td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td>RXS</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x14</td><td>INTENCLR</td><td>7:0</td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td></td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>INTENSET</td><td>7:0</td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td>RXS</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x16</td><td>INTENSET</td><td>7:0</td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td></td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td>INTFLAG</td><td>7:0</td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td>RXS</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x18</td><td>INTFLAG</td><td>7:0</td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td></td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x19</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1A</td><td rowspan="2">STATUS</td><td>7:0</td><td></td><td></td><td>COLL</td><td>ISF</td><td>CTS</td><td>BUFOVF</td><td>FERR</td><td>PERR</td></tr><tr><td>0x1B</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td rowspan="4">SYNCBUSY</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>CTRLB</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x1D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x21</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x25</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x26</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x27</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x28</td><td rowspan="2">DATA</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DATA[8]</td></tr><tr><td>0x2A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2C</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2D</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x30</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGSTOP</td></tr></table>

## 25.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 440 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Synchronized property in each individual register description. Refer to “Synchronization” on page 451 for details.

Some registers are enable-protected, meaning they can only be written when the USART is disabled. Enableprotection is denoted by the Enable-Protected property in each individual register description.

## 25.8.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00000000

Property: Enable-Protected, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td>DORD</td><td>CPOL</td><td>CMODE</td><td colspan="4">FORM[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="2">SAMPA[1:0]</td><td colspan="2">RXPO[1:0]</td><td></td><td></td><td colspan="2">TXPO[1:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="3">SAMPR[2:0]</td><td></td><td></td><td></td><td></td><td>IBON</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 31 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 30 – DORD: Data Order

This bit indicates the data order when a character is shifted out from the Data register.

0: MSB is transmitted first.

1: LSB is transmitted first.

This bit is not synchronized.

## ● Bit 29 – CPOL: Clock Polarity

This bit indicates the relationship between data output change and data input sampling in synchronous mode. This bit is not synchronized.

Table 25-5. Clock Polarity

<table><tr><td>CPOL</td><td>TxD Change</td><td>RxD Sample</td></tr><tr><td>0x0</td><td>Rising XCK edge</td><td>Falling XCK edge</td></tr><tr><td>0x1</td><td>Falling XCK edge</td><td>Rising XCK edge</td></tr></table>

## z Bit 28 – CMODE: Communication Mode

This bit indicates asynchronous or synchronous communication.

0: Asynchronous communication.

1: Synchronous communication.

This bit is not synchronized.

z Bits 27:24 – FORM[3:0]: Frame Format These bits define the frame format. These bits are not synchronized.

Table 25-6. Frame Format

<table><tr><td>FORM[3:0]</td><td>Description</td></tr><tr><td>0x0</td><td>USART frame</td></tr><tr><td>0x1</td><td>USART frame with parity</td></tr><tr><td>0x2-0x3</td><td>Reserved</td></tr><tr><td>0x4</td><td>Auto-baud -- break detection and auto-baud.</td></tr><tr><td>0x5</td><td>Auto-baud -- break detection and auto-baud with parity</td></tr><tr><td>0x6-0xF</td><td>Reserved</td></tr></table>

z Bits 23:22 – SAMPA[1:0]: Sample Adjustment These bits define the sample adjustment. These bits are not synchronized.

Table 25-7. Sample Adjustment

<table><tr><td>SAMPA[1:0]</td><td>16x Over-sampling (CTRLA.SAMPR=0 or 1)</td><td>8x Over-sampling (CTRLA.SAMPR=2 or 3)</td></tr><tr><td>0x0</td><td>7-8-9</td><td>3-4-5</td></tr><tr><td>0x1</td><td>9-10-11</td><td>4-5-6</td></tr><tr><td>0x2</td><td>11-12-13</td><td>5-6-7</td></tr><tr><td>0x3</td><td>13-14-15</td><td>6-7-8</td></tr></table>

z Bits 21:20 – RXPO[1:0]: Receive Data Pinout These bits define the receive data (RxD) pin configuration. These bits are not synchronized.

Table 25-8. Receive Data Pinout

<table><tr><td>RXPO[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>PAD[0]</td><td>SERCOM PAD[0] is used for data reception</td></tr><tr><td>0x1</td><td>PAD[1]</td><td>SERCOM PAD[1] is used for data reception</td></tr><tr><td>0x2</td><td>PAD[2]</td><td>SERCOM PAD[2] is used for data reception</td></tr><tr><td>0x3</td><td>PAD[3]</td><td>SERCOM PAD[3] is used for data reception</td></tr></table>

## z Bits 19:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bit 17:16 – TXPO[1:0]: Transmit Data Pinout These bits define the transmit data (TxD) and XCK pin configurations. This bit is not synchronized.

Table 25-9. Transmit Data Pinout

<table><tr><td>TXPO</td><td>TxD Pin Location</td><td>XCK Pin Location (When Applicable)</td><td>RTS</td><td>CTS</td></tr><tr><td>0x0</td><td>SERCOM PAD[0]</td><td>SERCOM PAD[1]</td><td>N/A</td><td>N/A</td></tr><tr><td>0x1</td><td>SERCOM PAD[2]</td><td>SERCOM PAD[3]</td><td>N/A</td><td>N/A</td></tr><tr><td>0x2</td><td>SERCOM PAD[0]</td><td>N/A</td><td>SERCOM PAD[2]</td><td>SERCOM PAD[3]</td></tr><tr><td>0x3</td><td colspan="4">Reserved</td></tr></table>

z Bits 15:13 – SAMPR[2:0]: Sample Rate These bits define the sample rate. These bits are not synchronized.

Table 25-10. Sample Rate

<table><tr><td>SAMPR[2:0]</td><td>Description</td></tr><tr><td>0x0</td><td>16x over-sampling using arithmetic baud rate generation.</td></tr><tr><td>0x1</td><td>16x over-sampling using fractional baud rate generation.</td></tr><tr><td>0x2</td><td>8x over-sampling using arithmetic baud rate generation.</td></tr><tr><td>0x3</td><td>8x over-sampling using fractional baud rate generation.</td></tr><tr><td>0x4</td><td>3x over-sampling using arithmetic baud rate generation.</td></tr><tr><td>0x5-0x7</td><td>Reserved</td></tr></table>

## Bits 12:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 8 – IBON: Immediate Buffer Overflow Notification

This bit controls when the buffer overflow status bit (STATUS.BUFOVF) is asserted when a buffer overflow occurs.

0: STATUS.BUFOVF is asserted when it occurs in the data stream.

1: STATUS.BUFOVF is asserted immediately upon buffer overflow.

## z Bit 7 – RUNSTDBY: Run In Standby

This bit defines the functionality in standby sleep mode.

This bit is not synchronized.

## Table 25-11. Run In Standby

<table><tr><td>RUNSTDBY</td><td>External Clock</td><td>Internal Clock</td></tr><tr><td>0x0</td><td>External clock is disconnected when ongoing transfer is finished. All reception is dropped.</td><td>Generic clock is disabled when ongoing transfer is finished. The device can wake up on Receive Start or Transfer Complete interrupt.</td></tr><tr><td>0x1</td><td>Wake on Receive Start or Receive Complete interrupt.</td><td>Generic clock is enabled in all sleep modes. Any interrupt can wake up the device.</td></tr></table>

## Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 4:2 – MODE: Operating Mode

These bits must be written to 0x0 or 0x1 to select the USART serial communication interface of the SERCOM. 0x0: USART with external clock.

0x1: USART with internal clock.

These bits are not synchronized.

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization, there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRLA.ENABLE will read back immediately and the Enable Synchronization Busy bit in the Synchronization Busy register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE is cleared when the operation is complete.

This bit is not enable-protected.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the SERCOM, except DBGCTRL, to their initial state, and the SERCOM will be disabled.

Writing a one to CTRLA.SWRST will always take precedence, meaning that all other writes in the same writeoperation will be discarded. Any register write access during the ongoing reset will result in an APB error. Reading any register will return the reset value of the register.

Due to synchronization, there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and SYNCBUSY.SWRST will both be cleared when the reset is complete.

This bit is not enable-protected.

## 25.8.2 Control B

Name: CTRLB

Offset: 0x04

Reset: 0x00000000

Property: Enable-Protected, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>RXEN</td><td>TXEN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td>PMODE</td><td></td><td></td><td>ENC</td><td>SFDE</td><td>COLDEN</td></tr><tr><td></td><td></td><td></td><td>PMODE</td><td></td><td></td><td>ENC</td><td></td><td>COLDEN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>SBMODE</td><td></td><td></td><td></td><td colspan="3">CHSIZE[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 17 – RXEN: Receiver Enable

0: The receiver is disabled or being enabled.

1: The receiver is enabled or will be enabled when the USART is enabled.

Writing a zero to this bit will disable the USART receiver. Disabling the receiver will flush the receive buffer and clear the FERR, PERR and BUFOVF bits in the STATUS register.

Writing a one to CTRLB.RXEN when the USART is disabled will set CTRLB.RXEN immediately. When the USART is enabled, CTRLB.RXEN will be cleared, and SYNCBUSY.CTRLB will be set and remain set until the receiver is enabled. When the receiver is enabled, CTRLB.RXEN will read back as one.

Writing a one to CTRLB.RXEN when the USART is enabled will set SYNCBUSY.CTRLB, which will remain set until the receiver is enabled, and CTRLB.RXEN will read back as one.

This bit is not enable-protected.

## z Bit 16 – TXEN: Transmitter Enable

0: The transmitter is disabled or being enabled.

1: The transmitter is enabled or will be enabled when the USART is enabled.

Writing a zero to this bit will disable the USART transmitter. Disabling the transmitter will not become effective until ongoing and pending transmissions are completed.

Writing a one to CTRLB.TXEN when the USART is disabled will set CTRLB.TXEN immediately. When the USART is enabled, CTRLB.TXEN will be cleared, and SYNCBUSY.CTRLB will be set and remain set until the transmitter is enabled. When the transmitter is enabled, CTRLB.TXEN will read back as one.

Writing a one to CTRLB.TXEN when the USART is enabled will set SYNCBUSY.CTRLB, which will remain set until the receiver is enabled, and CTRLB.TXEN will read back as one.

This bit is not enable-protected.

## z Bits 15:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 13 – PMODE: Parity Mode

This bit selects the type of parity used when parity is enabled (CTRLA.FORM is one). The transmitter will auto matically generate and send the parity of the transmitted data bits within each frame. The receiver will generate a parity value for the incoming data and parity bit, compare it to the parity mode and, if a mismatch is detected, STATUS.PERR will be set.

0: Even parity.

1: Odd parity.

This bit is not synchronized.

## z Bits 12:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 10 – ENC: Encoding Format

This bit selects the data encoding format.

0: Data is not encoded.

1: Data is IrDA encoded.

This bit is not synchronized.

## ● Bit 9 – SFDE: Start of Frame Detection Enable

This bit controls whether the start-of-frame detector will wake up the device when a start bit is detected on the RxD line, according to the table below.

This bit is not synchronized.

<table><tr><td>SFDE</td><td>INTENSET.RXS</td><td>INTENSET.RXC</td><td>Description</td></tr><tr><td>0</td><td>X</td><td>X</td><td>Start-of-frame detection disabled.</td></tr><tr><td>1</td><td>0</td><td>0</td><td>Reserved</td></tr><tr><td>1</td><td>0</td><td>1</td><td>Start-of-frame detection enabled. RXC wakes up the device from all sleep modes.</td></tr><tr><td>1</td><td>1</td><td>0</td><td>Start-of-frame detection enabled. RXS wakes up the device from all sleep modes.</td></tr><tr><td>1</td><td>1</td><td>1</td><td>Start-of-frame detection enabled. Both RXC and RXS wake up the device from all sleep modes.</td></tr></table>

## Bit 9 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 8 -- COLDEN: Collision Detection Enable

This bit enables collision detection.

0: Collision detection is not enabled.

1: Collision detection is enabled.

This bit is not synchronized.

## Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 6 – SBMODE: Stop Bit Mode

This bit selects the number of stop bits transmitted.

0: One stop bit.

1: Two stop bits.

This bit is not synchronized.

## z Bits 5:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 2:0 – CHSIZE[2:0]: Character Size

These bits select the number of bits in a character.

These bits are not synchronized.

Table 25-12. Character Size

<table><tr><td>CHSIZE[2:0]</td><td>Description</td></tr><tr><td>0x0</td><td>8 bits</td></tr><tr><td>0x1</td><td>9 bits</td></tr><tr><td>0x2-0x4</td><td>Reserved</td></tr><tr><td>0x5</td><td>5 bits</td></tr><tr><td>0x6</td><td>6 bits</td></tr><tr><td>0x7</td><td>7 bits</td></tr></table>

## 25.8.3 Baud

Name: BAUD

Offset: 0x0C

Reset: 0x0000

Property: Enable-Protected, Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="3">FP[2:0]/BAUD[15:13]</td><td colspan="5">BAUD[12:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">BAUD[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Arithmetic Baud Rate Generation (CTRLA.SAMPR[0]=0)

Bits 15:0 – BAUD[15:0]: Baud Value

These bits control the clock generation, as described in the SERCOM Baud Rate section.

Fractional Baud Rate Generation (CTRLA.SAMPR[0]=1)

z Bits 15:13 – FP[2:0]: Fractional Part

These bits control the clock generation, as described in the SERCOM Baud Rate section.

Bits 15:0 – BAUD[12:0]: Baud Value

These bits control the clock generation, as described in the SERCOM Baud Rate section.

## 25.8.4 Receive Pulse Length Register

Name: RXPL

Offset: 0x0E

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">RXPL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bits 7:0 – RXPL[7:0]: Receive Pulse Length

When the encoding format is set to IrDA (CTRLB.ENC=1), these bits control the minimum pulse length that is required for a pulse to be accepted by the IrDA receiver with regards to the serial engine clock period.

$$
P U L S E \geq (R X P L + 1) \times S E _ {p e r}
$$

## 25.8.5 Interrupt Enable Clear

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

Name: INTENCLR

Offset: 0x14

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td>RXS</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td></td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td></td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bit 7– ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Error Interrupt Enable bit, which disables the Error interrupt.

## z Bit 6 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 5 – RXBRK: Receive Break Interrupt Enable

0: Receive Break interrupt is disabled.

1: Receive Break interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Receive Break Interrupt Enable bit, which disables the Receive Break interrupt.

## z Bit 4 – CTSIC: Clear to Send Input Change Interrupt Enable

0: Clear To Send Input Change interrupt is disabled.

1: Clear To Send Input Change interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Clear To Send Input Change Interrupt Enable bit, which disables the Clear To Send Input Change interrupt.

## z Bit 3 – RXS: Receive Start Interrupt Enable

0: Receive Start interrupt is disabled.

1: Receive Start interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Receive Start Interrupt Enable bit, which disables the Receive Start interrupt.

## Bits 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 2 – RXC: Receive Complete Interrupt Enable

0: Receive Complete interrupt is disabled.

1: Receive Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Receive Complete Interrupt Enable bit, which disables the Receive Complete interrupt.

## z Bit 1 – TXC: Transmit Complete Interrupt Enable

0: Transmit Complete interrupt is disabled.

1: Transmit Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transmit Complete Interrupt Enable bit, which disables the Receive Complete interrupt.

## Bit 0 – DRE: Data Register Empty Interrupt Enable

0: Data Register Empty interrupt is disabled.

1: Data Register Empty interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Data Register Empty Interrupt Enable bit, which disables the Data Register Empty interrupt.

## 25.8.6 Interrupt Enable Set

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR) .

Name: INTENSET

Offset: 0x16

Reset: 0x00

Property: Write-Protected

<table><tr><td rowspan="3">Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td>RXS</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td></td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7 – ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Error Interrupt Enable bit, which enables the Error interrupt.

## z Bits 6 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 5– RXBRK: Receive Break Interrupt Enable

0: Receive Break interrupt is disabled.

1: Receive Break interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Receive Break Interrupt Enable bit, which enables the Receive Break interrupt.

## z Bit 4 – CTSIC: Clear to Send Input Change Interrupt Enable

0: Clear To Send Input Change interrupt is disabled.

1: Clear To Send Input Change interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Clear To Send Input Change Interrupt Enable bit, which enables the Clear To Send Input Change interrupt.

## Bit 3 – RXS: Receive Start Interrupt Enable

0: Receive Start interrupt is disabled.

1: Receive Start interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Receive Start Interrupt Enable bit, which enables the Receive Start interrupt.

## z Bits 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 2 – RXC: Receive Complete Interrupt Enable

0: Receive Complete interrupt is disabled.

1: Receive Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Receive Complete Interrupt Enable bit, which enables the Receive Complete interrupt.

## z Bit 1– TXC: Transmit Complete Interrupt Enable

0: Transmit Complete interrupt is disabled.

1: Transmit Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Transmit Complete Interrupt Enable bit, which enables the Transmit Complete interrupt.

## Bit 0 – DRE: Data Register Empty Interrupt Enable

0: Data Register Empty interrupt is disabled.

1: Data Register Empty interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Data Register Empty Interrupt Enable bit, which enables the Data Register Empty interrupt.

## 25.8.7 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x18

Reset: 0x00

Property:

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td>RXS</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td></td><td>ERROR</td><td></td><td>RXBRK</td><td>CTSIC</td><td></td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7– ERROR: Error

This flag is cleared by writing a one to it.

This bit is set when any error is detected. Errors that will set this flag have corresponding status flags in the STATUS register. Errors that will set this flag are COLL, ISF, BUFOVF, FERR, and PERR.Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## ● Bits 6 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bit 5 – RXBRK: Receive Break

This flag is cleared by writing a one to it.

This flag is set when auto-baud is enabled (CTRLA.FORM) and a break character is received.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## z Bit 4 – CTSIC: Clear to Send Input Change

This flag is cleared by writing a one to it.

This flag is set when a change is detected on the CTS pin.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## z Bit 3 – RXS: Receive Start

This flag is cleared by writing a one to it.

This flag is set when a start condition is detected on the RxD line and start-of-frame detection is enabled (CTRLB.SFDE is one).

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Receive Start interrupt flag.

## ● Bits 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 2 – RXC: Receive Complete

This flag is cleared by reading the Data register (DATA) or by disabling the receiver.

This flag is set when there are unread data in DATA.

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

## z Bit 1 – TXC: Transmit Complete

This flag is cleared by writing a one to it or by writing new data to DATA.

This flag is set when the entire frame in the transmit shift register has been shifted out and there are no new data in DATA.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## Bit 0 – DRE: Data Register Empty

This flag is cleared by writing new data to DATA.

This flag is set when DATA is empty and ready to be written.

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

## 25.8.8 Status

Name: STATUS

Offset: 0x1A

Reset: 0x0000

Property:

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>COLL</td><td>ISF</td><td>CTS</td><td>BUFOVF</td><td>FERR</td><td>PERR</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 5 – COLL: Collision Detected

This bit is cleared by writing a one to the bit or by disabling the receiver.

This bit is set when collision detection is enabled (CTRLB.COLDEN) and a collision is detected.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

## Bit 4 – ISF: Inconsistent Sync Field

This bit is cleared by writing a one to the bit or by disabling the receiver.

This bit is set when the frame format is set to auto-baud (CTRLA.FORM) and a sync field not equal to 0x55 is received.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

## ● Bit 3 – CTS: Clear to Send

This bit indicates the current level of the CTS pin when flow control is enabled (CTRLA.TXPO).

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

## Bit 2 – BUFOVF: Buffer Overflow

Reading this bit before reading the Data register will indicate the error status of the next character to be read. This bit is cleared by writing a one to the bit or by disabling the receiver.

This bit is set when a buffer overflow condition is detected. A buffer overflow occurs when the receive buffer is full, there is a new character waiting in the receive shift register and a new start bit is detected.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

## ● Bit 1 – FERR: Frame Error

Reading this bit before reading the Data register will indicate the error status of the next character to be read.

This bit is cleared by writing a one to the bit or by disabling the receiver.

This bit is set if the received character had a frame error, i.e., when the first stop bit is zero.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

## ● Bit 0 – PERR: Parity Error

Reading this bit before reading the Data register will indicate the error status of the next character to be read. This bit is cleared by writing a one to the bit or by disabling the receiver.

This bit is set if parity checking is enabled (CTRLA.FORM is 0x1 or 0x5) and a parity error is detected.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

## 25.8.9 Synchronization Busy

Name: SYNCBUSY

Offset: 0x1C

Reset: 0x00000000

Property:

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>CTRLB</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2– CTRLB: CTRLB Synchronization Busy

Writing CTRLB when the SERCOM is enabled requires synchronization. When written, the SYNC-BUSY.CTRLB bit will be set until synchronization is complete. If CTRLB is written while SYNCBUSY.CTRLB is asserted, an APB error will be generated.

0: CTRLB synchronization is not busy.

1: CTRLB synchronization is busy.

## z Bit 1 – ENABLE: SERCOM Enable Synchronization Busy

Enabling and disabling the SERCOM (CTRLA.ENABLE) requires synchronization. When written, the SYNC-BUSY.ENABLE bit will be set until synchronization is complete.

Writes to any register (except for CTRLA.SWRST) while enable synchronization is on-going will be discarded and an APB error will be generated.

0: Enable synchronization is not busy.

1: Enable synchronization is busy.

## z Bit 0 – SWRST: Software Reset Synchronization Busy

Resetting the SERCOM (CTRLA.SWRST) requires synchronization. When written, the SYNCBUSY.SWRST bit will be set until synchronization is complete.

Writes to any register while synchronization is on-going will be discarded and an APB error will be generated.

0: SWRST synchronization is not busy.

1: SWRST synchronization is busy.

## 25.8.10 Data

Name: DATA

Offset: 0x28

Reset: 0x0000

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DATA[8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read

## ● Bits 8:0 – DATA[8:0]: Data

Reading these bits will return the contents of the Receive Data register. The register should be read only when the Receive Complete Interrupt Flag bit in the Interrupt Flag Status and Clear register (INTFLAG.RXC) is set. The status bits in STATUS should be read before reading the DATA value in order to get any corresponding error.

Writing these bits will write the Transmit Data register. This register should be written only when the Data Register Empty Interrupt Flag bit in the Interrupt Flag Status and Clear register (INTFLAG.DRE) is set.

## 25.8.11 Debug Control

Name: DBGCTRL

Offset: 0x30

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGSTOP</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 0 – DBGSTOP: Debug Stop Mode

This bit controls the baud-rate generator functionality when the CPU is halted by an external debugger.

0: The baud-rate generator continues normal operation when the CPU is halted by an external debugger.

1: The baud-rate generator is halted when the CPU is halted by an external debugger.

# 26. SERCOM SPI – SERCOM Serial Peripheral Interface

## 26.1 Overview

The serial peripheral interface (SPI) is one of the available modes in the Serial Communication Interface (SERCOM) Refer to “SERCOM – Serial Communication Interface” on page 430 for details.

The SPI uses the SERCOM transmitter and receiver configured as shown in “Full-Duplex SPI Master Slave Interconnection” on page 476. Each side, master and slave, depicts a separate SPI containing a shift register, a transmit buffer and two receive buffers. In addition, the SPI master uses the SERCOM baud-rate generator, while the SPI slave can use the SERCOM address match logic. Fields shown in capital letters are synchronous to CLK\_SERCOMx\_APB and accessible by the CPU, while fields with lowercase letters are synchronous to the SCK clock.

## 26.2 Features

z Full-duplex, four-wire interface (MISO, MOSI, SCK, SS)

z Single-buffered transmitter, double-buffered receiver

z Supports all four SPI modes of operation

z Single data direction operation allows alternate function on MISO or MOSI pin

z Selectable LSB- or MSB-first data transfer

z Can be used with DMA

z Master operation:

z Serial clock speed up to 12MHz

z 8-bit clock generator

z Hardware controlled SS

z Slave operation:

z Serial clock speed up to the system clock

z Optional 8-bit address match operation

z Operation in all sleep modes

z Wake on SS transition

## 26.3 Block Diagram

Figure 26-1. Full-Duplex SPI Master Slave Interconnection

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_b2209d017317c226752960e9d020ee225fe5b5b4f51a4b68020b38172e421a19.jpg)

26.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>PAD[3:0]</td><td>Digital I/O</td><td>General SERCOM pins</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped to one of several pins.

## 26.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 26.5.1 I/O Lines

Using the SERCOM’s I/O lines requires the I/O pins to be configured using port configuration (PORT). Refer to “PORT” on page 378 for details.

When the SERCOM is configured for SPI operation, the pins should be configured according to Table 26-1. If the receiver is disabled, the data input pin can be used for other purposes. In master mode the slave select line (SS) is hardware controlled when Master Slave Select Enable (CTRLB.MSSEN) is set to one.

Table 26-1. SPI Pin Configuration

<table><tr><td>Pin</td><td>Master SPI</td><td>Slave SPI</td></tr><tr><td>MOSI</td><td>Output</td><td>Input</td></tr><tr><td>MISO</td><td>Input</td><td>Output</td></tr><tr><td>SCK</td><td>Output</td><td>Input</td></tr><tr><td> $\overline{SS}$ </td><td>Output (CTRLB.MSSEN=1)</td><td>Input</td></tr></table>

The combined configuration of PORT and the Data In/Data Out and Data Out Pinout bit groups in Control A register will define the physical position of the SPI signals in Table 26-1.

## 26.5.2 Power Management

The SPI can continue to operate in any sleep mode. The SPI interrupts can be used to wake up the device from sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 26.5.3 Clocks

The SERCOM bus clock (CLK\_SERCOMx\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_SERCOMx\_APB can be found in the Peripheral Clock Masking section in the “PM – Power Manager” on page 110.

A generic clock (GCLK\_SERCOMx\_CORE) is required to clock the SPI. This clock must be configured and enabled in the Generic Clock Controller before using the SPI. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the bus clock (CLK\_SERCOMx\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 486 for further details.

## 26.5.4 DMA

The DMA request lines are connected to the DMA controller (DMAC). Using the SERCOM DMA requests, requires the DMA controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details.

## 26.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the SPI, interrupts requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 26.5.6 Events

Not applicable.

## 26.5.7 Debug Operation

When the CPU is halted in debug mode, the SPI continues normal operation. If the SPI is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging. The SPI can be forced to halt operation during debugging. Refer to the Debug Control (DBGCTRL) register for details.

## 26.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

z Interrupt Flag Clear and Status register (INTFLAG)

z Status register (STATUS)

z Data register (DATA)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 26.5.9 Analog Connections

Not applicable.

## 26.6 Functional Description

## 26.6.1 Principle of Operation

The SPI is a high-speed synchronous data transfer interface. It allows fast communication between the device and peripheral devices.

The SPI can operate as master or slave. As master, the SPI initiates and controls all data transactions. The SPI is single buffered for transmitting and double buffered for receiving. When transmitting data, the Data register can be loaded with the next character to be transmitted while the current transmission is in progress. For receiving, this means that the data is transferred to the two-level receive buffer upon reception, and the receiver is ready for a new character.

The SPI transaction format is shown in Figure 26-2, where each transaction can contain one or more characters. The character size is configurable, and can be either 8 or 9 bits.

Table 26-2. SPI Transaction Format  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_711c573dcdc5af7976f237ca7e026f76b3a357f0f77a95888aea21be92d519ae.jpg)

The SPI master must initiate a transaction by pulling low the slave select line (SS) of the desired slave. The master and slave prepare data to be sent in their respective shift registers, and the master generates the serial clock on the SCK line. Data are always shifted from master to slave on the master output, slave input line (MOSI), and from slave to master on the master input, slave output line (MISO). The master signals the end of the transaction by pulling the SS line high.

As each character is shifted out from the master, another character is shifted in from the slave.

## 26.6.2 Basic Operation

## 26.6.2.1 Initialization

The following registers are enable-protected, meaning that they can only be written when the SPI is disabled (CTRL.ENABLE is zero):

z Control A register (CTRLA), except Enable (CTRLA.ENABLE) and Software Reset (CTRLA.SWRST)

z Control B register (CTRLB), except Receiver Enable (CTRLB.RXEN)

Baud register (BAUD)

z Address register (ADDR)

Any writes to these registers when the SPI is enabled or is being enabled (CTRLA.ENABLE is one) will be discarded Writes to these registers while the SPI is being disabled will be completed after the disabling is complete.

Enable-protection is denoted by the Enable-Protection property in the register description.

Before the SPI is enabled, it must be configured, as outlined by the following steps:

z SPI mode in master or slave operation must be selected by writing 0x2 or 0x3 to the Operating Mode bit group in the Control A register (CTRLA.MODE)

Transfer mode must be selected by writing the Clock Polarity bit and the Clock Phase bit in the Control A register (CTRLA.CPOL and CTRLA.CPHA)

z Transaction format must be selected by writing the Frame Format bit group in the Control A register (CTRLA.FORM)

SERCOM pad to use for the receiver must be selected by writing the Data In Pinout bit group in the Control A register (CTRLA.DIPO)

SERCOM pads to use for the transmitter, slave select and serial clock must be selected by writing the Data Out Pinout bit group in the Control A register (CTRLA.DOPO)

z Character size must be selected by writing the Character Size bit group in the Control B register (CTRLB.CHSIZE)

z Data direction must be selected by writing the Data Order bit in the Control A register (CTRLA.DORD)

If the SPI is used in master mode, the Baud register (BAUD) must be written to generate the desired baud rate

If the SPI is used in master mode and Hardware SS control is required, the Master Slave Select Enable bit in CTRLB register (CTRLB.MSSEN) should be set to 1.

z The receiver can be enabled by writing a one to the Receiver Enable bit in the Control B register (CTRLB.RXEN)

## 26.6.2.2 Enabling, Disabling and Resetting

The SPI is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The SPI is disabled by writing a zero to CTRLA.ENABLE.

The SPI is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the SPI, except DBGCTRL, will be reset to their initial state, and the SPI will be disabled. Refer to CTRLA for details.

## 26.6.2.3 Clock Generation

In SPI master operation (CTRLA.MODE is 0x3), the serial clock (SCK) is generated internally using the SERCOM baud-rate generator. When used in SPI mode, the baud-rate generator is set to synchronous mode, and the 8-bit Baud register (BAUD) value is used to generate SCK, clocking the shift register. Refer to “Clock Generation – Baud-Rate Generator” on page 433 for more details.

In SPI slave operation (CTRLA.MODE is 0x2), the clock is provided by an external master on the SCK pin. This clock is used to directly clock the SPI shift register.

## 26.6.2.4 Data Register

The SPI Transmit Data register (TxDATA) and SPI Receive Data register (RxDATA) share the same I/O address, referred to as the SPI Data register (DATA). Writing the DATA register will update the Transmit Data register. Reading the DATA register will return the contents of the Receive Data register.

## 26.6.2.5 SPI Transfer Modes

There are four combinations of SCK phase and polarity with respect to the serial data. The SPI data transfer modes are shown in Table 26-3 and Figure 26-2. SCK phase is selected by the Clock Phase bit in the Control A registe (CTRLA.CPHA). SCK polarity is selected by the Clock Polarity bit in the Control A register (CTRLA.CPOL). Data bits are shifted out and latched in on opposite edges of the SCK signal, ensuring sufficient time for the data signals to stabilize.

Table 26-3. SPI Transfer Modes

<table><tr><td>Mode</td><td>CPOL</td><td>CPHA</td><td>Leading Edge</td><td>Trailing Edge</td></tr><tr><td>0</td><td>0</td><td>0</td><td>Rising, sample</td><td>Falling, setup</td></tr><tr><td>1</td><td>0</td><td>1</td><td>Rising, setup</td><td>Falling, sample</td></tr><tr><td>2</td><td>1</td><td>0</td><td>Falling, sample</td><td>Rising, setup</td></tr><tr><td>3</td><td>1</td><td>1</td><td>Falling, setup</td><td>Rising, sample</td></tr></table>

Leading edge is the first clock edge in a clock cycle, while trailing edge is the second clock edge in a clock cycle.

Figure 26-2. SPI Transfer Modes  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_c062977c699b34f39991876ff1e3b9c21a5e3bb65758ed818d880b7fb011250c.jpg)

MSB first (DORD = 0) MSB Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 LSB LSB first (DORD = 1) LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 MSB

## 26.6.2.6 Transferring Data

## Master

When configured as a master (CTRLA.MODE is 0x3), if Master Slave Select Enable (CTRLB.MSSEN) is set to zero the SS line can be located at any general purpose I/O pin, and must be configured as an output. When the SPI is ready for a data transaction, software must pull the SS line low. If Master Slave Enable Select (CTRLB.MSSEN) is set to one, hardware controls the SS line.

When writing a character to the Data register (DATA), the character will be transferred to the shift register when the shift register is empty. Once the contents of TxDATA have been transferred to the shift register, the Data Register Empty flag in the Interrupt Flag Status and Clear register (INTFLAG.DRE) is set, and a new character can be written to DATA.

As each character is shifted out from the master, another character is shifted in from the slave. If the receiver is enabled (CTRLA.RXEN is one), the contents of the shift register will be transferred to the two-level receive buffer. The transfer takes place in the same clock cycle as the last data bit is shifted in, and the Receive Complete Interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.RXC) will be set. The received data can be retrieved by reading DATA.

When the last character has been transmitted and there is no valid data in DATA, the Transmit Complete Interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.TXC) is set. When the transaction is finished, the master must indicate this to the slave by pulling the SS line high. If Master Slave Select Enable (CTRLB.MSSEN) is set to zero, the software must pull the SS line high.

## Slave

When configured as a slave (CTRLA.MODE is 0x2), the SPI interface will remain inactive, with the MISO line tri-stated as long as the SS pin is pulled high. Software may update the contents of DATA at any time, as long as the Data Register Empty flag in the Interrupt Status and Clear register (INTFLAG.DRE) is set.

When $\overline { { \mathsf { S S } } }$ is pulled low and SCK is running, the slave will sample and shift out data according to the transaction mode set. When the contents of TxDATA have been loaded into the shift register, INTFLAG.DRE is set, and new data can be written to DATA. Similar to the master, the slave will receive one character for each character transmitted. On the same clock cycle as the last data bit of a character is received, the character will be transferred into the two-level receive buffer. The received character can be retrieved from DATA when Receive Complete interrupt flag (INTFLAG.RXC) is set.

When the master pulls the $\overline { { \mathsf { S S } } }$ line high, the transaction is done and the Transmit Complete Interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.TXC) is set.

Once DATA is written, it takes up to three SCK clock cycles before the content of DATA is ready to be loaded into the shift register. When the content of DATA is ready to be loaded, this will happen on the next character boundary. As a consequence, the first character transferred in a SPI transaction will not be the content of DATA. This can be avoided by using the preloading feature.

Refer to “Preloading of the Slave Shift Register” on page 483.

When transmitting several characters in one SPI transaction, the data has to be written to DATA while there are at least three SCK clock cycles left in the current character transmission. If this criteria is not met, then the previous character received will be transmitted.

After the DATA register is empty, it takes three CLK\_SERCOM\_APB cycles for INTFLAG.DRE to be set.

## 26.6.2.7 Receiver Error Bit

The SPI receiver has one error bit: the Buffer Overflow bit (BUFOVF), which can be read from the Status register (STATUS). Upon error detection, the bit will be set until it is cleared by writing a one to it. The bit is also automatically cleared when the receiver is disabled.

There are two methods for buffer overflow notification. When the immediate buffer overflow notification bit (CTRLA.IBON) is set, STATUS.BUFOVF is set immediately upon buffer overflow. Software can then empty the receive FIFO by reading RxDATA until the receive complete interrupt flag (INTFLAG.RXC) goes low.

When CTRLA.IBON is zero, the buffer overflow condition travels with data through the receive FIFO. After the received data is read, STATUS.BUFOVF and INTFLAG.ERROR will be set along with INTFLAG.RXC, and RxDATA will be zero.

## 26.6.3 Additional Features

## 26.6.3.1 Address Recognition

When the SPI is configured for slave operation (CTRLA.MODE is 0x2) with address recognition (CTRLA.FORM is 0x2), the SERCOM address recognition logic is enabled. When address recognition is enabled, the first character in a transaction is checked for an address match. If there is a match, then the Receive Complete Interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.RXC) is set, the MISO output is enabled and the transaction is processed. If there is no match, the transaction is ignored.

If the device is in sleep mode, an address match can wake up the device in order to process the transaction. If the address does not match, then the complete transaction is ignored. If a 9-bit frame format is selected, only the lower 8 bits of the shift register are checked against the Address register (ADDR).

Refer to “Address Match and Mask” on page 436 for further details.

## 26.6.3.2 Preloading of the Slave Shift Register

When starting a transaction, the slave will first transmit the contents of the shift register before loading new data from DATA. The first character sent can be either the reset value of the shift register (if this is the first transmission since the last reset) or the last character in the previous transmission. Preloading can be used to preload data to the shift register while SS is high and eliminate sending a dummy character when starting a transaction.

In order to guarantee enough set-up time before the first SCK edge, enough time must be given between SS going low and the first SCK sampling edge, as shown in Figure 26-3.

Preloading is enabled by setting the Slave Data Preload Enable bit in the Control B register (CTRLB.PLOADEN).

Figure 26-3. Timing Using Preloading  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_7c344bb6a9ff0473b890654c1f704830fe3a56afd26ce8b2c474bd7b29ad94f0.jpg)

Only one data character written to DATA will be preloaded into the shift register while the synchronized SS signal (see Figure 26-3) is high. The next character written to DATA before SS is pulled low will be stored in DATA until transfer begins. If the shift register is not preloaded, the current contents of the shift register will be shifted out.

## 26.6.3.3 Master with Several Slaves

Master with multiple slaves in parallel feature is available only when Master Slave Select Enable (CTRLB.MSSEN) is set to zero and hardware SS control is disabled. If the bus consists of several SPI slaves, an SPI master can use general purpose I/O pins to control the SS line to each of the slaves on the bus, as shown in Figure 26-4. In this configuration, the single selected SPI slave will drive the tri-state MISO line.

Figure 26-4. Multiple Slaves in Parallel  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_01ce6ca896229c84ed2a0247d5bec468b540895eed8d00f34d4770e0be6cb800.jpg)

An alternate configuration is shown in Figure 26-5. In this configuration, all n attached slaves are connected in series. A common SS line is provided to all slaves, enabling them simultaneously. The master must shift n characters for a complete transaction. Depending on the Master Slave Select Enable bit (CTRLB.MSSEN), SS line is controlled either by hardware or by user software and normal GPIO

Figure 26-5. Multiple Slaves in Series  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_39a46815841f54f2acf70bcc504424effd7d30b2045115dd4555fdc67ce894eb.jpg)

## 26.6.3.4 Loop-back Mode

By configuring the Data In Pinout (CTRLA.DIPO) and Data Out Pinout (CTRLA.DOPO) to use the same data pins fo transmit and receive, loop-back is achieved. The loop-back is through the pad, so the signal is also available externally.

## 26.6.3.5 Hardware Controlled SS

In master mode, a single $\overline { { \mathsf { S S } } }$ chip select can be controlled by hardware by setting the Master Slave Select Enable (CTRLB.MSSEN) bit to one. In this mode, the $\overline { { \mathsf { S S } } }$ pin is driven low for a minimum of one baud cycle before transmission begins, and stays low for a minimum of one baud cycle after transmission completes. If back-to-back frames are transmitted, the $\dot { \overline { { \mathsf { S S } } } }$ pin will always be driven high for a minimum of one baud cycle between frames.

In Figure 26-6, the time T is between one and two baud cycles depending on the SPI transfer mode.

Figure 26-6. Hardware Controlled SS  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_c9de4092f398fa6fb4ed3bb79086f6b8872de92c6db578695a901ee0d24f5402.jpg)  
T = 1 to 2 baud cycles

When MSSEN is set to zero, the SS pin(s) is/are controlled by user software and normal GPIO.

## 26.6.3.6 Slave Select Low Detection

In slave mode the SPI is capable of waking the CPU when the slave select (SS) goes low. When the Slave Select Low Detect is enabled (CTRLB.SSDE=1), a high to low transition will set the Slave Select Low interrupt flag (INTFLAG.SSL) and the device will wake if applicable.

## 26.6.4 DMA, Interrupts and Events

Table 26-4. Module Request for SERCOM SPI

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Data Register Empty</td><td>x</td><td></td><td></td><td>x</td><td>When data is written</td></tr><tr><td>Transmit Complete</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Receive Complete</td><td>x</td><td></td><td></td><td>x</td><td>When data is read</td></tr><tr><td>Slave Select low</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Error</td><td>x</td><td></td><td></td><td></td><td></td></tr></table>

## 26.6.4.1 DMA Operation

The SPI generates the following DMA requests:

z Data received (RX): The request is set when data is available in the receive FIFO. The request is cleared when DATA is read.

Data transmit (TX): The request is set when the transmit buffer (TX DATA) is empty. The request is cleared when DATA is written.

## 26.6.4.2 Interrupts

The SPI has the following interrupt sources:

Error

z Slave Select Low

● Receive Complete

z Transmit Complete

z Data Register Empty

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the

corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the SPI is reset. See the register description for details on how to clear interrupt flags.

The SPI has one common interrupt request line for all the interrupt sources. The user must read INTFLAG to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details

For details on clearing interrupt flags, refer to INTFLAG.

## 26.6.4.3 Events

Not applicable.

## 26.6.5 Sleep Mode Operation

During master operation, the generic clock will continue to run in idle sleep mode. If the Run In Standby bit in the Control A register (CTRLA.RUNSTDBY) is one, the GCLK\_SERCOM\_CORE will also be enabled in standby sleep mode. Any interrupt can wake up the device.

If CTRLA.RUNSTDBY is zero during master operation, GLK\_SERCOMx\_CORE will be disabled when the ongoing transaction is finished. Any interrupt can wake up the device.

During slave operation, writing a one to CTRLA.RUNSTDBY will allow the Receive Complete interrupt to wake up the device.

If CTRLA.RUNSTDBY is zero during slave operation, all reception will be dropped, including the ongoing transaction.

## 26.6.6 Synchronization

Due to the asynchronicity between CLK\_SERCOMx\_APB and GCLK\_SERCOMx\_CORE, some registers must be synchronized when accessed. A register can require:

Synchronization when written

z Synchronization when read

z Synchronization when written and read

● No synchronization

When executing an operation that requires synchronization, the corresponding Synchronization Busy bit in the Synchronization Busy register (SYNCBUSY) will be set immediately, and cleared when synchronization is complete. If an operation that requires synchronization is executed while the corresponding SYNCBUSY bit is one, a periphera bus error is generated.

The following bits need synchronization when written:

z Software Reset bit in the Control A register (CTRLA.SWRST). SYNCBUSY.SWRST is set to one while synchronization is in progress.

z Enable bit in the Control A register (CTRLA.ENABLE). SYNCBUSY.ENABLE is set to one while synchronization is in progress.

z Receiver Enable bit in the Control B register (CTRLB.RXEN). SYNCBUSY.CTRLB is set to one while synchronization is in progress.

CTRLB.RXEN behaves somewhat differently than described above. Refer to CTRLB for details.

Write-synchronization is denoted by the Write-Synchronized property in the register description.

26.7 Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">CTRLA</td><td>7:0</td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>IBON</td></tr><tr><td>0x02</td><td>23:16</td><td></td><td></td><td colspan="2">DIPO[1:0]</td><td></td><td></td><td colspan="2">DOPO[1:0]</td></tr><tr><td>0x03</td><td>31:24</td><td></td><td>DORD</td><td>CPOL</td><td>CPHA</td><td colspan="4">FORM[3:0]</td></tr><tr><td>0x04</td><td rowspan="4">CTRLB</td><td>7:0</td><td></td><td>PLOADEN</td><td></td><td></td><td></td><td colspan="3">CHSIZE[2:0]</td></tr><tr><td>0x05</td><td>15:8</td><td colspan="2">AMODE[1:0]</td><td>MSSEN</td><td></td><td></td><td></td><td>SSDE</td><td></td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td>RXEN</td><td></td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>BAUD</td><td>7:0</td><td colspan="8">BAUD[7:0]</td></tr><tr><td>0x0D</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x11</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>INTENCLR</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td>SSL</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>INTENSET</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td>SSL</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td>INTFLAG</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td>SSL</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>0x19</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1A</td><td rowspan="2">STATUS</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>BUFOVF</td><td></td><td></td></tr><tr><td>0x1B</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td rowspan="4">SYNCBUSY</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>CTRLB</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x1D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x21</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="8">ADDR[7:0]</td></tr><tr><td>0x25</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x26</td><td>23:16</td><td colspan="8">ADDRMASK[7:0]</td></tr><tr><td>0x27</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x28</td><td rowspan="2">DATA</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DATA[8]</td></tr><tr><td>0x2A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2C</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2D</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x30</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGSTOP</td></tr></table>

## 26.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 478 for details.

Some registers require synchronization when read and/or written. Write-synchronization is denoted by the Write-Synchronized property in each individual register description. Refer to “Synchronization” on page 486 for details.

Some registers are enable-protected, meaning they can only be written when the USART is disabled. Enableprotection is denoted by the Enable-Protected property in each individual register description.

## 26.8.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00000000

Property: Write-Protected, Enable-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td>DORD</td><td>CPOL</td><td>CPHA</td><td colspan="4">FORM[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td colspan="2">DIPO[1:0]</td><td></td><td></td><td colspan="2">DOPO[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>IBON</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 31 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 30 – DORD: Data Order

This bit indicates the data order when a character is shifted out from the Data register.

0: MSB is transferred first.

1: LSB is transferred first.

This bit is not synchronized.

## Bit 29 – CPOL: Clock Polarity

In combination with the Clock Phase bit (CPHA), this bit determines the SPI transfer mode.

0: SCK is low when idle. The leading edge of a clock cycle is a rising edge, while the trailing edge is a falling edge.

1: SCK is high when idle. The leading edge of a clock cycle is a falling edge, while the trailing edge is a rising edge.

This bit is not synchronized.

## z Bit 28 – CPHA: Clock Phase

In combination with the Clock Polarity bit (CPOL), this bit determines the SPI transfer mode.

0: The data is sampled on a leading SCK edge and changed on a trailing SCK edge.

1: The data is sampled on a trailing SCK edge and changed on a leading SCK edge.

This bit is not synchronized.

Table 26-5. SPI Transfer Modes

<table><tr><td>Mode</td><td>CPOL</td><td>CPHA</td><td>Leading Edge</td><td>Trailing Edge</td></tr><tr><td>0x0</td><td>0</td><td>0</td><td>Rising, sample</td><td>Falling, change</td></tr><tr><td>0x1</td><td>0</td><td>1</td><td>Rising, change</td><td>Falling, sample</td></tr><tr><td>0x2</td><td>1</td><td>0</td><td>Falling, sample</td><td>Rising, change</td></tr><tr><td>0x3</td><td>1</td><td>1</td><td>Falling, change</td><td>Rising, sample</td></tr></table>

## z Bits 27:24 – FORM[3:0]: Frame Format

Table 26-6 shows the various frame formats supported by the SPI. When a frame format with address is selected, the first byte received is checked against the ADDR register.

Table 26-6. Frame Format

<table><tr><td>FORM[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>SPI</td><td>SPI frame</td></tr><tr><td>0x1</td><td>-</td><td>Reserved</td></tr><tr><td>0x2</td><td>SPI_ADDR</td><td>SPI frame with address</td></tr><tr><td>0x3-0xF</td><td>-</td><td>Reserved</td></tr></table>

## z Bits 23:22 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 21:20 – DIPO[1:0]: Data In Pinout

These bits define the data in (DI) pad configurations.

In master operation, DI is MISO.

In slave operation, DI is MOSI.

These bits are not synchronized.

Table 26-7. Data In Pinout

<table><tr><td>DIPO[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>PAD[0]</td><td>SERCOM PAD[0] is used as data input</td></tr><tr><td>0x1</td><td>PAD[1]</td><td>SERCOM PAD[1] is used as data input</td></tr><tr><td>0x2</td><td>PAD[2]</td><td>SERCOM PAD[2] is used as data input</td></tr><tr><td>0x3</td><td>PAD[3]</td><td>SERCOM PAD[3] is used as data input</td></tr></table>

## z Bits 19:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 17:16 – DOPO: Data Out Pinout

This bit defines the available pad configurations for data out (DO) and the serial clock (SCK). In slave operation, the slave select line (\_SS) is controlled by DOPO, while in master operation the \_SS line is controlled by the port configuration.

In master operation, DO is MOSI.

In slave operation, DO is MISO.

These bits are not synchronized.

Table 26-8. Data Out Pinout

<table><tr><td>DOPO</td><td>DO</td><td>SCK</td><td>Slave_SS</td><td>Master_SS</td></tr><tr><td>0x0</td><td>PAD[0]</td><td>PAD[1]</td><td>PAD[2]</td><td>System configuration</td></tr><tr><td>0x1</td><td>PAD[2]</td><td>PAD[3]</td><td>PAD[1]</td><td>System configuration</td></tr><tr><td>0x2</td><td>PAD[3]</td><td>PAD[1]</td><td>PAD[2]</td><td>System configuration</td></tr><tr><td>0x3</td><td>PAD[0]</td><td>PAD[3]</td><td>PAD[1]</td><td>System configuration</td></tr></table>

## z Bits 15:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 8 – IBON: Immediate Buffer Overflow Notification

This bit controls when the buffer overflow status bit (STATUS.BUFOVF) is asserted when a buffer overflow occurs.

0: STATUS.BUFOVF is asserted when it occurs in the data stream.

1: STATUS.BUFOVF is asserted immediately upon buffer overflow.

This bit is not synchronized.

## z Bit 7 – RUNSTDBY: Run In Standby

This bit defines the functionality in standby sleep mode.

These bits are not synchronized.

Table 26-9. Run In Standby Configuration

<table><tr><td>RUNSTDBY</td><td>Slave</td><td>Master</td></tr><tr><td>0x0</td><td>Disabled. All reception is dropped, including the ongoing transaction.</td><td>Generic clock is disabled when ongoing transaction is finished. All interrupts can wake up the device.</td></tr><tr><td>0x1</td><td>Wake on Receive Complete interrupt.</td><td>Generic clock is enabled while in sleep modes. All interrupts can wake up the device.</td></tr></table>

## z Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 4:2 – MODE: Operating Mode

These bits must be written to 0x2 or 0x3 to select the SPI serial communication interface of the SERCOM. 0x2: SPI slave operation

0x3: SPI master operation

These bits are not synchronized.

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization, there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately and the Synchronization Enable Busy bit in the Synchronization Busy register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE is cleared when the operation is complete.

This bit is not enable-protected.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the SERCOM, except DBGCTRL, to their initial state, and the SERCOM will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same writeoperation will be discarded. Any register write access during the ongoing reset will result in an APB error. Reading any register will return the reset value of the register.

Due to synchronization, there is a delay from writing CTRLA.SWRST until the reset is complete.

CTRLA.SWRST and SYNCBUSY. SWRST will both be cleared when the reset is complete.

This bit is not enable-protected.

## 26.8.2 Control B

Name: CTRLB

Offset: 0x04

Reset: 0x00000000

Property: Write-Protected, Enable-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>RXEN</td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="2">AMODE[1:0]</td><td>MSSEN</td><td></td><td></td><td></td><td>SSDE</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>PLOADEN</td><td></td><td></td><td></td><td colspan="3">CHSIZE[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:18 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 17 – RXEN: Receiver Enable

0: The receiver is disabled or being enabled.

1: The receiver is enabled or it will be enabled when SPI is enabled.

Writing a zero to this bit will disable the SPI receiver immediately. The receive buffer will be flushed, data from ongoing receptions will be lost and STATUS.BUFOVF will be cleared.

Writing a one to CTRLB.RXEN when the SPI is disabled will set CTRLB.RXEN immediately. When the SPI is enabled, CTRLB.RXEN will be cleared, SYNCBUSY.CTRLB will be set and remain set until the receiver is enabled. When the receiver is enabled CTRLB.RXEN will read back as one.

Writing a one to CTRLB.RXEN when the SPI is enabled will set SYNCBUSY.CTRLB, which will remain set until the receiver is enabled, and CTRLB.RXEN will read back as one.

This bit is not enable-protected.

## ● Bit 16 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 15:14 – AMODE: Address Mode

These bits set the slave addressing mode when the frame format (CTRLA.FORM) with address is used. They are unused in master mode.

## Table 26-10. Address Mode

<table><tr><td>AMODE[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>MASK</td><td>ADDRMASK is used as a mask to the ADDR register</td></tr><tr><td>0x1</td><td>2_ADDRS</td><td>The slave responds to the two unique addresses in ADDR and ADDRMASK</td></tr><tr><td>0x2</td><td>RANGE</td><td>The slave responds to the range of addresses between and including ADDR and ADDRMASK. ADDR is the upper limit</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 13 – MSSEN: Master Slave Select Enable

This bit enables hardware slave select (\_SS) control.

0: Hardware \_SS control is disabled.

1: Hardware \_SS control is enabled.

## z Bits 12:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 9 – SSDE: Slave Select Low Detect Enable

This bit enables wake up when the slave select (\_SS) pin transitions from high to low.

0: \_SS low detector is disabled.

1: \_SS low detector is enabled.

## Bits 8:7 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 6 – PLOADEN: Slave Data Preload Enable

Setting this bit will enable preloading of the slave shift register when there is no transfer in progress. If the \_SS line is high when DATA is written, it will be transferred immediately to the shift register.

## z Bits 5:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

● Bits 2:0 – CHSIZE[2:0]: Character Size

## Table 26-11. Character Size

<table><tr><td>CHSIZE[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>8BIT</td><td>8 bits</td></tr><tr><td>0x1</td><td>9BIT</td><td>9 bits</td></tr><tr><td>0x2-0x7</td><td></td><td>Reserved</td></tr></table>

## 26.8.3 Baud Rate

Name: BAUD

Offset: 0x0C

Reset: 0x00

Property: Write-Protected, Enable-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">BAUD[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:0 – BAUD: Baud Register

These bits control the clock generation, as described in the SERCOM “Clock Generation – Baud-Rate Generator” on page 433.

## 26.8.4 Interrupt Enable Clear

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

Name: INTENCLR

Offset: 0x14

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td>SSL</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7– ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Error Interrupt Enable bit, which disables the Error interrupt.

## z Bits 6:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3– SSL: Slave Select Low Interrupt Enable

0: Slave Select Low interrupt is disabled.

1: Slave Select Low interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Slave Select Low Interrupt Enable bit, which disables the Slave Select Low interrupt.

## Bit 2 – RXC: Receive Complete Interrupt Enable

0: Receive Complete interrupt is disabled.

1: Receive Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Receive Complete Interrupt Enable bit, which disables the Receive Complete interrupt.

## z Bit 1 – TXC: Transmit Complete Interrupt Enable

0: Transmit Complete interrupt is disabled.

1: Transmit Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transmit Complete Interrupt Enable bit, which disable the Transmit Complete interrupt.

## Bit 0 – DRE: Data Register Empty Interrupt Enable

0: Data Register Empty interrupt is disabled.

1: Data Register Empty interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Data Register Empty Interrupt Enable bit, which disables the Data Register Empty interrupt.

## 26.8.5 Interrupt Enable Set

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

Name: INTENSET

Offset: 0x16

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td>SSL</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7 – ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Error Interrupt Enable bit, which enables the Error interrupt.

## z Bits 6:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 3 – SSL: Slave Select Low Interrupt Enable

0: Slave Select Low interrupt is disabled.

1: Slave Select Low interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Slave Select Low Interrupt Enable bit, which enables the Slave Select Low interrupt.

## Bit 2 – RXC: Receive Complete Interrupt Enable

0: Receive Complete interrupt is disabled.

1: Receive Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Receive Complete Interrupt Enable bit, which enables the Receive Complete interrupt.

## z Bit 1 – TXC: Transmit Complete Interrupt Enable

0: Transmit Complete interrupt is disabled.

1: Transmit Complete interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Transmit Complete Interrupt Enable bit, which enables the Transmit Complete interrupt.

## Bit 0 – DRE: Data Register Empty Interrupt Enable

0: Data Register Empty interrupt is disabled.

1: Data Register Empty interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Data Register Empty Interrupt Enable bit, which enables the Data Register Empty interrupt.

## 26.8.6 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x18

Reset: 0x00

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td>SSL</td><td>RXC</td><td>TXC</td><td>DRE</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – ERROR: Error

This flag is cleared by writing a one to it.

This bit is set when any error is detected. Errors that will set this flag have corresponding status flags in the STATUS register. The BUFOVF error will set this interrupt flag.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## z Bits 6:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3 – SSL: Slave Select Low

This flag is cleared by writing a one to it.

This bit is set when a high to low transition is detected on the \_SS pin in slave mode and Slave Select Low Detect (CTRLB.SSDE) is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## Bit 2 – RXC: Receive Complete

This flag is cleared by reading the Data (DATA) register or by disabling the receiver.

This flag is set when there are unread data in the receive buffer. If address matching is enabled, the first data received in a transaction will be an address.

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

## Bit 1 – TXC: Transmit Complete

This flag is cleared by writing a one to it or by writing new data to DATA.

In master mode, this flag is set when the data have been shifted out and there are no new data in DATA.

In slave mode, this flag is set when the \_SS pin is pulled high. If address matching is enabled, this flag is only set if the transaction was initiated with an address match.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## Bit 0 – DRE: Data Register Empty

This flag is cleared by writing new data to DATA.

This flag is set when DATA is empty and ready for new data to transmit.

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

## 26.8.7 Status

Name: STATUS

Offset: 0x1A

Reset: 0x0000

Property: –

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>BUFOVF</td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read

## Bit 2 – BUFOVF: Buffer Overflow

Reading this bit before reading DATA will indicate the error status of the next character to be read.

This bit is cleared by writing a one to the bit or by disabling the receiver.

This bit is set when a buffer overflow condition is detected. An overflow condition occurs if the two-level receive buffer is full when the last bit of the incoming character is shifted into the shift register. All characters shifted into the shift registers before the overflow condition is eliminated by reading DATA will be lost.

When set, the corresponding RxDATA will be 0.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

## z Bits 1:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 26.8.8 Synchronization Busy

Name: SYNCBUSY

Offset: 0x1C

Reset: 0x00000000

Property:

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>CTRLB</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2– CTRLB: CTRLB Synchronization Busy

Writing CTRLB when the SERCOM is enabled requires synchronization. When written, the SYNC-BUSY.CTRLB bit will be set until synchronization is complete. If CTRLB is written while SYNCBUSY.CTRLB is asserted, an APB error will be generated.

0: CTRLB synchronization is not busy.

1: CTRLB synchronization is busy.

## z Bit 1 – ENABLE: SERCOM Enable Synchronization Busy

Enabling and disabling the SERCOM (CTRLA.ENABLE) requires synchronization. When written, the SYNC-BUSY.ENABLE bit will be set until synchronization is complete.

Writes to any register (except for CTRLA.SWRST) while enable synchronization is on-going will be discarded and an APB error will be generated.

0: Enable synchronization is not busy.

1: Enable synchronization is busy.

## z Bit 0 – SWRST: Software Reset Synchronization Busy

Resetting the SERCOM (CTRLA.SWRST) requires synchronization. When written, the SYNCBUSY.SWRST bit will be set until synchronization is complete.

Writes to any register while synchronization is on-going will be discarded and an APB error will be generated.

0: SWRST synchronization is not busy.

1: SWRST synchronization is busy.

## 26.8.9 Address

Name: ADDR

Offset: 0x24

Reset: 0x00000000

Property: Write-Protected, Enable-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td colspan="9">ADDRMASK[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">ADDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 23:16 – ADDRMASK[7:0]: Address Mask

These bits hold the address mask when the transaction format (CTRLA.FORM) with address is used.

## Bits 15:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 7:0 – ADDR[7:0]: Address

These bits hold the address when the transaction format (CTRLA.FORM) with address is used.

## 26.8.10 Data

Name: DATA

Offset: 0x28

Reset: 0x0000

Property: –

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DATA[8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 8:0 – DATA[8:0]: Data

Reading these bits will return the contents of the receive data buffer. The register should be read only when the Receive Complete Interrupt Flag bit in the Interrupt Flag Status and Clear register (INTFLAG.RXC) is set. Writing these bits will write the transmit data buffer. This register should be written only when the Data Register Empty Interrupt Flag bit in the Interrupt Flag Status and Clear register (INTFLAG.DRE) is set.

## 26.8.11 Debug Control

Name: DBGCTRL

Offset: 0x30

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGSTOP</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – DBGSTOP: Debug Stop Mode

This bit controls the functionality when the CPU is halted by an external debugger.

0: The baud-rate generator continues normal operation when the CPU is halted by an external debugger.

1: The baud-rate generator is halted when the CPU is halted by an external debugger.

## 27. SERCOM I<sup>2</sup>C – SERCOM Inter-Integrated Circuit

## 27.1 Overview

The inter-integrated circuit $( | ^ { 2 } \mathsf { C } )$ interface is one of the available modes in the serial communication interface (SERCOM). Refer to “SERCOM – Serial Communication Interface” on page 430 for details.

The I<sup>2</sup>C interface uses the SERCOM transmitter and receiver configured as shown in Figure 27-1. Fields shown in capital letters are registers accessible by the CPU, while lowercase fields are internal to the SERCOM. Each side, master and slave, depicts a separate I<sup>2</sup>C interface containing a shift register, a transmit buffer and a receive buffer. In addition, the I<sup>2</sup>C master uses the SERCOM baud-rate generator, while the I<sup>2</sup>C slave uses the SERCOM address match logic.

## 27.2 Features

z Master or slave operation

z Can be used with DMA

z Philips I<sup>2</sup>C compatible

z SMBus<sup>™</sup> compatible

z PMBus compatible

z 100kHz and 400kHz, 1MHz and 3.4MHz support at low system clock frequencies

z Physical interface includes:

z Slew-rate limited outputs

z Filtered inputs

z Slave operation:

z Operation in all sleep modes

z Wake-up on address match

z 7-bit and 10-bit Address match in hardware for:

z Unique address and/or 7-bit general call address

z Address range

z Two unique addresses can be used with DMA

## 27.3 Block Diagram

Figure 27-1. I<sup>2</sup>C Single-Master Single-Slave Interconnection  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_0f0a0a49466b2ca6e33dfac01029281164296d7112dd2bcc5a60c26e9a97b7cf.jpg)

27.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>PAD[0]</td><td>Digital I/O</td><td>SDA</td></tr><tr><td>PAD[1]</td><td>Digital I/O</td><td>SCL</td></tr><tr><td>PAD[2]</td><td>Digital I/O</td><td>SDA_OUT (4-wire)</td></tr><tr><td>PAD[3]</td><td>Digital I/O</td><td>SDC_OUT (4-wire)</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins. Note that not all the pins are I<sup>2</sup>C pins. Refer to Table 6-1 for details on the pin type for each pin.

## 27.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 27.5.1 I/O Lines

Using the SERCOM’s I/O lines requires the I/O pins to be configured. Refer to “PORT” on page 378 for details.

## 27.5.2 Power Management

The I<sup>2</sup>C will continue to operate in any sleep mode where the selected source clock is running. I<sup>2</sup>C interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 27.5.3 Clocks

The SERCOM bus clock (CLK\_SERCOMx\_APB, where i represents the specific SERCOM instance number) is enabled by default, and can be enabled and disabled in the Power Manager. Refer to “PM – Power Manager” on page 110 for details.

The SERCOM bus clock (CLK\_SERCOMx\_APB) is enabled by default, and can be enabled and disabled in the Power Manager. Refer to “PM – Power Manager” on page 110 for details.

Two generic clocks are used by the SERCOM (GCLK\_SERCOMx\_CORE and GCLK\_SERCOM\_SLOW). The core clock (GCLK\_SERCOMx\_CORE) is required to clock the SERCOM while operating as a master, while the slow clock (GCLK\_SERCOM\_SLOW) is required only for certain functions. These clocks must be configured and enabled in the Generic Clock Controller (GCLK) before using the SERCOM. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

These generic clocks are asynchronous to the SERCOM bus clock (CLK\_SERCOMx\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to the “Synchronization” on page 527 section for further details.

## 27.5.4 DMA

The DMA request lines are connected to the DMA controller (DMAC). Using the SERCOM DMA requests, requires the DMA controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details.

## 27.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the I<sup>2</sup>C interrupts requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 27.5.6 Events

Not applicable.

## 27.5.7 Debug Operation

When the CPU is halted in debug mode, the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface continues normal operation. If the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging. The $\mathsf { I } ^ { 2 } \mathsf { C }$ interface can be forced to halt operation during debugging.

Refer to the DBGCTRL register for details.

## 27.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

z Interrupt Flag Status and Clear register (INTFLAG)

z Status register (STATUS)

z Address register (ADDR)

z Data register (DATA)

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply to accesses through en external debugger. Refer to“PAC – Peripheral Access Controller” on page 30 for details.

## 27.5.9 Analog Connections

Not applicable.

## 27.6 Functional Description

## 27.6.1 Principle of Operation

The ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface uses two physical lines for communication:

z Serial Data Line (SDA) for packet transfer

Serial Clock Line (SCL) for the bus clock

A transaction starts with the start condition, followed by a 7-bit address and a direction bit (read or write) sent from the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master. The addressed ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave will then acknowledge (ACK) the address, and data packet transactions can commence. Every 9-bit data packet consists of 8 data bits followed by a one-bit reply indicating whether the data was acknowledged or not. In the event that a data packet is not acknowledged (NACK), whether sent from the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave or master, it will be up to the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master to either terminate the connection by issuing the stop condition, or send a repeated start if more data is to be transceived.

Figure 27-2 illustrates the possible transaction formats and Figure 27-3 explains the legend used.

Figure 27-2. Basic I<sup>2</sup>C Transaction Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_53f4360ee167bbce6992ab47f3680751ef0c9f37ef2a75729dc01ee7418dd5bd.jpg)  
Figure 27-3. Transaction Diagram Syntax

Bus Driver:

Special Bus Conditions

Master Drives Bus

S

START Condition

Slave Drives Bus

Sr

Repeated START Condition

Either Master or Slave Drives Bus

P

STOP Condition

Data Packet Direction:

Acknowledge:

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_3b38cb54d8bb0252698228f72524823ea7c0e053a19c0397ac0203b9c77c8419.jpg)

"1"

Master Read

A

Acknowledge (ACK)

"0"

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_7f943c0119bd64cc60094fc6ef04fdb69f872b46ad3d959d0bd429458323ce76.jpg)

"0"

Master Write

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_7c2da833b7cf1a540535a4d450710e10d2bd80fc235c75ad8662e5951b00f97b.jpg)

"1"

Not Acknowledge (NACK)

## 27.6.2 Basic Operation

## 27.6.2.1 Initialization

The following registers are enable-protected, meaning they can be written only when the I<sup>2</sup>C interface is disabled (CTRLA.ENABLE is zero):

z Control A register (CTRLA), except Enable (CTRLA.ENABLE) and Software Reset (CTRLA.SWRST)

z Control B register (CTRLB), except Acknowledge Action (CTRLB.ACKACT) and Command (CTRLB.CMD)

z Baud Rate register (BAUD)

z Address register (ADDR) while in slave operation

Any writes to these bits or registers when the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface is enabled or is being enabled (CTRLA.ENABLE is one) will be discarded. Writes to these registers while the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface is being disabled will be completed after the disabling is complete.

Enable-protection is denoted by the Enable-Protection property in the register description.

Before the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface is enabled, it must be configured as outlined by the following steps:

I<sup>2</sup>C mode in master or slave operation must be selected by writing 0x4 or 0x5 to the Operating Mode bit group in the Control A register (CTRLA.MODE)

SCL low time-out can be enabled by writing to the SCL Low Time-Out bit in the Control A register (CTRLA.LOWTOUT)

In master operation, the inactive bus time-out can be set in the Inactive Time-Out bit group in the Control A register (CTRLA.INACTOUT)

Hold time for SDA can be set in the SDA Hold Time bit group in the Control A register (CTRLA.SDAHOLD)

Smart operation can be enabled by writing to the Smart Mode Enable bit in the Control B register (CTRLB.SMEN)

In slave operation, the address match configuration must be set in the Address Mode bit group in the Control B register (CTRLB.AMODE)

In slave operation, the addresses must be set, according to the selected address configuration, in the Address and Address Mask bit groups in the Address register (ADDR.ADDR and ADDR.ADDRMASK)

z In master operation, the Baud Rate register (BAUD) must be written to generate the desired baud rate

## 27.6.2.2 Enabling, Disabling and Resetting

The I<sup>2</sup>C interface is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The I<sup>2</sup>C interface is disabled by writing a zero to CTRLA.ENABLE. The ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ interface is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the I<sup>2</sup>C interface, except DBGCTRL, will be reset to their initial state, and the I<sup>2</sup>C interface will be disabled. Refer to CTRLA for details.

## 27.6.2.3 I<sup>2</sup>C Bus State Logic

The bus state logic includes several logic blocks that continuously monitor the activity on the I<sup>2</sup>C bus lines in all sleep modes. The start and stop detectors and the bit counter are all essential in the process of determining the current bus state. The bus state is determined according to the state diagram shown in Figure 27-4. Software can get the current bus state by reading the Master Bus State bits in the Status register (STATUS.BUSSTATE). The value of STATUS.BUSSTATE in the figure is shown in binary.

Figure 27-4. Bus State Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_388fc74d57b754a799609a2aeded14faec9f78890a4bcd9e2465265c1f72f325.jpg)

The bus state machine is active when the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master is enabled. After the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master has been enabled, the bus state is unknown. From the unknown state, the bus state machine can be forced to enter the idle state by writing to STATUS.BUSSTATE accordingly. However, if no action is taken by software, the bus state will become idle if a stop condition is detected on the bus. If the inactive bus time-out is enabled, the bus state will change from unknown to idle on the occurrence of a time-out. Note that after a known bus state is established, the bus state logic will not re-enter the unknown state from either of the other states.

When the bus is idle it is ready for a new transaction. If a start condition is issued on the bus by another ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master in a multimaster setup, the bus becomes busy until a stop condition is detected. The stop condition will cause the bus to re-enter the IDLE state. If the inactive bus time-out (SMBus) is enabled, the bus state will change from busy to idle on the occurrence of a time-out. If a start condition is generated internally by writing the Address bit group in the Address register (ADDR.ADDR) while in idle state, the owner state is entered. If the complete transaction was performed without interference, i.e., arbitration not lost, the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master is allowed to issue a stop condition, which in turn will cause a change of the bus state back to idle. However, if a packet collision is detected when in the owner state, the arbitration is assumed lost and the bus state becomes busy until a stop condition is detected.

A repeated start condition will change the bus state only if arbitration is lost while issuing a repeated start.

## 27.6.2.4 Clock Generation (Standard-mode, Fast-mode and Fast-mode Plus Transfers)

The Master ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ clock (SCL) frequency is determined by a number of factors. The low $( \mathsf { T } _ { \mathsf { L O W } } )$ and high $( 7 \lrcorner 1 1 6 1 )$ times are determined by the Baud Rate register (BAUD), while the rise $( { \mathsf { T } } _ { \mathsf { R l S E } } )$ and fall $( T _ { \mathsf { F A L L } } )$ times are determined by the bus topology. Because of the wired-AND logic of the bus, ${ \sf T } _ { \sf F A L L }$ will be considered as part of ${ \sf T } _ { \sf L O W }$ . Likewise, ${ \sf T } _ { \sf R I S E }$ will be in a state between $\mathsf { T } _ { \mathsf { L O W } }$ and ${ \sf T } _ { \sf H I G H }$ until a high state has been detected.

Figure 27-5. SCL Timing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_39adbfec20173030c825d22c8e62a3765f38475832a53b2fc3e96b7f941bd2ff.jpg)

The following parameters are timed using the SCL low time period. This comes from the Master Baud Rate Low bit group in the Baud Rate register (BAUD.BAUDLOW) when non-zero, or the Master Baud Rate bit group in the Baud Rate register (BAUD.BAUD) when BAUD.BAUDLOW is zero.

$\mathsf { T } _ { \mathsf { L O W } } - \mathsf { L o w }$ period of SCL clock

$\mathsf { T } _ { \mathsf { S U } ; \mathsf { S T O } }$ – Set-up time for stop condition

${ \sf T } _ { \sf B U F } -$ Bus free time between stop and start conditions

$\mathsf { T } _ { \mathsf { H D } ; \mathsf { S T A } }$ – Hold time (repeated) start condition

$\mathsf { T } _ { \mathsf { S U } ; \mathsf { S T A } }$ – Set-up time for repeated start condition

${ \sf T } _ { \sf H I G H }$ is timed using the SCL high time count from BAUD.BAUD

${ \sf T } _ { \sf R I S E }$ is determined by the bus impedance; for internal pull-ups. Refer to “Electrical Characteristics” on page 858 for details.

${ \sf T } _ { \sf F A L L }$ is determined by the open-drain current limit and bus impedance; can typically be regarded as zero. Refer to “Electrical Characteristics” on page 858 for details.

The SCL frequency is given by:

$$
f _ {S C L} = \frac {1}{T _ {L O W} + T _ {H I G H} + T _ {R I S E}}
$$

When BAUD.BAUDLOW is zero, the BAUD.BAUD value is used to time both SCL high and SCL low. In this case the following formula will give the SCL frequency:

$$
f _ {S C L} = \frac {f _ {G C L K}}{2 (5 + B A U D) + f _ {G C L K} T _ {R I S E}}
$$

When BAUD.BAUDLOW is non-zero, the following formula is used to determine the SCL frequency:

$$
f _ {S C L} = \frac {f _ {G C L K}}{1 0 + B A U D + B A U D L O W + f _ {G C L K} T _ {R I S E}}
$$

When BAUDLOW is non-zero, the following formula can be used to determine the SCL frequency:

$$
f _ {S C L} = \frac {f _ {G C L K}}{1 0 + B A U D + B A U D L O W + f _ {G C L K} T _ {R I S E}}
$$

The following formulas can be used to determine the SCL ${ \sf T } _ { \sf L O W }$ and ${ \sf T } _ { \sf H I G H }$ times:

$$
T _ {l o w} = \frac {\text { BAUD.BAUDLOW } + 5}{f _ {G C L K}}
$$

$$
T _ {H I G H} = \frac {B A U D . B A U D + 5}{f _ {G C L K}}
$$

For Fast-mode Plus the nominal high to low SCL ratio is 1 to 2 and BAUD should be set accordingly. At a minimum, BAUD.BAUD and/or BAUD.BAUDLOW must be non-zero.

## 27.6.2.5 Master Clock Generation (High-speed mode Transfer)

For High-speed mode transfers, there is no SCL synchronization, so the SCL frequency is determined by the GCLK frequency and the High-speed BAUD setting. When HSBAUDLOW is zero, the HSBAUD value is used to time both SCL high and SCL low. In this case the following formula can be used to determine the SCL frequency.

$$
f _ {S C L} = \frac {f _ {G C L K}}{2 (1 + H S B A U D)}
$$

When HSBAUDLOW is non-zero, the following formula can be used to determine the SCL frequency.

$$
f _ {S C L} = \frac {f _ {G C L K}}{2 + H S B A U D + H S B A U D L O W}
$$

For High-speed the nominal high to low SCL ratio is 1 to 2 and HSBAUD should be set accordingly. At a minimum, BAUD.BAUD and/or BAUD.BAUDLOW must be non-zero.

## 27.6.2.6 I<sup>2</sup>C Master Operation

The I<sup>2</sup>C master is byte-oriented and interrupt based. The number of interrupts generated is kept at a minimum by automatic handling of most events. Auto-triggering of operations and a special smart mode, which can be enabled by writing a one to the Smart Mode Enable bit in the Control A register (CTRLA.SMEN), are included to reduce software driver complexity and code size.

The I2C master has two interrupt strategies. When SCL Stretch Mode (CTRLA.SCLSM) is set to zero, SCL is stretched before or after the acknowledge bit . In this mode the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master operates according to the behavior diagram shown in Figure $^ { 2 7 - 6 }$ . The circles with a capital letter M followed by a number (M1, M2... etc.) indicate which node in the figure the bus logic can jump to based on software or hardware interaction.

This diagram is used as reference for the description of the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master operation throughout the document.

In the second strategy (SCLSM=1), interrupts only occur after the ACK bit as shown in Figure 27-7. This strategy can be used when it is not necessary to check DATA before acknowledging.

Figure 27-6. I<sup>2</sup>C Master Behavioral Diagram (SCLSM=0)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_b794eae6a219a79cd746b0b9405397b2e71caa962e90569cc4069a02fce857ed.jpg)

Figure 27-7. I<sup>2</sup>C Master Behavioral Diagram (SCLSM=1)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_c069338f0fb784a95a556be46263593440b978b24a0c450a49e961ade185c8f7.jpg)

## Transmitting Address Packets

The I<sup>2</sup>C master starts a bus transaction by writing ADDR.ADDR with the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave address and the direction bit. If the bus is busy, the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master will wait until the bus becomes idle before continuing the operation. When the bus is idle, the I<sup>2</sup>C master will issue a start condition on the bus. The ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master will then transmit an address packet using the address written to ADDR.ADDR.

After the address packet has been transmitted by the I<sup>2</sup>C master, one of four cases will arise, based on arbitration and transfer direction.

## Case 1: Arbitration lost or bus error during address packet transmission

If arbitration was lost during transmission of the address packet, the Master on Bus bit in the Interrupt Flag register (INTFLAG.MB) and the Arbitration Lost bit in the Status register (STATUS.ARBLOST) are both set. Serial data output to SDA is disabled, and the SCL is released, which disables clock stretching. In effect the I<sup>2</sup>C master is no longer allowed to perform any operation on the bus until the bus is idle again. A bus error will behave similarly to the arbitration lost condition. In this case, the MB interrupt flag and Master Bus Error bit in the Status register (STATUS.BUSERR) are both set in addition to STATUS.ARBLOST.

The Master Received Not Acknowledge bit in the Status register (STATUS.RXNACK) will always contain the last successfully received acknowledge or not acknowledge indication.

In this case, software will typically inform the application code of the condition and then clear the interrupt flag before exiting the interrupt routine. No other flags have to be cleared at this point, because all flags will be cleared automatically the next time the ADDR.ADDR register is written.

## Case 2: Address packet transmit complete – No ACK received

If no ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave device responds to the address packet, then the INTFLAG.MB interrupt flag is set and STATUS.RXNACK is set. The clock hold is active at this point, preventing further activity on the bus.

The missing ACK response can indicate that the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave is busy with other tasks or sleeping and, therefore, not able to respond. In this event, the next step can be either issuing a stop condition (recommended) or resending the

address packet by using a repeated start condition. However, the reason for the missing acknowledge can be that an invalid I<sup>2</sup>C slave address has been used or that the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave is for some reason disconnected or faulty. If using SMBus logic, the slave must ACK the address, and hence no action means the slave is not available on the bus.

## Case 3: Address packet transmit complete – Write packet, Master on Bus set

If the I<sup>2</sup>C master receives an acknowledge response from the I<sup>2</sup>C slave, INTFLAG.MB is set and STATUS.RXNACK is cleared. The clock hold is active at this point, preventing further activity on the bus.

In this case, the software implementation becomes highly protocol dependent. Three possible actions can enable the I<sup>2</sup>C operation to continue. The three options are:

z The data transmit operation is initiated by writing the data byte to be transmitted into DATA.DATA.

Transmit a new address packet by writing ADDR.ADDR. A repeated start condition will automatically be inserted before the address packet.

z Issue a stop condition, consequently terminating the transaction.

## Case 4: Address packet transmit complete – Read packet, Slave on Bus set

If the I<sup>2</sup>C master receives an ACK from the I<sup>2</sup>C slave, the I<sup>2</sup>C master proceeds to receive the next byte of data from the I<sup>2</sup>C slave. When the first data byte is received, the Slave on Bus bit in the Interrupt Flag register (INTFLAG.SB) is set and STATUS.RXNACK is cleared. The clock hold is active at this point, preventing further activity on the bus.

In this case, the software implementation becomes highly protocol dependent. Three possible actions can enable the I<sup>2</sup>C operation to continue. The three options are:

Let the I<sup>2</sup>C master continue to read data by first acknowledging the data received. This is automatically done when reading DATA.DATA if the smart mode is enabled.

z Transmit a new address packet.

z Terminate the transaction by issuing a stop condition.

An ACK or NACK will be automatically transmitted for the last two alternatives if smart mode is enabled. The Acknowledge Action bit in the Control B register (CTRLB.ACKACT) determines whether ACK or NACK should be sent.

## Transmitting Data Packets

When an address packet with direction set to write has been successfully transmitted, INTFLAG.MB will be set and the I<sup>2</sup>C master can start transmitting data by writing to DATA.DATA. The I<sup>2</sup>C master transmits data via the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ bus while continuously monitoring for packet collisions. If a collision is detected, the I<sup>2</sup>C master looses arbitration and STATUS.ARBLOST is set. If the transmit was successful, the I<sup>2</sup>C master automatically receives an ACK bit from the I<sup>2</sup>C slave and STATUS.RXNACK will be cleared. INTFLAG.MB will be set in both cases, regardless of arbitration outcome.

Testing STATUS.ARBLOST and handling the arbitration lost condition in the beginning of the I<sup>2</sup>C Master on Bus interrupt is recommended. This can be done, as there is no difference between handling address and data packet arbitration.

STATUS.RXNACK must be checked for each data packet transmitted before the next data packet transmission can commence. The I<sup>2</sup>C master is not allowed to continue transmitting data packets if a NACK is given from the I<sup>2</sup>C slave.

## Receiving Data Packets (SCLSM=0)

When INTFLAG.SB is set, the I<sup>2</sup>C master will already have received one data packet. The I<sup>2</sup>C master must respond by sending either an ACK or NACK. Sending a NACK might not be successfully executed as arbitration can be lost during the transmission. In this case, a loss of arbitration will cause INTFLAG.SB to not be set on completion. Instead, INTFLAG.MB will be used to indicate a change in arbitration. Handling of lost arbitration is the same as for data bit transmission.

## Receiving Data Packets (SCLSM=1)

When INTFLAG.SB is set, the I<sup>2</sup>C master will already have received one data packet and transmitted the ACKACT bit. At this point the ACKACT must be set to the correct value for the next ACK bit, and the transaction can continue by reading DATA and issuing a command if not in smart mode.

## High-speed Mode

High-speed transfers are a multi-step process as shown in Figure 27-8. First, a master code (0000 1nnn where nnn is a unique master code) is transmitted in Full-speed mode, followed by a NACK since no slave should acknowledge. Arbitration is performed only during the Full-speed Master Code phase. The master code is transmitted by writing the master code to the address register (ADDR) with the high-speed bit (ADDR.HS) written to zero.

After the Master Code and NACK have been transmitted, the master write interrupt will be asserted. At this point, the slave address can be written to the ADDR register with the ADDR.HS bit set to one. The master will then generate a repeated start followed by the slave address in High-speed mode. The bus will remain in High-speed mode until a stop is generated. If a repeated start is desired, the ADDR.HS bit must again be written to 1 along with the new address to be transmitted.

Figure 27-8. High Speed Transfer

<table><tr><td colspan="3">F/S-mode</td><td colspan="6">Hs-mode</td><td>F/S-mode</td></tr><tr><td>S</td><td>Master Code</td><td> $\overline{A}$ </td><td>Sr</td><td>ADDRESS</td><td>R/ $\overline{W}$ </td><td>A</td><td>DATA</td><td>A/ $\overline{A}$ </td><td>P</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>N Data Packets</td><td></td><td>Hs-mode continues</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>Sr</td><td>ADDRESS</td></tr></table>

Transmitting in High-speed mode requires the I2C master to be configured in High-speed mode (SPEED=0b10) and the SCL clock stretch mode (SCLSM) bit set to one.

## 10-Bit Addressing

When 10-bit addressing is enabled (TENBITEN=1) and the ADDR register is written, the two address bytes will be transmitted as shown in Figure 27-9. The addressed slave acknowledges the two address bytes and the transaction continues. Regardless of whether the transaction is a read or write, the master must start by sending the 10-bit address with the read/write bit (ADDR.ADDR[0]) equal to zero.

If the master receives a NACK after the first byte, then the write interrupt flag will be raised and the NACK bit will be set. If the first byte is acknowledged by one or more slaves, then the master will proceed to transmit the second address byte and the master will first see the write interrupt flag after the second byte is transmitted.

If the transaction is a read, the 10-bit address transmission must be followed by a repeated start and the first 7 bits of the address with the read/write bit equal to 1.

Figure 27-9. 10-Bit Address Transmission for a Read Transaction  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_23abd6fc4073aca3694f6b3888989bbbc0199348ce5485e3a2d560f168df6d5a.jpg)  
This implies the following procedure for a 10-bit read operation:

Write ADDR.ADDR[10:1] with the 10-bit address. ADDR.TENBITEN must be set (can be written simultaneously with ADDR) and read/write bit (ADDR.ADDR[0]) equal to 0.

z When the master write interrupt is asserted, write ADDR[7:0] register to “11110 address[9:8] 1”. ADDR.TENBITEN must be cleared (can be written simultaneously with ADDR).

● Proceed to transmit data.

## 27.6.2.7 I<sup>2</sup>C Slave Operation

The I<sup>2</sup>C slave is byte-oriented and interrupt-based. The number of interrupts generated is kept at a minimum by automatic handling of most events. Auto triggering of operations and a special smart mode, which can be enabled by writing a 1 to the Smart Mode Enable bit in the Control A register (CTRLA.SMEN), are included to reduce software’s complexity and code size.

The I<sup>2</sup>C slave has two interrupt strategies. When SCL Stretch Mode (CTRLA.SCLSM) is set to zero, SCL is stretched before or after the acknowledge bit. In this mode, the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave operates according to the behavior diagram shown in Figure 27-10. The circles with a capital S followed by a number (S1, S2... etc.) indicate which node in the figure the bus logic can jump to based on software or hardware interaction.

This diagram is used as reference for the description of the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave operation throughout the document.

Figure 27-10.I<sup>2</sup>C Slave Behavioral Diagram (SCLSM=0)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_19ca9d39e59fedafed9b688bc39111a789530dd144d824cf113b03a9294755cd.jpg)

In the second strategy (SCLSM=1), interrupts only occur after the ACK bit as shown in Figure 27-11. This strategy can be used when it is not necessary to check DATA before acknowledging. For master reads, an address and data interrupt will be issued simultaneously after the address acknowledge, while for master writes, the first data interrupt will be seen after the first data byte has been received by the slave and the acknowledge bit has been sent to the master.

Note that setting SCLSM to 1 is required for High-speed mode.

Figure 27-11.Slave Behavioral Diagram (SCLSM=1)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_ac0f57fa8d900d0a164621a7966bab597f06ce0739677bf4e2389ef725190e62.jpg)

## Receiving Address Packets (SCLSM=0)

When SCLSM is zero, the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave stretches the SCL line according to Figure 27-10. When the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave is properly configured, it will wait for a start condition to be detected. When a start condition is detected, the successive address packet will be received and checked by the address match logic. If the received address is not a match, the packet is rejected and the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave waits for a new start condition. The ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave Address Match bit in the Interrupt Flag register (INTFLAG.AMATCH) is set when a start condition followed by a valid address packet is detected. SCL will be stretched until the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave clears INTFLAG.AMATCH. Because the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave holds the clock by forcing SCL low, the software is given unlimited time to respond to the address.

The direction of a transaction is determined by reading the Read / Write Direction bit in the Status register (STATUS.DIR), and the bit will be updated only when a valid address packet is received.

If the Transmit Collision bit in the Status register (STATUS.COLL) is set, this indicates that the last packet addressed to the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave had a packet collision. A collision causes the SDA and SCL lines to be released without any notification to software. The next AMATCH interrupt is, therefore, the first indication of the previous packet’s collision. Collisions are intended to follow the SMBus Address Resolution Protocol (ARP).

After the address packet has been received from the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master, one of two cases will arise based on transfer direction.

## Case 1: Address packet accepted – Read flag set

The STATUS.DIR bit is one, indicating an ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ master read operation. The SCL line is forced low, stretching the bus clock. If an ACK is sent, ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave hardware will set the Data Ready bit in the Interrupt Flag register (INTFLAG.DRDY) indicating data are needed for transmit. If not acknowledge is sent, the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave will wait for a new start condition and address match.

Typically, software will immediately acknowledge the address packet by sending an ACK/NACK bit. The ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ slave command CTRLB.CMD = 3 can be used for both read and write operation as the command execution is dependent on the STATUS.DIR bit.

Writing a one to INTFLAG.AMATCH will also cause an ACK/NACK to be sent corresponding to the CTRLB.ACKACT bit.

## Case 2: Address packet accepted – Write flag set

The STATUS.DIR bit is cleared, indicating an I<sup>2</sup>C master write operation. The SCL line is forced low, stretching the bus clock. If an ACK is sent, the I<sup>2</sup>C slave will wait for data to be received. Data, repeated start or stop can be received.

If not acknowledge is sent, the I<sup>2</sup>C slave will wait for a new start condition and address match.

Typically, software will immediately acknowledge the address packet by sending an ACK/NACK bit. The I<sup>2</sup>C slave command CTRLB.CMD = 3 can be used for both read and write operation as the command execution is dependent on STATUS.DIR.

Writing a one to INTFLAG.AMATCH will also cause an ACK/NACK to be sent corresponding to the CTRLB.ACKACT bit.

## Receiving Address Packets (SCLSM=1)

When SCLSM is one, the I<sup>2</sup>C slave only stretches the SCL line after an acknowledge according to Figure 27-11. When the I<sup>2</sup>C slave is properly configured, it will wait for a start condition to be detected. When a start condition is detected, the successive address packet will be received and checked by the address match logic. If the received address is not a match, the packet is rejected and the I<sup>2</sup>C slave waits for a new start condition. If the address matches, the acknowledge action (CTRLB.ACKACT) is automatically sent and the Address Match bit in the Interrupt Flag register (INTFLAG.AMATCH) is set. SCL will be stretched until the I<sup>2</sup>C slave clears INTFLAG.AMATCH. Because the I<sup>2</sup>C slave holds the clock by forcing SCL low, the software is given unlimited time to respond to the address.

The direction of a transaction is determined by reading the Read / Write Direction bit in the Status register (STATUS.DIR), and the bit will be updated only when a valid address packet is received.

If the Transmit Collision bit in the Status register (STATUS.COLL) is set, this indicates that the last packet addressed to the I<sup>2</sup>C slave had a packet collision. A collision causes the SDA and SCL lines to be released without any notification to software. The next AMATCH interrupt is, therefore, the first indication of the previous packet’s collision Collisions are intended to follow the SMBus Address Resolution Protocol (ARP).

After the address packet has been received from the I<sup>2</sup>C master, a one can be written to INTFLAG.AMATCH to clear it.

## Receiving and Transmitting Data Packets (SCLSM=0)

After the I<sup>2</sup>C slave has received an address packet, it will respond according to the direction either by waiting for the data packet to be received or by starting to send a data packet by writing to DATA.DATA. When a data packet is received or sent, INTFLAG.DRDY will be set. Then, if the I<sup>2</sup>C slave was receiving data, it will send an acknowledge according to CTRLB.ACKACT.

## Case 1: Data received

INTFLAG.DRDY is set, and SCL is held low pending SW interaction.

## Case 2: Data sent

When a byte transmission is successfully completed, the INTFLAG.DRDY interrupt flag is set. If NACK is received, the I<sup>2</sup>C slave must expect a stop or a repeated start to be received. The I<sup>2</sup>C slave must release the data line to allow the I<sup>2</sup>C master to generate a stop or repeated start.

Upon stop detection, the Stop Received bit in the Interrupt Flag register (INTFLAG.PREC) will be set and the I<sup>2</sup>C slave will return to the idle state.

## High Speed Mode

When the I<sup>2</sup>C slave is configured in High-speed mode (CTRLA.SPEED=0x2) with SCLSM set to one, switching between Full-speed and High-speed modes is automatic. When the slave recognizes a START followed by a master code transmission and a NACK, it automatically switches to High-speed mode and sets the High-speed status bit (STATUS.HS). The slave will then remain in High-speed mode until a STOP is received.

## 10-Bit Addressing

When 10-bit addressing is enabled (ADDR.TENBITEN=1) the two address bytes following a START will be checked against the 10-bit slave address recognition. The first byte of the address will always be acknowledged and the second byte will raise the address interrupt flag as shown in Figure 27-12

If the transaction is a write, then the 10-bit address will be followed by N data bytes.

If the operation is a read, the 10-bit address will be followed by a repeated START and reception of “11110 ADDR[9:8] 1” and the second address interrupt will be received with the DIR bit set. The slave matches on the second address as it remembers that is was addressed by the previous 10-bit address.

Figure 27-12.10-bit Addressing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_e45b0caa3eec6eeb00afa5fe2ab9cf9629a2caae98b3f95b6f3aac6f7718f468.jpg)

## PMBus Group Command

When the group command bit is set (CTRLB.GCMD) and 7-bit addressing is used, a STOP interrupt will be generated if the slave has been addressed since the last STOP condition.

The group command protocol is used to send commands to more than one device. The commands are sent in one continuous transmission with a single STOP condition at the end. When the STOP condition is detected by the slaves addressed during the group command, they all begin executing the command they received.

Figure 27-13 shows an example where this slave is addressed by ADDRESS 1. This slave is addressed after a repeated START condition. There can be multiple slaves addressed before and after, then at the end of the group command, a single STOP is generated by the master. At this point a STOP interrupt is asserted.

Figure 27-13.PMBus Group Command Example  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_4df4c9118ec12aa9965503933a3779b3326f6da4bb643de365bcd792b797f46e.jpg)

## 27.6.3 Additional Features

## 27.6.3.1 SMBus

The I<sup>2</sup>C hardware incorporates three hardware SCL low time-outs which allows a time-out to occur for SMBus SCL low time-out, master extend time-out, and slave extend time-out. These time-outs are driven by the GCLK\_SERCOM\_SLOW clock. The GCLK\_SERCOM\_SLOW clock is used to accurately time the time-out and must be configured to used a 32kHz oscillator. The I<sup>2</sup>C interface also allows for an SMBus compatible SDA hold time.

z $\mathsf { T } _ { \mathsf { T I M E O U T } }$ SCL low time of 25-35 ms. – Measured for a single SCL low period. Enabled by bit CTRLA.LOWTOUTEN.

$\mathsf { T } _ { \mathsf { L O W : S E X T } }$ Cumulative clock low extend time of 25 ms – Measured as the cumulative SCL low extend time by a slave device in a single message from the initial START to the STOP. Enabled by bit CTRLA.SEXTTOEN.

z ${ \mathsf { T } } _ { \mathsf { L O W : M E X T } } .$ Cumulative clock low extend time of 10 ms. – Measured as the cumulative SCL low extend time by the master device within a single byte from START-to-ACK, ACK-to-ACK, or ACK-to-STOP. Enabled by bit (CTRLA.MEXTTOEN.

## 27.6.3.2 Smart Mode

The I<sup>2</sup>C interface incorporates a special smart mode that simplifies application code and minimizes the user interaction needed to keep hold of the I<sup>2</sup>C protocol. The smart mode accomplishes this by letting the reading of DATA.DATA automatically issue an ACK or NACK based on the state of CTRLB.ACKACT.

## 27.6.3.3 4-Wire Mode

Setting the Pin Usage bit in the Control A register (CTRLA.PINOUT) for master or slave to 4-wire mode enables operation as shown in Figure 27-14. In this mode, the internal ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ tri-state drivers are bypassed, and an external, I<sup>2</sup>Ccompliant tri-state driver is needed when connecting to an I<sup>2</sup>C bus.

Figure 27-14.I2C Pad Interface  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_0f60ec8aa589f9376e4f342ad286b554f6efbba1516935748bd9417ec2d03c89.jpg)

## 27.6.3.4 Quick Command

Setting the Quick Command Enable bit in the Control B register (CTRLB.QCEN) enables quick command. When quick command is enabled, the corresponding interrupt flag is set immediately after the slave acknowledges the address. At this point, the software can either issue a stop command or a repeated start by writing CTRLB.CMD or ADDR.ADDR.

## 27.6.4 DMA, Interrupts and Events

Table 27-1. Module Request for SERCOM I<sup>2</sup>C Slave

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Data Ready</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Data received (Slave receive mode)</td><td></td><td></td><td></td><td>x</td><td>when data is read</td></tr><tr><td>Data needed for transmit (Slave transmit mode)</td><td></td><td></td><td></td><td>x</td><td>when data is written</td></tr><tr><td>Address Match</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Stop received</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Error</td><td>x</td><td></td><td></td><td></td><td></td></tr></table>

Table 27-2. Module Request for SERCOM I<sup>2</sup>C Master

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Master on Bus</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Slave on Bus</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Data received (Master receive mode)</td><td></td><td></td><td></td><td>x</td><td>when data is read</td></tr><tr><td>Data needed for transmit (Master transmit mode)</td><td></td><td></td><td></td><td>x</td><td>when data is written</td></tr><tr><td>Error</td><td>x</td><td></td><td></td><td></td><td></td></tr></table>

## 27.6.4.1 DMA Operation

Smart mode (CTRLB.SMEN) must be enabled for DMA operation.

Slave DMA

When using the I<sup>2</sup>C slave with DMA, an address match will cause the address interrupt flag (INTFLAG.ADDRMATCH) to be raised. After the interrupt has been serviced, data transfer will be performed through DMA.

The I<sup>2</sup>C slave generates the following requests:

Write data received (RX): The request is set when master write data is received. The request is cleared when DATA is read.

Read data needed for transmit (TX): The request is set when data is needed for a master read operation. The request is cleared when DATA is written.

## Master DMA

When using the I<sup>2</sup>C master with DMA, the ADDR register must be written with the desired address (ADDR.ADDR), transaction length (ADDR.LEN), and transaction length enable (ADDR.LENEN). When ADDR.LENEN is written to 1 along with ADDR.ADDR, ADDR.LEN determines the number of data bytes in the transaction from 0 to 255. DMA is then used to transfer ADDR.LEN bytes followed by an automatically generated NACK (for master reads) and a STOP. If a NACK is received by the slave for a master write transaction before ADDR.LEN bytes, a STOP will be automatically generated and the length error (STATUS.LENERR) will be raised along with the INTFLAG.ERROR interrupt.

The I<sup>2</sup>C master generates the following requests:

Read data received (RX): The request is set when master read data is received. The request is cleared when DATA is read.

Write data needed for transmit (TX): The request is set when data is needed for a master write operation. The request is cleared when DATA is written.

## 27.6.4.2 Interrupts

The I<sup>2</sup>C slave has the following interrupt sources:

z Error

Data Ready

z Address Match

z Stop Received

The I<sup>2</sup>C master has the following interrupt sources:

Error

Slave on Bus

● Master on Bus

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the I<sup>2</sup>C is reset. See INTFLAG for details on how to clear interrupt flags.

The I<sup>2</sup>C has one common interrupt request line for all the interrupt sources. The user must read INTFLAG to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 27.6.4.3 Events

Not applicable.

## 27.6.5 Sleep Mode Operation

During I<sup>2</sup>C master operation, the generic clock (GCLK\_SERCOMx\_CORE) will continue to run in idle sleep mode. If the Run In Standby bit in the Control A register (CTRLA.RUNSTDBY) is one, the GLK\_SERCOMx\_CORE will also run in standby sleep mode. Any interrupt can wake up the device

If CTRLA.RUNSTDBY is zero during I<sup>2</sup>C master operation, the GLK\_SERCOMx\_CORE will be disabled when an ongoing transaction is finished. Any interrupt can wake up the device.

During I<sup>2</sup>C slave operation, writing a one to CTRLA.RUNSTDBY will allow the Address Match interrupt to wake up the device.

In I<sup>2</sup>C slave operation, all receptions will be dropped when CTRLA.RUNSTDBY is zero.

## 27.6.6 Synchronization

Due to the asynchronicity between CLK\_SERCOMx\_APB and GCLK\_SERCOMx\_CORE, some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

z No synchronization

When executing an operation that requires synchronization, the corresponding Synchronization Busy bit in the Synchronization Busy register (SYNCBUSY) will be set immediately, and cleared when synchronization is complete. If an operation that requires synchronization is executed while the corresponding SYNCBUSY bit is one, a periphera bus error is generated.

The following bits need synchronization when written:

z Software Reset bit in the Control A register (CTRLA.SWRST). SYNCBUSY.SWRST is set to one while synchronization is in progress.

Enable bit in the Control A register (CTRLA.ENABLE). SYNCBUSY.ENABLE is set to one while synchronization is in progress.

z Write to Bus State bits in the Status register (STATUS.BUSSTATE). SYNCBUSY.SYSOP is set to one while synchronization is in progress.

z Address bits in the Address register (ADDR.ADDR) when in master operation. SYNCBUSY.SYSOP is set to one while synchronization is in progress.

Data (DATA) when in master operation. SYNCBUSY.SYSOP is set to one while synchronization is in progress.

Write-synchronization is denoted by the Write-Synchronized property in the register description.

## 27.7 Register Summary

Table 27-3. Register Summary – Slave Mode

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">CTRLA</td><td>7:0</td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]=100</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x02</td><td>23:16</td><td>SEXTTOEN</td><td></td><td colspan="2">SDAHOLD[1:0]</td><td></td><td></td><td></td><td>PINOUT</td></tr><tr><td>0x03</td><td>31:24</td><td></td><td>LOWTOUT</td><td></td><td></td><td>SCLSM</td><td></td><td colspan="2">SPEED[1:0]</td></tr><tr><td>0x04</td><td rowspan="4">CTRLB</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x05</td><td>15:8</td><td colspan="2">AMODE[1:0]</td><td></td><td></td><td></td><td>AACKEN</td><td>GCMD</td><td>SMEN</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td>ACKACT</td><td colspan="2">CMD[1:0]</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>...</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>INTENCLR</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td></td><td>DRDY</td><td>AMATCH</td><td>PREC</td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>INTENSET</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td></td><td>DRDY</td><td>AMATCH</td><td>PREC</td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td>INTFLAG</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td></td><td>DRDY</td><td>AMATCH</td><td>PREC</td></tr><tr><td>0x19</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1A</td><td rowspan="2">STATUS</td><td>7:0</td><td>CLKHOLD</td><td>LOWTOUT</td><td></td><td>SR</td><td>DIR</td><td>RXNACK</td><td>COLL</td><td>BUSERR</td></tr><tr><td>0x1B</td><td>15:8</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td>HS</td><td>SEXTTOUT</td><td></td></tr><tr><td>0x1C</td><td rowspan="4">SYNCBUSY</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x1D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x21</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="7">ADDR[6:0]</td><td>GENCEN</td></tr><tr><td>0x25</td><td>15:8</td><td>TENBITEN</td><td></td><td></td><td></td><td></td><td colspan="3">ADDR[9:7]</td></tr><tr><td>0x26</td><td>23:16</td><td colspan="7">ADDRMASK[6:0]</td><td></td></tr><tr><td>0x27</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">ADDRMASK[9:7]</td></tr><tr><td>0x28</td><td rowspan="2">DATA</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

Table 27-4. Register Summary – Master Mode

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">CTRLA</td><td>7:0</td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]=101</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x02</td><td>23:16</td><td>SEXTTOEN</td><td>MEXTTOEN</td><td colspan="2">SDAHOLD[1:0]</td><td></td><td></td><td></td><td>PINOUT</td></tr><tr><td>0x03</td><td>31:24</td><td></td><td>LOWTOUT</td><td colspan="2">INACTOUT[1:0]</td><td>SCLSM</td><td></td><td colspan="2">SPEED[1:0]</td></tr><tr><td>0x04</td><td rowspan="4">CTRLB</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>QCEN</td><td>SMEN</td></tr><tr><td>0x06</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td>ACKACT</td><td colspan="2">CMD[1:0]</td></tr><tr><td>0x07</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td rowspan="4">BAUD</td><td>7:0</td><td colspan="8">BAUD[7:0]</td></tr><tr><td>0x0D</td><td>15:8</td><td colspan="8">BAUDLOW[7:0]</td></tr><tr><td>0x0E</td><td>23:16</td><td colspan="8">HSBAUD[7:0]</td></tr><tr><td>0x0F</td><td>31:24</td><td colspan="8">HSBAUDLOW[7:0]</td></tr><tr><td>0x10</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x11</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>INTENCLR</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td></td><td></td><td>SB</td><td>MB</td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>INTENSET</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td></td><td></td><td>SB</td><td>MB</td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td>INTFLAG</td><td>7:0</td><td>ERROR</td><td></td><td></td><td></td><td></td><td></td><td>SB</td><td>MB</td></tr><tr><td>0x19</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1A</td><td rowspan="2">STATUS</td><td>7:0</td><td>CLKHOLD</td><td>LOWTOUT</td><td colspan="2">BUSSTATE[1:0]</td><td></td><td>RXNACK</td><td>ARBLOST</td><td>BUSERR</td></tr><tr><td>0x1B</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td>LENERR</td><td>SEXTTOUT</td><td>MEXTTOUT</td></tr><tr><td>0x1C</td><td rowspan="4">SYNCBUSY</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SYSOP</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x1D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x21</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="8">ADDR[7:0]</td></tr><tr><td>0x25</td><td>15:8</td><td>TENBITEN</td><td>HS</td><td>LENEN</td><td></td><td></td><td colspan="3">ADDR[10:8]</td></tr><tr><td>0x26</td><td>23:16</td><td colspan="8">LEN[7:0]</td></tr><tr><td>0x27</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x28</td><td rowspan="2">DATA</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>...</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x30</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGSTOP</td></tr></table>

## 27.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Please refer to“Register Access Protection” on page 511 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Please refer to “Synchronization” on page 527 for details.

Some registers are enable-protected, meaning they can only be written when the I<sup>2</sup>C is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 27.8.1 I<sup>2</sup>C Slave Register Description

## 27.8.1.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00000000

Property: Write-Protected, Enable-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td>LOWTOUT</td><td></td><td></td><td>SCLSM</td><td></td><td colspan="2">SPEED[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td>SEXTTOEN</td><td></td><td colspan="2">SDAHOLD[1:0]</td><td></td><td></td><td></td><td>PINOUT</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]=100</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 31 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 30 – LOWTOUT: SCL Low Time-Out

This bit enables the SCL low time-out. If SCL is held low for 25ms-35ms, the slave will release its clock hold, if enabled, and reset the internal state machine. Any interrupts set at the time of time-out will remain set.

0: Time-out disabled.

1: Time-out enabled.

## Bits 29:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 27– SCLSM: SCL Clock Stretch Mode

This bit controls when SCL will be stretch for software interaction.

0: SCL stretch according to Figure 27-7

1: SCL stretch only after ACK bit according to Figure 27-10.

This bit is not synchronized.

## Bit 26– Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 25:24 – SPEED[1:0]: Transfer Speed These bits define bus speed.

Table 27-5. Transfer Speed

<table><tr><td>Value</td><td>Description</td></tr><tr><td>0x0</td><td>Standard-mode (Sm) up to 100 kHz and Fast-mode (Fm) up to 400 kHz</td></tr><tr><td>0x1</td><td>Fast-mode Plus (Fm+) up to 1 MHz</td></tr><tr><td>0x2</td><td>High-speed mode (Hs-mode) up to 3.4 MHz</td></tr><tr><td>0x3</td><td>Reserved</td></tr></table>

These bits are not synchronized.

## z Bit 23 – SEXTTOEN: Slave SCL Low Extend Time-Out

This bit enables the slave SCL low extend time-out. If SCL is cumulatively held low for greater than 25ms from the initial START to a STOP, the slave will release its clock hold if enabled and reset the internal state machine. Any interrupts set at the time of time-out will remain set. If the address was recognized, PREC will be set when a STOP is received.

0: Time-out disabled

1: Time-out enabled

This bit is not synchronized.

## Bit 22 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 21:20 – SDAHOLD[1:0]: SDA Hold Time These bits define the SDA hold time with respect to the negative edge of SCL.

Table 27-6. SDA Hold Time

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIS</td><td>Disabled</td></tr><tr><td>0x1</td><td>75</td><td>50-100ns hold time</td></tr><tr><td>0x2</td><td>450</td><td>300-600ns hold time</td></tr><tr><td>0x3</td><td>600</td><td>400-800ns hold time</td></tr></table>

These bits are not synchronized.

## z Bits 19:17 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 16 – PINOUT: Pin Usage

This bit sets the pin usage to either two- or four-wire operation:

0: 4-wire operation disabled

1: 4-wire operation enabled

This bit is not synchronized.

## Bits 15:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 7 – RUNSTDBY: Run in Standby

This bit defines the functionality in standby sleep mode.

0: Disabled – All reception is dropped.

1: Wake on address match, if enabled.

This bit is not synchronized.

## z Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 4:2 – MODE[2:0]: Operating Mode

These bits must be written to 0x04 to select the I<sup>2</sup>C slave serial communication interface of the SERCOM. These bits are not synchronized.

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled.

1: The peripheral is enabled.

Due to synchronization, there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately and the Enable Synchronization Busy bit in the Synchronization busy register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE will be cleared when the operation is complete.

This bit is not enable-protected.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the SERCOM, except DBGCTRL, to their initial state, and the SERCOM will be disabled.

Writing a one to CTRLA.SWRST will always take precedence, meaning that all other writes in the same writeoperation will be discarded. Any register write access during the ongoing reset will result in an APB error. Reading any register will return the reset value of the register.

Due to synchronization, there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and SYNCBUSY.SWRST will both be cleared when the reset is complete.

This bit is not enable-protected.

## 27.8.1.2 Control B

Name: CTRLB

Offset: 0x04

Reset: 0x00000000

Property: Write-Protected, Enable-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>ACKACT</td><td colspan="2">CMD[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="2">AMODE[1:0]</td><td></td><td></td><td></td><td>AACKEN</td><td>GCMD</td><td>SMEN</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:19 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 18 – ACKACT: Acknowledge Action

0: Send ACK

1: Send NACK

The Acknowledge Action (ACKACT) bit defines the slave's acknowledge behavior after an address or data byte is received from the master. The acknowledge action is executed when a command is written to the CMD bits. If smart mode is enabled (CTRLB.SMEN is one), the acknowledge action is performed when the DATA register is read.

This bit is not enable-protected.

## z Bits 17:16 – CMD[1:0]: Command

Writing the Command bits (CMD) triggers the slave operation as defined in Table 27-7. The CMD bits are strobe bits, and always read as zero. The operation is dependent on the slave interrupt flags, INTFLAG.DRDY and INTFLAG.AMATCH, in addition to STATUS.DIR (See Table 27-7).

All interrupt flags (INTFLAG.DRDY, INTFLAG.AMATCH and INTFLAG.PREC) are automatically cleared when a command is given.

This bit is not enable-protected.

Table 27-7. Command Description

<table><tr><td>CMD[1:0]</td><td>DIR</td><td>Action</td></tr><tr><td>0x0</td><td>X</td><td>(No action)</td></tr><tr><td>0x1</td><td>X</td><td>(Reserved)</td></tr><tr><td rowspan="3">0x2</td><td colspan="2">Used to complete a transaction in response to a data interrupt (DRDY)</td></tr><tr><td>0 (Master write)</td><td>Execute acknowledge action succeeded by waiting for any start (S/Sr) condition</td></tr><tr><td>1 (Master read)</td><td>Wait for any start (S/Sr) condition</td></tr><tr><td rowspan="6">0x3</td><td colspan="2">Used in response to an address interrupt (AMATCH)</td></tr><tr><td>0 (Master write)</td><td>Execute acknowledge action succeeded by reception of next byte</td></tr><tr><td>1 (Master read)</td><td>Execute acknowledge action succeeded by slave data interrupt</td></tr><tr><td colspan="2">Used in response to a data interrupt (DRDY)</td></tr><tr><td>0 (Master write)</td><td>Execute acknowledge action succeeded by reception of next byte</td></tr><tr><td>1 (Master read)</td><td>Execute a byte read operation followed by ACK/NACK reception</td></tr></table>

z Bits 15:14 – AMODE[1:0]: Address Mode  
These bits set the addressing mode according to Table 27-8.

Table 27-8. Address Mode Description

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>MASK</td><td>The slave responds to the address written in ADDR.ADDR masked by the value in ADDR.ADDRMASK(1).</td></tr><tr><td>0x1</td><td>2_ADDRS</td><td>The slave responds to the two unique addresses in ADDR.ADDR and ADDR.ADDRMASK.</td></tr><tr><td>0x2</td><td>RANGE</td><td>The slave responds to the range of addresses between and including ADDR.ADDR and ADDR.ADDRMASK. ADDR.ADDR is the upper limit.</td></tr><tr><td>0x3</td><td>-</td><td>Reserved.</td></tr></table>

Note: 1. See “SERCOM – Serial Communication Interface” on page 430 for additional information.

These bits are not write-synchronized.

## Bits 13:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 10– AACKEN: Automatic Acknowledge Enable

This bit enables the address to be automatically acknowledged if there is an address match.

0: Automatic acknowledge is disabled.

1: Automatic acknowledge is enabled.

This bit is not write-synchronized.

## z Bit 9 – GCMD: PMBus Group Command

This bit enables PMBus group command support. When enabled, a STOP interrupt will be generated if the slave has been addressed since the last STOP condition on the bus.

0: Group command is disabled.

1: Group command is enabled.

This bit is not write-synchronized.

## z Bit 8 – SMEN: Smart Mode Enable

This bit enables smart mode. When smart mode is enabled, acknowledge action is sent when DATA.DATA is read.

0: Smart mode is disabled.

1: Smart mode is enabled.

This bit is not write-synchronized.

## z Bits 7:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 27.8.1.3 Interrupt Enable Clear

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

Name: INTENCLR

Offset: 0x14

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td></td><td>DRDY</td><td>AMATCH</td><td>PREC</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7– ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Error Interrupt Enable bit, which disables the Error interrupt.

## z Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – DRDY: Data Ready Interrupt Enable

0: The Data Ready interrupt is disabled.

1: The Data Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Data Ready bit, which disables the Data Ready interrupt.

## z Bit 1 – AMATCH: Address Match Interrupt Enable

0: The Address Match interrupt is disabled.

1: The Address Match interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Address Match Interrupt Enable bit, which disables the Address Match interrupt.

## Bit 0 – PREC: Stop Received Interrupt Enable

0: The Stop Received interrupt is disabled.

1: The Stop Received interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Stop Received bit, which disables the Stop Received interrupt.

## 27.8.1.4 Interrupt Enable Set

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

Name: INTENSET

Offset: 0x16

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td></td><td>DRDY</td><td>AMATCH</td><td>PREC</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7 – ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Error Interrupt Enable bit, which enables the Error interrupt.

## z Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – DRDY: Data Ready Interrupt Enable

0: The Data Ready interrupt is disabled.

1: The Data Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Data Ready bit, which enables the Data Ready interrupt.

## z Bit 1 – AMATCH: Address Match Interrupt Enable

0: The Address Match interrupt is disabled.

1: The Address Match interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Address Match Interrupt Enable bit, which enables the Address Match interrupt.

## Bit 0 – PREC: Stop Received Interrupt Enable

0: The Stop Received interrupt is disabled.

1: The Stop Received interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Stop Received bit, which enables the Stop Received interrupt.

## 27.8.1.5 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x18

Reset: 0x00

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td></td><td>DRDY</td><td>AMATCH</td><td>PREC</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7– ERROR: Error

This flag is cleared by writing a one to it.

This bit is set when any error is detected. Errors that will set this flag have corresponding status flags in the STATUS register. Errors that will set this flag are SEXTTOUT, LOWTOUT, COLL, and BUSERR.Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 2 – DRDY: Data Ready

This flag is set when a I<sup>2</sup>C slave byte transmission is successfully completed.

The flag is cleared by hardware when either:

z Writing to the DATA register.

z Reading the DATA register with smart mode enabled.

z Writing a valid command to the CMD register.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Data Ready interrupt flag. Optionally, the flag can be cleared manually by writing a one to INTFLAG.DRDY.

## z Bit 1 – AMATCH: Address Match

This flag is set when the I<sup>2</sup>C slave address match logic detects that a valid address has been received.

The flag is cleared by hardware when CTRL.CMD is written.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Address Match interrupt flag. Optionally the flag can be cleared manually by writing a one to INTFLAG.AMATCH. When cleared, an ACK/NACK will be sent according to CTRLB.ACKACT.

## ● Bit 0 – PREC: Stop Received

This flag is set when a stop condition is detected for a transaction being processed. A stop condition detected between a bus master and another slave will not set this flag.

This flag is cleared by hardware after a command is issued on the next address match.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Stop Received interrupt flag. Optionally, the flag can be cleared manually by writing a one to INTFLAG.PREC.

## 27.8.1.6 Status

Name: STATUS

Offset: 0x1A

Reset: 0x0000

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>HS</td><td>SEXTTOUT</td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>CLKHOLD</td><td>LOWTOUT</td><td></td><td>SR</td><td>DIR</td><td>RXNACK</td><td>COLL</td><td>BUSERR</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 10 – HS: High-speed

This bit is set if the slave detects a START followed by a Master Code transmission.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the status. However, this flag is automatically cleared when a STOP is received.

## z Bit 9 – SEXTTOUT: Slave SCL Low Extend Time-Out

This bit is set if a slave SCL low extend time-out occurs.

This bit is cleared automatically if responding to a new start condition with ACK or NACK (write 3 to CTRLB.CMD) or when INTFLAG.AMATCH is cleared.

0: No SCL low extend time-out has occurred.

1: SCL low extend time-out has occurred.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the status.

## z Bit 8 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 7 – CLKHOLD: Clock Hold

The slave Clock Hold bit (STATUS.CLKHOLD) is set when the slave is holding the SCL line low, stretching the I<sup>2</sup>C clock. Software should consider this bit a read-only status flag that is set when INTFLAG.DRDY or INT-FLAG.AMATCH is set.

This bit is automatically cleared when the corresponding interrupt is also cleared.

## z Bit 6 – LOWTOUT: SCL Low Time-out

This bit is set if an SCL low time-out occurs.

This bit is cleared automatically if responding to a new start condition with ACK or NACK (write 3 to

CTRLB.CMD) or when INTFLAG.AMATCH is cleared.

0: No SCL low time-out has occurred.

1: SCL low time-out has occurred.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the status.

## Bit 5 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 4 – SR: Repeated Start

When INTFLAG.AMATCH is raised due to an address match, SR indicates a repeated start or start condition.

0: Start condition on last address match

1: Repeated start condition on last address match

This flag is only valid while the INTFLAG.AMATCH flag is one.

## z Bit 3 – DIR: Read / Write Direction

The Read/Write Direction (STATUS.DIR) bit stores the direction of the last address packet received from a master.

0: Master write operation is in progress.

1: Master read operation is in progress.

## z Bit 2 – RXNACK: Received Not Acknowledge

This bit indicates whether the last data packet sent was acknowledged or not.

0: Master responded with ACK.

1: Master responded with NACK.

## z Bit 1 – COLL: Transmit Collision

If set, the I<sup>2</sup>C slave was not able to transmit a high data or NACK bit, the I<sup>2</sup>C slave will immediately release the SDA and SCL lines and wait for the next packet addressed to it.

This flag is intended for the SMBus address resolution protocol (ARP). A detected collision in non-ARP situations indicates that there has been a protocol violation, and should be treated as a bus error.

Note that this status will not trigger any interrupt, and should be checked by software to verify that the data were sent correctly. This bit is cleared automatically if responding to an address match with an ACK or a NACK (writ ing 0x3 to CTRLB.CMD), or INTFLAG.AMATCH is cleared.

0: No collision detected on last data byte sent.

1: Collision detected on last data byte sent.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the status.

## z Bit 0 – BUSERR: Bus Error

The Bus Error bit (STATUS.BUSERR) indicates that an illegal bus condition has occurred on the bus, regardless of bus ownership. An illegal bus condition is detected if a protocol violating start, repeated start or stop is detected on the I<sup>2</sup>C bus lines. A start condition directly followed by a stop condition is one example of a protocol violation. If a time-out occurs during a frame, this is also considered a protocol violation, and will set STATUS.BUSERR.

This bit is cleared automatically if responding to an address match with an ACK or a NACK (writing 0x3 to CTRLB.CMD) or INTFLAG.AMATCH is cleared.

0: No bus error detected.

1: Bus error detected.

Writing a one to this bit will clear the status.

Writing a zero to this bit has no effect.

## 27.8.1.7 Synchronization Busy

Name: SYNCBUSY

Offset: 0x1C

Reset: 0x00000000

Property:

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bits 31:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – ENABLE: SERCOM Enable Synchronization Busy

Enabling and disabling the SERCOM (CTRLA.ENABLE) requires synchronization. When written, the SYNC-BUSY.ENABLE bit will be set until synchronization is complete.

Writes to any register (except for CTRLA.SWRST) while enable synchronization is on-going will be discarded and an APB error will be generated.

0: Enable synchronization is not busy.

1: Enable synchronization is busy.

## z Bit 0 – SWRST: Software Reset Synchronization Busy

Resetting the SERCOM (CTRLA.SWRST) requires synchronization. When written, the SYNCBUSY.SWRST bit will be set until synchronization is complete.

Writes to any register while synchronization is on-going will be discarded and an APB error will be generated. 0: SWRST synchronization is not busy.

1: SWRST synchronization is busy.

## 27.8.1.8 Address

Name: ADDR

Offset: 0x24

Reset: 0x00000000

Property: Write-Protected, Enable-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">ADDRMASK[9:7]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="7">ADDRMASK[6:0]</td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>TENBITEN</td><td></td><td></td><td></td><td></td><td colspan="3">ADDR[9:7]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="7">ADDR[6:0]</td><td>GENCEN</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:27 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 26:17 – ADDRMASK[9:0]: Address Mask

The ADDRMASK bits acts as a second address match register, an address mask register or the lower limit of an address range, depending on the CTRLB.AMODE setting.

## z Bit 16– Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 15– TENBITEN: Ten Bit Addressing Enable

Writing a one to TENBITEN enables 10-bit address recognition.

0: 10-bit address recognition disabled.

1: 10-bit address recognition enabled.

## Bits 14:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 10:1 – ADDR[9:0]: Address

The slave address (ADDR) bits contain the I<sup>2</sup>C slave address used by the slave address match logic to determine if a master has addressed the slave.

When using 7-bit addressing, the slave address is represented by ADDR.ADDR[6:0].

When using 10-bit addressing (ADDR.TENBITEN=1), the slave address is represented by ADDR.ADDR[9:0] When the address match logic detects a match, INTFLAG.AMATCH is set and STATUS.DIR is updated to indicate whether it is a read or a write transaction.

## z Bit 0 – GENCEN: General Call Address Enable

Writing a one to GENCEN enables general call address recognition. A general call address is an address of all zeroes with the direction bit written to zero (master write).

0: General call address recognition disabled.

1: General call address recognition enabled.

## 27.8.1.9 Data

Name: DATA

Offset: 0x28

Reset: 0x0000

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 7:0 – DATA[7:0]: Data

The slave data register I/O location (DATA.DATA) provides access to the master transmit and receive data buffers. Reading valid data or writing data to be transmitted can be successfully done only when SCL is held low by the slave (STATUS.CLKHOLD is set). An exception occurs when reading the last data byte after the stop condition has been received.

Accessing DATA.DATA auto-triggers I<sup>2</sup>C bus operations. The operation performed depends on the state of CTRLB.ACKACT, CTRLB.SMEN and the type of access (read/write).

Writing or reading DATA.DATA when not in smart mode does not require synchronization.

## 27.8.2 I<sup>2</sup>C Master Register Description

## 27.8.2.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00000000

Property: Write-Protected, Enable-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td>LOWTOUT</td><td colspan="2">INACTOUT[1:0]</td><td>SCLSM</td><td></td><td colspan="2">SPEED[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td>SEXTTOEN</td><td>MEXTTOEN</td><td colspan="2">SDAHOLD[1:0]</td><td></td><td></td><td></td><td>PINOUT</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RUNSTDBY</td><td></td><td></td><td colspan="3">MODE[2:0]=101</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 31 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 30 – LOWTOUT: SCL Low Time-Out

This bit enables the SCL low time-out. If SCL is held low for 25ms-35ms, the master will release its clock hold, if enabled, and complete the current transaction. A stop condition will automatically be transmitted.

INTFLAG.SB or INTFLAG.MB will be set as normal, but the clock hold will be released. The STATUS.LOW-TOUT and STATUS.BUSERR status bits will be set.

0: Time-out disabled.

1: Time-out enabled.

This bit is not synchronized.

## z Bits 29:28 – INACTOUT[1:0]: Inactive Time-Out

If the inactive bus time-out is enabled and the bus is inactive for longer than the time-out setting, the bus state logic will be set to idle. An inactive bus arise when either an I<sup>2</sup>C master or slave is holding the SCL low. The available time-outs are given in Table 27-9.

Enabling this option is necessary for SMBus compatibility, but can also be used in a non-SMBus set-up.

Table 27-9. Inactive Timout

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIS</td><td>Disabled</td></tr><tr><td>0x1</td><td>55US</td><td>5-6 SCL cycle time-out (50-60μs)</td></tr><tr><td>0x2</td><td>105US</td><td>10-11 SCL cycle time-out (100-110μs)</td></tr><tr><td>0x3</td><td>205US</td><td>20-21 SCL cycle time-out (200-210μs)</td></tr></table>

Calculated time-out periods are based on a 100kHz baud rate.  
These bits are not synchronized.

## Bit 27– SCLSM: SCL Clock Stretch Mode

This bit controls when SCL will be stretch for software interaction.

0: SCL stretch according to Figure 27-7.

1: SCL stretch only after ACK bit.

This bit is not synchronized.

## z Bit 26– Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 25:24 – SPEED[1:0]: Transfer Speed These bits define bus speed.

Table 27-10. Transfer Speed

<table><tr><td>Value</td><td>Description</td></tr><tr><td>0x0</td><td>Standard-mode (Sm) up to 100 kHz and Fast-mode (Fm) up to 400 kHz</td></tr><tr><td>0x1</td><td>Fast-mode Plus (Fm+) up to 1 MHz</td></tr><tr><td>0x2</td><td>High-speed mode (Hs-mode) up to 3.4 MHz</td></tr><tr><td>0x3</td><td>Reserved</td></tr></table>

These bits are not synchronized.

## ● Bit 23 – SEXTTOEN: Slave SCL Low Extend Time-Out

This bit enables the slave SCL low extend time-out. If SCL is cumulatively held low for greater than 25ms from the initial START to a STOP, the slave will release its clock hold if enabled and reset the internal state machine. Any interrupts set at the time of time-out will remain set. If the address was recognized, PREC will be set when a STOP is received.

0: Time-out disabled

1: Time-out enabled

This bit is not synchronized.

## Bit 22 – MEXTTOEN: Master SCL Low Extend Time-Out

This bit enables the master SCL low extend time-out. If SCL is cumulatively held low for greater than 10ms from START-to-ACK, ACK-to-ACK, or ACK-to-STOP the master will release its clock hold if enabled, and complete the current transaction. A STOP will automatically be transmitted.

SB or MB will be set as normal, but CLKHOLD will be release. The MEXTTOUT and BUSERR status bits will be set.

0: Time-out disabled

1: Time-out enabled

This bit is not synchronized.

## ● Bits 21:20 – SDAHOLD[1:0]: SDA Hold Time

These bits define the SDA hold time with respect to the negative edge of SCL.

Table 27-11. SDA Hold Time

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIS</td><td>Disabled</td></tr><tr><td>0x1</td><td>75NS</td><td>50-100ns hold time</td></tr><tr><td>0x2</td><td>450NS</td><td>300-600ns hold time</td></tr><tr><td>0x3</td><td>600NS</td><td>400-800ns hold time</td></tr></table>

These bits are not synchronized.

## z Bits 19:17 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 16 – PINOUT: Pin Usage

This bit set the pin usage to either two- or four-wire operation:

0: 4-wire operation disabled.

1: 4-wire operation enabled.

This bit is not synchronized.

## z Bits 15:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 7 – RUNSTDBY: Run in Standby

This bit defines the functionality in standby sleep mode.

0: GCLK\_SERCOMx\_CORE is disabled and the I<sup>2</sup>C master will not operate in standby sleep mode.

1: GCLK\_SERCOMx\_CORE is enabled in all sleep modes allowing the master to operate in standby sleep mode.

This bit is not synchronized.

## z Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 4:2 – MODE[2:0]: Operating Mode

These bits must be written to 0x5 to select the I<sup>2</sup>C master serial communication interface of the SERCOM. These bits are not synchronized.

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled.

1: The peripheral is enabled.

Due to synchronization, there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately and the Synchronization Enable Busy bit in the Syncbusy register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE will be cleared when the operation is complete.

This bit is not enable-protected.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the SERCOM, except DBGCTRL, to their initial state, and the SERCOM will be disabled.

Writing a one to CTRLA.SWRST will always take precedence, meaning that all other writes in the same writeoperation will be discarded. Any register write access during the ongoing reset will result in an APB error. Reading any register will return the reset value of the register.

Due to synchronization there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and SYNCBUSY.SWRST will both be cleared when the reset is complete.

This bit is not enable-protected.

## 27.8.2.2 Control B

Name: CTRLB

Offset: 0x04

Reset: 0x00000000

Property: Write-Protected, Enable-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>ACKACT</td><td colspan="2">CMD[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>QCEN</td><td>SMEN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:19 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 18 – ACKACT: Acknowledge Action

The Acknowledge Action (ACKACT) bit defines the I<sup>2</sup>C master's acknowledge behavior after a data byte is received from the I<sup>2</sup>C slave. The acknowledge action is executed when a command is written to CTRLB.CMD, or if smart mode is enabled (CTRLB.SMEN is written to one), when DATA.DATA is read.

0: Send ACK.

1: Send NACK.

This bit is not enable-protected.

This bit is not write-synchronized.

## z Bits 17:16 – CMD[1:0]: Command

Writing the Command bits (CMD) triggers the master operation as defined in Table 27-12. The CMD bits are strobe bits, and always read as zero. The acknowledge action is only valid in master read mode. In master write mode, a command will only result in a repeated start or stop condition. The CTRLB.ACKACT bit and the CMD bits can be written at the same time, and then the acknowledge action will be updated before the command is triggered.

Commands can only be issued when the Slave on Bus interrupt flag (INTFLAG.SB) or Master on Bus interrupt flag (INTFLAG.MB) is one.

If CMD 0x1 is issued, a repeated start will be issued followed by the transmission of the current address in ADDR.ADDR. If another address is desired, ADDR.ADDR must be written instead of the CMD bits. This will trigger a repeated start followed by transmission of the new address.

Issuing a command will set STATUS.SYNCBUSY.

Table 27-12. Command Description

<table><tr><td>CMD[1:0]</td><td>Direction</td><td>Action</td></tr><tr><td>0x0</td><td>X</td><td>(No action)</td></tr><tr><td>0x1</td><td>X</td><td>Execute acknowledge action succeeded by repeated Start</td></tr><tr><td rowspan="2">0x2</td><td>0 (Write)</td><td>No operation</td></tr><tr><td>1 (Read)</td><td>Execute acknowledge action succeeded by a byte read operation</td></tr><tr><td>0x3</td><td>X</td><td>Execute acknowledge action succeeded by issuing a stop condition</td></tr></table>

These bits are not enable-protected.

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 9 – QCEN: Quick Command Enable

Setting the Quick Command Enable bit (QCEN) enables quick command.

0: Quick Command is disabled.

1: Quick Command is enabled.

This bit is not write-synchronized.

## z Bit 8 – SMEN: Smart Mode Enable

This bit enables smart mode. When smart mode is enabled, acknowledge action is sent when DATA.DATA is read.

0: Smart mode is disabled.

1: Smart mode is enabled.

This bit is not write-synchronized.

## z Bits 7:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 27.8.2.3 Baud Rate

Name: BAUD

Offset: 0x0C

Reset: 0x0000

Property: Write-Protected, Enable-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">HSBAUDLOW[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">HSBAUD[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">BAUDLOW[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">BAUD[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:24 – HSBAUDLOW[7:0]: High Speed Master Baud Rate Low HSBAUDLOW not equal to 0

HSBAUDLOW indicates the SCL low time according to the following formula.

$$
H S B A U D L O W = f _ {G C L K} T _ {L O W} - 1
$$

## HSBAUDLOW equal to 0

The HSBAUD register is used to time ${ \sf T } _ { \sf L O W }$ <sub>,</sub> T<sub>HIGH,</sub> T<sub>SU;STO,</sub> ${ \mathsf { T } } _ { { \mathsf { H D } } ; { \mathsf { S T A } } }$ and $\mathsf { T } _ { \mathsf { S U } ; \mathsf { S T A } }$ ${ \sf T } _ { \sf B U F }$ is timed by the BAUD register.

z Bits 23:16 – HSBAUD[7:0]: High Speed Master Baud Rate

The HSBAUD register indicates the SCL high time according to the following formula. When HSBAUDLOW is zero, $\mathsf { T } _ { \mathsf { L O W } }$ <sub>,</sub> T<sub>HIGH,</sub> T<sub>SU;STO,</sub> $\mathsf { T } _ { \mathsf { H D } ; \mathsf { S T A } }$ and $\mathsf { T } _ { \mathsf { S U } ; \mathsf { S T A } }$ are derived using this formula. ${ \sf T } _ { \sf B U F }$ is timed by the BAUD register.

$$
B A U D = f _ {G C L K} T _ {H I G H} - 1
$$

## z Bits 15:8 – BAUDLOW[7:0]: Master Baud Rate Low

If the Master Baud Rate Low bit group (BAUDLOW) has a non-zero value, the SCL low time will be described by the value written.

For more information on how to calculate the frequency, see “SERCOM I2C – SERCOM Inter-Integrated Circuit” on page 509.

## z Bits 7:0 – BAUD[7:0]: Master Baud Rate

The Master Baud Rate bit group (BAUD) is used to derive the SCL high time if BAUD.BAUDLOW is non-zero. If BAUD.BAUDLOW is zero, BAUD will be used to generate both high and low periods of the SCL.

For more information on how to calculate the frequency, see “SERCOM I2C – SERCOM Inter-Integrated Circuit” on page 509.

## 27.8.2.4 Interrupt Enable Clear

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

Name: INTENCLR

Offset: 0x14

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td></td><td></td><td>SB</td><td>MB</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7– ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Error Interrupt Enable bit, which disables the Error interrupt.

## z Bits 6:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – SB: Slave on Bus Interrupt Enable

0: The Slave on Bus interrupt is disabled.

1: The Slave on Bus interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Slave on Bus Interrupt Enable bit, which disables the Slave on Bus interrupt.

## z Bit 0 – MB: Master on Bus Interrupt Enable

0: The Master on Bus interrupt is disabled.

1: The Master on Bus interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Master on Bus Interrupt Enable bit, which disables the Master on Bus interrupt.

## 27.8.2.5 Interrupt Enable Set

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

Name: INTENSET

Offset: 0x16

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td></td><td></td><td>SB</td><td>MB</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7 – ERROR: Error Interrupt Enable

0: Error interrupt is disabled.

1: Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Error Interrupt Enable bit, which enables the Error interrupt.

## z Bits 6:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 1 – SB: Slave on Bus Interrupt Enable

0: The Slave on Bus interrupt is disabled.

1: The Slave on Bus interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Slave on Bus Interrupt Enable bit, which enables the Slave on Bus interrupt.

## Bit 0 – MB: Master on Bus Interrupt Enable

0: The Master on Bus interrupt is disabled.

1: The Master on Bus interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Master on Bus Interrupt Enable bit, which enables the Master on Bus interrupt.

## 27.8.2.6 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x18

Reset: 0x00

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ERROR</td><td></td><td></td><td></td><td></td><td></td><td>SB</td><td>MB</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7– ERROR: Error

This flag is cleared by writing a one to it.

This bit is set when any error is detected. Errors that will set this flag have corresponding status flags in the STATUS register. Errors that will set this flag are LENERR, SEXTTOUT, MEXTTOUT, LOWTOUT, ARBLOST, and BUSERR.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the flag.

## Bits 6:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 1 – SB: Slave on Bus

The Slave on Bus flag (SB) is set when a byte is successfully received in master read mode, i.e., no arbitration lost or bus error occurred during the operation. When this flag is set, the master forces the SCL line low, stretching the I<sup>2</sup>C clock period. The SCL line will be released and SB will be cleared on one of the following actions:

z Writing to ADDR.ADDR

z Writing to DATA.DATA

z Reading DATA.DATA when smart mode is enabled (CTRLB.SMEN)

z Writing a valid command to CTRLB.CMD

Writing a one to this bit location will clear the SB flag. The transaction will not continue or be terminated until one of the above actions is performed.

Writing a zero to this bit has no effect.

## Bit 0 – MB: Master on Bus

The Master on Bus flag (MB) is set when a byte is transmitted in master write mode. The flag is set regardless of the occurrence of a bus error or an arbitration lost condition. MB is also set when arbitration is lost during sending of NACK in master read mode, and when issuing a start condition if the bus state is unknown. When this flag is set and arbitration is not lost, the master forces the SCL line low, stretching the I<sup>2</sup>C clock period. The SCL line will be released and MB will be cleared on one of the following actions:

z Writing to ADDR.ADDR

z Writing to DATA.DATA

z Reading DATA.DATA when smart mode is enabled (CTRLB.SMEN)

z Writing a valid command to CTRLB.CMD

If arbitration is lost, writing a one to this bit location will clear the MB flag.

If arbitration is not lost, writing a one to this bit location will clear the MB flag. The transaction will not continue or be terminated until one of the above actions is performed.

Writing a zero to this bit has no effect.

## 27.8.2.7 Status

Name: STATUS

Offset: 0x1A

Reset: 0x0000

Property: Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>LENERR</td><td>SEXTTOUT</td><td>MEXTTOUT</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>CLKHOLD</td><td>LOWTOUT</td><td colspan="2">BUSSTATE[1:0]</td><td></td><td>RXNACK</td><td>ARBLOST</td><td>BUSERR</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 10 – LENERR: Transaction Length Error

This bit is set when automatic length is used for a DMA transaction and the slave sends a NACK before ADDR.LEN bytes have been written by the master.

Writing a one to this bit location will clear STATUS.LENERR. This flag is automatically cleared when writing to the ADDR register.

Writing a zero to this bit has no effect.

This bit is not write-synchronized.

## z Bit 9 – SEXTTOUT: Slave SCL Low Extend Time-Out

This bit is set if a slave SCL low extend time-out occurs.

Writing a one to this bit location will clear STATUS.SEXTTOUT. Normal use of the I<sup>2</sup>C interface does not require the STATUS.SEXTTOUT flag to be cleared by this method. This flag is automatically cleared when writ ing to the ADDR register.

Writing a zero to this bit has no effect.

This bit is not write-synchronized.

## z Bit 8 – MEXTTOUT: Master SCL Low Extend Time-Out

This bit is set if a master SCL low time-out occurs.

Writing a one to this bit location will clear STATUS.MEXTTOUT. Normal use of the I<sup>2</sup>C interface does not require the STATUS.MEXTTOUT flag to be cleared by this method. This flag is automatically cleared when writ ing to the ADDR register.

Writing a zero to this bit has no effect.

This bit is not write-synchronized.

## ● Bit 7 – CLKHOLD: Clock Hold

The Master Clock Hold flag (STATUS.CLKHOLD) is set when the master is holding the SCL line low, stretching the I<sup>2</sup>C clock. Software should consider this bit a read-only status flag that is set when INTFLAG.SB or INT-

FLAG.MB is set. When the corresponding interrupt flag is cleared and the next operation is given, this bit is automatically cleared.

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

This bit is not write-synchronized.

## z Bit 6 – LOWTOUT: SCL Low Time-Out

This bit is set if an SCL low time-out occurs.

Writing a one to this bit location will clear STATUS.LOWTOUT. Normal use of the I<sup>2</sup>C interface does not require the LOWTOUT flag to be cleared by this method. This flag is automatically cleared when writing to the ADDR register.

Writing a zero to this bit has no effect.

This bit is not write-synchronized.

## ● Bits 5:4 – BUSSTATE[1:0]: Bus State

These bits indicate the current I<sup>2</sup>C bus state as defined in Table 27-13. After enabling the SERCOM as an I<sup>2</sup>C master, the bus state will be unknown.

Table 27-13. Bus State

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>Unknown</td><td>The bus state is unknown to the I2C master and will wait for a stop condition to be detected or wait to be forced into an idle state by software</td></tr><tr><td>0x1</td><td>Idle</td><td>The bus state is waiting for a transaction to be initialized</td></tr><tr><td>0x2</td><td>Owner</td><td>The I2C master is the current owner of the bus</td></tr><tr><td>0x3</td><td>Busy</td><td>Some other I2C master owns the bus</td></tr></table>

When the master is disabled, the bus-state is unknown. When in the unknown state, writing 0x1 to BUSSTATE forces the bus state into the idle state. The bus state cannot be forced into any other state. Writing STATUS.BUSSTATE to idle will set STATUS.SYNCBUSY.

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 2 – RXNACK: Received Not Acknowledge

This bit indicates whether the last address or data packet sent was acknowledged or not.

0: Slave responded with ACK.

1: Slave responded with NACK.

Writing a zero to this bit has no effect.

Writing a one to this bit has no effect.

This bit is not write-synchronized.

## ● Bit 1 – ARBLOST: Arbitration Lost

The Arbitration Lost flag (STATUS.ARBLOST) is set if arbitration is lost while transmitting a high data bit or a NACK bit, or while issuing a start or repeated start condition on the bus. The Master on Bus interrupt flag (INT-FLAG.MB) will be set when STATUS.ARBLOST is set.

Writing the ADDR.ADDR register will automatically clear STATUS.ARBLOST.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

This bit is not write-synchronized.

## z Bit 0 – BUSERR: Bus Error

The Bus Error bit (STATUS.BUSERR) indicates that an illegal bus condition has occurred on the bus, regardless of bus ownership. An illegal bus condition is detected if a protocol violating start, repeated start or stop is detected on the I<sup>2</sup>C bus lines. A start condition directly followed by a stop condition is one example of a protocol violation. If a time-out occurs during a frame, this is also considered a protocol violation, and will set BUSERR. If the I<sup>2</sup>C master is the bus owner at the time a bus error occurs, STATUS.ARBLOST and INTFLAG.MB will be set in addition to BUSERR.

Writing the ADDR.ADDR register will automatically clear the BUSERR flag.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear it.

This bit is not write-synchronized.

## 27.8.2.8 Syncbusy

Name: SYNCBUSY

Offset: 0x1C

Reset: 0x00000000

Property:

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SYSOP</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 2– SYSOP: System Operation Synchronization Busy

Writing CTRLB, STATUS.BUSSTATE, ADDR, or DATA when the SERCOM is enabled requires synchronization. When written, the SYNCBUSY.SYSOP bit will be set until synchronization is complete.

0: System operation synchronization is not busy.

1: System operation synchronization is busy.

## z Bit 1 – ENABLE: SERCOM Enable Synchronization Busy

Enabling and disabling the SERCOM (CTRLA.ENABLE) requires synchronization. When written, the SYNC-BUSY.ENABLE bit will be set until synchronization is complete.

Writes to any register (except for CTRLA.SWRST) while enable synchronization is on-going will be discarded and an APB error will be generated.

0: Enable synchronization is not busy.

1: Enable synchronization is busy.

## z Bit 0 – SWRST: Software Reset Synchronization Busy

Resetting the SERCOM (CTRLA.SWRST) requires synchronization. When written, the SYNCBUSY.SWRST bit will be set until synchronization is complete.

Writes to any register while synchronization is on-going will be discarded and an APB error will be generated.

0: SWRST synchronization is not busy.

1: SWRST synchronization is busy.

## 27.8.2.9 Address

Name: ADDR

Offset: 0x24

Reset: 0x0000

Property: Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td colspan="9">LEN[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td colspan="2">TENBITEN</td><td>HS</td><td>LENEN</td><td></td><td></td><td colspan="3">ADDR[10:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">ADDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 23:16 – LEN[7:0]: Transaction Length

For DMA operation, this field represents the data length of the transaction from 0 to 255 bytes. The transaction length enable (ADDR.LENEN) must be written to 1 for automatic transaction length to be used. After ADDR.LEN bytes have been transmitted or received, a NACK (for master reads) and STOP are automatically generated.

## z Bit 15 – TENBITEN: Ten Bit Addressing Enable

This bit enables 10-bit addressing. This bit can be written simultaneously with ADDR to indicate a 10-bit or 7-bit address transmission.

0: 10-bit addressing disabled.

1: 10-bit addressing enabled.

## z Bit 14 – HS: High Speed

This bit enables High-speed mode for the current transfer from repeated START to STOP. This bit can be written simultaneously with ADDR for a high speed transfer.

0: High-speed transfer disabled.

1: High-speed transfer enabled.

## Bit 13 – LENEN: Transfer Length Enable

This bit enables automatic transfer length.

0: Automatic transfer length disabled.

1: Automatic transfer length enabled.

## Bits 12:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 10:0 – ADDR[10:0]: Address

When ADDR is written, the consecutive operation will depend on the bus state:

Unknown: INTFLAG.MB and STATUS.BUSERR are set, and the operation is terminated.

Busy: The I<sup>2</sup>C master will await further operation until the bus becomes idle.

Idle: The I<sup>2</sup>C master will issue a start condition followed by the address written in ADDR. If the address is acknowledged, SCL is forced and held low, and STATUS.CLKHOLD and INTFLAG.MB are set.

Owner: A repeated start sequence will be performed. If the previous transaction was a read, the acknowledge action is sent before the repeated start bus condition is issued on the bus. Writing ADDR to issue a repeated start is performed while INTFLAG.MB or INTFLAG.SB is set.

Regardless of winning or loosing arbitration, the entire address will be sent. If arbitration is lost, only ones are transmitted from the point of loosing arbitration and the rest of the address length.

STATUS.BUSERR, STATUS.ARBLOST, INTFLAG.MB and INTFLAG.SB will be cleared when ADDR is written.

The ADDR register can be read at any time without interfering with ongoing bus activity, as a read access does not trigger the master logic to perform any bus protocol related operations.

The I<sup>2</sup>C master control logic uses bit 0 of ADDR as the bus protocol’s read/write flag (R/W); 0 for write and 1 for read.

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:16 – LEN[7:0]: Transaction Length

For DMA operation, this field represents the data length of the transaction from 0 to 255 bytes. The transaction length enable (ADDR.LENEN) must be written to 1 for automatic transaction length to be used. After ADDR.LEN bytes have been transmitted or received, a NACK (for master reads) and STOP are automatically generated.

## z Bit 15 – TENBITEN: Ten Bit Addressing Enable

This bit enables 10-bit addressing. This bit can be written simultaneously with ADDR to indicate a 10-bit or 7-bit address transmission.

0: 10-bit addressing disabled.

1: 10-bit addressing enabled.

## z Bit 14 – HS: High Speed

This bit enables High-speed mode for the current transfer from repeated START to STOP. This bit can be written simultaneously with ADDR for a high speed transfer.

0: .High-speed transfer disabled.

1: High-speed transfer enabled.

## Bit 13 – LENEN: Transfer Length Enable

This bit enables automatic transfer length.

0: Automatic transfer length disabled.

1: Automatic transfer length enabled.

## Bits 12:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 10:0 – ADDR[10:0]: Address

When ADDR is written, the consecutive operation will depend on the bus state:

Unknown: INTFLAG.MB and STATUS.BUSERR are set, and the operation is terminated.

Busy: The I<sup>2</sup>C master will await further operation until the bus becomes idle.

Idle: The I<sup>2</sup>C master will issue a start condition followed by the address written in ADDR. If the address is acknowledged, SCL is forced and held low, and STATUS.CLKHOLD and INTFLAG.MB are set.

Owner: A repeated start sequence will be performed. If the previous transaction was a read, the acknowledge action is sent before the repeated start bus condition is issued on the bus. Writing ADDR to issue a repeated start is performed while INTFLAG.MB or INTFLAG.SB is set.

Regardless of winning or loosing arbitration, the entire address will be sent. If arbitration is lost, only ones are transmitted from the point of loosing arbitration and the rest of the address length.

STATUS.BUSERR, STATUS.ARBLOST, INTFLAG.MB and INTFLAG.SB will be cleared when ADDR is written.

The ADDR register can be read at any time without interfering with ongoing bus activity, as a read access does not trigger the master logic to perform any bus protocol related operations.

The I<sup>2</sup>C master control logic uses bit 0 of ADDR as the bus protocol’s read/write flag (R/W); 0 for write and 1 for read.

## 27.8.2.10 Data

Name: DATA

Offset: 0x18

Reset: 0x0000

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td colspan="9">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:8 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 7:0 – DATA[7:0]: Data

The master data register I/O location (DATA) provides access to the master transmit and receive data buffers. Reading valid data or writing data to be transmitted can be successfully done only when SCL is held low by the master (STATUS.CLKHOLD is set). An exception occurs when reading the last data byte after the stop condition has been sent.

Accessing DATA.DATA auto-triggers I<sup>2</sup>C bus operations. The operation performed depends on the state of CTRLB.ACKACT, CTRLB.SMEN and the type of access (read/write).

Writing or reading DATA.DATA when not in smart mode does not require synchronization.

## 27.8.2.11 Debug Control

Name: DBGCTRL

Offset: 0x30

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGSTOP</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – DBGSTOP: Debug Stop Mode

This bit controls functionality when the CPU is halted by an external debugger.

0: The baud-rate generator continues normal operation when the CPU is halted by an external debugger.

1: The baud-rate generator is halted when the CPU is halted by an external debugger.

## 28. TC – Timer/Counter

## 28.1 Overview

The TC consists of a counter, a prescaler, compare/capture channels and control logic. The counter can be set to count events, or it can be configured to count clock pulses. The counter, together with the compare/capture channels can be configured to timestamp input events, allowing capture of frequency and pulse width. It can also perform waveform generation, such as frequency generation and pulse-width modulation (PWM).

## 28.2 Features

z Selectable configuration

z 8-, 16- or 32-bit TC, with compare/capture channels

z Waveform generation

z Frequency generation

z Single-slope pulse-width modulation

z Input capture

z Event capture

z Frequency capture

z Pulse-width capture

z One input event

z Interrupts/output events on:

z Counter overflow/underflow

z Compare match or capture

z Internal prescaler

z Can be used with DMA and to trigger DMA transactions

## 28.3 Block Diagram

Figure 28-1. Timer/Counter Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_d7c935337f3513d58c8f3b377b5c42d536f9cf193f7552e7d7c9d537c00d0131.jpg)

## 28.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>WO[1:0]</td><td>Digital output</td><td>Waveform output</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 28.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 28.5.1 I/O Lines

Using the TC’s I/O lines requires the I/O pins to be configured. Refer to “PORT” on page 378 for details.

## 28.5.2 Power Management

The TC can continue to operate in any sleep mode where the selected source clock is running. The TC interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 28.5.3 Clocks

The TC bus clock (CLK\_TCx\_APB, where x represents the specific TC instance number) can be enabled and disabled in the Power Manager, and the default state of CLK\_TCx\_APB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110.

The different TC instances are paired, even and odd, starting from TC1, and use the same generic clock, GCLK\_TCx. This means that the TC instances in a TC pair cannot be set up to use different GCLK\_TCx clocks.

This generic clock is asynchronous to the user interface clock (CLK\_TCx\_APB). Due to this asynchronicity, accessing certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 585 for further details.

## 28.5.4 DMA

The DMA request lines (or line if only one request) are connected to the DMA Controller (DMAC). Using the TC DMA requests requires the DMA Controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details.

## 28.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the TC interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 28.5.6 Events

To use the TC event functionality, the corresponding events need to be configured in the event system. Refer to “EVSYS – Event System” on page 405 for details.

## 28.5.7 Debug Operation

When the CPU is halted in debug mode the TC will halt normal operation. The TC can be forced to continue operation during debugging. Refer to the DBGCTRL register for details.

## 28.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

● Interrupt Flag register (INTFLAG)

Status register (STATUS)

z Read Request register (READREQ)

Count register (COUNT), “Counter Value” on page 607

z Period register (PER), “ Period Value” on page 610

Compare/Capture Value registers (CCx), “ Compare/Capture” on page 611

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 28.5.9 Analog Connections

Not applicable.

## 28.6 Functional Description

## 28.6.1 Principle of Operation

The counter in the TC can be set to count on events from the Event System, or on the GCLK\_TCx frequency. The pulses from GCLK\_TCx will go through the prescaler, where it is possible to divide the frequency down.

The value in the counter is passed to the compare/capture channels, where it can either be compared with user defined values or captured on a predefined event.

The TC can be configured as an 8-, 16- or 32-bit counter. Which mode is chosen will determine the maximum range of the counter. The counter range combined with the operating frequency will determine the maximum time resolution achievable with the TC peripheral.

The TC can be count up or down. By default, the counter will operate in a continuous mode and count up, where the counter will wrap to the zero when reaching the top value

When one of the compare/capture channels is used in compare mode, the TC can be used for waveform generation. Upon a match between the counter and the value in one or more of the Compare/Capture Value registers (CCx), one or more output pins on the device can be set to toggle. The CCx registers and the counter can thereby be used in frequency generation and PWM generation.

Capture mode can be used to automatically capture the period and pulse width of signals.

## 28.6.2 Basic Operation

## 28.6.2.1 Initialization

The following register is enable-protected, meaning that it can only be written when the TC is disabled (CTRLA.ENABLE is zero):

Control A register (CTRLA), except the Run Standby (RUNSTDBY), Enable (ENABLE) and Software Reset (SWRST) bits

The following bits are enable-protected:

Event Action bits in the Event Control register (EVCTRL.EVACT)

Enable-protected bits in the CTRLA register can be written at the same time as CTRLA.ENABLE is written to one, but not at the same time as CTRLA.ENABLE is written to zero.

Before the TC is enabled, it must be configured, as outlined by the following steps:

The TC bus clock (CLK\_TCx\_APB) must be enabled

z The mode (8, 16 or 32 bits) of the TC must be selected in the TC Mode bit group in the Control A register (CTRLA.MODE). The default mode is 16 bits

One of the wavegen modes must be selected in the Waveform Generation Operation bit group in the Control A register (CTRLA.WAVEGEN)

If the GCLK\_TCx frequency used should be prescaled, this can be selected in the Prescaler bit group in the Control A register (CTRLA.PRESCALER)

z If the prescaler is used, one of the presync modes must be chosen in the Prescaler and Counter Synchronization bit group in the Control A register (CTRLA.PRESYNC)

z One-shot mode can be selected by writing a one to the One-Shot bit in the Control B Set register (CTRLBSET.ONESHOT)

z If the counter should count down from the top value, write a one to the Counter Direction bit in the Control B Set register (CTRLBSET.DIR)

z If capture operations are to be used, the individual channels must be enabled for capture in the Capture Channel x Enable bit group in the Control C register (CTRLC.CPTEN)

The waveform output for individual channels can be inverted using the Waveform Output Invert Enable bit group in the Control C register (CTRLC.INVEN)

## 28.6.2.2 Enabling, Disabling and Resetting

The TC is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The TC is disabled by writing a zero to CTRLA.ENABLE.

The TC is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the TC, except DBGCTRL, will be reset to their initial state, and the TC will be disabled. Refer to the CTRLA register for details.

The TC should be disabled before the TC is reset to avoid undefined behavior.

## 28.6.2.3 Prescaler Selection

As seen in Figure 28-2, the GCLK\_TC clock is fed into the internal prescaler. Prescaler output intervals from 1 to 1/1024 are available. For a complete list of available prescaler outputs, see the register description for the Prescaler bit group in the Control A register (CTRLA.PRESCALER).

The prescaler consists of a counter that counts to the selected prescaler value, whereupon the output of the prescaler toggles.

When the prescaler is set to a value greater than one, it is necessary to choose whether the prescaler should reset its value to zero or continue counting from its current value on the occurrence of an overflow or underflow. It is also necessary to choose whether the TC counter should wrap around on the next GCLK\_TC clock pulse or the next prescaled clock pulse (CLK\_TC\_CNT of Figure 28-2). To do this, use the Prescaler and Counter Synchronization bit group in the Control A register (CTRLA.PRESYNC).

If the counter is set to count events from the event system, these will not pass through the prescaler, as seen in Figure 28-2.

Figure 28-2. Prescaler  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_ff6323c680ef00aebb56b01929d71d5ae555de210a2c0b5e27933a578eb06670.jpg)

## 28.6.2.4 TC Mode

The counter mode is selected with the TC Mode bit group in the Control A register (CTRLA.MODE). By default, the counter is enabled in the 16-bit counter mode.

Three counter modes are available:

COUNT8: The 8-bit TC has its own Period register (PER). This register is used to store the period value that can be used as the top value for waveform generation.

z COUNT16: This is the default counter mode. There is no dedicated period register in this mode.

z COUNT32: This mode is achieved by pairing two 16-bit TC peripherals. This pairing is explained in “Clocks” on page 575. The even-numbered TC instance will act as master to the odd-numbered TC peripheral, which will act as a slave. The slave status of the slave is indicated by reading the Slave bit in the Status register (STATUS.SLAVE). The registers of the slave will not reflect the registers of the 32-bit counter. Writing to any of the slave registers will not affect the 32-bit counter. Normal access to the slave COUNT and CCx registers is not allowed.

## 28.6.2.5 Counter Operations

The counter can be set to count up or down. When the counter is counting up and the top value is reached, the counter will wrap around to zero on the next clock cycle. When counting down, the counter will wrap around to the top value when zero is reached. In one-shot mode, the counter will stop counting after a wraparound occurs.

To set the counter to count down, write a one to the Direction bit in the Control B Set register (CTRLBSET.DIR). To count up, write a one to the Direction bit in the Control B Clear register (CTRLBCLR.DIR).

Each time the counter reaches the top value or zero, it will set the Overflow Interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.OVF). It is also possible to generate an event on overflow or underflow when the Overflow/Underflow Event Output Enable bit in the Event Control register (EVCTRL.OVFEO) is one.

The counter value can be read from the Counter Value register (COUNT) or a new value can be written to the COUNT register. Figure 28-3 gives an example of writing a new counter value. The COUNT value will always be zero when starting the TC, unless some other value has been written to it or if the TC has been previously reloaded at TOP value, because stopped while TC was counting down.

Figure 28-3. Counter Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_781283f41e07846219e36bfa5d41ffff4c156069472b93cc68584c7676019ca7.jpg)

## Stop Command

On the stop command, which can be evoked in the Command bit group in the Control B Set register (CTRLBSET.CMD), the counter will retain its current value. All waveforms are cleared. The counter stops counting, and the Stop bit in the Status register is set (STATUS.STOP).

## Retrigger Command and Event Action

Retriggering can be evoked either as a software command, using the Retrigger command in the Control B Set register (CTRLBSET.CMD), or as a retrigger event action, using the Event Action bit group in the Event Control register (EVCTRL.EVACT).

When a retrigger is evoked while the counter is running, the counter will wrap to the top value or zero, depending on the counter direction.

When a retrigger is evoked with the counter stopped, the counter will continue counting from the value in the COUNT register.

Note: When retrigger event action is configured and enabled as an event action, enabling the counter will not start the counter. The counter will start at the next incoming event and restart on any following event.

## Count Event Action

When the count event action is configured, every new incoming event will make the counter increment or decrement, depending on the state of the direction bit (CTRLBSET.DIR).

## Start Event Action

When the TC is configured with a start event action in the EVCTRL.EVACT bit group, enabling the TC does not make the counter start; the start is postponed until the next input event or software retrigger action. When the counter is running, an input event has not effect on the counter.

## 28.6.2.6 Compare Operations

When using the TC with the Compare/Capture Value registers (CCx) configured for compare operation, the counter value is continuously compared to the values in the CCx registers. This can be used for timer or waveform operation.

## Waveform Output Operations

The compare channels can be used for waveform generation on the corresponding I/O pins. To make the waveform visible on the connected pin, the following requirements must be fulfilled:

z Choose a waveform generation operation

Optionally, invert the waveform output by writing the corresponding Waveform Output Invert Enable bit in the Control C register (CTRLC.INVx)

z Enable the corresponding multiplexor in the PORT

The counter value is continuously compared with each CCx available. When a compare match occurs, the Match or Capture Channel x interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.MCx) is set on the next zero-to-one transition of CLK\_TC\_CNT (see Figure 28-4). An interrupt and/or event can be generated on such a condition when INTENSET.MCx and/or EVCTRL.MCEOx is one.

One of four configurations in the Waveform Generation Operation bit group in the Control A register (CTRLA.WAVEGEN) must be chosen to perform waveform generation. This will influence how the waveform is generated and impose restrictions on the top value. The four configurations are:

Normal frequency (NFRQ)

● Match frequency (MFRQ)

Normal PWM (NPWM)

Match PWM (MPWM)

When using NPWM or NFRQ, the top value is determined by the counter mode. In 8-bit mode, the Period register (PER) is used as the top value and the top value can be changed by writing to the PER register. In 16- and 32-bit mode, the top value is fixed to the maximum value of the counter.

## Frequency Operation

When NFRQ is used, the waveform output (WO[x]) toggles every time CCx and the counter are equal, and the interrupt flag corresponding to that channel will be set.

Figure 28-4. Normal Frequency Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_da5378d9079ef299b0119215a736a7d6158e9d33078a89a0e59156b8ce34dafd.jpg)

When MFRQ is used, the value in CC0 will be used as the top value and WO[0] will toggle on every overflow/underflow.

Figure 28-5. Match Frequency Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_c9582d7850c265a0817c9e3a75fdc35aa1413b6bc26fb1c77c14e47c2709c12e.jpg)

## PWM Operation

In PWM operation, the CCx registers control the duty cycle of the waveform generator output. Figure 28-6 shows how in count-up the WO[x] output is set at a start or compare match between the COUNT value and the top value and cleared on the compare match between the COUNT value and CCx register value.

In count-down the WO[x] output is cleared at start or compare match between the COUNT value and the top value and set on the compare match between the COUNT value and CCx register value.

Figure 28-6. Normal PWM Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_5374b2b7766ecdb3cb54cbb7563734d0a821fdfeed68e7792544220877f468f4.jpg)

In match operation, Compare/Capture register CC0 is used as the top value, in this case a negative pulse will appear on WO[0] on every overflow/underflow.

The following equation is used to calculate the exact period for a single-slope PWM $( R _ { \mathsf { P W M } , \mathsf { S S } } )$ waveform:

$$
R _ {\mathrm {PWM\_ {S} S}} = \frac {\log (T O P + 1)}{\log (2)}
$$

$$
f _ {\text { PWM\_SS }} = \frac {f _ {\text { CLK\_TC }}}{N (T O P + 1)}
$$

where N represent the prescaler divider used (1, 2, 4, 8, 16, 64, 256, 1024).

## Changing the Top Value

Changing the top value while the counter is running is possible. If a new top value is written when the counter value is close to zero and counting down, the counter can be reloaded with the previous top value, due to synchronization delays. If this happens, the counter will count one extra cycle before the new top value is used.

Figure 28-7. Changing the Top Value when Counting Down  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_3d81913a862b720998095bc2ef185b4dd2af2231999b327b0a08fc2782ddd5aa.jpg)

When counting up a change from a top value that is lower relative to the old top value can make the counter miss this change if the counter value is larger than the new top value when the change occurred. This will make the counter count to the max value. An example of this can be seen in Figure 28-8.

Figure 28-8. Changing the Top Value when Counting Up  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_38b8a7c280a4b1cddf386a8b99e9975f1500ac492118f68dc518ebfc0c312b67.jpg)

## 28.6.2.7 Capture Operations

To enable and use capture operations, the event line into the TC must be enabled using the TC Event Input bit in the Event Control register (EVCTRL.TCEI). The capture channels to be used must also be enabled in the Capture Channel x Enable bit group in the Control C register (CTRLC.CPTENx) before capture can be performed.

## Event Capture Action

The compare/capture channels can be used as input capture channels to capture any event from the Event System. Because all capture channels use the same event line, only one capture channel should be enabled at a time when performing event capture.

Figure 28-9 shows four capture events for one capture channel.

Figure 28-9. Input Capture Timing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_03_ca4cdad5a23752834d65a1d7b78813261abe7d1d6e70186ab1ba7903e078feae.jpg)

When the Capture Interrupt flag is set and a new capture event is detected, there is nowhere to store the new timestamp. As a result, the Error Interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG.ERR) is set.

## Period and Pulse-Width Capture Action

The TC can perform two input captures and restart the counter on one of the edges. This enables the TC to measure the pulse width and period. This can be used to characterize the frequency and duty cycle of an input signal:

$$
f = \frac {1}{T}
$$

$$
d u t y C y c l e = \frac {t _ {p}}{T}
$$

When using PPW event action, the period (T) will be captured into CC0 and the pulse width $( \mathfrak { t } _ { \mathfrak { p } } )$ in CC1. In PWP event action, the pulse width $( \mathfrak { t } _ { \mathfrak { p } } )$ will be captured in CC0 and the period (T) in CC1.

Selecting PWP (pulse-width, period) or PPW (period, pulse-width) in the Event Action bit group in the Event Contro register (EVCTRL.EVACT) enables the TC to performs two capture actions, one on the rising edge and one on the falling edge.

The TC Inverted Event Input in the Event Control register (EVCTRL.TCINV) is used to select whether the wraparound should occur on the rising edge or the falling edge. If EVCTRL.TCINV is written to one, the wraparound will happen on the falling edge. The event source to be captured must be an asynchronous event.

To fully characterize the frequency and duty cycle of the input signal, activate capture on CC0 and CC1 by writing 0x to the Capture Channel x Enable bit group in the Control C register (CTRLC.CPTEN). When only one of these measurements is required, the second channel can be used for other purposes.

The TC can detect capture overflow of the input capture channels. When the Capture Interrupt flag is set and a new capture event is detected, there is nowhere to store the new timestamp. Asa result, INTFLAG.ERR is set.

## 28.6.3 Additional Features

## 28.6.3.1 One-Shot Operation

When one-shot operation is enabled, the counter automatically stops on the next counter overflow or underflow condition. When the counter is stopped, STATUS.STOP is automatically set by hardware and the waveform outputs are set to zero.

One-shot operation can be enabled by writing a one into the One-Shot bit in the Control B Set register (CTRLBSET.ONESHOT) and disabled by writing a one to the One-Shot bit in the Control B Clear register (CTRLBCLR.ONESHOT). When enabled, it will count until an overflow or underflow occurs. The one-shot operation can be restarted with a retrigger command, a retrigger event or a start event.

When the counter restarts its operation, the Stop bit in the Status register (STATUS.STOP) is automatically cleared by hardware.

## 28.6.4 DMA, Interrupts and Events

Table 28-1. Module Request for TC

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Overflow / Underflow</td><td>x</td><td>x</td><td></td><td>x</td><td>Cleared on next clock cycle</td></tr><tr><td>Channel Compare Match or Capture</td><td>x</td><td>x</td><td></td><td> $x^1$ </td><td>For compare channel-Cleared on next clock cycle.For capture channel-cleared when CCx register is read</td></tr><tr><td>Capture Overflow Error</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Synchronization Ready</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Start Counter</td><td></td><td></td><td>x</td><td></td><td></td></tr><tr><td>Retrigger Counter</td><td></td><td></td><td>x</td><td></td><td></td></tr><tr><td>Increment / Decrement counter</td><td></td><td></td><td>x</td><td></td><td></td></tr><tr><td>Simple Capture</td><td></td><td></td><td>x</td><td></td><td></td></tr><tr><td>Period Capture</td><td></td><td></td><td>x</td><td></td><td></td></tr><tr><td>Pulse Width Capture</td><td></td><td></td><td>x</td><td></td><td></td></tr></table>

Note: 1. Two DMA requests lines are available, one for each compare/capture channel.

## 28.6.4.1 DMA Operation

The TC can generate the following DMA requests:

Overflow (OVF): the request is set when an update condition (overflow, underflow) is detected. The request is cleared on next clock cycle.

Channel Match or Capture (MCx): for a compare channel, the request is set on each compare match detection and cleared on next clock cycle. For a capture channel, the request is set when valid data is present in CCx register, and cleared when CCx register is read.

When using the TC with the DMA OVF request, the new value will be transfered to the register after the update condition. This means that the value is updated after the DMA and synchronization delay, and if the COUNT value has reached the new value before PER or CCx is updated, a match will not happen.

When using the TC with the DMA MCx request and updating CCx with a value that is lower than the current COUNT when down-counting, or higher than the current COUNT when up-counting, this value could cause a new compare match before the counter overflows. This will trigger the next DMA transfer, update CCx again, and the previous value is disregarded from the output signal WO[x].

## 28.6.4.2 Interrupts

The TC has the following interrupt sources:

z Overflow/Underflow: OVF

z Compare or Capture Channels

z Capture Overflow Error: ERR

z Synchronization Ready: SYNCRDY

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the TC is reset. See the INTFLAG register for details on how to clear interrupt flags.

The TC has one common interrupt request line for all the interrupt sources. The user must read the INTFLAG register to determine which interrupt condition is present. Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 28.6.4.3 Events

The TC can generate the following output events:

Overflow/Underflow (OVF)

z Match or Capture (MC)

Writing a one to an Event Output bit in the Event Control register (EVCTRL.MCEO) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event.

To enable one of the following event actions, write to the Event Action bit group (EVCTRL.EVACT).

z Start the counter

Retrigger counter

z Increment or decrement counter (depends on counter direction)

z Capture event

z Capture period

z Capture pulse width

Writing a one to the TC Event Input bit in the Event Control register (EVCTRL.TCEI) enables input events to the TC. Writing a zero to this bit disables input events to the TC. Refer to “EVSYS – Event System” on page 405 for details on configuring the Event System.

## 28.6.5 Sleep Mode Operation

The TC can be configured to operate in any sleep mode. To be able to run in standby, the RUNSTDBY bit in the Control A register (CTRLA.RUNSTDBY) must be written to one. The TC can wake up the device using interrupts from any sleep mode or perform actions through the Event System.

## 28.6.6 Synchronization

Due to the asynchronicity between CLK\_TCx\_APB and GCLK\_TCx some registers must be synchronized when accessed. A register can require:

z Synchronization when written

Synchronization when read

z Synchronization when written and read

● No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete. The synchronization Ready interrupt can be used to signal when sync is complete. This can be accessed via the Synchronization Ready Interrupt Flag in the Interrupt Flag Status and Clear register (INTFLAG.SYNCRDY).

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following bits need synchronization when written:

z Software Reset bit in the Control A register (CTRLA.SWRST)

z Enable bit in the Control A register (CTRLA.ENABLE)

Write-synchronization is denoted by the Write-Synchronized property in the register description.

The following registers need synchronization when written:

z Control B Clear register (CTRLBCLR)

z Control B Set register (CTRLBSET)

z Control C register (CTRLC)

z Count Value register (COUNT)

Period Value register (PERIOD)

Compare/Capture Value registers (CCx)

Write-synchronization is denoted by the Write-Synchronized property in the register description.

The following registers need synchronization when read:

Control B Clear register (CTRLBCLR)

z Control B Set register (CTRLBSET)

Control C register (CTRLC)

z Count Value register (COUNT)

● Period Value register (PERIOD)

Compare/Capture Value registers (CCx)

Read-synchronization is denoted by the Read-Synchronized property in the register description.

## 28.7 Register Summary

Table 28-2. Register Summary – 8-Bit Mode Registers

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRLA</td><td>7:0</td><td></td><td colspan="2">WAVEGEN[1:0]</td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td colspan="2">PRESCSYNC[1:0]</td><td>RUNSTDBY</td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>0x02</td><td rowspan="2">READREQ</td><td>7:0</td><td></td><td></td><td></td><td colspan="5">ADDR[4:0]</td></tr><tr><td>0x03</td><td>15:8</td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td>CTRLBCLR</td><td>7:0</td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>0x05</td><td>CTRLBSET</td><td>7:0</td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>0x06</td><td>CTRLC</td><td>7:0</td><td></td><td></td><td>CPTEN1</td><td>CPTEN0</td><td></td><td></td><td>INVEN1</td><td>INVEN0</td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td rowspan="2">EVCTRL</td><td>7:0</td><td></td><td></td><td>TCEI</td><td>TCINV</td><td></td><td colspan="3">EVACT[2:0]</td></tr><tr><td>0x0B</td><td>15:8</td><td></td><td></td><td>MCEO1</td><td>MCEO0</td><td></td><td></td><td></td><td>OVFEO</td></tr><tr><td>0x0C</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0D</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0E</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0F</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td>SLAVE</td><td>STOP</td><td></td><td></td><td></td></tr><tr><td>0x10</td><td>COUNT</td><td>7:0</td><td colspan="8">COUNT[7:0]</td></tr><tr><td>0x11</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>PER</td><td>7:0</td><td colspan="8">PER[7:0]</td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td>CC0</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x19</td><td>CC1</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x1A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1D</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

Table 28-3. Register Summary – 16-Bit Mode Registers

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRLA</td><td>7:0</td><td></td><td colspan="2">WAVEGEN[1:0]</td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td colspan="2">PRESCSYNC[1:0]</td><td>RUNSTDBY</td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>0x02</td><td rowspan="2">READREQ</td><td>7:0</td><td></td><td></td><td></td><td colspan="5">ADDR[4:0]</td></tr><tr><td>0x03</td><td>15:8</td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td>CTRLBCLR</td><td>7:0</td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>0x05</td><td>CTRLBSET</td><td>7:0</td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>0x06</td><td>CTRLC</td><td>7:0</td><td></td><td></td><td>CPTEN1</td><td>CPTENO</td><td></td><td></td><td>INVEN1</td><td>INVEN0</td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td rowspan="2">EVCTRL</td><td>7:0</td><td></td><td></td><td>TCEI</td><td>TCINV</td><td></td><td colspan="3">EVACT[2:0]</td></tr><tr><td>0x0B</td><td>15:8</td><td></td><td></td><td>MCEO1</td><td>MCEO0</td><td></td><td></td><td></td><td>OVFEO</td></tr><tr><td>0x0C</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0D</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0E</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0F</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td>SLAVE</td><td>STOP</td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="2">COUNT</td><td>7:0</td><td colspan="8">COUNT[7:0]</td></tr><tr><td>0x11</td><td>15:8</td><td colspan="8">COUNT[15:8]</td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x13</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="2">CC0</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x19</td><td>15:8</td><td colspan="8">CC[15:8]</td></tr><tr><td>0x1A</td><td rowspan="2">CC1</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x1B</td><td>15:8</td><td colspan="8">CC[15:8]</td></tr><tr><td>0x1C</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1D</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

Table 28-4. Register Summary – 32-Bit Mode Registers

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="2">CTRLA</td><td>7:0</td><td></td><td colspan="2">WAVEGEN[1:0]</td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td></td><td colspan="2">PRESCSYNC[1:0]</td><td>RUNSTDBY</td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>0x02</td><td rowspan="2">READREQ</td><td>7:0</td><td></td><td></td><td></td><td colspan="5">ADDR[4:0]</td></tr><tr><td>0x03</td><td>15:8</td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td>CTRLBCLR</td><td>7:0</td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>0x05</td><td>CTRLBSET</td><td>7:0</td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>0x06</td><td>CTRLC</td><td>7:0</td><td></td><td></td><td>CPTEN1</td><td>CPTENO</td><td></td><td></td><td>INVEN1</td><td>INVEN0</td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>0x09</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td rowspan="2">EVCTRL</td><td>7:0</td><td></td><td></td><td>TCEI</td><td>TCINV</td><td></td><td colspan="3">EVACT[2:0]</td></tr><tr><td>0x0B</td><td>15:8</td><td></td><td></td><td>MCEO1</td><td>MCEO0</td><td></td><td></td><td></td><td>OVFEO</td></tr><tr><td>0x0C</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0D</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0E</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>0x0F</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td>SLAVE</td><td>STOP</td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">COUNT</td><td>7:0</td><td colspan="8">COUNT[7:0]</td></tr><tr><td>0x11</td><td>15:8</td><td colspan="8">COUNT[15:8]</td></tr><tr><td>0x12</td><td>23:16</td><td colspan="8">COUNT[23:16]</td></tr><tr><td>0x13</td><td>31:24</td><td colspan="8">COUNT[31:24]</td></tr><tr><td>0x14</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="4">CC0</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x19</td><td>15:8</td><td colspan="8">CC[15:8]</td></tr><tr><td>0x1A</td><td>23:16</td><td colspan="8">CC[23:16]</td></tr><tr><td>0x1B</td><td>31:24</td><td colspan="8">CC[31:24]</td></tr><tr><td>0x1C</td><td rowspan="4">CC1</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x1D</td><td>15:8</td><td colspan="8">CC[15:8]</td></tr><tr><td>0x1E</td><td>23:16</td><td colspan="8">CC[23:16]</td></tr><tr><td>0x1F</td><td>31:24</td><td colspan="8">CC[31:24]</td></tr></table>

## 28.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to the “Register Access Protection” on page 576 and the “PAC – Peripheral Access Controller” on page 30 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or Read-Synchronized property in each individual register description. Refer to “Synchronization” on page 585 for details.

Some registers are enable-protected, meaning they can only be written when the TC is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 28.8.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x0000

Property: Write-Protected, Enable-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td colspan="2">PRESCSYNC[1:0]</td><td>RUNSTDBY</td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td colspan="2">WAVEGEN[1:0]</td><td></td><td colspan="2">MODE[1:0]</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

● Bits 15:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 13:12 – PRESCSYNC[1:0]: Prescaler and Counter Synchronization

These bits select whether on start or retrigger event the counter should wrap around on the next GCLK\_TCx clock or the next prescaled GCLK\_TCx clock. It’s also possible to reset the prescaler.

The options are as shown in Table 28-5.

These bits are not synchronized.

Table 28-5. Prescaler and Counter Synchronization

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>GCLK</td><td>Reload or reset the counter on next generic clock</td></tr><tr><td>0x1</td><td>PRESC</td><td>Reload or reset the counter on next prescaler clock</td></tr><tr><td>0x2</td><td>RESYNC</td><td>Reload or reset the counter on next generic clock. Reset the prescaler counter</td></tr><tr><td>0x3</td><td>-</td><td>Reserved</td></tr></table>

## Bit 11 – RUNSTDBY: Run in Standby

This bit is used to keep the TC running in standby mode:

0: The TC is halted in standby.

1: The TC continues to run in standby.

This bit is not synchronized.

## z Bits 10:8 – PRESCALER[2:0]: Prescaler

These bits select the counter prescaler factor, as shown in Table 28-6.

These bits are not synchronized.

Table 28-6. Prescaler

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>Prescaler: GCLK_TC</td></tr><tr><td>0x1</td><td>DIV2</td><td>Prescaler: GCLK_TC/2</td></tr><tr><td>0x2</td><td>DIV4</td><td>Prescaler: GCLK_TC/4</td></tr><tr><td>0x3</td><td>DIV8</td><td>Prescaler: GCLK_TC/8</td></tr><tr><td>0x4</td><td>DIV16</td><td>Prescaler: GCLK_TC/16</td></tr><tr><td>0x5</td><td>DIV64</td><td>Prescaler: GCLK_TC/64</td></tr><tr><td>0x6</td><td>DIV256</td><td>Prescaler: GCLK_TC/256</td></tr><tr><td>0x7</td><td>DIV1024</td><td>Prescaler: GCLK_TC/1024</td></tr></table>

## Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bits 6:5 – WAVEGEN[1:0]: Waveform Generation Operation

These bits select the waveform generation operation. They affect the top value, as shown in “Waveform Output Operations” on page 579. It also controls whether frequency or PWM waveform generation should be used. How these modes differ can also be seen from “Waveform Output Operations” on page 579. These bits are not synchronized.

Table 28-7. Waveform Generation Operation

<table><tr><td>Value</td><td>Name</td><td>Operation</td><td>Top Value</td><td>Waveform Output on Match</td><td>Waveform Output on Wraparound</td></tr><tr><td>0x0</td><td>NFRQ</td><td>Normal frequency</td><td>PER(1)/Max</td><td>Toggle</td><td>No action</td></tr><tr><td>0x1</td><td>MFRQ</td><td>Match frequency</td><td>CC0</td><td>Toggle</td><td>No action</td></tr><tr><td>0x2</td><td>NPWM</td><td>Normal PWM</td><td>PER(1)/Max</td><td>Clear when counting upSet when counting down</td><td>Set when counting upClear when counting down</td></tr><tr><td>0x3</td><td>MPWM</td><td>Match PWM</td><td>CC0</td><td>Clear when counting upSet when counting down</td><td>Set when counting upClear when counting down</td></tr></table>

Note: 1. This depends on the TC mode. In 8-bit mode, the top value is the Period Value register (PER). In 16- and 32-bit mode it is the maximum value.

## Bit 4 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 3:2 – MODE[1:0]: TC Mode

These bits select the TC mode, as shown in Table 28-8.

These bits are not synchronized.

Table 28-8. TC Mode

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>COUNT16</td><td>Counter in 16-bit mode</td></tr><tr><td>0x1</td><td>COUNT8</td><td>Counter in 8-bit mode</td></tr><tr><td>0x2</td><td>COUNT32</td><td>Counter in 32-bit mode</td></tr><tr><td>0x3</td><td>-</td><td>Reserved</td></tr></table>

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled.

1: The peripheral is enabled.

Due to synchronization, there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRLA.ENABLE will read back immediately, and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete.

## Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the TC, except DBGCTRL, to their initial state, and the TC will be disabled.

Writing a one to CTRLA.SWRST will always take precedence; all other writes in the same write-operation will be discarded.

Due to synchronization there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

## 28.8.2 Read Request

For a detailed description of this register and its use, refer to the“Synchronization” on page 585.

Name: READREQ

Offset: 0x02

Reset: 0x0000

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>RREQ</td><td>RCONT</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">ADDR[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bit 15 – RREQ: Read Request

Writing a zero to this bit has no effect.

This bit will always read as zero.

Writing a one to this bit requests synchronization of the register pointed to by the Address bit group (READ-REQ.ADDR) and sets the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY).

## z Bit 14 – RCONT: Read Continuously

0: Continuous synchronization is disabled.

1: Continuous synchronization is enabled.

When continuous synchronization is enabled, the register pointed to by the Address bit group (READ-REQ.ADDR) will be synchronized automatically every time the register is updated.

## z Bits 13:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 4:0 – ADDR[4:0]: Address

These bits select the offset of the register that needs read synchronization. In the TC, only COUNT and CCx are available for read synchronization.

## 28.8.3 Control B Clear

This register allows the user to change this register without doing a read-modify-write operation. Changes in this register will also be reflected in the Control B Set (CTRLBSET) register.

Name: CTRLBCLR

Offset: 0x04

Reset: 0x00

Property: Write-Protected, Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:6 – CMD[1:0]: Command

These bits are used for software control of retriggering and stopping the TC. When a command has been executed, the CMD bit group will read back as zero. The commands are executed on the next prescaled GCLK\_TC clock cycle.

Writing a zero to one of these bits has no effect.

Writing a one to one of these bits will clear the pending command.

Table 28-9. Command

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No action</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Force a start, restart or retrigger</td></tr><tr><td>0x2</td><td>STOP</td><td>Force a stop</td></tr><tr><td>0x3</td><td>-</td><td>Reserved</td></tr></table>

## z Bits 5:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 2 – ONESHOT: One-Shot

This bit controls one-shot operation of the TC. When in one-shot mode, the TC will stop counting on the next overflow/underflow condition or a stop command.

0: The TC will wrap around and continue counting on an overflow/underflow condition.

1: The TC will wrap around and stop on the next underflow/overflow condition.

Writing a zero to this bit has no effect.

Writing a one to this bit will disable one-shot operation.

## z Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 0 – DIR: Counter Direction

This bit is used to change the direction of the counter.

0: The timer/counter is counting up (incrementing).

1: The timer/counter is counting down (decrementing).

Writing a zero to this bit has no effect.

Writing a one to this bit will make the counter count up.

## 28.8.4 Control B Set

This register allows the user to change this register without doing a read-modify-write operation. Changes in this register will also be reflected in the Control B Set (CTRLBCLR) register.

Name: CTRLBSET

Offset: 0x05

Reset: 0x00

Property: Write-Protected, Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">CMD[1:0]</td><td></td><td></td><td></td><td>ONESHOT</td><td></td><td>DIR</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:6 – CMD[1:0]: Command

These bits is used for software control of retriggering and stopping the TC. When a command has been executed, the CMD bit group will be read back as zero. The commands are executed on the next prescaled GCLK\_TC clock cycle.

Writing a zero to one of these bits has no effect.

Writing a one to one of these bits will set a command.

Table 28-10. Command

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No action</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Force a start, restart or retrigger</td></tr><tr><td>0x2</td><td>STOP</td><td>Force a stop</td></tr><tr><td>0x3</td><td>-</td><td>Reserved</td></tr></table>

## z Bits 5:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 2 – ONESHOT: One-Shot

This bit controls one-shot operation of the TC. When active, the TC will stop counting on the next overflow/underflow condition or a stop command.

0: The TC will wrap around and continue counting on an overflow/underflow condition.

1: The timer/counter will wrap around and stop on the next underflow/overflow condition.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable one-shot operation.

## z Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 0 – DIR: Counter Direction

This bit is used to change the direction of the counter.

0: The timer/counter is counting up (incrementing).

1: The timer/counter is counting down (decrementing).

Writing a zero to this bit has no effect

Writing a one to this bit will make the counter count down.

## 28.8.5 Control C

Name: CTRLC

Offset: 0x06

Reset: 0x00

Property: Write-Protected, Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>CPTEN1</td><td>CPTENO</td><td></td><td></td><td>INVEN1</td><td>INVEN0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:4 – CPTENx: Capture Channel x Enable

These bits are used to select whether channel x is a capture or a compare channel.

Writing a one to CPTENx enables capture on channel x.

Writing a zero to CPTENx disables capture on channel x.

## z Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 1:0 – INVENx: Waveform Output x Invert Enable

These bits are used to select inversion on the output of channel x.

Writing a one to INVENx inverts the output from WO[x].

Writing a zero to INVENx disables inversion of the output from WO[x].

## 28.8.6 Debug Control

Name: DBGCTRL

Offset: 0x08

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 0 – DBGRUN: Debug Run Mode

This bit is not affected by a software reset, and should not be changed by software while the TC is enabled.

0: The TC is halted when the device is halted in debug mode.

1: The TC continues normal operation when the device is halted in debug mode.

## 28.8.7 Event Control

Name: EVCTRL

Offset: 0x0A

Reset: 0x0000

Property: Write-Protected, Enable-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td>MCEO1</td><td>MCEO0</td><td></td><td></td><td></td><td>OVFEO</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>TCEI</td><td>TCINV</td><td></td><td colspan="3">EVACT[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 15:14 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read

## ● Bits 13:12 – MCEOx: Match or Capture Channel x Event Output Enable

These bits control whether event match or capture on channel x is enabled or not and generated for every match or capture.

0: Match/Capture event on channel x is disabled and will not be generated.

1: Match/Capture event on channel x is enabled and will be generated for every compare/capture.

These bits are not enable-protected.

## z Bits 11:9 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 8 – OVFEO: Overflow/Underflow Event Output Enable

This bit is used to enable the Overflow/Underflow event. When enabled an event will be generated when the counter overflows/underflows.

0: Overflow/Underflow event is disabled and will not be generated.

1: Overflow/Underflow event is enabled and will be generated for every counter overflow/underflow.

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 5 – TCEI: TC Event Input

This bit is used to enable input events to the TC.

0: Incoming events are disabled.

1: Incoming events are enabled.

This bit is not enable-protected.

## z Bit 4 – TCINV: TC Inverted Event Input

This bit inverts the input event source when used in PWP or PPW measurement.

0: Input event source is not inverted.

1: Input event source is inverted.

This bit is not enable-protected.

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bits 2:0 – EVACT[2:0]: Event Action

These bits define the event action the TC will perform on an event,as shown in Table 28-11. The EVACT can only be changed while the TC is disabled.

Table 28-11. Event Action

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>OFF</td><td>Event action disabled</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Start, restart or retrigger TC on event</td></tr><tr><td>0x2</td><td>COUNT</td><td>Count on event</td></tr><tr><td>0x3</td><td>START</td><td>Start TC on event</td></tr><tr><td>0x4</td><td>-</td><td>Reserved</td></tr><tr><td>0x5</td><td>PPW</td><td>Period captured in CC0, pulse width in CC1</td></tr><tr><td>0x6</td><td>PWP</td><td>Period captured in CC1, pulse width in CC0</td></tr><tr><td>0x7</td><td>-</td><td>Reserved</td></tr></table>

## 28.8.8 Interrupt Enable Clear

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

Name: INTENCLR

Offset: 0x0C

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:4 – MCx: Match or Capture Channel x Interrupt Enable

0: The Match or Capture Channel x interrupt is disabled.

1: The Match or Capture Channel x interrupt is enabled.

Writing a zero to MCx has no effect.

Writing a one to MCx will clear the corresponding Match or Capture Channel x Interrupt Disable/Enable bit, which disables the Match or Capture Channel x interrupt.

## Bit 3 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready Interrupt Disable/Enable bit, which disables the Synchronization Ready interrupt.

## z Bit 2 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 1 – ERR: Error Interrupt Enable

0: The Error interrupt is disabled.

1: The Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Error Interrupt Disable/Enable bit, which disables the Error interrupt.

## Bit 0 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overflow Interrupt Disable/Enable bit, which disables the Overflow interrupt.

## 28.8.9 Interrupt Enable Set

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

Name: INTENSET

Offset: 0x0D

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 5:4 – MCx: Match or Capture Channel x Interrupt Enable

0: The Match or Capture Channel x interrupt is disabled.

1: The Match or Capture Channel x interrupt is enabled.

Writing a zero to MCx has no effect.

Writing a one to MCx will set the corresponding Match or Capture Channel x Interrupt Enable bit, which enables the Match or Capture Channel x interrupt.

## Bit 3 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Synchronization Ready Interrupt Disable/Enable bit, which enables the Synchronization Ready interrupt.

## z Bit 2 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 1 – ERR: Error Interrupt Enable

0: The Error interrupt is disabled.

1: The Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Error Interrupt bit, which enables the Error interrupt.

## Bit 0 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overflow Interrupt Enable bit, which enables the Overflow interrupt.

## 28.8.10 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x0E

Reset: 0x00

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>MC1</td><td>MC0</td><td>SYNCRDY</td><td></td><td>ERR</td><td>OVF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:4 – MCx: Match or Capture Channel x

This flag is set on the next CLK\_TC\_CNT cycle after a match with the compare condition or once CCx register contain a valid capture value, and will generate an interrupt request if the corresponding Match or Capture Channel x Interrupt Enable bit in the Interrupt Enable Set register (INTENSET.MCx) is one.

Writing a zero to one of these bits has no effect.

Writing a one to one of these bits will clear the corresponding Match or Capture Channel x interrupt flag In capture mode, this flag is automatically cleared when CCx register is read.

## z Bit 3 – SYNCRDY: Synchronization Ready

This flag is set on a 1-to-0 transition of the Synchronization Busy bit in the Status register (STATUS.SYNC-BUSY), except when the transition is caused by an enable or software reset, and will generate an interrupt request if the Synchronization Ready Interrupt Enable bit in the Interrupt Enable Set register (INTENSET.SYN-CRDY) is one.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready interrupt flag

## Bit 2 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bit 1 – ERR: Error

This flag is set if a new capture occurs on a channel when the corresponding Match or Capture Channel x interrupt flag is one, in which case there is nowhere to store the new capture.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Error interrupt flag.

## Bit 0 – OVF: Overflow

This flag is set on the next CLK\_TC\_CNT cycle after an overflow condition occurs, and will generate an interrupt if

INTENCLR/SET.OVF is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Overflow interrupt flag.

## 28.8.11 Status

Name: STATUS

Offset: 0x0F

Reset: 0x08

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td>SLAVE</td><td>STOP</td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## z Bits 6:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 4 – SLAVE: Slave

This bit is set when the even-numbered master TC is set to run in 32-bit mode. The odd-numbered TC will be the slave.

## ● Bit 3 – STOP: Stop

This bit is set when the TC is disabled, on a Stop command or on an overflow or underflow condition when the One-Shot bit in the Control B Set register (CTRLBSET.ONESHOT) is one.

0: Counter is running.

1: Counter is stopped.

## z Bits 2:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 28.8.12 Counter Value

## 28.8.12.1 8-Bit Mode

Name: COUNT

Offset: 0x10

Reset: 0x00

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:0 – COUNT[7:0]: Counter Value These bits contain the current counter value.

## 28.8.12.2 16-Bit Mode

Name: COUNT

Offset: 0x10

Reset: 0x0000

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – COUNT[15:0]: Counter Value These bits contain the current counter value.

## 28.8.12.3 32-Bit Mode

Name: COUNT

Offset: 0x10

Reset: 0x00000000

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">COUNT[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COUNT[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – COUNT[31:0]: Counter Value These bits contain the current counter value.

## 28.8.13 Period Value

The Period Value register is available only in 8-bit TC mode. It is not available in 16-bit and 32-bit TC modes.

## 28.8.13.1 8-Bit Mode

Name: PER

Offset: 0x14

Reset: 0xFF

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">PER[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

z Bits 7:0 – PER[7:0]: Period Value

These bits contain the counter period value in 8-bitTC mode.

## 28.8.14 Compare/Capture

## 28.8.14.1 8-Bit Mode

Name: CCx

Offset: 0x18+i\*0x1 [i=0..3]

Reset: 0x00

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CC[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bits 7:0 – CC[7:0]: Compare/Capture Value

These bits contain the compare/capture value in 8-bit TC mode. In frequency or PWM waveform match operation (CTRLA.WAVEGEN), the CC0 register is used as a period register.

## 28.8.14.2 16-Bit Mode

Name: CCx

Offset: 0x18+i\*0x2 [i=0..3]

Reset: 0x0000

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CC[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CC[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:0 – CC[15:0]: Compare/Capture Value

These bits contain the compare/capture value in 16-bit TC mode. In frequency or PWM waveform match operation (CTRLA.WAVEGEN), the CC0 register is used as a period register.

28.8.14.3 32-Bit Mode

Name: CCx

Offset: 0x18+i\*0x4 [i=0..3]

Reset: 0x00000000

Property: Write-Synchronized, Read-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">CC[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CC[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CC[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CC[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – CC[31:0]: Compare/Capture Value

These bits contain the compare/capture value in 32-bit TC mode. In frequency or PWM waveform match operation (CTRLA.WAVEGEN), the CC0 register is used as a period register.

## 29. TCC – Timer/Counter for Control Applications

## 29.1 Overview

The Timer/Counter for Control applications (TCC) consists of a counter, a prescaler, compare/capture channels and control logic. The counter can be set to count events or clock pulses. The counter together with the compare/capture channels can be configured to time stamp input events, allowing capture of frequency and pulse-width. It can also perform waveform generation such as frequency generation and pulse-width modulation.

Waveform extensions are intended for motor control, ballast, LED, H-bridge, power converters, and other types of power control applications. It enables low- and high-side output with optional dead-time insertion. It can also generate a synchronized bit pattern across the waveform output pins. The fault options enable fault protection for safe and deterministic handling, disabling and/or shut down of external drivers.

The Timer/Counter Block diagram (Figure 29-1 on page 615) shows all the features in TCC but table below shows the configuration of each of the TCCs.

Table 29-1. TCC Configuration Summary

<table><tr><td>TCC#</td><td>Channels (CC_NUM)</td><td>Waveform Output (WO_NUM)</td><td>Counter size</td><td>Fault</td><td>Dithering</td><td>Output matrix</td><td>Dead Time Insertion (DTI)</td><td>SWAP</td><td>Pattern generation</td></tr><tr><td>0</td><td>4</td><td>8</td><td>24-bit</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>1</td><td>2</td><td>4</td><td>24-bit</td><td>X</td><td>X</td><td></td><td></td><td></td><td>X</td></tr><tr><td>2</td><td>2</td><td>2</td><td>16-bit</td><td>X</td><td></td><td></td><td></td><td></td><td></td></tr></table>

## 29.2 Features

z Up to four compare/capture channels (CC) with:

z Double buffered period setting

z Double buffered compare or capture channe

z Circular buffer on period and compare channel registers

z Waveform generation:

z Frequency generation

z Single-slope pulse-width modulation (PWM)

z Dual-slope pulse-width modulation with half-cycle reload capability

## z Input capture:

z Event capture

z Frequency capture

z Pulse-width capture

z Waveform extensions:

z Configurable distribution of compare channels outputs across port pins

z Low- and high-side output with programmable dead-time insertion

z Waveform swap option with double buffer support

z Pattern generation with double buffer support

z Dithering support

z Fault protection for safe drivers disabling:

z Two recoverable fault sources

z Two non-recoverable fault sources

z Debugger can be source of non-recoverable fault

z Input event:

z Two input events for counter

z One input event for each channel

z Output event:

z Three output events (Count, Retrigger and Overflow) available for counter

z One Compare Match/Input Capture event output for each channel

z Interrupts:

z Overflow and Retrigger interrupt

z Compare Match/Input Capture interrupt

z Interrupt on fault detection

z Can be used with DMA and can trigger DMA transactions

## 29.3 Block Diagram

Figure 29-1. Timer/Counter Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_eebf37611289c6ee539ab81be315fe4982091628df9975c7a28da1fad8e2a1d1.jpg)

29.4 Signal Description

<table><tr><td>Pin Name</td><td>Type</td><td>Description</td></tr><tr><td>TCCx/WO[0]</td><td>Digital output</td><td>Compare channel 0 waveform output</td></tr><tr><td>TCCx/WO[1]</td><td>Digital output</td><td>Compare channel 1 waveform output</td></tr><tr><td>...</td><td>...</td><td>...</td></tr><tr><td>TCCx/WO[WO_NUM-1]</td><td>Digital output</td><td>Compare channel n waveform output</td></tr></table>

Refer to Table 6-1 in the “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 29.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 29.5.1 I/O Lines

Using the TCC’s I/O lines requires the I/O pins to be configured. Refer to “PORT” on page 378 for details.

## 29.5.2 Power Management

The TCC will continue to operate in any sleep mode where the selected source clock is running. The TCC’s interrupts can be used to wake up the device from sleep modes. Events connected to the event system can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 29.5.3 Clocks

The TCC bus clock (CLK\_TCCx\_APB, where x represents the specific TCC instance number) can be enabled and disabled in the power manager, and the default state of CLK\_TCCx\_APB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110

A generic clock (GCLK\_TCCx) is required to clock the TCC. This clock must be configured and enabled in the generic clock controller before using the TCC. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the bus clock (CLK\_TCCx\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 646 for further details.

## 29.5.4 DMA

The DMA request lines are connected to the DMA Controller (DMAC). Using the TCC DMA requests, requires the DMA Controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details.

## 29.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the TCC interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 29.5.6 Events

The events are connected to the Event System. Refer to “EVSYS – Event System” on page 405 for details on how to configure the Event System.

## 29.5.7 Debug Operation

When the CPU is halted in debug mode the TCC will halt normal operation. The TCC can be forced to continue operation during debugging. Refer to DBGCTRL for details.

## 29.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

z Interrupt Flag register (INTFLAG)

z Status register (STATUS)

z Period and Period Buffer registers (PER, PERB)

z Compare/Capture and Compare/Capture Buffer registers (CCx, CCBx)

z Control Waveform and Control Waveform Buffer registers (WAVE, WAVEB)

z Pattern Generation Value and Pattern Generation Value Buffer registers (PATT, PATTB)

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply to accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 29.5.9 Analog Connections

Not applicable.

## 29.6 Functional Description

## 29.6.1 Principle of Operation

Each TCC instance has up to four compare/capture channels (CCx).

The following definitions are used throughout the documentation:

Figure 29-2. Timer/counter definitions

<table><tr><td>Name</td><td>Description</td></tr><tr><td>TOP</td><td>The counter reaches TOP when it becomes equal to the highest value in the count sequence. The TOP value can be equal to the period (PER) or the compare channel A (CCA) register setting. This is selected by the waveform generator mode.</td></tr><tr><td>BOTTOM</td><td>The counter reaches BOTTOM when it becomes zero</td></tr><tr><td>MAX</td><td>The counter reaches maximum when it becomes all ones</td></tr><tr><td>UPDATE</td><td>The timer/counter signals an update when it reaches BOTTOM or TOP, depending on the direction settings.</td></tr></table>

In general, the term “timer” is used when the timer/counter clock control is handled by an internal source, and the term “counter” is used when the clock control is handled externally (e.g. counting external events). When used for compare operations, the CC channels are referred to as “compare channels.” When used for capture operations, the CC channels are referred to as “capture channels.”

The counter register (COUNT), period registers with buffer (PER and PERB), and compare and capture registers with buffers (CCx and CCxB) are 16 or 24-bit registers, depending on each TCC instance. Each buffer register has a buffer valid (BV) flag that indicates when the buffer contains a new value. During normal operation, the counter value is continuously compared to the Period (TOP) and to ZERO value to determine whether the counter has reached TOP or ZERO.

The counter value is also compared to the CCx registers. These comparisons can be used to generate interrupt requests, request DMA transactions or generate events for the event system. The waveform generator modes use these comparisons to set the waveform period or pulse width.

A prescaled generic clock (GCLK\_TCCx) and events from the event system can be used to control the counter. The event system is also used as a source to the input capture.

The recoverable fault module extension enables event controlled waveforms by acting directly on the generated waveforms from TCC compare channels output. These events can restart, halt the timer/counter period or shorten the output pulse active time, or disable waveform output as long as the fault condition is present. This can typically be used for current sensing regulation or zero crossing and demagnetization retriggering.

The MCE0 and MCE1 event sources are shared with the recoverable fault module. Only asynchronous events are used internally when fault unit extension is enabled. For further details on how to configure asynchronous events routing, refer to section “EVSYS – Event System” on page 405.

By using digital filtering and/or input blanking, qualification options (as detailed in “Recoverable Faults” on page 634), recoverable fault sources can be filtered and/or windowed to avoid false triggering, for example from I/O pin glitches.

In addition as shown in Figure 29-1 on page 615, six optional independent and successive units primarily intended for use with different types of motor control, ballast, LED, H-bridge, power converter, and other types of power switching applications, are implemented in some of TCC instances.

The output matrix (OTMX) can distribute and route out the TCC waveform outputs across the port pins in different configurations, each optimized for different application types.

The dead time insertion (DTI) unit splits the four lower OTMX outputs into two non-overlapping signals, the noninverted low side (LS) and inverted high side (HS) of the waveform output with optional dead-time insertion between LS and HS switching.

The swap (SWAP) unit can be used to swap the LS and HS pin outputs, and can be used for fast decay motor control. The pattern generation unit can be used to generate synchronized waveforms with constant logic level on TCC update conditions. This is for example useful for easy stepper motor and full bridge control.

The non-recoverable fault module enables event controlled fault protection by acting directly on the generated waveforms from timer/counter compare channels output. When a non-recoverable fault condition is detected, the output waveforms are forced to a safe and pre-configured value that is safe for the application. This is typically used for instant and predictable shut down and disabling high current or voltage drives.

The count event sources (TCE0 and TCE1) are shared with the non-recoverable fault extension. The events can be optionally filtered. If the filter options are not used, the non-recoverable faults provide an immediate asynchronous action on waveform output, even for cases where the clock is not present. For further details on how to configure asynchronous events routing, refer to section “EVSYS – Event System” on page 405.

## 29.6.2 Basic Operation

## 29.6.2.1 Initialization

The following registers are enable-protected, meaning that it can only be written when the TCC is disabled (CTRLA.ENABLE is zero):

Control A (CTRLA) register, except Run Standby (RUNSTDBY), Enable (ENABLE) and Software Reset (SWRST) bits

z Recoverable Fault n Control register (FCTRLA and FCTRLB)

z Waveform Extension Control register (WEXCTRL)

z Drive Control register (DRVCTRL)

z Event Control register

Enable-protected bits in the CTRLA register can be written at the same time as CTRLA.ENABLE is written to one, but not at the same time as CTRLA.ENABLE is written to zero.

Enable-protection is denoted by the Enable-Protected property in the register description.

Before the TCC is enabled, it must be configured as outlined by the following steps:

z Enable the TCC bus clock (CLK\_TCCx\_APB) first

z If Capture mode is required, enable the channel in capture mode by writing a one to Capture Enable bit in Control A register (CTRLA.CAPTEN)

Optionally, the following configurations can be set before or after enabling TCC:

z Select PRESCALER setting in the Control A register (CTRLA.PRESCALER)

z Select Prescaler Synchronization setting in Control A register (CTRLA.PRESCSYNC)

z If down-counting operation must be enabled, write a one to the Counter Direction bit in the Control B Set register (CTRLBSET.DIR)

z Select the Waveform Generation operation in WAVE register (WAVE.WAVEGEN)

z Select the Waveform Output Polarity in the WAVE register (WAVE.POL)

The waveform output can be inverted for the individual channels using the Waveform Output Invert Enable bit group in the Driver register (DRVCTRL.INVEN)

## 29.6.2.2 Enabling, Disabling and Resetting

The TCC is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The TCC is disabled by writing a zero to CTRLA.ENABLE.

The TCC is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the TCC, except DBGCTRL, will be reset to their initial state, and the TCC will be disabled. Refer to CTRLA register for details.

The TCC should be disabled before the TCC is reset to avoid undefined behavior.

## 29.6.2.3 Prescaler Selection

The GCLK\_TCCx is fed into the internal prescaler. Prescaler output intervals from 1 to 1/1024 are available. For a complete list of available prescaler outputs, see the register description for the Prescaler bit group in the Control A register (CTRLA.PRESCALER).

The prescaler consists of a counter that counts to the selected prescaler value, whereupon the output of the prescaler toggles. When the prescaler is set to a value greater than one, it is necessary to choose whether the prescaler should reset its value to zero or continue counting from its current value on the occurrence of an external re-trigger. It is also necessary to choose whether the TCC counter should wrap around on the next GCLK\_TCC clock pulse or the next prescaled clock pulse (CLK\_TCC\_CNT in Figure 29-3). To do this, use the Prescaler and Counter synchronization bit group in the Control A register (CTRLA.PRESYNC). If the counter is set to count events from the event system, these will not pass through the prescaler.

Figure 29-3. Prescaler  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_04aeb59bb190bcd28a1bfef2109fb45a66a065d2c0f86f6397df6d094697359b.jpg)

## 29.6.2.4 Counter Operation

Depending on the mode of operation, the counter is cleared, reloaded, incremented, or decremented at each TCC clock cycle (CLK\_TCC\_CNT). A counter clear or reload mark the end of current counter cycle and the start of a new one.

The counter will count in the direction set by the direction (CTRLBSET.DIR or CTRLBCLR.DIR) bit for each clock unti it reaches TOP or ZERO. A clear operation occurs when the TOP is reached while up-counting, the counter will be set to ZERO (cleared) on the next clock cycle. A reload operation occurs when the ZERO is reached while downcounting, the counter is reloaded with the period register (PER) value.

The counter value is continuously compared with the period (PER) and ZERO value to determine if the counter has reached TOP or ZERO. Based on this comparison, the Overflow Interrupt Flag in the Interrupt Flag Status and Clear register (INTFLAG.OVF)is set whenever the counter value matches with TOP / ZERO. This can be used to trigger an interrupt, a DMA request, or an event. If the One-Shot bit in the Control B Set register (CTRLBSET.ONESHOT) is set, the compare match (with TOP/ZERO) will stop the counting operation.

Up-counting is enabled by writing a one to the Direction bit in the Control B Clear register (CTRLBCLR.DIR). Downcounting is enabled by writing a one to the Direction bit in the Control B Set register (CTRLBSET.DIR).

Figure 29-4. Counter Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_9b78188c6a250dde6cf45d1a52ee0a6eb966eb562109bbce66157eeb1d3abeda.jpg)

As shown in Figure 29-4, it is possible to change the counter value (by writing directly in the Count register) even when the counter is running. The write access has higher priority than count, clear, or reload. The direction of the counter can also be changed during normal operation. Due to asynchronous clock domains, the internal counter settings are written when the synchronization is complete.

Normal operation must be used when using the counter as timer base for the capture channels.

## Stop Command

A Stop command can be issued from software by using TCC Command bits in Control B Set register (CTRLBSET.CMD =0x2, STOP).

When a stop is detected while the counter is running, the counter will maintain its current value. If the waveform generation (WG) is used, all waveforms are set to a state defined in Non-Recoverable State x Output Enable bit and

Non- Recoverable State x Output Value bit in the Driver Control register (DRVCTRL.NREx and DRVCTRL.NRVx), and the Stop bit in the Status register is set (STATUS.STOP).

## Pause Event Action

A pause command can be issued when the stop event action is configured in the Input Event Action 1 bits in Event Control register (EVCTRL.EVACT1=0x3, STOP).

When a pause is detected, the counter will maintain its current value and all waveforms keep their current state, as long as a start event action is detected: Input Event Action 0 bits in Event Control register (EVCTRL.EVACT0=0x3, START).

## Re-trigger Command and Event Action

A re-trigger command can be issued from software by using TCC Command bits in Control B Set register (CTRLBSET.CMD=0x1, RETRIGGER), or from event when the re-trigger event action is configured in the Input Event 0/1 Action bits in Event Control register (EVCTRL.EVACTn=0x1, RETRIGGER).

When the command is detected during counting operation, the counter will be reloaded or cleared, depending on the counting direction (CTRLBSET.DIR or CTRLBCLR.DIR). The Re-Trigger bit in the Interrupt Flag Status and Clear register will be set (INTFLAG.TRG). It is also possible to generate an event by writing a '1' to the Re-Trigger Event Output Enable bit in the Event Control register (EVCTRL.TRGEO). If the re-trigger command is detected when the counter is stopped, the counter will resume counting operation from the value in COUNT.

Note: When a re-trigger event action is configured in the Event Action bits in the Event Control register (EVCTRL.EVACTn=0x1, RETRIGGER), enabling the counter will not start the counter. The counter will start on the next incoming event and restart on corresponding following event.

## Start Event Action

The start action can be selected in the Event Control register (EVCTRL.EVACT0=0x3, START) and can start the counting operation when previously stopped. The event has no effect if the counter is already counting. When the module is enabled, the counter operation starts when the event is received or when a re-trigger software command is applied.

Note: When a start event action is configured in the Event Action bits in the Event Control register (EVCTRL.EVACT0=0x3, START), enabling the counter will not start the counter. The counter will start on the next incoming event, but it will not restart on subsequent events.

## Count Event Action

The TCC can count events. When an event is received, the counter increases or decreases the value, depending on direction settings (CTRLBSET.DIR or CTRLBCLR.DIR).

The count event action is selected by the Event Action 0 bit group in the Event Control register (EVCTRL.EVACT0=0x5, COUNT).

## Direction Event Action

The direction event action can be selected in the Event Control register (EVCTRL.EVACT1=0x2, DIR).

When this event is used, the asynchronous event path specified in the event system must be configured or selected. The direction event action can be used to control the direction of the counter operation, depending on external events level. When received, the event level overrides the Direction settings (CTRLBSET.DIR or CTRLBCLR.DIR) and the direction bit value is updated accordingly.

## Increment Event Action

The increment event action can be selected in the Event Control register (EVCTRL.EVACT0=0x4, INC) and can change the counter state when an event is received. When the TCE0 event (TCCx\_EV0) is received, the counte increments, whatever the direction setting (CTRLBSET.DIR or CTRLBCLR.DIR) is.

## Decrement Event Action

The decrement event action can be selected in the Event Control register (EVCTRL.EVACT1=0x4, DEC) and can change the counter state when an event is received. When the TCE1 (TCCx\_EV1) event is received, the counter decrements, whatever the direction setting (CTRLBSET.DIR or CTRLBCLR.DIR) is

## Non-recoverable Fault Event Action

Non-recoverable fault actions can be selected in the Event Control register (EVCTRL.EVACTn=0x7, FAULT). When received, the counter will be stopped and the output of the compare channels is overridden according to the Driver Control register settings (DRVCTRL.NREx and DRVCTRL.NRVx).

TCE0 and TCE1 must be configured as asynchronous events.

## Event Action Off

If the event action is disabled (EVCTRL.EVACTn=0x0, OFF), enabling the counter will also start the counter.

## 29.6.2.5 Compare Operations

By default, Compare/Capture channel is configured for Compare operations. To perform capture operations, it must be re-configured.

When using the TCC with the Compare/Capture Value registers (CCx) configured for compare operations, the counter value is continuously compared to the values in the CCx registers. This can be used for timer or for waveform operation.

The compare buffer (CCBx) register provides double buffer capability. The double buffering synchronizes the update of the CCx register with the buffer value at the UPDATE condition. For further details, refer to “Double Buffering” on page 626. The synchronization prevents the occurrence of odd-length, non-symmetrical pulses and ensures glitchfree output.

If Compare/Capture channel is not configured for capture operation Control A register), then compare operation will be enabled.

## Waveform Output Generation Operations

The compare channels can be used for waveform generation on output port pins. To make the waveform visible on the connected pin, the following requirements must be fulfilled:

1. Choose a waveform generation mode in the Waveform Control register (WAVE.WAVEGEN)

2. Optionally invert the waveform output WO[x] by writing the corresponding Waveform Output Invert Enable bit in the Driver Control register (DRVCTRL.INVENx)

3. Enable the corresponding PORTMUX

The counter value is continuously compared with each CCx value. When a compare match occurs, the Match or Capture Channel x bit in the Interrupt Flag Status and Clear register (INTFLAG.MCx) is set on the next zero-to-one transition of CLK\_TCC\_COUNT. If Match/Capture occurs, interrupt can be generated when INTENSET.MCX is set. If Compare/Match occurs, an event can be triggered when EVCTRL.MCEOx is set to one. Both interrupt and event can be generated simultaneously. The same condition generates a DMA request.

Six waveform configurations are available through the Waveform Generation (WG) bit group in the Waveform Control register (WAVE.WAVEGEN):

z Normal Frequency (NFRQ)

z Match Frequency (MFRQ)

z Single-slope PWM (NPWM)

● Dual-slope, interrupt/event at Top (DSTOP)

z Dual-slope, interrupt/event at ZERO (DSBOTTOM)

z Dual-slope, interrupt/event at Top and ZERO (DSBOTH)

z Dual-slope, critical interrupt/event at ZERO (DSCRITICAL)

When using MFRQ, the top value is defined by the CC0 register value, for all other waveforms operation the top value is defined by Period (PER) register value.

For dual slope waveform operations update time occurs when counter reaches the zero value. For all other waveforms generation modes, the update time occurs on counter wraparound, on overflow, underflow or retrigger.

## Normal Frequency Generation

For normal frequency generation, the period time is controlled by the period register (PER). The waveform generation output (WO[x]) is toggled on each compare match between COUNT and CCx, and the corresponding Match or Capture Channel x will be set.

Figure 29-5. Normal Frequency Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_a0bf860d7e9ad0508418e7f57ed68ee469f796f4d92ecee3c459b9d0e7acd124.jpg)

## Match Frequency Generation

For match frequency generation, the period time is controlled by CC0 instead of PER. WO[0] toggles on each updat condition.

Figure 29-6. Match Frequency Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_28e4411cfe3fd83d8f844226c758f8c8ac99958fb2d2c0ebebc6882546a32cd9.jpg)

## Single-Slope PWM Generation

For single-slope PWM generation, the period time is controlled by PER, while CCx control the duty cycle of the generated waveform output. When up-counting, WO[x] is set at start or compare match between the COUNT and TOP values, and cleared on compare match between COUNT and CCx register values.

When down-counting, WO[x] is cleared at start or compare match between the COUNT and TOP values, and set on compare match between COUNT and CCx register values.

Figure 29-7. Single-Slope PWM Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_f07c70cd3af47dfa97e5b572989ef63f4ebba1f4900fb5a5d45507ca0a5cd244.jpg)  
The following equation calculates the exact resolution for a single-slope PWM $( R _ { \mathsf { P W M } , \mathsf { S S } } )$ waveform:

$$
R _ {\mathrm {PWM\_SS}} = \frac {\log (\mathrm{TOP} + 1)}{\log (2)}
$$

The PWM frequency depends on the Period register value (PER) and the peripheral clock frequency $( \mathsf { f } _ { \mathsf { G C L K \_ T C C } } )$ , and can be

calculated by the following equation:

$$
f _ {\mathrm {PWM\_SS}} = \frac {f _ {\mathrm {GCLK\_TCC}}}{\mathrm{N} (\mathrm{TOP+1})}
$$

Where N represent the prescaler divider used (1, 2, 4, 8, 16, 64, 256, 1024).

## Dual-Slope PWM Generation

For dual-slope PWM generation, the period (TOP) is controlled by PER, while CCx control the duty cycle of the generated waveform output. Figure 29-8 shows how the counter repeatedly counts from ZERO (BOTTOM) to PER and then from PER to ZERO. The waveform generator output is set on compare match when up-counting, and cleared on compare match when down-counting. An interrupt/event is generated on TOP and/or ZERO depend of Dual slope operation selected Table 29-2. In DSBOTH operation, a second update time occur on TOP.

Figure 29-8. Dual-Slope Pulse Width Modulation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_ca904a88e2d057cce95199d2265bcea83bb316010e4a0622d8b15aff8b27afc8.jpg)  
Using dual-slope PWM results in a lower maximum operation frequency compared to single-slope PWM generation.

The period (TOP) defines the PWM resolution. The minimum resolution is 1 bits (TOP=0x00000001).

The following equation calculates the exact resolution for dual-slope PWM $\begin{array} { r } { ( \mathsf { R } _ { \mathsf { P W M } \_ \mathsf { D S } } ) \colon } \end{array}$

$$
R _ {\mathrm {PWM\_ {D} S}} = \frac {\log (\mathrm{PER} + 1)}{\log (2)}
$$

The PWM frequency depends on the period setting (TOP) and the peripheral clock frequency $( f _ { \mathsf { G C L K \_ T C C } } )$ and can be calculated by the following equation:

$$
f _ {\mathrm {PWM\_DS}} = \frac {f _ {\mathrm {GCLK\_TCC}}}{2 N \cdot P E R}
$$

N represents the prescaler divider used. The waveform generated will have a maximum frequency of half of the TCC clock frequency $( \mathsf { f } _ { \mathsf { G C L K \_ T C C } } )$ when TOP is set to one (0x00000001) and no prescaling is used.

The pulse width $( P _ { \mathsf { P W M } , \mathsf { D S } } )$ depends on the compare channel (CCx) register value and the peripheral clock frequency $( f _ { \mathsf { G C L K \_ T C C } } )$ , and can be calculated by the following equation:

$$
P _ {\mathrm {PWM\_DS}} = \frac {2 N \cdot (P E R - C C x)}{f _ {\mathrm {GCLK\_TCC}}}
$$

Where N represents the prescaler divider used.

Note: In DSTOP, DSBOTTOM and DSBOTH operation, when TOP is lower than MAX/2 the CCx MSB bit defines the ramp (rising if CCx[MSB] is 0, or falling if CCx[MSB] is 1) on which the CCx Match interrupt or event is generated.

## Dual-Slope Critical PWM Generation

Critical mode operation allows generation of non-aligned centered pulses. In this mode, the period time is controlled by PER, while CCx control the generated waveform output edge during up-counting and CC(x+CC\_NUM/2) contro the generated waveform output edge during down-counting.

Figure 29-9. Dual-Slope Critical Pulse Width Modulation (N=CC\_NUM)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_6791fe36e6041cdea62251f78ad7e5f659d8a17a354d823b56a6241a1abb5152.jpg)  
The table below shows the update counter and overflow event/interrupt generation conditions in different operation modes.

Table 29-2. Counter Update and Overflow Event/interrupt Conditions

<table><tr><td>Description</td><td colspan="7">Description</td></tr><tr><td>Name</td><td>Operation</td><td>Top</td><td>Update</td><td>Output Waveform On Match</td><td>Output Waveform On Update</td><td>OVIF/Event Up</td><td>Down</td></tr><tr><td>NFRQ</td><td>Normal Frequency</td><td>PER</td><td>TOP/ZERO</td><td>Toggle</td><td>Stable</td><td>TOP</td><td>ZERO</td></tr><tr><td>MFRQ</td><td>Match Frequency</td><td>CC0</td><td>TOP/ZERO</td><td>Toggle</td><td>Stable</td><td>TOP</td><td>ZERO</td></tr><tr><td>NPWM</td><td>Single-slope PWM</td><td>PER</td><td>TOP/ZERO</td><td rowspan="5" colspan="2">See Table 29-3</td><td>TOP</td><td>ZERO</td></tr><tr><td>DSCRITICAL</td><td>Dual-slope PWM</td><td>PER</td><td>ZERO</td><td>-</td><td>ZERO</td></tr><tr><td>DSBOTTOM</td><td>Dual-slope PWM</td><td>PER</td><td>ZERO</td><td>-</td><td>ZERO</td></tr><tr><td>DSBOTH</td><td>Dual-slope PWM</td><td>PER</td><td>TOP &amp; ZERO</td><td>TOP</td><td>ZERO</td></tr><tr><td>DSTOP</td><td>Dual-slope PWM</td><td>PER</td><td>ZERO</td><td>TOP</td><td>-</td></tr></table>

## Output Polarity

The polarity (WAVE.POLx) is available in all waveform output generation. In single-slope and dual-slope PWM generation, it is possible to invert individually the pulse edge alignment on start or end of PWM cycle for each compare

channels. Table 29-3 shows the waveform output set/clear conditions, depending on timer/counter settings, direction and polarity setting.

Table 29-3. Waveform Generation Set/Clear Conditions

<table><tr><td>Waveform Generation operation</td><td>DIR</td><td>POLx</td><td colspan="2">Waveform Generation Output Update</td></tr><tr><td></td><td></td><td></td><td>Set</td><td>Clear</td></tr><tr><td rowspan="4">Single-Slope PWM</td><td rowspan="2">0</td><td>0</td><td>Timer/counter matches TOP</td><td>Timer/counter matches CCx</td></tr><tr><td>1</td><td>Timer/counter matches CC</td><td>Timer/counter matches TOP</td></tr><tr><td rowspan="2">1</td><td>0</td><td>Timer/counter matches CC</td><td>Timer/counter matches ZERO</td></tr><tr><td>1</td><td>Timer/counter matches ZERO</td><td>Timer/counter matches CC</td></tr><tr><td rowspan="2">Dual-Slope PWM</td><td rowspan="2">x</td><td>0</td><td>Timer/counter matches CC when counting up</td><td>Timer/counter matches CC when counting down</td></tr><tr><td>1</td><td>Timer/counter matches CC when counting down</td><td>Timer/counter matches CC when counting up</td></tr></table>

In Normal and Match Frequency, the WAVE.POLx value represents the initial state of the waveform output.

## 29.6.2.6 Double Buffering

The Pattern (PATT), Waveform (WAVE), Period (PER) and the Compare Channels (CCx) registers are all double buffered. Each buffer register has a Buffer Valid (PATTBV, WAVEBV, PERBV or CCBVx) bit in the STATUS register, which indicates that the buffer register contains a value that can be copied into the corresponding register. When double buffering is enabled by writing a one to the Lock Update bit in the Control B Clear register (CTRLBCLR.LUPD) and the PER and CCx are used for a compare operation, the Buffer Valid bit is set when data has been written to a buffer register and cleared on an update condition.

This is shown for a compare register in Figure 29-10.

Figure 29-10.Compare Channel Double Buffering  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_a593fe81a1e804ca999394c77fb71091fd6cdf08285ec511674e766e0b214d1e.jpg)

As both the register (PATT/WAVE/PER/CCx) and corresponding buffer register (PATTB/WAVEB/PERB/CCBx) are available in the I/O register map, the double buffering feature is not mandatory. The double buffering is disabled by writing a one to CTRLSET.LUPD. This allows initialization and bypassing of the buffer register and the double buffering feature.

Note: In normal frequency (NFRQ), match frequency (MFRQ) or PWM down-counting counter mode (CTRLB-SET.DIR is one), PER is written at the same time as PERB is written if CTRLB.LUPD is zero or as soon as CTRLB.LUPD becomes zero.

## Changing the Period

The counter period is changed by writing a new value to the Period register or the Period Buffer register. If double buffering is not used, any update of PER is effective after the synchronization delay.

Figure 29-11.Unbuffered Single-Slope Up-Counting Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_57b2c2eb08ba5468bc8c53bb649c633335eba04e43d485d04162c58b56981bc5.jpg)

Figure 29-12.Unbuffered Single-Slope Down-Counting Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_455fba5dc65e7ed057c9d1fc5a8ca4c8699140916249720f2deb6775c5a0e2ed.jpg)

A counter wraparound can occur in any mode of operation when up-counting without buffering, as shown in Figure 29- 11. This due to the fact that COUNT and TOP are continuously compared, and if a new value that is lower than the current COUNT is written to TOP, COUNT will wrap before a compare match happen.

Figure 29-13.Unbuffered Dual-Slope Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_dc98dc1690cf285faaf666e0bff942bb1a7ee1870744614323c886c827c376e1.jpg)

When double buffering is used, the buffer can be written at any time and the counter will still maintain correct operation. The period register is always updated on the update condition, as shown for dual-slope operation in Figure 29-14. This prevents wraparound and the generation of odd waveforms.

Figure 29-14.Changing the Period Using Buffering  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_1c75a29ee495b81bc7611de63bf1413386d3e2581937073ec85a3749f7a78292.jpg)

## 29.6.2.7 Capture Operations

To enable and use capture operations, the Match or Capture Channel x Event Input Enable (MCEIx) bit must be enabled in the Event Control register (EVCTRL.MCEIx). The capture channels to be used must also be enabled in the Capture Channel x Enable bit in the Control A register (CTRLA.CPTENx) before capture can be performed.

## Event Capture Action

The capture channels can be used to capture the COUNT value upon reception of any event. Since there is one event line per capture channel, multiple capture operations can be enabled at the same time.

Figure 29-15 shows four capture events for one capture channel.

Figure 29-15.Input Capture Timing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_25b5cf124f11a3a1cf08acd627f224b93d94b9c2eb980a43219280364cfec4c3.jpg)

For input capture, the buffer register and the corresponding CCx act like a FIFO. When CCx is empty or read, any content in CCBx is transfered to CCx. The buffer valid flag is passed to set the CCx interrupt flag (IF) and generate the optional interrupt, event or DMA request.

Figure 29-16.Capture Double Buffering  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_e27b143a9f38bbfbb71331704f1aec5ce0e40ef52f9a80ad8e0de916a52d67a4.jpg)

When the Capture x (MCx) bit and the buffer valid flag are set and a new capture event is detected, there is nowhere to store the new timestamp. In that case the Error bit in the Interrupt Flag Status and Clear register (INTFLAG.ERR) is set.

## Period and Pulse-Width Capture Action

The TCC can perform two input captures and restart the counter on one of the edges. This enables the TCC to measure the pulse-width and period. This can be used to characterize an input signal in frequency and duty cycle:

$$
f = \frac {1}{T} d u t y C y c l e = \frac {t p}{T}
$$

When using PPW (Period, Pulse-width) event action, period (TOP) will be captured into CC0 and pulse-width (tp) into CC1. In PWP (Pulse-width, Period) event action, pulse-width (tp) will be captured into CC0 and period (TOP) into CC1.

Figure 29-17.PWP Capture  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_c3f9c421fe1dfffd6cb07e70894aa388b6c89ed9c02b24dbcfdc1e4912b39e56.jpg)  
Selecting PWP or PPW in the Event Action bit group in the Event Control register (EVCTRL.EVACT1) enables the TCC to perform two capture actions, one on the rising edge and one on the falling edge.

The Timer/Counter Inverted Event 1 Input Enable bit in Event Control register (EVCTRL.TCEINV1) is used to select which event input edge the counter restarts operation. The event source to be captured must be an asynchronous event.

For a period and width of the pulse of input signal in frequency and duty cycle, enable capture on CC0 and CC1 channels by writing a one to the Capture Channel x Enable bit in the Control A register (CTRLA.CPTENx). When only one of these measurements is required, the second channel can be used for other purposes.

The TCC can detect capture overflow of the input capture channels. Capture overflow occurs when the Capture Interrupt Flag is set and a new capture event is detected, there is nowhere to store the new timestamp. In that case INTFLAG.ERR is set.

Note: In dual-slope PWM operation, when TOP is lower than MAX/2 the CCx MSB captures the CTRLB.DIR state to identify the ramp (rising if CCx[MSB] is zero, or falling if CCx[MSB] is one) on which the Counter capture has been done.

## 29.6.3 Additional Features

## 29.6.3.1 One-Shot Operation

When one-shot is enabled, the counter automatically stops on the next counter overflow or underflow condition. When the counter is stopped, STATUS.STOP is set and the waveform outputs are set to the value defined by the Non-Recoverable State x Output Enable (NREx) and Non-Recoverable State x Output Value (NRVx) bits in the Drive Control register (DRVCTRL.NREx and DRVCTRL.NRVx)

One-shot operation can be enabled by writing a one to the One-Shot bit in the Control B Set register (CTRLBSET.ONESHOT) and disabled by writing a one to the One-Shot bit in the Control B Clear register (CTRLBCLR.ONESHOT). When enabled, the TCC will count until an overflow or underflow occurs and stop counting. The one-shot operation can be restarted by using retrigger software command, a retrigger event or a start event.

When the counter restarts its operation, the Stop bit in the Status register (STATUS.STOP) is cleared.

## 29.6.3.2 Circular Buffer

The Period register (PER) and the compare channels register (CC0 to CC3) support circular buffer operation. When circular buffer operation is enabled, at each update condition, the (PER) or CCx values are copied into the corresponding buffer registers. Circular buffer are dedicated to RAMP2, RAMP2A, and DSBOTH operations.

Figure 29-18.Circular Buffer on Channel 0  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_51d1c62474d61c141376ca5fb4dcf5d2a638993038a3edce9666f0c3ddc1e830.jpg)

## 29.6.3.3 Dithering Operation

The TCC supports dithering on Pulse-width or Period on a 16, 32 or 64 PWM cycles frame.

Dithering consists in adding some extra clocks cycles in a frame of several PWM cycles, improving the accuracy of the average output pulses width or period. The extra clock cycles are added on some of the compare match signals, one at a time, through a "blue noise" process that minimizes the flickering on the resulting dither patterns.

Dithering makes possible to improve the accuracy of the average output pulse width or period.

Dithering is enabled by writing the corresponding configuration in the Enhanced Resolution bits in CTRLA register (CTRLA.RESOLUTION):

z DITH4 enable dithering every 16 PWM frames

DITH5 enable dithering every 32 PWM frames

DITH6 enable dithering every 64 PWM frames

The DITHERCY bits of COUNT, PER and CCx define the number of extra cycles to add into the frame (DITHERCY bits from the respective COUNT, PER or CCx registers). The remaining bits of COUNT, PER, CCx define the compare value itself.

The pseudo code, giving the extra cycles insertion regarding the cycle is:

```c
int extra_cycle(resolution, dithercy, cycle){
    int MASK;
    int value
    switch (resolution){
    DITH4: MASK = 0x0f;
    DITH5: MASK = 0x1f;
    DITH6: MASK = 0x3f;
    }
    value = cycle * dithercy;
    if (((MASK & value) + dithercy) > MASK)
    return 1;
    return 0;
}
```

## 1.7.3.3.1: Dithering on Period

Writing DITHERCY in PER will lead to an average PWM period configured by the following formula:

If DITH4 mode is enabled, the last 4 significant bits from PER/CCx or COUNT register corresponds to the DITHERCY value, Rest of the bits corresponds to PER/CCx or COUNT value.

The PWM resolution can be calculated using the following formulas.

DITH4 mode:

$$
P w m P e r i o d = \frac {D I T H E R C Y}{1 6} + P E R
$$

DITH5 mode:

$$
P w m P e r i o d = \frac {D I T H E R C Y}{3 2} + P E R
$$

DITH6 mode:

$$
P w m P e r i o d = \frac {D I T H E R C Y}{6 4} + P E R
$$

## 1.7.3.3.2: Dithering on Pulse Width

Writing DITHERCY in CCx will lead to an average PWM pulse width configured by the following formula:

DITH4 mode:

$$
P w m P u l s e W i d t h = \frac {D I T H E R C Y}{1 6} + C C x
$$

DITH5 mode:

$$
P w m P u l s e W i d t h = \frac {D I T H E R C Y}{3 2} + C C x
$$

DITH6 mode:

$$
P w m P u l s e W i d t h = \frac {D I T H E R C Y}{6 4} + C C x
$$

## 29.6.3.4 Ramp Operations

Three ramp operations are supported and all require the timer/counter running in single-slope PWM generation.

## RAMP1 Operation

This is the default PWM operation, described in “Single-Slope PWM Generation” on page 623.

## RAMP2 Operation

These operations are dedicated for PFC, Half-Brige and Push-Pull SMPS topologies, where two consecutive timer/counter cycles are interleaved, as shown in Figure 29-19. In cycle A, odd channels output are disabled, and in cycle B, even channels output are disabled. The ramp index changes after each update, but can be software modified using the the Ramp index command bits in Control B Set register (CTRLBSET.IDXCMD).

## Standard RAMP2 (RAMP2) Operation

Ramp A and B periods are controlled through PER register value. Period register value can have different values on each ramp by enabling the circular buffer option (CIPEREN). This mode allows use of a two channels TCC to generate two output signals, or one output signal with another CC channel enabled in capture mode.

Figure 29-19.RAMP2 Standard Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_bcec5162b5ea2acae851ffa830c5cb4fd7abeadf3c882771c5916103daa71d67.jpg)

## Alternate RAMP2 (RAMP2A) Operation

Alternate RAMP2 operation is similar to RAMP2 with the difference that CC0 controls both WO[0]/WO[1] waveforms when the corresponding circular buffer option is enabled. The waveform polarity is the same on both outputs, and the channel 1 can be used in capture mode.

Figure 29-20.RAMP2 Alternate Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_9871195f6076689ba01f3d4bdfc4e74e57cf1831b42bf787ae3ac63a2dfe9b67.jpg)

## 29.6.3.5 Recoverable Faults

Recoverable faults can restart or halt the timer/counter. Two faults, called Fault A and Fault B, can trigger recoverable fault actions on compare channels CC0 and CC1 from the timer/counter. The compare channels outputs can be clamped to inactive state as long as the fault condition is present, or from the first valid fault condition detection and until the end of the timer/counter cycle.

## Fault inputs

The first two channel input events (MC0 and TCCxMC1) can be used as Fault A and Fault B inputs respectively. Event system channel connected to these fault inputs must be configured as asynchronous. In two ramp (RAMP2, RAMP2A) operation.

## Fault filtering

Three filtering types are available. The recoverable faults can use all three filters independently or various filter combinations.

Input filtering: By default, the event detection is asynchronous. When the event occurs, the fault system will immediately and asynchronously performs the selected fault action on the compare channel output, including system power modes where the clock is not available. To avoid false fault detection on external events (e.g. a glitch on I/O port) a digital filter can be enabled and set in FILTERVAL bits in the corresponding recoverable Fault Control n register (FCTRLn.FILTERVAL). In this case, the event will be delayed by the FILTERVAL value clock cycles. If the event width is less than the FILTERVAL, then the event will be discarded.

Fault blanking: Provides a way to disable fault input just after a selected waveform output edge to prevent false fault triggering because of signal bouncing on fault signal, as shown in Figure 29-21. Blanking can be enabled by writing the edge triggering configuration to the Faultn Blanking Mode bits in the Recoverable FaultnConfiguration register (FCTRLn.BLANK), and the number of clock cycles to blank is written to the Faultn Blanking Time bits in the Recoverable Faultn Configuration register (FCTRLn.BLANKVAL). The maximum blanking time is:

256 / (96 ×10<sup>6</sup>) = 2.66us for 96MHz peripheral clock frequency (GCLK\_TCCx)

256 / (1x10<sup>6</sup>) = 256us for 1MHz peripheral clock frequency (GCLK\_TCCx)

Figure 29-21.Fault Blanking in RAMP1 Operation with Inverted Polarity  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_9b2027ecedb8c1eb382115c9e7c1f07fb0041e082aff6f5e7f6e893408e53181.jpg)

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_fbd6b4d59e686d26eacfd4ae633bb7654a91d3d527c1ea1ef748c5b38db0421e.jpg)

Fault Qualification can be enabled using Faultn Qualification bit in Recoverable Faultn Configuration register (FCTRLn.QUAL). When the recoverable fault qualification is enabled (FCTRLn.QUAL), the fault input is disabled all the time the corresponding channel output has an inactive level, as shown in Figure 29-22.

Figure 29-22.Fault Qualification in RAMP1 Operation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_0ed3e2a5b1f453ec688d08cff26e7de98f5df8b2fc1c42250924843ebdf90cbc.jpg)

Figure 29-23.Fault Qualification in RAMP2 Operation with Inverted Polarity  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_6659513a9c276571c4fade25ebec468b244f86bf3d190d31ee8673261353ab00.jpg)

## Fault actions

Different fault actions can be configured individually for Fault A and Fault B. Most fault actions are not mutually exclusive; hence two or more actions can be enabled at the same time to achieve a result that is a combination of fault actions.

Keep action can be enabled using Faultn Keeper bit in Recoverable Faultn Configuration register (FCTRLn.KEEP). When the keep action (FCTRLn.KEEP) is enabled, the corresponding channel output will be clamped to zero when the fault condition is present. The clamp will be released on the start of the first cycle after the fault condition is no longer present, as shown in Figure 29-24.

Figure 29-24.Waveform Generation with Fault Qualification and Keep Action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_2a5b7bb5e355b6747af38daf68721c327a4c5aba336f8e014728a1169bcda055.jpg)

Restart action can be enabled using Faultn Restart bit in Recoverable Faultn Configuration register (FCTRLn.RESTART). When the restart action (FCTRLn.RESTART) is enabled, the timer/counter will be restarted when the corresponding fault condition is present. The ongoing cycle is stopped and the timer/counter starts a new cycle, as shown in Figure 29-25. When the new cycle starts, the compare outputs will be clamped to inactive level as long as the fault condition is present. Note that in RAMP2 operation, when a new timer/counter cycle starts, the cycle index will change automatically, as shown in Figure 29-26. Fault A and Fault B are qualified only during the cycle A and cycle B respectively, i.e. the faultA and faultB is disabled during cycle B or cycle A respectively.

Figure 29-25.Waveform Generation in RAMP1 mode with Restart Action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_40057b3e090f66cd966b5b2cfb9b5a4c59e52d129214b1679ca4ac3245d20caa.jpg)

Figure 29-26.Waveform Generation in RAMP2 mode with Restart Action  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_8f9a30831b0552066692225d7ea69fb096aa39dd23a04ed10054f9db72e9898d.jpg)

Capture action: Several capture actions can be selected using Faultn Capture Action bits in Faultn Control register (FCTRLn.CAPTURE). When one of the capture operations (FCTRLn.CAPTURE) is selected, the counter value is captured when the fault occurs. Several capture operations are available:

CAPT is equivalent to a standard capture operation, for further details refer to “Capture Operations” on page 629

CAPTMIN allows to get the minimum time stamped value, with notification through event or interrupt on each new local minimum captured value detection.

CAPTMAX allows to get the maximum time stamped value, with notification through event or IT on each new local maximum captured value, as shown in Figure 29-27.

z LOCMIN notifies through event or IT a local minimum captured value is detected.

z LOCMAX notifies through event or IT a local maximum captured value is detected.

DERIV0 notifies through event or IT when a local extremum captured value is detected, as shown in Figure 29-28.

In CAPT mode, on each filtered faultn, dedicated CCx channel capture counter value and an interrupt is generated. In other mode interrupt is only generated on a extremum captured value.

In CAPT operation, capture is performed on each capture event. MCx interrupt flag is set on each new capture. In CAPTMIN and CAPTMAX operation, capture is performed only when a new lower (for CAPTMIN) and new higher (for CAPMAX) value is detected. MCx interrupt flag is set on each new capture.

In LOCMIN and LOCMAX operation, capture is performed on each capture event. MCx interrupt flag is set only when the captured value is lower (for LOCMIN) and higher (for LOCMAX) values respectively than the previous captured value. DERIV0 is equivalent to a OR function of (LOCMIN, LOCMAX).

In CAPTMIN and CAPTMAX operation CCx keeps the extremum values respectively, as show in Figure 29-27, while in LOCMIN, LOCMAX or DERIV0 operations, CCx follow the counter value at fault time, as show in Figure 29-28.

Figure 29-27.Capture Action “CAPTMAX”  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_3c7fd9186a7d9018c5b98c84091c637afd3c69f15dee9e4ba47909a04fd18452.jpg)

Figure 29-28.Capture Action “DERIV0”  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_32501c92aac42a535b8561e9eb8dabfc6a5bd4a5f99d5ee45a421dd83357a9eb.jpg)

Hardware halt action can be configured using Faultn Halt mode bits in Recoverable Faultn configuration register (FCTRLn.HALT = HW). When hardware halt action is enabled (FCTRLn.HALT = HW), the timer/counter is halted and the cycle is extended as long as the corresponding fault is present. Figure 29- 29 shows an example where restart and hardware halt actions are enabled for Fault A. The compare channel 0 output is clamped to inactive level as long as the timer/counter is halted. The timer/counter resumes the counting operation as soon as the fault condition is no longer present. If the restart action is enabled, the timer/counter is halted as long as the fault condition is present and restarted when the fault condition is no longer present, as shown in Figure 29-30. Note that in RAMP2 and RAMP2A operations, when a new timer/counter cycle starts, the cycle index will automatically change.

Figure 29-29.Waveform Generation with Halt and Restart Actions  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_24081c5761e4f57c5d47e2e0c6590daeebb3f9c31c76ffbc98f1b30f9e896152.jpg)

Figure 29-30.Waveform Generation with Fault Qualification, Halt and Restart Actions  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_6e27a77c20a7fe9524a0c6d683851b469934479e6c8bda42eb456db623620c84.jpg)  
The software halt action can be configured using Faultn Halt mode bits in Recoverable Faultn configuration register (FCTRLn.HALT = SWHALT). Software halt action is similar to hardware halt action with one exception. To restart the timer/counter, the corresponding fault condition should no longer be present and the corresponding FAULTn bit in STATUS register must be cleared.

Figure 29-31.Waveform Generation with Software Halt, Fault Qualification, Keep and Restart Actions  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_8ad846737c7bd0d21f1e217d2eb081f94f43e20f94223a7348719c0b772fe994.jpg)

## 29.6.3.6 Non Recoverable Faults

The non-recoverable fault action will force all the compare outputs to a pre-defined level programmed into the Driver Control register (DRVCTRL.NRE and DRVCTRL.NRV). The non recoverable fault input (EV0 and EV1) actions are enabled in Event Control register (EVCTRL.EVACT0 and EVCTRL.EVACT1). To avoid false fault detection on external events (e.g. a glitch on an I/O port) a digital filter can be enabled using Non-Recoverable Fault Input x Filter Value bits in the Driver Control register (DRVCTRL.FILTERVALn). In this case, the event detection is synchronous, and event action is delayed by the selected digital filter value clock cycles.

## 29.6.3.7 Waveform Extension

Figure 29-32 shows a schematic diagram of action of the four optional units following the recoverable fault stage, on a port pin pair. The DTI and SWAP units can be seen as a four port pair slices:

z Slice 0 DTI0 / SWAP0 acting on port pins (WO[0], WO[WO\_NUM/2 +0])

z Slice 1 DTI1 / SWAP1 acting on port pins (WO[1], WO[WO\_NUM/2 +1])

And more generally:

z Slice n DTIx / SWAPx acting on port pins (WO[x], WO[WO\_NUM/2 +x])

Figure 29-32.Waveform Extension Stage Details  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_2f359e1b9686afc114d6852132491124c6ef0ceb6cd83b660ea72850401ec90a.jpg)

The output matrix (OTMX) unit distributes compare channels, according to the selectable configurations, as shown in Table 29-4.

Table 29-4. Output Matrix Channel Pin Routing Configuration

<table><tr><td>Value</td><td colspan="8">OTMX[x]</td></tr><tr><td>0x0</td><td>CC3</td><td>CC2</td><td>CC1</td><td>CC0</td><td>CC3</td><td>CC2</td><td>CC1</td><td>CC0</td></tr><tr><td>0x1</td><td>CC1</td><td>CC0</td><td>CC1</td><td>CC0</td><td>CC1</td><td>CC0</td><td>CC1</td><td>CC0</td></tr><tr><td>0x2</td><td>CC0</td><td>CC0</td><td>CC0</td><td>CC0</td><td>CC0</td><td>CC0</td><td>CC0</td><td>CC0</td></tr><tr><td>0x3</td><td>CC1</td><td>CC1</td><td>CC1</td><td>CC1</td><td>CC1</td><td>CC1</td><td>CC1</td><td>CC0</td></tr></table>

z Configuration 0x0 is default configuration. The channel location is the default one and channels are distributed on outputs modulo the number of channels. Channel 0 is routed to the Output matrix output OTMX[0], Channel 1 to OTMX[1]. If there are more outputs than channels, then channel 0 is duplicated to the Output matrix output OTMX[CC\_NUM], channel 1 to OTMX[CC\_NUM+1] and so on.

Configuration 0x1 distributes the channels on output modulo half the number of channels, this gives the lower channels twice the number of output locations than the default configuration. This provides for example, control of the four transistors of a full bridge using only two compare channels. Using pattern generation, some of these four outputs can be overwritten by a constant level, enabling flexible drive of a full bridge in all quadrant configurations.

z Configuration 0x2 distributes the compare channel 0 (CC0) to all port pins. With pattern generation, this configuration can control a stepper motor.

z Configuration 0x3 distributes the compare channel CC0 to first output and the channel CC1 to all other outputs. Together with pattern generation and the fault extension this configuration can control up to seven LED strings, with a boost stage.

An example of 4 compare channels on 4 outputs:

<table><tr><td>Value</td><td>OTMX[3]</td><td>OTMX[2]</td><td>OTMX[1]</td><td>OTMX[0]</td></tr><tr><td>0x0</td><td>CC3</td><td>CC2</td><td>CC1</td><td>CC0</td></tr><tr><td>0x1</td><td>CC1</td><td>CC0</td><td>CC1</td><td>CC0</td></tr><tr><td>0x2</td><td>CC0</td><td>CC0</td><td>CC0</td><td>CC0</td></tr><tr><td>0x3</td><td>CC1</td><td>CC1</td><td>CC1</td><td>CC0</td></tr></table>

The dead-time insertion (DTI) unit generates OFF time with the non-inverted low side (LS) and inverted high side (HS) of the WG output forced at low level. This OFF time is called dead time, and dead-time insertion ensures that the LS and HS will never switch simultaneously.

The DTI stage consists of four equal dead-time insertion generators; one for each of the first four compare channels. Figure 29-33shows the block diagram of one DTI generator. The four channels have a common register which controls the dead time and is independent of high side and low side setting.

Figure 29-33.Dead-Time Generator Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_70413c66273c8495b587a728571cc7c1c753e2f1341a0be90ff33af91066ee58.jpg)

As shown in Figure 29-33, the 8-bit dead-time counter is decremented by one for each peripheral clock cycle, until it reaches zero. A nonzero counter value will force both the low side and high side outputs into their OFF state. When the output matrix (OTMX) output changes, the dead-time counter is reloaded according to the edge of the input. When the output changes from low to high (positive edge) it initiates counter reload of the DTLS register, and when the output changes from high to low (negative edge) reload the DTHS register.

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_860e01c6d6d0c369370b7e28ae16c975acbbfd6daa41971b1b60bef03e521d99.jpg)

The pattern generator unit produces a synchronized bit pattern across the port pins it is connected to. The pattern generation features are primarily intended for handling the commutation sequence in brushless DC motor (BLDC), stepper motor and full bridge control. A block diagram of the pattern generator is shown in Figure 29-35.

Figure 29-35.Pattern Generator Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_cc55327e9ab7daf6ce18c4901c50b95d1dba572f26e05e5c361841aee2f5750f.jpg)

As with other double buffered timer/counter registers, the register update is synchronized to the UPDATE condition set by the timer/counter waveform generation operation. If the synchronization is not required by the application, the software can simply access directly the PATT.PGE, PATT.PGV bits registers.

29.6.4 DMA, Interrupts and Events  
Table 29-5. Module request for TCC

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Overflow / Underflow</td><td>X</td><td>X</td><td></td><td> $X^{(1)}$ </td><td>Cleared when PER/PERB, CCx/CCBx, PATT/PATTB or WAVE/WAVEB register is written.</td></tr><tr><td>Channel Compare Match or Capture</td><td>X</td><td>X</td><td> $X^{(2)}$ </td><td>X</td><td>For compare channel: Cleared when CCBx register is written.For capture channel: Cleared when CCx register is read.</td></tr><tr><td>Retrigger</td><td>X</td><td>X</td><td></td><td></td><td></td></tr><tr><td>Count</td><td>X</td><td>X</td><td></td><td></td><td></td></tr><tr><td>Capture Overflow Error</td><td>X</td><td></td><td></td><td></td><td></td></tr><tr><td>Synchronization Ready</td><td>X</td><td></td><td></td><td></td><td></td></tr><tr><td>Debug Fault State</td><td>X</td><td></td><td></td><td></td><td></td></tr><tr><td>Recoverable Faults</td><td>X</td><td></td><td></td><td></td><td></td></tr><tr><td>Non-Recoverable Faults</td><td>X</td><td></td><td></td><td></td><td></td></tr><tr><td>TCCx Event 0 input</td><td></td><td></td><td> $X^{(3)}$ </td><td></td><td></td></tr><tr><td>TCCx Event 1 input</td><td></td><td></td><td> $X^{(4)}$ </td><td></td><td></td></tr></table>

Notes: 1. DMA request set on overflow, underflow or retrigger conditions.  
2. Can perform capture or generate recoverable fault on an event input.  
3. Can retrigger counter / control counter direction / stop the counter / decrement the counter / perform period and pulse width capture / generate non-recoverable fault on an event input.  
4. Can retrigger counter / increment or decrement counter depending on direction / start the counter / increment or decrement counter based on direction / increment counter regardless of direction / generate nonrecoverable fault on an event input.

## 29.6.4.1 DMA Operation

The TCC generates the following DMA requests:

Overflow (OVF): the request is set when an update condition (overflow, underflow or re-trigger) is detected.

Compare Match or Capture (MCx): for a compare channel, the request is set on each compare match detection. For a capture channel, the request is set when valid data is present in CCx register, and cleared when CCx register is read.

## 29.6.4.2 Interrupts

The TCC has the following interrupt sources:

z Overflow/Underflow: OVF

z Retrigger: TRG

● Count: CNT. For further details, refer to EVCTRL.CNTSEL description.

z Capture Overflow Error: ERR

Debug Fault State: DFS

z Recoverable Faults: FAULTn

z Non-recoverable Faults: FAULTx

z Compare Match or Capture Channels: MCx

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear (INTFLAG) register is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set (INTENSET) register, and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear (INTENCLR) register. An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled, or the TCC is reset. See theINTFLAGfor details on how to clear interrupt flags. The TCC has one common interrupt request line for all the interrupt sources. Refer to “Processor And Architecture” on page 25 for details. The user must read the INTFLAG register to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Processor And Architecture” on page 25 for details.

## 29.6.4.3 Events

The TCC can generate the following output events:

z Overflow/Underflow: OVF

z Trigger: TRG

● Counter: CNT. For further details, refer to EVCTRL.CNTSEL description.

z Compare Match or Capture on compare/capture channels: MCx

Writing a one to an Event Output bit in the Event Control Register (EVCTRL.xxEO) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event. Refer to “EVSYS – Event System” on page 405 for details on configuring the event system.

The TCC can take the following actions on a channel input event (MCx):

z Capture event

z Generate a recoverable fault

The TCC can take the following actions on counter event 1 (TCCx EV1):

z Counter retrigger

z Counter direction control

z Stop the counter

z Decrement the counter on event

z Period and pulse width capture

z Non-recoverable fault

The TCC can take the following actions on counter event 0 (TCCx EV0):

z Counter retrigger

z Count on event (increment or decrement, depending on counter direction)

Counter start. Start counting on the event rising edge. Further events will not restart the counter; it keeps on counting using prescaled GCLK\_TCCx, until it reaches TOP or Zero depending on the direction.

z Counter increment on event. This will increment the counter irrespective of the counter direction.

Count during active state of an asynchronous event (increment or decrement, depending on counter direction). In this case, the counter will be incremented or decremented on each cycle of the prescaled clock, as long as the event is active.

z Non-recoverable fault

The counter Event Actions are available in Event Control register (EVCTRL.EVACT0 and EVCTRL.EVACT1). For further details, refer to EVCTRL register description.

Writing a one to an Event Input bit in the Event Control register (EVCTRL.MCEIx or EVCTRL.TCEIx) enables the corresponding action on input event. Writing a zero to this bit disables the corresponding action on input event. Note that if several events are connected to the TCC, the enabled action will apply for each the incoming event. Refer to “EVSYS – Event System” on page 405 for details on how to configure the event system.

## 29.6.5 Sleep Mode Operation

The TCC can be configured to operate in any sleep mode. To be able to run in standby the RUNSTDBY bit (CTRLA.RUNSTDBY) must be written to one. The TCC can wake up the device using interrupts from any sleep mode or performs internal actions through the event system.

## 29.6.6 Synchronization

Due to the asynchronicity between CLK\_TCCx\_APB and GCLK\_TCCx some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

● No synchronization

When a register requiring synchronization is accessed, the corresponding synchronization bit is set in Synchronization Busy register (SYNCBUSY) and cleared when the synchronization is complete.

An access to a register with synchronization busy bit set, will trigger an hardware interrupt.

The following bits need synchronization when written:

z Software Reset and Enable bits in Control A register (CTRLA.SWRST and CTRLA.ENABLE)

Write-synchronization is denoted by the Write-Synchronized property in the register description.

The following registers require synchronization when written:

z Control B Clear and Control B Set registers (CTRLBCLR and CTRLBSET)

z Status register (STATUS)

z Pattern and Pattern Buffer registers (PATT and PATTB)

z Waveform and Waveform Buffer registers (WAVE and WAVEB)

z Count Value register (COUNT)

z Period Value and Period Buffer Value registers (PER and PERB)

z Compare/Capture Value and Compare/Capture Buffer Value registers (CCx and CCBx)

Write-synchronization is denoted by the Write-Synchronized property in the register description.

## 29.7 Register Summary

Table 29-6. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">CTRLA</td><td>7:0</td><td></td><td colspan="2">RESOLUTION[1:0]</td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>15:8</td><td></td><td>ALOCK</td><td colspan="2">PRESCSYNC[1:0]</td><td>RUNSTDBY</td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>0x02</td><td>23:16</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x03</td><td>31:24</td><td></td><td></td><td></td><td></td><td>CPTEN3</td><td>CPTEN2</td><td>CPTEN1</td><td>CPTEN0</td></tr><tr><td>0x04</td><td>CTRLBCLR</td><td>7:0</td><td colspan="3">CMD[2:0]</td><td colspan="2">IDXCMD[1:0]</td><td>ONESHOT</td><td>LUPD</td><td>DIR</td></tr><tr><td>0x05</td><td>CTRLBSET</td><td>7:0</td><td colspan="3">CMD[2:0]</td><td colspan="2">IDXCMD[1:0]</td><td>ONESHOT</td><td>LUPD</td><td>DIR</td></tr><tr><td>0x06</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td rowspan="4">SYNCBUSY</td><td>7:0</td><td>PER</td><td>WAVE</td><td>PATT</td><td>COUNT</td><td>STATUS</td><td>CTRLB</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x09</td><td>15:8</td><td></td><td></td><td></td><td></td><td>CC3</td><td>CC2</td><td>CC1</td><td>CC0</td></tr><tr><td>0x0A</td><td>23:16</td><td></td><td>CCB3</td><td>CCB2</td><td>CCB1</td><td>CCB0</td><td>PERB</td><td>WAVEB</td><td>PATTB</td></tr><tr><td>0x0B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td rowspan="4">FCTRLA</td><td>7:0</td><td>RESTART</td><td colspan="2">BLANK[1:0]</td><td>QUAL</td><td>KEEP</td><td></td><td colspan="2">SRC[1:0]</td></tr><tr><td>0x0D</td><td>15:8</td><td>BLANKPRESC</td><td colspan="3">CAPTURE[2:0]</td><td colspan="2">CHSEL[1:0]</td><td colspan="2">HALT[1:0]</td></tr><tr><td>0x0E</td><td>23:16</td><td colspan="8">BLANKVAL[7:0]</td></tr><tr><td>0x0F</td><td>31:24</td><td></td><td></td><td></td><td></td><td colspan="4">FILTERVAL[3:0]</td></tr><tr><td>0x10</td><td rowspan="4">FCTRLB</td><td>7:0</td><td>RESTART</td><td colspan="2">BLANK[1:0]</td><td>QUAL</td><td>KEEP</td><td></td><td colspan="2">SRC[1:0]</td></tr><tr><td>0x11</td><td>15:8</td><td>BLANKPRESC</td><td colspan="3">CAPTURE[2:0]</td><td colspan="2">CHSEL[1:0]</td><td colspan="2">HALT[1:0]</td></tr><tr><td>0x12</td><td>23:16</td><td colspan="8">BLANKVAL[7:0]</td></tr><tr><td>0x13</td><td>31:24</td><td></td><td></td><td></td><td></td><td colspan="4">FILTERVAL[3:0]</td></tr><tr><td>0x14</td><td rowspan="4">WEXCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">OTMX[1:0]</td></tr><tr><td>0x15</td><td>15:8</td><td></td><td></td><td></td><td></td><td>DTIEN3</td><td>DTIEN2</td><td>DTIEN1</td><td>DTIEN0</td></tr><tr><td>0x16</td><td>23:16</td><td colspan="8">DTLS[7:0]</td></tr><tr><td>0x17</td><td>31:24</td><td colspan="8">DTHS[7:0]</td></tr><tr><td>0x18</td><td rowspan="4">DRVCTRL</td><td>7:0</td><td>NRE7</td><td>NRE6</td><td>NRE5</td><td>NRE4</td><td>NRE3</td><td>NRE2</td><td>NRE1</td><td>NRE0</td></tr><tr><td>0x19</td><td>15:8</td><td>NRV7</td><td>NRV6</td><td>NRV5</td><td>NRV4</td><td>NRV3</td><td>NRV2</td><td>NRV1</td><td>NRV0</td></tr><tr><td>0x1A</td><td>23:16</td><td>INVEN7</td><td>INVEN6</td><td>INVEN5</td><td>INVEN4</td><td>INVEN3</td><td>INVEN2</td><td>INVEN1</td><td>INVEN0</td></tr><tr><td>0x1B</td><td>31:24</td><td colspan="4">FILTERVAL[1:3:0]</td><td colspan="4">FILTERVAL[3:0]</td></tr><tr><td>0x1C</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1D</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1E</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>FDDBD</td><td></td><td>DBGRUN</td></tr><tr><td>0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="4">EVCTRL</td><td>7:0</td><td colspan="2">CNTSEL[1:0]</td><td colspan="3">EVACT[1:2:0]</td><td colspan="3">EVACT[0:2:0]</td></tr><tr><td>0x21</td><td>15:8</td><td>TCEI1</td><td>TCEI0</td><td>TCINV1</td><td>TCINV0</td><td></td><td>CNTEO</td><td>TRGEO</td><td>OVFEO</td></tr><tr><td>0x22</td><td>23:16</td><td></td><td></td><td></td><td></td><td>MCEI3</td><td>MCEI2</td><td>MCEI1</td><td>MCEI0</td></tr><tr><td>0x23</td><td>31:24</td><td></td><td></td><td></td><td></td><td>MCEO3</td><td>MCEO2</td><td>MCEO1</td><td>MCEO0</td></tr><tr><td>0x24</td><td rowspan="4">INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td>ERR</td><td>CNT</td><td>TRG</td><td>OVF</td></tr><tr><td>0x25</td><td>15:8</td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>DFS</td><td></td><td></td><td></td></tr><tr><td>0x26</td><td>23:16</td><td></td><td></td><td></td><td></td><td>MC3</td><td>MC2</td><td>MC1</td><td>MC0</td></tr><tr><td>0x27</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x28</td><td rowspan="4">INTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td>ERR</td><td>CNT</td><td>TRG</td><td>OVF</td></tr><tr><td>0x29</td><td>15:8</td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>DFS</td><td></td><td></td><td></td></tr><tr><td>0x2A</td><td>23:16</td><td></td><td></td><td></td><td></td><td>MC3</td><td>MC2</td><td>MC1</td><td>MC0</td></tr><tr><td>0x2B</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x2C</td><td rowspan="4">INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td>ERR</td><td>CNT</td><td>TRG</td><td>OVF</td></tr><tr><td>0x2D</td><td>15:8</td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>DFS</td><td></td><td></td><td></td></tr><tr><td>0x2E</td><td>23:16</td><td></td><td></td><td></td><td></td><td>MC3</td><td>MC2</td><td>MC1</td><td>MC0</td></tr><tr><td>0x2F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x30</td><td rowspan="4">STATUS</td><td>7:0</td><td>PERBV</td><td>WAVEBV</td><td>PATTBV</td><td>SLAVE</td><td>DFS</td><td></td><td>IDX</td><td>STOP</td></tr><tr><td>0x31</td><td>15:8</td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>FAULT1IN</td><td>FAULT0IN</td><td>FAULTBIN</td><td>FAULTAIN</td></tr><tr><td>0x32</td><td>23:16</td><td></td><td></td><td></td><td></td><td>CCBV3</td><td>CCBV2</td><td>CCBV1</td><td>CCBV0</td></tr><tr><td>0x33</td><td>31:24</td><td></td><td></td><td></td><td></td><td>CMP3</td><td>CMP2</td><td>CMP1</td><td>CMP0</td></tr><tr><td>0x34</td><td rowspan="4">COUNT</td><td>7:0</td><td colspan="8">COUNT[7:0]</td></tr><tr><td>0x35</td><td>15:8</td><td colspan="8">COUNT[15:8]</td></tr><tr><td>0x36</td><td>23:16</td><td colspan="8">COUNT[23:16]</td></tr><tr><td>0x37</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x38</td><td rowspan="2">PATT</td><td>7:0</td><td>PGE7</td><td>PGE6</td><td>PGE5</td><td>PGE4</td><td>PGE3</td><td>PGE2</td><td>PGE1</td><td>PGE0</td></tr><tr><td>0x39</td><td>15:8</td><td>PGV7</td><td>PGV6</td><td>PGV5</td><td>PGV4</td><td>PGV3</td><td>PGV2</td><td>PGV1</td><td>PGV0</td></tr><tr><td>0x3A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x3B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x3C</td><td rowspan="4">WAVE</td><td>7:0</td><td>CIPEREN</td><td></td><td colspan="2">RAMP[1:0]</td><td></td><td colspan="3">WAVEGEN[2:0]</td></tr><tr><td>0x3D</td><td>15:8</td><td></td><td></td><td></td><td></td><td>CICCEN3</td><td>CICCEN2</td><td>CICCEN1</td><td>CICCEN0</td></tr><tr><td>0x3E</td><td>23:16</td><td></td><td></td><td></td><td></td><td>POL3</td><td>POL2</td><td>POL1</td><td>POL0</td></tr><tr><td>0x3F</td><td>31:24</td><td></td><td></td><td></td><td></td><td>SWAP3</td><td>SWAP2</td><td>SWAP1</td><td>SWAP0</td></tr><tr><td>0x40</td><td rowspan="4">PER</td><td>7:0</td><td colspan="8">PER[7:0]</td></tr><tr><td>0x41</td><td>15:8</td><td colspan="8">PER[15:8]</td></tr><tr><td>0x42</td><td>23:16</td><td colspan="8">PER[23:16]</td></tr><tr><td>0x43</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x44</td><td rowspan="4">CC0</td><td>7:0</td><td colspan="8">CC[7:0]</td></tr><tr><td>0x45</td><td>15:8</td><td colspan="8">CC[15:8]</td></tr><tr><td>0x46</td><td>23:16</td><td colspan="8">CC[23:16]</td></tr><tr><td>0x47</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x54 ... 0x63</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x64</td><td rowspan="2">PATTB</td><td>7:0</td><td>PGEB7</td><td>PGEB6</td><td>PGEB5</td><td>PGEB4</td><td>PGEB3</td><td>PGEB2</td><td>PGEB1</td><td>PGEB0</td></tr><tr><td>0x65</td><td>15:8</td><td>PGVB7</td><td>PGVB6</td><td>PGVB5</td><td>PGVB4</td><td>PGVB3</td><td>PGVB2</td><td>PGVB1</td><td>PGVB0</td></tr><tr><td>0x66</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x67</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x68</td><td rowspan="4">WAVEB</td><td>7:0</td><td>CIPERENB</td><td></td><td colspan="2">RAMPB[1:0]</td><td></td><td colspan="3">WAVEGENB[2:0]</td></tr><tr><td>0x69</td><td>15:8</td><td></td><td></td><td></td><td></td><td>CICCENB3</td><td>CICCENB2</td><td>CICCENB1</td><td>CICCENB0</td></tr><tr><td>0x6A</td><td>23:16</td><td></td><td></td><td></td><td></td><td>POLB3</td><td>POLB2</td><td>POLB1</td><td>POLB0</td></tr><tr><td>0x6B</td><td>31:24</td><td></td><td></td><td></td><td></td><td>SWAPB3</td><td>SWAPB2</td><td>SWAPB1</td><td>SWAPB0</td></tr><tr><td>0x6C</td><td rowspan="4">PERB</td><td>7:0</td><td colspan="8">PERB[7:0]</td></tr><tr><td>0x6D</td><td>15:8</td><td colspan="8">PERB[15:8]</td></tr><tr><td>0x6E</td><td>23:16</td><td colspan="8">PERB[23:16]</td></tr><tr><td>0x6F</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x70</td><td rowspan="4">CCB0</td><td>7:0</td><td colspan="8">CCB[7:0]</td></tr><tr><td>0x71</td><td>15:8</td><td colspan="8">CCB[15:8]</td></tr><tr><td>0x72</td><td>23:16</td><td colspan="8">CCB[23:16]</td></tr><tr><td>0x73</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

## 29.8 Register Description

Registers can be 8, 16, or 32 bits wide. Atomic 8-, 16-, and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register, and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Please refer to the “Register Access Protection” on page 616 and the PAC chapter for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or Read-Synchronized property in each individual register description. Please refer to the “Synchronization” on page 646 for details.

Some registers are enable-protected, meaning they can only be written when the TCC is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 29.8.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00000000

Access: Read-Write

Property: Enable-Protected, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>CPTEN3</td><td>CPTEN2</td><td>CPTEN1</td><td>CPTENO</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td>ALOCK</td><td colspan="2">PRESCSYNC[1:0]</td><td>RUNSTDBY</td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td colspan="2">RESOLUTION[1:0]</td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 27:24 – CPTENx [x=3..0]: Capture Channel x Enable

These bits are used to select the capture or compare operation on channel x. The number of available channels depend on the TCC instance.

Writing a one to CAPTENx enables capture on channel x.

Writing a zero to CAPTENx disables capture on channel x.

These bits are not synchronized.

## z Bits 23:15 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 14 – ALOCK: Auto Lock

When this bit is set, Lock Update (LUPD) is set to one on each overflow/underflow or re-trigger event.

0: The LUPD bit is not affected on overflow/underflow, and re-trigger event.

1: The LUPD bit is set on each overflow/underflow or re-trigger event.

This bit is not synchronized.

z Bits 13:12 – PRESCSYNC[1:0]: Prescaler and Counter Synchronization Selection These bits select if on retrigger event, the Counter should be cleared or reloaded on the next GCLK\_TCCx clock or on the next prescaled GCLK\_TCCx clock. It also makes possible to reset the prescaler on retrigger event, as shown in the following table.

These bits are not synchronized.

Table 29-7. Prescaler and Counter Synchronization Selection

<table><tr><td>PRESCSYNC[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>GCLK</td><td>Reload or reset counter on next GCLK</td></tr><tr><td>0x1</td><td>PRESC</td><td>Reload or reset counter on next prescaler clock</td></tr><tr><td>0x2</td><td>RESYNC</td><td>Reload or reset counter on next GCLK and reset prescaler counter</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## ● Bit 11 – RUNSTDBY: Run in Standby

This bit is used to keep the TCC running in standby mode:

0: The TCC is halted in standby.

1: The TCC continues to run in standby.

This bit is not synchronized.

## ● Bits 10:8 – PRESCALER[2:0]: Prescaler

These bits select the Counter prescaler factor as shown in the following table. These bits are not synchronized.

Table 29-8. Prescaler

<table><tr><td>PRESCALER[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV1</td><td>No division</td></tr><tr><td>0x1</td><td>DIV2</td><td>Divide by 2</td></tr><tr><td>0x2</td><td>DIV4</td><td>Divide by 4</td></tr><tr><td>0x3</td><td>DIV8</td><td>Divide by 8</td></tr><tr><td>0x4</td><td>DIV16</td><td>Divide by 16</td></tr><tr><td>0x5</td><td>DIV64</td><td>Divide by 64</td></tr><tr><td>0x6</td><td>DIV256</td><td>Divide by 256</td></tr><tr><td>0x7</td><td>DIV1024</td><td>Divide by 1024</td></tr></table>

## z Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 6:5 – RESOLUTION[1:0]: Enhanced Resolution

These bits increase the TCC resolution by enabling the dithering options, according to the following table. These bits are not synchronized.

Table 29-9. Enhanced Resolution

<table><tr><td>RESOLUTION[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>Dithering is disabled</td></tr><tr><td>0x1</td><td>DITH4</td><td>Dithering is done every 16 PWM frames</td></tr><tr><td>0x2</td><td>DITH5</td><td>Dithering is done every 32 PWM frames</td></tr><tr><td>0x3</td><td>DITH6</td><td>Dithering is done every 64 PWM frames</td></tr></table>

## z Bits 4:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 1 – ENABLE: Enable

0: The peripheral is disabled.

1: The peripheral is enabled.

Due to synchronization there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRLA.ENABLE will read back immediately and the ENABLE bit in the SYNCBUSY register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE will be cleared when the operation is complete.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the TCC, except DBGCTRL, to their initial state, and the TCC will be disabled.

Writing a one to CTRLA.SWRST will always take precedence; all other writes in the same write-operation will be discarded.

Due to synchronization there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and SYNCBUSY.SWRST will both be cleared when the reset is complete.

## 29.8.2 Control B Clear

Name: CTRLBCLR

Offset: 0x04

Reset: 0x00

Access: Read-Write

Property: Read-Synchronized, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">CMD[2:0]</td><td colspan="2">IDXCMD[1:0]</td><td>ONESHOT</td><td>LUPD</td><td>DIR</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to change the below mentioned functionalities without doing a read-modify-write operation. Changes in this register will also be reflected in the Control B Set (CTRLBSET) register.

## z Bits 7:5 – CMD[2:0]: TCC Command

These bits can be used for software control of re-triggering and stop commands of the TCC. When a command has been executed, the CMD bit field will read back zero. The commands are executed on the next prescaled GCLK\_TCC clock cycle.

Writing a zero to this bit group has no effect.

Writing a valid value to these bits will clear the corresponding pending command.

Table 29-10. TCC Command

<table><tr><td>CMD[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No action</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Clear start, restart or retrigger</td></tr><tr><td>0x2</td><td>STOP</td><td>Force stop</td></tr><tr><td>0x3</td><td>UPDATE</td><td>Force update or double buffered registers</td></tr><tr><td>0x4</td><td>READSYNC</td><td>Force COUNT read synchronization</td></tr><tr><td>0x5-0x7</td><td></td><td>Reserved</td></tr></table>

## z Bits 4:3 – IDXCMD[1:0]: Ramp Index Command

These bits can be used to force cycle A and cycle B changes in RAMP2 and RAMP2A operation, according to the following table. On timer/counter update condition, the command is executed, the IDX flag in STATUS register is updated and the IDXCMD command is cleared.

Writing a zero to this field has no effect.

Writing a valid value to this field will clear the pending command.

Table 29-11. Ramp Index Command

<table><tr><td>IDXCMD[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Command disabled: Index toggles between cycles A and B</td></tr><tr><td>0x1</td><td>SET</td><td>Set index: cycle B will be forced in the next cycle</td></tr><tr><td>0x2</td><td>CLEAR</td><td>Clear index: cycle A will be forced in the next cycle</td></tr><tr><td>0x3</td><td>HOLD</td><td>Hold index: the next cycle will be the same as the current cycle</td></tr></table>

## ● Bit 2 – ONESHOT: One-Shot

This bit controls one-shot operation of the TCC. When one-shot operation is enabled, the TCC will stop counting on the next overflow/underflow condition or on a stop command.

0: The TCC will update the counter value on overflow/underflow condition and continues operation.

1: The TCC will stop counting on the next underflow/overflow condition.

Writing a zero to this bit has no effect

Writing a one to this bit will disable the one-shot operation.

## z Bit 1 – LUPD: Lock Update

This bit controls the update operation of the TCC buffered registers. When this bit is set, no update of the buffered registers is performed, even though an UPDATE condition has occurred. Locking the update ensures that all buffers registers are valid before an update is performed.

This bit has no effect when input capture operation is enabled.

1: The CCBx, PERB, PGVB, PGEB, and SWAPBx buffer registers value are not copied into the corresponding CCx, PER, PGV, PGE and SWAPx registers.

0: The CCBx, PERB, PGVB, PGEB, and SWAPBx buffer registers value are copied into the corresponding CCx, PER, PGV, PGE and SWAPx registers on counter update condition.

## z Bit 0 – DIR: Counter Direction

This bit is used to change the direction of the counter.

0: The timer/counter is counting up (incrementing).

1: The timer/counter is counting down (decrementing).

Writing a zero to this bit has no effect

Writing a one to this bit will make the counter count up.

## 29.8.3 Control B Set

Name: CTRLBSET

Offset: 0x05

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">CMD[2:0]</td><td colspan="2">IDXCMD[1:0]</td><td>ONESHOT</td><td>LUPD</td><td>DIR</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to change the below mentioned functionalities without doing a read-modify-write operation. Changes in this register will also be reflected in the Control B Clear (CTRLBCLR) register.

## z Bits 7:5 – CMD[2:0]: TCC Command

These bits can be used for software control of re-triggering and stop commands of the TCC. When a command has been executed, the CMD field will be read back as zero. The commands are executed on the next prescaled GCLK\_TCC clock cycle.

Writing a zero to this bit group has no effect

Writing a valid value into this bit group will set the associated command, as shown in the table below.

Table 29-12. TCC Command

<table><tr><td>CMD[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NONE</td><td>No action</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Clear start, restart or retrigger</td></tr><tr><td>0x2</td><td>STOP</td><td>Force stop</td></tr><tr><td>0x3</td><td>UPDATE</td><td>Force update or double buffered registers</td></tr><tr><td>0x4</td><td>READSYNC</td><td>Force COUNT read synchronization</td></tr><tr><td>0x5-0x7</td><td></td><td>Reserved</td></tr></table>

## z Bits 4:3 – IDXCMD[1:0]: Ramp Index Command

These bits can be used to force cycle A and cycle B changes in RAMP2 and RAMP2A operation, according to the table below. On timer/counter update condition, the command is executed, the IDX flag in STATUS register is updated and the IDXCMD command is cleared.

Writing a zero to this field has no effect.

Writing a valid value into this field will set a command.

Table 29-13. Ramp Index Command

<table><tr><td>IDXCMD[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Command disabled: Index toggles between cycles A and B</td></tr><tr><td>0x1</td><td>SET</td><td>Set index: cycle B will be forced in the next cycle</td></tr><tr><td>0x2</td><td>CLEAR</td><td>Clear index: cycle A will be forced in the next cycle</td></tr><tr><td>0x3</td><td>HOLD</td><td>Hold index: the next cycle will be the same as the current cycle</td></tr></table>

## ● Bit 2 – ONESHOT: One-Shot

This bit controls one-shot operation of the TCC. When in one-shot operation, the TCC will stop counting on the next overflow/underflow condition or a stop command.

0: The TCC will count continuously.

1: The TCC will stop counting on the next underflow/overflow condition.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the one-shot operation.

## z Bit 1 – LUPD: Lock Update

This bit controls the update operation of the TCC buffered registers. When this bit is set, no update of the buffered registers is performed, even though an UPDATE condition has occurred. Locking the update can be used to ensure that all buffer registers are loaded with the desired values, before an update is performed. After all the buffer registers are loaded correctly, the buffered registers can be unlocked.

This bit has no effect when input capture operation is enabled.

1: The CCBx, PERB, PGVB, PGEB, and SWAPBx buffer registers value are not copied into CCx, PER, PGV, PGE and SWAPx registers.

0: The CCBx, PERB, PGVB, PGEB, and SWAPBx buffer registers value are copied into CCx, PER, PGV, PGE and SWAPx registers on timer Overflow/underflow or retrigger condition.

## z Bit 0 – DIR: Counter Direction

This bit is used to change the direction of the counter.

0: The timer/counter is counting up (incrementing).

1: The timer/counter is counting down (decrementing).

Writing a zero to this bit has no effect

Writing a one to this bit will make the counter count down.

## 29.8.4 Synchronization Busy

Name: SYNCBUSY

Offset: 0x08

Reset: 0x00000000

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td>CCB3</td><td>CCB2</td><td>CCB1</td><td>CCB0</td><td>PERB</td><td>WAVEB</td><td>PATTB</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>CC3</td><td>CC2</td><td>CC1</td><td>CC0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PER</td><td>WAVE</td><td>PATT</td><td>COUNT</td><td>STATUS</td><td>CTRLB</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:23 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 22:19 – CCBx [x=3..0]: Compare Channel Buffer x Busy

This bit is cleared when the synchronization of Compare/Capture Channel x Buffer register between the clock domains is complete.

This bit is set when the synchronization of Compare/Capture Channel x Buffer register between clock domains is started.

CCBx bit is available only for existing Compare/Capture Channels. For details on CC channels number, refer to each TCC feature list.

This bit is set when the synchronization of CCBx register between clock domains is started.

## z Bit 18 – PERB: Period Buffer Busy

This bit is cleared when the synchronization of PERB register between the clock domains is complete.

This bit is set when the synchronization of PERB register between clock domains is started.

## z Bit 17 – WAVEB: Wave Buffer Busy

This bit is cleared when the synchronization of WAVEB register between the clock domains is complete. This bit is set when the synchronization of WAVEB register between clock domains is started.

## Bit 16 – PATTB: Pattern Buffer Busy

This bit is cleared when the synchronization of PATTB register between the clock domains is complete. This bit is set when the synchronization of PATTB register between clock domains is started.

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 11:8 – CCx [x=3..0]: Compare Channel x Busy

This bit is cleared when the synchronization of Compare/Capture Channel x register between the clock domains is complete.

This bit is set when the synchronization of Compare/Capture Channel x register between clock domains is started. CCx bit is available only for existing Compare/Capture Channels. For details on CC channels number, refer to each TCC feature list.

This bit is set when the synchronization of CCx register between clock domains is started.

## Bit 7 – PER: Period busy

This bit is cleared when the synchronization of PER register between the clock domains is complete. This bit is set when the synchronization of PER register between clock domains is started.

## ● Bit 6 – WAVE: Wave Busy

This bit is cleared when the synchronization of WAVE register between the clock domains is complete. This bit is set when the synchronization of WAVE register between clock domains is started.

## ● Bit 5 – PATT: Pattern Busy

This bit is cleared when the synchronization of PATT register between the clock domains is complete. This bit is set when the synchronization of PATT register between clock domains is started.

## z Bit 4 – COUNT: Count Busy

This bit is cleared when the synchronization of COUNT register between the clock domains is complete. This bit is set when the synchronization of COUNT register between clock domains is started.

## z Bit 3 – STATUS: Status Busy

This bit is cleared when the synchronization of STATUS register between the clock domains is complete. This bit is set when the synchronization of STATUS register between clock domains is started.

## Bit 2 – CTRLB: Ctrlb Busy

This bit is cleared when the synchronization of CTRLB register between the clock domains is complete. This bit is set when the synchronization of CTRLB register between clock domains is started.

## z Bit 1 – ENABLE: Enable Busy

This bit is cleared when the synchronization of ENABLE register bit between the clock domains is complete. This bit is set when the synchronization of ENABLE register bit between clock domains is started.

## z Bit 0 – SWRST: Swrst Busy

This bit is cleared when the synchronization of SWRST register bit between the clock domains is complete. This bit is set when the synchronization of SWRST register bit between clock domains is started.

## 29.8.5 Recoverable Fault A Configuration

Name: FCTRLA

Offset: 0x0C

Reset: 0x00000000

Access: Read-Write

Property: Enable-Protected, Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">FILTERVAL[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">BLANKVAL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>BLANKPRESC</td><td colspan="3">CAPTURE[2:0]</td><td colspan="2">CHSEL[1:0]</td><td colspan="2">HALT[1:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RESTART</td><td colspan="2">BLANK[1:0]</td><td>QUAL</td><td>KEEP</td><td></td><td colspan="2">SRC[1:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 27:24 – FILTERVAL[3:0]: Fault A Filter Value

These bits define the filter value applied on MCEx (x=0,1) event input line. The value must be set to zero when MCEx event is used as synchronous event.

## z Bits 23:16 – BLANKVAL[7:0]: Fault A Blanking Time

These bits are used to ignore potential glitches after selectable waveform edge is detected. The edge selection is available in BLANK bits (FCTRLA.BLANK). When enabled, the fault input source is internally disabled during BLANKVAL\* prescaled GCLK\_TCC periods after the detection of the waveform edge.

## ● Bit 15 – BLANKPRESC: Fault A Blanking Prescaler

This bit enables a 64 prescaler factor on BLANKVAL value.

0: Blank time is BLANKVAL\* prescaled GCLK\_TCC.

1: Blank time is BLANKVAL\* 64 \* prescaled GCLK\_TCC.

## z Bits 14:12 – CAPTURE[2:0]: Fault A Capture Action

These bits select the capture and Fault A interrupt/event conditions, as defined in the table below.

Table 29-14. Fault A Capture Action

<table><tr><td>CAPTURE[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>No capture</td></tr><tr><td>0x1</td><td>CAPT</td><td>Capture on fault</td></tr><tr><td>0x2</td><td>CAPTMIN</td><td>Minimum capture</td></tr><tr><td>0x3</td><td>CAPTMAX</td><td>Maximum capture</td></tr><tr><td>0x4</td><td>LOCMIN</td><td>Minimum local detection</td></tr><tr><td>0x5</td><td>LOCMAX</td><td>Maximum local detection</td></tr><tr><td>0x6</td><td>DERIV0</td><td>Minimum and maximum local detection</td></tr><tr><td>0x7</td><td>CAPTMARK</td><td>Capture with ramp index as MSB value</td></tr></table>

## Bits 11:10 – CHSEL[1:0]: Fault A Capture Channel

These bits select the channel for capture operation triggered by recoverable Fault A, as defined in the table below.

Table 29-15. Fault A Capture Channel

<table><tr><td>CHSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>CC0</td><td>Capture value stored in channel 0</td></tr><tr><td>0x1</td><td>CC1</td><td>Capture value stored in channel 1</td></tr><tr><td>0x2</td><td>CC2</td><td>Capture value stored in channel 2</td></tr><tr><td>0x3</td><td>CC3</td><td>Capture value stored in channel 3</td></tr></table>

## Bits 9:8 – HALT[1:0]: Fault A Halt Mode

These bits select the halt action for recoverable Fault A as defined in the table below.

Table 29-16. Fault A Halt Mode

<table><tr><td>HALT[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Halt action disabled</td></tr><tr><td>0x1</td><td>HW</td><td>Hardware halt action</td></tr><tr><td>0x2</td><td>SW</td><td>Software halt action</td></tr><tr><td>0x3</td><td>NR</td><td>Non-recoverable fault</td></tr></table>

## ● Bit 7 – RESTART: Fault A Restart

Setting this bit enables restart action for Fault A.

0: Fault A restart action is disabled.

1: Fault A restart action is enabled.

## Bits 6:5 – BLANK[1:0]: Fault A Blanking Mode

These bits, select the blanking start point for recoverable Fault A as defined in the table below.

Table 29-17. Fault A Blanking Mode

<table><tr><td>BLANK[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>START</td><td>Blanking applied from start of ramp</td></tr><tr><td>0x1</td><td>RISE</td><td>Blanking applied from rising edge of the output waveform</td></tr><tr><td>0x2</td><td>FALL</td><td>Blanking applied from falling edge of the output waveform</td></tr><tr><td>0x3</td><td>BOTH</td><td>Blanking applied from each toggle of the output waveform</td></tr></table>

## z Bit 4 – QUAL: Fault A Qualification

Setting this bit, enables the recoverable Fault A input qualification.

0: The recoverable Fault A input is not disabled on CMPx value condition.

1: The recoverable Fault A input is disabled when output signal is at inactive level (CMPx == 0).

## Bit 3 – KEEP: Fault A Keeper

Setting this bit enables the Fault A keep action.

0: The Fault A state is released as soon as the recoverable Fault A is released.

1: The Fault A state is released at the end of TCC cycle.

## Bit 2 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 1:0 – SRC[1:0]: Fault A Source

These bits select the TCC event input for recoverable Fault A, as defined in the table below.

Event system channel connected to MCEx event input, must be configured to route the event asynchronously, when used as a recoverable Fault A input.

Table 29-18. Fault A Source

<table><tr><td>SRC[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Fault input disabled</td></tr><tr><td>0x1</td><td>ENABLE</td><td>MCEx (x=0,1) event input</td></tr><tr><td>0x2</td><td>INVERT</td><td>Inverted MCEx (x=0,1) event input</td></tr><tr><td>0x3</td><td>ALTFAULT</td><td>Alternate fault (A or B) state at the end of the previous period</td></tr></table>

## 29.8.6 Recoverable Fault B Configuration

Name: FCTRLB

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: Enable-Protected, Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">FILTERVAL[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">BLANKVAL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>BLANKPRESC</td><td colspan="3">CAPTURE[2:0]</td><td colspan="2">CHSEL[1:0]</td><td colspan="2">HALT[1:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RESTART</td><td colspan="2">BLANK[1:0]</td><td>QUAL</td><td>KEEP</td><td></td><td colspan="2">SRC[1:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 27:24 – FILTERVAL[3:0]: Fault B Filter Value

These bits define the filter value applied on MCEx (x=0,1) event input line. The value must be set to zero when MCEx event is used as synchronous event.

## z Bits 23:16 – BLANKVAL[7:0]: Fault B Blanking Time

These bits are used to ignore potential glitches after selectable waveform edge is detected. The edge selection is available in BLANK bits (FCTRLB.BLANK). When enabled, the fault input source is internally disabled during BLANKVAL\* prescaled GCLK\_TCC periods after the detection of the edge.

## ● Bit 15 – BLANKPRESC: Fault B Blanking Prescaler

This bit enables a 64 prescaler factor on BLANKVAL value.

0: Blank time is BLANKVAL\* prescaled GCLK\_TCC.

1: Blank time is BLANKVAL\* 64 \* prescaled GCLK\_TCC.

## z Bits 14:12 – CAPTURE[2:0]: Fault B Capture Action

These bits select the capture and Fault B interrupt/event conditions, as defined in table below.

Table 29-19. Fault B Capture Action

<table><tr><td>CAPTURE[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>No capture</td></tr><tr><td>0x1</td><td>CAPT</td><td>Capture on fault</td></tr><tr><td>0x2</td><td>CAPTMIN</td><td>Minimum capture</td></tr><tr><td>0x3</td><td>CAPTMAX</td><td>Maximum capture</td></tr><tr><td>0x4</td><td>LOCMIN</td><td>Minimum local detection</td></tr><tr><td>0x5</td><td>LOCMAX</td><td>Maximum local detection</td></tr><tr><td>0x6</td><td>DERIV0</td><td>Minimum and maximum local detection</td></tr><tr><td>0x7</td><td>CAPTMARK</td><td>Capture with ramp index as MSB value</td></tr></table>

## Bits 11:10 – CHSEL[1:0]: Fault B Capture Channel

These bits select the channel for capture operation triggered by recoverable Fault B, as defined in the table below.

Table 29-20. Fault B Capture Channel

<table><tr><td>CHSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>CC0</td><td>Capture value stored in channel 0</td></tr><tr><td>0x1</td><td>CC1</td><td>Capture value stored in channel 1</td></tr><tr><td>0x2</td><td>CC2</td><td>Capture value stored in channel 2</td></tr><tr><td>0x3</td><td>CC3</td><td>Capture value stored in channel 3</td></tr></table>

## Bits 9:8 – HALT[1:0]: Fault B Halt Mode

These bits select the halt action for recoverable Fault B as defined in the table below.

Table 29-21. Fault B Halt Mode

<table><tr><td>HALT[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Halt action disabled</td></tr><tr><td>0x1</td><td>HW</td><td>Hardware halt action</td></tr><tr><td>0x2</td><td>SW</td><td>Software halt action</td></tr><tr><td>0x3</td><td>NR</td><td>Non-recoverable fault</td></tr></table>

## ● Bit 7 – RESTART: Fault B Restart

Setting this bit enables restart action for Fault B.

0: Fault B restart action is disabled.

1: Fault B restart action is enabled.

## Bits 6:5 – BLANK[1:0]: Fault B Blanking Mode

These bits, select the blanking start point for recoverable Fault B as defined in the table below.

Table 29-22. Fault B Blanking Mode

<table><tr><td>BLANK[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>START</td><td>Blanking applied from start of ramp</td></tr><tr><td>0x1</td><td>RISE</td><td>Blanking applied from rising edge of the output waveform</td></tr><tr><td>0x2</td><td>FALL</td><td>Blanking applied from falling edge of the output waveform</td></tr><tr><td>0x3</td><td>BOTH</td><td>Blanking applied from each toggle of the output waveform</td></tr></table>

## z Bit 4 – QUAL: Fault B Qualification

Setting this bit, enables the recoverable Fault B input qualification.

0: The recoverable Fault B input is not disabled on CMPx value condition.

1: The recoverable Fault B input is disabled when output signal is at inactive level (CMPx == 0).

## Bit 3 – KEEP: Fault B Keeper

Setting this bit enables the Fault B keep action.

0: The Fault B state is released as soon as the recoverable Fault B is released.

1: The Fault B state is released at the end of TCC cycle.

## Bit 2 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 1:0 – SRC[1:0]: Fault B Source

These bits select the TCC event input for recoverable Fault B, as defined in the table below.

Event system channel connected to MCEx event input, must be configured to route the event asynchronously, when used as a recoverable Fault B input.

Table 29-23. Fault B Source

<table><tr><td>SRC[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>Fault input disabled</td></tr><tr><td>0x1</td><td>ENABLE</td><td>MCEx (x=0,1) event input</td></tr><tr><td>0x2</td><td>INVERT</td><td>Inverted MCEx (x=0,1) event input</td></tr><tr><td>0x3</td><td>ALTFAULT</td><td>Alternate fault (A or B) state at the end of the previous period</td></tr></table>

## 29.8.7 Waveform Extension Configuration

Name: WEXCTRL

Offset: 0x14

Reset: 0x00000000

Access: Read-Write

Property: Enable-Protected, Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="8">DTHS[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">DTLS[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>DTIEN3</td><td>DTIEN2</td><td>DTIEN1</td><td>DTIENO</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">OTMX[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:24 – DTHS[7:0]: Dead-time High Side Outputs Value This register holds the number of GCLK\_TCC clock cycles for the dead-time high side.

Bits 23:16 – DTLS[7:0]: Dead-time Low Side Outputs Value

This register holds the number of GCLK\_TCC clock cycles for the dead-time low side.

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 11:8 – DTIENx [x=3..0]: Dead-time Insertion Generator x Enable

Setting any of these bits enables the dead-time insertion generator for the corresponding output matrix. This will override the output matrix [x] and [x+WO\_NUM/2], with the low side and high side waveform respectively. 0: No dead-time insertion override.

1: Dead time insertion override on signal outputs[x] and [x+WO\_NUM/2], from matrix outputs[x] signal.

## Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 1:0 – OTMX[1:0]: Output Matrix

These bits define the matrix routing of the TCC waveform generation outputs to the port pins, according to Table 29-4.

## 29.8.8 Driver Control

Name: DRVCTRL

Offset: 0x18

Reset: 0x00000000

Access: Read-Write

Property: Enable-Protected, Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td colspan="4">FILTERVAL1[3:0]</td><td colspan="4">FILTERVAL0[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td>INVEN7</td><td>INVEN6</td><td>INVEN5</td><td>INVEN4</td><td>INVEN3</td><td>INVEN2</td><td>INVEN1</td><td>INVEN0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>NRV7</td><td>NRV6</td><td>NRV5</td><td>NRV4</td><td>NRV3</td><td>NRV2</td><td>NRV1</td><td>NRV0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>NRE7</td><td>NRE6</td><td>NRE5</td><td>NRE4</td><td>NRE3</td><td>NRE2</td><td>NRE1</td><td>NRE0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:28 – FILTERVAL1[3:0]: Non-Recoverable Fault Input 1 Filter Value These bits define the filter value applied on TCEx event input line. This value must be 0 when TCEx event input line is configured as asynchronous event.

z Bits 27:24 – FILTERVAL0[3:0]: Non-Recoverable Fault Input 0 Filter Value These bits define the filter value applied on TCEx event input line. This value must be 0 when TCEx event input line is configured as asynchronous event.

● Bits 23:16 – INVENx [x=7..0]: Output Waveform x Inversion

These bits are used to select inversion on the output of channel x.

Writing a one to INVENx inverts output from WO[x].

Writing a zero to INVENx disables inversion of output from WO[x].

These bits define the value of the enabled override outputs, under non-recoverable fault condition.

## Bits 15:8 – NRVx [x=7..0]: Non-Recoverable State x Output Value

These bits define the value of the enabled override outputs, under non-recoverable fault condition.

## z Bits 7:0 – NREx [x=7..0]: Non-Recoverable State x Output Enable

These bits enable the override of individual outputs by NRVx value, under non-recoverable fault condition. 0: Non-recoverable fault tri-state the output.

1: Non-recoverable faults set the output to NRVx level.

## 29.8.9 Debug Control

Name: DBGCTRL

Offset: 0x1E

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>FDDBD</td><td></td><td>DBGRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – FDDBD: Fault Detection on Debug Break Detection

This bit is not affected by software reset and should not be changed by software while the TCC is enabled.

By default this bit is zero, the on-chip debug (OCD) fault protection is enabled. OCD break request from the OCD system will trigger non-recoverable fault. When this bit is set, OCD fault protection is disabled and OCD break request will not trigger a fault.

0: No faults are generated when TCC is halted in debug mode.

1: A non recoverable fault is generated and DFS flag is set when TCC is halted in debug mode.

## Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bit 0 – DBGRUN: Debug Running Mode

This bit is not affected by software reset and should not be changed by software while the TCC is enabled.

0: The TCC is halted when the device is halted in debug mode.

1: The TCC continues normal operation when the device is halted in debug mode.

## 29.8.10 Event Control

Name: EVCTRL

Offset: 0x20

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>MCEO3</td><td>MCEO2</td><td>MCEO1</td><td>MCEO0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>MCEI3</td><td>MCEI2</td><td>MCEI1</td><td>MCEI0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>TCEI1</td><td>TCEI0</td><td>TCINV1</td><td>TCINV0</td><td></td><td>CNTEO</td><td>TRGEO</td><td>OVFEO</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">CNTSEL[1:0]</td><td colspan="3">EVACT1[2:0]</td><td colspan="3">EVACT0[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 27:24 – MCEOx [x=3..0]: Match or Capture Channel x Event Output Enable

These bits control if the Match/capture event on channel x is enabled and will be generated for every match or capture.

0: Match/capture x event is disabled and will not be generated.

1: Match/capture x event is enabled and will be generated for every compare/capture on channel x.

## Bits 23:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 19:16 – MCEIx [x=3..0]: Match or Capture Channel x Event Input Enable

These bits indicate if the Match/capture x incoming event is enabled

These bits are used to enable match or capture input events to the CCx channel of TCC.

0: Incoming events are disabled.

1: Incoming events are enabled.

## z Bits 15:14 – TCEIx [x=1..0]: Timer/counter Event x Input Enable This bit is used to enable input event x to the TCC.

0: Incoming event x is disabled.

1: Incoming event x is enabled.

## Bits 13:12 – TCINVx [x=1..0]: Inverted Event x Input Enable

This bit inverts the event x input.

0: Input event source x is not inverted.

1: Input event source x is inverted.

## ● Bit 11 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 10 – CNTEO: Timer/counter Output Event Enable

This bit is used to enable the counter cycle event. When enabled, an event will be generated on begin or end of counter cycle depending of CNTSEL[1:0] settings.

0: Counter cycle output event is disabled and will not be generated.

1: Counter cycle output event is enabled and will be generated depend of CNTSEL[1:0] value.

## Bit 9 – TRGEO: Retrigger Output Event Enable

This bit is used to enable the counter retrigger event. When enabled, an event will be generated when the counter retriggers operation.

0: Counter retrigger event is disabled and will not be generated.

1: Counter retrigger event is enabled and will be generated for every counter retrigger.

## z Bit 8 – OVFEO: Overflow/Underflow Output Event Enable

This bit is used to enable the overflow/underflow event. When enabled, an event will be generated when the counter reaches the TOP or the ZERO value.

0: Overflow/underflow counter event is disabled and will not be generated.

1: Overflow/underflow counter event is enabled and will be generated for every counter overflow/underflow.

## Bits 7:6 – CNTSEL[1:0]: Timer/counter Output Event Mode

These bits define on which part of the counter cycle the counter event output is generated.

Table 29-24. Timer/counter Output Event Mode

<table><tr><td>CNTSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>START</td><td>An interrupt/event is generated when a new counter cycle starts</td></tr><tr><td>0x1</td><td>END</td><td>An interrupt/event is generated when a counter cycle ends</td></tr><tr><td>0x2</td><td>BETWEEN</td><td>An interrupt/event is generated when a counter cycle ends, except for the first and last cycles</td></tr><tr><td>0x3</td><td>BOUNDARY</td><td>An interrupt/event is generated when a new counter cycle starts or a counter cycle ends</td></tr></table>

## z Bits 5:3 – EVACT1[2:0]: Timer/counter Input Event1 Action

These bits define the action the TCC will perform on TCCx EV1 event input, as shown in the table below.

Table 29-25. Timer/counter Input Event1 Action

<table><tr><td>EVACT1[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>OFF</td><td>Event action disabled</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Re-trigger counter on event</td></tr><tr><td>0x2</td><td>DIR</td><td>Direction control</td></tr><tr><td>0x3</td><td>STOP</td><td>Stop counter on event</td></tr><tr><td>0x4</td><td>DEC</td><td>Decrement counter on event</td></tr><tr><td>0x5</td><td>PPW</td><td>Period capture value in CC0 register, pulse width capture value in CC1 register</td></tr><tr><td>0x6</td><td>PWP</td><td>Period capture value in CC1 register, pulse width capture value in CC0 register</td></tr><tr><td>0x7</td><td>FAULT</td><td>Non-recoverable fault</td></tr></table>

z Bits 2:0 – EVACT0[2:0]: Timer/counter Input Event0 Action These bits define the action the TCC will perform on TCCx EV0 event input 0, as shown in the table below.

Table 29-26. Timer/counter Input Event0 Action

<table><tr><td>EVACT0[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>OFF</td><td>Event action disabled</td></tr><tr><td>0x1</td><td>RETRIGGER</td><td>Start, restart or re-trigger counter on event</td></tr><tr><td>0x2</td><td>COUNTEV</td><td>Count on event</td></tr><tr><td>0x3</td><td>START</td><td>Start counter on event</td></tr><tr><td>0x4</td><td>INC</td><td>Increment counter on event</td></tr><tr><td>0x5</td><td>COUNT</td><td>Count on active state of asynchronous event</td></tr><tr><td>0x6</td><td></td><td>Reserved</td></tr><tr><td>0x7</td><td>FAULT</td><td>Non-recoverable fault</td></tr></table>

## 29.8.11 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x24

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>MC3</td><td>MC2</td><td>MC1</td><td>MC0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>DFS</td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>ERR</td><td>CNT</td><td>TRG</td><td>OVF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set (INTENSET) register.

## z Bits 31:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 19:16 – MCx [x=3..0]: Match or Capture Channel x Interrupt Enable

0: The Match or Capture Channel x interrupt is disabled.

1: The Match or Capture Channel x interrupt is enabled.

Writing a zero to MCx has no effect.

Writing a one to MCx will clear the corresponding Match or Capture Channel x Interrupt Disable/Enable bit, which disables the Match or Capture Channel x interrupt.

## z Bit 15 – FAULT1: Non-Recoverable Fault 1 Interrupt Enable

0: The Non-Recoverable Fault 1 interrupt is disabled.

1: The Non-Recoverable Fault 1 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Non-Recoverable Fault 1 Interrupt Disable/Enable bit, which disables the Non-Recoverable Fault 1 interrupt.

## Bit 14 – FAULT0: Non-Recoverable Fault 0 Interrupt Enable

0: The Non-Recoverable Fault 0 interrupt is disabled.

1: The Non-Recoverable Fault 0 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Non-Recoverable Fault 0 Interrupt Disable/Enable bit, which disables the Non-Recoverable Fault 0 interrupt.

## z Bit 13 – FAULTB: Recoverable Fault B Interrupt Enable

0: The Recoverable Fault B interrupt is disabled.

1: The Recoverable Fault B interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Recoverable Fault B Interrupt Disable/Enable bit, which disables the Recoverable Fault B interrupt.

## z Bit 12 – FAULTA: Recoverable Fault A Interrupt Enable

0: The Recoverable Fault A interrupt is disabled.

1: The Recoverable Fault A interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Recoverable Fault A Interrupt Disable/Enable bit, which disables the Recoverable Fault A interrupt.

## Bit 11 – DFS: Non-Recoverable Debug Fault Interrupt Enable

0: The Debug Fault State interrupt is disabled.

1: The Debug Fault State interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Debug Fault State Interrupt Disable/Enable bit, which disables the Debug Fault State interrupt.

## ● Bits 10:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3 – ERR: Error Interrupt Enable

0: The Error interrupt is disabled.

1: The Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Error Interrupt Disable/Enable bit, which disables the Error interrupt.

## ● Bit 2 – CNT: Counter Interrupt Enable

0: The Counter interrupt is disabled.

1: The Counter interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Counter Interrupt Disable/Enable bit, which disables the Counter interrupt.

## z Bit 1 – TRG: Retrigger Interrupt Enable

0: The Retrigger interrupt is disabled.

1: The Retrigger interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Retrigger Interrupt Disable/Enable bit, which disables the Retrigger interrupt.

## Bit 0 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overflow Interrupt Disable/Enable bit, which disables the Overflow interrupt.

## 29.8.12 Interrupt Enable Set

Name: INTENSET

Offset: 0x28

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>MC3</td><td>MC2</td><td>MC1</td><td>MC0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>DFS</td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>ERR</td><td>CNT</td><td>TRG</td><td>OVF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear (INTENCLR) register.

## z Bits 31:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 19:16 – MCx [x=3..0]: Match or Capture Channel x Interrupt Enable

0: The Match or Capture Channel x interrupt is disabled.

1: The Match or Capture Channel x interrupt is enabled.

Writing a zero to MCx has no effect.

Writing a one to MCx will set the corresponding Match or Capture Channel x Interrupt Disable/Enable bit, which enables the Match or Capture Channel x interrupt.

## z Bit 15 – FAULT1: Non-Recoverable Fault 1 Interrupt Enable

0: The Non-Recoverable Fault 1 interrupt is disabled.

1: The Non-Recoverable Fault 1 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Non-Recoverable Fault 1 Interrupt Disable/Enable bit, which enables the Non-Recoverable Fault 1 interrupt.

## Bit 14 – FAULT0: Non-Recoverable Fault 0 Interrupt Enable

0: The Non-Recoverable Fault 0 interrupt is disabled.

1: The Non-Recoverable Fault 0 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Non-Recoverable Fault 0 Interrupt Disable/Enable bit, which enables the Non-Recoverable Fault 0 interrupt.

## z Bit 13 – FAULTB: Recoverable Fault B Interrupt Enable

0: The Recoverable Fault B interrupt is disabled.

1: The Recoverable Fault B interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Recoverable Fault B Interrupt Disable/Enable bit, which enables the Recoverable Fault B interrupt.

## z Bit 12 – FAULTA: Recoverable Fault A Interrupt Enable

0: The Recoverable Fault A interrupt is disabled.

1: The Recoverable Fault A interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Recoverable Fault A Interrupt Disable/Enable bit, which enables the Recoverable Fault A interrupt.

## Bit 11 – DFS: Non-Recoverable Debug Fault Interrupt Enable

0: The Debug Fault State interrupt is disabled.

1: The Debug Fault State interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Debug Fault State Interrupt Disable/Enable bit, which enables the Debug Fault State interrupt.

## ● Bits 10:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3 – ERR: Error Interrupt Enable

0: The Error interrupt is disabled.

1: The Error interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Error Interrupt Disable/Enable bit, which enables the Error interrupt.

## ● Bit 2 – CNT: Counter Interrupt Enable

0: The Counter interrupt is disabled.

1: The Counter interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Retrigger Interrupt Disable/Enable bit, which enables the Counter interrupt.

## z Bit 1 – TRG: Retrigger Interrupt Enable

0: The Retrigger interrupt is disabled.

1: The Retrigger interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Retrigger Interrupt Disable/Enable bit, which enables the Retrigger interrupt.

## Bit 0 – OVF: Overflow Interrupt Enable

0: The Overflow interrupt is disabled.

1: The Overflow interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overflow Interrupt Disable/Enable bit, which enables the Overflow interrupt.

## 29.8.13 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x2C

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>MC3</td><td>MC2</td><td>MC1</td><td>MC0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>DFS</td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>ERR</td><td>CNT</td><td>TRG</td><td>OVF</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 19:16 – MCx [x=3..0]: Match or Capture x

This flag is set on the next CLK\_TCC\_COUNT cycle after a match with the compare condition or once CCx register contain a valid capture value.

Writing a zero to one of these bits has no effect.

Writing a one to one of these bits will clear the corresponding Match or Capture Channel x interrupt flag In Capture operation, this flag is automatically cleared when CCx register is read.

## z Bit 15 – FAULT1: Non-Recoverable Fault 1

This flag is set on the next CLK\_TCC\_COUNT cycle after a Non-Recoverable Fault 1 occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Non-Recoverable Fault 1 interrupt flag.

## z Bit 14 – FAULT0: Non-Recoverable Fault 0

This flag is set on the next CLK\_TCC\_COUNT cycle after a Non-Recoverable Fault 0 occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Non-Recoverable Fault 0 interrupt flag.

## Bit 13 – FAULTB: Recoverable Fault B

This flag is set on the next CLK\_TCC\_COUNT cycle after a Recoverable Fault B occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Recoverable Fault B interrupt flag.

## z Bit 12 – FAULTA: Recoverable Fault A

This flag is set on the next CLK\_TCC\_COUNT cycle after a Recoverable Fault A occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Recoverable Fault A interrupt flag.

## z Bit 11 – DFS: Non-Recoverable Debug Fault

This flag is set on the next CLK\_TCC\_COUNT cycle after an Debug Fault State occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Debug Fault State interrupt flag.

## Bits 10:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3 – ERR: Error

This flag is set if a new capture occurs on a channel when the corresponding Match or Capture Channel x interrupt flag is one. In which case there is nowhere to store the new capture.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Error interrupt flag.

## ● Bit 2 – CNT: Counter

This flag is set on the next CLK\_TCC\_COUNT cycle after a counter event occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the CNT interrupt flag.

## Bit 1 – TRG: Retrigger

This flag is set on the next CLK\_TCC\_COUNT cycle after a counter retrigger occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Retrigger interrupt flag.

## z Bit 0 – OVF: Overflow

This flag is set on the next CLK\_TCC\_COUNT cycle after an overflow condition occurs.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Overflow interrupt flag.

## 29.8.14 Status

Name: STATUS

Offset: 0x30

Reset: 0x00000001

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>CMP3</td><td>CMP2</td><td>CMP1</td><td>CMP0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>CCBV3</td><td>CCBV2</td><td>CCBV1</td><td>CCBV0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>FAULT1</td><td>FAULT0</td><td>FAULTB</td><td>FAULTA</td><td>FAULT1IN</td><td>FAULT0IN</td><td>FAULTBIN</td><td>FAULTAIN</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PERBV</td><td>WAVEBV</td><td>PATTBV</td><td>SLAVE</td><td>DFS</td><td></td><td>IDX</td><td>STOP</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 27:24 – CMPx [x=3..0]: Compare Channel x Value

This bit reflects the channel x output compare value.

0: Channel compare output value is 0.

1: Channel compare output value is 1.

## z Bits 23:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 19:16 – CCBVx [x=3..0]: Compare Channel x Buffer Valid

For a compare channel, the bit is set when a new value is written to the corresponding CCBx register. The bit is cleared by writing a one to the corresponding location or automatically cleared on an UPDATE condition.

For a capture channel, the bit is set when a valid capture value is stored in the CCBx register. The bit is automatically cleared when the CCx register is read.

## z Bit 15 – FAULT1: Non-Recoverable Fault 1 State

This bit is set by hardware as soon as non-recoverable Fault 1 condition occurs.

This bit is cleared by writing a one to this bit and when the corresponding FAULT1IN status bit is low.

Once this bit is clear, the timer/counter will restart from the last COUNT value. To restart the timer/counter from BOTTOM, the timer/counter restart command must be executed before clearing the corresponding FAULT1 bit. For further details on timer/counter commands, refer to available commands description (CTRLBSET.CMD).

## z Bit 14 – FAULT0: Non-Recoverable Fault 0 State

This bit is set by hardware as soon as non-recoverable Fault 0 condition occurs.

This bit is cleared by writing a one to this bit and when the corresponding FAULT0IN status bit is low.

Once this bit is clear, the timer/counter will restart from the last COUNT value. To restart the timer/counter from BOTTOM, the timer/counter restart command must be executed before clearing the corresponding FAULT0 bit. For further details on timer/counter commands, refer to available commands description (CTRLBSET.CMD).

## Bit 13 – FAULTB: Recoverable Fault B State

This bit is set by hardware as soon as recoverable Fault B condition occurs.

This bit is cleared by hardware when Fault B action is resumed, or by writing a one to this bit when the corresponding FAULTBIN bit is low. If software halt command is enabled (FCTRLB.HALT=SW), clearing this bit release the timer/counter.

## z Bit 12 – FAULTA: Recoverable Fault A State

This bit is set by hardware as soon as recoverable Fault A condition occurs.

This bit is cleared by hardware when Fault A action is resumed, or by writing a one to this bit when the corresponding FAULTAIN bit is low. If software halt command is enabled (FCTRLA.HALT=SW), clearing this bit release the timer/counter.

## ● Bit 11 – FAULT1IN: Non-Recoverable Fault1 Input

This bit is set while an active Non-Recoverable Fault 1 input is present.

## z Bit 10 – FAULT0IN: Non-Recoverable Fault0 Input

This bit is set while an active Non-Recoverable Fault 0 input is present.

## z Bit 9 – FAULTBIN: Recoverable Fault B Input

This bit is set while an active Recoverable Fault B input is present.

## z Bit 8 – FAULTAIN: Recoverable Fault A Input

This bit is set while an active Recoverable Fault A input is present.

## z Bit 7 – PERBV: Period Buffer Valid

This bit is set when a new value is written to the PERB register. This bit is automatically cleared by hardware on UPDATE condition or by writing a one to this bit.

## z Bit 6 – WAVEBV: Wave Buffer Valid

This bit is set when a new value is written to the WAVEB register. This bit is automatically cleared by hardware on UPDATE condition or by writing a one to this bit.

## z Bit 5 – PATTBV: Pattern Buffer Valid

This bit is set when a new value is written to the PATTB register. This bit is automatically cleared by hardware on UPDATE condition or by writing a one to this bit.

## ● Bit 4 – SLAVE: Slave

Tis bit is set when TCC is set in Slave mode. This bit follows the CTRLA.MSYNC bit state.

## z Bit 3 – DFS: Non-Recoverable Debug Fault State

This bit is set by hardware in debug mode when DBGCTRL.FDDBD bit is set. The bit is cleared by writing a one to this bit and when the TCC is not in debug mode.

When the bit is set, the counter is halted and the waveforms state depend on DRVCTRL.NRE and DRVCTRL.NRV registers.

## z Bit 2 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 1 – IDX: Ramp

In RAMP2 and RAMP2A operation, the bit is cleared during the cycle A and set during the cycle B. In RAMP1 operation, the bit is always read zero. For details on ramp operations, refer to “Ramp Operations” on page 633.

## z Bit 0 – STOP: Stop

This bit is set when the TCC is disabled, on a STOP command or on an UPDATE condition when One-Shot operation mode is enabled (CTRLBSET.ONESHOT = 1).

This bit is clear on the next incoming counter increment or decrement.

0: Counter is running.

1: Counter is stopped.

## 29.8.15 Count

Name: COUNT

Offset: 0x34

Reset: 0x00000000

Access: Read-Write

Property: Read-Synchronized, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COUNT[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:0 – COUNT[23:0]: Counter Value

These bits hold the value of the counter register.

The number of bits in this field corresponds to the size of the counter.

## 29.8.15.1 DITH4 mode

Name: COUNT

Offset: 0x34

Reset: 0x00000000

Access: Read-Write

Property: Read-Synchronized, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COUNT[19:12]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[11:4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">COUNT[3:0]</td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:4 – COUNT[19:0]: Counter Value

These bits hold the value of the counter register.

The number of bits in this field corresponds to the size of the counter.

## z Bits 3:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 29.8.15.2 DITH5 mode

Name: COUNT

Offset: 0x34

Reset: 0x00000000

Access: Read-Write

Property: Read-Synchronized, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COUNT[18:11]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[10:3]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">COUNT[2:0]</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:5 – COUNT[18:0]: Counter Value

These bits hold the value of the counter register.

The number of bits in this field corresponds to the size of the counter.

## z Bits 4:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 29.8.15.3 DITH6 mode

Name: COUNT

Offset: 0x34

Reset: 0x00000000

Access: Read-Write

Property: Read-Synchronized, Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">COUNT[17:10]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">COUNT[9:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">COUNT[1:0]</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:6 – COUNT[17:0]: Counter Value

These bits hold the value of the counter register.

The number of bits in this field corresponds to the size of the counter.

## z Bits 5:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 29.8.16 Pattern

Name: PATT

Offset: 0x38

Reset: 0x0000

Access: Read-Write

Property: Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>PGV7</td><td>PGV6</td><td>PGV5</td><td>PGV4</td><td>PGV3</td><td>PGV2</td><td>PGV1</td><td>PGV0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PGE7</td><td>PGE6</td><td>PGE5</td><td>PGE4</td><td>PGE3</td><td>PGE2</td><td>PGE1</td><td>PGE0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:8 – PGVx [x=7..0]: Pattern Generator x Output Value This register holds the values of pattern for each waveform output.

z Bits 7:0 – PGEx [x=7..0]: Pattern Generator x Output Enable This register holds the enables of pattern generation for each waveform output. A bit position at one, overrides the corresponding SWAP output with the corresponding PGVx value.

## 29.8.17 Waveform Control

Name: WAVE

Offset: 0x3C

Reset: 0x00000000

Access: Read-Write

Property: Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>SWAP3</td><td>SWAP2</td><td>SWAP1</td><td>SWAP0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>POL3</td><td>POL2</td><td>POL1</td><td>POL0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>CICCEN3</td><td>CICCEN2</td><td>CICCEN1</td><td>CICCEN0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>CIPEREN</td><td></td><td colspan="2">RAMP[1:0]</td><td></td><td colspan="3">WAVEGEN[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 27:24 – SWAPx [x=3..0]: Swap DTI Output Pair x

Setting these bits enables output swap of DTI outputs [x] and [x+WO\_NUM/2]. Note the DTIxEN settings will not affect the swap operation.

## Bits 23:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 19:16 – POLx [x=3..0]: Channel x Polarity

Setting these bits enable the output polarity in single-slope and dual-slope PWM operations.

In single-slope PWM waveform generation:

0: Compare output is initialized to \~DIR and set to DIR when TCC counter matches CCx value

1: Compare output is initialized to DIR and set to \~DIR when TCC counter matches CCx value.

In dual-slope PWM waveform generation:

0: Compare output is set to \~DIR when TCC counter matches CCx value

1: Compare output is set to DIR when TCC counter matches CCx value.

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 11:8 – CICCENx [x=3..0]: Circular Channel x Enable

Setting these bits enable the compare circular buffer option on channel. When the bit is set, CCx register value is copied-back into the CCx register on UPDATE condition.

## z Bit 7 – CIPEREN: Circular period Enable

Setting these bits enable the period circular buffer option. When the bit field is set, the PER register value is copied-back into the PERB register on UPDATE condition.

## z Bit 6 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 5:4 – RAMP[1:0]: Ramp Mode

These bits select Ramp operation (RAMP), as shown in the table below. These bits are not synchronized.

Table 29-27. Ramp Mode

<table><tr><td>RAMP[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>RAMP1</td><td>RAMP1 operation</td></tr><tr><td>0x1</td><td>RAMP2A</td><td>Alternative RAMP2 operation</td></tr><tr><td>0x2</td><td>RAMP2</td><td>RAMP2 operation</td></tr><tr><td>0x3</td><td>RAMP2C</td><td>Critical RAMP2 operation</td></tr></table>

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 2:0 – WAVEGEN[2:0]: Waveform Generation

These bits select the waveform generation operation, as shown in the table below. The settings impact the top value and select the frequency/PWM mode. These bits are not synchronized.

Table 29-28. Waveform Generation

<table><tr><td>WAVEGEN[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NFRQ</td><td>Normal frequency</td></tr><tr><td>0x1</td><td>MFRQ</td><td>Match frequency</td></tr><tr><td>0x2</td><td>NPWM</td><td>Normal PWM</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr><tr><td>0x4</td><td>DSCRITICAL</td><td>Dual-slope critical</td></tr><tr><td>0x5</td><td>DSBOTTOM</td><td>Dual-slope with interrupt/event condition when COUNT reaches ZERO</td></tr><tr><td>0x6</td><td>DSBOTH</td><td>Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP</td></tr><tr><td>0x7</td><td>DSTOP</td><td>Dual-slope with interrupt/event condition when COUNT reaches TOP</td></tr></table>

## 29.8.18 Period

Name: PER

Offset: 0x40

Reset: 0xFFFFFFFF

Access: Read-Write

Property: Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PER[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PER[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">PER[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 23:0 – PER[23:0]: Period Value

These bits hold the value of the period buffer register. The value is copied to PER register on UPDATE condition. The number of bits in this field corresponds to the size of the counter.

## 29.8.18.1 DITH4 mode

Name: PER

Offset: 0x40

Reset: 0xFFFFFFFF

Access: Read-Write

Property: Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PER[19:12]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PER[11:4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">PER[3:0]</td><td colspan="4">DITHERCY[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:4 – PER[19:0]: Period Value

These bits hold the value of the period buffer register. The value is copied to PER register on UPDATE condition. The number of bits in this field corresponds to the size of the counter.

## z Bits 3:0 – DITHERCY[3:0]: Dithering Cycle Number

These bits hold the number of extra cycles that are added on the PWM period each number of frames as specified in Table 29-9 on page 653.

## 29.8.18.2 DITH5 mode

Name: PER

Offset: 0x40

Reset: 0xFFFFFFFF

Access: Read-Write

Property: Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PER[18:11]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PER[10:3]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">PER[2:0]</td><td colspan="5">DITHERCY[4:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:5 – PER[18:0]: Period Value

These bits hold the value of the period buffer register. The value is copied to PER register on UPDATE condition. The number of bits in this field corresponds to the size of the counter.

## z Bits 4:0 – DITHERCY[4:0]: Dithering Cycle Number

These bits hold the number of extra cycles that are added on the PWM period each number of frames as specified in Table 29-9 on page 653.

## 29.8.18.3 DITH6 mode

Name: PER

Offset: 0x40

Reset: 0xFFFFFFFF

Access: Read-Write

Property: Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PER[17:10]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PER[9:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">PER[1:0]</td><td colspan="6">DITHERCY[5:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:6 – PER[17:0]: Period Value

These bits hold the value of the period buffer register. The value is copied to PER register on UPDATE condition. The number of bits in this field corresponds to the size of the counter.

## z Bits 5:0 – DITHERCY[5:0]: Dithering Cycle Number

These bits hold the number of extra cycles that are added on the PWM period each number of frames as specified in Table 29-9 on page 653.

## 29.8.19 Compare and Capture

Name: CCn

Offset: 0x44+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CC[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CC[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CC[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 23:0 – CC[23:0]: Channel Compare/Capture Value

These bits hold the value of the Channel x compare/capture register.

The number of bits in this field corresponds to the size of the counter.

## 29.8.19.1 DITH4 mode

Name: CCn

Offset: 0x44+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CC[19:12]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CC[11:4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">CC[3:0]</td><td colspan="4">DITHERCY[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:4 – CC[19:0]: Channel Compare/Capture Value

These bits hold the value of the Channel x compare/capture register.

The number of bits in this field corresponds to the size of the counter.

## z Bits 3:0 – DITHERCY[3:0]: Dithering Cycle Number

These bits hold the number of extra cycles that are added on the PWM pulse width each number of frames as specified in Table 29-9 on page 653.

## 29.8.19.2 DITH5 mode

Name: CCn

Offset: 0x44+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CC[18:11]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CC[10:3]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">CC[2:0]</td><td colspan="5">DITHERCY[4:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:5 – CC[18:0]: Channel Compare/Capture Value

These bits hold the value of the Channel x compare/capture register.

The number of bits in this field corresponds to the size of the counter.

## z Bits 4:0 – DITHERCY[4:0]: Dithering Cycle Number

These bits hold the number of extra cycles that are added on the PWM pulse width each number of frames as specified in Table 29-9 on page 653.

## 29.8.19.3 DITH6 mode

Name: CCn

Offset: 0x44+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CC[17:10]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CC[9:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">CC[1:0]</td><td colspan="6">DITHERCY[5:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:6 – CC[17:0]: Channel Compare/Capture Value

These bits hold the value of the Channel x compare/capture register.

The number of bits in this field corresponds to the size of the counter.

## z Bits 5:0 – DITHERCY[5:0]: Dithering Cycle Number

These bits hold the number of extra cycles that are added on the PWM pulse width each number of frames as specified in Table 29-9 on page 653.

## 29.8.20 Pattern Buffer

Name: PATTB

Offset: 0x64

Reset: 0x0000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>PGVB7</td><td>PGVB6</td><td>PGVB5</td><td>PGVB4</td><td>PGVB3</td><td>PGVB2</td><td>PGVB1</td><td>PGVB0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>PGEB7</td><td>PGEB6</td><td>PGEB5</td><td>PGEB4</td><td>PGEB3</td><td>PGEB2</td><td>PGEB1</td><td>PGEB0</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:8 – PGVBx [x=7..0]: Pattern Generator x Output Enable These bits represent the PGV buffers. When the double buffering is enable, PGVB bits value is copied to the PGV bits on an UPDATE condition.

z Bits 7:0 – PGEBx [x=7..0]: Pattern Generator x Output Enable Buffer These bits represent the PGE buffers. When the double buffering is enable, PGEB bits value is copied to the PGE bits on an UPDATE condition.

## 29.8.21 Waveform Control Buffer

Name: WAVEB

Offset: 0x68

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>SWAPB3</td><td>SWAPB2</td><td>SWAPB1</td><td>SWAPB0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>POLB3</td><td>POLB2</td><td>POLB1</td><td>POLB0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>CICCENB3</td><td>CICCENB2</td><td>CICCENB1</td><td>CICCENB0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>CIPERENB</td><td></td><td colspan="2">RAMPB[1:0]</td><td></td><td colspan="3">WAVEGENB[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 27:24 – SWAPBx [x=3..0]: Swap DTI Output Pair x Buffer

These bits represent the SWAP buffers. When the double buffering is enable, SWAPB bits value is copied to the SWAP bits on an UPDATE condition.

## z Bits 23:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 19:16 – POLBx [x=3..0]: Channel x Polarity Buffer

These bits represent the POL buffers. When the double buffering is enable, POLB bits value is copied to the POL bits on an UPDATE condition.

## Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 11:8 – CICCENBx [x=3..0]: Circular Channel x Enable Buffer

These bits represent the CICCEN buffers. When the double buffering is enable, CICCENB bits value is copied to the CICCEN bits on an UPDATE condition.

## z Bit 7 – CIPERENB: Circular Period Enable Buffer

This bit represents the CIPEREN buffer. When the double buffering is enable, CIPERENB bit value is copied to the CIPEREN bit on an UPDATE condition.

## z Bit 6 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bits 5:4 – RAMPB[1:0]: Ramp Mode Buffer

These bits represent the RAMP buffers. When the double buffering is enable, RAMPB bits value is copied to the RAMP bits on an UPDATE condition.

Table 29-29. Ramp Mode Buffer

<table><tr><td>RAMPB[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>RAMP1</td><td>RAMP1 operation</td></tr><tr><td>0x1</td><td>RAMP2A</td><td>Alternative RAMP2 operation</td></tr><tr><td>0x2</td><td>RAMP2</td><td>RAMP2 operation</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## ● Bits 2:0 – WAVEGENB[2:0]: Waveform Generation Buffer

These bits represent the WAVEGEN buffers. When the double buffering is enable, WAVEGENB bits value is copied to the WAVEGEN bits on an UPDATE condition.

Table 29-30. Waveform Generation Buffer

<table><tr><td>WAVEGENB[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>NFRQ</td><td>Normal frequency</td></tr><tr><td>0x1</td><td>MFRQ</td><td>Match frequency</td></tr><tr><td>0x2</td><td>NPWM</td><td>Normal PWM</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr><tr><td>0x4</td><td>DSCRITICAL</td><td>Dual-slope critical</td></tr><tr><td>0x5</td><td>DSBOTTOM</td><td>Dual-slope with interrupt/event condition when COUNT reaches ZERO</td></tr><tr><td>0x6</td><td>DSBOTH</td><td>Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP</td></tr><tr><td>0x7</td><td>DSTOP</td><td>Dual-slope with interrupt/event condition when COUNT reaches TOP</td></tr></table>

## 29.8.22 Period Buffer

Name: PERB

Offset: 0x6C

Reset: 0xFFFFFFFF

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PERB[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PERB[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">PERB[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:0 – PERB[23:0]: Period Buffer Value

These bits hold the value of the period register.

The number of bits in this field corresponds to the size of the counter.

## 29.8.22.1 DITH4 mode

Name: PERB

Offset: 0x6C

Reset: 0xFFFFFFFF

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PERB[19:12]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PERB[11:4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">PERB[3:0]</td><td colspan="4">DITHERCYB[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:4 – PERB[19:0]: Period Buffer Value

These bits hold the value of the period register.

The number of bits in this field corresponds to the size of the counter.

## Bits 3:0 – DITHERCYB[3:0]: Dithering Buffer Cycle Number

These bits represent the PER.DITHERCY bits buffer. When the double buffering is enable, DITHERCYB bits value is copied to the PER.DITHERCY bits on an UPDATE condition.

## 29.8.22.2 DITH5 mode

Name: PERB

Offset: 0x6C

Reset: 0xFFFFFFFF

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PERB[18:11]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PERB[10:3]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">PERB[2:0]</td><td colspan="5">DITHERCYB[4:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 23:5 – PERB[18:0]: Period Buffer Value

These bits hold the value of the period register.

The number of bits in this field corresponds to the size of the counter.

## Bits 4:0 – DITHERCYB[4:0]: Dithering Buffer Cycle Number

These bits represent the PER.DITHERCY bits buffer. When the double buffering is enable, DITHERCYB bits value is copied to the PER.DITHERCY bits on an UPDATE condition.

## 29.8.22.3 DITH6 mode

Name: PERB

Offset: 0x6C

Reset: 0xFFFFFFFF

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">PERB[17:10]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">PERB[9:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">PERB[1:0]</td><td colspan="6">DITHERCYB[5:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td><td>1</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:6 – PERB[17:0]: Period Buffer Value

These bits hold the value of the period register.

The number of bits in this field corresponds to the size of the counter.

## ● Bits 5:0 – DITHERCYB[5:0]: Dithering Buffer Cycle Number

These bits represent the PER.DITHERCY bits buffer. When the double buffering is enable, DITHERCYB bits value is copied to the PER.DITHERCY bits on an UPDATE condition.

## 29.8.23 Compare and Capture Buffer

Name: CCBn

Offset: 0x70+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CCB[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CCB[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">CCB[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:0 – CCB[23:0]: Channel Compare/Capture Buffer Value

These bits hold the value of the channel x compare/capture buffer register. The register serves as the buffer for the associated compare or capture registers (CCx). Accessing this register using the CPU or DMA will affect the corresponding CCBVx status bit.

The number of bits in this field corresponds to the size of the counter.

## 29.8.23.1 DITH4 mode

Name: CCBn

Offset: 0x70+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CCB[19:12]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CCB[11:4]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="4">CCB[3:0]</td><td colspan="4">DITHERCYB[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:4 – CCB[19:0]: Channel Compare/Capture Buffer Value

These bits hold the value of the channel x compare/capture buffer register. The register serves as the buffer for the associated compare or capture registers (CCx). Accessing this register using the CPU or DMA will affect the corresponding CCBVx status bit.

The number of bits in this field corresponds to the size of the counter.

## z Bits 3:0 – DITHERCYB[3:0]: Dithering Buffer Cycle Number

These bits represent the CCx.DITHERCY bits buffer. When the double buffering is enable, DITHERCYB bits value is copied to the CCx.DITHERCY bits on an UPDATE condition.

## 29.8.23.2 DITH5 mode

Name: CCBn

Offset: 0x70+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CCB[18:11]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CCB[10:3]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="3">CCB[2:0]</td><td colspan="5">DITHERCYB[4:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:5 – CCB[18:0]: Channel Compare/Capture Buffer Value

These bits hold the value of the channel x compare/capture buffer register. The register serves as the buffer for the associated compare or capture registers (CCx). Accessing this register using the CPU or DMA will affect the corresponding CCBVx status bit.

The number of bits in this field corresponds to the size of the counter.

## z Bits 4:0 – DITHERCYB[4:0]: Dithering Buffer Cycle Number

These bits represent the CCx.DITHERCY bits buffer. When the double buffering is enable, DITHERCYB bits value is copied to the CCx.DITHERCY bits on an UPDATE condition.

## 29.8.23.3 DITH6 mode

Name: CCBn

Offset: 0x70+n\*0x4 [n=0..3]

Reset: 0x00000000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="8">CCB[17:10]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">CCB[9:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">CCB[1:0]</td><td colspan="6">DITHERCYB[5:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 31:24 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 23:6 – CCB[17:0]: Channel Compare/Capture Buffer Value

These bits hold the value of the channel x compare/capture buffer register. The register serves as the buffer for the associated compare or capture registers (CCx). Accessing this register using the CPU or DMA will affect the corresponding CCBVx status bit.

The number of bits in this field corresponds to the size of the counter.

## z Bits 5:0 – DITHERCYB[5:0]: Dithering Buffer Cycle Number

These bits represent the CCx.DITHERCY bits buffer. When the double buffering is enable, DITHERCYB bits value is copied to the CCx.DITHERCY bits on an UPDATE condition.

## 30. USB – Universal Serial Bus

## 30.1 Overview

The Universal Serial Bus interface (USB) module complies with the Universal Serial Bus (USB) 2.1 specification supporting device mode.

The USB device mode supports 8 endpoint addresses. All endpoint addresses have one input and one output endpoint, for a total of 16 endpoints. Each endpoint is fully configurable in any of the four transfer types: control, interrupt, bulk or isochronous.

Internal SRAM is used to keep the configuration and data buffer for each endpoint. The memory locations used for the endpoint configurations and data buffers is fully configurable. The amount of memory allocated is dynamic according to the number of endpoints in use, and the configuration of these. The USB module has a built-in Direct Memory Access (DMA) and will read/write data from/to the system RAM when a USB transaction takes place. No CPU or DMA Controller resources are required.

To maximize throughput, an endpoint can be configured for ping-pong operation. When this is done the input and output endpoint with the same address are used in the same direction. The CPU or DMA Controller can then read/write one data buffer while the USB module writes/reads from the other buffer. This gives double buffered communication.

Multi-packet transfer enables a data payload exceeding the maximum packet size of an endpoint to be transferred as multiple packets without any software intervention. This reduces the number of interrupts and software intervention needed for USB transfers.

For low power operation the USB module can put the microcontroller in any sleep mode when the USB bus is idle and a suspend condition is given. Upon bus resume the USB module can wake the microcontroller from any sleep mode.

## 30.2 Features

z Compatible with the USB 2.1 specification

z USB Embedded Device mode

z Supports full (12Mbit/s) and low (1.5Mbit/s) speed communication

z Supports Link Power Management (LPM-L1) protocol

z On-chip transceivers with built-in pull-ups and pull-downs

z On-Chip USB serial resistors

z 1kHz SOF clock available on external pin

z Device mode

z Supports 8 IN endpoints and 8 OUT endpoints

z No endpoint size limitations

z Built-in DMA with multi-packet and dual bank for all endpoints

z Supports feedback endpoint

z Supports crystal less clock

Figure 30-1. LS/FS Implementation: USB Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_ac24485afe2e29747997bdaf2df50798646fe1ee16a9ee8af552df5a8c33007b.jpg)

30.4 Signal Description

<table><tr><td>Pin Name</td><td>Pin Description</td><td>Type</td></tr><tr><td>DM</td><td>Data -: Differential Data Line - Port</td><td>Input/Output</td></tr><tr><td>DP</td><td>Data +: Differential Data Line + Port</td><td>Input/Output</td></tr><tr><td>SOF 1kHz</td><td>SOF Output</td><td>Output</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped to one of several pins.

## 30.5 Product Dependencies

In order to use this peripheral module, other parts of the system must be configured correctly, as described below.

## 30.5.1 I/O Lines

The USB pins may be multiplexed with the I/O lines Controller. The user must first configure the I/O Controller to assign the USB pins to their peripheral functions.

A 1kHz SOF clock is available on external pin. The user must first configure the I/O Controller to assign the 1kHz SOF clock to the peripheral function.

## 30.5.2 Power Management

The USB will continue to operate in any sleep mode where the selected source clock is running. The USB’s interrupts can be used to wake up the device from sleep modes. Events connected to the event system can trigger other operations in the

system without exiting sleep modes. Refer to the “PM – Power Manager” on page 110 for details on the different sleep modes.

## 30.5.3 Clocks

The USB bus clock (CLK\_USB\_AHB) can be enabled and disabled in the Power Manager, and the default state of CLK\_USB\_AHB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110.

A generic clock (GCLK\_USB) is required to clock the USB. This clock must be configured and enabled in the Generic Clock Controller before using the USB. Refer to “GCLK – Generic Clock Controller” on page 88 for further details.

This generic clock is asynchronous to the bus clock (CLK\_USB\_AHB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 94 for furthe details.

The USB module requires a GCLK\_USB of 48 MHz ± 0.25% clock for low speed and full speed operation. To follow the USB data rate at 12Mbit/s in full-speed mode, the CLK\_USB\_AHB clock should be at minimum 8MHz.

Clock recovery is achieved by a digital phase-locked loop in the USB module, which complies with the USB jitter specifications. If crystal-less operation is used in USB device mode, please refer to “USB Clock Recovery Mode” on page 154.

## 30.5.4 DMA

The USB has a built-in Direct Memory Access (DMA) and will read/write data from/to the system RAM when a USB transaction takes place. No CPU or DMA Controller resources are required.

## 30.5.5 Interrupts

The interrupt request lines are connected to the interrupt controller. Using the USB interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 30.5.6 Events

Not Applicable

## 30.5.7 Debug Operation

When the CPU is halted in debug mode the USB continues normal operation. If the USB is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

## 30.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the peripheral access controller (PAC), except the following registers:

z Device Interrupt Flag (INTFLAG) register

Endpoint Interrupt Flag (EPINTFLAG) register

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply to accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 30.5.9 Analog Connections

Not applicable.

## 30.5.10 Calibration

The output drivers for the DP/DM USB line interface can be tuned with calibration values from the production test. The calibration values must be loaded from the NVM Software Calibration Area into the USB Pad Calibration register

(PADCAL) by software, before enabling the USB, to achieve the specified accuracy. Refer to “NVM Software Calibration Row Mapping” on page 24 for further details.

For details on Pad Calibration, refer to Pad Calibration register PADCAL.

## 30.6 Functional Description

## 30.6.1 USB General Operation

## 30.6.1.1 Initialization

After a hardware reset, the USB is disabled. The user should first enable the USB (CTRLA.ENABLE) in device mode.

Figure 30-2. General States

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_655cfa79cde703f005a04f8c7c15b29b773f175805bfd82bbe86d06de4ca3f43.jpg)

After a hardware reset, the USB is in the idle state. In this state:

z The module is disabled. The USB Enable bit in the Control A register (CTRLA.ENABLE) is reset.

● The module clock is stopped in order to minimize power consumption.

The USB pad is in suspend mode.

z The internal states and registers of the device are reset.

Before using the USB, the Pad Calibration register (PADCAL) must be loaded with production calibration values from the NVM Software Calibration Area. Refer to “NVM Software Calibration Row Mapping” on page 24 for further details.

The USB is enabled by writing a one to CTRLA.ENABLE. The USB is disabled by writing a zero to CTRLA.ENABLE. The USB is reset by writing a one to the Software Reset bit in CTRLA (CTRLA.SWRST). All registers in the USB wil be reset to their initial state, and the USB will be disabled. Refer to the CTRLA register for details.

The user can configure pads and speed before enabling the USB by writing to the Speed Configuration field in the Control B register (CTRLB.SPDCONF). These values are taken into account once the USB has been enabled by writing a one to CTRLA.ENABLE.

After writing a one to CTRLA.ENABLE, the USB enters device mode (according to CTRLA.MODE). Please refer Figure 30-2.

The USB can be disabled at any time by writing a zero to CTRLA.ENABLE.

Refer to “USB Device Operations” on page 718 for the basic operation of the device mode.

## 30.6.2 USB Device Operations

This section gives an overview of the USB module device operation during normal transactions. For more details on general USB and USB protocol, please refer to the Universal Serial Bus specification revision 2.1.

## 30.6.2.1 Initialization

To attach the USB device to start the USB communications from the USB host, a zero should be written to the Detach bit in the Device Control B register (CTRLB.DETACH). To detach the device from the USB host, a one must be written to the CTRLB.DETACH.

After the device is attached, the host will request the USB device descriptor using the default device address zero. On successful transmission, it will send a USB reset. After that, it sends an address to be configured for the device. All further transactions will be directed to this device address. This address should be configured in the Device Address field in the Device Address register (DADD.DADD) and the Address Enable bit in DADD (DADD.ADDEN) should be written to one to accept the communications directed to this address. DADD.ADDEN is automatically cleared on receiving a USB reset.

## 30.6.2.2 Endpoint Configuration

Endpoint data can be placed anywhere in the device RAM. The USB controller accesses these endpoints directly through the AHB master (built-in DMA) with the help of the endpoint descriptors. The base address of the endpoint descriptors needs to be written in the Descriptor Address register (DESCADD) by the user. Please refer the Endpoint Descriptor structure in “Endpoint Descriptor structure” on page 762.

Before using an endpoint, the user should configure the direction and type of the endpoint in Type of Endpoint field in the Device Endpoint Configuration register (EPCFG.EPTYPE0/1). The endpoint descriptor registers should be initialized to known values before using the endpoint, so that the USB controller does not read the random values from the RAM.

The Endpoint Size field in the Packet Size register (PCKSIZE.SIZE) should be configured as per the size reported to the host for that endpoint. The Address of Data Buffer register (ADDR) should be set to the data buffer used for endpoint transfers.

The Ram Access Interrupt bit in Device Interrupt Flag register (INTFLAG.RAMACER) is set when a RAM access underflow error occurs during IN data stage.

When an endpoint is disabled, the following registers are cleared for that endpoint:

● Device Endpoint Interrupt Enable Clear/Set (EPINTENCLR/SET) register

z Device Endpoint Interrupt Flag (EPINTFLAG) register

z Transmit Stall 0 bit in the Endpoint Status register (EPSTATUS.STALLRQ0)

z Transmit Stall 1 bit in the Endpoint Status register (EPSTATUS.STALLRQ1)

## 30.6.2.3 Multi-Packet Transfers

Multi-packet transfer enables a data payload exceeding the endpoint maximum transfer size to be transferred as multiple packets without software intervention. This reduces the number of interrupts and software intervention required to manage higher level USB transfers. Multi-packet transfer is identical to the IN and OUT transactions described below unless otherwise noted in this section.

The application software provides the size and address of the RAM buffer to be proceeded by the USB module for a specific endpoint, and the USB module will split the buffer in the required USB data transfers without any software intervention.

Figure 30-3. Multi-Packet Feature - Reduction of CPU Overhead  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_fe2d40d90459893f99160dc8eb4f1187ef8a7c0ebb2f4fcbfcf82c580f530c91.jpg)

## 30.6.2.4 USB Reset

The USB bus reset is initiated by a connected host and managed by hardware.

During USB reset the following registers are cleared:

Device Endpoint Configuration (EPCFG) register - except for Endpoint 0

z Device Frame Number (FNUM) register

z Device Address (DADD) register

z Device Endpoint Interrupt Enable Clear/Set (EPINTENCLR/SET) register

z Device Endpoint Interrupt Flag (EPINTFLAG) register

0 Transmit Stall 0 bit in the Endpoint Status register (EPSTATUS.STALLRQ0)

z Transmit Stall 1 bit in the Endpoint Status register (EPSTATUS.STALLRQ1)

● Endpoint Interrupt Summary (EPINTSMRY) register

z Upstream resume bit in the Control B register (CTRLB.UPRSM)

At the end of the reset process, the End of Reset bit is set in the Interrupt Flag register (INTFLAG.EORST).

## 30.6.2.5 Start-of-Frame

When a Start-of-Frame (SOF) token is detected, the frame number from the token is stored in the Frame Number field in the Device Frame Number register (FNUM.FNUM) and the Start-of-Frame interrupt bit in the Device Interrupt Flag register (INTFLAG.SOF) is set. If there is a CRC or bit-stuff error, the Frame Number Error status flag (FNUM.FNCERR) in the FNUM register is set.

## 30.6.2.6 Management of SETUP Transactions

When a SETUP token is detected and the device address of the token packet does not match DADD.DADD the packet is discarded and the USB module returns to idle and waits for the next token packet.

When the address matches, the USB module checks if the endpoint is enabled in EPCFG. If the addressed endpoint is disabled, the packet is discarded and the USB module returns to idle and waits for the next token packet.

When the endpoint is enabled, the USB module then checks on the EPCFG of the addressed endpoint. If the EPCFG.EPTYPE0 is not set to control, the USB module returns to idle and waits for the next token packet.

When the EPCFG.EPTYPE0 matches, the USB module then fetches the Data Buffer Address (ADDR) from the addressed endpoint's descriptor and waits for a DATA0 packet. If a PID error or any other PID than DATA0 is detected, the USB module returns to idle and waits for the next token packet.

When the data PID matches and if Received Setup Complete interrupt bit in the Device Endpoint Interrupt Flag register (EPINTFLAG.RXSTP) is equal to zero, ignoring the Bank 0 Ready bit in the Device Endpoint Status register (EPSTATUS.BK0RDY), the incoming data is written to the data buffer pointed to by the Data Buffer Address (ADDR). If the number of received data bytes exceeds the endpoint's maximum data payload size as specified by the

PCKSIZE.SIZE, the remainders of the received data bytes are discarded. The packet will still be checked for bit-stuff and CRC errors. Software must never report a endpoint size to the host that is greater than the value configured in PCKSIZE.SIZE. If a bit-stuff or CRC error is detected in the packet, the USB module returns to idle and waits for the next token packet.

If data is successfully received, an ACK handshake is returned to the host, and the number of received data bytes, excluding the CRC, is written to the Byte Count (PCKSIZE.BYTE\_COUNT). If the number of received data bytes is the maximum data payload specified by PCKSIZE.SIZE, no CRC data is written to the data buffer. If the number of received data bytes is the maximum data payload specified by PCKSIZE.SIZE minus one, only the first CRC data is written to the data buffer. If the number of received data is equal or less than the data payload specified by PCKSIZE.SIZE minus two, both CRC data bytes are written to the data buffer.

Finally the EPSTATUS is updated. Data Toggle OUT bit (EPSTATUS.DTGLOUT), the Data Toggle IN bit (EPSTATUS.DTGLIN), the current bank bit (EPSTATUS.CURRBK) and the Bank Ready 0 bit (EPSTATUS.BK0RDY) are set. Bank Ready 1 bit (EPSTATUS.BK1RDY) and the Stall Bank 0/1 bit (EPSTATUS.STALLQR0/1) are cleared on receiving the SETUP request. The RXSTP bit is set and triggers an interrupt if the Received Setup Interrupt Enable bit is set in Endpoint Interrupt Enable Set/Clear register (EPINTENSET/CLR.RXSTP).

## 30.6.2.7 Management of OUT Transactions

Figure 30-4. OUT Transfer: Data Packet Host to USB Device  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_10827fce032cfb6ea27d9c7306c890d5dde3bedd86155165fb4a5f7af4717ef4.jpg)

When a OUT token is detected and the device address of the token packet does not match DADD.DADD, the packet is discarded and the USB module returns to idle and waits for the next token packet.

If the address matches, the USB module checks if the endpoint number received is enabled in the EPCFG of the addressed endpoint. If the addressed endpoint is disabled, the packet is discarded and the USB module returns to idle and waits for the next token packet.

When the endpoint is enabled, the USB module then checks the Endpoint Configuration register (EPCFG) of the addressed output endpoint. If the type of the endpoint (EPCFG.EPTYPE0) is not set to OUT, the USB module returns to idle and waits for the next token packet.

The USB module then fetches the Data Buffer Address (ADDR) from the addressed endpoint's descriptor, and waits for a DATA0 or DATA1 packet. If a PID error or any other PID than DATA0 or DATA1 is detected, the USB module returns to idle and waits for the next token packet.

If EPSTATUS.STALLRQ0 in EPSTATUS is set, the incoming data is discarded. If the endpoint is not isochronous, a STALL handshake is returned to the host and the Transmit Stall Bank 0 interrupt bit in EPINTFLAG (EPINTFLAG.STALL0) is set.

For isochronous endpoints, data from both a DATA0 and DATA1 packet will be accepted. For other endpoint types the PID is checked against EPSTATUS.DTGLOUT. If a PID mismatch occurs, the incoming data is discarded, and an ACK handshake is returned to the host.

If EPSTATUS.BK0RDY is set, the incoming data is discarded, the bit Transmit Fail 0 interrupt bit in EPINTFLAG (EPINTFLAG.TRFAIL0) and the status bit STATUS\_BK.ERRORFLOW are set. If the endpoint is not isochronous, a NAK handshake is returned to the host.

The incoming data is written to the data buffer pointed to by the Data Buffer Address (ADDR). If the number of received data bytes exceeds the maximum data payload specified as PCKSIZE.SIZE, the remainders of the received data bytes are discarded. The packet will still be checked for bit-stuff and CRC errors. If a bit-stuff or CRC error is detected in the packet, the USB module returns to idle and waits for the next token packet.

If the endpoint is isochronous and a bit-stuff or CRC error in the incoming data, the number of received data bytes, excluding CRC, is written to PCKSIZE.BYTE\_COUNT. Finally the EPINTFLAG.TRFAIL0 and CRC Error bit in the Device Bank Status register (STATUS\_BK.CRCERR) is set for the addressed endpoint.

If data was successfully received, an ACK handshake is returned to the host if the endpoint is not isochronous, and the number of received data bytes, excluding CRC, is written to PCKSIZE.BYTE\_COUNT. If the number of received data bytes is the maximum data payload specified by PCKSIZE.SIZE no CRC data bytes are written to the data buffer. If the number of received data bytes is the maximum data payload specified by PCKSIZE.SIZE minus one, only the first CRC data byte is written to the data buffer If the number of received data is equal or less than the data payload specified by PCKSIZE.SIZE minus two, both CRC data bytes are written to the data buffer.

Finally in EPSTATUS for the addressed output endpoint, EPSTATUS.BK0RDY is set and EPSTATUS.DTGLOUT is toggled if the endpoint is not isochronous. The flag Transmit Complete 0 interrupt bit in EPINTFLAG (EPINTFLAG.TRCPT0) is set for the addressed endpoint.

## 30.6.2.8 Multi-Packet Transfers for OUT Endpoint

The number of data bytes received is stored in endpoint PCKSIZE.BYTE\_COUNT as for normal operation. Since PCKSIZE.BYTE\_COUNT is updated after each transaction, it must be set to zero when setting up a new transfer. The total number of bytes to be received must be written to PCKSIZE.MULTI\_PACKET\_SIZE. This value must be a multiple of PCKSIZE.SIZE, otherwise excess data may be written to SRAM locations used by other parts of the application.

EPSTATUS.DTGLOUT management for non-isochronous packets and EPINTFLAG.BK1RDY/BK0RDY management are as for normal operation.

If a maximum payload size packet is received, PCKSIZE.BYTE\_COUNT will be incremented by PCKSIZE.SIZE after the transaction has completed, and EPSTATUS.DTGLOUT will be toggled if the endpoint is not isochronous. If the updated PCKSIZE.BYTE\_COUNT is equal to PCKSIZE.MULTI\_PACKET\_SIZE (i.e. the last transaction), EPSTATUS.BK1RDY/BK0RDY, and EPINTFLAG.TRCPT0/TRCPT1 will be set.

## 30.6.2.9 Management of IN Transactions

Figure 30-5. IN Transfer: Data Packet USB Device to Host After Request from Host  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_ae46e28bdb72a1ad41b5df0ee77b9af337f3afde4434f9ea31633c888d2f29dc.jpg)

When a IN token is detected and if the device address of the token packet does not match DADD.DADD, the packet is discarded and the USB module returns to idle and waits for the next token packet.

When the address matches, the USB module checks if the endpoint received is enabled in the EPCFG of the addressed endpoint and if not the packet is discarded and the USB module returns to idle and waits for the next token packet.

When the endpoint is enabled, the USB module then checks on the EPCFG of the addressed input endpoint. If the EPCFG.EPTYPE1 is not set to IN, the USB module returns to idle and waits for the next token packet.

If EPSTATUS.STALLRQ1 in EPSTATUS is set, and the endpoint is not isochronous, a STALL handshake is returned to the host and EPINTFLAG.STALL1 is set.

If EPSTATUS.BK1RDY is cleared, the flag EPINTFLAG.TRFAIL1 is set. If the endpoint is not isochronous, a NAK handshake is returned to the host.

The USB module then fetches the Data Buffer Address (ADDR) from the addressed endpoint's descriptor. The data pointed to by the Data Buffer Address (ADDR) is sent to the host in a DATA0 packet if the endpoint is isochronous. For non-isochronous endpoints a DATA0 or DATA1 packet is sent depending on the state of EPSTATUS.DTGLIN. When the number of data bytes specified in endpoint PCKSIZE.BYTE\_COUNT is sent, the CRC is appended and sent to the host.

For isochronous endpoints, EPSTATUS.BK1RDY is cleared and EPINTFLAG.TRCPT1 is set.

For all non-isochronous endpoints the USB module waits for an ACK handshake from the host. If an ACK handshake is not received within 16 bit times, the USB module returns to idle and waits for the next token packet. If an ACK handshake is successfully received EPSTATUS.BK1RDY is cleared, EPINTFLAG.TRCPT1 is set and EPSTATUS.DTGLIN is toggled.

## 30.6.2.10 Multi-Packet Transfers for IN Endpoint

The total number of data bytes to be sent is written to PCKSIZE.BYTE\_COUNT as for normal operation. The Multipacket size register (PCKSIZE.MULTI\_PACKET\_SIZE) is used to store the number of bytes that are sent, and must be written to zero when setting up a new transfer.

When an IN token is received, PCKSIZE.BYTE\_COUNT and PCKSIZE.MULTI\_PACKET\_SIZE are fetched. If PCKSIZE.BYTE\_COUNT minus PCKSIZE.MULTI\_PACKET\_SIZE is less than the endpoint PCKSIZE.SIZE, endpoint BYTE\_COUNT minus endpoint PCKSIZE.MULTI\_PACKET\_SIZE bytes are transmitted, otherwise PCKSIZE.SIZE number of bytes are transmitted. If endpoint PCKSIZE.BYTE\_COUNT is a multiple of PCKSIZE.SIZE, the last packet sent will be zero-length if the AUTOZLP bit is set.

If a maximum payload size packet was sent (i.e. not the last transaction), MULTI\_PACKET\_SIZE will be incremented by the PCKSIZE.SIZE. If the endpoint is not isochronous the EPSTATUS.DTLGIN bit will be toggled when the transaction has completed. If a short packet was sent (i.e. the last transaction), MULTI\_PACKET\_SIZE is incremented by the data payload. EPSTATUS.BK0/1RDY will be cleared and EPINTFLAG.TRCPT0/1 will be set.

## 30.6.2.11 Ping-Pong Operation

When an endpoint is configured for ping-pong operation, it uses both the input and output data buffers (banks) for a given endpoint in a single direction. The direction is selected by enabling one of the IN or OUT direction in EPCFG.EPTYPE0/1 and configuring the opposite direction in EPCFG.EPTYPE1/0 as Dual Bank.

When ping-pong operation is enabled for an endpoint, the endpoint in the opposite direction must be configured as dual bank. The data buffer, data address pointer and byte counter from the enabled endpoint are used as Bank 0, while the matching registers from the disabled endpoint are used as Bank 1.

Figure 30-6. Ping-Pong Overview  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_0df65445e47362fede5a9780e93897f1dbeba77fef716bd7a4608fb1111dfcfd.jpg)

The Bank Select flag in EPSTATUS.CURBK indicates which bank data will be used in the next transaction, and is updated after each transaction. According to EPSTATUS.CURBK, EPINTFLAG.TRCPT0 or EPINTFLAG.TRFAIL0 or EPINTFLAG.TRCPT1 or EPINTFLAG.TRFAIL1 in EPINTFLAG and Data Buffer 0/1 ready (EPSTATUS.BK0RDY and EPSTATUS.BK1RDY) are set. The EPSTATUS.DTGLOUT and EPSTATUS.DTGLIN are updated for the enabled endpoint direction only.

## 30.6.2.12 Feedback Operation

Feedback endpoints are endpoints with same address but in different direction. This is usually used in explicit feedback mechanism in USB Audio, where a feedback endpoint is associated to one or more isochronous data endpoints to which it provides feedback service. The feedback endpoint always has the opposite direction from the data endpoint.

The feedback endpoint always has the opposite direction from the data endpoint(s). The feedback endpoint has the same endpoint number as the first (lower) data endpoint. A feedback endpoint can be created by configuring an endpoint with different endpoint size (PCKSIZE.SIZE) and different endpoint type (EPCFG.EPTYPE0/1) for the IN and OUT direction.

Example Configuration for Feedback Operation:

Endpoint n / IN: EPCFG.EPTYPE1 = Interrupt IN, PCKSIZE.SIZE = 64.

Endpoint n / OUT: EPCFG.EPTYPE0= Isochronous OUT, PCKSIZE.SIZE = 512.

## 30.6.2.13 Suspend State and Pad Behavior

Figure 30-7illustrates the behavior of the USB pad in device mode.

Figure 30-7. Pad Behavior  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_03494a6de0b40f33e8aac61bae6b669da7e81c34ea931883e0f8ee8bff0952e0.jpg)

In Idle state, the pad is in low power consumption mode.

In Active state, the pad is active.

Figure 30-8 illustrates the pad events leading to a PAD state change.

Figure 30-8. Pad Events  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_8ee84fe0d1b4b91a130c0f73a6d84049f961f635d8129e60bc44b2c0aed74b74.jpg)

The Suspend Interrupt bit in the Device Interrupt Flag register (INTFLAG.SUSPEND) is set when a USB Suspend state has been detected on the USB bus. The USB pad is then automatically put in the Idle state. The detection of a non-idle state sets the Wake Up Interrupt bit in INTFLAG(INTFLAG.WAKEUP) and wakes the USB pad.

The pad goes to the Idle state if the USB module is disabled or if CTRLB.DETACH is written to one. It returns to the Active state when CTRLA.ENABLE is written to one and CTRLB.DETACH is written to zero.

## 30.6.2.14 Remote Wakeup

The remote wakeup request (also known as upstream resume) is the only request the device may send on its own initiative. This should be preceded by a DEVICE\_REMOTE\_WAKEUP request from the host.

First, the USB must have detected a “Suspend” state on the bus, i.e. the remote wakeup request can only be sent after INTFLAG.SUSPEND has been set.

The user may then write a one to the Remote Wakeup bit in CTRLB(CTRLB.UPRSM) to send an Upstream Resume to the host initiating the wakeup. This will automatically be done by the controller after 5 ms of inactivity on the USB bus.

When the controller sends the Upstream Resume INTFLAG.WAKEUP is set and INTFLAG.SUSPEND is cleared.

The CTRLB.UPRSM is cleared at the end of the transmitting Upstream Resume.

In case of a rebroadcast resume initiated by the host, the End of Resume bit in INTFLAG(INTFLAG.EORSM) flag is set when the rebroadcast resume is completed.

In the case where the CTRLB.UPRSM bit is set while a host initiated downstream resume is already started, the CTRLB.UPRSM is cleared and the upstream resume request is ignored.

## 30.6.2.15 Link Power Management L1 (LPM-L1) Suspend State Entry and Exit as Device

The LPM Handshake bit in CTRLB.LPMHDSK should be configured to accept the LPM transaction.

When a LPM transaction is received on any enabled endpoint n and a handshake has been sent in response by the controller according to CTRLB.LPMHDSK, the Device Link Power Manager (EXTREG) register is updated in the bank 0 of the addressed endpoint's descriptor. It contains information such as the Best Effort Service Latency (BESL), the Remote Wake bit (bRemoteWake), and the Link State parameter (bLinkState).

If the LPM transaction was positively acknowledged (ACK handshake), USB sets the Link Power Management Interrupt bit in INTFLAG(INTFLAG.LPMSUSP) bit which indicates that the USB transceiver is suspended, reducing power consumption. This suspend occurs 9 microseconds after the LPM transaction according to the specification.

To further reduce consumption, it is recommended to stop the USB clock while the device is suspended.

The MCU can also enter in one of the available sleep modes if the wakeup time latency of the selected sleep mode complies with the host latency constraint (see the BESL parameter in EXTREG).

Recovering from this LPM-L1 suspend state is exactly the same as the Suspend state (see Section “Suspend State and Pad Behavior” on page 724) except that the remote wakeup duration initiated by USB is shorter to comply with the Link Power Management specification.

If the LPM transaction is responded with a NYET, the Link Power Management Not Yet Interrupt Flag

INTFLAG(INTFLAG.LPMNYET) is set. This generates an interrupt if the Link Power Management Not Yet Interrupt Enable bit in INTENCLR/SET (INTENCLR/SET.LPMNYET) is set.

If the LPM transaction is responded with a STALL or no handshake, no flag is set, and the transaction is ignored.

30.6.2.16 USB Device Interrupt  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_e6b20102991a40f2e96f4dc9b308094b3b0674dc0a02ddc50e7fba2d177dfe67.jpg)  
The WAKEUP is an asynchronous interrupt and can be used to wake-up the device from any sleep mode

## 30.7 Register Summary

The register mapping depends on the Operating Mode field in the Control A register (CTRLA.MODE). The register summary is detailed below.

## 30.7.1 Common Device Host Summary

Table 30-1. Common Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td>CTRLA</td><td>7:0</td><td>MODE</td><td></td><td></td><td></td><td></td><td>RUNSTBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x02</td><td>SYNCBUSY</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x03</td><td>QOSCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td colspan="2">DQOS[1:0]</td><td colspan="2">CQOS[1:0]</td></tr><tr><td>0x0D</td><td>FSMSTATUS</td><td>7:0</td><td></td><td colspan="7">FSMSTATE[6:0]</td></tr><tr><td>0x24</td><td rowspan="4">DESCADD</td><td>7:0</td><td colspan="8">DESCADD[7:0]</td></tr><tr><td>0x25</td><td>15:8</td><td colspan="8">DESCADD[15:8]</td></tr><tr><td>0x26</td><td>23:16</td><td colspan="8">DESCADD[23:16]</td></tr><tr><td>0x27</td><td>31:24</td><td colspan="8">DESCADD[31:24]</td></tr><tr><td>0x28</td><td rowspan="2">PADCAL</td><td>7:0</td><td colspan="2">TRANSN[1:0]</td><td></td><td colspan="5">TRANSP[4:0]</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td colspan="3">TRIM[2:0]</td><td></td><td colspan="3">TRANSN[4:2]</td></tr></table>

30.7.2 Device Summary

Table 30-2. General Device Registers Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x04</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x05</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x06</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td rowspan="2">CTRLB</td><td>7:0</td><td></td><td></td><td></td><td>NREPLY</td><td colspan="2">SPDCONF[1:0]</td><td>UPRSM</td><td>DETACH</td></tr><tr><td>0x09</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="2">LPMHDSK[1:0]</td><td>GNAK</td><td></td></tr><tr><td>0x0A</td><td>DADD</td><td></td><td>ADDEN</td><td colspan="7">DADD[6:0]</td></tr><tr><td>0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>STATUS</td><td>7:0</td><td colspan="2">LINESTATE[1:0]</td><td></td><td></td><td colspan="2">SPEED[1:0]</td><td></td><td></td></tr><tr><td>0x0E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="2">FNUM</td><td>7:0</td><td colspan="5">FNUM[4:0]</td><td></td><td></td><td></td></tr><tr><td>0x11</td><td>15:8</td><td>FNCERR</td><td></td><td colspan="6">FNUM[10:5]</td></tr><tr><td>0x12</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x14</td><td rowspan="2">INTENCLR</td><td>7:0</td><td>RAMACER</td><td>UPRSM</td><td>EORSM</td><td>WAKEUP</td><td>EORST</td><td>SOF</td><td></td><td>SUSPEND</td></tr><tr><td>0x15</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>LPMSUSP</td><td>LPMNYET</td></tr><tr><td>0x16</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x17</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x18</td><td rowspan="2">INTENSET</td><td>7:0</td><td>RAMACER</td><td>UPRSM</td><td>EORSM</td><td>WAKEUP</td><td>EORST</td><td>SOF</td><td></td><td>SUSPEND</td></tr><tr><td>0x19</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>LPMSUSP</td><td>LPMNYET</td></tr><tr><td>0x1A</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1C</td><td rowspan="2">INTFLAG</td><td>7:0</td><td>RAMACER</td><td>UPRSM</td><td>EORSM</td><td>WAKEUP</td><td>EORST</td><td>SOF</td><td></td><td>SUSPEND</td></tr><tr><td>0x1D</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>LPMSUSP</td><td>LPMNYET</td></tr><tr><td>0x1E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="2">EPINTSMRY</td><td>7:0</td><td colspan="8">EPINT[7:0]</td></tr><tr><td>0x21</td><td>15:8</td><td colspan="8">EPINT[15:8]</td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

Table 30-3. Device endpoint Register n

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1m0</td><td>EPCFGx</td><td>7:0</td><td></td><td colspan="3">EPTYPE1[1:0]</td><td></td><td colspan="3">EPTYPE0[1:0]</td></tr><tr><td>0x1m1</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1m2</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1m3</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1m4</td><td>EPSTATUSCLR</td><td>7:0</td><td>BK1RDY</td><td>BK0RDY</td><td>STALLRQ1</td><td>STALLRQ0</td><td></td><td>CURBK</td><td>DTGLIN</td><td>DTGLOUT</td></tr><tr><td>0x1m5</td><td>EPSTATUSSET</td><td>7:0</td><td>BK1RDY</td><td>BK0RDY</td><td>STALLRQ1</td><td>STALLRQ0</td><td></td><td>CURBK</td><td>DTGLIN</td><td>DTGLOUT</td></tr><tr><td>0x1m6</td><td>EPSTATUS</td><td>7:0</td><td>BK1RDY</td><td>BK0RDY</td><td>STALLRQ1</td><td>STALLRQ0</td><td></td><td>CURBK</td><td>DTGLIN</td><td>DTGLOUT</td></tr><tr><td>0x1m7</td><td>EPINTFLAG</td><td>7:0</td><td></td><td>STALL1</td><td>STALL0</td><td>RXSTP</td><td>TRFAIL1</td><td>TRFAIL0</td><td>TRCPT1</td><td>TRCPT0</td></tr><tr><td>0x1m8</td><td>EPINTENCLR</td><td>7:0</td><td></td><td>STALL1</td><td>STALL0</td><td>RXSTP</td><td>TRFAIL1</td><td>TRFAIL0</td><td>TRCPT1</td><td>TRCPT0</td></tr><tr><td>0x1m9</td><td>EPINTENSET</td><td>7:0</td><td></td><td>STALL1</td><td>STALL0</td><td>RXSTP</td><td>TRFAIL1</td><td>TRFAIL0</td><td>TRCPT1</td><td>TRCPT0</td></tr><tr><td>0x1mA</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1mB</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

Table 30-4. Device endpoint n Descriptor Bank 0

<table><tr><td>Offset0x n0 +index</td><td>Name</td><td>BitPos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="8">ADD[7:0]</td></tr><tr><td>0x01</td><td>15:8</td><td colspan="8">ADD[15:8]</td></tr><tr><td>0x02</td><td>23:16</td><td colspan="8">ADD[23:16]</td></tr><tr><td>0x03</td><td>31:24</td><td colspan="8">ADD[31:24]</td></tr><tr><td>0x04</td><td rowspan="4">PCKSIZE</td><td>7:0</td><td colspan="8">BYTE_COUNT[7:0]</td></tr><tr><td>0x05</td><td>15:8</td><td colspan="2">MULTI_PACKET_SIZE[1:0]</td><td colspan="6">BYTE_COUNT[13:8]</td></tr><tr><td>0x06</td><td>23:16</td><td colspan="8">MULTI_PACKET_SIZE[9:2]</td></tr><tr><td>0x07</td><td>31:24</td><td>AUTO_ZLP</td><td colspan="3">SIZE[2:0]</td><td colspan="4">MULTI_PACKET_SIZE[13:10]</td></tr><tr><td>0x08</td><td rowspan="2">EXTREG</td><td>7:0</td><td colspan="4">VARIABLE[3:0]</td><td colspan="4">SUBPID[3:0]</td></tr><tr><td>0x09</td><td>15:8</td><td></td><td colspan="7">VARIABLE[10:4]</td></tr><tr><td>0x0A</td><td>STATUS_BK</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERRORFLOW</td><td>CRCERR</td></tr><tr><td>0x0B</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0D</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0E</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0F</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

Table 30-5. Device endpoint n Descriptor Bank 1

<table><tr><td>Offset0x n0 +0x10 +index</td><td>Name</td><td>BitPos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td rowspan="4">ADDR</td><td>7:0</td><td colspan="8">ADD[7:0]</td></tr><tr><td>0x01</td><td>15:8</td><td colspan="8">ADD[15:8]</td></tr><tr><td>0x02</td><td>23:16</td><td colspan="8">ADD[23:16]</td></tr><tr><td>0x03</td><td>31:24</td><td colspan="8">ADD[31:24]</td></tr><tr><td>0x04</td><td rowspan="4">PCKSIZE</td><td>7:0</td><td colspan="8">BYTE_COUNT[7:0]</td></tr><tr><td>0x05</td><td>15:8</td><td colspan="2">MULTI_PACKET_SIZE[1:0]</td><td colspan="6">BYTE_COUNT[13:8]</td></tr><tr><td>0x06</td><td>23:16</td><td colspan="8">MULTI_PACKET_SIZE[9:2]</td></tr><tr><td>0x07</td><td>31:24</td><td>AUTO_ZLP</td><td colspan="3">SIZE[2:0]</td><td colspan="4">MULTI_PACKET_SIZE[13:10]</td></tr><tr><td>0x08</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x09</td><td>Reserved</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0A</td><td>STATUS_BK</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERRORFLOW</td><td>CRCERR</td></tr><tr><td>0x0B</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0D</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0E</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0F</td><td>Reserved</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>

## 30.8 Register Description

Registers can be 8, 16, or 32 bits wide. Atomic 8-, 16-, and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register, and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by Write-Protected property in each individual register description. Please refer to the “Register Access Protection” on page 716 section and the “PAC – Peripheral Access Controller” on page 30 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Refer to “Synchronization” on page 94 for details.

Some registers are enable-protected, meaning they can only be written when the USB is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 30.8.1 Common Device Host Registers

## 30.8.1.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x0000

Property: Write-Protected, Write-Synchronised

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>MODE</td><td></td><td></td><td></td><td></td><td>RUNSTBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7– MODE: Operating Mode

This bit defines the operating mode of the USB.

0: USB Device mode

1: Reserved

## z Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – RUNSDTBY: Run in Standby Mode

0: USB clock is stopped in standby mode.

1: USB clock is running in standby mode

This bit is Enable-Protected.

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRLA.ENABLE will read back immediately and the Synchronization status enable bit in the synchronization register (SYNCBUSY.ENABLE) will be set. SYNCBUSY.ENABLE will be cleared when the operation is complete.

## This bit is Write-Synchronized

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the USB, to their initial state, and the USB will be disabled.

Writing a one to CTRLA.SWRST will always take precedence, meaning that all other writes in the same writeoperation will be discarded.

Due to synchronization there is a delay from writing CTRLA.SWRST until the reset is complete.

CTRLA.SWRST and SYNCBUSY.SWRST will both be cleared when the reset is complete.

This bit is Write-Synchronized.

## 30.8.1.2 Synchronization Busy

Name: SYNCBUSY

Offset: 0x02

Reset: 0x0000

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 1 – ENABLE: Synchronization Enable status bit

This bit is cleared when the synchronization of ENABLE register between the clock domains is complete. This bit is set when the synchronization of ENABLE register between clock domains is started.

## Bit 0 – SWRST: Synchronization Software Reset status bit

This bit is cleared when the synchronization of SWRST register between the clock domains is complete. This bit is set when the synchronization of SWRST register between clock domains is started.

## 30.8.1.3 QOS Control

Name: QOSCTRL

Offset: 0x03

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="2">DQOS[1:0]</td><td colspan="2">CQOS[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td></tr></table>

## Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 3:2 –DQOS[1:0]: Data Quality of Service

These bits define the memory priority access during the endpoint or pipe read/write data operation.Refer to “SRAM Quality of Service” on page 29.

## z Bits 1:0 – CQOS[1:0]: Configuration Quality of Service

These bits define the memory priority access during the endpoint or pipe read/write configuration operation.Refer to “SRAM Quality of Service” on page 29.

## 30.8.1.4 Finite State Machine Status

Name: FSMSTATUS

Offset: 0x0D

Reset: 0xXXXX

Property: Read only

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">FSMSTATE[6:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td></tr></table>

## Bits 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 6:0 – FSMSTATE[6:0]: Fine State Machine Status

These bits indicate the state of the finite state machine of the USB controller.

<table><tr><td>FSMSTATE[6:0]</td><td>Description</td></tr><tr><td>0x01</td><td>OFF (L3). Corresponds to the powered-off, disconnected, and disabled state</td></tr><tr><td>0x02</td><td>ON (L0). Corresponds to the Idle and Active states</td></tr><tr><td>0x04</td><td>SUSPEND (L2)</td></tr><tr><td>0x08</td><td>SLEEP (L1)</td></tr><tr><td>0x10</td><td>DNRESUME. Down Stream Resume.</td></tr><tr><td>0x20</td><td>UPRESUME. Up Stream Resume.</td></tr><tr><td>0x40</td><td>RESET. USB lines Reset.</td></tr><tr><td>Others</td><td>Reserved</td></tr></table>

## 30.8.1.5 Descriptor Address

Name: DESCADD

Offset: 0x24

Reset: 0x00000000

Property: Write-Protected

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td>+3</td><td colspan="8">DESCADD[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td>+2</td><td colspan="8">DESCADD[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td>+1</td><td colspan="8">DESCADD[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>+0</td><td colspan="8">DESCADD[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 31:0 – DESCADD[31:0]: Descriptor Address Value These bits define the base address of the main USB descriptor in RAM. The two least significant bits must be written to zero.

## 30.8.1.6 Pad Calibration

Name: PADCAL

Offset: 0x28

Reset: 0x0000

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td colspan="2"></td><td colspan="3">TRIM[2:0]</td><td></td><td colspan="3">TRANSN[4:2]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">TRANSN[1:0]</td><td></td><td colspan="5">TRANSP[4:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

The Pad Calibration values must be loaded from the NVM Software Calibration Area into the USB Pad Calibration register by software, before enabling the USB, to achieve the specified accuracy. Refer to “NVM Software Calibration Row Mapping” on page 24 for further details.

## ● Bit 15 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 14:12 – TRIM: Trim bits for DP/DM

These bits calibrate the matching of rise/fall of DP/DM.

## z Bit 11 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 10:6 – TRANSN: Trimmable Output Driver Impedance N These bits calibrate the NMOS output impedance of DP/DM drivers.

## Bit 5 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 4:0 – TRANSP: Trimmable Output Driver Impedance P These bits calibrate the PMOS output impedance of DP/DM drivers.

## 30.8.2 Device Registers - Common

## 30.8.2.1 Control B

Name: CTRLB

Offset: 0x08

Reset: 0x0001

Property: Write-Protected

<table><tr><td>Bits</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="2">LPMHD[1:0]</td><td>GNAK</td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td rowspan="2">Bits</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>NREPLY</td><td colspan="2">SPDCONF[1:0]</td><td>UPRSM</td><td>DETACH</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 11:10 – LPMHDSK[1:0]: Link Power Management Handshake

These bits select the Link Power Management Handshake configuration as shown in Table 30-6.

Table 30-6. LPMHDSK Selection

<table><tr><td>LPMHDSK[1:0]</td><td>Description</td></tr><tr><td>0x0</td><td>No handshake. LPM is not supported</td></tr><tr><td>0x1</td><td>ACK</td></tr><tr><td>0x2</td><td>NYET</td></tr><tr><td>0x3</td><td>Reserved</td></tr></table>

## z Bit 9 – GNAK: Global NAK

This bit configures the operating mode of the NAK.

0: The handshake packet reports the status of the USB transaction

1: A NAK handshake is answered for each USB transaction regardless of the current endpoint memory bank status

This bit is not synchronized.

## Bits 8:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 4 – NREPLY: No reply excepted SETUP Token

0: Disable the “NO\_REPLY” feature: Any transaction to endpoint 0 will be handled according to the USB2.0 standard.

1: Enable the “NO\_REPLY” feature: Any transaction to endpoint 0 will be ignored except SETUP.

This bit is cleared by hardware when receiving a SETUP packet.

This bit has no effect for any other endpoint but endpoint 0.

## z Bits 3:2 – SPDCONF[1:0]: Speed Configuration

These bits select the speed configuration as shown in Table 30-7.

Table 30-7. SPDCONF Selection

<table><tr><td>SPDCONF [1:0]</td><td>Description</td></tr><tr><td>0x0</td><td>FS: Low speed</td></tr><tr><td>0x1</td><td>LS: Full Speed</td></tr><tr><td>0x2</td><td>Reserved</td></tr><tr><td>0x3</td><td>Reserved</td></tr></table>

## z Bit 1 – UPRSM: Upstream Resume

0: Writing a zero to this bit has no effect.

1: Writing a one to this bit will generate an upstream resume to the host for a remote wakeup.

This bit is cleared when the USB receives a USB reset or once the upstream resume has been sent.

## z Bit 0 – DETACH: Detach

0: The device is attached to the USB bus so that communications may occur.

1: It is the default value at reset. The internal device pull-ups are disabled, removing the device from the USB bus.

## 30.8.2.2 Device Address

Name: DADD

Offset: 0x0A

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>ADDEN</td><td colspan="7">DADD[6:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – ADDEN: Device Address Enable

0: Writing a zero will deactivate the DADD field (USB device address) and return the device to default address 0.

1: Writing a one will activate the DADD field (USB device address).

This bit is cleared when a USB reset is received.

## Bits 6:0 – DADD: Device Address

These bits define the device address. The DADD register is reset when a USB reset is received.

## 30.8.2.3 Status

Name: STATUS

Offset: 0x0C

Reset: 0x0000

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">LINESTATE[1:0]</td><td></td><td></td><td colspan="2">SPEED[1:0]</td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td></tr></table>

z Bits 7:6 – LINESTATE[1:0]: USB Line State Status  
These bits define the current line state DP/DM as showed in Table 30-8.

Table 30-8. USB Line State Status

<table><tr><td>LINESTATE[1:0]</td><td>USB Line Status</td></tr><tr><td>0x0</td><td>SE0/RESET</td></tr><tr><td>0x1</td><td>FS-J or LS-K State</td></tr><tr><td>0x2</td><td>FS-K or LS-J State</td></tr></table>

## z Bits 5:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 3:2 – SPEED [1:0]: Speed Status

These bits define the current speed used of the device

Table 30-9. Speed Status

<table><tr><td>SPEED[1:0]</td><td>SPEED STATUS</td></tr><tr><td>0x0</td><td>Low-speed mode</td></tr><tr><td>0x1</td><td>Full-speed mode</td></tr><tr><td>0x2</td><td>Reserved</td></tr><tr><td>0x3</td><td>Reserved</td></tr></table>

## z Bits 1:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 30.8.2.4 Device Frame Number

Name: FNUM

Offset: 0x10

Reset: 0x0000

Property: Read only

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>FNCERR</td><td></td><td colspan="6">FNUM[10:5]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="5">FNUM[4:0]</td><td colspan="3">MFNUM[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 15 – FNCERR: Frame Number CRC Error

This bit is cleared upon receiving a USB reset.

This bit is set when a corrupted frame number (or micro-frame number) is received.

This bit and the SOF (or MSOF) interrupt bit are updated at the same time.

## ● Bit 14 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 13:3 – FNUM: Frame Number

These bits are cleared upon receiving a USB reset.

These bits are updated with the frame number information as provided from the last SOF packet even if a cor rupted SOF is received.

## z Bits 2:0 – MFNUM: Micro Frame Number

These bits are cleared upon receiving a USB reset or at the beginning of each Start-of-Frame (SOF interrupt). These bits are updated with the micro-frame number information as provided from the last MSOF packet even if a corrupted MSOF is received.

## 30.8.2.5 Device Interrupt Enable Clear

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set (INTENSET) register.

Name: INTENCLR

Offset: 0x14

Reset: 0x0000

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>LPMSUSP</td><td>LPMNYET</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td rowspan="2">Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>RAMACER</td><td>UPRSM</td><td>EORSM</td><td>WAKEUP</td><td>EORST</td><td>SOF</td><td></td><td>SUSPEND</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 9 – LPMSUSP: Link Power Management Suspend Interrupt Enable

0: The Link Power Management Suspend interrupt is disabled.

1: The Link Power Management Suspend interrupt is enabled and an interrupt request will be generated when the Link Power Management Suspend interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Link Power Management Suspend Interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 8 – LPMNYET: Link Power Management Not Yet Interrupt Enable

0: The Link Power Management Not Yet interrupt is disabled.

1: The Link Power Management Not Yet interrupt is enabled and an interrupt request will be generated when the Link Power Management Not Yet interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Link Power Management Not Yet interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 7 – RAMACER: RAM Access Interrupt Enable

0: The RAM Access interrupt is disabled.

1: The RAM Access interrupt is enabled and an interrupt request will be generated when the RAM Access interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the RAM Access interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 6 – UPRSM: Upstream Resume Interrupt Enable

0: The Upstream Resume interrupt is disabled.

1: The Upstream Resume interrupt is enabled and an interrupt request will be generated when the Upstream Resume interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Upstream Resume interrupt Enable bit and disable the corresponding interrupt request.

## ● Bit 5 – EORSM: End Of Resume Interrupt Enable

0: The End Of Resume interrupt is disabled.

1: The End Of Resume interrupt is enabled and an interrupt request will be generated when the End Of Resume interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the End Of Resume interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 4 – WAKEUP: Wake-Up Interrupt Enable

0: The Wake Up interrupt is disabled.

1: The Wake Up interrupt is enabled and an interrupt request will be generated when the Wake Up interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Wake Up interrupt Enable bit and disable the corresponding interrupt request.

## Bit 3 – EORST: End of Reset Interrupt Enable

0: The End of Reset interrupt is disabled.

1: The End of Reset interrupt is enabled and an interrupt request will be generated when the End of Reset interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the End of Reset interrupt Enable bit and disable the corresponding interrupt request.

## Bit 2 – SOF: Start-of-Frame Interrupt Enable

0: The Start-of-Frame interrupt is disabled.

1: The Start-of-Frame interrupt is enabled and an interrupt request will be generated when the Start-of-Frame interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Start-of-Frame interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 0– SUSPEND: Suspend Interrupt Enable

0: The Suspend interrupt is disabled.

1: The Suspend interrupt is enabled and an interrupt request will be generated when the Suspend interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Suspend Interrupt Enable bit and disable the corresponding interrupt request.

## 30.8.2.6 Device Interrupt Enable Set

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear (INTENCLR) register.

Name: INTENSET

Offset: 0x18

Reset: 0x0000

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>LPMSUSP</td><td>LPMNYET</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td rowspan="2">Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>RAMACER</td><td>UPRSM</td><td>EORSM</td><td>WAKEUP</td><td>EORST</td><td>SOF</td><td></td><td>SUSPEND</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 9 – LPMSUSP: Link Power Management Suspend Interrupt Enable

0: The Link Power Management Suspend interrupt is disabled.

1: The Link Power Management Suspend interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Link Power Management Suspend Enable bit and enable the corresponding interrupt request.

## ● Bit 8 – LPMNYET: Link Power Management Not Yet Interrupt Enable

0: The Link Power Management Not Yet interrupt is disabled.

1: The Link Power Management Not Yet interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Link Power Management Not Yet interrupt bit and enable the corresponding interrupt request.

## Bit 7 – RAMACER: RAM Access Interrupt Enable

0: The RAM Access interrupt is disabled.

1: The RAM Access interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the RAM Access Enable bit and enable the corresponding interrupt request.

## z Bit 6 – UPRSM: Upstream Resume Interrupt Enable

0: The Upstream Resume interrupt is disabled.

1: The Upstream Resume interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Upstream Resume Enable bit and enable the corresponding interrupt request.

## z Bit 5 – EORSM: End Of Resume Interrupt Enable

0: The End Of Resume interrupt is disabled.

1: The End Of Resume interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the End Of Resume interrupt Enable bit and enable the corresponding interrupt request.

## z Bit 4 – WAKEUP: Wake-Up Interrupt Enable

0: The Wake Up interrupt is disabled.

1: The Wake Up interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Wake Up interrupt Enable bit and enable the corresponding interrupt request.

## ● Bit 3 – EORST: End of Reset Interrupt Enable

0: The End of Reset interrupt is disabled.

1: The End of Reset interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the End of Reset interrupt Enable bit and enable the corresponding interrupt request.

## Bit 2 – SOF: Start-of-Frame Interrupt Enable

0: The Start-of-Frame interrupt is disabled.

1: The Start-of-Frame interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Start-of-Frame interrupt Enable bit and enable the corresponding interrupt request.

## Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 0 – SUSPEND: Suspend Interrupt Enable

0: The Suspend interrupt is disabled.

1: The Suspend interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Suspend interrupt Enable bit and enable the corresponding interrupt request.

## 30.8.2.7 Device Interrupt Flag

Name: INTFLAG

Offset: 0x01C

Reset: 0x0000

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>LPMSUSP</td><td>LPMNYET</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>RAMACER</td><td>UPRSM</td><td>EORSM</td><td>WAKEUP</td><td>EORST</td><td>SOF</td><td></td><td>SUSPEND</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 9 – LPMSUSP: Link Power Management Suspend Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when the USB module acknowledge a Link Power Management Transaction (ACK handshake) and has entered the Suspended state and will generate an interrupt if INTENCLR/SET.LPMSUSP is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the LPMSUSP Interrupt Flag.

## ● Bit 8 – LPMNYET: Link Power Management Not Yet Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when the USB module acknowledges a Link Power Management Transaction (handshake is NYET) and will generate an interrupt if INTENCLR/SET.LPMNYET is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the LPMNYET Interrupt Flag.

## ● Bit 7– RAMACER: RAM Access Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a RAM access underflow error occurs during IN data stage. This bit will generate an interrupt if INTENCLR/SET.RAMACER is one.

Writing a zero to this bit has no effect.

## ● Bit 6 – UPRSM: Upstream Resume Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when the USB sends a resume signal called “Upstream Resume” and will generate an interrupt if INTENCLR/SET.UPRSM is one.

Writing a zero to this bit has no effect.

## z Bit 5 – EORSM: End Of Resume Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when the USB detects a valid “End of Resume” signal initiated by the host and will generate an interrupt if INTENCLR/SET.EORSM is one.

Writing a zero to this bit has no effect.

## z Bit 4 – WAKEUP: Wake Up Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when the USB is reactivated by a filtered non-idle signal from the lines and will generate an interrupt if INTENCLR/SET.WAKEUP is one.

Writing a zero to this bit has no effect.

## Bit 3 – EORST: End of Reset Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a USB “End of Reset” has been detected and will generate an interrupt if INTEN-CLR/SET.EORST is one.

Writing a zero to this bit has no effect.

## Bit 2 – SOF: Start-of-Frame Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a USB “Start-of-Frame” has been detected (every 1 ms) and will generate an interrupt if INTENCLR/SET.SOF is one.

The FNUM is updated.

Writing a zero to this bit has no effect.

## Bit 1 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 0 – SUSPEND: Suspend Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a USB “Suspend” idle state has been detected for 3 frame periods (J state for 3 ms) and will generate an interrupt if INTENCLR/SET.SUSPEND is one.

Writing a zero to this bit has no effect.

## 30.8.2.8 Endpoint Interrupt Summary

Name: EPINTSMRY

Offset: 0x20

Reset: 0x00000000

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td>+1</td><td colspan="8">EPINT[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>+0</td><td colspan="8">EPINT[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:0 – EPINT[15:0]: EndPoint Interrupt Summary Register

The flag EPINT[n] is set when an interrupt is triggered by the EndPoint n. See “Device EndPoint Interrupt Flag” on page 756 register in the device EndPoint section.

This bit will be cleared when no interrupts are pending for EndPoint n.

## 30.8.3 Device Registers - Endpoint

## 30.8.3.1 Device Endpoint Configuration register n

Name: EPCFGx

Offset: 0x100 + (n x 0x20)

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td colspan="3">ETYPE1[2:0]</td><td></td><td colspan="3">ETYPE0[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 6:4 – EPTYPE1[2:0]: Type of the Endpoint for IN direction These bits contains the endpoint type for IN direction.

Table 30-10. Type of Endpoint

<table><tr><td>EPTYPE1[2:0]</td><td>Description</td></tr><tr><td>0x0</td><td>Bank1 is disabled</td></tr><tr><td>0x1</td><td>Bank1 is enabled and configured as Control IN</td></tr><tr><td>0x2</td><td>Bank1 is enabled and configured as Isochronous IN</td></tr><tr><td>0x3</td><td>Bank1 is enabled and configured as Bulk IN</td></tr><tr><td>0x4</td><td>Bank1 is enabled and configured as Interrupt IN</td></tr><tr><td>0x5</td><td>Bank1 is enabled and configured as Dual-Bank OUT(EndPoint type is the same as the one defined in EPTYPE0)</td></tr><tr><td>0x6-0x7</td><td>Reserved</td></tr></table>

Upon receiving a USB reset EPCFGn.EPTYPE1 is cleared except for endpoint 0 which is unchanged.

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 2:0 – EPTYPE0[2:0]: Type of the Endpoint for OUT direction These bits contains the endpoint type for OUT direction.

Table 30-11. Type of Endpoint

<table><tr><td>EPTYPE0[2:0]</td><td>Description</td></tr><tr><td>0x0</td><td>Bank0 is disabled</td></tr><tr><td>0x1</td><td>Bank0 is enabled and configured as Control SETUP / Control OUT</td></tr><tr><td>0x2</td><td>Bank0 is enabled and configured as Isochronous OUT</td></tr><tr><td>0x3</td><td>Bank0 is enabled and configured as Bulk OUT</td></tr><tr><td>0x4</td><td>Bank0 is enabled and configured as Interrupt OUT</td></tr><tr><td>0x5</td><td>Bank0 is enabled and configured as Dual Bank IN(EndPoint type is the same as the one defined in EPTYPE1)</td></tr><tr><td>0x6-0x7</td><td>Reserved</td></tr></table>

Upon receiving a USB reset EPCFGn.EPTYPE0 is cleared except for endpoint 0 which is unchanged.

## 30.8.3.2 EndPoint Status Clear Register n

Name: EPSTATUSCLR

Offset: 0x104 + (x \* 0x20)

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>BK1RDY</td><td>BK0RDY</td><td>STALLRQ1</td><td>STALLRQ0</td><td></td><td>CURBK</td><td>DTGLIN</td><td>DTGLOUT</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – BK1RDY: Bank 1 Ready

Writing a zero to this bit has no effect.

Writing a one to this bit will clear EPSTATUS.BK1RDY bit.

## ● Bit 6 – BK0RDY: Bank 0 Ready

Writing a zero to this bit has no effect.

Writing a one to this bit will clear EPSTATUS.BK0RDY bit.

## ● Bit 5 – STALLRQ1:STALL bank 1 Request

Writing a zero to this bit has no effect.

Writing a one to this bit will clear EPSTATUS.STALLRQ1 bit.

## ● Bit 4 – STALLRQ0:STALL bank 0 Request

Writing a zero to this bit has no effect.

Writing a one to this bit will clear EPSTATUS.STALLRQ0 bit.

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 2 – CURBK: Current Bank

Writing a zero to this bit has no effect.

Writing a one to this bit will clear EPSTATUS.CURBK bit.

## Bit 1 – DTGLIN: Data Toggle IN

Writing a zero to this bit has no effect.

Writing a one to this bit will clear EPSTATUS.DTGLIN bit.

## z Bit 0 – DTGLOUT: Data Toggle OUT

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the EPSTATUS.DTGLOUT bit.

## 30.8.3.3 EndPoint Status Set n

Name: EPSTATUSSET

Offset: 0x105 + (n x 0x20)

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>BK1RDY</td><td>BK0RDY</td><td>STALLRQ1</td><td>STALLRQ0</td><td></td><td>CURBK</td><td>DTGLIN</td><td>DTGLOUT</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – BK1RDY: Bank 1 Ready

Writing a zero to this bit has no effect.

Writing a one to this bit will set EPSTATUS.BK1RDY bit.

## ● Bit 6 – BK0RDY: Bank 0 Ready

Writing a zero to this bit has no effect.

Writing a one to this bit will set EPSTATUS.BK0RDY bit.

## z Bit 5 – STALLRQ1: STALL Request bank 1

Writing a zero to this bit has no effect.

Writing a one to this bit will set EPSTATUS.STALLRQ1 bit.

## z Bit 4 – STALLRQ0: STALL Request bank 0

Writing a zero to this bit has no effect.

Writing a one to this bit will set EPSTATUS.STALLRQ0 bit.

## z Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 2 – CURBK: Current Bank

Writing a zero to this bit has no effect.

Writing a one to this bit will set EPSTATUS.CURBK bit.

## Bit 1 – DTGLIN: Data Toggle IN

Writing a zero to this bit has no effect.

Writing a one to this bit will set EPSTATUS.DTGLIN bit.

## z Bit 0 – DTGLOUT: Data Toggle OUT

Writing a zero to this bit has no effect.

Writing a one to this bit will set the EPSTATUS.DTGLOUT bit.

## 30.8.3.4 EndPoint Status n

Name: EPSTATUS

Offset: 0x106 + (n x 0x20)

Reset: 0x00

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>BK1RDY</td><td>BK0RDY</td><td>STALLRQ1</td><td>STALLRQ0</td><td></td><td>CURBK</td><td>DTGLIN</td><td>DTGLOUT</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – BK1RDY: Bank 1 is ready

0: The bank number 1 is not ready: For IN direction Endpoints, the bank is not yet filled in.

For Control/OUT direction Endpoints, the bank is empty.

1: The bank number 1 is ready: For IN direction Endpoints, the bank is filled in. For Control/OUT direction End points, the bank is full.

Writing a one to the bit EPSTATUSCLR.BK1RDY will clear this bit.

Writing a one to the bit EPSTATUSSET.BK1RDY will set this bit.

## z Bit 6 – BK0RDY: Bank 0 is ready

0: The bank number 0 is not ready : For IN direction Endpoints, the bank is not yet filled in. For Control/OUT direction Endpoints, the bank is empty.

1: The bank number 0 is ready: For IN direction Endpoints, the bank is filled in. For Control/OUT direction Endpoints, the bank is full.

Writing a one to the bit EPSTATUSCLR.BK0RDY will clear this bit.

Writing a one to the bit EPSTATUSSET.BK0RDY will set this bit.

## z Bit 5 – STALLRQ1: STALL bank 1 request

0: Disable STALLRQ1 feature.

1: Enable STALLRQ1 feature: a STALL handshake will be sent to the host in regards to bank1.

Writing a zero to the bit EPSTATUSCLR.STALLRQ1 will clear this bit.

Writing a one to the bit EPSTATUSSET.STALLRQ1 will set this bit.

This bit is cleared by hardware when receiving a SETUP packet.

## z Bit 4 – STALLRQ0: STALL bank 0 request

0: Disable STALLRQ0 feature.

1: Enable STALLRQ0 feature: a STALL handshake will be sent to the host in regards to bank0.

Writing a zero to the bit EPSTATUSCLR.STALLRQ0 will clear this bit.

Writing a one to the bit EPSTATUSSET.STALLRQ0 will set this bit.

This bit is cleared by hardware when receiving a SETUP packet.

## Bit 3 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 2 – CURBK: Current Bank

0: The bank0 is the bank that will be used in the next single/multi USB packet.

1: The bank1 is the bank that will be used in the next single/multi USB packet.

Writing a zero to the bit EPSTATUSCLR.CURBK will clear this bit.

Writing a one to the bit EPSTATUSSET.CURBK will set this bit.

## z Bit 1 – DTGLIN: Data Toggle IN Sequence

0: The PID of the next expected IN transaction will be zero: data 0. 1: The PID of the next expected IN transaction will be one: data 1. Writing a zero to the bit EPSTATUSCLR.DTGLINCLR will clear this bit. Writing a one to the bit EPSTATUSSET.DTGLINSET will set this bit.

## ● Bit 0 – DTGLOUT: Data Toggle OUT Sequence

0: The PID of the next expected OUT transaction will be zero: data 0. 1: The PID of the next expected OUR transaction will be one: data 1. Writing a zero to the bit EPSTATUSCLR.DTGLOUTCLR will clear this bit. Writing a one to the bit EPSTATUSSET.DTGLOUTSET will set this bit.

## 30.8.3.5 Device EndPoint Interrupt Flag

Name: EPINTFLAG

Offset: 0x107 + (n x 0x20)

Reset: 0x00

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>STALL1</td><td>STALL0</td><td>RXSTP</td><td>TRFAIL1</td><td>TRFAIL0</td><td>TRCPT1</td><td>TRCPT0</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 6 – STALL1: Transmit Stall 1 Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a Transmit Stall occurs and will generate an interrupt if EPINTENCLR/SET.STALL1 is one.

EPINTFLAG.STALL1 is set for a single bank IN endpoint or double bank IN/OUT endpoint when current bank is "1".

Writing a zero to this bit has no effect.

Writing a one to this bit clears the STALL1 Interrupt Flag.

## Bit 5 – STALL0: Transmit Stall 0 Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a Transmit Stall occurs and will generate an interrupt if EPINTENCLR/SET.STALL0 is one.

EPINTFLAG.STALL0 is set for a single bank OUT endpoint or double bank IN/OUT endpoint when current bank is "0".

Writing a zero to this bit has no effect.

Writing a one to this bit clears the STALL0 Interrupt Flag.

## z Bit 4 – RXSTP: Received Setup Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a Received Setup occurs and will generate an interrupt if EPINTENCLR/SET.RXSTP is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the RXSTP Interrupt Flag.

## z Bit 3 – TRFAIL1: Transfer Fail 1 Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a transfer fail occurs and will generate an interrupt if EPINTENCLR/SET.TRFAIL1 is one. EPINTFLAG.TRFAIL1 is set for a single bank IN endpoint or double bank IN/OUT endpoint when current bank is "1".

Writing a zero to this bit has no effect.

Writing a one to this bit clears the TRFAIL1 Interrupt Flag.

## Bit 2 – TRFAIL0: Transfer Fail 0 Interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a transfer fail occurs and will generate an interrupt if EPINTENCLR/SET.TRFAIL0 is one. EPINTFLAG.TRFAIL0 is set for a single bank OUT endpoint or double bank IN/OUT endpoint when current bank is "0".

Writing a zero to this bit has no effect.

Writing a one to this bit clears the TRFAIL0 Interrupt Flag.

## z Bit 1 – TRCPT1: Transfer Complete 1 interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a Transfer Complete occurs and will generate an interrupt if EPINTENCLR/SET.TRCPT1 is one. EPINTFLAG.TRCPT1 is set for a single bank IN endpoint or double bank IN/OUT endpoint when current bank is "1".

Writing a zero to this bit has no effect.

Writing a one to this bit clears the TRCPT1 Interrupt Flag.

## ● Bit 0 – TRCPT0: Transfer Complete 0 interrupt Flag

This flag is cleared by writing a one to the flag.

This flag is set when a Transfer complete occurs and will generate an interrupt if EPINTENCLR/SET.TRCPT0 is one. EPINTFLAG.TRCPT0 is set for a single bank OUT endpoint or double bank IN/OUT endpoint when current bank is "0".

Writing a zero to this bit has no effect.

Writing a one to this bit clears the TRCPT0 Interrupt Flag.

## 30.8.3.6 Device EndPoint Interrupt Enable

Name: EPINTENCLR

Offset: 0x108 + (n x 0x20)

Reset: 0x00

Property: Write-Protected

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Endpoint Interrupt Enable Set (EPINTENSET) register.

This register is cleared by USB reset or when EPEN[n] is zero.

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>STALL1</td><td>STALL0</td><td>RXSTP</td><td>TRFAIL1</td><td>TRFAIL0</td><td>TRCPT1</td><td>TRCPT0</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## ● Bits 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## Bit 6 – STALL1: Transmit STALL 1 Interrupt Enable

0: The Transmit Stall 1 interrupt is disabled.

1: The Transmit Stall 1 interrupt is enabled and an interrupt request will be generated when the Transmit Stall 1 Interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transmit Stall 1 Interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 5 – STALL0: Transmit STALL 0 Interrupt Enable

0: The Transmit Stall 0 interrupt is disabled.

1: The Transmit Stall 0 interrupt is enabled and an interrupt request will be generated when the Transmit Stall 0 Interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transmit Stall 0 Interrupt Enable bit and disable the corresponding interrupt request.

## Bit 4 – RXSTP: Received Setup Interrupt Enable

0: The Received Setup interrupt is disabled.

1: The Received Setup interrupt is enabled and an interrupt request will be generated when the Received Setup Interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Received Setup Interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 3 – TRFAIL1: Transfer Fail 1 Interrupt Enable

0: The Transfer Fail 1 interrupt is disabled.

1: The Transfer Fail 1 interrupt is enabled and an interrupt request will be generated when the Transfer Fail 1 Interrupt Flag is set.

The user should look into the descriptor table status located in ram to be informed about the error condition : ERRORFLOW, CRC.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transfer Fail 1 Interrupt Enable bit and disable the corresponding interrupt request.

## ● Bit 2 – TRFAIL0: Transfer Fail 0 Interrupt Enable

0: The Transfer Fail bank 0 interrupt is disabled.

1: The Transfer Fail bank 0 interrupt is enabled and an interrupt request will be generated when the Transfer Fail 0 Interrupt Flag is set.

The user should look into the descriptor table status located in ram to be informed about the error condition : ERRORFLOW, CRC.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transfer Fail 0 Interrupt Enable bit and disable the corresponding interrupt request.

## ● Bit 1 – TRCPT1: Transfer Complete 1 Interrupt Enable

0: The Transfer Complete 1 interrupt is disabled.

1: The Transfer Complete 1 interrupt is enabled and an interrupt request will be generated when the Transfer Complete 1 Interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transfer Complete 1 Interrupt Enable bit and disable the corresponding interrupt request.

## z Bit 0 – TRCPT0: Transfer Complete 0 interrupt Enable

0: The Transfer Complete bank 0 interrupt is disabled.

1: The Transfer Complete bank 0 interrupt is enabled and an interrupt request will be generated when the Transfer Complete 0 Interrupt Flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Transfer Complete 0 interrupt Enable bit and disable the corresponding interrupt request.

## 30.8.3.7 Device Interrupt EndPoint Set

Name: EPINTENSET

Offset: 0x109 + (n x 0x20)

Reset: 0x0000

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td>STALL1</td><td>STALL0</td><td>RXSTP</td><td>TRFAIL1</td><td>TRFAIL0</td><td>TRCPT1</td><td>TRCPT0</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Endpoint Interrupt Enable Set (EPINTENCLR) register.

This register is cleared by USB reset or when EPEN[n] is zero.

## z Bits 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 6 – STALL1: Transmit Stall 1 Interrupt Enable

0: The Transmit Stall 1 interrupt is disabled.

1: The Transmit Stall 1 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Transmit bank 1 Stall interrupt.

## z Bit 5 – STALL0: Transmit Stall 0 Interrupt Enable

0: The Transmit Stall 0 interrupt is disabled.

1: The Transmit Stall 0 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Transmit bank 0 Stall interrupt.

## Bit 4 – RXSTP: Received Setup Interrupt Enable

0: The Received Setup interrupt is disabled.

1: The Received Setup interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Received Setup interrupt.

## z Bit 3 – TRFAIL1: Transfer Fail bank 1 Interrupt Enable

0: The Transfer Fail interrupt is disabled.

1: The Transfer Fail interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Transfer Fail interrupt.

## z Bit 3 – TRFAIL0: Transfer Fail bank 0 Interrupt Enable

0: The Transfer Fail interrupt is disabled.

1: The Transfer Fail interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Transfer Fail interrupt.

## z Bit 1 – TRCPT1: Transfer Complete bank 1 interrupt Enable

0: The Transfer Complete bank 1 interrupt is disabled.

1: The Transfer Complete bank 1 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Transfer Complete 0 interrupt.

## Bit 0 – TRCPT0: Transfer Complete bank 0 interrupt Enable

0: The Transfer Complete bank 0 interrupt is disabled.

1: The Transfer Complete bank 0 interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will enable the Transfer Complete 1 interrupt.

## 30.8.4 Device Registers - Endpoint RAM

## 30.8.4.1 Endpoint Descriptor structure

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_d140fd0cd44ce26b1a8e818548f4846585da9637906ed52fc62ba4e4922eff86.jpg)

## 30.8.4.2 Address of Data Buffer

Name: ADDR

Offset: 0x00 & 0x10

Reset: 0xxxxxxxx

Property: NA

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td>+3</td><td colspan="8">ADDR[31:24]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td>+2</td><td colspan="8">ADDR[23:16]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td>+1</td><td colspan="8">ADDR[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>+0</td><td colspan="8">ADDR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

z Bits 31:0 – ADDR[31:0]: Data Pointer Address Value These bits define the data pointer address as an absolute word address in RAM.The two least significant bits must be zero to ensure the start address is 32-bit aligned.

## 30.8.4.3 Packet Size

Name: PCKSIZE

Offset: 0x04 & 0x14

Reset: 0xxxxxxxxx

Property: NA

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td>+3</td><td>AUTO_ZLP</td><td colspan="3">SIZE[2:0]</td><td colspan="4">MULTI_PACKET_SIZE[13:10]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td>+2</td><td colspan="8">MULTI_PACKET_SIZE[9:2]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td>+1</td><td colspan="2">MULTI_PACKET_SIZE[1:0]</td><td colspan="6">BYTE-COUNT[13:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>+0</td><td colspan="8">BYTE_COUNT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

## z Bit 31 – AUTO\_ZLP: Automatic Zero Length Packet

This bit defines the automatic Zero Length Packet mode of the endpoint.

0: Automatic Zero Length Packet is disabled.

1: Automatic Zero Length Packet is enabled.

When enabled, the USB module will manage the ZLP handshake by hardware. This bit is for IN endpoints only. When disabled the handshake should be managed by firmware.

## z Bits 30:28 – SIZE: Endpoint size

These bits contains the maximum packet size of the endpoint.

Table 30-12. Endpoint Size

<table><tr><td>SIZE[2:0]</td><td>Description</td></tr><tr><td>0x0</td><td>8 Byte</td></tr><tr><td>0x1</td><td>16 Byte</td></tr><tr><td>0x2</td><td>32 Byte</td></tr><tr><td>0x3</td><td>64 Byte</td></tr><tr><td>0x4</td><td> $128 \text{ Byte}^{(1)}$ </td></tr><tr><td>0x5</td><td>256 Byte (1)</td></tr><tr><td>0x6</td><td>512 Byte (1)</td></tr><tr><td>0x7</td><td>1023 Byte (1)</td></tr></table>

1. for Isochronous endpoints only.

## z Bits 27:14 – MULTI\_PACKET\_SIZE: Multiple Packet Size

These bits define the 14-bit value that is used for multi-packet transfers.

For IN endpoints, MULTI\_PACKET\_SIZE holds the total number of bytes sent. MULTI\_PACKET\_SIZE should be written to zero when setting up a new transfer.

For OUT endpoints, MULTI\_PACKET\_SIZE holds the total data size for the complete transfer. This value must be a multiple of the maximum packet size.

## Bits 13:0 – BYTE\_COUNT: Byte Count

These bits define the 14-bit value that is used for the byte count.

For IN endpoints, BYTE\_COUNT holds the number of bytes to be sent in the next IN transaction.

For OUT endpoint or SETUP endpoints, BYTE\_COUNT holds the number of bytes received upon the last OUT or SETUP transaction.

## 30.8.4.4 Extended Register

Name: EXTREG

Offset: 0x08

Reset: 0xxxxxxxx

Property: NA

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td>+1</td><td></td><td colspan="7">VARIABLE[10:4]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>+0</td><td colspan="4">VARIABLE[3:0]</td><td colspan="4">SUBPID[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

## z Bits 15 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 14:4 – VARIABLE: VARIABLE

These bits define the VARIABLE field of a received extended token.These bits are updated when the USB has answered by an handshake token ACK to a LPM transaction. See Section 2.1.1 Protocol Extension Token in the reference document “ENGINEERING CHANGE NOTICE, USB 2.0 Link Power Management Addendum”. To support the USB2.0 Link Power Management addition the VARIABLE field should be read as described below.

Table 30-13. VARIABLE bit fields for LPM application

<table><tr><td>VARIABLES</td><td>Description</td></tr><tr><td>VARIABLE[3:0]</td><td>bLinkState (1)</td></tr><tr><td>VARIABLE[7:4]</td><td>BESL (2)</td></tr><tr><td>VARIABLE[8]</td><td>bRemoteWake (1)</td></tr><tr><td>VARIABLE[10:9]</td><td>Reserved</td></tr></table>

(1) for a definition of LPM Token bRemoteWake and bLinkState fields, refer to "Table 2-3 in the reference document ENGINEERING CHANGE NOTICE, USB 2.0 Link Power Management Addendum".

(2) for a definition of LPM Token BESL field, refer to "Table 2-3 in the reference document ENGINEERING CHANGE NOTICE, USB 2.0 Link Power Management Addendum" and "Table X-X1 in Errata for ECN USB 2.0 Link Power Management.

## ● Bits 3:0 – SUBPID: SUBPID

These bits define the SUBPID field of a received extended token.These bits are updated when the USB has answered by an handshake token ACK to a LPM transaction. See Section 2.1.1 Protocol Extension Token in the reference document “ENGINEERING CHANGE NOTICE, USB 2.0 Link Power Management Addendum”.

## 30.8.4.5 Device Status Bank

Name: STATUS\_BK

Offset: 0x0A & 0x1A

Reset: 0xxxxxxxx

Property: NA

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td>+0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>ERROFLOW</td><td>CRCERR</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr></table>

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 1 – ERROFLOW: Error Flow Status

This bit defines the Error Flow Status.

0: No Error Flow detected.

1: A Error Flow has been detected.

This bit is set when a Error Flow has been detected during transfer from/towards this bank.

For OUT transfer, a NAK handshake has been sent.

For Isochronous OUT transfer, an overrun condition has occurred.

For IN transfer, this bit is not valid. EPSTATUS.TRFAIL0 and EPSTATUS.TRFAIL1 should reflect the flow errors.

## z Bit 0 – CRCERR: CRC Error

This bit defines the CRC Error Status.

0: No CRC Error.

1: CRC Error detected.

This bit is set when a CRC error has been detected in an isochronous OUT endpoint bank.

## z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 2:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

<table><tr><td>BINTERVAL</td><td>Description</td></tr><tr><td>=0</td><td>Multiple consecutive OUT token is sent in the same frame until it is acked by the peripheral</td></tr><tr><td>&gt;0</td><td>One OUT token is sent every BINTERVAL frame until it is acked by the peripheral</td></tr></table>

## 31. ADC – Analog-to-Digital Converter

## 31.1 Overview

The Analog-to-Digital Converter (ADC) converts analog signals to digital values. The ADC has 12-bit resolution, and is capable of converting up to 350ksps. The input selection is flexible, and both differential and single-ended measurements can be performed. An optional gain stage is available to increase the dynamic range. In addition, several internal signal inputs are available. The ADC can provide both signed and unsigned results.

ADC measurements can be started by either application software or an incoming event from another peripheral in the device. ADC measurements can be started with predictable timing, and without software intervention.

Both internal and external reference voltages can be used.

An integrated temperature sensor is available for use with the ADC. The bandgap voltage as well as the scaled I/O and core voltages can also be measured by the ADC.

The ADC has a compare function for accurate monitoring of user-defined thresholds, with minimum software intervention required.

The ADC may be configured for 8-, 10- or 12-bit results, reducing the conversion time. ADC conversion results are provided left- or right-adjusted, which eases calculation when the result is represented as a signed value. It is possible to use DMA to move ADC results directly to memory or peripherals when conversions are done.

## 31.2 Features

z 8-, 10- or 12-bit resolution

z Up to 350,000 samples per second (350ksps)

z Differential and single-ended inputs

z Up to 32 analog inputs

z 25 positive and 10 negative, including internal and external

z Five internal inputs

z Bandgap

z Temperature sensor

z DAC

z Scaled core supply

z Scaled I/O supply

z 1/2x to 16x gain

z Single, continuous and pin-scan conversion options

z Windowing monitor with selectable channel

z Conversion range:

$\mathsf { V } _ { \mathsf { r e f } } \left[ 1 \mathsf { v } \mathsf { t o } \mathsf { V } _ { \mathsf { D D A N A } } - 0 . 6 \mathsf { V } \right]$

$\mathsf { A D C x } ^ { \star } \mathsf { G A I N } [ \mathsf { O V } \mathsf { t o } - \mathsf { V } _ { \mathsf { r e f } } ]$

z Built-in internal reference and external reference options

z Four bits for reference selection

z Event-triggered conversion for accurate timing (one event input)

z Optional DMA transfer of conversion resul

z Hardware gain and offset compensation

z Averaging and oversampling with decimation to support, up to 16-bit result

z Selectable sampling time

## 31.3 Block Diagram

Figure 31-1. ADC Block Diagram

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_ef481070d792b666327b4c8261abe8471d58c8742756519a8c192e8edb9b27c0.jpg)

31.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>VREFA</td><td>Analog input</td><td>External reference voltage A</td></tr><tr><td>VREFB</td><td>Analog input</td><td>External reference voltage B</td></tr><tr><td>ADC[19..0](1)</td><td>Analog input</td><td>Analog input channels</td></tr></table>

Note: 1. Refer to “Configuration Summary” on page 3 for details on exact number of analog input channels.

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 31.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 31.5.1 I/O Lines

Using the ADC's I/O lines requires the I/O pins to be configured using the port configuration (PORT).

Refer to “PORT” on page 378 for details.

## 31.5.2 Power Management

The ADC will continue to operate in any sleep mode where the selected source clock is running. The ADC’s interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting the sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 31.5.3 Clocks

The ADC bus clock (CLK\_ADC\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_ADC\_APB can be found in the Table 15-1.

A generic clock (GCLK\_ADC) is required to clock the ADC. This clock must be configured and enabled in the Generic Clock Controller (GCLK) before using the ADC. Refer “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the bus clock (CLK\_ADC\_APB). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 780 for further details.

## 31.5.4 DMA

The DMA request lines are connected to the DMA controller (DMAC). Using the ADC DMA requests, requires the DMA controller to be configured first. Refer ro “DMAC – Direct Memory Access Controller” on page 271 for details.

## 31.5.5 Interrupts

The interrupt request line is connected to the interrupt controller. Using ADC interrupts requires the interrupt controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 31.5.6 Events

Events are connected to the Event System. Refer to “EVSYS – Event System” on page 405 for details.

## 31.5.7 Debug Operation

When the CPU is halted in debug mode, the ADC will halt normal operation. The ADC can be forced to continue operation during debugging. Refer to the Debug Control register (DBGCTRL) for details.

## 31.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following register:

z Interrupt Flag Status and Clear register (INTFLAG)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode or the CPU reset is extended, all write-protection is automatically disabled. Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 31.5.9 Analog Connections

I/O-pins AIN0 to AIN19 as well as the VREFA/VREFB reference voltage pin are analog inputs to the ADC.

## 31.5.10 Calibration

The values BIAS\_CAL and LINEARITY\_CAL from the production test must be loaded from the NVM Software Calibration Area into the ADC Calibration register (CALIB) by software to achieve specified accuracy.

Refer to “NVM Software Calibration Row Mapping” on page 24 for more details.

## 31.6 Functional Description

## 31.6.1 Principle of Operation

By default, the ADC provides results with 12-bit resolution. 8-bit or 10-bit results can be selected in order to reduce the conversion time. The ADC has an oversampling with decimation option that can extend the resolution to 16 bits. The input values can be either internal (e.g., internal temperature sensor) or external (connected I/O pins). The user can also configure whether the conversion should be single-ended or differential.

## 31.6.2 Basic Operation

## 31.6.2.1 Initialization

Before enabling the ADC, the asynchronous clock source must be selected and enabled, and the ADC reference must be configured. The first conversion after the reference is changed must not be used. All other configuration registers must be stable during the conversion. The source for GCLK\_ADC is selected and enabled in the System Controller (SYSCTRL). Refer to “SYSCTRL – System Controller” on page 143 for more details.

When GCLK\_ADC is enabled, the ADC can be enabled by writing a one to the Enable bit in the Control Register A (CTRLA.ENABLE).

## 31.6.2.2 Enabling, Disabling and Reset

The ADC is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The ADC is disabled by writing a zero to CTRLA.ENABLE.

The ADC is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the ADC, except DBGCTRL, will be reset to their initial state, and the ADC will be disabled. Refer to the CTRLA register for details.

The ADC must be disabled before it is reset.

## 31.6.2.3 Basic Operation

In the most basic configuration, the ADC sample values from the configured internal or external sources (INPUTCTRL register). The rate of the conversion is dependent on the combination of the GCLK\_ADC frequency and the clock prescaler.

To convert analog values to digital values, the ADC needs first to be initialized, as described in “Initialization” on page 771. Data conversion can be started either manually, by writing a one to the Start bit in the Software Trigger register (SWTRIG.START), or automatically, by configuring an automatic trigger to initiate the conversions. A free-running mode could be used to continuously convert an input channel. There is no need for a trigger to start the conversion. It will start automatically at the end of previous conversion.

The automatic trigger can be configured to trigger on many different conditions.

The result of the conversion is stored in the Result register (RESULT) as it becomes available, overwriting the result from the previous conversion.

To avoid data loss if more than one channel is enabled, the conversion result must be read as it becomes available (INTFLAG.RESRDY). Failing to do so will result in an overrun error condition, indicated by the OVERRUN bit in the Interrupt Flag Status and Clear register (INTFLAG.OVERRUN)

To use an interrupt handler, the corresponding bit in the Interrupt Enable Set register (INTENSET) must be written to one.

## 31.6.3 Prescaler

The ADC is clocked by GCLK\_ADC. There is also a prescaler in the ADC to enable conversion at lower clock rates. Refer to CTRLB for details on prescaler settings.

Figure 31-2. ADC Prescaler  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_547b4e84ef52f393e5f5c7185197edb421b6ae634d85c35eb74a7cd49b533a87.jpg)

The propagation delay of an ADC measurement depends on the selected mode and is given by: z Single-shot mode:

$$
\text { PropagationDelay } = \frac {1 + \frac {\text { Resolution }}{2} + \text { DelayGain }}{f _ {\text { CLK - ADC }}}
$$

z Free-running mode:

$$
\text { PropagationDelay } = \frac {\frac {\text { Resolution }}{2} + \text { DelayGain }}{f _ {C L K - A D C}}
$$

Table 31-1. Delay Gain

<table><tr><td></td><td></td><td colspan="4">Delay Gain (in CLK_ADC Period)</td></tr><tr><td></td><td rowspan="2">INTPUTCTRL.GAIN[3:0]</td><td colspan="2">Free-running mode</td><td colspan="2">Single shot mode</td></tr><tr><td>Name</td><td>Differential Mode</td><td>Single-Ended Mode</td><td>Differential mode</td><td>Single-Ended mode</td></tr><tr><td>1X</td><td>0x0</td><td>0</td><td>0</td><td>0</td><td>1</td></tr><tr><td>2X</td><td>0x1</td><td>0</td><td>1</td><td>0.5</td><td>1.5</td></tr><tr><td>4X</td><td>0x2</td><td>1</td><td>1</td><td>1</td><td>2</td></tr><tr><td>8X</td><td>0x3</td><td>1</td><td>2</td><td>1.5</td><td>2.5</td></tr><tr><td>16X</td><td>0x4</td><td>2</td><td>2</td><td>2</td><td>3</td></tr><tr><td>Reserved</td><td>0x5 ... 0xE</td><td>Reserved</td><td>Reserved</td><td>Reserved</td><td>Reserved</td></tr><tr><td>DIV2</td><td>0xF</td><td>0</td><td>1</td><td>0.5</td><td>1.5</td></tr></table>

## 31.6.4 ADC Resolution

The ADC supports 8-bit, 10-bit and 12-bit resolutions. Resolution can be changed by writing the Resolution bit group in the Control B register (CTRLB.RESSEL). After a reset, the resolution is set to 12 bits by default.

## 31.6.5 Differential and Single-Ended Conversions

The ADC has two conversion options: differential and single-ended. When measuring signals where the positive input is always at a higher voltage than the negative input, the single-ended conversion should be used in order to have full 12-bit resolution in the conversion, which has only positive values. The negative input must be connected to ground. This ground could be the internal GND, IOGND or an external ground connected to a pin. Refer to INPUTCTRL for selection details. If the positive input may go below the negative input, creating some negative results, the differential mode should be used in order to get correct results. The configuration of the conversion is done in the Differential Mode bit in the Control B register (CTRLB.DIFFMODE). These two types of conversion could be run in single mode or in free-running mode. When set up in free-running mode, an ADC input will continuously sample and do new conversions. The INTFLAG.RESRDY bit will be set at the end of each conversion.

## 31.6.5.1 Conversion Timing

Figure 31-3 shows the ADC timing for a single conversion without gain. The writing of the ADC Start Conversion bit (SWTRIG.START) or Start Conversion Event In bit (EVCTRL.STARTEI) must occur at least one CLK\_ADC\_APB cycle before the CLK\_ADC cycle on which the conversion starts. The input channel is sampled in the first half CLK\_ADC period. The sampling time can be increased by using the Sampling Time Length bit group in the Sampling Time Control register (SAMPCTRL.SAMPLEN). Refer to Figure 31-4 for example on increased sampling time.

Figure 31-3. ADC Timing for One Conversion in Differential Mode without Gain  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_a90ce2ae401b68ab5a6603f05b71597655d9cd8f1e3ed5f91433f10f1b740894.jpg)

Figure 31-4. ADC Timing for One Conversion in Differential Mode without Gain, but with Increased Sampling Time  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_e61a9db8f25c00a34c9f43e41be99b4551592930d2688483df603c4e143c5f0d.jpg)

Figure 31-5. ADC Timing for Free Running in Differential Mode without Gain  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_493d06b03fa960c367b6d0f92a52c1e6438cd2c56711c40afe5f7698ef23944d.jpg)

Figure 31-6. ADC Timing for One Conversion in Single-Ended Mode without Gain  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_501232b49e63deac903308da5a31f31788681641ebc4f5503a453c9dd8511e5f.jpg)

Figure 31-7. ADC Timing for Free Running in Single-Ended Mode without Gain  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_db26d48ff5ed1f265473202278d9a0666ae57141d59b1b46653ab891f34186d2.jpg)

## 31.6.6 Accumulation

The result from multiple consecutive conversions can be accumulated. The number of samples to be accumulated is specified by writing to the Number of Samples to be Collected field in the Average Control register (AVGCTRL.SAMPLENUM) as described in Table . When accumulating more than 16 samples, the result will be too large for the 16-bit RESULT register. To avoid overflow, the result is shifted right automatically to fit within the 16 available bits. The number of automatic right shifts are specified in Table . Note that to be able to perform the accumulation of two or more samples, the Conversion Result Resolution field in the Control B register (CTRLB.RESSEL) must be written to one.

Table 31-2. Accumulation

<table><tr><td>Number of Accumulated Samples</td><td>AVGCTRL.SAMPLENUM</td><td>Intermediate Result Precision</td><td>Number of Automatic Right Shifts</td><td>Final Result Precision</td><td>Automatic Division Factor</td></tr><tr><td>1</td><td>0x0</td><td>12 bits</td><td>0</td><td>12 bits</td><td>0</td></tr><tr><td>2</td><td>0x1</td><td>13 bits</td><td>0</td><td>13 bits</td><td>0</td></tr><tr><td>4</td><td>0x2</td><td>14 bits</td><td>0</td><td>14 bits</td><td>0</td></tr><tr><td>8</td><td>0x3</td><td>15 bits</td><td>0</td><td>15 bits</td><td>0</td></tr><tr><td>16</td><td>0x4</td><td>16 bits</td><td>0</td><td>16 bits</td><td>0</td></tr><tr><td>32</td><td>0x5</td><td>17 bits</td><td>1</td><td>16 bits</td><td>2</td></tr><tr><td>64</td><td>0x6</td><td>18 bits</td><td>2</td><td>16 bits</td><td>4</td></tr><tr><td>128</td><td>0x7</td><td>19 bits</td><td>3</td><td>16 bits</td><td>8</td></tr><tr><td>256</td><td>0x8</td><td>20 bits</td><td>4</td><td>16 bits</td><td>16</td></tr><tr><td>512</td><td>0x9</td><td>21 bits</td><td>5</td><td>16 bits</td><td>32</td></tr><tr><td>1024</td><td>0xA</td><td>22 bits</td><td>6</td><td>16 bits</td><td>64</td></tr><tr><td>Reserved</td><td>0xB -0xF</td><td>12 bits</td><td></td><td>12 bits</td><td>0</td></tr></table>

## 31.6.7 Averaging

Averaging is a feature that increases the sample accuracy, though at the cost of reduced sample rate. This feature is suitable when operating in noisy conditions. Averaging is done by accumulating m samples, as described in “Accumulation” on page 775, and divide the result by m. The averaged result is available in the RESULT register. The number of samples to be accumulated is specified by writing to AVGCTRL.SAMPLENUM as described in Table . The division is obtained by a combination of the automatic right shift described above, and an additional right shift that must be specified by writing to the Adjusting Result/Division Coefficient field in AVGCTRL (AVGCTRL.ADJRES) as described in Table . Note that to be able to perform the averaging of two or more samples, the Conversion Result Resolution field in the Control B register (CTRLB.RESSEL) must be written to one.

1 Averaging AVGCTRL.SAMPLENUM samples will reduce the effective sample rate by AVGCTRL.SAMPLENUM When the required average is reached, the INTFLAG.RESRDY bit is set.

Table 31-3. Averaging

<table><tr><td>Number of Accumulated Samples</td><td>AVGCTRL.SAMPLENUM</td><td>Intermediate Result Precision</td><td>Number of Automatic Right Shifts</td><td>Division Factor</td><td>AVGCTRL.ADJRES</td><td>Total Number of Right Shifts</td><td>Final Result Precision</td><td>Automatic Division Factor</td></tr><tr><td>1</td><td>0x0</td><td>12 bits</td><td>0</td><td>1</td><td>0x0</td><td></td><td>12 bits</td><td>0</td></tr><tr><td>2</td><td>0x1</td><td>13</td><td>0</td><td>2</td><td>0x1</td><td>1</td><td>12 bits</td><td>0</td></tr><tr><td>4</td><td>0x2</td><td>14</td><td>0</td><td>4</td><td>0x2</td><td>2</td><td>12 bits</td><td>0</td></tr><tr><td>8</td><td>0x3</td><td>15</td><td>0</td><td>8</td><td>0x3</td><td>3</td><td>12 bits</td><td>0</td></tr><tr><td>16</td><td>0x4</td><td>16</td><td>0</td><td>16</td><td>0x4</td><td>4</td><td>12 bits</td><td>0</td></tr><tr><td>32</td><td>0x5</td><td>17</td><td>1</td><td>16</td><td>0x4</td><td>5</td><td>12 bits</td><td>2</td></tr><tr><td>64</td><td>0x6</td><td>18</td><td>2</td><td>16</td><td>0x4</td><td>6</td><td>12 bits</td><td>4</td></tr><tr><td>128</td><td>0x7</td><td>19</td><td>3</td><td>16</td><td>0x4</td><td>7</td><td>12 bits</td><td>8</td></tr><tr><td>256</td><td>0x8</td><td>20</td><td>4</td><td>16</td><td>0x4</td><td>8</td><td>12 bits</td><td>16</td></tr><tr><td>512</td><td>0x9</td><td>21</td><td>5</td><td>16</td><td>0x4</td><td>9</td><td>12 bits</td><td>32</td></tr><tr><td>1024</td><td>0xA</td><td>22</td><td>6</td><td>16</td><td>0x4</td><td>10</td><td>12 bits</td><td>64</td></tr><tr><td>Reserved</td><td>0xB -0xF</td><td></td><td></td><td></td><td>0x0</td><td></td><td>12 bits</td><td>0</td></tr></table>

## 31.6.8 Oversampling and Decimation

By using oversampling and decimation, the ADC resolution can be increased from 12 bits to up to 16 bits. To increase the resolution by n bits, 4<sup>n</sup> samples must be accumulated. The result must then be shifted right by n bits. This right shift is a combination of the automatic right shift and the value written to AVGCTRL.ADJRES. To obtain the correct resolution, the ADJRES must be configured as described in the table below. This method will result in n bit extra LSB resolution.

Table 31-4. Configuration Required for Oversampling and Decimation

<table><tr><td>Result Resolution</td><td>Number of Samples to Average</td><td>AVGCTRL.SAMPLENUM[3:0]</td><td>Number of Automatic Right Shifts</td><td>AVGCTRL.ADJRES[2:0]</td></tr><tr><td>13 bits</td><td> $4^{1} = 4$ </td><td>0x2</td><td>0</td><td>0x1</td></tr><tr><td>14 bits</td><td> $4^{2} = 16$ </td><td>0x4</td><td>0</td><td>0x2</td></tr><tr><td>15 bits</td><td> $4^{3} = 64$ </td><td>0x6</td><td>2</td><td>0x1</td></tr><tr><td>16 bits</td><td> $4^{4} = 256$ </td><td>0x8</td><td>4</td><td>0x0</td></tr></table>

## 31.6.9 Window Monitor

The window monitor allows the conversion result to be compared to some predefined threshold values. Supported modes are selected by writing the Window Monitor Mode bit group in the Window Monitor Control register (WINCTRL.WINMODE[2:0]). Thresholds are given by writing the Window Monitor Lower Threshold register (WINLT) and Window Monitor Upper Threshold register (WINUT).

If differential input is selected, the WINLT and WINUT are evaluated as signed values. Otherwise they are evaluated as unsigned values.

Another important point is that the significant WINLT and WINUT bits are given by the precision selected in the Conversion Result Resolution bit group in the Control B register (CTRLB.RESSEL). This means that if 8-bit mode is selected, only the eight lower bits will be considered. In addition, in differential mode, the eighth bit will be considered as the sign bit even if the ninth bit is zero.

The INTFLAG.WINMON interrupt flag will be set if the conversion result matches the window monitor condition.

## 31.6.10 Offset and Gain Correction

Inherent gain and offset errors affect the absolute accuracy of the ADC. The offset error is defined as the deviation of the actual ADC’s transfer function from an ideal straight line at zero input voltage. The offset error cancellation is handled by the Offset Correction register (OFFSETCORR). The offset correction value is subtracted from the converted data before writing the Result register (RESULT). The gain error is defined as the deviation of the last output step’s midpoint from the ideal straight line, after compensating for offset error. The gain error cancellation is handled by the Gain Correction register (GAINCORR). To correct these two errors, the Digital Correction Logic Enabled bit in the Control B register (CTRLB.CORREN) must be written to one.

Offset and gain error compensation results are both calculated according to:

Result Conversion value OFFSETCORR = ( ) – ⋅ GAINCORR

In single conversion, a latency of 13 GCLK\_ADC is added to the availability of the final result. Since the correction time is always less than the propagation delay, this latency appears in free-running mode only during the first conversion. After that, a new conversion will be initialized when a conversion completes. All other conversion results are available at the defined sampling rate.

Figure 31-8. ADC Timing Correction Enabled  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_04_ec235fb84e51c9220848539f65905a9162b2f0cdb64b21faad7d941cb2c50c52.jpg)

## 31.6.11 DMA, Interrupts and Events

Table 31-5. Module Request for ADC

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Result Ready</td><td>x</td><td>x</td><td></td><td>x</td><td>When result register is read</td></tr><tr><td>Overrun</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Window Monitor</td><td>x</td><td>x</td><td></td><td></td><td></td></tr><tr><td>Synchronization Ready</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Start Conversion</td><td></td><td></td><td>x</td><td></td><td></td></tr><tr><td>ADC Flush</td><td></td><td></td><td>x</td><td></td><td></td></tr></table>

## 31.6.11.1 DMA Operation

The ADC generates the following DMA request:

z Result Conversion Ready (RESRDY): the request is set when a conversion result is available and cleared when the RESULT register is read. When the averaging operation is enabled, the DMA request is set when the averaging is completed and result is available.

## 31.6.11.2 Interrupts

The ADC has the following interrupt sources:

Result Conversion Ready: RESRDY. This is an asynchronous interrupt and can be used to wake-up the device from any sleep mode.

z Overrun: OVERRUN

z Window Monitor: WINMON. This is an asynchronous interrupt and can be used to wake-up the device from any sleep mode

Synchronization Ready: SYNCRDY. This is an asynchronous interrupt and can be used to wake-up the device from any sleep mode.

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR) register. An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the peripheral is reset. An interrupt flag is cleared by writing a one to the corresponding bit in the INTFLAG register. Each peripheral can have one interrupt request line per interrupt source or one common interrupt request line for all the interrupt sources. This is device dependent.

Refer to “Nested Vector Interrupt Controller” on page 26 for details. If the peripheral has one common interrupt request line for all the interrupt sources, the user must read the INTFLAG register to determine which interrupt condition is present.

## 31.6.11.3 Events

The peripheral can generate the following output events:

● Result Ready (RESRDY)

Window Monitor (WINMON)

Output events must be enabled to be generated. Writing a one to an Event Output bit in the Event Control register (EVCTRL.xxEO) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event. The events must be correctly routed in the Event System. Refer to “EVSYS – Event System” on page 405 for details.

The peripheral can take the following actions on an input event:

z ADC start conversion (START)

z ADC conversion flush (FLUSH)

Input events must be enabled for the corresponding action to be taken on any input event. Writing a one to an Event Input bit in the Event Control register (EVCTRL.xxEI) enables the corresponding action on the input event. Writing a zero to this bit disables the corresponding action on the input event. Note that if several events are connected to the peripheral, the enabled action will be taken on any of the incoming events. The events must be correctly routed in the Event System. Refer to “EVSYS – Event System” on page 405 for details.

## 31.6.12 Sleep Mode Operation

The Run in Standby bit in the Control A register (CTRLA.RUNSTDBY) controls the behavior of the ADC during standby sleep mode. When the bit is zero, the ADC is disabled during sleep, but maintains its current configuration. When

the bit is one, the ADC continues to operate during sleep. Note that when RUNSTDBY is zero, the analog blocks are powered off for the lowest power consumption. This necessitates a start-up time delay when the system returns from sleep.

When RUNSTDBY is one, any enabled ADC interrupt source can wake up the CPU. While the CPU is sleeping, ADC conversion can only be triggered by events.

## 31.6.13 Synchronization

Due to the asynchronicity between CLK\_ADC\_APB and GCLK\_ADC, some registers must be synchronized when accessed. A register can require:

Synchronization when written

z Synchronization when read

z Synchronization when written and read

● No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete. The Synchronization Ready interrupt can be used to signal when synchronization is complete.

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following bits need synchronization when written:

z Software Reset bit in the Control A register (CTRLA.SWRST)

● Enable bit in the Control A register (CTRLA.ENABLE)

The following registers need synchronization when written:

z Control B (CTRLB)

z Software Trigger (SWTRIG)

Window Monitor Control (WINCTRL)

z Input Control (INPUTCTRL)

● Window Upper/Lower Threshold (WINUT/WINLT)

Write-synchronization is denoted by the Write-Synchronized property in the register description.

The following registers need synchronization when read:

z Software Trigger (SWTRIG)

z Input Control (INPUTCTRL)

z Result (RESULT)

Read-synchronization is denoted by the Read-Synchronized property in the register description.

## 31.7 Register Summary

Table 31-6. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td>CTRLA</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>RUNSTDBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>REFCTRL</td><td>7:0</td><td>REFCOMP</td><td></td><td></td><td></td><td colspan="4">REFSEL[3:0]</td></tr><tr><td>0x02</td><td>AVGCTRL</td><td>7:0</td><td></td><td colspan="3">ADJRES[2:0]</td><td colspan="4">SAMPLENUM[3:0]</td></tr><tr><td>0x03</td><td>SAMPCTRL</td><td>7:0</td><td></td><td></td><td colspan="6">SAMPLEN[5:0]</td></tr><tr><td>0x04</td><td rowspan="2">CTRLB</td><td>7:0</td><td></td><td></td><td colspan="2">RESSEL[1:0]</td><td>CORREN</td><td>FREERUN</td><td>LEFTADJ</td><td>DIFFMODE</td></tr><tr><td>0x05</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>0x06</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>WINCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">WINMODE[2:0]</td></tr><tr><td>0x09 ... 0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>SWTRIG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>START</td><td>FLUSH</td></tr><tr><td>0x0D ... 0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">INPUTCTRL</td><td>7:0</td><td></td><td></td><td></td><td colspan="5">MUXPOS[4:0]</td></tr><tr><td>0x11</td><td>15:8</td><td></td><td></td><td></td><td colspan="5">MUXNEG[4:0]</td></tr><tr><td>0x12</td><td>23:16</td><td colspan="4">INPUTOFFSET[3:0]</td><td colspan="4">INPUTSCAN[3:0]</td></tr><tr><td>0x13</td><td>31:24</td><td></td><td></td><td></td><td></td><td colspan="4">GAIN[3:0]</td></tr><tr><td>0x14</td><td>EVCTRL</td><td>7:0</td><td></td><td></td><td>WINMONEO</td><td>RESRDYEO</td><td></td><td></td><td>SYNCEI</td><td>STARTEI</td></tr><tr><td>0x15</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x16</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>WINMON</td><td>OVERRUN</td><td>RESRDY</td></tr><tr><td>0x17</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>WINMON</td><td>OVERRUN</td><td>RESRDY</td></tr><tr><td>0x18</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>WINMON</td><td>OVERRUN</td><td>RESRDY</td></tr><tr><td>0x19</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1A</td><td rowspan="2">RESULT</td><td>7:0</td><td colspan="8">RESULT[7:0]</td></tr><tr><td>0x1B</td><td>15:8</td><td colspan="8">RESULT[15:8]</td></tr><tr><td>0x1C</td><td rowspan="2">WINLT</td><td>7:0</td><td colspan="8">WINLT[7:0]</td></tr><tr><td>0x1D</td><td>15:8</td><td colspan="8">WINLT[15:8]</td></tr><tr><td>0x1E</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td rowspan="2">WINUT</td><td>7:0</td><td colspan="8">WINUT[7:0]</td></tr><tr><td>0x21</td><td>15:8</td><td colspan="8">WINUT[15:8]</td></tr><tr><td>0x22</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x23</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x24</td><td rowspan="2">GAINCORR</td><td>7:0</td><td colspan="8">GAINCORR[7:0]</td></tr><tr><td>0x25</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">GAINCORR[11:8]</td></tr><tr><td>0x26</td><td rowspan="2">OFFSETCORR</td><td>7:0</td><td colspan="8">OFFSETCORR[7:0]</td></tr><tr><td>0x27</td><td>15:8</td><td></td><td></td><td></td><td></td><td colspan="4">OFFSETCORR[11:8]</td></tr><tr><td>0x28</td><td rowspan="2">CALIB</td><td>7:0</td><td colspan="8">LINEARITY_CAL[7:0]</td></tr><tr><td>0x29</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">BIAS_CAL[2:0]</td></tr><tr><td>0x2A</td><td>DBGCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr></table>

## 31.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 770 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Refer to “Synchronization” on page 780 for details.

Some registers are enable-protected, meaning they can be written only when the ADC is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 31.8.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>RUNSTDBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 2 – RUNSTDBY: Run in Standby

This bit indicates whether the ADC will continue running in standby sleep mode or not:

0: The ADC is halted during standby sleep mode.

1: The ADC continues normal operation during standby sleep mode.

## z Bit 1 – ENABLE: Enable

0: The ADC is disabled.

1: The ADC is enabled.

Due to synchronization, there is a delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete.

## 0 Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the ADC, except DBGCTRL, to their initial state, and the ADC will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded.

Due to synchronization, there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

## 31.8.2 Reference Control

Name: REFCTRL

Offset: 0x01

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>REFCOMP</td><td></td><td></td><td></td><td colspan="4">REFSEL[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7 – REFCOMP: Reference Buffer Offset Compensation Enable

The accuracy of the gain stage can be increased by enabling the reference buffer offset compensation. This will decrease the input impedance and thus increase the start-up time of the reference.

0: Reference buffer offset compensation is disabled.

1: Reference buffer offset compensation is enabled.

z Bits 6:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 3:0 – REFSEL[3:0]: Reference Selection

These bits select the reference for the ADC according to Table 31-7.

Table 31-7. Reference Selection

<table><tr><td>REFSEL[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>INT1V</td><td>1.0V voltage reference</td></tr><tr><td>0x1</td><td>INTVCC0</td><td>1/1.48 VDDANA</td></tr><tr><td>0x2</td><td>INTVCC1</td><td>1/2 VDDANA (only for VDDANA &gt; 2.0V)</td></tr><tr><td>0x3</td><td>VREFA</td><td>External reference</td></tr><tr><td>0x4</td><td>VREFB</td><td>External reference</td></tr><tr><td>0x5-0xF</td><td></td><td>Reserved</td></tr></table>

## 31.8.3 Average Control

Name: AVGCTRL

Offset: 0x02

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td colspan="3">ADJRES[2:0]</td><td colspan="4">SAMPLENUM[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

z Bits 6:4 – ADJRES[2:0]: Adjusting Result / Division Coefficient These bits define the division coefficient in 2<sup>n</sup> steps.

z Bits 3:0 – SAMPLENUM[3:0]: Number of Samples to be Collected These bits define how many samples should be added together.The result will be available in the Result register (RESULT). Note: if the result width increases, CTRLB.RESSEL must be changed.

Table 31-8. Number of Samples to be Collected

<table><tr><td>SAMPLENUM[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>1</td><td>1 sample</td></tr><tr><td>0x1</td><td>2</td><td>2 samples</td></tr><tr><td>0x2</td><td>4</td><td>4 samples</td></tr><tr><td>0x3</td><td>8</td><td>8 samples</td></tr><tr><td>0x4</td><td>16</td><td>16 samples</td></tr><tr><td>0x5</td><td>32</td><td>32 samples</td></tr><tr><td>0x6</td><td>64</td><td>64 samples</td></tr><tr><td>0x7</td><td>128</td><td>128 samples</td></tr><tr><td>0x8</td><td>256</td><td>256 samples</td></tr><tr><td>0x9</td><td>512</td><td>512 samples</td></tr><tr><td>0xA</td><td>1024</td><td>1024 samples</td></tr><tr><td>0xB-0xF</td><td></td><td>Reserved</td></tr></table>

## 31.8.4 Sampling Time Control

Name: SAMPCTRL

Offset: 0x03

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="6">SAMPLEN[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 5:0 – SAMPLEN[5:0]: Sampling Time Length

These bits control the ADC sampling time in number of half CLK\_ADC cycles, depending of the prescaler value, thus controlling the ADC input impedance. Sampling time is set according to the equation:

$$
\text { Sampling   time } = (S A M P L E N + 1) \cdot \left(\frac {C L K _ {A D C}}{2}\right)
$$

## 31.8.5 Control B

Name: CTRLB

Offset: 0x04

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">PRESCALER[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="2">RESSEL[1:0]</td><td>CORREN</td><td>FREERUN</td><td>LEFTADJ</td><td>DIFFMODE</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 10:8 – PRESCALER[2:0]: Prescaler Configuration

These bits define the ADC clock relative to the peripheral clock according to Table 31-9. These bits can only be written while the ADC is disabled.

Table 31-9. Prescaler Configuration

<table><tr><td>PRESCALER[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DIV4</td><td>Peripheral clock divided by 4</td></tr><tr><td>0x1</td><td>DIV8</td><td>Peripheral clock divided by 8</td></tr><tr><td>0x2</td><td>DIV16</td><td>Peripheral clock divided by 16</td></tr><tr><td>0x3</td><td>DIV32</td><td>Peripheral clock divided by 32</td></tr><tr><td>0x4</td><td>DIV64</td><td>Peripheral clock divided by 64</td></tr><tr><td>0x5</td><td>DIV128</td><td>Peripheral clock divided by 128</td></tr><tr><td>0x6</td><td>DIV256</td><td>Peripheral clock divided by 256</td></tr><tr><td>0x7</td><td>DIV512</td><td>Peripheral clock divided by 512</td></tr></table>

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:4 – RESSEL[1:0]: Conversion Result Resolution

These bits define whether the ADC completes the conversion at 12-, 10- or 8-bit result resolution. These bits can be written only while the ADC is disabled.

Table 31-10. Conversion Result Resolution

<table><tr><td>RESSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>12BIT</td><td>12-bit result</td></tr><tr><td>0x1</td><td>16BIT</td><td>For averaging mode output</td></tr><tr><td>0x2</td><td>10BIT</td><td>10-bit result</td></tr><tr><td>0x3</td><td>8BIT</td><td>8-bit result</td></tr></table>

## z Bit 3 – CORREN: Digital Correction Logic Enabled

0: Disable the digital result correction.

1: Enable the digital result correction. The ADC conversion result in the RESULT register is then corrected for gain and offset based on the values in the GAINCAL and OFFSETCAL registers. Conversion time will be increased by X cycles according to the value in the Offset Correction Value bit group in the Offset Correction register.

This bit can be changed only while the ADC is disabled.

## ● Bit 2 – FREERUN: Free Running Mode

0: The ADC run is single conversion mode.

1: The ADC is in free running mode and a new conversion will be initiated when a previous conversion completes. This bit can be changed only while the ADC is disabled.

## ● Bit 1 – LEFTADJ: Left-Adjusted Result

0: The ADC conversion result is right-adjusted in the RESULT register.

1: The ADC conversion result is left-adjusted in the RESULT register. The high byte of the 12-bit result will be present in the upper part of the result register. Writing this bit to zero (default) will right-adjust the value in the RESULT register.

This bit can be changed only while the ADC is disabled.

## z Bit 0 – DIFFMODE: Differential Mode

0: The ADC is running in singled-ended mode.

1: The ADC is running in differential mode. In this mode, the voltage difference between the MUXPOS and MUX-NEG inputs will be converted by the ADC.

This bit can be changed only while the ADC is disabled.

## 31.8.6 Window Monitor Control

Name: WINCTRL

Offset: 0x08

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">WINMODE[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

Bits 2:0 – WINMODE[2:0]: Window Monitor Mode

These bits enable and define the window monitor mode. Table 31-11 shows the mode selections.

Table 31-11. Window Monitor Mode

<table><tr><td>WINMODE[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>DISABLE</td><td>No window mode (default)</td></tr><tr><td>0x1</td><td>MODE1</td><td>Mode 1: RESULT &gt; WINLT</td></tr><tr><td>0x2</td><td>MODE2</td><td>Mode 2: RESULT &lt; WINUT</td></tr><tr><td>0x3</td><td>MODE3</td><td>Mode 3: WINLT &lt; RESULT &lt; WINUT</td></tr><tr><td>0x4</td><td>MODE4</td><td>Mode 4: !(WINLT &lt; RESULT &lt; WINUT)</td></tr><tr><td>0x5-0x7</td><td></td><td>Reserved</td></tr></table>

## 31.8.7 Software Trigger

Name: SWTRIG

Offset: 0x0C

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>START</td><td>FLUSH</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – START: ADC Start Conversion

0: The ADC will not start a conversion.

1: The ADC will start a conversion. The bit is cleared by hardware when the conversion has started. Setting this bit when it is already set has no effect.

Writing this bit to zero will have no effect.

## z Bit 0 – FLUSH: ADC Conversion Flush

0: No flush action.

1: The ADC pipeline will be flushed. A flush will restart the ADC clock on the next peripheral clock edge, and all conversions in progress will be aborted and lost. This bit is cleared until the ADC has been flushed.

After the flush, the ADC will resume where it left off; i.e., if a conversion was pending, the ADC will start a new conversion.

Writing this bit to zero will have no effect.

## 31.8.8 Input Control

Name: INPUTCTRL

Offset: 0x10

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">GAIN[3:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td colspan="4">INPUTOFFSET[3:0]</td><td colspan="4">INPUTSCAN[3:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">MUXNEG[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td colspan="5">MUXPOS[4:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bits 31:28 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 27:24 – GAIN[3:0]: Gain Factor Selection

These bits set the gain factor of the ADC gain stage according to the values shown in Table 31-12.

Table 31-12. Gain Factor Selection

<table><tr><td>GAIN[3:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>1X</td><td>1x</td></tr><tr><td>0x1</td><td>2X</td><td>2x</td></tr><tr><td>0x2</td><td>4X</td><td>4x</td></tr><tr><td>0x3</td><td>8X</td><td>8x</td></tr><tr><td>0x4</td><td>16X</td><td>16x</td></tr><tr><td>0x5-0xe</td><td></td><td>Reserved</td></tr><tr><td>0xF</td><td>DIV2</td><td>1/2x</td></tr></table>

## ● Bits 23:20 – INPUTOFFSET[3:0]: Positive Mux Setting Offset

The pin scan is enabled when INPUTSCAN != 0. Writing these bits to a value other than zero causes the first conversion triggered to be converted using a positive input equal to MUXPOS + INPUTOFFSET. Setting this register to zero causes the first conversion to use a positive input equal to MUXPOS.

After a conversion, the INPUTOFFSET register will be incremented by one, causing the next conversion to be done with the positive input equal to MUXPOS + INPUTOFFSET. The sum of MUXPOS and INPUTOFFSET gives the input that is actually converted.

## z Bits 19:16 – INPUTSCAN[3:0]: Number of Input Channels Included in Scan

This register gives the number of input sources included in the pin scan. The number of input sources included is INPUTSCAN + 1. The input channels included are in the range from MUXPOS + INPUTOFFSET to MUXPOS + INPUTOFFSET + INPUTSCAN.

The range of the scan mode must not exceed the number of input channels available on the device.

## z Bits 15:13 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 12:8 – MUXNEG[4:0]: Negative Mux Input Selection

These bits define the Mux selection for the negative ADC input. Table 31-13 shows the possible input selections.

Table 31-13. Negative Mux Input Selection

<table><tr><td>MUXNEG[4:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x00</td><td>PIN0</td><td>ADC AIN0 pin</td></tr><tr><td>0x01</td><td>PIN1</td><td>ADC AIN1 pin</td></tr><tr><td>0x02</td><td>PIN2</td><td>ADC AIN2 pin</td></tr><tr><td>0x03</td><td>PIN3</td><td>ADC AIN3 pin</td></tr><tr><td>0x04</td><td>PIN4</td><td>ADC AIN4 pin</td></tr><tr><td>0x05</td><td>PIN5</td><td>ADC AIN5 pin</td></tr><tr><td>0x06</td><td>PIN6</td><td>ADC AIN6 pin</td></tr><tr><td>0x07</td><td>PIN7</td><td>ADC AIN7 pin</td></tr><tr><td>0x08 - 0x17</td><td></td><td>Reserved</td></tr><tr><td>0x18</td><td>GND</td><td>Internal ground</td></tr><tr><td>0x19</td><td>IOGND</td><td>I/O ground</td></tr><tr><td>0x1A - 0x1F</td><td></td><td>Reserved</td></tr></table>

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 4:0 – MUXPOS[4:0]: Positive Mux Input Selection

These bits define the Mux selection for the positive ADC input. Table 31-14 shows the possible input selections. If the internal bandgap voltage or temperature sensor input channel is selected, then the Sampling Time Length bit group in the Sampling Control register must be written with a corresponding value.

Table 31-14. Positive Mux Input Selection

<table><tr><td>MUXPOS[4:0]</td><td>Group configuration</td><td>Description</td></tr><tr><td>0x00</td><td>PIN0</td><td>ADC AIN0 pin</td></tr><tr><td>0x01</td><td>PIN1</td><td>ADC AIN1 pin</td></tr><tr><td>0x02</td><td>PIN2</td><td>ADC AIN2 pin</td></tr><tr><td>0x03</td><td>PIN3</td><td>ADC AIN3 pin</td></tr><tr><td>0x04</td><td>PIN4</td><td>ADC AIN4 pin</td></tr><tr><td>0x05</td><td>PIN5</td><td>ADC AIN5 pin</td></tr><tr><td>0x06</td><td>PIN6</td><td>ADC AIN6 pin</td></tr><tr><td>0x07</td><td>PIN7</td><td>ADC AIN7 pin</td></tr><tr><td>0x08</td><td>PIN8</td><td>ADC AIN8 pin</td></tr><tr><td>0x09</td><td>PIN9</td><td>ADC AIN9 pin</td></tr><tr><td>0x0A-0x17</td><td></td><td>Reserved</td></tr><tr><td>0x18</td><td>TEMP</td><td>Temperature reference</td></tr><tr><td>0x19</td><td>BANDGAP</td><td>Bandgap voltage</td></tr><tr><td>0x1A</td><td>SCALEDCOREVCC</td><td>1/4 scaled core supply</td></tr><tr><td>0x1B</td><td>SCALEDIOVCC</td><td>1/4 scaled I/O supply</td></tr><tr><td>0x1C</td><td>DAC</td><td>DAC output</td></tr><tr><td>0x1D-0x1F</td><td></td><td>Reserved</td></tr></table>

## 31.8.9 Event Control

Name: EVCTRL

Offset: 0x14

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td>WINMONEO</td><td>RESRDYEO</td><td></td><td></td><td>SYNCEI</td><td>STARTEI</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 5 – WINMONEO: Window Monitor Event Out

This bit indicates whether the Window Monitor event output is enabled or not and an output event will be generated when the window monitor detects something.

0: Window Monitor event output is disabled and an event will not be generated.

1: Window Monitor event output is enabled and an event will be generated.

## z Bit 4 – RESRDYEO: Result Ready Event Out

This bit indicates whether the Result Ready event output is enabled or not and an output event will be generated when the conversion result is available.

0: Result Ready event output is disabled and an event will not be generated.

1: Result Ready event output is enabled and an event will be generated.

## z Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 1 – SYNCEI: Synchronization Event In

0: A flush and new conversion will not be triggered on any incoming event.

1: A flush and new conversion will be triggered on any incoming event.

## Bit 0 – STARTEI: Start Conversion Event In

0: A new conversion will not be triggered on any incoming event.

1: A new conversion will be triggered on any incoming event.

## 31.8.10 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x16

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>WINMON</td><td>OVERRUN</td><td>RESRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled, and an interrupt request will be generated when the Synchronization Ready interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready Interrupt Enable bit and the corresponding interrupt request.

## Bit 2 – WINMON: Window Monitor Interrupt Enable

0: The window monitor interrupt is disabled.

1: The window monitor interrupt is enabled, and an interrupt request will be generated when the Window Monitor interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Window Monitor Interrupt Enable bit and the corresponding interrupt request.

## Bit 1 – OVERRUN: Overrun Interrupt Enable

0: The Overrun interrupt is disabled.

1: The Overrun interrupt is enabled, and an interrupt request will be generated when the Overrun interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Overrun Interrupt Enable bit and the corresponding interrupt request.

## z Bit 0 – RESRDY: Result Ready Interrupt Enable

0: The Result Ready interrupt is disabled.

1: The Result Ready interrupt is enabled, and an interrupt request will be generated when the Result Ready interrupt flag is set.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Result Ready Interrupt Enable bit and the corresponding interrupt request.

## 31.8.11 Interrupt Enable Set

Name: INTENSET

Offset: 0x17

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>WINMON</td><td>OVERRUN</td><td>RESRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 3 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Synchronization Ready Interrupt Enable bit, which enables the Synchronization Ready interrupt.

## ● Bit 2 – WINMON: Window Monitor Interrupt Enable

0: The Window Monitor interrupt is disabled.

1: The Window Monitor interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Window Monitor Interrupt bit and enable the Window Monitor interrupt.

## ● Bit 1 – OVERRUN: Overrun Interrupt Enable

0: The Overrun interrupt is disabled.

1: The Overrun interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Overrun Interrupt bit and enable the Overrun interrupt.

## z Bit 0 – RESRDY: Result Ready Interrupt Enable

0: The Result Ready interrupt is disabled.

1: The Result Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Result Ready Interrupt bit and enable the Result Ready interrupt.

## 31.8.12 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x18

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>WINMON</td><td>OVERRUN</td><td>RESRDY</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:4 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 3 – SYNCRDY: Synchronization Ready

This flag is cleared by writing a one to the flag.

This flag is set on a one-to-zero transition of the Synchronization Busy bit in the Status register (STATUS.SYNC-BUSY), except when caused by an enable or software reset, and will generate an interrupt request if INTENCLR/SET.SYNCRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Synchronization Ready interrupt flag.

## z Bit 2 – WINMON: Window Monitor

This flag is cleared by writing a one to the flag or by reading the RESULT register.

This flag is set on the next GCLK\_ADC cycle after a match with the window monitor condition, and an interrupt request will be generated if INTENCLR/SET.WINMON is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Window Monitor interrupt flag.

## z Bit 1 – OVERRUN: Overrun

This flag is cleared by writing a one to the flag.

This flag is set if RESULT is written before the previous value has been read by CPU, and an interrupt request will be generated if INTENCLR/SET.OVERRUN is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Overrun interrupt flag.

## ● Bit 0 – RESRDY: Result Ready

This flag is cleared by writing a one to the flag or by reading the RESULT register.

This flag is set when the conversion result is available, and an interrupt will be generated if INTEN-CLR/SET.RESRDY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Result Ready interrupt flag.

## 31.8.13 Status

Name: STATUS

Offset: 0x19

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 31.8.14 Result

Name: RESULT

Offset: 0x1A

Reset: 0x0000

Access: Read-Only

Property: Read-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">RESULT[15:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">RESULT[7:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 15:0 – RESULT[15:0]: Result Conversion Value

These bits will hold up to a 16-bit ADC result, depending on the configuration.

In single-ended without averaging mode, the ADC conversion will produce a 12-bit result, which can be left- or right-shifted, depending on the setting of CTRLB.LEFTADJ.

If the result is left-adjusted (CTRLB.LEFTADJ), the high byte of the result will be in bit position [15:8], while the remaining 4 bits of the result will be placed in bit locations [7:4]. This can be used only if an 8-bit result is required; i.e., one can read only the high byte of the entire 16-bit register.

If the result is not left-adjusted (CTRLB.LEFTADJ) and no oversampling is used, the result will be available in bit locations [11:0], and the result is then 12 bits long.

If oversampling is used, the result will be located in bit locations [15:0], depending on the settings of the Average Control register (AVGCTRL).

## 31.8.15 Window Monitor Lower Threshold

Name: WINLT

Offset: 0x1C

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">WINLT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">WINLT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – WINLT[15:0]: Window Lower Threshold If the window monitor is enabled, these bits define the lower threshold value.

## 31.8.16 Window Monitor Upper Threshold

Name: WINUT

Offset: 0x20

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">WINUT[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">WINUT[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – WINUT[15:0]: Window Upper Threshold If the window monitor is enabled, these bits define the upper threshold value.

## 31.8.17 Gain Correction

Name: GAINCORR

Offset: 0x24

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td colspan="4">GAINCORR[11:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">GAINCORR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 11:0 – GAINCORR[11:0]: Gain Correction Value

If the CTRLB.CORREN bit is one, these bits define how the ADC conversion result is compensated for gain error before being written to the result register. The gaincorrection is a fractional value, a 1-bit integer plusan 11-bit fraction, and therefore 1/2 <= GAINCORR < 2. GAINCORR values range from 0.10000000000 to 1.11111111111.

## 31.8.18 Offset Correction

Name: OFFSETCORR

Offset: 0x26

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">OFFSETCORR[11:8]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">OFFSETCORR[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:12 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 11:0 – OFFSETCORR[11:0]: Offset Correction Value

If the CTRLB.CORREN bit is one, these bits define how the ADC conversion result is compensated for offset error before being written to the Result register. This OFFSETCORR value is in two's complement format.

## 31.8.19 Calibration

Name: CALIB

Offset: 0x28

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">BIAS_CAL[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">LINEARITY_CAL[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:11 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 10:8 – BIAS\_CAL[2:0]: Bias Calibration Value

This value from production test must be loaded from the NVM software calibration area into the CALIB register by software to achieve the specified accuracy.

The value must be copied only, and must not be changed.

## z Bits 7:0 – LINEARITY\_CAL[7:0]: Linearity Calibration Value

This value from production test must be loaded from the NVM software calibration area into the CALIB register by software to achieve the specified accuracy.

The value must be copied only, and must not be changed.

## 31.8.20 Debug Control

Name: DBGCTRL

Offset: 0x2A

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>DBGRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:1 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 0 – DBGRUN: Debug Run

0: The ADC is halted during debug mode.

1: The ADC continues normal operation during debug mode.

This bit can be changed only while the ADC is disabled.

This bit should be written only while a conversion is not ongoing.

## 32. AC – Analog Comparators

## 32.1 Overview

The Analog Comparator (AC) supports two individual comparators. Each comparator (COMP) compares the voltage levels on two inputs, and provides a digital output based on this comparison. Each comparator may be configured to generate interrupt requests and/or peripheral events upon several different combinations of input change.

Hysteresis and propagation delay are two important properties of the comparators; dynamic behavior. Both parameters may be adjusted to achieve the optimal operation for each application.

The input selection includes four shared analog port pins and several internal signals. Each comparator output state can also be output on a pin for use by external devices.

The comparators are always grouped in pairs on each port. The AC module may implement one pair. These are called Comparator 0 (COMP0) and Comparator 1 (COMP1). They have identical behaviors, but separate control registers. The pair can be set in window mode to compare a signal to a voltage range instead of a single voltage level.

## 32.2 Features

z Two individual comparators

z Selectable propagation delay versus current consumption

z Selectable hysteresis

z On/Off

z Analog comparator outputs available on pins

z Asynchronous or synchronous

z Flexible input selection

z Four pins selectable for positive or negative inputs

z Ground (for zero crossing)

z Bandgap reference voltage

z 64-level programmable $\mathsf { V } _ { \mathsf { D D A N A } }$ scaler per comparator

z DAC

z Interrupt generation on:

z Rising or falling edge

z Toggle

z End of comparison

z Window function interrupt generation on:

z Signal above window

z Signal inside window

z Signal below window

z Signal outside window

z Event generation on:

z Comparator output

z Window function inside/outside window

z Optional digital filter on comparator output

z Low-power option

z Single-shot support

## 32.3 Block Diagram

Figure 32-1. Analog Comparator Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_790e039678c7232e7413af7dfbd1f3811bc43d98186b7feab15f69da0c8f48e6.jpg)

32.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>AIN[3..0]</td><td>Analog input</td><td>Comparator inputs</td></tr><tr><td>CMP[1..0]</td><td>Digital output</td><td>Comparator outputs</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 32.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 32.5.1 I/O Lines

Using the AC’s I/O lines requires the I/O pins to be configured. Refer to the PORT chapter for details.

Refer to “PORT” on page 378 for details.

## 32.5.2 Power Management

The AC will continue to operate in any sleep mode where the selected source clock is running. The AC’s interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 32.5.3 Clocks

The AC bus clock (CLK\_AC\_APB) can be enabled and disabled in the Power Manager, and the default state of the CLK\_AC\_APB can be found in the Peripheral Clock Masking section of “PM – Power Manager” on page 110.

Two generic clocks (GCLK\_AC\_DIG and GCLK\_AC\_ANA) are used by the AC. The digital clock (GCLK\_AC\_DIG) is required to provide the sampling rate for the comparators, while the analog clock (GCLK\_AC\_ANA) is required for low-voltage operation $( \mathsf { V } _ { \mathsf { D D A N A } } < 2 . 5 \mathsf { V } )$ to ensure that the resistance of the analog input multiplexors remains low. These clocks must be configured and enabled in the Generic Clock Controller before using the peripheral.

Refer to “GCLK – Generic Clock Controller” on page 88 for details.

These generic clocks are asynchronous to the CLK\_AC\_APB clock. Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 818 for furthe details.

## 32.5.4 DMA

Not applicable.

## 32.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the AC interrupts requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 32.5.6 Events

The events are connected to the Event System. Using the events requires the Event System to be configured first. Refer to “EVSYS – Event System” on page 405 for details.

## 32.5.7 Debug Operation

When the CPU is halted in debug mode, the peripheral continues normal operation. If the peripheral is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

## 32.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following registers:

Control B register (CTRLB)

● Interrupt Flag register (INTFLAG)

Write-protection is denoted by the Write-Protected property in the register description.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 32.5.9 Analog Connections

Each comparator has up to four I/O pins that can be used as analog inputs. Each pair of comparators shares the same four pins. These pins must be configured for analog operation before using them as comparator inputs.

Any internal reference source, such as a bandgap reference voltage or the DAC, must be configured and enabled prior to its use as a comparator input.

## 32.5.10 Other Dependencies

Not applicable.

## 32.6 Functional Description

## 32.6.1 Principle of Operation

Each comparator has one positive input and one negative input. Each positive input may be chosen from a selection of analog input pins. Each negative input may be chosen from a selection of analog input pins or internal inputs, such as a bandgap reference voltage. The digital output from the comparator is one when the difference between the positive and the negative input voltage is positive, and zero otherwise.

The individual comparators can be used independently (normal mode) or grouped in pairs to generate a window comparison (window mode)

## 32.6.2 Basic Operation

## 32.6.2.1 Initialization

Before enabling the AC, the input and output events must be configured in the Event Control register (EVCTRL). These settings cannot be changed while the AC is enabled.

Each individual comparator must also be configured by its respective Comparator Control register (COMPCTRL0) before that comparator is enabled. These settings cannot be changed while the comparator is enabled.

Select the desired measurement mode with COMPCTRLx.SINGLE. See “Starting a Comparison” on page 810 for more details

Select the desired hysteresis with COMPCTRLx.HYST. See “Input Hysteresis” on page 814 for more details

Select the comparator speed versus power with COMPCTRLx.SPEED. See “Propagation Delay vs. Power Consumption” on page 814 for more details

z Select the interrupt source with COMPCTRLx.INTSEL

z Select the positive and negative input sources with the COMPCTRLx.MUXPOS and

z Select the filtering option with COMPCTRLx.FLEN

## 32.6.2.2 Enabling, Disabling and Resetting

The AC is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The individual comparators must be also enabled by writing a one to the Enable bit in the Comparator x Control registers (COMPCTRLx.ENABLE). The AC is disabled by writing a zero to CTRLA.ENABLE. This will also disable the individual comparators, but will not clear their COMPCTRLx.ENABLE bits

The AC is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the AC, except DEBUG, will be reset to their initial state, and the AC will be disabled. Refer to the CTRLA register for details.

## 32.6.2.3 Starting a Comparison

Each comparator channel can be in one of two different measurement modes, determined by the Single bit in the Comparator x Control register (COMPCTRLx.SINGLE):

z Continuous measurement

z Single-shot

After being enabled, a start-up delay is required before the result of the comparison is ready. This start-up time is measured automatically to account for environmental changes, such as temperature or voltage supply level, and is specified in “Electrical Characteristics” on page 858.

During the start-up time, the COMP output is not available. If the supply voltage is below 2.5V, the start-up time is also dependent on the voltage doubler. If the supply voltage is guaranteed to be above 2.5V, the voltage doubler can be disabled by writing the Low-Power Mux bit in the Control A register (CTRLA.LPMUX) to one.

The comparator can be configured to generate interrupts when the output toggles, when the output changes from zero to one (rising edge), when the output changes from one to zero (falling edge) or at the end of the comparison. An endof-comparison interrupt can be used with the single-shot mode to chain further events in the system, regardless of the state of the comparator outputs. The interrupt mode is set by the Interrupt Selection bit group in the Comparator Control register (COMPCTRLx.INTSEL). Events are generated using the comparator output state, regardless of whether the interrupt is enabled or not.

## Continuous Measurement

Continuous measurement is selected by writing COMPCTRLx.SINGLE to zero. In continuous mode, the comparator is continuously enabled and performing comparisons. This ensures that the result of the latest comparison is always available in the Current State bit in the Status A register (STATUSA.STATEx). After the start-up time has passed, a comparison is done and STATUSA is updated. The Comparator x Ready bit in the Status B register (STATUSB.READYx) is set, and the appropriate peripheral events and interrupts are also generated. New comparisons are performed continuously until the COMPCTRLx.ENABLE bit is written to zero. The start-up time applies only to the first comparison.

In continuous operation, edge detection of the comparator output for interrupts is done by comparing the current and previous sample. The sampling rate is the GCLK\_AC\_DIG frequency. An example of continuous measurement is shown in Figure 32-2.

Figure 32-2. Continuous Measurement Example  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_9149b229f20703b3f0568e4c63edf07075fbbe9473c436faf9127eb94ee5133b.jpg)

For low-power operation, comparisons can be performed during sleep modes without a clock. The comparator is enabled continuously, and changes in the state of the comparator are detected asynchronously. When a toggle occurs, the Power Manager will start GCLK\_AC\_DIG to register the appropriate peripheral events and interrupts. The GCLK\_AC\_DIG clock is then disabled again automatically, unless configured to wake up the system from sleep.

## Single-Shot

Single-shot operation is selected by writing COMPCTRLx.SINGLE to one. During single-shot operation, the comparator is normally idle. The user starts a single comparison by writing a one to the respective Start Comparison bit in the write-only Control B register (CTRLB.STARTx). The comparator is enabled, and after the start-up time has passed, a single comparison is done and STATUSA is updated. Appropriate peripheral events and interrupts are also generated. No new comparisons will be performed.

Writing a one to CTRLB.STARTx also clears the Comparator x Ready bit in the Status B register

(STATUSB.READYx). STATUSB.READYx is set automatically by hardware when the single comparison has completed. To remove the need for polling, an additional means of starting the comparison is also available. A read of the Status C register (STATUSC) will start a comparison on all comparators currently configured for single-shot operation. The read will stall the bus until all enabled comparators are ready. If a comparator is already busy with a comparison, the read will stall until the current comparison is compete, and a new comparison will not be started.

A single-shot measurement can also be triggered by the Event System. Writing a one to the Comparator x Event Input bit in the Event Control Register (EVCTRL.COMPEIx) enables triggering on incoming peripheral events. Each comparator can be triggered independently by separate events. Event-triggered operation is similar to user-triggered operation; the difference is that a peripheral event from another hardware module causes the hardware to automatically start the comparison and clear STATUSB.READYx.

To detect an edge of the comparator output in single-shot operation for the purpose of interrupts, the result of the current measurement is compared with the result of the previous measurement (one sampling period earlier). An example of single-shot operation is shown in Figure 32-3.

Figure 32-3. Single-Shot Example  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_43a813551d608fab275fa002d663cc8336d0918f37ee5351d28188a6ad45bc09.jpg)

For low-power operation, event-triggered measurements can be performed during sleep modes. When the event occurs, the Power Manager will start GCLK\_AC\_DIG. The comparator is enabled, and after the startup time has passed, a comparison is done and appropriate peripheral events and interrupts are also generated. The comparator and GCLK\_AC\_DIG are then disabled again automatically, unless configured to wake up the system from sleep.

## 32.6.3 Selecting Comparator Inputs

Each comparator has one positive and one negative input. The positive input is fed from an external input pin (AINx). The negative input can be fed either from an external input pin (AINx) or from one of the several internal reference voltage sources common to all comparators. The user selects the input source as follows:

The positive input is selected by the Positive Input MUX Select bit group in the Comparator Control register (COMPCTRLx.MUXPOS)

z The negative input is selected by the Negative Input MUX Select bit group in the Comparator Control register (COMPCTRLx.MUXNEG)

In the case of using an external I/O pin, the selected pin must be configured for analog usage in the PORT Controller by disabling the digital input and output. The switching of the analog input multiplexors is controlled to minimize crosstalk between the channels. The input selection must be changed only while the individual comparator is disabled.

## 32.6.4 Window Operation

Each comparator pair can be configured to work together in window mode. In this mode, a voltage range is defined, and the comparators give information about whether an input signal is within this range or not. Window mode is enabled by the Window Enable x bit in the Window Control register (WINCTRL.WENx). Both comparators in a pair must have the same measurement mode setting in their respective Comparator Control Registers (COMPCTRLx.SINGLE).

To physically configure the pair of comparators for window mode, the same I/O pin should be chosen for each comparator’s positive input to create the shared input signal. The negative inputs define the range for the window. In Figure 32-4, COMP0 defines the upper limit and COMP1 defines the lower limit of the window, as shown but the window will also work in the opposite configuration with COMP0 lower and COMP1 higher. The current state of the window function is available in the Window x State bit group of the Status register (STATUS.WSTATEx).

Window mode can be configured to generate interrupts when the input voltage changes to below the window, when the input voltage changes to above the window, when the input voltage changes into the window or when the input voltage changes outside the window. The interrupt selections are set by the Window Interrupt Selection bit group in the Window Control register (WINCTRL.WINTSELx[1:0]). Events are generated using the inside/outside state of the window, regardless of whether the interrupt is enabled or not. Note that the individual comparator outputs, interrupts and events continue to function normally during window mode.

When the comparators are configured for window mode and single-shot mode, measurements are performed simultaneously on both comparators. Writing a one to either Start Comparison bit in the Control B register (CTRLB.STARTx) starts a measurement. Likewise either peripheral event can start a measurement.

Figure 32-4. Comparators in Window Mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_a5954588d645130940c486b279be894ab9ca5907f8169191484beb1e6eec2069.jpg)

## 32.6.5 Voltage Doubler

The AC contains a voltage doubler that can reduce the resistance of the analog multiplexors when the supply voltage is below 2.5V. The voltage doubler is normally switched on/off automatically based on the supply level. When enabling the comparators, additional start-up time is required for the voltage doubler to settle. If the supply voltage is guaranteed to be above 2.5V, the voltage doubler can be disabled by writing the Low-Power Mux bit in the Control A register (CTRLA.LPMUX) to one. Disabling the voltage doubler saves power and reduces the start-up time.

## 32.6.6 $\mathsf { \pmb { v } } _ { \mathsf { D D A N A } }$ Scaler

The $\mathsf { V } _ { \mathsf { D D A N A } }$ scaler generates a reference voltage that is a fraction of the device’s supply voltage, with 64 levels. One independent voltage channel is dedicated for each comparator. The scaler is enabled when a comparator’s Negative Input Mux bit group in its Comparator Control register (COMPCTRLx.MUXNEG) is set to five and the comparator is enabled. The voltage of each channel is selected by the Value bit group in the Scaler x registers (SCALERx.VALUE[5:0]).

Figure 32-5. VDDANA Scaler  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_af348e58734bf7346185e04e752a32f430ecdb474be5ec472494ca5b21009ee5.jpg)

## 32.6.7 Input Hysteresis

Application software can selectively enable/disable hysteresis for the comparison. Applying hysteresis will help prevent constant toggling of the output, which can be caused by noise when the input signals are close to each other. Hysteresis is enabled for each comparator individually by the Hysteresis Mode bit in the Comparator x Control register (COMPCTRLx.HYST). Hysteresis is available only in continuous mode (COMPCTRLx.SINGLE=0).

## 32.6.8 Propagation Delay vs. Power Consumption

It is possible to trade off comparison speed for power efficiency to get the shortest possible propagation delay or the lowest power consumption. The speed setting is configured for each comparator individually by the Speed bit group in the Comparator x Control register (COMPCTRLx.SPEED). The Speed bits select the amount of bias current provided to the comparator, and as such will also affect the start-up time.

## 32.6.9 Filtering

The output of the comparators can be digitally filtered to reduce noise using a simple digital filter. The filtering is determined by the Filter Length bits in the Comparator Control x register (COMPCTRLx.FLEN), and is independent for each comparator. Filtering is selectable from none, 3-bit majority (N=3) or 5-bit majority (N=5) functions. Any change in the comparator output is considered valid only if N/2+1 out of the last N samples agree. The filter sampling rate is the CLK\_AC frequency scaled by the prescaler setting in the Control A register (CTRLA.PRESCALER).

Note that filtering creates an additional delay of N-1 sampling cycles from when a comparison is started until the comparator output is validated. For continuous mode, the first valid output will occur when the required number of filter samples is taken. Subsequent outputs will be generated every cycle based on the current sample plus the previous N-1 samples, as shown in Figure 32-6. For single-shot mode, the comparison completes after the Nth filter sample, as shown in Figure 32-7.

Figure 32-6. Continuous Mode Filtering  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_06de2bf9b97846fd1fe736cfb7b305e76428e70044bd955a3cc2195dd68fb02f.jpg)

Figure 32-7. Single-Shot Filtering  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_44a178ae0afaac30e97b5db684e4c77959b586475e1e6d6eec085b3cadd2d75d.jpg)  
During sleep modes, filtering is supported only for single-shot measurements. Filtering must be disabled if continuous measurements will be done during sleep modes, or the resulting interrupt/event may be generated incorrectly.

## 32.6.10 Comparator Output

The output of each comparator can be routed to an I/O pin by setting the Output bit group in the Comparator Control x register (COMPCTRLx.OUT). This allows the comparator to be used by external circuitry. Either the raw, nonsynchronized output of the comparator or the CLK\_AC-synchronized version, including filtering, can be used as the I/O signal source. The output appears on the corresponding CMP[x] pin.

## 32.6.11 Offset Compensation

The Swap bit in the Comparator Control registers (COMPCTRLx.SWAP) controls switching of the input signals to a comparator's positive and negative terminals. When the comparator terminals are swapped, the output signal from the comparator is also inverted, as shown in Figure 32-8. This allows the user to measure or compensate for the comparator input offset voltage. As part of the input selection, COMPCTRLx.SWAP can be changed only while the comparator is disabled.

Figure 32-8. Input Swapping for Offset Compensation  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_a513efc488052fc38a35ab05c027b0415b9db4138447fad85268804651ad73b6.jpg)

## 32.7 Additional Features

## 32.7.1 DMA Operation

Not applicable.

## 32.7.2 Interrupts

The peripheral has the following interrupt sources:

z Comparator: COMP0, COMP1(INTENCLR, INTSET, INTFLAG)

z Window: WIN0(INTENCLR, INTSET, INTFLAG)

Comparator interrupts are generated based on the conditions selected by the Interrupt Selection bit group in the Comparator Control registers (COMPCTRLx.INTSEL). Window interrupts are generated based on the conditions selected by the Window Interrupt Selection bit group in the Window Control register (WINCTRL.WINTSEL[1:0]).

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the peripheral is reset. An interrupt flag is cleared by writing a one to the corresponding bit in the INTFLAG register.

Each peripheral can have one interrupt request line per interrupt source or one common interrupt request line for all the interrupt sources. If the peripheral has one common interrupt request line for all the interrupt sources, the user must read the INTFLAG register to determine which interrupt condition is present

For details on clearing interrupt flags, refer to the INTFLAG register description.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 32.7.3 Events

The peripheral can generate the following output events:

z Comparator: COMPEO0, COMPEO1(EVCTRL)

z Window: WINEO0(EVCTRL)

Output events must be enabled to be generated. Writing a one to an Event Output bit in the Event Control register (EVCTRL.COMPEOx) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event. The events must be correctly routed in the Event System. Refer to “EVSYS – Event System” on page 405 for details.

The peripheral can take the following actions on an input event:

z Single-shot measurement

z Single-shot measurement in window mode

Input events must be enabled for the corresponding action to be taken on any input event. Writing a one to an Event Input bit in the Event Control register (EVCTRL.COMPEIx) enables the corresponding action on input event. Writing a zero to a bit disables the corresponding action on input event. Note that if several events are connected to the peripheral, the enabled action will be taken on any of the incoming events. The events must be correctly routed in the Event System. Refer to “EVSYS – Event System” on page 405 for details.

When EVCTRL.COMPEIx is one, the event will start a comparison on COMPx after the start-up time delay. In normal mode, each comparator responds to its corresponding input event independently. For a pair of comparators in window mode, either comparator event will trigger a comparison on both comparators simultaneously.

## 32.7.4 Sleep Mode Operation

The Run in Standby bit in the Control A register (CTRLA.RUNSTDBY) controls the behavior of the AC during standby sleep mode. When the bit is zero, the comparator pair is disabled during sleep, but maintains its current configuration. When the bit is one, the comparator pair continues to operate during sleep. Note that when RUNSTDBY is zero, the analog blocks are powered off for the lowest power consumption. This necessitates a start-up time delay when the system returns from sleep.

When RUNSTDBY is one, any enabled AC interrupt source can wake up the CPU. While the CPU is sleeping, singleshot comparisons are only triggerable by events. The AC can also be used during sleep modes where the clock used by the AC is disabled, provided that the AC is still powered (not in shutdown). In this case, the behavior is slightly different and depends on the measurement mode, as listed in Table 32-1.

Table 32-1. Sleep Mode Operation

<table><tr><td>COMPCTRLx.MODE</td><td>RUNSTDBY=0</td><td>RUNSTDBY=1</td></tr><tr><td>0 (Continuous)</td><td>COMPx disabled</td><td>GCLK_AC_DIG stopped, COMPx enabled</td></tr><tr><td>1 (Single-shot)</td><td>COMPx disabled</td><td>GCLK_AC_DIG stopped, COMPx enabled only when triggered by an input event</td></tr></table>

## 32.7.4.1 Continuous Measurement during Sleep

When a comparator is enabled in continuous measurement mode and GCLK\_AC\_DIG is disabled during sleep, the comparator will remain continuously enabled and will function asynchronously. The current state of the comparator is asynchronously monitored for changes. If an edge matching the interrupt condition is found, GCLK\_AC\_DIG is started to register the interrupt condition and generate events. If the interrupt is enabled in the Interrupt Enable registers (INTENCLR/SET), the AC can wake up the device; otherwise GCLK\_AC\_DIG is disabled until the next edge detection. Filtering is not possible with this configuration.

Figure 32-9. Continuous Mode SleepWalking  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_d7377ae5bec415b09d496e78b2dd9c78ce603c69f6b74efb99be2783bb688c32.jpg)

## 32.7.4.2 Single-Shot Measurement during Sleep

For low-power operation, event-triggered measurements can be performed during sleep modes. When the event occurs, the Power Manager will start GCLK\_AC\_DIG. The comparator is enabled, and after the start-up time has passed, a comparison is done, with filtering if desired, and the appropriate peripheral events and interrupts are also generated, as shown in Figure 32-10 The comparator and GCLK\_AC\_DIG are then disabled again automatically, unless configured to wake the system from sleep. Filtering is allowed with this configuration.

Figure 32-10.Single-Shot SleepWalking  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_f2c8bbb54186b9bf566385321f404256ca1b09769bd3466bfde707fdd3d298ae.jpg)

## 32.7.5 Synchronization

Due to the asynchronicity between CLK\_MODULE\_APB and GCLK\_MODULE, some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

z No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete.

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following bits need synchronization when written:

z Software Reset bit in Control A register (CTRLA.SWRST)

z Enable bit in Control A register (CTRLA.ENABLE)

z Enable bit in Comparator Control register (COMPCTRLn.ENABLE)

The following register need synchronization when written:

z Window Control register (WINCTRL)

Refer to the Synchronization chapter for further details.

## 32.8 Register Summary

Table 32-2. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x00</td><td>CTRLA</td><td>7:0</td><td>LPMUX</td><td></td><td></td><td></td><td></td><td>RUNSTDBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x01</td><td>CTRLB</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>START1</td><td>START0</td></tr><tr><td>0x02</td><td rowspan="2">EVCTRL</td><td>7:0</td><td></td><td></td><td></td><td>WINEO0</td><td></td><td></td><td>COMPEO1</td><td>COMPEO0</td></tr><tr><td>0x03</td><td>15:8</td><td></td><td></td><td></td><td></td><td></td><td></td><td>COMPEI1</td><td>COMPEI0</td></tr><tr><td>0x04</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td>WIN0</td><td></td><td></td><td>COMP1</td><td>COMP0</td></tr><tr><td>0x05</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td></td><td>WIN0</td><td></td><td></td><td>COMP1</td><td>COMP0</td></tr><tr><td>0x06</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td>WIN0</td><td></td><td></td><td>COMP1</td><td>COMP0</td></tr><tr><td>0x07</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x08</td><td>STATUSA</td><td>7:0</td><td></td><td></td><td colspan="2">WSTATE0[1:0]</td><td></td><td></td><td>STATE1</td><td>STATE0</td></tr><tr><td>0x09</td><td>STATUSB</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td>READY1</td><td>READY0</td></tr><tr><td>0x0A</td><td>STATUSC</td><td>7:0</td><td></td><td></td><td colspan="2">WSTATE0[1:0]</td><td></td><td></td><td>STATE1</td><td>STATE0</td></tr><tr><td>0x0B</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0C</td><td>WINCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td colspan="2">WINTSELO[1:0]</td><td>WENO</td></tr><tr><td>0x0D ... 0x0F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x10</td><td rowspan="4">COMPCTRL0</td><td>7:0</td><td></td><td colspan="2">INTSEL[1:0]</td><td></td><td colspan="2">SPEED[1:0]</td><td>SINGLE</td><td>ENABLE</td></tr><tr><td>0x11</td><td>15:8</td><td>SWAP</td><td></td><td colspan="2">MUXPOS[1:0]</td><td></td><td colspan="3">MUXNEG[2:0]</td></tr><tr><td>0x12</td><td>23:16</td><td></td><td></td><td></td><td></td><td>HYST</td><td></td><td colspan="2">OUT[1:0]</td></tr><tr><td>0x13</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">FLEN[2:0]</td></tr><tr><td>0x14</td><td rowspan="4">COMPCTRL1</td><td>7:0</td><td></td><td colspan="2">INTSEL[1:0]</td><td></td><td colspan="2">SPEED[1:0]</td><td>SINGLE</td><td>ENABLE</td></tr><tr><td>0x15</td><td>15:8</td><td>SWAP</td><td></td><td colspan="2">MUXPOS[1:0]</td><td></td><td colspan="3">MUXNEG[2:0]</td></tr><tr><td>0x16</td><td>23:16</td><td></td><td></td><td></td><td></td><td>HYST</td><td></td><td colspan="2">OUT[1:0]</td></tr><tr><td>0x17</td><td>31:24</td><td></td><td></td><td></td><td></td><td></td><td colspan="3">FLEN[2:0]</td></tr><tr><td>0x18 ... 0x1F</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x20</td><td>SCALER0</td><td>7:0</td><td></td><td></td><td colspan="6">VALUE[5:0]</td></tr><tr><td>0x21</td><td>SCALER1</td><td>7:0</td><td></td><td></td><td colspan="6">VALUE[5:0]</td></tr></table>

## 32.9 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 809 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Write-Synchronized or the Read-Synchronized property in each individual register description. Refer to “Synchronization” on page 818 for details.

Some registers are enable-protected, meaning they can be written only when the AC is disabled. Enable-protection is denoted by the Enable-Protected property in each individual register description.

## 32.9.1 Control A

Name: CTRLA

Offset: 0x00

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>LPMUX</td><td></td><td></td><td></td><td></td><td>RUNSTDBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – LPMUX: Low-Power Mux

0: The analog input muxes have low resistance, but consume more power at lower voltages (e.g., are driven by the voltage doubler).

1: The analog input muxes have high resistance, but consume less power at lower voltages (e.g., the voltage doubler is disabled).

This bit is not synchronized

## z Bits 6:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – RUNSTDBY: Run in Standby

This bit controls the behavior of the comparators during standby sleep mode.

0: The comparator pair is disabled during sleep.

1: The comparator pair continues to operate during sleep.

This bit is not synchronized

## ● Bit 1 – ENABLE: Enable

0: The AC is disabled.

1: The AC is enabled. Each comparator must also be enabled individually by the Enable bit in the Comparator Control register (COMPCTRLn.ENABLE).

Due to synchronization, there is delay from updating the register until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately after being written. STATUS.SYNCBUSY is set. STA-TUS.SYNCBUSY is cleared when the peripheral is enabled/disabled.

## z Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets all registers in the AC to their initial state, and the AC will be disabled.

Writing a one to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded.

Due to synchronization, there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

## 32.9.2 Control B

Name: CTRLB

Offset: 0x01

Reset: 0x00

Access: Write-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>START1</td><td>START0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>W</td><td>W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 1:0 – STARTx [x=1..0]: Comparator x Start Comparison

Writing a zero to this field has no effect.

Writing a one to STARTx starts a single-shot comparison on COMPx if both the Single-Shot and Enable bits in the Comparator x Control Register are one (COMPCTRLx.SINGLE and COMPCTRLx.ENABLE). If comparator x is not implemented, or if it is not enabled in single-shot mode, writing a one has no effect.

This bit always reads as zero.

## 32.9.3 Event Control

Name: EVCTRL

Offset: 0x02

Reset: 0x0000

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>COMPEI1</td><td>COMPEI0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>WINEO0</td><td></td><td></td><td>COMPEO1</td><td>COMPEO0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 15:10 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 9:8 – COMPEIx [x=1..0]: Comparator x Event Input

Note that several actions can be enabled for incoming events. If several events are connected to the peripheral, the enabled action will be taken for any of the incoming events. There is no way to tell which of the incoming events caused the action.

These bits indicate whether a comparison will start or not on any incoming event.

0: Comparison will not start on any incoming event.

1: Comparison will start on any incoming event.

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – WINEO: Window x Event Output Enable

These bits indicate whether the window x function can generate a peripheral event or not.

0: Window x Event is disabled.

1: Window x Event is enabled.

## Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 1:0 – COMPEOx [x=1..0]: Comparator x Event Output Enable

These bits indicate whether the comparator x output can generate a peripheral event or not.

0: COMPx event generation is disabled.

1: COMPx event generation is enabled.

## 32.9.4 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x04

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>WIN0</td><td></td><td></td><td>COMP1</td><td>COMP0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – WIN: Window x Interrupt Enable

Reading this bit returns the state of the Window x interrupt enable.

0: The Window x interrupt is disabled.

1: The Window x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit disables the Window x interrupt.

## z Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 1:0 – COMPx [x=1..0]: Comparator x Interrupt Enable

Reading this bit returns the state of the Comparator x interrupt enable.

0: The Comparator x interrupt is disabled.

1: The Comparator x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit disables the Comparator x interrupt.

## 32.9.5 Interrupt Enable Set

Name: INTENSET

Offset: 0x05

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>WIN0</td><td></td><td></td><td>COMP1</td><td>COMP0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – WIN: Window x Interrupt Enable

Reading this bit returns the state of the Window x interrupt enable.

0: The Window x interrupt is disabled.

1: The Window x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit enables the Window x interrupt.

## z Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bits 1:0 – COMPx [x=1..0]: Comparator x Interrupt Enable

Reading this bit returns the state of the Comparator x interrupt enable.

0: The Comparator x interrupt is disabled.

1: The Comparator x interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Ready interrupt bit and enable the Ready interrupt.

## 32.9.6 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x06

Reset: 0x00

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td>WIN0</td><td></td><td></td><td>COMP1</td><td>COMP0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:5 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 4 – WIN: Window x

This flag is set according to the Window x Interrupt Selection bit group in the WINCTRL register (WINC-TRL.WINTSELx) and will generate an interrupt if INTENCLR/SET.WINx is also one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Window x interrupt flag.

## z Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 1:0 – COMPx [x=1..0]: Comparator x

Reading this bit returns the status of the Comparator x interrupt flag. If comparator x is not implemented, COMPx always reads as zero.

This flag is set according to the Interrupt Selection bit group in the Comparator x Control register (COMPC-TRLx.INTSEL) and will generate an interrupt if INTENCLR/SET.COMPx is also one.

Writing a zero to this bit has no effect.

Writing a one to this bit clears the Comparator x interrupt flag.

## 32.9.7 Status A

Name: STATUSA

Offset: 0x08

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="2">WSTATE0[1:0]</td><td></td><td></td><td>STATE1</td><td>STATE0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:4 – WSTATE0[1:0]: Window 0 Current State

These bits show the current state of the signal if the window 0 mode is enabled, according to Table 32-3. If the win dow 0 function is not implemented, WSTATE0 always reads as zero.

Table 32-3. Window 0 Current State

<table><tr><td>WSTATE0[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>ABOVE</td><td>Signal is above window</td></tr><tr><td>0x1</td><td>INSIDE</td><td>Signal is inside window</td></tr><tr><td>0x2</td><td>BELOW</td><td>Signal is below window</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 1:0 – STATEx [x=1..0]: Comparator x Current State

This bit shows the current state of the output signal from COMPx. STATEx is valid only when STATUSB.READYx is one.

## 32.9.8 Status B

Name: STATUSB

Offset: 0x09

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td>READY1</td><td>READY0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bit 7 – SYNCBUSY: Synchronization Busy

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## z Bits 6:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 1:0 – READYx [x=1..0]: Comparator x Ready

This bit is cleared when the comparator x output is not ready.

This bit is set when the comparator x output is ready.

If comparator x is not implemented, READYx always reads as zero.

## 32.9.9 Status C

Name: STATUSC

Offset: 0x0A

Reset: 0x00

Access: Read-Only

Property: -

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="2">WSTATE0[1:0]</td><td></td><td></td><td>STATE1</td><td>STATE0</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

STATUSC is a copy of STATUSA (see STATUSA register), with the additional feature of automatically starting singleshot comparisons. A read of STATUSC will start a comparison on all comparators currently configured for single-shot operation. The read will stall the bus until all enabled comparators are ready. If a comparator is already busy with a comparison, the read will stall until the current comparison is compete, and a new comparison will not be started.

Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 5:4 – WSTATE0[1:0]: Window 0 Current State

These bits show the current state of the signal if the window 0 mode is enabled. If the window 0 function is not implemented, WSTATE0 always reads as zero.

Table 32-4. Window 0 Current State

<table><tr><td>WSTATE0[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>ABOVE</td><td>Signal is above window</td></tr><tr><td>0x1</td><td>INSIDE</td><td>Signal is inside window</td></tr><tr><td>0x2</td><td>BELOW</td><td>Signal is below window</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## Bits 3:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bits 1:0 – STATEx [x=1..0]: Comparator x Current State

This bit shows the current state of the output signal from COMPx. If comparator x is not implemented, STATEx always reads as zero. STATEx is only valid when STATUSB.READYx is one.

## 32.9.10 Window Control

Name: WINCTRL

Offset: 0x0C

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="2">WINTSEL0[1:0]</td><td>WENO</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 2:1 – WINTSEL0[1:0]: Window 0 Interrupt Selection

These bits configure the interrupt mode for the comparator window 0 mode.

Table 32-5. Window 0 Interrupt Selection

<table><tr><td>WINTSEL0[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>ABOVE</td><td>Interrupt on signal above window</td></tr><tr><td>0x1</td><td>INSIDE</td><td>Interrupt on signal inside window</td></tr><tr><td>0x2</td><td>BELOW</td><td>Interrupt on signal below window</td></tr><tr><td>0x3</td><td>OUTSIDE</td><td>Interrupt on signal outside window</td></tr></table>

z Bit 0 – WEN0: Window 0 Mode Enable

0: Window mode is disabled for comparators 0 and 1.

1: Window mode is enabled for comparators 0 and 1.

## 32.9.11 Comparator Control n

Name: COMPCTRLn

Offset: 0x10+n\*0x4 [n=0..1]

Reset: 0x00000000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan="3">FLEN[2:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>HYST</td><td></td><td colspan="2">OUT[1:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td>SWAP</td><td></td><td colspan="2">MUXPOS[1:0]</td><td></td><td colspan="3">MUXNEG[2:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td colspan="2">INTSEL[1:0]</td><td></td><td colspan="2">SPEED[1:0]</td><td>SINGLE</td><td>ENABLE</td></tr><tr><td>Access</td><td>R</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

The configuration of comparator n is protected while comparator n is enabled (COMPCTRLn.ENABLE=1). Changes to the other bits in COMPCTRLn can only occur when COMPCTRLn.ENABLE is zero

## z Bits 31:27 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bits 26:24 – FLEN[2:0]: Filter Length

These bits configure the filtering for comparator n. COMPCTRLn.FLEN can only be written while COMPC-TRLn.ENABLE is zero.

These bits are not synchronized.

Table 32-6. Filter Length

<table><tr><td>FLEN[2:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>OFF</td><td>No filtering</td></tr><tr><td>0x1</td><td>MAJ3</td><td>3-bit majority function (2 of 3)</td></tr><tr><td>0x2</td><td>MAJ5</td><td>5-bit majority function (3 of 5)</td></tr><tr><td>0x3-0x7</td><td></td><td>Reserved</td></tr></table>

## z Bits 23:20 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 19 – HYST: Hysteresis Enable

This bit indicates the hysteresis mode of comparator n. Hysteresis is available only for continuous mode (COMPC-TRLn.SINGLE=0). COMPCTRLn.HYST can be written only while COMPCTRLn.ENABLE is zero.

0: Hysteresis is disabled.

1: Hysteresis is enabled.

This bit is not synchronized

## Bit 18 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 17:16 – OUT[1:0]: Output

These bits configure the output selection for comparator n. COMPCTRLn.OUT can be written only while COMPC-TRLn.ENABLE is zero.

These bits are not synchronized.

Table 32-7. Output

<table><tr><td>OUT[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>OFF</td><td>The output of COMPn is not routed to the COMPn I/O port</td></tr><tr><td>0x1</td><td>ASYNC</td><td>The asynchronous output of COMPn is routed to the COMPn I/O port</td></tr><tr><td>0x2</td><td>SYNC</td><td>The synchronous output (including filtering) of COMPn is routed to the COMPn I/O port</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 15 – SWAP: Swap Inputs and Invert

This bit swaps the positive and negative inputs to COMPn and inverts the output. This function can be used for offset cancellation. COMPCTRLn.SWAP can be written only while COMPCTRLn.ENABLE is zero.

0: The output of MUXPOS connects to the positive input, and the output of MUXNEG connects to the negative input.

1: The output of MUXNEG connects to the positive input, and the output of MUXPOS connects to the negative input.

This bit is not synchronized

## z Bit 14 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 13:12 – MUXPOS[1:0]: Positive Input Mux Selection

These bits select which input will be connected to the positive input of comparator n. COMPCTRLn.MUXPOS can be written only while COMPCTRLn.ENABLE is zero.

These bits are not synchronized.

Table 32-8. Positive Input Mux Selection

<table><tr><td>MUXPOS[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>PIN0</td><td>I/O pin 0</td></tr><tr><td>0x1</td><td>PIN1</td><td>I/O pin 1</td></tr><tr><td>0x2</td><td>PIN2</td><td>I/O pin 2</td></tr><tr><td>0x3</td><td>PIN3</td><td>I/O pin 3</td></tr></table>

## z Bit 11 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 10:8 – MUXNEG[2:0]: Negative Input Mux Selection

These bits select which input will be connected to the negative input of comparator n. COMPCTRLn.MUXNEG can only be written while COMPCTRLn.ENABLE is zero.

These bits are not synchronized.

Table 32-9. Negative Input Mux Selection

<table><tr><td>Value</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>PIN0</td><td>I/O pin 0</td></tr><tr><td>0x1</td><td>PIN1</td><td>I/O pin 1</td></tr><tr><td>0x2</td><td>PIN2</td><td>I/O pin 2</td></tr><tr><td>0x3</td><td>PIN3</td><td>I/O pin 3</td></tr><tr><td>0x4</td><td>GND</td><td>Ground</td></tr><tr><td>0x5</td><td>VSCALE</td><td> $V_{DDANA}$  scaler</td></tr><tr><td>0x6</td><td>BANDGAP</td><td>Internal bandgap voltage</td></tr><tr><td>0x7</td><td>DAC</td><td>DAC output</td></tr></table>

## Bit 7 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 6:5 – INTSEL[1:0]: Interrupt Selection

These bits select the condition for comparator n to generate an interrupt or event. COMPCTRLn.INTSEL can be written only while COMPCTRLn.ENABLE is zero.

These bits are not synchronized.

Table 32-10. Interrupt Selection

<table><tr><td>INTSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>TOGGLE</td><td>Interrupt on comparator output toggle</td></tr><tr><td>0x1</td><td>RISING</td><td>Interrupt on comparator output rising</td></tr><tr><td>0x2</td><td>FALLING</td><td>Interrupt on comparator output falling</td></tr><tr><td>0x3</td><td>EOC</td><td>Interrupt on end of comparison (single-shot mode only)</td></tr></table>

## z Bit 4 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bits 3:2 – SPEED[1:0]: Speed Selection

This bit indicates the speed/propagation delay mode of comparator n. COMPCTRLn.SPEED can be written only while COMPCTRLn.ENABLE is zero.

These bits are not synchronized.

Table 32-11. Speed Selection

<table><tr><td>SPEED[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>LOW</td><td>Low speed</td></tr><tr><td>0x1</td><td>HIGH</td><td>High speed</td></tr><tr><td>0x2-0x3</td><td></td><td>Reserved</td></tr></table>

## ● Bit 1 – SINGLE: Single-Shot Mode

This bit determines the operation of comparator n. COMPCTRLn.SINGLE can be written only while COMPC-TRLn.ENABLE is zero.

0: Comparator n operates in continuous measurement mode.

1: Comparator n operates in single-shot mode.

This bit is not synchronized

## z Bit 0 – ENABLE: Enable

Writing a zero to this bit disables comparator n.

Writing a one to this bit enables comparator n.

After writing to this bit, the value read back will not change until the action initiated by the writing is complete. Due to synchronization, there is a latency of at least two GCLK\_AC\_DIG clock cycles from updating the register until the comparator is enabled/disabled. The bit will continue to read the previous state while the change is in progress. Writing a one to COMPCTRLn.ENABLE will prevent further changes to the other bits in COMPCTRLn. These bits remain protected until COMPCTRLn.ENABLE is written to zero and the write is synchronized.

## 32.9.12 Scaler n

Name: SCALERn

Offset: $0 \times 2 0 + \mathsf { n } ^ { \star } 0 \times 1 \ [ \mathsf { n } = 0 . . . 1 ]$

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td colspan="6">VALUE[5:0]</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 7:6 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

z Bits 5:0 – VALUE[5:0]: Scaler Value

$$
V _ {S C A L E} = \frac {V _ {D D} \cdot (V A L U E + 1)}{6 4}
$$

These bits define the scaling factor for channel n of the $\mathsf { V } _ { \mathsf { D D } }$ voltage scaler. The output voltage, $\mathsf { V } _ { \mathsf { S C A L E } }$ , is:

## 33. DAC – Digital-to-Analog Converter

## 33.1 Overview

The Digital-to-Analog Converter (DAC) converts a digital value to a voltage. The DAC has one channel with 10-bit resolution, and it is capable of converting up to 350,000 samples per second (350ksps).

## 33.2 Features

z DAC with 10-bit resolution

z Up to 350ksps conversion rate

z Multiple trigger sources

z High-drive capabilities

z Output can be used as input to the Analog Comparator (AC)

z DMA support

## 33.3 Block Diagram

Figure 33-1. DAC Block Diagram  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_86459641abc1c78608bda62399a7fd80db3aad91466845867a1b0b9a797dad9a.jpg)

33.4 Signal Description

<table><tr><td>Signal Name</td><td>Type</td><td>Description</td></tr><tr><td>VOUT</td><td>Analog output</td><td>DAC output</td></tr><tr><td>VREFA</td><td>Analog input</td><td>External reference</td></tr></table>

Refer to “I/O Multiplexing and Considerations” on page 13 for the pin mapping of this peripheral. One signal can be mapped on several pins.

## 33.5 Product Dependencies

In order to use this peripheral, other parts of the system must be configured correctly, as described below.

## 33.5.1 I/O Lines

Using the DAC’s I/O lines requires the I/O pins to be configured using the port configuration (PORT).

Refer to “PORT” on page 378 for details.

## 33.5.2 Power Management

The DAC will continue to operate in any sleep mode where the selected source clock is running. The DAC interrupts can be used to wake up the device from sleep modes. The events can trigger other operations in the system without exiting sleep modes. Refer to “PM – Power Manager” on page 110 for details on the different sleep modes.

## 33.5.3 Clocks

The DAC bus clock (CLK\_DAC\_APB) can be enabled and disabled in the Power Manager, and the default state of CLK\_DAC\_APB can be found in the Peripheral Clock Masking section in “PM – Power Manager” on page 110.

A generic clock (GCLK\_DAC) is required to clock the DAC. This clock must be configured and enabled in the Generic Clock Controller before using the DAC. Refer to “GCLK – Generic Clock Controller” on page 88 for details.

This generic clock is asynchronous to the bus clock (CLK\_DAC). Due to this asynchronicity, writes to certain registers will require synchronization between the clock domains. Refer to “Synchronization” on page 840 for further details.

## 33.5.4 DMA

The DMA request line is connected to the DMA Controller (DMAC). Using the DAC DMA requests requires the DMA Controller to be configured first. Refer to “DMAC – Direct Memory Access Controller” on page 271 for details.

## 33.5.5 Interrupts

The interrupt request line is connected to the Interrupt Controller. Using the DAC interrupts requires the Interrupt Controller to be configured first. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 33.5.6 Events

The events are connected to the Event System. Refer to “EVSYS – Event System” on page 405 for details on how to configure the Event System.

## 33.5.7 Debug Operation

When the CPU is halted in debug mode the DAC continues normal operation. If the DAC is configured in a way that requires it to be periodically serviced by the CPU through interrupts or similar, improper operation or data loss may result during debugging.

## 33.5.8 Register Access Protection

All registers with write-access are optionally write-protected by the Peripheral Access Controller (PAC), except the following register:

z Interrupt Flag Status and Clear register (INTFLAG)

Write-protection is denoted by the Write-Protection property in the register description.

When the CPU is halted in debug mode, all write-protection is automatically disabled.

Write-protection does not apply for accesses through an external debugger. Refer to “PAC – Peripheral Access Controller” on page 30 for details.

## 33.5.9 Analog Connections

Not applicable.

## 33.6 Functional Description

## 33.6.1 Principle of Operation

The Digital-to-Analog Converter (DAC) converts the digital value written to the Data register (DATA) into an analog voltage on the DAC output. By default, a conversion is started when new data is written to DATA, and the corresponding voltage is available on the DAC output after the conversion time. It is also possible to enable events from the Event System to trigger the conversion.

## 33.6.2 Basic Operation

## 33.6.2.1 Initialization

Before enabling the DAC, it must be configured by selecting the voltage reference using the Reference Selection bits in the Control B register (CTRLB.REFSEL).

## 33.6.2.2 Enabling, Disabling and Resetting

The DAC is enabled by writing a one to the Enable bit in the Control A register (CTRLA.ENABLE). The DAC is disabled by writing a zero to CTRLA.ENABLE.

The DAC is reset by writing a one to the Software Reset bit in the Control A register (CTRLA.SWRST). All registers in the DAC will be reset to their initial state, and the DAC will be disabled. Refer to the CTRLA register for details.

## 33.6.2.3 Enabling the Output Buffer

To enable the DAC output on the $\mathsf { V } _ { \mathsf { O U T } }$ pin, the output driver must be enabled by writing a one to the External Output Enable bit in the Control B register (CTRLB.EOEN).

The DAC output buffer provides a high-drive-strength output, and is capable of driving both resistive and capacitive loads. To minimize power consumption, the output buffer should be enabled only when external output is needed

## 33.6.3 Additional Features

## 33.6.3.1 Conversion Range

The conversion range is between GND and the selected DAC voltage reference. The default voltage reference is the internal 1V (INT1V) reference voltage. The other voltage reference options are the 3.3V analog supply voltage $( \mathsf { A V } _ { \mathsf { C C } }$ = VDDANA) and the external voltage reference (VREFA). The voltage reference is selected by writing to the Reference Selection bits in the Control B register (CTRLB.REFSEL). The output voltage from the DAC can be calculated using the following formula:

$$
V _ {D A C} = \frac {D A T A}{0 x 3 F F} \cdot V R E F
$$

## 33.6.3.2 DAC as an Internal Reference

The DAC output can be internally enabled as input to the analog comparator. This is enabled by writing a one to the Internal Output Enable bit in the Control B register (CTRLB.IOEN). It is possible to have the internal and external output enabled simultaneously.

The DAC output can also be enabled as input to the Analog-to-Digital Converter. In this case, the output buffer must be enabled.

## 33.6.3.3 Data Buffer

The Data Buffer register (DATABUF) and the Data register (DATA) are linked together to form a two-stage FIFO. The DAC uses the Start Conversion event to load data from DATABUF into DATA and start a new conversion. The Start Conversion event is enabled by writing a one to the Start Event Input bit in the Event Control register

(EVCTRL.STARTEI). If a Start Conversion event occurs when DATABUF is empty, an Underrun interrupt request is generated if the Underrun interrupt is enabled.

The DAC can generate a Data Buffer Empty event when DATABUF becomes empty and new data can be loaded to the buffer. The Data Buffer Empty event is enabled by writing a one to the Empty Event Output bit in the Event Control register (EVCTRL.EMPTYEO). A Data Buffer Empty interrupt request is generated if the Data Buffer Empty interrupt is enabled.

## 33.6.3.4 Voltage Pump

When the DAC is used at operating voltages lower than 2.5V, the voltage pump must be enabled. This enabling is done automatically, depending on operating voltage.

The voltage pump can be disabled by writing a one to the Voltage Pump Disable bit in the Control B register (CTRLB.VPD). This can be used to reduce power consumption when the operating voltage is above 2.5V.

The voltage pump uses the asynchronous GCLK\_DAC clock, and requires that the clock frequency be at least four times higher than the sampling period.

## 33.6.3.5 Sampling Period

As there is no automatic indication that a conversion is done, the sampling period must be greater than or equal to the specified conversion time.

## 33.6.4 DMA, Interrupts and Events

Table 33-1. Moduel Request for ADC

<table><tr><td>Condition</td><td>Interrupt request</td><td>Event output</td><td>Event input</td><td>DMA request</td><td>DMA request is cleared</td></tr><tr><td>Data Buffer Empty</td><td>x</td><td>x</td><td></td><td>x</td><td>When DATABUF is written</td></tr><tr><td>Underrun</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Synchronization Ready</td><td>x</td><td></td><td></td><td></td><td></td></tr><tr><td>Start Conversion</td><td></td><td></td><td>x</td><td></td><td></td></tr></table>

## 33.6.4.1 DMA Operation

The DAC generates the following DMA request:

Data Buffer Empty (EMPTY): the request is set when the Data Buffer register is empty (data transferred from DATABUF to DATA). The request is cleared when DATABUF is written.

For each Start Conversion event, DATABUF is transferred into DATA and the conversion starts. When DATABUF is empty, the DAC generates the DMA request for new data. As DATABUF is initially not empty, it must be written by the CPU before the first event occurs.

If the CPU accesses the registers that are the source of a DMA request set/clear condition, the DMA request can be lost or the DMA transfer can be corrupted, if enabled.

When DAC registers are write-protected by Peripheral Access Controller, DATABUF cannot be written. To bypass DATABUF write protection, Bypass DATABUF Write Protection bit (CTRLB.BDWP) must be written to one.

## 33.6.4.2 Interrupts

The DAC has the following interrupt sources:

z Data Buffer Empty

z Underrun

Synchronization Ready

Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is cleared, the interrupt is disabled or the DAC is reset. See the register description for details on how to clear interrupt flags.

The DAC has one common interrupt request line for all the interrupt sources. The user must read the INTFLAG register to determine which interrupt condition is present.

Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to “Nested Vector Interrupt Controller” on page 26 for details.

## 33.6.4.3 Events

The DAC can generate the following output events:

Data Buffer Empty (EMPTY)

Writing a one to an Event Output bit in the Event Control register (EVCTRL.xxEO) enables the corresponding output event. Writing a zero to this bit disables the corresponding output event. Refer to “EVSYS – Event System” on page 405 for details on configuring the event system.

The DAC can take the following actions on an input event:

z Start Conversion (START)

Writing a one to an Event Input bit in the Event Control register (EVCTRL.xxEI) enables the corresponding action on an input event. Writing a zero to this bit disables the corresponding action on input event. Note that if several events are connected to the DAC, the enabled action will be taken on any of the incoming events. Refer to “EVSYS – Event System” on page 405 for details on configuring the event system.

## 33.6.5 Sleep Mode Operation

The generic clock for the DAC is running in idle sleep mode. If the Run In Standby bit in the Control A register (CTRLA.RUNSTDBY) is one, the DAC output buffer will keep its value in standby sleep mode. If CTRLA.RUNSTDBY is zero, the DAC output buffer will be disabled in standby sleep mode.

## 33.6.6 Synchronization

Due to the asynchronicity between CLK\_DAC\_APB and GCLK\_DAC, some registers must be synchronized when accessed. A register can require:

z Synchronization when written

z Synchronization when read

z Synchronization when written and read

z No synchronization

When executing an operation that requires synchronization, the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set immediately, and cleared when synchronization is complete. The Synchronization Ready interrupt can be used to signal when synchronization is complete.

If an operation that requires synchronization is executed while STATUS.SYNCBUSY is one, the bus will be stalled. All operations will complete successfully, but the CPU will be stalled and interrupts will be pending as long as the bus is stalled.

The following bits need synchronization when written:

z Software Reset bit in the Control A register (CTRLA.SWRST)

z Enable bit in the Control A register (CTRLA.ENABLE)

z All bits in the Data register (DATA)

z All bits in the Data Buffer register (DATABUF)

Synchronization is denoted by the Write-Synchronized property in the register description.

The following bits need synchronization when read:

z All bits in the Data register (DATA)

## 33.7 Register Summary

Table 33-2. Register Summary

<table><tr><td>Offset</td><td>Name</td><td>Bit Pos.</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x0</td><td>CTRLA</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>RUNSTDBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>0x1</td><td>CTRLB</td><td>7:0</td><td colspan="2">REFSEL[1:0]</td><td></td><td>BDWP</td><td>VPD</td><td>LEFTADJ</td><td>IOEN</td><td>EOEN</td></tr><tr><td>0x2</td><td>EVCTRL</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td></td><td>EMPTYEO</td><td>STARTEI</td></tr><tr><td>0x3</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x4</td><td>INTENCLR</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>EMPTY</td><td>UNDERRUN</td></tr><tr><td>0x5</td><td>INTENSET</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>EMPTY</td><td>UNDERRUN</td></tr><tr><td>0x6</td><td>INTFLAG</td><td>7:0</td><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>EMPTY</td><td>UNDERRUN</td></tr><tr><td>0x7</td><td>STATUS</td><td>7:0</td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0x8</td><td rowspan="2">DATA</td><td>7:0</td><td colspan="8">DATA[7:0]</td></tr><tr><td>0x9</td><td>15:8</td><td colspan="8">DATA[15:8]</td></tr><tr><td>0xA</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0xB</td><td>Reserved</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>0xC</td><td rowspan="2">DATABUF</td><td>7:0</td><td colspan="8">DATABUF[7:0]</td></tr><tr><td>0xD</td><td>15:8</td><td colspan="8">DATABUF[15:8]</td></tr></table>

## 33.8 Register Description

Registers can be 8, 16 or 32 bits wide. Atomic 8-, 16- and 32-bit accesses are supported. In addition, the 8-bit quarters and 16-bit halves of a 32-bit register and the 8-bit halves of a 16-bit register can be accessed directly.

Some registers are optionally write-protected by the Peripheral Access Controller (PAC). Write-protection is denoted by the Write-Protected property in each individual register description. Refer to “Register Access Protection” on page 837 for details.

Some registers require synchronization when read and/or written. Synchronization is denoted by the Synchronized property in each individual register description. Refer to “Synchronization” on page 840 for details.

## 33.8.1 Control A

Name: CTRLA

Offset: 0x0

Reset: 0x00

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>RUNSTDBY</td><td>ENABLE</td><td>SWRST</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – RUNSTDBY: Run in Standby

0: The DAC output buffer is disabled in standby sleep mode.

1: The DAC output buffer can be enabled in standby sleep mode.

This bit is not synchronized.

## z Bit 1 – ENABLE: Enable

0: The peripheral is disabled or being disabled.

1: The peripheral is enabled or being enabled.

Due to synchronization, there is delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The value written to CTRL.ENABLE will read back immediately and the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY is cleared when the operation is complete.

## ● Bit 0 – SWRST: Software Reset

0: There is no reset operation ongoing.

1: The reset operation is ongoing.

Writing a zero to this bit has no effect.

Writing a one to this bit resets the all registers in the DAC to their initial state, and the DAC will be disabled.

Writing a one to CTRLA.SWRST will always take precedence, meaning that all other writes in the same write operation will be discarded.

Due to synchronization, there is a delay from writing CTRLA.SWRST until the reset is complete. CTRLA.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete.

## 33.8.2 Control B

Name: CTRLB

Offset: 0x1

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="2">REFSEL[1:0]</td><td></td><td>BDWP</td><td>VPD</td><td>LEFTADJ</td><td>IOEN</td><td>EOEN</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

Bits 7:6 – REFSEL[1:0]: Reference Selection

These bits select the reference voltage for the DAC according to the table below.

Table 33-3. Reference Selection

<table><tr><td>REFSEL[1:0]</td><td>Name</td><td>Description</td></tr><tr><td>0x0</td><td>INT1V</td><td>Internal 1.0V reference</td></tr><tr><td>0x1</td><td>AVCC</td><td>AVCC</td></tr><tr><td>0x2</td><td>VREFA</td><td>External reference</td></tr><tr><td>0x3</td><td></td><td>Reserved</td></tr></table>

## z Bit 5 – Reserved

This bit is unused and reserved for future use. For compatibility with future devices, always write this bit to zero when this register is written. This bit will always return zero when read.

## z Bit 4 – BDWP: Bypass DATABUF Write Protection

This bit can bypass DATABUF write protection.

0: DATABUF register is write-protected by Peripheral Access Controller.

1: DATABUF register is not write-protected.

## z Bit 3 – VPD: Voltage Pump Disable

This bit controls the behavior of the voltage pump.

0: Voltage pump is turned on/off automatically.

1: Voltage pump is disabled.

## Bit 2 – LEFTADJ: Left Adjusted Data

This bit controls how the 10-bit conversion data is adjusted in the Data and Data Buffer registers.

0: DATA and DATABUF registers are right-adjusted.

1: DATA and DATABUF registers are left-adjusted.

## Bit 1 – IOEN: Internal Output Enable

0: Internal DAC output not enabled.

1: Internal DAC output enabled to be used by the AC.

## Bit 0 – EOEN: External Output Enable

0: The DAC output is turned off.

1: The high-drive output buffer drives the DAC output to the $\mathsf { V } _ { \mathsf { O U T } }$ pin.

## 33.8.3 Event Control

Name: EVCTRL

Offset: 0x2

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>EMPTYEO</td><td>STARTEI</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:2 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## ● Bit 1 – EMPTYEO: Data Buffer Empty Event Output

This bit indicates whether or not the Data Buffer Empty event is enabled and will be generated when the Data Buffer register is empty.

0: Data Buffer Empty event is disabled and will not be generated.

1: Data Buffer Empty event is enabled and will be generated.

## z Bit 0 – STARTEI: Start Conversion Event Input

This bit indicates whether or not the Start Conversion event is enabled and data are loaded from the Data Buffer register to the Data register upon event reception.

0: A new conversion will not be triggered on an incoming event.

1: A new conversion will be triggered on an incoming event.

## 33.8.4 Interrupt Enable Clear

Name: INTENCLR

Offset: 0x4

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>EMPTY</td><td>UNDERRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to disable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Set register (INTENSET).

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready Interrupt Enable bit, which disables the Synchronization Ready interrupt.

## Bit 1 – EMPTY: Data Buffer Empty Interrupt Enable

0: The Data Buffer Empty interrupt is disabled.

1: The Data Buffer Empty interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Data Buffer Empty Interrupt Enable bit, which disables the Data Buffer Empty interrupt.

## z Bit 0 – UNDERRUN: Underrun Interrupt Enable

0: The Underrun interrupt is disabled.

1: The Underrun interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Underrun Interrupt Enable bit, which disables the Underrun interrupt.

## 33.8.5 Interrupt Enable Set

Name: INTENSET

Offset: 0x5

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>EMPTY</td><td>UNDERRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

This register allows the user to enable an interrupt without doing a read-modify-write operation. Changes in this register will also be reflected in the Interrupt Enable Clear register (INTENCLR).

## z Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## z Bit 2 – SYNCRDY: Synchronization Ready Interrupt Enable

0: The Synchronization Ready interrupt is disabled.

1: The Synchronization Ready interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Synchronization Ready Interrupt Enable bit, which enables the Synchronization Ready interrupt.

## Bit 1 – EMPTY: Data Buffer Empty Interrupt Enable

0: The Data Buffer Empty interrupt is disabled.

1: The Data Buffer Empty interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Data Buffer Empty Interrupt Enable bit, which enables the Data Buffer Empty interrupt.

## z Bit 0 – UNDERRUN: Underrun Interrupt Enable

0: The Underrun interrupt is disabled.

1: The Underrun interrupt is enabled.

Writing a zero to this bit has no effect.

Writing a one to this bit will set the Underrun Interrupt Enable bit, which enables the Underrun interrupt.

## 33.8.6 Interrupt Flag Status and Clear

Name: INTFLAG

Offset: 0x6

Reset: 0x00

Access: Read-Write

Property: Write-Protected

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>SYNCRDY</td><td>EMPTY</td><td>UNDERRUN</td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## Bits 7:3 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## Bit 2 – SYNCRDY: Synchronization Ready

This flag is cleared by writing a one to the flag.

This flag is set on a 1-to-0 transition of the Synchronization Busy bit in the Status register (STATUS.SYNCBUSY), except when the transition is caused by an enable or a software reset, and will generate an interrupt request if INTENCLR/SET.READY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Synchronization Ready interrupt flag.

## ● Bit 1 – EMPTY: Data Buffer Empty

This flag is cleared by writing a one to the flag or by writing new data to DATABUF.

This flag is set when data is transferred from DATABUF to DATA, and the DAC is ready to receive new data in DATABUF, and will generate an interrupt request if INTENCLR/SET.EMPTY is one.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Data Buffer Empty interrupt flag.

## z Bit 0 – UNDERRUN: Underrun

This flag is cleared by writing a one to the flag.

This flag is set when a start conversion event occurs when DATABUF is empty, and will generate an interrupt request if INTENCLR/SET.UNDERRUN is one.

Writing a zero to this bit has no effect.

Writing a one to this bit will clear the Underrun interrupt flag.

## 33.8.7 Status

Name: STATUS

Offset: 0x7

Reset: 0x00

Access: Read-Only

Property: Read-Synchronized

<table><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td>SYNCBUSY</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Access</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td><td>R</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

## z Bit 7 – SYNCBUSY: Synchronization Busy Status

This bit is cleared when the synchronization of registers between the clock domains is complete. This bit is set when the synchronization of registers between clock domains is started.

## Bits 6:0 – Reserved

These bits are unused and reserved for future use. For compatibility with future devices, always write these bits to zero when this register is written. These bits will always return zero when read.

## 33.8.8 Data

Name: DATA

Offset: 0x8

Reset: 0x0000

Access: Read-Write

Property: Write-Protected, Write-Synchronized

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DATA[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DATA[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – DATA[15:0]: Data value to be converted

DATA register contains the 10-bit value that is converted to a voltage by the DAC. The adjustment of these 10 bits within the 16-bit register is controlled by CTRLB.LEFTADJ:

\- DATA[9:0] when CTRLB.LEFTADJ is zero.

\- DATA[15:6] when CTRLB.LEFTADJ is one.

## 33.8.9 Data Buffer

Name: DATABUF

Offset: 0xC

Reset: 0x0000

Access: Read-Write

Property: -

<table><tr><td>Bit</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td></tr><tr><td></td><td colspan="8">DATABUF[15:8]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>Bit</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr><tr><td></td><td colspan="8">DATABUF[7:0]</td></tr><tr><td>Access</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td><td>R/W</td></tr><tr><td>Reset</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></table>

z Bits 15:0 – DATABUF[15:0]: Data Buffer

DATABUF contains the value to be transferred into DATA.The adjustment of these 10 bits within the 16-bit register is controlled by CTRLB.LEFTADJ:

\- DATABUF[9:0] when CTRLB.LEFTADJ is zero.

\- DATABUF[15:6] when CTRLB.LEFTADJ is one.

## 34. PTC - Peripheral Touch Controller

## 34.1 Overview

The purpose of PTC is to acquire signals to detect touch on capacitive sensors. The external capacitive touch sensor is typically formed on a PCB, and the sensor electrodes are connected to the analog front end of the PTC through the I/O pins in the device. The PTC supports both self- and mutual-capacitance sensors.

In mutual-capacitance mode, sensing is done using capacitive touch matrices in various X-Y configurations, including indium tin oxide (ITO) sensor grids. The PTC requires one pin per X-line and one pin per Y-line.

In self-capacitance mode, the PTC requires only one pin (Y-line) for each touch sensor.

## 34.2 Features

z Low-power, high-sensitivity, environmentally robust capacitive touch buttons, sliders, wheels and proximity sensing

z Supports mutual capacitance and self-capacitance sensing

z 7/13/16 buttons in self-capacitance mode, for 14-/20-/24- pins respectively

z 12/42/72 buttons in mutual-capacitance mode, for 14-/20-/24- pins respectively

z Mix-and-match mutual-and self-capacitance sensors

z One pin per electrode – no external components

z Load compensating charge sensing

z Parasitic capacitance compensation and adjustable gain for superior sensitivity

z Zero drift over the temperature and $\mathsf { V } _ { \mathsf { D D } }$ range

z Auto calibration and re-calibration of sensors

z Single-shot and free-running charge measurement

z Hardware noise filtering and noise signal de-synchronization for high conducted immunity

z Selectable channel change delay

z Allows choosing the settling time on a new channel, as required

z Acquisition-start triggered by command or interrupt event

z Low CPU utilization through interrupt on acquisition-complete

z 5% CPU utilization scanning 10 channels at 50ms scan rate

z Supported by the Atmel<sup>®</sup> QTouch<sup>®</sup> Composer development tool, which comprises QTouch Library project builder and QTouch analyzer

## 34.3 Block Diagram

Figure 34-1. PTC Block Diagram Mutual-capacitance  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_01e07b22bedffbf5203b69604a930b600d5c7857ba5c805cff94bd8e5693a6b8.jpg)

Figure 34-2. PTC Block Diagram Self-capacitance  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_fb7a5ab0061d6790766fcc6eec20badc96cce147b84faae4c43aabee6901e65b.jpg)

## 34.4 Signal Description

<table><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>X[n:0]</td><td>Digital</td><td>X-line (Output)</td></tr><tr><td>Y[m:0]</td><td>Analog</td><td>Y-line (Input/Output)</td></tr></table>

Note: 1. The number of X and Y lines are device dependent. Refer to “Configuration Summary” on page 3 for details.

Refer to “I/O Multiplexing and Considerations” on page 13 for details on the pin mapping for this peripheral. One signal can be mapped on several pins.

## 34.5 Product Dependencies

In order to use this Peripheral, configure the other components of the system as described in the following sections.

## 34.5.1 I/O Lines

The I/O lines used for analog X-lines and Y-lines must be connected to external capacitive touch sensor electrodes. External components are not required for normal operation. However, to improve the EMC performance, a series resistor of 1 KΩ can be used on X-lines and Y-lines.

## Mutual-capacitance Sensor Arrangement

A mutual-capacitance sensor is formed between two I/O lines - an X electrode for transmitting and Y electrode for receiving. The mutual capacitance between the X and Y electrode is measured by the Peripheral Touch Controller.

Figure 34-3. Mutual Capacitance Sensor Arrangement

<table><tr><td rowspan="5">MCU</td><td colspan="3">Sensor Capacitance Cx,y</td></tr><tr><td>Cx0,y0</td><td>Cx0,y1</td><td>Cx0,ym</td></tr><tr><td>Cx1,y0</td><td>Cx1,y1</td><td>Cx1,ym</td></tr><tr><td>Cxn,y0</td><td>Cxn,y1</td><td>Cxn,ym</td></tr><tr><td></td><td></td><td></td></tr></table>

## Self-capacitance Sensor Arrangement

The self-capacitance sensor is connected to a single pin on the Peripheral Touch Controller through the Y electrode for receiving the signal. The sense electrode capacitance is measured by the Peripheral Touch Controller.

Figure 34-4. Self-capacitance Sensor Arrangement  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_31237cac96e86971c92b1fafe401b056f95f5b206758d1fdc7b3b56e95ccacd6.jpg)

For more information about designing the touch sensor, refer to Buttons, Sliders and Wheels Touch Sensor Design Guide on http://www.atmel.com.

## 34.5.2 Clocks

The PTC is clocked by the GCLK\_PTC clock. The PTC operates from an asynchronous clock source and the operation is independent of the main system clock and its derivative clocks, such as the peripheral bus clock (CLK\_APB). A number of clock sources can be selected as the source for the asynchronous GCLK\_PTC. The clock source is selected by configuring the Generic Clock Selection ID in the Generic Clock Control register. For more information about selecting the clock sources, refer to “GCLK – Generic Clock Controller” on page 88.

The selected clock must be enabled in the Power Manager, before it can be used by the PTC. By default these clocks are disabled. The frequency range of GCLK\_PTC is 400kHz to 4MHz.

For more details, refer to “PM – Power Manager” on page 110.

## 34.6 Functional Description

In order to access the PTC, the user must use the QTouch Composer tool to configure and link the QTouch Library firmware with the application code. QTouch Library can be used to implement buttons, sliders, wheels and proximity sensor in a variety of combinations on a single interface.

For more information about QTouch library, refer to the Atmel QTouch Library Peripheral Touch Controller User Guide.

Figure 34-5. QTouch Library Usage  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_91e46ebf24518d9f63a690146ec7419465c07a91001914dd7e343fd2c0780303.jpg)

1. With BOD33 disabled. If the BOD33 is enabled, check Table 35-18

## 35. Electrical Characteristics

## 35.1 Disclaimer

All typical values are measured at ${ \mathsf { T } } = 2 5 ^ { \circ } { \mathsf { C } }$ unless otherwise specified. All minimum and maximum values are valid across operating temperature and voltage unless otherwise specified.

## 35.2 Absolute Maximum Ratings

Stresses beyond those listed in Table 35-1 may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

Table 35-1. Absolute maximum ratings

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DD}$ </td><td>Power supply voltage</td><td>0</td><td>3.8</td><td>V</td></tr><tr><td> $I_{VDD}$ </td><td>Current into a  $V_{DD}$  pin</td><td>-</td><td>92(1)</td><td>mA</td></tr><tr><td> $I_{GND}$ </td><td>Current out of a GND pin</td><td>-</td><td>130(1)</td><td>mA</td></tr><tr><td> $V_{PIN}$ </td><td>Pin voltage with respect to GND and  $V_{DD}$ </td><td>GND-0.6V</td><td> $V_{DD}$ +0.6V</td><td>V</td></tr><tr><td> $T_{storage}$ </td><td>Storage temperature</td><td>-60</td><td>150</td><td>°C</td></tr></table>

Note: 1. Maximum source current is 46mA and maximum sink current is 65mA per cluster. A cluster is a group of GPIOs as shown in . Also note that each $V _ { \mathsf { D D } } / \mathsf { G N D }$ pair is connected to 2 clusters so current consumption through the pair will be a sum of the clusters source/sink currents.

## 35.3 General Operating Ratings

The device must operate within the ratings listed in Table 35-2 in order for all other electrical characteristics and typical characteristics of the device to be valid.

Table 35-2. General operating conditions<sup>(2)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DD}$ </td><td>Power supply voltage</td><td>1.62(1)</td><td>3.3</td><td>3.63</td><td>V</td></tr><tr><td> $T_A$ </td><td>Temperature range</td><td>-40</td><td>25</td><td>85</td><td>°C</td></tr><tr><td> $T_J$ </td><td>Junction temperature</td><td>-</td><td>-</td><td>100</td><td>°C</td></tr></table>

2. CAUTION: In debugger cold-plugging mode, NVM erase operations are not protected by the BOD33 and BOD12. NVM erase operation at supply voltages below specified minimum can cause corruption of NVM areas that are mandatory for correct device behavior.

## 35.4 Supply Characteristics

The following characteristics are applicable to the operating temperature range: $\mathsf { T } _ { \mathsf { A } } = - 4 0 ^ { \circ } \mathsf { C }$ to $8 5 ^ { \circ } \mathrm { C }$ , unless otherwise specified and are valid for a junction temperature up to $\mathsf { T } _ { \mathsf { J } } = 1 0 0 ^ { \circ } \mathsf { C }$ . Refer to “Power Supply and Start-Up Considerations” on page 17.

Table 35-3. Supply voltage Characteristics

<table><tr><td>Symbol</td><td>Conditions</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DDIO}$ </td><td rowspan="2">Full Voltage Range</td><td>1.62</td><td>3.63</td><td rowspan="2">V</td></tr><tr><td> $V_{DDANA}$ </td><td>1.62</td><td>3.63</td></tr></table>

Table 35-4. Supply Slew Rates

<table><tr><td>Symbol</td><td>Parameter</td><td>Fall Rate Max</td><td>Rise Rate Max.</td><td>Units</td></tr><tr><td> $V_{DDIO}$ </td><td rowspan="2">DC supply peripheral I/Os, internal regulator and analog supply voltage</td><td>0.05</td><td>0.1</td><td rowspan="2">V/μs</td></tr><tr><td> $V_{DDANA}$ </td><td>0.05</td><td>0.1</td></tr></table>

## 35.5 Maximum Clock Frequencies

Table 35-5. Maximum GCLK Generator Output Frequencies

<table><tr><td>Symbol</td><td>Description</td><td>Undivided</td><td>Divided</td><td>Units</td></tr><tr><td> $f_{GCLKGEN0} / f_{GCLK\_MAIN}$  $f_{GCLKGEN1}$  $f_{GCLKGEN2}$  $f_{GCLKGEN3}$  $f_{GCLKGEN4}$  $f_{GCLKGEN5}$ </td><td>GCLK Generator Output Frequency</td><td>96</td><td>48</td><td>MHz</td></tr></table>

Table 35-6. Maximum Peripheral Clock Frequencies

<table><tr><td>Symbol</td><td>Description</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{CPU}$ </td><td>CPU clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{AHB}$ </td><td>AHB clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{APBA}$ </td><td>APBA clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{APBB}$ </td><td>APBB clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{APBC}$ </td><td>APBC clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_DFLL48M\_REF}$ </td><td>DFLL48M Reference clock frequency</td><td>33</td><td>kHz</td></tr><tr><td> $f_{GCLK\_DPLL}$ </td><td>FDPLL96M Reference clock frequency</td><td>2</td><td>MHz</td></tr><tr><td> $f_{GCLK\_DPLL\_32K}$ </td><td>FDPLL96M 32k Reference clock frequency</td><td>32</td><td>kHz</td></tr><tr><td> $f_{GCLK\_WDT}$ </td><td>WDT input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_RTC}$ </td><td>RTC input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EIC}$ </td><td>EIC input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_USB}$ </td><td>USB input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_0}$ </td><td>EVSYS channel 0 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_1}$ </td><td>EVSYS channel 1 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_2}$ </td><td>EVSYS channel 2 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_3}$ </td><td>EVSYS channel 3 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_4}$ </td><td>EVSYS channel 4 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_5}$ </td><td>EVSYS channel 5 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOMx\_SLOW}$ </td><td>Common SERCOM slow input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOM0\_CORE}$ </td><td>SERCOM0 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOM1\_CORE}$ </td><td>SERCOM1 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOM2\_CORE}$ </td><td>SERCOM2 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_TCC0}$ </td><td>TCC0 input clock frequency</td><td>96</td><td>MHz</td></tr><tr><td> $f_{GCLK\_TC1, GCLK\_TC2}$ </td><td>TC1,TC2 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_ADC}$ </td><td>ADC input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_AC\_DIG}$ </td><td>AC digital input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_AC\_ANA}$ </td><td>AC analog input clock frequency</td><td>64</td><td>kHz</td></tr><tr><td> $f_{GCLK\_DAC}$ </td><td>DAC input clock frequency</td><td>350</td><td>kHz</td></tr><tr><td> $f_{GCLK\_PTC}$ </td><td>PTC input clock frequency</td><td>48</td><td>MHz</td></tr></table>

## 35.6 Power Consumption

The values in Table 35-7 are measured values of power consumption under the following conditions, except where noted:

## z Operating conditions

$\mathsf { V } _ { \mathsf { V D D I N } } = 3 . 3 \mathsf { V }$

$\mathsf { V } _ { \mathsf { D D I N } } = 1 . 8 \mathsf { V } ,$ CPU is running on Flash with 3 wait state

Wake up time from sleep mode is measured from the edge of the wakeup signal to the execution of the first instruction fetched in flash.

## z Oscillators

z XOSC (crystal oscillator) stopped

z XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal

z DFLL48M using XOSC32K as reference and running at 48MHz

## z Clocks

DFLL48M used as main clock source, except otherwise specified.

z CPU, AHB clocks undivided

z APBA clock divided by 4

z APBB and APBC bridges off

z The following AHB module clocks are running: NVMCTRL, APBA bridge

z All other AHB clocks stopped

z The following peripheral clocks running: PM, SYSCTRL, RTC

z All other peripheral clocks stopped

z I/Os are inactive with internal pull-up

CPU is running on flash with 1 wait states

NVMCTRL cache enabled

z BOD33 disabled

Table 35-7. Current Consumption

<table><tr><td>Mode</td><td>Conditions</td><td> $T_A$ </td><td> $V_{CC}$ </td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="18">ACTIVE</td><td rowspan="2">CPU running a While(1) algorithm</td><td>25°C</td><td>3.3V</td><td></td><td>2.95</td><td>3.01</td><td rowspan="4">mA</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>2.96</td><td>3.02</td></tr><tr><td rowspan="2">CPU running a While(1) algorithm  $V_{DDIN}=1.8V$ , CPU is running on Flash with 3 wait states</td><td>25°C</td><td>1.8V</td><td></td><td>2.89</td><td>2.95</td></tr><tr><td>85°C</td><td>1.8V</td><td></td><td>2.94</td><td>3.02</td></tr><tr><td rowspan="2">CPU running a While(1) algorithm, CPU is running on Flash with 3 wait states with GCLKIN as reference</td><td>25°C</td><td>3.3V</td><td></td><td>53*freq + 282</td><td>53*freq + 330</td><td rowspan="2">μA(with freq in MHz)</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>54*freq + 278</td><td>54*freq + 354</td></tr><tr><td rowspan="2">CPU running a Fibonacci algorithm</td><td>25°C</td><td>3.3V</td><td></td><td>3.25</td><td>3.39</td><td rowspan="4">mA</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>3.24</td><td>3.40</td></tr><tr><td rowspan="2">CPU running a Fibonacci algorithm  $V_{DDIN}=1.8V$ , CPU is running on flash with 3 wait states</td><td>25°C</td><td>1.8V</td><td></td><td>3.19</td><td>3.33</td></tr><tr><td>85°C</td><td>1.8V</td><td></td><td>3.25</td><td>3.40</td></tr><tr><td rowspan="2">CPU running a Fibonacci algorithm, CPU is running on Flash with 3 wait states with GCLKIN as reference</td><td>25°C</td><td>3.3V</td><td></td><td>60*freq + 281</td><td>61*freq + 335</td><td rowspan="2">μA(with freq in MHz)</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>60*freq + 281</td><td>61*freq + 350</td></tr><tr><td rowspan="2">CPU running a CoreMark algorithm</td><td>25°C</td><td>3.3V</td><td></td><td>3.95</td><td>4.04</td><td rowspan="4">mA</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>3.98</td><td>4.07</td></tr><tr><td rowspan="2">CPU running a CoreMark algorithm  $V_{DDIN}=1.8V$ , CPU is running on flash with 3 wait states</td><td>25°C</td><td>1.8V</td><td></td><td>3.52</td><td>3.63</td></tr><tr><td>85°C</td><td>1.8V</td><td></td><td>3.59</td><td>3.69</td></tr><tr><td rowspan="2">CPU running a CoreMark algorithm, CPU is running on Flash with 3 wait states with GCLKIN as reference</td><td>25°C</td><td>3.3V</td><td></td><td>75*freq + 284</td><td>74*freq + 284</td><td rowspan="2">μA(with freq in MHz)</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>76*freq + 273</td><td>75*freq + 273</td></tr><tr><td rowspan="2">IDLE0</td><td rowspan="2"></td><td>25°C</td><td>3.3V</td><td></td><td>1.81</td><td>1.89</td><td rowspan="6">mA</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>1.82</td><td>1.90</td></tr><tr><td rowspan="2">IDLE1</td><td rowspan="2"></td><td>25°C</td><td>3.3V</td><td></td><td>1.28</td><td>1.36</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>1.29</td><td>1.38</td></tr><tr><td rowspan="2">IDLE2</td><td rowspan="2"></td><td>25°C</td><td>3.3V</td><td></td><td>1.06</td><td>1.17</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>1.06</td><td>1.18</td></tr><tr><td rowspan="4">STANDBY</td><td rowspan="2">XOSC32K runningRTC running at 1kHz</td><td>25°C</td><td>3.3V</td><td></td><td>3.40</td><td>10.40</td><td rowspan="4">μA</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>23.00</td><td>57.00</td></tr><tr><td rowspan="2">XOSC32K and RTC stopped</td><td>25°C</td><td>3.3V</td><td></td><td>2.20</td><td>9.20</td></tr><tr><td>85°C</td><td>3.3V</td><td></td><td>21.00</td><td>55.000</td></tr></table>

Table 35-8. Wake-up Time

<table><tr><td>Mode</td><td>Conditions</td><td> $T_A$ </td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="2">IDLE0</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>4.0</td><td></td><td rowspan="8">μs</td></tr><tr><td>85°C</td><td></td><td>4.0</td><td></td></tr><tr><td rowspan="2">IDLE1</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>12.1</td><td></td></tr><tr><td>85°C</td><td></td><td>13.6</td><td></td></tr><tr><td rowspan="2">IDLE2</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>13.0</td><td></td></tr><tr><td>85°C</td><td></td><td>14.5</td><td></td></tr><tr><td rowspan="2">STANDBY</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>19.6</td><td></td></tr><tr><td>85°C</td><td></td><td>19.7</td><td></td></tr></table>

Figure 35-1. Measurement Schematic  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_db565207f58a5637ae4f372b900c91bc1cd49411fa1a5e067d944c1c6b4bbf21.jpg)

## 35.7 Peripheral Power Consumption

Since USB peripheral complies with the Universal Serial Bus (USB) v2.0 standard, USB peripheral power consumption is described a specific section.

## 35.7.1 All peripheral except USB

Default conditions, except where noted:

z Operating conditions

$\mathsf { V } _ { \mathsf { V D D I N } } = 3 . 3 \mathsf { V }$

z Oscillators

z XOSC (crystal oscillator) stopped

z XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal

z OSC8M at 8MHz

z Clocks

z OSC8M used as main clock source

z CPU, AHB and APBn clocks undivided

z The following AHB module clocks are running: NVMCTRL, HPB2 bridge, HPB1 bridge, HPB0 bridge

z All other AHB clocks stopped

z The following peripheral clocks running: PM, SYSCTRL

z All other peripheral clocks stopped

z I/Os are inactive with internal pull-up

z CPU in IDLE0 mode

z Cache enabled

z BOD33 disabled

In this default conditions, the power consumption $\mathsf { I } _ { \mathsf { d e f a u l t } }$ is measured.

Operating mode for each peripheral in turn:

z Configure and enable the peripheral GCLK (When relevant, see conditions)

z Unmask the peripheral clock

z Enable the peripheral (when relevant)

z Set CPU in IDLE0 mode

● Measurement I<sub>periph</sub>

z Wake-up CPU via EIC (async: level detection, filtering disabled)

Disable the peripheral (when relevant)

z Mask the peripheral clock

z Disable the peripheral GCLK (when relevant, see conditions)

Each peripheral power consumption provided in the table is the value $( \boldsymbol { \vert } _ { \mathsf { p e r i p h } } - \boldsymbol { \vert } _ { \mathsf { d e f a u l t } } )$ , using the same measurement method as for global power consumption measurement.

Table 35-9. Typical Peripheral Power Consumption

<table><tr><td>Peripheral</td><td>Conditions</td><td>Typ.</td><td>Units</td></tr><tr><td>RTC</td><td> $f_{GCLK\_RTC}=32kHz, 32bit counter mode$ </td><td>5.20</td><td>μA</td></tr><tr><td>WDT</td><td> $f_{GCLK\_WDT}=32kHz, normal mode with EW$ </td><td>2.70</td><td>μA</td></tr><tr><td>AC</td><td>Both  $f_{GCLK}=8MHz, Enable both COMP$ </td><td>64.6</td><td>μA</td></tr><tr><td>TCx(1)</td><td> $f_{GCLK}=8MHz, Enable + COUNTER in 8bit mode$ </td><td>38.9</td><td>μA</td></tr><tr><td>TCC0</td><td> $f_{GCLK}=8MHz, Enable + COUNTER$ </td><td>125.8</td><td>μA</td></tr><tr><td>SERCOMx.I2CM(2)</td><td> $f_{GCLK}=8MHz, Enable$ </td><td>62.9</td><td>μA</td></tr><tr><td>SERCOMx.I2CS(2)</td><td> $f_{GCLK}=8MHz, Enable$ </td><td>25.1</td><td>μA</td></tr><tr><td>SERCOMx.SPI(2)</td><td> $f_{GCLK}=8MHz, Enable$ </td><td>58.7</td><td>μA</td></tr><tr><td>SERCOMx.USART(2)</td><td> $f_{GCLK}=8MHz, Enable$ </td><td>70.7</td><td>μA</td></tr><tr><td>DMAC(3)</td><td>RAM to RAM transfer</td><td>178.3</td><td>μA</td></tr></table>

Notes: 1. All TCs share the same power consumption values.  
2. All SERCOMs share the same power consumption values.  
3. The value includes the power consumption of the R/W access to the RAM

## 35.7.2 USB Peripheral Power Consumption

Default conditions, except where noted:

z Operating conditions

$\mathsf { V } _ { \mathsf { V D D I N } } = 3 . 3 \mathsf { V }$

Oscillators

z XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal in USB Host mode

Clocks

z USB Device mode: DFLL48M in USB recovery mode (Crystal less)

z USB Host mode: DFLL48M in closed loop with XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal

z CPU, AHB and APBn clocks undivided

z The following AHB module clocks are running: NVMCTRL, HPB2 bridge, HPB1 bridge, HPB0 bridge

z All other AHB clocks stopped

I/Os are inactive with internal pull-up

z CPU in IDLE0 mode

Cache enabled

z BOD33 disabled

In this default conditions, the power consumption $\mathsf { I } _ { \mathsf { d e f a u l t } }$ is measured.

Measurements do not include consumption of clock source (ex: DFLL48M or FDPLL96M) and CPU. However no CPU activity is required during all states (Suspend, IDLE, Data transfer).

Measurements have been done with an USB cable of 1.5m.

For USB Device mode, measurements include the maximum consumption (200µA) through pull-up resistor on the D+ line for USB attach. This value depends on USB Host characteristic.

Operating modes:

z Run the USB Device/Host states in regards of the Universal Serial Bus (USB) v2.0 standard.

USB power consumption is provided in the following tables.

Table 35-10. Typical USB Device Full Speed mode Current Consumption

<table><tr><td>USB Device state</td><td>Conditions(1)</td><td>Typ.</td><td>Units</td></tr><tr><td>Suspend</td><td>GCLK_USB is off, using USB wakeup asynchronous interrupt. USB bus in suspend mode.</td><td>201</td><td>μA</td></tr><tr><td>Suspend</td><td>GCLK_USB is on. USB bus in suspend mode.</td><td>0.83</td><td rowspan="4">mA</td></tr><tr><td>IDLE</td><td>Start Of Frame is running. No packet transferred.</td><td>1.17</td></tr><tr><td>Active OUT</td><td>Start Of Frame is running. Bulk OUT on 100% bandwidth.</td><td>2.17</td></tr><tr><td>Active IN</td><td>Start Of Frame is running. Bulk IN on 100% bandwidth.</td><td>10.3</td></tr></table>

Notes: 1. Measures include the consumption (200µA) of the 1.5 kΩ pull-up on the D+ line for USB attach  
2. Measures include consumption of DFLL48M in USB recovery mode, excepted SUSPEND state which turns off DFLL48M  
4. Measures done with an USB cable of 1.5m  
3. Measures do not include CPU consumption. However no CPU activity is required during all states (Suspend, IDLE, Data transfer)

## 35.8 I/O Pin Characteristics

## 35.8.1 Normal I/O Pins

Table 35-11. Normal I/O Pins Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td>All pins except PA24, PA25</td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td>0.25* $V_{DD}$ </td><td rowspan="6">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td>0.3* $V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>0.7* $V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>0.55* $V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{OL}$ </td><td>Output low-level voltage</td><td> $V_{DD}>1.6V, I_{OL} \max$ </td><td>-</td><td>0.1* $V_{DD}$ </td><td>0.2* $V_{DD}$ </td></tr><tr><td> $V_{OH}$ </td><td>Output high-level voltage</td><td> $V_{DD}>1.6V, I_{OH} \max$ </td><td>0.8* $V_{DD}$ </td><td>0.9* $V_{DD}$ </td><td>-</td></tr><tr><td rowspan="4"> $I_{OL}$ </td><td rowspan="4">Output low-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>1</td><td rowspan="8">mA</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2.5</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>3</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>10</td></tr><tr><td rowspan="4"> $I_{OH}$ </td><td rowspan="4">Output high-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>0.7</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>7</td></tr><tr><td rowspan="2"> $t_{RISE}$ </td><td rowspan="2">Rise time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}$ =3.3V</td><td></td><td>-</td><td>15</td><td rowspan="4">nS</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF, Vdd = 3.3V</td><td></td><td>-</td><td>15</td></tr><tr><td rowspan="2"> $t_{FALL}$ </td><td rowspan="2">Fall time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}$ =3.3V</td><td></td><td>-</td><td>15</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF, Vdd = 3.3V</td><td></td><td>-</td><td>15</td></tr><tr><td> $I_{LEAK}$ </td><td>Input leakage current</td><td>Pull-up resistors disabled</td><td>-1</td><td>+/-0.015</td><td>1</td><td>μA</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

## 35.8.2 I<sup>2</sup>C Pins

Refer to “I/O Multiplexing and Considerations” on page 13 to get the list of ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ pins.

Table 35-12. I<sup>2</sup>C Pins Characteristics in I<sup>2</sup>C configuration

<table><tr><td>Symbol</td><td>Parameter</td><td>Condition</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td></td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td> $0.25*V_{DD}$ </td><td rowspan="7">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td> $0.3*V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td> $0.7*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td> $0.55*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{HYS}$ </td><td>Hysteresis of Schmitt trigger inputs</td><td></td><td> $0.08*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td rowspan="2"> $V_{OL}$ </td><td rowspan="2">Output low-level voltage</td><td> $V_{DD}>2.0V$  $I_{OL}=3mA$ </td><td>-</td><td>-</td><td>0.4</td></tr><tr><td> $V_{DD}\leq 2.0V$  $I_{OL}=2mA$ </td><td>-</td><td>-</td><td> $0.2*V_{DD}$ </td></tr><tr><td> $C_I$ </td><td>Capacitance for each I/O Pin</td><td></td><td></td><td></td><td></td><td>pF</td></tr><tr><td rowspan="3"> $I_{OL}$ </td><td rowspan="3">Output low-level current</td><td> $V_{OL}=0.4V$ Standard, Fast and HS Modes</td><td>3</td><td>-</td><td>-</td><td rowspan="3">mA</td></tr><tr><td> $V_{OL}=0.4V$ Fast Mode+</td><td>20</td><td>-</td><td>-</td></tr><tr><td> $V_{OL}=0.6V$ </td><td>6</td><td>-</td><td>-</td></tr><tr><td> $f_{SCL}$ </td><td>SCL clock frequency</td><td></td><td>-</td><td>-</td><td>3.4</td><td>MHz</td></tr><tr><td rowspan="2"> $R_P$ </td><td rowspan="2">Value of pull-up resistor</td><td> $f_{SCL}\leq 100kHz$ </td><td rowspan="2"></td><td rowspan="2"></td><td></td><td rowspan="2">Ω</td></tr><tr><td> $f_{SCL}>100kHz$ </td><td></td></tr></table>

I<sup>2</sup>C pins timing characteristics can be found in “SERCOM in I2C Mode Timing” on page 899.

Table 35-13. I<sup>2</sup>C Pins Characteristics in I/O Configuration

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td></td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td> $0.25*V_{DD}$ </td><td rowspan="6">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td> $0.3*V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td> $0.7*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td> $0.55*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{OL}$ </td><td>Output low-level voltage</td><td> $V_{DD}>1.6V, I_{OL} \max$ </td><td>-</td><td> $0.1*V_{DD}$ </td><td> $0.2*V_{DD}$ </td></tr><tr><td> $V_{OH}$ </td><td>Output high-level voltage</td><td> $V_{DD}>1.6V, I_{OH} \max$ </td><td> $0.8*V_{DD}$ </td><td> $0.9*V_{DD}$ </td><td>-</td></tr><tr><td rowspan="4"> $I_{OL}$ </td><td rowspan="4">Output low-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>1</td><td rowspan="8">mA</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2.5</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>3</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>10</td></tr><tr><td rowspan="4"> $I_{OH}$ </td><td rowspan="4">Output high-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>0.7</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>7</td></tr><tr><td rowspan="2"> $t_{RISE}$ </td><td rowspan="2">Rise time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td><td rowspan="4">nS</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td rowspan="2"> $t_{FALL}$ </td><td rowspan="2">Fall time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td> $I_{LEAK}$ </td><td>Input leakage current</td><td>Pull-up resistors disabled</td><td>-1</td><td>+/-0.015</td><td>1</td><td>μA</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

Table 35-14. USB Pins Characteristics in I/O Configuration

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td></td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td> $0.25*V_{DD}$ </td><td rowspan="6">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td> $0.3*V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td> $0.7*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td> $0.55*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{OL}$ </td><td>Output low-level voltage</td><td> $V_{DD}>1.6V, I_{OL} \max$ </td><td>-</td><td> $0.1*V_{DD}$ </td><td> $0.2*V_{DD}$ </td></tr><tr><td> $V_{OH}$ </td><td>Output high-level voltage</td><td> $V_{DD}>1.6V, I_{OH} \max$ </td><td> $0.8*V_{DD}$ </td><td> $0.9*V_{DD}$ </td><td>-</td></tr><tr><td rowspan="4"> $I_{OL}$ </td><td rowspan="4">Output low-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>1</td><td rowspan="8">mA</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2.5</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>3</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>10</td></tr><tr><td rowspan="4"> $I_{OH}$ </td><td rowspan="4">Output high-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>0.7</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>7</td></tr><tr><td rowspan="2"> $t_{RISE}$ </td><td rowspan="2">Rise time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td><td rowspan="4">nS</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td rowspan="2"> $t_{FALL}$ </td><td rowspan="2">Fall time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td> $I_{LEAK}$ </td><td>Input leakage current</td><td>Pull-up resistors disabled</td><td>-1</td><td>+/-0.015</td><td>1</td><td>μA</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

## 35.8.3 XOSC Pin

XOSC pins behave as normal pins when used as normal I/Os. Refer to Table 35-11.

## 35.8.4 XOSC32 Pin

XOSC32 pins behave as normal pins when used as normal I/Os. Refer to Table 35-11.

## 35.8.5 External Reset Pin

Reset pin has the same electrical characteristics as normal I/O pins. Refer to Table 35-11.

## 35.9 Injection Current

Stresses beyond those listed in the table below may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $I_{inj1}^{(2)}$ </td><td>IO pin injection current</td><td>-1</td><td>+1</td><td rowspan="3">mA</td></tr><tr><td> $T_{inj2}^{(3)}$ </td><td>IO pin injection current</td><td>-15</td><td>+15</td></tr><tr><td> $I_{injtotal}$ </td><td>Sum of IO pins injection current</td><td>-45</td><td>+45</td></tr><tr><td colspan="5">Notes: 1. Injecting current may have an effect on the accuracy of Analog blocks2. Conditions for Vpin: Vpin &lt; GND-0.3V or 3.6V &lt; Vpin ≤ 4.2VConditions for VDD: 3V &lt; VDD ≤ 3.6V.If  $V_{pin}$  is lower than GND-0.6V, then a current limiting resistor is required. The negative DC injection current limiting resistor R is calculated as R = | (GND-0.6V . Vpin)/linj1|.If Vpin is greater than VDD+0.6V, a current limiting resistor is required. The positive DC injection current limiting resistor R is calculated as R = (Vpin-(VDD+0.6V))/linj13. Conditions for Vpin: Vpin &lt; GND-0.6V or Vpin ≤ 3.6V.Conditions for VDD: VDD ≤ 3V.If Vpin is lower than GND-0.6V, a current limiting resistor is required. The negative DC injection current limiting resistor R is calculated as R = | (GND-0.6V . Vpin)/linj2|.If Vpin is greater than VDD+0.6V, a current limiting resistor is required. The positive DC injection current limiting resistor R is calculated as R = (Vpin-(VDD+0.6V))/linj2.</td></tr></table>

Table 35-15. Injection Current<sup>(1)</sup>

sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

## 35.10 Analog Characteristics

## 35.10.1 Voltage Regulator Characteristics

Table 35-16. Decoupling requirements

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $C_{IN}$ </td><td>Input regulator capacitor, between  $V_{DDIN}$  and GND</td><td></td><td>-</td><td>4.7</td><td>-</td><td>μF</td></tr></table>

Note: Supplying any external components using VDDCORE pin is not allowed to assure the integrity of the core supply voltage.

## 35.10.2 Power-On Reset (POR) Characteristics

Table 35-17. POR Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{POT+}$ </td><td>Voltage threshold on  $V_{DDIN}$  rising</td><td rowspan="2"> $V_{DD}$  falls at 1V/ms or slower</td><td>1.27</td><td>1.43</td><td>1.58</td><td rowspan="2">V</td></tr><tr><td> $V_{POT-}$ </td><td>Voltage threshold on  $V_{DDIN}$  falling</td><td>0.72</td><td>1.02</td><td>1.32</td></tr></table>

Figure 35-2. POR Operating Principle  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_1491a96aa3416352f054727395791dee1f102e6abf80a1034154c3de803515e4.jpg)

Figure 35-3. BOD33 Hysteresis OFF  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c7aed61b3b1356077fd447a8841c0dc131a006ae3493ce1c20173f9610ea8ebd.jpg)

Figure 35-4. BOD33 Hysteresis ON  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_3b2d7645ad8b52e575df8bce65dc99807a7437b6ca6756e8141d447893c8fe5c.jpg)

Table 35-18. BOD33 LEVEL Value

<table><tr><td>Symbol</td><td>BOD33.LEVEL</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="4"> $V_{BOD+}$ </td><td>6</td><td rowspan="4">Hysteresis ON</td><td>-</td><td>1.67</td><td>1.71</td><td rowspan="8">V</td></tr><tr><td>7</td><td>-</td><td>1.70</td><td>1.75</td></tr><tr><td>39</td><td>-</td><td>2.81</td><td>2.83</td></tr><tr><td>48</td><td>-</td><td>3.09</td><td>3.20</td></tr><tr><td rowspan="4"> $V_{BOD-}$ or $V_{BOD}$ </td><td>6</td><td rowspan="4">Hysteresis ON or Hysteresis OFF</td><td>1.61</td><td>1.64</td><td>1.65</td></tr><tr><td>7</td><td>1.64</td><td>1.67</td><td>1.69</td></tr><tr><td>39</td><td>2.72</td><td>2.76</td><td>2.79</td></tr><tr><td>48</td><td>3.00</td><td>3.07</td><td>3.10</td></tr></table>

Note: See chapter Memories table “NVM User Row Mapping” on page 23 for the BOD33 default value settings.

Table 35-19. BOD33 Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td></td><td>Step size, between adjacent values in BOD33.LEVEL</td><td></td><td>-</td><td>34</td><td>-</td><td rowspan="2">mV</td></tr><tr><td> $V_{HYST}$ </td><td> $V_{BOD+} - V_{BOD-}$ </td><td>Hysteresis ON</td><td>35</td><td>-</td><td>100</td></tr><tr><td> $t_{DET}$ </td><td>Detection time</td><td>Time with  $V_{DDANA} < V_{TH}$  necessary to generate a reset signal</td><td>-</td><td> $0.9^{(1)}$ </td><td>-</td><td rowspan="2">μs</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td></td><td>-</td><td> $2.2^{(1)}$ </td><td>-</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

Table 35-20. BOD33 Mode Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td> $T_A$ </td><td> $V_{CC}$ </td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="6"> $I_{BOD33}$ </td><td rowspan="6">Current consumption</td><td rowspan="2">IDLE2, Continuous mode</td><td>25°C</td><td rowspan="2">3.3V</td><td>25</td><td>48</td><td rowspan="6">μA</td></tr><tr><td>-40 to 85°C</td><td>-</td><td>50</td></tr><tr><td rowspan="2">IDLE2, Sampling mode</td><td>25°C</td><td rowspan="2">1.8V</td><td>0.034</td><td>0.21</td></tr><tr><td>-40 to 85°C</td><td>-</td><td>1.62</td></tr><tr><td rowspan="2">STDBY, Sampling mode</td><td>25°C</td><td rowspan="2">3.3V</td><td>0.132</td><td>0.38</td></tr><tr><td>-40 to 85°C</td><td>-</td><td>1</td></tr></table>

## 35.10.4 Analog-to-Digital (ADC) Characteristics

Table 35-21. Operating Conditions

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>RES</td><td>Resolution</td><td></td><td>8</td><td>-</td><td>12</td><td>bits</td></tr><tr><td> $f_{CLK\_ADC}$ </td><td>ADC Clock frequency</td><td></td><td>30</td><td>-</td><td>2100</td><td>kHz</td></tr><tr><td></td><td>Conversion speed</td><td></td><td>10</td><td></td><td>1000</td><td></td></tr><tr><td rowspan="2"></td><td rowspan="2">Sample rate(1)</td><td>Single shot</td><td>5</td><td>-</td><td>300</td><td rowspan="2">ksps</td></tr><tr><td>Free running</td><td>5</td><td>-</td><td> $350^{(3)}$ </td></tr><tr><td></td><td>Sampling time(1)</td><td></td><td>0.5</td><td>-</td><td>-</td><td>cycles</td></tr><tr><td></td><td>Conversion time(1)</td><td>1x Gain</td><td>6</td><td>-</td><td>-</td><td>cycles</td></tr><tr><td> $V_{REF}$ </td><td>Voltage reference range</td><td></td><td>1.0</td><td>-</td><td> $V_{DDANA}-0.6$ </td><td>V</td></tr><tr><td> $V_{REFINT1V}$ </td><td>Internal 1V reference (2)</td><td></td><td>-</td><td>1.0</td><td>-</td><td>V</td></tr><tr><td> $V_{REFINTVCC0}$ </td><td>Internal ratiometric reference  $0^{(2)}$ </td><td></td><td>-</td><td> $V_{DDANA}/1.48$ </td><td>-</td><td>V</td></tr><tr><td> $V_{REFINTVCC0}$ Voltage Error</td><td>Internal ratiometric reference 0(2) error</td><td>2.0V $-1-1%$ </td><td>-1</td><td>-</td><td>1</td><td>%</td></tr><tr><td>\( V_{REFINTVCC1}</td><td>Internal ratiometric reference 1(2)</td><td> $V_{DDANA}>2.0V$ </td><td>-</td><td> $V_{DDANA}/2$ </td><td>-</td><td>V</td></tr><tr><td> $V_{REFINTVCC1}$ Voltage Error</td><td>Internal ratiometric reference 1(2) error</td><td>2.0V $-1-1%$ </td><td>-1</td><td>-</td><td>1</td><td>%</td></tr><tr><td rowspan="2"></td><td rowspan="2">Conversion range(1)</td><td>Differential mode</td><td>\( -V_{REF}/GAIN</td><td>-</td><td> $+V_{REF}/GAIN$ </td><td>V</td></tr><tr><td>Single-ended mode</td><td>0.0</td><td>-</td><td> $+V_{REF}/GAIN$ </td><td>V</td></tr><tr><td> $C_{SAMPLE}$ </td><td>Sampling capacitance(2)</td><td></td><td>-</td><td>3.5</td><td>-</td><td>pF</td></tr><tr><td> $R_{SAMPLE}$ </td><td>Input channel source resistance(2)</td><td></td><td>-</td><td>-</td><td>3.5</td><td>kΩ</td></tr><tr><td> $I_{DD}$ </td><td>DC supply current(1)</td><td> $f_{CLK\_ADC}=2.1MHz^{(3)}$ </td><td>-</td><td>3.8</td><td>4.5</td><td>mA</td></tr></table>

1. These values are based on characterization. These values are not covered by test limits in production.  
2. These values are based on simulation. These values are not covered by test limits in production or characterization.  
3. In this condition and for a sample rate of 350ksps, a conversion takes 6 clock cycles of the ADC clock (conditions: 1X gain, 12-bit resolution, differential mode, free-running).

Table 35-22. Differential Mode

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>ENOB</td><td>Effective Number Of Bits</td><td>With gain compensation</td><td>-</td><td>10.5</td><td>10.7</td><td>bits</td></tr><tr><td>TUE</td><td>Total Unadjusted Error</td><td>1x Gain</td><td>3.1</td><td>4.3</td><td>20</td><td>LSB</td></tr><tr><td>INL</td><td>Integral Non Linearity</td><td>1x Gain</td><td>1.0</td><td>1.3</td><td>6.3</td><td>LSB</td></tr><tr><td>DNL</td><td>Differential Non Linearity</td><td>1x Gain</td><td>+/-0.3</td><td>+/-0.5</td><td>+/-0.98</td><td>LSB</td></tr><tr><td></td><td rowspan="3">Gain Error</td><td>Ext. Ref 1x</td><td>-25.0</td><td>2.5</td><td>+25.0</td><td>mV</td></tr><tr><td></td><td> $V_{REF}=V_{DDANA}/1.48$ </td><td>-30.0</td><td>-1.5</td><td>+30.0</td><td>mV</td></tr><tr><td></td><td>Bandgap</td><td>-15.0</td><td>-5.0</td><td>+10.0</td><td>mV</td></tr><tr><td rowspan="2"></td><td rowspan="2"> $Gain\ Accuracy^{(4)}$ </td><td>Ext. Ref. 0.5x</td><td>+/-0.04</td><td>+/-0.2</td><td>+/-1.5</td><td>%</td></tr><tr><td>Ext. Ref. 2x to 16x</td><td>+/-0.1</td><td>+/-0.4</td><td>+/-2.0</td><td>%</td></tr><tr><td rowspan="3"></td><td rowspan="3">Offset Error</td><td>Ext. Ref. 1x</td><td>-10.0</td><td>-1.5</td><td>+10.0</td><td>mV</td></tr><tr><td> $V_{REF}=V_{DDANA}/1.48$ </td><td>-10.0</td><td>0.5</td><td>+10.0</td><td>mV</td></tr><tr><td>Bandgap</td><td>-10.0</td><td>3.0</td><td>+10.0</td><td>mV</td></tr><tr><td>SFDR</td><td>Spurious Free Dynamic Range</td><td rowspan="4">1x Gain $F_{CLK\_ADC} = 2.1MHz$  $F_{IN} = 40kHz$  $A_{IN} = 95\%FSR$ </td><td>62.7</td><td>70.4</td><td>75.8</td><td>dB</td></tr><tr><td>SINAD</td><td>Signal-to-Noise and Distortion</td><td>54.1</td><td>61.4</td><td>62.7</td><td>dB</td></tr><tr><td>SNR</td><td>Signal-to-Noise Ratio</td><td>54.5</td><td>63.6</td><td>65.6</td><td>dB</td></tr><tr><td>THD</td><td>Total Harmonic Distortion</td><td>-74</td><td>-70.2</td><td>-63</td><td>dB</td></tr><tr><td></td><td>Noise RMS</td><td>T=25°C</td><td>0.6</td><td>1.0</td><td>2</td><td>mV</td></tr></table>

Notes: 1. Maximum numbers are based on characterization and not tested in production, and valid for 5% to 95% of the input voltage range.

2. Dynamic parameter numbers are based on characterization and not tested in production.

3. Respect the input common mode voltage through the following equations (where $\mathsf { V } _ { \mathsf { C M \_ I N } }$ is the Input channel common mode voltage):

c. $\mid \mathsf { f } \mid \mathsf { V } _ { \mid \mathsf { N } } \mid > \mathsf { V } _ { \mathsf { R E F } } / 4$

$\mathsf { V } _ { \mathbb { C } \mathsf { M } \_ { \| \mathsf { N } } } < 0 . 9 5 ^ { \star } \mathsf { V } _ { \mathsf { D } \mathbb { D } \mathsf { A N A } } + \mathsf { V } _ { \mathsf { R E F } } / 4 - 0 . 7 5 \mathsf { V }$

$$
V _ {C M \_ I N} > V _ {R E F} / 4 - 0. 0 5 ^ {*} V _ {D D A N A} - 0. 1 V
$$

d. $\mid \mathsf { f } \mid \mathsf { V } _ { \mid \mathsf { N } } \mid < \mathsf { V } _ { \mathsf { R E F } } / 4$

$\mathsf { V } _ { \mathsf { C M \_ N } } < 1 . 2 ^ { \star } \mathsf { V } _ { \mathsf { D D A N A } } - 0 . 7 5 \mathsf { V }$

$\mathsf { V } _ { \mathsf { C M \_ l N } } > 0 . 2 ^ { \star } \mathsf { V } _ { \mathsf { D D A N A } } - 0 . 1 \mathsf { V }$

4. The gain accuracy represents the gain error expressed in percent. Gain accuracy (%) = (Gain Error in V x 100) / (2\*Vref/GAIN)

Table 35-23. Single-Ended Mode

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>ENOB</td><td>Effective Number of Bits</td><td>With gain compensation</td><td></td><td>9.5</td><td>9.8</td><td>Bits</td></tr><tr><td>TUE</td><td>Total Unadjusted Error</td><td>1x gain</td><td></td><td>10.5</td><td>40.0</td><td>LSB</td></tr><tr><td>INL</td><td>Integral Non-Linearity</td><td>1x gain</td><td>1.0</td><td>1.6</td><td>10.0</td><td>LSB</td></tr><tr><td>DNL</td><td>Differential Non-Linearity</td><td>1x gain</td><td>+/-0.5</td><td>+/-0.6</td><td>+/-0.98</td><td>LSB</td></tr><tr><td></td><td>Gain Error</td><td>Ext. Ref. 1x</td><td>-5.0</td><td>0.7</td><td>+5.0</td><td>mV</td></tr><tr><td></td><td rowspan="2"> $Gain\ Accuracy^{(3)}$ </td><td>Ext. Ref. 0.5x</td><td>+/-0.09</td><td>+/-0.59</td><td>+/-3.5</td><td>%</td></tr><tr><td></td><td>Ext. Ref. 2x to 16X</td><td>+/-0.03</td><td>+/-0.2</td><td>+/-4.0</td><td>%</td></tr><tr><td></td><td>Offset Error</td><td>Ext. Ref. 1x</td><td>-5</td><td>2.0</td><td>10</td><td>mV</td></tr><tr><td>SFDR</td><td>Spurious Free Dynamic Range</td><td rowspan="4">1x Gain $F_{CLK\_ADC} = 2.1MHz$  $F_{IN} = 40kHz$  $A_{IN} = 95\%FSR$ </td><td>54.2</td><td>65.0</td><td>67.0</td><td>dB</td></tr><tr><td>SINAD</td><td>Signal-to-Noise and Distortion</td><td>47.5</td><td>59.5</td><td>61</td><td>dB</td></tr><tr><td>SNR</td><td>Signal-to-Noise Ratio</td><td>48</td><td>60.0</td><td>64</td><td>dB</td></tr><tr><td>THD</td><td>Total Harmonic Distortion</td><td>-74</td><td>-68.8</td><td>-62.1</td><td>dB</td></tr><tr><td></td><td>Noise RMS</td><td>T = 25°C</td><td>-</td><td>1.0</td><td>-</td><td>mV</td></tr></table>

Notes: 1. Maximum numbers are based on characterization and not tested in production, and for 5% to 95% of the input voltage range.  
2. Respect the input common mode voltage through the following equations (where $\mathsf { V } _ { \mathsf { C M \_ I N } }$ is the Input channel common mode voltage) for all $\mathsf { V } _ { \mathsf { I N } } .$  
$\mathsf { V } _ { \mathbb { C } \mathsf { M } \_ { \| \mathsf { N } } } < 0 . 7 ^ { \star } \mathsf { V } _ { \mathsf { D D A N A } } + \mathsf { V } _ { \mathsf { R E F } } / 4 - 0 . 7 5 \mathsf { V }$

$$
V _ {C M \_ I N} > V _ {R E F} / 4 - 0. 3 ^ {*} V _ {D D A N A} - 0. 1 V
$$

3. The gain accuracy represents the gain error expressed in percent. Gain accuracy (%) = (Gain Error in V x 100) $\mathrm { ' } ( \mathsf { V } _ { \mathsf { R E F } } / \mathsf { G A I N } )$

## 35.10.4.1 Performance with the Averaging Digital Feature

Averaging is a feature which increases the sample accuracy. ADC automatically computes an average value of multiple consecutive conversions. The numbers of samples to be averaged is specified by the Number-of-Samples-to be-collected bit group in the Average Control register (AVGCTRL.SAMPLENUM[3:0]) and the averaged output is available in the Result register (RESULT).

Table 35-24. Averaging feature

<table><tr><td>Average Number</td><td>Conditions</td><td>SNR (dB)</td><td>SINAD (dB)</td><td>SFDR (dB)</td><td>ENOB (bits)</td></tr><tr><td>1</td><td rowspan="4">In differential mode, 1x gain, $V_{DDANA}$ =3.0V,  $V_{REF}$ =1.0V, 350kSpsT=25°C</td><td>66.0</td><td>65.0</td><td>72.8</td><td>9.75</td></tr><tr><td>8</td><td>67.6</td><td>65.8</td><td>75.1</td><td>10.62</td></tr><tr><td>32</td><td>69.7</td><td>67.1</td><td>75.3</td><td>10.85</td></tr><tr><td>128</td><td>70.4</td><td>67.5</td><td>75.5</td><td>10.91</td></tr></table>

35.10.4.2 Performance with the hardware offset and gain correction

Inherent gain and offset errors affect the absolute accuracy of the ADC. The offset error cancellation is handled by the Offset Correction register (OFFSETCORR) and the gain error cancellation, by the Gain Correction register (GAINCORR). The offset and gain correction value is subtracted from the converted data before writing the Result register (RESULT).

Table 35-25. Offset and Gain correction feature

<table><tr><td>Gain Factor</td><td>Conditions</td><td>Offset Error (mV)</td><td>Gain Error (mV)</td><td>Total Unadjusted Error (LSB)</td></tr><tr><td>0.5x</td><td rowspan="5">In differential mode, 1x gain, $V_{DDANA}$ =3.0V,  $V_{REF}$ =1.0V, 350kspsT=25°C</td><td>0.25</td><td>1.0</td><td>2.4</td></tr><tr><td>1x</td><td>0.20</td><td>0.10</td><td>1.5</td></tr><tr><td>2x</td><td>0.15</td><td>-0.15</td><td>2.7</td></tr><tr><td>8x</td><td>-0.05</td><td>0.05</td><td>3.2</td></tr><tr><td>16x</td><td>0.10</td><td>-0.05</td><td>6.1</td></tr></table>

## 35.10.4.3 Inputs and Sample and Hold Acquisition Times

The analog voltage source must be able to charge the sample and hold (S/H) capacitor in the ADC in order to achieve maximum accuracy. Seen externally the ADC input consists of a resistor $\left( { { R } _ { S A M P L E } } \right)$ and a capacitor $\big ( C _ { S A M P L E } \big )$ . In addition, the source resistance $\left( { { R _ { S O U R C E } } } \right)$ must be taken into account when calculating the required sample and hold time. Figure 35-5 shows the ADC input channel equivalent circuit.

Figure 35-5. ADC Input  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_a7eee48dfd208e56719a4305a61c98632f0c74b156bb9ca036004a7f61d9c80d.jpg)

To achieve n bits of accuracy, the $C _ { S A M P L E }$ capacitor must be charged at least to a voltage of

$$
V _ {C S A M P L E} \geq V _ {I N} \times (1 - 2 ^ {- (n + 1)})
$$

The minimum sampling time for a given t<sub>SAMPLEHOLD</sub> $R _ { S O U R C E }$ can be found using this formula:

$$
t _ {S A M P L E H O L D} \geq (R _ {S A M P L E} + R _ {S O U R C E}) \times (C _ {S A M P L E}) \times (n + 1) \times \ln (2)
$$

for a 12 bits accuracy:

$$
t _ {S A M P L E H O L D} \geq (R _ {S A M P L E} + R _ {S O U R C E}) \times (C _ {S A M P L E}) \times 9. 0 2
$$

where

$$
t _ {S A M P L E H O L D} = \frac {1}{2 \times f _ {A D C}}
$$

## 35.10.5 Digital to Analog Converter (DAC) Characteristics

Table 35-26. Operating Conditions<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DDANA}$ </td><td>Analog supply voltage</td><td></td><td>1.62</td><td>-</td><td>3.63</td><td>V</td></tr><tr><td> $AV_{REF}$ </td><td>External reference voltage</td><td></td><td>1.0</td><td>-</td><td> $V_{DDANA}-0.6$ </td><td>V</td></tr><tr><td></td><td>Internal reference voltage 1</td><td></td><td>-</td><td>1</td><td>-</td><td>V</td></tr><tr><td></td><td>Internal reference voltage 2</td><td></td><td>-</td><td> $V_{DDANA}$ </td><td>-</td><td>V</td></tr><tr><td></td><td>Linear output voltage range</td><td></td><td>0.05</td><td>-</td><td> $V_{DDANA}-0.05$ </td><td>V</td></tr><tr><td></td><td>Minimum resistive load</td><td></td><td>5</td><td>-</td><td>-</td><td>kΩ</td></tr><tr><td></td><td>Maximum capacitance load</td><td></td><td>-</td><td>-</td><td>100</td><td>pF</td></tr><tr><td> $I_{DD}$ </td><td>DC supply current(2)</td><td>Voltage pump disabled</td><td>-</td><td>184</td><td>230</td><td>μA</td></tr></table>

Notes: 1. These values are based on specifications otherwise noted.  
2. These values are based on characterization. These values are not covered by test limits in production.

Table 35-27. Clock and Timing<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="2"></td><td rowspan="2">Conversion rate</td><td rowspan="2"> $C_{load}=100pF$  $R_{load}>5kΩ$ </td><td>Normal mode</td><td>-</td><td>-</td><td>350</td><td rowspan="2">ksps</td></tr><tr><td>For  $\Delta_{DATA}=+/-1$ </td><td>-</td><td>-</td><td>1000</td></tr><tr><td rowspan="2"></td><td rowspan="2">Startup time</td><td colspan="2"> $V_{DDNA}>2.6V$ </td><td>-</td><td>-</td><td>2.85</td><td>μs</td></tr><tr><td colspan="2"> $V_{DDNA}<2.6V$ </td><td>-</td><td>-</td><td>10</td><td>μs</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

Table 35-28. Accuracy Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>RES</td><td>Input resolution</td><td colspan="2"></td><td></td><td></td><td>10</td><td>Bits</td></tr><tr><td rowspan="6">INL</td><td rowspan="6">Integral non-linearity</td><td rowspan="2"> $V_{REF} = Ext 1.0V$ </td><td> $V_{DD} = 1.6V$ </td><td>0.4</td><td>0.5</td><td>1.5</td><td rowspan="6">LSB</td></tr><tr><td> $V_{DD} = 3.6V$ </td><td>0.6</td><td>0.7</td><td>1.5</td></tr><tr><td rowspan="2"> $V_{REF} = V_{DDANA}$ </td><td> $V_{DD} = 1.6V$ </td><td>1.4</td><td>1.5</td><td>2.5</td></tr><tr><td> $V_{DD} = 3.6V$ </td><td>0.7</td><td>0.8</td><td>1.5</td></tr><tr><td rowspan="2"> $V_{REF} = INT1V$ </td><td> $V_{DD} = 1.6V$ </td><td>0.4</td><td>0.5</td><td>1.5</td></tr><tr><td> $V_{DD} = 3.6V$ </td><td>0.3</td><td>0.4</td><td>1.5</td></tr><tr><td rowspan="6">DNL</td><td rowspan="6">Differential non-linearity</td><td rowspan="2"> $V_{REF} = Ext 1.0V$ </td><td> $V_{DD} = 1.6V$ </td><td>+/-0.2</td><td>+/-0.5</td><td>+/-1.5</td><td rowspan="6">LSB</td></tr><tr><td> $V_{DD} = 3.6V$ </td><td>+/-0.4</td><td>+/-0.6</td><td>+/-1.2</td></tr><tr><td rowspan="2"> $V_{REF} = V_{DDANA}$ </td><td> $V_{DD} = 1.6V$ </td><td>+/-1.1</td><td>+/-1.3</td><td>+/-1.5</td></tr><tr><td> $V_{DD} = 3.6V$ </td><td>+/-1.0</td><td>+/-1.1</td><td>+/-1.2</td></tr><tr><td rowspan="2"> $V_{REF} = INT1V$ </td><td> $V_{DD} = 1.6V$ </td><td>+/-0.2</td><td>+/-0.6</td><td>+/-1.5</td></tr><tr><td> $V_{DD} = 3.6V$ </td><td>+/-0.3</td><td>+/-0.6</td><td>+/-1.6</td></tr><tr><td></td><td>Gain error</td><td colspan="2">Ext.  $V_{REF}$ </td><td>+/-1.5</td><td>+/-4.0</td><td>+/-10</td><td>mV</td></tr><tr><td></td><td>Offset error</td><td colspan="2">Ext.  $V_{REF}$ </td><td>+/-1.0</td><td>+/-2</td><td>+/-6</td><td>mV</td></tr></table>

Note: 1. All values measured using a conversion rate of 350ksps.

## 35.10.6 Analog Comparator Characteristics

Table 35-29. Electrical and Timing

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td></td><td>Positive input voltage range</td><td></td><td>0</td><td>-</td><td> $V_{DDANA}$ </td><td rowspan="2">V</td></tr><tr><td></td><td>Negative input voltage range</td><td></td><td>0</td><td>-</td><td> $V_{DDANA}$ </td></tr><tr><td rowspan="2"></td><td rowspan="2">Offset</td><td>Hysteresis = 0, Fast mode</td><td>-15</td><td>0.0</td><td>15</td><td rowspan="4">mV</td></tr><tr><td>Hysteresis = 0, Low power mode</td><td>-25</td><td>0.0</td><td>25</td></tr><tr><td rowspan="2"></td><td rowspan="2">Hysteresis</td><td>Hysteresis = 1, Fast mode</td><td>20</td><td>50</td><td>85</td></tr><tr><td>Hysteresis = 1, Low power mode</td><td>15</td><td>40</td><td>75</td></tr><tr><td rowspan="2"></td><td rowspan="2">Propagation delay</td><td>Changes for  $V_{ACM} = V_{DDANA}/2$ 100mV overdrive, Fast mode</td><td></td><td>90</td><td>180</td><td rowspan="2">ns</td></tr><tr><td>Changes for  $V_{ACM} = V_{DDANA}/2$ 100mV overdrive, Low power mode</td><td></td><td>282</td><td>520</td></tr><tr><td rowspan="2"> $t_{STARTUP}$ </td><td rowspan="2">Startup time</td><td>Enable to ready delayFast mode</td><td></td><td>1</td><td>2.6</td><td rowspan="2">μs</td></tr><tr><td>Enable to ready delayLow power mode</td><td></td><td>14</td><td>22</td></tr><tr><td rowspan="4"> $V_{SCALE}$ </td><td>INL(3)</td><td></td><td>-1.4</td><td>0.75</td><td>1.4</td><td rowspan="4">LSB</td></tr><tr><td>DNL(3)</td><td></td><td>-0.9</td><td>0.25</td><td>0.9</td></tr><tr><td>Offset Error (1)(2)</td><td></td><td>-0.2</td><td>0.260</td><td>0.92</td></tr><tr><td>Gain Error (1)(2)</td><td></td><td>-0.89</td><td>0.215</td><td>0.89</td></tr></table>

Notes: 1. According to the standard equation $V ( X ) = V _ { \bot S B } ^ { \bot } ( X + 1 ) ; V _ { \bot S B } = V _ { \Delta D A N A } / 6 4$  
2. Data computed with the Best Fit method  
3. Data computed using histogram

## 35.10.7 Bandgap Reference Characteristics

Table 35-30. Internal 1.1V Bandgap reference characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="2">INT1V</td><td rowspan="2">Internal 1.1V Bandgap reference</td><td>Over voltage and [-40°C, +85°C]</td><td>1.08</td><td>1.1</td><td>1.12</td><td rowspan="2">V</td></tr><tr><td>Over voltage at 25°C</td><td>1.07</td><td>1.1</td><td>1.11</td></tr></table>

## 35.10.8 Temperature Sensor Characteristics

## 35.10.8.1 Temperature Sensor Characteristics

Table 35-31. Temperature Sensor Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td></td><td>Temperature sensor output voltage</td><td>T=25°C, VDDANA=3.3V</td><td></td><td>0.688</td><td></td><td>V</td></tr><tr><td></td><td>Temperature sensor slope</td><td></td><td>2.06</td><td>2.16</td><td>2.26</td><td>mV/°C</td></tr><tr><td></td><td>Variation over VDDANA voltage</td><td>VDDANA=1.62V to 3.6V</td><td>-0.4</td><td>1.4</td><td>3.0</td><td>mV/V</td></tr><tr><td></td><td>Temperature Sensor accuracy</td><td>Using the method described in Section 35.10.8.2</td><td>-10</td><td>-</td><td>10</td><td>°C</td></tr></table>

Note: 1. These values are based on characterization. These values are not covered by test limits in production.  
2. See also rev C errata concerning the temperature sensor.

## 35.10.8.2 Software-based Refinement of the Actual Temperature

The temperature sensor behavior is linear but it depends on several parameters such as the internal voltage reference which itself depends on the temperature. To take this into account, each device contains a Temperature Log row with data measured and written during the production tests. These calibration values should be read by software to infer the most accurate temperature readings possible.

This Software Temperature Log row can be read at address 0x00806030. The Software Temperature Log row cannot be written.

This section specifies the Temperature Log row content and explains how to refine the temperature sensor output using the values in the Temperature Log row.

## Temperature Log Row

All values in this row were measured in the following conditions:

$\mathsf { V } _ { \mathsf { D D I N } } = \mathsf { V } _ { \mathsf { D D I O } } = \mathsf { V } _ { \mathsf { D D A N A } } = 3 . 3 \mathsf { V }$

z ADC Clock frequency = 1.0MHz

z ADC sample rate: 125ksps

z ADC sampling time: 57µs

z ADC mode: Free running mode, ADC averaging mode with 4 averaged samples

z Data computed on the average of 10 ADC conversions

z ADC voltage reference= 1.0V internal reference (INT1V)

z ADC input = temperature sensor

Table 35-32. Temperature Log Row Content

<table><tr><td>Bit Position</td><td>Name</td><td>Description</td></tr><tr><td>07:00</td><td>ROOM_TEMP_VAL_INT</td><td>Integer part of room temperature in °C</td></tr><tr><td>11:08</td><td>ROOM_TEMP_VAL_DEC</td><td>Decimal part of room temperature</td></tr><tr><td>19:12</td><td>HOT_TEMP_VAL_INT</td><td>Integer part of hot temperature in °C</td></tr><tr><td>23:20</td><td>HOT_TEMP_VAL_DEC</td><td>Decimal part of hot temperature</td></tr><tr><td>31:24:00</td><td>ROOM_INT1V_VAL</td><td>2's complement of the internal 1V reference drift at room temperature (versus a 1.0 centered value)</td></tr><tr><td>39:32:00</td><td>HOT_INT1V_VAL</td><td>2's complement of the internal 1V reference drift at hot temperature (versus a 1.0 centered value)</td></tr><tr><td>51:40:00</td><td>ROOM_ADC_VAL</td><td>12bit ADC conversion at room temperature</td></tr><tr><td>63:52:00</td><td>HOT_ADC_VAL</td><td>12bit ADC conversion at hot temperature</td></tr></table>

The temperature sensor values are logged during test production flow for Room and Hot insertions:

ROOM\_TEMP\_VAL\_INT and ROOM\_TEMP\_VAL\_DEC contains the measured temperature at room insertion (e.g. for ROOM\_TEMP\_VAL\_INT=25 and ROOM\_TEMP\_VAL\_DEC=2, the measured temperature at room insertion is 25.2°C).

z HOT\_TEMP\_VAL\_INT and HOT\_TEMP\_VAL\_DEC contains the measured temperature at hot insertion (e.g. for HOT\_TEMP\_VAL\_INT=83 and HOT\_TEMP\_VAL\_DEC=3, the measured temperature at room insertion is 83.3°C).

The temperature log row also contains the corresponding 12bit ADC conversions of both Room and Hot temperatures:

ROOM\_ADC\_VAL contains the 12bit ADC value corresponding to (ROOM\_TEMP\_VAL\_INT, ROOM\_TEMP\_VAL\_DEC)

HOT\_ADC\_VAL contains the 12bit ADC value corresponding to (HOT\_TEMP\_VAL\_INT, HOT\_TEMP\_VAL\_DEC)

The temperature log row also contains the corresponding 1V internal reference of both Room and Hot temperatures:

ROOM\_INT1V\_VAL is the 2’s complement of the internal 1V reference value corresponding to (ROOM\_TEMP\_VAL\_INT, ROOM\_TEMP\_VAL\_DEC)

HOT\_INT1V\_VAL is the 2’s complement of the internal 1V reference value corresponding to (HOT\_TEMP\_VAL\_INT, HOT\_TEMP\_VAL\_DEC)

ROOM\_INT1V\_VAL and HOT\_INT1V\_VAL values are centered around 1V with a 0.001V step. In other words, the range of values [0,127] corresponds to [1V, 0.873V] and the range of values [-1, -127] corresponds to [1.001V, 1.127V]. INT1V == 1 - (VAL/1000) is valid for both ranges.

## Using Linear Interpolation

For concise equations, we’ll use the following notations:

z (ROOM\_TEMP\_VAL\_INT, ROOM\_TEMP\_VAL\_DEC) is denoted $\tan \beta _ { \mathsf { R } }$

z (HOT\_TEMP\_VAL\_INT, HOT\_TEMP\_VAL\_DEC) is denoted temp<sub>H</sub>

z ROOM\_ADC\_VAL is denoted $\mathsf { A D C } _ { \mathsf { R } }$ , its conversion to Volt is denoted $\mathsf { V } _ { \mathsf { A D C R } }$

z HOT\_ADC\_VAL is denoted ${ \mathsf { A D C } } _ { \mathsf { H } } ,$ , its conversion to Volt is denoted $\mathsf { V } _ { \mathsf { A D C H } }$

z ROOM\_INT1V\_VAL is denoted INT $\mathsf { 1 V _ { R } }$

z HOT\_INT1V\_VAL is denoted $\mathsf { I N T 1 V _ { H } }$

Using the $( \mathsf { t e m p } _ { \mathsf { R } } , \mathsf { A D C } _ { \mathsf { R } } )$ and $( \mathsf { t e m p } _ { \mathsf { H } } , \mathsf { A D C } _ { \mathsf { H } } )$ points, using a linear interpolation we have the following equation:

$$
\left(\frac {V _ {A D C} - V _ {A D C R}}{t e m p - t e m p _ {R}}\right) = \left(\frac {V _ {A D C H} - V _ {A D C R}}{t e m p _ {H} - t e m p _ {R}}\right)
$$

Given a temperature sensor ADC conversion value $\mathsf { A D C } _ { \mathsf { m } } ,$ we can infer a coarse value of the temperature temp<sub>C</sub> as:

[Equation 1]

$$
\operatorname{temp} _ {C} = \operatorname{temp} _ {R} + \left[ \frac {\left\{\left(A D C _ {m} \cdot \frac {1}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\} \cdot \left(\operatorname{temp} _ {H} - \operatorname{temp} _ {R}\right)}{\left\{\left(A D C _ {H} \cdot \frac {I N T 1 V _ {H}}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\}} \right]
$$

Note 1: in the previous expression, we’ve added the conversion of the ADC register value to be expressed in V Note 2: this is a coarse value because we assume INT1V=1V for this ADC conversion.

Using the $( \mathsf { t e m p } _ { \mathsf { R } } , \mathsf { I N T } 1 \mathsf { V } _ { \mathsf { R } } )$ and $\mathsf { ( t e m p _ { H } , \mathsf { I N T } 1 V _ { H } ) }$ points, using a linear interpolation we have the following equation:

$$
\left(\frac {I N T 1 V - I N T 1 V _ {R}}{t e m p - t e m p _ {R}}\right) = \left(\frac {I N T 1 V _ {H} - I N T 1 V _ {R}}{t e m p _ {H} - t e m p _ {R}}\right)
$$

Then using the coarse temperature value, we can infer a closer to reality INT1V value during the ADC conversion as:

$$
I N T 1 V _ {m} = I N T 1 V _ {R} + \left(\frac {(I N T 1 V _ {H} - I N T 1 V _ {R}) \cdot (t e m p _ {C} - t e m p _ {R})}{(t e m p _ {H} - t e m p _ {R})}\right)
$$

Back to [Equation 1], we replace $\lvert \lvert \mathsf { N T } \rvert \vee = 1 \vee$ by $\mathsf { I N T 1 V } = \mathsf { I N T 1 V } _ { \mathsf { m } } ,$ , we can then deduce a finer temperature value as:

[Equation 1bis]

$$
\operatorname{temp} _ {f} = \operatorname{temp} _ {R} + \left[ \frac {\left\{\left(A D C _ {m} \cdot \frac {I N T 1 V _ {m}}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\} \cdot \left(\operatorname{temp} _ {H} - \operatorname{temp} _ {R}\right)}{\left\{\left(A D C _ {H} \cdot \frac {I N T 1 V _ {H}}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\}} \right]
$$

## 35.11 NVM Characteristics

Table 35-33. Maximum Operating Frequency

<table><tr><td> $V_{DD}$  range</td><td>NVM Wait States</td><td>Maximum Operating Frequency</td><td>Units</td></tr><tr><td rowspan="4">1.62V to 2.7V</td><td>0</td><td>14</td><td rowspan="6">MHz</td></tr><tr><td>1</td><td>28</td></tr><tr><td>2</td><td>42</td></tr><tr><td>3</td><td>48</td></tr><tr><td rowspan="2">2.7V to 3.63V</td><td>0</td><td>24</td></tr><tr><td>1</td><td>67</td></tr></table>

Note that on this flash technology, a max number of 8 consecutive write is allowed per row. Once this number is reached, a row erase is mandatory.

Table 35-34. Flash Endurance and Data Retention

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $Ret_{NVM25k}$ </td><td>Retention after up to 25k</td><td>Average ambient 55°C</td><td>10</td><td>50</td><td>-</td><td>Years</td></tr><tr><td> $Ret_{NVM2.5k}$ </td><td>Retention after up to 2.5k</td><td>Average ambient 55°C</td><td>20</td><td>100</td><td>-</td><td>Years</td></tr><tr><td> $Ret_{NVM100}$ </td><td>Retention after up to 100</td><td>Average ambient 55°C</td><td>25</td><td>&gt;100</td><td>-</td><td>Years</td></tr><tr><td> $Cyc_{NVM}$ </td><td> $Cycling\ Endurance^{(1)}$ </td><td>-40°C &lt; Ta &lt; 85°C</td><td>25k</td><td>150k</td><td>-</td><td>Cycles</td></tr></table>

Note: 1. An endurance cycle is a write and an erase operation.

Table 35-35. EEPROM Emulation<sup>(1)</sup> Endurance and Data Retention

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $Ret_{EEPROM100k}$ </td><td>Retention after up to 100k</td><td>Average ambient 55°C</td><td>10</td><td>50</td><td>-</td><td>Years</td></tr><tr><td> $Ret_{EEPROM10k}$ </td><td>Retention after up to 10k</td><td>Average ambient 55°C</td><td>20</td><td>100</td><td>-</td><td>Years</td></tr><tr><td> $Cyc_{EEPROM}$ </td><td> $Cycling\ Endurance^{(2)}$ </td><td>-40°C &lt; Ta &lt; 85°C</td><td>100k</td><td>600k</td><td>-</td><td>Cycles</td></tr></table>

Notes: 1. The EEPROM emulation is a software emulation described in the App note AT03265.  
2. An endurance cycle is a write and an erase operation.

Table 35-36. NVM Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $t_{FPP}$ </td><td>Page programming time</td><td>-</td><td>-</td><td>-</td><td>2.5</td><td>ms</td></tr><tr><td> $t_{FRE}$ </td><td>Row erase time</td><td>-</td><td>-</td><td>-</td><td>6</td><td>ms</td></tr><tr><td> $t_{FCE}$ </td><td>DSU chip erase time (CHIP_ERASE)</td><td>-</td><td>-</td><td>-</td><td>240</td><td>ms</td></tr></table>

Table 35-37. Flash Erase and Programming Current

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $\text{IDD}_{\text{NVM}}$ </td><td>Maximum current (peak) during whole programming or erase operation</td><td>-</td><td>10</td><td>-</td><td>mA</td></tr></table>

## 35.12 Oscillators Characteristics

## 35.12.1 Crystal Oscillator (XOSC) Characteristics

## 35.12.1.1 Digital Clock Characteristics

The following table describes the characteristics for the oscillator when a digital clock is applied on XIN.

Table 35-38. Digital Clock Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{CPXIN}$ </td><td>XIN clock frequency</td><td>Digital mode</td><td>-</td><td>-</td><td>32</td><td>MHz</td></tr></table>

## 35.12.1.2 Crystal Oscillator Characteristics

The following table describes the characteristics for the oscillator when a crystal is connected between XIN and XOUT as shown in Figure 35-6. The user must choose a crystal oscillator where the crystal load capacitance $\mathsf C _ { \mathsf { L } }$ is within the range given in the table. The exact value of $\mathsf C _ { \mathrm { L } }$ can be found in the crystal datasheet. The capacitance of the external capacitors $( { \mathsf { C } } _ { \mathsf { L E X T } } )$ can then be computed as follows:

$$
\mathrm{C} _ {\mathrm{LEXT}} = 2 (\mathrm{C} _ {\mathrm{L}} - \mathrm{C} _ {\mathrm{STRAY}} - \mathrm{C} _ {\mathrm{SHUNT}})
$$

where $\mathsf { C } _ { \mathsf { S T R A Y } }$ is the capacitance of the pins and PCB, $\mathsf { C } _ { \mathsf { S H U N T } }$ is the shunt capacitance of the crystal.

Table 35-39. Crystal Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Crystal oscillator frequency</td><td></td><td>0.4</td><td>-</td><td>32</td><td>MHz</td></tr><tr><td rowspan="6">ESR</td><td rowspan="6">Crystal Equivalent Series Resistance Safety Factor = 3</td><td>f = 0.455MHz,  $C_L$  = 100pFXOSC.GAIN = 0</td><td>-</td><td>-</td><td>5.6K</td><td rowspan="6">Ω</td></tr><tr><td>f = 2MHz,  $C_L$  = 20pFXOSC.GAIN = 0</td><td>-</td><td>-</td><td>416</td></tr><tr><td>f = 4MHz,  $C_L$  = 20pFXOSC.GAIN = 1</td><td>-</td><td>-</td><td>243</td></tr><tr><td>f = 8MHz,  $C_L$  = 20pFXOSC.GAIN = 2</td><td>-</td><td>-</td><td>138</td></tr><tr><td>f = 16MHz,  $C_L$  = 20pFXOSC.GAIN = 3</td><td>-</td><td>-</td><td>66</td></tr><tr><td>f = 32MHz,  $C_L$  = 18pFXOSC.GAIN = 4</td><td>-</td><td>-</td><td>56</td></tr><tr><td> $C_{XIN}$ </td><td>Parasitic capacitor load</td><td rowspan="2"></td><td>-</td><td>6.5</td><td>-</td><td>pF</td></tr><tr><td> $C_{XOUT}$ </td><td>Parasitic capacitor load</td><td>-</td><td>4.3</td><td>-</td><td>pF</td></tr><tr><td rowspan="10"> $I_{XOSC}$ </td><td rowspan="10">Current Consumption</td><td>f = 2MHz,  $C_L$ = 20pF, AGC off</td><td></td><td>65</td><td>85</td><td rowspan="10">μA</td></tr><tr><td>f = 2MHz,  $C_L$ = 20pF, AGC on</td><td></td><td>52</td><td>73</td></tr><tr><td>f = 4MHz,  $C_L$ = 20pF, AGC off</td><td></td><td>117</td><td>150</td></tr><tr><td>f = 4MHz,  $C_L$ = 20pF, AGC on</td><td></td><td>74</td><td>100</td></tr><tr><td>f = 8MHz,  $C_L$ = 20pF, AGC off</td><td></td><td>226</td><td>296</td></tr><tr><td>f = 8MHz,  $C_L$ = 20pF, AGC on</td><td></td><td>128</td><td>172</td></tr><tr><td>f = 16MHz,  $C_L$ = 20pF, AGC off</td><td></td><td>502</td><td>687</td></tr><tr><td>f = 16MHz,  $C_L$ = 20pF, AGC on</td><td></td><td>307</td><td>552</td></tr><tr><td>f = 32MHz,  $C_L$ = 18pF, AGC off</td><td></td><td>1622</td><td>2200</td></tr><tr><td>f = 32MHz,  $C_L$ = 18pF, AGC on</td><td></td><td>615</td><td>1200</td></tr><tr><td rowspan="5"> $t_{STARTUP}$ </td><td rowspan="5">Startup time</td><td>f = 2MHz,  $C_L$ = 20pF,XOSC.GAIN = 0, ESR = 600Ω</td><td></td><td>14K</td><td>48K</td><td rowspan="5">cycles</td></tr><tr><td>f = 4MHz,  $C_L$ = 20pF,XOSC.GAIN = 1, ESR = 100Ω</td><td></td><td>6800</td><td>19.5K</td></tr><tr><td>f = 8MHz,  $C_L$ = 20pF,XOSC.GAIN = 2, ESR = 35Ω</td><td></td><td>5550</td><td>13K</td></tr><tr><td>f = 16MHz,  $C_L$ = 20pF,XOSC.GAIN = 3, ESR = 25Ω</td><td></td><td>6750</td><td>14.5K</td></tr><tr><td>f = 32MHz,  $C_L$ = 18pF,XOSC.GAIN = 4, ESR = 40Ω</td><td></td><td>5.3K</td><td>9.6K</td></tr></table>

Figure 35-6. Oscillator Connection  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_cdf517ad14063df58927255a9154034628ae9240bce4a8951d40df51e757a499.jpg)

## 35.12.2 External 32kHz Crystal Oscillator (XOSC32K) Characteristics

## 35.12.2.1 Digital Clock Characteristics

The following table describes the characteristics for the oscillator when a digital clock is applied on XIN32 pin.

Table 35-40. Digital Clock Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{CPXIN32}$ </td><td>XIN32 clock frequency</td><td>Digital mode</td><td>-</td><td>32.768</td><td>-</td><td>kHz</td></tr><tr><td></td><td>XIN32 clock duty cycle</td><td>Digital mode</td><td>-</td><td>50</td><td>-</td><td>%</td></tr></table>

## 35.12.2.2 Crystal Oscillator Characteristics

Figure 35-6 and the equation in “Crystal Oscillator Characteristics” on page 886 also applies to the 32kHz oscillator connection. The user must choose a crystal oscillator where the crystal load capacitance $\mathsf C _ { \mathsf { L } }$ is within the range given in the table. The exact value of $\mathsf C _ { \mathsf { L } }$ can be found in the crystal datasheet.

Table 35-41. 32kHz Crystal Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Crystal oscillator frequency</td><td></td><td>-</td><td>32768</td><td></td><td>Hz</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td> $\text{ESR}_{\text{XTAL}} = 39.9\text{k}\Omega, \text{C}_L = 12.5\text{pF}$ </td><td>-</td><td>28K</td><td>30K</td><td>cycles</td></tr><tr><td> $C_L$ </td><td>Crystal load capacitance</td><td></td><td>-</td><td>-</td><td>12.5</td><td rowspan="4">pF</td></tr><tr><td> $C_{SHUNT}$ </td><td>Crystal shunt capacitance</td><td></td><td>-</td><td>0.1</td><td></td></tr><tr><td> $C_{XIN32}$ </td><td>Parasitic capacitor load</td><td rowspan="2">SOIC20/14 packages</td><td>-</td><td>6.5</td><td></td></tr><tr><td> $C_{XOUT32}$ </td><td>Parasitic capacitor load</td><td>-</td><td>4.3</td><td></td></tr><tr><td> $I_{XOSC32K}$ </td><td>Current consumption</td><td></td><td>-</td><td>1.22</td><td>2.19</td><td>μA</td></tr><tr><td>ESR</td><td>Crystal equivalent series resistance f=32.768kHz Safety Factor = 3</td><td> $C_L=12.5\text{pF}$ </td><td>-</td><td>-</td><td>100</td><td>kΩ</td></tr></table>

## 35.12.3 Digital Frequency Locked Loop (DFLL48M) Characteristics

Table 35-42. DFLL48M Characteristics - Open Loop Mode<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Output frequency</td><td>DFLLVAL.COARSE = DFLL48M COARSE CAL DFLLVAL.FINE = 512</td><td>47</td><td>48</td><td>49</td><td>MHz</td></tr><tr><td> $I_{DFLL}$ </td><td>Power consumption on  $V_{DDIN}$ </td><td>DFLLVAL.COARSE = DFLL48M COARSE CAL DFLLVAL.FINE = 512</td><td>-</td><td>403</td><td>453</td><td>μA</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td>DFLLVAL.COARSE = DFLL48M COARSE CAL DFLLVAL.FINE = 512 $f_{OUT}$  within 90% of final value</td><td></td><td>8</td><td>9</td><td>μs</td></tr></table>

Note: 1. DFLL48M in Open loop after calibration at room temperature.

Table 35-43. DFLL48M Characteristics - Close Loop Mode<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Average Output frequency</td><td> $f_{REF}=32.768kHz$ </td><td>47.76</td><td>48</td><td>48.24</td><td>MHz</td></tr><tr><td> $f_{REF}$ </td><td>Reference frequency</td><td></td><td>0.732</td><td>32.768</td><td>33</td><td>kHz</td></tr><tr><td>Jitter</td><td>Cycle to Cycle jitter</td><td> $f_{REF}=32.768kHz$ </td><td>-</td><td>-</td><td>0.42</td><td>ns</td></tr><tr><td> $I_{DFLL}$ </td><td>Power consumption on  $V_{DDIN}$ </td><td> $f_{REF}=32.768kHz$ </td><td>-</td><td>403</td><td>453</td><td>μA</td></tr><tr><td> $t_{LOCK}$ </td><td>Lock time</td><td> $f_{REF}=32.768kHz$  $DFLLVAL.COARSE=DFLL48M COARSE CAL$  $DFLLVAL.FINE=512$  $DFLLCTRL.BPLCKC=1$  $DFLLCTRL.QLDIS=0$  $DFLLCTRL.CCDIS=1$  $DFLLMUL.FSTEP=10$ </td><td></td><td>200</td><td>500</td><td>μs</td></tr></table>

Note: 1. To insure that the device stays within the maximum allowed clock frequency, any reference clock for DFLL in close loop must be within a 2% error accuracy.

## 35.12.4 32.768kHz Internal oscillator (OSC32K) Characteristics

Table 35-44. 32kHz RC Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $f_{OUT}$ </td><td rowspan="3">Output frequency</td><td>Calibrated against a 32.768kHz reference at 25°C, over [-40, +85]°C, over [1.62, 3.63]V</td><td>30.3</td><td>32.768</td><td>34.2</td><td rowspan="3">kHz</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, at  $V_{DD}=3.3V$ </td><td>32.6</td><td>32.768</td><td>32.8</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, over [1.62, 3.63]V</td><td>32.4</td><td>32.7680.67</td><td>33.11.31</td></tr><tr><td> $I_{OSC32K}$ </td><td>Current consumption</td><td></td><td></td><td></td><td></td><td>μA</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td></td><td></td><td>1</td><td>2</td><td>cycle</td></tr><tr><td>Duty</td><td>Duty Cycle</td><td></td><td></td><td>50</td><td></td><td>%</td></tr></table>

## 35.12.5 Ultra Low Power Internal 32kHz RC Oscillator (OSCULP32K) Characteristics

Table 35-45. Ultra Low Power Internal 32kHz RC Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $f_{OUT}$ </td><td rowspan="3">Output frequency</td><td>Calibrated against a 32.768kHz reference at 25°C, over [-40, +85]C, over [1.62, 3.63]V</td><td>27.8</td><td>32.768</td><td>37.8</td><td rowspan="3">kHz</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, at  $V_{DD}=3.3V$ </td><td>32.85</td><td>32.768</td><td>32.8</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, over [1.62, 3.63]V</td><td>31.9</td><td>32.768</td><td>33.1</td></tr><tr><td>Duty</td><td>Duty Cycle</td><td></td><td></td><td>50</td><td></td><td>%</td></tr></table>

## 35.12.6 Multi RC Oscillator (OSC8M) Characteristics

Table 35-46. Multi RC Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $f_{OUT}$ </td><td rowspan="3">Output frequency</td><td>Calibrated against a 8MHz reference at 25°C, over [-40, +85]C, over [1.62, 3.63]V</td><td>7.8</td><td>8</td><td>8.14</td><td rowspan="3">MHz</td></tr><tr><td>Calibrated against a 8MHz reference at 25°C, at  $V_{DD}=3.3V$ </td><td>7.94</td><td>8</td><td>8.06</td></tr><tr><td>Calibrated against a 8MHz reference at 25°C, over [1.62, 3.63]V</td><td>7.92</td><td>8</td><td>8.08</td></tr><tr><td>TempCo</td><td>Freq vs. temperature drift</td><td></td><td>-2.3</td><td></td><td>1.6</td><td>%</td></tr><tr><td>SupplyCo</td><td>Freq vs supply drift</td><td></td><td>-1</td><td></td><td>1</td><td>%</td></tr><tr><td> $I_{OSC8M}$ </td><td>Current consumption</td><td>IDLE2 on OSC32K versus IDLE2 on calibrated OSC8M enabled at 8MHz (FRANGE=1, PRESC=0)</td><td></td><td>64</td><td>96</td><td>μA</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td></td><td></td><td>2.4</td><td>3.3</td><td>μs</td></tr><tr><td>Duty</td><td>Duty cycle</td><td></td><td></td><td>50</td><td></td><td>%</td></tr></table>

## 35.12.7 Fractional Digital Phase Locked Loop (FDPLL96M) Characteristics

Table 35-47. FDPLL96M Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{IN}$ </td><td>Input frequency</td><td></td><td>32</td><td>-</td><td>2000</td><td>KHz</td></tr><tr><td> $f_{OUT}$ </td><td>Output frequency</td><td></td><td>48</td><td>-</td><td>96</td><td>MHz</td></tr><tr><td rowspan="2"> $I_{FDPLL96M}$ </td><td rowspan="2">Current consumption</td><td> $f_{IN}= 32 kHz, f_{OUT}= 48 MHz$ </td><td></td><td>400</td><td>700</td><td rowspan="2">μA</td></tr><tr><td> $f_{IN}= 32 kHz, f_{OUT}= 96 MHz$ </td><td></td><td>650</td><td>900</td></tr><tr><td rowspan="4">Jp</td><td rowspan="4">Period jitter</td><td> $f_{IN}= 32 kHz, f_{OUT}= 48 MHz$ </td><td></td><td>1.5</td><td>2</td><td rowspan="4">%</td></tr><tr><td> $f_{IN}= 32 kHz, f_{OUT}= 96 MHz$ </td><td></td><td>3.0</td><td>10</td></tr><tr><td> $f_{IN}= 2 MHz, f_{OUT}= 48 MHz$ </td><td></td><td>1.3</td><td>2</td></tr><tr><td> $f_{IN}= 2 MHz, f_{OUT}= 96 MHz$ </td><td></td><td>3.0</td><td>7</td></tr><tr><td rowspan="2"> $t_{LOCK}$ </td><td rowspan="2">Lock Time</td><td>After startup, time to get lock signal. $f_{IN}= 32 kHz, f_{OUT}= 96 MHz$ </td><td></td><td>1.3</td><td>2</td><td>ms</td></tr><tr><td> $f_{IN}= 2 MHz, f_{OUT}= 96 MHz$ </td><td></td><td>25</td><td>50</td><td>μs</td></tr><tr><td>Duty</td><td>Duty cycle</td><td></td><td>40</td><td>50</td><td>60</td><td>%</td></tr></table>

Note: 1. All values have been characterized with FILTSEL[1/0] as default value.

## 35.13 PTC Typical Characteristics

Figure 35-7. Power consumption [µA]. 1 sensor, Frequency mode = None, CPU Clk = 48MHz, PTC Clk = 4MHz, V<sub>DD</sub>=3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_1ffe0273dca6df7e1aea7d1c8ed0e647cd042cec2cfb700200999dd0ac953c85.jpg)

Figure 35-8. Power consumption [µA].  
1 sensor, Frequency mode = HOP, CPU Clk = 48MHz, PTC Clk = 2MHz, V<sub>DD</sub>=3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_f16ad60a3609a1845dd559c34723da1aed35e97cf948b6eda54b45945e5648ea.jpg)

Figure 35-9. Power consumption [µA]. 10 sensors, Frequency mode = None, CPU Clk = 48MHz, PTC Clk = 4MHz, V =3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_a8e0edf0d5da41c2c78b4c3b09d416de9782c0aa323c28da8a1bbe4f61da195f.jpg)

Figure 35-10.Power consumption [µA]. 10 sensors, Frequency mode = HOP, CPU Clk = 48MHz, PTC Clk = 2MHz, V<sub>DD</sub>=3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_483bef8d42d69225e366b3250e9cb645948adbf8382935ee1494cf264d7d77f7.jpg)

Figure 35-11.Power consumption [µA]. 50 sensors, Frequency mode = None, CPU Clk = 48MHz, PTC Clk = 4MHz, V =3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c8f2b7b1e652457a1e3fa84204f58c4e34cb215a670ba0436a1cce5f08acdd07.jpg)

Figure 35-12.Power consumption [µA].  
50 sensors, Frequency mode = HOP, CPU Clk = 48MHz, PTC Clk = 2MHz, V<sub>DD</sub>=3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_e8929c833fef05c2822855b95e24efa84746668eb21a2fbbbf87905510a3fe1a.jpg)

Figure 35-13.CPU utilization.  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c5684ae86e079281ce1d2fd1c4720eb9e0e92f32c9dfc5ab7d38845ef0c356ba.jpg)

## 35.14 USB Characteristics

The USB on-chip buffers comply with the Universal Serial Bus (USB) v2.0 standard. All AC parameters related to these buffers can be found within the USB 2.0 electrical specifications.

The USB interface is USB-IF certified:

TID 40001664 - Peripheral Silicon > Low/Full Speed > Silicon Building Blocks

Electrical configuration required to be USB compliance:

\- The CPU frequency must be higher 8MHz when USB is active (No constraint for USB suspend mode)

\- The operating voltages must be 3.3V (Min. 3.0V, Max. 3.6V).

\- The GCLK\_USB frequency accuracy source must be less than:

\- In USB device mode, 48MHz +/-0.25%

Table 35-48. GCLK\_USB Clock Setup Recommendations

<table><tr><td colspan="2">Clock setup</td><td>USB Device</td></tr><tr><td rowspan="4">DFLL48M</td><td>Open loop</td><td>No</td></tr><tr><td>Closed loop, any internal OSC source</td><td>No</td></tr><tr><td>Closed loop, any external XOSC source</td><td>Yes</td></tr><tr><td>Closed loop, USB SOF source (USB recovery mode) $^{(1)}$ </td><td>Yes $^{(2)}$ </td></tr><tr><td rowspan="3">FDPLL96M</td><td>Any internal OSC source (32K, 8M, ... )</td><td>No</td></tr><tr><td>Any external XOSC source (&lt; 1MHz)</td><td>Yes</td></tr><tr><td>Any external XOSC source (&gt; 1MHz)</td><td>Yes $^{(3)}$ </td></tr></table>

Notes: 1. When using DFLL48M in USB recovery mode, the Fine Step value must be Ah to guarantee a USB clock at +/-0.25% before 11ms after a resume.

## 35.15 Timing Characteristics

## 35.15.1 External Reset

Table 35-49. External reset characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Condition</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $t_{EXT}$ </td><td>Minimum reset pulse width</td><td></td><td>10</td><td>-</td><td>-</td><td>ns</td></tr></table>

## 35.15.2 SERCOM in SPI Mode Timing

Figure 35-14.SPI timing requirements in master mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_4aa696d85d726aae1db7f0e34a3103fad0d2a8646b53607772bc6b8fcf79eda2.jpg)

Figure 35-15.SPI timing requirements in slave mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_915beaa5b4bb83c110c965a471493742ada8a77ffdc337d4b7199d6888d1cc3a.jpg)

Table 35-50. SPI timing characteristics and requirements<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $t_{SCK}$ </td><td>SCK period</td><td colspan="2">Master</td><td></td><td>84</td><td></td><td rowspan="21">ns</td></tr><tr><td> $t_{SCKW}$ </td><td>SCK high/low width</td><td colspan="2">Master</td><td>-</td><td>0.5 $*t_{SCK}$ </td><td>-</td></tr><tr><td> $t_{SCKR}$ </td><td>SCK rise time(2)</td><td colspan="2">Master</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{SCKF}$ </td><td>SCK fall time(2)</td><td colspan="2">Master</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{MIS}$ </td><td>MISO setup to SCK</td><td colspan="2">Master</td><td>-</td><td>21</td><td>-</td></tr><tr><td> $t_{MIH}$ </td><td>MISO hold after SCK</td><td colspan="2">Master</td><td>-</td><td>13</td><td>-</td></tr><tr><td> $t_{MOS}$ </td><td>MOSI setup SCK</td><td colspan="2">Master</td><td>-</td><td> $t_{SCK}/2 - 3$ </td><td>-</td></tr><tr><td> $t_{MOH}$ </td><td>MOSI hold after SCK</td><td colspan="2">Master</td><td>-</td><td>3</td><td>-</td></tr><tr><td> $t_{SSCK}$ </td><td>Slave SCK Period</td><td colspan="2">Slave</td><td>1 $*t_{CLK\_APB}$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SSCKW}$ </td><td>SCK high/low width</td><td colspan="2">Slave</td><td>0.5 $*t_{SSCK}$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SSCKR}$ </td><td>SCK rise time(2)</td><td colspan="2">Slave</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{SSCKF}$ </td><td>SCK fall time(2)</td><td colspan="2">Slave</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{SIS}$ </td><td>MOSI setup to SCK</td><td colspan="2">Slave</td><td> $t_{SSCK}/2 - 9$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SIH}$ </td><td>MOSI hold after SCK</td><td colspan="2">Slave</td><td> $t_{SSCK}/2 - 3$ </td><td>-</td><td>-</td></tr><tr><td rowspan="2"> $t_{SSS}$ </td><td rowspan="2"> $\overline{SS}$  setup to SCK</td><td rowspan="2">Slave</td><td>PRELOADEN=1</td><td>2 $*t_{CLK\_APB} + t_{SOS}$ </td><td>-</td><td>-</td></tr><tr><td>PRELOADEN=0</td><td> $t_{SOS}+7$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SSH}$ </td><td>SS hold after SCK</td><td colspan="2">Slave</td><td> $t_{SIH} - 4$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SOS}$ </td><td>MISO setup SCK</td><td colspan="2">Slave</td><td>-</td><td> $t_{SSCK}/2 - 18$ </td><td>-</td></tr><tr><td> $t_{SOH}$ </td><td>MISO hold after SCK</td><td colspan="2">Slave</td><td>-</td><td>18</td><td>-</td></tr><tr><td> $t_{SOSS}$ </td><td>MISO setup after  $\overline{SS}$  low</td><td colspan="2">Slave</td><td>-</td><td>18</td><td>-</td></tr><tr><td> $t_{SOSH}$ </td><td>MISO hold after  $\overline{SS}$  high</td><td colspan="2">Slave</td><td>-</td><td>10</td><td>-</td></tr></table>

Notes: 1. These values are based on simulation. These values are not covered by test limits in production.  
2. See “I/O Pin Characteristics” on page 867

## 35.15.3 SERCOM in I<sup>2</sup>C Mode Timing

Table 35-51 describes the requirements for devices connected to the ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ Interface Bus. Timing symbols refer to Figure 35-16.

Figure 35-16. I<sup>2</sup>C Interface Bus Timing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_df91d9320d8f40542bfca9e7cb1fd35c4ea8f79abf3e09f2defe2a38075fdd25.jpg)

Table 35-51. I<sup>2</sup>C Interface Timing<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $t_R$ </td><td rowspan="3">Rise time for both SDA and  $SCL^{(3)}$ </td><td>Standard / Fast mode</td><td> $C_b^{(2)} = 400pF$ </td><td>-</td><td>230</td><td>350</td><td rowspan="15">ns</td></tr><tr><td>Fast mode +</td><td> $C_b^{(2)} = 550pF$ </td><td>-</td><td>60</td><td>100</td></tr><tr><td>High speed mode</td><td> $C_b^{(2)} = 100pF$ </td><td>-</td><td>30</td><td>60</td></tr><tr><td rowspan="3"> $t_{OF}$ </td><td rowspan="3">Output fall time from  $V_{IHmin}$  to  $V_{ILmax}^{(3)}$ </td><td>Standard / Fast mode</td><td> $10pF < C_b^{(2)} < 400pF$ </td><td>-</td><td>25</td><td>50</td></tr><tr><td>Fast mode +</td><td> $10pF < C_b^{(2)} < 550pF$ </td><td>-</td><td>20</td><td>30</td></tr><tr><td>High speed mode</td><td> $10pF < C_b^{(2)} < 100pF$ </td><td>-</td><td>10</td><td>20</td></tr><tr><td> $t_{HD;STA}$ </td><td>Hold time (repeated) START condition</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td> $t_{LOW}-9$ </td><td>-</td><td>-</td></tr><tr><td> $t_{LOW}$ </td><td>Low period of SCL Clock</td><td></td><td> $f_{SCL} > 100kHz$ </td><td>113</td><td>-</td><td>-</td></tr><tr><td> $t_{BUF}$ </td><td>Bus free time between a STOP and a START condition</td><td></td><td> $f_{SCL} > 100kHz$ </td><td> $t_{LOW}$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SU;STA}$ </td><td>Setup time for a repeated START condition</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td> $t_{LOW}+7$ </td><td>-</td><td>-</td></tr><tr><td> $t_{HD;DAT}$ </td><td>Data hold time</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td>9</td><td>-</td><td>12</td></tr><tr><td> $t_{SU;DAT}$ </td><td>Data setup time</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td>104</td><td>-</td><td>-</td></tr><tr><td> $t_{SU;STO}$ </td><td>Setup time for STOP condition</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td> $t_{LOW}+9$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SU;DAT;Rx}$ </td><td>Data setup time (receive mode)</td><td></td><td> $f_{SCL} > 100kHz, Slave$ </td><td>51</td><td>-</td><td>56</td></tr><tr><td> $t_{HD;DAT;Tx}$ </td><td>Data hold time (send mode)</td><td></td><td> $f_{SCL} > 100kHz, Slave$ </td><td>71</td><td>90</td><td>138</td></tr></table>

Notes: 1. These values are based on simulation. These values are not covered by test limits in production.  
2. Cb = Capacitive load on each bus line. Otherwise noted, value of ${ \mathsf { C } } _ { \mathsf { b } }$ set to 20pF.  
3. These values are based on characterization. These values are not covered by test limits in production.

Figure 35-17.SWD Interface Signals  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_ae99ccf539241de0747d50e534b38801dd4da90638408db9fbecdb058da1d2da.jpg)

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_0f1eee8a559e43aad99608cb8ce91374ae92220a05d3efe12e04b57d505ef428.jpg)

Table 35-52. SWD Interface Timings<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $T_{HIGH}$ </td><td>SWDCLK High period</td><td rowspan="5"> $V_{\text{VDDIO}}$  from 3.0V to 3.6V, maximum external capacitor = 40pF</td><td>10</td><td>500000</td><td rowspan="5">ns</td></tr><tr><td> $T_{LOW}$ </td><td>SWDCLK Low period</td><td>10</td><td>500000</td></tr><tr><td> $T_{OS}$ </td><td>SWDIO output skew to falling edge SWDCLK</td><td>-5</td><td>5</td></tr><tr><td> $T_{IS}$ </td><td>Input Setup time required between SWDIO</td><td>4</td><td>-</td></tr><tr><td> $T_{IH}$ </td><td>Input Hold time required between SWDIO and rising edge SWDCLK</td><td>1</td><td>-</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

## 36. Packaging Information

## 36.1 Thermal Considerations

## 36.1.1 Thermal Resistance Data

Table 6-1 on page 13 summarizes the thermal resistance data depending on the package.

Table 36-1. Thermal Resistance Data

<table><tr><td>Package Type</td><td> $\theta_{JA}$ </td><td> $\theta_{JC}$ </td><td>Units</td></tr><tr><td>24-pin QFN</td><td>61.7</td><td>25.4</td><td>°C/W</td></tr><tr><td>20-pin SOIC</td><td>44.0</td><td>21.0</td><td>°C/W</td></tr><tr><td>20-ball WLCSP</td><td>37.4</td><td>6.6</td><td>°C/W</td></tr><tr><td>14-pin SOIC</td><td>58.5</td><td>26.3</td><td>°C/W</td></tr></table>

## 36.1.2 Junction Temperature

The average chip-junction temperature, ${ \sf T } _ { \sf J } ,$ in $^ \circ \mathsf { C }$ can be obtained from the following:

Equation 1

$$
T _ {J} = T _ {A} + (P _ {D} \times \theta_ {J A})
$$

Equation 2

$$
T _ {J} = T _ {A} + (P _ {D} \times (\theta_ {H E A T S I N K} + \theta_ {J C}))
$$

where:

z $\theta _ { \mathsf { J A } } =$ package thermal resistance, Junction-to-ambient (°C/W), provided in Table 6-1 on page 13.

$\theta _ { \mathsf { J C } }$ = package thermal resistance, Junction-to-case thermal resistance (°C/W), provided in Table 6-1 on page 13.

z $\mathsf { \theta _ { H E A T S I N K } = }$ cooling device thermal resistance (°C/W), provided in the device datasheet.

z $\mathsf { P } _ { \mathsf { D } } = \mathsf { d e v i c e }$ power consumption (W).

$\mathsf { T } _ { \mathsf { A } } = \mathsf { a m b i e n t }$ temperature (°C).

From the Equation 1, the user can derive the estimated lifetime of the chip and decide if a cooling device is necessary or not. If a cooling device is to be fitted on the chip, the second equation should be used to compute the resulting average chip-junction temperature $\mathsf { T } _ { \mathsf { J } } \mathsf { i n } ^ { \circ } \mathsf { C }$

## 36.2.1 24-pin QFN

DRAWINGS NOT SCALED  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_9850ffef1a86a4142c031978fb36cb9227dc3d58a70b8abc5205ff37244c0469.jpg)  
TOP VIEW

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_4d17fc278d605aee9e151476586b28c79377edf98ea68d34ab95bf62fab5260c.jpg)  
SIDE VIEW

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_e7d85ce794ee7f3f8fcb3102e3d30bb1bbed0587572560ca1e8fc90abeae87c9.jpg)

COMMON DIMENSIONS (Unit of Measure = mm)

<table><tr><td>SYMBOL</td><td>MIN</td><td>NOM</td><td>MAX</td><td>NOTE</td></tr><tr><td>A</td><td>0.80</td><td>0.85</td><td>0.90</td><td></td></tr><tr><td>A1</td><td>0.00</td><td>----</td><td>0.05</td><td></td></tr><tr><td>A2</td><td>----</td><td>0.65</td><td>0.70</td><td></td></tr><tr><td>A3</td><td colspan="3">0.203 REF</td><td></td></tr><tr><td>D/E</td><td colspan="3">4.00 BSC</td><td></td></tr><tr><td>D2/E2</td><td>2.45</td><td>2.60</td><td>2.75</td><td></td></tr><tr><td>L</td><td>0.35</td><td>0.40</td><td>0.45</td><td></td></tr><tr><td>R</td><td>0.09</td><td>----</td><td>----</td><td></td></tr><tr><td>b</td><td>0.18</td><td>0.25</td><td>0.30</td><td>2</td></tr><tr><td>e</td><td colspan="3">0.50 BSC</td><td></td></tr><tr><td colspan="5">TOLERANCES OF FORM AND POSITION</td></tr><tr><td>aaa</td><td colspan="4">0.15</td></tr><tr><td>bbb</td><td colspan="4">0.10</td></tr><tr><td>ccc</td><td colspan="4">0.10</td></tr><tr><td>ddd</td><td colspan="4">0.05</td></tr><tr><td>eee</td><td colspan="4">0.08</td></tr><tr><td>fff</td><td colspan="4">0.10</td></tr><tr><td>n</td><td colspan="4">24</td></tr></table>

Notes : 1. This drawing is for general information only. Refer to JEDEC Drawing MO-220, Variation VGGD-6 for proper dimensions, tolerances, datums, etc. (excepted D2/E2 Min et Nom).  
2. Dimension b applies to metallized terminal and is measured between 0.15mm and 0.30mm from the terminal tip. If the terminal has the optical radius on the other end of the terminal, the dimension should not be measured in that radius area. 02/18/2014

## Table 36-2. Device and Package Maximum Weight

<table><tr><td>44</td><td>mg</td></tr></table>

## Table 36-3. Package Characteristics

<table><tr><td>Moisture Sensitivity Level</td><td>MSL3</td></tr></table>

## Table 36-4. Package Reference

<table><tr><td>JEDEC Drawing Reference</td><td>MO-220</td></tr><tr><td>JESD97 Classification</td><td>E3</td></tr></table>

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_3d80bb021b1def2a795c629cb46351f0cee67aa3802a58768b82f10c3100e05b.jpg)

<table><tr><td>SYMBOL</td><td>MIN</td><td>NOM</td><td>MAX</td><td>NOTE</td></tr><tr><td>A</td><td>2.35</td><td>2.50</td><td>2.65</td><td></td></tr><tr><td>A1</td><td>0.10</td><td>----</td><td>0.30</td><td></td></tr><tr><td>D</td><td>12.60</td><td>12.80</td><td>13.00</td><td>2</td></tr><tr><td>E</td><td>10.00</td><td>10.30</td><td>10.65</td><td></td></tr><tr><td>E1</td><td>7.40</td><td>7.50</td><td>7.60</td><td>3</td></tr><tr><td>L</td><td>0.40</td><td>----</td><td>1.27</td><td></td></tr><tr><td>b</td><td>0.31</td><td>----</td><td>0.51</td><td>4</td></tr><tr><td>c</td><td>0.20</td><td>----</td><td>0.33</td><td></td></tr><tr><td>e</td><td colspan="3">1.27 BSC</td><td></td></tr><tr><td>h</td><td>0.25</td><td>----</td><td>0.75</td><td></td></tr><tr><td>θ</td><td>0°</td><td>----</td><td>8°</td><td></td></tr><tr><td colspan="5">TOLERANCES OF FORM AND POSITION</td></tr><tr><td>aaa</td><td colspan="3">0.25</td><td></td></tr><tr><td>bbb</td><td colspan="3">0.25</td><td></td></tr><tr><td>ccc</td><td colspan="3">0.10</td><td></td></tr><tr><td>n</td><td colspan="3">20</td><td></td></tr></table>

Notes : 1. Thls drawlng Is for general Informatlon only. Refer to JEDEC DrawIng MS-013, Varlatlon AC. qe mq Mi  
2. DImenslons D does not Include mold Flash, protruslons or gate burrs, Mold Flash, protruslons or gate burrs shall not exceed 0.15mm per end. 3. DImenslons E1 does not Include Inter-lead Flash or protrusÍon. Inter-Iead Flash or protuslon shall not exceed 0.25mm per sIde  
4. DImenslons "b" does not Include the Dambar protruslon. Allowable Dambar protruslon shall be 0.10mm total In excess of the "b" dImenslon maxImum materlal condItlon. The Dambar may not be located on the lower radlus of the foot. 02/05/2014

Table 36-5. Device and Package Maximum Weight

<table><tr><td>530</td><td>mg</td></tr></table>

Table 36-6. Package Characteristics

<table><tr><td>Moisture Sensitivity Level</td><td>MSL3</td></tr></table>

Table 36-7. Package Reference

<table><tr><td>JEDEC Drawing Reference</td><td>MS-013</td></tr><tr><td>JESD97 Classification</td><td>E3</td></tr></table>

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_ac30ea59c1e3bfcbc125345a7457f5f800e2aa37e1a142b8c1deeb40a8e6dce7.jpg)  
Notes : 1. Dimension "b" is measured at the maximum ball diameter in a plane to the seating plane.

DRAWINGS NOT SCALED

## Table 36-8. Device and Package Maximum Weight

<table><tr><td>7</td><td>mg</td></tr></table>

Table 36-9. Package Characteristics

<table><tr><td>Moisture Sensitivity Level</td><td>MSL3</td></tr></table>

Table 36-10. Package Reference

<table><tr><td>JEDEC Drawing Reference</td><td>MS-220</td></tr><tr><td>JESD97 Classification</td><td>E8</td></tr></table>

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_10ce9a426500b64f4f21b2a8ea904c86730553017910778a40210c243b8a023d.jpg)

<table><tr><td>SYMBOL</td><td>MIN</td><td>NOM</td><td>MAX</td><td>NOTE</td></tr><tr><td>A</td><td>1.35</td><td>1.60</td><td>1.75</td><td></td></tr><tr><td>A1</td><td>0.10</td><td>----</td><td>0.25</td><td></td></tr><tr><td>D</td><td>8.55</td><td>8.65</td><td>8.75</td><td>2</td></tr><tr><td>E</td><td>5.80</td><td>6.00</td><td>6.20</td><td></td></tr><tr><td>E1</td><td>3.80</td><td>3.90</td><td>4.00</td><td>3</td></tr><tr><td>L</td><td>0.40</td><td>----</td><td>1.27</td><td></td></tr><tr><td>b</td><td>0.33</td><td>----</td><td>0.51</td><td>4</td></tr><tr><td>c</td><td>0.19</td><td>----</td><td>0.25</td><td></td></tr><tr><td>e</td><td colspan="3">1.27 BSC</td><td></td></tr><tr><td>h</td><td>0.25</td><td>----</td><td>0.50</td><td></td></tr><tr><td>θ</td><td>0°</td><td>----</td><td>8°</td><td></td></tr><tr><td colspan="5">TOLERANCES OF FORM AND POSITION</td></tr><tr><td>aaa</td><td colspan="3">0.25</td><td></td></tr><tr><td>bbb</td><td colspan="4">0.25</td></tr><tr><td>ccc</td><td colspan="3">0.10</td><td></td></tr><tr><td>n</td><td colspan="3">14</td><td></td></tr></table>

Notes : 1. ThIs drawIng Is for general Informatlon only. Refer to JEDEC Drawlng MS-012, Varlatlon AB. 2. Dimensjons D does not jnclude mold Flash, protrusjons or gate burrs. Mold Fíash, protrusjons and gate burrs shal not exceed 0.15mm (0.006 jn) per sjde. 3. Dimensions E1 does not include inter-lead Flash or protrusions, Inter-lead Flash and protrusions shall not exceed 0.25mm (0.010 in) per side. 4. Dimensions b does not include Dambar protrusion. Allowable Dambar protrusion shall be 0.10mm total in excess of the b dimension at 01/31/2014

## Table 36-11. Device and Package Maximum Weight

<table><tr><td>230</td><td>mg</td></tr></table>

## Table 36-12. Package Characteristics

<table><tr><td>Moisture Sensitivity Level</td><td>MSL3</td></tr></table>

Table 36-13. Package Reference

<table><tr><td>JEDEC Drawing Reference</td><td>MS-012</td></tr><tr><td>JESD97 Classification</td><td>E3</td></tr></table>

## 36.3 Soldering Profile

The following table gives the recommended soldering profile from J-STD-20.

<table><tr><td>Profile Feature</td><td>Green Package</td></tr><tr><td>Average Ramp-up Rate (217°C to peak)</td><td>3°C/s max</td></tr><tr><td>Preheat Temperature 175°C +/-25°C</td><td>150-200°C</td></tr><tr><td>Time Maintained Above 217°C</td><td>60-150s</td></tr><tr><td>Time within 5°C of Actual Peak Temperature</td><td>30s</td></tr><tr><td>Peak Temperature Range</td><td>260°C</td></tr><tr><td>Ramp-down Rate</td><td>6°C/s max</td></tr><tr><td>Time 25°C to Peak Temperature</td><td>8 minutes max</td></tr></table>

A maximum of three reflow passes is allowed per component.

## 37. Schematic Checklist

## 37.1 Introduction

A good hardware design comes from a proper schematic. This chapter describes a common checklist which should be used when starting and reviewing the schematics for the design of the device. This chapter illustrates a recommended power supply connection, how to connect external analog references, programmer, debugger, oscillator,crystal and USB.

## 37.1.1 Operation in Noisy Environment

If the microcontroller is operating in an environment with much electromagnetic noise it must be protected from this noise to ensure reliable operation. In addition to following best practice EMC design guidelines, the recommendations listed in the schematic checklist sections must be followed. In particular placing decoupling capacitors very close to the power pins, a RC-filter on the RESET pin, and a pull-up resistor on the SWCLK pin is critical for reliable operations. It is also relevant to eliminate or attenuate noise in order to avoid that it reaches supply pins, I/O pins and crystals.

## 37.2 Power Supply

The device supports a single power supply from 1.62 to 3.63V.

## 37.2.1 Power Supply Connections

Figure 37-1. Power Supply Schematic

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_26852609991bda6f8a55b031374adbcd88eee88986c95e19ab0d0f998d7e6e89.jpg)

Table 37-1. Power Supply Connections, $V _ { \tt D D C O R E }$ From Internal Regulator

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td> $V_{DDIO/IN/ANA}$ </td><td>1.6V to 3.6VDecoupling/filtering capacitors  $100nF^{(1)(2)}$  and  $4.7\mu F^{(1)}$ </td><td>Supply voltage</td></tr><tr><td>GND</td><td></td><td>Ground</td></tr></table>

Notes: 1. These values are only given as typical examples.

2. Decoupling capacitor should be placed close to the device for each supply pin pair in the signal group, low ESR caps should be used for better decoupling.

## 37.3 External Analog Reference Connections

The following schematic checklist is only necessary if the application is using one or more of the external analog references. If the internal references are used instead, the following circuits in Figure 37-2 and Figure 37-3 are no necessary.

Figure 37-2. External Analog Reference Schematic With Two References  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_5438bb27564d5c7d1d7f75bb5e4a4e5f650adbde9679f8443466c6d816388ce4.jpg)

Figure 37-3. External Analog Reference Schematic With One Reference  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_5c839e84231139aaf29d7ec249cc1a496bc7df54cfa8f13cd57f1f651bc7d387.jpg)

Table 37-2. External Analog Reference Connections

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td>VREFx</td><td>1.0V to  $V_{DDANA}$  - 0.6V for ADC1.0V to  $V_{DDANA}$  - 0.6V for DACDecoupling/filtering capacitors $100nF^{(1)(2)}$  and  $4.7\mu F^{(1)}$ </td><td>External reference from VREFx pin on the analog port</td></tr><tr><td>GND</td><td></td><td>Ground</td></tr></table>

Notes: 1. These values are given as a typical example.  
2. Decoupling capacitor should be placed close to the device for each supply pin pair in the signal group.

## 37.4 External Reset Circuit

The external reset circuit is connected to the RESET pin when the external reset function is used. If the external reset function has been disabled, the circuit is not necessary. The reset switch can also be removed, if the manual reset is not necessary. After power up, the RESET pin has RESET functionality enabled by default. To use this pin as GPIO, user has to disable the RESET functionality using External Reset Controller (EXTCTRL) register. The RESET pin itself has an internal pull-up resistor, hence it is optional to also add an external pull-up resistor.

Figure 37-4. External Reset Circuit Example Schematic  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_42b36611424aad93ab109cd7d4464678e39689dbd0244f01d7fdda57487e2ded.jpg)

A pull-up resistor makes sure that the reset does not go low unintended causing a device reset. An additional resistor has been added in series with the switch to safely discharge the filtering capacitor, i.e. preventing a current surge when shorting the filtering capacitor which again causes a noise spike that can have a negative effect on the system

Table 37-3. Reset Circuit Connections

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td> $\overline{\text{RESET}}$ </td><td>Reset low level threshold voltage $V_{DDIO}=1.6V-2.0V: Below 0.33* V_{DDIO}$  $V_{DDIO}=2.7V-3.6V: Below 0.36* V_{DDIO}$ Decoupling/filter capacitor  $100nF^{(1)}$ Pull-up resistor  $10kΩ^{(1)(2)}$ Resistor in series with the switch  $330Ω^{(1)}$ </td><td>Reset pin</td></tr></table>

Notes: 1. These values are given as a typical example.  
2. The device features an internal pull-up resistor on the RESET pin, hence an external pull-up is optional.

## 37.5 Unused or Unconnected Pins

For unused pins the default state of the pins for the will give the lowest current leakage. There is thus no need to do any configuration of the unused pins in order to lower the power consumption.

## 37.6 Clocks and Crystal Oscillators

The device can be run from internal or external clock sources, or a mix of internal and external sources. An example of usage will be to use the internal 8MHz oscillator as source for the system clock, and an external 32.768kHz watch crystal as clock source for the Real-Time counter (RTC).

## 37.6.1 External Clock Source

Figure 37-5. External Clock Source Example Schematic

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_7aeddff829e518739ade9df5c1d9d5ad2f9ed7ad5e2166fcac1cfa0a664a9ff8.jpg)

Table 37-4. External Clock Source Connections

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td>XIN</td><td>XIN is used as input for an external clock signal</td><td>Input for inverting oscillator pin</td></tr><tr><td>XOUT/GPIO</td><td>Can be left unconnected or used as normal GPIO</td><td></td></tr></table>

## 37.6.2 Crystal Oscillator

Figure 37-6. Crystal Oscillator Example Schematic

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_a05061f86f3860ca31923038b4ae048ba99f09a4a7a14cf81406c8974ff21979.jpg)

The crystal should be located as close to the device as possible. Long signal lines may cause too high load to operate the crystal, and cause crosstalk to other parts of the system.

Table 37-5. Crystal Oscillator Checklist

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td>XIN</td><td>Load capacitor 15pF $^{(1)(2)}$ </td><td rowspan="2">External crystal between 0.4 to 30MHz</td></tr><tr><td>XOUT</td><td>Load capacitor 15pF $^{(1)(2)}$ </td></tr></table>

Notes: 1. These values are given only as typical example.  
2. Decoupling capacitor should be placed close to the device for each supply pin pair in the signal group.

## 37.6.3 External Real Time Oscillator

The low frequency crystal oscillator is optimized for use with a 32.768kHz watch crystal. When selecting crystals, load capacitance and crystal’s Equivalent Series Resistance (ESR) must be taken into consideration. Both values are specified by the crystal vendor.

The device's oscillator is optimized for very low power consumption, hence close attention should be made when selecting crystals, see “Crystal Oscillator Characteristics” on page 886 for maximum ESR recommendations on 12.5pF crystals.

The Low-frequency Crystal Oscillator provides an internal load capacitance of typical values available in Table 35-41. This internal load capacitance and PCB capacitance can allow to use a Crystal inferior to 12.5pF load capacitance without external capacitors as shown in Figure 37-7.

Figure 37-7. External Real Time Oscillator without Load Capacitor  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_3218c47eceecb203d3d4ce456f8f641dc0de04ae3634c61e2e1976406e2b94d2.jpg)

However, to improve Crystal accuracy and Safety Factor, it can be recommended by crystal datasheet to add external capacitors as shown in the figure below.

To find suitable load capacitance for a 32.768kHz crystal, consult the crystal datasheet.

Figure 37-8. External Real Time Oscillator with Load Capacitor  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_408ae056dacc67d193e5a4d4b09eec5bc17a1432fb82fd0dc8ebc8d6db4c908d.jpg)

Table 37-6. External Real Time Oscillator Checklist

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td>XIN32</td><td>Load capacitor 22pF(1)(2)</td><td>Timer oscillator input</td></tr><tr><td>XOUT32</td><td>Load capacitor 22pF(1)(2)</td><td>Timer oscillator output</td></tr></table>

Notes: 1. These values are given only as typical examples.  
2. Decoupling capacitor should be placed close to the device for each supply pin pair in the signal group.

## 37.6.4 Calculating the Correct Crystal Decoupling Capacitor

In order to calculate correct load capacitor for a given crystal one can use the model shown in the following figure which includes internal capacitors $\mathsf { C } _ { \mathsf { L } \mathsf { n } } ,$ external parasitic capacitance $\complement _ { \mathsf { E L n } }$ and external load capacitance $\mathsf { C } _ { \mathsf { P } \mathsf { n } } .$

Figure 37-9. Crystal Circuit With Internal, External and Parasitic Capacitance  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_829539d60f3c56ebd651f74b1b78254dec0f0f404b85e8a19743aa339eb49626.jpg)  
Using this model the total capacitive load for the crystal can be calculated as shown in the equation below:

$$
\sum C _ {t o t} = \frac {(C _ {L 1} + C _ {P 1} + C _ {E L 1}) (C _ {L 2} + C _ {P 2} + C _ {E L 2})}{C _ {L 1} + C _ {P 1} + C _ {E L 1} + C _ {L 2} + C _ {P 2} + C _ {E L 2}}
$$

where $\mathsf { C } _ { \mathrm { t o t } }$ is the total load capacitance seen by the crystal, this value should be equal to the load capacitance value found in the crystal manufacturer datasheet.

The parasitic capacitance $\complement _ { \mathsf { E L n } }$ can in most applications be disregarded as these are usually very small. If accounted for the value is dependent on the PCB material and PCB layout.

For some crystal the internal capacitive load provided by the device itself can be enough. To calculate the total load capacitance in this case. $\complement _ { \mathsf { E L n } }$ and $\mathsf { C } _ { \mathsf { P } \mathsf { n } }$ are both zero, $\mathsf C _ { \mathsf L 1 } = \mathsf C _ { \mathsf L 2 } = \mathsf C _ { \mathsf L }$ , and the equation reduces to the following:

$$
\sum C _ {t o t} = \frac {C _ {L}}{2}
$$

See “Electrical Characteristics” on page 858 for the device equivalent internal pin capacitance.

## 37.7 Programming and Debug Ports

For programming and/or debugging, the device should be connected using the Serial Wire Debug, SWD, interface. Currently the SWD interface is supported by several Atmel and third party programmers and debuggers, like the SAM-ICE, JTAGICE3 or the device’s Xplained Pro (device’s evaluation kit) Embedded Debugger.

Refer to the SAM-ICE, JTAGICE3 or the device’s Xplained Pro user guides for details on debugging and programming connections and options. For connecting to any other programming or debugging tool please refer to that specific programmer or debugger’s user guide.

The device’s Xplained Pro evaluation board for the device supports programming and debugging through the onboard embedded debugger so no external programmer or debugger is needed.

Note that a pull-up resistor on the SWCLK pin is critical for reliable operations. Refer to “Operation in Noisy Environment” on page 907.

Figure 37-10.SWCLK Circuit Connections  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c68ef8189d0e526079acd6a72fac44286445a5f912b5a9e291241a130b838654.jpg)

Table 37-7. SWCLK Circuit Connections

<table><tr><td>Pin Name</td><td>Description</td><td>Recommended Pin Connection</td></tr><tr><td>SWCLK</td><td>Serial wire clock pin</td><td>Pull-up resistor 1kΩ</td></tr></table>

## 37.7.1 Cortex Debug Connector (10-pin)

For debuggers and/or programmers that support the Cortex Debug Connector (10-pin) interface the signals should be connected as shown in the following figure and detailed table.

Figure 37-11.Cortex Debug Connector (10-pin)  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_3e32fe55a0bed7d63d166f5a488aba699d7f1e744f942506607060de716988a8.jpg)

Table 37-8. Cortex Debug Connector (10-pin)

<table><tr><td>Signal Name</td><td>Description</td></tr><tr><td>SWDCLK</td><td>Serial wire clock pin</td></tr><tr><td>SWDIO</td><td>Serial wire bidirectional data pin</td></tr><tr><td>RESET</td><td>Target device reset pin, active low</td></tr><tr><td>VTref</td><td>Target voltage sense, should be connected to the device  $V_{DD}$ </td></tr><tr><td>GND</td><td>Ground</td></tr></table>

## 37.7.2 10-pin JTAGICE3 Compatible Serial Wire Debug Interface

The JTAGICE3 debugger and programmer does not support the Cortex Debug Connector (10-pin) directly, hence a special pinout is needed to directly connect the device to the JTAGICE3, alternatively one can use the JTAGICE3 squid cable and manually match the signals between the JTAGICE3 and the device. The following figure describes how to connect a 10-pin header that support connecting the JTAGICE3 directly to the device without the need for a squid cable.

To connect the JTAGICE3 programmer and debugger to the device, one can either use the JTAGICE3 squid cable, or use a 10-pin connector as shown in the figure with details given in the table to connect to the target using the JTAGICE3 cable directly.

Figure 37-12.10-pin JTAGICE3 Compatible Serial Wire Debug Interface  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_547b3e07d2c2e0259843e92b5d8b4c27f1cdf412f2e32a4773d5169962b5a008.jpg)

Table 37-9. 10-pin JTAGICE3 Compatible Serial Wire Debug Interface

<table><tr><td>Signal Name</td><td>Description</td></tr><tr><td>SWDCLK</td><td>Serial wire clock pin</td></tr><tr><td>SWDIO</td><td>Serial wire bidirectional data pin</td></tr><tr><td> $\overline{\text{RESET}}$ </td><td>Target device reset pin, active low</td></tr><tr><td>VTG</td><td>Target voltage sense, should be connected to the device  $V_{DD}$ </td></tr><tr><td>GND</td><td>Ground</td></tr></table>

## 37.7.3 20-pin IDC JTAG Connector

For debuggers and/or programmers that support the 20-pin IDC JTAG Connector, e.g. the SAM-ICE, the signals should be connected as shown in the figure with details described in the table.

Figure 37-13.20-pin IDC JTAG Connector  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_55a349b7082a10ae2d1a483d074a54f75a21634e78069cc0858c1d601ef01177.jpg)

Table 37-10. 20-pin IDC JTAG Connector

<table><tr><td>Signal Name</td><td>Description</td></tr><tr><td>SWCLK</td><td>Serial wire clock pin</td></tr><tr><td>SWDIO</td><td>Serial wire bidirectional data pin</td></tr><tr><td> $\overline{\text{RESET}}$ </td><td>Target device reset pin, active low</td></tr><tr><td>VTref</td><td>Target voltage sense, should be connected to the device  $V_{DD}$ </td></tr><tr><td>GND</td><td>Ground</td></tr><tr><td>GND*</td><td>These pins are reserved for firmware extension purposes. They can be left open or connected to GND in normal debug environment. They are not essential for SWD in general.</td></tr></table>

## 37.8 USB Interface

The USB interface consists of a differential data pair (D+/D-) and a power supply (VBUS, GND).

Refer to the “Electrical Characteristics” on page 858 for operating voltages which will allow USB operation.

Table 37-11. USB Interface Checklist

<table><tr><td>Signal Name</td><td>Recommended Pin Connection</td><td>Description</td></tr><tr><td>D+</td><td rowspan="2">The impedance of the pair should be matched on the PCB to minimize reflections.USB differential tracks should be routed with the same characteristics (length, width, number of vias, etc.)Signals should be routed as parallel as possible, with a minimum number of angles and vias</td><td>USB full speed / low speed positive data upstream pin</td></tr><tr><td>D-</td><td>USB full speed / low speed negative data upstream pin</td></tr></table>

Figure 37-14.Low Cost USB Interface Example Schematic  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_05245a63bd24dccb476f08ff77b745b6f820bb3b16f20e97e961d1d7eaf09617.jpg)

It is recommended to increase ESD protection on the USB D+, D-, and VBUS lines using dedicated transient suppressors. These protections should be located as close as possible to the USB connector to reduce the potential discharge path and reduce discharge propagation within the entire system.

The USB FS cable includes a dedicated shield wire that should be connected to the board with caution. Special attention should be paid to the connection between the board ground plane and the shield from the USB connecto and the cable.

Tying the shield directly to ground would create a direct path from the ground plane to the shield, turning the USB cable into an antenna. To limit the USB cable antenna effect, it is recommended to connect the shield and ground through an RC filter.

Figure 37-15.Protected USB Interface Example Schematic  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_31ae69ae323aa060a86683bc8b4319fcd36e965d6de3cf69078f8f186cdefcb7.jpg)

## 38. Errata

## 38.1 Revision A

Not Sampled

## 38.2 Revision B

1 - The MBIST ""Pause-on-Error"" feature is not functional on this device. Errata reference: 14324 Fix/Workaround: Do not use the ""Pause-on-Error"" feature.

## 38.2.2 DMAC

1 - If data is written to CRCDATAIN in two consecutive instructions, the CRC computation may be incorrect. Errata reference: 13507

Fix/Workaround:

Add a NOP instruction between each write to CRCDATAIN register.

## 38.2.3 NVMCTRL

1 - Default value of MANW in NVM.CTRLB is 0. Errata reference: 13134 This can lead to spurious writes to the NVM if a data write is done through a pointer with a wrong address corresponding to NVM area. Fix/Workaround: Set MANW in the NVM.CTRLB to 1 at startup

2 - When external reset is active it causes a high leakage current on VDDIO. Errata reference: 13446

Fix/Workaround:

Minimize the time external reset is active.

## 38.2.4 Device

1 - Internal BOD12 could be re-enabled too early on some parts when leaving standby sleep mode, this could lead to a device reset with BOD12 as reset cause when leaving standby mode. Errata reference: 15513

Fix/Workaround:

Disable BOD12 by software just before entering standby sleep mode writing 0x00000004 value at 0x40000838 location and re-enable it writing 0x00000006 at 0x40000838 when exiting sleep mode.

2 - The SYSTICK calibration value is incorrect. Errata reference: 14157

## Fix/Workaround:

The correct SYSTICK calibration value is 0x40000000. This value should not be used to initialize the Systick RELOAD value register, which should be initialized instead with a value depending on the main clock frequency and on the tick period required by the application. For a detailed description of the SYSTICK module, refer to the official ARM Cortex-M0+ documentation.

## 3 - If APB clock is stopped and GCLK clock is running, APB read access to read-synchronized registers will freeze the system. The CPU and the DAP AHB-AP are stalled, as a consequence debug operation is impossible. Errata reference: 10416

## Fix/Workaround:

Do not make read access to read-synchronized registers when APB clock is stopped and GCLK is running. To recover from this situation, power cycle the device or reset the device using the RESETN pin.

## 4 - The voltage regulator in low power mode is not functional at temperatures above 85C. Errata reference: 12291

## Fix/Workaround:

Enable normal mode on the voltage regulator in standby sleep mode.

Example code:

// Set the voltage regulator in normal mode configuration in standby sleep mode SYSCTRL->VREG.bit.RUNSTDBY = 1;

## 5 - In I2C Slave mode, writing the CTRLB register when in the AMATCH or DRDY interrupt service routines can cause the state machine to reset. Errata reference: 13574

## Fix/Workaround:

Write CTRLB.ACKACT to 0 using the following sequence:

// If higher priority interrupts exist, then disable so that the

// following two writes are atomic.

SERCOM - STATUS.reg = 0;

SERCOM - CTRLB.reg = 0;

// Re-enable interrupts if applicable.

Write CTRLB.ACKACT to 1 using the following sequence:

// If higher priority interrupts exist, then disable so that the

// following two writes are atomic.

SERCOM - STATUS.reg = 0;

SERCOM - CTRLB.reg = SERCOM\_I2CS\_CTRLB\_ACKACT;

// Re-enable interrupts if applicable.

Otherwise, only write to CTRLB in the AMATCH or DRDY interrupts if it is to close out a transaction.

When not closing a transaction, clear the AMATCH interrupt by writing a 1 to its bit position instead of using CTRLB.CMD. The DRDY interrupt is automatically cleared by reading/writing to the DATA register in smart mode. If not in smart mode, DRDY should be cleared by writing a 1 to its bit position.

Code replacements examples:

Current:

$$
\text { SERCOM - CTRLB.reg } \models \text { SERCOM\_I2CS\_CTRLB\_ACKACT };
$$

Change to:

// If higher priority interrupts exist, then disable so that the

// following two writes are atomic.

SERCOM - STATUS.reg = 0;

SERCOM - CTRLB.reg = SERCOM\_I2CS\_CTRLB\_ACKACT;

// Re-enable interrupts if applicable.

## Current:

```sql
SERCOM - CTRLB.reg &= ~SERCOM_I2CS_CTRLB_ACKACT;
```

Change to:

// If higher priority interrupts exist, then disable so that the

// following two writes are atomic.

SERCOM - STATUS.reg = 0;

SERCOM - CTRLB.reg = 0;

// Re-enable interrupts if applicable.

## Current:

/\* ACK or NACK address \*/

```sql
SERCOM - CTRLB.reg |= SERCOM_I2CS_CTRLB_CMD(0x3);
```

Change to:

// CMD=0x3 clears all interrupts, so to keep the result similar,

// PREC is cleared if it was set.

if (SERCOM - INTFLAG.bit.PREC) SERCOM - INTFLAG.reg =

SERCOM\_I2CS\_INTFLAG\_PREC;

SERCOM - INTFLAG.reg = SERCOM\_I2CS\_INTFLAG\_AMATCH;

6 - If the external XOSC32K is broken, neither the external pin RST nor the GCLK software reset can reset the GCLK generators using XOSC32K as source clock. Errata reference: 12164

Fix/Workaround:

Do a power cycle to reset the GCLK generators after an external XOSC32K failure.

## 38.2.5 DFLL48M

1 - The DFLL clock must be requested before being configured otherwise a write access to a DFLL register can freeze the device. Errata reference: 9905

## Fix/Workaround:

Write a zero to the DFLL ONDEMAND bit in the DFLLCTRL register before configuring the DFLL module.

2 - The DFLL status bits in the PCLKSR register during the USB clock recovery mode can be wrong after a USB suspend state. Errata reference: 11938

## Fix/Workaround:

Do not monitor the DFLL status bits in the PCLKSR register during the USB clock recovery mode.

3 - If the DFLL48M reaches the maximum or minimum COARSE or FINE calibration values during the locking sequence, an out of bounds interrupt will be generated. These interrupts will be generated even if the final calibration values at DFLL48M lock are not at maximum or minimum, and might therefore be false out of bounds interrupts. Errata reference: 10669

## Fix/Workaround:

Check that the lockbits: DFLLLCKC and DFLLLCKF in the SYSCTRL Interrupt Flag Status and Clear register (INTFLAG) are both set before enabling the DFLLOOB interrupt.

## 38.2.6 EIC

1 - When the EIC is configured to generate an interrupt on a low level or rising edge or both edges (CONFIGn.SENSEx) with the filter enabled (CONFIGn.FILTENx), a spurious flag might appear for the dedicated pin on the INTFLAG.EXTINT[x] register as soon as the EIC is enabled using CTRLA ENABLE bit. Errata reference: 15341

## Fix/Workaround:

Clear the INTFLAG bit once the EIC enabled and before enabling the interrupts.

## 38.2.7 SERCOM

1 - The I2C Slave SCL Low Extend Time-out (CTRLA.SEXTTOEN) and Master SCL Low Extend Time-out (CTRLA.MEXTTOEN) cannot be used if SCL Low Time-out (CTRLA.LOWTOUT) is disabled. When SCTRLA.LOWTOUT=0, the GCLK\_SERCOM\_SLOW is not requested. Errata reference: 12003

## Fix/Workaround:

To use the Master or Slave SCL low extend time-outs, enable the SCL Low Timeout (CTRLA.LOWTOUT=1).

2 - In USART autobaud mode, missing stop bits are not recognized as inconsistent sync (ISF) or framing (FERR) errors. Errata reference: 13852

## Fix/Workaround:

None

3 - If the SERCOM is enabled in SPI mode with SSL detection enabled (CTRLB.SSDE) and CTRLB.RXEN=1, an erroneous slave select low interrupt (INTFLAG.SSL) can be generated. Errata reference: 13369

## Fix/Workaround:

Enable the SERCOM first with CTRLB.RXEN=0. In a subsequent write, set CTRLB.RXEN=1.

4 - In TWI master mode, an ongoing transaction should be stalled immediately when DBGCTRL.DBGSTOP is set and the CPU enters debug mode. Instead, it is stopped when the current byte transaction is completed and the corresponding interrupt is triggered if enabled. Errata reference: 12499

Fix/Workaround:

In TWI master mode, keep DBGCTRL.DBGSTOP=0 when in debug mode.

## 38.2.8 TCC

1 - Advance capture mode (CAPTMIN CAPTMAX LOCMIN LOCMAX DERIV0) doesn’t work if an upper channel is not in one of these mode. Example: when CC[0]=CAPTMIN, CC[1]=CAPTMAX, CC[2]=CAPTEN, and CC[3]=CAPTEN, CAPTMIN and CAPTMAX won’t work. Errata reference: 14817

## Fix/Workaround:

Basic capture mode must be set in lower channel and advance capture mode in upper channel.

Example: CC[0]=CAPTEN , CC[1]=CAPTEN , CC[2]=CAPTMIN, CC[3]=CAPTMAX

All capture will be done as expected.

2 - In RAMP 2 mode with Fault keep, qualified and restart: Errata reference: 13262

If a fault occurred at the end of the period during the qualified state, the switch to the next ramp can have two restarts.

Fix/Workaround:

Avoid faults few cycles before the end or the beginning of a ramp.

3 - All DMA MCx triggers are not raised, on a CCx match. Errata reference: 13084 Fix/Workaround: To update CC/CCBUF values through DMA, use DMA OVF triggers

4 - With blanking enabled, a recoverable fault that occurs during the first increment of a rising TCC is not blanked. Errata reference: 12519 Fix/Workaround: None

5 - In Dual slope mode a Retrigger Event does not clear the TCC counter. Errata reference: 12354 Fix/Workaround: None

6 - In two ramp mode, two events will be generated per cycle, one on each ramp’s end. EVCTRL.CNTSEL.END cannot be used to identify the end of a double ramp cycle. Errata reference: 12224 Fix/Workaround: None

7 - When the RUNSTDBY bit is written after the TCC is enabled, the respective TCC APB bus is stalled and the RUNDSTBY bit in the TCC CTRLA register is not enabled-protected. Errata reference: 12477 Fix/Workaround: None.

8 - TCC fault filtering on inverted fault is not working. Errata reference: 12512 Fix/Workaround: Use only non-inverted faults.

## 39. About This Document

## 39.1 Conventions

## 39.1.1 Numerical Notation

Table 39-1. Numerical notation

<table><tr><td>165</td><td>Decimal number</td></tr><tr><td>0101b</td><td>Binary number (example 0b0101 = 5 decimal)</td></tr><tr><td>0101</td><td>Binary numbers are given without suffix if unambiguous</td></tr><tr><td>0x3B24</td><td>Hexadecimal number</td></tr><tr><td>X</td><td>Represents an unknown or don&#x27;t care value</td></tr><tr><td>Z</td><td>Represents a high-impedance (floating) state for either a signal or a bus</td></tr></table>

## 39.1.2 Memory Size and Type

Table 39-2. Memory Size and Bit Rate

<table><tr><td>Symbol</td><td>Description</td></tr><tr><td>kB/kbyte</td><td>kilobyte ( $2^{10} = 1024$ )</td></tr><tr><td>MB/Mbyte</td><td>megabyte ( $2^{20} = 1024*1024$ )</td></tr><tr><td>GB/Gbyte</td><td>gigabyte ( $2^{30} = 1024*1024*1024$ )</td></tr><tr><td>b</td><td>bit (binary 0 or 1)</td></tr><tr><td>B</td><td>byte (8 bits)</td></tr><tr><td>1kbit/s</td><td>1,000 bit/s rate (not 1,024 bit/s)</td></tr><tr><td>1Mbit/s</td><td>1,000,000 bit/s rate</td></tr><tr><td>1Gbit/s</td><td>1,000,000,000 bit/s rate</td></tr></table>

## 39.1.3 Frequency and Time

Table 39-3. Frequency and Time

<table><tr><td>Symbol</td><td>Description</td></tr><tr><td>kHz</td><td> $1\text{kHz} = 10^{3}\text{Hz} = 1,000\text{Hz}$ </td></tr><tr><td>MHz</td><td> $10^{6} = 1,000,000\text{Hz}$ </td></tr><tr><td>GHz</td><td> $10^{9} = 1,000,000,000\text{Hz}$ </td></tr><tr><td>s</td><td>second</td></tr><tr><td>ms</td><td>millisecond</td></tr><tr><td>μs</td><td>microsecond</td></tr><tr><td>ns</td><td>nanosecond</td></tr></table>

Table 39-4. Register and bit mnemonics

<table><tr><td>R/W</td><td>Read/Write accessible register bit. The user can read from and write to this bit.</td></tr><tr><td>R</td><td>Read-only accessible register bit. The user can only read this bit. Writes will be ignored.</td></tr><tr><td>W</td><td>Write-only accessible register bit. The user can only write this bit. Reading this bit will return an undefined value.</td></tr><tr><td>BIT</td><td>Bit names are shown in uppercase. (Example PINA1)</td></tr><tr><td>BITS[n:m]</td><td>A set of bits from bit n down to m. (Example: PINA3..0 = {PINA3, PINA2, PINA1, PINA0}</td></tr><tr><td>Reserved</td><td>Reserved bits are unused and reserved for future use. For compatibility with future devices, always write reserved bits to zero when the register is written. Reserved bits will always return zero when read.</td></tr><tr><td>PERIPHERALi</td><td>If several instances of a peripheral exist, the peripheral name is followed by a number to indicate the number of the instance in the range 0-n. PERIPHERALi denotes one specific instance.</td></tr><tr><td>Reset</td><td></td></tr><tr><td>SET/CLR</td><td>Registers with SET/CLR suffix allows the user to clear and set bits in a register without doing a read-modify-write operation. These registers always come in pairs. Writing a one to a bit in the CLR register will clear the corresponding bit in both registers, while writing a one to a bit in the SET register will set the corresponding bit in both registers. Both registers will return the same value when read. If both registers are written simultaneously, the write to the CLR register will take precedence.</td></tr></table>

## 39.2 Acronyms and Abbreviations

Table 39-5 contains acronyms and abbreviations used in this document.

Table 39-5. Acronyms and Abbreviations

<table><tr><td>Abbreviation</td><td>Description</td></tr><tr><td>AC</td><td>Analog Comparator</td></tr><tr><td>ADC</td><td>Analog-to-Digital Converter</td></tr><tr><td>ADDR</td><td>Address</td></tr><tr><td>AHB</td><td>AMBA Advanced High-performance Bus</td></tr><tr><td>APB</td><td>AMBA Advanced Peripheral Bus</td></tr><tr><td>AREF</td><td>Analog reference voltage</td></tr><tr><td>AV_DD</td><td>Analog supply voltage</td></tr><tr><td>BLB</td><td>Boot Lock Bit</td></tr><tr><td>BOD</td><td>Brown-out detector</td></tr><tr><td>CAL</td><td>Calibration</td></tr><tr><td>CC</td><td>Compare/capture</td></tr><tr><td>CLK</td><td>Clock</td></tr><tr><td>CRC</td><td>Cyclic Redundancy Check</td></tr><tr><td>CTRL</td><td>Control</td></tr><tr><td>DAC</td><td>Digital to Analog converter</td></tr><tr><td>DFLL</td><td>Digital Frequency Locked Loop</td></tr><tr><td>DSU</td><td>Device service unit</td></tr><tr><td>EEPROM</td><td>Electrically Erasable Programmable Read-Only Memory</td></tr><tr><td>EIC</td><td>External interrupt controller</td></tr><tr><td>EVSYS</td><td>Event System</td></tr><tr><td>GCLK</td><td>Generic clock</td></tr><tr><td>GND</td><td>Ground</td></tr><tr><td>GPIO</td><td>General Purpose Input/Output</td></tr><tr><td>I2C</td><td>Inter-integrated circuit</td></tr><tr><td>IF</td><td>Interrupt Flag</td></tr><tr><td>INT</td><td>Interrupt</td></tr><tr><td>IOBUS</td><td>I/O Bus</td></tr><tr><td>NMI</td><td>Non-Maskable Interrupt</td></tr><tr><td>NVIC</td><td>Nested vector interrupt controller</td></tr><tr><td>NVMCTRL</td><td>Non-Volatile Memory controller</td></tr><tr><td>OSC</td><td>Oscillator</td></tr><tr><td>PAC</td><td>Peripheral access controller</td></tr><tr><td>PC</td><td>Program counter</td></tr><tr><td>PER</td><td>Period</td></tr><tr><td>PM</td><td>Power manager</td></tr><tr><td>POR</td><td>Power-on reset</td></tr><tr><td>PTC</td><td>Peripheral touch controller</td></tr><tr><td>PWM</td><td>Pulse Width Modulation</td></tr><tr><td>RAM</td><td>Random-access memory</td></tr><tr><td>REF</td><td>Reference</td></tr><tr><td>RMW</td><td>Read-modify-write</td></tr><tr><td>RTC</td><td>Real-time counter</td></tr><tr><td>RX</td><td>Receiver</td></tr><tr><td>SERCOM</td><td>Serial communication interface</td></tr><tr><td>SMBus</td><td>System Management Bus</td></tr><tr><td>SP</td><td>Stack Pointer</td></tr><tr><td>SPI</td><td>Serial peripheral interface</td></tr><tr><td>SRAM</td><td>Static random-access memory</td></tr><tr><td>SYSCTRL</td><td>System controller</td></tr><tr><td>SWD</td><td>Single-wire debug</td></tr><tr><td>TC</td><td>Timer/Counter</td></tr><tr><td>TX</td><td>Transmitter</td></tr><tr><td>ULP</td><td>Ultra Low Power</td></tr><tr><td>USART</td><td>Universal synchronous and asynchronous serial receiver and transmitter</td></tr><tr><td> $V_{DD}$ </td><td>Digital supply voltage</td></tr><tr><td>VREF</td><td>Voltage reference</td></tr><tr><td>WDT</td><td>Watchdog timer</td></tr><tr><td>XOSC</td><td>Crystal oscillator</td></tr></table>

## 40. Datasheet Revision History

Please note that the referring page numbers in this section are referred to this document. The referring revision in this section are referring to the document revision.

## 40.1 Rev. H – 08/2016

<table><tr><td colspan="2">“Ordering Information” on page 5</td></tr><tr><td></td><td>Added “Device Identification” on page 6</td></tr><tr><td colspan="2">“I/O Multiplexing and Considerations” on page 13</td></tr><tr><td></td><td>Added SWDIO in IO multiplexing table</td></tr><tr><td colspan="2">“I/O Multiplexing and Considerations” on page 13</td></tr><tr><td></td><td>Added a table note related to PA24 and PA25 pins</td></tr><tr><td colspan="2">“Memories” on page 21</td></tr><tr><td></td><td>Updated “Embedded Memories” on page 21: Added reference to the EEPROMUpdated the Table : Set as “Reserved” 73:64 bit positionAdded “NVM Calibration and Auxiliary Space” on page 21</td></tr><tr><td colspan="2">“PAC – Peripheral Access Controller” on page 30</td></tr><tr><td></td><td>Updated the PAC overview: CLK_PAC0_APB and CLK_PAC1_APB are enabled at reset while CLK_PAC2_APB is disabled at reset.Added “Register Description” on page 31</td></tr><tr><td colspan="2">“DSU – Device Service Unit” on page 39</td></tr><tr><td></td><td>Updated the table in “System Services Availability When Accessed Externally” on page 48. MBIST is not available when the device is protected from the external address space. Yes has been changed to No in the table.Updated the content in “Testing of Onboard Memories (MBIST)” on page 47 about the MBIST run time</td></tr><tr><td colspan="2">“GCLK – Generic Clock Controller” on page 88</td></tr><tr><td></td><td>“Signal Description” on page 89: Updated the signal name to GCLK_IO[5:0]Updated all the tables according to generic clock generator [5:0]Updated GENDIV GENDIV Reset value tables</td></tr><tr><td colspan="2">“SYSCTRL – System Controller” on page 143</td></tr><tr><td></td><td>Updated the content in “Open-Loop Operation” on page 152 and in “Closed-Loop Operation” on page 152Updated “Debug Operation” on page 148 about debugger cold-plugging and hot plugging</td></tr><tr><td colspan="2">“WDT – Watchdog Timer” on page 208</td></tr><tr><td></td><td>Updated the content in “Debug Operation” on page 209</td></tr><tr><td colspan="2">“RTC – Real-Time Counter” on page 227</td></tr><tr><td></td><td>Updated the content in “Clock/Calendar (Mode 2)” on page 231</td></tr><tr><td colspan="2">“ADC – Analog-to-Digital Converter” on page 768</td></tr><tr><td></td><td>“Prescaler” on page 772: Added the formula of the PropagationDelay for Free Running ModeUpdated the Table 31-1Updated the description of Interrupts</td></tr><tr><td colspan="2">“AC – Analog Comparators” on page 807</td></tr><tr><td></td><td>“Block Diagram” on page 808: Removed one block diagram without DAC</td></tr><tr><td colspan="2">“Electrical Characteristics” on page 858</td></tr><tr><td></td><td>Updated Table 35-1 “Absolute Maximum Ratings: $V_{PIN}$ : min and max changed respectively from GND-0.3V to GND-0.6V and GND+0.3V to GND+0.6VUpdated Table 35-11: Normal I/O Pins Characteristics, the Pull-up - Pull-down resistance excludes PA24 and PA25 pins. Those USB pins have different pull-up and pull-downAdded “Injection Current” on page 870Updated “Analog-to-Digital (ADC) Characteristics” on page 874: Removed “Conversion Speed” from the Table 35-21 “Operating Conditions”Added Table 35-37 “Flash Erase and Programming Current”Updated Table 35-4: Renamed the table to “Supply Slew Rates” and added “Max Fall Rate = 0.05 V/μsUpdated the Table 35-2 “General Operating Conditions”: Voltage drop caution added</td></tr><tr><td colspan="2">“Electrical Characteristics at 105°C” on page 935</td></tr><tr><td></td><td>Updated Table 35-1 “Absolute Maximum Ratings: $V_{PIN}$ : min and max changed respectively from GND-0.3V to GND-0.6V and GND+0.3V to GND+0.6VAdded “Injection Current” on page 870Updated “Analog Characteristics” on page 872: Removed “Conversion Speed” from the Table 35-21 “Operating Conditions”Updated Table 35-4: Renamed the table to “Supply Slew Rates” and added “Max Fall Rate = 0.05 V/μsUpdated the Table 35-2 “General Operating Conditions”: Voltage drop caution added</td></tr></table>

## 40.2 Rev. G – 05/2016

<table><tr><td colspan="2">“SYSCTRL – System Controller” on page 143</td></tr><tr><td></td><td>“Principle of Operation” on page 148: Updated the last paragraph to “To force the oscillator to run in standby mode except for DFLL and DPLL, the RUNSTDBY bit must be written to one”DFLLCTRL: Removed RUNSTDBY bitDPLLCTRLA: Removed RUNSTDBY bit</td></tr><tr><td colspan="2">“ADC – Analog-to-Digital Converter” on page 768</td></tr><tr><td></td><td>Table 31-13 and Table 31-14: Updated the content in the two respective tables</td></tr><tr><td colspan="2">“Electrical Characteristics” on page 858</td></tr><tr><td></td><td>Table 35-22 and Table 35-23: The device has single power domain. The table notes updated accordingly.</td></tr></table>

## 40.3 Rev. F – 04/2016

<table><tr><td colspan="2">“Ordering Information” on page 5</td></tr><tr><td></td><td>Added 105C ordering information for SAMD10 and SAMD11</td></tr><tr><td colspan="2">“Memories” on page 21</td></tr><tr><td></td><td>“NVM User Row Mapping” on page 23: Added “Production setting” in the table</td></tr></table>

## 40.4 Rev. E – 03/2016

<table><tr><td colspan="2">“Packaging Information” on page 901</td></tr><tr><td></td><td>Table 36-1: Updated the thermal resistance values of the package 20-ball WLCSP “20-ball WLCSP” on page 904: Updated the value of the device maximum weight</td></tr><tr><td colspan="2">“Schematic Checklist” on page 907</td></tr><tr><td></td><td>“Operation in Noisy Environment” on page 907: This section has been added “Programming and Debug Ports” on page 913: The pull-up resistor to SWCLK pin is 1kΩ</td></tr><tr><td colspan="2">Errata:</td></tr><tr><td></td><td>Revision B: Added errata related to EIC. Errata reference 15341</td></tr></table>

## 40.5 Rev. D – 02/2016

<table><tr><td colspan="2">“I/O Multiplexing and Considerations” on page 13</td></tr><tr><td></td><td>Table 6-1: Added AC: CMP0/1 in the IO multiplexing table</td></tr><tr><td colspan="2">“Memories” on page 21</td></tr><tr><td></td><td>“NVM Software Calibration Row Mapping” on page 24: Removed the text “CRr_SYSCTRL_DFLLVAL”</td></tr><tr><td colspan="2">“TC – Timer/Counter” on page 573</td></tr><tr><td></td><td>“Capture Operations” on page 582: Removed timestamp from “Event Capture Action”</td></tr><tr><td colspan="2">“Electrical Characteristics at 105°C” on page 935</td></tr><tr><td></td><td>“SERCOM in SPI Mode Timing” on page 968: added in the datasheet“SERCOM in I2C Mode Timing” on page 970: Added in the datasheet</td></tr></table>

40.6 Rev. C – 01/2016

<table><tr><td colspan="2">Introduced WLCSP20 package offering:</td></tr><tr><td></td><td>“Features” on page 2: Added 20-ball WLCSP.“Ordering Information” on page 5: Added ATSAMD11D14A-UUT.“Configuration Summary” on page 3: Added WLCSP to “Pinout” on page 8: Added “SAM D11D 20-ball WLCSP” on page 9.“I/O Multiplexing and Considerations” on page 13: Added WLCSP20 multiplexing signals.“Packaging Information” on page 901:- Added WLCSP20 to Table 36-1.- Added “20-ball WLCSP” on page 904 package drawing.</td></tr><tr><td colspan="2">“DSU – Device Service Unit” on page 39</td></tr><tr><td></td><td>Updated Bit 21-16 - SERIES [5:0] in DID. The value of the field is 0x02.</td></tr><tr><td colspan="2">“SYSCTRL – System Controller” on page 143</td></tr><tr><td></td><td>Updated description in “Drift Compensation” on page 154.</td></tr><tr><td colspan="2">“NVMCTRL – Non-Volatile Memory Controller” on page 355</td></tr><tr><td></td><td>Removed the text related to “AUTOWS bit” from “Clocks” on page 356</td></tr><tr><td colspan="2">“PORT” on page 378</td></tr><tr><td></td><td>Updated Bit 17 - INEN in WRCONFIGn. This bit determines the new value written to PINCFGy.INEN for all pins selected by.....</td></tr><tr><td colspan="2">“TC – Timer/Counter” on page 573</td></tr><tr><td></td><td>TC instances are paired ..... starting from TC1 (not from TC0) in “Clocks” on page 575</td></tr><tr><td colspan="2">“TCC – Timer/Counter for Control Applications” on page 614</td></tr><tr><td></td><td>Updated “Stop Command”, “Pause Event Action” and “Event Action Off” in “Counter Operation” on page 620</td></tr><tr><td colspan="2">“Electrical Characteristics” on page 858</td></tr><tr><td></td><td>“Digital Frequency Locked Loop (DFLL48M) Characteristics” on page 889: Removed note from Table 35-43.“Digital Frequency Locked Loop (DFLL48M) Characteristics” on page 889: Added note to Table 35-43.“NVM Characteristics” on page 884: Updated the Table 35-33“Power Consumption” on page 861: Added Max values in the Table 35-7</td></tr><tr><td colspan="2">Appendix A</td></tr><tr><td></td><td>Added “Electrical Characteristics at 105°C” on page 935</td></tr></table>

40.7 Rev. B – 07/2015

<table><tr><td colspan="2">“Description” on page 1</td></tr><tr><td></td><td>CoreMark score updated from 2.14 to 2.46 CoreMark/MHz.</td></tr><tr><td colspan="2">“NVM User Row Mapping” on page 23</td></tr><tr><td></td><td>Added WDT window default value which is WINDOW_1 = 0x5. Row bits [24:17] Reserved and Default value = 0x70. Row bit [41] Reserved and Default value = 0.</td></tr><tr><td colspan="2">“Starting CRC32 Calculation” on page 46</td></tr><tr><td></td><td>Updated how NVMCTRL security bit affects only CRC32 through SWD interface.</td></tr><tr><td colspan="2">“SERCOM SPI – SERCOM Serial Peripheral Interface” on page 476</td></tr><tr><td></td><td>Updated the features. Serial clock speed up to 12MHz in Master Operation.</td></tr><tr><td colspan="2">“USB – Universal Serial Bus” on page 714</td></tr><tr><td></td><td>Updated all contents as this USB for SAM D11 is device only.</td></tr><tr><td colspan="2">REFCTRL Register</td></tr><tr><td></td><td>Updated Table 31-7 on page 785. AREFx changed to VREFx.</td></tr><tr><td colspan="2">CTRLB Register</td></tr><tr><td></td><td>Updated Table 33-3 on page 845. VREFP changed to VREFA.</td></tr><tr><td colspan="2">“Electrical Characteristics” on page 858</td></tr><tr><td></td><td>Updated all SAMD11 Electrical characteristic values.</td></tr><tr><td colspan="2">“Ordering Information” on page 5:</td></tr><tr><td></td><td>Removed carrier type “Tray” for ordering code selection</td></tr><tr><td colspan="2">“Schematic Checklist” on page 907</td></tr><tr><td></td><td>Added “Schematic Checklist” on page 907</td></tr></table>

## 40.8 Rev. A – 01/2015

<table><tr><td></td><td>Initial revision</td></tr></table>

## Appendix A. Electrical Characteristics at 105°C

## A.1 Disclaimer

All typical values are measured at T = 25°C unless otherwise specified. All minimum and maximum values are valid across operating temperature and voltage unless otherwise specified.

## A.2 Absolute Maximum Ratings

Stresses beyond those listed in Table 40-1 may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

Table 40-1. Absolute maximum ratings

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DD}$ </td><td>Power supply voltage</td><td>0</td><td>3.8</td><td>V</td></tr><tr><td> $I_{VDD}$ </td><td>Current into a  $V_{DD}$  pin</td><td>-</td><td>92(1)</td><td>mA</td></tr><tr><td> $I_{GND}$ </td><td>Current out of a GND pin</td><td>-</td><td>130(1)</td><td>mA</td></tr><tr><td> $V_{PIN}$ </td><td>Pin voltage with respect to GND and  $V_{DD}$ </td><td>GND-0.6V</td><td> $V_{DD}$ +0.6V</td><td>V</td></tr><tr><td> $T_{storage}$ </td><td>Storage temp</td><td>-60</td><td>150</td><td>°C</td></tr></table>

Note: 1. Maximum source current is 46mA and maximum sink current is 65mA per cluster. Also note that each V /GND pair is connected to 2 clusters so current consumption through the pair will be the sum of the clusters source/sink currents.

## A.3 General Operating Ratings

The device must operate within the ratings listed in Table 40-2 in order for all other electrical characteristics and typical characteristics of the device to be valid.

Table 40-2. General operating conditions<sup>(2)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DD}$ </td><td>Power supply voltage</td><td>1.62(1)</td><td>3.3</td><td>3.63</td><td>V</td></tr><tr><td> $T_A$ </td><td>Temperature range</td><td>-40</td><td>25</td><td>105</td><td>°C</td></tr><tr><td> $T_J$ </td><td>Junction temperature</td><td>-</td><td>-</td><td>125</td><td>°C</td></tr></table>

1. With BOD33 disabled. If the BOD33 is enabled, check Table 40-16  
2. CAUTION: In debugger cold-plugging mode, NVM erase operations are not protected by the BOD33 and BOD12. NVM erase operation at supply voltages below specified minimum can cause corruption of NVM areas that are mandatory for correct device behavior.

## A.4 Supply Characteristics

The following characteristics are applicable to the operating temperature range: $\mathsf { T } _ { \mathsf { A } } = - 4 0 ^ { \circ } \mathsf { C }$ to $1 0 5 ^ { \circ } \mathrm { C }$ , unless otherwise specified and are valid for a junction temperature up to $\mathsf { T } _ { \mathsf { J } } = 1 2 5 ^ { \circ } \mathsf { C }$ . Refer to “Power Supply and Start-Up Considerations” on page 17.

Table 40-3. Supply voltage Characteristics

<table><tr><td>Symbol</td><td>Conditions</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DD}$ </td><td>Full Voltage Range</td><td>1.62</td><td>3.63</td><td>V</td></tr></table>

Table 40-4. Supply Rise Rates

<table><tr><td>Symbol</td><td>Parameter</td><td>Fall Rate Max</td><td>Rise Rate Max.</td><td>Units</td></tr><tr><td> $V_{DDIO}$ </td><td rowspan="2">DC supply peripheral I/Os, internal regulator and analog supply voltage</td><td>0.05</td><td>0.1</td><td rowspan="2">V/μs</td></tr><tr><td> $V_{DDANA}$ </td><td>0.05</td><td>0.1</td></tr></table>

## A.5 Maximum Clock Frequencies

Table 40-5. Maximum GCLK Generator Output Frequencies

<table><tr><td>Symbol</td><td>Description</td><td>Undivided</td><td>Divided</td><td>Units</td></tr><tr><td> $f_{GCLKGEN0} / f_{GCLK\_MAIN}$  $f_{GCLKGEN1}$  $f_{GCLKGEN2}$  $f_{GCLKGEN3}$  $f_{GCLKGEN4}$  $f_{GCLKGEN5}$ </td><td>GCLK Generator Output Frequency</td><td>96</td><td>48</td><td>MHz</td></tr></table>

Table 40-6. Maximum Peripheral Clock Frequencies

<table><tr><td>Symbol</td><td>Description</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{CPU}$ </td><td>CPU clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{AHB}$ </td><td>AHB clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{APBA}$ </td><td>APBA clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{APBB}$ </td><td>APBB clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{APBC}$ </td><td>APBC clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_DFLL48M\_REF}$ </td><td>DFLL48M Reference clock frequency</td><td>33</td><td>kHz</td></tr><tr><td> $f_{GCLK\_DPLL}$ </td><td>FDPLL96M Reference clock frequency</td><td>2</td><td>MHz</td></tr><tr><td> $f_{GCLK\_DPLL\_32K}$ </td><td>FDPLL96M 32k Reference clock frequency</td><td>32</td><td>kHz</td></tr><tr><td> $f_{GCLK\_WDT}$ </td><td>WDT input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_RTC}$ </td><td>RTC input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EIC}$ </td><td>EIC input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_USB}$ </td><td>USB input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_0}$ </td><td>EVSYS channel 0 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_1}$ </td><td>EVSYS channel 1 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_2}$ </td><td>EVSYS channel 2 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_3}$ </td><td>EVSYS channel 3 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_4}$ </td><td>EVSYS channel 4 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_EVSYS\_CHANNEL\_5}$ </td><td>EVSYS channel 5 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOMx\_SLOW}$ </td><td>Common SERCOM slow input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOM0\_CORE}$ </td><td>SERCOM0 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOM1\_CORE}$ </td><td>SERCOM1 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_SERCOM2\_CORE}$ </td><td>SERCOM2 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_TCC0}$ </td><td>TCC0 input clock frequency</td><td>96</td><td>MHz</td></tr><tr><td> $f_{GCLK\_TC1, GCLK\_TC2}$ </td><td>TC1,TC2 input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_ADC}$ </td><td>ADC input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_AC\_DIG}$ </td><td>AC digital input clock frequency</td><td>48</td><td>MHz</td></tr><tr><td> $f_{GCLK\_AC\_ANA}$ </td><td>AC analog input clock frequency</td><td>64</td><td>kHz</td></tr><tr><td> $f_{GCLK\_DAC}$ </td><td>DAC input clock frequency</td><td>350</td><td>kHz</td></tr><tr><td> $f_{GCLK\_PTC}$ </td><td>PTC input clock frequency</td><td>48</td><td>MHz</td></tr></table>

## A.6 Power Consumption

The values in Table 40-7 are measured values of power consumption under the following conditions, except where noted:

z Operating conditions

$\mathsf { V } _ { \mathsf { V D D I N } } = 3 . 3 \mathsf { V }$

$\mathsf { V } _ { \mathsf { D D I N } } = 1 . 8 \mathsf { V } ,$ CPU is running on Flash with 3 wait state

Wake up time from sleep mode is measured from the edge of the wakeup signal to the execution of the first instruction fetched in flash.

## z Oscillators

z XOSC (crystal oscillator) stopped

z XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal

z DFLL48M using XOSC32K as reference and running at 48MHz

## z Clocks

DFLL48M used as main clock source, except otherwise specified.

z CPU, AHB clocks undivided

z APBA clock divided by 4

z APBB and APBC bridges off

z The following AHB module clocks are running: NVMCTRL, APBA bridge

z All other AHB clocks stopped

z The following peripheral clocks running: PM, SYSCTRL, RTC

z All other peripheral clocks stopped

z I/Os are inactive with internal pull-up

z CPU is running on flash with 1 wait states

z NVMCTRL cache enabled

z BOD33 disabled

Table 40-7. Current Consumption

<table><tr><td>Mode</td><td>Conditions</td><td> $T_A$ </td><td> $V_{CC}$ </td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="18">ACTIVE</td><td rowspan="2">CPU running a While(1) algorithm</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>3.01</td><td rowspan="4">mA</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>3.06</td></tr><tr><td rowspan="2">CPU running a While(1) algorithm  $V_{DDIN}=1.8V$ , CPU is running on Flash with 3 wait states</td><td>25°C</td><td>1.8V</td><td></td><td></td><td>2.95</td></tr><tr><td>105°C</td><td>1.8V</td><td></td><td></td><td>3.06</td></tr><tr><td rowspan="2">CPU running a While(1) algorithm, CPU is running on Flash with 3 wait states with GCLKIN as reference</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>53*freq + 330</td><td rowspan="2">μA (with freq in MHz)</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>53*freq + 402</td></tr><tr><td rowspan="2">CPU running a Fibonacci algorithm</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>3.39</td><td rowspan="4">mA</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>3.45</td></tr><tr><td rowspan="2">CPU running a Fibonacci algorithm  $V_{DDIN}=1.8V$ , CPU is running on flash with 3 wait states</td><td>25°C</td><td>1.8V</td><td></td><td></td><td>3.33</td></tr><tr><td>105°C</td><td>1.8V</td><td></td><td></td><td>3.45</td></tr><tr><td rowspan="2">CPU running a Fibonacci algorithm, CPU is running on Flash with 3 wait states with GCLKIN as reference</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>61*freq + 335</td><td rowspan="2">μA (with freq in MHz)</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>61*freq + 404</td></tr><tr><td rowspan="2">CPU running a CoreMark algorithm</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>4.04</td><td rowspan="4">mA</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>4.13</td></tr><tr><td rowspan="2">CPU running a CoreMark algorithm  $V_{DDIN}=1.8V$ , CPU is running on flash with 3 wait states</td><td>25°C</td><td>1.8V</td><td></td><td></td><td>3.62</td></tr><tr><td>105°C</td><td>1.8V</td><td></td><td></td><td>3.77</td></tr><tr><td rowspan="2">CPU running a CoreMark algorithm, CPU is running on Flash with 3 wait states with GCLKIN as reference</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>74*freq + 356</td><td rowspan="2">μA (with freq in MHz)</td></tr><tr><td>105°C25°C</td><td>3.3V3.3V</td><td></td><td></td><td>75*freq + 4141.89</td></tr><tr><td rowspan="2">IDLE0</td><td rowspan="2"></td><td></td><td></td><td></td><td></td><td></td><td rowspan="6">mA</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>1.95</td></tr><tr><td rowspan="2">IDLE1</td><td rowspan="2"></td><td>25°C</td><td>3.3V</td><td></td><td></td><td>1.36</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>1.40</td></tr><tr><td rowspan="2">IDLE2</td><td rowspan="2"></td><td>25°C</td><td>3.3V</td><td></td><td></td><td>1.17</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>1.19</td></tr><tr><td rowspan="4">STANDBY</td><td rowspan="2">XOSC32K runningRTC running at 1kHz</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>10.40</td><td rowspan="4">μA</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>142.50</td></tr><tr><td rowspan="2">XOSC32K and RTC stopped</td><td>25°C</td><td>3.3V</td><td></td><td></td><td>9.20</td></tr><tr><td>105°C</td><td>3.3V</td><td></td><td></td><td>137.50</td></tr></table>

Table 40-8. Wake-up Time

<table><tr><td>Mode</td><td>Conditions</td><td> $T_A$ </td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="2">IDLE0</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>4.0</td><td></td><td rowspan="8">μs</td></tr><tr><td>105°C</td><td></td><td>4.0</td><td></td></tr><tr><td rowspan="2">IDLE1</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>12.1</td><td></td></tr><tr><td>105°C</td><td></td><td>14.3</td><td></td></tr><tr><td rowspan="2">IDLE2</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>13.0</td><td></td></tr><tr><td>105°C</td><td></td><td>15.2</td><td></td></tr><tr><td rowspan="2">STANDBY</td><td rowspan="2">OSC8M used as main clock source, cache disabled</td><td>25°C</td><td></td><td>19.6</td><td></td></tr><tr><td>105°C</td><td></td><td>20.1</td><td></td></tr></table>

Figure 40-1. Measurement Schematic  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_1b4e90fac5df9a7dfc3c50e6423c2f1a0c0018439fea137ecf7c89e10104c89e.jpg)

Since USB peripheral complies with the Universal Serial Bus (USB) v2.0 standard, USB peripheral power consumption is described a specific section.

except USB

## A.6.1 USB Peripheral Power Consumption

Default conditions, except where noted:

z Operating conditions

$\mathsf { V } _ { \mathsf { V D D I N } } = 3 . 3 \mathsf { V }$

Oscillators

z XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal in USB Host mode

Clocks

z USB Device mode: DFLL48M in USB recovery mode (Crystal less)

USB Host mode: DFLL48M in closed loop with XOSC32K (32kHz crystal oscillator) running with external 32kHz crystal

z CPU, AHB and APBn clocks undivided

z The following AHB module clocks are running: NVMCTRL, HPB2 bridge, HPB1 bridge, HPB0 bridge

z All other AHB clocks stopped

● I/Os are inactive with internal pull-up

z CPU in IDLE0 mode

z Cache enabled

z BOD33 disabled

In this default conditions, the power consumption $\mathsf { I } _ { \mathsf { d e f a u l t } }$ is measured.

Measurements do not include consumption of clock source (ex: DFLL48M or FDPLL96M) and CPU. However no CPU activity is required during all states (Suspend, IDLE, Data transfer).

Measurements have been done with an USB cable of 1.5m.

For USB Device mode, measurements include the maximum consumption (200µA) through pull-up resistor on the D+ line for USB attach. This value depends on USB Host characteristic.

Operating modes:

z Run the USB Device/Host states in regards of the Universal Serial Bus (USB) v2.0 standard.

USB power consumption is provided in the following tables.

Table 40-9. Typical USB Device Full Speed mode Current Consumption

<table><tr><td>USB Device state</td><td>Conditions(1)</td><td>Typ.</td><td>Units</td></tr><tr><td>Suspend</td><td>GCLK_USB is off, using USB wakeup asynchronous interrupt. USB bus in suspend mode.</td><td>201</td><td>μA</td></tr><tr><td>Suspend</td><td>GCLK_USB is on. USB bus in suspend mode.</td><td>0.83</td><td rowspan="4">mA</td></tr><tr><td>IDLE</td><td>Start Of Frame is running. No packet transferred.</td><td>1.17</td></tr><tr><td>Active OUT</td><td>Start Of Frame is running. Bulk OUT on 100% bandwidth.</td><td>2.17</td></tr><tr><td>Active IN</td><td>Start Of Frame is running. Bulk IN on 100% bandwidth.</td><td>10.3</td></tr></table>

Notes: 1. Measures include the consumption (200µA) of the 1.5 kΩ pull-up on the D+ line for USB attach  
2. Measures include consumption of DFLL48M in USB recovery mode, excepted SUSPEND state which turns off DFLL48M  
3. Measures do not include CPU consumption. However no CPU activity is required during all states (Suspend, IDLE, Data transfer)  
4. Measures done with an USB cable of 1.5m

## A.7 I/O Pin Characteristics

## A.7.1 Normal I/O Pins

## Table 40-10. Normal I/O Pins Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td></td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td> $0.25*V_{DD}$ </td><td rowspan="6">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td> $0.3*V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td> $0.7*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td> $0.55*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{OL}$ </td><td>Output low-level voltage</td><td> $V_{DD}>1.6V, I_{OL} \max$ </td><td>-</td><td> $0.1*V_{DD}$ </td><td> $0.2*V_{DD}$ </td></tr><tr><td> $V_{OH}$ </td><td>Output high-level voltage</td><td> $V_{DD}>1.6V, I_{OH} \max$ </td><td> $0.8*V_{DD}$ </td><td> $0.9*V_{DD}$ </td><td>-</td></tr><tr><td rowspan="4"> $I_{OL}$ </td><td rowspan="4">Output low-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>1</td><td rowspan="8">mA</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2.5</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>3</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>10</td></tr><tr><td rowspan="4"> $I_{OH}$ </td><td rowspan="4">Output high-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>0.7</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>7</td></tr><tr><td rowspan="2"> $t_{RISE}$ </td><td rowspan="2">Rise time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td><td rowspan="4">nS</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td rowspan="2"> $t_{FALL}$ </td><td rowspan="2">Fall time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td> $I_{LEAK}$ </td><td>Input leakage current</td><td>Pull-up resistors disabled</td><td>-1</td><td>+/-0.015</td><td>1</td><td>μA</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

## A.7.2 I<sup>2</sup>C Pins

Refer to “I/O Multiplexing and Considerations” on page 13 to get the list of ${ \mathsf { I } } ^ { 2 } { \mathsf { C } }$ pins.

Table 40-11. I<sup>2</sup>C Pins Characteristics in $\mathsf { I } ^ { 2 } \mathsf { C }$ configuration

<table><tr><td>Symbol</td><td>Parameter</td><td>Condition</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td></td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td>0.25* $V_{DD}$ </td><td rowspan="7">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td>0.3* $V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>0.7* $V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>0.55* $V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{HYS}$ </td><td>Hysteresis of Schmitt trigger inputs</td><td></td><td>0.08* $V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td rowspan="2"> $V_{OL}$ </td><td rowspan="2">Output low-level voltage</td><td> $V_{DD}>2.0V$  $I_{OL}=3mA$ </td><td>-</td><td>-</td><td>0.4</td></tr><tr><td> $V_{DD}\leq 2.0V$  $I_{OL}=2mA$ </td><td>-</td><td>-</td><td>0.2* $V_{DD}$ </td></tr><tr><td> $C_I$ </td><td>Capacitance for each I/O Pin</td><td></td><td></td><td></td><td></td><td>pF</td></tr><tr><td rowspan="3"> $I_{OL}$ </td><td rowspan="3">Output low-level current</td><td> $V_{OL}=0.4V$ Standard, Fast and HS Modes</td><td>3</td><td>-</td><td>-</td><td rowspan="3">mA</td></tr><tr><td> $V_{OL}=0.4V$ Fast Mode+</td><td>20</td><td>-</td><td>-</td></tr><tr><td> $V_{OL}=0.6V$ </td><td>6</td><td>-</td><td>-</td></tr><tr><td> $f_{SCL}$ </td><td>SCL clock frequency</td><td></td><td>-</td><td>-</td><td>3.4</td><td>MHz</td></tr><tr><td rowspan="2"> $R_P$ </td><td rowspan="2">Value of pull-up resistor</td><td> $f_{SCL}\leq 100kHz$ </td><td rowspan="2"></td><td rowspan="2"></td><td></td><td rowspan="2">Ω</td></tr><tr><td> $f_{SCL}>100kHz$ </td><td></td></tr></table>

Table 40-12. USB Pins Characteristics in I/O Configuration

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $R_{PULL}$ </td><td>Pull-up - Pull-down resistance</td><td></td><td>20</td><td>40</td><td>60</td><td>kΩ</td></tr><tr><td rowspan="2"> $V_{IL}$ </td><td rowspan="2">Input low-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td>-</td><td>-</td><td> $0.25*V_{DD}$ </td><td rowspan="6">V</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td>-</td><td>-</td><td> $0.3*V_{DD}$ </td></tr><tr><td rowspan="2"> $V_{IH}$ </td><td rowspan="2">Input high-level voltage</td><td> $V_{DD}=1.62V-2.7V$ </td><td> $0.7*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{DD}=2.7V-3.63V$ </td><td> $0.55*V_{DD}$ </td><td>-</td><td>-</td></tr><tr><td> $V_{OL}$ </td><td>Output low-level voltage</td><td> $V_{DD}>1.6V, I_{OL} \max$ </td><td>-</td><td> $0.1*V_{DD}$ </td><td> $0.2*V_{DD}$ </td></tr><tr><td> $V_{OH}$ </td><td>Output high-level voltage</td><td> $V_{DD}>1.6V, I_{OH} \max$ </td><td> $0.8*V_{DD}$ </td><td> $0.9*V_{DD}$ </td><td>-</td></tr><tr><td rowspan="4"> $I_{OL}$ </td><td rowspan="4">Output low-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>1</td><td rowspan="8">mA</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2.5</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>3</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>10</td></tr><tr><td rowspan="4"> $I_{OH}$ </td><td rowspan="4">Output high-level current</td><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>0.7</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=0$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=1.62V-3V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>2</td></tr><tr><td> $V_{DD}=3V-3.63V, PORT.PINCFG.DRVSTR=1$ </td><td>-</td><td>-</td><td>7</td></tr><tr><td rowspan="2"> $t_{RISE}$ </td><td rowspan="2">Rise time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td><td rowspan="4">nS</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td rowspan="2"> $t_{FALL}$ </td><td rowspan="2">Fall time(1)</td><td>PORT.PINCFG.DRVSTR=0 load = 5pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td>PORT.PINCFG.DRVSTR=1 load = 20pF,  $V_{DD}=3.3V$ </td><td></td><td>-</td><td>15</td></tr><tr><td> $I_{LEAK}$ </td><td>Input leakage current</td><td>Pull-up resistors disabled</td><td>-1</td><td>+/-0.015</td><td>1</td><td>μA</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

## A.8 Injection Current

Stresses beyond those listed in the table below may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

Table 40-13. Injection Current<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Min.</td><td>Max.</td><td>Units</td></tr><tr><td> $I_{inj1}^{(2)}$ </td><td>IO pin injection current</td><td>-1</td><td>+1</td><td rowspan="3">mA</td></tr><tr><td> $T_{inj2}^{(3)}$ </td><td>IO pin injection current</td><td>-15</td><td>+15</td></tr><tr><td> $I_{injtotal}$ </td><td>Sum of IO pins injection current</td><td>-45</td><td>+45</td></tr></table>

1. Injecting current may have an effect on the accuracy of Analog blocks  
2. Conditions for Vpin: Vpin < GND-0.3V or 3.6V < Vpin ≤ 4.2V  
Conditions for VDD: 3V < VDD ≤ 3.6V.

I $\mathsf { f } \mathsf { V } _ { \mathsf { p i n } }$ is lower than GND-0.6V, then a current limiting resistor is required. The negative DC injection current limiting resistor R is calculated as R = |(GND-0.6V . Vpin)/Iinj1|.

If Vpin is greater than VDD+0.6V, a current limiting resistor is required. The positive DC injection current limiting resistor R is calculated as R = (Vpin-(VDD+0.6V))/Iinj1

3. Conditions for Vpin: Vpin < GND-0.6V or Vpin ≤ 3.6V. Conditions for VDD: VDD ≤ 3V.

If Vpin is lower than GND-0.6V, a current limiting resistor is required. The negative DC injection current limiting resistor R is calculated as R = |(GND-0.6V . Vpin)/Iinj2|.

If Vpin is greater than VDD+0.6V, a current limiting resistor is required. The positive DC injection current limiting resistor R is calculated as R = (Vpin-(VDD+0.6V))/Iinj2.

## A.9 Analog Characteristics

## A.9.1 Voltage Regulator Characteristics

Table 40-14. Decoupling requirements

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $C_{IN}$ </td><td>Input regulator capacitor, between  $V_{DDIN}$  and GND</td><td></td><td>-</td><td>4.7</td><td>-</td><td>μF</td></tr></table>

Note: Supplying any external components using VDDCORE pin is not allowed to assure the integrity of the core supply voltage.

## A.9.2 Power-On Reset (POR) Characteristics

Table 40-15. POR Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{POT+}$ </td><td>Voltage threshold on  $V_{DDIN}$  rising</td><td rowspan="2"> $V_{DD}$  falls at 1V/ms or slower</td><td>1.27</td><td>1.43</td><td>1.58</td><td rowspan="2">V</td></tr><tr><td> $V_{POT-}$ </td><td>Voltage threshold on  $V_{DDIN}$  falling</td><td>0.62</td><td>1.02</td><td>1.32</td></tr></table>

Figure 40-2. POR Operating Principle  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_1f6ca98fe0952d359f143ac8c93b1c54b71b6c47aaff57e52b886f8003fa589c.jpg)

## A.9.3 Brown-Out Detectors Characteristics

## BOD33

Figure 40-3. BOD33 Hysteresis OFF  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_9ad49e3523c95358b2c31affeca0b35c9d33f248069d4778be44532b658002b0.jpg)

Figure 40-4. BOD33 Hysteresis ON  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_2069079460d4a411795ac5c435facce6b893ac010d555ae78fc1cba7fc31b628.jpg)

Table 40-16. BOD33 LEVEL Value

<table><tr><td>Symbol</td><td>BOD33.LEVEL</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="4"> $V_{BOD+}$ </td><td>6</td><td rowspan="4">Hysteresis ON</td><td>-</td><td>1.67</td><td>1.71</td><td rowspan="8">V</td></tr><tr><td>7</td><td>-</td><td>1.70</td><td>1.75</td></tr><tr><td>39</td><td>-</td><td>2.81</td><td>2.83</td></tr><tr><td>48</td><td>-</td><td>3.09</td><td>3.20</td></tr><tr><td rowspan="4"> $V_{BOD-}$ or $V_{BOD}$ </td><td>6</td><td rowspan="4">Hysteresis ON or Hysteresis OFF</td><td>1.61</td><td>1.64</td><td>1.65</td></tr><tr><td>7</td><td>1.64</td><td>1.67</td><td>1.69</td></tr><tr><td>39</td><td>2.72</td><td>2.76</td><td>2.79</td></tr><tr><td>48</td><td>3.00</td><td>3.07</td><td>3.10</td></tr></table>

Note: See chapter Memories table “NVM User Row Mapping” on page 23 for the BOD33 default value settings.

Table 40-17. BOD33 Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td></td><td>Step size, between adjacent values in BOD33.LEVEL</td><td></td><td>-</td><td>34</td><td>-</td><td rowspan="2">mV</td></tr><tr><td> $V_{HYST}$ </td><td> $V_{BOD+} - V_{BOD-}$ </td><td>Hysteresis ON</td><td>35</td><td>-</td><td>100</td></tr><tr><td> $t_{DET}$ </td><td>Detection time</td><td>Time with  $V_{DDANA} < V_{TH}$  necessary to generate a reset signal</td><td>-</td><td> $0.9^{(1)}$ </td><td>-</td><td rowspan="2">μs</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td></td><td>-</td><td> $2.2^{(1)}$ </td><td>-</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

Table 40-18. BOD33 Mode Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td> $T_A$ </td><td> $V_{CC}$ </td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="6"> $I_{BOD33}$ </td><td rowspan="6">Current consumption</td><td rowspan="2">IDLE2, Continuous mode</td><td>25°C</td><td rowspan="2">3.3V</td><td>25</td><td>48</td><td rowspan="6">μA</td></tr><tr><td>-40 to 105°C</td><td>-</td><td>51</td></tr><tr><td rowspan="2">IDLE2, Sampling mode</td><td>25°C</td><td rowspan="2">1.8V</td><td>0.034</td><td>0.21</td></tr><tr><td>-40 to 105°C</td><td>-</td><td>2.44</td></tr><tr><td rowspan="2">STDBY, Sampling mode</td><td>25°C</td><td rowspan="2">3.3V</td><td>0.132</td><td>0.38</td></tr><tr><td>-40 to 105°C</td><td>-</td><td>1.5</td></tr></table>

## A.9.4 Analog-to-Digital (ADC) Characteristics

Table 40-19. Operating Conditions

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>RES</td><td>Resolution</td><td></td><td>8</td><td>-</td><td>12</td><td>bits</td></tr><tr><td> $f_{CLK\_ADC}$ </td><td>ADC Clock frequency</td><td></td><td>30</td><td>-</td><td>2100</td><td>kHz</td></tr><tr><td rowspan="2"></td><td rowspan="2">Sample rate(1)</td><td>Single shot</td><td>5</td><td>-</td><td>300</td><td rowspan="2">ksps</td></tr><tr><td>Free running</td><td>5</td><td>-</td><td> $350^{(3)}$ </td></tr><tr><td></td><td>Sampling time(1)</td><td></td><td>0.5</td><td>-</td><td>-</td><td>cycles</td></tr><tr><td></td><td>Conversion time(1)</td><td>1x Gain</td><td>6</td><td>-</td><td>-</td><td>cycles</td></tr><tr><td> $V_{DDANA}$ </td><td>Power supply voltage</td><td>T &gt; 85°C</td><td>2.7</td><td>-</td><td>3.6</td><td>V</td></tr><tr><td> $V_{REF}$ </td><td>Voltage reference range</td><td></td><td>1.0</td><td>-</td><td> $V_{DDANA}-0.6$ </td><td>V</td></tr><tr><td> $V_{REFINT1V}$ </td><td>Internal 1V reference (2)</td><td></td><td>-</td><td>1.0</td><td>-</td><td>V</td></tr><tr><td> $V_{REFINTVCC0}$ </td><td>Internal ratiometric reference 0(2)</td><td></td><td>-</td><td> $V_{DDANA}/1.48$ </td><td>-</td><td>V</td></tr><tr><td> $V_{REFINTVCC0}$ Voltage Error</td><td>Internal ratiometric reference 0(2) error</td><td>2.0V $-1-1%$ </td><td>-1</td><td>-</td><td>1</td><td>%</td></tr><tr><td>\( V_{REFINTVCC1}</td><td>Internal ratiometric reference 1(2)</td><td> $V_{DDANA}>2.0V$ </td><td>-</td><td> $V_{DDANA}/2$ </td><td>-</td><td>V</td></tr><tr><td> $V_{REFINTVCC1}$ Voltage Error</td><td>Internal ratiometric reference 1(2) error</td><td>2.0V $-1-1%$ </td><td>-1</td><td>-</td><td>1</td><td>%</td></tr><tr><td rowspan="2"></td><td rowspan="2">Conversion range(1)</td><td>Differential mode</td><td>\( -V_{REF}/GAIN</td><td>-</td><td> $+V_{REF}/GAIN$ </td><td>V</td></tr><tr><td>Single-ended mode</td><td>0.0</td><td>-</td><td> $+V_{REF}/GAIN$ </td><td>V</td></tr><tr><td> $C_{SAMPLE}$ </td><td>Sampling capacitance(2)</td><td></td><td>-</td><td>3.5</td><td>-</td><td>pF</td></tr><tr><td> $R_{SAMPLE}$ </td><td>Input channel source resistance(2)</td><td></td><td>-</td><td>-</td><td>3.5</td><td>kΩ</td></tr><tr><td> $I_{DD}$ </td><td>DC supply current(1)</td><td> $f_{CLK\_ADC}=2.1MHz^{(3)}$ </td><td>-</td><td>3.8</td><td>4.5</td><td>mA</td></tr></table>

1. These values are based on characterization. These values are not covered by test limits in production.  
2. These values are based on simulation. These values are not covered by test limits in production or characterization.  
3. In this condition and for a sample rate of 350ksps, a conversion takes 6 clock cycles of the ADC clock (conditions: 1X gain, 12-bit resolution, differential mode, free-running).

Table 40-20. Differential Mode

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>ENOB</td><td>Effective Number Of Bits</td><td>With gain compensation</td><td>-</td><td>10.0</td><td>10.4</td><td>bits</td></tr><tr><td>TUE</td><td>Total Unadjusted Error</td><td>1x Gain</td><td>3.1</td><td>4.3</td><td>16</td><td>LSB</td></tr><tr><td>INL</td><td>Integral Non Linearity</td><td>1x Gain</td><td>1.0</td><td>1.3</td><td>5.0</td><td>LSB</td></tr><tr><td>DNL</td><td>Differential Non Linearity</td><td>1x Gain</td><td>+/-0.3</td><td>+/-0.5</td><td>+/-0.98</td><td>LSB</td></tr><tr><td></td><td rowspan="3">Gain Error</td><td>Ext. Ref 1x</td><td>-25.0</td><td>2.5</td><td>+25.0</td><td>mV</td></tr><tr><td></td><td> $V_{REF}=V_{DDANA}/1.48$ </td><td>-30.0</td><td>-1.5</td><td>+30.0</td><td>mV</td></tr><tr><td></td><td>Bandgap</td><td>-15.0</td><td>-5.0</td><td>+10.0</td><td>mV</td></tr><tr><td rowspan="2"></td><td rowspan="2">Gain Accuracy(5)</td><td>Ext. Ref. 0.5x</td><td>+/-0.04</td><td>+/-0.2</td><td>+/-1.0</td><td>%</td></tr><tr><td>Ext. Ref. 2x to 16x</td><td>+/-0.1</td><td>+/-0.4</td><td>+/-1.5</td><td>%</td></tr><tr><td rowspan="3"></td><td rowspan="3">Offset Error</td><td>Ext. Ref. 1x</td><td>-10.0</td><td>-1.5</td><td>+10.0</td><td>mV</td></tr><tr><td> $V_{REF}=V_{DDANA}/1.48$ </td><td>-10.0</td><td>0.5</td><td>+10.0</td><td>mV</td></tr><tr><td>Bandgap</td><td>-10.0</td><td>3.0</td><td>+10.0</td><td>mV</td></tr><tr><td>SFDR</td><td>Spurious Free Dynamic Range</td><td rowspan="4">1x Gain $F_{CLK\_ADC} = 2.1MHz$  $F_{IN} = 40kHz$  $A_{IN} = 95\%FSR$ </td><td>63.0</td><td>70.4</td><td>74.8</td><td>dB</td></tr><tr><td>SINAD</td><td>Signal-to-Noise and Distortion</td><td>57.0</td><td>61.4</td><td>64.3</td><td>dB</td></tr><tr><td>SNR</td><td>Signal-to-Noise Ratio</td><td>57.9</td><td>63.6</td><td>65.5</td><td>dB</td></tr><tr><td>THD</td><td>Total Harmonic Distortion</td><td>-74.5</td><td>-70.2</td><td>-64.5</td><td>dB</td></tr><tr><td></td><td>Noise RMS</td><td>T=25°C</td><td>0.6</td><td>1.0</td><td>2</td><td>mV</td></tr></table>

Notes: 1. Maximum numbers are based on characterization and not tested in production, and valid for 5% to 95% of the input voltage range.  
2. Dynamic parameter numbers are based on characterization and not tested in production.

2. Respect the input common mode voltage through the following equations (where $\mathsf { V } _ { \mathsf { C M \_ I N } }$ is the Input channel common mode voltage) for all $\mathsf { V } _ { \mathsf { I N } } .$

3. Respect the input common mode voltage through the following equations (where $\mathsf { V } _ { \mathsf { C M \_ I N } }$ is the Input channel common mode voltage):

e. $\mid \mathsf { f } \mid \mathsf { V } _ { \mid \mathsf { N } } \mid > \mathsf { V } _ { \mathsf { R E F } } / 4$

$$
V _ {C M \_ I N} <   0. 9 5 ^ {*} V _ {D D A N A} + V _ {R E F} / 4 - 0. 7 5 V
$$

$$
V _ {C M \_ I N} > V _ {R E F} / 4 - 0. 0 5 ^ {*} V _ {D D A N A} - 0. 1 V
$$

f. $\mid \mathsf { f } \mid \mathsf { V } _ { \mid \mathsf { N } } \mid < \mathsf { V } _ { \mathsf { R E F } } / 4$

$$
V _ {C M \_ I N} <   1. 2 ^ {*} V _ {D D A N A} - 0. 7 5 V
$$

$$
V _ {C M \_ I N} > 0. 2 ^ {*} V _ {D D A N A} - 0. 1 V
$$

4. The ADC channels on pins PA08, PA09, PA10, PA11 are powered from the VDDIO power supply. The ADC performance of these pins will not be the same as all the other ADC channels on pins powered from the VDDANA power supply.

5. The gain accuracy represents the gain error expressed in percent. Gain accuracy (%) = (Gain Error in V x 100) / (2\*Vref/GAIN)

Table 40-21. Single-Ended Mode

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>ENOB</td><td>Effective Number of Bits</td><td>With gain compensation</td><td></td><td>9.5</td><td>9.8</td><td>Bits</td></tr><tr><td>TUE</td><td>Total Unadjusted Error</td><td>1x gain</td><td></td><td>10.5</td><td>40.0</td><td>LSB</td></tr><tr><td>INL</td><td>Integral Non-Linearity</td><td>1x gain</td><td>1.0</td><td>1.6</td><td>10.0</td><td>LSB</td></tr><tr><td>DNL</td><td>Differential Non-Linearity</td><td>1x gain</td><td>+/-0.5</td><td>+/-0.6</td><td>+/-0.98</td><td>LSB</td></tr><tr><td></td><td>Gain Error</td><td>Ext. Ref. 1x</td><td>-5.0</td><td>0.7</td><td>+5.0</td><td>mV</td></tr><tr><td></td><td rowspan="2"> $Gain\ Accuracy^{(4)}$ </td><td>Ext. Ref. 0.5x</td><td>+/-0.09</td><td>+/-0.59</td><td>+/-3.5</td><td>%</td></tr><tr><td></td><td>Ext. Ref. 2x to 16X</td><td>+/-0.03</td><td>+/-0.2</td><td>+/-4.0</td><td>%</td></tr><tr><td></td><td>Offset Error</td><td>Ext. Ref. 1x</td><td>-5</td><td>2.0</td><td>10</td><td>mV</td></tr><tr><td>SFDR</td><td>Spurious Free Dynamic Range</td><td rowspan="4">1x Gain $F_{CLK\_ADC} = 2.1MHz$  $F_{IN} = 40kHz$  $A_{IN} = 95\%FSR$ </td><td>54.2</td><td>65.0</td><td>76.0</td><td>dB</td></tr><tr><td>SINAD</td><td>Signal-to-Noise and Distortion</td><td>47.5</td><td>59.5</td><td>61</td><td>dB</td></tr><tr><td>SNR</td><td>Signal-to-Noise Ratio</td><td>48</td><td>60.0</td><td>64</td><td>dB</td></tr><tr><td>THD</td><td>Total Harmonic Distortion</td><td>-74</td><td>-68.8</td><td>-62.1</td><td>dB</td></tr><tr><td></td><td>Noise RMS</td><td>T = 25°C</td><td>-</td><td>1.0</td><td>-</td><td>mV</td></tr></table>

Notes: 1. Maximum numbers are based on characterization and not tested in production, and for 5% to 95% of the input voltage range.  
$\mathsf { V } _ { \mathsf { C M \_ I N } } < 0 . 7 ^ { \star } \mathsf { V } _ { \mathsf { D D A N A } } + \mathsf { V } _ { \mathsf { R E F } } / 4 -$ – 0.75V  
$\mathsf { V } _ { \mathsf { C M \_ l N } } > \mathsf { V } _ { \mathsf { R E F } } / 4 - 0 . 3 ^ { \star } \mathsf { V } _ { \mathsf { D D A N A } } - 0 . 1 \mathsf { V }$  
3. The ADC channels on pins PA08, PA09, PA10, PA11 are powered from the VDDIO power supply. The ADC performance of these pins will not be the same as all the other ADC channels on pins powered from the VDDANA power supply.  
4. The gain accuracy represents the gain error expressed in percent. Gain accuracy (%) = (Gain Error in V x 100) $\mathrm { ' } ( \mathsf { V } _ { \mathsf { R E F } } / \mathsf { G A I N } )$

## Performance with the Averaging Digital Feature

Averaging is a feature which increases the sample accuracy. ADC automatically computes an average value of multiple consecutive conversions. The numbers of samples to be averaged is specified by the Number-of-Samples-to be-collected bit group in the Average Control register (AVGCTRL.SAMPLENUM[3:0]) and the averaged output is available in the Result register (RESULT).

Table 40-22. Averaging feature

<table><tr><td>Average Number</td><td>Conditions</td><td>SNR (dB)</td><td>SINAD (dB)</td><td>SFDR (dB)</td><td>ENOB (bits)</td></tr><tr><td>1</td><td rowspan="4">In differential mode, 1x gain, $V_{DDANA}$ =3.0V,  $V_{REF}$ =1.0V, 350kSpsT=25°C</td><td>66.0</td><td>65.0</td><td>72.8</td><td>9.75</td></tr><tr><td>8</td><td>67.6</td><td>65.8</td><td>75.1</td><td>10.62</td></tr><tr><td>32</td><td>69.7</td><td>67.1</td><td>75.3</td><td>10.85</td></tr><tr><td>128</td><td>70.4</td><td>67.5</td><td>75.5</td><td>10.91</td></tr></table>

## Performance with the hardware offset and gain correction

Inherent gain and offset errors affect the absolute accuracy of the ADC. The offset error cancellation is handled by the Offset Correction register (OFFSETCORR) and the gain error cancellation, by the Gain Correction register (GAINCORR). The offset and gain correction value is subtracted from the converted data before writing the Result register (RESULT).

Table 40-23. Offset and Gain correction feature

<table><tr><td>Gain Factor</td><td>Conditions</td><td>Offset Error (mV)</td><td>Gain Error (mV)</td><td>Total Unadjusted Error (LSB)</td></tr><tr><td>0.5x</td><td rowspan="5">In differential mode, 1x gain, $V_{DDANA}$ =3.0V,  $V_{REF}$ =1.0V, 350kspsT=25°C</td><td>0.25</td><td>1.0</td><td>2.4</td></tr><tr><td>1x</td><td>0.20</td><td>0.10</td><td>1.5</td></tr><tr><td>2x</td><td>0.15</td><td>-0.15</td><td>2.7</td></tr><tr><td>8x</td><td>-0.05</td><td>0.05</td><td>3.2</td></tr><tr><td>16x</td><td>0.10</td><td>-0.05</td><td>6.1</td></tr></table>

## Inputs and Sample and Hold Acquisition Times

The analog voltage source must be able to charge the sample and hold (S/H) capacitor in the ADC in order to achieve maximum accuracy. Seen externally the ADC input consists of a resistor $\left( { { R } _ { S A M P L E } } \right)$ and a capacitor $\big ( C _ { S A M P L E } \big )$ . In addition, the source resistance $\left( { { R _ { S O U R C E } } } \right)$ must be taken into account when calculating the required sample and hold time. Figure 35-5 shows the ADC input channel equivalent circuit.

To achieve n bits of accuracy, the $C _ { S A M P L E }$ capacitor must be charged at least to a voltage of

$$
V _ {C S A M P L E} \geq V _ {I N} \times (1 - 2 ^ {- (n + 1)})
$$

The minimum sampling time t<sub>SAMPLEHOLD</sub> for a given $R _ { S O U R C E }$ can be found using this formula:

$$
t _ {S A M P L E H O L D} \geq (R _ {S A M P L E} + R _ {S O U R C E}) \times (C _ {S A M P L E}) \times (n + 1) \times \ln (2)
$$

for a 12 bits accuracy:

$$
t _ {S A M P L E H O L D} \geq (R _ {S A M P L E} + R _ {S O U R C E}) \times (C _ {S A M P L E}) \times 9. 0 2
$$

where

$$
t _ {S A M P L E H O L D} = \frac {1}{2 \times f _ {A D C}}
$$

## A.9.5 Digital to Analog Converter (DAC) Characteristics

Table 40-24. Operating Conditions<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $V_{DDANA}$ </td><td>Analog supply voltage</td><td></td><td>1.62</td><td>-</td><td>3.63</td><td>V</td></tr><tr><td> $AV_{REF}$ </td><td>External reference voltage</td><td></td><td>1.0</td><td>-</td><td> $V_{DDANA}-0.6$ </td><td>V</td></tr><tr><td></td><td>Internal reference voltage 1</td><td></td><td>-</td><td>1</td><td>-</td><td>V</td></tr><tr><td></td><td>Internal reference voltage 2</td><td></td><td>-</td><td> $V_{DDANA}$ </td><td>-</td><td>V</td></tr><tr><td></td><td>Linear output voltage range</td><td></td><td>0.05</td><td>-</td><td> $V_{DDANA}-0.05$ </td><td>V</td></tr><tr><td></td><td>Minimum resistive load</td><td></td><td>5</td><td>-</td><td>-</td><td>kΩ</td></tr><tr><td></td><td>Maximum capacitance load</td><td></td><td>-</td><td>-</td><td>100</td><td>pF</td></tr><tr><td> $I_{DD}$ </td><td>DC supply current(2)</td><td>Voltage pump disabled</td><td>-</td><td>184</td><td>230</td><td>μA</td></tr></table>

Notes: 1. These values are based on specifications otherwise noted.  
2. These values are based on characterization. These values are not covered by test limits in production.

Table 40-25. Clock and Timing<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="2"></td><td rowspan="2">Conversion rate</td><td rowspan="2"> $C_{load}=100pF$  $R_{load}>5kΩ$ </td><td>Normal mode</td><td>-</td><td>-</td><td>350</td><td rowspan="2">ksps</td></tr><tr><td>For  $\Delta_{DATA}=+/-1$ </td><td>-</td><td>-</td><td>1000</td></tr><tr><td rowspan="2"></td><td rowspan="2">Startup time</td><td colspan="2"> $V_{DDNA}>2.6V$ </td><td>-</td><td>-</td><td>2.85</td><td>μs</td></tr><tr><td colspan="2"> $V_{DDNA}<2.6V$ </td><td>-</td><td>-</td><td>10</td><td>μs</td></tr></table>

Note: 1. These values are based on simulation. These values are not covered by test limits in production or characterization.

Table 40-26. Accuracy Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td>RES</td><td>Input resolution</td><td colspan="2"></td><td></td><td></td><td>10</td><td>Bits</td></tr><tr><td rowspan="6">INL</td><td rowspan="6">Integral non-linearity</td><td rowspan="2"> $V_{REF}$ =Ext 1.0V</td><td> $V_{DD}$ =1.6V</td><td>0.4</td><td>0.5</td><td>2.5</td><td rowspan="6">LSB</td></tr><tr><td> $V_{DD}$ =3.6V</td><td>0.6</td><td>0.7</td><td>1.5</td></tr><tr><td rowspan="2"> $V_{REF}$ = $V_{DDANA}$ </td><td> $V_{DD}$ =1.6V</td><td>1.4</td><td>1.5</td><td>2.5</td></tr><tr><td> $V_{DD}$ =3.6V</td><td>0.7</td><td>0.8</td><td>1.5</td></tr><tr><td rowspan="2"> $V_{REF}$ =INT1V</td><td> $V_{DD}$ =1.6V</td><td>0.4</td><td>0.5</td><td>1.5</td></tr><tr><td> $V_{DD}$ =3.6V</td><td>0.3</td><td>0.4</td><td>1.5</td></tr></table>

Table 40-26. Accuracy Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="6">DNL</td><td rowspan="6">Differential non-linearity</td><td rowspan="2"> $V_{REF}$ = Ext 1.0V</td><td> $V_{DD}$ = 1.6V</td><td>+/-0.2</td><td>+/-0.5</td><td>+/-1.5</td><td rowspan="6">LSB</td></tr><tr><td> $V_{DD}$ = 3.6V</td><td>+/-0.4</td><td>+/-0.6</td><td>+/-1.2</td></tr><tr><td rowspan="2"> $V_{REF}$ =  $V_{DDANA}$ </td><td> $V_{DD}$ = 1.6V</td><td>+/-1.1</td><td>+/-1.3</td><td>+/-1.5</td></tr><tr><td> $V_{DD}$ = 3.6V</td><td>+/-1.0</td><td>+/-1.1</td><td>+/-1.2</td></tr><tr><td rowspan="2"> $V_{REF}$ = INT1V</td><td> $V_{DD}$ = 1.6V</td><td>+/-0.2</td><td>+/-0.6</td><td>+/-1.5</td></tr><tr><td> $V_{DD}$ = 3.6V</td><td>+/-0.3</td><td>+/-0.6</td><td>+/-1.6</td></tr><tr><td></td><td>Gain error</td><td colspan="2">Ext.  $V_{REF}$ </td><td>+/-1.5</td><td>+/-4.0</td><td>+/-10</td><td>mV</td></tr><tr><td></td><td>Offset error</td><td colspan="2">Ext.  $V_{REF}$ </td><td>+/-1.0</td><td>+/-2</td><td>+/-6</td><td>mV</td></tr></table>

Note: 1. All values measured using a conversion rate of 350ksps.

## A.9.6 Analog Comparator Characteristics

Table 40-27. Electrical and Timing

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td></td><td>Positive input voltage range</td><td></td><td>0</td><td>-</td><td> $V_{DDANA}$ </td><td rowspan="2">V</td></tr><tr><td></td><td>Negative input voltage range</td><td></td><td>0</td><td>-</td><td> $V_{DDANA}$ </td></tr><tr><td rowspan="2"></td><td rowspan="2">Offset</td><td>Hysteresis = 0, Fast mode</td><td>-15</td><td>0.0</td><td>15</td><td rowspan="4">mV</td></tr><tr><td>Hysteresis = 0, Low power mode</td><td>-25</td><td>0.0</td><td>25</td></tr><tr><td rowspan="2"></td><td rowspan="2">Hysteresis</td><td>Hysteresis = 1, Fast mode</td><td>20</td><td>50</td><td>85</td></tr><tr><td>Hysteresis = 1, Low power mode</td><td>15</td><td>40</td><td>75</td></tr><tr><td rowspan="2"></td><td rowspan="2">Propagation delay</td><td>Changes for  $V_{ACM}=V_{DDANA}/2$ 100mV overdrive, Fast mode</td><td></td><td>90</td><td>180</td><td rowspan="2">ns</td></tr><tr><td>Changes for  $V_{ACM}=V_{DDANA}/2$ 100mV overdrive, Low power mode</td><td></td><td>282</td><td>520</td></tr><tr><td rowspan="2"> $t_{STARTUP}$ </td><td rowspan="2">Startup time</td><td>Enable to ready delayFast mode</td><td></td><td>1</td><td>2.6</td><td rowspan="2">μs</td></tr><tr><td>Enable to ready delayLow power mode</td><td></td><td>14</td><td>22</td></tr><tr><td rowspan="4"> $V_{SCALE}$ </td><td>INL(3)</td><td></td><td>-1.4</td><td>0.75</td><td>1.4</td><td rowspan="4">LSB</td></tr><tr><td>DNL(3)</td><td></td><td>-0.9</td><td>0.25</td><td>0.9</td></tr><tr><td>Offset Error (1)(2)</td><td></td><td>-0.2</td><td>0.260</td><td>0.92</td></tr><tr><td>Gain Error (1)(2)</td><td></td><td>-0.89</td><td>0.215</td><td>0.89</td></tr></table>

Notes: 1. According to the standard equation $V ( X ) = V _ { \bot S B } ^ { \bot } ( X + 1 ) ; V _ { \bot S B } = V _ { \Delta D A N A } / 6 4$  
2. Data computed with the Best Fit method  
3. Data computed using histogram

## A.9.7 Bandgap Reference Characteristics

Table 40-28. Bandgap (Internal 1.1V reference) characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="2">INT1V</td><td rowspan="2">Internal 1.1V Bandgap reference</td><td>Over voltage and [-40°C, +105°C]</td><td>1.08</td><td>1.1</td><td>1.12</td><td rowspan="2">V</td></tr><tr><td>Over voltage at 25°C</td><td>1.07</td><td>1.1</td><td>1.11</td></tr></table>

## A.9.8 Temperature Sensor Characteristics

## Temperature Sensor Characteristics

## Table 40-29. Temperature Sensor Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td></td><td>Temperature sensor output voltage</td><td>T=25°C, VDDANA=3.3V</td><td></td><td>0.688</td><td></td><td>V</td></tr><tr><td></td><td>Temperature sensor slope</td><td></td><td>2.06</td><td>2.16</td><td>2.26</td><td>mV/°C</td></tr><tr><td></td><td>Variation over VDDANA voltage</td><td>VDDANA=1.62V to 3.6V</td><td>-0.4</td><td>1.4</td><td>3.0</td><td>mV/V</td></tr><tr><td></td><td>Temperature Sensor accuracy</td><td>Using the method described in “Software-based Refinement of the Actual Temperature” on page 953</td><td>-10</td><td>-</td><td>10</td><td>°C</td></tr></table>

Note: 1. These values are based on characterization. These values are not covered by test limits in production.  
2. See also rev C errata concerning the temperature sensor.

## Software-based Refinement of the Actual Temperature

The temperature sensor behavior is linear but it depends on several parameters such as the internal voltage reference which itself depends on the temperature. To take this into account, each device contains a Temperature Log row with data measured and written during the production tests. These calibration values should be read by software to infer the most accurate temperature readings possible.

This Software Temperature Log row can be read at address 0x00806030. The Software Temperature Log row cannot be written.

This section specifies the Temperature Log row content and explains how to refine the temperature sensor output using the values in the Temperature Log row.

## Temperature Log Row

All values in this row were measured in the following conditions:

$\mathsf { V } _ { \mathsf { D D M N } } = \mathsf { V } _ { \mathsf { D D I O } } = \mathsf { V } _ { \mathsf { D D A N A } } = 3 . 3 \mathsf { V }$

z ADC Clock frequency = 1.0MHz

z ADC sample rate: 125ksps

z ADC sampling time: 57µs

z ADC mode: Free running mode, ADC averaging mode with 4 averaged samples

z Data computed on the average of 10 ADC conversions

z ADC voltage reference= 1.0V internal reference (INT1V)

z ADC input = temperature sensor

Table 40-30. Temperature Log Row Content

<table><tr><td>Bit Position</td><td>Name</td><td>Description</td></tr><tr><td>07:00</td><td>ROOM_TEMP_VAL_INT</td><td>Integer part of room temperature in °C</td></tr><tr><td>11:08</td><td>ROOM_TEMP_VAL_DEC</td><td>Decimal part of room temperature</td></tr><tr><td>19:12</td><td>HOT_TEMP_VAL_INT</td><td>Integer part of hot temperature in °C</td></tr><tr><td>23:20</td><td>HOT_TEMP_VAL_DEC</td><td>Decimal part of hot temperature</td></tr><tr><td>31:24:00</td><td>ROOM_INT1V_VAL</td><td>2&#x27;s complement of the internal 1V reference drift at room temperature (versus a 1.0 centered value)</td></tr><tr><td>39:32:00</td><td>HOT_INT1V_VAL</td><td>2&#x27;s complement of the internal 1V reference drift at hot temperature (versus a 1.0 centered value)</td></tr><tr><td>51:40:00</td><td>ROOM_ADC_VAL</td><td>12bit ADC conversion at room temperature</td></tr><tr><td>63:52:00</td><td>HOT_ADC_VAL</td><td>12bit ADC conversion at hot temperature</td></tr></table>

The temperature sensor values are logged during test production flow for Room and Hot insertions:

ROOM\_TEMP\_VAL\_INT and ROOM\_TEMP\_VAL\_DEC contains the measured temperature at room insertion (e.g. for ROOM\_TEMP\_VAL\_INT=25 and ROOM\_TEMP\_VAL\_DEC=2, the measured temperature at room insertion is 25.2°C).

HOT\_TEMP\_VAL\_INT and HOT\_TEMP\_VAL\_DEC contains the measured temperature at hot insertion (e.g. for HOT\_TEMP\_VAL\_INT=83 and HOT\_TEMP\_VAL\_DEC=3, the measured temperature at room insertion is 83.3°C).

The temperature log row also contains the corresponding 12bit ADC conversions of both Room and Hot temperatures:

ROOM\_ADC\_VAL contains the 12bit ADC value corresponding to (ROOM\_TEMP\_VAL\_INT, ROOM\_TEMP\_VAL\_DEC)

HOT\_ADC\_VAL contains the 12bit ADC value corresponding to (HOT\_TEMP\_VAL\_INT, HOT\_TEMP\_VAL\_DEC)

The temperature log row also contains the corresponding 1V internal reference of both Room and Hot temperatures:

ROOM\_INT1V\_VAL is the 2’s complement of the internal 1V reference value corresponding to (ROOM\_TEMP\_VAL\_INT, ROOM\_TEMP\_VAL\_DEC)

HOT\_INT1V\_VAL is the 2’s complement of the internal 1V reference value corresponding to (HOT\_TEMP\_VAL\_INT, HOT\_TEMP\_VAL\_DEC)

ROOM\_INT1V\_VAL and HOT\_INT1V\_VAL values are centered around 1V with a 0.001V step. In other words, the range of values [0,127] corresponds to [1V, 0.873V] and the range of values [-1, -127] corresponds to [1.001V, 1.127V]. INT1V == 1 - (VAL/1000) is valid for both ranges.

## Using Linear Interpolation

For concise equations, we’ll use the following notations:

z (ROOM\_TEMP\_VAL\_INT, ROOM\_TEMP\_VAL\_DEC) is denoted $\tan \beta _ { \mathsf { R } }$

z (HOT\_TEMP\_VAL\_INT, HOT\_TEMP\_VAL\_DEC) is denoted temp<sub>H</sub>

z ROOM\_ADC\_VAL is denoted $\mathsf { A D C } _ { \mathsf { R } } ,$ its conversion to Volt is denoted $\mathsf { V } _ { \mathsf { A D C R } }$

z HOT\_ADC\_VAL is denoted ${ \mathsf { A D C } } _ { \mathsf { H } } ,$ its conversion to Volt is denoted $\mathsf { V } _ { \mathsf { A D C H } }$

z ROOM\_INT1V\_VAL is denoted INT $1 \mathsf { V } _ { \mathsf { R } }$

z HOT\_INT1V\_VAL is denoted $\mathsf { I N T } 1 \mathsf { V } _ { \mathsf { H } }$

Using the $( \mathsf { t e m p } _ { \mathsf { R } } , \mathsf { A D C } _ { \mathsf { R } } )$ and $( \mathsf { t e m p } _ { \mathsf { H } } , \mathsf { A D C } _ { \mathsf { H } } )$ points, using a linear interpolation we have the following equation:

$$
\left(\frac {V _ {A D C} - V _ {A D C R}}{t e m p - t e m p _ {R}}\right) = \left(\frac {V _ {A D C H} - V _ {A D C R}}{t e m p _ {H} - t e m p _ {R}}\right)
$$

Given a temperature sensor ADC conversion value $\mathsf { A D C } _ { \mathsf { m } } ,$ we can infer a coarse value of the temperature temp<sub>C</sub> as:

[Equation 1]

$$
\operatorname{temp} _ {C} = \operatorname{temp} _ {R} + \left[ \frac {\left\{\left(A D C _ {m} \cdot \frac {1}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\} \cdot \left(\operatorname{temp} _ {H} - \operatorname{temp} _ {R}\right)}{\left\{\left(A D C _ {H} \cdot \frac {I N T 1 V _ {H}}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\}} \right]
$$

Note 1: in the previous expression, we’ve added the conversion of the ADC register value to be expressed in V Note 2: this is a coarse value because we assume INT1V=1V for this ADC conversion.

Using the $( \mathsf { t e m p } _ { \mathsf { R } } , \mathsf { I N T } 1 \mathsf { V } _ { \mathsf { R } } )$ and $\mathsf { ( t e m p _ { H } , \mathsf { I N T } 1 V _ { H } ) }$ points, using a linear interpolation we have the following equation:

$$
\left(\frac {I N T 1 V - I N T 1 V _ {R}}{t e m p - t e m p _ {R}}\right) = \left(\frac {I N T 1 V _ {H} - I N T 1 V _ {R}}{t e m p _ {H} - t e m p _ {R}}\right)
$$

Then using the coarse temperature value, we can infer a closer to reality INT1V value during the ADC conversion as:

$$
I N T 1 V _ {m} = I N T 1 V _ {R} + \left(\frac {(I N T 1 V _ {H} - I N T 1 V _ {R}) \cdot (t e m p _ {C} - t e m p _ {R})}{(t e m p _ {H} - t e m p _ {R})}\right)
$$

Back to [Equation 1], we replace INT1V=1V by $\mathsf { I N T 1 V } = \mathsf { I N T 1 V } _ { \mathsf { m } } ,$ , we can then deduce a finer temperature value as:

[Equation 1bis]

$$
\operatorname{temp} _ {f} = \operatorname{temp} _ {R} + \left[ \frac {\left\{\left(A D C _ {m} \cdot \frac {I N T 1 V _ {m}}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\} \cdot \left(\operatorname{temp} _ {H} - \operatorname{temp} _ {R}\right)}{\left\{\left(A D C _ {H} \cdot \frac {I N T 1 V _ {H}}{\left(2 ^ {1 2} - 1\right)}\right) - \left(A D C _ {R} \cdot \frac {I N T 1 V _ {R}}{\left(2 ^ {1 2} - 1\right)}\right) \right\}} \right]
$$

## A.10 NVM Characteristics

Table 40-31. Maximum Operating Frequency

<table><tr><td> $V_{DD}$  range</td><td>NVM Wait States</td><td>Maximum Operating Frequency</td><td>Units</td></tr><tr><td rowspan="4">1.62V to 2.7V</td><td>0</td><td>14</td><td rowspan="6">MHz</td></tr><tr><td>1</td><td>28</td></tr><tr><td>2</td><td>42</td></tr><tr><td>3</td><td>48</td></tr><tr><td rowspan="2">2.7V to 3.63V</td><td>0</td><td>24</td></tr><tr><td>1</td><td>48</td></tr></table>

Note that on this flash technology, a max number of 8 consecutive write is allowed per row. Once this number is reached, a row erase is mandatory.

Table 40-32. Flash Endurance and Data Retention

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $Ret_{NVM25k}$ </td><td>Retention after up to 25k</td><td>Average ambient 55°C</td><td>10</td><td>50</td><td>-</td><td>Years</td></tr><tr><td> $Ret_{NVM2.5k}$ </td><td>Retention after up to 2.5k</td><td>Average ambient 55°C</td><td>20</td><td>100</td><td>-</td><td>Years</td></tr><tr><td> $Ret_{NVM100}$ </td><td>Retention after up to 100</td><td>Average ambient 55°C</td><td>25</td><td>&gt;100</td><td>-</td><td>Years</td></tr><tr><td> $Cyc_{NVM}$ </td><td> $Cycling\ Endurance^{(1)}$ </td><td>-40°C &lt; Ta &lt; 105°C</td><td>25k</td><td>150k</td><td>-</td><td>Cycles</td></tr></table>

Note: 1. An endurance cycle is a write and an erase operation.

Table 40-33. EEPROM Emulation<sup>(1)</sup> Endurance and Data Retention

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $Ret_{EEPROM100k}$ </td><td>Retention after up to 100k</td><td>Average ambient 55°C</td><td>10</td><td>50</td><td>-</td><td>Years</td></tr><tr><td> $Ret_{EEPROM10k}$ </td><td>Retention after up to 10k</td><td>Average ambient 55°C</td><td>20</td><td>100</td><td>-</td><td>Years</td></tr><tr><td> $Cyc_{EEPROM}$ </td><td> $Cycling\ Endurance^{(2)}$ </td><td>-40°C &lt; Ta &lt; 105°C</td><td>100k</td><td>600k</td><td>-</td><td>Cycles</td></tr></table>

Notes: 1. The EEPROM emulation is a software emulation described in the App note AT03265.  
2. An endurance cycle is a write and an erase operation.

Table 40-34. NVM Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $t_{FPP}$ </td><td>Page programming time</td><td>-</td><td>-</td><td>-</td><td>2.5</td><td>ms</td></tr><tr><td> $t_{FRE}$ </td><td>Row erase time</td><td>-</td><td>-</td><td>-</td><td>6</td><td>ms</td></tr><tr><td> $t_{FCE}$ </td><td>DSU chip erase time (CHIP_ERASE)</td><td>-</td><td>-</td><td>-</td><td>240</td><td>ms</td></tr></table>

## A.11 Oscillators Characteristics

## A.11.1 Crystal Oscillator (XOSC) Characteristics

## Digital Clock Characteristics

The following table describes the characteristics for the oscillator when a digital clock is applied on XIN.

Table 40-35. Digital Clock Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{CPXIN}$ </td><td>XIN clock frequency</td><td>Digital mode</td><td>-</td><td>-</td><td>32</td><td>MHz</td></tr></table>

## Crystal Oscillator Characteristics

The following table describes the characteristics for the oscillator when a crystal is connected between XIN and XOUT as shown in Figure 40-5. The user must choose a crystal oscillator where the crystal load capacitance $\mathsf C _ { \mathsf { L } }$ is within the range given in the table. The exact value of $\mathsf C _ { \mathsf { L } }$ can be found in the crystal datasheet. The capacitance of the external capacitors $( { \mathsf { C } } _ { \mathsf { L E X T } } )$ can then be computed as follows:

$$
\mathrm{C} _ {\mathrm{LEXT}} = 2 (\mathrm{C} _ {\mathrm{L}} - \mathrm{C} _ {\mathrm{STRAY}} - \mathrm{C} _ {\mathrm{SHUNT}})
$$

where $\mathsf { C } _ { \mathsf { S T R A Y } }$ is the capacitance of the pins and PCB, $\mathsf { C } _ { \mathsf { S H U N T } }$ is the shunt capacitance of the crystal.

Table 40-36. Crystal Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Crystal oscillator frequency</td><td></td><td>0.4</td><td>-</td><td>32</td><td>MHz</td></tr><tr><td rowspan="6">ESR</td><td rowspan="6">Crystal Equivalent Series Resistance Safety Factor = 3</td><td>f = 0.455MHz,  $C_L$  = 100pFXOSC.GAIN = 0</td><td>-</td><td>-</td><td>5.6K</td><td rowspan="6">Ω</td></tr><tr><td>f = 2MHz,  $C_L$  = 20pFXOSC.GAIN = 0</td><td>-</td><td>-</td><td>416</td></tr><tr><td>f = 4MHz,  $C_L$  = 20pFXOSC.GAIN = 1</td><td>-</td><td>-</td><td>243</td></tr><tr><td>f = 8MHz,  $C_L$  = 20pFXOSC.GAIN = 2</td><td>-</td><td>-</td><td>138</td></tr><tr><td>f = 16MHz,  $C_L$  = 20pFXOSC.GAIN = 3</td><td>-</td><td>-</td><td>66</td></tr><tr><td>f = 32MHz,  $C_L$  = 18pFXOSC.GAIN = 4</td><td>-</td><td>-</td><td>56</td></tr><tr><td> $C_{XIN}$ </td><td>Parasitic capacitor load</td><td rowspan="2"></td><td>-</td><td>6.5</td><td>-</td><td>pF</td></tr><tr><td> $C_{XOUT}$ </td><td>Parasitic capacitor load</td><td>-</td><td>4.3</td><td>-</td><td>pF</td></tr><tr><td rowspan="10"> $I_{XOSC}$ </td><td rowspan="10">Current Consumption</td><td>f = 2MHz,  $C_L$  = 20pF, AGC off</td><td></td><td>65</td><td>87</td><td rowspan="10">μA</td></tr><tr><td>f = 2MHz,  $C_L$  = 20pF, AGC on</td><td></td><td>52</td><td>76</td></tr><tr><td>f = 4MHz,  $C_L$  = 20pF, AGC off</td><td></td><td>117</td><td>155</td></tr><tr><td>f = 4MHz,  $C_L$  = 20pF, AGC on</td><td></td><td>74</td><td>104</td></tr><tr><td>f = 8MHz,  $C_L$  = 20pF, AGC off</td><td></td><td>226</td><td>308</td></tr><tr><td>f = 8MHz,  $C_L$  = 20pF, AGC on</td><td></td><td>128</td><td>180</td></tr><tr><td>f = 16MHz,  $C_L$  = 20pF, AGC off</td><td></td><td>502</td><td>714</td></tr><tr><td>f = 16MHz,  $C_L$  = 20pF, AGC on</td><td></td><td>307</td><td>590</td></tr><tr><td>f = 32MHz,  $C_L$  = 18pF, AGC off</td><td></td><td>1622</td><td>2257</td></tr><tr><td>f = 32MHz,  $C_L$  = 18pF, AGC on</td><td></td><td>615</td><td>1280</td></tr><tr><td rowspan="5"> $t_{STARTUP}$ </td><td rowspan="5">Startup time</td><td>f = 2MHz,  $C_L$  = 20pF,XOSC.GAIN = 0, ESR = 600Ω</td><td></td><td>14K</td><td>48K</td><td rowspan="5">cycles</td></tr><tr><td>f = 4MHz,  $C_L$  = 20pF,XOSC.GAIN = 1, ESR = 100Ω</td><td></td><td>6800</td><td>19.5K</td></tr><tr><td>f = 8MHz,  $C_L$  = 20pF,XOSC.GAIN = 2, ESR = 35Ω</td><td></td><td>5550</td><td>13K</td></tr><tr><td>f = 16MHz,  $C_L$  = 20pF,XOSC.GAIN = 3, ESR = 25Ω</td><td></td><td>6750</td><td>14.5K</td></tr><tr><td>f = 32MHz,  $C_L$  = 18pF,XOSC.GAIN = 4, ESR = 40Ω</td><td></td><td>5.3K</td><td>9.6K</td></tr></table>

Figure 40-5. Oscillator Connection  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_3f9067017a8ea2c12e0c2aa44bfae782e589a1feeced4606bbfb1118b8899472.jpg)

## A.11.2 External 32kHz Crystal Oscillator (XOSC32K) Characteristics

## Digital Clock Characteristics

The following table describes the characteristics for the oscillator when a digital clock is applied on XIN32 pin.

Table 40-37. Digital Clock Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{CPXIN32}$ </td><td>XIN32 clock frequency</td><td>Digital mode</td><td>-</td><td>32.768</td><td>-</td><td>kHz</td></tr><tr><td></td><td>XIN32 clock duty cycle</td><td>Digital mode</td><td>-</td><td>50</td><td>-</td><td>%</td></tr></table>

## Crystal Oscillator Characteristics

Figure 40-5 and the equation in “Crystal Oscillator Characteristics” on page 957 also applies to the 32kHz oscillator connection. The user must choose a crystal oscillator where the crystal load capacitance $\mathsf C _ { \mathsf { L } }$ is within the range given in the table. The exact value of $\mathsf C _ { \mathsf { L } }$ can be found in the crystal datasheet.

Table 40-38. 32kHz Crystal Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Crystal oscillator frequency</td><td></td><td>-</td><td>32768</td><td></td><td>Hz</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td> $\text{ESR}_{\text{XTAL}} = 39.9\text{k}\Omega, \text{C}_L = 12.5\text{pF}$ </td><td>-</td><td>28K</td><td>30K</td><td>cycles</td></tr><tr><td> $C_L$ </td><td>Crystal load capacitance</td><td></td><td>-</td><td>-</td><td>12.5</td><td rowspan="4">pF</td></tr><tr><td> $C_{SHUNT}$ </td><td>Crystal shunt capacitance</td><td></td><td>-</td><td>0.1</td><td></td></tr><tr><td> $C_{XIN32}$ </td><td>Parasitic capacitor load</td><td rowspan="2">SOIC20/14 packages</td><td>-</td><td>6.5</td><td></td></tr><tr><td> $C_{XOUT32}$ </td><td>Parasitic capacitor load</td><td>-</td><td>4.3</td><td></td></tr><tr><td> $I_{XOSC32K}$ </td><td>Current consumption</td><td></td><td>-</td><td>1.22</td><td>2.2</td><td>μA</td></tr><tr><td>ESR</td><td>Crystal equivalent series resistance f=32.768kHz Safety Factor = 3</td><td> $C_L=12.5\text{pF}$ </td><td>-</td><td>-</td><td>100</td><td>kΩ</td></tr></table>

## A.11.3 Digital Frequency Locked Loop (DFLL48M) Characteristics

Table 40-39. DFLL48M Characteristics - Open Loop Mode<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Output frequency</td><td>DFLLVAL.COARSE = DFLL48M COARSE CAL DFLLVAL.FINE = 512</td><td>47</td><td>48</td><td>49</td><td>MHz</td></tr><tr><td> $I_{DFLL}$ </td><td>Power consumption on  $V_{DDIN}$ </td><td>DFLLVAL.COARSE = DFLL48M COARSE CAL DFLLVAL.FINE = 512</td><td>-</td><td>403</td><td>453</td><td>μA</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td>DFLLVAL.COARSE = DFLL48M COARSE CAL DFLLVAL.FINE = 512 $f_{OUT}$  within 90% of final value</td><td></td><td>8</td><td>9</td><td>μs</td></tr></table>

Note: 1. DFLL48M in Open loop after calibration at room temperature.

Table 40-40. DFLL48M Characteristics - Close Loop Mode<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{OUT}$ </td><td>Average Output frequency</td><td> $f_{REF}=32.768kHz$ </td><td>47.76</td><td>48</td><td>48.24</td><td>MHz</td></tr><tr><td> $f_{REF}$ </td><td>Reference frequency</td><td></td><td>0.732</td><td>32.768</td><td>33</td><td>kHz</td></tr><tr><td>Jitter</td><td>Cycle to Cycle jitter</td><td> $f_{REF}=32.768kHz$ </td><td>-</td><td>-</td><td>0.42</td><td>ns</td></tr><tr><td> $I_{DFLL}$ </td><td>Power consumption on  $V_{DDIN}$ </td><td> $f_{REF}=32.768kHz$ </td><td>-</td><td>403</td><td>453</td><td>μA</td></tr><tr><td> $t_{LOCK}$ </td><td>Lock time</td><td> $f_{REF}=32.768kHz$  $DFLLVAL.COARSE=DFLL48M COARSE CAL$  $DFLLVAL.FINE=512$  $DFLLCTRL.BPLCKC=1$  $DFLLCTRL.QLDIS=0$  $DFLLCTRL.CCDIS=1$  $DFLLMUL.FSTEP=10$ </td><td></td><td>200</td><td>500</td><td>μs</td></tr></table>

Note: 1. To insure that the device stays within the maximum allowed clock frequency, any reference clock for DFLL in close loop must be within a 2% error accuracy.

## A.11.4 32.768kHz Internal oscillator (OSC32K) Characteristics

## Table 40-41. 32kHz RC Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $f_{OUT}$ </td><td rowspan="3">Output frequency</td><td>Calibrated against a 32.768kHz reference at 25°C, over [-40, +105]°C, over [1.62, 3.63]V</td><td>30.3</td><td>32.768</td><td>34.4</td><td rowspan="3">kHz</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, at  $V_{DD}=3.3V$ </td><td>32.6</td><td>32.768</td><td>32.8</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, over [1.62, 3.63]V</td><td>32.4</td><td>32.768</td><td>33.1</td></tr><tr><td> $I_{OSC32K}$ </td><td>Current consumption</td><td></td><td></td><td>0.67</td><td>1.9</td><td>μA</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td></td><td></td><td>1</td><td>2</td><td>cycle</td></tr><tr><td>Duty</td><td>Duty Cycle</td><td></td><td></td><td>50</td><td></td><td>%</td></tr></table>

## A.11.5 Ultra Low Power Internal 32kHz RC Oscillator (OSCULP32K) Characteristics

Table 40-42. Ultra Low Power Internal 32kHz RC Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $f_{OUT}$ </td><td rowspan="3">Output frequency</td><td>Calibrated against a 32.768kHz reference at 25°C, over [-40, +105]°C, over [1.62, 3.63]V</td><td>27.8</td><td>32.768</td><td>38.3</td><td rowspan="3">kHz</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, at  $V_{DD}=3.3V$ </td><td>32.5</td><td>32.768</td><td>32.8</td></tr><tr><td>Calibrated against a 32.768kHz reference at 25°C, over [1.62, 3.63]V</td><td>31.9</td><td>32.768</td><td>33.1</td></tr><tr><td>Duty</td><td>Duty Cycle</td><td></td><td></td><td>50</td><td></td><td>%</td></tr></table>

## A.11.6 Multi RC Oscillator (OSC8M) Characteristics

Table 40-43. Multi RC Oscillator Characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $f_{OUT}$ </td><td rowspan="3">Output frequency</td><td>Calibrated against a 8MHz reference at 25°C, over [-40, +105]°C, over [1.62, 3.63]V</td><td>7.8</td><td>8</td><td>8.16</td><td rowspan="3">MHz</td></tr><tr><td>Calibrated against a 8MHz reference at 25°C, at  $V_{DD}=3.3V$ </td><td>7.94</td><td>8</td><td>8.06</td></tr><tr><td>Calibrated against a 8MHz reference at 25°C, over [1.62, 3.63]V</td><td>7.92</td><td>8</td><td>8.08</td></tr><tr><td>TempCo</td><td>Freq vs. temperature drift</td><td></td><td>-2.3</td><td></td><td>1.6</td><td>%</td></tr><tr><td>SupplyCo</td><td>Freq vs supply drift</td><td></td><td>-1</td><td></td><td>1</td><td>%</td></tr><tr><td> $I_{OSC8M}$ </td><td>Current consumption</td><td>IDLE2 on OSC32K versus IDLE2 on calibrated OSC8M enabled at 8MHz (FRANGE=1, PRESC=0)</td><td></td><td>64</td><td>96</td><td>μA</td></tr><tr><td> $t_{STARTUP}$ </td><td>Startup time</td><td></td><td></td><td>2.4</td><td>3.3</td><td>μs</td></tr><tr><td>Duty</td><td>Duty cycle</td><td></td><td></td><td>50</td><td></td><td>%</td></tr></table>

A.11.7 Fractional Digital Phase Locked Loop (FDPLL96M) Characteristics

Table 40-44. FDPLL96M Characteristics<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td>Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $f_{IN}$ </td><td>Input frequency</td><td></td><td>32</td><td>-</td><td>2000</td><td>KHz</td></tr><tr><td> $f_{OUT}$ </td><td>Output frequency</td><td></td><td>48</td><td>-</td><td>96</td><td>MHz</td></tr><tr><td rowspan="2"> $I_{FDPLL96M}$ </td><td rowspan="2">Current consumption</td><td> $f_{IN}= 32 kHz, f_{OUT}= 48 MHz$ </td><td></td><td>400</td><td>733</td><td rowspan="2">μA</td></tr><tr><td> $f_{IN}= 32 kHz, f_{OUT}= 96 MHz$ </td><td></td><td>650</td><td>1235</td></tr><tr><td rowspan="4">Jp</td><td rowspan="4">Period jitter</td><td> $f_{IN}$ =32 kHz,  $f_{OUT}$ =48 MHz</td><td></td><td>1.5</td><td>2</td><td rowspan="4">%</td></tr><tr><td> $f_{IN}$ =32 kHz,  $f_{OUT}$ =96 MHz</td><td></td><td>3.0</td><td>10</td></tr><tr><td> $f_{IN}$ =2 MHz,  $f_{OUT}$ =48 MHz</td><td></td><td>1.3</td><td>2</td></tr><tr><td> $f_{IN}$ =2 MHz,  $f_{OUT}$ =96 MHz</td><td></td><td>3.0</td><td>7</td></tr><tr><td rowspan="2"> $t_{LOCK}$ </td><td rowspan="2">Lock Time</td><td>After startup, time to get lock signal. $f_{IN}$ =32 kHz,  $f_{OUT}$ =96 MHz</td><td></td><td>1.3</td><td>2</td><td>ms</td></tr><tr><td> $f_{IN}$ =2 MHz,  $f_{OUT}$ =96 MHz</td><td></td><td>25</td><td>50</td><td>μs</td></tr><tr><td>Duty</td><td>Duty cycle</td><td></td><td>40</td><td>50</td><td>60</td><td>%</td></tr></table>

Note: 1. All values have been characterized with FILTSEL[1/0] as default value.

## A.12 PTC Typical Characteristics

## Figure 40-6. Power consumption [µA].

$$
1 \text {   sensor,   Frequency   mode   } = \text {   None,   CPU   Clk   } = 4 8 \text { MHz,   PTC   Clk   } = 4 \text { MHz,   } V _ {D D} = 3. 3 \text { V }
$$

![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_5c1ff8d70110d2d497a0a9b04a9b33282447d727cf2214f728f2daaa409ccf9f.jpg)

Figure 40-7. Power consumption [µA].  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_47ae41b28399da6726c319334cc528e8a9fba6651d83e2fa4abdd79b92dc68fb.jpg)  
Figure 40-8. Power consumption [µA].

10 sensors, Frequency mode = None, CPU Clk = 48MHz, PTC Clk = 4MHz, V =3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_d9c7706a9cf31229882eda8ea4a0344d7912e41b4b89d89838e42bf83d4b0ffc.jpg)

Figure 40-9. Power consumption [µA]. 10 sensors, Frequency mode = HOP, CPU Clk = 48MHz, PTC Clk = 2MHz, V =3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_a7f4a28e3bd238d11bc9e1d4c1570799c3e07bd336169f96b136612c95a63252.jpg)

Figure 40-10.Power consumption [µA].  
50 sensors, Frequency mode = None, CPU Clk = 48MHz, PTC Clk = 4MHz, V<sub>DD</sub>=3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c08f6d7abb134a45a89dcde91bbd681109760a739a01f16ca2f5c3bdea689b92.jpg)

Figure 40-11.Power consumption [µA]. 50 sensors, Frequency mode = HOP, CPU Clk = 48MHz, PTC Clk = 2MHz, V =3.3V  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_30a79c5e498a9b1114572c9b527977d14e6b7e0e348bc50b81757b0c0b8ccc54.jpg)

Figure 40-12.CPU utilization.  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c50a399a690407523f84a40e46465061950f7de1f007c20da01123b7a0e1e505.jpg)

## A.13 USB Characteristics

The USB on-chip buffers comply with the Universal Serial Bus (USB) v2.0 standard. All AC parameters related to these buffers can be found within the USB 2.0 electrical specifications.

The USB interface is USB-IF certified:

TID 40001664 - Peripheral Silicon > Low/Full Speed > Silicon Building Blocks

Electrical configuration required to be USB compliance:

\- The CPU frequency must be higher 8MHz when USB is active (No constraint for USB suspend mode)

\- The operating voltages must be 3.3V (Min. 3.0V, Max. 3.6V).

\- The GCLK\_USB frequency accuracy source must be less than:

\- In USB device mode, 48MHz +/-0.25%

Table 40-45. GCLK\_USB Clock Setup Recommendations

<table><tr><td colspan="2">Clock setup</td><td>USB Device</td></tr><tr><td rowspan="4">DFLL48M</td><td>Open loop</td><td>No</td></tr><tr><td>Closed loop, any internal OSC source</td><td>No</td></tr><tr><td>Closed loop, any external XOSC source</td><td>Yes</td></tr><tr><td>Closed loop, USB SOF source (USB recovery mode) $^{(1)}$ </td><td>Yes $^{(2)}$ </td></tr><tr><td rowspan="3">FDPLL96M</td><td>Any internal OSC source (32K, 8M, ... )</td><td>No</td></tr><tr><td>Any external XOSC source (&lt; 1MHz)</td><td>Yes</td></tr><tr><td>Any external XOSC source (&gt; 1MHz)</td><td>Yes $^{(3)}$ </td></tr></table>

Notes: 1. When using DFLL48M in USB recovery mode, the Fine Step value must be Ah to guarantee a USB clock at +/-0.25% before 11ms after a resume.  
2. Very high signal quality and crystal less. It is the best setup for USB Device mode.

3. FDPLL lock time is short when the clock frequency source is high (> 1MHz). Thus, FDPLL and external OSC can be stopped during USB suspend mode to reduce consumption and guarantee a USB wakeup time (See TDRSMDN in USB specification).

## A.14 Timing Characteristics

## A.14.1 External Reset

Table 40-46. External reset characteristics

<table><tr><td>Symbol</td><td>Parameter</td><td>Condition</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $t_{EXT}$ </td><td>Minimum reset pulse width</td><td></td><td>10</td><td>-</td><td>-</td><td>ns</td></tr></table>

## A.14.2 SERCOM in SPI Mode Timing

Figure 40-13.SPI timing requirements in master mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_cccb8d9f310bced7a864a5be4a38315b26632bf26d419e9340a191af7f526f4e.jpg)

Figure 40-14.SPI timing requirements in slave mode  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_f7577b3129c39448ce79084beeb2e2b3452807059c7af27a41a57d3285bfeb70.jpg)

Table 40-47. SPI timing characteristics and requirements<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td> $t_{SCK}$ </td><td>SCK period</td><td colspan="2">Master</td><td></td><td>84</td><td></td><td rowspan="21">ns</td></tr><tr><td> $t_{SCKW}$ </td><td>SCK high/low width</td><td colspan="2">Master</td><td>-</td><td>0.5 $*t_{SCK}$ </td><td>-</td></tr><tr><td> $t_{SCKR}$ </td><td>SCK rise time(2)</td><td colspan="2">Master</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{SCKF}$ </td><td>SCK fall time(2)</td><td colspan="2">Master</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{MIS}$ </td><td>MISO setup to SCK</td><td colspan="2">Master</td><td>-</td><td>21</td><td>-</td></tr><tr><td> $t_{MIH}$ </td><td>MISO hold after SCK</td><td colspan="2">Master</td><td>-</td><td>13</td><td>-</td></tr><tr><td> $t_{MOS}$ </td><td>MOSI setup SCK</td><td colspan="2">Master</td><td>-</td><td> $t_{SCK}/2 - 3$ </td><td>-</td></tr><tr><td> $t_{MOH}$ </td><td>MOSI hold after SCK</td><td colspan="2">Master</td><td>-</td><td>3</td><td>-</td></tr><tr><td> $t_{SSCK}$ </td><td>Slave SCK Period</td><td colspan="2">Slave</td><td>1 $*t_{CLK\_APB}$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SSCKW}$ </td><td>SCK high/low width</td><td colspan="2">Slave</td><td>0.5 $*t_{SSCK}$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SSCKR}$ </td><td>SCK rise time(2)</td><td colspan="2">Slave</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{SSCKF}$ </td><td>SCK fall time(2)</td><td colspan="2">Slave</td><td>-</td><td>-</td><td>-</td></tr><tr><td> $t_{SIS}$ </td><td>MOSI setup to SCK</td><td colspan="2">Slave</td><td> $t_{SSCK}/2 - 9$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SIH}$ </td><td>MOSI hold after SCK</td><td colspan="2">Slave</td><td> $t_{SSCK}/2 - 3$ </td><td>-</td><td>-</td></tr><tr><td rowspan="2"> $t_{SSS}$ </td><td rowspan="2"> $\overline{SS}$  setup to SCK</td><td rowspan="2">Slave</td><td>PRELOADEN=1</td><td>2 $*t_{CLK\_APB} + t_{SOS}$ </td><td>-</td><td>-</td></tr><tr><td>PRELOADEN=0</td><td> $t_{SOS}+7$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SSH}$ </td><td>SS hold after SCK</td><td colspan="2">Slave</td><td> $t_{SIH} - 4$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SOS}$ </td><td>MISO setup SCK</td><td colspan="2">Slave</td><td>-</td><td> $t_{SSCK}/2 - 18$ </td><td>-</td></tr><tr><td> $t_{SOH}$ </td><td>MISO hold after SCK</td><td colspan="2">Slave</td><td>-</td><td>18</td><td>-</td></tr><tr><td> $t_{SOSS}$ </td><td>MISO setup after  $\overline{SS}$  low</td><td colspan="2">Slave</td><td>-</td><td>18</td><td>-</td></tr><tr><td> $t_{SOSH}$ </td><td>MISO hold after  $\overline{SS}$  high</td><td colspan="2">Slave</td><td>-</td><td>10</td><td>-</td></tr></table>

Notes: 1. These values are based on simulation. These values are not covered by test limits in production.  
2. See “I/O Pin Characteristics” on page 867

## A.14.3 SERCOM in I<sup>2</sup>C Mode Timing

Table 35-51 describes the requirements for devices connected to the I<sup>2</sup>C Interface Bus. Timing symbols refer to Figure 35-16.

Figure 40-15. I<sup>2</sup>C Interface Bus Timing  
![](https://www.embedr.app/api/datasheets/ds_19293aa4fad2bd5f3642/asset?path=images%2Fpart_05_c74263b3b93dfc256b6ab0391cc3a2d6b09ea53821f2adf9c906d34aa14b90e0.jpg)

Table 40-48. I<sup>2</sup>C Interface Timing<sup>(1)</sup>

<table><tr><td>Symbol</td><td>Parameter</td><td colspan="2">Conditions</td><td>Min.</td><td>Typ.</td><td>Max.</td><td>Units</td></tr><tr><td rowspan="3"> $t_R$ </td><td rowspan="3">Rise time for both SDA and  $SCL^{(3)}$ </td><td>Standard / Fast mode</td><td> $C_b^{(2)} = 400pF$ </td><td>-</td><td>230</td><td>350</td><td rowspan="15">ns</td></tr><tr><td>Fast mode +</td><td> $C_b^{(2)} = 550pF$ </td><td>-</td><td>60</td><td>100</td></tr><tr><td>High speed mode</td><td> $C_b^{(2)} = 100pF$ </td><td>-</td><td>30</td><td>60</td></tr><tr><td rowspan="3"> $t_{OF}$ </td><td rowspan="3">Output fall time from  $V_{IHmin}$  to  $V_{ILmax}^{(3)}$ </td><td>Standard / Fast mode</td><td> $10pF < C_b^{(2)} < 400pF$ </td><td>-</td><td>25</td><td>50</td></tr><tr><td>Fast mode +</td><td> $10pF < C_b^{(2)} < 550pF$ </td><td>-</td><td>20</td><td>30</td></tr><tr><td>High speed mode</td><td> $10pF < C_b^{(2)} < 100pF$ </td><td>-</td><td>10</td><td>20</td></tr><tr><td> $t_{HD;STA}$ </td><td>Hold time (repeated) START condition</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td> $t_{LOW}-9$ </td><td>-</td><td>-</td></tr><tr><td> $t_{LOW}$ </td><td>Low period of SCL Clock</td><td></td><td> $f_{SCL} > 100kHz$ </td><td>113</td><td>-</td><td>-</td></tr><tr><td> $t_{BUF}$ </td><td>Bus free time between a STOP and a START condition</td><td></td><td> $f_{SCL} > 100kHz$ </td><td> $t_{LOW}$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SU;STA}$ </td><td>Setup time for a repeated START condition</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td> $t_{LOW}+7$ </td><td>-</td><td>-</td></tr><tr><td> $t_{HD;DAT}$ </td><td>Data hold time</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td>9</td><td>-</td><td>12</td></tr><tr><td> $t_{SU;DAT}$ </td><td>Data setup time</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td>104</td><td>-</td><td>-</td></tr><tr><td> $t_{SU;STO}$ </td><td>Setup time for STOP condition</td><td></td><td> $f_{SCL} > 100kHz, Master$ </td><td> $t_{LOW}+9$ </td><td>-</td><td>-</td></tr><tr><td> $t_{SU;DAT;Rx}$ </td><td>Data setup time (receive mode)</td><td></td><td> $f_{SCL} > 100kHz, Slave$ </td><td>51</td><td>-</td><td>56</td></tr><tr><td> $t_{HD;DAT;Tx}$ </td><td>Data hold time (send mode)</td><td></td><td> $f_{SCL} > 100kHz, Slave$ </td><td>71</td><td>90</td><td>138</td></tr></table>

Notes: 1. These values are based on simulation. These values are not covered by test limits in production.  
2. Cb = Capacitive load on each bus line. Otherwise noted, value of ${ \mathsf { C } } _ { \mathsf { b } }$ set to 20pF.  
3. These values are based on characterization. These values are not covered by test limits in production.

Description....1
Features....2
1. Configuration Summary....3
2. Ordering Information....5
2.1 SAM D11C – 14-pin SOIC....5
2.2 SAM D11D – 20-pin SOIC....5
2.3 SAM D11D – 20-ball WLCSP....5
2.4 SAM D11D – 24-pin QFN....6
2.5 Device Identification....6
3. Block Diagram....7
4. Pinout....8
4.1 SAM D11C 14-pin SOIC....8
4.2 SAM D11D 20-pin SOIC....8
4.3 SAM D11D 20-ball WLCSP....9
4.4 SAM D11D 24-pin QFN....10
5. Signal Descriptions List....11
6. I/O Multiplexing and Considerations....13
6.1 Multiplexed Signals....13
6.2 Other Functions....16
7. Power Supply and Start-Up Considerations....17
7.1 Power Domain Overview....17
7.2 Power Supply Considerations....17
7.3 Power-Up....18
7.4 Power-On Reset and Brown-Out Detector....19
8. Product Mapping....20
9. Memories....21
9.1 Embedded Memories....21
9.2 Physical Memory Map....21
9.3 NVM Calibration and Auxiliary Space....21
9.4 NVM User Row Mapping....23
9.5 NVM Software Calibration Row Mapping....24
9.6 Serial Number....24
10. Processor And Architecture....25
10.1 Cortex M0+ Processor....25
10.2 Nested Vector Interrupt Controller....26
10.3 High-Speed Bus System....27
10.4 AHB-APB Bridge....30
10.5 PAC – Peripheral Access Controller....30
10.6 Register Description....31

11. Peripherals Configuration Summary 37
12. DSU – Device Service Unit 39
12.1 Overview 39
12.2 Features 39
12.3 Block Diagram 39
12.4 Signal Description 40
12.5 Product Dependencies 40
12.6 Debug Operation 41
12.7 Chip-Erase 42
12.8 Programming 43
12.9 Intellectual Property Protection 43
12.10 Device Identification 44
12.11 Functional Description 45
12.12 Register Summary 50
12.13 Register Description 53
13. Clock System 80
13.1 Clock Distribution 80
13.2 Synchronous and Asynchronous Clocks 81
13.3 Register Synchronization 81
13.4 Enabling a Peripheral 85
13.5 On-demand, Clock Requests 86
13.6 Power Consumption vs Speed 86
13.7 Clocks after Reset 86
14. GCLK – Generic Clock Controller 88
14.1 Overview 88
14.2 Features 88
14.3 Block Diagram 88
14.4 Signal Description 89
14.5 Product Dependencies 89
14.6 Functional Description 90
14.7 Register Summary 95
14.8 Register Description 96
15. PM – Power Manager 110
15.1 Overview 110
15.2 Features 110
15.3 Block Diagram 111
15.4 Signal Description 111
15.5 Product Dependencies 111
15.6 Functional Description 113
15.7 Register Summary 121
15.8 Register Description 122
16. SYSCTRL – System Controller 143
16.1 Overview 143
16.2 Features 143
16.3 Block Diagram 145
16.4 Signal Description 147
16.5 Product Dependencies 147

16.6 Functional Description 148  
16.7 Register Summary 163  
16.8 Register Description 165  

17. WDT – Watchdog Timer 208  
17.1 Overview 208  
17.2 Features 208  
17.3 Block Diagram 208  
17.4 Signal Description 209  
17.5 Product Dependencies 209  
17.6 Functional Description 210  
17.7 Register Summary 215  
17.8 Register Description 216  

18. RTC – Real-Time Counter 227  
18.1 Overview 227  
18.2 Features 227  
18.3 Block Diagram 227  
18.4 Signal Description 228  
18.5 Product Dependencies 228  
18.6 Functional Description 230  
18.7 Register Summary 235  
18.8 Register Description 238  

19. DMAC – Direct Memory Access Controller 271  
19.1 Overview 271  
19.2 Features 271  
19.3 Block Diagram 272  
19.4 Signal Description 272  
19.5 Product Dependencies 272  
19.6 Functional Description 273  
19.7 Register Summary 292  
19.8 Register Description 295  

20. EIC – External Interrupt Controller 336  
20.1 Overview 336  
20.2 Features 336  
20.3 Block Diagram 336  
20.4 Signal Description 337  
20.5 Product Dependencies 337  
20.6 Functional Description 338  
20.7 Register Summary 342  
20.8 Register Description 343  

21. NVMCTRL – Non-Volatile Memory Controller 355  
21.1 Overview 355  
21.2 Features 355  
21.3 Block Diagram 355  
21.4 Signal Description 355  
21.5 Product Dependencies 356  
21.6 Functional Description 356  
21.7 Register Summary 362

21.8 Register Description 363
22. PORT 378
22.1 Overview 378
22.2 Features 378
22.3 Block Diagram 379
22.4 Signal Description 379
22.5 Product Dependencies 379
22.6 Functional Description 381
22.7 Register Summary 386
22.8 Register Description 388
23. EVSYS – Event System 405
23.1 Overview 405
23.2 Features 405
23.3 Block Diagram 406
23.4 Signal Description 406
23.5 Product Dependencies 406
23.6 Functional Description 407
23.7 Register Summary 412
23.8 Register Description 413
24. SERCOM – Serial Communication Interface 430
24.1 Overview 430
24.2 Features 430
24.3 Block Diagram 430
24.4 Signal Description 430
24.5 Product Dependencies 431
24.6 Functional Description 432
25. SERCOM USART – SERCOM Universal Synchronous and Asynchronous and Transmitter 438
25.1 Overview 438
25.2 Features 438
25.3 Block Diagram 439
25.4 Signal Description 439
25.5 Product Dependencies 439
25.6 Functional Description 441
25.7 Register Summary 452
25.8 Register Description 454
26. SERCOM SPI – SERCOM Serial Peripheral Interface 476
26.1 Overview 476
26.2 Features 476
26.3 Block Diagram 476
26.4 Signal Description 476
26.5 Product Dependencies 477
26.6 Functional Description 478
26.7 Register Summary 487
26.8 Register Description 489

27. SERCOM I2C – SERCOM Inter-Integrated Circuit 509
27.1 Overview 509
27.2 Features 509
27.3 Block Diagram 509
27.4 Signal Description 510
27.5 Product Dependencies 510
27.6 Functional Description 511
27.7 Register Summary 529
27.8 Register Description 534

28. TC – Timer/Counter 573
28.1 Overview 573
28.2 Features 573
28.3 Block Diagram 574
28.4 Signal Description 575
28.5 Product Dependencies 575
28.6 Functional Description 576
28.7 Register Summary 587
28.8 Register Description 590

29. TCC – Timer/Counter for Control Applications 614
29.1 Overview 614
29.2 Features 614
29.3 Block Diagram 615
29.4 Signal Description 615
29.5 Product Dependencies 616
29.6 Functional Description 617
29.7 Register Summary 647
29.8 Register Description 650

30. USB – Universal Serial Bus 714
30.1 Overview 714
30.2 Features 714
30.3 USB Block Diagram 715
30.4 Signal Description 715
30.5 Product Dependencies 715
30.6 Functional Description 718
30.7 Register Summary 727
30.8 Register Description 731

31. ADC – Analog-to-Digital Converter 768
31.1 Overview 768
31.2 Features 768
31.3 Block Diagram 769
31.4 Signal Description 769
31.5 Product Dependencies 770
31.6 Functional Description 771
31.7 Register Summary 781
31.8 Register Description 783

32. AC – Analog Comparators 807
32.1 Overview 807

32.2 Features 807
32.3 Block Diagram 808
32.4 Signal Description 808
32.5 Product Dependencies 808
32.6 Functional Description 810
32.7 Additional Features 816
32.8 Register Summary 819
32.9 Register Description 820

33. DAC – Digital-to-Analog Converter 836
33.1 Overview 836
33.2 Features 836
33.3 Block Diagram 836
33.4 Signal Description 836
33.5 Product Dependencies 837
33.6 Functional Description 838
33.7 Register Summary 842
33.8 Register Description 843

34. PTC - Peripheral Touch Controller 853
34.1 Overview 853
34.2 Features 853
34.3 Block Diagram 854
34.4 Signal Description 855
34.5 Product Dependencies 855
34.6 Functional Description 857

35. Electrical Characteristics 858
35.1 Disclaimer 858
35.2 Absolute Maximum Ratings 858
35.3 General Operating Ratings 858
35.4 Supply Characteristics 859
35.5 Maximum Clock Frequencies 859
35.6 Power Consumption 861
35.7 Peripheral Power Consumption 864
35.8 I/O Pin Characteristics 867
35.9 Injection Current 870
35.10 Analog Characteristics 872
35.11 NVM Characteristics 884
35.12 Oscillators Characteristics 886
35.13 PTC Typical Characteristics 892
35.14 USB Characteristics 896
35.15 Timing Characteristics 897

36. Packaging Information 901
36.1 Thermal Considerations 901
36.2 Package Drawings 902
36.3 Soldering Profile 906

37. Schematic Checklist 907
37.1 Introduction 907
37.2 Power Supply 907

37.3 External Analog Reference Connections 908
37.4 External Reset Circuit 910
37.5 Unused or Unconnected Pins 910
37.6 Clocks and Crystal Oscillators 910
37.7 Programming and Debug Ports 913
37.8 USB Interface 917

38. Errata 920
38.1 Revision A. 920
38.2 Revision B. 920

39. About This Document 926
39.1 Conventions 926
39.2 Acronyms and Abbreviations 927

40. Datasheet Revision History 930
40.1 Rev. H - 08/2016 930
40.2 Rev. G - 05/2016 931
40.3 Rev. F - 04/2016 932
40.4 Rev. E - 03/2016 932
40.5 Rev. D - 02/2016 932
40.6 Rev. C - 01/2016 933
40.7 Rev. B - 07/2015 933
40.8 Rev. A - 01/2015 934

Appendix A. Electrical Characteristics at 105°C. 935
A.1 Disclaimer 935
A.2 Absolute Maximum Ratings 935
A.3 General Operating Ratings 935
A.4 Supply Characteristics 936
A.5 Maximum Clock Frequencies 936
A.6 Power Consumption 937
A.7 I/O Pin Characteristics 941
A.8 Injection Current 944
A.9 Analog Characteristics 945
A.10 NVM Characteristics 956
A.11 Oscillators Characteristics 957
A.12 PTC Typical Characteristics 963
A.13 USB Characteristics 966
A.14 Timing Characteristics 968

Table of Contents . 972

# Atmel Enabling Unlimited Possibilities

© 2016 Atmel Corporation. / Rev.: Atmel-42363H-SAM-D11-Datasheet\_09/2016.