AD73322
–36–
REV. B
The circular buffer approach can be useful if a long initialization
sequence is required. The list of initialization words is put into
the buffer in the required order.
.VAR/DM/RAM/CIRC init_cmds[16]; {Codec init sequence}
.VAR/DM/RAM stat_flag;
.INIT init_cmds:
b # 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 ,
b # 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 ,
b # 1 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 ,
b # 1 0 0 0 0 0 1 0 1 1 1 1 1 0 0 1 ,
b # 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 ,
b # 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 ,
b # 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 ;
and the DSP program initializes pointers to the top of the buffer
i3 = ^init_cmds; l3 = %init_cmds;
and puts the first entry in the DSP’s transmit buffer so that it is
available at the first SDOFS pulse.
ax0 = dm(i3,m1);
tx0 = ax0;
The DSP’s transmit interrupt is enabled.
imask = b#0001000000;
At each occurrence of an SDOFS pulse, the DSP’s transmit
buffer contents are sent to the SDI pin of the AD73322. This
also causes a subsequent DSP Tx interrupt which transfers the
initialization word, pointed to by the circular buffer pointer, to
the Tx buffer. The buffer pointer is updated to point to the next
unsent initialization word. When the circular buffer pointer
wraps around which happens after the last word has been ac-
cessed, it indicates that the initialization phase is complete. This
can be done “manually” in the DSP using a simple address
check or autobuffered mode can be used to the complete trans-
fer automatically.
txcdat: ar = dm(stat_flag);
ar = pass ar;
if eq rti;
ena sec_reg;
ax0 = dm (i3, m1);
tx0 = ax0;
ax0 = i3;
ay0 = ^init_cmds;
ar = ax0 - ay0;
if gt rti;
ax0 = 0x00;
dm (stat_flag) = ax0;
rti;
In the main body of the program, the code loops waiting for the
initialization sequence to be completed.
check_init:
ax0 = dm (stat_flag);
af = pass ax0;
if ne jump check_init;
As the AD73322 is effectively a cascade of two codec units, it is
important to observe some restrictions in the sequence of send-
ing initialization words to the two codecs. It is preferable to send
pairs of control words for the corresponding control registers in
each codec and it is essential to send the control word for codec
2 before that for codec 1. Control Registers A and B contain
settings, such as sampling rate, serial clock rate etc., which
critically require synchronous update in both codecs.
Once the device has been initialized, Control Register A on both
codecs is written with a control word which changes the operat-
ing mode from Program Mode to either data mode or Mixed
Control Data Mode. The device count field which defaults to
000b will have to be programmed to 001b for a single AD73322
device. In data mode or mixed mode, the main function of the
device is to return ADC samples from both codecs and to accept
DAC words for both codecs. During each sample interval two
ADC samples will be returned from the device while in the same
interval two DAC update samples will be sent to the device. In
order to reduce the number of interrupts and to reduce com-
plexity, autobuffering can be used to ensure that only one inter-
rupt is generated during each sampling interval.
AD73322
–37–REV. B
APPENDIX A
DAC Timing Control Example
The AD73322’s DAC is loaded from the DAC register contents
just before the ADC register contents are loaded to the serial
register (SDOFS going high). This default DAC load position
can be advanced in time to occur earlier with respect to the
SDOFS going high. Figure 45 shows an example of the ADC
unload and DAC load sequence. At time t
1
the SDOFS is raised
to indicate that a new ADC word is ready. Following the SDOFS
pulse, 16 bits of ADC data are clocked out on SDO in the sub-
sequent 16 SCLK cycles finishing at time t
2
where the DSP’s
SPORT will have received the 16-bit word. The DSP may
process this information and generate a DAC word to be sent to
SE
SCLK
SDOFS
SDO
SDIFS
DATA REGISTER
UPDATE
DAC LOAD
FROM DAC REGISTER
t
1
t
2
t
3
t
4
t
6
t
5
ADC WORD
SDI
DAC WORD
Figure 43. DAC Timing Control
the AD73322. Time t
3
marks the beginning of the sequence of
sending the DAC word to the AD73322. This sequence ends at
time t
4
where the DAC register will be updated from the 16 bits
in the AD73322’s serial register. However, the DAC will not be
updated from the DAC register until time t
5
, which may not be
acceptable in certain applications. In order to reduce this delay
and load the DAC at time t
6
, the DAC advance register can be
programmed with a suitable setting corresponding to the
required time advance (refer to Table XI for details of DAC
Timing Control settings).
AD73322
–38–
REV. B
APPENDIX B
Configuring an AD73322 to Operate in Data Mode
1
This section describes the typical sequence of control words
that are required to be sent to an AD73322 to set it up for data
mode operation. In this sequence Registers B, C and A are
programmed before the device enters data mode. This descrip-
tion panel refers to Table XXIII.
At each sampling event, a pair of SDOFS pulses will be ob-
served which will cause a pair of control (programming) words
to be sent to the device from the DSP. It is advisable that each
pair of control words should program a single register in each
Channel. The sequence to be followed is Channel 2 followed by
Channel 1.
In Step 1, we have the first output sample event following de-
vice reset. The SDOFS signal is raised on both channels
2
simul-
taneously, which prepares the DSP Rx register to accept the
ADC word from Channel 2, while SDOFS from Channel 1
becomes an SDIFS to Channel 2. As the SDOFS of Channel 2
is coupled to the DSP’s TFS and RFS, and to the SDIFS of
Channel 1, this event also forces a new control word to be out-
put from the DSP Tx register to Channel 1
3
.
In Step 2, we observe the status of the channels following the
transmission of the first control word. The DSP has received
the output word from Channel 2, while Channel 2 has received
the output word from Channel 1. Channel 1 has received the
Control word destined for Channel 2. At this stage, the SDOFS
of both channels are again raised because Channel 2 has received
Channel 1’s output word, and as it is not a valid control word
addressed to Channel 2, it is passed on to the DSP. Likewise,
Channel 1 has received a control word destined for Channel
2—address field is not zero—and it decrements the address field
of the control word and passes it on.
Step 3 shows completion of the first series of control word
writes. The DSP has now received both output words and each
channel has received a control word that addresses control
register B and sets the internal MCLK divider ratio to 1, SCLK
rate to DMCLK/2 and sampling rate to DMCLK/256. Note
that both channels are updated simultaneously as both receive
the addressed control word at the same time. This is an impor-
tant factor in cascaded operation as any latency between updat-
ing the SCLK or DMCLK of channels can result in corrupted
operation. This will not happen in the case of an FSLB configu-
ration as shown here, but must be taken into account in a non-
FSLB configuration. One other important observation of this
sequence is that the data words are received and transmitted in
reverse order, i.e., the ADC words are received by the DSP,
Channel 2 first, then Channel 1 and, similarly, the transmit
words from the DSP are sent to Channel 2 first, then to Chan-
nel 1. This ensures that all channels are updated at the same time.
Steps 4–6 are similar to Steps 1–3 but, instead, program Control
Register C to power-up the analog sections of the device (ADCs,
DACs and reference).
Steps 7–9 are similar to Steps 1–3 but, instead, program Control
Register A, with a device count field equal to two channels in
cascade and sets the PGM/DATA bit to one to put the channel
in data mode.
In Step 10, the programming phase is complete and we now
begin actual channel data read and write. The words loaded into
the serial registers of the two channels at the ADC sampling
event now contain valid ADC data and the words written to the
channels from the DSP’s Tx register will now be interpreted as
DAC words. The DSP Tx register contains the DAC word for
Channel 2.
In Step 11, the first DAC word has been transmitted into the
cascade and the ADC word from Channel 2 has been read from
the cascade. The DSP Tx register now contains the DAC word
for Channel 1. As the words being sent to the cascade are now
being interpreted as 16-bit DAC words, the addressing scheme
now changes from one where the address was embedded in the
transmitted word, to one where the serial port now counts the
SDIFS pulses. When the number of SDIFS pulses received
equals the value in the channel count field of Control Register
A, the length of the cascade—each channel updates its DAC
register with the present word in its serial register. In Step 11
each channel has received only one SDIFS pulse; Channel 2
received one SDIFS from the SDOFS of Channel 1 when it sent
its ADC word, and Channel 1 received one SDIFS pulse when
it received the DAC word for Channel 2 from the DSP’s Tx regis-
ter. Therefore, each channel raises its SDOFS line to pass on the
current word in its serial register, and each channel now receives
another SDIFS pulse.
Step 12 shows the completion of an ADC read and DAC write
cycle. Following Step 11, each channel has received two SDIFS
pulses that equal the setting of the channel count field in Con-
trol Register A. The DAC register in each channel is now up-
dated with the contents of the word that accompanied the SDIFS
pulse that satisfied the channel count requirement. The internal
frame sync counter is now reset to zero and will begin counting
for the next DAC update cycle.
Steps 10–12 are repeated on each sampling event.
NOTES
1
Channel 1 and Channel 2 of the description refer to the two AFE sections of
the AD73322 device.
2
The AD73322 is configured as two channels in cascade. The internal cascade
connections between Channels 1 and 2 are detailed in Figure 14. The connec-
tions SDI/SDIFS are inputs to Channel 1 while SDO/SDOFS are outputs from
Channel 2.
3
This sequence assumes that the DSP SPORT’s Rx and Tx interrupts are
enabled. It is important to ensure that there is no latency (separation) between
control words in a cascade configuration. This is especially the case when
programming Control Registers A and B as they must be updated synchro-
nously in each channel.

AD73322LARUZ

Mfr. #:
Manufacturer:
Analog Devices Inc.
Description:
Analog Front End - AFE Dual-Ch 3V Front-End Processor
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet