Maker Pro
Maker Pro

UART redirect? (Beginner Question)

R

Robert Bouillon

I need to access 3 devices via UART from one microcontroller, but I
never need to access more than one at the same time.

Rather than finding a diesel uC with 3 UARTS, I was thinking of
latching one UART output as necessary. For example, If I needed to
access device 1 I would latch the tx/rx for device 1 and write to the
UART. If I needed to write to device 2, I'd disable latch 1 and enable
latch 2, then write. I'd be connecting at speeds of no greater than
19200 bps. I'm operating @ 5v.

I've never latched a serial connection. I want to make sure my latch
has a good response time and will operate effectively at 19200 bps. Is
there something specific I should look for? Should I just go with a uC
or uP better suited for my needs?

Thanks
 
M

Markus Mandl

Robert Bouillon wrote:
....
I need to access 3 devices via UART from one microcontroller, but I
never need to access more than one at the same time.
....


Hallo Robert,

you could use a 74HC138 decoder for TX and a 74HC251 encoder for RX.
Connect your uC-TX to /G2A and two select signals on the '138 and your
serial data should appear on the selected Y-output.
The '251 works more or less the other way round.

Regards
Markus
 
P

Paul Burke

you could use a 74HC138 decoder for TX and a 74HC251 encoder for RX.
Connect your uC-TX to /G2A and two select signals on the '138 and your
serial data should appear on the selected Y-output.
The '251 works more or less the other way round.

Or a (74HC perhaps)4052 quad 2 channel analog multiplexer - the digital
lines don't 'know' they are being treated as analog! Just connect a
couple of uC IO lines to the S0 and S1 (or A and B depending on data
book), make sure the enable is active (low), don't forget to connect the
analog ground as well.

Paul Burke
 
T

Tim Wescott

Paul said:
Or a (74HC perhaps)4052 quad 2 channel analog multiplexer - the digital
lines don't 'know' they are being treated as analog! Just connect a
couple of uC IO lines to the S0 and S1 (or A and B depending on data
book), make sure the enable is active (low), don't forget to connect the
analog ground as well.
And make sure that you put in pullups or pulldowns so the transmitter
goes to the right state when you're not switched to it (figuring out the
right idle state is left as an exercise to the reader -- I think it's
low on the RS-232 side and high on the TTL side).
 
P

Paul Burke

Tim said:
And make sure that you put in pullups or pulldowns so the transmitter
goes to the right state when you're not switched to it (figuring out the
right idle state is left as an exercise to the reader -- I think it's
low on the RS-232 side and high on the TTL side).

If you use MAX232s or similar, they have them already.

Paul Burke
 
R

Robert Bouillon

Awesome. Thanks for the info. I'll give it a shot.

It's easy to forget the pull ups & pull downs so I'll make sure I get
those.

Any idea how fast I'd be able to push the IC's? I'm worried that at
some point they might not be able to handle the frequency, by either
adding noise to the waveform or just getting too hot. I doubt I'd ever
go above 38400 but it'd be good to know.

Thanks again!
 
Top