Shift out strange issues...

I'm having some strange issues with shiftOut.
I am seeing my clock pin giving me a 50mS pulse and the data pin staying static on my oscilloscope.
The latchpin seems to be working ok.
What I see on my output is that whatever is on the shift register gets shifted in one second intervals until the register is all high.
I should be seeing different values shifted in.

Here is my code:

int latchPin = 0;
int clockPin = 1;
int dataPin = 2;
int lifePin = 13;
int output = 100;
//Prototypes
void writeshift(byte, byte, byte);

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(lifePin, OUTPUT);
  
}

void loop() {

    // pause before next value:
    delay(1000);
   writeOutputs(0xff,0xff, 0xff);
   digitalWrite(lifePin, LOW);
    
    delay(1000);
    writeOutputs(0x00, 0x00, 0x00);
    digitalWrite(lifePin, HIGH);  
  
  
}

void writeOutputs(byte score1, byte score2, byte outs){
  
    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, MSBFIRST, score1);  
    shiftOut(dataPin, clockPin, MSBFIRST, score2);  
    shiftOut(dataPin, clockPin, MSBFIRST, outs);
    digitalWrite(latchPin, HIGH);
    delay(1);
    digitalWrite(latchPin, LOW);
}
int latchPin = 0;
int clockPin = 1;

These pins have special meaning, with extra resistors. I'd recommend you not use them as latch and clock pins.

I actually had tested it already using 1 and 2. I know they are used to program but that shouldn't and didn't interfere with the shift register outputs. I tested it using 2 registers and it worked fine. I have an extremely high pin count usage and have my other pins occupied.

I was up until 2 AM debugging and about the 5th time I checked my wires, I realized that at one of the junctions between boards, I obviously had all of the wires crossed.

I believe that a good nights sleep is in order before doing that kind of debugging.

I tested it using 2 registers and it worked fine.

That implies that you do not have any / enough decoupling capacitors on the shift registers:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Also there should be no capacitors on the shift register's clock or latch lines, despite what any tutorial may say.

You know Mike, I think that you are correct.

However, I definitely had an issue with crossed wires that was causing my problem.

I don't have any decoupling caps and I saw some sporadic behavior on the scope.
I haven't been able to fix my wire crossing issues yet because I have to work during the day. :frowning: but I suspect that is the primary culprit.

One of the odd things that I saw was with a volt meter, on the output QH` of the first register, when it should have been a high output, it was 8.6VDC for about a second before drifting down to 5VDC.

I have no inductance (unless it is parasitic) and no voltage above 5vdc in the system so this confuses me.

it was 8.6VDC for about a second before drifting down to 5VDC.

Not good.
As well as inductance you can get this effect with capacitors. If you have a capacitor in series between an output at zero and a logic input at +5V. Then when the output goes to +5V the logic input will go up to +10V before it starts to discharge. It is likely that you would see this as an 8.6V spike on a scope.

Hmm.. this is interesting Mike, I don't have any capacitors in my system besides the one ac coupling the reset pin.

Could wire capacitance do this?
I really don't see that happening off of line cap.

Everything totally worked better when I wired it correctly!

Thanks for all of the great info everybody!

Mike, you are always so fast to respond. I appreciate how much of yourself that you pour into this forum!