Datasheet

Figure 50-22. Detection and Autocorrection of Missing Pulses
PHA
PHB
Missing pulse due to a contamination (dust, scratch, etc.)
Not a change of direction
detection
1 2 3 4 5 6 7 10 12 13 14 15 16
corrections
If a quadrature device is undamaged, the number of pulses counted for a predefined period of time must be the same
with or without detection and autocorrection feature.
Therefore, if the measurement results dif
fer, a contamination exists on the device producing the quadrature signals.
This does not substitute the measurements of the number of pulses between two index pulses (if available) but
provides a complementary method to detect damaged quadrature devices.
When the device providing quadrature signals is severely damaged, potentially leading to a number of consecutive
missing pulses greater than 1, the downstream processing may be affected. It is possible to define the maximum
admissible number of consecutive missing pulses before issuing a Missing Pulse Error flag (MPE in TC_QISR). The
threshold triggering an MPE flag report can be configured in TC_BMR.MAXCMP. If the field MAXCMP is cleared,
MPE never rises. The flag MAXCMP can trigger an interrupt while the QDEC is operating, thus providing a real time
report of a potential problem on the quadrature device.
50.6.17 2-bit Gray Up/Down Counter for Stepper Motor
Each channel can be independently configured to generate a 2-bit Gray count waveform on corresponding TIOAx,
TIOBx outputs by means of TC_SMMRx.GCEN.
Up or Down count can be defined by writing TC_SMMRx.DOWN.
It is mandatory to configure the channel in Waveform mode in the TC_CMR.
The period of the counters can be programmed in TC_RCx.
Figure 50-23. 2-bit Gray Up/Down Counter
TIOAx
TIOBx
DOWNx
TC_RCx
WAVEx = GCENx =1
50.6.18 Fault Mode
At any time, the TC_RCx registers can be used to perform a comparison on the respective current channel counter
value (TC_CVx) with the value of TC_RCx register
.
The CPCSx flags can be set accordingly and an interrupt can be generated.
This interrupt is processed but requires an unpredictable amount of time to be achieve the required action.
SAM E70/S70/V70/V71 Family
T
imer Counter (TC)
© 2019 Microchip T
echnology Inc.
Datasheet
DS60001527D-page 1512