Texas Instruments TLV1562 manual Software Overview, SLAA040

Page 48
.set 000C0h ; Operate without calibrated inputs (no offset)

Software Overview

NO_CALIB_OP

*INDEX MODE 1: NO_SW_PWDN SW_PWDN

NO_AUTO_PWDN AUTO_PWDN

TWO_COMPLEMENT NO_2COMPLEMENT

NO_DEBUG

DEBUG_MODE

RES_10_BIT

RES_8_BIT

RES_4_BIT

RD_CONV_START CST_CONV_START

.set 000C0h ; Operate without calibrated inputs (no offset)

.set 00100h ; Software power down mode disabled

.set 00101h ; instruction for software power down

.set 00100h ; Automatic internal power–down Disabled

.set 00102h ; Automatic internal power–down Enabled

.set 00100h ; ADC output in 2s complement format

.set 00104h ; ADC output is binary, not in 2s complement

.set 00000h ; Debug mode disabled

.set 00108h ; Debug mode enabled

.set 00100h ; 10-bit resolution of the ADC

.set 00120h ; 8-bit resolution of the ADC

.set 00110h ; 4-bit resolution of the ADC

.set 00100h ; start Conversion by RD Signal

.set 00140h ; start Conversion by CSTART Signal

;Example to use the constants, decribed on the top:

;set the sending value ”send” to sampling Channel 4 with external clock source

;calibrated inputs into Mono Continuous Mode

;

;@send = #(CH4MONO_CONTINUOUSSINGLE_ENDCLK_EXTERNALCALIB_OP);

;port(xxxxh) = @send ; send the value over the Data lines to the TLCV1562

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

*memory organization (table write of samples) for the C54x

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

num_data_A .set 00200h ; Number of data from channel A

num_data_B

.set 00200h ; Number of data from channel B

num_data_C

.set 00200h ; Number of data from channel C

num_data_D

.set 00200h ; Number of data from channel D

data_loc_A

.set 02000h ; Start data location for channel A

data_loc_B

.set 02200h

; Start data location for channel B

data_loc_C

.set 02400h

; Start data location for channel C

data_loc_D

.set 02600h

; Start data location for channel D

TRASH

.set 02000h

; address to waste the first input sample

 

 

; after initialization

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

*bit setting of the serial DAC to match the right mode

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

TLC5618_LATCH_A .set 08000h ; update output A

TLC5618_LATCH_B

.set 00000h ;

update B

TLC5618_DOUBLE_LATCH.set 01000h ;

update both outputs

TLC5618_FAST_MODE

.set 04000h

;

fast settling time (2.5us)

TLC5618_SLOW_MODE

.set 00000h

;

slower settling time (power save)

TLC5618_POWER_UP

.set 00000h

;

remain active

TLC5618_POWER_DOWN

.set 02000h

;

go sleep

42SLAA040

Image 48
Contents July SLAA040Application Report TParalInteMS3rflelADConvertertotheacing20C54xDSPtheTLV1562IMPORTANT NOTICE Contents 8.5.5 List of Figures List of TablesFigures viSLAA040 Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSP 1 Introduction2 The Board 2.1 TMS320C54x Starter Kit2.2 TLV1562EVM 2.3 ADC TLV1562 Overview2.3.1 Suggestions for the ’C54x to TLV1562 Interface 2.3.1.1 The Universal InterfaceUsing RD or the CSTART Signal to Start Conversion 2.3.2 Recyclic ArchitectureFigure 2. TLV1562 to ’C54x DSP Interface of the EVM 2.3.3 Note on the Interface, Using an External ADC Clock Drive 2.4 Onboard Components2.4.1 TLC5618A - Serial DAC 2.4.2 THS5651 - Parallel Output CommsDAC Figure 3. TLC5618A to ’C542 DSP InterfaceFigure 4. THS5651 to C542 DSP Interface 3 Operational Overview 3.1 Reference Voltage Inputs3.2 Input Data Bits Table 1. Signal Connections 3.3 Connections Between the DSP and the EVM3.3.1 Jumpers Used on the TLV1562EVM Table 2. 3-Position JumpersTable 3. 2-Position Jumpers 8SLAA0404 The Serial DAC/DSP System Table 4. DSP/DAC InterconnectionTable 5. DSP Serial Port Signals and Registers 5 The DSP Serial Port6 Other DSP/TLV1562 Signals 6.1 DSP Internal Serial Port Operation7.2 Mono Interrupt Driven Mode Using RD 7 Conversation Between the TLV1562 and the DSP7.1 Writing to the ADC Table 6. DSP Algorithm for Writing to the ADCTable 7. DSP Algorithm for Mono Interrupt Driven Mode Using RD tDCSL-sample+1ADCSYSCLKtENDATAOUT = 41 ns 7.3 Mono Interrupt Driven Mode Using CSTART Table 8. DSP Algorithm for Mono Interrupt Driven Mode Using CSTART14 SLAA040 7.4 Dual Interrupt Driven Mode Table 9. DSP Algorithm for Dual Interrupt Driven Mode7.5 Mono Continuous Mode Table 10. DSP Algorithm for Mono Continuous Mode16 SLAA040 7.6 Dual Continuous Mode Table 11. DSP Algorithm for Dual Continuous Mode8 Software Overview 8.1 Software Development tools8.2 DSP Memory Map Figure 5. Memory Map 8.3.3 Timer Output 8.3 Programming Strategies for the ’C54x, Explanations8.3.1 Optimizing CPU Resources for Maximum Data Rates 8.3.2 Address and Data Bus for I/O Tasks8.3.5 Generating the Chip Select Signal and the CSTART Signal 8.3.4 Data Page Pointer8.3.6 Interfacing the Serial DAC 5618A to the DSP 8.3.7 Interrupt Latency 8.3.8 Branch Optimization goto/dgoto, call/dcallGOTO MARK MARK DP = #1 ARP = #58.3.9 Enabling Software Modules .if/.elseif/.endif 8.4 Software Code Explanation8.4.1 Software Principals of the Interface 8.4.1.2 Timed Solution 8.4.1.1 Software PollingAdvantage Disadvantage8.4.1.3 Interrupt Driven Solution 8.4.1.5 Setting the Right SwitchesAdvantages DisadvantagesTable 12. Switch Settings TaskTable 13. Instruction in the Program Header Step 8.5 Flow Charts and Comments for All Software Modes 8.5.1 The Mono Interrupt Driven Mode Using RD to Start ConversionTable 14. Instruction in the Program Header Step 8.4.1.6 Common Software for all ModesProgram Files Other FilesCode verification common file of all modes constants definitionFigure 6. Software Flow of the Mono Interrupt Driven Solution 8.5.2 Mono Interrupt Driven Mode Using CSTART to Start Conversion Calibration procedure of the DACIncludes the complete software algorithm to control the monomode Common file of all modes constants definitionInitialize SPI SAVEPoll INTO Pin Until h/0 Transition Occurs Pull Down CSTART8.5.2.1 Throughput Optimization† This only works for one TLV1562 not multiple because CS is not used8.5.3 Dual Interrupt Driven Mode Figure 8. Time Optimization monocst1Maximum Performance at 1.2 MSPS with Internal Clock IMPORTANT NOTE The code has been optimized to maximize the data throughput. It was found that CSTART can be pulled low earlier than the data read instruction is performed by the DSP. This saves the 100-ns wait time in STEP 3 because the data read requires at least 100 ns. Therefore, CSTART gets pulled high directly after data read, and the interface becomes faster and gains throughput. This variation will be found in the code. The data acquisition is done in a small number of steps that explains everything inside the code Software Overview 8.5.4 Mono Continuous Mode Figure 10. Flow Chart Mono Continuous Mode 8.5.5 Dual Continuous Mode Figure 11. Flow Chart Dual Continuous Mode Program Files 8.6 Source Code 8.6.1 Common Software for all Modes except C-Callable8.6.1.1 Constants.asm set 000C0h Operate without calibrated inputs no offset 42 SLAA0408.6.1.2 Interrupt Vectors 4C internal timer interrupt 44 SLAA0408.6.1.3 linker,cmd 8.6.1.4 Auto.batFile Linker.lnk COMMAND FILE title ”COMMAND FILE FOR TLV1562.ASM”Mainprogram Monomode.asm pointer address when using any of the following variablesjump address to init. new channel counter for one channelsent value to register CR0 of the ADC if SENDOUTSERIAL endif if INT0DRIVENPOLLINGDRV48 SLAA040 endif if AUTOPWDNENABLE endif if DIFFINPUTMODE= bit*AR5,15-0 elseif INT0DRIVENelseif NOINT0SIG 52 SLAA040 8.6.3 Calibration of the ADC CALIBRAT.ASM54 SLAA040 if SMECALIBRATION 56 SLAA040 Software Overview 58 SLAA040 Software Overview 60 SLAA040 if INT0DRIVENPOLLINGDRV 62 SLAA040 = bit*AR5,15-0 endif if SAVEINTOMEMORY 64 SLAA040Software Overview 8.6.5 Dual Interrupt Driven Mode Constants definition - see 8.6.1.1 Constants.asmInterrupt Routine handler - see 8.6.1.2 Interrupt Vectors Mainprogram DUALIRQ1.asmSoftware Overview Interfacing the TLV1562 Parallel ADC to the TMS320C54x DSPSoftware Overview if SENDOUTSERIALSoftware Overview 70 SLAA040 if AUTOPWDNENABLE 72 SLAA040 Software Overview 8.6.6 Mono Continuous Mode Mainprogram MONOCON1.asm74 SLAA040 Software Overview 76 SLAA040 endif if EXTERNALCLOCK 78 SLAA040 Software Overview 8.6.7 Dual Continuous Mode Mainprogram DUALCON1.asm80 SLAA040 Software Overview 82 SLAA040 Software Overview 84 SLAA040 Software Overview 8.6.8 C-Callable Mainprogram C1562.cTLV1562Channel, Save Memory Start address, NUMBEROFSAMPLES 80h samples of channel 1 will be stored beginning on 2000hSoftware Overview 88 SLAA040 AR7+ = data@ADSAMPLE Vectors.asm 90 SLAA040int2 returnenable 48 external interrupt int2 nop Auto.bat Linker.cmd92 SLAA040 9 Summary 10 References