AD1940/AD1941
Rev. B | Page 19 of 36
RAMS AND REGISTERS
Table 17. Control Port Addresses
SPI/ I
2
C Subaddress Register Name Read/Write Word Length
0–1023 (0x0000–0x03FF) Parameter RAM Write: 4 bytes, read: 4 bytes
1024–2559 (0x0400–0x09FF) Program RAM Write: 5 bytes, read: 5 bytes
2560–2623 (0x0A00–0x0A3F) Target/Slew RAM Write: 5 bytes, read: n/a
2624–2628 (0x0A40–0x0A44) Parameter RAM Data Safeload Registers 0–4 Write: 5 bytes, read: n/a
2629–2633 (0x0A45–0x0A49) Parameter RAM Indirect Address Safeload Registers 0–4 Write: 2 bytes, read: n/a
2634–2639 (0x0A4A–0x0A4F) Data Capture Registers 0–5 (Control Port Readback) Write: 2 bytes, read: 3 bytes
2640–2641 (0x0A50–0x0A51) Data Capture Registers (Digital Output) Write: 2 bytes, read: n/a
2642 (0x0A52) DSP Core Control Register Write: 2 bytes, read: 2 bytes
2643 (0x0A53) RAM Configuration Register Write: 1 byte, read: 1 byte
2644 (0x0A54) Serial Output Control Register 1 (Channels 0–7) Write: 2 bytes, read: 2 bytes
2645 (0x0A55) Serial Output Control Register 2 (Channels 8–15) Write: 2 bytes, read: 2 bytes
2646 (0x0A56) Serial Input Control Register Write: 1 byte, read: 1 byte
Table 18. RAM Read/Write Modes
Memory Size
Subaddress
Range Read Write
Burst Mode
Available Write Modes
Parameter RAM 1024 × 28
0–1023
(0x0000–0x03FF)
Yes Yes Yes Direct write
1
or safeload write
Program RAM 1536 × 40
1024–2559
(0x0400–0x09FF)
Yes Yes Yes Direct write
1
Target/Slew RAM 64 × 34
2560–2623
(0x0A00–0x0A3F)
No
Yes (via
safeload)
Yes
2
Safeload write
1
DSP core should be shut down first to avoid clicks/pops.
2
The target/slew RAMs need to be written through the safeload registers. Safeload writes may be done in either single write mode or burst mode.
CONTROL PORT ADDRESSING
Table 1 7 shows the addressing of the AD1940/AD1941’s RAM
and register spaces. The address space encompasses a set of
registers and three RAMs: one each for holding signal
processing parameters, holding the program instructions, and
ramping parameter values. The program and parameter RAMs
are initialized on power-up from on-board boot ROMs.
Table 1 8 shows the sizes and available writing modes of the
parameter, program, and target/slew RAMs.
PARAMETER RAM CONTENTS
The parameter RAM is 28 bits wide and occupies Addresses 0 to
1023. The parameter RAM is initialized to all 0s on power-up.
The data format of the parameter RAM is twos complement
5.23. This means that the coefficients may range from +16.0
(minus 1 LSB) to –16.0, with 1.0 represented by the binary word
0000 1000 0000 0000 0000 0000 0000.
Options for Parameter Updates
The parameter RAM can be written and read using one of the
two following methods.
1. Direct Read/Write. This method allows direct access to
the program and parameter RAMs. This mode of operation
is normally used during a complete new load of the RAMs,
using burst mode addressing. The clear register bit in the
core control register should be set to 0 using this mode to
avoid any clicks or pops in the outputs. Note that it is also
possible to use this mode during live program execution,
but since there is no handshaking between the core and the
control port, the parameter RAM is unavailable to the DSP
core during control writes, resulting in clicks and pops in
the audio stream.
2. Safeload Write. Up to five safeload registers can be loaded
with parameter RAM address/data. The data is then
transferred to the requested address when the RAM is not
busy. This method can be used for dynamic updates while
live program material is playing through the AD1940/
AD1941. For example, a complete update of one biquad
section can occur in one audio frame, while the RAM is
not busy. This method is not available for writing to the
program RAM or control registers.
The following sections discuss these two options in more detail.
AD1940/AD1941
Rev. B | Page 20 of 36
RECOMMENDED PROGRAM/PARAMETER
LOADING PROCEDURES
When writing large amounts of data to the program or para-
meter RAM in direct write mode, the processor core should be
disabled to prevent unpleasant noises from appearing at the
audio output. The AD1940/AD1941 contain several
mechanisms for disabling the core.
If the loaded program does not use the target/slew RAM as the
main system volume control (for example, the default power-up
program),
1. Assert Bit 9 (low to assert—default setting) and Bit 6 (high
to assert) of the core control register. This zeroes the
accumulators, the serial output registers, and the serial
input registers.
2. Fill the program RAM using burst mode writes.
3. Fill the parameter RAM using burst mode writes.
4. Assert Bit 7 of the core control register to initiate a data-
memory clear sequence. Wait at least 100 μs for this
sequence to complete. This bit is automatically cleared after
the operation is complete.
5. Deassert Bit 9 and Bit 6 of the core control register to allow
the core to begin normal operation
If the loaded program does use the target/slew RAM as the
main system volume control,
1. Assert Bit 12 of the core control register. This begins a
volume ramp down, with a time constant determined by
the upper bits of the target RAM. Wait for this ramp down
to complete (the user may poll Bit 13 of the core control
register, or simply wait for a given amount of time).
2. Assert Bit 9 (low to assert) and Bit 6 (high to assert) of the
core control register. This zeroes the accumulators, the
serial output registers, and the serial input registers.
3. Fill the program RAM using burst mode writes.
4. Fill the parameter RAM using burst mode writes.
5. Assert Bit 7 of the core control register to initiate a data-
memory clear sequence. Wait at least 100 μs for this
sequence to complete. This bit is automatically cleared after
the operation is complete.
6. Deassert Bit 9 and Bit 6 of the core control register.
7. If the newly loaded program also uses the target/slew
RAM, deassert Bit 12 of the core control register to begin a
volume ramp up procedure.
TARGET/SLEW RAM
The target/slew RAM is a bank of 64 RAM locations, each of
which can be set to autoramp from one value to a desired final
value in one of four modes.
Summary
The target/slew RAM is used by the DSP when a program is
loaded into the program RAM that uses one or more locations
in the slew RAM to access internal coefficient data. Typically,
these coefficients are used for volume controls or smooth cross-
fading effects, but may be used to update any value in the para-
meter RAM. Each of the 64 locations in the slew RAM are
linked to corresponding locations in the target RAM. When a
new value is written to the target RAM using the control
port, the corresponding slew RAM location begins to ramp
toward the target. The value is updated once per audio frame
(LRCLK period).
The target RAM is 34 bits wide. The lower 28 bits contain the
target data in 5.23 format for the linear and exponential
(constant dB and RC type) ramp types. For constant time
ramping, the lower 28 bits contain 16 bits in 2.14 format and
12 bits to set the current step. The upper six bits are used to
determine the type and speed of the ramp envelope in all
modes. The format of the data write for linear and exponential
formats is shown in Table 19. Table 20 shows the data write
format for the constant time ramping.
Data can only be written to the target/slew RAM using the
safeload registers as described in the Safeload Registers section.
A mute slew RAM bit is included in the core control register to
simultaneously set all the slew RAM target values to 0. This is
useful for implementing a global multichannel mute. When this
bit is deasserted, all slew RAM values return to their original
premuted states.
Table 19. Linear, Constant dB, and RC Type
Ramp Data Write
Byte 0 Byte 1 Bytes 2–4
000000, curve_type [1:0]
time_const [3:0],
data [27:24]
Data [23:0]
Table 20. Constant Time Ramp Data Write
Byte 0 Byte 1 Bytes 2–4
000000,
curve_type [1:0]
update_step [0],
#_of_steps [2:0], data
[15:12]
Data [11:0],
reserved [11:0]
AD1940/AD1941
Rev. B | Page 21 of 36
The four ramping curve types are
Linear—Value slews to target using a fixed step size.
Constant dB—Value slews to target using the current value
to calculate the step size. The resulting curve has a
constant rise and decay when measured in dB.
RC type—Value slews to target using the difference
between target and current values to calculate the step size,
producing a simple RC type curve for rising and falling.
Constant Time—Value slews to the target in a fixed
number of steps in a linear fashion. The control port mute
has no affect on this type.
Table 21. Target/Slew RAM Ramp Type Settings
Setting Ramp Type
00 Linear
01 Constant dB
10 RC type
11 Constant time
The following sections detail how the control port writes to
the target/slew RAM to control the time constant and ramp
type parameters.
Ramp Types 1 to 3: Linear, Constant dB, RC Type (34-Bit
Write)
The target word for the first three ramp types is broken up into
three parts. The 34-bit command is written with six leading 0s
to extend the data write to five bytes. The parts of the target
RAM write are the following:
Ramp Type (2 bits)
Time Constant (4 bits)
0000 = Fastest
1111 = Slowest
Data (28 Bits): 5.23 Format
Ramp Type 4—Constant Time (34-Bit Write)
The target word for the constant time ramp type is written in
five parts, with the 34-bit command again written with six
leading zeros to extend the data write to five bytes. The parts of
the constant time target RAM write are the following:
Ramp Type (2 bits).
Update Step (1 bit). Set to 1 when new target is loaded to
trigger step value update. Value is automatically reset after
the step value is updated.
Number of Steps (3 bits). The number of steps that it takes
to slew to the target value is set by these three bits, with the
number of steps equal to 2
3-bit setting + 6
.
000 = 64
001 = 128
010 = 256
011 = 512
100 = 1024
101 = 2048
110 = 4096
111 = 8196
Data (16 bits). 2.14 format.
Reserved (12 bits). When writing to the RAM, these bits
should all be set to 0.
Target and Slew RAM Initialization
On reset, the target/slew RAM initializes to preset values. The
target RAM initializes to a linear ramp type with a time
constant of 5 and the data set to 1.0. The slew RAM initializes to
a value of 1.0. These defaults give a full-scale (1.0 to 0.0) ramp
time of 21.3 ms.
Linear Update Math
Linear math is the addition or subtraction of a constant value
(step). The equation to describe this step size is
()
20
10
13
52
2
×
=
tconst
step
The result of the equation is normalized to a 5.23 data format.
This gives a time constant range from 6.75 ms to 213.4 ms
(–60 dB relative to 0 dB full scale). An example of this kind of
update is shown in Figure 15 and Figure 16. All slew RAM
figure examples, except the half-scale constant time ramp plot,
show an increasing or decreasing ramp between –80 dB and
0 dB (full scale). All figures except the constant time plots
(Figure 19 and Figure 21) use a time constant of 0x7 (0x0 being
the fastest and 0xF being the slowest).
TIME (ms)
OUTPUT LEVEL (V)
1
0.4
0.6
0.8
0.2
0
–0.4
–0.2
–1
–0.8
–0.6
0102030
04607-0-017
Figure 15. Slew RAM—Linear Update Increasing Ramp

AD1940YSTZ

Mfr. #:
Manufacturer:
Analog Devices Inc.
Description:
Audio DSPs IC 28-Bit Audio Processor
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union