Texas Instruments TLV1562 User Manual
Page 93
Software Overview
87
Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP
; .setsect ”.vectors”, 0x00180,0 ; sections of code
; .setsect ”.text”, 0x00200,0 ; these assembler directives specify
; .setsect ”.data”, 0x01800,1 ; the absolute addresses of different
; .setsect ”.variabl”, 0x01800,1 ; sections of code
.sect ”.vectors”
.copy ”vectors.asm”
.sect ”.data”
.copy
”constant.asm”
AD_DP .usect ”.variabl”, 0 ;
ACT_CHANNEL .usect ”.variabl”, 1 ; jump address to init. new channel
ADWORD .usect ”.variabl”, 1 ; send–bytes to the ADC
ADCOUNT .usect ”.variabl”, 1 ; counter for one channel
ADMEM .usect ”.variabl”, 1 ; points to act. memory save location
CH_NO .usect ”.variabl”, 1 ; channel number 1 to 4
CR0_SEND .usect ”.variabl”, 1 ; the last value, sent to register CR0
CR1_SEND .usect ”.variabl”, 1 ; the last value, sent to register CR1
CR_PROBLEM .usect ”.variabl”, 1 ; problem with initialization of this mode
when repeated (reset)
ZERO .usect ”.variabl”, 1 ; the value zero to send
TEMP .usect ”.variabl”, 1 ; temporary variable
isr_save .usect ”.variabl”, 1 ; memory location to save AR7 during
; interrupts
ADSAMPLE .usect ”.variabl”,1 ; last read sample
* Address Decoder constants:
ADC .set 00002h ; activate A0 when TLV1562 is choosen
CSTART .set 00001h ; activate A1 when CSTART is choosen
DAC1 .set 00003h ; activate A2 when DAC1 is choosen
DEACTIVE .set 00000h ; deactivate the address lines A0, A1 and A2
.def _TLV1562
.sect ”.text”
START:
INITIALIZATION:
_TLV1562:
data(ADMEM) = *SP(1) ; read saving location
data(ADCOUNT) = *SP(2) ; read number of samples
push(AR6) ; save AR6
push(AR7) ; save AR7
CPL = #0 ; do DP pointer addressing
* sign extension mode, ini Stack
SXM = 0 ; no sign extension mode
* reset pending IRQs
IFR = #1 ; reset any old interrupt on pin INT0