32-bit ARM-Based
Microcontrollers
SAM D21E / SAM D21G / SAM D21J
Introduction
The SAM D21 is a series of low-power microcontrollers using the 32-bit ARM Cortex -M0+ processor,
and ranging from 32- to 64-pins with up to 256KB Flash and 32KB of SRAM. The SAM D21 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, Event System for inter-peripheral signaling, and support for capacitive
touch button, slider and wheel user interfaces.
®
®
Features
•
Processor
– ARM Cortex-M0+ CPU running at up to 48MHz
• Single-cycle hardware multiplier
• Micro Trace Buffer (MTB)
Memories
– 32/64/128/256KB in-system self-programmable Flash
– 4/8/16/32KB SRAM Memory
System
– Power-on reset (POR) and brown-out detection (BOD)
– Internal and external clock options with 48MHz Digital Frequency Locked Loop (DFLL48M)
and 48MHz to 96MHz Fractional Digital Phase Locked Loop (FDPLL96M)
– External Interrupt Controller (EIC)
– 16 external interrupts
– One non-maskable interrupt
– Two-pin Serial Wire Debug (SWD) programming, test and debugging interface
Low Power
– Idle and standby sleep modes
– SleepWalking peripherals
Peripherals
– 12-channel Direct Memory Access Controller (DMAC)
– 12-channel Event System
– Up to five 16-bit Timer/Counters (TC), configurable as either:
• One 16-bit TC with two compare/capture channels
• One 8-bit TC with two compare/capture channels
• One 32-bit TC with two compare/capture channels, by using two TCs
– Three 24-bit Timer/Counters for Control (TCC), with extended functions:
•
•
•
•
©
2017 Microchip Technology Inc.
Datasheet Complete
40001882A-page 1
32-bit ARM-Based Microcontrollers
Up to four compare channels with optional complementary output
Generation of synchronized pulse width modulation (PWM) pattern across port pins
Deterministic fault protection, fast decay and configurable dead-time between
complementary output
• Dithering that increase resolution with up to 5 bit and reduce quantization error
32-bit Real Time Counter (RTC) with clock/calendar function
Watchdog Timer (WDT)
CRC-32 generator
One full-speed (12Mbps) Universal Serial Bus (USB) 2.0 interface
• Embedded host and device function
• Eight endpoints
Up to six Serial Communication Interfaces (SERCOM), each configurable to operate as either:
•
•
•
•
–
–
USART with full-duplex and single-wire half-duplex configuration
I2C up to 3.4MHz
SPI
LIN slave
•
•
•
–
–
–
–
–
One two-channel Inter-IC Sound (I
2
S) interface
One 12-bit, 350ksps Analog-to-Digital Converter (ADC) with up to 20 channels
• Differential and single-ended input
• 1/2x to 16x programmable gain stage
• Automatic offset and gain error compensation
• Oversampling and decimation in hardware to support 13-, 14-, 15- or 16-bit resolution
10-bit, 350ksps Digital-to-Analog Converter (DAC)
Two Analog Comparators (AC) with window compare function
Peripheral Touch Controller (PTC)
• 256-Channel capacitive touch and proximity sensing
–
–
–
•
•
•
•
I/O
– Up to 52 programmable I/O pins
Drop in compatible with SAM D20
Packages
– 64-pin TQFP, QFN, UFBGA
– 48-pin TQFP, QFN, WLCSP
– 32-pin TQFP, QFN, WLCSP
Operating Voltage
– 1.62V – 3.63V
©
2017 Microchip Technology Inc.
Datasheet Complete
40001882A-page 2
Table of Contents
Introduction......................................................................................................................1
Features.......................................................................................................................... 1
1. Description...............................................................................................................12
2. Configuration Summary...........................................................................................13
3. Ordering Information................................................................................................15
3.1.
3.2.
3.3.
3.4.
SAM D21E..................................................................................................................................15
SAM D21G................................................................................................................................. 18
SAM D21J.................................................................................................................................. 20
Device Identification................................................................................................................... 22
4. Block Diagram......................................................................................................... 24
5. Pinout...................................................................................................................... 25
5.1.
5.2.
5.3.
SAM D21J.................................................................................................................................. 25
SAM D21G................................................................................................................................. 27
SAM D21E..................................................................................................................................29
6. Signal Descriptions List........................................................................................... 31
7. I/O Multiplexing and Considerations........................................................................33
7.1.
7.2.
Multiplexed Signals.................................................................................................................... 33
Other Functions..........................................................................................................................35
8. Power Supply and Start-Up Considerations............................................................ 38
8.1.
8.2.
8.3.
8.4.
Power Domain Overview............................................................................................................38
Power Supply Considerations.................................................................................................... 38
Power-Up................................................................................................................................... 40
Power-On Reset and Brown-Out Detector................................................................................. 40
9. Product Mapping..................................................................................................... 42
10. Memories.................................................................................................................43
10.1. Embedded Memories................................................................................................................. 43
10.2. Physical Memory Map................................................................................................................ 43
10.3. NVM Calibration and Auxiliary Space........................................................................................ 44
11. Processor And Architecture.....................................................................................48
11.1.
11.2.
11.3.
11.4.
11.5.
Cortex M0+ Processor............................................................................................................... 48
Nested Vector Interrupt Controller..............................................................................................49
Micro Trace Buffer...................................................................................................................... 51
High-Speed Bus System............................................................................................................ 52
AHB-APB Bridge........................................................................................................................ 54
©
2017 Microchip Technology Inc.
Datasheet Complete
40001882A-page 3
32-bit ARM-Based Microcontrollers
11.6. PAC - Peripheral Access Controller........................................................................................... 55
12. Peripherals Configuration Summary........................................................................67
13. DSU - Device Service Unit...................................................................................... 69
13.1. Overview.................................................................................................................................... 69
13.2. Features..................................................................................................................................... 69
13.3. Block Diagram............................................................................................................................ 70
13.4. Signal Description...................................................................................................................... 70
13.5. Product Dependencies............................................................................................................... 70
13.6. Debug Operation........................................................................................................................ 71
13.7. Chip Erase..................................................................................................................................73
13.8. Programming..............................................................................................................................73
13.9. Intellectual Property Protection.................................................................................................. 74
13.10. Device Identification................................................................................................................... 75
13.11. Functional Description................................................................................................................76
13.12. Register Summary..................................................................................................................... 82
13.13. Register Description...................................................................................................................84
14. Clock System.........................................................................................................100
14.1. Clock Distribution..................................................................................................................... 100
14.2. Synchronous and Asynchronous Clocks..................................................................................101
14.3. Register Synchronization......................................................................................................... 101
14.4.
14.5.
14.6.
14.7.
14.8.
Enabling a Peripheral............................................................................................................... 106
Disabling a Peripheral.............................................................................................................. 106
On-demand, Clock Requests................................................................................................... 106
Power Consumption vs. Speed................................................................................................ 107
Clocks after Reset.................................................................................................................... 107
15. GCLK - Generic Clock Controller.......................................................................... 108
15.1.
15.2.
15.3.
15.4.
15.5.
15.6.
15.7.
15.8.
Overview.................................................................................................................................. 108
Features................................................................................................................................... 108
Block Diagram.......................................................................................................................... 108
Signal Description.................................................................................................................... 109
Product Dependencies............................................................................................................. 109
Functional Description.............................................................................................................. 110
Register Summary....................................................................................................................115
Register Description................................................................................................................. 116
16. PM – Power Manager............................................................................................127
16.1.
16.2.
16.3.
16.4.
16.5.
16.6.
16.7.
16.8.
Overview.................................................................................................................................. 127
Features................................................................................................................................... 127
Block Diagram.......................................................................................................................... 128
Signal Description.................................................................................................................... 128
Product Dependencies............................................................................................................. 128
Functional Description..............................................................................................................130
Register Summary....................................................................................................................137
Register Description................................................................................................................. 137
©
2017 Microchip Technology Inc.
Datasheet Complete
40001882A-page 4
32-bit ARM-Based Microcontrollers
17. SYSCTRL – System Controller............................................................................. 150
17.1.
17.2.
17.3.
17.4.
17.5.
17.6.
17.7.
17.8.
Overview.................................................................................................................................. 150
Features................................................................................................................................... 150
Block Diagram.......................................................................................................................... 152
Signal Description.................................................................................................................... 152
Product Dependencies............................................................................................................. 152
Functional Description..............................................................................................................154
Register Summary....................................................................................................................170
Register Description................................................................................................................. 172
18. WDT – Watchdog Timer........................................................................................ 205
18.1.
18.2.
18.3.
18.4.
18.5.
18.6.
18.7.
18.8.
Overview.................................................................................................................................. 205
Features................................................................................................................................... 205
Block Diagram.......................................................................................................................... 206
Signal Description.................................................................................................................... 206
Product Dependencies............................................................................................................. 206
Functional Description..............................................................................................................207
Register Summary....................................................................................................................212
Register Description................................................................................................................. 212
19. RTC – Real-Time Counter..................................................................................... 218
19.1.
19.2.
19.3.
19.4.
19.5.
19.6.
19.7.
19.8.
Overview.................................................................................................................................. 218
Features................................................................................................................................... 218
Block Diagram.......................................................................................................................... 219
Signal Description.................................................................................................................... 219
Product Dependencies............................................................................................................. 219
Functional Description..............................................................................................................221
Register Summary....................................................................................................................226
Register Description................................................................................................................. 229
20. DMAC – Direct Memory Access Controller........................................................... 252
20.1. Overview.................................................................................................................................. 252
20.2. Features................................................................................................................................... 252
20.3. Block Diagram.......................................................................................................................... 254
20.4. Signal Description.................................................................................................................... 254
20.5. Product Dependencies............................................................................................................. 254
20.6. Functional Description..............................................................................................................255
20.7. Register Summary....................................................................................................................275
20.8. Register Description................................................................................................................. 276
20.9. Register Summary - SRAM...................................................................................................... 299
20.10. Register Description - SRAM................................................................................................... 299
21. EIC – External Interrupt Controller........................................................................ 305
21.1.
21.2.
21.3.
21.4.
21.5.
Overview.................................................................................................................................. 305
Features................................................................................................................................... 305
Block Diagram.......................................................................................................................... 305
Signal Description.................................................................................................................... 306
Product Dependencies............................................................................................................. 306
©
2017 Microchip Technology Inc.
Datasheet Complete
40001882A-page 5