The APB Advanced Timer is a highly flexible timer module designed for integration with an APB (Advanced Peripheral Bus). It consists of multiple independent timer blocks, each capable of counting based on configurable settings.
This README provides an overview of the APB Advanced Timer, its block diagrams, and how it can be seamlessly integrated into your system using the OBI (Open Bus Interface).
The following diagram provides a top-level view of the APB Advanced Timer module. This diagram shows the general structure of the timer, though some configuration connections (e.g., from adv_timer_apb_if to the timers and event logic) have been omitted for clarity.
The APB Advanced Timer module contains four independent timer blocks. These blocks are controlled by internal signals (s_ctrl_x), which govern their operation. This allows each timer block to function independently, providing great flexibility for time-based operations.
Note that the configuration signals (cfg_x) and control signals (s_ctrl_x) are omitted from the diagram to reduce visual complexity.
This diagram illustrates how to instantiate the apb_adv_timer component when integrating with an OBI (Open Bus Interface). The reg_adv_timer_wrap.sv file includes the wrapping logic required for this interface, ensuring smooth connectivity between the APB Advanced Timer and an OBI-compatible system.
This module implements a configurable comparator that triggers an output based on a match between an internal counter and a programmable threshold (r_comp). The behavior of the output is determined by the selected operation mode (r_comp_op).
- OP_SET: Set the output to
1on match. - OP_TOGRST: Toggle the output on match; reset to
0on a second event. - OP_SETRST: Set the output to
1on match; reset to0on a second event. - OP_TOG: Toggle the output on each match.
- OP_RST: Reset the output to
0on match. - OP_TOGSET: Toggle the output on match; set it to
1on a second event. - OP_RSTSET: Reset the output to
0on match; set it to1on a second event.
A match occurs when the internal counter value (timer_count_i) is equal to the comparison value (r_comp) and the timer signal is valid (timer_valid_i).
In sawtooth mode (timer_sawtooth_i = 1), the second event is identified using the timer_end_i signal. Otherwise, a second match is used to trigger the follow-up action.
-
Four Independent Timer Blocks: The APB Advanced Timer features four distinct timer blocks, each capable of operating independently. This allows for parallel execution of multiple timing tasks.
-
APB Interface: Designed with an APB interface, the timer module is easy to integrate into APB-based systems, ensuring seamless communication with other components.
-
OBI Bus Integration: In addition to the APB interface, the timer can be connected to an OBI bus using the Wrapper file. This enhances its versatility in a range of system configurations.
-
Flexible Configuration: Each timer block can be independently configured with various parameters, such as different time intervals, allowing for precise control over time-based operations.
The APB Advanced Timer provides a powerful and flexible solution for managing time-based operations in embedded systems. With its four independent timer blocks, APB interface, and support for OBI bus integration, it offers unparalleled versatility for time-critical tasks.
For detailed configuration options or additional implementation examples, please refer to the documentation linked below.