1.. zephyr:board:: raytac_mdbt50q_db_40
2
3Overview
4********
5
6The Raytac MDBT50Q-DB-40 hardware provides support for the
7Nordic Semiconductor nRF52840 ARM Cortex-M4F CPU and the following devices:
8
9* :abbr:`ADC (Analog to Digital Converter)`
10* CLOCK
11* FLASH
12* :abbr:`GPIO (General Purpose Input Output)`
13* :abbr:`I2C (Inter-Integrated Circuit)`
14* :abbr:`MPU (Memory Protection Unit)`
15* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
16* :abbr:`PWM (Pulse Width Modulation)`
17* RADIO (Bluetooth Low Energy and 802.15.4)
18* :abbr:`RTC (nRF RTC System Clock)`
19* Segger RTT (RTT Console)
20* :abbr:`SPI (Serial Peripheral Interface)`
21* :abbr:`UART (Universal asynchronous receiver-transmitter)`
22* :abbr:`USB (Universal Serial Bus)`
23* :abbr:`WDT (Watchdog Timer)`
24
25More information about the board can be found at the `MDBT50Q-DB-40 website`_.
26The `MDBT50Q-DB-40 Specification`_ contains the demo board's datasheet.
27The `MDBT50Q-DB-40 Schematic`_ contains the demo board's schematic.
28
29Hardware
30********
31- Module Demo Board build by MDBT50Q-1MV2
32- Nordic nRF52840 SoC Solution Version: 2
33- A recommnded 3rd-party module by Nordic Semiconductor.
34- BT5.2&BT5.1&BT5 Bluetooth Specification Cerified
35- Supports BT5 Long Range Features
36- Cerifications: FCC, IC, CE, Telec(MIC), KC, SRRC, NCC, RCM, WPC
37- 32-bit ARM® Cortex™ M4F CPU
38- 1MB Flash Memory/256kB RAM
39- RoHs & Reach Compiant.
40- 48 GPIO
41- Chip Antenna
42- Interfaces: SPI, UART, I2C, I2S, PWM, ADC, NFC, and USB
43- Highly flexible multiprotocol SoC ideally suited for Bluetooth® Low Energy, ANT+, Zigbee, Thread (802.15.4) ultra low-power wireless applications.
44- 3 User LEDs
45- 4 User buttons
46- 1 Mini USB connector for power supply and USB communication
47- SWD connector for FW programing
48- J-Link interface for FW programing
49- UART interface for UART communication
50
51Supported Features
52==================
53
54The raytac_mdbt50q_db_40/nrf52840 board configuration supports the following
55hardware features:
56
57+-----------+------------+----------------------+
58| Interface | Controller | Driver/Component     |
59+===========+============+======================+
60| ADC       | on-chip    | adc                  |
61+-----------+------------+----------------------+
62| CLOCK     | on-chip    | clock_control        |
63+-----------+------------+----------------------+
64| FLASH     | on-chip    | flash                |
65+-----------+------------+----------------------+
66| GPIO      | on-chip    | gpio                 |
67+-----------+------------+----------------------+
68| I2C(M)    | on-chip    | i2c                  |
69+-----------+------------+----------------------+
70| MPU       | on-chip    | arch/arm             |
71+-----------+------------+----------------------+
72| NVIC      | on-chip    | arch/arm             |
73+-----------+------------+----------------------+
74| PWM       | on-chip    | pwm                  |
75+-----------+------------+----------------------+
76| RADIO     | on-chip    | Bluetooth,           |
77|           |            | ieee802154           |
78+-----------+------------+----------------------+
79| RTC       | on-chip    | system clock         |
80+-----------+------------+----------------------+
81| RTT       | Segger     | console              |
82+-----------+------------+----------------------+
83| SPI(M/S)  | on-chip    | spi                  |
84+-----------+------------+----------------------+
85| QSPI(M)   | on-chip    | qspi                 |
86+-----------+------------+----------------------+
87| UART      | on-chip    | serial               |
88+-----------+------------+----------------------+
89| USB       | on-chip    | usb                  |
90+-----------+------------+----------------------+
91| WDT       | on-chip    | watchdog             |
92+-----------+------------+----------------------+
93
94Other hardware features have not been enabled yet for this board.
95See `MDBT50Q-DB-40 website`_ and `MDBT50Q-DB-40 Specification`_
96for a complete list of Raytac MDBT50Q-DB-40 board hardware features.
97
98Connections and IOs
99===================
100
101LED
102---
103
104* LED1 (green) = P0.13
105* LED2 (red) = P0.14
106* LED3 (blue) = P0.15
107
108Push buttons
109------------
110
111* BUTTON1 = SW1 = P0.11
112* BUTTON2 = SW2 = P0.12
113* BUTTON3 = SW3 = P0.24
114* BUTTON4 = SW4 = P0.25
115
116UART
117----
118* RXD = P0.08
119* TXD = P0.06
120* RTS = P0.05
121* CTS = P0.07
122
123Programming and Debugging
124*************************
125
126Applications for the ``raytac_mdbt50q_db_40/nrf52840`` board configuration can be
127built, flashed, and debugged in the usual way. See :ref:`build_an_application` and
128:ref:`application_run` for more details on building and running.
129
130.. note::
131   Flashing and Debugging Zephyr onto the raytac_mdbt50q_db_40/nrf52840 board
132   requires an	external J-Link programmer. The programmer is attached to the J1
133   or J9 SWD connector.
134
135Flashing
136========
137
138Follow the instructions in the :ref:`nordic_segger` page to install
139and configure all the necessary software. Further information can be
140found in :ref:`nordic_segger_flashing`. Then build and flash
141applications as usual (see :ref:`build_an_application` and
142:ref:`application_run` for more details).
143
144Here is an example for the :zephyr:code-sample:`hello_world` application.
145
146Use a USB to TTL converter to connect the computer and raytac_mdbt50q_db_40/nrf52840
147J10 connector. Then run your favorite terminal program to listen for output.
148
149.. code-block:: console
150
151   $ minicom -D <tty_device> -b 115200
152
153Replace :code:`<tty_device>` with the port where the USB to TTL converter
154can be found. For example, under Linux, :code:`/dev/ttyUSB0`.
155
156Then build and flash the application in the usual way.
157
158.. zephyr-app-commands::
159   :zephyr-app: samples/hello_world
160   :board: raytac_mdbt50q_db_40/nrf52840
161   :goals: build flash
162
163Debugging
164=========
165
166The ``raytac_mdbt50q_db_40/nrf52840`` board does not have an on-board-J-Link debug IC,
167however, instructions from the :ref:`nordic_segger` page also apply to this board.
168Use the Debug out connector of nRF52x DK to connect to the J1 connector, and use SEGGER
169J-Link OB IF to debug.
170
171Testing the LEDs and buttons in the MDBT50Q-DB-40
172*************************************************
173
174There are 2 samples that allow you to test that the buttons (switches) and LEDs on
175the board are working properly with Zephyr:
176
177.. code-block:: console
178
179   samples/basic/blinky
180   samples/basic/button
181
182You can build and flash the examples to make sure Zephyr is running correctly on
183your board. The button and LED definitions can be found in
184:zephyr_file:`boards/raytac/mdbt50q_db_40/raytac_mdbt50q_db_40_nrf52840.dts`.
185
186Selecting the pins
187==================
188
189Pins can be configured in the board pinctrl file. To see the available mappings,
190open the `MDBT50Q-DB-40 Specification`_, chapter 2.5 'Pin Assignment'.
191Select the pins marked 'General-purpose I/O'. Note that pins marked as 'low-frequency I/O
192only' can only be used in under-10KHz applications. They are not suitable for SPI, I2C,
193UART, and PWM.
194
195References
196**********
197
198.. target-notes::
199
200.. _MDBT50Q-DB-40 website:
201	https://www.raytac.com/product/ins.php?index_id=81
202.. _MDBT50Q-DB-40 Specification:
203	https://www.raytac.com/download/index.php?index_id=43
204.. _MDBT50Q-DB-40 Schematic:
205	https://www.raytac.com/upload/catalog_b/134ade06b5db3dd5803d27c5b17f22f3.jpg
206.. _J-Link Software and documentation pack:
207	https://www.segger.com/jlink-software.html
208