Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

30 buttons input for Microcontroller suggestion

Status
Not open for further replies.

lloydi12345

Member
Hi, I am building a project right now and it would need 30 buttons. I am already leaning near to my first option which is the idea of multiplexing the input using 8 input and 4 output pins of a microcontroller like this one with some modifications. What bothers me here is that the microcontroller might not be able to handle the voltage or it might pick up some nasty signals.

**broken link removed**

Another option is to use 74HC165 but what bothers me is the processing time. It might take time for the microcontroller to determine which button was pressed. It looks like I would be using 4 of these ICs and stack them. There would be a lot of for loops and logic and shifting actions that would be involved so it could take lots of processing time. This would also complicate the PCB design since 4 ICs will be used.

I will be using PIC18F6622. Do you think the first option would be the best way for this? The things that should be considered here are PCB designing, electrical noise, complexity of the program and processing time.

If you have other suggestions I would be willing to know it. Thanks! :)
 
Either method will work. For the multiplexed method, the output pins do not require pull-up resistors. Why are you worried about nasty signals? are the buttons located a long distance from the microcontroller?

For the second option, i.e. using PISO shift registers, you can connect them to the SPI port of the microcontroller; this will allow reading the switch states to be very fast. It wouldn't take that long otherwise anyway.
 
Either method will work. For the multiplexed method, the output pins do not require pull-up resistors. Why are you worried about nasty signals? are the buttons located a long distance from the microcontroller?

Yeah, I will be using a different circuit board for the buttons so I might catch.

For the second option, i.e. using PISO shift registers, you can connect them to the SPI port of the microcontroller; this will allow reading the switch states to be very fast. It wouldn't take that long otherwise anyway.

Thanks, I'll check the SPI port there. I will be only using 8Mhz Crystal so it might be slow.
 
Yeah, I will be using a different circuit board for the buttons so I might catch.
If the distance between the boards is short, there's unlikely to be any issues.
Thanks, I'll check the SPI port there. I will be only using 8Mhz Crystal so it might be slow.
What is your definition of slow? With 8MHz instruction frequency, I'm not sure, but the SPI freq should be able to be set at 1MHz (check the datasheet). For 30 buttons, thats 32/1MHz --> 32 microseconds to shift in the data.
 
I stated slow because of the processing time that it might take since calculations and lines will be executed. There will be also interrupts going on so I just thought everything would be slowed down. Well, reading your explanation, everything seems like to be pretty quick. Thanks a lot! :)
 
Status
Not open for further replies.

Latest threads

Back
Top