Raytac MDBT42Q

Raytac MDBT42Q

This is the Bluetooth module that we use in Puck.js and Pixl.js devices. You can buy it from us with the Espruino firmware pre-installed.

Note: We only provide support for MDBT42 modules purchased from us. Other modules won't have a bootloader installed so need connecting to a programmer in order to have firmware installed.

Features

  • Bluetooth Low Energy
  • Espruino JavaScript interpreter pre-installed
  • nRF52832 SoC - 64MHz ARM Cortex M4, 64kB RAM, 512kB Flash
  • 32 x GPIO (capable of PWM, SPI, I2C, UART) on 0.7mm Pitch, including 8 analog inputs
  • 1.7v - 3.6v voltage range
  • Built in thermometer
  • NFC tag programmable from JavaScript (when an antenna is connected)
  • Dimensions: 16mm x 10mm x 2.2mm thick

Buying

You can buy pre-programmed MDBT42Q modules direct from us

Getting Started

All you need to get the MDBT42Q working is to apply power between the VDD and GND pins. A 3v non-rechargeable lithium cell is ideal for this (LiPo batteries have a voltage that is too high and will need the voltage dropping with a diode or voltage regulator). Check the pinout below for details on where to connect power.

It is recommended to connect all the GND pins together (especially when designing a PCB) but it is not absolutely required - you can boot the MDBT42Q module with just two wires.

Once powered up follow the Puck.js Getting Started Guide for details on getting the IDE connected wirelessly. You can also use a wired connection if you prefer.

On-board peripherals

While there are no buttons or LEDs on the module, the MDBT42Q build assumes:

  • There is a button (BTN/BTN1) between pin D0 and 3.3v. Pulling this high on boot enables the bootloader.
  • There is a LED (LED/LED1) between pin D1 and GND. This is flashes at boot and also indicates bootloader mode.

Tutorials

First, it's best to check out the Puck.js Getting Started Guide

Tutorials using MDBT42Q:

  • No tutorials are available yet

Tutorials using Bluetooth LE:

Tutorials using Bluetooth LE and functionality that may not be part of the MDBT42Q module:

Pinout

Hover the mouse over a pin function for more information. Clicking in a function will tell you how to use it in Espruino.

  • Purple boxes show pins that are used for other functionality on the board. You should avoid using these unless you know that the marked device is not used.
  • ! boxes contain extra information about the pin. Hover your mouse over them to see it.
  • 3.3v boxes mark pins that are not 5v tolerant (they only take inputs from 0 - 3.3v, not 0 - 5v).
  • GND is ground (0v).
  • ADC is an Analog to Digital Converter (for reading analog voltages)
  • USART is a 2 wire peripheral for Serial Data.
3.3v D24
3.3v D23
GND
D0 3.3v BTN1
D1 3.3v LED1
D2 3.3v ADC
D3 3.3v ADC
D4 3.3v ADC
D5 3.3v ADC
D6 3.3v USART1 TX
D7 3.3v
D8 3.3v USART1 RX
D9 3.3v NFC
D10 3.3v NFC
GND
GND
3.3v D25
3.3v D26
3.3v D27
ADC 3.3v D28
ADC 3.3v D29
ADC 3.3v D30
ADC 3.3v D31
DEC4
DCC
VDD

Note: The nRF52 port has one available I2C, SPI and USART (and infinite software SPI and I2C). Unlike other Espruino boards, these peripherals can be used on any pin.

Information

MDBT42Q library

Serial Console

When power is first applied, the MDBT42Q checks if pin D8 is at 3.3v (which will be the case if it is connected to a Serial port's transmit line). If it is, it initialises the on-chip UART on D8 (MDBT42Q RX) and D6 (MDBT42Q TX) and puts the Espruino console (REPL) on it at 9600 baud.

To use it, connect to a 3.3v output USB to TTL converter as follows:

MDBT42Q USB->TTL converter
GND GND
D8 RX ( -> PC )
D6 TX ( <- PC )
3V 3.3v (Optional - to run without a battery)

You can now use the normal Espruino Web IDE, or a serial terminal application at 9600 baud.

When you connect via Bluetooth, the console will automatically move over. To stop this, execute Serial1.setConsole(true) to force the console to stay on Serial1.

Note: Serial1 is not enabled by default because it requires the high speed oscillator to stay on, which increases power draw a huge amount. If you connect the UART but don't power down and power on the MDBT42Q, you won't get a serial port.

Firmware Updates

Check out the Puck.js firmware update instructions for full details. All you need to do is apply power to your module with pin D0 connected to VDD, then release it after a second.

This will enable the bootloader mode, and you can then connect with the nRF connect app.

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.