.endif

Software Overview

* reset pending IRQs

 

 

 

 

 

 

 

 

 

 

IFR

= #1

; reset any old interrupt on pin INT0

.endif

 

 

 

 

 

.if INT0_DRIVEN

 

 

 

 

* enable Interrupt INT0

 

 

 

 

 

 

 

 

 

@IMR

= #01

; allow INT0

.endif

 

 

 

 

 

*enable global interrupt (this is required even 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_BITRD_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

.elseif (R4BIT_RESOLUT)

 

@CR1_SEND ^= #RES_10_BIT

; clear bit for 10–Bit Resolution

@CR1_SEND = #RES_4_BIT

; set 8–Bit conversion mode

.endif

 

.if (EXTERNAL_CLOCK)

 

@CR0_SEND ^= #CLK_INTERNAL

; clear CLK_INTERNAL bit if one

@CR0_SEND = #CLK_EXTERNAL

; set CLK_EXTERNAL mode

.endif

 

Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP

49

Page 55
Image 55
Texas Instruments manual Software Overview, endif, Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP