Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

NEWBIE TO ANT

Rank

Total Posts: 8

Joined 0

PM

Hi everyone,

I am newbie to ANT. i started a project under ANT protocol. My task is to create a establish a USART communication between external Microcontroller and ANT. The microcontroller which i am using is ATmega128L and the Tranceiver module used is C7 RF module.I know the USART communication in ATmega128L but i dont how to implement communication between microcontroller and the tranceiver.The packet ID, Packet size, channel mode etc have to be declared in the microcontroller end..!! please help me with some idea how to implement..!!!


with regards
jakr      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Good Morning,

I suggest taking a look at the forum post Getting Started with ANT Development in Embedded Systems. I also suggest taking a look at theANT Message Protocol and Usage document. It is the main document that describes the ANT Protocol, as well as the packet ID, packet size, channel ID and assignment etc.

Best Regards,

Kassandra Rizopoulos      
Rank

Total Posts: 8

Joined 0

PM

i wrote the code for USART communication for the microcontroller..!!!

#include <avr/io.h>
#include <util/delay.h>
#define BAUD 57600


void USART_Init( unsigned int ubrr )
{

UBRR0H = (unsigned char)(ubrr>>8);
UBRR0L = (unsigned char)ubrr;
UCSR0B = (1<<RXEN)|(1<<TXEN);
UCSR0C = (1<<USBS)|(3<<UCSZ0);
}



unsigned char read(void)
{
while( !(UCSR0A & (1 << RXC0)) )
;
return UDR0;
}

void write(unsigned char data)
{
while ( !(UCSR0A & (1 << UDRE0)) )
;
UDR0 = data;
}


int main (void)
{
USART_Init( ( F_CPU / BAUD / 16 ) - 1);
while (1)
{
write( read() + 1);
}
return 0;
}


but i dont know how to declare the frame format here in microcontroller end..!!