Summary: This module will demonstrate how to use Spectrum Digital's eZdsp F2812 to implement a finite impulse response (FIR) filter on an audio input.
The purpose of this lab is to learn how to prepare Spectrum Digital’s eZdsp™ F2812 to implement a finite impulse response (FIR) filter using an audio input. Since the F2812 does not have a digital-to-analog converter (DAC) as one of its peripherals, this lab will cover setting up the eZdsp™ to use two options:
Before you begin, review the basics of digital filtering.
The eZdsp™ F2812 allows people to determine if the TI TMS320F2812 digital signal processor (DSP) is suitable for their application requirements. It also allows evaluators to develop and run software for the F2812 processor by using Code Composer Studio. A separate tutorial for the Code Composer Studio software will be available in this course.
The eZdsp™ F2812 has the following features:
| eZdsp™ F2812 Block Diagram from Spectrum Digital's Datasheet |
|---|
![]() |
To begin this lab, there are several tasks you will have to accomplish in order to set up your hardware before programming the DSP. Some background information has been provided, but if you like additional information, please refer to the References section at the end of this lab.
The eZdsp™ requires a 5V power supply that is provided and should be connected to the board via connector P6. The supplied parallel cable also needs to be plugged into a PC that has Code Composer Studio installed on it.
Soldering Connectors Since we will be working with the analog-to-digital converter (ADC) and the serial peripheral interface (SPI) on the eZdsp™S kit, we will want to solder two connectors on the board. One header should be soldered onto pins 20-26 on the outline labeled P8 which deals specifically with SPI signals. The second header should be soldered onto pins 2,4,6,8,10,12, and 14 on the outline labeled P9 which is where the analog signals are located.
|
You will also need to solder a wire from pin 13 (GND) to pin 18 (VREFLO) on header P9 for proper ADC operation.
Your eZdsp™ setup should look like this:
![]() |
TI’s multi-converter evaluation module (EVM) is a kit that allows users to evaluate the performance of several devices in the multipurpose (MP) family of data converters. It is designed to work with the TMS320 DSPs. It comes with six different ADCs and ten various DACs. For the purpose of our lab, we will be using the TLV5638 dual 12-bit DAC.
Setting up the EVM The EVM has a header labeled J11 that needs to be connected to header P8 on the eZdsp™ board. Using wires to do so, connect the following:
| Pin No. | Header P8 | Pin No. | Header J11 |
|---|---|---|---|
| 19 | GND | 1 | GND |
| 20 | GND | 3 | GND |
| 23 | SPISIMOA | 2 | SDI |
| 25 | SPICLKA | 4 | SCLK |
| 26 | SPISTEA | 6 | CS |
![]() |
After this, the boards are now set to communicate with each other:
![]() |
Once the boards are connected, powering up the EVM board is the next step. The EVM operates on four voltages: -12V, 0V, 12V, and 5V. Solder one wire to each pin in connector J7. After partially stripping each wire, use a power supply source to deliver the proper voltage to each pin. The D1 LED should light green when done correctly as shown in the following picture:
![]() |
Since we will be using a DSP to generate signals, we will want to make sure the EVM board is configured as such. Look for the SW1 switch on the right side of the board and make sure the following is set:
| SW1-1 | Off |
| SW1-2 | On |
| SW1-3 | Off |
| SW1-4 | Off |
Once this is done, a second LED, which will light up orange, signifies that the EVM is set to operate via a DSP – “User Mode”.
![]() |
The board is now ready to receive signals.
Another option for using an external DAC is the audio processing daughtercard that was designed after the eZdsp™ was successfully set up to communicate to the TLV5638 DAC on the EVM. In this section, we will show how to set up the eZdsp™ to communicate with the daughtercard.
| Audio Processing Daughtercard | ||||
|---|---|---|---|---|
|
A simplified block diagram of the system is shown in the following figure:
![]() |
Soldering The only preparation the eZdsp™ requires to interface with the audio processing daughtercard is to solder two headers to P8 and P9 to the eZdsp™:
![]() |
Once you are done with that, then all you have to do is join the two boards together through the headers:
|
When you have the audio processing board mounted on the eZdsp™ F2812, then you will have to connect the power supply and parallel cable to the eZdsp™. The LED labeled ‘Power’ on the daughtercard should light up bright orange if done correctly.
You will also have to connect the provided speaker to the jumper labeled ‘R_SPKR’ on the daughtercard. Make sure the black wire is connected to the ‘-‘ and the red wire is connected to the ‘+’.
For our lab, you will be using an Apple iPod to supply the audio source and that will have to be connected with the supplied cable to the jumper labeled J4 on the daughtercard. Since the iPod we are using does not have a very reliable battery, be sure to have the iPod connected to a power supply. Your setup should look like this:
![]() |
To turn the iPod on, just press the Play button. To turn it off, hold the Play button until the screen goes blank, just like in previous picture.
Controls The daughtercard features two potentiometers that will be programmed later in this lab to control the volume of the output signal and the spectrum of filters that will be applied to the input signal.
In this part of the lab, we will be using Code Composer Studio to set up the software implementation of the FIR filter on an audio signal. If you are not familiar with Code Composer Studio, you might want to read over the ELEC 424 tutorial before you begin.
There are several peripherals and interfaces we will work with and a little background information will be given for each, but if you would like more information, please look under the References section at the end of this lab manual.
The serial peripheral interface (SPI) is a high-speed synchronous serial input/output (I/O) port that allows a serial bit stream of programmed length (1-16 bits) to be shifted into and out of the device at a programmed bit-transfer rate. The SPI is normally used for communications between the DSP controller and external peripherals, the DAC in our case, or another controller.
Since we will be implementing an FIR filter on an audio source, we will need to be able to communicate to the TI TLV5638 dual 12-bit DAC on the EVM. We will do this by setting up the SPI on the F2812 DSP. There are several registers that require the following values in order to operate properly:
| Register Name | Register Value (HEX) |
|---|---|
| SPICCR.bit.SPISWRESET | 0 |
| SPICCR.all | 0x005F |
| SPICTL.all | 0x001F |
| SPISTS.all | 0x0000 |
| SPIBRR.all | 0x0002 |
| SPIFFTX.all | 0xC028 |
| SPIFFRX.all | 0x0028 |
| SPIFFCT.all | 0x00 |
| SPIPRI.all | 0x0010 |
| SPICCR.bit.SPISWRESET | 1 |
| SPIFFTX.bit.TXFIFO | 1 |
| SPIFFRX.bit.RXFIFORESET | 1 |
The F2812 DSP has a 12-bit ADC core with built-in dual sample-and-hold (S/H). It provides options for:
A block diagram of the ADC module:
![]() |
For this lab, we will be using sequential sampling, 16-bit cascaded mode and enable the event manager A (EVA) to be the source trigger for the SOC sequence. We will set up the following registers to do so:
| Register Name | Register Value (HEX) |
|---|---|
| AdcRegs.ADCMAXCONV.all | 0x0001 |
| AdcRegs.ADCCHSELSEQ1.bit.CONV00 | 0x3 |
| AdcRegs.ADCCHSELSEQ1.bit.CONV01 | 0x2 |
| AdcRegs.ADCTRL2.bit.EVA_SOC_SEQ1 | 1 |
| AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 | 1 |
The ADC places its results in 16 registers, ADCRESULT0-ADCRESULT15, which are left-justified, meaning that the four least significant bits are reserved. Each ADCRESULTn register corresponds to one of the ADCINA0-ADCINA7 or ADCINB0-ADCINB7 registers.
The event manager peripheral in the DSP includes general-purpose (GP) timers, full-compare/PWM units, capture units, and quadrature-encoder pulse (QEP) circuits. For the purpose of this lab, we will be using event manager A (EVA) to trigger the SOC sequence in the ADC.
EVA functional diagram:
![]() |
The following registers need to be set up as:
| Register Name | Register Value (HEX) |
|---|---|
| EvaRegs.T1CMPR | 0x00fa |
| EvaRegs.T1PR | 0x1f4 |
| EvaRegs.GPTCONA.bit.T1TOADC | 1 |
| EvaRegs.T1CON.all | 0x1043 |
Interrupts, as described by Dr. Choi in one of his lab manuals in ELEC 434, provide a mechanism for handling any infrequent or exception event. The interrupt causes a CPU to make a temporary transfer of control from its current location to another location that services the event. Variety of sources, internal and external to the CPU, can generate interrupts. The use of interrupts greatly increases the performance of the CPU by allowing the I/O devices direct and rapid access to the CPU and by freeing the CPU from the task of continually testing the status of its I/O devices. The I/O devices assert interrupts to request the CPU to start a new I/O operation, to signal the completion of an I/O operation, and to signal the occurrence of hardware and software errors.
The F2812 DSP supports one nonmaskable interrupt (NMI) and 16 maskable prioritized interrupt requests (INT1-INT14, RTOSINT, and DLOGINT) at the CPU level.
For the purpose of our lab, we will be using interrupts for the ADC and the SPI.
After you have prepared the eZdsp™ F2812 for either the EVM or the audio processing daughtercard and have read the software section of this lab manual, you are to implement an FIR filter on an audio input signal:
remez’, ‘fir1’, and ‘fir2’ are different commands you can use to in order to get coefficients for low-pass, high-pass, and band-pass filters. You can refer to FIR filtering using Matlab. freqz’ command.