1.. zephyr:board:: bt610
2
3Overview
4********
5
6The Sentrius™ BT610 Sensor is a battery powered, Bluetooth v5 Long Range
7integrated sensor platform that uses a Nordic Semiconductor nRF52840 ARM
8Cortex-M4F CPU.
9
10The sensor has the following features:
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* :abbr:`QSPI (Quad Serial Peripheral Interface)`
21* RADIO (Bluetooth Low Energy and 802.15.4)
22* :abbr:`RTC (nRF RTC System Clock)`
23* Segger RTT (RTT Console)
24* :abbr:`SPI (Serial Peripheral Interface)`
25* :abbr:`UART (Universal Asynchronous Receiver-Transmitter)`
26* :abbr:`WDT (Watchdog Timer)`
27
28.. figure:: img/bt610_back.jpg
29     :align: center
30     :alt: Sentrius BT610 Sensor, rear view
31
32     Sentrius BT610 Sensor, rear view
33
34More information about the board can be found at the
35`Sentrius BT610 website`_.
36
37Hardware
38********
39
40Supported Features
41==================
42
43The BT610 Sensor supports the following
44hardware features:
45
46+-----------+------------+----------------------+
47| Interface | Controller | Driver/Component     |
48+===========+============+======================+
49| ADC       | on-chip    | adc                  |
50+-----------+------------+----------------------+
51| CLOCK     | on-chip    | clock_control        |
52+-----------+------------+----------------------+
53| FLASH     | on-chip    | flash                |
54+-----------+------------+----------------------+
55| GPIO      | on-chip    | gpio                 |
56+-----------+------------+----------------------+
57| I2C(M)    | on-chip    | i2c                  |
58+-----------+------------+----------------------+
59| MPU       | on-chip    | arch/arm             |
60+-----------+------------+----------------------+
61| NVIC      | on-chip    | arch/arm             |
62+-----------+------------+----------------------+
63| PWM       | on-chip    | pwm                  |
64+-----------+------------+----------------------+
65| QSPI      | on-chip    | qspi                 |
66+-----------+------------+----------------------+
67| RADIO     | on-chip    | Bluetooth,           |
68|           |            | ieee802154           |
69+-----------+------------+----------------------+
70| RTC       | on-chip    | system clock         |
71+-----------+------------+----------------------+
72| RTT       | Segger     | console              |
73+-----------+------------+----------------------+
74| SPI(M)    | on-chip    | spi                  |
75+-----------+------------+----------------------+
76| UART      | on-chip    | serial               |
77+-----------+------------+----------------------+
78| WDT       | on-chip    | watchdog             |
79+-----------+------------+----------------------+
80
81.. figure:: img/bt610_board.jpg
82     :align: center
83     :alt: Sentrius BT610 Sensor, board layout
84
85     Sentrius BT610 Sensor, board layout
86
87Connections and IOs
88===================
89
90LED
91---
92
93Two LEDs are visible through the BT610 housing lid. Note that the LEDs can be
94driven either directly, or via PWM. PWM should be used when current consumption
95is required to be minimised.
96
97* LED_1 (red) = LED0 = P1.07 (Red LED 1)
98* LED_2 (green) = LED1 = P1.03 (Green LED 2)
99
100* LED_PWM_1 (red) = LED0PWM = P1.07 (Red PWM LED 1)
101* LED_PWM_2 (green) = LED1PWM = P1.03 (Green PWM LED 2)
102
103Push button
104------------
105
106The BT610 incorporates three mechanical push buttons. Note these are only
107accessible with the housing cover removed.
108
109Two of the buttons are available for use via the board DTS file, as follows.
110
111* BUTTON_1 = SW0 = P0.24 (Boot button SW1)
112* BUTTON_2 = SW1 = P1.01 (Tamper switch SW2)
113
114A third mechanical push button is provided to allow reset of the on-board
115microcontroller.
116
117Magnetoresistive sensor
118-----------------------
119
120The BT610 incorporates a Honeywell SM351LT magnetoresistive sensor. Refer to
121the `Honeywell SM351LT datasheet`_ for further details.
122
123* MAG_1 = SW2 = P1.15 (SM3531LT_0)
124
125External flash memory
126---------------------
127
128A 64Mbit external flash memory part is available for storage of application
129images and data. Refer to the `Macronix MX25R6435FZNIL0 datasheet`_ for further
130details.
131
132The flash memory is connected to the on-board QSPI device controller.
133
134* MX25R64 = QSPI
135
136Voltage reference
137-----------------
138
139A precision 2.5V voltage reference is provided on the V_REF input for use
140during AD measurements.
141
142This can deliver up to 50mA peak and 20mA continuous current.
143
144
145Sensor connectivity
146-------------------
147
148The BT610 incorporates three terminal blocks J5, J6 & J7 that allow
149connectivity to its sensor inputs, as follows.
150
151Terminal Block J5
152-----------------
153
154+-----------+------------------------+----------------------------+-----------+
155| Pin No.   | Name                   | Description                | Direction |
156+===========+========================+============================+===========+
157| 1         | EXT_SPI_CS_2           | External SPI CS 2          | OUT       |
158+-----------+------------------------+----------------------------+-----------+
159| 2         | GND                    | GND                        | (N/A)     |
160+-----------+------------------------+----------------------------+-----------+
161| 3         | AIN4                   | Analog Input 4             | IN        |
162+-----------+------------------------+----------------------------+-----------+
163| 4         | AIN3                   | Analog Input 3             | IN        |
164+-----------+------------------------+----------------------------+-----------+
165| 5         | GND                    | GND                        | (N/A)     |
166+-----------+------------------------+----------------------------+-----------+
167| 6         | AIN2                   | Analog Input 2             | IN        |
168+-----------+------------------------+----------------------------+-----------+
169| 7         | AIN1                   | Analog Input 1             | IN        |
170+-----------+------------------------+----------------------------+-----------+
171| 8         | GND                    | GND                        | (N/A)     |
172+-----------+------------------------+----------------------------+-----------+
173| 9         | DIN2                   | Digital Input 2            | IN        |
174+-----------+------------------------+----------------------------+-----------+
175| 10        | DO2                    | Digital Output 2           | OUT       |
176+-----------+------------------------+----------------------------+-----------+
177
178Terminal Block J6
179-----------------
180
181+-----------+------------------------+----------------------------+-----------+
182| Pin No.   | Name                   | Description                | Direction |
183+===========+========================+============================+===========+
184| 1         | DO1                    | Digital Output 1           | OUT       |
185+-----------+------------------------+----------------------------+-----------+
186| 2         | DIN1                   | Digital Input 1            | IN        |
187+-----------+------------------------+----------------------------+-----------+
188| 3         | GND                    | GND                        | (N/A)     |
189+-----------+------------------------+----------------------------+-----------+
190| 4         | THERM4                 | Thermistor Input 4         | IN        |
191+-----------+------------------------+----------------------------+-----------+
192| 5         | THERM3                 | Thermistor Input 3         | IN        |
193+-----------+------------------------+----------------------------+-----------+
194| 6         | GND                    | GND                        | (N/A)     |
195+-----------+------------------------+----------------------------+-----------+
196| 7         | THERM2                 | Thermistor Input 2         | IN        |
197+-----------+------------------------+----------------------------+-----------+
198| 8         | THERM1                 | Thermistor Input 1         | IN        |
199+-----------+------------------------+----------------------------+-----------+
200| 9         | GND                    | GND                        | (N/A)     |
201+-----------+------------------------+----------------------------+-----------+
202| 10        | B+ OUT                 | Ext. sensor power supply   | (N/A)     |
203+-----------+------------------------+----------------------------+-----------+
204
205Terminal Block J7
206-----------------
207
208+-----------+------------------------+----------------------------+-----------+
209| Pin No.   | Name                   | Description                | Direction |
210+===========+========================+============================+===========+
211| 1         | UART_1_RTS             | UART 1 RTS                 | IN        |
212+-----------+------------------------+----------------------------+-----------+
213| 2         | UART_1_CTS             | UART 1 CTS                 | OUT       |
214+-----------+------------------------+----------------------------+-----------+
215| 3         | UART_1_RXD             | UART 1 RXD                 | IN        |
216+-----------+------------------------+----------------------------+-----------+
217| 4         | UART_1_TXD             | UART 1 TXD                 | OUT       |
218+-----------+------------------------+----------------------------+-----------+
219| 5         | EXT_I2C_SCL            | External I2C SCL           | OUT       |
220+-----------+------------------------+----------------------------+-----------+
221| 6         | EXT_I2C_SDA            | External I2C SDA           | IN/OUT    |
222+-----------+------------------------+----------------------------+-----------+
223| 7         | EXT_SPI_CLK/TRACEDATA3 | Ext. SPI CLK/TRACE DATA 3  | OUT       |
224+-----------+------------------------+----------------------------+-----------+
225| 8         | EXT_SPI_MISO           | External SPI MISO          | IN        |
226+-----------+------------------------+----------------------------+-----------+
227| 9         | EXT_SPI_MOSI           | External SPI MOSI          | OUT       |
228+-----------+------------------------+----------------------------+-----------+
229| 10        | EXT_SPI_CS_1           | External SPI CS 1          | OUT       |
230+-----------+------------------------+----------------------------+-----------+
231
232Analog inputs
233-------------
234
235The four external Analog Inputs are multiplexed to a single host
236microcontroller AD input, AIN_1, via a TI TMUX1204 multiplexer.
237
238Refer to the `TI TMUX1204 datasheet`_ for further details.
239
240Signals up to 12V, to a maximum of 50mA, can be applied to the external Analog
241Inputs.
242
243External Analog Input connections are made to the multiplexer as follows.
244
245+--------------+--------------+
246| Input        | MUX Input    |
247+==============+==============+
248| AIN1         | S1           |
249+--------------+--------------+
250| AIN2         | S2           |
251+--------------+--------------+
252| AIN3         | S3           |
253+--------------+--------------+
254| AIN4         | S4           |
255+--------------+--------------+
256
257A TI TCA9538 port expander is used to determine the mode of each Analog Input,
258for either voltage or current measurement, and also to control the mutliplexer.
259A high level applied to the appropriate expander port pin enables the
260associated analog input as a current input; when a low logic level is applied,
261voltage measurement mode is selected.
262
263Refer to the `TI TCA9538 datasheet`_ for further details.
264
265The expander port connections are as follows.
266
267+--------------+---------------+
268| Pin          | Function      |
269+==============+===============+
270| P0           | AIN1 mode     |
271+--------------+---------------+
272| P1           | AIN2 mode     |
273+--------------+---------------+
274| P2           | AIN3 mode     |
275+--------------+---------------+
276| P3           | AIN4 mode     |
277+--------------+---------------+
278| P4           | MUX A0        |
279+--------------+---------------+
280| P5           | MUX A1        |
281+--------------+---------------+
282| P6           | (N/C)         |
283+--------------+---------------+
284| P7           | (N/C)         |
285+--------------+---------------+
286
287The following illustrates some possible configuration values for the port
288expander. Note that it is possible for combinations of voltage and current
289measurement to be applied such that some external Analog Inputs measure current
290and others voltage. This is not shown below.
291
292+----------------+------------------------------+
293| Expander value | Selected Analog Input & mode |
294+================+==============================+
295| b'00000000'    | AIN1, voltage measurement    |
296+----------------+------------------------------+
297| b'00000001'    | AIN1, current measurement    |
298+----------------+------------------------------+
299| b'00010000'    | AIN2, voltage measurement    |
300+----------------+------------------------------+
301| b'00010010'    | AIN2, current measurement    |
302+----------------+------------------------------+
303| b'00100000'    | AIN3, voltage measurement    |
304+----------------+------------------------------+
305| b'00100100'    | AIN3, current measurement    |
306+----------------+------------------------------+
307| b'00110000'    | AIN4, voltage measurement    |
308+----------------+------------------------------+
309| b'00111000'    | AIN4, current measurement    |
310+----------------+------------------------------+
311
312Circuitry associated with the analog input measurements can be disabled when
313not in use.
314
315A GPIO is used to control this behaviour, as shown below.
316
317+----------------+-----------+
318| ANALOG_ENABLE  | Behaviour |
319+================+===========+
320| 0              | Disabled  |
321+----------------+-----------+
322| 1              | Enabled   |
323+----------------+-----------+
324
325Thermistor inputs
326-----------------
327
328The four external thermistor inputs are connected to a single AD input, AIN_2,
329via a TI TMUX1204 multiplexer.
330
331Refer to the `TI TMUX1204 datasheet`_ for further details.
332
333External analog input connections are made to the multiplexer as follows.
334
335+--------------+--------------+
336| Input        | MUX Input    |
337+==============+==============+
338| THERM1       | S1           |
339+--------------+--------------+
340| THERM2       | S2           |
341+--------------+--------------+
342| THERM3       | S3           |
343+--------------+--------------+
344| THERM4       | S4           |
345+--------------+--------------+
346
347The same port expander used to select external analog inputs is also used to
348select external thermistor inputs.
349
350The table below defines possible values that can be written.
351
352+----------------+-----------------------+
353| Expander value | Selected Analog Input |
354+================+=======================+
355| b'00000000'    | THERM1                |
356+----------------+-----------------------+
357| b'00010000'    | THERM2                |
358+----------------+-----------------------+
359| b'00100000'    | THERM3                |
360+----------------+-----------------------+
361| b'00110000'    | THERM4                |
362+----------------+-----------------------+
363
364A GPIO line is used to enable electronics associated with thermistor
365measurement. This is controlled as shown below.
366
367+----------------+-----------------------+
368| THERM_ENABLE   | Behaviour             |
369+================+=======================+
370| 0              | Enabled               |
371+----------------+-----------------------+
372| 1              | Disabled              |
373+----------------+-----------------------+
374
375Note the thermistor circuit must be calibrated before use. A suggested method
376for achieving this is described in the
377`BT610 Zephyr Application Thermistor Calibration`_ application note.
378
379Digital inputs
380--------------
381
382Two external digital inputs are available for connection to external signals.
383For the digital level being applied to be detected, an appropriate output pin
384must first be set. This approach is taken to ensure supporting circuitry can be
385powered down when the input state is not being determined. When in use, the
386external digital input level can be read from the appropriate input pin.
387
388The output and input pins required are as follows.
389
390+----------------+----------------+
391| Enable Pin     | Input Read Pin |
392+================+================+
393| DIN_1_ENABLE   | DIN_1          |
394+----------------+----------------+
395| DIN_2_ENABLE   | DIN_2          |
396+----------------+----------------+
397
398Digital outputs
399---------------
400
401Two external digital outputs are available to provide signals to or to directly
402drive external equipment.
403
404To provide a high level on the external digital output, a high logic level is
405applied to the appropriate host microcontroller output.
406
407The output pins required are as follows.
408
409+----------------+--------------------------+
410| Output Pin     | External Sensor Terminal |
411+================+==========================+
412| DO_1_MCU       | DO1                      |
413+----------------+--------------------------+
414| DO_2_MCU       | DO2                      |
415+----------------+--------------------------+
416
417External power supply
418---------------------
419
420Power can be supplied to external sensors via the B+ OUT terminal. This is
421enabled by setting the BATTERY_OUTPUT_ENABLE GPIO line. In addition, the
422external supply can be boosted to 5V by setting the HIGH_SUPPLY_ENABLE GPIO
423line. When 5V is not selected, the external power supply follows the
424battery voltage.
425
426Up to 50mA peak and 20mA continuous current can be delivered by the External
427Power Supply.
428
429External sensor I2C port
430------------------------
431
432External I2C sensors can be connected on the external I2C port. Note that
433external I2C sensors should be powered from the B+ terminal to ensure applied
434voltage levels match those expected internally by the board.
435
436Required pins are as follows.
437
438+-------------+--------------------------+
439| Output Pin  | External Sensor Terminal |
440+=============+==========================+
441| SCL_PIN     | EXT_I2C_SCL              |
442+-------------+--------------------------+
443| SDA_PIN     | EXT_I2C_SDA              |
444+-------------+--------------------------+
445
446
447External sensor SPI port
448------------------------
449
450Up to 2 external SPI sensors can be connected on the external SPI port. Note
451that external SPI sensors should be powered from the B+ terminal to ensure
452applied voltage levels match those expected internally by the board.
453
454Required pins are as follows.
455
456+-------------+--------------------------+
457| Output Pin  | External Sensor Terminal |
458+=============+==========================+
459| SCK_PIN     | EXT_I2C_SCL              |
460+-------------+--------------------------+
461| MOSI_PIN    | EXT_I2C_SDA              |
462+-------------+--------------------------+
463| MISO_PIN    | EXT_SPI_MISO             |
464+-------------+--------------------------+
465| SDA_PIN     | EXT_I2C_SDA              |
466+-------------+--------------------------+
467| CS_GPIOS    | EXT_I2C_SDA              |
468+-------------+--------------------------+
469| CS_GPIOS    | EXT_I2C_SDA              |
470+-------------+--------------------------+
471
472
473Programming and Debugging
474*************************
475
476Applications for the ``bt610`` board configuration can be
477built and flashed in the usual way (see :ref:`build_an_application`
478and :ref:`application_run` for more details); however, the standard
479debugging targets are not currently available.
480
481The BT610 features a 10 way header, J3, for connection of a
482programmer/debugger, with pinout as follows.
483
484+-----------+------------+----------------------+
485| Pin No.   | Name       | Description          |
486+===========+============+======================+
487| 1         | 3.3V       | Power Supply, 3.3V   |
488+-----------+------------+----------------------+
489| 2         | SWDIO      | Data Input/Output    |
490+-----------+------------+----------------------+
491| 3         | GND        | GND                  |
492+-----------+------------+----------------------+
493| 4         | SWDCLK     | Clock Pin            |
494+-----------+------------+----------------------+
495| 5         | GND        | GND                  |
496+-----------+------------+----------------------+
497| 6         | SWO        | Trace Output Pin     |
498+-----------+------------+----------------------+
499| 7         | (N/C)      | Not Connected        |
500+-----------+------------+----------------------+
501| 8         | (N/C)      | Not Connected        |
502+-----------+------------+----------------------+
503| 9         | GND        | GND                  |
504+-----------+------------+----------------------+
505| 10        | nRESET     | Reset Pin            |
506+-----------+------------+----------------------+
507
508Access to the sensor debug UART is facilitated by a 6 pin header, J1, with
509pinout as follows.
510
511+-----------+------------+----------------------+-----------+
512| Pin No.   | Name       | Description          | Direction |
513+===========+============+======================+===========+
514| 1         | GND        | GND                  | N/A       |
515+-----------+------------+----------------------+-----------+
516| 2         | UART_0_RTS | UART 0 RTS Pin       | IN        |
517+-----------+------------+----------------------+-----------+
518| 3         | 3.3V       | Power Supply, 3.3V   | N/A       |
519+-----------+------------+----------------------+-----------+
520| 4         | UART_0_RX  | UART 0 RX Pin        | IN        |
521+-----------+------------+----------------------+-----------+
522| 5         | UART_0_TX  | UART 0 TX Pin        | OUT       |
523+-----------+------------+----------------------+-----------+
524| 6         | UART_0_CTS | UART 0 CTS Pin       | OUT       |
525+-----------+------------+----------------------+-----------+
526
527Note that pin 3 requires a solder bridge to be closed to enable powering of the
528BT610 board via the UART connector.
529
530Flashing
531========
532
533Follow the instructions in the :ref:`nordic_segger` page to install
534and configure all the necessary software. Further information can be
535found in :ref:`nordic_segger_flashing`. Then build and flash
536applications as usual (see :ref:`build_an_application` and
537:ref:`application_run` for more details).
538
539Here is an example for the :zephyr:code-sample:`hello_world` application.
540
541First, run your favorite terminal program to listen for output.
542
543NOTE: On the BT610, the UART lines are at TTL levels and must be passed through
544an appropriate line driver circuit for translation to RS232 levels. Refer to
545the `MAX3232 datasheet`_ for a suitable driver IC.
546
547.. code-block:: console
548
549   $ minicom -D <tty_device> -b 115200
550
551Replace :code:`<tty_device>` with the port where the BT610 can be found. For
552example, under Linux, :code:`/dev/ttyUSB0`.
553
554Then build and flash the application in the usual way.
555
556.. zephyr-app-commands::
557   :zephyr-app: samples/hello_world
558   :board: bt610
559   :goals: build flash
560
561Note that an external debugger is required to perform application flashing.
562
563Debugging
564=========
565
566The ``bt610`` board does not have an on-board J-Link debug IC
567as some nRF5x development boards, however, instructions from the
568:ref:`nordic_segger` page also apply to this board, with the additional step
569of connecting an external debugger.
570
571Testing Bluetooth on the BT610
572***********************************
573Many of the Bluetooth examples will work on the BT610.
574Try them out:
575
576* :zephyr:code-sample:`ble_peripheral`
577* :zephyr:code-sample:`bluetooth_eddystone`
578* :zephyr:code-sample:`bluetooth_ibeacon`
579
580
581Testing the LEDs and buttons on the BT610
582*****************************************
583
584There are 2 samples that allow you to test that the buttons (switches) and LEDs
585on the board are working properly with Zephyr:
586
587* :zephyr:code-sample:`blinky`
588* :zephyr:code-sample:`button`
589
590You can build and flash the examples to make sure Zephyr is running correctly
591on your board. The button, LED and sensor device definitions can be found in
592:zephyr_file:`boards/ezurio/bt610/bt610.dts`.
593
594
595References
596**********
597
598.. target-notes::
599
600.. _Sentrius BT610 website: https://www.ezurio.com/iot-devices/iot-sensors/sentrius-bt610-io-sensor
601.. _Honeywell SM351LT datasheet: https://sensing.honeywell.com/honeywell-sensing-nanopower-series-datasheet-50095501-c-en.pdf
602.. _MAX3232 datasheet: https://www.ti.com/lit/ds/symlink/max3232.pdf
603.. _TI TMUX1204 datasheet: https://www.ti.com/lit/gpn/TMUX1204
604.. _TI TCA9538 datasheet: https://www.ti.com/lit/gpn/TCA9538
605.. _Macronix MX25R6435FZNIL0 datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7913/MX25R6435F,%20Wide%20Range,%2064Mb,%20v1.5.pdf
606.. _BT610 Zephyr Application Thermistor Calibration: https://www.ezurio.com/technology/bt610-thermistor-coefficient-calculator
607