This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Incorrect Code Composer Output for Picollo



I am using the TI picollo 28069 eval module and using the Ti supplied software in the examples.  One of the assembly code modules I am using is the ADCDRV_1ch.asm where the value of the A/D is returned(shown at bottom).  Below is a listing of the compiled code.  The first call generates the correct code and the second has an incorrect location for the DP register.  I have reordered the source code around and see the problem move. It also shows up in other routines.  CCS version 4.2.4.00033. 

202         ADCDRV_1ch 3         ; A0 Input Voltage
0x000218:   761F0230    MOVW         DP, #0x230
0x00021A:   8E26        MOVL         XAR0, @0x26
0x00021B:   761F002C    MOVW         DP, #0x2c
0x00021D:   56030C03    MOV          ACC, @0x3 << 12
0x00021F:   1EC0        MOVL         *+XAR0[0], ACC
203         ADCDRV_1ch 2        ; A2 Primary Current
0x000220:   761F0230    MOVW         DP, #0x230
0x000222:   8E24        MOVL         XAR0, @0x24
0x000223:   761F8C14    MOVW         DP, #0x8c14
0x000225:   0000        ITRAP0
0x000226:   8C140000    MPY          P, @0x14, #0

;----------------------------------------------------------------------------------

; FILE: ADCDRV_1ch.asm

ADCDRV_1ch

.macro n

;=============================

MOVW DP, #_ADCDRV_1ch_Rlt:n: ; Load Data Page

MOVL XAR0,@_ADCDRV_1ch_Rlt:n: ; Load Rlt Data Page Pointer in XAR0

MOVW DP, #_AdcResult ; load Data Page to read ADC results

MOV ACC,@_AdcResult.ADCRESULT:n:<<12 ; read and shift the 12 bit ADC result by 12 bits to get Q24 value

MOVL *XAR0,ACC ; store result in output pointer location

.endm

 

 

Thanks, Jerry