Analog Devices ee-92 Application Notes

Engineer To Engineer Note EE-92
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.
This procedure is based on one of the examples that comes with the ADSP-21xx software (Example 2 - can be found in C:\Program
Files\Analog Devices\VisualDSP\21xx\
Examples\Example2). This program is a talkthru
program that simply passes data through the serial ports. The DSP receives a value in SPORT1, then transmits it through SPORT1. The main part of the program is an infinite loop that waits for the SPORT1 receive interrupt to occur. The interrupt service routine performs all data processing (in this example, transferring data from the SPORT receive register to the SPORT transmit register).
For simulation purposes, input and output files will be used as inputs and outputs to the serial port. The file, serin.dat provides the input for the serial port. The debugger creates the file serout.dat and stores the output of the SPORT in this file.
This example is also documented in Chapter 7 of the ADSP-2100 Family Assembler Tools & Simulator Manual (page 7-25).
Procedure for setting up this example in the Debugger
1. Assemble and link your code to create an executable.
2. Open up the Debugger and select a new
session with an ADSP-2101 target.
3. Load your executable into the Debugger and
click on DEBUGà RESET to simulate code bootup.
4. Go to SETTINGSàSTREAMS. This will
bring up the Streams dialog box. Make the following selections:
a. Under Source (Debug Target) select
SPORT 1 as your device.
b. Next, fill in the destination file
associated with SPORT 1. Under Destination (File) enter ‘serout.dat’ (or whatever name you choose for the output).
c. Change the format to binary. d. Click on Connect. These steps have
configured the output stream.
e. Now, for the input stream, go back to
Source (File). Browse to select the file, ‘serin.dat’ which should be in the
C:\Program Files\Analog Devices\Visual
Dsp\Examples\Example2 directory.
f. Change the format to binary. g. Go back to Destination (Debug
Target). Select SPORT 1 as your device.
h. Click on Connect. These steps have
configured the input stream.
i. Check the ACTIVE streams to make
sure your selections were set correctly.
j. Click on OK to close the Streams
Dialog Box.
5. Jump to location 0x0029 in the program and
change the value 0x6b27 to 0x6a27 to enable the SPORT.
a
6. Set up the debugger to generate an RFS1
interrupt every 200 cycles by going to SETTINGSà INTERRUPTS and selecting RFS1 (under External Interrupts) and entering 200 for the min and max cycles.
7. Run the program.
8. In a few seconds, you should see an error box
come up that says
Failed to read from device:
FILE (C:\Program Files\Analog Devices\Visual DSP\21xx\Examples\Example2\Serin.dat, Binary)
Note: This means that the Debugger has reached the end of the file. Check the contents of your output file to determine if the talkthru simulation executed properly. You should see the same values in serout.dat as those in serin.dat.
EE-92 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
Loading...