Datasheet

974
32117D–AVR-01/12
AT32UC3C
33.6.2.3 2-bit Gray Up/Down Counter for Stepper Motor
It is possible to configure a couple of channels to provide a 2-bit gray count waveform on 2 out-
puts. Dead-Time generator and other downstream logic can be configured on these channels.
Up or down count mode can be configured on-the-fly by the SMMR register.
When GCEN0 is written to 1, channels 0 and 1 outputs are driven with gray counter.
Figure 33-6. 2-bit Gray Up/Down Counter
33.6.2.4 Dead-Time Generator
The dead-time generator uses the comparator output OCx to provide the two complementary
outputs DTOHx and DTOLx, which allows the PWM to drive external power control switches
safely. When the dead-time generator is enabled by writing a one to the DTE bit in the ”Channel
Mode Register” on page 1036 (CMRx), dead-times (also called dead-bands or non-overlapping
times) are inserted between the edges of the two complementary outputs DTOHx and DTOLx.
Note that enabling or disabling the dead-time generator is allowed only if the channel is
disabled.
The dead-time is adjustable by the ”Channel Dead Time Register” on page 1045 (DTx), both
outputs of the dead-time generator can be adjusted separately by DTH and DTL. The dead-time
values can be updated synchronously to the PWM period by using the ”Channel Dead Time
Update Register” on page 1046 (DTUPDx).
The dead-time is based on a specific counter which uses the same selected clock that feeds the
channel counter of the comparator. Depending on the edge and the configuration of the dead-
time, DTOHx and DTOLx are delayed until the counter has reached the value defined by DTH or
DTL. An inverted configuration bit (DTHI and DTLI bits in the CMRx register) is provided for each
outputs to invert the dead-times outputs. The following figure shows the waveform of the dead-
time generator.
PWMH0
DOWNx
GCEN0 = 1
PWMH1
PWML0
PWML1