程序在仿真是下载到板子可以正常运行,下载到flash后不能正常运行。
在程序中使用了adc,epwm,高精度sin信号发生器示例代码。
在下载到flash后仿真设置断点,epwm可以正常工作,adc不能识别电压,sin发生器不能更新输出信号。
以上情况在ram仿真运行无问题,只有下载flash后运行不正常,同时试过其他程序下载flash是可以正常运行的;
这是为什么呢?
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.
程序在仿真是下载到板子可以正常运行,下载到flash后不能正常运行。
在程序中使用了adc,epwm,高精度sin信号发生器示例代码。
在下载到flash后仿真设置断点,epwm可以正常工作,adc不能识别电压,sin发生器不能更新输出信号。
以上情况在ram仿真运行无问题,只有下载flash后运行不正常,同时试过其他程序下载flash是可以正常运行的;
这是为什么呢?
while(1)
{
SMG_DisplayFloat(sqvout,3);
switch( KEY_Scan(0))
{
case 1:
a++;
if(a>=10)
{a=0;}
LCD9648_Write16shu(0,0,a);
break;
case 2:
b++;
if(b>=10)
{b=0;}
LCD9648_Write16shu(8,0,b);
break;
case 3:
c++;
if(c>=10)
{c=0;}
LCD9648_Write16shu(16,0,c);
break;
case 4:
vd++;
if(vd>=10)
{vd=0;}
LCD9648_Write16shu(32,0,vd);
break;
case 5:
ve++;
if(ve>=10)
{ve=0;}
LCD9648_Write16shu(40,0,ve);
break;
case 9:
sin_freq=a*100+b*10+c+vd*0.1+ve*0.01;
if(sin_freq==0)
{sin_freq=1;}
Scanning_ratio=50000/sin_freq;
sgne.freq=sin_freq/50000*65536;
break;
}
}
}