DIYstompboxes.com

DIY Stompboxes => Digital & DSP => Topic started by: mth5044 on June 02, 2009, 07:41:02 PM

Title: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 02, 2009, 07:41:02 PM
I don't even know what to call it, so I have no idea what to search for. I'm hoping my explaination will atleast get me a name of what I'm supposed to look for. This is also my first time posting in the Digital forum.. so hopefully I'm in the right place.

Anyway, the FV1 chip, with the reverb and all that jazz has it's 7 or so effects selectable by three switches, which are either on or off. The comination of these switches determines what program its on. Instead of having three toggle switches to do the job, I wanted to have some kind of control that has an up and down and a number display on a seven segment number LED thing. The up and down would flip through different switch combinations and then have a number displayed as to what combination the switches are in (i.e. what effect is on).

For example, when the number 1 is displayed, the switches could be on on on, then when the up button is pushed the number 2 is displayed and the switches are in on on off. Just an example.

Is this going to be rough? I don't have any programming knowledge, which is probably going to be the biggest downfall. I'm just not sure if this has a name I can look up, or if there are some IC's I could buy and use.

Thanks dudes!
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 03, 2009, 06:37:06 AM
Probably better to have it displaying by means of simple LEDs. You could convert into numbers, but you'd have to mentally convert back into binary to decide what's on and what's not. For example, effects 1 and 3 on would be displayed as "5", which is 101 in binary. So, in this case, 101 translates instantly as "1 on, 2 off, 3 on".

CD4053 would do for the switches - each one contains 3 SPDT switches and a pair of these chips would provide 3 for the effects and 3 for the LEDs. Or just one and do the Millenium LED switching trick on the other pole of each switch?

CD4029 will be ideal for the up/down counting. This very clever chip will either output in binary if pin 9 is held high or base 10 if pin 9 is grounded. So, we want it to count in binary, so hold it high. It has 4 output pins, Q1 - Q4 which can be used to drive the CD4053.

The other clever thing it does is provide what the datasheet calls "jam inputs" together with a "preset enable" pin. This means that you can force it to be at a particular number when you raise the preset enable high. So, when you want to cycle from 7 (Q1-Q3 all on - binary 111) to 0 (Q1-Q3 all off - binary 000) the chip will try to go to 8. So, when Q4 goes high, you have a simple little series of gates to (a) preset enable high and (b) J1-J4 all zero and all the lights go off. Going the other way is just as easy - you are looking for the condition when Q1-Q4 are all off and it receives a "down" selection to result in (a) preset enable high and (b) J1-J3 high and (c) J4 low.

Another couple of NAND chips and maybe a NOT chip to provide the roll-over logic for the jam inputs and we're done.

Give me a couple of hours and I'll have a completed circuit for you.
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 03, 2009, 08:17:14 AM
It's actually easier than I thought - We don't care about Q4 at all... when you increment from 7 to 8, Q1 - Q3 all turn to zero anyway and when you increment from 15 (all on) to "16", all outputs go off. Similarly, when you decrement from all off, you get "15" (all on, but we don't care about Q4 = 8, remember) and when you decrement from 8 to 7, Q1 - Q3 all turn on again.

You just need one CD4011 Quad 2-Input NAND chip for a quick and dirty solution, but there's the problem of switch-bounce, so you need another one to provide 2 S/R latches. Switches are SPDT momentary contact, so you push it and then just release to get a complete clock cycle:

(http://homepages.tesco.net/~michael.jdcastle/pics/binary%20switching%20up%20and%20down.gif)

I've just shown the LED switching, but it wouldn't be hard to add another 4053 ganged to the same inputs to provide the signal switching. Have a look at R.G.'s site (www.geofex.com) for more info about switching systems involving 4053s and how to bias the inputs/outputs.
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 03, 2009, 09:10:08 PM
Wow R O Tiree, I really appreciate the information you gave. It's not a real easy reading for me, so I will take some time to digest what you suggest and see if I can wrap my head around it.

The floor is still open to other ideas, if they exist, although the CD4053 looks like it would work beautifuly  :icon_mrgreen:
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 06, 2009, 04:32:41 PM
I tried to look through RG's site, but for some reason I never have any luck finding the pages I want to there.

Is it possible to just piggy back another 4053B off of Q1,2 and 3 for the 'audio' switching part? I mean, if I had to make that schematic twice, that would be 8 IC's and really limit how small I can make this thing. To make things worse, I still need to work with through hole stuff, never tried SMD  :'(

Also, any ideas on how to convert the three LED's into a number display? I found there are IC's that work with them, but I'm not sure how to find the missing link.

Thanks  :)

EDIT: sorry, I've been putting together a layout for this, atleast the LED part, and in your diagram, I am having some trouble identifying some pin numbers. From this data sheet:

http://www.onsemi.com/pub_link/Collateral/MC14029B-D.PDF

I get Q0-3 (or 1-4 like your diagram), P0-3, U/D, B/D, Vss and Vdd, but what about C in, C out and Clock? I read your description, and I won't lie, it's still really confusing, but it is slowly making sense..
Title: Re: Is there a simple spst switching with number display thing?
Post by: slacker on June 06, 2009, 04:54:47 PM
Have a look at the CD4511 (http://www.kpsec.freeuk.com/components/cmos.htm#4511) that will drive a 7 segment LED display to show your numbers, you can just use that instead of the CD4053.
I'm guessing the outputs of the CD4029 will drive the FV1 directly to choose the program.
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 06, 2009, 06:20:18 PM
Quote from: slacker on June 06, 2009, 04:54:47 PM
Have a look at the CD4511 (http://www.kpsec.freeuk.com/components/cmos.htm#4511) that will drive a 7 segment LED display to show your numbers, you can just use that instead of the CD4053.
I'm guessing the outputs of the CD4029 will drive the FV1 directly to choose the program.

Thanks Slacker, I'll have to see if I can make any sense of it.
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 07, 2009, 07:10:00 AM
I typed "CD4053 geofex" into Google and the first hit was Bypassing and Switching with the CD4053 (http://www.geofex.com/article_folders/cd4053/cd4053.htm). The coding on the page is a little weird and you'll find some of the text hidden behind some of the pictures, perhaps. You can solve this by dragging the right hand border of the window and making the window narrower. I found that making it a square sorted this out...

The 4511 is a no-brainer if you want to display numbers - but what's the point of logic that works in binary if you display it in base 10 and then have to mentally convert it back into binary again in order to decide what's on and what's off?

Each of these devices' outputs can drive up to 50 other inputs, usually. So there's no problem at all in using the outputs from the 4029 to drive another 4053.

The pinouts on the MC14029B-D chip and the CD4029 from Fairchild (http://pdf1.alldatasheet.com/datasheet-pdf/view/50852/FAIRCHILD/CD4029.html) are identical. As you correctly identified, the one you linked to labels the jam inputs and the outputs 0-3 instead of 1-4, but it's all the same. My simulator gives some of the pins different names, but here's the breakdown:

Pin   CW Sim   Fairchild Datasheet                 Remarks

1.      LD               Preset Enable                        Must be held at Gnd unless you want to force it to adopt another number via the jam inputs.
2.      Q4               Q4                                       This output denotes "8" in decimal when high. Add it to whichever other outputs are high to get the correct
                                                                       number. Remember, we don't care about this one, though.
3.      P4                J4                                        Jam input 4 (8). If pin one is high, whichever of these jam-inputs is also high at the time will go forward to its
                                                                       respective output (Q4 in this case, then).
4.      P1                J1                                        Jam input 1 (1).
5.      EN                Carry In                               Only needed when you're cascading these chips to count to higher numbers. Hold it low in this application.
6.      Q1               Q1                                       Ouput denotes "1" when high. Add to the other Qs.
7.      C                 Carry Out                             Leave this one floating. It sits high unless Q1-4 are all on, when it flips low. We don't need it here.
8.      Not Shown    Vss                                     Connect to circuit ground. Not shown in CW sim in order to keep the diagrams clearer.
9.      B/D               Binary/Decade                     If held high, it counts in binary, if low it counts in decimal. We want it high.
10.    U/D               Up/Down                            If held high the chip counts down by one when the clock is cycled. If held low, it counts upwards.
11.    Q2                Q2                                     Output denotes "2". Add to the others.
12.    P2                 J2                                      Jam input 2 (2).
13.    P3                 J3                                      Jam input 3 (4).
14.    Q3                Q3                                     Output denotes "4". Add to the others.
15.    |>                Clock                                  Chip changes state on the leading edge of the clock pulse going high. Nothing happens when you put this pin low again, except
                                                                      the chip is now ready for another clock pulse.

Hope all that helps.
Title: Re: Is there a simple spst switching with number display thing?
Post by: slacker on June 07, 2009, 10:03:27 AM
Quote from: R O Tiree on June 07, 2009, 07:10:00 AM
The 4511 is a no-brainer if you want to display numbers - but what's the point of logic that works in binary if you display it in base 10 and then have to mentally convert it back into binary again in order to decide what's on and what's off?

Good point. I was assuming that the 3 inputs on the FV1 were BCD inputs so number 1 from the CD4029, binary 001, would be patch 1 and an input of 001 to the CD4511 would display the number 1, so no mental conversion needed.

I didn't read the original post well enough, if Mike really wants on,on,on (111) to be patch 1 then what I suggested won't be much use.
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 07, 2009, 02:04:17 PM
Oops - forgot Pin 16 - Vdd - connect to positive supply.
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 07, 2009, 02:06:44 PM
R O Tiree, thanks for that explaination, just what I needed  :) I've got a layout almost ready for it that I will post up.

I don't really get what you are saying about the point of doing it if you have to convert it back to binary anyway. The reason I want to go this way is for the number to be displayed instead of having to read the number and sequence of LED's then interperate what the combination of LED's mean. If I wanted to just keep it to three LED's, I could just put in three switches with LED's and switch them that way, instead of 5 IC's and two switches. I was thinking of trying to find something to go on the other set of lugs on a DPDT switch that could control the counting and keep it seperate from the switching circuit, but I can't seem to find anything that stays in the parameters of only counting from 0-7 or 1-8.

But, I would like to give the way you say a try, definitly a fun project.  :)

EDIT: I do atleast know the Vdd part  :P Thanks for the addition though  :)
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 07, 2009, 06:12:30 PM
(http://homepages.tesco.net/~michael.jdcastle/pics/binary%20switching%20up%20and%20down%204511B.gif)

There ya go - now you get a number output. You'll still need the 4053 for the switching (see GEOFex) and you can use the Q1-3 outputs to drive both the 4511 and the 4053. Those switches are not ordinary "latched" SPDT that stay in the new position when you release the plunger - the ones you'll need are "momentary", which means you push, the switch changes state, release and the switch returns to its original state.

Here's what happens when you select the "Down" switch:

(http://homepages.tesco.net/~michael.jdcastle/pics/binary%20switching%20up%20and%20down%204511B%201.gif)

You see the logic changes state and "1" is displayed already, but the system needs to reset itself, so you need to release the switch:

(http://homepages.tesco.net/~michael.jdcastle/pics/binary%20switching%20up%20and%20down%204511B%202.gif)
Title: Re: Is there a simple spst switching with number display thing?
Post by: MoltenVoltage on June 07, 2009, 06:34:37 PM
This is exactly the kind of thing microcontrollers do best.

This could easily be done with a 14 pin uC - 2 power pins, 7 LED display pins, 3 output pins, 2 input pins

We'd make one, but it appears the total market would be 1-2 chips.   :-\
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 08, 2009, 02:06:36 PM
Sometimes it's fun to work the logic of these things out the "hard way". Also, if this is the sort of thing you're only going to do once, then hard-wiring is probably the way ahead. If, however, you're going to do this sort of thing a lot, then investing in the hardware and software to "roll-yer-own" becomes viable.
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 08, 2009, 08:00:46 PM
R O Tiree, I love you.

Seriously.

You have definitly made my first visit into digital a fun and exciting one. Of course, being hand fed the stuff is an easy way out, but I really appreciate what you did. It's not said enough, but people at this forum put so much time into helping people out, where they won't really get anything out of it, but do it anyway. I wish I knew some of you outside the forum  ;D

Back on topic, I got as far as the 4029 chip, so now I'll just split Q1-3 into two parts, going to the 4053B and the 4511B. What do B stand for anyway? Since it's on every chip we've used so far.

MoltenVoltage - I was told by cloudscape, I think is his name on here, (or tape, or sonic crayon, if you recognize any of those names) that ucontrolers would probably be the 'easiest' way. If you ever saw his Hollow Earth v2 pedal on this site, he had done something similar. R O Tiree is right too, atm, it's just for this one pedal. So the ~$5 worth in chips is easier for me to do right now then the $80 BASIC AVR environment or whatever it was called.

OTOH, I can't wait to try out your MV52 chip, especially now that you have a new version out w/o the tap problem.

Thanks again for the schematics R O Tiree, I will hopefully give them a try before my summer is over then I'm sure you will see this thread bumped with a happy ending.  :icon_mrgreen:
Title: Re: Is there a simple spst switching with number display thing?
Post by: R O Tiree on June 09, 2009, 05:41:42 PM
Thanks, me old. I enjoyed doing it  ;D
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on June 10, 2009, 09:43:07 PM
So, here is a layout, the PnP and then some of the connections on the board.

(http://i246.photobucket.com/albums/gg114/mth5044/switch2render.gif)
(http://i246.photobucket.com/albums/gg114/mth5044/switchPnP.gif)
(http://i246.photobucket.com/albums/gg114/mth5044/layoutswitch.jpg)

Some notes on the last picture

The orange lines on the SPDT mom. switches are what direction they are usually latched in. I was looking at some DPDT on-off-on switches so I could just have one switch, which could go up or down, but i forgot it needs to switch the 5v signal, which would have to be always on in the one direction if a DPDT on/off/on switch was used (I think)

Red dots are 5v connections (except the one next to the 5v regulator, which is 9v). I forgot to put the 5v to the 4053B, but that will got to pin 16. Since pins 2 and 5 are isolated on the 4053B, I will clip off the leads of the socket to allow other traces to run under there and be exposed on the end of the PCB.

The A's, B's and C's connect together.

The stuff on the top right is a 5v regulator, I forget the name of the componant used, but it's a common part (7805 maybe? I don't remember). Then the 5v is divided in a little hub type thing to the chips.

I checked the layout a few times, caught some mistakes, but I think it's OK now. I'm not sure if it was easier or harder then layouts I'm used to doing (caps, resistors and the like), but it sure was a different experience. I can't wait to get this up and working  :icon_mrgreen:
Title: Re: Is there a simple spst switching with number display thing?
Post by: cloudscapes on June 13, 2009, 10:45:06 PM
really clean!
and yes it would be a 7805
Title: Re: Is there a simple spst switching with number display thing?
Post by: kfw on July 17, 2009, 09:52:17 PM
That was a complicated answer.

The simple one is "yes, there are such switches"
they're called binary or BCD encoders, and the littlest ones are the size of 6-pin ICs with a screwdriver setting 0-7, 0-9, or 0-F, depending on whether you got octal, BCD, or hexidecimal.  They also come looking like standard rotary switches, or as things called thumbwheel switches, which have a mechanical indicator with a little number and either a wheel to turn or up and down buttons.

Google "thumbwheel switch" and select 'images' to see some.  Or "octal switch" or "BCD switch"

But in summary, you could get an 8-position rotary that selected those automatically and indicated with numbers from 0-7 or 1-8.  And you can get them in a variety of appearances.  Try DigiKey or Mouser.
Title: Re: Is there a simple spst switching with number display thing?
Post by: TheNixon on October 21, 2009, 04:10:31 AM
Hi,

I made my custom switching/looper based on CD4052 and PIC 16f84... Well PIC programmer can be made up of few components (i had some samples of PIC16f84 and i didn't wnat to threw them away)... CD4052 has ability to switch between 4 different routes. So I use 4 pins of PIC to notify when SW(momentary footswitch) has been pressed and FW  of PIC puts the right combination on two out pins (4 possible combination) which are connected to A,B pins of CD4052. PIC has 5V supply, 4052 has bipolar +-9V supply, so this two pins need 9V to make changes in 4052 (5V wont work, it is to low), so I add transistors (common collector) to drive 9V to pins of 4052. I tried to to replace PIC16f84 with some logic and I made some milley and moore automats but I soon realize that it woudl be easier to use PIC and made only simple PIC programmer (RS232 based). For FW programimg I used PIC simulator IDE which offers you simple basic language compiler and simulation and overview of pins of PIC. I made up whole thing within 30mins. SW compiles *.hex and with any programmer you can donwload it to device. Everything works nice for me.

Br,
nix
Title: Re: Is there a simple spst switching with number display thing?
Post by: MetalGuy on October 21, 2009, 04:51:32 PM
I appreciate your enthousiasm but excuse me - it's 21th century and using 5 pcs 40XX series chips for such type of switching is ridiculous.
I would suggest to Frank to include this feature in the next version of his FX unit. It would require a simple PIC or Atmel - he knows better.
This way the unit will have the functionality of an ACE mudule where no encoders are required and the display is maintained by the unit.

Title: Re: Is there a simple spst switching with number display thing?
Post by: octfrank on October 21, 2009, 07:26:26 PM
Quote from: MetalGuy on October 21, 2009, 04:51:32 PM
I appreciate your enthousiasm but excuse me - it's 21th century and using 5 pcs 40XX series chips for such type of switching is ridiculous.
I must agree, using a PIC or other simple micro would be a better solution.
Quote from: MetalGuy on October 21, 2009, 04:51:32 PM
I would suggest to Frank to include this feature in the next version of his FX unit. It would require a simple PIC or Atmel - he knows better.
Suggestion noted but will probably not happen. Many users only use 1,2 or 4 programs from an FV-1 or SKRM-C8 so including a micro that most clients would never use would add unnecessary cost to the module. Rotary switches with binary or gray outputs are rather common, many clients use micros to select the program in response to MIDI program change commands so the micro is the one that maintains state as it also acts as the MIDI receiver and you can easily make a encoder with a simple SP8T rotary switch and priority encoder. Using up/down push buttons is not too common where MIDI or other interface requiring a micro isn't also used.
Quote from: MetalGuy on October 21, 2009, 04:51:32 PM
This way the unit will have the functionality of an ACE mudule where no encoders are required and the display is maintained by the unit.
Don't think I know the ACE module and a quick search didn't turn up anything, pointer to a site?
Title: Re: Is there a simple spst switching with number display thing?
Post by: MetalGuy on October 22, 2009, 04:43:11 AM
QuoteDon't think I know the ACE module and a quick search didn't turn up anything, pointer to a site?

I wrote several times here about the ACE series modules and I even used one in one of my guitar amps.
They have a DSP onboard and have other interesting features supported by a uCU (Atmel).

This is the  manufacturer's site but strangely you wont't find the full datatsheets for their products there:

http://www.thk-japan.com/

You can find and download the full specs from one of their distributors site:

http://www.fk-industrie.de/en/produktkatalog/BG/EM/0.html

The data sheet for each module is named Specifications (pdf) not THKProdukte.pdf.
99 preset version of the module ACE99 supports an LCD display.

You can find these modules also at Cliff:

http://www.cliffuk.co.uk/products/digital/index.htm

http://www.cliffusa.com/digital-effects-modules.asp

Check out also the FX1 DSP Boards (AL3201 based) which are also relatively unknown.

And again the full datasheets are available from the German site:

http://www.fk-industrie.de/en/produktkatalog/BG/EM/0.html

This is a closeup of ACE8:

(http://i499.photobucket.com/albums/rr353/MetalguyPics/ACE8.jpg)


And finally to remind you about our take on FV-1 and thank Keith and you I think about solving couple of problems with this one:

http://www.diystompboxes.com/smfforum/index.php?topic=70381.0







Title: Re: Is there a simple spst switching with number display thing?
Post by: octfrank on October 22, 2009, 12:34:18 PM
Thanks for the pointers MetalGuy, will need to look at those in more detail. Any idea on the quantities they do? I based my answer above on the fact that every one (until this thread) that has asked about up/down/display control had a micro in their design already that could be tasked with that. If I am wrong and this feature is popular I'll look at adding it to a future module.

I do remember the thread from last year on your fx unit, did you ever post samples? If you did I missed that posting.

And sorry for hijacking the thread, so a little on the discussion so far:
There is a small logic error on the presentation of the SR latch, since these are cross coupled NAND gates it is really S-not/R-not latch so the proper way to wire it is have the switches tied to gnd, not +5 and use pull up resistors on the switched NAND inputs (pins 1,6,8 and 13 of the 4011 making the latches) to +5. This way the inputs do not float when the switch is not driving the input.
Title: Re: Is there a simple spst switching with number display thing?
Post by: MetalGuy on October 22, 2009, 04:26:13 PM
QuoteThanks for the pointers MetalGuy, will need to look at those in more detail. Any idea on the quantities they do? I based my answer above on the fact that every one (until this thread) that has asked about up/down/display control had a micro in their design already that could be tasked with that. If I am wrong and this feature is popular I'll look at adding it to a future module.

I bought my ACE8 from the german distributor together with other things but I think the module came at ~30 Euro.
My opinion is FV-1 sounds better and is more versatile that ACE and if you can implement the features ACEs have - mainly supporting 7 segment displays and using a regular pot instead of encoder, that will be enough to cmpletely beat ACE.
It wouldn't harm to develop two versions of your FV-1 module - one with and one without those features. Also why not a 100 presets version like the M16_24 :: Fixed program module from Spins site? Some people like it simple others like as much controls as possible so think about it.

QuoteI do remember the thread from last year on your fx unit, did you ever post samples? If you did I missed that posting.

Unfortunately no samples yet but since the FV-1 is all over the forum now maybe it's time to finally record some.
Title: Re: Is there a simple spst switching with number display thing?
Post by: mth5044 on October 22, 2009, 06:26:27 PM
You Digital & DSP guys  :icon_lol:

Way above my pay grade  :icon_lol:

I'm grateful for R O Tirees help. I don't know if my layout of his circuit works yet or not though. I will go put it together now! There has finally been a slow down at school, now there is time. THERE IS TIME!

I also don't have the knowledge or technology to program micro controllers. I took a class in true basic 6 years ago and made a mac machine (  :icon_lol: ) but I don't think I would be able to get programming down in any amount of time that would make it worth it, not to mention the cost of just getting the basics.

But I'm glad I made a thread that got other people talking.
Title: Re: Is there a simple spst switching with number display thing?
Post by: cloudscapes on October 22, 2009, 10:53:45 PM
mmmm, DSP

I'm comfortable enough with AVR stuff that doesn't need to be super speedy and optimized, but for decent DSP it seems you gotta do things in assembler.

my dream is to do granular synthesis in a pedal
Title: Re: Is there a simple spst switching with number display thing?
Post by: MoltenVoltage on October 22, 2009, 11:56:39 PM
If you want the highest audio resolution you absolutely need to code in asm.

For switching LED displays, its irrelevant, but just about as easy to use asm.
Title: Re: Is there a simple spst switching with number display thing?
Post by: MetalGuy on October 23, 2009, 04:47:08 AM
QuoteI also don't have the knowledge or technology to program micro controllers. I took a class in true basic 6 years ago and made a mac machine (  icon_lol ) but I don't think I would be able to get programming down in any amount of time that would make it worth it, not to mention the cost of just getting the basics.

Most people don't and dont' have to know because other people can do it for us and offer a product at descent price.