I have XBEE PRO units, one connected to my PC via a usb teerminal, and the other connected to a PIC32 chip on breadboard.
I’ve tested the XBEEs communicating by setting the breadboard XBEE up so that Dout wired to Din and it worked just fine as an ECHO. But upon connecting to my PIC32 I tried to run the simple code below and all I get on X-CTU is F0 F0 instead of ‘A’… if anyone can guide me in the right direction…
#define SYSCLK (80000000UL)
#define PBCLK (SYSCLK/2)
#define DESIRED_BAUDRATE (9600) //The desired BaudRate
#define BAUD_VALUE ((PBCLK/16/DESIRED_BAUDRATE)-1)
#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_2 //Fpb=40,000,000
int32_t main(void)
{
DDPCONbits.JTAGEN = 0;
SYSTEMConfigPerformance(SYSCLK);
char DataIN;
//INTDisableInterrupts();
//InitApp();
//INTEnableSystemMultiVectoredInt();
OpenUART1(UART_EN, UART_RX_ENABLE | UART_TX_ENABLE, BAUD_VALUE); //(Fpb/16/9600)-1=259
while(1)
{
DelayMs(1000); //delay of 1 second
putcUART1('A');
};
return 0;
}