Shop OBEX P1 Docs P2 Docs Learn Events
Receive API packets from Xbee to PIC18f4620 — Parallax Forums

Receive API packets from Xbee to PIC18f4620

nikiaroranikiarora Posts: 1
edited 2010-10-06 00:00 in Accessories
Hi everyone,

I'm having trouble in receiving an API packet from XCTU program to the PIC18F4620.

The setup is as follows:

There is one device with an Xbee module connected to a PIC18F4620 with an LCD display.

At the other end, the Xbee is connected to the computer via a serial port.

I am able to send the packet from the Xbee and PIC18f4620 to the XCTU, and It displays the values. This is the apcket I was able to sent.

0x7E
0x00
0x0A
0x01
0x01
0x50
0x01
0x00
0x48
0x65
0x6C
0x6C
0x6F
0xB8

But when I tried to send the same packaet thorugh XCTU to Xbee and the PIC then it doens't display the values correctly.

I'm not 100% sure of my coding, specially the part where we try to display the values in the USART in the LCD display.

Could somebody please help me, or at least guide me in the right way.

Thanks in advance.

Below is a part of the code that we wrote using MikroC. This get get the values from the USART and displays it on the LCD. I can get the first value of 7E to be displayed on the LCD, but I'm not sure how to code this to get the packet as a whole.

if (Usart_Data_Ready())
{
test=Usart_Read(); //test data type is unsigned int

IntToStr(test, array);// array is of data type char
Lcd_Custom_Out(1,1,array);
Delay_ms(1000);
Lcd_Custom_Cmd(Lcd_Clear);
}:mad:

Comments

  • Daniel HarrisDaniel Harris Posts: 207
    edited 2010-10-06 00:00
    which LCD module are you using?

    Does it have a serial "backpack" board to take data serially and convert it to the necessary signals to drive the display? I.E. do you know how to communicate with the LCD?
Sign In or Register to comment.