|
| 1 | +.. zephyr:board:: adafruit_trinkey_qt2040 |
| 2 | +
|
| 3 | +Overview |
| 4 | +******** |
| 5 | + |
| 6 | +The `Adafruit Trinkey QT2040`_ board is based on the RP2040 microcontroller from Raspberry |
| 7 | +Pi Ltd. The board has a Stemma QT connector for easy sensor usage, and has a USB type A connector. |
| 8 | +The board outline is similar to many Adafruit Stemma QT shields. |
| 9 | + |
| 10 | + |
| 11 | +Hardware |
| 12 | +******** |
| 13 | + |
| 14 | +- Microcontroller Raspberry Pi RP2040, with a max frequency of 133 MHz |
| 15 | +- Dual ARM Cortex M0+ cores |
| 16 | +- 264 kByte SRAM |
| 17 | +- 8 Mbyte QSPI flash |
| 18 | +- USB type A connector |
| 19 | +- Reset and boot buttons |
| 20 | +- RGB LED (Neopixel) |
| 21 | +- Stemma QT I2C connector |
| 22 | + |
| 23 | + |
| 24 | +Default Zephyr Peripheral Mapping |
| 25 | +================================= |
| 26 | + |
| 27 | +.. rst-class:: rst-columns |
| 28 | + |
| 29 | + - Boot/User button: GPIO12 |
| 30 | + - RGB LED: GPIO27 |
| 31 | + - I2C0_SDA : GPIO16 |
| 32 | + - I2C0_SCL : GPIO17 |
| 33 | + |
| 34 | +Note that no serial port pins (RX or TX) are exposed. By default this board |
| 35 | +uses USB for terminal output. |
| 36 | + |
| 37 | +The Boot/User button will pull down the QSPI chip-select line (via a diode) for entering |
| 38 | +the built-in USB bootloader at startup. The devicetree file enables an in-chip pull-up |
| 39 | +resistor for the Boot/User button so it can be used during runtime, for example |
| 40 | +via the :zephyr:code-sample:`input-dump` or the :zephyr:code-sample:`button` sample. |
| 41 | +However these samples are somewhat unreliable, as there might be lots of interrupts. This |
| 42 | +can be solved by using a stronger external pull-up via the TP4 test point on the back of the PCB, |
| 43 | +for example 10 kOhm to +3.3 Volt. |
| 44 | + |
| 45 | +See also `pinout`_ and `schematic`_. |
| 46 | + |
| 47 | + |
| 48 | +Supported Features |
| 49 | +================== |
| 50 | + |
| 51 | +.. zephyr:board-supported-hw:: |
| 52 | +
|
| 53 | +
|
| 54 | +Programming and Debugging |
| 55 | +************************* |
| 56 | + |
| 57 | +.. zephyr:board-supported-runners:: |
| 58 | +
|
| 59 | +The Adafruit Trinkey QT2040 board does not expose the SWDIO and SWCLK pins, so programming |
| 60 | +must be done via the USB port. Press and hold the BOOT button, and then press the RST button, |
| 61 | +and the device will appear as a USB mass storage unit. Building your application will result |
| 62 | +in a :file:`build/zephyr/zephyr.uf2` file. Drag and drop the file to the USB mass storage unit, |
| 63 | +and the board will be reprogrammed. |
| 64 | + |
| 65 | +For more details on programming RP2040-based boards, see :ref:`rpi_pico_programming_and_debugging`. |
| 66 | + |
| 67 | + |
| 68 | +Flashing |
| 69 | +======== |
| 70 | + |
| 71 | +To build and flash the :zephyr:code-sample:`led-strip` application, which will blink the |
| 72 | +on-board RGB LED in different colors, use this command: |
| 73 | + |
| 74 | +.. zephyr-app-commands:: |
| 75 | + :zephyr-app: samples/drivers/led/led_strip |
| 76 | + :board: adafruit_trinkey_qt2040 |
| 77 | + :goals: build flash |
| 78 | + |
| 79 | +Try also the :zephyr:code-sample:`dining-philosophers` sample to verify USB console output. |
| 80 | +Samples where text is printed only just at startup, for example :zephyr:code-sample:`hello_world`, |
| 81 | +are difficult to use as the text is already printed once you connect to the newly created |
| 82 | +USB console endpoint. |
| 83 | + |
| 84 | +It is easy to connect a sensor shield via the Stemma QT I2C connector, for example |
| 85 | +the ``adafruit_lis3dh`` shield. Run the :zephyr:code-sample:`accel_polling` sample: |
| 86 | + |
| 87 | +.. zephyr-app-commands:: |
| 88 | + :zephyr-app: samples/sensor/accel_polling/ |
| 89 | + :board: adafruit_trinkey_qt2040 |
| 90 | + :shield: adafruit_lis3dh |
| 91 | + :goals: build flash |
| 92 | + |
| 93 | +or the :zephyr:code-sample:`sensor_shell` sample: |
| 94 | + |
| 95 | +.. zephyr-app-commands:: |
| 96 | + :zephyr-app: samples/sensor/sensor_shell/ |
| 97 | + :board: adafruit_trinkey_qt2040 |
| 98 | + :shield: adafruit_lis3dh |
| 99 | + :goals: build flash |
| 100 | + |
| 101 | +Read the values from the accelerometer via the shell: |
| 102 | + |
| 103 | +.. code-block:: console |
| 104 | +
|
| 105 | + uart:~$ sensor get lis3dh@18 |
| 106 | + channel type=0(accel_x) index=0 shift=4 num_samples=1 value=22974328296ns (0.000000) |
| 107 | + channel type=1(accel_y) index=0 shift=4 num_samples=1 value=22974328296ns (-0.114912) |
| 108 | + channel type=2(accel_z) index=0 shift=4 num_samples=1 value=22974328296ns (9.882431) |
| 109 | + channel type=3(accel_xyz) index=0 shift=4 num_samples=1 value=22974328296ns, (0.000000, -0.114912, 9.882431) |
| 110 | +
|
| 111 | +
|
| 112 | +References |
| 113 | +********** |
| 114 | + |
| 115 | +.. target-notes:: |
| 116 | + |
| 117 | +.. _Adafruit Trinkey QT2040: |
| 118 | + https://learn.adafruit.com/adafruit-trinkey-qt2040 |
| 119 | + |
| 120 | +.. _pinout: |
| 121 | + https://learn.adafruit.com/adafruit-trinkey-qt2040/pinouts |
| 122 | + |
| 123 | +.. _schematic: |
| 124 | + https://learn.adafruit.com/adafruit-trinkey-qt2040/downloads |
0 commit comments