Helow, I have a program that I did for F2812 in code composer 3.1 and this program work very well. Now I imported the program using CC 5.4 for a R2812 and the global variables doesnt work, only local variables. I need some help.
Thank you
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.
Helow, I have a program that I did for F2812 in code composer 3.1 and this program work very well. Now I imported the program using CC 5.4 for a R2812 and the global variables doesnt work, only local variables. I need some help.
Thank you
Hi, follow the file main.c. Actually there is no error in the variable, only it does not store any after doing some regard for example, it updates only if it is a local variable value.
In the program bellow see only the variable call "nl and n" declared in line 125 and 126. "nl" is declared again in line 199 as a local varable and the simple code in line 306 and 307. "nl" increment but "n' stay with "0".
Thank you
//******** Programa completo ************* //******** Janderson Duarte ***********/ //******** 30/10/2008 ****************/ //******* Arquivos Include (Bibliotecas) *********/ #include "stdio.h" #include "DSP28_Device.h" #include "qmath.h" #include "Parametros.h" #define PI 3.14159265358979 /* Defini��es de frequ�ncia */ #define FREQUENCIA_DE_CHAVEAMENTO 75e3 // (Hz) #define FREQUENCIA_DE_AMOSTRAGEM 75e3 // (Hz) #define FREQUENCIA_DE_CLOCK 150e6 // (Hz) /* defini��es de projeto */ #define KAD (4096.0/3.0) #define VT ((int16)(FREQUENCIA_DE_CLOCK/(FREQUENCIA_DE_CHAVEAMENTO))) /* defini��o das Bases */ #define Q30 1073741824L #define Q29 536870912L #define Q28 268435456L #define Q25 33554432L #define Q24 16777216 #define Q23 8388608 #define Q22 4194304 #define Q21 2097152 #define Q20 1048576 #define Q19 524288 #define Q18 262144 #define Q16 65536 #define Q15 32768 #define Q14 16384 #define Q13 8192 #define Q12 4096 #define Q10 1024 #define Q5 32 #define Q4 16 #define Q3 8 /**** Defini��o das constantes do controlador de corrente */ #define KI1 0.38321 #define KI2 0.35986 #define KI3 1 /* Mudan�a das constantes para a base 15 */ #define KI1_Q15 ((int)((float)KI1*Q15)) #define KI2_Q15 ((int)((float)KI2*Q15)) #define KI3_Q15 ((unsigned int)((float)KI3*Q15)) /**** Defini��o das constantes do controlador de tens�o */ #define KV1 1 #define KV2 0.0038703 #define KV3 0.0038699 /* Contantes do controlador de tens�o p/ realizar o controle */ #define KV1_Q0 ((int)KV1) #define KV2_Q0 ((float)KV2) #define KV3_Q0 ((float)KV3) //__________________ Pr�-defini��o das Fun��es ____________________/ extern void DSP28x_msDelay(unsigned long Count); // Rotina de delay em ms extern void DSP28x_usDelay(unsigned long Count); // Rotina de delay em us void ConfigEIRandDBGIER(Uint16 en_cpu_int); void inicia_timer (); //Func�o que d� o start no timer void habilita_PWM (); //Fun��o que habilita PWM void desabilita_PWM (); //Fun��o que dasabilita as sa�das PWMs interrupt void INTERRUPCAO(void); //__________________ Declara�ao de variaveis ____________________/ //***************************************************************/ //_________________ Vari�veis de Entrada Lidas _________________/ signed int iref_in,voin,iLin; //_________________ Vari�veis do controlador de corrente _________________/ unsigned int iK1_Q15 = KI1_Q15, //ganhos projetados do controlador na base 20 iK2_Q15 = KI2_Q15, //ganhos projetados do controlador na base 20 iK3_Q15 = KI3_Q15; //ganhos projetados do controlador na base 20 int ic = 0, //A��o de controle atual ic_km1 = 0, //A��o de controle anterior ie = 0, //Erro ie_km1 = 0, //Erro anterior ic_max = 0.95*VT, // Limita��o superior para o valor do controle p/ D=0.9 ic_min = 0; // Limita��o inferior para o valor do controle int32 iref = 0; //refer�ncia p/ cont. de corrente //_________________ Vari�veis do controlador de tens�o _________________/ int vK1_Q0 = KV1_Q0; //ganhos projetados do controlador de tens�o float vK2_Q0 = KV2_Q0, //ganhos projetados do controlador de tens�o vK3_Q0 = KV3_Q0; //ganhos projetados do controlador de tens�o float vc = 0, //A��o do controle atual vc_km1 = 0, //A��o do controle anterior vc_max = 1.7; //Limita��o do controlador de tens�o p/ dar 22,5A de pico de entrada ((22,49A*ki)/1,3)=1.7 int ve = 0, //Erro ve_km1 = 0, //Erro anterior vref = 2048, //Tens�o de refer�ncia (300V*Kvsense*Kad=2048) vc_min = 0; //Limita��o minima do controlador de tens�o //_________________ Vari�veis de contadores _________________/ int j=0, l=0, nl=0, n=0; #define controtensao //Para compilar o controle de tens�o //____________ Aloca��o de Mem�ria Para os Gr�ficos ____________/ #define PONTOS 2048 int k=0; int grafico1[PONTOS]; //#pragma DATA_SECTION (grafico1,"GRAFICOS") //int grafico2[PONTOS]; //#pragma DATA_SECTION (grafico2,"GRAFICOS") //**************************************************************/ //****************** PROGRAMA PRINCIPAL ************************/ //**************************************************************/ void main(void) { //Inicializa sistema de controle //PLL, Watchdog,habilita perif�ricos InitSysCtrl(); EALLOW; SysCtrlRegs.HISPCP.all = 0x0000; //Muda o clock dos perif�ricos para SYSCLKOUT/1 EDIS; ConfiguraIO(); // Configura Entradas/Sa�das // ****************************** Rotina para reset dos drivers ******************************************** // GpioDataRegs.GPADAT.bit.GPIOA10 = 0; // DELAY_US(1); // GpioDataRegs.GPADAT.bit.GPIOA10 = 1; // DELAY_US(10); EALLOW; GpioMuxRegs.GPDMUX.bit.T1CTRIP_PDPA_GPIOD0= 0; // I/O GpioMuxRegs.GPDDIR.bit.GPIOD0 = 0; // Saida EDIS; // Inicializa a interface com a mem�ria ASRAM externa InitXintf(); // Inicializa os Registradores de Controle PIE em seu estado pad�o // O estado padr�o destes registradores � zero e os flags s�o limpos InitPieCtrl(); InitAdc(); // Liga o circuito do ADC ConfiguraADC(); // Configura os registradores do ADC ConfiguraEVA1(); // Configura os registradores do EVA ConfiguraEVA2(); // Configura os registradores do EVA ConfiguraEVB(); // Configura os registradores do EVB MyInitInterrupt(); // Configura as interrup��es // Enable the PIE block PieCtrlRegs.PIECRTL.bit.ENPIE = 1; inicia_timer (); //Inicia contador p/ gerar os PWMs while(1){} //Fica em looping infinito aguardando interrupcao do timer1 } //**************************************************************/ //---------ROTINA DE INTERRUP��O DO TIMER1--------------------/ //**************************************************************/ interrupt void INTERRUPCAO(void) // interrupacao do timer1 do EV-A { int nl=0; GpioDataRegs.GPADAT.bit.GPIOA10 = 0; //*************** Leitura e Ajustes Dos Sinais ***************/ //_________________ Leitura dos dados do ADC _________________/ //{ AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1; // Limpa Flag que indica final de conversao Do ADC AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1; // Reset ADC AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1; // Inicia a convers�o // Espera o fim da convers�o while (AdcRegs.ADCST.bit.INT_SEQ1 == 0) {} iLin=(int16)(AdcRegs.ADCRESULT0>>4); //Guarda o valor lido de corrente no indutor p/ a variavel iLin voin=(int16)(AdcRegs.ADCRESULT1>>4); //Guarda o valor lido de tens�o de sa�da p/ a variavel voin iref_in=(int)((AdcRegs.ADCRESULT2)-(AdcRegs.ADCRESULT3)); //Guarda o valor lido de referencia de corrente e diminui off-set p/ a variavel iref_in iref_in=(int)(iref_in>>4); /**** Rotina de prote��o de sobretens�o, sobrecorrente e erro de driver ***/ if(GpioDataRegs.GPADAT.bit.GPIOA8==0) // Prote��o de erro de driver { // desabilita_PWM (); } if(iLin>3618) //Prote��o de sobre-corrente (26.5A*Kisense*KAD=3618) { j++; if(j==4) //Tem que passar 3 vezes do valor p/ entender como sobre-corrente { // desabilita_PWM (); } } if(voin>2798) //Prote��o de sobre-tens�o (410V*KVsense*KAD=2798) { l++; if(l==4) //Tem que passar 3 vezes do valor p/ entender como sobre-tens�o { // desabilita_PWM (); } } /**** Rotina de retifica��o do sinal de refer�ncia da rede p/ servir de referencia cont. corrente ***/ iref_in=abs(iref_in); //*********************** Controlador de Tens�o **************************************************/ #ifdef controtensao // cv(k)=K1*cv(k-1)+K2*ve(k)-K3*ve(k-1) Esta � a lei de controle de tens�o ve=((int)(vref)-(voin)); //Faz o erro de tens�o vc=(((float)vK1_Q0*vc_km1)+((float)vK2_Q0*ve)-((float)vK3_Q0*ve_km1)); //Lei de controle //********* Bloco do saturador da a��o de controle de tens�o *********************************************/ if(vc>vc_max) { vc=vc_max; } if(vc<vc_min) { vc=vc_min; } //******** Bloco que multiplica a saida do cont. tens�o pela seno retificado de refer�ncia *******/ iref=((int32)((float)iref_in*vc)); #endif //*********************** Controlador de corrente **************************************************/ // ci(k)=K1*ei(k)-K2*ei(k-1)+K3*ci(k-1) Esta � a lei de controle de corrente ie=((int)(iref)-(iLin)); //Faz o erro Q/15 ic=((((int32)iK1_Q15*ie)-((int32)iK2_Q15*ie_km1)+((int32)iK3_Q15*ic_km1))>>15); //Lei de controle //********* Bloco do saturador da a��o de controle ***************************************************/ if(ic>ic_max) { ic=ic_max; } if(ic<ic_min) { ic=ic_min; } //****************** Atualiza��o das vari�veis do controle de tens�o ****************************** vc_km1 = vc; ve_km1 = ve; //****************** Atualiza��o das vari�veis do controle de corrente ****************************** ic_km1 = ic; ie_km1 = ie; // ********** Atualiza valor de refer�ncia do PWM ***************************************************/ EvaRegs.T1CMPR = 600; EvaRegs.T2CMPR = 600; //*********** Grafico ******************************************************/ /* n++; if(n>=10) { GpioDataRegs.GPADAT.bit.GPIOA10 = 1; grafico1[k]=ic; n=0; // grafico2[k]=ic; // k=k+1; if (k==PONTOS) { k=0; n++; } } */ nl++; n=nl; GpioDataRegs.GPADAT.bit.GPIOA10 = 1; // To recieve more interrupts from this PIE group, acknowledge this interrupt PieCtrlRegs.PIEACK.bit.ACK2 = 1; // Reset o Flag da interrupcao do EVA T1PINT // EvaRegs.EVAIFRA.bit.T1PINT=1; EvaRegs.EVAIFRA.bit.T1UFINT=1; // Coloca 0 no FLAG DBGM, permitindo Debug em Tempo Real ERTM; return; } void ConfigEIRandDBGIER(Uint16 en_cpu_int) { IER = en_cpu_int; //asm(" OR IER,#en_cpu_int"); asm(" MOV *SP++,IER"); asm(" POP DBGIER"); } void inicia_timer () //Func�o que inicia o contador dos timers { EvaRegs.T1CON.bit.TENABLE = 1; // Timer1 Enable EvaRegs.T2CON.bit.TENABLE = 1; // Timer2 Enable EvbRegs.T3CON.bit.TENABLE = 1; EvbRegs.T4CON.bit.TENABLE = 1; } void habilita_PWM () //Fun��o que habilita os PWMs { EvaRegs.GPTCONA.bit.T1PIN=1; //PWM do timer 1 ativo em baixo EvaRegs.GPTCONA.bit.T2PIN=1; //PWM do timer 2 ativo em baixo } void desabilita_PWM () //Fun��o que desahabilita os PWMs { EvaRegs.GPTCONA.bit.T1PIN=0; //For�a PWM timer 1 para zero EvaRegs.GPTCONA.bit.T2PIN=0; //For�a PWM timer 2 para zero while(1) {} //Fica em looping infinito p/ nao habilitar PWM novamente } //Fim
Hi,
I'd a look at your code, there doesn't seems to be any issue. I would like you to check with the "Step into" functionality (ie step by step towards the line "n=nl") during debugging. Check whether you reach that particular line or not. If not then what is it that stopping you. Let me know what you observe.
Regards,
Gautam
Janderson,
When you updated to CCS 5.4, did you start using a new compiler version? If so, did you update your linker command file? The .bss section needs to be in RAM for global variables to work.
You can check the .map file in the output directory to see where your global variables are in memory. Make sure that the address is in RAM.
Hi, I imported using CC. 5.4. I did Project->Import Existing CCS Eclipse Project, just it. And I didint change the linker file, I am using the same that was imported and work for F2812, but dont work for R2812. I think the problem is samething like you said, but I dont know how to fix, I already tried to change linker file by the file of R2812 from CCS, but I didint get. Follow my file .MAP, I dont understand very well this file, If you could look for me. The . BSS Section start in 00008000 and the dissasembly picture it send to the position 0x200, I dont know if this is important. Thank you.
****************************************************************************** TMS320C2000 Linker PC v6.1.3 ****************************************************************************** >> Linked Mon Apr 07 08:24:24 2014 OUTPUT FILE NAME: <E:/Programas DSP/Programa completo teste conversor 03-04-2014/controle corrente+tensao/../Debug/Fonte3F.out> ENTRY POINT SYMBOL: "_c_int00" address: 003f836a MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- PAGE 0: H0_SARAM 003f8000 00002000 000006ba 00001946 RWIX BOOTROM 003ff000 00000fc0 00000000 00000fc0 RW RESET 003fffc0 00000002 00000000 00000002 RWIX PAGE 1: M0_SARAM 00000040 000003c0 00000000 000003c0 RWIX M1_SARAM 00000400 00000400 00000400 00000000 RWIX DEV_EMU 00000880 00000180 000000d6 000000aa RWIX FLASH_REGS 00000a80 00000060 00000008 00000058 RWIX CSM 00000ae0 00000010 00000010 00000000 RWIX XINTF 00000b20 00000020 00000020 00000000 RWIX CPU_TIMER0 00000c00 00000008 00000008 00000000 RWIX CPU_TIMER1 00000c08 00000008 00000000 00000008 RWIX CPU_TIMER2 00000c10 00000008 00000000 00000008 RWIX PIE_CTRL 00000ce0 00000020 0000001a 00000006 RWIX PIE_VECT 00000d00 00000100 00000100 00000000 RWIX ECAN_A 00006000 00000100 00000000 00000100 RWIX ECAN_AMBOX 00006100 00000100 00000000 00000100 RWIX SYSTEM 00007010 00000020 00000020 00000000 RWIX SPI_A 00007040 00000010 00000010 00000000 RWIX SCI_A 00007050 00000010 00000010 00000000 RWIX XINTRUPT 00007070 00000010 00000010 00000000 RWIX GPIOMUX 000070c0 00000020 00000020 00000000 RWIX GPIODAT 000070e0 00000020 00000020 00000000 RWIX ADC 00007100 00000020 0000001a 00000006 RWIX EV_A 00007400 00000040 00000032 0000000e RWIX EV_B 00007500 00000040 00000032 0000000e RWIX SPI_B 00007740 00000010 00000000 00000010 RWIX SCI_B 00007750 00000010 00000010 00000000 RWIX MCBSP_A 00007800 00000040 00000025 0000001b RWIX L0_SARAM 00008000 00001000 000008c4 0000073c RWIX L1_SARAM 00009000 00001000 00000000 00001000 RWIX ZONE6 00100000 00010000 00000000 00010000 RWIX CSM_PWL 003f7ff8 00000008 00000008 00000000 RWIX SECTION ALLOCATION MAP output attributes/ section page origin length input sections -------- ---- ---------- ---------- ---------------- .text 0 003f8000 00000535 003f8000 000000dd 00Main.obj (.text:retain) 003f80dd 00000097 ConfiguraEV.obj (.text) 003f8174 0000008b rts2800_ml.lib : fs_add.obj (.text) 003f81ff 00000075 DSP28_Xintf.obj (.text) 003f8274 0000005a rts2800_ml.lib : fs_mpy.obj (.text) 003f82ce 00000051 00Main.obj (.text) 003f831f 0000004b rts2800_ml.lib : exit.obj (.text) 003f836a 00000046 : boot.obj (.text) 003f83b0 00000040 ConfiguraIO.obj (.text) 003f83f0 0000003b rts2800_ml.lib : fs_tol.obj (.text) 003f842b 00000032 myInitInterrupt.obj (.text) 003f845d 00000029 ConfiguraADC.obj (.text) 003f8486 00000021 DSP28_PieCtrl.obj (.text) 003f84a7 0000001f DSP28_SysCtrl.obj (.text) 003f84c6 0000001a rts2800_ml.lib : i_tofs.obj (.text) 003f84e0 00000017 DSP28_Adc.obj (.text) 003f84f7 00000017 rts2800_ml.lib : fs_cmp.obj (.text) 003f850e 00000011 qsinlt.obj (.text) 003f851f 00000009 rts2800_ml.lib : _lock.obj (.text) 003f8528 00000009 : fs_sub.obj (.text) 003f8531 00000004 DSP28_usDelay.obj (.text) ramfuncs 0 003f8000 00000015 DSECT 003f8000 00000015 DSP28_SysCtrl.obj (ramfuncs) SINTBL 0 003f8535 00000101 003f8535 00000101 qmath.lib : sintb360.obj (SINTBL) .cinit 0 003f8636 00000084 003f8636 0000006a 00Main.obj (.cinit) 003f86a0 0000000e rts2800_ml.lib : exit.obj (.cinit) 003f86ae 0000000a : _lock.obj (.cinit) 003f86b8 00000002 --HOLE-- [fill = 0] .reset 0 003fffc0 00000002 DSECT 003fffc0 00000002 rts2800_ml.lib : boot.obj (.reset) .stack 1 00000400 00000400 UNINITIALIZED 00000400 00000400 --HOLE-- DevEmuRegsFile * 1 00000880 000000d6 UNINITIALIZED 00000880 000000d6 DSP28_GlobalVariableDefs.obj (DevEmuRegsFile) FlashRegsFile * 1 00000a80 00000008 UNINITIALIZED 00000a80 00000008 DSP28_GlobalVariableDefs.obj (FlashRegsFile) CsmRegsFile * 1 00000ae0 00000010 UNINITIALIZED 00000ae0 00000010 DSP28_GlobalVariableDefs.obj (CsmRegsFile) XintfRegsFile * 1 00000b20 00000020 UNINITIALIZED 00000b20 00000020 DSP28_GlobalVariableDefs.obj (XintfRegsFile) CpuTimer0RegsFile * 1 00000c00 00000008 UNINITIALIZED 00000c00 00000008 DSP28_GlobalVariableDefs.obj (CpuTimer0RegsFile) PieCtrlRegsFile * 1 00000ce0 0000001a UNINITIALIZED 00000ce0 0000001a DSP28_GlobalVariableDefs.obj (PieCtrlRegsFile) PieVectTable * 1 00000d00 00000100 UNINITIALIZED 00000d00 00000100 DSP28_GlobalVariableDefs.obj (PieVectTable) SysCtrlRegsFile * 1 00007010 00000020 UNINITIALIZED 00007010 00000020 DSP28_GlobalVariableDefs.obj (SysCtrlRegsFile) SpiaRegsFile * 1 00007040 00000010 UNINITIALIZED 00007040 00000010 DSP28_GlobalVariableDefs.obj (SpiaRegsFile) SciaRegsFile * 1 00007050 00000010 UNINITIALIZED 00007050 00000010 DSP28_GlobalVariableDefs.obj (SciaRegsFile) XIntruptRegsFile * 1 00007070 00000010 UNINITIALIZED 00007070 00000010 DSP28_GlobalVariableDefs.obj (XIntruptRegsFile) GpioMuxRegsFile * 1 000070c0 00000020 UNINITIALIZED 000070c0 00000020 DSP28_GlobalVariableDefs.obj (GpioMuxRegsFile) GpioDataRegsFile * 1 000070e0 00000020 UNINITIALIZED 000070e0 00000020 DSP28_GlobalVariableDefs.obj (GpioDataRegsFile) AdcRegsFile * 1 00007100 0000001a UNINITIALIZED 00007100 0000001a DSP28_GlobalVariableDefs.obj (AdcRegsFile) EvaRegsFile * 1 00007400 00000032 UNINITIALIZED 00007400 00000032 DSP28_GlobalVariableDefs.obj (EvaRegsFile) EvbRegsFile * 1 00007500 00000032 UNINITIALIZED 00007500 00000032 DSP28_GlobalVariableDefs.obj (EvbRegsFile) ScibRegsFile * 1 00007750 00000010 UNINITIALIZED 00007750 00000010 DSP28_GlobalVariableDefs.obj (ScibRegsFile) McbspaRegsFile * 1 00007800 00000025 UNINITIALIZED 00007800 00000025 DSP28_GlobalVariableDefs.obj (McbspaRegsFile) .bss 1 00008000 00000000 UNINITIALIZED .ebss 1 00008000 000008c4 UNINITIALIZED 00008000 00000840 00Main.obj (.ebss) 00008840 00000080 rts2800_ml.lib : exit.obj (.ebss) 000088c0 00000004 : _lock.obj (.ebss) CsmPwlFile * 1 003f7ff8 00000008 UNINITIALIZED 003f7ff8 00000008 DSP28_GlobalVariableDefs.obj (CsmPwlFile) GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name address name -------- ---- 00008000 .bss 003f8000 .text 003f8345 C$$EXIT 003f8174 FS$$ADD 003f84f7 FS$$CMP 003f8274 FS$$MPY 003f8528 FS$$SUB 003f83f0 FS$$TOL 003f84c6 I$$TOFS 003f8535 SINTAB_360 00007100 _AdcRegs 003f82f8 _ConfigEIRandDBGIER 003f845d _ConfiguraADC 003f80dd _ConfiguraEVA1 003f810e _ConfiguraEVA2 003f8126 _ConfiguraEVB 003f83b0 _ConfiguraIO 00000c00 _CpuTimer0Regs 003f7ff8 _CsmPwl 00000ae0 _CsmRegs 003f8531 _DSP28x_usDelay 00000880 _DevEmuRegs 00007400 _EvaRegs 00007500 _EvbRegs 00000a80 _FlashRegs 000070e0 _GpioDataRegs 000070c0 _GpioMuxRegs 003f8000 _INTERRUPCAO 003f84e0 _InitAdc 003f8000 _InitFlash 003f8486 _InitPieCtrl 003f84a7 _InitSysCtrl 003f81ff _InitXintf 00007800 _McbspaRegs 003f842b _MyInitInterrupt 00000ce0 _PieCtrlRegs 00000d00 _PieVectTable 00007050 _SciaRegs 00007750 _ScibRegs 00007040 _SpiaRegs 00007010 _SysCtrlRegs 00007070 _XIntruptRegs 00000b20 _XintfRegs 00000800 __STACK_END 00000400 __STACK_SIZE ffffffff ___binit__ 00008000 ___bss__ ffffffff ___c_args__ 003f8636 ___cinit__ 00008000 ___end__ 003f8535 ___etext__ ffffffff ___pinit__ 003f8000 ___text__ 00008844 __cleanup_ptr 00008842 __dtors_ptr 000088c2 __lock 003f851f __nop 003f8520 __register_lock 003f8524 __register_unlock 000088c0 __unlock 003f8369 _abort 003f8347 _atexit 003f836a _c_int00 003f8318 _desabilita_PWM 003f831f _exit 00008040 _grafico1 003f830d _habilita_PWM 00008001 _iK1_Q15 0000800f _iK2_Q15 00008007 _iK3_Q15 00008012 _iLin 00008008 _ic 00008006 _ic_km1 00008003 _ic_max 00008002 _ic_min 00008005 _ie 00008000 _ie_km1 003f8300 _inicia_timer 0000801c _iref 00008015 _iref_in 00008009 _j 00008010 _k 0000800c _l 003f82ce _main 0000800d _n 0000800b _nl 003f850e _qsinlt 00008004 _vK1_Q0 0000801a _vK2_Q0 0000801e _vK3_Q0 00008020 _vc 00008016 _vc_km1 00008018 _vc_max 0000800a _vc_min 0000800e _ve 00008011 _ve_km1 00008014 _voin 00008013 _vref ffffffff binit 003f8636 cinit 00008000 end 003f8535 etext ffffffff pinit GLOBAL SYMBOLS: SORTED BY Symbol Address address name -------- ---- 00000400 __STACK_SIZE 00000800 __STACK_END 00000880 _DevEmuRegs 00000a80 _FlashRegs 00000ae0 _CsmRegs 00000b20 _XintfRegs 00000c00 _CpuTimer0Regs 00000ce0 _PieCtrlRegs 00000d00 _PieVectTable 00007010 _SysCtrlRegs 00007040 _SpiaRegs 00007050 _SciaRegs 00007070 _XIntruptRegs 000070c0 _GpioMuxRegs 000070e0 _GpioDataRegs 00007100 _AdcRegs 00007400 _EvaRegs 00007500 _EvbRegs 00007750 _ScibRegs 00007800 _McbspaRegs 00008000 .bss 00008000 ___bss__ 00008000 ___end__ 00008000 _ie_km1 00008000 end 00008001 _iK1_Q15 00008002 _ic_min 00008003 _ic_max 00008004 _vK1_Q0 00008005 _ie 00008006 _ic_km1 00008007 _iK3_Q15 00008008 _ic 00008009 _j 0000800a _vc_min 0000800b _nl 0000800c _l 0000800d _n 0000800e _ve 0000800f _iK2_Q15 00008010 _k 00008011 _ve_km1 00008012 _iLin 00008013 _vref 00008014 _voin 00008015 _iref_in 00008016 _vc_km1 00008018 _vc_max 0000801a _vK2_Q0 0000801c _iref 0000801e _vK3_Q0 00008020 _vc 00008040 _grafico1 00008842 __dtors_ptr 00008844 __cleanup_ptr 000088c0 __unlock 000088c2 __lock 003f7ff8 _CsmPwl 003f8000 .text 003f8000 _INTERRUPCAO 003f8000 _InitFlash 003f8000 ___text__ 003f80dd _ConfiguraEVA1 003f810e _ConfiguraEVA2 003f8126 _ConfiguraEVB 003f8174 FS$$ADD 003f81ff _InitXintf 003f8274 FS$$MPY 003f82ce _main 003f82f8 _ConfigEIRandDBGIER 003f8300 _inicia_timer 003f830d _habilita_PWM 003f8318 _desabilita_PWM 003f831f _exit 003f8345 C$$EXIT 003f8347 _atexit 003f8369 _abort 003f836a _c_int00 003f83b0 _ConfiguraIO 003f83f0 FS$$TOL 003f842b _MyInitInterrupt 003f845d _ConfiguraADC 003f8486 _InitPieCtrl 003f84a7 _InitSysCtrl 003f84c6 I$$TOFS 003f84e0 _InitAdc 003f84f7 FS$$CMP 003f850e _qsinlt 003f851f __nop 003f8520 __register_lock 003f8524 __register_unlock 003f8528 FS$$SUB 003f8531 _DSP28x_usDelay 003f8535 SINTAB_360 003f8535 ___etext__ 003f8535 etext 003f8636 ___cinit__ 003f8636 cinit ffffffff ___binit__ ffffffff ___c_args__ ffffffff ___pinit__ ffffffff binit ffffffff pinit [103 symbols]
I don't see anything obviously wrong with the assembly or the .map file. The global variable is in the L0 SRAM, which is fine. Can you provide a screenshot that shows the CPU register values right before the MOV @0xd, AL instruction is executed?
Also, can you try initializing the variable to a different value? Instead of:
int j=0,
l=0,
nl=0,
n=0;
You could do:
int j=0,
l=0,
nl=100,
n=0;
Thanks,
I Changed the configuration target to TMS320F2812 and it worked very well. But Code Composer gave the message:
28xx: Flash Programmer: Warning: The configured device (TMS320F2812), does not match the detected device (). Flash Programming operations could be affected. Please consider modifying your target configuration file.
Do you think it is a problem? The fact is is I configure with TMS320R2812 dont work and with TMS320F2812 work. I can continue using this way?
Very thank