Saturday, 10 October 2020

6502 Computer Adventures: Part 2

 

Previously I connected up the 6502, now it was time to get the CPU to actually do something so I connected some LEDs to a couple of the address bus (pins 9- 13). I powered both circuits using a couple of AA batteries, success the LEDs started to blink randomly. 











W65C02 Pinout












Enough of the randomness I actually wanted the CPU to do something.  I hardwired the data bus so the CPU would be forced to run the same instruction over and over,  the NOP or No operation instruction was a good choice.   This does nothing for 2 clock cycles, usually used to time a delay or fill patches in a program.



I connected 16 LEDs to the address bus so I could monitor what it was doing.   The NOP instruction equates to EA in Hex or 11101010 in Binary. I hardwired the data bus (pins 26 - 33) starting at pin 26, I connected them via 1K resistors like this.

Pin Data Bus Connection
26 D7 +5v (1)
27 D6 +5v (1)
28 D5 +5v (1)
29 D4 0V (0)
30 D3 +5v (1)
31 D2 0V (0)
32 D1 +5v (1)
33 D0 0V (0)


Updated breadboard with the NOP / 11101010 hardwired to the 8 data pins









So I had basically made some blinkenlights, exciting times.  Watching the LEDs connected to the address bus count in a binary was quite therapeutic. 

Arduino Mega monitoring the address and data buses















In the first part of Ben Eater's 6502 videos he connected up a Arduino Mega to the address and data buses and wrote a little Arduino sketch to monitor these.