Datasheet

Table Of Contents
Only the first two input signals can be swapped by writing to the SWAP bit in the Control A register
(CTRLA.SWAP).
Related Links
53.3 Block Diagram
53.6.2.5 Period Control
The Channel Compare 0 register (CC0) can act as a period register (PER) by writing the PEREN bit in
the Control A register (CTRLA.PEREN) to '1'. The PER can be used to control the top value (TOP) of the
counting operation:
When up-counting and the counter reaches the value of CC0, the counter is cleared to zero. When down-
counting and the counter reaches zero, the counter is reloaded with the CC0 value.
53.6.2.6 QDEC Operation Mode
In QDEC mode of operation, Signal 0 and Signal 1 control logic inputs refer to Phase A and Phase B in
X4 mode, and to count/direction in X2 mode. The Signal 2 control logic input refers to the Index, in both
X4 and X2 mode of operation. In X4 mode, a simultaneous transition on Phase A and Phase B will cause
a QDEC error detection (STATUS.QERR).
Figure 53-4. QDEC Block Diagram
sync
syncsync
Quadrature
Decoder
Position Clock
Velocity Clock
Position Direction
Filter
Revolution Check
First Index Sync
Direction Change Detection
Error Detection
Angular
Counter (n-bits)
ResetDIR
Count
OVF (Interrupt or Event)
MC0 (Interrupt or Event)
MC1 (Interrupt or Event)
ovf
Revolution
Counter (16/32-n-bits)
CC0
CC1
VLC (Interrupt or Event)
DIR (Interrupt or Event)
ERR (Interrupt)
Phase A
Count
Phase B
Direction
Index
Signal 0
Signal 1
Signal 2
Related Links
53.3 Block Diagram
53.6.2.6.1 Position and Rotation Measurement
After filtering, the quadrature signals are analyzed to extract the rotation direction and edges in order to
be counted by the counter.
The counter is split in two parts, Angular and Revolution. The Phase A and B edge detections define the
motor axis position, which is recorded by the Angular part of the counter. The motor revolution is recorded
by the Revolution part of the counter. The Angular counter is updated each time a QDEC transition is
detected. The Revolution counter is updated on each angular counter overflow or underflow.
SAM D5x/E5x Family Data Sheet
PDEC – Position Decoder
© 2019 Microchip Technology Inc.
Datasheet
DS60001507E-page 1951