rs232c and cmos/ttl--one connector  - Page 1
Forum section: electronics / projects

author: phenol
author_rank: Regular Contributor
timestamp: August 03, 2017, 04:09:38 am
content: I want to switch between rs232 (-12...+12v) and standard cmos uart levels (3.3v) by flipping a single spst switch. The tricky bit is that there's only one connector available for both signal types.The microcontroller has two tx lines and one rx line. I cannot use mechanical relays or arrays of switches.Any elegant ways of getting it done? there are certain analog muxes that can accept bipolar supplies (not available on the board) and handle negative voltages on the inputs and still others that have a charge pump built in and work off a single positive voltage. The versatility of the latter seems restricted to one particular brand (maxim, "beyond the rails") and it would take 3 such spdt switches to get the job done.the uart speed is 115kbps max, so i guess i could use discretes (transistors and pullup resistors) in tandem with a 232 transceiver with transmitters that can be 3-stated(sn65c3222), but doing so is going to result in less than perfect "cmos" performance when in that mode.

author: jbb
author_rank: Super Contributor
timestamp: August 03, 2017, 07:53:31 am
content: At risk of sounding like a grumpy bastard, I think this scheme might be a bad idea. Eventually someone will have the switch in the wrong place. You can design your equipment to survive, but will the other equipment that's been plugged in survive too?Depending on your needs, volume etc. a custom cable with an RS232 converter in it might be a solution. (I work in manufacturing and feel a bit dirty saying this, 'cause custom cables are a scourge and horror.)

author: phenol
author_rank: Regular Contributor
timestamp: August 03, 2017, 08:02:19 am
content: The scheme IS a bad idea for many reasons, but it's a requirement coming from the end customer (or rather a lousy product manager)_

author: jbb
author_rank: Super Contributor
timestamp: August 03, 2017, 08:07:42 am
content: Quote from: phenol on August 03, 2017, 08:02:19 amWell, you have my sympathies. Remember to write him/her an email saying that it's likely to result in broken equipment somewhere, somewhen.Deploying analog MUX type chips may be your best move. You can possibly tap off the +ve and -ve rails of the RS232 converter to get the voltage rails you need, or deploy your own extra power supply. Refer BOM cost increases to your product manager...Re custom cables... on a couple of minutes' further thought, my previous hate was a bit extreme.I feel that custom cables can be a pain in the production environment for three reasons:They take longer to order and cost more than standard cables.They tie up engineering, supply chain management and production staff.They lead toSKU proliferationand increased inventory cost (if you need to support stuff after sale).The sales team are not responsible for the above issues, and start thinking that they can do custom cables for everyone. Remember, their incentives are around making sales. Remember also that if they didn't sell anything the company would have no income and we wouldn't get paid.So think carefully before you open Pandora's box (of random cables).

author: phenol
author_rank: Regular Contributor
timestamp: August 03, 2017, 08:57:06 am
content: well, we are a vivid example where sku proliferation has spun out of control, leading to ever so increasing number low-velocity items in the warehouse. This fault arises from the fact that certain business developers here feel the need to respond to just about ANY random customization and design request.Supply chain management woes aside, I've been eyeballing these for a while now:https://datasheets.maximintegrated.com/en/ds/MAX14759-MAX14763.pdf

author: David Hess
author_rank: Super Contributor
timestamp: August 03, 2017, 02:58:51 pm
content: I have seen this done before with some type of switch matrix like changing a group of jumpers or dip switches.The same receiver could be used for logic level and RS-232 level inputs if it is tolerant of RS-232 levels. Inversion may need to be selectable and on the transmitter also. This is easy to do with an analog comparator.RS-232 transmitters which support shutdown, tristate their outputs so one could be placed in parallel with a logic level driver that also supports tristate operation. That leaves finding a logic level driver which is tolerant of RS-232 levels when tristated or shutdown.If I could not find a logic level driver tolerant of RS-232 levels, then I would probably design a discrete level shifter which supports two different sets of levels. Some RS-232 drivers may already be able to do this by altering their supply voltages. There are some fun closed loop analog ways to do this using a clamped integrator and buffer (1) which would produce perfect outputs but I would try to find something simpler.Since an RS-232 port will normally always produce RS-232 levels, automatic detection should be possible but I am not sanguine about reliability.I would not even try to multiplex the RS-232 side.(1) More capable pulse generators work this way to support variable levels and variable slew rates.