
The ‘3’ bit is actually the fourth from the right. For example, to set pin 3 high, we need to make sure that the ‘3’ bit of PORTB is a one. fake6502 were written to manage the GPIO pins connected as address, data and control buses.

#6502 EMULATOR ARDUINO WITH DATA PIN HOW TO#
What I am thinking through now is how to tie the ram read with the shift out, and ram write with the shift in. Browse The Most Popular 2 C Arduino 6502 Open Source Projects. The pins in each port are numbered 0-7 and we set them high or low by writing a 1 or 0 to the associated bit in the register. This is a spacetime emulator use, space because in-circuit.

This is still a work in progress for this part so I havent considered what passive components to use for noise isolation or other things. Since these memory operations are synchronous, you can use the cs on different pins, everything else can share the rest of the bus. All done with 5 pins, not much of a savings until you consider you can share every pin as an SPI bus. Then I remembered I has a bunch of 74HC299 universal shift registers which allows you to shift data in or out serially, and latch parallel data or set the outputs for the ram to read or write. Everything I read was using two shift registers for the data bus. I didn’t want to use 8 pins for I/O on the Arduino Nano I was testing with. The one thing I was stuck on was the data bus. This worked for me because I tied the enable output line to the clock. This allows you to check the ram for bit errors. and for our purposes we will assume all clocks edge are aligned and refer to CLK0 (output from Arduino into 6502). Most memory initializes with alternate pages as all zeroes and either a random or fixed pattern. The main reason was to see if the address bus was iterating through cells in the RAM chip properly.

I also added LED indicators to the data bus. It was from an old PC secondary cache which were used in banks of 4. This time around I had an old 64kb static ram chip. Understand that I am primarily a developer, electronics comes naturally to me, but proficiency comes with experience so forgive any of my “worst practices” that might make an electrical engineer cringe. I added some LED indicators to the address bus so I can see the activity as I cycled through.
#6502 EMULATOR ARDUINO WITH DATA PIN SERIAL#
I last left off with the makings of an address decoder using a pair of 74hc595 serial to parallel shift registers.
