This example demonstrates the timer's functionality in compare match mode. In the Example interrupt is enabled and a compare match user callback is registered. In the callback the counter is reset to zero and a match count variable is incremented. The application waits until the match count variable updates and on update prints its value. Application stops the timer and exits when match count reaches 10.
The counter source Clock is set to MCU_HFOSC0 giving it a 25 MHz tick with the counter Presacler disabled. Compare value is set to 12500000. Therefore the callback is called approximately twice every second.
Parameter | Value |
---|---|
CPU + OS | r5fss0-0 nortos |
r5fss0-0 freertos | |
Toolchain | ti-arm-clang |
Board | am64x-evm, am64x-sk |
Example folder | examples/drivers/gp_timer/gp_timer_compare_match_callback |
Shown below is a sample output when the application is run,