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.

LAUNCHXL-CC2640R2: GPTimer定时器记录的上升沿和下降沿的计数值存放的在哪个寄存器? 是否是存放在GPT:TnR寄存器中? 每个上升沿或下降沿都会产生一次中断吗? timerA寄存器地址与timerB寄存器地址的offest相差多少?

LAUNCHXL-CC2640R2: GPTimer定时器记录的上升沿和下降沿的计数值存放的在哪个寄存器?

是否是存放在GPT:TnR寄存器中?

每个上升沿或下降沿都会产生一次中断吗?

 timerA寄存器地址与timerB寄存器地址的offest相差多少?

  • 如果我使用的是定时器B,是否可以通过这样获得计数值
    /*!
    * @brief Retrieve the current value of timer
    * This returns the value of the timer in all modes except for
    * input edge count and input edge time mode.
    * In edge count mode, this register contains the number of edges that
    * have occurred. In input edge time, this register contains the
    * timer value at which the last edge event took place.
    * In 16-bit modes the function will return a 24-bit word where the
    * 8-bit prescaler value is included.
    */
    GPTimerCC26XX_Value GPTimerCC26XX_getValue(GPTimerCC26XX_Handle handle)
    {
    return GPTimerCC26XX_getTimerValue(handle, GPT_O_TAR);
    }
    只需要把 GPT_O_TAR改为 GPT_O_TBR即可
  • 是的,
    Based on the value in the register field TnMR.TnILD, this register is updated with the value from TnILR register either on the next cycle
    or on the next timeout. A read returns the current value of the Timer A Count Register, in all cases except for Input Edge count and Timer modes.

    In the Input Edge Count Mode, this register contains the number of edges that have occurred. In the Input Edge Time mode, this register contains the time at which the last edge event took place.