AM243x MCU+ SDK  11.00.00
GPTIMER PWM Capture

Introduction

This example demonstrates the timer's functionality in PWM Generation mode and input capture mode. In this Example one Timer is configured in PWM_GEN mode and the other one is configured in INPUT_CAPTURE mode. The first timer is configured to generate a 1 KHz Square wave.

The other timer is configured to capture two consecutive edges and call the callback on second capture. In the callback the capture values are read, the difference is stored and a semaphore is posted.

Application starts the capture timer first and then starts the PWM generating timer and pends semaphore to be posted on capture. On post application stops both counters and exits.

The counter source Clock in both cases is set to MCU_HFOSC0 giving it a 25 MHz tick with counter Presacler disabled.

  • Connect Pin 74 of J8 (MMC1_SDCD) to Pin 73 of J8 (MMC1_SDWP).
  • Example is not supported for EVM Board.

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 nortos
r5fss0-0 freertos
Toolchain ti-arm-clang
Boards am243x-lp
Example folder examples/drivers/gp_timer/gp_timer_pwm_capture

Steps to Run the Example

See Also

GPTIMER

Sample Output

Shown below is a sample output when the application is run,

GP Timer PWM Capture Test Started ...
Ticks between Rising and falling edge : 12500
All tests have passed!!