楼主参考一下下面这个历程:
C:ticontrolSUITEdevice_supportf2806xv130F2806x_examplescla_adc_fir_flash
void init_cla()
[
//
// This code assumes the CLA clock is already enabled in
// the call to InitSysCtrl();
//
// EALLOW: is needed to write to EALLOW protected registers
// EDIS: is needed to disable write to EALLOW protected registers
//
// Initalize the interrupt vectors for Task 7 (CLA FIR Filter)
// and for Task 8 (FIR filter initalization)
//
// The symbols used in this calculation are defined in the CLA
// assembly code and in the CLAShared.h header file
//
EALLOW;
Cla1Regs.MVECT7 = (Uint16) (&Cla1Task7 - &Cla1Prog_Start)*sizeof(Uint32);
Cla1Regs.MVECT8 = (Uint16) (&Cla1Task8 - &Cla1Prog_Start)*sizeof(Uint32);
//
// Task 7 has the option to be started by either EPWM7_INT or ADCINT7
// In this case we will allow ADCINT7 to start CLA Task 7
//
Cla1Regs.MPISRCSEL1.bit.PERINT7SEL = CLA_INT7_ADCINT7;
//
// 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
//
memcpy(&Cla1funcsRunStart, &Cla1funcsLoadStart, (Uint32)&Cla1funcsLoadSize);
Cla1Regs.MMEMCFG.bit.PROGE = 1;
//
// Enable the IACK instruction to start a task
// Enable the CLA interrupt 8 and interrupt 7
//
Cla1Regs.MCTL.bit.IACKE = 1;
Cla1Regs.MIER.all = (M_INT8 | M_INT7);
//
// Force CLA task 8 using the IACK instruction
// Task 8 will initalize the filter input delay
// line to zero (X[0] - X[4]).
//
// No need to wait, the task will finish by the time
// we configure the ePWM and ADC modules
//
Cla1ForceTask8();
]
如果您认为此问题已被解答,请在“这是否解答您的问题” 后,点击“是”按钮! 谢谢您的合作!
楼主参考一下下面这个历程:
C:ticontrolSUITEdevice_supportf2806xv130F2806x_examplescla_adc_fir_flash
void init_cla()
[
//
// This code assumes the CLA clock is already enabled in
// the call to InitSysCtrl();
//
// EALLOW: is needed to write to EALLOW protected registers
// EDIS: is needed to disable write to EALLOW protected registers
//
// Initalize the interrupt vectors for Task 7 (CLA FIR Filter)
// and for Task 8 (FIR filter initalization)
//
// The symbols used in this calculation are defined in the CLA
// assembly code and in the CLAShared.h header file
//
EALLOW;
Cla1Regs.MVECT7 = (Uint16) (&Cla1Task7 - &Cla1Prog_Start)*sizeof(Uint32);
Cla1Regs.MVECT8 = (Uint16) (&Cla1Task8 - &Cla1Prog_Start)*sizeof(Uint32);
//
// Task 7 has the option to be started by either EPWM7_INT or ADCINT7
// In this case we will allow ADCINT7 to start CLA Task 7
//
Cla1Regs.MPISRCSEL1.bit.PERINT7SEL = CLA_INT7_ADCINT7;
//
// 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
//
memcpy(&Cla1funcsRunStart, &Cla1funcsLoadStart, (Uint32)&Cla1funcsLoadSize);
Cla1Regs.MMEMCFG.bit.PROGE = 1;
//
// Enable the IACK instruction to start a task
// Enable the CLA interrupt 8 and interrupt 7
//
Cla1Regs.MCTL.bit.IACKE = 1;
Cla1Regs.MIER.all = (M_INT8 | M_INT7);
//
// Force CLA task 8 using the IACK instruction
// Task 8 will initalize the filter input delay
// line to zero (X[0] - X[4]).
//
// No need to wait, the task will finish by the time
// we configure the ePWM and ADC modules
//
Cla1ForceTask8();
]
如果您认为此问题已被解答,请在“这是否解答您的问题” 后,点击“是”按钮! 谢谢您的合作!
举报