Texas Instruments TLV1562 Software Overview, if AUTOPWDNENABLE, endif if DIFFINPUTMODE, SLAA040

Models: TLV1562

1 99
Download 99 pages 55.38 Kb
Page 56
Image 56
.if (AUTO_PWDN_ENABLE)

Software Overview

.if (AUTO_PWDN_ENABLE)

@CR1_SEND ^= #NO_AUTO_PWDN @CR1_SEND = #AUTO_PWDN

.endif

.if (DIFF_INPUT_MODE)

@CR0_SEND ^= #SINGLE_END @CR0_SEND = #DIFFERENTIAL

.endif

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

*ADC_INI:

*set ADC register CR0/CR1

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

ADC_INI:

* write CR1:

port(ADC) = @CR1_SEND

port(DEACTIVE) = @ZERO

NOP

* write CR0

port(ADC) = @CR0_SEND port(DEACTIVE) = @ZERO

NOP

;clear NO_AUTO_PWDN bit if one

;set AUTO_PWDN mode

;clear single ended input bit if one

;set differential input mode

;Address decoder sets CS low,

;WR low and send CR1 value to the ADC

;deselect ADC (CShigh)

;wait for tW(CSH)=50ns

;send CR0 value to the ADC

;deselect ADC (CShigh)

;wait for tW(CSH)=50ns

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

*ADC_mono_IRQ_Start:

*read samples and store them into memory

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

ADC_mono_IRQ_Start:

STEP2: @TEMP

= port(ADC)

; select ADC (CS low) (change address bus signal)

STEP3: repeat(#4)

 

 

 

 

 

 

 

 

 

NOP

 

; wait for tD(CSL–SAMPLE)+1SYSCLK=6

 

 

 

 

 

 

 

 

 

 

 

STEP4: XF

= 0

; clear RD

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

;

50SLAA040

Page 56
Image 56
Texas Instruments TLV1562 Software Overview, if AUTOPWDNENABLE, endif if DIFFINPUTMODE, if POLLINGDRV, = bit*AR5,15-0