Texas Instruments TLV1562 User Manual

Page 69

Advertising
background image

Software Overview

63

Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP

* write CR0

port(ADC) = @CR0_SEND ; send CR0 value to the ADC

port(DEACTIVE) = @ZERO ; deselect ADC (CS high)

NOP ; wait for tW(CSH)=50ns

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

* ADC_mono_IRQ_Start:

* read samples and store them into memory

*******************************************
ADC_mono_IRQ_Start:

ISTEP2: XF = 0 ; clear CSTART

ISTEP3: NOP

NOP

NOP ; wait for TW(CSTARTL)

ISTEP4: XF = 1 ; set CSTART

STEP5:

.if POLLING_DRV

* wait until INT– goes low in polling the INT0 pin:

M1: TC = bit(*AR5,15–0) ; test, is the INT0 Bit in IFR=1?

if (NTC) goto M1 ; wait until INT signal goes high

IFR = #1 ; reset any old interrupt on pin INT0

.elseif INT0_DRIVEN

* user main program area (this could execute additional code)

* go into idle state until the INT0 wakes the processor up

USER_MAIN: IDLE(2) ; the user software could do something else here

goto USER_MAIN ;

.elseif NO_INT0_SIG

* instead of using the INT signal, the processor waits

* for 6ADCSYSCLK+49ns and reads then the sample

repeat(#32)

nop ; wait for 34 processor cycles

.endif

* read sample

STEP2: XF = 0 ; clear CSTART

STEP10: @ADSAMPLE = port(ADC) ; read the new sample into the DSP

.if (AUTO_PWDN)

* wait 800ns before finishing the sampling (requirment in Auto power down mode)

repeat(#24)

nop ; wait for 20 clock cycles [t(APDR)=500ns]

.endif

Advertising