Serial Comms through TX/RX pair jumbled


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    7

    Default Serial Comms through TX/RX pair jumbled

    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 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

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    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.
    Code:
    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.
    Code:
      
    TRAIN	VAR BYTE
    TRAIN=$55
    SEROUT PORTC.4,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Apr 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    "h" will not train it. You need to send a series of 0101 , high and low.
    That is what the $55 is.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

  6. #6
    Join Date
    Apr 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    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

Similar Threads

  1. Simple Serial Comms.
    By koossa in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd November 2007, 08:12
  2. Serial Comms with PIC micros
    By carlsnilsson in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st September 2006, 01:00
  3. Replies: 2
    Last Post: - 23rd July 2006, 08:16
  4. Serial comms / Bootloader
    By koossa in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 30th October 2005, 18:48
  5. Do I need MAX232 for Serial Comms
    By koossa in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th October 2005, 17:10

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts