82SLAA040

Software Overview

repeat(#num_data_A–1)

 

data(data_loc_A) = @TEMP

; fill memory table 1

repeat(#num_data_B–1)

 

data(data_loc_B) = @TEMP

; fill memory table 2

repeat(#num_data_C–1)

 

data(data_loc_C) = @TEMP

; fill memory table 3

repeat(#num_data_D–1)

 

data(data_loc_D) = @TEMP

; fill memory table 4

.if SEND_OUT_SERIAL

******************************************************************************

*SERIAL_DAC_INI:

*initialize the serial interface to send out the samples for the serial DAC

*set up the serial interface for a DSP–DAC (5618A) conversation

*initialize the SPI interface and the DAC

*the serial interface will be updated with the last sample if the serial

*buffer is empty (after the last bit has been sent)

******************************************************************************

SERIAL_DAC_INI:

BSPI_INI:

 

 

DP

= #0

 

@BSPC

= #00038h

; reset SPI

@BSPCE

= #00101h

; set clock speed, no Autobuffer Mode

@BSPC

= #0C078h

; start serial port

.endif

*enable global interrupt (this is even required, if no IRQ routine is used

*by this program because the GoDSP debugger needs to do its backgroud interrupts)

INTM

=

0

; enable global IRQ

* initialize storage table for the ADC samples

AR7

= #(data_loc_A)

; point to first date location of the storage table

AR0

= #(num_data_A+data_loc_A) ; AR0 points to table end

DP

= #AD_DP

;

@ADCOUNT= #(num_data_A)

; initialize ADCOUNT with the number of required samples

DP

= #AD_DP

 

@ZERO

= #00000

; set the dummy send value

*initialize the send values to set–up the two programmable register of the ADC @CR0_SEND = #(CH1MONO_CONTINUOUSSINGLE_ENDCLK_INTERNALNO_CALIB_OP);

@CR1_SEND = #(NO_SW_PWDNNO_AUTO_PWDNNO_2COMPLEMENTNO_DEBUGRES_10_BITRD_CONV_START);

*change some of the possible modes by variation of the bit setting in the file header

*this next step can be erased, if the user is running in only one special configuration

.if (R8BIT_RESOLUT)

@CR1_SEND ^= #RES_10_BIT ; clear bit for 10–Bit Resolution

@CR1_SEND = #RES_8_BIT

; set 8–Bit conversion mode

.elseif (R4BIT_RESOLUT)

82SLAA040

Page 88
Image 88
Texas Instruments TLV1562 manual Software Overview, if SENDOUTSERIAL, endif, if R8BITRESOLUT, elseif R4BITRESOLUT, SLAA040