I've got a question about shift registers and a trick I had in mind which isn't panning out as I thought it would.
I have a led matrix I'm driving the anode columns high one at a time and sinking all the cathodes together every time. I can do it the traditional way and completely refresh the anode shift registers every time but that seems redundant since all I'm doing is pushing a 1 (high) across the pins with every new loop. Since the shift register is rather good at doing just that (pulse the SH_CP clock pin 11 high and low), I figured it should be super efficient to enter a high bit at the start of the line and then just clock it down every loop while keeping a counter so that I can know when the 1 high bit will have reached the end.
Two things went differently than I had expected, and of those two there's just one that had me puzzled.
The first easy one: I put a single 1 in de data line, clocked that in and put the latch high, entering it to the output pins. I then clocked that through. What didn't happen was a single led going from pin 1, to 2, to 3, to 4 etc. (like a Knight Rider thing) but every consecutive led turned on, so first led 1, then led 1 and 2, then 1, 2, and 3, etc. Made sense, because I was moving up a 1, without the 1 in the previous position being changed. So, I shifted a 1 into the data line, clocked that in, and then a 0. Now it worked! When clocking, the 1 moved along, and the trailing 0 as well, changing the previous 1 to a 0 while doing so. Great success. Me happy.
I though it would be trivial to apply this to daisy chaining, i.e. that I could just shift that 1 and 0 across multiple shift registers by only clocking but... that doesn't work! I can't explain why, but as soon as I start only clocking (ie not shifting out any data), the second shift register will show identical data as the first one. Let me explain this through numbers:
Begin state. Two shift registers, shifting in data from the right: 00000000 00000000 I shift in a 1... 00000000 00000001 ... and then a 0 00000000 00000010 .. and latch it. the bit sequence is now set to the output pins. I don't shift out any new data but only putch the clock high and low again, also latching in between (to update the new position of the bits to the output pins). I would now expect this: 00000000 00000100 but instead this happens: 00000100 00000100 Another latch low, clock high, clock low, latch high, and then: 00001000 00001000 In a way that IS logical, but why did the second shift register get that 1 in there in the first place!?
Apparently I'm missing something in the way shift registers work. Why isn't my idea working? Is it possible at all? Would really make things more efficient.