.if (INT0_DRIVENPOLLING_DRV)

Software Overview

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

 

 

 

.if (INT0_DRIVENPOLLING_DRV)

 

 

* reset pending IRQs

 

 

 

 

 

 

IFR

= #1

; reset any old interrupt on pin INT0

.endif

 

 

 

.if INT0_DRIVEN

*enable Interrupt INT0 DP = #0

@IMR = #01

; allow INT0

.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

.if POLLING_DRV

 

 

 

AR5

= #(IFR)

 

; AR5 points to the IFR register (only for polling mode)

.endif

 

 

 

 

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_INTSINGLE_ENDCLK_INTERNALNO_CALIB_OP);

@CR1_SEND = #(NO_SW_PWDNNO_AUTO_PWDNNO_2COMPLEMENTNO_DEBUGRES_10_BITCST_CONV_START);

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

*this next steps 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

Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP

61

Page 67
Image 67
Texas Instruments TLV1562 manual Software Overview, endif, if INT0DRIVENPOLLINGDRV, if POLLINGDRV, if R8BITRESOLUT