Rik said:
I'm trying to solve a little problem with a (hopefully) simple
circuit, and I'm not really sure where to start searching (I tinker
with electronics, but haven't attempting building something from
scratch yet...)
What I have is 8 data lines coming out of a cartridge-type device (D0
through D7). Depending on a condition (physical on-off type switch
hopefully) I need to reverse all 8 lines as they come out of the
cartridge.
So, if the switch is off, D0 out of the cartridge would go straight
through to where D0 should connect on the main board, D1 to D1, etc...
If the switch is on, D0 should now connect to where D7 would normally
connect on the main board, D1 to D6, D2 to D5 and D3 to D4.
Or, basically, a circuit that would emulate 8 SPDT switches being
thrown all at once one way or the other...
Seems like this has to be a simple enough circuit to me... (or is
there simply a chip that will do this?)
Thanks for any help, apologies in advance if this is in a FAQ
somewhere... Didn't see anything obvious when I looked...
Rik
Jmorg
(at)
Earthlink
[dot]
net
Good morning, Rik. Thanks for looking first. I'm assuming you've got
5V digital logic signals you're switching, and that you're not
particularly concerned about obtaining the fastest switching speed.
Given these assumptions, there is a one-chip solution. A small EPROM
will do the job quite nicely with inputs to spare. The problem is, if
you had an EPROM burner, you certainly wouldn't be asking -- you'd have
it done by now.
Well, there is a two-chip solution for you. It's called a data
selector, and does exactly what you ask. For a 74HC157, it will switch
between two sets of four data signals, depending on what the control
signal says. Look at the data sheet:
http://www.fairchildsemi.com/ds/DM/DM74ALS157.pdf
and then look at this diagram (view in fixed font or M$ Notepad):
1 2 3 4 5 6 7 8 9
o o o o o o o o o
| | | | | | | | |
| | | | .----------------------------------o
| | | | | | | | | |
o----------------------------------------------------------. |
| | | | | | | | | | |
| o----------------------------------------------------. | |
| | | | | | | | | | | |
| | o----------------------------------------------. | | |
| | | | | | | | | | | | |
| | | o----------------------------------------. | | | |
| | | | | | | | | | | | | |
| | | | .----------o | | | | | | | |
| | | | | | | | | | | | | | |
| | | | .----------------o | | | | | | |
| | | | | | | | | | | | | | | |
| | | | .----------------------o | | | | | |
| | | | | | | | | | | | | | | | |
| | | | .----------------------------o | | | | |
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | |
.--o--o--o--o-----o--o--o--o--. | .--o--o--o--o-----o--o--o--o--. |
| A1 A2 A3 A4 B1 B2 B3 B4 |1| | A1 A2 A3 A4 B1 B2 B3 B4 |1|
| Selo-' | Selo-'
| 74HC157 | | 74HC157 |
| Strobe o-. | Strobe o-.
| Y1 Y2 Y3 Y4 | | | Y1 Y2 Y3 Y4 | |
'----------o--o--o--o---------' | '----------o--o--o--o---------' |
4| | | | | 4| | | | |
o o o o === o o o o ===
GND GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
The above of course assumes you've got Vcc and GND connected to the
appropriate pins on the ICs. I've left figuring out the pin numbers to
you. The logic of the chip is as follows:
If STROBE is high, the outputs are Tri-State (not connected to
anything, act like open ckt). So, we'll tie both low to make the chip
"always on".
Assuming STROBE is low, then if Sel (your logic signal 9) is low, Y
will have the same logic level as A. If Sel is high, Y will have the
same logic level as B. So, if you wire up the chips with your logic
signals 1-2-3-4-5-6-7-8 as shown above, when 9 is low, the output will
be 1-2-3-4-5-6-7-8. When 9 is high, your output will be
8-7-6-5-4-3-2-1. I guess that's pretty much what you want.
You can make the logic signal at pin 9 with your switch like this:
VCC
+
|
.-.
| |10K
SW1 | |
'-'
_/ | 9
.--o/ o--o---->
|
===
GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
The HC family is made for 5V logic. If your requirements are
different, this solution might not work for you. In that case, a quad
DPDT analog switch or some 4000-series logic or something else might be
a better solution.
So, look at these questions to see if this is OK. If any of your
answers are different than these, you'll have to describe your problem
a little better to get another answer:
5V power supply: YES
5V logic: YES
Digital signals: YES
High speed requirements: NO
Good luck
Chris