Shop OBEX P1 Docs P2 Docs Learn Events
Parallax RF Module, can't connect — Parallax Forums

Parallax RF Module, can't connect

Bram_KBram_K Posts: 3
edited 2008-06-06 14:59 in Robotics
Hi,

I'm trying to use Parallax rf module to control a robot, I've bought one package Parallax rf module,

AVR ATmega8535 is used as the serial data receiver and transmitter controller,

the baud rate has been set to 1200 baud, 8 data bit, 1 stop bit, n parity bit, the microcontroller has been tested to communicate,
by connecting the rxd txd pin with a cable, and the communication just fine,
the cable then removed, and the parallax rf module is expected to take over the cable function,
but,
when the receiver is turned on, the number read was random,
then when the transmitter is turned on, the receiver is stop reading,

the PDN pin is left hang as the datasheet option,
the Vcc has been connected to 5 volt, the GND pin has been grounded,
the DATA pin is connected too, the Transmitter DATA pin to TXD pin, and the Receiver DATA pin to RXD pin,
the testing code just:

at the transmitter

while (1)
{
putchar(0x55);
}

at the receiver

unsigned char rc;

while(1)
{
rc = getchar();
PORTB = rc;
}

the code initialization is done by CodeVision code generator,

the code then changed to:

at the transmitter:

unsigned char idx;

while(1)
{
___ for (idx = 0; idx <50; idx++)
___ {
_______ putchar(0x0f);_________// for sinchronization
___ }
___ putchar("!"); _____________// for sentinel
___ putchar(0xaa);___________// value to be sent
___ delay_ms(250);___________// signal spacing
}


and at the receiver


unsigned char t, tt;
while(1)
{
_____while(1)
_____{
_________t = getchar();________ // reading sinchronizatiion and possibly of "!" char
_________if ( t == "!")__________// yes sentinel arrived
____________{
_________________tt = getchar();_____ // get value to be read
_________________PORTB = tt;_______ // show in port B
_________________break;____________// see the next transsmitted value
_____________}
_____}
}


I think this code follows the code suggested in the datasheet, but still
the receiver waiting.

the data pin at the receiver has been observed with the osciloscope, the logic is always high,
but if the transmitter is switched off, then the data gangling high low, a random data appeared;

Please someone, give me a clue, how to solve the problem,

thank you in advance
Kurnia Brahmana

Post Edited (Bram_K) : 6/6/2008 5:03:55 PM GMT
Sign In or Register to comment.