Close
0%
0%

6502 breadboard computer

Ben Eater's 6502 breadboard build that will allow me to single step each cycle and monitor the address and data lines using an Audrino.

Similar projects worth following
Ben Eater's 6502 breadboard build that will allow me to single step each cycle and monitor the address and data lines using an Audrino and a serial port monitor. Using an EEPROM programmer to push binaries will be how to execute code without a native keyboard although Ben has a tutorial on that too.

I have always been fascinated in how computers work so when I stumbled across Ben Eater's website I was blown away by how well he explains how to build an entire 8-bit computer on a breadboard. He also shows to build the 6502 breadboard computer and both share the same clock so with the 6502 build being a bit simpler, it seemed like the logical place to start.

The clock can either pulse using a variable rate resistor or can single step each pulse which will allow me to see the address and data pins or any other pins by writing a small Sketch program to monitor the bits in the serial monitor. 

Ben also shows how to push 6502 binaries the what will be a keyboard-less computer by using a modern machine to push the bits to an EEPROM. There are also video's on how USB keyboards and video card's work so if I am successful on this project I may try adding in these components as separate projects.

  • Progress

    8bitflynn04/03/2022 at 15:39 0 comments

    Finished with clock.

    Started on 6502 breadboard computer.

    Hooked up LEDs to address pins and then to Audrino to monitor. Only wired first five address pins so far. I think making a map of the mnemonics of the address and data lines would be useful to print in the serial monitor...

    Finished hooking up address and data pins to Audrino and then the R/W pin.

    Serial monitor printing address pins and data pins first in binary and then in hexadecimal. The Read/Write pin also shows if the data pins are reading or writing.

    Removed address LEDs and added EPROM chip. Installed EPROM programmer software and tested. Next up is to hook the address and data pins from the 6502 to the AT28C256 EPROM chip. The EPROM chip is 32KB so it has 15 address pins while the 6502 has 16 address pins and can access 64KB. Also the 6502 startup sequence looks for 0xfffc and 0xfffd to set the program counter to execute code. To make that work the EPROM needs to only to accessible by the 6502 address lines if the last address line not in use is connected to the EPROM's CE (chip enable pin) so that 0x0000 - 0x7fff is not used for EPROM but if last address pin on the 6502 is on, it triggers the CE on the EPROM and data can be read.

    I slightly modified the Audrino code to signal the interrupt when pin 2 is falling rather than rising because from my testing with the red LEDs I was always seeing the bits in the serial monitor from the previous CPU cycle. I am guessing that having it trigger the interrupt on the clocks high signal was causing it to sample the address limes before the 6510 had changed the address lines. Setting the interrupt to happen when the clock signal is falling made the red LEDs match what the serial monitor.

    Hooked up EPROM a week ago. wrote a C# program to create the 0xea bytes but serial monitor was showing CPU data pins reading 0x57 which is the opposite bit pattern.

    Changed C# program to create 0x57 bytes instead of 0xea bytes. I am going to install Python and try creating the binary the way Ben did it. It could also be I hardwired the data lines in reverse but I rewired and checked several times.

    Now that i know the CPU is reading from the EPROM, I will need to run some more tests to hopefully figure out why I had to reverse the bits on the binary on the EPROM to get the correct value in serial monitor.

    Added in a opcode to mnemonic lookup to audrino sketch so serial monitor can show the mnemonics as its capturing the data pins each clock cycle.

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates