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.
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.
Listing 8 - ADSP-218x C Code For Variable I/O Space
Access
The code in Listing 8 pipes the value of a C variable
myvar to I/O port at address 0x0100. Note that the
variable is declared globally to make it accessible to the
assembly code. It is also necessary to declare the variable
as an external before trying to access it. Finally, note the
choice of the ax0 register to store the value. This register
is regarded as a scratch register by the C compiler and is
hence safe to use.
I/O simulation
One of the main features of the I/O ports in the ADSP218x simulator is transferring input data to a simulated
I/O port from a data file and redirecting output data to a
data file. To simulate port I/O with file I/O, choose the
following within the simulator:
Memory
Port Display
Open
Use these menu options, as shown in Figure 2, to open
the simulator’s Port Open menu. You must select the IO
option inside the Port Open Menu, selecting PM or DM
causes an error.
Once you have set up the data files names and clicked Yes
in the Accept Port Configuration field, you can
execute or step through the dummy instructions in the
Program Memory Window, also shown in Figure 2. It is
important to note that the value that is displayed at the IO
memory address location 0x0100 in the I/O memory
window maybe inaccurate. It is possible, however, to
verify the correctness of the data that is actually written to
the I/O port by exiting/quitting the simulator and looking
at the out.dat data file (shown in Listing 9).
C:\PROJECTS>type out.dat
0100
C:\PROJECTS>
Listing 9 - Viewing The OUT.DAT File (In DOS)
You can similarly use in-line assembly to direct a value
from an I/O port into a C variable.
EE-2Page 4
Notes on using Analog Devices’ DSP, audio, & video components from the Computer Products Division