This is a simple ROM emulator for the 6502 microprocessor using the Raspberry PI Pico. The emulator can be used to test the 6502 microprocessor without the need for a physical ROM/EEPROM chip. The emulator can be used to test the 6502 microprocessor with a clock frequency of up to 1Mhz.
The entire 6502 build and examples is inspired by Ben Eater's 6502 computer build
- ARM toolchain
- GCC
- CMake
- Python
- Raspberry PI Pico SDK
- VASM Old-style assembler Download Here
- XXD (For converting binary to C header file)
- PIN 0-15: Address Bus (A0-A15)
- PIN 16-22, 26: Data Bus (D7-D0)
- PIN 27: Read/Write (R/W)
- PIN 28: Clock (From the clock/timer)
The second way is to use the vasm
assembler to generate the ROM. The makerom.sh
script assembles the given assembly file and generates a binary file.
The binary file is then converted to a C header file using the xxd
command. Make sure to add the .section code, "rx"
directive to the start of your assembly files to make sure that the code is placed in the correct section of the binary file.
[makerom.sh <assembly_file>] && ./upload.sh
Make sure that the Pico is in BOOTSEL mode before running the script.
To avoid conflicts with an external RAM a ROM_STACK_START=0x0000
and ROM_STACK_END=0x07FF
is defined in the CMakeLists.txt
file. The ROM will set the data pins to high impedance when the address is within this stack range to avoid bus contention.