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.

// 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

void nixieTranslate(double nixie) {

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

hundreds = (number % 100000) / 10000;
nixieIlluminate(14, 15, 16, 17, hundreds);
Serial.print("Hundreds Place: "); // troubleshooting

tens = (number % 10000) / 1000;
nixieIlluminate(10, 11, 12, 13, tens);
Serial.print("Tens Place: "); // troubleshooting

ones = (number % 1000) / 100;
nixieIlluminate(6, 7, 8, 9, ones);
Serial.print("Ones Place: "); // troubleshooting

tenths = (number % 100) / 10;
nixieIlluminate(2, 3, 4, 5, tenths);
Serial.print("Tenths Place: "); // troubleshooting

hundredths = number % 10;
nixieIlluminate(18, 19, 20, 21, hundredths);
Serial.print("Hundredths Place: "); // troubleshooting

for (int i = 0; i < 4; i++) {
   Serial.print("]: ");

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

  • 1
    \$\begingroup\$ What board support package are you using for the Mega1284p in Arduino? There are a few different ones out there... I suspect you are simply not affecting the pins you think you are affecting in firmware. Can you verify digital Write toggles the physical pins you believe should toggle? \$\endgroup\$ – vicatcu Jan 2 at 3:33
  • \$\begingroup\$ I am using the “maniac bug” mighty 1284 board package. Using LEDs I checked each individual I/O pin on the ATMEGA1284, and the setup is as expected \$\endgroup\$ – csapidus Jan 2 at 4:17
  • \$\begingroup\$ You can consider trying my core instead, different pinout though: see wildfire.wickeddevice.com... maniacbug is kind of ancient. \$\endgroup\$ – vicatcu Jan 2 at 18:18
  • \$\begingroup\$ please do report back as to whether that worked for you. \$\endgroup\$ – vicatcu Jan 2 at 20:47
  • \$\begingroup\$ I will certainly do. I intend to test the day after tomorrow. \$\endgroup\$ – csapidus Jan 3 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.