Peripheral Interface Adapters Have Been Assimilated.

1 September, 2010 (08:29) | Pinball | By: admin

I have conquered the Motorola 6820/6821 peripheral interface adapter!

Last week I got another batch of prototype PCBs and one of them was the latest version of my Bally/Stern CPU socket based daughter board that adds a microcontroller connected to all of the CPU pins needed to let the microcontroller run in parallel with the original CPU or halt it and interface with the RAM, ROM and PIAs on it’s own. The ultimate goal is to have a system which adds as much RAM and ROM as the original CPU (Motorola 6800) can address and be programmable by a PC via USB. At that point it will be possible to write far more complex game rules to run on the original CPU or new game rules that will run in the microcontroller making the Motorola 6800 CPU unnecessary. This RAM and ROM will be usable by either the original CPU or the microcontroller because the microcontroller is connected across the whole address and data bus.

Currently I’m working on writing the microcontroller operating system. The first step was to interface with the PIAs and get them doing my bidding. I first read the 6821 datasheet years ago and I understood the basic concept of how to read and write to the PIAs but I had to go over the datasheet pretty extensively to get the full picture of how they work.

I’m happy to say that at this point I have code to read and write to PIAs. That is a huge step toward reading switches and controlling lamps/solenoids. It seems like something so simple but it was pretty exciting when the LED on the MPU flashed under my control for the first time.

The first thing I did once I had the hardware tested and working was write a program to let me manually manipulate the address, data and control pins. Once this was working I manually put the PIAs through their paces using the data sheet as a guide. Then I built all that manual stuff into functions in my microcontroller operating system. That’s pretty much where I am right now. The next thing I need to do is write the interrupt routine for zero cross and the other PIA generated interrupts. The zero cross interrupt is needed before I can write the routines to strobe the lamps and drive the solenoids. I was going to use a microcontroller internal timer to trigger the display interrupt but I’m going to need to service the PIA interrupt anyway so I’ll also need to write code to service the display interrupt (strobe the displays). Should be fun.

This is a screen shot of the program I wrote to manually control the address, data and control pins of the 6800 CPU socket.

The extra sockets on the board are for EEPROM. This EEPROM will be programmable by a PC via the USB port on the board and replace the original game code. It will also add substantial ROM space over what the original board had available to the CPU. This most likely won’t be fully working until the next prototype PCB. I don’t like the address decoding on this version. I have run into a bunch of problems that I’ll probably discuss another day. In the mean time this project is rolling right along.