RAYTAC MDBT42Q-AT-UART-M User manual

Version: C
Issued Date: 2020/04/22
User Guide
(簡易使用手冊)
產品名稱 (Product): Demo Board for MDBT42Q-ATM / PATM
產品型號 (Model No.): MDBT42Q –AT –UART –M
韌體版本 (FW Revision): 1.2

Index
1. Introduction ................................................................................................................... 3
1.1. Contents of the Set............................................................................................... 3
2. Hardware Description ................................................................................................... 4
3. Reference Circuit........................................................................................................... 6
4. Connecting for the First Time ...................................................................................... 7
5. AT Command ................................................................................................................. 8
5.1. List of supported commands................................................................................. 8
5.2. AT Command Sets................................................................................................ 9
5.3. Default Info......................................................................................................... 17
6. How to Control External MCU .................................................................................... 19
6.1. How to Send AT Commands............................................................................... 19
6.2. How to Return to Flashed Default Setting........................................................... 20
6.3. How to Start Scanning........................................................................................ 22
7. Report of Data Transmission...................................................................................... 25
8. Useful Links................................................................................................................. 27
History of Firmware Revision............................................................................................ 28
Release Note....................................................................................................................... 29

1.Introduction
This document shows how to use the demo board (MDBT42Q-AT-UART-M) to test function of
MDBT42Q-ATM & MDBT42Q-PATM.
MDBT42Q-AT-UART-M is designed for testing and debugging without building your own
board. The board is only available with MDBT42Q-ATM (chip antenna) module.
MDBT42Q-ATM will be pre-programmed with Raytac’s AT command firmware. If you don’t
need such pre-programming and is looking for nRF52832 module, please check
MDBT42Q-512KV2 and MDBT42Q-P512KV2.
Please visit our website for spec sheet of every module mentioned above.
1.1. Contents of the Set
Each set includes MDBT42Q-AT-UART-M x 1 and mini-USB cable x 1. Please contact us if
the set you receive is not complete.

2.Hardware Description
(1) MDBT42Q-ATM BLE module based on nRF52832.
(2) 32.768KHz crystal for external LF.
(3) 10uH & 15nH inductor for DC-to-DC mode.
(4) Interface to connect to external MCU.
(5) ADC input for battery detection only. Reference voltage is 0.6V.
Example:
formula: Input Voltage
(6) UART interface for data bridge or AT commands.
(7) Pairing key.

(8) Debug interface, connecting to Nordic’s nRF5X DK.
Important: Please be careful not to “erase” the module during testing. Raytac’s
AT command firmware will not be shared. You may need to send the unit to us
for re-programming when module’s FW is erased.
(9) 3.3V LDO to power up MDBT42Q-ATM.
(10) LED for status indicator
(11) USB Power only

3.Reference Circuit

4.Connecting for the First Time
Please follow instruction below to connect MDBT42Q-AT-UART-Sto MDBT42Q-AT-UART-M.
1. Make sure the distance between 2 boards is less than 30 cm.
2. Press the “pairing key” on MDBT42Q-AT-UART-Mfor over 2 seconds.
3. When seeing LED blinks like below, the connection is successful.
Connected
0.2 sec ON / 1.8 secs OFF
Note that a few criteria must be met in order to pair successfully, see 6.3 How to Start
Scanning. Try default setting if pairing was not successful.

5.AT Command
5.1. List of supported commands
- Setting of scanned device name
- Setting of scanned base UUID/service UUID/TX character/RX character
- Setting of scanned RSSI threshold
- Choose data rate of 1M bps or 2M bps on-air
- Set TX output power in 5 levels.
- Set scanning time
- Enable/disable scanning
- Set LED pattern indicating scanning or connecting status
- 7 sets of UART baud rates
- Enable/disable UART flow control
- Power-down mode for power saving and GPIO wake-up
- Support DC-to-DC and LDO power mode
- Use internal or external 32.768KHz oscillator
- Recover-to-default setting with hardware and software method
- System reset of hardware and software
- Set serial number and retrieve
- Retrieve MAC Address
- Retrieve ADC value for battery detection
- Support maximum MTU 247bytes / data payload up to maximum 244 bytes
- Enable/Disable Beacon information printed out through UART interface
(31 bytes beacon)
- Support scan Beacon company ID/UUID (31 bytes beacon)

5.2. AT Command Sets
5.2.1.“Write”Commands
No.
Command
Description
(1)
AT+NAME
Set scanned device name. Max. length of 20 characters
e.g. AT+NAME123 (device name 123, 3 characters)
(2)
AT+RESET
Set to reset system
(3)
AT+SCANOLDSTART
Set to start scanning paired device
(4)
AT+SCANNEWSTART
Set to start scanning ALL devices
(5)
AT+SCANSTOP
Set to stop scanning
(6)
AT+SLEEP
Set to get into deep sleep mode
(7)
AT+BAUDRATE9600
Set UART baud rate at 9600 bps,n,8,1
(8)
AT+BAUDRATE19200
Set UART baud rate at 19200 bps,n,8,1
(9)
AT+BAUDRATE38400
Set UART baud rate at 38400 bps,n,8,1
(10)
AT+BAUDRATE57600
Set UART baud rate at 57600 bps,n,8,1
(11)
AT+BAUDRATE115200
Set UART baud rate at 115200 bps,n,8,1
(12)
AT+BAUDRATE230400
Set UART baud rate at 230400 bps,n,8,1
(recommended enabling flow control)
(13)
AT+BAUDRATE460800
Set UART baud rate at 460800 bps,n,8,1
(recommended enabling flow control)
(14)
AT+FLOWCONTROLDIS
Disable UART flow control
(15)
AT+FLOWCONTROLEN
Enable UART flow control
(16)
AT+TXPOWER4DBM
Set RF TX power at + 4dBm
(17)
AT+TXPOWER0DBM
Set RF TX power at 0dBm
(18)
AT+TXPOWER-4DBM
Set RF TX power at - 4dBm
(19)
AT+TXPOWER-8DBM
Set RF TX power at - 8dBm
(20)
AT+TXPOWER-20DBM
Set RF TX power to - 20dBm
(21)
AT+XTALINTERNAL
Use internal RC 32.768KHZ low frequency oscillator
(22)
AT+XTALEXTERNAL
Use external crystal 32.768KHZ low frequency oscillator
(23)
AT+CONNECTINDICATORLOW
Set logic low output when connecting BT
(24)
AT+CONNECTINDICATORHIGH
Set logic high output when connecting BT

No.
Command
Description
(25)
AT+PHYMODE1MBPS
Set PHY mode at 1Mbps
(26)
AT+PHYMODE2MBPS
Set PHY mode at 2Mbps
(27)
AT+WAKEUPLOW
Set logic low at wake-up when in deep sleep
(28)
AT+WAKEUPHIGH
Set logic high at wake-up when in deep sleep
(29)
AT+IDLETIMEtttt
Set idle time (Hex)
e.g. 0x001E (min. 30secs),
0x0258 (Max. 600secs)
0x0000 (forever)
(30)
AT+SCANOLDTIMEtttt
Set time of scanning of paired device (Hex)
e.g. 0x001E (min. 30secs),
0x0258 (Max. 600secs)
0x0000 (forever)
(31)
AT+SCANNEWTIMEtttt
Set time of scanning all devices (Hex)
e.g. 0x001E (min. 30secs),
0x0258 (Max. 600secs)
0x0000 (forever)
(32)
AT+DCDCDIS
Disable DC to DC converter
(33)
AT+DCDCEN
Enable DC to DC converter
(34)
AT+CONNECTINTERVALMODE0
Set connection interval mode for Peripheral 20ms/40ms
usage (min. 20ms / Max. 75ms),
(35)
AT+CONNECTINTERVALMODE1
Set connection interval mode for Peripheral 8ms/8ms
usage (min. 8ms / Max. 8ms)
(36)
AT+IDLEPATTERNnnnnffff
Set LED idle pattern (Hex), where
n = time when LED on, f = time when LED off
e.g. 0x0064 (min. 100ms)
0x1388 (Max. 5,000ms)
0x00000000 (off)
0xFFFFFFFF (on)

No.
Command
Description
(37)
AT+CONNECTPATTERNnnnnffff
Set LED connecting pattern (Hex), where
n = time when LED on, f = time when LED off
e.g. 0x0064 (min. 100ms)
0x1388 (Max. 5,000ms)
0x00000000 (off)
0xFFFFFFFF (on)
(38)
AT+SCANOLDPATTERNnnnnffff
Set LED pattern for scanning paired device (Hex), where
n = time when LED on, f = time when LED off
e.g. 0x0064 (min. 100ms)
0x1388 (Max. 5000ms)
0x00000000 (off)
0xFFFFFFFF (on)
(39)
AT+SCANNEWPATTERNnnnnffff
Set LED pattern for scanning all devise (Hex), where
n = time when LED on, f = time when LED off
e.g. 0x0064 (min. 100ms)
0x1388 (Max. 5000ms)
0x00000000 (off)
0xFFFFFFFF (on)
(40)
AT+SERIALNOnnnnnnnn
Set serial number
e.g. AB000001, fixed 8-character length
(41)
AT+RESPONSEDIS
Disable response when sending “write” command
(42)
AT+RESPONSEEN
Enable response when sending “write” command
(43)
AT+DISCONNECT
Terminate the connection
(44)
AT+RSSITHRESHOLDnnn
Set RSSI threshold for scanning all devices (Ascii),
e.g. -69 (min.); -29 (Max.)
(45)
AT+BEACONINFODIS
Disable scanning beacon (31 bytes)
(46)
AT+BEACONINFOEN
Enable scanning beacon (31 bytes)
When AT+BEACONINFOEN is set, the device become a
BEACON SCANNER only. If you want to exchange data,
please set “AT+BEACONINFODIS”.
(47)
AT+COMPANYIDdddd
Set company ID for beacon (Hex),
e.g. 0x004C (for Apple ID)

No.
Command
Description
(48)
AT+BEACONUUID
uuuuuuuuuuuuuuuu
uuuuuuuuuuuuuuuu
Set UUID for beacon (Hex),
e.g. 0112233445566778899AABBCCDDEEFF0
(49)
AT+TXCHARACTERUUIDuuuu
Set TX character UUID for NUS (Hex),
e.g. 0x0003
(50)
AT+RXCHARACTERUUIDuuuu
Set RX character UUID for NUS (Hex),
e.g. 0x0002
(51)
AT+SERVICEUUIDuuuu
Set service UUID for NUS (Hex),
e.g. 0x0001
(52)
AT+BASEUUID
uuuuuuuuuuuuuuuu
uuuuuuuuuuuuuuuu
Set base UUID for NUS (Hex),
e.g. 9ECADC240EE5A9E093F3A3B50000406E
13th & 14th byte is reserved for service / TX character
RX character UUID, always be 0000.
(53)
AT+DEFAULT
Back to default

5.2.2.“Read”Commands
No.
Command
Description
(1)
AT?NAME
To retrieve scanned device name
(2)
AT?VERSION
To retrieve firmware version
(3)
AT?MACADDR
To retrieve IC MAC address
(4)
AT?BAUDRATE
To retrieve current UART baud rate
(5)
AT?FLOWCONTROL
To retrieve UART status of flow control
(6)
AT?TXPOWER
To retrieve RF TX power
(7)
AT?XTAL
To retrieve status of 32.768KHz oscillator
(8)
AT?CONNECTINDICATOR
To retrieve logic of pin for BT-connecting indicator
(9)
AT?PHYMODE
To retrieve status of PHY mode
(10)
AT?WAKEUP
To retrieve logic of wake-up pin
(11)
AT?IDLETIME
To retrieve idle time (Hex)
(12)
AT?SCANOLDTIME
To retrieve time of scanning paired device (Hex)
(13)
AT?SCANNEWTIME
To retrieve time of scanning all devices (Hex)
(14)
AT?DCDC
To retrieve DC to DC converter status
(15)
AT?CONNECTINTERVALMODE
To retrieve status of connection interval mode
(16)
AT?IDLEPATTERN
To retrieve LED idle pattern (Hex)
(17)
AT?CONNECTPATTERN
To retrieve LED connecting pattern (Hex)
(18)
AT?SCANOLDPATTERN
To retrieve LED pattern when scanning paired device (Hex)
(19)
AT?SCANNEWPATTERN
To retrieve LED pattern when scanning all devices (Hex)
(20)
AT?SERIALNO
To retrieve serial number
(21)
AT?ADCVALUE
To retrieve 10bit ADC value
(22)
AT?RESPONSE
To retrieve status of response
(23)
AT?RSSITHRESHOLD
To retrieve scanning new RSSI threshold value (Ascii)
(24)
AT?CONNECTRSSI
To retrieve RSSI value when in BLE connection (Ascii)
(25)
AT?BEACONINFO
To retrieve beacon information
(26)
AT?COMPANYID
To retrieve company ID value (Hex)
(27)
AT?BEACONUUID
To retrieve beacon UUID value (Hex)

No.
Command
Description
(28)
AT?TXCHARACTERUUID
To retrieve TX character UUID value (Hex)
(29)
AT?RXCHARACTERUUID
To retrieve RX character UUID value (Hex)
(30)
AT?SERVICEUUID
To retrieve service UUID value (Hex)
(31)
AT?BASEUUID
To retrieve base UUID value (Hex)
(32)
AT?ALLPARAMETERS
To retrieve value of all parameters

5.2.3.Response (Default)
No.
Command
Response
(1)
AT?NAME
Raytac AT-UART (default)
(2)
AT?VERSION
e.g. version: 1.0
(3)
AT?MACADDR
e.g. D352BDE1E414
(4)
AT?BAUDRATE
0 baudrate9600 (default)
(0 = 9600; 1 = 19200; 2 = 38400; 3 = 57600; 4 = 115200;
5 = 230400; 6 = 460800)
(5)
AT?FLOWCONTROL
0 flowcontrol dis (default)
(0 = disabled; 1 = enabled)
(6)
AT?TXPOWER
0 txpower 4dbm (default)
(0 = 4dBm; 1 = 0dBm; 2 = -4dBm; 3 = -8dBm, 4 = -20dBm)
(7)
AT?XTAL
0 xtal internal (default)
(0 = internal; 1 = external, and XTAL = 32.768KHz oscillator)
(8)
AT?CONNECTINDICATOR
0 connect indicator low (default)
(0 = output low; 1 = output high)
(9)
AT?PHYMODE
0 PHY mode 1Mbps (default)
(0 = 1Mbps; 1 = 2Mbps)
(10)
AT?WAKEUP
0 wakeup low (default)
(0 = low active; 1 = high active)
(11)
AT?IDLETIME
0000 (default: Hex, forever idle with no timeout,
tttt: 0x0000)
(12)
AT?SCANOLDTIME
0000 (default: Hex, forever scanning paired device
with no timeout, tttt: 0x0000)
(13)
AT?SCANNEWTIME
0000 default: Hex, forever scanning ALL devices
with no timeout, tttt: 0x0000)
(14)
AT?DCDC
0 dcdc dis (default)
(0 = disabled; 1 = enabled)

No.
Command
Response
(15)
AT?CONNECTINTERVALMODE
0 connect interval mode 0 (default)
(0 = connection interval for Peripheral 20ms/40ms usage
1 = connection interval for Peripheral 8ms/8ms usage)
(16)
AT?IDLEPATTERN
00640f3c (default: Hex, 0.1sec on / 3.9sec off,
nnnn: 0x0064, ffff: 0x0f3c)
(17)
AT?CONNECTPATTERN
00c80708 (default: Hex, 0.2sec on / 1.8sec off,
nnnn: 0x00c8, ffff: 0x0708)
(18)
AT?SCANOLDPATTERN
03e803e8 (default: Hex, 1sec on / 1sec off,
nnnn: 0x03e8, ffff: 0x03e8)
(19)
AT?SCANNEWPATTERN
00640064 (default: Hex, 0.1sec on / 0.1sec off,
nnnn: 0x0064, ffff: 0x0064)
(20)
AT?SERIALNO
Display “ no data! ” string (default)
(21)
AT?ADCVALUE
Value varies from input voltage
(22)
AT?RESPONSE
1 response en (default)
(0 = disable response; 1 = enable response)
(23)
AT?RSSITHRESHOLD
-51 (default: Ascii, nnn: -51)
(24)
AT?BEACONINFO
0 beaconinfo dis (default)
(0 = disable print beacon info.; 1 = enable print beacon info.)
(25)
AT?COMPANYID
004C (default: Hex, dddd: 0x004C)
(26)
AT?BEACONUUID
0112233445566778899AABBCCDDEEFF0
(default: Hex, uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu:
0x0112233445566778899AABBCCDDEEFF0)
(27)
AT?TXCHARACTERUUID
0003 (default: Hex, uuuu: 0x0003)
(28)
AT?RXCHARACTERUUID
0002 (default: Hex, uuuu: 0x0002)
(29)
AT?SERVICEUUID
0001 (default: Hex, uuuu: 0x0001)
(30)
AT?BASEUUID
9ECADC240EE5A9E093F3A3B50000406E
(default: Hex, uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu:
0x9ECADC240EE5A9E093F3A3B50000406E)
(31)
AT?ALLPARAMETERS
Display value of all parameters, separated by "0x0d0x0a"

5.3. Default Info
No.
Description
Default
(1)
Scanned device name
Raytac AT-UART
(2)
Base UUID
0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0,
0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E
(3)
Service UUID
0x0001
TX characteristic: 0x0003; RX characteristic: 0x0002
(4)
Baud rate
9600bps,n,8,1
(5)
Status of flow control
Disabled
(6)
RF TX power
+4dBm
(7)
32.768Khz oscillator
Using internal RC with 1,000ms calibration time
(8)
Logic of BT connecting indicator
Output set as logic low when BT is connecting
(9)
PHY mode
1Mbps
(10)
Logic of wake-up pin
Set logic low to wake up in deep sleep
(11)
Idle time
Forever idle with no timeout
(12)
Time of scanning paired device
Forever scanning for paired device with no timeout
(13)
Time of scanning all devices
Forever scanning for all devices with no timeout
(14)
Status of DC-to-DC converter
Disabled
(15)
Connection interval mode
Set at min. 20ms and Max. 75ms for Peripheral
20ms/40ms usage
(16)
Idle LED pattern
0.1sec on / 3.9sec off
(17)
Connecting LED pattern
0.2sec on / 1.8secs off
(18)
LED pattern for scanning
paired device
1sec on / 1sec off
(19)
LED pattern for scanning
all devices
0.1sec on / 0.1sec off
(20)
Serial number
Display “ no data! ” string
(21)
ADC value
Value varies from input voltage between
0x0000 ~ 0x03FF (Hex).
(22)
State of response
Enabled

No.
Description
Default
(23)
Scanning new RSSI threshold
-51 (Ascii).
(24)
Beacon UUID
0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
0x89, 0x9A, 0xAB, 0xBC, 0xCD, 0xDE, 0xEF, 0xF0
(25)
Company ID
0x004C

6.How to Control External MCU
6.1. How to Send AT Commands
⚫When BT is NOT connected (for all commands)
1. Output low to P0.10 (UART PD pin) to enable UART interface. Please keep it enabling
during the whole time when sendingAT commands.
2. Send any AT commands you want.
3. Send command “ AT+RESET ” to save all your settings.
4. Output high or NC to P0.10 (UART PD pin) to turn off UART interface.
⚫When BT is connected (for AT?ADCVALUE, AT+DISCONNECT,
AT?CONNECTRSSI, AT+SCANNEWSTART and AT+SLEEP only)
1. Output low to P0.11 (flash default pin) to enable receivingAT commands when BT is
connected. Please keep it low during the whole time when sending AT commands.
2. Send “AT?ADCVALUE” or “AT+DISCONNECT” or “AT?CONNECTRSSI” or
“AT+SCANNEWSTART” or“AT+SLEEP”.
3. Output high or NC to P0.11 (flash default pin) to disable receiving AT commands when
BT is connected.

6.2. How to Return to Flashed Default Setting
* Only when BT is NOT connected *
* Note that default baud rate is “9600bps,n,8,1”. For other default, please
check “ 5.3 Default Info”
⚫Use Hardware Method
1. Read P0.03 (indicator pin) first to check if BT is NOT in connection.
2. Output a low pulse to P0.11 (flash default pin), then system will return to default setting.
⚫Use Software method
1. Output low to P0.10 (UART PD pin) to enable UART interface. Please keep in enabling
during the whole time when sendingAT commands.
2. Send command “ AT+DEFAULT ”, then system will return to default setting.
Table of contents
Other RAYTAC Motherboard manuals