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.

全局变量数据异常

Other Parts Discussed in Thread: TMS320F28062

我们使用的是TMS320F28062这款芯片。电流电压采集计算过程中概率性出现异常数据1.#INF,1.#QNAN,出现在上电的一瞬间,或者在仿真状态下,程序运行的瞬间。

在ADC中断中计算电压BST.Vab,BST.Vbc

BST.Vab = ((float)AdcResult.ADCRESULT0 + (float)AdcResult.ADCRESULT10 - ADOffset.Vab)* AdjKCoef.Vab;
BST.Vbc = ((float)AdcResult.ADCRESULT1 + (float)AdcResult.ADCRESULT11 - ADOffset.Vbc)* AdjKCoef.Vbc;

某一次运行运行时出现BST.Vbc 为1.#QNAN时,鼠标将光标移变量BST.Vbc上方是显示:

  (x)= BST.Vc      float   -1.#QNAN 

name : BST.Vbc

       Default: -1.#QNAN 

       Hex:0xFFC07A86

       Decimal:-1.#QNAN 

       Octal:037760075206

       Binary:11111111110000000111101010000110

另外,将某些全局变量(这些变量与上述变量没有逻辑关系)定义位置往后挪几行,发现出现上述问题没有出现。

各位大侠,能帮忙解释原因吗?