MIT
6.111 Labkit  

 FPGA Labkit

for 6.111 Introduction to Digital Systems

6.111 homeLabkit homeTest Programs → General I/O Ports Test

I/O Test 2: General I/O Ports

by Nathan Ickes

Introduction

The iotest2 program tests the following labkit components:

  • All four user I/O ports
  • The daughtercard connector
  • All four logic analyzer ports
  • The RS-232 port
  • The two PS/2 ports
  • The builtin 27MHz oscillator
  • The two oscillator sockets
  • The alphanumeric displays
  • The eight slide switches
  • The nine pushbuttons
  • The eight individual, user-controlled LEDs
The user I/O and daughtercard ports are tested as outputs only. The iotest program tests these ports as inputs and outputs, but requires the use of special loopback fixtures.

Test Setup

  • For configuring using a CompactFlash card: iotest2.ace
  • For direct download to the FPGA via JTAG: iotest2.bit

LEDs, Switches, and Pushbuttons

The eight user-controlled LEDs, nine pushbuttons, and eight slide-switches (all located near the lower edge of the board) should behave as follows.

  • LED 0 (D9): On when the "Enter" pushbutton (S5) is pressed; blinking when pushbutton 0 (S9) is pressed; on if switch 0 (S17) is up; off otherwise.
  • LED 1 (D8): On when the "Enter" pushbutton (S5) is pressed; blinking when pushbutton 1 (S8) is pressed; on if switch 1 (S16) is up; off otherwise.
  • LED 2 (D7): On when the "Enter" pushbutton (S5) is pressed; blinking when pushbutton 2 (S7) is pressed; on if switch 2 (S15) is up; off otherwise.
  • LED 3 (D6): On when the "Enter" pushbutton (S5) is pressed; blinking when pushbutton 3 (S6) is pressed; on if switch 3 (S14) is up; off otherwise.
  • LED 4 (D5): On when the "Enter" pushbutton (S5) is pressed; blinking when the "right" pushbutton (S4) is pressed; on if switch 4 (S13) is up; off otherwise.
  • LED 5 (D4): On when the "Enter" pushbutton (S5) is pressed; blinking when the "left" pushbutton (S3) is pressed; on if switch 5 (S12) is up; off otherwise.
  • LED 6 (D3): On when the "Enter" pushbutton (S5) is pressed; blinking when the "down" pushbutton (S2) is pressed; on if switch 6 (S11) is up; off otherwise.
  • LED 7 (D2): On when the "Enter" pushbutton (S5) is pressed; blinking when the "up" pushbutton (S1) is pressed; on if switch 7 (S10) is up; off otherwise.

The clock used to blink each LED when the corresponding pushbutton is pressed is derived from the labkit's built-in 27MHz oscillator (Y4).

Alphanumeric Displays

The alphanumeric display is used to display status information from several of the system tests. When the FPGA is first configured, the display should show something like this:

Alphanumeric display on startup

If the display is blank, or shows mangled characters, something is wrong.

Oscillators

The labkit's built-in 27MHz oscillator is used by the alphanumeric display driver. If the display is functioning, it is safe to assume the built-in oscillator is functioning properly.

The status of the clock signals from the two oscillator sockets in the upper-left corner of the PCB is indicated by the third item on the alphanumeric display ("C:??"). The first character after the colon indicates the state of the Clock 1 oscillator (Y2), and the next character indicates the status of the Clock 2 oscillator (Y3). An upwards pointing arrow indicates the respective clock signal is stuck high; a downwards pointing arrow indicates the respective clock signal is stuck low; and an arrow pointing both upwards and downwards indicates that the respective clock signal is properly toggling.

Obviously, in order to test the oscillator sockets, it is necessary to install an actual oscillator in each socket. Any 3.3V oscillator, with a frequency between 1MHz and 10MHz can be used.

PS/2 Ports

Testing the PS/2 ports requires a PS/2 compatible keyboard. The keyboard should first be plugged into the keyboard port on the labkit (J9). Note that PS/2 is not designed to be a hot-pluggable interface. It's best to plug in the keyboard with the labkit powered off. The keyboard controlled may not reset properly if the keyboard is plugged in while the labkit is on.

Typing any of the keys A through F should cause the first few characters of the alphanumeric display to read "K:X", where X is the character that was typed. The PS/2 test interface only recognizes the key codes A-F. All other key codes are translated as "?"--this includes repeat and release codes.

The mouse port (J8) is tested using a keyboard, in the same manner as the keyboard port. The second field on the alphanumeric display ("M:X") indicates the last key code received over the mouse port.

RS-232 Port

A trivial loopback test is implemented, which includes flow control. Connect the labkit's RS-232 connector (J7) to a PC, using a null-modem cable. Then launch a terminal program (such as HyperTerm) on the PC. Any baud rate, parity, and stop bit settings can be used. Hardware flow control should be turned on, in order to test the labkit's CTS and RTS lines. Local echo should be turned off. Characters typed into the terminal on the PC should be echoed by the labkit.

User I/O, Daughtercard, and Logic Analyzer Connectors

Source Code

MIT 6.111 Introduction to Digital Systems, Updated April 05, 2005