Go Down

Topic: PWM Stepper Motor Mode Register (Read 1 time) previous topic - next topic



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



Mar 13, 2017, 07:46 pm Last Edit: Mar 14, 2017, 05:17 am by ard_newbie
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 ).


Go Up