请问为什么要在开启定时器的时候使用这样一条语句呢?(我用的是28335的芯片)
CpuTimer0Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0程序在下面:
================================================================// Configure CPU-Timer 0, 1, and 2 to interrupt every second:
// 100MHz CPU Freq, 1 second Period (in uSeconds)
ConfigCpuTimer(&CpuTimer0, 100, 1000000);
ConfigCpuTimer(&CpuTimer1, 100, 1000000);
ConfigCpuTimer(&CpuTimer2, 100, 1000000);
#endif
// To ensure precise timing, use write-only instructions to write to the entire register. Therefore, if any
// of the configuration bits are changed in ConfigCpuTimer and InitCpuTimers (in DSP2833x_CpuTimers.h), the
// below settings must also be updated.
CpuTimer0Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
CpuTimer1Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
CpuTimer2Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
那么问题来了,请问为什么还要在开启定时器的时候使用
CpuTimer0Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
这样一条语句呢?虽然这条语句确实能够将定时器启动,但是它会影响到
FREE=1 SOFT=1 (自由运行模式)这个状态
还有就是0x4001中的最低位为什么是1呢?手册中0~3位是保留的啊?
不太明白0x4001的原因,还请各位大大指教指教,谢谢大家!