simple signalling logic circuit optimization

Started by Thomeeque, March 04, 2011, 11:33:03 AM

Previous topic - Next topic

Thomeeque

 Hello guys,

I have some guitar pedal with two 3PDT footswitches where I would like to implement following signalling logic:

AB|GR
00|10
01|01
10|~~
11|11

where:


  • A and B represent (state of) footswitches,
  • G and R represent green and red half of two-color LED and
  • ~ represents blinking (cca 2Hz fixed frequency square, one half of cycle both LEDs shine, other half of cycle are both LEDs dark)

Now, I'd like to use simple logic chips (CD4xxx family probably) and maybe switching diodes to achieve this (including square signal generator for blinking), but my knowledge and overview about logic chips is very limited, so I'm pretty sure that even if I would try very hard my solution would not be the most optimized one (by optimized I mean part count or maybe better said circuit physical size mostly).

Using Karnaugh maps I have found these logic equations:

G = (-A)(-B) + AB + AC
R = B + AC


Note: C represents logic state at output of blinking signal generator.

What I see is some inverted XOR and few ANDs, so I would probably manage it using one multi-XOR IC (partly for XOR, partly for negations, maybe for oscillator) and one multi-NAND IC for rest plus few diodes for ORs, but isn't there some path simpler?

What could help with optimization:


  • Switches could be configured to provide A or -A (B or -B), independently
  • output R and G signals could be both inverted (but both same - as I say above, I use two-color diode - I can choose common cathode or common anode type)
  • blinking duty cycle does not have to be exactly 50:50

I don't want to use PIC or any other approach at this moment, really just simple logic ICs and diodes (and few resistors and capacitors for oscillator and LEDs of course).

Thanks, T.

Edit: VCC = 9-10V
Do you have a technical question? Please don't send private messages, use the FORUM!

jasperoosthoek

If I understand correctly the plus signs are ORs right? OR can be done with just two diodes that supply the same LED (and current limiting resistor).

Just get two inverters for the -A and -B and three AND gates in a CMOS chip (the CD4xxx handles 9V for sure). The AND gates do the (-A)(-B), AB and AC. The ouputs of the AND gates are ORed with diodes supplying a LED.

This can also be done with five NAND gates. Use two as inverters by running the same signal to each input. Use the other NANDs instead of ANDs. The output of those three NANDs will be inverted. Just use diodes at the negative side of the LEDs to make them blink when the NANDs are negative.

Good luck!
[DIYStompbox user name]@hotmail.com

Thomeeque

#2
 Thanks Jasper, but what you suggest is - with all due respect - really just replacing operators in my equations by corresponding logical elements 1:1. And result is two ICs plus cca five diodes.

I kinda hoped that we would find the way at least how to cut those two ICs to one.

And maybe I have found solution:

(-A)(-B) + AB = -(A XOR B) = A XNOR B

so

G = (-A)(-B) + AB + AC = (A XNOR B) + AC
R = B + AC

If I use CD4077B (quad XNOR gate), I have three remaining XNOR gates available for the rest. As XNOR can be turned to inverter (by setting one input to 0), I could use two to get oscillator. Now only remains to solve this AC (besides ORs, which can be made by diodes, "only" four now) - and it could be done if I'll find the way how to stop oscillator at 0 by A=0. And I think this could be doable as well, but I'll have to think about it yet after I'll get some sleep :)

Cheers, T.
Do you have a technical question? Please don't send private messages, use the FORUM!

cpm

this is job for a Pic, anyway...
you can try 4052: Dual 4-Channel Analog Multiplexer/Demultiplexer
the switches are the control bits, each multiplexer routes one of the output bits, apply your 4 line output table at the pins

Thomeeque

 Thanks for reply, Carlos!

Quote from: cpm on March 05, 2011, 06:00:36 AM
this is job for a Pic, anyway...

Yeah, considering PIC price and simplicity of circuit needed around it you are right, but I simply don't want to put (even tiny) digital computer into otherwise very simple analog pedal just to control status LED. Besides the need of programming (which I would probably handle already) it could lead to some (clock) noise issues or something like that.

Quote from: cpm on March 05, 2011, 06:00:36 AM
you can try 4052: Dual 4-Channel Analog Multiplexer/Demultiplexer
the switches are the control bits, each multiplexer routes one of the output bits, apply your 4 line output table at the pins

Yep, it could be interesting, but it would require "external" blinking signal generator (another IC or transistor(s))..

I'll try my CD4077B idea once I'll do shopping, it could work.. :)

Cheers, T.
Do you have a technical question? Please don't send private messages, use the FORUM!

Hides-His-Eyes

Quote from: Thomeeque on March 07, 2011, 06:23:59 AM
Yeah, considering PIC price and simplicity of circuit needed around it you are right, but I simply don't want to put (even tiny) digital computer into otherwise very simple analog pedal just to control status LED. Besides the need of programming (which I would probably handle already) it could lead to some (clock) noise issues or something like that.


Your blinking LED is just as likely to cause 'clock' noise!

PIC clock noise generally STARTS at 4MHz, which is so far out of the audio band as to be easily ignored.

Thomeeque

#6
Quote from: Hides-His-Eyes on March 07, 2011, 06:43:58 AM
Your blinking LED is just as likely to cause 'clock' noise!

Yes, maybe, but I'll be "closer" to the clock circuit with better chance to round the edges.

Quote from: Hides-His-Eyes on March 07, 2011, 06:43:58 AM
PIC clock noise generally STARTS at 4MHz, which is so far out of the audio band as to be easily ignored.

I'm not sure if the clock signal would be the only source of noise coming out of the PIC and even 4MHz could cause troubles in the whole signal chain if there was some other source of similar frequencies (heterodyning).

T.
Do you have a technical question? Please don't send private messages, use the FORUM!

JKowalski

I can't see any way to simplify it anymore. Try to rearrange the input truth table so it gives you the same results but different options on how to get there.


JKowalski

Quote from: Thomeeque on March 07, 2011, 07:25:46 AM

Quote from: Hides-His-Eyes on March 07, 2011, 06:43:58 AM
PIC clock noise generally STARTS at 4MHz, which is so far out of the audio band as to be easily ignored.

I'm not sure if the clock signal would be the only source of noise coming out of the PIC and even 4MHz could cause troubles in the whole signal chain if there was some other source of similar frequencies (heterodyning).

T.

It wouldn't. Both methods are doing the same thing - creating a 2Hz clock. Pulsing an LED at 2Hz at a certain current will cause the same amount of noise no matter how you get to that point. Just because you are using a chip that runs at 4mHz to create a 2Hz signal doesn't magically make the 2Hz noise go away.

PIC's will generate noise other then the clock, definitely. Think of all the operations in the chip going on - states don't ALWAYS change at 4mHz (or w/e the clock speed is)... What about a register? Say you load that once every 1,000,000 cycles.  That's 0.25Hz. Generally the noise will spread across a huge spectrum but the MAJORITY of the noise will be at 4mHz and it's harmonics since the MAJORITY of the transistions is done on the clock cycle.


All you want to watch for is switching high currents through the LED (limit them reasonably) and don't use components to make your 2Hz signal that draw lots of current. CMOS won't, used correctly. Neither will PIC's, they are designed for relatively low power consumption.

Thomeeque

#9
 Thanks, Chris!

So, this is what I came up with so far:



It does not look that simple, but it can be done on relatively small PCB. I have tried it "per partes" on breadboard so far ("AC" logic idea mainly), I'll try to solder complete prototype soon and see how it behaves noisewise.

It could be simplified little bit if I would go with red blinking (I could drop D2 and D3 and feed green half directly by IC1B), but I don't want to :)

Btw. it's a really shame that low-current dual LEDs are not that common (shops around me sell only stadard "20mA" dual LEDs :(), I wonder why..?

T.
Do you have a technical question? Please don't send private messages, use the FORUM!

Barcode80

I think it has to do with the different voltages required to make the LED material glow certain colors. I guess that depends on if you are referring to bi-color single shared anode and cathode or if you mean the kind with a shared cathode but individual anodes.

Thomeeque

#11
Quote from: Barcode80 on March 15, 2011, 12:28:41 PM
I think it has to do with the different voltages required to make the LED material glow certain colors. I guess that depends on if you are referring to bi-color single shared anode and cathode or if you mean the kind with a shared cathode but individual anodes.

Hmm, shops around sell only those with common cathode (or anode)..

Meanwhile I did findout that RGB LEDs (red, green and blue LEDs combined /with common cathode/ in one capsule) fairly available here are much more sensitive (it shines at 1mA same as the dual color LED at 10mA) - on the other hand colors do not mix that well in those I did try (e.g. when red and green colors were shining, at direct angle it was nice orange but at some offset angles it was almost red or almost green - very confusing), even DIFFUSED type.

So I did gave up and added yet simple transistor buffers for each half to give dual color LED current it needs.



It's much more complicated then I would expect at the beginning (really good reason why to give PIC a shot next time :)), but I'm quite happy with the result :)

I'll post updated schematic soon.

Edit:



Thanks, T.
Do you have a technical question? Please don't send private messages, use the FORUM!

MoltenVoltage

In my experience, logic chips create a louder click than a PIC.

Because they do, what I recently discovered (after extensively experimenting with Galego's techniques) is that you should create a separate digital ground for the logic chip and anything downstream.

The optimal method I've found is to make a ground to > digital ground connection with a 43 ohm resistor and a 1N4001 diode pointing away from the digital ground.  Signal diodes don't work as well.

A 100uF cap from +5v to the Digital Ground also makes a big difference.  Finally a 220 uF cap in front of the voltage regulator helps a lot too.

For this project, it might be overkill, but something to keep in mind when you work with logic chips.
MoltenVoltage.com for PedalSync audio control chips - make programmable and MIDI-controlled analog pedals!