|
| 1 | +.. _adafruit_trinket_m0: |
| 2 | + |
| 3 | +Adafruit Trinket M0 |
| 4 | +################### |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +The Adafruit Trinket M0 is a tiny (27 mm x 15 mm) ARM development |
| 10 | +board with an onboard RGB LED, USB port, and range of I/O broken out |
| 11 | +onto 5 pins. |
| 12 | + |
| 13 | +.. image:: img/adafruit_trinket_m0.png |
| 14 | + :width: 500px |
| 15 | + :align: center |
| 16 | + :alt: Adafruit Trinket M0 |
| 17 | + |
| 18 | +Hardware |
| 19 | +******** |
| 20 | + |
| 21 | +- ATSAMD21E18A ARM Cortex-M0+ processor at 48 MHz |
| 22 | +- 256 KiB flash memory and 32 KiB of RAM |
| 23 | +- Internal trimmed 8 MHz oscillator |
| 24 | +- A user LED |
| 25 | +- An RGB DotStar LED |
| 26 | +- Native USB port |
| 27 | +- One reset button |
| 28 | + |
| 29 | +Supported Features |
| 30 | +================== |
| 31 | + |
| 32 | +The adafruit_trinket_m0 board configuration supports the following hardware |
| 33 | +features: |
| 34 | + |
| 35 | ++-----------+------------+--------------------------------------+ |
| 36 | +| Interface | Controller | Driver/Component | |
| 37 | ++===========+============+======================================+ |
| 38 | +| NVIC | on-chip | nested vector interrupt controller | |
| 39 | ++-----------+------------+--------------------------------------+ |
| 40 | +| Flash | on-chip | Can be used with NFFS to store files | |
| 41 | ++-----------+------------+--------------------------------------+ |
| 42 | +| SYSTICK | on-chip | systick | |
| 43 | ++-----------+------------+--------------------------------------+ |
| 44 | +| WDT | on-chip | Watchdog | |
| 45 | ++-----------+------------+--------------------------------------+ |
| 46 | +| GPIO | on-chip | I/O ports | |
| 47 | ++-----------+------------+--------------------------------------+ |
| 48 | +| USART | on-chip | Serial ports | |
| 49 | ++-----------+------------+--------------------------------------+ |
| 50 | +| SPI | on-chip | Serial Peripheral Interface ports | |
| 51 | ++-----------+------------+--------------------------------------+ |
| 52 | + |
| 53 | +Other hardware features are not currently supported by Zephyr. |
| 54 | + |
| 55 | +The default configuration can be found in the Kconfig file |
| 56 | +:file:`boards/arm/adafruit_trinket_m0/adafruit_trinket_m0_defconfig`. |
| 57 | + |
| 58 | +Connections and IOs |
| 59 | +=================== |
| 60 | + |
| 61 | +The `Adafruit Trinket M0 Learn site`_ has detailed information about |
| 62 | +the board including `pinouts`_ and the `schematic`_. |
| 63 | + |
| 64 | +System Clock |
| 65 | +============ |
| 66 | + |
| 67 | +The SAMD21 MCU is configured to use the 8 MHz internal oscillator |
| 68 | +with the on-chip PLL generating the 48 MHz system clock. The internal |
| 69 | +APB and GCLK unit are set up in the same way as the upstream Arduino |
| 70 | +libraries. |
| 71 | + |
| 72 | +Serial Port |
| 73 | +=========== |
| 74 | + |
| 75 | +The SAMD21 MCU has 6 SERCOM based USARTs. On the Trinket, SERCOM0 is |
| 76 | +the Zephyr console and is available on pins 3 (RX) and 4 (TX). |
| 77 | +SERCOM2 is available on pins 2 (RX) and 0 (TX). |
| 78 | + |
| 79 | +SPI Port |
| 80 | +======== |
| 81 | + |
| 82 | +The SAMD21 MCU has 6 SERCOM based SPIs. On the Trinket, SPI1 is used |
| 83 | +to drive the DotStar RGB LED. SERCOM0 can be put into SPI mode and |
| 84 | +used to connect to devices over pin 2 (MISO), pin 4 (MOSI), and pin 3 |
| 85 | +(SCK). |
| 86 | + |
| 87 | +Programming and Debugging |
| 88 | +************************* |
| 89 | + |
| 90 | +The Trinket M0 ships the BOSSA compatible UF2 bootloader. The |
| 91 | +bootloader can be entered by quickly tapping the reset button twice. |
| 92 | + |
| 93 | +Flashing |
| 94 | +======== |
| 95 | + |
| 96 | +#. Build the Zephyr kernel and the :ref:`hello_world` sample application: |
| 97 | + |
| 98 | + .. zephyr-app-commands:: |
| 99 | + :zephyr-app: samples/hello_world |
| 100 | + :board: adafruit_trinket_m0 |
| 101 | + :goals: build |
| 102 | + :compact: |
| 103 | + |
| 104 | +#. Connect the Trinket M0 to your host computer using USB |
| 105 | + |
| 106 | +#. Connect a 3.3 V USB to serial adapter to the board and to the |
| 107 | + host. See the `Serial Port`_ section above for the board's pin |
| 108 | + connections. |
| 109 | + |
| 110 | +#. Run your favorite terminal program to listen for output. Under Linux the |
| 111 | + terminal should be :code:`/dev/ttyACM0`. For example: |
| 112 | + |
| 113 | + .. code-block:: console |
| 114 | +
|
| 115 | + $ minicom -D /dev/ttyACM0 -o |
| 116 | +
|
| 117 | + The -o option tells minicom not to send the modem initialization |
| 118 | + string. Connection should be configured as follows: |
| 119 | + |
| 120 | + - Speed: 115200 |
| 121 | + - Data: 8 bits |
| 122 | + - Parity: None |
| 123 | + - Stop bits: 1 |
| 124 | + |
| 125 | +#. Tap the reset button twice quickly to enter bootloader mode |
| 126 | + |
| 127 | +#. Flash the image: |
| 128 | + |
| 129 | + .. zephyr-app-commands:: |
| 130 | + :zephyr-app: samples/hello_world |
| 131 | + :board: adafruit_trinket_m0 |
| 132 | + :goals: flash |
| 133 | + :compact: |
| 134 | + |
| 135 | + You should see "Hello World! arm" in your terminal. |
| 136 | + |
| 137 | +References |
| 138 | +********** |
| 139 | + |
| 140 | +.. target-notes:: |
| 141 | + |
| 142 | +.. _Adafruit Trinket M0 Learn site: |
| 143 | + https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino |
| 144 | + |
| 145 | +.. _pinouts: |
| 146 | + https://learn.adafruit.com/assets/49778 |
| 147 | + |
| 148 | +.. _schematic: |
| 149 | + https://learn.adafruit.com/assets/45723 |
0 commit comments