1.. zephyr:board:: seeeduino_xiao
2
3Overview
4********
5
6The Seeeduino XIAO is a tiny (20 mm x 17.5 mm) ARM development
7board with onboard LEDs, USB port, and range of I/O broken out
8onto 14 pins.
9
10Hardware
11********
12
13- ATSAMD21G18A ARM Cortex-M0+ processor at 48 MHz
14- 256 KiB flash memory and 32 KiB of RAM
15- Three user LEDs
16- Native USB port
17
18Supported Features
19==================
20
21The seeeduino_xiao board configuration supports the following hardware
22features:
23
24+-----------+------------+------------------------------------------+
25| Interface | Controller | Driver/Component                         |
26+===========+============+==========================================+
27| DMA       | on-chip    | Direct memory access                     |
28+-----------+------------+------------------------------------------+
29| DAC       | on-chip    | Digital to analogue converter            |
30+-----------+------------+------------------------------------------+
31| Flash     | on-chip    | Can be used with LittleFS to store files |
32+-----------+------------+------------------------------------------+
33| GPIO      | on-chip    | I/O ports                                |
34+-----------+------------+------------------------------------------+
35| HWINFO    | on-chip    | Hardware info                            |
36+-----------+------------+------------------------------------------+
37| I2C       | on-chip    | Inter-Integrated Circuit                 |
38+-----------+------------+------------------------------------------+
39| NVIC      | on-chip    | nested vector interrupt controller       |
40+-----------+------------+------------------------------------------+
41| SPI       | on-chip    | Serial Peripheral Interface ports        |
42+-----------+------------+------------------------------------------+
43| SYSTICK   | on-chip    | systick                                  |
44+-----------+------------+------------------------------------------+
45| USART     | on-chip    | Serial ports                             |
46+-----------+------------+------------------------------------------+
47| USB       | on-chip    | USB device                               |
48+-----------+------------+------------------------------------------+
49| WDT       | on-chip    | Watchdog                                 |
50+-----------+------------+------------------------------------------+
51
52Other hardware features are not currently supported by Zephyr.
53
54The default configuration can be found in the Kconfig file
55:zephyr_file:`boards/seeed/seeeduino_xiao/seeeduino_xiao_defconfig`.
56
57Connections and IOs
58===================
59
60The `Seeeduino XIAO wiki`_ has detailed information about
61the board including `pinouts`_ and the `schematic`_.
62
63System Clock
64============
65
66The SAMD21 MCU is configured to use the 32 kHz external crystal
67with the on-chip PLL generating the 48 MHz system clock.  The internal
68APB and GCLK unit are set up in the same way as the upstream Arduino
69libraries.
70
71SPI Port
72========
73
74The SAMD21 MCU has 6 SERCOM based SPIs.  On the XIAO, SERCOM0 can be put
75into SPI mode and used to connect to devices over pin 9 (MISO), pin 10
76(MOSI), and pin 8 (SCK).
77
78I2C Port
79========
80
81The SAMD21 MCU has 6 SERCOM based USARTs. On the XIAO, SERCOM2 is available on
82pin 4 (SDA) and pin 5 (SCL).
83
84Serial Port
85===========
86
87The SAMD21 MCU has 6 SERCOM based USARTs.  On the XIAO, SERCOM4 is
88the Zephyr console and is available on pins 7 (RX) and 6 (TX).
89
90USB Device Port
91===============
92
93The SAMD21 MCU has a USB device port that can be used to communicate
94with a host PC.  See the :zephyr:code-sample-category:`usb` sample applications for
95more, such as the :zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual
96serial port that echos characters back to the host PC.
97
98DAC
99===
100
101The SAMD21 MCU has a single channel DAC with 10 bits of resolution. On
102the XIAO, the DAC is available on pin 0.
103
104Programming and Debugging
105*************************
106
107The XIAO ships the BOSSA compatible UF2 bootloader.  The bootloader can be
108entered by shorting the RST and GND pads twice.
109
110Additionally, if :code:`CONFIG_USB_CDC_ACM` is enabled then the bootloader
111will be entered automatically when you run :code:`west flash`.
112
113Flashing
114========
115
116#. Build the Zephyr kernel and the :zephyr:code-sample:`hello_world` sample application:
117
118   .. zephyr-app-commands::
119      :zephyr-app: samples/hello_world
120      :board: seeeduino_xiao
121      :goals: build
122      :compact:
123
124#. Connect the XIAO to your host computer using USB
125
126#. Connect a 3.3 V USB to serial adapter to the board and to the
127   host.  See the `Serial Port`_ section above for the board's pin
128   connections.
129
130#. Run your favorite terminal program to listen for output. Under Linux the
131   terminal should be :code:`/dev/ttyUSB0`. For example:
132
133   .. code-block:: console
134
135      $ minicom -D /dev/ttyUSB0 -o
136
137   The -o option tells minicom not to send the modem initialization
138   string. Connection should be configured as follows:
139
140   - Speed: 115200
141   - Data: 8 bits
142   - Parity: None
143   - Stop bits: 1
144
145#. Short the RST and GND pads twice quickly to enter bootloader mode
146
147#. Flash the image:
148
149   .. zephyr-app-commands::
150      :zephyr-app: samples/hello_world
151      :board: seeeduino_xiao
152      :goals: flash
153      :compact:
154
155   You should see "Hello World! seeeduino_xiao" in your terminal.
156
157References
158**********
159
160.. target-notes::
161
162.. _Seeeduino XIAO wiki:
163    https://wiki.seeedstudio.com/Seeeduino-XIAO/
164
165.. _pinouts:
166    https://wiki.seeedstudio.com/Seeeduino-XIAO/#hardware-overview
167
168.. _schematic:
169    https://wiki.seeedstudio.com/Seeeduino-XIAO/#resourses
170