Software Overview
84
SLAA040
@SWWSR = #07000h ; one I/O wait states
DP = #AD_DP ;
*******************************************
* ADC_dual_con_Start:
* read samples and store them into memory
*******************************************
ADC_dual_con_Start:
repeat(#12)
NOP ; wait for t(SAMPLES) (450ns)
STEP6: @CH1_ADSAMPLE = port(ADC) ; read the new sample into the DSP
STEP7: repeat(#20)
NOP ; wait for t(CONV1) (about 800ns)
STEP10: @CH2_ADSAMPLE = port(ADC); read the new sample into the DSP
* IMPORTANT: fine–tune the counter number of the next repeat loop in order
* to achive maximum throughput related to the delay of the store instructions
STEP11: repeat(#7)
NOP ; wait for t(CONV1) (about 800ns)
STEP12: call STORE ; store the last sample into the table
goto STEP6 ; go back to receive next sample
**********************************
* STORE:
* saving the samples into memory
**********************************
STORE:
.if (SEND_OUT_PARALLEL)
* store sample into the parallel buffer location if choosen
port(DAC1) = @CH1_ADSAMPLE ; update DAC output with sample one
.endif
.if SAVE_INTO_MEMORY
* store new sample into DSP data memory
*AR7+ = data(@CH1_ADSAMPLE) ; write last sample of channel 1 into memory table
*AR6+ = data(@CH2_ADSAMPLE) ; write last sample of channel 2 into memory table
.endif
.if SEND_OUT_SERIAL
* store sample into the serial buffer location
DP = #00000h ; point to page zero
TC = bitf(@SPC,#01000h) ; test, is the XRDY Bit in SPC=1?
if (TC) goto SEND_SERIAL_END ; don’t send something until XDR is empty
; this has been included because the serial DAC TLC5618A is not able to understand
; endless data–streem (the CS should not become high before end of sending
; the 16th bit)
DP = #AD_DP ; reset Data page pointer to variables
A = @ADSAMPLE<<2 ; leftshift of the sample for a 12 bit format
Содержание TLV1562
Страница 6: ...vi SLAA040 ...