Other Parts Discussed in Thread: LAUNCHXL-F280049C
Hi all
we find unusual error while using TMS320F280049CPM and either CCS 10.2.0.00009 or CCS 10.4.0.00006.
We use TMS and TCK from our board to LAUNCHXL-F280049C (I only use MSP432E401YTPDT from the LAUNCHXL-F280049C) debugging interface to PC
Actually we find this issue while doing Instaspin FOC lab from TI, I discovered unusual ADC calculation result, then, we make much simpler code to investigate the error. Please refer to the attached video ( https://drive.google.com/file/d/1xeMcQ_gLstLLm2zCo6sryPC8qjKjjeip/view?usp=sharing ) and below explanation regarding the error
- The issue is CCS failed to display (by monitoring CCS expression window) the result of this simple equation Ia = ((aaa == 1.0) ? 2.0 : 0.0) * (200.0/4096.0) - 100.0; while we change variable aaa between 2.0 or 0.0 inside the loop. As you will expect, Ia value should be either -99.9023438 or -100.0, but as you can see from the video, there are many Ia result except those 2 value.
- Then we remove the subtraction and call it as Ib = ((aaa == 1.0) ? 2.0 : 0.0) * (200.0/4096.0); By removing the subtraction (-100), we can get correct result for Ib, Ib only have 2 possible value : 0.09765625 or 0.0 depend on aaa value.
- Then we remove the toggle variable aaa from Ia, and name it as Ic = 2.0 * (200.0/4096.0) - 100.0; Again by removing the toggle variable aaa, we can get correct result Ic will always be -99.9023438. So it mean there is no error with either the FPU or the syntax.
- Then we guess the error is with the CCS debugger display, so I let TMS320F2800049CPM to calculate the max and min of it’s calculated Ia value and also to increment the er variable, if TMS320 encounter any unexpected result, by adding below 3 lines code :
if((Ia<-100.0)||(Ia>-99.9)) {er++;}
if(Ia>maxia) maxia=Ia;
if(Ia<minia) minia=Ia;
And from the expression window, we can see, the max and min value will be as expected : -99.9023438 or -100.0, and er variable always 0, mean no error encountered by the TMS320.
For more detail please refer to the code https://drive.google.com/file/d/1t_N1BwckJSZoHvgldtmCRkZ9sDrToKfr/view?usp=sharing for your test
From the above explanation we conclude the error is only at the CCS expression window, because from point no 4 and 5, TMS320 do not find any unexpected result.
So how to solve this issue, because we really depend on the expression display while we do debugging.
Thank you and best regards
evan
