LEDs and Switches

The DE2 board provides four pushbutton switches. Each of these switches is debounced using a Schmitt Trigger circuit, as indicated in Figure 1. The four outputs called KEY0, ..., KEY3 of the Schmitt Trigger device are connected directly to the Cyclone II FPGA. Each switch provides a high logic level (3.3 volts) when it is not pressed, and provides a low logic level (0 volts) when depressed. Since the pushbutton switches are debounced, they are appropriate for use as clock or reset inputs in a circuit.

Figure 1. Switch debouncing.

There are also 18 toggle switches (sliders) on the DE2 board. These switches are not debounced, and are intended for use as level-sensitive data inputs to a circuit. Each switch is connected directly to a pin on the Cyclone II FPGA. When a switch is in the DOWN position (closest to the edge of the board) it provides a low logic level (0 volts) to the FPGA, and when the switch is in the UP position it provides a high logic level (3.3 volts).

There are 27 user-controllable LEDs on the DE2 board. Eighteen red LEDs are situated above the 18 toggle switches, and eight green LEDs are found above the pushbutton switches (the 9th green LED is in the middle of the 7-segment displays). Each LED is driven directly by a pin on the Cyclone II FPGA; driving its associated pin to a high logic level turns the LED on, and driving the pin low turns it off. A schematic diagram that shows the pushbutton and toggle switches is given in Figure 2. A schematic diagram that shows the LED circuitry appears in Figure 3.

Figure 2. Schematic diagram of the pushbutton and toggle switches.

Figure 3. Schematic diagram of one group of LEDs.

A list of the signal names on the Cyclone II FPGA that are connected to the toggle switches, pushbutton switches and LEDs are displayed in Table 1.

Table 1. signal assignments for toggle switches, pushbuttons, and LEDs

Signal NameDescription
SW[17:0] toggle switches (18)
KEY[3:0] pushbuttons (4)
LEDR[17:0] red LEDs (18)
LEDG[8:0] green LEDs (9)

See DE2_pin_assignments.csv, a comma-delimited file that matches "standard" descriptive names to actual FPGA pin locations. This file can be directly opened in Microsoft Excel.

References

   DE2 User Manual, version 1.4, 2006. (pdf)


Maintained by John Loomis, last updated 18 April 2007