Adafruit Trinket M0

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

Interfaces

InterfaceHardware SupportedTinyGo Support
GPIOYESYES
UARTYESYES
SPIYESYES
I2CYESYES
ADCYESYES
PWMYESYES
USBDeviceYESYES

Pins

PinHardware pinAlternative namesPWM
D0PA08A2, SDA_PIN, I2S_SDO_PINTCC0 (channel 0), TCC1 (channel 2)
D1PA02A0
D2PA09A1, SPI0_SDI_PIN, SCL_PINTCC0 (channel 1), TCC1 (channel 3)
D3PA07A3, UART_RX_PIN, SPI0_SCK_PINTCC1 (channel 1)
D4PA06A4, UART_TX_PIN, SPI0_SDO_PINTCC1 (channel 0)
D13PA10LED, I2S_SCK_PINTCC1 (channel 0), TCC0 (channel 2)
USBCDC_DM_PINPA24TCC1 (channel 2)
USBCDC_DP_PINPA25TCC1 (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