Page 342.
9.3.3.3 16-Bit Input Edge Time Mode 输入边沿计时模式
Each time a rising edge event is detected, the current count value is loaded into the GPTMTnR register, and is held there until another rising edge is detected (at which point the new count value
is loaded into GPTMTnR).
每当检测到上升沿,定时器捕捉当前值存放到GPTMTnR寄存器,该值一直保存直到下一个上升沿到来才更新。
page 371
9.6 Register 17
This register shows the current value of the TimerA counter in all cases except for Input Edge Count
mode. When in this mode, this register contains the time at which the last edge event took place
GPTMTAR保存的是定时器当前值,除了输入边沿计数模式外。在输入边沿计数模式下,该寄存器保存最近一次边沿事件发生的时间。
问题1.Page 371的输入边沿计数模式是否应当更改为输入边沿计时模式。
问题2.若问题1成立,那么读GPTMTnR将返回事件发生时定时器的捕捉值,而不是定时器自由运行的当前值?
你的问题1确实是的, 输入边沿计数模式应该更改为输入边沿计时模式.
其实不存在2这个问题,既然是边沿计时模式,寄存器GPTMTAR就应该保存边沿发生时的时间,如果保存的是定时器的当前值,哪你直接读定时器的寄存器就行了。
这个功能设计的目的就是为了测试边沿间隔时间用的,所以保存边沿发生时的时间是合理的。