MPC563XM Reference Manual, Rev. 1
Freescale Semiconductor
857
Preliminary—Subject to Change Without Notice
23.4.7.4.1
Calculating the Angle Tick Period Integer and Fraction
On each tooth the microcode has to update the exact period of a single angle tick used for counting the
internal angle in the tooth. The period of an angle tick or a tooth is measured in units of TCR1 clocks (if
TCR1CS=0) or TCR1 clocks divided by 2 (if TCR1CS=1). The microcode can use the eTPU MAC
Divider unit (see
Section 23.4.8.3, “MAC and Divide Unit (MDU)
) to divide the tooth period by the
number of angle ticks per tooth, which is stored in the TICKS field of TPR (refer to
). This division yields the integer part of the angle tick period and the remainder.
Dividing again the remainder shifted left nine positions, by the number of angle ticks per tooth translates
the remainder to a 9-bit fraction. The microcode concatenates the 15-bit integer and the 9-bit fraction to a
24-bit value and writes it to TRR. The new rate is effective immediately after the next Angle Tick is
generated by the Angle Tick Generator
1
.
For high RPM, note that shifting the tooth period value nine positions to the left prior to the first divide
operation would calculate, in one operation, the integer and the fraction. For example: On 60 teeth
flywheel running at 1000 RPM, tooth period is 1 msec. If TCR1 counts @25 MHz, it counts 25,000 times
in a tooth, which can be represented by 15 bits. Therefore the tooth period can be shifted nine positions to
the left prior to divide operation, and be represented with 24 bits.
Using shift left nine positions and one divide operation would get the result in MACL register (in MDU)
which holds the integer and nine bits of the fraction:
Angle_Tick_Rate {Integer[14:0], Fraction[8:0]} = (TCR1ToothPeriod
2
<<9) / Ticks
TRR = Angle_Tick_Rate {Integer[14:0], Fraction[8:0]}
On low RPM the initial tooth period, measured in TCR1 counts, may be too big to be shifted nine positions
to the left. For lower RPM (for example 500 RPM) the tooth period cannot be represented by 15 bits, and
shifting it nine positions to the left would lose the MSB. In this case, two divide operations are required as
follows: first divide the Tooth Period by the number of TICKS - the integer is stored in MACL and
remainder in MACH. MACL is saved in another register. MACH is shifted 9 positions to the left and
divided again by TICKS. In parallel with the second divide, the register which saved the original MACL
is shifted left 9 positions. After the divide MACL contains the 9 bits fraction and the other register contains
the 15-bit integer, shifted left nine times. The logical OR of the two registers is written to the TRR:
Angle_Tick_Rate {Integer[14:0]} = (TCR1ToothPeriod) / Ticks
Remainder[9:0] = TCR1ToothPeriod) mod Ticks
Angle_Tick_Rate {Fraction[8:0]} = (Remainder[9:0] << 9) / Ticks
TRR = Angle_Tick_Rate {Integer[14:0], Fraction[8:0]} = (Integer[14:0] << 9) | Fraction[8:0]
1.
In High-rate mode, the tick keeps being updated at the rate of system clock/8 until it goes back to Normal mode, when the
new TRR value is used.
2.
The tooth period (TCR1ToothPeriod) is not, in general, the value of estimated tooth time. It is obtained by microcode by
subtracting TCR1 values between two teeth detections. Its comparison with the estimated tooth time indicates acceleration
(if minor) or deceleration (if greater) to the microcode.
Содержание MPC5632M
Страница 22: ...MPC563XM Reference Manual Rev 1 22 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 62: ...MPC563XM Reference Manual Rev 1 62 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 92: ...MPC563XM Reference Manual Rev 1 92 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 168: ...MPC563XM Reference Manual Rev 1 168 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 242: ...MPC563XM Reference Manual Rev 1 242 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 302: ...MPC563XM Reference Manual Rev 1 302 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 410: ...MPC563XM Reference Manual Rev 1 410 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 440: ...MPC563XM Reference Manual Rev 1 440 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 464: ...MPC563XM Reference Manual Rev 1 464 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 554: ...MPC563XM Reference Manual Rev 1 554 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 590: ...MPC563XM Reference Manual Rev 1 590 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 622: ...MPC563XM Reference Manual Rev 1 622 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 716: ...MPC563XM Reference Manual Rev 1 716 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1114: ...MPC563XM Reference Manual Rev 1 1114 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1144: ...MPC563XM Reference Manual Rev 1 1144 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1266: ...MPC563XM Reference Manual Rev 1 1266 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1316: ...MPC563XM Reference Manual Rev 1 1316 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1348: ...MPC563XM Reference Manual Rev 1 1348 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1362: ...MPC563XM Reference Manual Rev 1 1362 Freescale Semiconductor Preliminary Subject to Change Without Notice ...
Страница 1382: ...MPC563XM Reference Manual Rev 1 1382 Freescale Semiconductor Preliminary Subject to Change Without Notice ...