Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20563

Share your working BASCOM-AVR code here : nRF24AP2 and ANT Wireless Protocol : NEWTOPIC

$
0
0
Hello, The attached Demo shows how to communicate with ANT wireless devices. In this case, I show how to create an ANT Slave using the Nordic Semiconductor nRF24AP2 module. This is done in this Demo by initializing communication with a compatible Heart Rate Monitor (the Master) using the ANT communication protocol. ANT devices are “Ultra Low Power” consumers and are popular with athletes who wear them for long periods of time. Data collected and stored can be analyzed later. From the Bascom perspective, the interface is very easy [once Mark and MWS explain the extremely complicated details of how a UART actually works ;-) ] Running at 3.3V, a straight connection is used from the micro Rx/Tx to the nRF module (no need for RS232 interface). The only “trick” is to figure out how to determine when the nRF has completed sending a message to the micro since the messages vary in length from 5 to 13+ characters. These devices can transmit messages from 1 to 4 Hz, so using an interrupt was better than just “Wait”. I decided to use Serialin Bytematch=All with a reset of TIMER0 with each character received. When the TIMER0 interrupt happens (it is set up as a Timer), we know there are no more characters being received by the UART and the message is parsed for further processing. There may be better ways to do this, if so, please let me know. The messages sent by the Master Heart Rate Monitor are interpreted to provide the following information: - Current heart rate in beats per minute. - Cumulative Time since last battery change - Manufacturer ID - Device Serial Number - Hardware Version, Software Version - Model Number Ennio

Viewing all articles
Browse latest Browse all 20563

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>