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.
我用CLA执行两个任务,task8和task1,task8使用软件触发,task1使用ADCINT1触发,现在问题是,我用软件触发task8之后,task8无法执行,而只有task1才能被中断触发。
EALLOW;
// Copy the CLA program code from its load address to the CLA program memory
// Once done, assign the program memory to the CLA
// Make sure there are at least two SYSCLKOUT cycles between assigning
// the memory to the CLA and when an interrupt comes in
// Call this function even if Load and Run address is the same!
// MemCopy(&Cla1funcsLoadStart, &Cla1funcsLoadEnd, &Cla1funcsRunStart);
memcpy(&Cla1funcsRunStart, &Cla1funcsLoadStart, (Uint32) &Cla1funcsLoadSize);
asm(" RPT #3 || NOP");
Cla1Regs.MMEMCFG.bit.PROGE = 1; // Configure the RAM as CLA program memory
// Cla1Regs.MMEMCFG.bit.RAM0E = 1; // configure RAM L1, F28035 as CLA Data memory 0
// Cla1Regs.MMEMCFG.bit.RAM1E = 1; // Configure RAM L2, F28035 as CLA data memory 1
// Symbols used in calculation are defined in CLA_Shared.h file
Cla1Regs.MVECT1 = ((Uint16) Cla1Task1 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT2 = ((Uint16) Cla1Task2 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT3 = ((Uint16) Cla1Task3 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT4 = ((Uint16) Cla1Task4 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT5 = ((Uint16) Cla1Task5 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT6 = ((Uint16) Cla1Task6 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT7 = ((Uint16) Cla1Task7 - (Uint16) &Cla1Prog_Start);
Cla1Regs.MVECT8 = ((Uint16) Cla1Task8 - (Uint16) &Cla1Prog_Start);
// Enable the IACK instruction to start a task (software task triggering)
Cla1Regs.MCTL.bit.IACKE = 1;
Cla1Regs.MPISRCSEL1.bit.PERINT1SEL = 0; // 0=ADCINT1 1=none 2=EPWM1INT
// Enable the CLA interrupt 1 (Allow CLA to be interrupted)
Cla1Regs.MIER.all = M_INT1;
// Configure the interrupt that would occur each control cycles
asm(" RPT #3 || NOP");
// No need to wait, the task will finish by the time
// we configure the ePWM and ADC modules
Cla1ForceTask8();
EDIS;
}
我认为是我的cmd有问题,我觉得源代码并没有问题的,请工程师们帮我分析下原因。
可能是因为您没有打开任务8.
Cla1Regs.MIER.all = M_INT1; 应该改为:Cla1Regs.MIER.all = (M_INT1 | M_INT8);
Setting the bits in the interrupt enable register (MIER) allow an incoming interrupt or main CPU software to start the corresponding CLA task. Writing a 0 will block the task, but the interrupt request will still be latched in the flag register (MIFLG). S