Electronics

SAMD21 M0-Mini (Soldered) RobotDYN

Out Of Stock

1

Description

The RobotDyn SAMD21 M0-Mini is a strong 32-bit expansion of the Arduino UNO platform but in a smaller size, similar to a Micro or Nano. SAMD21 MCU with a 32-bit ARM Cortex M0 processor powers the board. The SAMD21 M0-Mini board has increased performance, giving a range of project options for devices, and serving as an excellent instructional tool for learning about 32-bit application development. M0 applications range from smart IoT gadgets to wearable technologies to high-tech automation and wacky robots. The board is powered by the SAMD21 MCU from Atmel, which has a 32-bit ARM Cortex M0+ core.

Specifications:

  • MCU – Microchip ATSAMD21G18 Arm Cortex-M0+ microcontroller @ 48 MHz with 32KB data RAM, 256KB flash
  • USB – 1x micro USB port for power and programming
  • Expansion
    • 2x 14-pin headers with 19x digital I/O (including 12x PWM), 6x Analog I/O
    • 3.3V logic level
  • Programming – 6-pin ISCP connector
  • Misc – Power, Tx and Rx LED’s, button
  • Power Supply
    • Input – 5V via micro USB port or VIN
    • Output – 3.3V-800mA (However, it reads 3.3V/180mA on the silkscreen)
    • Consumption – 3.3V @ 220mA
  • Dimensions – 56.5 x 18 mm
  • Temperature Range – -40°С – +85°С


How to add the SAMD21 to the Arduino Boards Manager

The SAMD21 M0 Mini can be viewed as an Arduino Zero board with a SAMD21 core at its heart. As a result, the required board reference may be accessed in the Arduino IDE's board manager without the requirement for a separate board management URL download:

1. Go to Tools -> Board -> Boards Manager

2. Type “SAMD” into the Boards Manager input and install the latest board package entitled: “Arduino SAMD Boards (32-bits ARM Cortex-Mo+) by Arduino”

3. Go to Tools-> Board -> Arduino/Genuino Zero (Native USB Port)

4. Ensure that the correct Port is selected, in this case: “Arduino/Genuino Zero (Native USB Port)”

As a verification, upload a sample Blink sketch with an external LED.

 
Sample code with the DAC and the ADC of the SAMD21:

The SAMD21, like the Arduino Due, features a 10-bit DAC and can output 10-bits of analog data through its A0 port. This is accomplished by setting the analogWriteResolution() function to 10-bits and then writing to the A0 pin. The A0 pin is the only one that can be written analogically; however, if additional pins are written using the analogWrite() method, they will either register HIGH/LOW or utilize PWM signals depending on their capabilities.

The code below is an implementation of the DAC and subsequent reading on the ADC. The code does the following:

  • Outputs a sine wave to the 10-bit DAC

  • Reads from the 12-bit ADC

  • Prints the DAC output and the values read from the ADC

    Note: pin A0 must be wired directly to pin A2.

// reading 10-bit DAC data on the SAMD21's 12-bit ADC

int analog_out = A0;
int analog_in = A2;

float dac_iter = 0.0;

void setup() {
  SerialUSB.begin(115200); // initialize USB serial port
  analogWriteResolution(10); // set DAC to 10-bit
  analogReadResolution(12); // set ADC to 12-bit
}

void loop() {
  dac_iter+=0.01; // step through for sine wave
  analogWrite(analog_out,int((511.5*sin(2*PI*dac_iter))+511.5)); //DAC sine
  // DAC sine wave for plotting comparison
  float a_out = (((511.5*sin(2*PI*dac_iter))+511.5)/1023.0)*3.3;
  
  float a_read = (analogRead(analog_in)/4095.0)*3.3; // ADC 12-bit reading
  // plot for serial plotter or just viewing in serial monitor
  SerialUSB.print("DAC: ");
  SerialUSB.print(a_out);
  SerialUSB.print(", ADC: ");
  SerialUSB.println(a_read);
  delay(10); // as needed
}

For (Instruction manuals, schematics, etc): Click Here