Table of Contents |
---|
Introduction
This page gives an overview of tmrctr driver which is available as part of the Xilinx Vivado and SDK distribution.Source path for the driver;
https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/tmrctr
Driver source code is organized into different folders. Below diagram shows the tmrctr driver source organization
tmrctr
|
-- Doc - Provides the API and data structure details
|
- Examples - Reference application to show how to use the driver APIs and calling sequence
|
- Source - Driver source files
Features Supported
Driver features supported
- Two identical modules each timer/counter module having two 32/64-bit counters
- The timer/counters support polled mode, interrupt driven mode, enabling and disabling specific timers, PWM operation and the cascade mode operation to get a 64-bit timer/counter
- Support both increment and decrement counting
- Ability to produce output in PWM by using the two timer/counters as a pair with a specified frequency and duty factor
Known issues and Limitations
- none
Test cases
TMRCTR fast interrupt example:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/tmrctr/examples/xtmrctr_fast_intr_example.cThe purpose of this example is to illustrate axi timer fast interrupt mode. It initializes a timer/counter and sets it up in the compare mode in the auto reload such that the periodic interrupt is generated.
Output
Code Block | ||
---|---|---|
| ||
Successfully ran Tmrctr fast interrupt Example |
TMRCTR interrupt 64-bit example:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/tmrctr/examples/xtmrctr_intr_64bit_example.cThis example initializes a 64-bit timer/counter, which is only in cascade mode and sets it up in the compare mode in the auto reload such that the periodic interrupt is generated
Output
Code Block | ||
---|---|---|
| ||
Successfully ran Tmrctr interrupt 64bit Example |
TMRCTR interrupt example:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/tmrctr/examples/xtmrctr_intr_example.cThis example initializes a timer/counter and sets it up in the compare mode in the auto reload such that the periodic interrupt is generated.
Output
Code Block | ||
---|---|---|
| ||
Successfully ran Tmrctr interrupt Example |
TMRCTR low level example:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/tmrctr/examples/xtmrctr_low_level_example.cThis example deals with the tmrctr low level API's. It starts the timer/counter such that its incrementing by default in the polled mode and checks if the count is changed.
Output
Code Block | ||
---|---|---|
| ||
Successfully ran Tmrctr lowlevel Example |
TMRCTR polled example:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/tmrctr/examples/xtmrctr_polled_example.cThis example enables the auto reload mode and starts the timer/counter such that its incrementing by default in the polled mode and checks if the count is changed.
Output
Code Block | ||
---|---|---|
| ||
Successfully ran Tmrctr polled Example |
TMRCTR selftest example:
https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/tmrctr/examples/xtmrctr_selftest_example.cThis example performs a self test to ensure that the hardware was built correctly.
Output
Code Block | ||
---|---|---|
| ||
Successfully ran Tmrctr selftest Example |
Changelog
2020.2
- Updated makefile for parallel make execution and incremental build support.
2020.1
- Updated xtmrctr_intr_64bit_example.c to reduce time required to complete the example
2019.2
- None
2017.3
- Resolved compilation warnings
- Updates XTmrCtr_DisableIntr macro to not to clear T0INT flag.
- Modified tmrctr.tcl to append 'U' to all constant definitions exported from the tmrctr driver to the xparameters.h