Hi,
I’ve got two Xbee S1 units that I’m using to connect to each other. I’m not sure why but one unit has a solid green light for the RSSI and the other has no light at all. I’m using ISR USART2_RX_vect interupt that triggers whenever data is written to the serial port. These are the two functions associated. The project is written in C using Atmel Studio.
void serial2_init(void)
{
UCSR2B = (1<<RXEN2)|(1<<TXEN2); //turn on the transmission and reception circuitry
UCSR2C = (1<<UCSZ20)|(1<<UCSZ21); //use 8- bit character sizes
UBRR2 = BAUD_PRESCALE; //load baud rate prescaler into register
} //end serial2_init
void serial2_write_byte(uint8_t data_byte)
{
while((UCSR2A&(1<<UDRE2))==0){} //wait until data register is ready
char outputVal[30];
UDR2 = data_byte;
}
The interrupt is never triggered. The only way I’ve managed to get them both to light up completely green is to deploy the same source code to both, then the interrupts start triggering.
Can anyone explain to me where I am going wrong?
Thanks,
Neil