88SLAA040

Software Overview

* initialize storage table for the ADC samples

DP

=

#AD_DP

;

A

+=

#–1

; decrement A

@CH_NO

= A

; read number of sampling channel

A

= @ADMEM

 

AR7

= A

; point to first date location of the storage table

A

= @ADCOUNT

; AR0 points to table end

B= @ADMEM A += B

AR0

= A

; AR0 is loaded with last save location

AR5

= #(IFR)

; AR5 points to the IFR register (only for polling mode)

DP

= #AD_DP

 

@ZERO

= #00000

; set the dummy send value

*initialize the send values to set–up the two programmable register of the ADC @CR0_SEND = #(MONO_INTSINGLE_ENDCLK_INTERNALNO_CALIB_OP);

A = @CR0_SEND

A = @CH_NO @CR0_SEND = A

@CR1_SEND = #(NO_SW_PWDNNO_AUTO_PWDNNO_2COMPLEMENTNO_DEBUGRES_10_BITCST_CONV_START);

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

*ADC_INI:

*set ADC register CR0/CR1

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

ADC_INI:

*write CR1 (to reset old CSTART mode initialization, because otherwise, the ADC never sets

*back its int– pin to show a sample is available:

@CR_PROBLEM = #(SW_PWDNNO_AUTO_PWDNNO_2COMPLEMENTNO_DEBUGRES_10_BITRD_CONV_START);

port(ADC) = @CR_PROBLEM

; Address

decoder sets CS low,

 

 

; WR– low

and send CR_PROBLEM value to the ADC

NOP

 

; wait for tW(CSH)=50ns

* write CR1:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

port(ADC) = @CR1_SEND

; Address decoder sets CS low,

 

 

; WR– low and send CR1 value to the ADC

 

 

 

 

 

 

port(DEACTIVE) = @ZERO

; deselect ADC (CS high)

NOP

 

; wait for tW(CSH)=50ns

* write CR0

 

 

 

 

 

 

 

 

 

port(ADC) = @CR0_SEND

; send CR0 value to the ADC

 

 

 

 

STEP1: port(DEACTIVE) = @ZERO

; deselect ADC (CS high)

NOP

;

 

 

 

 

 

 

 

 

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

*ADC_mono_IRQ_Start:

*read samples and store them into memory

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

88SLAA040

Page 94
Image 94
Texas Instruments TLV1562 manual Software Overview, SLAA040