Automated Programming
I said previously that I needed a better way of programming the EEPROMs than typing in the bytes by hand, and I think I’ve got it now.
For a while I was using a python program which converted the binary data into an arduino array that I could paste into the arduino sketch, but I have found a way to completely automate it now.
Here is the batch file that I made:
ca65 and ld65 assembles and links the assembly source code into a binary ready to put on the EEPROM.
Here’s format.py:
The first thing it does is turn the the raw binary data into an array for an arduino sketch. It then puts that array into the programmer sketch
After running that python program to create the new sketch, it uses arduino-cli to compile and upload the sketch to the arduino, followed by putty to open up a Serial monitor.
With all of this, I can simply run “makebat.bat” in the command line and it will do everything automatically. It’s not perfect, for example the serial port and name of the source file are hard coded into the program, but those are easy enough to change, and it’s still a lot easier now than it was before.
I’ve been having some issues with the LCD acting weird, and with how often I was pulling the EEPROM out to reprogram it, it was about time I made something better. My end goal was to make another program for the arduino where I could upload the raw binary and it would do everything by itself, but the Arduino Uno has 32k of program storage so unless I plan to fill up the entire chip, this solution will work fine.