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.
工具/软件:Code Composer Studio
尊敬的所有,
当我读取 ADC 结果时、CLA 任务,为什么所有返回的变量始终 为0?
如下所示、AdcaResultRegs.ADCRESULT13 = 4095,、但 f32AdcResultA3S = 0。
#pragma DATA_SECTION (f32AdcResultA3S、"CLAData");
#pragma DATA_SECTION (f32AdcResultA4S、"CLAData");
#pragma DATA_SECTION (f32AdcResultA5S、"CLAData");
float32 f32AdcResultA3S=0;
float32 f32AdcResultA4S = 0;
float32 f32AdcResultA5S = 0;
Cla1Share :origin = 0x00A000、length = 0x000A00
CLA 数据 :> Cla1Share,page=1
C28x 和 CLA 上有不同大小的数据类型。 除非遵循共享变量的指导原则、否则这可能会导致问题。
请参阅以下两个常见问题解答:
您还可以在 CLA 软件开发指南中找到 CLA 入门信息、该指南非常有用:
此致
Lori
非常感谢,工作正常!
我的解决方案:
typedef union
{
volatile unsigned short *ptr;//对齐到低16位
volatile unsigned int *pad;//32位
} CLA_FPR;
typedef 结构
{
CLA_FPR A;
CLA_FPR b;
cla_Fptr c;
}F_Three _PHASE_ADC;
C28:tGridVolADCount.a.pad =(volatile UINT16 *)&AdcaResultRegs.ADCRESULT13;
CLA:float32 temp =*(tGridVolADCount.a.ptr);