1

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

csapidus
  • 11
  • 4
  • 1
    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? – vicatcu Jan 02 '19 at 03:33
  • 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 – csapidus Jan 02 '19 at 04:17
  • You can consider trying my core instead, different pinout though: see http://wildfire.wickeddevice.com... maniacbug is kind of ancient. – vicatcu Jan 02 '19 at 18:18
  • please do report back as to whether that worked for you. – vicatcu Jan 02 '19 at 20:47
  • I will certainly do. I intend to test the day after tomorrow. – csapidus Jan 03 '19 at 00:22
  • I only found this question after posting mine. I might have had the same problem and it was difficult to figure out so I was inspired to write up something to hopefully save someone else time: https://electronics.stackexchange.com/questions/590952/why-dont-certain-pins-on-portc-on-the-atmega164a-324a-644a-1284a-work Maybe your problem is different but it can't hurt to give it a try. Also can you clarify what D2, D3 etc mean? I see you are going up past 7 so it's not PORTD. – The Movie Man Oct 17 '21 at 06:04

0 Answers0