Difference between revisions of "PIC32MX: XBee Wireless Round-trip Latency"

From Mech
Jump to navigationJump to search
Line 26: Line 26:




This code is for the TRANSMITTER XBee chip. It takes a string of characters and
This code is for the TRANSMITTER XBee chip. It takes a string of characters and
sends them from the PIC to the XBee and broadcasts it out into the world. The
sends them from the PIC to the XBee and broadcasts it out into the world. The
reciever chip should receive the message and echo it back to the transmitter. At
reciever chip should receive the message and echo it back to the transmitter. At
the point when the transmitter first broadcasts the message, a pin on the PIC is
the point when the transmitter first broadcasts the message, a pin on the PIC is
set to high. When the message is successfully echoed back, that pin is set low
set to high. When the message is successfully echoed back, that pin is set low
so the whole process can be timed using an oscilloscope.
so the whole process can be timed using an oscilloscope.


**********************************************************************/
**********************************************************************/

Revision as of 17:07, 13 February 2010

Original Assignment

Do not erase this section!

Your assignment is to set up one PIC32 to send data to another using XBees for wireless RS-232 comm. One PIC will send a series of numbers; the other PIC will receive them and echo them back; and the first PIC will time the total time to send and receive back. To time, the first PIC can set a digital pin high, then set it low again when the original sent data is correctly received. It could also keep track of the count of a counter-timer. You can time how long it takes for the round-trip using an oscilloscope or by reading the counter-timer. You should try this for different baud rates and a couple of different sizes (in bytes) of the message. How low can you get the total round-trip time while guaranteeing low data loss?

Overview

Summarize briefly what the page is about.

Circuit

Include a schematic and give any part numbers. A photo of your circuit is OK, but not as a replacement for a schematic.

Code

The code below is for the transmitter XBee chip. Note that the message string sent included only one period and was placed at the end. The program scans the message it receives looking for that period, so it knows that the whole message was received.

/********************************************************************** 

Transmitter Code Lab 5: High Speed XBee Latency George Randolph Nathan Hirsch 10 February 2010


This code is for the TRANSMITTER XBee chip.  It takes a string of characters and 
sends them from the PIC to the XBee and broadcasts it out into the world.  The 
reciever chip should receive the message and echo it back to the transmitter.  At
the point when the transmitter first broadcasts the message, a pin on the PIC is 
set to high.  When the message is successfully echoed back, that pin is set low 
so the whole process can be timed using an oscilloscope.
 **********************************************************************/