Project Logs

I've checked in the Nixie multiplex code for the ATMega into GitHub. It's available here.

To get started, you need to get an ATMega328P in whatever form factor you prefer. For getting started, you probably want the DIP variant for breadboarding.

To compile the code, you need to get it from the GitHub repository. You'll need the AVR GCC toolchain. Just type "make" and the makefile will make a .hex for you.

Edit the Makefile and set the type of programmer you're going to use. By default, it's configured to use a USBTiny (or a clone). Wire your chip up for ISP programming. You'll probably want something like this to make it easier to breadboard.

Connect up your AVR programmer to the chip and type "make init" to have the makefile fuse and flash the chip.

Having done that, you can now connect the SPI pins of the chip up to your host. If you write a "1" to the E bit of the config register (see the README on GitHub), then you should see the multiplex action begin to happen on the element select lines of the chip.

I haven't actually tried any of this yet, but I've got a rough cut of the code for an ATMega328P acting as a dedicated SPI slave display controller.

The wiring:

PB3-PB5 are used as both the ISP interface to program the chip and the SPI slave interface. In principle, this means that the same 3 wire connections (plus holding !RESET low) could be used to update the flash from the Pi.

For vocabulary, I use "element" as the name for an individual tube and "digit" as the 0-9 (plus decimal point) digit line.

PD0-7 are digit lines 0-7.

PB0-PB1 are digit lines 8 and 9.

PB2 is the digit line for the decimal point.

PB6-PB7 are the element select lines 0-1

PC0-PC5 are the element select lines 2-7.

What's left on the DIP variant of the ATMega328P are the !RESET, two Vcc and two GND and AREF (which can be left NC).

I'm going to upload preliminary (untested) code for the chip to the files.

You'll want to set the LFUSE to 0xe2. That will set the clock speed to 8 MHz from the internal oscillator. The minimum Vcc voltage is 2.7V at that speed.

I am going to try to use Arduinix as the driver for the 4 IN-12 nixie tubes I got from EBay. Arduinix is an board that was originally designed to drive Nixie Tubes via Arduino Uno or alike.

Since Arduinix requires 12 inputs in total and Pi Zero has many more outputs than that, It should be very easy to connect Pi Zero GPIO to Arduinix input pins.

I first explored using ESP8266-based solution as a controller but there were not enough pins on ESP chip to drive the 12 necessary pins on Arduinix.

Arduinix uses 2x SN74141 or Soviet equivalent Nixie Driver ICs to route power to appropriate cathodes of the nixie tubes. These ICs take in binary 5V input on 4 pins and turn on up to 10 cathodes on the output.

Nixies' anode pins connect to high power transistors on the Arduinix and those transistors are turned on via yet other transistors.

By using only 12 pins (2 banks of 4 pins and 4 pins for anodes) you can control 8 nixie tubes in total by means of multiplexing. Since I am using only 4 tubes I should be able to turn on 2 tubes at a time for a brief period of time, then switch to another 2 tubes. When this is done very quickly, it will appear that the digits are always lit.

Without further ado, I connected pins 2-13 on Arduinix to the following pins on Pi Zero:

Pin on Arduinix

Pin on Pi Zero

2

26

3

16

4

20

5

19

6

13

7

12

8

6

9

5

10

22

11

27

12

18

13

17

I also connected Pi Zero's +5V and ground to Arduinix's 5V and ground pins necessary for the ICs.

Arduinix requires separate 9-12V input that gets converted to high voltage necessary for the Nixie tubes. I used an adjustable DC converter (link in the part list) that takes in 12V and converts it to 5V that is then distributed to the Pi and Arduinix's 5V input.

I followed schematics below to connect a single Nixie tube to the Arduinix:

I then created the following Python program to display a number zero on a single nixie tube: