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.

TMS320F28035: TI controlSuite 里面提供了一个步进驱动器历程,里面有用到了CPUTIMER0/1/2,但是没看到三个定时器的初始化。

Part Number: TMS320F28035
Other Parts Discussed in Thread: CONTROLSUITE

现在在看步进电机的历程,路径上:

C:\ti\controlSUITE\development_kits\DRV8412-C2-KIT_v131\Stepper\Stepper.c

其中有好几个状态机,状态机的切换和三个CPUTimer0、1、2相关。

但是在代码里面又没有看到三个定时器的初始化过程啊。请问这是怎么回事?

  • 以下是CPU TIMER初始化:

    // Timing sync for slow background tasks
    // Timer period definitions found in device specific PeripheralHeaderIncludes.h
    CpuTimer0Regs.PRD.all = mSec1; // A tasks
    CpuTimer1Regs.PRD.all = mSec5; // B tasks
    CpuTimer2Regs.PRD.all = mSec50; // C tasks

    以下是CPU timer的中断标志:

    if(CpuTimer0Regs.TCR.bit.TIF == 1)
    {
    CpuTimer0Regs.TCR.bit.TIF = 1; // clear flag

    }