LIN Stepper Software Description
Designer Reference Manual
DRM047 — Rev 0
68
LIN Stepper Software Description
MOTOROLA
6.3.2 Scaling of Time
Scaling of time variables is according to EQ12,13
(EQ 12.)
ResolutionPeriod
defines the time of
(EQ 13.)
6.3.3 Acceleration Scaling and Arithmetic Operations
Some of the arithmetic operations used in the LIN Stepper software
impact the calling.
A good example is umul_16x8_macro
(EQ 14.)
which is used for acceleration ramp calculation:
(EQ 15.)
And EQ15 can be rewritten to
(EQ 16.)
if we use the umul_16x8_macro
(EQ 17.)
Then according to EQ16, EQ17 the Resolution Acceleration is:
(EQ 18.)
NOTE:
The actual frequency variable
frequencyActLowHigh
is represented as
an union. Then for the acceleration calculations it can be accessed as
Resolution Period
Timer Prescaller Division
Bus Frequency
--------------------------------------------------------------
=
Real Step Period
periodStep*Resolution Period
=
UWord16 Variable3
UWord16 Variable1*UByte Variable2
256
---------------------------------------------------------------------------------------------
=
Frequency Difference
SteppingPeriod*Acceleration
=
Resolution Frequency*(UWord16) frequencyDif
Resolution Period*(UWord16) periodStep*Resolution Acceleration*
a
cceleration
=
(UWord16)Frequency Dif
(UWord16)periodStep*(UByte)Acceleration
256
-----------------------------------------------------------------------------------------------------------
=
RESOLUTION_ACCEL_DECEL_S_S2
RESOLUTION_FREQUENCY_LOW_HIGH
256.0*(RESOLUTION_PERIOD_NS/1000000000.0)
----------------------------------------------------------------------------------------------------------------------------------
=
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..