PWM Stepper Motor Mode Register

Hey

can any one share some insight on this subject.

the documentation is very vague.

is it ideally used as a counter of pulses or is it meant as a pwm output

given the lack of description in the documentation im guessing there are better options

Cheers

Note that figure 38.6 page 981 of Sam3x datasheet is wrong. Instead refer to Sam4 datasheet figure 39.6 page 962.

Following is 2-bit sequence (n = 2) in Gray code: 00 01 11 10

In Gray code, you never have 2 bits moving at the same time whatever the width of the sequence, this particularity is leveraged to operate stepper motors.

I found an interesting document produced by TI, see pages 6,7 and 8 :

And see chapter Driving a stepper in this document :


For Full Step Drive, you will see the analogy with figure 39.6 in Sam4 datasheet page 962 :
In 2-bit Gray Up/Down Counter for Stepper Motor,

A waveform is PWMH0
B waveform is PWMH1
C waveform is PWML0
D waveform is PWML1

To program these waveforms, you need to program register PWM_SMMR ( or TC_SMMR for TIOA/TIOB ).

thanks ard that makes sense