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.

TMS320F28027: 技术手册上关于TIM1的时钟和使能位均在复位后处于使能状态,难道芯片上电复位后TIM1定时器是运行状态,谢谢!

Part Number: TMS320F28027
Other Parts Discussed in Thread: C2000WARE

CPUTIMER1ENCLK 复位的时候R/W-1,The CPU Timer 1 is clocked

TIMERxTCR Register 的TSS位 R/W-0 Reads of 0 indicate the CPU-timer is running.To start or restart the CPU-timer, set TSS to 0. At reset, TSS is cleared to 0 and the CPU-timer immediately starts.

按照手册所说定时器1复位后是运行状态的 难道上电的时候要先禁止T1的使能位才能保证时间的正常运行?

还有我目前的程序以T1做100us中断,中断中程序比较多但总体执行时间不会超过中断的时间,这样是否合理?是否影响了中断机制?

此外我想自己定义变量使用,CMD命令给数组和结构体分配空间我看到了,那怎么利用CMD给单一变量或者多个变量指定空间还是编译器自动分配了空间?

谢谢!

  • 你好:

    1、

    保证时间的正常运行

    这里说的正常运行是指什么?关于TSS寄存器,例程(C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2802x\examples\drivers\cpu_timer)中有使用这个寄存器的说明:

    // 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 f2802x_CpuTimers.h), the
    // below settings must also be updated.
    //

    //
    // Use write-only instruction to set TSS bit = 0

    2、如果你的程序中没有别的中断,那应该没什么问题。如果有其他中断,那么如果如果执行完T1+other中断的时间超过100us的话就必然会有影响。

    3、单一变量或者多个变量的空间,如果不特别指定的话就会自动分配,指定变量空间不是必须的。