= bit(*AR5,15–0)
; wait for 20 clock cycles [t(APDR)=500ns]
Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP
; wait for 34 processor cycles
; clear CSTART
; read the new sample into the DSP

Software Overview

* 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:

 

= bit(*AR5,15–0)

 

 

 

 

 

 

M1: TC

; 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

.endif

* read sample

STEP2: XF = 0

STEP10: @ADSAMPLE = port(ADC)

.if (AUTO_PWDN)

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

nop

.endif

63

Page 69
Image 69
Texas Instruments TLV1562 Software Overview, if POLLINGDRV, = bit*AR5,15-0, elseif INT0DRIVEN, elseif NOINT0SIG, endif