| Author |
Message |
krabbacitor

Joined: Aug 13, 2009 Posts: 12 Location: Hamburg
|
Posted: Sat Apr 17, 2010 7:01 am Post subject:
4 state pushbutton switch with shift register? |
 |
|
Hi there!
I'm just curious... I thought it would be nice to have a single debounced pushbutton switch, which would close one contact (of four) on each successive pressing, like this:
no signal: on - off - off - off
first push: off - on -off - off
second: off - off - on - off... and so on
could one use a 4-bit serial in parallel out shift register? (i'm STILL a newbie... )
i thought about trying this with a cd4015 cmos but couldn't find a working ltspice model for this...
does somebody have an idea, if this works at all or if there's some model for it available? as yet i've been unlucky...
regards
christian |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
|
Posted: Sat Apr 17, 2010 8:12 am Post subject:
|
 |
|
Initialization of the shift register to state on-off-off-off is the issue using a shift register. This must be done at power up.
A 2 bit binary counter and a "1 of 4 decoder" might be easier I think, though it will be at least 2 ICs. The debounced switch provides clock to the counter and the counter outputs drive the "address" lines of the decoder/selector. If the counter is simply cleared at power up, it will initialize the output state to on-off-off-off. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
|
Back to top
|
|
 |
metal_head_82

Joined: Dec 27, 2009 Posts: 34 Location: Germany
Audio files: 2
|
Posted: Tue Apr 20, 2010 3:21 am Post subject:
|
 |
|
Thought about the same thing last evening...
Though I'm still a n00b to all this I came up with the same solution.
But I'd use a 4052 - that way you can have 2 buttons
Of course you would need a second counter BUT it's still a nice and easy way.
AND you could use the counter outputs to drive some LEDs. That way you always have visual feedback  _________________ "I don't care much about music. What I like is sounds." |
|
|
Back to top
|
|
 |
JovianPyx

Joined: Nov 20, 2007 Posts: 1988 Location: West Red Spot, Jupiter
Audio files: 237
|
Posted: Tue Apr 20, 2010 6:23 am Post subject:
|
 |
|
No second counter required. I believe that there are binary up-down counters. But really, with only 4 positions, a single button is probably sufficient. More than 4 might call for a second button. Using an up down counter would be more complex circuitry, however. _________________ FPGA, dsPIC and Fatman Synth Stuff
Time flies like a banana. Fruit flies when you're having fun. BTW, Do these genes make my ass look fat? corruptio optimi pessima
|
|
|
Back to top
|
|
 |
fonik

Joined: Jun 07, 2006 Posts: 3950 Location: Germany
Audio files: 23
|
|
|
Back to top
|
|
 |
|