Shift register missing bits
Hey friends,
I have a two daisy chained shift registers (74AHC595) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.
The code seems to work, but the outputs O_9 and O_10 are not staying high (zoom) after setting them, whereas all the other ones are working fine. This is the used code snipped:
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);
</span><span style="color:#323232;">
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);
</span><span style="color:#323232;">
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;
</span><span style="color:#323232;">
</span><span style="color:#323232;">for(int i=0; i<17; i++){
</span><span style="color:#323232;">
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;
</span><span style="color:#323232;">
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);
</span><span style="color:#323232;"> usleep(10);
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);
</span><span style="color:#323232;">
</span><span style="color:#323232;"> delay(10)
</span><span style="color:#323232;"> input_bin = input_bin>>1;
</span><span style="color:#323232;">}
</span>
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.

Add comment