RS-232 repeater at reasonable DIY cost
LoopyByteloose
Posts: 12,537
I was looking for a low voltage RS-485 tranciever at Maxim and I noticed an interesting schematic in their documents.· They simply connect the TTL Tx to the TTL Rx to create a very reasonable, high quality RS-485 tranciever.
What came to mind is the extra pins on the MAX232.· One might be able to similarlyconnect the TTL RX1 to TX2 and TX1 to RX2.· In this way, you have a nice little RS-232 repeater that is very compact and possible for battery operation.
Has anyone ever done this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
What came to mind is the extra pins on the MAX232.· One might be able to similarlyconnect the TTL RX1 to TX2 and TX1 to RX2.· In this way, you have a nice little RS-232 repeater that is very compact and possible for battery operation.
Has anyone ever done this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Comments
The logger was outputting rs232 formats but at a 5V level (in essence TTL levels)....this didn't cut it, so I took a wire wrap chip carrier and mounted a MAX232CPE. Then just soldered the additional components right to the long legs....put it in a zip lock bag and taped up the end with 2 db9 tails coming off of it and just put it inline.
Got lucky that pin1 of the logger was +5Vdc for power.....so I didn't need any power supply circuitry. Nice and compact.
I would suggest, however, to get the MAX232 chip that has the capacitors integrated in the die (smaller footprint in the end!).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
The Ziplock bag is a nice detail. I used to used them on all the power supplies behind the desk that support my computer [noparse][[/noparse]Being down and under, they are real dust catchers and I worry about eventual moisture and spills].
One day I was short of ziplocks, so I tryied saran wrap. Seems a little tigher and neater, so I switched.
Maxim has low power features and a chip that works down to 3.3v, so I am actually thinking of an outdoor repeater with solar recharger.
This really allows you to build a lot of home automation / remote control around the BasicStamp.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
When running wires to these things...you typically only need pins 2,3 &5 (tx/rx/gnd)....but run an extra pair and use that to power these repeaters!
That way you just have to plug things inline...rather than having to try and find a power source and run a brick to it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
That makes a lot of sense. Even if I have one +5volts source, the new low voltage MAX3232 would function fine under a voltage drop. It maybe even be harder to buy 3 wires than 4.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Have pulled cables through hotels and the drywallers/carpenters have spiked the conduits with my cable in it.
Luckily we ran cat5 (4pair) for phone (just needed 1 pair)....so we only had one problem where a wire was totally bad.
Of course, the more wires...the more $$ unless it's network cable...which is way too cheap these days!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
· For long cable runs, consider a RS-422 driver/receiver scheme with DS75176 (or sim.) in conjunction with MAX232.
I really like the RS-422 and RS-485 hardware, but.......
You don't need the RS-232 (but it is nice for an interface to your PC) to do that.
You can just go straight to RS-422 or RS-485 from TTL and back again for Stamp to Stamp applications.
Also, I think you would need 4 chips.
What I was talking about requires only 1 chip in the middle of a long wire run. Apparently, if you go down to 300 BAUD you can get 1000 feet with just RS-232. Slow, but if you already have the hardware and software, maybe the speed is not necessary.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
· And, yes, the DS75176 requires that tx/rx (DE & /RE) be asserted accordingly, like hand-shaking,·because the 422 I/O are in parallel (one goes Hi-Z when the other is selected.)· So, you·do need one for RX and one for TX on both ends (but you can use DTR, DSR, RTS, CTS·to control the 75176's·DE & /RE) when you're going wholly asynchronous, nothing-but-RD/TD.· They're surprisingly inexpensive.
· The "50m" figure often cited for RS232 lengths is The Standard's requirement (i.e. -- MIN) and that's at top speed (which, I believe, is 19.2kbps.)· With slower speeds, greater distances can/will be achieved.· At 300 bps, you might get as much as 4,000 feet (but not with #24 twin-lead or anything like that.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
I·think that I meant to write·50 feet.·
I have before me here The Art of Electronics, not they're/it's the final authority,·but there's a table of "Serial Data Standards" and it has RS232 with a Max data rate of 20kbps and a max. cable length of 15m, with RS422 10Mbps and 1200m.
At the following link, Maxim refers to this "15 meter" thing, too:· http://www.maxim-ic.com/appnotes.cfm/appnote_number/83
I think that it was meant, to be compliant, that·COMM (signal levels)·would have to be good·at·20kbps over not less than 15m (and if 20, 50, or 100m, then more the better.)· But I often hear, like I·bet you have, too, steve_b,·this 50 feet figure bandied about as though it was Scripture.
(KN -- "Well, this cable is 100 feet and the max on rs232 is 50 feet, puffer, puffer, so let's go dart at windmills since I can't see any straws to grasp at."·· PJ -- "No man, that ain't it, we're only doing '1200'.· So, I suggest that you take off that heat-shrink and solder those wires in properly this time.")
AT the BB electronics site ( www.bb-elec.com/RS232.asp ) they mention several hundred feet at 9600baud and lower!
**All dependant on noise/grounding...
Here's a site where a guy gives tips on getting long runs with rs232
www.marcspages.co.uk/tech/long232.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
· Too true.
· B & B has a lot of cool stuff for interconnect/COMMs.
Gunther pointed me back to using RS-232 at 300 Baud as I was looking int0 RS-485 and he wondered why I needed all the speed as well as distance.
Over the past six months, reading standards and hardware specs has taken me on a big circle from RS-232 to RS-485 to CANbus to Internet and back to RS-232.
While the reading and knowledge gained is quite helpful, in most cases a RS-232 repeater will help out a couple of Stamps just fine.
Yes B & B has tons of cool stuff, but one repeater is likely to cost $50USD. They have always been a supplier for the general market, not the DIY hobbyist.
So I was very happy to see that in one afternoon I could build a $5 repeater. In this way, I could spend more money on Stamps or other more complex support chips.
The·'Marc's technical page'·article is very good on how to use your wire wisely to gain better quality. There are quite a few choices of wire and Gunther even suggested to me that you could boost the RS-232 to 24volt as a resonable alternative and run it on very cheap wire.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
please get me right, if you boost RS-232 up to 24Volt, it is no longer RS-232, as this is not in the specs - it is your own proprietary protocol then but there is not reason why you should not do it when it saves you money, and works reliably for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
What's the laptop version of rs232 (in that it's rs232 at 5volt levels)??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."