# digital switch IC/ multiplexer i need help!

Discussion in 'The Projects Forum' started by motion86, Nov 21, 2012.

1. ### motion86 Thread Starter New Member

Feb 21, 2011
9
0
hi everyone,

i'm trying to find a switching IC that has multiple inputs and a single output (so that at any given time there is only one input connected to the output) something like a multiplexer but much simpler, in particular i need it to have a single control input, so that at switches the inputs in order, and every time it gets a pulse on the control pin it switches to the next switch and when it reaches the end goes back to the first...
does anyone have an idea if there is an IC that does that or any other way of tackling this issue?

2. ### tshuck Well-Known Member

Oct 18, 2012
3,528
675
An IC, no, but you can make exactly what you described the way you described.... a multiplexer with a counter on the select lines....

3. ### motion86 Thread Starter New Member

Feb 21, 2011
9
0
tshuck thanks for your reply, is there a way you can describe exactly how to do that, i have very limited knowledge of how those components work, that's why i was looking for an IC that i can connect to my arduino controller and using only one pin to do the switching, what i'm trying to do is, i'm trying to read multiple voltages trough a single analog input pin on my micro-controller and using one digital pin to control the switching array

4. ### tshuck Well-Known Member

Oct 18, 2012
3,528
675
...then you need to be sure that you are using an analog multiplexer...

If you were to connect the outputs of the counter to the select lines of the multiplexer, it would cycle between each of the inputs. The counter clock would be your control line, in that each time you pulse this line, the count will increase, switching which channel is routed to your controller...

Edit: Also, make sure your counter is not a decimal counter...

5. ### motion86 Thread Starter New Member

Feb 21, 2011
9
0
so i want to use the CD4067 multiplexer would this counter work for it 74LS90 or this CD4029 and how do i wire them up, i'm looking at the counters data sheet and have no idea how that thing works..

Last edited: Nov 21, 2012
6. ### ScottWang Moderator

Aug 23, 2012
5,285
818
One Pulse → CD4520 → CD4067

CD4520 : CMOS Dual Up Binary Counters. (0~15)

CD4067 :
CD4520 Q1A,Q2A,Q3A,Q4A 4 Qout → CD4067 A,B,C,D → CD4067 I/O 16 (0~15) → Common I/O
Inhibit = Hi, No out.
Inhibit = Lo, which pin is Output, it depends on A,B,C,D from CD4520 Qout choosed.

datasheets of EE parts search.
http://www.datasheetcatalog.com/

7. ### tshuck Well-Known Member

Oct 18, 2012
3,528
675
these would work....

You'll need to hook up the lowest four bits of the counter to the mux.... $\phi$1 would be your clock input, or control line to advance each selected channel...

Code ( (Unknown Language)):
1.  i'm looking at the counters data sheet and have no idea how that thing works..
I was a bit confused myself, I've never seen a synchronous device not label a clock input, but that is only because it is designed to allow a oscillator(RC or crystal) to clock it, so it doesn't need to be fed a clock signal...

8. ### motion86 Thread Starter New Member

Feb 21, 2011
9
0
thank you very much! i appreciate your help! i'll write back when i get the components in and test it..

9. ### crutschow Expert

Mar 14, 2008
14,777
3,780
You must have some method to determine which channel the mux is connected to (I assume you need that). One way would be to add a reset line from the controller to the counter to reset it to zero at a known time. From there you can determine which channel is on by the number of clock pulses from that point.

10. ### motion86 Thread Starter New Member

Feb 21, 2011
9
0
so i should reset the counter every time the program reaches the last value in the sequence and start over from 0? let say it goes from 0-9 every time i sends 9 pulses it resets the counter and starts back from 0.

11. ### crutschow Expert

Mar 14, 2008
14,777
3,780
Yes, that's the typical way to do it. So you need one line for the count and one line for the reset from the controller.

There are ways to do everything with one line but that requires more logic in front of the counter. For example, sending a long pulse for the reset, and short pulses for the count, which are then separated into separate reset and clock pulses by the logic circuit.

12. ### tshuck Well-Known Member

Oct 18, 2012
3,528
675
He's saying that since you don't know where the counter will start up, you need a way to synchronize the count of the counter and the count in the controller. Otherwise, you could be reading channel X when you meant to read β... If you set up a startup delay on the Load input to the counter, you can avoid this as it will always start up in a predefined count...

You don't need to reset multiple times, just once to synchronize the devices...

13. ### motion86 Thread Starter New Member

Feb 21, 2011
9
0
What do u mean by a start up delay, and what is the load, is that the start up pulse, or reset?

14. ### tshuck Well-Known Member

Oct 18, 2012
3,528
675
Okay... so the counter has a load function which will load a predetermined value into the counter(usually 0, but can be anything)...

The start up delay I'm referring to is basically a capacitor which will start at 0V and raise to Vcc, depending on arrangement, and will load the load value, then enable your controller and counter to have a common starting point...

15. ### crutschow Expert

Mar 14, 2008
14,777
3,780
Ideally that's true, but if there's ever any glitch that upsets the count while the circuit is operating, then it can get out of sync and won't recover until you restart the circuit. That's why a sync pulse is often sent every frame in such circuits.