I've started a new project--building circuits around the Intel 8088 microprocessor. I am unsure how far this will go, but the idea is to hit the basics such as addressing external memory, fetching instructions to execute, handling interrupts, managing I/O, and other essential needs for a PC. I will assume that you don't have much of a background in digital circuits or computer design. However if you are savvy with the aforementioned, I will assume that you are capable of skipping through.
A Brief History of the 8088
Intel introduced the 8088 in 79', and the microprocessor was a hit. Though the 8088 is internally a 16-bit microprocessor, Intel's desire for it to have binary compatibility with the previous 8085 (as well as the 8080) meant that the external data bus had to be only 8 bits wide. This decision was easy to make since the 8086, which did feature a 16-bit data bus, wasn't attracting as much attention from hobbyist in terms of designing home computers. After modifications to the 8086's BIU (Bus Interface Unit), the 8088 hit the market with the new x86 architecture and eventually found its way into the famous IBM PC. This PC was a watershed moment in computer history; having IBM make a personal computer validated the market, and signaled that these machines were more than nerdware. Today, for better or worse, the x86 architecture dominates the computer market--and this is all traced back to the 8088.
What We Need to Get Started
Whether you are new to electronics or not, your toolbox is incomplete. There is always an additional one-hundred bucks that can be put towards something shiny and new. Keeping that in mind, don't feel bad about the following list of things you will need to get started; just get used to it:
- Power supply (5V, at least 1A)
- Logic Probe
- Oscilloscope (20 MHz at least)
Ideally, you will want to invest in a better power supply. The basic circuit that I will be putting together within this post will suck up around 50mA--and that's without the 8088 connected. Just get a better power supply if possible. If your budget is limited, SparkFun has a $10 power regulator that will do just fine for now: https://www.sparkfun.com/products/114 (This kit comes with a 250mA resettable fuse, but go ahead a switch it out for a 500mA one.) You will see a 9V battery powering my circuit, but a 9V wall wart is preferred since the battery will destabilize quickly within a 200mA+ circuit.
The next big item on the list is the oscilloscope. A digital one is preferred, and if you can afford anything above the 20MHz recommended bandwidth, do it. The better the scope, the better you will feel inside. If a traditional scope is outside your price range, you can pick up a cheap, PC-based one from SainSmart: http://www.sainsmart.com/sainsmart-dds-120-20m-50m-s-virtual-oscilloscope-silver.html (The software is only for Windows, but might be worth it for some.) I would not recommend buying this if you can afford otherwise.
Building an 8088 Circuit
The first thing a microprocessor needs is a clock signal. The original 8088 was 5MHz. THAT IS FIVE MILLION CYCLES PER SECOND! Feel the excitement?
We could use a 5MHz crystal, but the 8088 is picky about the incoming clock signal. For accurate internal timing, the 8088 requires the incoming clock signal to have a duty cycle of 33% (1/3 of the time high, and 2/3 of the time low.) Though this can be accomplished with some wizard-like circuitry, Intel spared us the headache and provided the 8284A clock generator, which generates the needed signal but also divides the initial crystal frequency by three. This means that a 15MHz crystal will be needed to generate the appropriate 5Mhz clock signal for the 8088. The 8284A is around 5 bucks each, and some can be found here: http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_52871_-1. Buy a couple of them. In Robert Grossblatt's The 8088 Project Book, he writes, "IF YOU CAN'T AFFORD TO BLOW IT UP, YOU CAN'T AFFORD TO USE IT."
Some Basics in Digital Electronics
A circuit must be closed for current to flow (The circuit must also run from a higher voltage to a lower voltage.)
Voltages are relative differences in electric potential; we usually choose the negative terminal to be our ground--0V (A 9V battery has a 9V positive terminal and a 0V, or ground, negative terminal.)
A resistor inhibits current within a circuit.
A capacitor stores charge, and does not complete a circuit (so current will not flow through.)
A capacitor will also smooth out the voltage within a circuit.
It is smart to place a small resistor before current-sensitive components (Such as LEDs, Transistors, Switches); it is also smart to have a small capacitor before voltage-sensitive components (such as ICs.)
The mathematical relationship between voltage, current, and resistance within a circuit is V = IR or I = V/R (The units for voltage, current, and resistance are respectively volts (V), amps (A), and ohms (Ω).)
Two resistors, R1 and R2, in series have the following mathematical relationship: R = R1 + R2.
Two resistors in parallel have the following mathematical relationship: 1/R = 1/R1 + 1/R2 (This means that if you need a 500Ω resistor but only have two of 1000Ω, you can simply twist them together in parallel.)
Capacitance is measured in Farads (F).
Back to Building an 8088 Circuit
I will start this section by dropping a schematic. Don't feel intimidated. There are only six symbols you will need to learn here--and I've included a key!
The above schematic should now be straightforward, except for the circuit connecting to the RES pin of the 8284A. Let's take a closer look at this particular circuit.
The right half of the circuit shows a 10,000Ω resistor in series with a 0.1uF capacitor. Recalling that V = IR, it becomes clear the a 10kΩ resistor will all but stop current from flowing here. Then why include it? Recall that capacitors can store charge. We are actually not interested in having current flow; what we want to do is charge the capacitor to 5V so the RES pin will read HIGH (Which does not signal a reset.) The switch is added to the circuit so that once closed, the capacitor will discharge causing the RES pin to read LOW (Which signals a reset.) I recommend building this circuit on a breadboard with an LED after the 150Ω resistor to see this circuit in action.
It will take time to get used to these schematics, and it will take even longer to get comfortable with implementing them within a breadboard. For now, I'll give you a little cookie:
After you have something on the breadboard, it's time to check it. Grab your oscilloscope and read the CLK pin of the 8284A. If everything is functional, you should see a signal like the following:
The clock signal output by the 8284A captured on a PC oscilloscope.
Notice that the duty cycle of the wave is pretty much 33%. We do have a bit of noise in our waveform, but considering that our implementation is on a breadboard, this is normal.
The next thing to test is the RESET pin. Ideally, upon closing the switch (and discharging the capacitor), the 8284A will read HIGH on the RESET pin. This pin will be connected to the actual 8088, and this is what will signal an 8088 reset.
The bottom signal is a reading of the RESET pin while the RES circuit's capacitor is charged.
Now, while closing the switch, read the RESET pin on the scope. We should see it jump HIGH like in the following picture:
Upon closing the RES circuit (discharging the capacitor), the RESET signal is HIGH on the scope.
If you were unable to achieve any of these readings, try triple checking your circuits (Use your multimeter and digital prove for testing), try swapping out the 8284A (You did buy a couple of them, right?), and try everything else I have not suggested. I've spent days debugging a circuit only to find a minor problem. It happens, just keep up the excitement.
In my next post, I'll actually plug the 8088 into our design.
A final view of the 8284A connected to the 8088.