I have to write a micro-controller program to scan 30 input pins. I only need to know whether they are high/low and the speed can be very slow. But the problem is that 16C54 does not have so much input pins.
I have searched from the Internet that there are matrix for keyboard input. However, is it possible to use matrix or other design so that I can reduce the input pin count ?
Thank for your replies. I am a newbie to electronics. If I use 4x74ls165, I need to assign :
1 input pin for clock, 1 input pn for data in and 4 inputs for 74ls165's output.
Is my interpretion correct ?
each 74ls165 can give you up to 8 inputs... (8x4=32 inputs suggested)
to communicate to one 74ls165 you need on the microcontroller
- 1 input for data. (pin 9 on '165)
- 1 output for clock. (pin 2 on'165)
- 1 ouput for load (pin 1 on '165)
optional 1 output for clock inhibit (pin 15, on '165... i would leave it connected to GND)
after yo can communicate with one 74ls165, you can cascade the other three... just connect clock to clock pin, load to load pin, (optional inhibit too) aaaannnnddd serial out to serial in (pin 10)
is well suggested to connect the last Serial input PIn (pin 10) to gnd at the last stage....