Datasheet
1055
32117D–AVR-01/12
AT32UC3C
Figure 34-7. Timer Block Diagram
The user can set the timer count direction by writing to the CF.TSDIR bit. The counting direction
is taken into account when a trigger occurs. The counting direction is shown in SR.CNTDIR.
The user has to set the initial direction of counting by writing to CF.TSDIR. When the timer is
triggered, i.e. each time a toggle direction event occurs, the counter changes counting direction.
If the counter reaches 0, it will be stuck at 0 as long as the counting direction is down.
34.6.3 Interrupts
The QDEC has one interrupt request line connected to the interrupt controller. The sources of
this interrupt are:
• The QEPI interrupt to detect the index signal.
• The CMP interrupt to detect a compare match.
• The CAP interrupt to detect that the QDEC counter value has been saved in the CAP register
due to the capture event.
• The OVR interrupt to detect that a capture event was received without the CAP register
having been read since the last capture event. In OCD mode, reading the CAP register does
not clear the memory of the last capture event.
• The PCRO interrupt to detect a roll-over of the position counter. In Timer/Counter mode, the
roll over occurs when (PC = 0xFFFF and RC != RCTOP), when PC = TOP.PCTOP or when
RC = RCTOP.
up/down
control
CNT
CAP
DIR
PB
capture eventtrigger event
toggle direction event
CF.UPD
CF.TSDIR
CLK_QDEC_INT
Clock Control
CMP
TOP
compare event
GCLK_QDEC