RM0082
BS_General purpose timers
Doc ID 018672 Rev 1
323/844
Note:
Independently by the timer activity, pending interruptions remain active until they have been
acknowledged (writing a 1‘b1 in the relevant bit) and they are not automatically deactivated
when the timer is disabled or enabled. It is therefore strongly recommended to acknowledge
all active interrupt sources before enabling a timer.
17.2.6 TIMER_COMPARE
register
The TIMER_COMPARE is a RW register allows the software to program the timer period.
The TIMER_COMPARE bit assignments are given in
.
The COMPARE_VALUE is expressed as an integer number of clock periods (where the
input clock of the timer is the output of the prescaler) ranging from the 16’h0001 minimum
value to the 16’hFFFF maximum value (default, to be intended as free-running timer in auto-
reload mode). When the counter reaches the COMPARE_VALUE, the GPT behaves
depending on the operation mode (auto-reload or single-shot).
Note:
1
In auto-reload mode, when the counter reaches the COMPARE_VALUE, it is cleared and
restarts:
TIMER_PERIOD = (COMPARE_VALUE - 1) x COUNTER_ 2 TIMER_CLOCK
periods.
2
COUNTER_PERIOD is the period of the timer’s input clock (i.e. the prescaler’s output).
Table 258.
TIMER_STATUS_INT_ACK register bit assignments
Bit
Name
Reset value Description
[15:03]
Reserved
13’h0
Read undefined. Write: should be zero.
[02]
REDGE
1’h0
Rising edge capture.
Reading this bit as 1‘b1, it means that a rising edge has
been detected on the capture input and an interrupt is
raised.
Writing 1‘b1, the interrupt source is cleared, whereas there
is no effect when writing 1‘b0.
[01]
FEDGE
1’h0
Falling edge capture.
Reading this bit as 1‘b1, it means that a falling edge has
been detected on the capture input and an interrupt is
raised.
Writing 1‘b1, the interrupt source is cleared, whereas there
is no effect when writing 1‘b0.
[00]
MATCH
1’h0
Match status.
Reading this bit as 1‘b1, it means that a match has occurred
in the compare unit and an interrupt is raised.
Writing 1‘b1, the interrupt source is cleared, whereas there
is no effect when writing 1‘b0.
Table 259.
TIMER_COMPARE register bit assignments
Bit
Name
Reset value
Description
[15:00]
COMPARE_VALUE
16’hFFFF
Compare value.