• AVR Freaks

Hot!Cable length to UART at 3V

Author
juliosilva
Super Member
  • Total Posts : 246
  • Reward points : 0
  • Joined: 2004/04/26 09:47:58
  • Location: Portugal
  • Status: offline
2012/05/11 04:52:33 (permalink)
0

Cable length to UART at 3V

Hello,

I'm developing a system with two PIC's that needs bi-directional communication.
They both work at 3V VCC, and I'll use UART at 9600bps.

I'll use 6 wire, crossed cable (3x2 pair) (like CAT5U ethenet cable), with 1xGND paired with 1xTX, 1xGND paired with 1xRX, and 2 other pair with VCC (3V). So the same cable will have regulated 3V/GND and TX/RX.

Is the best choice?
What is the maximum cable length that I should use?


Thanks for any tip,

JS
#1

13 Replies Related Threads

    Steven37
    Super Member
    • Total Posts : 347
    • Reward points : 0
    • Joined: 2008/08/29 05:20:14
    • Location: South Australia
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/11 07:30:42 (permalink)
    0
    Hi,

    If you are using RS232 line driver/receiver ICs (MAX3221 or similar) then the cable length can be several hundred metres.

    If you are not using RS232 line driver/receiver ICs but are just connecting the PICs USARTs together, I think you will have trouble getting it to work reliably at 9600 baud over 1/2 a metre.

    Regards Steve.

    post edited by Steven37 - 2012/05/11 07:33:48
    #2
    juliosilva
    Super Member
    • Total Posts : 246
    • Reward points : 0
    • Joined: 2004/04/26 09:47:58
    • Location: Portugal
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/11 08:41:40 (permalink)
    0
    Not using line driver, just two PIC's...

    I need it to be from 5 to 10mts...
    #3
    WaltR
    Super Member
    • Total Posts : 3812
    • Reward points : 0
    • Joined: 2003/11/07 12:38:21
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/11 12:06:55 (permalink)
    0
    juliosilva

    Not using line driver, just two PIC's...

    I need it to be from 5 to 10mts...


    Do yourself a favor and use line driver/receivers for that distance.

    Else just wire the PICs together and hope the data does not get corrupted.
    Also, beware on grounding issues.
    #4
    juliosilva
    Super Member
    • Total Posts : 246
    • Reward points : 0
    • Joined: 2004/04/26 09:47:58
    • Location: Portugal
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/11 13:00:06 (permalink)
    0
    What do you suggest?
    MAX3232?
    #5
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/11 13:26:19 (permalink)
    0
    If you have to put drivers anyway, I'd suggest MAX485 to make it differential, and up to 1Km Smile

    In my opinion, @9600 you can easily do 5-10mt, just beware of grounds (and maybe have some checksum)

    GENOVA :D :D ! GODO
    #6
    juliosilva
    Super Member
    • Total Posts : 246
    • Reward points : 0
    • Joined: 2004/04/26 09:47:58
    • Location: Portugal
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/12 05:28:42 (permalink)
    0
    HI DarioG,

    Do you think I can get 5-10mts without drivers?
    Regarding the grounds what is your tips?

    Regards,

    JS
    #7
    DarioG
    Allmächtig.
    • Total Posts : 54081
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/12 07:17:04 (permalink)
    0
    Yes it should work.
    As for ground, easiest method is to connect them together or even using the same power supply.
    Or, power them via batteries.
    It gets worse with switching power supply...

    GENOVA :D :D ! GODO
    #8
    drh
    26+ years
    • Total Posts : 1068
    • Reward points : 0
    • Joined: 2004/07/12 11:43:22
    • Location: Hemet, Calif. USA
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/12 07:30:50 (permalink)
    0
    Since you are using a CAT5 cable, you might consider using an RS422 interface. Look at the MAX3080 and MAX3081 chips.

    David
    #9
    juliosilva
    Super Member
    • Total Posts : 246
    • Reward points : 0
    • Joined: 2004/04/26 09:47:58
    • Location: Portugal
    • Status: offline
    Re:Cable length to UART at 3V 2012/05/14 05:56:51 (permalink)
    0
    DarioG

    Yes it should work.
    As for ground, easiest method is to connect them together or even using the same power supply.
    Or, power them via batteries.
    It gets worse with switching power supply...



    I'll be using the same power supply, I'll send +3V, GND, TX&RX. And will pair one twisted pair for TX-GND and other for RX-GND.
    So TX & RX will be paired with a GND each. and the VCC and GND on the board will be the same.

    drh, I'll also take a look at that, thanks.

    Regards,

    JS
    #10
    cesardag
    New Member
    • Total Posts : 23
    • Reward points : 0
    • Joined: 2006/10/19 23:12:38
    • Location: Lima, Peru
    • Status: offline
    Re:Cable length to UART at 3V 2020/08/21 12:57:54 (permalink)
    -1 (1)
    I think an rg58 cable would be better if you want to use one way in short distances (maybe 10 meters). But of course, you will need to use two power supplies.
    RS232 is the most common, but RS485 will be better for longer distances since it is balanced.
    Hope not to be too late.
    #11
    ric
    Super Member
    • Total Posts : 28731
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re:Cable length to UART at 3V 2020/08/21 15:12:09 (permalink)
    +3 (3)
    cesardag
    I think an rg58 cable would be better if you want to use one way in short distances (maybe 10 meters). But of course, you will need to use two power supplies.
    RS232 is the most common, but RS485 will be better for longer distances since it is balanced.
    Hope not to be too late.

    Eight years later, I think this hope may be in vain.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #12
    crosland
    Super Member
    • Total Posts : 2060
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re:Cable length to UART at 3V 2020/08/22 08:43:46 (permalink)
    0 (4)
    cesardag
    I think an rg58 cable would be better if you want to use one way in short distances (maybe 10 meters). But of course, you will need to use two power supplies.
    RS232 is the most common, but RS485 will be better for longer distances since it is balanced.
    Hope not to be too late.




    Can either of those be made to stretch 8 years? I think you need a different physical interface and protocol for that.
    #13
    mlp
    boots too small
    • Total Posts : 967
    • Reward points : 0
    • Joined: 2012/09/10 15:12:07
    • Location: previously Microchip XC8 team
    • Status: offline
    Re:Cable length to UART at 3V 2020/08/24 09:10:36 (permalink)
    +2 (2)
    crosland
     
    Can either of those be made to stretch 8 years?

    Run your cable to Alpha Centauri and back.

    Mark (this opinion available for hire)
    #14
    Jump to:
    © 2020 APG vNext Commercial Version 4.5