cant get new shift register (TPIC6A596NE) to work !?

Hey everybody!

i am just learning about arduino and circuits.
At the moment i am trying to control a 4 digit 7 segment display with arduino using 2 shift registers.

on my first run i used 2x SN74HC595n becuase its used in so many tutorials. finaly i got it working smooth but i realisied that the current is to high for this register and is heating up.

so after a lot of research i decided to go for a new shift register which can handle way more current.
so i got 2 TPIC6A596NE registers… here is the datasheet: DATASHEET

so just to try if everything is working fine i try to control just a single LED.

here is how i connected everything: (picture on the bottom of this post)

(r1 = register pin 1, r2 = register pin 2…)
(X = not connected)

r1 = X
r2 = X
r3 = 5V
r4 = GND
r5 = GND
r6 = GND
r7 = Arduino 9
r8 = Arduino 7
r9 = X
r10 = X
r11 = X
r12 = X
r13 = X
r14 = GND
r15 = GND
r16 = GND
r17 = 5V
r18 = Arduino 8
r19 = resistor 220 ohm =>LED => GND
r20 = x

here is my code:

// 4 digit 7 segment display using 2 shift registers
//by Bernahrd Gratzl aka LoL-Fighter
//
//V0.1 - 18.03.2018

const byte dataPin = 8;
const byte shiftPin = 7;
const byte storePin = 9;
const int plex_speed = 0;

//define Possible numbers
//const byte one[8] = {0,0,0,0,0,1,1,0};
const byte numbers[10][8] = { 
  {1, 1, 1, 1, 1, 1, 1, 1},             // 0
  {0, 0, 0, 0, 0, 1, 1, 0},             // 1
  {0, 1, 0, 1, 1, 0, 1, 1},             // 2
  {0, 1, 0, 0, 1, 1, 1, 1},             // 3
  {0, 1, 1, 0, 0, 1, 1, 0},             // 4
  {0, 1, 1, 0, 1, 1, 0, 1},             // 5
  {0, 1, 1, 1, 1, 1, 0, 1},             // 6
  {0, 0, 0, 0, 0, 1, 1, 1},             // 7
  {0, 1, 1, 1, 1, 1, 1, 1},             // 8
  {0, 1, 1, 0, 1, 1, 1, 1}              // 9
};

//define displays
const byte displays[5][8] = {
  {1,1,1,1,1,1,1,1},                    // 0 - placeholder
  {1,1,1,1,1,1,1,0},                    // 1
  {1,1,1,1,1,1,0,1},                    // 2
  {1,1,1,1,1,0,1,1},                    // 3
  {1,1,1,1,0,1,1,1}                     // 4
};

void setup() {
  pinMode(dataPin, OUTPUT);
  pinMode(shiftPin, OUTPUT);
  pinMode(storePin, OUTPUT);
  digitalWrite(storePin, LOW);      //just to be save
}

void loop() {
  // put your main code here, to run repeatedly:
print_display(0, 8);
/*delay(plex_speed);
print_display(2, 1);
delay(plex_speed);
print_display(3, 2);
delay(plex_speed);
print_display(4, 3);
delay(plex_speed);*/
}




void print_display(byte disp, byte num){

  digitalWrite(storePin, LOW);
  
  // display
  for (int i =0; i < 8; i++){
    digitalWrite(shiftPin, LOW);
    digitalWrite(dataPin, displays[disp][i]);
    digitalWrite(shiftPin, HIGH);
  }

  // number
  for (int j = 0; j < 8; j++){
    digitalWrite(shiftPin, LOW);
    digitalWrite(dataPin, numbers[num][j]);
    digitalWrite(shiftPin, HIGH);
  }
  digitalWrite(storePin, HIGH);
}

this script used to work with the old register but with the new one the LED is not lighting up !?
does anybody know whats going on here?

The TPIC family is sink only (internal mosfet switch to ground).
Therefore you must connect the LED/resistor between supply(+) and chip output.
A LED between output and ground won't work.

Same for the 7-segment display.
Can only use common anode displays with this chip.
Anode to supply (can be more than 5volt),
segments (cathodes) with seven current limiting resistors to the outputs of the TPIC.

See this large digit driver project.
Leo..

thanks for this info!

guess i have to digg deeprer into that.

well the LED is on now but whatever i send to the register it wont go off !?

EDIT:
my bad.. the last issue was in the code so its working.. thanks!

so just to get this right... can i tell this new register is a "reversed" version of the old one?
old register pin connected to VCC when high and the new one connects to GND when high is that correct?

Too late to dig into your code (after midnight here).
Maybe you're multiplexing too fast (plex delay = 0).
The link I gave you also has a code example.

From memory, the output is indeed reversed (see the datasheet).
No difference in code if you also change the LED from pin-ground to pin-VCC.
Leo..

Yes, they are inverted (or at least tpic6b595 is, those are what I have).

74hc595:
Send 0, pin is internally connected to ground and can sink current
Send 1, pin is internally connected to 5V and can source current

Tpic6b595:
Send 0, pin is not connected, will not source or sink current
Send 1, pin is connected to ground and can sink current

thank you for your answers!

well then it seems like i buyed wrong shift registers! for 7 segment displays i need to control VCC not gnd

RayGenWurm:
for 7 segment displays i need to control VCC not gnd

Incorrect.

7 seg displays come in 2 types. Common anode and common cathode.

If your design avoids multiplexing, then common anode is easier to use with tpic chips.

If your design uses multiplexing, then common cathode may be easier to use with tpic chips.

PaulRB:
Incorrect.

7 seg displays come in 2 types. Common anode and common cathode.

If your design avoids multiplexing, then common anode is easier to use with tpic chips.

If your design uses multiplexing, then common cathode may be easier to use with tpic chips.

i am using a common cathode display and yes i am using multiplexing… can you tell me more detail on how to do that or do you have a link or something? right now i have no idea to get a common cathode display working with this tpic register!?

Can you give more detail on your displays? How many digits, forward voltage, current, etc.

PaulRB:
Can you give more detail on your displays? How many digits, forward voltage, current, etc.

here is the datasheet i guess there you find all informations - i have a 4042AH display (common cathode)
http://www.semisvit.com.ua/pdf/flying/NFD-4042ABx-21.pdf

Data Sheet

Ok, so you connect the 8 segment anode pins to 8 Arduino pins with series resistors and the 4 cathode pins to 4 pins of the tpic chip. Alternatively, use a 74hc595 to drive the anodes instead of Arduino pins, and daisy-chain the two shift registers.

This would have been far easier with a max7219 chip, of course. The max chip drives the anodes and cathodes, saving Arduino pins, you wouldn't need series resistors, and the chip does the multiplexing, making your code simpler.

well thats why i tried to use shift registers to save pins on the arduino…
at my first run i used the 74hc595 but like i told the current is to high for this chip thats why i went for a new one…

i see the tpic was a fail but hey they are not that expensive… i will take a look at max7219 chip

I assume you had a 74hc595 connected to the common cathodes of the display? Each pin on the 74hc595 can only sink about 35mA, which is not really enough for 8 segments. This is probably why the chip was overheating. You could avoid that by using higher value series resistors, but that would make the display dimmer.

Using the combination of 74hc595 and tpic6a596 would overcome that 35mA limit. But there would still be a limit of 70mA for the 74hc595's 8 pins in total, so you would need to limit the current to about 8~9mA per pin.