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:
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.
Hmmmm do you want to write to both shift register at the same time? I say this because you're looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input.
don't really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with input_bin:
So, every time you go through a cycle of the for loop, you'll just start with the same values in upper_byte, and lower_byte. To sequentially output each shifted value, you'll instead want something like:
output_value = 0b1
for i = 1 to 16:
latch(low)
shift_out(output_value)
latch(high)
output_value = output_value << 1
That is, if I interpereted correctly that you want the shift registers to output the following:
Note: Lemmy has a bug where it doesn't format some symbols correctly, so the left angle bracket gets formatted as <. The same issue exists for the right angle bracket, the ampersand, and I would presume others.