I'm trying to build a circuit which uses three 4094's to give me enough outputs to drive a number of LED's. I've built a few similar circuits before in the past using the same code and schematic, but for some reason this time I'm having problems controlling the shift registers.
The first 4094 is connected to my Arduino UNO using the following outputs:
CD4094_CLOCK - Digital 2
CD4094_DATA - Digital 3
CD4094_STROBE - Digital 4
For the sake of testing I've connected the 4094 OEs to +5V, but they will be on a PWM pin in reality. I've connected all the 4094 STROBE
and CLOCK
inputs as I've done previously, too.
I'm using the following program, however no matter what value I shiftOut
to the 4094's most of the outputs stay high:
// CD4094 Constants
#define CD4094_CLOCK 2
#define CD4094_DATA 3
#define CD4094_STROBE 4
//#define CD4094_OE 3
char Display1 = 0, Display2 = 0, Display3 = 0;
void setup() {
pinMode(CD4094_CLOCK, OUTPUT);
pinMode(CD4094_STROBE, OUTPUT);
pinMode(CD4094_DATA, OUTPUT);
//pinMode(CD4094_OE, OUTPUT);
}
void loop() {
Display1 = 63;
Display2 = 6;
Display3 = 91;
shiftOut(CD4094_DATA, CD4094_CLOCK, MSBFIRST, Display3);
shiftOut(CD4094_DATA, CD4094_CLOCK, MSBFIRST, Display2);
shiftOut(CD4094_DATA, CD4094_CLOCK, MSBFIRST, Display1);
digitalWrite(CD4094_STROBE, HIGH);
digitalWrite(CD4094_STROBE, LOW);
delay(3000);
Display1 = 0;
Display2 = 0;
Display3 = 0;
shiftOut(CD4094_DATA, CD4094_CLOCK, MSBFIRST, Display3);
shiftOut(CD4094_DATA, CD4094_CLOCK, MSBFIRST, Display2);
shiftOut(CD4094_DATA, CD4094_CLOCK, MSBFIRST, Display1);
digitalWrite(CD4094_STROBE, HIGH);
digitalWrite(CD4094_STROBE, LOW);
delay(3000);
}
Here's a picture of my breadboard too, in case it could help someone?
Does anyone have any suggestions on how I can debug this sort of issue? The only tools I have are my multimeter and Arduino boards. Is there some kind of problem with my code?
QSn
) of one shift-register, to the data-input (D
) of the next shift-register \$\endgroup\$CLOCK
is onD0
,DATA
is onD1
andSTROBE
is onD2
- thanks for pointing that one out too. I've updated my constants accordingly, now when I run the program all my 4094 outputs remain high. \$\endgroup\$