|
| 1 | +.. zephyr:board:: maker_nano_rp2040 |
| 2 | +
|
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +The `Cytron Maker Nano RP2040`_ board is based on the RP2040 microcontroller from Raspberry Pi Ltd. |
| 7 | +The board has an Arduino Nano header, Maker/Qwiic/Stemma QT connectors and a mikro USB connector. |
| 8 | + |
| 9 | + |
| 10 | +Hardware |
| 11 | +******** |
| 12 | + |
| 13 | +- Microcontroller Raspberry Pi RP2040, with a max frequency of 133 MHz |
| 14 | +- Dual ARM Cortex M0+ cores |
| 15 | +- 264 kByte SRAM |
| 16 | +- 2 Mbyte QSPI flash |
| 17 | +- 20 GPIO pins |
| 18 | +- 2 ADC pins |
| 19 | +- I2C |
| 20 | +- SPI |
| 21 | +- UART |
| 22 | +- Mikro USB connector |
| 23 | +- Reset, boot and user buttons |
| 24 | +- 2 RGB LEDs (Neopixels) |
| 25 | +- Piezo buzzer with mute switch |
| 26 | +- Maker/Qwiic/Stemma QT/zephyr_i2c connectors |
| 27 | +- Status indicators for digital pins |
| 28 | + |
| 29 | + |
| 30 | +Default Zephyr Peripheral Mapping |
| 31 | +================================= |
| 32 | + |
| 33 | ++-------------+--------+-----------------+-------------------+ |
| 34 | +| Label | Pin | Default pin mux | Notes | |
| 35 | ++=============+========+=================+===================+ |
| 36 | +| RGB LEDs | GPIO11 | PIO0 | | |
| 37 | ++-------------+--------+-----------------+-------------------+ |
| 38 | +| User button | GPIO20 | | Alias sw0 | |
| 39 | ++-------------+--------+-----------------+-------------------+ |
| 40 | +| Buzzer | GPIO22 | PWM3A | Zephyr PWM name 6 | |
| 41 | ++-------------+--------+-----------------+-------------------+ |
| 42 | + |
| 43 | + |
| 44 | +Arduino Nano header: |
| 45 | + |
| 46 | ++-------+--------+-----------------+-------------------+ |
| 47 | +| Label | Pin | Default pin mux | Also in connector | |
| 48 | ++=======+========+=================+===================+ |
| 49 | +| 0 | GPIO0 | UART0 TX | Maker port 0 | |
| 50 | ++-------+--------+-----------------+-------------------+ |
| 51 | +| 1 | GPIO1 | UART0 RX | Maker port 0 | |
| 52 | ++-------+--------+-----------------+-------------------+ |
| 53 | +| RS | Reset | | | |
| 54 | ++-------+--------+-----------------+-------------------+ |
| 55 | +| G | GND | | | |
| 56 | ++-------+--------+-----------------+-------------------+ |
| 57 | +| 2 | GPIO2 | | (Alias led0) | |
| 58 | ++-------+--------+-----------------+-------------------+ |
| 59 | +| 3 | GPIO3 | | | |
| 60 | ++-------+--------+-----------------+-------------------+ |
| 61 | +| 4 | GPIO4 | | | |
| 62 | ++-------+--------+-----------------+-------------------+ |
| 63 | +| 5 | GPIO5 | | | |
| 64 | ++-------+--------+-----------------+-------------------+ |
| 65 | +| 6 | GPIO6 | | | |
| 66 | ++-------+--------+-----------------+-------------------+ |
| 67 | +| 7 | GPIO7 | | | |
| 68 | ++-------+--------+-----------------+-------------------+ |
| 69 | +| 8 | GPIO8 | | | |
| 70 | ++-------+--------+-----------------+-------------------+ |
| 71 | +| 9 | GPIO9 | | | |
| 72 | ++-------+--------+-----------------+-------------------+ |
| 73 | +| 17 | GPIO17 | SPI0 CS | | |
| 74 | ++-------+--------+-----------------+-------------------+ |
| 75 | +| 19 | GPIO19 | SPI0 MOSI | | |
| 76 | ++-------+--------+-----------------+-------------------+ |
| 77 | +| 16 | GPIO16 | SPI0 MISO | | |
| 78 | ++-------+--------+-----------------+-------------------+ |
| 79 | +| 18 | GPIO18 | SPI0 SCK | | |
| 80 | ++-------+--------+-----------------+-------------------+ |
| 81 | +| 3V3 | 3.3 V | | | |
| 82 | ++-------+--------+-----------------+-------------------+ |
| 83 | +| NC | | | | |
| 84 | ++-------+--------+-----------------+-------------------+ |
| 85 | +| 26 | GPIO26 | I2C1 SDA | Maker port 1 | |
| 86 | ++-------+--------+-----------------+-------------------+ |
| 87 | +| 27 | GPIO27 | I2C1 SCL | Maker port 1 | |
| 88 | ++-------+--------+-----------------+-------------------+ |
| 89 | +| 28 | GPIO28 | ADC2 | | |
| 90 | ++-------+--------+-----------------+-------------------+ |
| 91 | +| 29 | GPIO29 | ADC3 | | |
| 92 | ++-------+--------+-----------------+-------------------+ |
| 93 | +| 12 | GPIO12 | I2C0 SDA | | |
| 94 | ++-------+--------+-----------------+-------------------+ |
| 95 | +| 13 | GPIO13 | I2C0 SCL | | |
| 96 | ++-------+--------+-----------------+-------------------+ |
| 97 | +| 14 | GPIO14 | | | |
| 98 | ++-------+--------+-----------------+-------------------+ |
| 99 | +| 15 | GPIO15 | | | |
| 100 | ++-------+--------+-----------------+-------------------+ |
| 101 | +| 5V | 5 V | | | |
| 102 | ++-------+--------+-----------------+-------------------+ |
| 103 | +| RS | Reset | | | |
| 104 | ++-------+--------+-----------------+-------------------+ |
| 105 | +| G | GND | | | |
| 106 | ++-------+--------+-----------------+-------------------+ |
| 107 | +| VIN | Vin | | | |
| 108 | ++-------+--------+-----------------+-------------------+ |
| 109 | + |
| 110 | + |
| 111 | +Maker port 0 (pins also available in the Arduino Nano header): |
| 112 | + |
| 113 | ++--------+-----------------+ |
| 114 | +| Pin | Default pin mux | |
| 115 | ++========+=================+ |
| 116 | +| GPIO0 | UART0 TX | |
| 117 | ++--------+-----------------+ |
| 118 | +| GPIO1 | UART0 RX | |
| 119 | ++--------+-----------------+ |
| 120 | + |
| 121 | + |
| 122 | +Maker port 1, also known as Qwiic/Stemma QT/zephyr_i2c. Pins also available in the Arduino |
| 123 | +Nano header: |
| 124 | + |
| 125 | ++--------+-----------------+ |
| 126 | +| Pin | Default pin mux | |
| 127 | ++========+=================+ |
| 128 | +| GPIO26 | I2C1 SDA | |
| 129 | ++--------+-----------------+ |
| 130 | +| GPIO27 | I2C1 SCL | |
| 131 | ++--------+-----------------+ |
| 132 | + |
| 133 | +See also `pinout`_. |
| 134 | + |
| 135 | + |
| 136 | +Supported Features |
| 137 | +================== |
| 138 | + |
| 139 | +.. zephyr:board-supported-hw:: |
| 140 | +
|
| 141 | +
|
| 142 | +Programming and Debugging |
| 143 | +************************* |
| 144 | + |
| 145 | +.. zephyr:board-supported-runners:: |
| 146 | +
|
| 147 | +The Maker Nano RP2040 board does not expose the SWDIO and SWCLK pins, so programming must be |
| 148 | +done via the USB port. Press and hold the BOOT button, and then press the RST button, |
| 149 | +and the device will appear as a USB mass storage unit. |
| 150 | +Building your application will result in a :file:`build/zephyr/zephyr.uf2` file. |
| 151 | +Drag and drop the file to the USB mass storage unit, and the board will be reprogrammed. |
| 152 | + |
| 153 | +For more details on programming RP2040-based boards, see :ref:`rpi_pico_programming_and_debugging`. |
| 154 | + |
| 155 | + |
| 156 | +Flashing |
| 157 | +======== |
| 158 | + |
| 159 | +To run the :zephyr:code-sample:`led-strip` sample: |
| 160 | + |
| 161 | +.. zephyr-app-commands:: |
| 162 | + :zephyr-app: samples/drivers/led/led_strip/ |
| 163 | + :board: maker_nano_rp2040 |
| 164 | + :goals: build flash |
| 165 | + |
| 166 | +Try also the :zephyr:code-sample:`hello_world`, :zephyr:code-sample:`blinky`, |
| 167 | +:zephyr:code-sample:`button`, :zephyr:code-sample:`input-dump` and |
| 168 | +:zephyr:code-sample:`adc_dt` samples. |
| 169 | + |
| 170 | +The use of the Maker Port 1/Qwiic/Stemma QT I2C connector is demonstrated using the |
| 171 | +:zephyr:code-sample:`light_sensor_polling` sample and a separate shield: |
| 172 | + |
| 173 | +.. zephyr-app-commands:: |
| 174 | + :zephyr-app: samples/sensor/light_polling |
| 175 | + :board: maker_nano_rp2040 |
| 176 | + :shield: adafruit_veml7700 |
| 177 | + :goals: build flash |
| 178 | + |
| 179 | +Use the shell to control the GPIO pins: |
| 180 | + |
| 181 | +.. zephyr-app-commands:: |
| 182 | + :zephyr-app: samples/sensor/sensor_shell |
| 183 | + :board: maker_nano_rp2040 |
| 184 | + :gen-args: -DCONFIG_GPIO=y -DCONFIG_GPIO_SHELL=y |
| 185 | + :goals: build flash |
| 186 | + |
| 187 | +To set one of the GPIO pins high, use these commands in the shell, and study the indicator LEDs: |
| 188 | + |
| 189 | +.. code-block:: shell |
| 190 | +
|
| 191 | + gpio conf gpio0 2 o |
| 192 | + gpio set gpio0 2 1 |
| 193 | +
|
| 194 | +Turn on the buzzer switch on the short side of the board. Then build using the same command |
| 195 | +as above for the sensor_shell. Use these shell commands to turn on and off the buzzer: |
| 196 | + |
| 197 | +.. code-block:: shell |
| 198 | +
|
| 199 | + pwm usec pwm@40050000 6 1000 500 |
| 200 | + pwm usec pwm@40050000 6 1000 0 |
| 201 | +
|
| 202 | +
|
| 203 | +References |
| 204 | +********** |
| 205 | + |
| 206 | +.. target-notes:: |
| 207 | + |
| 208 | +.. _Cytron Maker Nano RP2040: |
| 209 | + https://www.cytron.io/c-maker-series/p-maker-nano-rp2040-simplifying-projects-with-raspberry-pi-rp2040 |
| 210 | + |
| 211 | +.. _pinout: |
| 212 | + https://docs.google.com/drawings/d/e/2PACX-1vSGwfh_1ac_UFXT4F72D0yJHaYHjDC-lfeBMLp0dc8ry57sAYtdobIFBZqrfXE6AuDTYEY9Cicto2b8/pub?w=3373&h=2867 |
0 commit comments