16.2. GPTMR输入捕获例子

16.2.1. 概述

input_captrue示例工程演示了GPTMR输入捕获的功能.

16.2.2. 硬件设置

请参考具体开发板引脚描述部分的描述。 连接外部PWM至GPTMR输入捕获引脚。

16.2.3. 运行现象

运行工程,示例执行GPTMR的输入捕获的功能,串口终端输出如下信息,打印出每次捕获到的边沿间隔时间,也就是一个周期的时间。

gptmr input capture test
capture the pulse width : 100001 tick
capture the pulse width : 100000 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100000 tick
capture the pulse width : 100000 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick
capture the pulse width : 100000 tick
capture the pulse width : 100001 tick
capture the pulse width : 100001 tick