SAMD21 32-bit Arm Cortex-M0+ Microcontroller
The SAMD21 or more precisely the ATSAMD21G18 is a microcontroller manufactured by Atmel. Unlike the popular ATMega series, this microcontroller features an ARM Cortex M0+ core.
SAMD21 MCU Pinout Configuration
Pin Number |
Pin Name |
Pin Description |
44 |
VDDIN |
Main power supply pin, typically 3.3V |
17, 36 |
VDDIO |
Power supply pins for the GPIO pins, typically 3.3V |
43 |
VDDCORE |
Regulated 1.2V output |
6 |
VDDA |
Analog supply voltage to power the internal ADC and reference, typically 3.3V |
18, 35, 42 |
GND |
Ground reference for internal core and GPIO pins |
5 |
GNDA |
Ground reference for analog section and ADC |
40 |
RESET |
Resets the microcontroller when pulled to ground |
1, 2 |
XTAL |
External crystal oscillator pins |
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 47, 48 |
Analog Pins |
Analog input pins, can also be used as GPIO, pins PA02 – PA07, PB02 – PB02, PB08 – PB09 |
13, 14, 15, 16, 19, 20, 21, 22, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 41, 45, 46 |
Digital Pins |
Digital GPIO pins, PA08 – PA25, PA30 – PA31, PB10 – PB11, PB22 – PB23, pins 33 and 34 native USB |
Features and Specifications
- 256KB flash memory
- 32KB SRAM
- 32KB EEPROM (simulated in flash)
- 22 GPIO pins
- 14-channel 12-bit ADC
- 10-bit DAC
Note: Complete technical details can be found in the SAMD21 datasheet found at the end of this page.
SAMD21 Equivalent Microcontroller
STM32F0 series
Other microcontrollers: ATMega328P, STM32F103C8
Brief Introduction to SAMD21 Microcontroller
The SAMD32 is a 32-bit microcontroller from Atmel that contains an ARM Cortex M0+ core. The variety of onboard peripherals it has makes it easy to interface with a variety of external sensors and devices. It has built-in USB 2.1 support, which makes programming directly from USB possible and can also act as a USB drive or input device or a USB host. It also has one USART, I2C and SPI channel.
It has an internal 12-bit 350ksps ADC and a 10-bit 350ksps DAC. The ADC has a configurable gain of 0.5x to 16x and has automatic gain error and offset compensation. The analog peripherals also consist of four analog comparators with window compare function. An internal 32-bit clock/calendar is also provided. A clock crystal can be attached to pins 23 and 24. The SAMD21 is available as a breakout board from various companies such as Sparkfun.
SAMD21 Microcontroller Programming
Since the SAMD21 has native USB support, it can be programmed directly through the USB port by installing the right bootloader.
Programming can also be done using the ICSP/SWD pin headers that are usually broken out on development boards. Programming through these pins requires a dedicated programmed such as the Atmel ICE.
2D Model and Dimensions
If you are designing a PCB or Perf board with this component then the following picture from the SAMD21 datasheet will be useful to know its package type and dimensions.