Well guys, I do not know if there is someone here with knowledge on the subject, but I would like if someone could help me. I am wanting to make a PIC 16F877A send data (a number int) to my computer using a XBee. Where the transmitter is connected to the pic, which sends data to the receiver that is connected to the PC via USB adapter card of rogercom. I did a virtual test as follows, the PIC sends the whole number 10 every time a LED turns on, simulated by proteus and sent through a serial port simulated on the computer. Everything worked when I started the monitor, saw the number 10 sent always when the LED lit (in the simulation of proteus data is sent over a standard RS232 port, and not by the XBee, but I believe that it is equivalent). So I went to practice, rode around the circuit and could begin to see the data sent in transparent mode, the problem is that the data arrive in a strange way, not the number 10 as expected, through a monitoring program was serial ports may see the following data every time the LED lights up:
83 FC (in hexadecimal equivalent of what appears in the X-CTU). And the string equivalent is: ƒü. These symbols in ASCII. I’ve seen this problem happening because of the transmission rate, but I had change it and didn’t work out. I do not understand why.
First is to get the PIC to output the correct data to the PC without the XBee. This ensures that the PIC code is correct and the Baud rates, number of bits, parity and stop bits settings on the PIC and PC match.
Once this works then connect in the XBees.
Which XBees do you have? There are two different hardware versions that can run four different protocols with many firmware versions of each.
Read the Firmware Version out of the XBees with X_CTU and post with your next questions.
Never assume the Baud rates are correct. If in doubt (odd characters received) use an O’scope or logic analyzer to measure the bit times when sending the character ‘U’ (0x55).
Lastly, search and read the many threads in this forum on XBees. Your question has been posted before.
I dont have a way to test just with the pc because I dont have a cable female-female that I guess its needed to test. But I thought this comunication appear to be simple, and several people had already done something similar.
I didnt understand when you said about the firmware…
My Xbee is: XBee 2mW Series 2.5 Wire Antenna.
I’m studying a lot this Xbees, and reading a lot of topics but the problem persists.
Ok. You can remove the two XBees from the sockets on the boards used to interface to the PIC and to the PC. Are you using a break-out and a USB or RS232 Explorer board?
Then jumper from one XBee socket to the other with some small solid wire, phone wire works, TX to RX, RX to TX & Gnd to Gnd. This then acts as the Level and/or protocol translator between the PIC and PC.
I didnt understand when you said about the firmware…
My Xbee is: XBee 2mW Series 2.5 Wire Antenna.
In the PC setting tab of X-CTU do a Test/Query. The firmware version is then reported.
I’m using a PIC that is configured to transmit to a RS232 and this TX is connected to DIN of the Xbee. The other Xbee is connected to PC by the rogercom USB device.
Firmware 10CD is on a Series 1 XBee (1mW) and running straight 802.15.4
This is NOT a series 2.5XBee!
Ensure that you are using the correct XBee document. Digi Doc 90000982_A.pdf is the one you want.
The series 1 XBees running 802.15.4 are easier to use as you need, transparent serial mode.
I’m using a PIC that is configured to transmit to a RS232
Can I assume that you do not have an RS232 level translator connected. The PIC TX output pin from the UART is know as Asynchronous Serial.
Is your PIC running from 5V? The XBee is a 3.3V device and there should be a 5V to 3.3V level shifter between the PIC TX and the XBee’s DIN. A resistor divider is simple and works. Microchip has a 3V Tips
nTricks doc.
Did you understand my last explanation on how to connect the PIC without the XBees?
Ah, thats correct, sorry, I was confused about the model.
What about the supply of 5V and 3.3V, I already knew what was needed and the circuit is already operating properly about it.
Can I assume that you do not have an RS232 level translator connected. The PIC TX output pin from the UART is know as Asynchronous Serial.
I do not really understand exactly what you mean by that, but the only thing there is a wire from the tx of the pic and the DIN of the Xbee (with adaptation beacause the 3.3V thing).
Sorry, but didnt understand this explanation:
Ok. You can remove the two XBees from the sockets on the boards used to interface to the PIC and to the PC. Are you using a break-out and a USB or RS232 Explorer board?
Then jumper from one XBee socket to the other with some small solid wire, phone wire works, TX to RX, RX to TX & Gnd to Gnd. This then acts as the Level and/or protocol translator between the PIC and PC.
I will describe in more detail my circuit: I have a pic on a protoboard powered with 5V that is programmed to send by rs232 the same integer value every 5 seconds. PIC’s TX pin has a wire after passing through the 3.3V converter that is connected to the DIN Xbee. This one is properly supplied with 3.3V. Then these data should be viewed correctly received after the Xbee connected to the computer by USB rogercom plate, but the data arrive in a strange way, but still arrive. I hope it serves to make amends leave clearer.
I have a pic on a protoboard powered with 5V that is programmed to send by rs232
RS232 is an Asynchronous serial protcol with invert levels at +12V to -12V. Are you really using RS232 or just logic level Asynchronous serial? This is what is confusing the issue.
a wire from the tx of the pic and the DIN of the Xbee (with adaptation beacause the 3.3V thing).
This is logic level Asynchronous serial and is what is confusing the issue.
Google “RS232” and “Asynchronous serial” to learn what it really means.
Do you receive the correct characters without the XBees?
Are you really sure that the Baud rates of each pair match?
When I said about the PIC is sending by rs232 is because the PIC program is configured to send that type. When I tested the simulation in proteus I connected the TX PIC to a rs232 port simulated on proteus, and oh yes I saw the correct characters. In practice, I have not tested without Xbee because not have the cable adjusted right. The baudrates are the same, just do not know if what I’m using is right, I’m using what I put in the program, which is 9600 kbps.