1.. _adafruit_itsybitsy_nrf52840:
2
3Adafruit ItsyBitsy nRF52840
4###########################
5
6Overview
7********
8
9The Adafruit ItsyBitsy nRF52840 Express is a small (36 mm x 18 mm) ARM
10development board with an onboard RGB LED, USB port, 2 MB of QSPI flash,
11and range of I/O broken out onto 21 GPIO pins.
12
13This development kit has the following features:
14
15* :abbr:`ADC (Analog to Digital Converter)`
16* CLOCK
17* FLASH
18* :abbr:`GPIO (General Purpose Input Output)`
19* :abbr:`I2C (Inter-Integrated Circuit)`
20* :abbr:`I2S (Inter-Integrated Sound)`
21* :abbr:`MPU (Memory Protection Unit)`
22* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
23* :abbr:`PWM (Pulse Width Modulation)`
24* :abbr:`QSPI (Quad Serial Peripheral Interface)`
25* RADIO (Bluetooth Low Energy and 802.15.4)
26* :abbr:`RTC (nRF RTC System Clock)`
27* :abbr:`SPI (Serial Peripheral Interface)`
28* :abbr:`UARTE (Universal asynchronous receiver-transmitter)`
29* :abbr:`USB (Universal Serial Bus)`
30* :abbr:`WDT (Watchdog Timer)`
31
32.. image:: img/adafruit_itsybitsy_nrf52840.jpeg
33     :align: center
34     :alt: Adafruit ItsyBitsy nRF52840 Express
35
36Hardware
37********
38- nRF52840 ARM Cortex-M4F CPU at 64MHz
39- 1 MB of flash memory and 256 KB of SRAM
40- 2 MB of QSPI flash
41- A user LED
42- A user switch
43- An RGB DotStar LED
44- Native USB port
45- One reset button
46
47Supported Features
48==================
49
50The Adafruit ItsyBitsy nRF52840 board configuration supports the
51following hardware features:
52
53+-----------+------------+----------------------+
54| Interface | Controller | Driver/Component     |
55+===========+============+======================+
56| ADC       | on-chip    | adc                  |
57+-----------+------------+----------------------+
58| CLOCK     | on-chip    | clock_control        |
59+-----------+------------+----------------------+
60| FLASH     | on-chip    | flash                |
61+-----------+------------+----------------------+
62| GPIO      | on-chip    | gpio                 |
63+-----------+------------+----------------------+
64| I2C       | on-chip    | i2c                  |
65+-----------+------------+----------------------+
66| MPU       | on-chip    | arch/arm             |
67+-----------+------------+----------------------+
68| NVIC      | on-chip    | arch/arm             |
69+-----------+------------+----------------------+
70| PWM       | on-chip    | pwm                  |
71+-----------+------------+----------------------+
72| QSPI(M)   | on-chip    | nor                  |
73+-----------+------------+----------------------+
74| RADIO     | on-chip    | Bluetooth,           |
75|           |            | ieee802154           |
76+-----------+------------+----------------------+
77| RTC       | on-chip    | system clock         |
78+-----------+------------+----------------------+
79| SPI       | on-chip    | spi                  |
80+-----------+------------+----------------------+
81| UARTE     | on-chip    | serial               |
82+-----------+------------+----------------------+
83| USB       | on-chip    | usb                  |
84+-----------+------------+----------------------+
85| WDT       | on-chip    | watchdog             |
86+-----------+------------+----------------------+
87
88Other hardware features have not been enabled yet for this board.
89
90Connections and IOs
91===================
92
93The `Adafruit ItsyBitsy nRF52840 Express Learn site`_ has detailed
94information about the board including `pinouts`_ and the `schematic`_.
95
96LED
97---
98
99* LED0 (red) = P0.06
100
101* LED1 (Adafruit DotStar)
102
103    * DATA = P0.08
104
105    * CLK = P1.09
106
107Push buttons
108------------
109
110* SWITCH = P0.29
111
112* RESET = P0.18
113
114Logging
115-------
116
117Logging is done using the USB-CDC port. See the :zephyr:code-sample:`logging` sample
118or the :zephyr:code-sample:`usb-cdc-acm-console` sample applications to see how this works.
119
120Testing LEDs and buttons on the Adafruit ItsyBitsy nRF52840 Express
121*******************************************************************
122The :zephyr:code-sample:`button` sample lets you test the buttons (switches) and the red LED.
123The :zephyr:code-sample:`blinky` sample lets you test the red LED.
124
125The DotStar LED has been implemented as a SPI device and can be tested
126with the :zephyr:code-sample:`led-apa102` sample application.
127
128You can build and flash the examples to make sure Zephyr is running correctly on
129your board. The button and LED definitions can be found in
130:zephyr_file:`boards/arm/adafruit_itsybitsy_nrf52840/adafruit_itsybitsy_nrf52840.dts`.
131
132Programming and Debugging
133*************************
134The ItsyBitsy ships with the BOSSA compatible UF2 bootloader.  The
135bootloader can be entered by quickly tapping the reset button twice.
136
137First time setup
138================
139Some versions of this board were shipped with a buggy bootloader.
140Ensure that the bootloader is up to date by following the
141`Adafruit UF2 Bootloader update`_ tutorial. Note that this tutorial
142was made for the Adafruit Feather nRF52840, but the steps to update
143the bootloader are the same for the ItsyBitsy. The files for the
144ItsyBitsy bootloader can be found in the `Adafruit nRF52 Bootloader repo`_.
145
146The building and flashing of Zephyr applications have been tested with
147release 0.7.0 of the UF2 bootloader.
148
149Flashing
150========
151Flashing is done by dragging and dropping the built Zephyr UF2-file
152into the :code:`ITSY840BOOT` drive.
153
154#. Build the Zephyr kernel and the :zephyr:code-sample:`blinky`
155   sample application:
156
157   .. zephyr-app-commands::
158      :zephyr-app: samples/basic/blinky
159      :board: adafruit_itsybitsy_nrf52840
160      :goals: build
161      :compact:
162
163#. Connect the ItsyBitsy to your host computer using USB
164
165#. Tap the reset button twice quickly to enter bootloader mode
166
167#. Flash the image:
168
169   Drag and drop the file :code:`samples/basic/blinky/build/zephyr/zephyr.uf2`
170   into :code:`ITSY840BOOT`
171
172The device will disconnect and you should see the red LED blink.
173
174References
175**********
176
177.. target-notes::
178
179.. _Adafruit ItsyBitsy nRF52840 Express Learn site:
180    https://learn.adafruit.com/adafruit-itsybitsy-nrf52840-express
181
182.. _pinouts:
183    https://learn.adafruit.com/adafruit-itsybitsy-nrf52840-express/pinouts
184
185.. _schematic:
186    https://learn.adafruit.com/adafruit-itsybitsy-nrf52840-express/downloads
187
188.. _Adafruit UF2 Bootloader update:
189    https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/update-bootloader
190
191.. _Adafruit nRF52 Bootloader repo:
192    https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases
193