TiaC CoffeeCaller nRF52

Overview

The TiaC CoffeeCaller nRF52 board is based on the aQFN73 package of the nRF52840 chip. See the nRF52840 Product Overview [15] for a short description of the key features of the chip or the more detailed nRF52840 Product Specification [16] for all technical details.

Hardware

The board is powered by 5V via the USB-C connector and has a 3.3V/200㎃ LDO as needed by the chip and other peripherals on the board. It features 5 user buttons, 4 GPIO LEDs, WS2812 RGB Strip with 4 LEDs, 4 servo PIN headers, SHT40 temperature and humidity sensor, qwIIC Connector and a PWM buzzer. Schematics and KiCad design files can be found in the TiaC CoffeeCaller nRF52 website [2].

Features and Resources

Printed Circuit Board

5V/150㎃ 3.3V/200㎃

64㎒ 1㎆ 256㎅ USB-C UF2 SWD

RST BOOT USER WHITE RGB PASSIVE Servo Motor

TH : T H

17 5 2 1

  • Single core Arm Cortex-M4 processor running up to 64㎒

  • 256㎅ on-chip SRAM

  • 1㎆ on-chip flash with XIP capabilities

  • USB 1.1 controller (device)

  • On-board USB-C micro connector

  • On-board 3.3V LDO regulator with 200㎃

  • On-board RESET button

  • On-board BOOT button

  • On-board 4 User button

  • On-board 4 User LEDs

  • On-board 4 User RGB LED

  • On-board 1 User PWM Buzzer

  • On-board 4 User PWM Servo Motor connectors

  • 8 GPIO pins via Free pin header

  • 1 UART peripherals

  • 1 I2C controllers

  • 5 PWM channels

  • TH: temperature and humidity (SHT40 [14])

  • 1 Watchdog timer peripheral

Design Data

TiaC CoffeeCaller nRF52

Positions

Todo

Export more design notes from KiCad and show here.

Pinouts

Todo

Create a pinout for the free pin header, maybe with KiCad.

Supported Features

The TiaC CoffeeCaller nRF52 board configuration supports the following Zephyr hardware features:

Hardware Features Supported by Zephyr

Peripheral

Kconfig option

Devicetree compatible

Zephyr API

PINCTRL

CONFIG_PINCTRL

nordic,nrf-pinctrl

Pin Control API

GPIO

CONFIG_GPIO

General-Purpose Input/Output (GPIO)

UART

CONFIG_SERIAL

nordic,nrf-uarte

Universal Asynchronous Receiver-Transmitter (UART)

UDC (USB Device Controller)

CONFIG_USB_DEVICE_STACK_NEXT

nordic,nrf-usbd

USB device support APIs

RADIO (L1: GFSK / O-QPSK, L2: IEEE 802.15.4)

CONFIG_NET_L2_IEEE802154

IEEE 802.15.4

I2C

CONFIG_I2C

nordic,nrf-twi

Inter-Integrated Circuit (I2C) Bus

WS2812 (GPIO)

CONFIG_LED_STRIP

worldsemi,ws2812-gpio

N/A

PWM

CONFIG_PWM

nordic,nrf-pwm

Pulse Width Modulation (PWM)

Watchdog Timer (WDT)

CONFIG_WATCHDOG

nordic,nrf-wdt

Watchdog

Flash

CONFIG_FLASH

nordic,nrf52-flash-controller

Flash and Flash map

HWINFO

CONFIG_HWINFO

N/A

Hardware Information

CLOCK

CONFIG_CLOCK_CONTROL

Clock Control

NVIC

N/A

arm,v7m-nvic

Nested Vector Interrupts Controller

SYSTICK

N/A

arm,armv7m-systick

Other hardware features are not currently supported by Zephyr. The default configuration can be found in the different Kconfig files:

Board Configurations

The TiaC CoffeeCaller nRF52 board can be configured for the following different use cases.

west build -b coffeecaller_nrf52

Use the native USB device port with CDC-ACM as Zephyr console and for the shell.

User LED

The TiaC CoffeeCaller nRF52 board feature four white LEDs for user purposes at GPIO port 1. The LEDs are all low active.

  • LD1 (white) @ P1.06aliases { led0 = &ld1; };

  • LD2 (white) @ P1.07aliases { led1 = &ld2; };

  • LD3 (white) @ P1.02aliases { led2 = &ld3; };

  • LD4 (white) @ P1.04aliases { led3 = &ld4; };

User RGB LED

The TiaC CoffeeCaller nRF52 board feature four RGB LEDs for user purposes in strip (serial) interconnection at GPIO port 0 line 26.

  • WS2812 Strip @ P0.26aliases { led-strip = &led_strip; };

User Button

The TiaC CoffeeCaller nRF52 board feature one tactile push button for boot select purpose at GPIO port 0 line 4 and four further push buttons for user purposes at GPIO port 0 and 1. The push button are all low active.

  • BUTTON0 (big) @ P0.04aliases { sw0 = &button0; mcuboot-button0 = &button0; };

  • BUTTON1 (small) @ P0.31aliases { sw1 = &button1; };

  • BUTTON2 (small) @ P0.29aliases { sw2 = &button2; };

  • BUTTON3 (small) @ P0.03aliases { sw3 = &button3; };

  • BUTTON4 (small) @ P1.15aliases { sw4 = &button4; };

  • RESET (small)

User PWM Buzzer and Servo Motors

The TiaC CoffeeCaller nRF52 board feature two independent PWM function units with 4 channels each. The PWM0 channel 0 will be used for the on-board passive magnetic buzzer and PWM1 channel 0 to 3 are reserved for driving servo motors.

Serial Port

The TiaC CoffeeCaller nRF52 board feature one two wire UART (RxD/TxD) at USART0 acassible on the free pin header with the default settings of 115200/8N1 without any flow control (no XON/XOFF, no RTS/CTS).

  • TxD @ P0.06

  • RxD @ P0.08

USB Device Port

The TiaC CoffeeCaller nRF52 board features one (native) USB full-speed device port that can be used to communicate with a host PC. See the USB sample applications for more, such as the USB CDC ACM UART sample sample which sets up a virtual serial port that echos characters back to the host PC. This board provide the Zephyr console per default on the USB port as CDC ACM:

USB device idVendor=1915, idProduct=c0ca, bcdDevice= 4.03
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: CoffeeCaller nRF52 (CDC ACM)
Manufacturer: TiaC (Nordic Semiconductor ASA)
SerialNumber: 9D167F0C551481F7

Connections and IOs

Selecting the pins

Pins can be configured in the board pinctrl file ( boards/tiac/coffeecaller/nrf52840-pinctrl.dtsi ). To see the available mappings, open the nRF52840 Product Specification [16], chapter 7 Hardware and Layout. In the table 7.1.1 aQFN73 ball assignments select the pins marked General purpose I/O. Note that pins marked as low frequency I/O only can only be used in under-10㎑ applications. They are not suitable for 115200 speed of UART.

Laced Grove Signal Interface

The TiaC CoffeeCaller nRF52 board offers the option of connecting hardware modules via one single Qwiic/STEMMA QT (Grove connectors). This is provided by a specific interface for general signal mapping, the Laced Grove Signal Interface.

Following mappings are well known:

  • grove_gpios: GPIO mapping

  • grove_pwms: PWM mapping

This is the GPIO signal line mapping from the nRF52840 [15] to the set of Grove connectors provided as Laced Grove Signal Interface.

This list must not be stable!

phandle index to shield –>

Signal : Meaning

mini_usb_rp2040

<&grove_gpios 0 …>

not wired

<&grove_gpios 1 …>

not wired

<&grove_gpios 2 …>

not wired

<&grove_gpios 3 …>

not wired

<&grove_gpios 4 …>

not wired

<&grove_gpios 5 …>

not wired

<&grove_gpios 6 …>

not wired

<&grove_gpios 7 …>

not wired

<&grove_gpios 8 …>

not wired

<&grove_gpios 9 …>

not wired

<&grove_gpios 10 …>

not wired

<&grove_gpios 11 …>

not wired

<&grove_gpios 12 …>

not wired

<&grove_gpios 13 …>

not wired

<&grove_gpios 14 …>

not wired

<&grove_gpios 15 …>

not wired

<&grove_gpios 16 …>

P0.20: I2C-SDA (I2C0)

<&grove_d17_header 1 …>
<&gpio0 20 …>

<&grove_gpios 17 …>

P0.24: I2C-SCL (I2C0)

<&grove_d17_header 0 …>
<&gpio0 24 …>

<&grove_gpios 18 …>

not wired

<&grove_gpios 19 …>

not wired

<&grove_gpios 20 …>

not wired

<&grove_gpios 21 …>

not wired

<&grove_gpios 22 …>

not wired

<&grove_gpios 23 …>

not wired

<&grove_gpios 24 …>

not wired

<&grove_gpios 25 …>

not wired

<&grove_gpios 26 …>

not wired

<&grove_gpios 27 …>

not wired

<&grove_gpios 28 …>

not wired

<&grove_gpios 29 …>

not wired

<&grove_gpios 30 …>

not wired

<&grove_gpios 31 …>

not wired

Programming and Debugging

The TiaC CoffeeCaller nRF52 board features an UF2 based bootloader [4] to program the application by copying the build/zephyr/zephyr.uf2 file to the mounted mass storage device TiaCCoffee. If the board is powered on with the BOOTSEL button pressed (the big BUTTON0), it will appear on the host as a mass storage device:

USB device idVendor=239a, idProduct=00da, bcdDevice= 1.00
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: coffeecaller
Manufacturer: TiaC
SerialNumber: 9D167F0C551481F7

Tip

When ever you need to restore this original bootloader you should read and following the directions in Building and flashing the CoffeeCaller bootloader [5]. There is also a backup copy of the original bootloader together with a ready to use SEGGER JFlash control file inside the Bridel project:

There is also a SWD header (SWD1) on board which have to be used with tools like SEGGER JLink for bootloader restore, for programming, or direct programming and debugging.

Flashing

Using UF2

The UF2 file should be copied on command line or drag-and-dropped via UI file manager to this new mass storage device, which will flash the board.

Here is an example for the Hello World application. First, run your favorite terminal program to listen for output. Replace <tty_device> with the port where the board can be found. For example, under Linux, /dev/ttyACM0.

$ minicom -b 115200 -8 -c on -D <tty_device>

Then build and flash the application in the usual way.

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 zephyr/samples/hello_world
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Hello World! coffeecaller_nrf52/nrf52840

Debugging

The SWD interface can be used to debug the board. To achieve this, you can either use SEGGER JLink, OpenOCD or PyOCD and follow the instruction in Building, Flashing and Debugging.

You can debug an application in the usual way. Here is an example for debugging the Hello World application:

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 zephyr/samples/hello_world
west debug -r jlink -d build/coffeecaller_nrf52

Tests and Examples

Hello Shell on the USB Console (CDC/ACM)

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 bridle/samples/helloshell
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Hello World! I'm THE SHELL from coffeecaller_nrf52
uart:~$ 

Simple test execution on target

(text in bold is a command input)

More Samples

There are 3 samples that allow you to test that the push buttons and LEDs on the board are working properly with Zephyr. You can build and flash the examples to make sure Zephyr is running correctly on your board. The button and LED definitions can be found in boards/tiac/coffeecaller/coffeecaller_nrf52_nrf52840.dts.

User LED Blinky by GPIO

See also Zephyr sample: Blinky.

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 zephyr/samples/basic/blinky
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
LED state: OFF
LED state: ON
LED state: OFF
LED state: ON
LED … … …

User LED On/Off by GPIO Button

See also Zephyr sample: Button.

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 zephyr/samples/basic/button
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Set up button at gpio@50000000 pin 4
Set up LED at gpio@50000300 pin 6
Press the button
Button pressed at 834903
Button pressed at 834909
Button pressed at 875997
Button pressed at 876002
Button pressed at 917520
Button pressed at 917525
Button … … …

WS2812 LED Test Pattern over GPIO

See also Zephyr sample: LED strip.

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 zephyr/samples/drivers/led/led_strip
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
[00:00:04.013,671] <inf> main: Found LED strip device ws2812
[00:00:04.013,671] <inf> main: Displaying pattern on strip

User GPIO Button Input dump

See also Zephyr sample: Input dump.

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 zephyr/samples/subsys/input/input_dump
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Input sample started
I: input event: dev=buttons          SYN type= 1 code= 11 value=1
I: input event: dev=buttons          SYN type= 1 code= 11 value=0
I: input event: dev=buttons          SYN type= 1 code=  2 value=1
I: input event: dev=buttons          SYN type= 1 code=  2 value=0
I: input event: dev=buttons          SYN type= 1 code=  3 value=1
I: input event: dev=buttons          SYN type= 1 code=  3 value=0
I: input event: dev=buttons          SYN type= 1 code=  4 value=1
I: input event: dev=buttons          SYN type= 1 code=  4 value=0
I: input event: dev=buttons          SYN type= 1 code=  5 value=1
I: input event: dev=buttons          SYN type= 1 code=  5 value=0

Sounds from the speaker

This Bridle sample is applicable for the on-board passive magnetic buzzer connected to the PWM0 channel 0.

west build -b coffeecaller_nrf52 -p -d build/coffeecaller_nrf52 bridle/samples/buzzer
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
uart:~$ 

Simple test execution on target

  1. play a beep

  2. play a folk song

  3. play a chrismas song

    uart:~$ buzzer beep
    uart:~$ buzzer play folksong
    uart:~$ buzzer play xmastime

Drive a servo motor

TiaC CoffeeCaller nRF52 Servomotor Test

See also Zephyr sample: Servomotor.

This Zephyr sample is applicable for first on-board servo motor connector corresponding to the PWM1 channel 0.

Connect a servomotor MG996R to the first on-board PWM channel for servomotors, the 4×3 pin header block (HDR1 and HDR2).

The corresponding PWM pulse widths for a range of -90° to +90° (180°) are 500 ㎲ to 2,500 ㎲ with a period of 50 ㎐. All these servomotor specific parameters are preset by the snippet PWM Servomotor Preset Snippet (pwm-servo) that have to use to get access to this dedicated PWM channel together with the original Zephyr Servomotor sample. Invoke west build and west flash with this snipped and optional mixed with others, for example:

west build -b coffeecaller_nrf52/nrf52840 -p always -S "pwm-servo" -d build/coffeecaller_nrf52 zephyr/samples/basic/servo_motor
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Servomotor control

Grove Module Samples

All currently supported Grove modules can be reused on the Qwiic / STEMMA QT connector using a conversion cable. Only the corresponding shield stacks need to be specified.

Hello Shell with sensor access to Grove BMP280

west build -b coffeecaller_nrf52 -p --shield "grove_sens_bmp280" -d build/coffeecaller_nrf52 bridle/samples/helloshell
west flash -r uf2 -d build/coffeecaller_nrf52

Simple test execution on target

(text in bold is a command input)

BME280 humidity and pressure sensor with Grove BMP280

See also Zephyr sample: BME280 humidity and pressure sensor.

west build -b coffeecaller_nrf52 -p --shield "grove_sens_bmp280" -d build/coffeecaller_nrf52 zephyr/samples/sensor/bme280
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

[00:00:00.000,305] <dbg> temp_nrf5: temp_nrf5_sample_fetch: sample: 112
[00:00:00.000,305] <dbg> temp_nrf5: temp_nrf5_channel_get: Temperature:28,0
[00:00:00.002,838] <dbg> BME280: bme280_chip_init: ID OK (BMP280)
[00:00:00.012,084] <dbg> BME280: bme280_chip_init: "bmp280@77" OK
*** Booting Zephyr OS build v4.3.0***
Found device "bmp280@77", getting sensor data
temp: 27.319976; press: 99.58593; humidity: 0.7812
[00:00:04.032,348] <dbg> temp_nrf5: temp_nrf5_sample_fetch: sample: 112
[00:00:04.032,348] <dbg> temp_nrf5: temp_nrf5_channel_get: Temperature:28,0
temp: 27.319976; press: 99.58593; humidity: 0.7812
temp: 27.319976; press: 99.58593; humidity: 0.7812
temp: 27.319976; press: 99.58593; humidity: 0.7812
[00:00:08.032,531] <dbg> temp_nrf5: temp_nrf5_sample_fetch: sample: 109
[00:00:08.032,531] <dbg> temp_nrf5: temp_nrf5_channel_get: Temperature:27,250000
temp: 27.319976; press: 99.58593; humidity: 0.7812
temp: 27.319976; press: 99.58593; humidity: 0.7812
temp: 27.319976; press: 99.58593; humidity: 0.7812
temp: 27.319976; press: 99.58593; humidity: 0.7812
temp: 27.319976; press: 99.58593; humidity: 0.7812
… … …

LED Blinky with Grove LED Button (Qwiic signals as GPIO)

See also Zephyr sample: Blinky.

west build -b coffeecaller_nrf52 -p --shield "grove_btn_d16_inv grove_led_d17 x_grove_testbed" -d build/coffeecaller_nrf52 zephyr/samples/basic/blinky
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
LED state: OFF
LED state: ON
LED state: OFF
LED state: ON
LED … … …

LED Switch with Grove LED Button (Qwiic signals as GPIO)

See also Zephyr sample: Button.

west build -b coffeecaller_nrf52 -p --shield "grove_btn_d16_inv grove_led_d17 x_grove_testbed" -d build/coffeecaller_nrf52 zephyr/samples/basic/button
west flash -r uf2 -d build/coffeecaller_nrf52

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Set up button at gpio@50000000 pin 20
Set up LED at gpio@50000000 pin 24
Press the button
Button pressed at 914048
Button pressed at 969568
Button pressed at 976710
Button pressed at 1000039
Button pressed at 1097113
Button pressed at 1114151
Button … … …

References