I need to know the best cable.
markuster
Posts: 184
Hi again ,
I need to keep one Propeller connected to my PC with the DB9.
My problem is I need to know the maximum lenght of the serial cable.
I need to ensure good comunication
even in long distances.
Do you know the best characteristics I have to have on mind before buy
a really good interface cable ?
Thanks,
I need to keep one Propeller connected to my PC with the DB9.
My problem is I need to know the maximum lenght of the serial cable.
I need to ensure good comunication
even in long distances.
Do you know the best characteristics I have to have on mind before buy
a really good interface cable ?
Thanks,
Comments
Sparkfun has a few interesting modules:
https://www.sparkfun.com/categories/16
-John
EDIT: If you want even longer range, perhaps you could consider a big-daddy 1km module:
http://lairdtech.thomasnet.com/item/all-categories/bluetooth-module-with-power-amplifier/btm404?&plpver=10&origin=keyword&filter=&by=prod
http://www.monoprice.com/products/product.asp?c_id=102&cp_id=10212&cs_id=1021201&p_id=441&seq=1&format=2
We also use them with the gender adapters shown on that page under the "customers who bought this also bought...."
This is not just about 'good wire'. Unlike RS422/485 that uses a 'differential mode' to keep out noise, RS232 doesn't, so I have doubts that a twisted pair of wires is any better than plain old wire. 24 gauge telephone wire is likely to be adequate.
The issue of shielding might come into play if you have a lot of inductive interferances -- from electrical motors or banks of flourescent lighting. If you do use shielded wire, only ground it at ONE end to avoid creating a 'ground loop problem'.
If you don't need Propeller Programing at a distance, there are DB9 modules that convert RS232 to RS422 that work nicely and are cheap.
Here is one that claims 4000 feet. Cost is about $16 USD. RS422 provides full-duplex over 4 wires/2 twisted pairs; RS485 provides half-duplex over 2 wires/1 twisted pair.
http://www.rs232-converters.com/RS232_to_RS422_Converters/RS232_to_RS422_Converter.htm
https://www.rs232-converters.com/RS232_to_RS422_Converters/RS232_to_RS485_RS422_Converter.htm
Luck does run out at the worst possible moment. And if you're looking for "best cables", packaged cable "quality"
is a nebulous and unrepeatable thing. And if you're using RS232, there's a big variation in the signaling levels
used by different PCs, they seldom meet RS232 specs, so it's even more difficult to say much without knowing
exactly what you're doing.
Many of us know that the RS232 specification is +12/-12, but modern laptops and motherboards may provide +5/0 instead, or even +3.3/0. So I am qualifying with the 'average', but there really is no real average out their. Just a lot of devices that work regardless of not following the standard.
One can use RS422 full-duplex, but it doesn't have the RST for programing.
We talked about this at great length recently in another thread that was using a USB extension cord for long distance Propeller programing... a bit expensive to reach 100 or more feet.
I have a RS422 with RST (3 twisted parts/ 6 wires) sitting on my desk that I built (for less than $15USD), but it didn't work for some reason... so I need to trouble-shoot it.
Now seems like a good time to get it working. I will report back soon. If that works, it can nicely reach 4000 feet... which I will never need.
I need 120 feet of cable.
I found at ebay an USB to RJ45 cable extender (150 feet) but it is for USB 1.1 and I don't understand
if I can use USB 1.1 with the Propeller. Do you know if I can use it ?
The product link is this:
http://www.ebay.com/itm/USB-OVER-RJ45-CAT5E-5E-CAT6-CABLE-EXTENSION-EXTENDER-CABLE-ADAPTER-UP-TO-150FT-/280946935693
(or The ebay code is 280946935693)
Thanks again.
Are you using a Propeller board witha USB programming port? It should work with USB 1.1.
Of course, nobody can really say for sure that it really will or will not. We had another thread with someone that was disappointed with a similar device. But we also had several people that felt the device was excellent. These devices vary greatly in device and origin. The cheapest are on EBay and out of China.
You didn't say if you needed to program the Propeller or you just needed communications. That detail is an important difference.
I guess you are considering USB instead of a DB9 serial port.
http://www.differencebetween.net/technology/difference-between-usb-1-1-and-2-0/
The ebay link does not have anything to do with a DB9 as posted in your original post.
You need a DB9 Serial to USB on the PC side, and the you could use that extender. But be aware you probably can not program a Propeller with this scenario, but you could pass data.
50 feet on standard RS232 in considered the max on standard cable.
Just to follow up.
My homebrew 3 twisted pair/ 6wire set up is still not right. But I think that if it is fixable, I should know in a day or two. I have wanted a long-distance ability to program the Propeller for ages and I think I am very near with this build.
Some USB via RJ45 devices do work nicely with programing the Propeller over distances up to 150'. But asking for a recommendation of one of the least expensive on EBay is a shot-in-the-dark. You never know if you are going to find someone else that bought exactly what you want and is satisfied with it. Sometimes you win, other times nothing.
But I am certainly going to keep trying for a RS-232 to RS422 solution with RST as 4000 feet is a lot more than 150 feet. Plus I don't like USB. It makes things more complicated.
I have two Propeller boards: Propeller Proto Board and Propeller Proto Board with USB
I need just send an infrared sensor detection to a PC using the Parallax PLX-DAQ Data Acquisition for Excel.
I need those 120 feet. And it seems USB-RJ45 could be more easy than other alternative but your opinion and experience
will be very usefull.
thanks again.
Perhaps RS-232 to RS422 solution with RST is better. My problem is that I don't know electronics and some people
told me that I need a chip called MAX232 or something like that and it is a little complicate for me.
But any way , do you have some PDF or some picture to understand how to build this electronics ?
I suppose I will need two of them : one is RS-232 to RS422 and the other is RS422 to RS-232 ( is this ok ? )
Thanks.
Yes the USB-RJ45 solution seems the easiest for you.
I guess you do not need programming for the Propeller at 120 feet, just serial communications.
If you want to build something, you will have to learn a bit.
+++++++++++++++
The MAX232 chip is very popular for RS232 driver/receiver interface and will work to convert RS232 to ttl. But if you look at the BasicStamp2, Parallax just used transistors.. simpler, cheaper, and in most cases just as reliable.
Manufacturers don't buy and use every good chip that comes out as they are cost sensitive and there are cheaper ways to get good results in many cases. The MAX232 is simpler for hobbyist and beginners and will work nicely inside an adapter for RS232 to RS422 with RST for programing the Propeller.
But this isn't what I built. I would have to redesign and draw up another schematic if you want to use that.
So, the real question are [a] Should you use an RS422 solution with RST, or Should you buy an USB to USB via RJ45?
IN answering [a], my own build is not yet working. I did spend a few hours on it this morning, but haven't found out why. I don't feel comfortable providing a schematic that is unproven. There are other schematics posted in another thread, but I am not sure you need all the protection that they added to the basic circuit. The design was for something outdoor, like controlling traffic lights and protection from thunderstorms with lightning.
Also, my desgin is using USB to RS422 with RST, and then RS422 with RST to 3.3volt logic. The USB to RS422 is using a USB2SER adapter. But if you want your DB9 RS232, you could use a MAX232 for RS232 to RS422.
In answering , For $5.30, that device is very attractive. It may or may not program. But you need a USB port at your computer, and you need either a Propeller board with USB or and adapter such as the Prop Plug to connect to the Propeller.
~~~~~~
Either way, much depends of what you already have, and how much you are willing to build. Since you have a USB Propeller Protoboard, buying the USB to USB RJ45 should work for communications, and MIGHT work for programing. You are going to spend more time and more money building an RS422 with Reset device.
I am including a photo of what I have built. It uses TWO USB ports (one just for +5V power), a Parallax USB2SER device, and four SN75178 chips to convert to and from RS422 with Reset... a some capacitors and resistors.
~~~~~~
As far as what goes to what for RS422 solutions... starting at your PC.
Starting with a USB...
a. USB to RS422 adapter (likely it does not proivde the Reset)
b. Build or buy a USB to ttl, and then build ttl to RS422 with Reset
Starting with RS232
a. RS232 to RS422 adapter (doesn't provide the Reset)
b. Build RS232 to RS422 with Reset. Start with a DB9, and a MAX232 to convert to ttl, and then conver to RS422 (NOTE- you will need find a +5V or +3.3V source for all the chips)
++++++++++++++++++++++++++++++++
Arriving at the Propeller Proto Board.
a. Via USB - requires another converted from RS422 to USB (adds significant cost and complexity to the build)
b. Via Propeller 3.3 ttl - requires conversion of 3 twisted pairs from RS422 to ttl. (Powered by the Propeller Proto Board and cheap to build.)
For communicating with and programming the Prop you only need three signals which amounts to one and a half RS422 chips or three RS485 chips. Personally I just use the RS485 chips hardwired into rx or tx mode. Of course you need the same thing down the other end.
The circuit is very basic but if you want one I can easily draw up a schematic for you. For the wiring just use 3 pairs from a CAT5 cable, nothing special, the circuit can handle very high speeds and is very noise immune.
BTW, you don't really need a MAX232 chip, the whole RS232 standard as it has been implemented in recent decades allows 0 to 3.3V interface operation without any problems so all you might need is a resistor or two.
One pair of RS422 chips are used with the MAX232; the second pair are used directly with the Propeller Proto Board's ttl.
But Peter seems to have a way to eliminate the MAX232 completely. That is very interesting, but you would have to at least protect the RS422 chips from a negative voltage and an overvoltage.
You have to decide if you want all +5 VDC chips or all +3.3 VDC chips. It is easier to buy +5 VDC, but you have to protect the Propeller chip's inputs with some extra resistors if you do.
A and B are receive with A being Plus and B being minus
Y and Z are transmit with Y being Plus and Z being minus.
Y connects with the distant A
Z connects with the distant B
Nothing works if you do it backwards.
That all seem quite easy... except the DIP chips I am using have the right side ordered A B Z Y, so my whole setup for CAT5 cables is messed up. I think that I will have it working in an hour or so.
The devil is in the details. You want six twisted pairs. If you choose to use CAT5 cables with ordinary RJ45 connectors, there are 4 twisted pairs, but the plug sequence in also not simple and straight forward... the left end is one pair, the right end is one pair, the middle two are a third pair, and the two individual wires remaining are the 4th pair.
In other words, if you don't use RJ45 connectors with standard LAN setup, life is much simpler... but watch out for where that Z is. I completely missed it and wire for ABYZ.
I am attaching the PDF for the chips I am using. You need 2 at each end and they are about 95 cents each.
I set up a new 6 wire cable just a foot long and retested everything... no luck.
The USB2SER works fine directly with the Propeller Proto Board... so it is something in my 2 boards with the 4 RS422 chips.... maybe something obvious I missed.
I suppose I could have just provided a schematic and said this is easy to build. But if I don't have it working for myself, I don't feel good about saying something 'should work'.
At this point, I have not even bothered yet with the Reset feature and programing. I am just trying to have a serial link to a Propeller Proto Board loaded with PropForth ver 5.5. Once I have full-duplex confirmed, then it is time to try reloading the Propeller.
These is all tedious. But that is sometimes the way a DIY project goes.
I thought nobody will send me a reply.
After I read your replies I understood that 485 and 422 are very good alternatives for long distances and I think they are better than USB if I need more distances in the future.
I found this Interface Converter:
http://www.pongee.com/PCT-R2R5.html
BUT I have some questions, just to be sure :
1-- Do you know if this interface converter could help me
to send data to a PC if the distance is 120 feet ?
2-- Do you know if I have to add more electronics to use
this interface converter with my Propeller ?
( This Propeller : http://www.parallax.com/Store/Microcontrollers/PropellerDevelopmentBoards/tabid/514/CategoryID/73/List/0/SortField/0/catpageindex/2/Level/a/ProductID/423/Default.aspx )
3-- It seems I have to use two interface converters. The first one
attached to the Propeller and the second one to the PC ( Is this ok? )
Thanks again.
FF
If you want to program a propeller over 120 feet - that might be a bit complicated.
But if you just want to communicate - that is easy. Just decrease the baud rate. As an extreme example, you can many kilometres at 300 baud. Just a rough guess for 120 feet based on experience running unshielded wires around the place, I think you could get 9600 baud to work, but 19200 might be too fast (the propeller programs at 115200).
What I like to do with my boards is put a RS232 D9 connection on the board and a max3232 to program the propeller. Use a USB to D9 cable. Then, once the prop is programmed, use the same cable/wires as a comms setup, so there are no hardware changes needed. Just grab a serial object from the obex for the propeller side, and on the PC side, use multiple languages to talk to the serial port. Even an old school terminal program. Start with slow baud rates over long distances and gradually increase the rate till errors appear, then drop the rate to maybe 1/4 of this so it is reliable. You don't even need fancy RS232 signal levels. As Peter says in post #15, you can even use 0 and 3V3 directly off a propeller pin. Maybe add a resistor like 1k in series to protect against shorts. I've run these signals 500m or so at 1200baud with no problems.
The problem with just shopping the internet is you may not understand what you are looking at.
A. That is a RS485 solution that is HALF-Duplex and uses 1 twisted pair. I previously recommended RS422 which is FULL-Duplex and usis 2 twist pairs.
If you don't know what Half-duplex and Full-duplex are, you need to learn.
B. That is ONLY one end. You have to provide another conversion from RS422 or RS485 to ttl 3.3 volt at the Propeller end.
Without reset, One chip can do it all. The solution I have is +5 volt (the SN75179 chip), but there are +3.3 volt RS422 and RS485 chips out there.
~~~~~~~~~
We the Parallax Proto Board, you DO need another converted at the Proto Board end.
At the computer - RS232 to RS422 <=============>At the Proto Board, RS422 to 3.3 volt ttl.
Maxim has 3.3 volt RS422 FULL DUPLEX chips.
~~~~~~~~~~
My own project is a mess. It seems that trying to use a PropToll or a USB2SER with RS422 is not working. Today I did a loop-back test to see if the USB2SER device at least would talk to itself... not luck.
My overall impression is that a DIY build is easier for with RS232 to RS422 than USB to RS422. I guess I have to start over.
Here is a schematic for RS232 DB9 to RS422 (also has a DB9) that is pretty good. But becareful, that is a MAX233, not a 232 and wiring appears different... less capacitors.
You only need 3 wires to do so, but CAT5 wire is so cheap with 4 twisted pairs (8 wires), you can use that and grow into it.
Or you can use 4 wire telephone wire for the RS232 and later to try RS422 at Full-duplex.
Half-duplex can be more trouble that it is worth. Sure, you have only 2 wires; but transmit and receive can collide unless you have established one device as a Master (sends first) and the other as a Slave (Listens and waits, then replies only when sure).
Half-duplex software will work fine on Full-duplex wiring ==> SO Use RS422, NOT RS485. You will be happy to did.
It is the simplest build and gets you started.
Later, you go over to RS422. I am going to try another build without the USB2SER and , maybe starting without the ability to program.
Since RS232 (chips) these days is not compliant with the original 60's standard partly because it has to deal with 0-5V system and so is quite happy to accept anything 2V or more as signal and anything 1.2V or less as an idle condition then we simply current limit any +/- signal it sends and invert the signal simply by swapping the polarity of the balanced lines. Remove redundancies and improve reliability. (The circuit is missing an optional termination resistor)
Thanks for posting the schematic. I have been breaking down everything I built and doing loop-back tests as results so far have been nil.
Everything looks right excepting a missing 120 ohm termination resistor in the lower right hand corner where the RES recieves. I suspect the next step for me to start over and build according to your schematic.... adding a MAX232 and a DB9 ot the left hand portion.
As mentioned the termination resistor is missing but considering the type of signal that's used I doubt very much that it would make any difference. This schematic does not require what I really consider a redundant RS232 chip, it won't work any better or worse with it but it is redundant. Check the datasheets and do your maths if you like but you don't need it, not even for "safety".
That 'redundant RS232 chip' actually inverts the signal logic.. and it seems that the inversion might be necessary to provide correct ttl levels into the RS422 chips.
I have gotten an off-the-shelf DB9 RS232 to RS422 adapter communicating with a Propeller Proto Board (finally), but I am getting strings and strings of garbage.
Either the baud rate at 230400 is too high, or everything is inverted. I am trying to slow down the baud in a recompiled of PropForth (via a USB2SER programer), and will report back. After I get good full-duplex RS422, I will then try to get that Reset right.
In my case, it seems like a speed problem since every time I hit enter, I get another line of garbage. So it seems that the CR is being properly recieved.
Preliminary Loopback test of just the DB9 RS232 to RS422 adapter seem to indicate that errors might creep in over 57600 baud in my bench setup. (I know you get 3M baud with direct USB).
Take a look at how Parallax's own RS232 solution uses transistors to invert the received RS232 to Propeller ttl.
http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/SerialtoPropeller.pdf
Actually, the RS422 chip inverts the signal simply by swapping the outputs or inputs as I mentioned. You mentioned you had an OTS RS422 cable but what are you using on the Prop end? If you are going from RS232 then you probably won't be able to achieve 230400 baud reliably as the drivers are slew rate limited and switching between a -6 to a +6 voltage takes more time than a few hundred millivolts or 3V or a balanced line. RS232 should be fine for 115200 baud and less otherwise you need USB-RS422. The garbage you are receiving does seem to indicate inversion so try swapping the polarity!
Yes, the over-the-counter RS232-RS422 has documentation (all in Chinese of course) that mention the top baud rate at 115,200.
That seems to be the regular deal with these $16 USD units. Mine is suppose to be powered directly from the RS232 port, so it blocks use of all lines other than the Rx and Tx by trying to get power from them. And in my case, it will take an outside power supply if needed at 9 volts. (Some don't have this feature, others will take only 5 volts. You have to shop carefully to be sure you get one that is simple for you). I am just using a 9V battery.
My USB2SER device is working again, so I reloaded the Propeller Proto Board with a much saner 19200 baud and all seems well with full duplex communication other than the trash.
Yes, a lot of the RS422 chips do limit their baud rate to be less sensitive to electrical problems that arise in long lines.
This certainly is never going to be 3Mbaud rate that you get with Tachyon via a USB to USB connection. But having cheap uber-distance Propeller programing that is hard-wire is coming together.
I also have to go back and insert the Open Collector transistor modification to the RST_ signal line on the board that interfaces with the Propeller... I was just trying to pull the line low without the extra wiring - so I need to insert a .01uf cap, a NPN transistor and the 33K ohm resistor.
I am using 5 volt RS422 Driver/ Receiver chips with the 3.3K resistors protecting the Propeller i/o.. seems to be working.
See below for a photo of the bench test ( just 1 foot of wire) for this device. It works and should handle 120 feet without a problem, but it won't program --- only Rx and Tx
After all t is good at interface to the Propeller Proto Board, I will try to work out what I did wrong (or right) at PC end.
So I am still struggling ... not 100% yet.
BTW, I don't use USB to USB connections at all, it's only ever USB down at the PC end. Don't forget that balanced lines need twisted pair so that any injected noise tends to even out and of course gets canceled out due to the differential receivers.
So rather than provide a lot of non-sense, I just have to step back and resolve my computer problems before I can finished this.
I enthusiastically agree with you Peter -- just USB to ttl and then to RS422 is ideal, USB to RS232 to RS422 is a second choice.
I really want to finish this project, but it is going to take time.