PDA

View Full Version : Serial Comms through TX/RX pair jumbled



altech6983
- 28th July 2009, 18:13
Hello,

I am working on a remote control project that controls a pan tilt camera. I have the remote and receiver board working so long as the serial line is directly wired from remote to receiver.

The problem comes when I hook up the TWS-434A and the RWS-434 as the TX and RX, the circuits don't work due to garbage coming though. I have a ttl serial to pc hookup and I have monitored the output of the remote (it is outputting the correct serial code into the transmitter) but I just get random garbage on he other side. If I use the serial to pc link to send characters then it is still garbage but it isn't usually random, if I type h then I get "y" with the dots on top most of the time.

I am using the 16F628A USART at 1200 baud 8N1 no parity (I also use that to test the tx/rx of the serial pc link, though I have tried other speeds through the TWS-434A/RWS-434 but no luck.

This page (http://www.rentron.com/ruf-bot.htm) made it look so simple as I though it would be, is there any suggestions you can give me?

Thanks for any help, I really need it,
altech6983

mackrackit
- 28th July 2009, 18:30
Normally a bit of error checking is needed. the simplest is to send a dummy character before the value you want to receive.
Below sample waits for 9. when 9 is received the next charater is stored in myVar.


SERIN PORTC.4,T2400,[9],myVar

Sometimes folks have better luck "training" the receiver. In theory this balances the receiving capacitor. Below is the send code.


TRAIN VAR BYTE
TRAIN=$55
SEROUT PORTC.4,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]

altech6983
- 28th July 2009, 18:56
I use error checking, I wait for "AX" and then receive but i can't even get one right character out of it.

I have tried training the receiver, I would send "h" about ten twenty times but the "h" never would come though.

These are the only two things that I knew of that would effect it and so that is why I implemented them but still no success.

mackrackit
- 28th July 2009, 19:30
"h" will not train it. You need to send a series of 0101 , high and low.
That is what the $55 is.

dhouston
- 28th July 2009, 19:34
See http://davehouston.org/RFTipsTricks.htm

altech6983
- 28th July 2009, 21:04
thanks for the link, and I understand why the $55 now.

I will try some of those and see if they work.

Thanks for the help