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.
// -------------------------------- FRAMEWORK --------------------------------------
// State Machine function prototypes
//----------------------------------------------------------------------------------
// Alpha states
void A0(void); //state A0
void B0(void); //state B0
void C0(void); //state C0
// A branch states
void A1(void); //state A1
void A2(void); //state A2
void A3(void); //state A3
void A4(void); //state A4
// B branch states
void B1(void); //state B1
void B2(void); //state B2
void B3(void); //state B3
void B4(void); //state B4
// C branch states
void C1(void); //state C1
void C2(void); //state C2
void C3(void); //state C3
void C4(void); //state C4
// Variable declarations
void (*Alpha_State_Ptr)(void); // Base States pointer
void (*A_Task_Ptr)(void); // State pointer A branch
void (*B_Task_Ptr)(void); // State pointer B branch
void (*C_Task_Ptr)(void); // State pointer C branch
CpuTimer0Regs.PRD.all = mSec5; // A tasks
CpuTimer1Regs.PRD.all = mSec10; // B tasks
CpuTimer2Regs.PRD.all = mSec100; // C tasks
// Tasks State-machine init
Alpha_State_Ptr = &A0;
A_Task_Ptr = &A1;
B_Task_Ptr = &B1;
C_Task_Ptr = &C1;
void A1(void) // SCI-GUI
//--------------------------------------------------------
{
//SerialHostComms(); // Serialport controls LED2 (GPIO-31)
// Will not blink until GUI is connected
test_time++;
//the next time CpuTimer0 'counter' reaches Period value go to A2
A_Task_Ptr = &A2;
//-------------------
}
A tasks的周期是5ms,B tasks 的周期是10ms,C tasks的周期是100ms,
我把测试变量 test_time++放在void A1()函数中,为什么不计数??
CpuTimer0Regs.PRD.all = mSec5; // A tasks
CpuTimer1Regs.PRD.all = mSec10; // B tasks
CpuTimer2Regs.PRD.all = mSec100; // C tasks
CpuTimer0中断还能使用吗?
CpuTimer0Regs.PRD.all = mSec5; // A tasks
CpuTimer1Regs.PRD.all = mSec10; // B tasks
CpuTimer2Regs.PRD.all = mSec100; // C tasks
CpuTimer0中断还能使用吗?
// Current Offset Calculation Routine
// Caluculates the Offset on sensed current
Offset_IphA=0;
Offset_IphA=0;
i=0;
while(i<10)
{
DSP28x_usDelay(10);
Offset_IphA=(float)Ipfc1R;
Offset_IphB=(float)Ipfc2R;
i--;
}
Offset_IphA=(Offset_IphA*0.000244140625);
Offset_IphB=(Offset_IphB*0.000244140625);
//=================================================================================
// BACKGROUND (BG) LOOP
//=================================================================================
//--------------------------------- FRAMEWORK -------------------------------------
for(;;) //infinite loop
{
test_time++;
// State machine entry & exit point
//===========================================================
(*Alpha_State_Ptr)(); // jump to an Alpha state (A0,B0,...)
//===========================================================
}
for(;;)函数进不去,test_time++不反应,好像一直在while(i<10)循环,我的例程是High-voltage Motor Control+PFCkit
ACI and PFC(with CLA)
CpuTimer0Regs.PRD.all = mSec5; // A tasks
CpuTimer1Regs.PRD.all = mSec10; // B tasks
CpuTimer2Regs.PRD.all = mSec100; // C tasks
CPU的三个内部定时器,被ABC tasks用了,5ms,10ms,100ms,
interrupt void cpu_timer0_isr(void);中断函数的周期也只能是5ms了吗?
你把Cputimer0的周期改一下,就变成别的时间了啊。
是不是停止到了DSP28x_usDelay(10); 里面了。
你单步跟踪一下,到底停止到什么地方了,是否是进入了illegal ISR了,那里面有个ESTOP,就出不来了。
否则不会在while(i<10)里面出不来。
把程序烧写到Flash中,用Load Symbols单步执行,看看到底停止到哪里了,为什么出不来。
i=0;
while(i<10)
{
DSP28x_usDelay(10);
Offset_IphA=(float)Ipfc1R;
Offset_IphB=(float)Ipfc2R;
i--;
}
这个函数是个死循环
您好,我想请教一下,TI的controlSUITE电机控制例程FOC(dsp2833x),dsp2833x是浮点型的,为什么程序是定点的呢,那这和用dsp2812控制有什么区别吗
您好,我想请教一下,TI的controlSUITE电机控制例程FOC(dsp2833x),dsp2833x是浮点型的,为什么程序是定点的呢,那这和用dsp2812控制有什么区别吗