Dear Members,
I want to wake up the chip whenever there's a radio signal from ANT sensor without pushing a button,
Will this function sd_app_evt_wait() help ?
I put at the end of the loop,
So far I need to push the button to wake up the chip,
Thanks
Dear Members,
I want to wake up the chip whenever there's a radio signal from ANT sensor without pushing a button,
Will this function sd_app_evt_wait() help ?
I put at the end of the loop,
So far I need to push the button to wake up the chip,
Thanks
Typically to achieve communication between two ANT nodes, then one is a master and the other is a slave. A slave device can search for a master at any time based on a few parameters, if an appropriate master is found, then the slave device will synchronize with the master and "track" the master. If there is no master present, the slave will timeout search, and typically the slave will enter idle mode until the user press a button or similiar to initiate searching again. Reason for not searching continously is that it is a rather current consumption intensive mode, so you don't want to be searching continously. If you don't want a user to activiely push a button to start searching, then you will either need to for instance use a timer to periodically start searching and/or just start searching again on every search timeout.
It is common practize to put the MCU to sleep (even if radio is in use searching or not) by calling sd_app_evt_wait() to save power.
Kenneth
Hi Kenneth,
Thanks for the reply,
"..........If you don't want a user to activiely push a button to start searching, then you will either need to for instance use a timer to periodically start searching and/or just start searching again on every search timeout."
Which function can I use with timer for searching for master ?
Any example in SDK ?
Await for reply ..
Thanks
app_timer(), call sd_event_wait() or call a function for searching the master ?
What's the function for searching master ?
Thanks
You should be able to find out how an app_timer can be created and started by looking at some of the example projects, the app_timer will allow you to run some code at a timeout or given interval.
In terms how to setup a slave device to search for a master, this is explained in this document:
https://www.thisisant.com/resources/an11-ant-channel-search-and-background-scanning-channel/
In short the slave will start searching for a master when the ANT open channel is called.
Kenneth
Thanks for the information, I will see and keep posted.
I found :
// ////////////////////////////////////////////
/** @name Extended Assign Channel Parameters
* @{ */
// ////////////////////////////////////////////
#define EXT_PARAM_ALWAYS_SEARCH ((uint8_t)0x01) ///< Bitfield for enabling background searching behaviour.
Line 127 ant_parameter.h
in relation with :
5.2 Configuring a Background Scanning Channel page 5, the documents you gave me,
https://www.thisisant.com/resources/an11-ant-channel-search-and-background-scanning-channel/
Which function using this parameter for doing background scanning ?
Thanks
It has a relation with this, isn't it ?
E:\nRF5_SDK_17.0.2_d674dde\examples\ant\ant_background_scanning\main.c
It has a relation with this, isn't it ?
E:\nRF5_SDK_17.0.2_d674dde\examples\ant\ant_background_scanning\main.c
We rely on much of the documentation on:
https://www.thisisant.com/developer/resources/downloads/
https://www.thisisant.com/developer/components/nrf52832/
And if you search through the ANT examples in the nRF5 SDK for EXT_PARAM_ALWAYS_SEARCH you can find that it is for instance used in ant_channel_init() is passed into sd_ant_channel_assign().
BEst regards,
Kenneth