UART Multiplexing

I need an IC to share a UART between two devices. The TX/RX voltage will range between 3.3V and 5V. The data rate is 115,200 bps. I've found a few IC's capable of handling this but they are all so expensive (ex: MAX399 @ $2.70 in qty 2500). Any other suggestions?

--------------------------------------- Posted through

formatting link

Reply to
eeboy
Loading thread data ...

How many lines do you have to do the selecting? What do you mean 3.3 and 5V? Will you need to level translate? What power supply will you be running the mux at?

Reply to
a7yvm109gf5d1

Yes, try some standard parts like 4051,2,3. MAX* are usually expensive custom parts.

Reply to
linnix

So... a micro and two devices involved. The micro and one of the devices both run at 3.3V. The other device runs at 5.0V. I currently have the 5.0V device communicating with the 3.3V micro with no problems. It's 5.0V tolerant.

The mux will be running at 3.3V so it will have to be 5.0V tolerant... or I will have to perform some level translation which I'd rather not do (another component).

I can free up multiple I/O pins to do the selecting but would prefer to utilize a single I/O pin to select between device A or device B (1=A,

0=B).

--------------------------------------- Posted through

formatting link

Reply to
eeboy

Sounds quite desperate trying to multiplex the UART.

Are the devices addressable ? If so, an open collector (wired-OR) bus with 5 V tolerant devices should do the trick.

Could an external dual-UART be used (communicating with the controller e.g. using I2C) ?

If you end up into a dead end (cost, availability), you may have to step back a few levels and look at the broader picture.

Reply to
Paul Keinanen

HC4053 with diode clamps/resistors to get 5V tolerance....gives you 3 lines of mux.

Reply to
TTman

Huh? You aren't planning on switching the signals *on* the EIA232 interface, are you? I.e., I assume you have one UART that wants to talk to two different "external" devices.

If so, install your EIA232 level translators connected to the pins of the "external connectors" (i.e. DB9's or DB25's). Now, you have all "logic level" signals to play with (3V or 5V depending on the translators you chose).

Put a (logically, OR) gate in series with each output (Tx) signal (before getting to the level translator. Drive a signal to the other input of each gate -- use that signal for one of the gates and the complement of that signal for the other (this can be one signal passing through an inverter -- or, two signals that you deliberately drive in complementary fashion from the processor).

Whichever external device is NOT in use has this "control input" driven HIGH. This forces the EIA232 driver to emit a marking condition regardless of the state of the actual Tx signal from the *real* UART.

Meanwhile, use a 2-to-1 mux to combine the Rx signals from the translators into a genuine Rx signal fed to the UART. Drive the "select" input with the same control signal used for the Tx circuitry. This causes the input from one of the Rx paths to be ignored in favor of the other.

By careful choice of gates, you can probably fabricate the mux out of spare gates left over from the gating of the Tx signal(s).

Or, have I totally misunderstood your question?

Reply to
D Yuniskis

74HC4051
--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
nico@nctdevpuntnl (punt=.)
--------------------------------------------------------------
Reply to
Nico Coesel

On a sunny day (Fri, 09 Apr 2010 20:21:08 -0500) it happened "eeboy" wrote in :

between 3.3V and 5V. The data rate is 115,200 bps.

(ex: MAX399 @$2.70 in qty 2500). Any other

PIC

LOL And that can probably replace your devices too.

Reply to
Jan Panteltje

PIC. (no LOL)

Reply to
David Eather

I presume you mean one CPU or bus, one UART, and two serial ports? Two busses or two CPUs is a tad harder.

At 115,200 bps, it's not simple EIA-232, could (depending on the UART) be synchronous, asynchronous... there are LOTS of protocols out there. Most of the replies are about 2:1 input selection and 1:2 output switching, BUT you also have to clear the FIFO buffer in the UART, and arrange a correct handshake signal sent to the inactive port (usually the RTS signal if it were EIA-232). Why not use a dual UART? There's lots around, even quad and octal. Z8530 is a classic choice (Z85C3008 typical part number).

Reply to
whit3rd

"eeboy", Are you just a shill trying to "seed" your web page hookup to this usenet thread?

You want to apply LOTS of engineering time because a $2.70 part is too expensive for your one-off project?

What you're describing is an electronic version of an A/B switch, correct?

Why wouldn't 9600 Baud do the job?

If you're using 115K Baud will you be using all of the SECONDARY RS232 pins/lines as well?

formatting link

Reply to
Greegor

Hmmm... I see nothing in his post to indicate this is "one off".

That's how I have read it. In which case, all of the steering logic can be done on the "low voltage" side as I've indicated in another post (gate the unused TxD to Marking while simultaneously inhibiting input from the deselected RxD).

Shouldn't matter -- except on the translated ("hi voltage") side. There, it usually places limits on cable length.

I've seen scant few products actually use any of these pins. The last that I was involved with only cherry picked some pins (mainly offering alternatives to their counterparts in the primary channel -- e.g., I recall a configuration option in one product that allowed SRTS to be used in lieu of RTS... compatibility with some archaic bit of kit).

One product tried to economize on connector shells by routing it's two serial ports to a single DB25. This went over like a lead balloon -- *everyone* needed an adapter cable to split those two channels back out into their intended separate channels (i.e., cost of the external Y cable vastly exceeded the savings of one less connector shell in the product!).

Also, the secondary channel doesn't (IIRC) support the full complement of signals. Nowadays, you could squeak by without the "extras" (in most cases) as few other devices need/want those signals (OTOH, back in the 70's, RS232 was still much more rigidly implemented -- e.g., the role of the "handshaking" signals has changed over the years from that which was originally laid out)

Reply to
D Yuniskis

This isn't a one off.

Correct.

Because it doesn't fit the application.

One thing I may not have been clear on. The communications from the UART peripheral of the micro is simply logic level asynchronous serial consisting of an RX and TX signal. No handshaking, no RS-232 voltage levels.

--------------------------------------- Posted through

formatting link

Reply to
eeboy

Perhaps. I've got 3 UART peripherals on my micro and 4 UART enabled devices. The 4th device is a new addition, so I am having to retrofit the board. I could implement a software UART, choose another micro with 4 UART peripherals, or multiplex one UART. The last made the most sense to me since this newest device can only operate when the other device is not.

Unfortunately no.

--------------------------------------- Posted through

formatting link

Reply to
eeboy

Sounds like the best solution so far... just don't like that I have to use two (RX and TX) of these large (relative) components.

--------------------------------------- Posted through

formatting link

Reply to
eeboy

there is also a 4052 and 4053 - you don't need two

Reply to
David Eather

Then why are you even *looking* at analog switches/muxes?? They are *slower* than the logic gating that I have described and have capabilities you don't need!

Reply to
D Yuniskis

Do the remote devices transmit whenever they wish, or only on request from your microcontroller?

If they transmit on their own time, you will have great difficulty multiplexing them and extracting useful data, as you won't know which one to select when, or where in the message one is when you select it.

--
Peter Bennett, VE7CEI  
peterbb4 (at) interchange.ubc.ca  
GPS and NMEA info: http://vancouver-webpages.com/peter
Vancouver Power Squadron: http://vancouver.powersquadron.ca
Reply to
Peter Bennett

...

You could also look at Analog's ADG787, a dual 2:1 Mux/Demux available in 10-lead LFCSP and MSOP packages and 10-ball WLCSP package, at sizes like 3x3mm, 3x5mm, and 1.5x2mm. One such device can multiplex 2 sets of logic-level Rx and Tx lines from your external devices to a set of Rx and Tx lines on your micro. But it's non stock at Digikey -

Reply to
Joe

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.