Engineer To Engineer Note EE-2
Notes on using Analog Devices’ DSP, audio, & video components from the Computer Products Division
Phone: (800) ANALOG-D or (781) 461-3881, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com
Using ADSP-218x I/O Space
Last modified 11/08/96
Introduction
Digital Signal Processors (DSPs) are often chosen by
designers performing arithmetic operations on binary data.
DSPs perform many common signal processing
algorithms, such as filtering or fast fourier transforms on
input digitized data, more economically than
corresponding analog circuits. The information that the
DSP processes usually comes from an analog-to-digital
converter, which represents the real-world value as a
binary number. After processing by the DSP, the output
goes through a digital-to-analog converter, which provides
a continuous signal that is useful for real-world feedback.
This data flow appears in Figure 1. Because real-world
signal I/O can be an important part of DSP system
operations, I/O between the DSP and converters is a major
design issue when developing a DSP system.
External
Signal
A/D
Converter
DSP
ADSP-2181
D/A
Converter
Ext
Signal
ADSP-218x DSPs, however, differs from other processors
of the ADSP-21xx family with regard to memory mapped
I/O. Unlike other members of this DSP family (which
required memory-mapped peripherals be connected to PM
or DM spaces), ADSP-218x DSPs have their own
separate I/O space. For managing I/O space access,
ADSP-218x DSPs have an extra memory select line
/IOMS. The ADSP-218x DSPs’ I/O Space allows access
to up to 2048 locations of 16-bit data. This space should
be used to communicate with parallel devices such as data
converters, external registers, or latches. This additional
select line lets this DSP perform parallel-peripheral I/O
without the additional decoding hardware that is required
by other ADSP-21xx family DSPs.
Before describing how to use and ADSP-218x DSP’s I/O
space, it would be useful to review some I/O space
features. ADSP-218x DSP I/O space has the following
features:
• Provides directly-addressed locations
• Supports 16-bit transfers
• Has four waitstate ranges with 512 locations each
• Includes a dedicated I/O select line, /IOMS
Figure 1 - DSP Data Flow
There are two methods for sending digitized information to
a DSP. One method is serial communication. All Analog
Devices ADSP-2100 family DSPs have synchronous
serial communication ports (SPORTs). These SPORTs
let you connect many types of serial-converters directly to
the DSP.
The other communications method is to connect the
converter as a parallel I/O source. On most ADSP-2100
family DSPs, parallel I/O is available by connecting the
converter as a memory-mapped peripheral in the DSP’s
Program Memory or Data Memory Spaces. But, memory
mapped I/O on these DSPs does require some interface
hardware to manage the input from the converter.
• And, the ADSP-218x DSP’s assembly language has
syntax that supports this I/O space:
Dreg = IO(address);
! Reads from an IO address
IO(address) = Dreg;
! Writes to an IO address
This engineer’s note explains how to set up and use
parallel I/O with an ADSP-218x DSP’s I/O space and port
your existing ADSP-21xx code to take advantage of this
I/O space. Using this space in your design lets you
eliminate the external address decoding for parallel
peripherals, which is required for other ADSP-21xx family
DSPs, because you can use the ADSP-218x DSP’s
dedicated I/O select line, /IOMS, during I/O space
accesses.
Porting ADSP-21xx Code To Take
Advantage Of ADSP-218x I/O Space
If you are porting your ADSP- 21xx family DSP design
to an ADSP-218x DSP, you must make some changes to
your source code and architecture file for the I/O space
device to communicate with the DSP correctly. If your
current design uses an ADSP-2101, your system file
includes a declaration for a data memory-mapped I/O port.
For example (using Release 5.x development software
tools), the system file in listing 1 shows how to define a
port at address 0x0100.
.SYSTEM some_example;
.ADSP2101;
.MMAP0;
.SEG/PM/RAM/ABS=0x0000/CODE/DATA int_pm[2048];
.SEG/PM/RAM/ABS=0x800/CODE/DATA ext_pm[14336];
.SEG/DM/RAM/ABS=0x0000/DATA ext_dm1[256];
.PORT/DM/ABS=0x0100 some_port;
.SEG/DM/RAM/ABS=0x0101/DATA ext_dm2[14079];
.SEG/DM/RAM/ABS=0x3800/DATA int_dm[1024];
.ENDSYS;
Listing 1 - ADSP-2101 System File
From this file, you create your architecture file created
using the command (in DOS):
bld21 my_2101.sys
The output of this command results in Listing 2.
$SOME_EXAMPLE
$ADSP2101
$MMAP0
$0000 07FF paxINT_PM t
$0800 3FFF paxEXT_PM t
$0000 00FF dadEXT_DM1 t
$0100 0100 dapSOME_PORT t
$0101 37FF dadEXT_DM2 t
$3800 3BFF dadINT_DM t
$
Listing 2 - ADSP-2101 Architecture File
In the main module of your ADSP-2101 source program,
your code accesses a port using the assembly language
directives and instructions in Listing 3.
.MODULE/SEG=int_pm/RAM/ABS = 0 test;
.PORT some_port;
JUMP start; RTI;NOP;NOP;
RTI;NOP;NOP;NOP;
RTI;NOP;NOP;NOP;
RTI;NOP;NOP;NOP;
RTI;NOP;NOP;NOP;
RTI;NOP;NOP;NOP;
RTI;NOP;NOP;NOP;
start: ar = 0x0100;
dm(some_port) = ar;
nop;
.ENDMOD;
Listing 3 - ADSP-2101 Memory Mapped I/O Code
To port Listings 2 and 3 so that they can work on an
ADSP-218x, you must modify your source files. Use the
following steps:
1. Remove all instances of the .PORT directive from
your system builder file
2. Use the IO command in your source programs to
write to or read from this port address
So, your new system file, new_218x.sys, looks like
Listing 4.
.SYSTEM some_example;
.ADSP218x;
.MMAP0;
.SEG/PM/RAM/ABS=0x0000/CODE/DATA
int_pm[16384];
.SEG/DM/RAM/ABS=0x0000/DATA int_dm[16384];
.ENDSYS;
Listing 4 - ADSP-218x System File
EE-2 Page 2
Notes on using Analog Devices’ DSP, audio, & video components from the Computer Products Division
Phone: (800) ANALOG-D or (781) 461-3881, FAX: (781) 461-3010, EMAIL: dsp.support@analog.com