# ARDUINO + D52QD2M4IA (nRF52832) - protocol help…

Hi.

I develop an application in the past with ARDUINO and a nRF24AP2 module with great success. I can read 8 heart rate monitors ANT+ sensors in the same time, with 8 differents channels.

Now I am trying to upgrade my application using a D52QD2M4IA (nRF52832) to read 15 or many sensors in the same time.

The main problem I have is a protocol issue.

According to ANT Message Protocol and Usage 5.1 I wrote an ARDUINO library to connect with nRF24AP2. It works. But not with D52QD2M4IA.

I report a protocol dump report between ARDUINO (the Host) and the ANT+ Nordic Modules:

----------------------------------------------- nRF24AP2 started

RX <<< [ A4 1 6F 0 CA ]
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 6 54 8 3 0 B2 36 0 79 ]
Canali massimi disponibili sul modulo :8
100) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 B9 A5 21 FB BD 72 C3 45 64 ] len=13
RX <<< [ A4 3 40 0 46 0 A1 ]
101) CHANNEL ASSIGN - channel #: 0 - channel type: 64 - network #: 0
TX >>> [ A4 3 42 0 40 0 A5 ] len=7
RX <<< [ A4 3 40 0 42 0 A5 ]
102) SET CHANNEL - channel #: 0 - device number: 0 - device type: 120 - transmission type: 0
TX >>> [ A4 5 51 0 0 0 78 0 88 ] len=9
RX <<< [ A4 3 40 0 51 0 B6 ]
103) SET CHANNEL FREQUENCY - channel #: 0 - frequency: 57
TX >>> [ A4 2 45 0 39 DA ] len=6
RX <<< [ A4 3 40 0 45 0 A2 ]
104) SET RX EXT MESSAGE ENABLE - enable: 1
TX >>> [ A4 2 66 0 1 C1 ] len=6
RX <<< [ A4 3 40 0 66 0 81 ]
105) OPEN SCAN MODE (CONTINUOUS)
TX >>> [ A4 1 5B 0 FE ] len=5
RX <<< [ A4 3 40 0 5B 0 BC ]
106) 106) 106) 106) 106) 106) 106

----------------------------------------------- D52QD2M4IA started

RX <<< [ A4 1 6F 1 CB ]
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 84 2A 8 4 BA 9B 0 7D 68 FE 0 0 0 0 0 0 0 54 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 66 8F 0 0 0 0 0 1 9E 5 0 0 E8 3 0 0 0 0 0 0 8 1 23 0 2 25 0 6B 0 1 1 0 1D 0 D 0 1F 0 0 10 10 A4 1 6F 1 CB A4 84 2A 8 4 BA 9B 0 7D 68 FE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
Messaggio non atteso!: 2A - Messaggio atteso era: 54
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 8 4A 8 4 BA 36 0 7D 68 FC 0 ]
Messaggio non atteso!: 4A - Messaggio atteso era: 54
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 8 4A 8 4 BA 9B 80 FD 43 FC 0 ]
Messaggio non atteso!: 4A - Messaggio atteso era: 54
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 84 AA 8 4 BA 36 0 7D 68 FE 0 0 0 0 0 0 0 54 0 1 0 1 0 0 0 4 0 0 0 1 0 0 0 0 0 0 66 8F 0 0 0 0 0 1 9E 5 0 0 E8 3 0 0 0 0 0 0 8 1 23 0 2 25 0 6B 0 1 1 0 1D 0 D 0 1F 0 0 31 31 A4 1 6F 1 CB A4 84 2A 8 4 BA 9B 0 7D 68 FE A4 8 4A 8 4 BA 36 0 7D 68 FC A4 8 4A 8 4 BA 9B 80 FD 43 FC A4 84 AA 8 4 BA 36 0 7D 68 FE 0 0 0 0 0 0 0 0 0 ]
Messaggio non atteso!: AA - Messaggio atteso era: 54
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 84 AA 8 4 BA 9B 80 FD 43 FC 0 0 0 0 0 0 0 54 0 1 0 1 0 0 0 5 0 0 0 1 0 0 0 0 0 0 66 8F 0 0 0 0 0 1 9E 5 0 0 E8 3 0 0 0 0 0 0 8 1 23 0 2 25 0 6B 0 1 1 0 1D 0 D 0 1F 0 0 3C 3C A4 1 6F 1 CB A4 84 2A 8 4 BA 9B 0 7D 68 FE A4 8 4A 8 4 BA 36 0 7D 68 FC A4 8 4A 8 4 BA 9B 80 FD 43 FC A4 84 AA 8 4 BA 36 0 7D 68 FE A4 84 AA 8 4 BA 9B 80 FD ]
Messaggio non atteso!: AA - Messaggio atteso era: 54
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 84 AA 8 4 BA 3B 0 7D 68 FC 0 0 0 0 0 0 0 54 0 1 0 1 0 0 0 6 0 0 0 1 0 0 0 0 0 0 66 8F 0 0 0 0 0 1 9E 5 0 0 E8 3 0 0 0 0 0 0 8 1 23 0 2 25 0 6B 0 1 1 0 1D 0 D 0 1F 0 0 7 7 4 BA 3B 0 7D 68 FC 2A 8 4 BA 9B 0 7D 68 FE A4 8 4A 8 4 BA 36 0 7D 68 FC A4 8 4A 8 4 BA 9B 80 FD 43 FC A4 84 AA 8 4 BA 36 0 7D 68 FE A4 84 AA 8 4 BA 9B 80 FD ]
Messaggio non atteso!: AA - Messaggio atteso era: 54
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 84 54 8 4 BA 36 0 F6 1D 8B 0 0 0 0 0 0 0 54 0 1 0 1 0 0 0 7 0 0 0 1 0 0 0 0 0 0 66 8F 0 0 0 0 0 1 9E 5 0 0 E8 3 0 0 0 0 0 0 8 1 23 0 2 25 0 6B 0 1 1 0 1D 0 D 0 1F 0 0 12 12 4 BA 3B 0 7D 68 FC A4 84 54 8 4 BA 36 0 F6 1D 8B 4A 8 4 BA 36 0 7D 68 FC A4 8 4A 8 4 BA 9B 80 FD 43 FC A4 84 AA 8 4 BA 36 0 7D 68 FE A4 84 AA 8 4 BA 9B 80 FD ]
Canali massimi disponibili sul modulo :8
100) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 B9 A5 21 FB BD 72 C3 45 64 ] len=13
RX <<< [ A4 20 0 46 0 D0 36 0 F6 1D 8B 0 0 0 0 0 0 0 40 0 1 0 1 0 0 0 8 0 0 0 1 0 0 0 0 8 ]
Messaggio non atteso!: 0 - Messaggio atteso era: 40
100) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 B9 A5 21 FB BD 72 C3 45 64 ] len=13
RX <<< [ A4 20 0 46 0 A1 36 0 F6 1D 8B 0 0 0 0 0 0 0 40 0 1 0 1 0 0 0 9 0 0 0 1 0 0 0 0 8 ]
Messaggio non atteso!: 0 - Messaggio atteso era: 40
[...]


How I can solve this problem? It seems to using extended message but also if I try to disable them the module seems to ignore it. Many thanks.

edit retag close delete

You are sending commands over UART to the nRF52? What firmware are you running on the nRF52? We don't have an example for running a serialized application with the ANT SoftDevices, only BLE. The nRF24AP2 is only a connectivity IC, while the nRF52 is not, but can be.

( 2016-09-28 10:31:44 +0100 )editconvert to answer

Thanks Petter for your response, excuse me I add an answer below, could you help me? Thanks.

( 2016-09-28 11:57:16 +0100 )editconvert to answer

Sort by » oldest newest most voted

Hi, and thanks for response... so in attach there is a picture of the D52QD2M4IA module.

I bought one of it connected like following: The wiring I used is:

H202 -> TO ARDUINO PIN FOR RESET FUNCTION
H203 -> VCC
H204 -> GND
H206 -> TO ARDUINO PIN FOR SUSPEND FUNCTION
H207 -> TO ARDUINO PIN FOR SLEEP FUNCTION
H209 -> PORTSEL TO GND (ASYNC)
H210 -> BR2 TO VCC
H211 -> UART TX TO ARDUINO RX
H212 -> UART RX TO ARDUINO TX
H213 -> BR1 TO VCC
H214 -> BR3 TO VCC
H217 -> RTS TO ARDUINO INPUT PIN

BR1-2-3 to VCC = selection of 57600bps serial UART speed


When Arduino starts it execute this routines...

// module reset
void hardwareReset() {
[... some other code ...]
digitalWrite(RESET_PIN, LOW);
delay(5);
[... some other code ...]
hw_reset_count++;
delay(5);
digitalWrite(RESET_PIN, HIGH);
[... some other code ...]
}

// **************************************************************************************************
// * ANT Management Routines
// **************************************************************************************************
void antBegin() {
pinMode(SUSPEND_PIN, OUTPUT);
pinMode(SLEEP_PIN, OUTPUT);
pinMode(RESET_PIN, OUTPUT);
pinMode(RTS_PIN, INPUT);
[... some other code ...]
digitalWrite(RESET_PIN, HIGH);
digitalWrite(SUSPEND_PIN, HIGH);
digitalWrite(SLEEP_PIN, LOW);
//This should not be strictly necessary - the device should always come up by itself....
//But let's make sure we didn't miss the first RTS in a power-up race
hardwareReset();
}


It respond me so I assume that there is a firmware that can "drive" the ANT protocol or not? I do not download any kind of software in it...

How can I solve my issues?

My needs is to read as many as HRM data and pass thought Arduino to a PC application. Could you help me? Thanks.

more

I'm sorry. You are correct. It seems they have made serialization firmware (ANT network processor application) for it. Maybe you can find something useful in tech resources here? I think you should contact Dynastream regarding application support, at thisisant.com.

( 2016-09-28 12:26:11 +0100 )editconvert to answer

I tryed to contact Dynastream but I had no so clear explanation... Here can be found the discussion ---> https://www.thisisant.com/forum/viewt... thanks

( 2016-09-28 15:07:38 +0100 )editconvert to answer

[hide preview]

## Recent blog posts

• ### Difference between nRF52840 Engineering A and B reference designs

Posted 2018-01-15 12:27:08 by Martin Børs-Lind
• ### [For Hire] Expert development services of custom Hardware devices | IoT solutions | Mobile Apps

Posted 2018-01-15 09:08:42 by Ilya Surinsky
• ### Rust bindings to nrf52 series

Posted 2018-01-12 23:23:07 by Coleman McFarland
• ### Show And Tell: Poly - Building an RC Airplane The Hard Way

Posted 2018-01-05 01:17:57 by Daniel Veilleux
• ### Bluetooth on a desktop computer (Windows, Mac, Linux)

Posted 2018-01-04 17:56:57 by kbaud

## Recent questions

• ### nrfutil, nRF Connect: Thingy52 DFU fails with message "FW version failure (Code = 5)"

Posted 2018-01-23 18:06:26 by Till
• ### nrf_sniffer_2.0.0-beta-1_51296aa/PCA10040/windows 7 not working

Posted 2018-01-23 18:03:32 by BramPeeters
• ### How send message to all from peripheral to peripheral in the multiperipheral example?

Posted 2018-01-23 17:20:07 by Renato Silva
• ### Soft Devices s310 Central and Peripheral

Posted 2018-01-23 17:05:52 by fede99
• ### Is nrf_drv_spi_transfer interrupt safe?

Posted 2018-01-23 16:27:39 by samer