Logically never using a 1P8T switch (I hope…)

Started by Matthew Sanford, June 22, 2023, 08:24:37 PM

Previous topic - Next topic

Matthew Sanford

So another post about switching 5 poles mentioned CD405x chips, 4053 x 2 specifically, but it got me reading on the 4051 and thinking on the 8 waves of the StompFLO, the fideleater, and Druid schemes using 1P8T switches. The 393 binary counter seems to put out signals that could feed the 4051 to switch in order. This is me assuming it'd take the voltage from a divider to feed back to the StompFLO (is that demux?), and that using a momentary to send 6v plus pulses to the 393 would do the trick. Figuring 3 LEDs to match the truth!...uh...table. This is a "for the future" thing for me right now

So, to echo Animaniacs, good idea/bad idea?

On another note, is there a circuit that could sample and hold voltage from a pot set between 5v and ground if the middle is switched to another chip? Aaaaand...staying that way if switched back?
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

PRR

  • SUPPORTER

Matthew Sanford

Hmmm...no solution for leakage though, I guess. Should just pony up for the dual concentric pots or whatever they call 2 separate pots in one, no switching of the cv pots needed that way...

Still, on the other, that should work right? I just like the idea of hitting a foot switch to cycle through, with the 9th resetting it to the beginning. Much better than bending over to turn a knob, what with this back
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: Matthew Sanford on June 22, 2023, 11:52:15 PM
I just like the idea of hitting a foot switch to cycle through, with the 9th resetting it to the beginning. Much better than bending over to turn a knob, what with this back

I didn't understand what you were proposing in your opening post, but it sounded much too complicated.

Doing this "footswitch to cycle through 8 options" is simple: You use the footswitch to clock the counter, the counter provides a 3-bit binary code to the 4051, and the 4051 selects a voltage to feed the StompLFO waveform input.

In fact, it doesn't even have to be that complicated - you can drop the 4051 too. There's a diagram in one of the datasheets (might be TAPLFO or VCLFO, I don't remember) showing how to build a little R-2R DAC which takes a three bit binary code and creates the right voltage directly. It's only a few resistors, so it's not hard.

About the only tricky bit to this will be getting a bouncy footswitch to clock the counter cleanly. There'll need to be some fairly robust debouncing going on there so that both a stamp and a tap give the same nice increment-by-one action.



Matthew Sanford

A hastily drawn scheme of my thoughts

Was considering the 74LS90 as I have some, but now seeing the output is 2.4 against the needed 3.5v high needed by the 4051, using the 9th count to reset it. I looked up the VCOLFO R-2R DAC...


...and a site explaining the series/parallel points, so that seems a smarter way than the 4051 since a divider would be necessary anyway. As the counter isn't supplying 5v, is that why yours shows a separate 5v input? I'll have to riddle through the math this weekend.

Thank you for taking some time while on vacation Tom!
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: Matthew Sanford on June 23, 2023, 01:15:47 PM
I looked up the VCOLFO R-2R DAC...

Yep, that's the one!

Quote
...and a site explaining the series/parallel points, so that seems a smarter way than the 4051 since a divider would be necessary anyway. As the counter isn't supplying 5v, is that why yours shows a separate 5v input?
No, the extra input is because I ideally want midpoint voltages for each of the eight ranges. One way to do that is to use a 4-bit DAC with the lowest bit permanently set high. So rather than count 0,1,2,3...7 we actually count 1,3,5,7,9,11,13,15.

My R-2R DAC circuit assumes that the logic outputs are 5V (or very close to it), so I doubt it's going to work with 3.4V. That seems very low. The VCLFO/TAPLFO/StompLFO CV inputs all need 0-5V, so something that only goes to 3.4V is going to lose some of the top of the range. Is there some other counter you can use?


PRR

Quote from: ElectricDruid on June 28, 2023, 01:13:55 PM...3.4V. That seems very low. The VCLFO/TAPLFO/StompLFO CV inputs all need 0-5V, so something that only goes to 3.4V is going to lose some of the top of the range.

The 74LS90 actually specs 2.7V minimum. It is made for TTL logic, where 1.3V is high. You must assume 1.2++V loss from Vcc=5.0V. With a CYA factor that is under 3.5V. And actually very temperature sensitive.

Buffered CMOS is normally suggested for too-simple DACs but the price may get in the way.
  • SUPPORTER

Matthew Sanford

#7
Conundrum. I'm trying to slow myself down on things and this is a ways out (gotta finish buffers, scoville guitar amp, flangers, so much to get to breadboard...) but

I was thinking maybe I should use the 90 (or similar) to hit bases/gates on 3-4 BJTs or FETs or relays to send different voltages into the R-2R in order to return the correct voltage over 8 steps, so it is the trigger but isn't the voltage level. Feels like I'm just increasing the part count, but just tapping to the next wave on a stompflo rather than turning just sounds nice... (Edit start)its funny how many logic chips I now have (well, the 4051, the relays, I think 157s, etc) ordered for relatively cheap during this just for ideas to change. I suppose I'll find use for them somewhere!(Edit end, just can't post short!)

Hey thank you both again! Ever helpful (with my sanity issues!)!
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

R.G.

#8
At the risk of becoming a one-note tune, there are cheap microcontroller (PIC and other families) that can mechanize all that.

As I noted in the thread about a one-of-three/four/N footswitch, MCUs debounce footswitches easily in code, and the code is easy, even for up to N switched all debounced in parallel. PICs mostly contain 10-bit A-D converters and many of them contain internal five bit ( one of 32 ) DACs to generate voltages external to the chip. If you want to feed the thing with a pot, the A-D does that; if you want to whack a footswitch to get to a pre-defined setting, the footswitches can be set to override the pot, and the programming could be such that if the pot changes after a footswitch is pressed, the output reverts to being controlled by the pot setting. So, set by pot; press a footswitch for a pre-set; revert to pot if you turn the pot. ASMOP*

(*ASMOP = A Simple Matter Of Programming)

I'm a little confused with the approach in the original post, too, but there might be a one- or two-chip solution. One chip is a $1.50 PIC. The PIC reads up to eight footswitches, calculates what voltage to put out based on the switch reading, then outputs it on the DAC. The one of eight switching becomes internal to the PIC in code. There's enough logic simply unused in the PIC to illuminate indicator LEDs and so on.

Edit: upon re-reading, the PIC solution also functions as a crude (5-bit, only 32 values) sample and hold. The ADC reads the voltage to be sampled, the value is held as a binary number, and is then remembered later with 5-bit accuracy. Fancier PICs or external DACs can get you higher accuracy when you use the remembered "hold" value.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Matthew Sanford

Really a PIC would do all I need, switch from one Druid chip to the other and remember settings for each...I'm a bit far from the programming part, but I figure it's not that different from BASIC, right? :icon_wink:

Still, I'm going to play with the hardware side first probably, it helps to play around with everything to gather and compile bits of understanding! Thank you for putting it here though, might help someone else later too
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

R.G.

Quote from: Matthew Sanford on June 28, 2023, 07:44:25 PM
Really a PIC would do all I need, switch from one Druid chip to the other and remember settings for each...I'm a bit far from the programming part, but I figure it's not that different from BASIC, right? :icon_wink:
Actually, it IS BASIC. The free Great Cow BASIC suite lets you write PIC code in a BASIC variant and compile it to hex, suitable for programming into the chip. I used to use both C and assembler for PICs, but all I use now is GCB.

Quote
Still, I'm going to play with the hardware side first probably, it helps to play around with everything to gather and compile bits of understanding! Thank you for putting it here though, might help someone else later too
Go for it. Understanding both is good.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Matthew Sanford

With line numbers and Goto statements? I've got smiles like an 8 year old in front of the orange monitor of the IBM clone...though I was cursing it's lack of the random function.

That is brilliant though. Ok, give in to the tendency to learn everything!

Thanks for the info and encouragement! Ah, I love this place.
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

R.G.

Well, yes, GOTOs, but line numbers are no longer hard requirements in modern dialects of BASIC. And it does have a random function. And GCB has libraries that let you use the on-chip peripherals directly in BASIC. And you can drop assembly statements in directly. It's a highly functional mix of high(ish) level language and down-to-the-bare-metal capabilities. Very handy.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Matthew Sanford

I just found the old GW Basic manual online, makes me giddy but I'm from '77 so the age programming on an Atari 400 then ibm-compatible was still a time of wonder for me. I'll search out a GCB guide and start learning. I suppose not such a wonder, but still yes, how far we've come from storing programs on cassette tapes to using tiny 8 pin chips! Building blocks are still the same...I guess akin to everything though, right?
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: Matthew Sanford on June 29, 2023, 01:18:55 AM
I just found the old GW Basic manual online, makes me giddy but I'm from '77 so the age programming on an Atari 400 then ibm-compatible was still a time of wonder for me. I'll search out a GCB guide and start learning. I suppose not such a wonder, but still yes, how far we've come from storing programs on cassette tapes to using tiny 8 pin chips! Building blocks are still the same...I guess akin to everything though, right?

One of the things I really like about PIC/microcontroller programming is exactly that - it takes me back to my early years programming personal computers in the 80s. The level is really very similar: memories measured in KB, clock speeds of a few MHz, never enough RAM. Back then, programmers had to learn how to do things as efficiently as possible and how to get the most out of the little that was provided. That was the part I loved. Microcontrollers are the only place that those skills are really still required.


Matthew Sanford

"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: Matthew Sanford on June 29, 2023, 10:53:20 AM
Quotenever enough RAM.

is there ever enough?
Nowadays with 16GB RAM in your laptop, I'd say there's *much more* than enough. Modern computers use *dozens* of levels of code-on-top-of-code-on-top-of-code, and a lot of modern software is hopelessly bloated and would be hideously slow except for the fact that processors got so damn fast. It doesn't do programmers any good to have lots of RAM and super-fast chips to play with - it just makes them lazy!! ;)

Matthew Sanford

I might of been thinking of the computer in my skull...well, and the two repurposed computers that had issues with Studio One before I stopped being cheap about it.  :icon_frown:
Reading the GCB syntax and holy cow I know some of this!
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx