8
Analog Interface
8 – 13
{ ADSP-21msp58/59 Analog Interface Loopback Example
}
{ - configures analog interface
}
{ - copies ADC receive data to DAC transmit buffer}
.MODULE/ABS=0/BOOT=0 talkthru;
#define
codec_tx_data
0x3FEC
#define
codec_rx_data
0x3FED
#define
codec_ctrl_reg 0x3FEE
resetv:
JUMP setup; NOP; NOP; NOP;
irq2v:
RTI; NOP; NOP; NOP;
{interrupt vectors ...}
hipwv:
RTI; NOP; NOP; NOP;
hiprv:
RTI; NOP; NOP; NOP;
spt0tv:
RTI; NOP; NOP; NOP;
spt0rv:
RTI; NOP; NOP; NOP;
antv:
RTI; NOP; NOP; NOP;
anrv:
SI = DM(codec_rx_data);
{read in data from ADC}
DM(codec_tx_data) = SI;
{write out data to DAC}
RTI; NOP;
irq1v:
RTI; NOP; NOP; NOP;
irq0v:
RTI; NOP; NOP; NOP;
timerv:
RTI; NOP; NOP; NOP;
pwrdwnv:
RTI; NOP; NOP; NOP;
setup:
AX1 = 0x0060;
DM(codec_ctrl_reg) = AX1;
{power up analog interface}
IMASK = 0x8;
{enable analog receive interrupt}
wait_loop:
IDLE;
{wait for interrupt}
JUMP wait_loop;
.ENDMOD;
Listing 8.1 ADSP-21msp58/59 Analog Loopback Program
8.4.3.2 Autobuffering Enabled
In some applications it is advantageous to perform block data transfers
between the analog converters and processor memory. Analog
interface autobuffering allows you to automatically transfer blocks of
data from the ADC to on-chip processor data memory or from on-chip
processor data memory to the DAC.
An interrupt is generated when an entire block transfer is complete (i.e.
when the data buffer is full or empty). Analog interface autobuffering
operates in the same way as SPORT autobuffering, described in
Chapter 5. Note that data can be autobuffered through the analog
converters or through SPORT0 of the ADSP-21msp58/59.
Autobuffering is not available on SPORT1 of the ADSP-21msp58/59.