Is there a 7/8 bit switch for microcontrollers?

In summary: There is a chip called a 16to8 bit multiplexing/demultiplexing bus switch. It would be a good solution for what you are looking for.
  • #1
juming
45
0
i have 7 data lines coming out from a microcontroller... i need the 8th one to control where its going to, either to a 7 input on a RAM chip, or a 7 input on an LCD display.
basically i think I'm looking for a 7/8 bit switch... does one exist? can anyone supply me with the name of such a switch? or the part number? or the datasheet?
thanks in advance
 
Engineering news on Phys.org
  • #2
You could use a couple of CD4016 (or CD4066) quad bilateral switches.

Regards
 
  • #3
Since they are digital lines, you should solve this digitally. You can use a couple '245 Octal Bus Transceivers and control which direction(s) get selected with your 8th bit, for example.

Are these lines bidirectional? You need to define the path selection options and the direction selection options, and then just work out the logic to do the routing. You could use discrete NAND gates for that matter, or a PAL to do this function.
 
  • #4
berkeman said:
Since they are digital lines, you should solve this digitally.
He said he wanted a switch. 4016s are switches for digital lines.
You need to define the path selection options and the direction selection options, and then just work out the logic to do the routing. You could use discrete NAND gates for that matter, or a PAL to do this function.
Sounds a bit complicated for what he wants to do.

Regards
 
  • #5
dlgoff said:
He said he wanted a switch. 4016s are switches for digital lines.

Sounds a bit complicated for what he wants to do.
Actually, my databook calls them digitally controlled analog switches, which is what they are architecturally. I just wanted him to think more in the context of the task that he was talking about. If I gave him an interview question to mux his uC's lines between a RAM and an LCD controller, and he used analog switches to do it, he'd fail the interview. The way you route digital lines around is with digital logic and muxes, not with analog switches. And I mentioned PALs to maybe get him to poke around the net some to learn what PALs are used for, and why that would be how he would do it in the real world. Even at a high school level, PALs are very handy, and PAL programmers are cheap.
 
  • #6
Most IC's come with enable pins. Why not just connect the lines up to both devices and use the 8th bit as an address line?

What LCD and RAM are you using? What's the function of the circuit? What other devices have spare cells in them?
 
  • #7
ok, well I'm about to check up on the 4016, but I've checked out the 4066, and that's just a straight on/off switch. i want a switch that will just change the data path from the uC to the SRAM or to the LCD. kinda like the track change for a railway i would imagine. and the 4066 is unsuitable for that
i'v found something called a "16to8 bit multiplexing/demultiplexing bus switch" which looks perfect... but i was wondering if there was another way, because that chip only seems to be made by one manufacturer... and i cannot get hold of that exact one. maybe other companies make it? i don't know, i haven't been able to find any though :(
 
  • #8
in reply to delta, the enable pins are being used for a completely different operation. i can't touch them. i have 7 input pins on both the LCD and the SRAM... and 8 output of the port of the uC. therefore i have an extra line that i can use from the uC to control the 'switch' I'm looking for :/
 
  • #9
Use the 8th output to switch between the LCD and the RAM. Ram and LCDs have an enable. Split the 8th bit into two lines. Invert one of the lines. Use the inverted line to enable one of the devices and the noninverted line to enable the other---this is assuming both devices use the same logic level to enable them which is not always the case. A single 7404(or cmos equiv if you wnat) IC should do the trick. You are multiplexing a bus by doing this and would be well served to learn what MUX'ing is and how best to accomplish it.

Good luck.
 
  • #10
basically.. this is EXACTLY what I'm looking for...
http://www.pericom.com/pdf/datasheets/PI5C3390.pdf
but, is there anything similar to that, because i cannot get my hands on one of those :( it explains what I'm after. look at the block diagram it gives. i just need to connect the /BEN & /AEN lines together with a not on the one and connect that to my 8th bit.
anyone know of anything similar to this? like a simple IC? or if there's another manufacturer that makes this chip ?
 
  • #11
juming said:
basically.. this is EXACTLY what I'm looking for...
http://www.pericom.com/pdf/datasheets/PI5C3390.pdf
but, is there anything similar to that, because i cannot get my hands on one of those :( it explains what I'm after. look at the block diagram it gives. i just need to connect the /BEN & /AEN lines together with a not on the one and connect that to my 8th bit.
anyone know of anything similar to this? like a simple IC? or if there's another manufacturer that makes this chip ?

Read my post above.
 
  • #12
do you have any website/info on how to implement an 8:16 multiplexer then? and what parts to use?
 
  • #13
my problem here, faust9, is that i do not have an enable pin on the LCD. it is one of the 7 that need to pass through the MUX. and it cannot be linked directly otherwise a signal passing to the SRAM that includes that bit could accidentally intefere with the LCD and sink current or interfere with my address that is to be written to the SRAM.

i'v found the PI5C3390 and the IDTQS3390, however it seems the suppliers in this country do not have those chips. also, those are both 16-8 MUX bus switches... but i need an 8-16 MUX bus switch. any ideas on how to create one from lesser components?
 
  • #14
juming said:
do you have any website/info on how to implement an 8:16 multiplexer then? and what parts to use?

I explained it above. You don't need an 8:16 MUX to do what you've asked about.

You only need an inverter on the 8th bit (the free bit you mentioned a few posts back that you wanted to use as a switch). Send the 8th bit to one device directly and send the 8th bit through an inverter (74hc04) to the other device. When the 8th bit goes high one device will be enabled and the other disabled. When the 8th bit goes low the exact opposite will occure. If you only need 7 data lines from an 8 bit bus and want to access two device then just use an inverter. A PAL would be the best solution because LCD's usually have a limited instruction set so the full 7bit bus uses addres space not needed by the LCD which could be used for additional ram/rom but the easy solution is an inverter on the 8th bit. Google is your friend. Google MUX or multiplexor.

Good luck.

[edit] just saw the post above. Use a latch between the LCD and the data bus and the 8th bit to 'latch' the lcd data in. This is how old addr:data buses used to be MUX'ed.
 
Last edited:
  • #15
How do you not have an enable available for your RAm or LCD? Your system will not work unless you have some way of telling the RAM/LCD when to read data and when to write data.
 
  • #16
juming said:
i have 7 input pins on both the LCD and the SRAM...
It's a write-only RAM?
 
  • #17
juming said:
do you have any website/info on how to implement an 8:16 multiplexer then? and what parts to use?

I can only recommend you continue searching for an 16-8 mux supplier.

Failing that you're left with getting a couple of buffer chips. One for the LCD and one for RAM, both connecting to the data bus from the microcontroller. The 8th bit would enable either one buffer or the other.
 
  • #18
From the National Semiconductor data book: "The CD4016BM/CD4014BC is a quad bilateral switch intended for the transmission or multiplexing of analog or digital signals."

Try it. You'll like it. It's cheap too.

With four you can do exactly what you're wanting.

Regards

edit: spelling
 
Last edited:
  • #19
berkeman said:
... If I gave him an interview question to mux his uC's lines between a RAM and an LCD controller, and he used analog switches to do it, he'd fail the interview...
Maybe but he would be switching data by now.

Regards
 
  • #20
mmkay.
firstly, the RAM enable pin is using a different port, and the LCD is configured in a 4-bit manner such that there is no set 'enable' pin, the 'enable' pin is to be high in the wait state where it transfers info on the input pins to the internal buffer register, then on the low, it outputs that internal buffer register to the display. therefore even if the LCD is in the 'off' mode, the pins are still connected and still receiving data, and might still sink current which would interfere with the address that is to be written to the SRAM. that is why the so-called 'simple' solution is not applicable :( (in this case)

yes, I'm still a student, but no, this is not part of any project or anything! I'm helping my lecturer to build expansion boards to be used in 3rd year practical lab work on microcontrollers... lecturer is too busy with adminish stuff like marking exams and such.
 
  • #21
Juming ,
what you are calling SRAM , is that Serial RAM ??
like this
http://pdfserv.maxim-ic.com/en/ds/DS1200.pdf
because a seven bit static ram isn't very useful...
berkeman here sugested using a 245 , which is exactly what you should use because the outputs are Tri-Stated...that is what they are made to do
 
  • #22
hehe.. no it's static ram... but the other address byte and the data byte are going to another port. this is my only problem here, these A8-A14 address lines need to have the same input as bits 0-6 of the LCD, from PORT C of my uC. the 8th bit of the uC can therefore be used to control the switch... to channel the other 7 either to the SRAM or to the LCD. but the problem is, i don't have a switch...
 
  • #23
the 245 is not what I'm looking for. i need 16 outputs.
i think what i'll do is use 2 244's and connect the input lines together and to the port, and invert one of the enable lines and connect those together.
what do you think?
 
  • #24
i do not need to read in from either the LCD or the SRAM, so the uni-directionality of the 244 is ok
 
  • #25
juming said:
the 245 is not what I'm looking for. i need 16 outputs.
i think what i'll do is use 2 244's and connect the input lines together and to the port, and invert one of the enable lines and connect those together.
what do you think?
It sounds like you're on the right track. BTW, what you would do in a real-world uC design is use some logic, generally either a PAL, CPLD or FPGA to decode your addresses into a memory map that has different memory address areas dedicated to each peripheral. Your logic would decode the appropriate CE-, WE-, R/W-, etc. signals for each peripheral based on what the uC was doing with the memory bus and its control output signals. For example, it's pretty common for a uC to have external PROM/flash for program storage, external SRAM, and maybe an external UART like the 16C550 series to talk RS-232 off-board.

Here's an engineering bulletin that I helped write many years ago that talks about how to design external memory interface logic for a particular microcontroller (the Neuron chip uC, used with LonWorks control networks). Note that you can't just throw down logic (or even analog switches) in the memory interface without doing at least some basic memory timing checks to be sure that it will work with the speed grade of memories and logic that you've chosen:

http://www.echelon.com/support/documentation/bulletin/005-0013-01D.pdf

Have fun with the project! -Mike-
 
  • #26
I still don't see the need for 2 244's. You said the RAM does have an enable line then there is no real need for a second 244. ADDR:DATA buses used to be split by using only one latch and an inverted enable line. Without seeing your schematic or knowing the exact details I can't say for sure that you don't need 2 buffers, but from experience and wht you've posted so far I'd say one will do the trick.
 
  • #27
how long this is going to go before juming tells us what uController he is using ?
which static ram he wants to interface ??
which LCD he wants to use.??
 
  • #28
uC is: ATMEL ATMega8515
SRAM is: UTRON UT62256C 32K X 8 bit low power CMOS SRAM
LCD is: CLOVER DISPLAY CV4162H

not that it really matters because all i was asking for was a way to switch between two different 7bit lines, without using their enable pins because they're busy being used elsewhere.
 

1. What is an 8 bit switch?

An 8 bit switch is a type of electrical switch that has 8 positions or settings. It can be used to control the flow of electricity in a circuit, with each position representing a different level of voltage or current.

2. How does an 8 bit switch work?

An 8 bit switch works by allowing or blocking the flow of electricity through its 8 positions. These positions are controlled by mechanical or electronic components within the switch, such as metal contacts or transistors.

3. Is an 8 bit switch different from a normal switch?

Yes, an 8 bit switch is different from a normal switch in that it has 8 positions instead of the typical 2 positions (on and off). This allows for more precise control of the electricity flow in a circuit.

4. Can I use an 8 bit switch in my electronic projects?

Yes, you can use an 8 bit switch in your electronic projects as long as it is compatible with the voltage and current requirements of your circuit. It can be useful for creating more complex and customizable circuits.

5. Where can I buy an 8 bit switch?

An 8 bit switch can be purchased at most electronic supply stores or online retailers. It is important to make sure you are buying a reliable and high-quality switch to ensure proper functionality in your projects.

Similar threads

  • Electrical Engineering
2
Replies
49
Views
2K
Replies
37
Views
3K
Replies
31
Views
2K
  • Electrical Engineering
Replies
1
Views
234
  • Electrical Engineering
Replies
1
Views
2K
  • Electrical Engineering
Replies
6
Views
833
  • Electrical Engineering
Replies
5
Views
2K
  • Electrical Engineering
2
Replies
49
Views
5K
  • Electrical Engineering
Replies
11
Views
7K
Replies
7
Views
830
Back
Top