Atmel ARM-Based Evaluation Kit for SAM4S16C, 32-Bit ARM® Cortex® Microcontroller ATSAM4S-WPIR-RD ATSAM4S-WPIR-RD Data Sheet

Product codes
ATSAM4S-WPIR-RD
Page of 1231
847
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
37.6.14.3Direction Status and Change Detection
After filtering, the quadrature signals are analyzed to extract the rotation direction and edges of the two quadrature 
signals detected in order to be counted by timer/counter logic downstream.
The direction status can be directly read at anytime in the TC_QISR. The polarity of the direction flag status 
depends on the configuration written in TC_BMR. INVA, INVB, INVIDX, SWAP modify the polarity of DIR flag.
Any change in rotation direction is reported in the TC_QISR and can generate an interrupt.
The direction change condition is reported as soon as two consecutive edges on a phase signal have sampled the 
same value on the other phase signal and there is an edge on the other signal. The two consecutive edges of one 
phase signal sampling the same value on other phase signal is not sufficient to declare a direction change, for the 
reason that particulate contamination may mask one or more reflective bars on the optical or magnetic disk of the 
sensor. (Refer to 
 for waveforms.)
Figure 37-18. Rotation Change Detection
The direction change detection is disabled when QDTRANS is set in the TC_BMR. In this case the DIR flag report 
must not be used.
A quadrature error is also reported by the quadrature decoder logic via the QERR flag in the TC_QISR. This error 
is reported if the time difference between two edges on PHA, PHB is lower than a predefined value. This 
PHA
PHB
Direction Change under normal conditions
DIR
DIRCHG
change condition
Report Time
No direction change due to particulate contamination masking a reflective bar
PHA
PHB
DIR
DIRCHG
spurious change condition (if detected in a simple way)
same phase
missing pulse