Simple question about shift registers.
Simple question about shift registers.
(OP)
I want to connect 8 on/off spst switches to the inputs of a Piso shift register in a multiplex control system. My question is this. How will the register know when an input changes states? I don't want to have to run a comm line back to the MCU for every switch. If I did that, I wouldn't need the register.





RE: Simple question about shift registers.
Dan - Owner

http://www.Hi-TecDesigns.com
RE: Simple question about shift registers.
You can either have your micro poll the shift register every so often in order to tell when a switch changes state or maybe you can use an I/O expander chip that will cause an interrupt on the micro when a switch changes state.
RE: Simple question about shift registers.
This can be accomplished in either hardware or software and google should provide more than enough information on ways to accomplish this task.
I recently designed a controller where I use a state machine implemented in programmable logic to periodically scan the switches, detect and qualify any switch transitions, save the updated switch readings and then generate an interrupt to the processor. The performance has been great: it is very responsive, can detect when a switch is pressed and released, and does not burden the software with periodic polling.
RE: Simple question about shift registers.
RE: Simple question about shift registers.
I also ran Google searches on 74HC165, a popular PISO and the combined search terms: 74HC165 and code. Of course, the code examples will not include the code you will need to setup your mux before you poll the shift regsiter.
Regards.
RE: Simple question about shift registers.
Try using the SPI bus (SCLK,SDI) and either 74HC166 or 74HC589a.
Good luck!
Regards,
Gonzalo