Shop OBEX P1 Docs P2 Docs Learn Events
I need to know the best cable. - Page 2 — Parallax Forums

I need to know the best cable.

2»

Comments

  • markustermarkuster Posts: 184
    edited 2013-07-22 15:11
    Hi again:

    I thought that RS422 and RS485 were the same thing , but seems it is not.

    I think one good solution could be this you wrotte:


    https://www.rs232-converters.com/RS232_to_RS422_Converters/RS232_to_RS485_RS422_Converter.htm


    I am not an expert and I would like to know if I need to add more electronics
    to send the data from the Propeller to a PC . The distance is about 120 feet.

    As I wrotte , the Propeller is this:
    http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/CategoryID/73/List/0/SortField/0/catpageindex/2/Level/a/ProductID/423/Default.aspx

    Thanks again,
  • FernandFernand Posts: 83
    edited 2013-07-23 02:47
    @markuster, there's some uncertainty here.
    You seem to want to do only one thing,
    which is to pass data from a Propeller to a PC over 120 ft of wire. Yes?

    You will load the program into your Propeller board at the PC using a special short cable. Yes?

    You will never load a new or modified program onto your board over the 120 ft cable,
    because to do that you will always bring the PC to the Prop or the other way around,
    and use the special short cable, correct?

    Will you be sending ANY data from the PC to the propeller during operation
    at all -- maybe to acknowledge that the PC got the last chunk of data --
    or will the sensor data just pass over and over with no confirmation?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-23 04:59
    It was a full moon yesterday... couldn't get anything right. I sorted out my computers, and my RS422 interface at the Propeller Proto board.

    I am still not sure if my USB2SER is defective. I have set it aside and am just working on a a pair of boards. A RS232 to RS422 to be connected to the PC, and a RS422 to be connected to the Propeller Proto Board.

    The good news...
    I finally got the retail RS232 to RS422 talking to the Propeller with a home-built RS422 interface at the Propeller Proto board .
    It is rock solid at 19200 baud. I have to reload and go test higher baud rates. But from what I understand, the PropTool loads the Propeller at 19200 baud (correct me if I am wrong).

    The set up is: PC> USB> USB to RS232 > RS422
    (4 wire/full duplex)
    RS422> ttl > Propeller

    The RS422 to ttl chip is a 5 Volt sn75179 ( just one chip required) at the Propeller. 120ohm termination on the receiver RS422 inputs.
    Ttl 3.3V. out of the Prop goes into the sn75179 unprotected, ttl 3.3V into the Prop has a 3.9K ohm resistor to protect the Propeller.

    This is just a bench test with 1 foot of 4 wire full-duplex. Now I need to insert a longer cable as well. I don't really want to buy 250 to 1000 feet of CAT5 just for testing. So I will have to look at what I have squirreled away. I am pretty sure there is 150 of CAT5 on hand.

    ^^^^^^^^
    The next build step is to get the 6 wire solution working that actuall programs . And that is indeed suppose to do actual loading of binaries from 120 to 150 feet... bare minimum.. maybe 4000 feet!

    Others have had good luck with distance programing of the Propeller with an XBee wireless, but aside from the extra expense - each has its own niche. I actually prefer the privacy of wire.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-23 05:10
    Well, the 4 wire set up is now working well at 115,200 baud on a bench cable of 1 foot. I can talk and program Forth on the remote Propeller... time to dig out the longer wire.
  • markustermarkuster Posts: 184
    edited 2013-07-23 14:31
    [QUOTE=The set up is: PC> USB> USB to RS232 > RS422
    (4 wire/full duplex)
    RS422> ttl > Propeller

    The RS422 to ttl chip is a 5 Volt sn75179 ( just one chip required) at the Propeller. 120ohm termination on the receiver RS422 inputs.
    Ttl 3.3V. out of the Prop goes into the sn75179 unprotected, ttl 3.3V into the Prop has a 3.9K ohm resistor to protect the Propeller.[/QUOTE]

    Loopy Byteloose :
    Do you have some schematics or picture to undertand how to add the chip and the resistors ?

    It is very important to me to add these extra electronics parts and try to test the comunication .
    Thanks again.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-24 00:50
    For my working 4 wire full-duplex solution I am using a retail RS232-to=RS422 adapter. They sell for about $16 USD now and I you can see one I recommended in Posting #3 above.
    These are NOT suitable for downloading Propeller binaries at a distance. They only provide Tx and Rx.
    You can program in Forth at a distance.

    Yes, I can provide a schematic for the home-built device at the Propeller Proto Board, and will try to have that provided later today

    ~~~~~~~~~~~~~~
    The 6 wire solution got bogged down as I originally hoped that I could use a USB2SER, Series A to convert the USB to serial.
    But it has some unusual i/o wiring (a 10K pullup on the Rx, and 1K on both the Tx and Rx == all at 3.3v). It just doesn't seem to want to work with my 5 volt, sn75179 chip. It won't even work if I don't connect the RST.

    So I am building another RS232 to ttl setup using 2N3904 and 2N3906 transistors to test with sn75179 chips. This is what is causing delays in providing a 6 wire solution.

    There are newer Series B and Series C of the USB2SER that use a different FTDI chip and have a different output design. That might work, but I don't have one to test. And I will not buy one for a while.

    ~~~~~~~~~~~~~~
    Buying RS422 for 5 volt in DIP8 is very handy. DIP8 can have sockets to quickly replace chips if ever they fail.

    For 3.3 Volt, you would likely have to buy SMD chips and may find them a bit harder to buy.

    One has to be careful to protect the 3.3v devices (the Propeller and the USB2SER) when using a 5.0 V chip.
    A simple solution is best. Put a 3.9K resistor on all lines providing a signal into the 3.3 Volt device. All 3.3 V output lines require nothing.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-24 07:08
    Here is the schematic for the end at the Propeller Proto board.

    The RS422 cable is Plus to Plus, Minus to Minus, but Transmit to Receive in both direction as a twisted pair.... no ground required between the computer and the Propeller board.

    R+-
    T+
    R-
    T-
    T-
    R-
    T+
    R+
    640 x 400 - 19K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-24 11:30
    WHOOPS, the device below doesn't have DTR... need for Programing the Propeller.

    Hi all,
    This device appears to have Tx, Rx, RTS, and CTS in an 8 wire RS422 setup... plus some very nice electrical protection from ESD (think thunder and lightning).
    It is a little expensive, no worrying out powering via a wallwart/

    See page 14 of the PDF they provide to verify all 8 lines.

    http://www.easysync-ltd.com/product/555/usb2-f-6001-pcb.html

    Sorry, I though this was good -- no DTR. It seems that you MUST DIY a solution for RS422 for loading binaries.. nothing available as a complete solution... at least not cheaply.
  • markustermarkuster Posts: 184
    edited 2013-07-24 15:25
    Hi Loopy Byteloose, Thanks for the schematics !!! :

    I bought two of these:
    https://www.rs232-converters.com/RS232_to_RS422_Converters/RS232_to_RS485_RS422_Converter.htm
    ( They will arrive soon )

    Do you know if I can use the chip sn75176 instead of your chip sn75179 ? .

    I have a friend that could give me the sn75176.

    Could you confirm please?

    Thanks again,
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-25 06:10
    Hi

    The sn75176 combined the driver and the reciever, so you need 2 chips to have full duplex... one for each direction. And you have to wire the RE_ and the DE to get the right direction. Peter provided a schematic that uses those. One chip would be a dedicated Reciever and the other would be a dedicated Driver.

    The sn75179 has SEPARATED driver and reciever sections, so you need only 1 chip to have full duplex... One chip that does a full duplex.

    Both will work fine.. if you can sort out the wiring.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-25 12:03
    Here is the PDF for the 75176 to help you get the wiring right. Peter used a different chip that may have a different pin out.

    I also include a copy of the 75179 PDF for comparison.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-27 09:50
    Had to go shopping as my spool of solder finally ran out. It took about 10 years. Anyway, while at the store I found a 50 meter CAT5 cable for less than $10 USD and decide to test the RS232 to RS422 with this... over 150 feet.

    That seemed like an excellent test of my RS422 setup. I doubt if I will ever get testing to the 4000 feet limit or beyond (that requires I build RS422 repeaters), but this seemed worthwhile.

    Testing with pfth083 Forth on the Propeller and 50 meters of wire, everything works fine at th 115200 baud.

    And I am pretty sure I could double that without a problem for PropForth... though the store bought device claims the 115200 limit.


    ^^^^^^^^^^

    Since I already had the 4 wire solution working before on a short wire, this isn't much in the way of news. But I have been quiet recently because I was building the 6 wire solution that will allow loading Propeller binaries at 150 feet as well. That is the next phase. I will report back soon as I am ready to test that with the 50 meter CAT5 cable as well.

    I suspect that 500 feet is easily dbable, but I am not going to buy longer and longer wires just for bench testing. DIY repeaters at 4000 foot intervals are not that hard to build, but powering them might be tricky in remote areas -- maybe a battery and solar cell charger.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-07-29 09:22
    Finally....
    After a few repairs and rebuilds, I now have an RS232 to RS422 setup that is programing over 50 meters of CAT5 a Propeller Proto Board (or any Propeller that can be hooked up via P31, P30, and Reset).

    Since the RS422 driver/receiver chips I am using are 5 Volt, I decided to use a MAX232 for RS232 interface. I initially had difficulty with crosstalk as my Rx and Tx from the MAX232 were parallel and close together.

    Also, I tried driving the Reset without an open collector configuration and just a 3.9K resistor. That did not work. Propeller not seen by Propeller Tool. So I used a 10pf capaciftor and Peter's wiring detail to get a good reset.

    The good open collector setup programed on the first try and repeatedly. I am easily running at 115200 baud. I may try faster yet.
    I am running a USB to RS232 adapter from a Toshiba notebook. And at least for me, this is easier than building a direct USB to RS422.

    I suspect it can be done with a Sparkfun USB to ttl breakout board ($20 USD) and the right 3.3V RS422 drvier/receiver chips. But I just went with what I had on hand and what was available in Kaohsiung for a total cost of about $5 USD.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-08-01 05:42
    I learned a lot in building this. At the PC end, if you need USB and don't have RS232, FTDI actually sells a very nice USB to RS422 dongle with 1.8 meters of 9 wire cable attached.

    All you have to do is to solder a DB-9 to the end of it and cover it in a housing. Then you get an RJ45 to DB9 breakout adapter to make the device plug directly into and CAT5 cable.

    *******
    At the Propeller end, you still have to build RS422 to ttl, but it isn't really that hard. I used an RS45 socket that had 8 wires attached to make the jump to a tiny daughter board that has two sn75179s and a 2n3904 for the Reset. The daughter board gets 5V from the Propeller Proto Board.

    This is a great setup for lab and industrial controller installations. It eliminates the need to walk back and forth to reload the Propeller code. And works great with Forth.
  • markustermarkuster Posts: 184
    edited 2013-08-08 09:48
    Hi Loopy Byteloose and all the people that is helping me here :

    I am following your suggestion to use 422.

    But, sorry for ask again. But why 485 converters are more popular than 422 converters ?
    I tried to understand at wiki but it is a little difficult for me. It seems 485 can n connect with more propellers than 422.

    Thanks ,
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-08-09 10:02
    Why are RS485 converters more popular than RS422?

    I am not sure that they are.

    A. It might be that the higher number is more appealing.
    B. It might be that the RS485 was more popular because half-duplex was most common in the beginning.
    C. It might be that RS485 is best for Master/Slave configurations (and so, half-duplex saves wire). Yes RS485 can communicate on one pair of wire because it is half-duplex.
    D. It might be a lot of the vendors just don't understand the differences so they have RS422 devices that they claim are RS422/485 devices... just because they will work with both.


    I recommended the RS422 just because it will allow full duplex. If you really use the pair of devices you purchased from one PC to another (Linux will do this very nicely), the full duplex is very handy.

    BTW, full-duplex also allows you to do loop-back tests to check your wiring all along the line. I can't seem to figure out how to do that in half-duplex without having a device first receive the message, wait a moment, and then return it.. after switching from Rx to Tx and hoping the other side has switched from Tx to Rx.
  • markustermarkuster Posts: 184
    edited 2013-08-29 14:40
    Hi Loopy Byteloose :

    I can't work with the INDUSTRIAL RS232 TO
    RS422 CONVERTER (Code CON-485/422-PI9 ) I bought. I don't know where is the problem. I thaught could be easier.

    Here is the link :
    http://www.rs232-converters.com/RS232_to_RS422_Converters/RS232_to_RS485_RS422_Converter.htm

    I think , perhaps could be a better idea if I bought an adaptor from the propeller USB
    to the PC like this:

    http://www.rs232-converters.com/single_usb_to_rs422_converter.htm

    I have sent several e-mails to the company called http://www.rs232-converters.com , I have called twice
    and I tried to use the chat they have and nobody answer me. The tech. support is very bad there .
    I think the tech. support of Parallax is to much better.

    Thanks.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-08-30 08:25
    Hi,
    Sorry to hear the ventor is unresponsive. But the device may still be good and working right.

    To begin with, you should be able to do a loop back test with one RS232 to RS422 device connected to your computer to verify that software and hardware is A-Okay.

    I did this with mine and it was easy. http://www.bb-elec.com/Learning-Center/All-White-Papers/Serial/RS-422-Loopback-Connections-Illustration.aspx

    I think you just have to connet T+ to R+ and T- to R- for a good Loopback test rig. You have to also configure the jumpers for RS422 with 120ohm. Return to your vendors page for details.

    Your device's web site also explains how to do a Loopback with with ONE device in the first paragraph of their Trouble Shooting section. It pretty much says what I am telling you above.

    ++++++++++

    If you can't get that done, you may either have setup problems or hardware problems closer to the computer . You can do another RS232 loopback with the RS232 to RS422 converter removed to verify it is or is NOT the converter that is at fault.

    If the RS232 alone Loopback is okay... the device may not be getting adequate power from the other RS232 pins... like it is suppose to or you may have not configured the jumpers correctly..

    Here is how to build a RS232 Loopback. I have a female DB9 built for this that I keep handy

    http://www.ni.com/white-paper/3450/en

    #####################

    Yes there is a bit of learning curve with long distance communications, but starting with LoopBack Test assures that you check one end at a time for problems. Once you get the end at the PC working right and verified, you can then focus on checking if the end at the Propeller is setup right.

    You will waste a lot of time going back and forth if you skip the Loopback testing.

    After that, I have had to check the cables for right wiring and continuity as well with a VOM.

    So you start at the Computer and work toward the distant site.

    +++++++++++++++++++
    I have a device that is a little different.
    Yours is powered entirely from the RS232 port via data and/or extra lines that may have to be set active in software; Mine is suppose to do that, but can take a 9 Volt independent source for power as well... so I use a 9 VDC battery.

    So, it is important to do the Loopback testing to verify you have actually got power to the device. It is unclear to me how high the RS232 signal volatage should be to allow it to properly operate, you might need +5Volts, you might need higher.

    #######################
    If you need a Windows application to get the serial port working right, you might consider using RealTerm as it will allow you to control all the pins that are suppose to power your device. It is free and very handy. It will help you verify exactly how to configure any other serial terminal software you choose to use.

    http://realterm.sourceforge.net/


    +++++++++++++++++++++

    BTW, since we last chatted I have built actually two complete set ups, and retired my first build as it didn't work well... the construction was too sloppy. Neatness does count. And be sure to use tiwisted pairs on the RS422 lines to keep out noise.
  • markustermarkuster Posts: 184
    edited 2013-09-02 19:25
    Hi Loopy Byteloose:

    Perhaps the problem is because the Propeller works with very low voltage . Could be this the problem ?

    And the other question is if you know if the Propeller is compatible with USB 1.1 ?

    Thanks again Loopy Byteloose .
Sign In or Register to comment.