char buff = 0;
void main(){
ANSEL = 0;
ANSELH = 0;
UART1_Init(9600); // init USART
Delay_ms(100);
while (1) { // Endless loop
if (UART1_Data_Ready())
{ // If data is received,
buff = UART1_Read(); // read the received data,
UART1_Write((char)'K'); // and send data via UART
}
}
}
With these config bits:
Code:
CONFIG :$2007 : 0x03F4
alias
Internal Rc no clock
Master Clear Enable External
Brown Out Detect Enabled, SBOREN disabled
Xbee modules are able to communicate perfectly (100% success on loopback test via x-ctu) and the pic is able to communicate perfectly in the test via pickit2 on the USART COM port (it answers with the character 'K' to every byte I send).
But as linked above, xbee cannot communicate with the pic and I get 0% success rate in the x-ctu test (always timeout).