EE 101 Lab Exercise 9: Introduction to Programmable Logic - Altera EPM7032 (There is no pre-lab for this exercise)
Your assignment in this lab exercise is to use a programmable logic device (PLD) to implement a combinational logic circuit. The circuit you will program into the Altera EPM7032 EPLD is identical to the majority circuit we just designed in class (to blow up the Enterprise). For this lab, the AHDL (Altera Hardware Description Language) file that you would normally be responsible for writing has been provided for you below. The purpose of this exercise is merely to familiarize you with the Altera PLD programming software.
A sample AHDL program, Figure 1, implements the majority circuit. The truth table for this circuit is shown in Figure 2. The canonical sum of products expression for the majority circuit is F = ABC + ABC + ABC + ABC. Note that we did not reduce the equation before writing the Altera text design file in Figure 1. The Max+plus II software does this automatically.
Figure 1: AHDL program for a three input majority circuit.
Figure 2: Truth table for a three bit majority circuit. 1. Login to a PC (Windows NT network). Double click on the Altera icon on the desktop. The Altera software will take a minute to load. Altera can also be brought up by selecting it from taskbar, under the Programs menu (select MaxPlus II).
2. Under the File menu, select New. A small window will appear. Click on Text Editor File and OK. A window will appear. Before doing anything else, go to the File menu and choose Save As. Select the D: drive and, in the File Name field, type in majority.tdf and click on OK.
3. From the File menu choose Project and choose Name. Enter "majority" in the Project Name field, or select majority with the mouse and click on OK. Your path (d:\) and project name should appear on he bar at the top of the screen after a short wait.
4. Type the program as given in Figure 1 in the majority.tdf window. It would be wise to save your program (File menu, Save) after you complete every few lines. This way, if your computer or the network "crashes", you will not have to retype all of your work. After you have finished typing in the program, save it one more time. Then, go to the Max+plus II menu and choose Compiler. Do not hit the Start button yet. Before starting the compilation, you will specify the device type you want to use. Lots of PLDs are supported by the Max+plus II software, and there is a built-in feature that lets Altera pick the best chip for you. The PLD we are using in this lab is the EPM7032LC44. We will make sure that the proper device and package are chosen by first going to the Assign menu and selecting Device. First, uncheck the box that reads Show Only Fastest Speed Grades. You should see two fields, one for Device family and the other for specific Devices. In the Device Family Field, select MAX7000 (if it is not already selected). In the devices field, select EPM7032LC44-15. Hit OK. Now click the Start button on the compiler window. If there is problem with the .tdf file you created, you will find out now. If the compilation process stops and reports errors, fix these, re-save your program, and resume compiling (hit the Start button again). Ask for assistance if you have trouble fixing your errors and compiling. After the program compiles with no errors, hit OK. After compilation, several new files have been added to your directory. They are all called majority, but their extensions vary: .cnf, .fin, .fit, .hif, .ini, .mmf, .pof, .prb, .rpt, .snf, and .sym.
5. Take a look at your .rpt file. (File, Open majority.rpt, or just click the rpt icon in the compiler window). Scroll down to find the picture of the chip. Note the pinout, and which pins are connected to what, and which are deliberately not connected. Find the area where the device, turbo, and security options are listed (right above the pinout). Add your name around this area.
By highlighting the area with your mouse, select your name, the picture of the PLD, and the pinout information which follows it. Print out your highlighted portion. (File ~ Print ~ 1 copy ~ Selected Area). Go to the printer and wait for your printout. You will use this picture of the chip to wire up your circuit.
6. Simulate your program. Altera has a feature that allows you to simulate your program before you actually take the time to build your circuit.
7. Program your chip. The Altera programmer is located in the Northwest corner of the lab. Since the programmer PC is networked with the rest of the lab, you can access your files from there. When you are ready to program your chip, let a lab assistant know so he or she can guide you through the process. 8. Take your chip back to your workstation and install it in the PLCC adapter board. Note that certain pins are always going to be tied to Vcc and GND. For the EPM7032, pins 3, 15, 23 and 35 are always tied to Vcc, and pins 10, 22, 30 and 42 are always tied to ground. We have designed the adapter board to join these Vcc and ground pins together. All you have to do is to connect a single wire from the VCC port on the adapter to +5 volts on the protoboard, and another wire from GND on the adapter to ground on the protoboard. Note (from the printout of your chip) that there are possibly other grounds and Vccs that you will still need to hook up. These pin assignments will vary from project to project. Take care that your chip has the proper orientation, and let a lab assistant witness you plugging the chip into its socket. Make sure all GND and Vcc wires are hooked up properly to the device. Hook the output (F) of the Altera chip to an LED on the breadboard. Test your device first by using +5V and ground as inputs, and a logic probe for the output. Construct a truth table with your results. It should agree with the truth table in Figure 2.
9. Once you are convinced your circuit is working properly, hook up the stimulus generator (or counter) and logic analyzer as you did last week. It would be wise to exit Altera completely before running the logic analyzer and stimulus generator software. Refer to your lab from last week to remind you how to use the stimulus and logic analyzer. If you get stuck, ask for help! Construct a truth table with your results. Again, this should agree with the truth table in Figure 1. Print out a copy of your waveform data (for one cycle of inputs only) and tape it into your lab book. |