beautypg.com

Texas Instruments TLV1562 User Manual

Page 87

background image

Software Overview

81

Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP

isr_save .usect ”.variabl”, 1 ; memory location to save AR7 during

; interrupts

CH1_ADSAMPLE .usect ”.variabl”, 1 ; last readed sample of channel 1

CH2_ADSAMPLE .usect ”.variabl”, 1 ; last readed sample of channel 2

* Address Decoder constants:

ADC .set 00002h ; activate A0 when TLV1562 is choosen

RD_CALIBRATION .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

SAVE_INTO_MEMORY .set 00001h ; store the samples into DSP memory

SEND_OUT_SERIAL .set 00000h ; store the last sample allways into serial buffer memory

SEND_OUT_PARALLEL .set 00001h ; store the last sample allways into DAC1

R10BIT_RESOLUT .set 00001h ; use maximum resolution of 10-bit

R8BIT_RESOLUT .set 00000h ; use 8-Bit resolution

R4BIT_RESOLUT .set 00000h ; use fastest mode (4-Bit resolution)

INTERNAL_CLOCK .set 00001h ; use the internal clock of the ADC

EXTERNAL_CLOCK .set 00000h ; use the external clock of the ADC

DIFF_INPUT_MODE .set 00000h ; use differential mode instead of single ended inputs

IME_CALIBRATION .set 00000h ; do an Internal Midscale Error Calibration

SME_CALIBRATION .set 00000h ; do a System Midscale Error Calibration

.sect ”.text”

_MAIN:

START:

INITIALIZATION:

* disable IRQ, sign extension mode, ini Stack

INTM = 1 ; disable IRQ

SXM = 0 ; no sign extension mode

; SP = #0280h ; initialize Stack pointer

* initialize waitstates:

DP = #00000h ; point to page zero

@SWWSR = #01000h ; one I/O wait states

* copy interrupt routine, which are uncritical by the EVM to the IRQ table location:

* this is required for the DSKplus kit but has to be changed on other platforms

DP = #1 ; point to page 1 (IRQ vector table)

AR7 = #00200h

repeat(#3h)

data(0084h) = *AR7+ ; copy the NMI vector

AR7 = #00240h

repeat(#35)

data(00C0h) = *AR7+ ; copy INT0, INT1,...

* clear all memory locations of the sampling table (table, where the samples will be stored)

DP = #AD_DP ;

@TEMP = #00000h ;