Transition from SN74HC595N to TPIC6B595 registers

Hello all,

Question about going from sourcing to sinking registers.

I have a project in testing phase, that already works with the 74HC595N registers, and although it works fine, when I do the final build, I want to upgrade to the TPIC6B595 registers, due to them being able to handle higher current for all my LEDs, and for fear of frying my existing registers.

I understand that everything will need to be rewired, with the constant power across all the LED anodes (+) along with resistors, and then each LED cathode (-) gets wired to the drain pins of the TPIC6B595 registers.

What I do not understand is if I have to make any code changes in the IDE.

Here is a bit of my code:

digitalWrite(latchPin, LOW);             //Pull latch LOW to start sending data
  for (int i = 2; i >= 0; i--) {
    shiftOut(dataPin, clockPin, MSBFIRST, seq[n][i]);          //Send the data
  }
  digitalWrite(latchPin, HIGH);            //Pull latch HIGH to stop sending data

  // step to next pattern for next time
  n++;
  if (n >= 16)
    n = 0;
}

Would the first digitalWrite need to be changed to HIGH, and the second digitalWrite need to be changed to LOW?
Maybe I'm overthinking it, but the whole source now changing to sink has got me confused on the programming aspect.

Thanks, Jeff

I don't think so. The TPIC6B595 will drain / turn on when a 1 is written to it. So if a HIGH aka 1 on the 74HC595N turns on the led it will still after rewiring to switch low side :slight_smile:

Awesome. Thank you for the tip septillion!