Numitron IV-9 clock with TPIC6B595 shift registers

Hi!

So I am building my first clock with numitron tubes IV-9, arduino micro pro, TPIC6B595 shift registers and clock module. Currently arduino, shift registers and tubes are soldered onto pcb board and now I am working with code to display separate digits on tubes. There is a problem when I shiftOut all 4 bytes one by one. Last tube in the chain always show correct number but first three ones does not with some digits.

Here is my code.

////Pin connect to Latch
const int latchPin = 7;
////Pin connected to Clock
const int clockPin = 6;
////Pin connected to Data
const int dataPin = 5;

//B00000001 //9
//B00000000 //8
//B00011111 //7
//B10000000 //6
//B10000001 //5
//B00110011 //4
//B00001001 //3
//B01001000 //2
//B00111111 //1
//B00000100 //0
//B11111111 //blank

void setup() {
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}

void loop() {
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, ~B00000001); //minutes first digit
shiftOut(dataPin, clockPin, MSBFIRST, ~B00000001); //minutes second digit
shiftOut(dataPin, clockPin, MSBFIRST, ~B00000001); //hours first digit
shiftOut(dataPin, clockPin, MSBFIRST, ~B00000001); //hours second digit
digitalWrite(latchPin, HIGH);
delay(1000);
}

I made pictures with all digits shifted out as code currently shows. Started with blank byte and ended with number 9. Pictures
First image is layout and last one is overall setup.

As you can see from the pictures that blank works fine. Nothing is light up. Zero works as well. Then comes number one but only the last tube in shift register lineup shows correctly.

Number 2 is messed up. Number 3 is ok. Number 4 is messed up. Number 5 shows 9 on first three ones. Number 6 shows 8 on first three ones. Number 7 shows 1 on first three ones. Number 8 is ok. Number 9 is ok as well.

Note that on pictures where numbers are photographed, first tube from the left is the one that takes serial input. Output moves from left to right so the most right one is the last in chain.

Seems to me that this is code error but I maybe wrong. Please help me out :frowning:

Hello. The code you posted should show the same pattern on each digit. Anything else would suggest wiring errors or faulty components, not code errors.

Paul

I can't see the bypass capacitors on your TPIC6B595s. Where have you hidden them?

Make this an array:

//B00000001 //9
//B00000000 //8
//B00011111 //7
//B10000000 //6
//B10000001 //5
//B00110011 //4
//B00001001 //3
//B01001000 //2
//B00111111 //1
//B00000100 //0
//B11111111 //blank
byte fontArray[] = {
B00000001, //9
B00000000, //8
B00011111, //7
B10000000, //6
B10000001, //5
B00110011, //4
B00001001, //3
B01001000, //2
B00111111, //1
B00000100, //0
B11111111, //blank

};

Then have your code use it

void loop() {
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, fontArray[digit0]); //minutes first digit
shiftOut(dataPin, clockPin, MSBFIRST, fontArray[digit1]); //minutes second digit
shiftOut(dataPin, clockPin, MSBFIRST, fontArray[digit2]); //hours first digit
shiftOut(dataPin, clockPin, MSBFIRST, fontArray[digit3]); //hours second digit
digitalWrite(latchPin, HIGH);
delay(1000);
}

Then come up with some code for digit0,1,2,3 to represent hours and minutes or whatever.

Paul__B, could you give some more information? Sorry I am a noob in electronics...

How big caps? Ceramic? Each shift register should have its own?

I have put one u1J63 cap between Arduino VCC and ground pin. But this did not help.

CrossRoads, I have code to display clock digits but it is not in use since my shift registers does not display correct digits :frowning:

0.1uC ceramic caps on each shift register.
Little guys like these
http://www.dipmicro.com/store/C5K10-50
You can see them next to the shift registers on this board:

If you have code to display digits, why did you post the nonsense above?

Can i use 1uF elec caps?

walts159:
Can i use 1uF elec caps?

Those would be beneficial to help smooth the current when switching happens. But you still need the bypass caps as well, and they need to be smaller value, around 0.1uF. Digital chips can misbehave strangely without them, and its not worthwhile trying to figure out what's going on until you put the caps in.

CrossRoads:
If you have code to display digits, why did you post the nonsense above?

I think the OP was trying to keep things as simple as possible in order to debug the circuut. Correct?

Correct

0.1 µF ceramic caps. The exact value is not critical, you could easily use 0.47 µF but the 0.1 µF is a common value.

The important thing is negligible internal resistance and inductance; (aluminium) electrolytics have significant inductance.

And necessarily mounted as closely between supply and ground pins as possible.

Bad news. Bought some 104 capacitors and even separated SRCLR power from VCC and put 10kO resistors like in the datasheet but same results. Here are some updated pictures of final layout. Arduino VCC is going to shift registers VCC only. Numitron and SRCLR power comes from separate power source since numitron take about 140ma (max) each tube thats 560ma (max)

datasheet layout

Pictures2

Doubt the 10k resistors are in any way relevant. Haven't heard of that before.

I think we seriously need to look at the code - in its entirety.

But the code I provided is the one I am testing with and it does not work...

OK, so going from the start, it was pointed out that code would light one (same) segment only of every digit.

So what does it show? If you care to point to - or link here - one and one only picture it may be illuminating( :grinning: ).

Paul__B:
OK, so going from the start, it was pointed out that code would light one (same) segment only of every digit.

That's what the OP intended, for purposes of testing. But the digits do not appear the same. Sounds like the right-hand one is always correct (yes?). The other 3 always match each other but do not always match the right-hand digit (yes?). Its hard to see on some of those pics because of the reflections on the glass tubes make it hard to see which segments are lit.

I believe these issues are most likely to be incorrect wiring or shorts. I suggest disconnecting the power, removing the tpic chips from their sockets and performing some continuity checks with a multimeter. For each digit leg on the tubes, check continuity with the correct pin in the corresponding tpic's socket, and no continuity on any other socket pins (which would indicate a short).

PaulRB:
That's what the OP intended, for purposes of testing. But the digits do not appear the same. Sounds like the right-hand one is always correct (yes?). The other 3 always match each other but do not always match the right-hand digit (yes?). Its hard to see on some of those pics because of the reflections on the glass tubes make it hard to see which segments are lit.

I believe these issues are most likely to be incorrect wiring or shorts. I suggest disconnecting the power, removing the tpic chips from their sockets and performing some continuity checks with a multimeter. For each digit leg on the tubes, check continuity with the correct pin in the corresponding tpic's socket, and no continuity on any other socket pins (which would indicate a short).

Yes, you are correct on all questions.

I looked for short, but no luck.

I also thought that maybe it was signal travelling from Arduino going too fast maybe so I tried this thread solution but still the same results.

http://forum.arduino.cc/index.php?topic=39341.0

Okay found out that the last tube that I used pin layout reference for other tubes was different that other three tubes that had the same one, so it was wiring problem after all.

Sorry for that and thanks for help. Will post pics once this clock is done :wink:

Finally finished this clock!

A lot of build process pictures! Numitron clock - Album on Imgur

I will try to answer questions once I will have time! Thanks for help!