SCPS295 September 2024 TPLD801
ADVANCE INFORMATION
When configured as a Counter (CNT) and a valid edge appears on the IN input, this macro-cells resets the internal counter to 0 and begins counting down from DATA on the next rising clock edge. Then, the macro-cell outputs a pulse for the duration of one CLK period when the count reaches 0 and wrap around to the value in DATA. The counter will continually operate until another reset is recevied. The edge on which the Counter is reset is determined by the Edge select parameter and can be configured as:
Rising: only rising edges of IN reset the counter.
Falling: only falling edges of IN reset the counter.
Both: both rising and falling edges of IN reset the counter.
High Level Reset: the counter is reset to 0 whenever IN is High; after reset, the counter output stays Low until the next rising CLK edge, then operates normally.
The counter time is calculated by COUNT = (DATA + 1)/fCLK. After a reset, an additional 2 clock cycles is added for clock synchronization, but there is an option to bypass the clock sync.
Figure 7-13 and Figure 7-14 show examples of Counter output timing diagrams with respect to the Edge select parameter with DATA = 1 and DATA = 3, respectively.
Figure 7-15 shows an example of how the Counter macro-cell operates when the IN signal is shorter than the counter length (shown when edge select parameter is set to "both").