User Interfacing
EE 552 Winter 2003 - Smart Equalizer Project
Group Members: Dustin Demontigny - demontig@ee.ualberta.ca, Dave Bull - bull@ee.ualberta.ca
Introduction: Digital systems often use specialized interfaces to interact with the outside world. This application note outlines the description and operation of such a system used for a digital equalizer. The gain values of each band in the graphic equalizer are used to determine how loud each frequency band is. Analog equalizers sold on the consumer market often use sliding potentiometers to manipulate these gain parameters. We used two push buttons to increment or decrement between preset gain values for all bands. The Smart Equalizer project uses the Xstend and XSA boards.
NOTE: All of the code was simulated using ModelSim and implemented using the Xilinx Project Navigator. It therefore might need a little “tweaking” to compile properly using Altera or other tools. We discovered this after we started programming using maxplusII.
Description: The VHDL code for the user interface block is described in user_io.vhd. The hardware components used in the user interface include 3 pushbuttons (incr, decr and reset) as well as a seven segment LED display, which are all accessible on the XStend board. The pushbuttons are used to select the desired preset value for the band gains. Incr and Decr are used to cycle up or down between the desired preset values. Preset 0 will create an equalizer with a flat response (unity gain). Preset 1 will correspond to user 1, preset 2 to user 2 and so on. The current preset will be displayed on the 7 segment display. The user interface manipulates input data from the outside world and stores band gain values in a register for use in the filter subsystem. This interface could be changed to perform such tasks as mode or sensor level selection in a control system.
Implementation: The user interface incorporates four main components: a debouncer, a preset counter, a preset decoder and a bcd decoder. These four components are instantiated structurally in one VHDL file user_io.vhd which is the top level for the user interface. A package file called smart_eq_pack.vhd holds all of the constants and component declarations used in the user interface.
The debounce entity described in debouncer3.vhd removes unwanted transients from the pushbutton inputs creating stable pulses of varying width. It does this by counting the number of clock cycles that occur. When the number of clock cycles count reaches the required value set by the constant debounce_delay, the input signals are mapped to the output. This method works well as long as the debounce delay is greater than the maximum bounce duration of the pushbuttons. It is important to mention here that a debounce_delay of 7 was used for simulation purposes whereas a debounce duration of 1023 will be used when implementing the design on the FPGA. The outputs from the debouncer are sent to the input of the preset counter.
The preset counter is described in preset_counter.vhd. This component reads the input pushbuttons to set the desired preset value. It works similar to an up down counter. When incr is pressed the preset value is incremented by one. Similarly, when decr is pressed the preset value is decremented by one. A synchronous reset button is used to set the preset value to zero. A very important requirement is to allow the preset value to increment or decrement only once for every press cycle. This means that the preset counter cannot simply check to see whether the button is pressed since the button will be held down for many clock cycles. This requirement is fulfilled by using two press variables, one for each of the pushbuttons. These variables act as a flags to indicate when the pushbutton signals goes low. These flags are then checked whenever the pushbuttons are not low. If the flags are set, then the preset value is incremented or decremented accordingly and the flag is reset to zero. It is important to note here that this system relies on only one pushbutton being pressed at on time. This requirement is acceptable considering the purpose of the user interface.
The output from the preset counter is sent to two decoders: a bcd decoder and a preset decoder. These are described in files bcd_decoder.vhd and preset_decoder.vhd respectively. The bcd decoder take the value of the preset counter and converts it to a decimal number display on the seven segment LED display. The preset decoder converts the value of the preset counter to a gain value required for the filter bands. The configuration of the LED segments and the preset values are stored in the package file smart_eq_pack.vhd and can be added to or changed as needed.
Signals new_gain and send_gain are used for handshaking. The user interface will set output new_gain high whenever the gain value has been changed and the input send_gain is high. Otherwise it will stay low.
Group Members: Dustin Demontigny - demontig@ee.ualberta. ca, Dave Bull - bull@ee.ualberta.ca