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.

MSP432P4011 定时器TA1 读取当前COUNT数值



请问TI工程师:

        我需要读MSP432P4011  定时器TA1的当前的COUNT数值

        使用函数  Timer_A_getCounterValue(TIMER_A1_BASE

        说可能不可靠  ,必须读2次   然后看2次读取的数据是否<10  才能认为是安全的。

        我能直接读  TA1R   寄存器吗?    同时  为何TA1R   寄存器  CCS不认识  

  • 在TRM内有写道

    When the timer clock is asynchronous to the CPU clock, any read from TAxR should occur while the timer is not operating or the results may be unpredictable. Alternatively, the timer may be read multiple times while operating, and a majority vote taken in software to determine the correct reading.

    我试了一下,确实不准确,要重复测试才可以

    TAR的值,可以在线调试时查看,也可以使用下面的语句读取