electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Developers' Corner
4 state pushbutton switch with shift register?
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
krabbacitor



Joined: Aug 13, 2009
Posts: 12
Location: Hamburg

PostPosted: Sat Apr 17, 2010 7:01 am    Post subject: 4 state pushbutton switch with shift register? Reply with quote  Mark this post and the followings unread

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... Wink )
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
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 237

PostPosted: Sat Apr 17, 2010 8:12 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
metal_head_82



Joined: Dec 27, 2009
Posts: 34
Location: Germany
Audio files: 2

PostPosted: Tue Apr 20, 2010 3:21 am    Post subject: Reply with quote  Mark this post and the followings unread

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 Wink
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 Wink

_________________
"I don't care much about music. What I like is sounds."
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1988
Location: West Red Spot, Jupiter
Audio files: 237

PostPosted: Tue Apr 20, 2010 6:23 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message Visit poster's website
fonik



Joined: Jun 07, 2006
Posts: 3950
Location: Germany
Audio files: 23

PostPosted: Wed Apr 21, 2010 2:30 am    Post subject: Reply with quote  Mark this post and the followings unread

i used a 4017 counter and a DG412 switch. the circuit below has almost all bells and whistles, but one could easily leave them off.
http://modular.fonik.de/pdf/SeqSwitchV2.pdf

_________________
Posted Image
cheers,
matthias
____________
Big Boss at fonitronik
Tech Buddy at Random*Source
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org