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.

280049 CLA调试问题

Other Parts Discussed in Thread: C2000WARE

各位晚上好!

我这两天在调试CLA功能时碰到点问题,麻烦大家帮我看看,谢谢

配置情况:

1.CLA只使能了Task2和Tas8,其中Task8通过软件触发,且只有在初始化时会触发;Task2通过Timer1触发。

2.Timer1 500us溢出一次,只使能外设级中断(向量表以及PIE没有使能)。

调试情况:

1.用仿真器在线调试,连接CLA后运行,通过设置断点可以看到Task2能够运行,能够停在断点所在处。

2.将断点注释掉后,再次编译运行,发现Task2只运行一次,就一直停在MSTOP处,可Timer1是周期触发的。

3.查看手册发现,CLA任务只能在触发源信号的边沿进行触发,而TImer1中断一次后由于没有进入中断服务函数进行清除中断标志位,因此标志位会一直是1,因此怀疑是否是这一点导致Task2只触发一次。

4.将Timer1的中断向量以及PIE使能,在中断服务函数中清除Timer1的中断标志位,发现,Task2仍然只运行一次就停在MSTOP。

5.将Task2的触发方式由Timer1换成软件触发,触发函数在Timer1中每500us执行一次,发现Task2依然只执行一次。

问题:

为什么触发源是周期性触发,但Task2只运行一次就停在MSTOP上?

  • user4612577 说:
    3.查看手册发现,CLA任务只能在触发源信号的边沿进行触发,而TImer1中断一次后由于没有进入中断服务函数进行清除中断标志位,因此标志位会一直是1,因此怀疑是否是这一点导致Task2只触发一次。

    根据您的描述,因为没有清中断标志而不能再次触发task的可能性比较高

    您是如何清除中断标志的?

    在TI例程内有类似的代码,您可以参考一下,路径为 C:\ti\c2000\C2000Ware_3_01_00_00\device_support\f28004x\examples\cla

    //-----------------------------------------------------------------------------
    //
    // CLA Task 1 End-of-Task Interrupt Service Routine
    //
    // Description: This ISR is run every time task 1 completes. It continuously
    // takes the filtered values from the CLA and stores it to a circular buffer
    //
    //-----------------------------------------------------------------------------
    #ifdef __cplusplus
    #pragma CODE_SECTION(".TI.ramfunc");
    #else
    #pragma CODE_SECTION(cla1Isr1, ".TI.ramfunc")
    #endif
    __attribute__((interrupt))  void cla1Isr1 ()
    {
    	EALLOW;
    
        //
        // Clear the ADC interrupt flag so the next SOC can occur
        //
        AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1U;
    
        //
        // Acknowledge the end-of-task interrupt for task 1
        //
        PieCtrlRegs.PIEACK.bit.ACK11 = 1U;
    
        EDIS;
    }