I’m trying to get the range test to work in x-ctu with an xbee module and an atmega16L. I’m using codevision to program the chip.
Here’s what I’m working with:
usb explorer: http://www.sparkfun.com/commerce/produc … ts_id=8687
for remote chip logic shift: http://www.adafruit.com/index.php?main_ … 4d8e5e1cde
I updated both xbee chips to version 10CD. I left all settings default except PANID = 25 and BD = 19200 for both chips.
The code I used in my Atmega is:
#include <stdio.h>
#include <mega16.h>
void main(void)
{
unsigned char num;
UCSRA=0x00; //clear control and status register
UBRRL = 12; //set the Baud Rate at 19200
UBRRH = 0;
UCSRB = 0x18; //enable the transmitter and receiver
UCSRC = 0x86; //8-data bits, no parity, 1-stop bit
DDRA = (DDRA & 0x00);
PORTA = (PORTA | 0xFF);
DDRB = (DDRB & 0x00);
PORTB = (PORTB | 0xFF);
DDRC = (DDRC & 0x00);
PORTC = (PORTC | 0xFF);
DDRD = (DDRD & 0x00);
PORTD = (PORTD | 0xFC);
while(1)
{
scanf("%c", &num);
printf("%c", num);
}
}
I also attempted connecting Dout to Din of the remote xbee with the atmega removed, but was unable to get any response on my computer with the range test or the command: atci12. However, the red data LED came on the adafruit breakout board, leading me to think the remote xbee was receiving data.
This is my first attempt at xbee. Any help would be appreciated.