×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Simple question about shift registers.
2

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.

I'm not sure what a "Piso" shoft register is, but reading the datasheet of any common SR should show you that a clocking line is necessary.  Besides, without one, how would you plan on getting the data to your micro?

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Simple question about shift registers.

I assume PISO = parallel in, serial out.

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.

You will also need to account for how you handle de-bouncing the switches.  When the switch is pressed or released you will see several very short duration on and off transitions and you will need to make sure your logic is immune to these.

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.

Interrupts....

RE: Simple question about shift registers.

Richk67: With no additional h/w you will need to decode/debounce the switches in software, most likely using a polling method. Using Noway2's advice to use Google I found the following: www.ganssle.com/debouncing.pdf.

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.

Hi.

Try using the SPI bus (SCLK,SDI) and either 74HC166 or 74HC589a.

Good luck!

Regards,
Gonzalo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources