diff --git a/boards/arm/bt6x0/Kconfig b/boards/arm/bt6x0/Kconfig new file mode 100644 index 00000000000..7ecba6123d9 --- /dev/null +++ b/boards/arm/bt6x0/Kconfig @@ -0,0 +1,10 @@ +# BT6X0 board configuration + +# Copyright (c) 2021 Laird Connectivity +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_BT6X0 diff --git a/boards/arm/bt6x0/Kconfig.board b/boards/arm/bt6x0/Kconfig.board new file mode 100644 index 00000000000..ea37d471d45 --- /dev/null +++ b/boards/arm/bt6x0/Kconfig.board @@ -0,0 +1,8 @@ +# BT6X0 board configuration + +# Copyright (c) 2021 Laird Connectivity +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_BT6X0 + bool "BT6X0" + depends on SOC_NRF52840_QIAA diff --git a/boards/arm/bt6x0/Kconfig.defconfig b/boards/arm/bt6x0/Kconfig.defconfig new file mode 100644 index 00000000000..cc5682b747a --- /dev/null +++ b/boards/arm/bt6x0/Kconfig.defconfig @@ -0,0 +1,18 @@ +# BT6X0 Sensor configuration + +# Copyright (c) 2021 Laird Connectivity +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_BT6X0 + +config BOARD + default "bt6x0" + +config IEEE802154_NRF5 + default y + depends on IEEE802154 + +config BT_CTLR + default BT + +endif # BOARD_BT6X0 diff --git a/boards/arm/bt6x0/board.cmake b/boards/arm/bt6x0/board.cmake new file mode 100644 index 00000000000..f9e8b267728 --- /dev/null +++ b/boards/arm/bt6x0/board.cmake @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +board_runner_args(nrfjprog "--nrf-family=NRF52") +board_runner_args(jlink "--device=nrf52" "--speed=4000") +board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) +include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) diff --git a/boards/arm/bt6x0/bt6x0.dts b/boards/arm/bt6x0/bt6x0.dts new file mode 100644 index 00000000000..fdb871f1d69 --- /dev/null +++ b/boards/arm/bt6x0/bt6x0.dts @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2021 Laird Connectivity + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include + +/ { + model = "Laird BT6x0 Sensor"; + compatible = "lairdconnect,bt6x0"; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,uart-mcumgr = &uart0; + zephyr,bt-mon-uart = &uart0; + zephyr,bt-c2h-uart = &uart0; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + leds { + compatible = "gpio-leds"; + led1: led_1 { + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + label = "Red LED 1"; + }; + led2: led_2 { + gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + }; + + pwmleds { + compatible = "pwm-leds"; + + led1pwm: led_1_pwm { + pwms = <&pwm0 39>; + label = "Red PWM LED 1"; + }; + + led2pwm: led_2_pwm { + pwms = <&pwm1 35>; + label = "Green PWM LED 2"; + }; + }; + + buttons { + compatible = "gpio-keys"; + button1: button_1 { + gpios = <&gpio0 24 GPIO_PULL_UP>; + label = "Boot button switch 1 (SW1)"; + }; + button2: button_2 { + gpios = <&gpio1 1 GPIO_PULL_UP>; + label = "Tamper switch 2 (SW2)"; + }; + mag1: mag_1 { + compatible = "honeywell,sm351lt"; + gpios = <&gpio1 15 0>; + label = "SM3531LT_0"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + dinenable1: din_enable_1 { + label = "Digital Input 1 Enable"; + gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; + }; + + dinenable2: din_enable_2 { + label = "Digital Input 2 Enable"; + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + }; + + din1: din_1 { + label = "Digital Input 1"; + gpios = <&gpio0 9 GPIO_PULL_UP>; + }; + + din2: din_2 { + label = "Digital Input 2"; + gpios = <&gpio1 11 GPIO_PULL_UP>; + }; + + thermenable: therm_enable { + label = "Thermistor Inputs Enable"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + analogenable: analog_enable { + label = "Analog Inputs Enable"; + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + }; + + highsupplyenable: high_supply_enable { + label = "High Voltage Power Supply Enable"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + }; + + expanderirq: expander_irq { + label = "Port Expander Interrupt Request"; + gpios = <&gpio1 14 GPIO_PULL_UP>; + }; + + ain1: ain_1 { + label = "Analog Input 1"; + gpios = <&gpio0 2 GPIO_PULL_UP>; + }; + + ain2: ain_2 { + label = "Analog Input 2"; + gpios = <&gpio0 3 GPIO_PULL_UP>; + }; + + vref: v_ref { + label = "Voltage Reference"; + gpios = <&gpio0 29 GPIO_PULL_UP>; + }; + + expanderreset: expander_reset { + label = "Port Expander Reset"; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + }; + + batteryoutputenable: battery_output_enable { + label = "Battery Output Enable"; + gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; + }; + + do1mcu: do_1_mcu { + label = "Digital Output 1"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + + do2mcu: do_2_mcu { + label = "Digital Output 2"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + }; + + /* These aliases are provided for compatibility with samples */ + aliases { + led0 = &led1; + led1 = &led2; + led0pwm = &led1pwm; + led1pwm = &led2pwm; + sw0 = &button1; + sw1 = &button2; + sw2 = &mag1; + }; +}; + +&pwm0 { + status = "okay"; + ch0-pin = <39>; +}; + +&pwm1 { + status = "okay"; + ch0-pin = <35>; +}; + +&adc { + status = "okay"; +}; + +&gpiote { + status = "okay"; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&uart0 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + tx-pin = <6>; + rx-pin = <8>; + rts-pin = <5>; + cts-pin = <7>; +}; + +&uart1 { + compatible = "nordic,nrf-uarte"; + current-speed = <115200>; + status = "okay"; + tx-pin = <16>; + rx-pin = <14>; + rts-pin = <13>; + cts-pin = <15>; +}; + +&i2c0 { + compatible = "nordic,nrf-twi"; + status = "okay"; + sda-pin = <26>; + scl-pin = <27>; +}; + +&spi1 { + compatible = "nordic,nrf-spi"; + status = "okay"; + sck-pin = <41>; + mosi-pin = <40>; + miso-pin = <4>; + cs-gpios = <&gpio0 25 0>, + <&gpio0 31 0>; +}; + +&qspi { + status = "okay"; + sck-pin = <19>; + io-pins = <20>, <21>, <22>, <23>; + csn-pins = <17>; + mx25r64: mx25r6435f@0 { + compatible = "nordic,qspi-nor"; + reg = <0>; + writeoc = "pp4io"; + readoc = "read4io"; + sck-frequency = <8000000>; + label = "MX25R64"; + jedec-id = [c2 28 17]; + sfdp-bfp = [ + e5 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 04 bb + ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 + 10 d8 00 ff 23 72 f5 00 82 ed 04 cc 44 83 68 44 + 30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff + ]; + size = <67108864>; + has-dpd; + t-enter-dpd = <10000>; + t-exit-dpd = <35000>; + }; +}; + +&flash0 { + /* + * For more information, see: + * http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* 96K */ + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x000000000 0x00018000>; + }; + /* 896K */ + slot0_partition: partition@18000 { + label = "image-0"; + reg = <0x00018000 0x000E0000>; + }; + + /* + * The flash starting at 0x000f8000 and ending at + * 0x000fffff is reserved for use by the application. + */ + + /* + * Storage partition will be used by FCB/NVS + * if enabled. 32K + */ + storage_partition: partition@f8000 { + label = "storage"; + reg = <0x000f8000 0x00008000>; + }; + }; +}; + +&mx25r64 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* 896K */ + slot1_partition: partition@0 { + label = "image-1"; + reg = <0x0000000 0x000E0000>; + }; + /* 16K */ + scratch_partition: partition@E0000 { + label = "image-scratch"; + reg = <0x000E0000 0x00004000>; + }; + /* 112K */ + customer_partition: partition@E4000 { + label = "customer-storage"; + reg = <0x000E4000 0x0001C000>; + }; + /* 7MB */ + lfs_partition: partition@100000 { + label = "lfs_storage"; + reg = <0x00100000 0x000700000>; + }; + }; +}; diff --git a/boards/arm/bt6x0/bt6x0.yaml b/boards/arm/bt6x0/bt6x0.yaml new file mode 100644 index 00000000000..886659a8e12 --- /dev/null +++ b/boards/arm/bt6x0/bt6x0.yaml @@ -0,0 +1,22 @@ +identifier: bt6x0 +name: BT6X0 +type: mcu +arch: arm +ram: 256 +flash: 1024 +toolchain: + - zephyr + - gnuarmemb + - xtools +supported: + - adc + - ble + - gpio + - i2c + - ieee802154 + - pwm + - spi + - watchdog + - counter + - sm351lt + - qspi diff --git a/boards/arm/bt6x0/bt6x0_defconfig b/boards/arm/bt6x0/bt6x0_defconfig new file mode 100644 index 00000000000..f6b801f740a --- /dev/null +++ b/boards/arm/bt6x0/bt6x0_defconfig @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_SOC_SERIES_NRF52X=y +CONFIG_SOC_NRF52840_QIAA=y +CONFIG_BOARD_BT6X0=y + +# Enable MPU +CONFIG_ARM_MPU=y + +# enable GPIO +CONFIG_GPIO=y +CONFIG_NFCT_PINS_AS_GPIOS=y + +# enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +# additional board options +CONFIG_GPIO_AS_PINRESET=y + +# 32kHz clock source +CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y +CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y diff --git a/boards/arm/bt6x0/doc/bt6x0.rst b/boards/arm/bt6x0/doc/bt6x0.rst new file mode 100644 index 00000000000..772e29dc935 --- /dev/null +++ b/boards/arm/bt6x0/doc/bt6x0.rst @@ -0,0 +1,618 @@ +.. _bt6x0: + +Laird Connectivity Sentrius BT6x0 Sensor +######################################## + +Overview +******** + +The Sentrius™ BT6x0 Sensor is a battery powered, Bluetooth v5 Long Range +integrated sensor platform that uses a Nordic Semiconductor nRF52840 ARM +Cortex-M4F CPU. + +The sensor has the following features: + +* :abbr:`ADC (Analog to Digital Converter)` +* CLOCK +* FLASH +* :abbr:`GPIO (General Purpose Input Output)` +* :abbr:`I2C (Inter-Integrated Circuit)` +* :abbr:`MPU (Memory Protection Unit)` +* :abbr:`NVIC (Nested Vectored Interrupt Controller)` +* :abbr:`PWM (Pulse Width Modulation)` +* :abbr:`QSPI (Quad Serial Peripheral Interface)` +* RADIO (Bluetooth Low Energy and 802.15.4) +* :abbr:`RTC (nRF RTC System Clock)` +* Segger RTT (RTT Console) +* :abbr:`SPI (Serial Peripheral Interface)` +* :abbr:`UART (Universal Asynchronous Receiver-Transmitter)` +* :abbr:`WDT (Watchdog Timer)` + +.. figure:: img/bt6x0_front.jpg + :width: 500px + :align: center + :alt: Sentrius BT6x0 Sensor, front view + + Sentrius BT6x0 Sensor, front view + +.. figure:: img/bt6x0_back.jpg + :width: 500px + :align: center + :alt: Sentrius BT6x0 Sensor, rear view + + Sentrius BT6x0 Sensor, rear view + +More information about the board can be found at the +`Sentrius BT610 website`_. + +Hardware +******** + +Supported Features +================== + +The BT6x0 Sensor supports the following +hardware features: + ++-----------+------------+----------------------+ +| Interface | Controller | Driver/Component | ++===========+============+======================+ +| ADC | on-chip | adc | ++-----------+------------+----------------------+ +| CLOCK | on-chip | clock_control | ++-----------+------------+----------------------+ +| FLASH | on-chip | flash | ++-----------+------------+----------------------+ +| GPIO | on-chip | gpio | ++-----------+------------+----------------------+ +| I2C(M) | on-chip | i2c | ++-----------+------------+----------------------+ +| MPU | on-chip | arch/arm | ++-----------+------------+----------------------+ +| NVIC | on-chip | arch/arm | ++-----------+------------+----------------------+ +| PWM | on-chip | pwm | ++-----------+------------+----------------------+ +| QSPI | on-chip | qspi | ++-----------+------------+----------------------+ +| RADIO | on-chip | Bluetooth, | +| | | ieee802154 | ++-----------+------------+----------------------+ +| RTC | on-chip | system clock | ++-----------+------------+----------------------+ +| RTT | Segger | console | ++-----------+------------+----------------------+ +| SPI(M) | on-chip | spi | ++-----------+------------+----------------------+ +| UART | on-chip | serial | ++-----------+------------+----------------------+ +| WDT | on-chip | watchdog | ++-----------+------------+----------------------+ + +.. figure:: img/bt6x0_board.jpg + :width: 500px + :align: center + :alt: Sentrius BT6x0 Sensor, board layout + + Sentrius BT6x0 Sensor, board layout + +Connections and IOs +=================== + +LED +--- + +Two LEDs are visible through the BT6x0 housing lid. Note that the LEDs can be +driven either directly, or via PWM. PWM should be used when current consumption +is required to be minimised. + +* LED_1 (red) = LED0 = P1.07 (Red LED 1) +* LED_2 (green) = LED1 = P1.03 (Green LED 2) + +* LED_PWM_1 (red) = LED0PWM = P1.07 (Red PWM LED 1) +* LED_PWM_2 (green) = LED1PWM = P1.03 (Green PWM LED 2) + +Push button +------------ + +The BT6x0 incorporates three mechanical push buttons. Note these are only +accessible with the housing cover removed. + +Two of the buttons are available for use via the board DTS file, as follows. + +* BUTTON_1 = SW0 = P0.24 (Boot button SW1) +* BUTTON_2 = SW1 = P1.01 (Tamper switch SW2) + +A third mechanical push button is provided to allow reset of the on-board +microcontroller. + +Magnetoresistive sensor +----------------------- + +The BT6x0 incorporates a Honeywell SM351LT magnetoresistive sensor. Refer to +the `Honeywell SM351LT datasheet`_ for further details. + +* MAG_1 = SW2 = P1.15 (SM3531LT_0) + +External flash memory +--------------------- + +A 64Mbit external flash memory part is available for storage of application +images and data. Refer to the `Macronix MX25R6435FZNIL0 datasheet`_ for further +details. + +The flash memory is connected to the on-board QSPI device controller. + +* MX25R64 = QSPI + +Voltage reference +----------------- + +A precision 2.5V voltage reference is provided on the V_REF input for use +during AD measurements. + +This can deliver up to 50mA peak and 20mA continuous current. + + +Sensor connectivity +------------------- + +The BT6x0 incorporates three terminal blocks J5, J6 & J7 that allow +connectivity to its sensor inputs, as follows. + +Terminal Block J5 +----------------- + ++-----------+------------------------+----------------------------+-----------+ +| Pin No. | Name | Description | Direction | ++===========+========================+============================+===========+ +| 1 | EXT_SPI_CS_2 | External SPI CS 2 | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 2 | GND | GND | (N/A) | ++-----------+------------------------+----------------------------+-----------+ +| 3 | AIN4 | Analog Input 4 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 4 | AIN3 | Analog Input 3 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 5 | GND | GND | (N/A) | ++-----------+------------------------+----------------------------+-----------+ +| 6 | AIN2 | Analog Input 2 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 7 | AIN1 | Analog Input 1 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 8 | GND | GND | (N/A) | ++-----------+------------------------+----------------------------+-----------+ +| 9 | DIN2 | Digital Input 2 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 10 | DO2 | Digital Output 2 | OUT | ++-----------+------------------------+----------------------------+-----------+ + +Terminal Block J6 +----------------- + ++-----------+------------------------+----------------------------+-----------+ +| Pin No. | Name | Description | Direction | ++===========+========================+============================+===========+ +| 1 | DO1 | Digital Output 1 | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 2 | DIN1 | Digital Input 1 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 3 | GND | GND | (N/A) | ++-----------+------------------------+----------------------------+-----------+ +| 4 | THERM4 | Thermistor Input 4 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 5 | THERM3 | Thermistor Input 3 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 6 | GND | GND | (N/A) | ++-----------+------------------------+----------------------------+-----------+ +| 7 | THERM2 | Thermistor Input 2 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 8 | THERM1 | Thermistor Input 1 | IN | ++-----------+------------------------+----------------------------+-----------+ +| 9 | GND | GND | (N/A) | ++-----------+------------------------+----------------------------+-----------+ +| 10 | B+ OUT | Ext. sensor power supply | (N/A) | ++-----------+------------------------+----------------------------+-----------+ + +Terminal Block J7 +----------------- + ++-----------+------------------------+----------------------------+-----------+ +| Pin No. | Name | Description | Direction | ++===========+========================+============================+===========+ +| 1 | UART_1_RTS | UART 1 RTS | IN | ++-----------+------------------------+----------------------------+-----------+ +| 2 | UART_1_CTS | UART 1 CTS | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 3 | UART_1_RXD | UART 1 RXD | IN | ++-----------+------------------------+----------------------------+-----------+ +| 4 | UART_1_TXD | UART 1 TXD | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 5 | EXT_I2C_SCL | External I2C SCL | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 6 | EXT_I2C_SDA | External I2C SDA | IN/OUT | ++-----------+------------------------+----------------------------+-----------+ +| 7 | EXT_SPI_CLK/TRACEDATA3 | Ext. SPI CLK/TRACE DATA 3 | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 8 | EXT_SPI_MISO | External SPI MISO | IN | ++-----------+------------------------+----------------------------+-----------+ +| 9 | EXT_SPI_MOSI | External SPI MOSI | OUT | ++-----------+------------------------+----------------------------+-----------+ +| 10 | EXT_SPI_CS_1 | External SPI CS 1 | OUT | ++-----------+------------------------+----------------------------+-----------+ + +Analog inputs +------------- + +The four external Analog Inputs are multiplexed to a single host +microcontroller AD input, AIN_1, via a TI TMUX1204 multiplexer. + +Refer to the `TI TMUX1204 datasheet`_ for further details. + +Signals up to 12V, to a maximum of 50mA, can be applied to the external Analog +Inputs. + +External Analog Input connections are made to the multiplexer as follows. + ++--------------+--------------+ +| Input | MUX Input | ++==============+==============+ +| AIN1 | S1 | ++--------------+--------------+ +| AIN2 | S2 | ++--------------+--------------+ +| AIN3 | S3 | ++--------------+--------------+ +| AIN4 | S4 | ++--------------+--------------+ + +A TI TCA9538 port expander is used to determine the mode of each Analog Input, +for either voltage or current measurement, and also to control the mutliplexer. +A high level applied to the appropriate expander port pin enables the +associated analog input as a current input; when a low logic level is applied, +voltage measurement mode is selected. + +Refer to the `TI TCA9538 datasheet`_ for further details. + +The expander port connections are as follows. + ++--------------+---------------+ +| Pin | Function | ++==============+===============+ +| P0 | AIN1 mode | ++--------------+---------------+ +| P1 | AIN2 mode | ++--------------+---------------+ +| P2 | AIN3 mode | ++--------------+---------------+ +| P3 | AIN4 mode | ++--------------+---------------+ +| P4 | MUX A0 | ++--------------+---------------+ +| P5 | MUX A1 | ++--------------+---------------+ +| P6 | (N/C) | ++--------------+---------------+ +| P7 | (N/C) | ++--------------+---------------+ + +The following illustrates some possible configuration values for the port +expander. Note that it is possible for combinations of voltage and current +measurement to be applied such that some external Analog Inputs measure current +and others voltage. This is not shown below. + ++----------------+------------------------------+ +| Expander value | Selected Analog Input & mode | ++================+==============================+ +| b'00000000' | AIN1, voltage measurement | ++----------------+------------------------------+ +| b'00000001' | AIN1, current measurement | ++----------------+------------------------------+ +| b'00010000' | AIN2, voltage measurement | ++----------------+------------------------------+ +| b'00010010' | AIN2, current measurement | ++----------------+------------------------------+ +| b'00100000' | AIN3, voltage measurement | ++----------------+------------------------------+ +| b'00100100' | AIN3, current measurement | ++----------------+------------------------------+ +| b'00110000' | AIN4, voltage measurement | ++----------------+------------------------------+ +| b'00111000' | AIN4, current measurement | ++----------------+------------------------------+ + +Circuitry associated with the analog input measurements can be disabled when +not in use. + +A GPIO is used to control this behaviour, as shown below. + ++----------------+-----------+ +| ANALOG_ENABLE | Behaviour | ++================+===========+ +| 0 | Disabled | ++----------------+-----------+ +| 1 | Enabled | ++----------------+-----------+ + +Thermistor inputs +----------------- + +The four external thermistor inputs are connected to a single AD input, AIN_2, +via a TI TMUX1204 multiplexer. + +Refer to the `TI TMUX1204 datasheet`_ for further details. + +External analog input connections are made to the multiplexer as follows. + ++--------------+--------------+ +| Input | MUX Input | ++==============+==============+ +| THERM1 | S1 | ++--------------+--------------+ +| THERM2 | S2 | ++--------------+--------------+ +| THERM3 | S3 | ++--------------+--------------+ +| THERM4 | S4 | ++--------------+--------------+ + +The same port expander used to select external analog inputs is also used to +select external thermistor inputs. + +The table below defines possible values that can be written. + ++----------------+-----------------------+ +| Expander value | Selected Analog Input | ++================+=======================+ +| b'00000000' | THERM1 | ++----------------+-----------------------+ +| b'00010000' | THERM2 | ++----------------+-----------------------+ +| b'00100000' | THERM3 | ++----------------+-----------------------+ +| b'00110000' | THERM4 | ++----------------+-----------------------+ + +A GPIO line is used to enable electronics associated with thermistor +measurement. This is controlled as shown below. + ++----------------+-----------------------+ +| THERM_ENABLE | Behaviour | ++================+=======================+ +| 0 | Enabled | ++----------------+-----------------------+ +| 1 | Disabled | ++----------------+-----------------------+ + +Note the thermistor circuit must be calibrated before use. A suggested method +for achieving this is described in the +`BT610 Zephyr Application Thermistor Calibration`_ application note. + +Digital inputs +-------------- + +Two external digital inputs are available for connection to external signals. +For the digital level being applied to be detected, an appropriate output pin +must first be set. This approach is taken to ensure supporting circuitry can be +powered down when the input state is not being determined. When in use, the +external digital input level can be read from the appropriate input pin. + +The output and input pins required are as follows. + ++----------------+----------------+ +| Enable Pin | Input Read Pin | ++================+================+ +| DIN_1_ENABLE | DIN_1 | ++----------------+----------------+ +| DIN_2_ENABLE | DIN_2 | ++----------------+----------------+ + +Digital outputs +--------------- + +Two external digital outputs are available to provide signals to or to directly +drive external equipment. + +To provide a high level on the external digital output, a high logic level is +applied to the appropriate host microcontroller output. + +The output pins required are as follows. + ++----------------+--------------------------+ +| Output Pin | External Sensor Terminal | ++================+==========================+ +| DO_1_MCU | DO1 | ++----------------+--------------------------+ +| DO_2_MCU | DO2 | ++----------------+--------------------------+ + +External power supply +--------------------- + +Power can be supplied to external sensors via the B+ OUT terminal. This is +enabled by setting the BATTERY_OUTPUT_ENABLE GPIO line. In addition, the +external supply can be boosted to 5V by setting the HIGH_SUPPLY_ENABLE GPIO +line. When 5V is not selected, the external power supply follows the +battery voltage. + +Up to 50mA peak and 20mA continuous current can be delivered by the External +Power Supply. + +External sensor I2C port +------------------------ + +External I2C sensors can be connected on the external I2C port. Note that +external I2C sensors should be powered from the B+ terminal to ensure applied +voltage levels match those expected internally by the board. + +Required pins are as follows. + ++-------------+--------------------------+ +| Output Pin | External Sensor Terminal | ++=============+==========================+ +| SCL_PIN | EXT_I2C_SCL | ++-------------+--------------------------+ +| SDA_PIN | EXT_I2C_SDA | ++-------------+--------------------------+ + + +External sensor SPI port +------------------------ + +Up to 2 external SPI sensors can be connected on the external SPI port. Note +that external SPI sensors should be powered from the B+ terminal to ensure +applied voltage levels match those expected internally by the board. + +Required pins are as follows. + ++-------------+--------------------------+ +| Output Pin | External Sensor Terminal | ++=============+==========================+ +| SCK_PIN | EXT_I2C_SCL | ++-------------+--------------------------+ +| MOSI_PIN | EXT_I2C_SDA | ++-------------+--------------------------+ +| MISO_PIN | EXT_SPI_MISO | ++-------------+--------------------------+ +| SDA_PIN | EXT_I2C_SDA | ++-------------+--------------------------+ +| CS_GPIOS | EXT_I2C_SDA | ++-------------+--------------------------+ +| CS_GPIOS | EXT_I2C_SDA | ++-------------+--------------------------+ + + +Programming and Debugging +************************* + +Applications for the ``bt6x0`` board configuration can be +built and flashed in the usual way (see :ref:`build_an_application` +and :ref:`application_run` for more details); however, the standard +debugging targets are not currently available. + +The BT6x0 features a 10 way header, J3, for connection of a +programmer/debugger, with pinout as follows. + ++-----------+------------+----------------------+ +| Pin No. | Name | Description | ++===========+============+======================+ +| 1 | 3.3V | Power Supply, 3.3V | ++-----------+------------+----------------------+ +| 2 | SWDIO | Data Input/Output | ++-----------+------------+----------------------+ +| 3 | GND | GND | ++-----------+------------+----------------------+ +| 4 | SWDCLK | Clock Pin | ++-----------+------------+----------------------+ +| 5 | GND | GND | ++-----------+------------+----------------------+ +| 6 | SWO | Trace Output Pin | ++-----------+------------+----------------------+ +| 7 | (N/C) | Not Connected | ++-----------+------------+----------------------+ +| 8 | (N/C) | Not Connected | ++-----------+------------+----------------------+ +| 9 | GND | GND | ++-----------+------------+----------------------+ +| 10 | nRESET | Reset Pin | ++-----------+------------+----------------------+ + +Access to the sensor debug UART is facilitated by a 6 pin header, J1, with +pinout as follows. + ++-----------+------------+----------------------+-----------+ +| Pin No. | Name | Description | Direction | ++===========+============+======================+===========+ +| 1 | GND | GND | N/A | ++-----------+------------+----------------------+-----------+ +| 2 | UART_0_RTS | UART 0 RTS Pin | IN | ++-----------+------------+----------------------+-----------+ +| 3 | 3.3V | Power Supply, 3.3V | N/A | ++-----------+------------+----------------------+-----------+ +| 4 | UART_0_RX | UART 0 RX Pin | IN | ++-----------+------------+----------------------+-----------+ +| 5 | UART_0_TX | UART 0 TX Pin | OUT | ++-----------+------------+----------------------+-----------+ +| 6 | UART_0_CTS | UART 0 CTS Pin | OUT | ++-----------+------------+----------------------+-----------+ + +Note that pin 3 requires a solder bridge to be closed to enable powering of the +BT6x0 board via the UART connector. + +Flashing +======== + +Follow the instructions in the :ref:`nordic_segger` page to install +and configure all the necessary software. Further information can be +found in :ref:`nordic_segger_flashing`. Then build and flash +applications as usual (see :ref:`build_an_application` and +:ref:`application_run` for more details). + +Here is an example for the :ref:`hello_world` application. + +First, run your favorite terminal program to listen for output. + +NOTE: On the BT6x0, the UART lines are at TTL levels and must be passed through +an appropriate line driver circuit for translation to RS232 levels. Refer to +the `MAX3232 datasheet`_ for a suitable driver IC. + +.. code-block:: console + + $ minicom -D -b 115200 + +Replace :code:`` with the port where the BT6x0 can be found. For +example, under Linux, :code:`/dev/ttyUSB0`. + +Then build and flash the application in the usual way. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: bt6x0 + :goals: build flash + +Note that an external debugger is required to perform application flashing. + +Debugging +========= + +The ``bt6x0`` board does not have an on-board J-Link debug IC +as some nRF5x development boards, however, instructions from the +:ref:`nordic_segger` page also apply to this board, with the additional step +of connecting an external debugger. + +Testing Bluetooth on the BT6x0 +*********************************** +Many of the Bluetooth examples will work on the BT6x0. +Try them out: + +* :ref:`ble_peripheral` +* :ref:`bluetooth-eddystone-sample` +* :ref:`bluetooth-ibeacon-sample` + + +Testing the LEDs and buttons on the BT6x0 +***************************************** + +There are 2 samples that allow you to test that the buttons (switches) and LEDs +on the board are working properly with Zephyr: + +* :ref:`blinky-sample` +* :ref:`button-sample` + +You can build and flash the examples to make sure Zephyr is running correctly +on your board. The button, LED and sensor device definitions can be found in +:zephyr_file:`boards/arm/bt6x0/bt6x0.dts`. + + +References +********** + +.. target-notes:: + +.. _Sentrius BT610 website: https://www.lairdconnect.com/iot-devices/iot-sensors/sentrius-bt610-io-sensor +.. _Honeywell SM351LT datasheet: https://sensing.honeywell.com/honeywell-sensing-nanopower-series-datasheet-50095501-c-en.pdf +.. _MAX3232 datasheet: https://www.ti.com/lit/ds/symlink/max3232.pdf +.. _TI TMUX1204 datasheet: https://www.ti.com/lit/gpn/TMUX1204 +.. _TI TCA9538 datasheet: https://www.ti.com/lit/gpn/TCA9538 +.. _Macronix MX25R6435FZNIL0 datasheet: https://www.macronix.com/Lists/Datasheet/Attachments/7913/MX25R6435F,%20Wide%20Range,%2064Mb,%20v1.5.pdf +.. _BT610 Zephyr Application Thermistor Calibration: https://www.lairdconnect.com/documentation/application-note-bt610-zephyr-application-thermistor-calibration diff --git a/boards/arm/bt6x0/doc/img/bt6x0_back.jpg b/boards/arm/bt6x0/doc/img/bt6x0_back.jpg new file mode 100644 index 00000000000..ba903ec5151 Binary files /dev/null and b/boards/arm/bt6x0/doc/img/bt6x0_back.jpg differ diff --git a/boards/arm/bt6x0/doc/img/bt6x0_board.jpg b/boards/arm/bt6x0/doc/img/bt6x0_board.jpg new file mode 100644 index 00000000000..0c3d355b019 Binary files /dev/null and b/boards/arm/bt6x0/doc/img/bt6x0_board.jpg differ diff --git a/boards/arm/bt6x0/doc/img/bt6x0_front.jpg b/boards/arm/bt6x0/doc/img/bt6x0_front.jpg new file mode 100644 index 00000000000..61dad863f1e Binary files /dev/null and b/boards/arm/bt6x0/doc/img/bt6x0_front.jpg differ diff --git a/tests/drivers/adc/adc_api/src/test_adc.c b/tests/drivers/adc/adc_api/src/test_adc.c index 98cf0b04718..ea1ce0458c6 100644 --- a/tests/drivers/adc/adc_api/src/test_adc.c +++ b/tests/drivers/adc/adc_api/src/test_adc.c @@ -59,7 +59,8 @@ defined(CONFIG_BOARD_UBX_EVKANNAB1_NRF52832) || \ defined(CONFIG_BOARD_UBX_EVKNINAB1_NRF52832) || \ defined(CONFIG_BOARD_UBX_EVKNINAB3_NRF52840) || \ - defined(CONFIG_BOARD_UBX_EVKNINAB4_NRF52833) + defined(CONFIG_BOARD_UBX_EVKNINAB4_NRF52833) || \ + defined(CONFIG_BOARD_BT6X0) #include #define ADC_DEVICE_NAME DT_LABEL(DT_INST(0, nordic_nrf_saadc))