Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Continuous scanning, transmitting data

Rank

Total Posts: 3

Joined 2014-03-05

PM

Hi all,

I try to use continuous scanning in a setup of up to 3 masters transmitting data and one slave
in continuous mode receiving their data. We use Nordic's nRF51422 in this project. While I can
receive the data in the slave, sending data back to the master seems impossible.
I tried to use
sd_ant_broadcast_message_tx(...) 

but this didn't work. How do I transmit data back to the masters?

I setup the masters with:
sd_ant_channel_assign(0CHANNEL_TYPE_MASTER00)
sd_ant_channel_radio_freq_set(066)
sd_ant_channel_period_set(03276)
sd_ant_channel_id_set(0, <device_number>, <device_type>, 0x01)
sd_ant_broadcast_message_tx(<some data>)
sd_ant_channel_open(0


I setup the slave with:
sd_ant_channel_assign(0CHANNEL_TYPE_SLAVE00)
sd_ant_channel_id_set(00x000x000x01)
sd_ant_channel_radio_freq_set(066)
sd_ant_rx_scan_mode_start(0x01


Any help welcome, thanks a lot!      

Signature

Thomas Schulze
Die Entwicklerschmiede
Innovative Lösungen für Ihre Leistungselektronik

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi Thomas,

Have you closely followed the "ant_continuous_scanning_controller example" in the nRF5 SDK? You must use other ANT channels (which act as message buffers in continuous scanning mode) to send the messages back to the masters, and not the channel which is acting as the continuous scanning mode.

The Continuous Scanning Mode Application Note helps explain this in further detail.

The example in the SDK uses 1 additional channel to act as the "response channel", but up to 14 other channels could be opened in order to buffer messages to respond to additional master channels. In your application, it could be 3 as you are responding to 3 masters.

#define ANT_SCAN_CHANNEL_NUMBER     ((uint8_t) 0)            /**< Scanning channel number. */
#define ANT_RESPONSE_CHANNEL_NUMBER_1 ((uint8_t) 1)            /**< Response channel number 1 */
#define ANT_RESPONSE_CHANNEL_NUMBER_2 ((uint8_t) 2)            /**< Response channel number 2 */
#define ANT_RESPONSE_CHANNEL_NUMBER_3 ((uint8_t) 3)            /**< Response channel number 3 */
...
err_code sd_ant_channel_id_set(ANT_RESPONSE_CHANNEL_NUMBER_1device_number_to_respond_todevice_type_to_respond_totransmission_type_to_respond_to);
...
err_code sd_ant_acknowledge_message_tx(ANT_RESPONSE_CHANNEL_NUMBER_1ANT_STANDARD_DATA_PAYLOAD_SIZEm_tx_buffer); 


Cheers      
Rank

Total Posts: 3

Joined 2014-03-05

PM

Hi Harrison,

thanks! I'll try that...      

Signature

Thomas Schulze
Die Entwicklerschmiede
Innovative Lösungen für Ihre Leistungselektronik

Rank

Total Posts: 3

Joined 2014-03-05

PM

Hi Harrison,

thanks a lot for Your kind support. I have the system working now.
However the implementation of Nordic seems to deviate a bit.
According to Nordic extended messages are not supported,
and according to Nordic sending data back in continuous scanning is
impossible. But in fact it is possible, if done according Your guideline.

Thanks a lot again,

Thomas      

Signature

Thomas Schulze
Die Entwicklerschmiede
Innovative Lösungen für Ihre Leistungselektronik

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

You're welcome Thomas.

Correct, continuous scan mode allows all normal slave channel functions to be used; bi-directional communication; broadcast, ack and burst messaging; extended messages with RSSI, Channel ID, RX Timestamp, etc.