GR712RC-UM, Jun 2017, Version 2.9 90 www.cobham.com/gaisler
GR712RC
12 General Purpose Timer Unit with Time Latch Capability
12.1 Overview
The General Purpose Timer Unit with time latch capability provides a common 8-bit prescaler and
two 32-bit decrementing timers. The timer value can be latched when a system interrupt occurs. Each
timer can also generate an interrupt on underflow.
12.2 Operation
The prescaler is decremented on each system clock cycle. When the prescaler underflows, it is
reloaded from the prescaler reload register and a timer tick is generated. The two timers are decre-
mented each on each tick. To minimize complexity, timers share the same decrementer. This means
that the minimum allowed prescaler division factor is 3.
The operation of each timer is controlled through its control register. A timer is enabled by setting the
enable bit in the control register. The timer value is then decremented on each prescaler tick. When a
timer underflows, it will automatically be reloaded with the value of the corresponding timer reload
register if the restart bit in the control register is set, otherwise it will stop at -1 and clear the enable
bit. Each timer can generate a unique interrupt when it underflows, if the interrupt enable bit is set.
By setting the chain bit in the control register, timer 2 can be chained with timer 1, creating a 64-bit
timer. Timer 2 will be decremented once each time timer 1 underflows.
Each timer can be reloaded with the value in its reload register at any time by writing a ‘one’ to the
load bit in the control register.
Each timer can latch its value to dedicated registers when any of the 31 system interrupts occur. A
dedicated mask register is provided to select the interrupts. Note that incorrect values can be latched if
an incoming interrupt is occurring in the middle of the decrementing process. The likelihood is
approximately 1/(prescaler reload value). Note that the latch function cannot be used with the core’s
own interrupt number 7.
Figure 55. General Purpose Timer Unit block diagram
prescaler reload
-1
prescaler value
timer 1 value
timer 2 value
timer 1 reload
timer 2 reload
-1
tick
irq 7