- #FILL ROM IN EPROM PROGRAMMER PRO#
- #FILL ROM IN EPROM PROGRAMMER SOFTWARE#
- #FILL ROM IN EPROM PROGRAMMER CODE#
rom = bytearray( * 32768)Īfter writing this to the EEPROM and powering up the computer, the output behaved as expected after the reset button was pushed.
#FILL ROM IN EPROM PROGRAMMER CODE#
The python code below does a better job of explaining. Since the entire address space was shifted up, I had to write these values to 0x7FFC and 0x7FFD in the EEPROM. I had to store these at what the processor would view as 0xFFFC and 0xFFFD. The processor is little endian, meaning it takes in the lower byte of the address first and the higher byte second. I needed to specify the reset vector as 0x8000 to ensure that the processor doesn't leave the range of the EEPROM. My code for filling the EEPROM had to be edited to add the reset vector.
I also decided to hook up a button to the RESB pin on the processor so I could toggle resets. In return, this satisfied our requirement of including the reset vector in the ROM. This resulted in the EEPROM being active only when the 6502 was reading from addresses 0x8000 and 0xFFFF because these address all have the 16th address bit set high, which is inverted and fed into the active low chip select on the EEPROM. The 74LS04 IC was used to invert the signal (datasheet can be found here). This was as simple as inverting and connecting the 16th address pin of the MPU to the chip select pin on the EEPROM. The first thing I took from this was that I needed to include the addresses 0xFFFC and 0xFFFD in my EEPROM's range so that it could tell the processor where the reset vector is pointing. RESB should be held high after reset for normal operation. This is the start location for program control. The program counter is loaded with the reset vector from locations FFFC (low byte) and FFFD (high byte). When a positive edge is detected, there will be a reset sequence lasting seven clock cycles.
#FILL ROM IN EPROM PROGRAMMER SOFTWARE#
All Registers are initialized by software except the Decimal and Interrupt disable mode select bits of the Processor Status Register (P) are initialized by hardware. Ready (RDY) has no effect while RESB is being held low. The RESB signal must be held low for at least two clock cycles after VDD reaches operating voltage. The Reset (RESB) input is used to initialize the microprocessor and start program execution. The datasheet can give us some information on the reset pin. I had not considered the reset pin of the MPU at all it had been tied high in the initial hardware setup, so the processor just started from a random spot whenever it was turned on. While this worked to get the MPU to do nothing, this was not a long term solution. This made sense because the EEPROM is 32KB, which would contain addresses 0x0000 through 0x7FFF.
After tying the pin low, the processor worked exactly as expected for all addresses that were less than 0x8000. The chip enable pin on the EEPROM was not tied to anything, so it was not outputting anything. The Output Enable and Chip Select pins were tied low to ensure that the EEPROM was always outputting its contents.Ĭonnecting power to the computer, I was surprised to see processor acting unpredictably yet again, though this wasn't entirely unsuspected. I also decided to tie the Write Enable pin high, as I wasn't going to write to the ROM while it was in the computer at any point. The pinout of the EEPROM can be seen below.Īfter first connecting power and ground, I connected the data bus and address bus of the MPU to the busses on the EEPROM. Now that I had my program written onto the EEPROM, I needed to get to the actual hardware setup. This generated a binary file named "rom.bin" which contained my code, which just filled the entire EEPROM with 0圎A, the NOP instruction. The code for the script can be seen below.
Before I could use assembly language, I decided to use python to create a binary image containing the code I needed.
#FILL ROM IN EPROM PROGRAMMER PRO#
This is compatible with the XGecu Pro EEPROM programmer, which is what I used to program the EEPROM. I'm using the AT28C256 EEPROM for this project. I needed a place to store more complex code. This would prove to be far too complex to encode using hardware in any way. In order to get human-readable output, I needed a way to communicate with the VIA.