PIC to PIC Serial data using Cat5 cable


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    53

    Default PIC to PIC Serial data using Cat5 cable

    Hello,

    I am currently working on a project where two PIC's on two separate boards need to communicate serially over a distance of about 5 metres. I am looking to use UTP Cat5 cable to connect them together. As well as data, this cable will also carry the power supply from board 1 to board 2.

    For noise immunity, is it best to use one of the twisted pairs for the power supply and another for the data, or will it not matter too much?

    Thanks,

    Andy Wood

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Andy Wood View Post
    Hello,
    I am currently working on a project where two PIC's on two separate boards need to communicate serially over a distance of about 5 metres. I am looking to use UTP Cat5 cable to connect them together. As well as data, this cable will also carry the power supply from board 1 to board 2.
    For noise immunity, is it best to use one of the twisted pairs for the power supply and another for the data, or will it not matter too much?
    Thanks,
    Andy Wood
    Depends on what speed and how electrically noisy the area is and are you planning on using RS232 type connection, RS485, I2C, SPI, a differential signaling method, single wire, common grounds & power (which I'd assume based on what you said)?

  3. #3
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Depends on what speed and how electrically noisy the area is and are you planning on using RS232 type connection, RS485, I2C, SPI, a differential signaling method, single wire, common grounds & power (which I'd assume based on what you said)?
    Hello Skimask,

    Thanks for the reply. At this stage, data rate is 9600 baud using HSERIN/HSEROUT, logic level (no line drivers), common ground and power.

    I suppose my question is, given the above, what is best practice?

    Regards,

    Andy Wood

  4. #4


    Did you find this post helpful? Yes | No

    Default Cat 5 cable

    I regularly use 10-15 metre runs of cat5 cable between PICs. With a MAX232 interface chip I can get 115,200 bps at 15+ metres and at TTL I don't know the maximum because I have not had to go over 19,200 bps.

    I find that the voltage drop in the pair(s) used for power means that I have to run 9+ volts and have a regulator at each remote PIC.

    I use three wires for GND, 3 wires for PWR and the remaining two for data.

    I wire these as
    1 pair - PWR and PWR
    1 pair - PWR and TxD
    1 pair - GND and RxD
    1 pair - GND and GND

    I always use a checksum on every message passed and flash a LED when an error is detected. From the occasional flash of the error LED there are real world noise issues as with every form of serial comms beyond the PCB.

  5. #5
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BrianT View Post
    I regularly use 10-15 metre runs of cat5 cable between PICs. With a MAX232 interface chip I can get 115,200 bps at 15+ metres and at TTL I don't know the maximum because I have not had to go over 19,200 bps.

    I find that the voltage drop in the pair(s) used for power means that I have to run 9+ volts and have a regulator at each remote PIC.

    I use three wires for GND, 3 wires for PWR and the remaining two for data.

    I wire these as
    1 pair - PWR and PWR
    1 pair - PWR and TxD
    1 pair - GND and RxD
    1 pair - GND and GND

    I always use a checksum on every message passed and flash a LED when an error is detected. From the occasional flash of the error LED there are real world noise issues as with every form of serial comms beyond the PCB.

    Hello Brian,

    That is excellent "real world" information you have supplied - thank you for sharing it. It certainly helps in establishing a few "rules of thumb".

    Regarding the error checking - that was going to be one of my future questions. What did you find to be a reliable method without going overboard or having too much overhead. Is there any suggestions you have regarding which methods are better than others on a performance vs. overhead basis? I am only new to the serial comms aspect so any inforrmation would be appreciated.

    Regards,

    Andy Wood

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


    Did you find this post helpful? Yes | No

    Default

    The best error checking method? I would imagine every one here has their own preferences. It will depend some on the environment as to how much is needed or how much bad data is acceptable. ?

    This is a good read http://www.linxtechnologies.com/Documents/AN-00160.pdf
    It is for data over wireless, but the same applies. Page 4 starts the error checking methods.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 00:52
  2. 2 PIC, serial communication
    By lightgreen in forum Serial
    Replies: 6
    Last Post: - 21st November 2009, 15:20
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  4. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  5. Replies: 7
    Last Post: - 6th February 2008, 05:38

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