Adafruit Trinket M0

The Adafruit Trinket M0 is a tiny ARM development board based on the Atmel ATSAMD21E18 family of SoC.

Interfaces

Interface Hardware Supported TinyGo Support
GPIO YES YES
UART YES YES
SPI YES YES
I2C YES YES
ADC YES YES
PWM YES YES
USBDevice YES YES

Pins

Pin Hardware pin Alternative names PWM
D0 PA08 A2, SDA_PIN, I2S_SD_PIN TCC0 (channel 0), TCC1 (channel 2)
D1 PA02 A0
D2 PA09 A1, SPI0_SDI_PIN, SCL_PIN TCC0 (channel 1), TCC1 (channel 3)
D3 PA07 A3, UART_RX_PIN, SPI0_SCK_PIN TCC1 (channel 1)
D4 PA06 A4, UART_TX_PIN, SPI0_SDO_PIN TCC1 (channel 0)
D13 PA10 LED, I2S_SCK_PIN TCC1 (channel 0), TCC0 (channel 2)
USBCDC_DM_PIN PA24 TCC1 (channel 2)
USBCDC_DP_PIN PA25 TCC1 (channel 3)

Machine Package Docs

Documentation for the machine package for the Adafruit Trinket M0

Flashing

UF2

The Trinket M0 comes with the UF2 bootloader already installed.

CLI Flashing

  • Plug your Trinket M0 into your computer’s USB port.

  • Flash your TinyGo program to the board using this command:

    tinygo flash -target=trinket-m0 [PATH TO YOUR PROGRAM]
    
  • The Trinket M0 board should restart and then begin running your program.

Troubleshooting

If you have troubles getting your Trinket M0 board to receive code, try this:

  • Press the “RESET” button on the board two times to get the Trinket M0 board ready to receive code.

  • The Trinket M0 board will appear to your computer like a USB drive.

  • Now try running the tinygo flash command as above:

    tinygo flash -target=Trinket-m0 [PATH TO YOUR PROGRAM]
    

Once you have updated your Trinket M0 board the first time, after that you should be able to flash it entirely from the command line.

Notes

You can use the USB port to the Trinket M0 as a serial port. UART0 refers to this connection.

The DotStar LED on the Trinket M0 can be accessed using the APA102 driver via a software SPI on the PA01 and PA00 pins