ATSAMD21G18A

✓ In Stock

Ultra-low power 32-bit ARM Cortex-M0+ MCU with 256KB Flash, USB, and rich peripheral set for IoT applications.

Product Overview

Description

The ATSAMD21G18A is a high-performance 32-bit microcontroller based on the ARM Cortex-M0+ processor running at up to 48MHz. It features 256KB of Flash memory and 32KB of SRAM, providing ample resources for complex IoT and embedded applications.

This device integrates a full-speed USB 2.0 device and embedded host controller, making it ideal for USB-connected applications. The rich peripheral set includes six flexible serial communication modules (SERCOM) configurable as UART, SPI, or I2C, 12-channel DMA, and a 12-bit ADC with up to 20 channels.

With ultra-low power consumption down to 70μA/MHz in active mode and sub-2μA in standby with RTC, the SAM D21 is optimized for battery-powered IoT devices. The device is supported by the comprehensive Atmel START and MPLAB Harmony development frameworks.

Product Series

ATSAMD

Primary Application

USB devices and accessories

Key Features

  • ARM Cortex-M0+ processor up to 48MHz
  • Full-speed USB 2.0 device and host
  • Six configurable SERCOM modules
  • 12-channel Direct Memory Access (DMA)
  • 12-bit ADC with up to 20 channels
  • 10-bit DAC for analog output
  • Touch sensing capability (PTC)
  • Ultra-low power consumption

Specifications

Architecture ARM Cortex-M0+
Flash Memory 256KB
SRAM 32KB
Max Frequency 48MHz
GPIO 38 pins
ADC 12-bit, 20 channels
USB Full-speed Device + Host
Operating Voltage 1.62V - 3.63V
Package TQFP-48, QFN-48
Temperature Range -40°C to +85°C (Industrial)

Applications

USB devices and accessories

Electronic system design

IoT sensor nodes and gateways

Sensor signal conditioning

Smart home and building automation

Industrial automation and control

Wearable devices

Electronic system design

Industrial control systems

Industrial automation and control

Documents & Resources

FAE Expert Insights

S

"The SAM D21 is my top recommendation for IoT gateway and USB device applications. The six SERCOM modules are incredibly flexible - you can configure them as UART, SPI, or I2C on the fly, which is a lifesaver when board layouts need last-minute changes. The USB peripheral is rock-solid and supports both device and host modes, perfect for USB-to-serial bridges or USB-powered sensor hubs. I've measured active current at 75μA/MHz typical, which is excellent for a 32-bit MCU. The touch controller (PTC) works well for capacitive buttons without external components. One limitation is the 48MHz max clock - for DSP-heavy applications, consider the SAM D51 series instead. The extensive HAL support in both Atmel START and Arduino makes development very fast."

Flexible SERCOM modules enable last-minute interface changes; excellent USB peripheral for device/host applications

— Sarah Johnson, BeiLuo

Frequently Asked Questions

What is the difference between SAM D21 and SAM D51?

The SAM D21 and SAM D51 are both ARM-based microcontrollers but target different performance levels. The SAM D21 uses a Cortex-M0+ core running at 48MHz, ideal for low-power IoT applications with basic processing needs. It offers excellent power efficiency at 70μA/MHz but lacks DSP capabilities. The SAM D51 uses a Cortex-M4F core running at 120MHz with hardware floating-point unit (FPU) and DSP instructions, delivering significantly higher compute performance for complex algorithms, motor control, and graphics. The D51 also provides more memory (up to 1MB Flash vs 256KB) and advanced security features. Choose D21 for cost-sensitive, low-power IoT; choose D51 for performance-intensive applications requiring DSP or floating-point math.

Select SAM D21 for basic IoT and USB applications under $3; choose SAM D51 for DSP, motor control, or graphics requiring >48MHz performance.

SAM D21 vs D51 Cortex-M0+ vs M4F microcontroller comparison
How do I configure SERCOM modules for different interfaces?

The SAM D21 features six SERCOM (Serial Communication) modules that can be individually configured as UART, SPI, or I2C through the PORT and SERCOM registers. Configuration is done via the Atmel START code configurator or by directly writing registers. Each SERCOM uses specific pin mappings defined in the datasheet - for example, SERCOM0 can use PA08/PA09 for I2C or PA04-PA07 for SPI. The flexibility allows you to assign interfaces based on PCB layout constraints rather than fixed pinouts. To configure: 1) Enable SERCOM clock in GCLK and PM; 2) Configure PORT pins for the desired function; 3) Write SERCOM CTRLA register to select mode (USART, SPI, or I2C); 4) Set baud rate and frame format in CTRLB and BAUD registers; 5) Enable the peripheral. The MPLAB Harmony and Arduino cores abstract this configuration for rapid development.

Use Atmel START for graphical pin configuration; assign SERCOMs based on PCB routing constraints for optimal layout.

SAM D21 SERCOM configuration UART SPI I2C setup pin multiplexing
What development boards are available for SAM D21?

Microchip offers several development boards for SAM D21 evaluation: 1) SAM D21 Xplained Pro (ATSAMD21-XPRO) - professional evaluation board with embedded debugger, Arduino-compatible headers, and multiple sensors; 2) Curiosity Nano Evaluation Kit (DM320119) - low-cost board with integrated debugger in a compact form factor; 3) Arduino Zero - Arduino-compatible board using SAM D21, ideal for makers and rapid prototyping; 4) Adafruit Feather M0 - popular third-party board with LiPo battery charging and Feather ecosystem compatibility. All boards include USB debugging and programming capability. The Xplained Pro is recommended for comprehensive evaluation with its rich peripheral expansion options, while the Curiosity Nano offers the best value for basic development.

Choose SAM D21 Xplained Pro for comprehensive evaluation; Curiosity Nano for cost-sensitive projects; Arduino Zero for maker community compatibility.

SAM D21 development board Xplained Pro Curiosity Nano
Can SAM D21 run Arduino sketches?

Yes, the SAM D21 is fully supported by the Arduino ecosystem. The Arduino Zero board uses the ATSAMD21G18A microcontroller, and Microchip provides official Arduino core support for the SAM D21 family. This means you can use the familiar Arduino IDE and libraries for rapid prototyping. The Arduino core abstracts the low-level register configuration, providing easy-to-use functions for GPIO, ADC, PWM, I2C, SPI, and USB. Advanced features like DMA and the event system are also accessible through Arduino libraries. For production development, you can migrate from Arduino to bare-metal programming or use MPLAB X with Harmony framework while retaining the same hardware. The extensive Arduino library ecosystem significantly accelerates development for common IoT sensors and wireless modules.

Use Arduino for rapid prototyping and proof-of-concept; migrate to MPLAB X for production firmware requiring optimization.

SAM D21 Arduino Arduino Zero Arduino IDE support
What is the power consumption of SAM D21 in different modes?

The SAM D21 offers excellent power efficiency across multiple operating modes: Active mode consumes approximately 70μA/MHz at 3.3V when executing from Flash - so at 48MHz, expect around 3.4mA. Idle mode (CPU stopped, peripherals running) reduces consumption to about 1.2mA. Standby mode with RTC and SRAM retention consumes only 2.5μA typical, making it ideal for battery-powered sensor nodes that wake periodically. Deep sleep mode without RTC drops to 0.5μA but requires external reset to wake. The device supports multiple clock domains allowing selective peripheral gating - for example, you can run the ADC from a 32kHz clock while the CPU sleeps. The event system enables peripheral-to-peripheral communication without CPU wakeups, further reducing average power consumption in event-driven applications.

Use standby with RTC for periodic sensor sampling achieving 2.5μA average; use event system to minimize CPU wakeups.

SAM D21 power consumption low power modes battery optimization