Here’s the software necessary to work the programmer board:
Arduino sketch (for Arduino Mega 2560)
Here’s a screenshot of the program in operation. It should all be fairly self-explanatory. Please send me a comment if you have any problems or questions.
Update January 2021. Thanks to Marco Almeida, who built one of these gadgets, and reported errors when reading a program from the Chip. He solved the problem by reducing the baud rate at which the Arduino communicates with the PC program – previously it was 57600, and Marco reported that he’d had success at 9600. I was able to reproduce the bug at 57600 baud. I don’t know why it worked previously – I think maybe an update to the Arduino release, default optimization settings, etc, pushed it over the edge. Anyway, I found that mine worked reliably at 19200 baud, so I’ve now modified and uploaded both the Arduino Mega sketch, and the PC program to work at that new reduced speed. It’s still plenty fast enough, only taking a couple of seconds to write, read, or verify a program using all the AT89C2051’s flash memory. The download links haven’t changed, but if you installed the programs prior to January 2021, you should probably uninstall your old copy, and update to the current one.
To reliably program a chip, you need to use the Erase function first. I usually erase, then read the chip (to check it’s empty), then load the hex file, write it to the chip, verify, and power down. Very occasionally, I’ll get a verify error, but a second pass through the above sequence has always resulted in success, so far!
You can buy programmers for the AT89C2051 (and other similar chips) on AliExpress for less than twenty dollars, and if you just want to program chips, that’s an easier way to go!
Leave a Reply