Engineer To Engineer Note EE-93
Technical Notes on using Analog Devices’ DSP components and development tools
Phone: (800) ANALOG-D, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com, FTP: ftp.analog.com, WEB: www.analog.com/dsp
Copyright 1999, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers’ products
or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders.
Information furnished by Analog Devices Applications and Development Tools Engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog
Devices regarding the technical accuracy of the content provided in all Analog Devices’ Engineer-to-Engineer Notes.
Digital Delay Demo for
the 2181 EZ-Kit Lite
Contributed by: Greg G. and Steve R.
This DSP EZ-Note describes a simple digital delay
demonstration using the ADSP-2181 EZ-Kit Lite
development board (ADDS-21XX-EZ-LITE.)
This board is a low-cost evaluation/development
board based on the ADSP-2181 digital signal
processor (DSP.) It is assumed that a “default”
installation of the EZ-Kit Lite software (included
with the development kit) has been performed.
This software includes the assembler, linker,
simulator and prom splitter programs as well as a
Windows based monitor program and various
sample applications.
One of the included demonstration applications is
MIC2OUT. This program takes an input from a
microphone connected to the EZ-Kit Lite board,
digitizes the sample through the A/D converter on
the AD1847 codec, and then immediately outputs
the sample back through the D/A on the codec.
The following steps outline the procedure for
observing and modifying the digital delay:
1) Create a “DOS box” by double-clicking on
the MS-DOS prompt icon from the
program manager window.
2) Change to the \DSP directory (an
exercise in typing in long paths.) This can
be done by typing:
CD \ADI-DSP\21xx\EZKITL\2181\DSP
3) Look at the source code file by typing:
EDIT MIC2OUT.DSP
4) Using the PAGEDOWN key, move down near
the end of the file to the INTERRUPT
SERVICE ROUTINES section. All of the code
in the earlier portion of the application is used to
configure the codec and initialize the program.
5) Note just above the INTERRUPT SERVICE
ROUTINES section, a line of code:
The source code for the digital delay application is
contained in the directory:
C:\ADI-DSP\21xx\EZKITL\2181\DSP
The DSP source file is MIC2OUT.DSP. For this
exercise, we will first run the application to see how
it operates. Then we will modify the program to
add a digital delay. By changing delay parameters,
we will change the length of the delay.
talkthru: idle;
jump talkthru;
This is the main routine of the MIC2OUT
application. The first instruction places the DSP
in idle mode and the second loops back
indefinitely. The processor performs this loop
until it is interrupted by the Receive Interrupt
Service Routine, indicating that a data sample
from the input is ready to be processed.
a
6) Next, look at the Receive Interrupt Service
Routine. This is the section of the application
where the input data is read from the A/D
converter with the following instructions:
Lite board and a set of amplified
speakers connected to the output jack.
Talk into the microphone and observe the
immediate output. This is the talkthru
mode working.
ax0 = dm(rx_buf + 1)
ay0 = dm(rx_buf + 2)
This reads the left and right channels from the
receive buffer in data memory. The data has
been placed there from the codec using the
autobuffering capability of the serial ports.
The next two lines take the data and immediately
write it to the transmit buffer in data memory to
be sent back to the codec for output. This is
done by placing the output data in the transmit
buffer.
dm(tx_buf + 1) = ax0
dm(tx_buf + 2) = ay0
7) Exit the editor and return to the DOS command
line by typing ALT-FX.
8) Press ALT-TAB to get back to the
PROGRAM MANAGER window. Double
click on EZ-KIT Lite folder and then start the
EZ-Kit Lite monitor by double clicking on the
EZ-Kit Lite program icon.
9) Press ALT-L to bring up the Loading
menu and choose the Download user
program and Go option. Click on the
MIC2OUT.EXE program in the File Name
listing window to select the MIC2OUT
application. Click on OK to load and run
the application.
11) Next, we will modify the MIC2OUT.DSP
source file to add a digital delay.
12) Press ALT-TAB to return to the DOS
window. From the
\adi_dsp\21xx\ezkitl\2181\dsp
subdirectory , bring the source file into the
editor by typing:
EDIT MIC2OUT.DSP
13) Pagedown to the DATA BUFFER
DECLARATIONS section.
14) What we want to do is to add a digital
delay to the program. This will mean that
rather than take the immediate input
sample and just write it to the output, we
must store the current sample temporarily
and output a sample from a previous
input. We do this through the use of
circular buffers.
Below is an example of a circular buffer of
length N. Data which had been placed
into the buffer N samples ago, is read
from the current location. New sample
data is placed into the buffer at the next
location and will be fetched N reads later.
When the current location pointer reaches
N and increments, it wraps around and
starts at location 0 again. Hence the term
circular buffer.
10) Make sure that you have a microphone
connected to the input jack of the EZ-Kit
EE-93 Page 2
Technical Notes on using Analog Devices’ DSP components and development tools
Phone: (800) ANALOG-D, FAX: (781) 461-3010, FTP: ftp.analog.com, EMAIL: dsp.support@analog.com