Part Number:TMS320F28035Other Parts Discussed in Thread:CONTROLSUITE
现在在看步进电机的历程,路径上:
C:\ti\controlSUITE\development_kits\DRV8412-C2-KIT_v131\Stepper\Stepper.c
其中有好几个状态机,状态机的切换和三个CPUTimer0、1、2相关。
但是在代码里面又没有看到三个定时器的初始化过程啊。请问这是怎么回事?
Green Deng:
以下是CPU TIMER初始化:
// Timing sync for slow background tasks// Timer period definitions found in device specific PeripheralHeaderIncludes.hCpuTimer0Regs.PRD.all = mSec1; // A tasksCpuTimer1Regs.PRD.all = mSec5; // B tasksCpuTimer2Regs.PRD.all = mSec50; // C tasks
以下是CPU timer的中断标志:
if(CpuTimer0Regs.TCR.bit.TIF == 1){CpuTimer0Regs.TCR.bit.TIF = 1; // clear flag
}