Having substantially completed Ben's 6502 Hello World project I can start to think what to progress myself. My priority is to see if I can avoid the need to remove the EEPROM, burn new code in a programmer, and replace it each time I write, amend or correct a 6502 assembly program.
I have a Mega 2560 attached to the 6502 board connected to the address and data buses and therefore connected to most pins on the AT28C256 EEPROM. The TLS EEPROM programmer I have been using doesn't require special hardware capabilities so providing I connect the Mega to the three EEPROM control pins (Output Enable, Write Enable, Chip Enable) I should be able to write programs to it.
Prototype EEPROM write sketch
I started with a separate breadboard EEPROM with digital I/O pins on an Arduino Mega 2560 connected to each I/O pin. I firstly wrote a sketch to read data from the EEPROM and display on the Arduino serial monitor. Functionally this program was very similar to the 6502 video program to read from memory, so it was easy to implement in a sketch.
Ben has an Arduino EEPROM programmer as a separate video tutorial. It uses a nano and shift registers instead of a Mega to read/write the EEPROM but it provided useful hints for me to write to the EEPROM. In fact the write process is very simple: disable the output pins, set address and data values on the bus then pulse Write Enable low for 1 microsecond to write data. To test the program I took the EEPROM which previously displayed "Goodbye, Cruel W" and changed the letter "l" (0x68" to "t" (0x74). I replaced the EEPROM in the 6502 board and checked that the message displayed was updated.
No comments:
Post a Comment