So I'm learning how to control nixie tubes with an Arduino through i2c and k155 nixie driver chips. I've had luck so far with each of those elements separately, and am just now bringing them together in the what makes the most sense.
The k1555 chip has 4 input pins that basically take a binary number and connect the appropriate pin. IE you make A low, B high, C low, D low, and it will connect pin 2 to light up the Nixie's "2". I got this working directly from the Arduino by manually writing each pin low or high for each zero I wanted, 0 through 9.
Then I plugged it into a PCF8574 i2c that I've also had luck with coding for in the past. I've been able to hook up 6 leds to confirm that I could get each to light up as I wished. (if you don't know, coding for i2c through the Wire.h library is, as far as I understand it, the reverse of binary. You write the i2c device a number from 0 to 255 and it writes to each pin corresponding to the binary digit.)
The logics at play for each of these chips seem to cancel each other out, so that if I want a 1 to light up I just feed the i2c chip "1", it will tell my k155 chip "0001", and that will connect my nixie tube's "1" cathode.
And it all worked, with a simple loop cycling from 0 through to 9...except for the "0". The nixie tube is just shut off for that duration of the loop. This seems to be because the code for the k155 chip to light the "0" is (0000) ie no signal...except that I am able to get the "0" to light when I run the test directly from the arduino to the k155.
Has anyone had this experience or similar before? Code posted below. As I've said this code works to light each digit in succession except for "0", and I can get the "0" to light with no other change than changing the 4 input pins from the i2c straight into the arduino and using different code.
#include "Wire.h"
#define nixie 0x20
int dd=300;
void setup()
{
Wire.begin();
allOff();
}
void allOff()
{
Wire.beginTransmission(nixie);
Wire.write(255);
Wire.endTransmission();
}
void nixieTest()
{
Wire.beginTransmission(nixie);
Wire.write(1);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(2);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(3);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(4);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(5);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(6);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(7);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(8);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(9);
Wire.endTransmission();
delay(dd);
Wire.beginTransmission(nixie);
Wire.write(16);
Wire.endTransmission();
delay(dd);
}
void loop()
{
for (int z=0; z<10; z++)
{
nixieTest();
}
}
Edit: One thing I forgot to mention and am not sure if it's relevant, but since my i2c guy has 8 outputs and the k155 only needs 4 inputs I'm only using the first 4 pins on the i2c. As I said, this still works out for an input of 1 leading to an output of 1, etc.
I've also tried writing "16" to the i2c to see if it would write that as low to the first 4 pins and high to the unused 5th to make anything happen, but no luck.