|
| 1 | +.. _arduino_mkrzero: |
| 2 | + |
| 3 | +Arduino MKRZero |
| 4 | +############### |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +The Arduino MKRZero is built around Atmel’s SAMD21 MCU, which features |
| 10 | +a 32-bit ARM Cortex M0+ core. It comes in a smaller format than the |
| 11 | +Arduino Zero based on that same MCU. |
| 12 | + |
| 13 | +.. image:: img/arduino_mkrzero.jpg |
| 14 | + :width: 500px |
| 15 | + :align: center |
| 16 | + :alt: Arduino MKRZero |
| 17 | + |
| 18 | +Hardware |
| 19 | +******** |
| 20 | + |
| 21 | +- ATSAMD21G18A ARM Cortex-M0+ processor at 48 MHz |
| 22 | +- 32.768 kHz crystal oscillator |
| 23 | +- 256 KiB flash memory and 32 KiB of RAM |
| 24 | +- 1 user LED |
| 25 | +- One reset button |
| 26 | +- Native USB port |
| 27 | + |
| 28 | +Supported Features |
| 29 | +================== |
| 30 | + |
| 31 | +The arduino_mkrzero board configuration supports the following hardware |
| 32 | +features: |
| 33 | + |
| 34 | ++-----------+------------+--------------------------------------+ |
| 35 | +| Interface | Controller | Driver/Component | |
| 36 | ++===========+============+======================================+ |
| 37 | +| NVIC | on-chip | nested vector interrupt controller | |
| 38 | ++-----------+------------+--------------------------------------+ |
| 39 | +| Flash | on-chip | Can be used with NFFS to store files | |
| 40 | ++-----------+------------+--------------------------------------+ |
| 41 | +| SYSTICK | on-chip | systick | |
| 42 | ++-----------+------------+--------------------------------------+ |
| 43 | +| WDT | on-chip | Watchdog | |
| 44 | ++-----------+------------+--------------------------------------+ |
| 45 | +| GPIO | on-chip | I/O ports | |
| 46 | ++-----------+------------+--------------------------------------+ |
| 47 | +| USART | on-chip | Serial ports | |
| 48 | ++-----------+------------+--------------------------------------+ |
| 49 | +| SPI | on-chip | Serial Peripheral Interface ports | |
| 50 | ++-----------+------------+--------------------------------------+ |
| 51 | +| I2C | on-chip | I2C ports (experimental) | |
| 52 | ++-----------+------------+--------------------------------------+ |
| 53 | +| USB | on-chip | USB device | |
| 54 | ++-----------+------------+--------------------------------------+ |
| 55 | +| EIC | on-chip | External Interrupt Controller | |
| 56 | ++-----------+------------+--------------------------------------+ |
| 57 | + |
| 58 | +Other hardware features are not currently supported by Zephyr. |
| 59 | + |
| 60 | +The default configuration can be found in the Kconfig |
| 61 | +:file:`boards/arm/arduino_mkrzero/arduino_mkrzero_defconfig`. |
| 62 | + |
| 63 | +Connections and IOs |
| 64 | +=================== |
| 65 | + |
| 66 | +The `Arduino store`_ has detailed information about board |
| 67 | +connections. Download the `Arduino MKRZero Schematic`_ for more detail. |
| 68 | + |
| 69 | +System Clock |
| 70 | +============ |
| 71 | + |
| 72 | +The SAMD21 MCU is configured to use the 32.768 kHz external oscillator |
| 73 | +with the on-chip PLL generating the 48 MHz system clock. The internal |
| 74 | +APB and GCLK unit are set up in the same way as the upstream Arduino |
| 75 | +libraries. |
| 76 | + |
| 77 | +Serial Port |
| 78 | +=========== |
| 79 | + |
| 80 | +The SAMD21 MCU has 6 SERCOM peripherals, each configurable to operate as either: |
| 81 | + |
| 82 | +- USART |
| 83 | +- SPI |
| 84 | +- I2C |
| 85 | + |
| 86 | +SERCOM5 is configured as Arduino MKRZero's unique UART interface. |
| 87 | + |
| 88 | +SPI Port |
| 89 | +======== |
| 90 | + |
| 91 | +SERCOM1 is configured as Arduino MKRZero's unique SPI interface. |
| 92 | + |
| 93 | +I2C Port |
| 94 | +======== |
| 95 | + |
| 96 | +SERCOM0 is configured as Arduino MKRZero's unique I2C interface. |
| 97 | + |
| 98 | +USB Device Port |
| 99 | +=============== |
| 100 | + |
| 101 | +The SAMD21 MCU has a USB device port that can be used to communicate |
| 102 | +with a host PC. See the :ref:`usb-samples` sample applications for |
| 103 | +more, such as the :ref:`usb_cdc-acm` sample which sets up a virtual |
| 104 | +serial port that echos characters back to the host PC. |
| 105 | + |
| 106 | +EIC |
| 107 | +=== |
| 108 | + |
| 109 | +The External Interrupt Controller peripheral allows I/O pins to be configured as |
| 110 | +interrupt lines. It is enabled from the GPIO driver configuration menu. The |
| 111 | +interrupt -to- I/O pin mapping depends on both the MCU device variant pin count |
| 112 | +and the peripheral signals multiplexing to the I/O pins for the considered |
| 113 | +board. On Atmel SAMD21G for instance, both PA00 and PA16 can be assigned to |
| 114 | +external interrupt 0. On the Arduino MKR Zero, which is based on this device |
| 115 | +variant, PA00 is used for another purpose which leaves the user with PA16 as the |
| 116 | +only choice for this particular external interrupt. The value 16 would thus need |
| 117 | +to be configured for external interrupt 0. Below is the mapping table for the |
| 118 | +Arduino MKR Zero. Also note that, unlike for other peripherals, the pin |
| 119 | +multiplexing is performed by the GPIO driver as part of the I/O pin |
| 120 | +configuration, that is, no code is needed in pinmux.c. |
| 121 | + |
| 122 | ++--------+------------+------------+---------+ |
| 123 | +| EXTINT | MKZero Pin | PORT Group | I/O Pin | |
| 124 | ++========+============+============+=========+ |
| 125 | +| 0 | MOSI | PORTA | 16 | |
| 126 | ++--------+------------+------------+---------+ |
| 127 | +| 1 | SCK | PORTA | 17 | |
| 128 | ++--------+------------+------------+---------+ |
| 129 | +| 2 | A1 | PORTB | 2 | |
| 130 | ++--------+------------+------------+---------+ |
| 131 | +| 3 | A2 | PORTB | 3 | |
| 132 | ++--------+------------+------------+---------+ |
| 133 | +| 4 | D6 | PORTA | 20 | |
| 134 | ++--------+------------+------------+---------+ |
| 135 | +| 5 | D7 | PORTA | 21 | |
| 136 | ++--------+------------+------------+---------+ |
| 137 | +| 6 | D0 | PORTA | 22 | |
| 138 | ++--------+------------+------------+---------+ |
| 139 | +| 7 | D1 | PORTA | 23 | |
| 140 | ++--------+------------+------------+---------+ |
| 141 | +| 10 | D4 | PORTB | 10 | |
| 142 | ++--------+------------+------------+---------+ |
| 143 | +| 11 | D5 | PORTB | 11 | |
| 144 | ++--------+------------+------------+---------+ |
| 145 | + |
| 146 | + |
| 147 | +Programming and Debugging |
| 148 | +************************* |
| 149 | + |
| 150 | +Debugging and programming the Arduino MKRZero requires using the |
| 151 | +Atmel-ICE development tool with OpenOCD. |
| 152 | + |
| 153 | +Flashing |
| 154 | +======== |
| 155 | + |
| 156 | +#. Build the Zephyr kernel and the :ref:`hello_world` sample application: |
| 157 | + |
| 158 | + .. zephyr-app-commands:: |
| 159 | + :zephyr-app: samples/hello_world |
| 160 | + :board: arduino_mkrzero |
| 161 | + :goals: build |
| 162 | + :compact: |
| 163 | + |
| 164 | +#. Connect the Arduino MKRZero to your host computer using the USB debug |
| 165 | + port. |
| 166 | + |
| 167 | +#. Run your favorite terminal program to listen for output. Under Linux the |
| 168 | + terminal should be :code:`/dev/ttyACM0`. For example: |
| 169 | + |
| 170 | + .. code-block:: console |
| 171 | +
|
| 172 | + $ minicom -D /dev/ttyACM0 -o |
| 173 | +
|
| 174 | + The -o option tells minicom not to send the modem initialization |
| 175 | + string. Connection should be configured as follows: |
| 176 | + |
| 177 | + - Speed: 115200 |
| 178 | + - Data: 8 bits |
| 179 | + - Parity: None |
| 180 | + - Stop bits: 1 |
| 181 | + |
| 182 | +#. To flash an image: |
| 183 | + |
| 184 | + .. zephyr-app-commands:: |
| 185 | + :zephyr-app: samples/hello_world |
| 186 | + :board: arduino_mkrzero |
| 187 | + :goals: flash |
| 188 | + :compact: |
| 189 | + |
| 190 | + You should see "Hello World! arm" in your terminal. |
| 191 | + |
| 192 | +References |
| 193 | +********** |
| 194 | + |
| 195 | +.. target-notes:: |
| 196 | + |
| 197 | +.. _Arduino Store: |
| 198 | + https://store.arduino.cc/arduino-mkrzero |
| 199 | + |
| 200 | +.. _Arduino MKRZero Schematic: |
| 201 | + https://www.arduino.cc/en/uploads/Main/ArduinoMKRZero-schematic.pdf |
0 commit comments