Product Specs

Table Of Contents
24 TIMER Timer/counter
Page
235
When the timer is incremented beyond its maximum value the Counter register will overflow and the TIMER
will automatically start over from zero.
The Counter register can be cleared, that is, its internal value set to zero explicitly, by triggering the CLEAR
task.
The TIMER implements multiple capture/compare registers.
Independent of prescaler setting the accuracy of the TIMER is equivalent to one tick of the timer frequency
f
TIMER
as illustrated in Figure 42: Block schematic for timer/counter on page 234.
24.1 Capture
The TIMER implements one capture task for every available capture/compare register.
Every time the CAPTURE[n] task is triggered, the Counter value is copied to the CC[n] register.
24.2 Compare
The TIMER implements one COMPARE event for every available capture/compare register.
A COMPARE event is generated when the Counter is incremented and then becomes equal to the value
specified in one of the capture compare registers. When the Counter value becomes equal to the value
specified in a capture compare register CC[n], the corresponding compare event COMPARE[n] is generated.
BITMODE on page 239 specifies how many bits of the Counter register and the capture/compare register
that are used when the comparison is performed. Other bits will be ignored.
24.3 Task delays
After the TIMER is started, the CLEAR task, COUNT task and the STOP task will guarantee to take effect
within one clock cycle of the PCLK16M.
24.4 Task priority
If the START task and the STOP task are triggered at the same time, that is, within the same period of
PCLK16M, the STOP task will be prioritized.
24.5 Registers
Table 42: Instances
Base address
Peripheral
Instance
Description
Configuration
0x40008000
TIMER
TIMER0
Timer 0
This timer instance has 4 CC registers
(CC[0..3])
0x40009000
TIMER
TIMER1
Timer 1
This timer instance has 4 CC registers
(CC[0..3])
0x4000A000
TIMER
TIMER2
Timer 2
This timer instance has 4 CC registers
(CC[0..3])
0x4001A000
TIMER
TIMER3
Timer 3
This timer instance has 6 CC registers
(CC[0..5])
0x4001B000
TIMER
TIMER4
Timer 4
This timer instance has 6 CC registers
(CC[0..5])
Table 43: Register Overview
Register
Offset
Description
TASKS_START
0x000
Start Timer