2 shift registers, 1 array

I have 2 shift registers, working 10 led's all together (1st 595 controlling 8, 2nd controlling 2) in that order.

  1. is there a way to set 1 LED high without affecting any others, or do you have to simulate the other LED's staying high?

  2. Can you have 2 shift registers as part of the same Array, at the moment, you have to shift the values to the next register, altering the first register

Would multiplexing be easier to solve these two issues?

  1. You can set one LED high (whatever that means) without changing the state of the other LEDs, except that for a brief time as the shift registers do their shifting the other LEDs will be affected. This will not be seen by the human eye, which is what I have to assume you are doing with LEDs.

  2. I don’t understand this question. Shift registers are shift registers, they are not part of an array, or an Array.

Shift registers use 3 or 4 pins for an unlimited number of LEDs. Multiplexing 10 LEDs could use seven pins but there are ways to reduce the number of pins. If you are having problems with shift registers, you are likely to have problems with multiplexing.

Your code and a schematic would probably help us to help you.

To post your code:

  1. Use CTRL-T in the Arduino IDE to autoformat the code.
  2. Copy and paste the autoformatted code into a post, using code tags (the </> button). Your code will look like this!

vaj4088:

  1. You can set one LED high (whatever that means) without changing the state of the other LEDs, except that for a brief time as the shift registers do their shifting the other LEDs will be affected. This will not be seen by the human eye, which is what I have to assume you are doing with LEDs.

That is false. The shifting does not influence the outputs until they are latched. That only happens after all the bits are shifted into the register (unless your code is handling it improperly!). Thus, you definitely can change one bit without changing the others.

Also, the same thing holds true when registers are daisy chained. There is no effect or harm in shifting the last register's bits through the first. It is perfectly transparent, since both registers are latched at the same time.

You are right that "That is false" as long as Jamackey does not clock the latch until all of the bits have been shifted. My crystal ball is broken so I can't see Jamackey's code.

If coded properly, I agree that "you definitely can change one bit without changing the others."

We still need to see the code and the wiring.

vaj4088:
You are right that "That is false" as long as Jamackey does not clock the latch until all of the bits have been shifted. My crystal ball is broken so I can't see Jamackey's code.

If coded properly, I agree that "you definitely can change one bit without changing the others."

We still need to see the code and the wiring.

Well, I've never seen wiring for the 74HC595 that didn't use the latch. But there's always a first time. Perhaps on instructables, or YouTube or somewhere like that... :slight_smile:

There was a method that used a cap to couple latch to clock, so the output was always 1 clock behind the input.
I think one is better off using 3 control lines tho:

digitalWrite (latchPin, LOW); // RCLK input
SPI.transfer(dataByteToShiftOut); // SRCLK and Ser Data in. SPI uses internal hardware to send data out fast. 
// default is 4 MHz clock, can increase to 8 MHz, or slow down: 8 MHz, 4 MHz, 2 MHz, 1 MHz, 512KHz, 256 KHz, 128KHz, 64KHz
// or
shiftOut(dataPin, clockPin, MSBFIRST, dataByteToShiftOut); // slower "bit-banged" output, lot of code runs in background
digitalWrite (latchPin, HIGH); // RCLK input, outputs change on this rising edge