multiplexing

Status
Not open for further replies.

Xoll

New Member
Hello
I'm doing a project which will display number of switches.I have 32 switches. Can I use 32:1 multiplexer that will choose the first push button to display on 7 segment?How about data selector?Do I need to set it in program?

My idea is :

switch(user push button)--multiplexer(select only push button)--micro-c(read and check)--7 segment(display)
 
You only need a micro-controller, it can scan the matrix of switches, 12 I/O lines required, for a 4x8 (32 switches) matrix, or for a 6x6 (36 switches).

If you want to use a PIC as your micro-controller there are examples of multi-plexing in my tutorials.
 
There are lots of techniques for reducing the number of I/O lines for matrixed switches. for exmple, you can use a 74HC138 (actually any 74xx138) to drive up to 8 rows using only 3 pins and then each column takes an additional pin. the '138 is a demux - you input 3 bits and it selects one of 8 outputs. the 32 (4x8) switch matrix can be done with 7 pins.

If you have spare ADC channels on your microcontroller, you can place a number of switches on a single pin using resistors. I've seen examples of 8. In theory it could go much higher...
 
Using the N*(N-1) multiplexing scheme allows 30 switches using 6 pins, or 42 switches using 7 pins.

But since the OP is driving multiplexed 7-segment displays, he might as well use single-pin column driven switch matrices. This would require a total of 8 pins for the display (9 pins if the decimal point is required) and 4 pins for 32 switches. Now, what to do with those 3 or 4 extra pins (grin)?

Regards, Mike
 

Attachments

  • 32 switch challenge.PNG
    33 KB · Views: 347
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…