Close

Driving the tubes, flipping digits, part 1

A project log for Just Another Nixie Clock

An arduino based multiplexed, cross-fading IN-14 Nixie tube clock.

kevin-mosseyKevin Mossey 05/17/2021 at 13:315 Comments

The Russian K155ID1 chip (which is equivalent to the SN74141) is a BCD (binary coded decimal) decoders with a weird pinout.  There are 16 pins, of which 2 are used for power/ground, leaving 14.  This gives you the outputs for digits 0-9 via just 4 inputs, which acting as a binary number gives you 16 possible inputs.  The truth table is easy enough - an input of 0 turns on the "0" output, an input of 1 turns on the "1" output, etc, through to an input of 9 (binary 1001) turns on the "9" output pin.  Values 10-15 as inputs have no output.

Two warnings about invalid values: First, this blanks the Nixie tube on the cathode side, not the anode side.  If you are going to blank a Nixie tube you should do it by turning off the anode. Second, there is a pair of chips similar to the K155ID1/SN74141 that have similar specs, but the digital inputs 10-15 turn on pins 0-5.  My code is taking advantage of the invalid output to turn off a bulb at the cathode by sending invalid codes - even though I just said you shouldn't do this!  This is to save output pins on the 'duino and it's only for some of the setup pages - so it won't be an issue for very long.  If you come across the 5441A/7441A chips, the setup pages will act funky and you'll need to add more anode high side switches.

Back to the pinout! Pins 3, 4, 6, and 7 are the inputs, but they don't correspond to binary places the way you might expect in order.  Instead, they are out of order:

Chip Driver Pin
3
4
6
7
Binary position you'd expect:
2^0
2^1
2^2
2^3
Or maybe you'd expect this:
2^3
2^2
2^1
2^0
??? But this is how it actually is: ???
2^0
2^3
2^1
2^2

My first go I just set up the chip on a breadboard, with jumpers going from digital out pins on the Arduino to the driver chip, and I criss-crossed the jumpers and just turned on pins 8-11 with digitalWrite() and a direct drive to the anode from the 170V power supply (through a 10K resistor!!!) and switched the value by changing the cathode.  Not ideal, but I can be impatient and wanted to see the pretty tubes light up.

I wrote a simple program which was really something like this:

#define A 8
#define B 9
#define C 10
#define D 11

void setup() {
  pinMode(A, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(D, OUTPUT);
}

void loop() {

  for (int i=0; i<10; i++) {
    digitalWrite(A, i & 1 ? HIGH : LOW);
    digitalWrite(B, i & 2 ? HIGH : LOW);
    digitalWrite(C, i & 4 ? HIGH : LOW);
    digitalWrite(D, i & 8 ? HIGH : LOW);
    delay(1000);
  }
}

And here's the video:


Discussions

Ken Yap wrote 05/18/2021 at 06:35 point

The other comment I wanted to make is that the pinout of the inputs just happened to be the way the pins are connected to the die by the bonding wires. The PCB designer is supposed to design the traces to suit. Sometimes "odd" assignments are due to upgrading older pinouts for more memory capacity, for example, the 27 EPROM series. So one should not have any expectations of the "right" pinout.

If you want to read  a dissection of why the Z80 pinout is the way it is, search for the blog entries of Ken Shiriff who analysed the die layout.

  Are you sure? yes | no

Kevin Mossey wrote 05/18/2021 at 12:35 point

That's definitely interesting!  I ended up handling it on my board by running the traces straight without crossing over and just outputting the proper values in the software.  I should have the board schematic and layouts up in a couple of days, so you can see what I mean.  I just have to add a pin header for the buttons and the 3 remaining unused IO pins.

For anyone who wants to read the article Ken is talking about: http://www.righto.com/2014/09/why-z-80s-data-pins-are-scrambled.html  I had no idea the Z80's data bus was so weird.  Thanks for pointing that out.

  Are you sure? yes | no

Ken Yap wrote 05/18/2021 at 12:43 point

👍

  Are you sure? yes | no

Ken Yap wrote 05/17/2021 at 23:16 point

It and the original 7441/74141 are not shift registers, there is no clocking. They're just decoders.

  Are you sure? yes | no

Kevin Mossey wrote 05/18/2021 at 02:19 point

Thanks for catching that, I updated the post.

  Are you sure? yes | no