CSE370 Laboratory Assignment 8


Design Project


Distributed: 26 November 2003
Due: 10 December 2003


Objectives

In this laboratory assignment you will build an RS232 to LCD pipeline (see project description). You are provided with a schematic and Verilog files for all the modules. Two of the modules (MainController and InitDecoder) have incomplete Verilog descriptions that you must complete. You will then synthesize these two parts into PALs and wire up the entire circuit on your XLA5 board connected to a PC running HyperTerminal to provide the characters to display and send them over the RS232 cable.


HyperTerminal

The screen shot below shows how to configure HyperTerminal.

Note: You may experience a peculiar problem with HyperTerminal that the MSB of the character changes when you repeatedly press the same key on the keyboard. If this happens to you, here is the fix.

Reconfigure HyperTerm as its settings are causing the problem. When you run HyperTerm you should see "4800 8-N-1" at the bottom of the window, as shown in the red circle in the figure. If it instead says Auto-Detect you need to stop the session by clicking on the Disconnect button (circled in green) and goto the File menu, and Select properties. Click on configure. Ensure that the settings are correct and also make sure that you click the apply button. (If apply is greyed out, make a change then change it back then click apply). Now hit the Connect button and check to see if 4800 8-N-1 comes up.


Design Files

To create your own design for this project, load the following files into Active-HDL:

Documentation for the LCD module is available here or from the manufacturer's web page.

You will need to set the contrast for the LCD screen. For this, we have to apply a voltage at the Vo pin that we can obtain using the voltage divider circuit shown in the figure below. This circuit will generate a voltage for Vo of approximately 1/(1+4) of VCC or .2 of 5 volts or 1 volt. If you look at the LCD screen specs you will find the location of the Vo pin. In your kit we have included a 3.9K ohm resistor and a 1K ohm resistor. You can determine the resistance value of a resistor by the color coded bands on the resistor (see explanation of how the color coded system works and an automated calculator).

 


Notes

  1. This laboratory assignment is linked to the last written assignment and you can work with your lab partner on both together. In fact, this is recommended. You will turn in one copy of the written assignment and have this laboratory assignment checked off for both of you.


Review of PAL Programming Method

Place the PAL into the programmer as close to the lever as possible (shown the in figure below where your PAL fits into the red box.)

NOTE the location of PIN 1. This means the notch on top of the PAL must be place opposite from the lever.

Programming Steps

  1. Erase the PAL
  2. Program the PAL
  3. Verify the PAL

If ANY of these steps fail try your other PAL. Contact the course staff to help you deal with failures in these steps.

Please be careful with the programmers. Take the time to ensure that you are putting the chip in correctly and that you are following the steps correctly. Refer back to the tutorial for further details.

Creating a wiring file for your PAL

To create a wiring file for your PAL you need to create your own CTL file. Refer back to laboratory assignment 7 for an example on proper syntax. Essentially you are creating an attribute by concatenating the various wiring assignments ending the attribute with a semicolon. One important thing to note is that the following 4 items should have the exact same name or you control file might not work.

  1. The Verilog File (extension .v)
  2. The Verilog Module
  3. The Control File (extension .CTL)
  4. In the attribute declaration line in the CTL file (e.g attribute pin_numbers of [verilog module]:module is)


Tasks

  1. Start by connecting the serial cable from the PC to the connector on the XLA5 board. To do this, you will need to add a "null modem" and a "gender changer" between the XLA5 connector and the end of the cable. Make sure to do this. Otherwise, you will not receive characters on to your board. Make sure to keep the null modem and gender changer with your kit, that is, remember to remove them when you unplug your XLA5 board.

    The sender module of the project schematic is implemented by the PC and the serial_buffer module is already loaded into the FPGA (see schematic). We'll need LEDs connected to the "received" and "charRcvd" outputs of the FPGA ("received" is already connected to LD7, wire O2 to one of the other LEDs) and a switch connected to the "displayed" input of the FPGA (O3). The system already has a reset, use push-button BTN1 to indicate a reset. The LD6 output of the FPGA makes reset available after it is synchronized and debounced so that you can use it in the rest of your circuit (it is also connected to LD6 for easy viewing). Power-up the board and start HyperTerminal on the PC. Send a character over the RS232 cable with HyperTerminal by typing a character on the PC keyboard. (Make sure to configure HyperTerminal correctly by following the instructions above.) You should see the "received" LED light up after you type a character on the keyboard. What is the value of charRcvd? Shift out the character one bit at a time by using BTN4. You'll want to look for a start bit followed by the 8-bit ASCII code of the character and then a stop bit. Did you see the code for your character delivered serially on "charRcvd"?

  2. You will now wire up your part of the circuit using the provided schematic as a guide. By now, you'll have completed the design of your two PALs and verified their operation in the simulator. Note that the '244 and '377 modules were set up to match the physical parts pin for pin. You'll have to decide on your own pin assignments for the PALs. The "drop_a_bit" module does not exist physically. It simply connects some wires to make the '377 into a shift register. You can realize it on your protoboard just with wires - no chips needed. The display module can be plugged directly into your protoboard. Make sure to leave room to connect to the 13 pins (PWR, GND, 8-bit data, RS, RW, and E).

    Verify the operation of your circuit a piece at a time. Compare against your simulation waveforms as you single step. Demonstrate it to the TAs by sending a few characters to the display. Also, demonstrate any extra credit commands you may have implemented.


Comments to: cse370-webmaster@cs.washington.edu (Last Update: )