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