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.

[参考译文] TM4C123GH6PZ:TM4C123GH6:TimerMatchSet () 行为问题

Guru**** 2909750 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1579073/tm4c123gh6pz-tm4c123gh6-timermatchset-behaviour-issue

器件型号:TM4C123GH6PZ


您好:

我使用 32 位计时器对在输入 GPIO 上接收到的脉冲进行计数。

当接收到脉冲计数时、我希望调用中断处理程序。 我想针对不同的计数值(100,150,180 等)执行此操作。

TM4C123 会按预期调用中断处理程序。 第一次用 TimerValueGet () 读取计数器值时,在调用 TimerMatchSet () 进行下一次计数之前,我读取了一个合适的值。 第二次调用中断处理程序时、用 TimerValueGet () 读取的值为 0。 我没有开始时的脉冲计数。 计数器似乎被重置为 0。

这是正常行为吗? 因为我想让 TimerLoadSet (0) 的总脉冲计数。

你有想法吗?

感谢你的帮助。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    TimerLoadSet (0) 会将加载寄存器 (LR) 设置为 0、因此计时器将有效地不计数(重复计数为 0)。  

    如果您使用边沿计数模式、计数器将在匹配事件之后自动复位[参考数据表 (SPMS376E) 第 11.3.2.3 节]。

    您能否发布实际使用的序列?