16.2. GPTMR input captrue

16.2.1. Overview

The example shows input capture.

16.2.2. Board Setting

Please refer to Pin Description for specific board. Connect external PWM signal to GPTMR capture pin.

16.2.3. Running the example

Running the example, the serial terminal outputs the following infomation,and prints out the edge interval time captured each time,that is, the time of one cycle.

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