Analogue Multiplexer Issue

I have a slight (Bloomin annoying) issue with the MUXing on the CheapStep Pro Project. In general it works as expected.

So to give you an idea what is supposed to happen…

The mux gets set to Address 0, gets enabled, and then steps through to address 8 before being disabled. (the next of the 4 muxes then does the same and it cycles through… All fine(ish)

Each Mux output sends ~5V to an LED, pair of POTS and that gives the two CV voltages…

The problem is that there is a glitch, it seems primarily on step 2,7 causing noise on step 5… You can see the LED for step 5 flicker faintly briefly.

I have tried all sorts of things in code to delay, change, rejig the way the mux is addressing… But to no avail.

I have googled around and can’t fins much on it…

In practice, the CV for the Frequency makes no noticable difference, but the one for the VCA creates a crackle…

Has anyone got any ideas… Anthing I can add in to attenuate these blips???

Any help much appreciated as it’s holding me up now :frowning:

Cheers

Rob

Are you sure address bits are set correctly before enabling the chip? I mean you should disable it while setting a new address. Did you also tried using pull-up or pull-down resistors on the address pins?

1 Like

Ok, forget the disabling, it also disables the outputs. The chip uses “break-before-make” so it takes a few nano seconds before it switches the channel. So I guess it’s a timing issue. Add some delays. Or you are too slow while changing the address.

What device you are using to drive it?

Cheers

It’s being driven by an Arduino.

Still trying to make some sense of what’s going on. As I say I don’t think it’s an addressing/enabling issue.

The PCB’s are my old test boards which may be a little hacked and had dodgy ribon cables by the looks… I will build up one of the later ones and see if the issue goes away.

How are you setting the address pins? Output pins on the Arduino can be set directly in a register. This is much faster and you can even set certain pins at the same time to avoid timing issues.

-edit since I mistakenly thought this was I2C for a sec-

Pins 6,7,8 should be set to GND, and pin 3 should be your output to an analog input pin on the arduino.

This just highlights the need for me to finish up my diy midi controller wiki.

Here is a diagram for hookups:

-note, this is for muxing, not demuxing-

1 Like

Errrr — Comment on previous post was edited so I edited this one as we concur it’s not an It’s not an I2C MUX. :smiley:

it’s a 3 bit Addressed “4051” shown in the schematic.

1 Like

It’s all hooked up correctly, the addressing and sequencing all works fine across 4 muxes. But it gets this little interference.

Cheers

Rob

Please share the code and the full schem, all i see right now is that it looks like you have hooked it up incorrectly. If you dont wish to share everything, can you confirm PIN 3? It looks like its just plugged to +5v in the schem.

Pin 3 is 5V, which gets passed out to the 8 outputs in sequence.

Ah, I was thinking in reverse. I only ever use these guys to multiplex inputs. How many of these are you using? To confirm, are you muxing or are you demuxing?

This is just the control sub board (1 of 4)

1 Mux per board outputs sequenced 5V
1 Mux per board inputs 5V to the Duino.

I did initially months ago have issues with over voltage then tryign to push 6V through the chip, maybe it’s just over voltage ( but I doubt it…)

Can you tell me what ENA leads to?

image

I would also like to see loop in your code that goes through each pin addr.

Are all of the enable lines for all of your 74HC4051’s on different pins of the ardunino?
Are they reading from the same analog out pin?

Mux Selection ( referenced in sequence section)

void muxa(){           
       digitalWrite(13, LOW );//A
       digitalWrite(2, HIGH );//B
       digitalWrite(4, HIGH );//C
       digitalWrite(22, HIGH );//D 
}
void muxb(){           
       digitalWrite(13, HIGH );//A
       digitalWrite(2, LOW );//B
       digitalWrite(4, HIGH );//C
       digitalWrite(22, HIGH );//D 
}
void muxc(){           
       digitalWrite(13, HIGH );//A
       digitalWrite(2, HIGH );//B
       digitalWrite(4, LOW );//C
       digitalWrite(22, HIGH );//D 
}
void muxd(){           
       digitalWrite(13,HIGH );//A
       digitalWrite(2, HIGH );//B
       digitalWrite(4, HIGH );//C
       digitalWrite(22, LOW );//D 
}

can you include pin definitions? I would like to know more about what the pins that are referenced in your mux functions map to on the MUX. I see 4 pins, but only 3 of those can be address select pins. A,B,C, and D are not very descriptive.

pinMode(42, OUTPUT);
pinMode(43, OUTPUT);
pinMode(44, OUTPUT);
pinMode(45, OUTPUT);
pinMode(46, OUTPUT);
pinMode(47, OUTPUT);
pinMode(48, OUTPUT);
pinMode(49, OUTPUT);
pinMode(50, OUTPUT);
pinMode(51, OUTPUT);
pinMode(52, OUTPUT);
pinMode(53, OUTPUT);
pinMode(13, OUTPUT);
pinMode(22, OUTPUT);
pinMode(2, OUTPUT);
pinMode(4, OUTPUT);

void x32STEP_F(){
Serial.println(“32 Step Mode - loop”);
for ( int DigitX = 1; DigitX < 13 ; DigitX = DigitX + 3 ) {

       Serial.println("A ONE");
       if ( DigitX == 1 ) {
       muxa();
       Serial.println("A ONE");
      
       }
       if ( DigitX == 4 ) {
       muxb();
       Serial.println("B TWO");
      
       }
       if ( DigitX == 7 ) {
       muxc();
       Serial.println("C THREE");
      
       }
       if ( DigitX == 10 ) {
       muxd();
       Serial.println("D FOUR");
      
       }     
       digitalWrite(41+DigitX,LOW); //A42 B45 C48 D51
       digitalWrite(42+DigitX,LOW); //A43 B46 C49 D52
       digitalWrite(43+DigitX,LOW); //A44 B47 C50 D53
       delay(spe); 
       //
       digitalWrite(41+DigitX,LOW); //A42 B45 C48 D51
       digitalWrite(42+DigitX,LOW); //A43 B46 C49 D52
       digitalWrite(43+DigitX,HIGH); //A44 B47 C50 D53
       delay(spe); 
       //
       digitalWrite(41+DigitX,LOW); //A42 B45 C48 D51
       digitalWrite(42+DigitX,HIGH); //A43 B46 C49 D52
       digitalWrite(43+DigitX,LOW); //A44 B47 C50 D53
       delay(spe); 
       //
       digitalWrite(41+DigitX,LOW); //A42 B45 C48 D51
       digitalWrite(42+DigitX,HIGH); //A43 B46 C49 D52
       digitalWrite(43+DigitX,HIGH); //A44 B47 C50 D53
       delay(spe);  
       //
       digitalWrite(41+DigitX,HIGH); //A42 B45 C48 D51
       digitalWrite(42+DigitX,LOW); //A43 B46 C49 D52
       digitalWrite(43+DigitX,LOW); //A44 B47 C50 D53
       delay(spe); 
       //
       digitalWrite(41+DigitX,HIGH); //A42 B45 C48 D51
       digitalWrite(42+DigitX,LOW); //A43 B46 C49 D52
       digitalWrite(43+DigitX,HIGH); //A44 B47 C50 D53
       delay(spe); 
       //
       digitalWrite(41+DigitX,HIGH); //A42 B45 C48 D51
       digitalWrite(42+DigitX,HIGH); //A43 B46 C49 D52
       digitalWrite(43+DigitX,LOW); //A44 B47 C50 D53
       delay(spe); 
       //
       digitalWrite(41+DigitX,HIGH); //A42 B45 C48 D51
       digitalWrite(42+DigitX,HIGH); //A43 B46 C49 D52
       digitalWrite(43+DigitX,HIGH); //A44 B47 C50 D53
       delay(spe); 
       }

}

The main control, enables go to D22,D13,D4,D2

I take it the arduino pins S0, S1 and S2 are digital outputs ( the diagram says ‘in’ )?