Hello!
I am tearing my hair out, and help would be immensely appreciated.
I am developing a nixie RPN calculator. I am using nixies being driven by K155ID1 nixie drivers, connected to an ATMEGA1284PU. I have succesfully developed a nixie RPN calculator using the same set-up, but with pin connections being made to an Arduino MEGA.
I noticed with the Arduino MEGA, that the I/O pins connected to the nixie drivers could not be selected haphazardly - otherwise the tubes would do funny things (such as light up only a single number, light up particular numbers, or not light up at all). When this would happen, it would NOT be because of miswiring with the tube or drivers, but with what four I/O pins a K155ID1 would be connected to. I would take a particular tube with driver connected to I/O D2, D3, D4, and D5 (at this time working perfectly), alter the code to fit D2, D4, D6, and D8 for example, and the tube would no longer light up properly! The code for the nixie RPN calculator on the Arduino MEGA, working successfully, is included in the Google Folder linked at the bottom.
Note that the custom nixieilluminate function takes in the nixie driver pins. In this particular situation, those pins are provided numerically - and this works!
The code for the ATMEGA1284 nixie RPN calculator is practically the same, but due to the custom pinout of an ATMEGA1284, the selected I/O pins are different. The altered snipped for the drivers is shown below. A diagram of an ATEMGA1284 pinout is included in the Google Folder.
void nixieTranslate(double nixie) // takes in either user-submitted data or the result of an operation. breaks down number into each digit, then sends to the appropriate nixie using nixieIlluminate
{
number = (nixie * 100) / 1; // multiplies by 100 in order to account for the tenths and hundredths place. divides by int one to truncate remaining decimal digits.
thousands = number / 100000;
// nixieIlluminate(2, 3, 4, 5, thousands); // sends the appropriate arduino pins for that particular digit, as well as the digit value, to nixieIlluminate
Serial.print("Thousands Place: "); // troubleshooting
Serial.print(thousands);
Serial.print("\n");
hundreds = (number % 100000) / 10000;
nixieIlluminate(14, 15, 16, 17, hundreds);
Serial.print("Hundreds Place: "); // troubleshooting
Serial.print(hundreds);
Serial.print("\n");
tens = (number % 10000) / 1000;
nixieIlluminate(10, 11, 12, 13, tens);
Serial.print("Tens Place: "); // troubleshooting
Serial.print(tens);
Serial.print("\n");
ones = (number % 1000) / 100;
nixieIlluminate(6, 7, 8, 9, ones);
Serial.print("Ones Place: "); // troubleshooting
Serial.print(ones);
Serial.print("\n");
tenths = (number % 100) / 10;
nixieIlluminate(2, 3, 4, 5, tenths);
Serial.print("Tenths Place: "); // troubleshooting
Serial.print(tenths);
Serial.print("\n");
hundredths = number % 10;
nixieIlluminate(18, 19, 20, 21, hundredths);
Serial.print("Hundredths Place: "); // troubleshooting
Serial.print(hundredths);
Serial.print("\n");
Serial.print("\n\n");
for (int i = 0; i < 4; i++) {
Serial.print("myStack[");
Serial.print(i);
Serial.print("]: ");
Serial.println(myStack[i]);
}
Serial.println("\n");
}
Unfortunately, this same code does NOT work for the ATMEGA1284PU! Specifically, the I/O pin sets [D2,D3,D4, and D5] and [D10, D11, D12, and D13] WORK, but [D6, D7, D8, and D9], [D14, D15, D16, and D17], and [D18, D19, D20, D21] do NOT WORK. I have tried other random combinations, but they for the most part fail. I am entirely lost as to why or why not the ATMEGA I/O pin selection matters, and how to select correctly in a manner that allows my nixie drivers to drive correctly. To test the theory that it is the ATMEGA1284PU I/O pins that are the issue, and not the drivers or tubes, I would rearrange the pins to allow different tube/driver combinations to connect to the known, working I/O pin sets - and they would all work. Whenever a tube/driver is connected to a non-working I/O pin set - they would fail.
I have included the schematic of the nixie RPN calculator on the ATMEGA1284. This schematic is accurate as far as what driver I/O pins I have connected where. I have tried many combinations, but the one represented in the above code and attached schematic are most updated. I have also added actual photos of both set-ups. As you can see in the real life photo, only two digits actually work (and those have drivers connected to the two working I/O pin sets). I have no clue what else to do. I feel like I am so close.
Please help.
ALL ATTACHMENTS ARE IN FOLLOWING GOOGLE FOLDER:
https://drive.google.com/drive/folders/158Hp9Pi4ySgNs9pG6gdjif97Fw8hwU_y?usp=sharing