Author Topic: 74HC4052 as a serial extension?  (Read 1786 times)

0 Members and 1 Guest are viewing this topic.

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
74HC4052 as a serial extension?
« on: June 28, 2017, 02:23:58 pm »
Hi
Can I use a 74HC4052 as "extension lead"?
I have 2 serial devices that have an LCD and when connected to the serial port I need both to display the same thing. It also has a keypad and both need to send to the same port.
Its unlikely that both units will be used at the same time an even more unlikely that a button on each keypad will be pressed at exactly the same time.
I thought that muxes where used to more as a "switch" than a "hub" in networking terms but this sparkfun schematic seems to be what I want https://www.sparkfun.com/datasheets/Components/General/SerialMux-v10.pdf
Does this do what I want? Or is it a switch?
Thanks in advance.
« Last Edit: June 28, 2017, 03:04:09 pm by abdullahseba »
This is my right hand this is my wrong hand
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
Re: 74HC4052 as a serial extension?
« Reply #1 on: June 28, 2017, 02:58:43 pm »
It will be a switch in that the UART on your microcontroller (?) will only be transmitting to and receiving from one of the serial devices at the same time. The difference to a switch in network terms is that the microcontroller will have to explicitly switch between the displays. So you have to change the MUX configuration (through the MUX_A/MUX_B lines) to select which display you want to talk to. Similar to the old manual KVM-switches where you had to press a button or turn a dial to select a computer.

Offline abdullahsebaTopic starter

  • Frequent Contributor
  • **
  • Posts: 335
  • Country: gb
Re: 74HC4052 as a serial extension?
« Reply #2 on: June 28, 2017, 03:25:42 pm »
So
It will be a switch in that the UART on your microcontroller (?) will only be transmitting to and receiving from one of the serial devices at the same time. The difference to a switch in network terms is that the microcontroller will have to explicitly switch between the displays. So you have to change the MUX configuration (through the MUX_A/MUX_B lines) to select which display you want to talk to. Similar to the old manual KVM-switches where you had to press a button or turn a dial to select a computer.
So how do you switch between the devices in the circuit? I seen no other inputs to the micro in the schematic.
This is my right hand this is my wrong hand
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
Re: 74HC4052 as a serial extension?
« Reply #3 on: June 28, 2017, 05:19:32 pm »
You would connect one of the GPIOs to MUX_A or MUX_B. Two GPIOs if you want to control three or four devices. See the 74HC4052 datasheet for how the A and B pins relate to the 0/1/2/3 outputs. Whichever pin you do not connect to your micro will be pulled low by the 1 kOhm resistor, so connecting one of the inputs if sufficient if you only need to switch between two outputs.
 
The following users thanked this post: abdullahseba


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf