Join the Ben Heck team every week for amazing hacks! Watch them build and mod community-inspired projects using electronics!
|The Learning Circuit|
|See All Episodes|
While Ben does not care about records, he’s interested in using this as an excuse to build a RAM analyzer for the Atari 2600, analyzing the BUS with newer hardware. This external device will see when the CPU writes to the RAM and make a copy of the data to put in a memory array that can be read by a microcontroller. If they can get the RAM copier working, they can later have a microcontroller take a look at the RAM and make decisions on how best to play the game.
Ben rigs up some test equipment using some microchip PIC tail cards and some TI B0108 voltage receivers. This has an 8-bit BUS on either side to allow you to put two different voltages on it, in this case 5 volts and 3.3 volts, and does automatic conversions for you. He tests to make sure that the BUS transceiver properly converts 5 volts into 3.3 volts. He plugs the card into a PIC Development board. This allows him to do 8-bit read/write operations on the PIC32. To scan the Atari’s memory he’ll send bytes to it. The 8-bit data bus will come in as soon as he adds the address BUS and act as a clone of the RAM so that it can monitor what the Atari is thinking. By having a copy of the RAM, the MCU can make decisions on how best to play the game.
Ben does a voltage test with an IC tester clip. Ben has a wired up a PIC tail connector for the PIC32 MZ. He’s got some logic that does an address decode. Basically, it only sends a pulse when they are addressing the RAM. He runs the data and the address line through these 3.3 volt to 5 volt transceivers so they can knock down the voltage to 3.3 volts for the PIC32 so the PIC32 can read it without damaging itself.
Because they are using a 6502 CPU they’ll have to make adjustments to compensate for INCrement and DECrement. The data is not due to the possibility of having a double write immediately in the RAM by doing an INCrement or DECrement command. Ben takes a look at a 6502 CPU timing sheet and analyzes the INCrement and DECrement instructions that caused a double write to the RAM. He then adds circuitry to accommodate for that and counts a certain number of periods before setting a flag to tell him that the address or data is valid. This creates a rising edge triggering an interrupt on the PIC32 allowing it to load the valid data. Using external circuitry allows them to analyze the waveforms coming off to the CPU and figure out the best time to send the data to the PIC.