
Enhanced Time Processing Unit (eTPU2)
MPC5644A Microcontroller Reference Manual, Rev. 6
Freescale Semiconductor
901
24.5.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 24.5.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-tooth
flywheel running at 1000 RPM, tooth period is 1 ms. 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.
Содержание MPC5644A
Страница 2: ...MPC5644A Microcontroller Reference Manual Rev 6 2 Freescale Semiconductor...
Страница 24: ...MPC5644A Microcontroller Reference Manual Rev 6 24 Freescale Semiconductor...
Страница 26: ...MPC5644A Microcontroller Reference Manual Rev 6 26 Freescale Semiconductor...
Страница 52: ...Introduction MPC5644A Microcontroller Reference Manual Rev 6 52 Freescale Semiconductor...
Страница 56: ...Memory Map MPC5644A Microcontroller Reference Manual Rev 6 56 Freescale Semiconductor...
Страница 130: ...Device Performance Optimization MPC5644A Microcontroller Reference Manual Rev 6 130 Freescale Semiconductor...
Страница 204: ...Multi Layer AHB Crossbar Switch XBAR MPC5644A Microcontroller Reference Manual Rev 6 204 Freescale Semiconductor...
Страница 212: ...Peripheral Bridge PBRIDGE MPC5644A Microcontroller Reference Manual Rev 6 212 Freescale Semiconductor...
Страница 558: ...System Integration Unit SIU MPC5644A Microcontroller Reference Manual Rev 6 558 Freescale Semiconductor...
Страница 582: ...Frequency modulated phase locked loop FMPLL MPC5644A Microcontroller Reference Manual Rev 6 582 Freescale Semiconductor...
Страница 766: ...Enhanced Time Processing Unit eTPU2 MPC5644A Microcontroller Reference Manual Rev 6 766 Freescale Semiconductor...
Страница 1228: ...Decimation Filter MPC5644A Microcontroller Reference Manual Rev 6 1228 Freescale Semiconductor...
Страница 1236: ...System Information Module and Trim SIM MPC5644A Microcontroller Reference Manual Rev 6 1236 Freescale Semiconductor...
Страница 1250: ...Cyclic Redundancy Checker CRC Unit MPC5644A Microcontroller Reference Manual Rev 6 1250 Freescale Semiconductor...
Страница 1336: ...Deserial Serial Peripheral Interface DSPI MPC5644A Microcontroller Reference Manual Rev 6 1336 Freescale Semiconductor...
Страница 1388: ...Enhanced Serial Communication Interface ESCI MPC5644A Microcontroller Reference Manual Rev 6 1388 Freescale Semiconductor...
Страница 1440: ...FlexCAN Module MPC5644A Microcontroller Reference Manual Rev 6 1440 Freescale Semiconductor...
Страница 1624: ...FlexRay Communication Controller FlexRay MPC5644A Microcontroller Reference Manual Rev 6 1624 Freescale Semiconductor...
Страница 1670: ...JTAG Controller JTAGC MPC5644A Microcontroller Reference Manual Rev 6 1670 Freescale Semiconductor...
Страница 1692: ...Nexus Port Controller NPC MPC5644A Microcontroller Reference Manual Rev 6 1692 Freescale Semiconductor...
Страница 1701: ...Development Trigger Semaphore DTS MPC5644A Microcontroller Reference Manual Rev 6 Freescale Semiconductor 1701...
Страница 1702: ...Development Trigger Semaphore DTS MPC5644A Microcontroller Reference Manual Rev 6 1702 Freescale Semiconductor...