參數(shù)資料
型號: AN2897
英文描述: Using the eTPU Angle Clock
中文描述: 使用時鐘角的eTPU
文件頁數(shù): 25/32頁
文件大小: 587K
代理商: AN2897
eTPU Software Design
Using the eTPU Angle Clock, Rev. 0
Freescale Semiconductor
25
Last_State = PossibleGapVerifying;
/* More */
break;
4.2.7
Gap Verified
Once the gap is verified, the system can go to
Half_Sync
or even
Full_Sync
mode. The tooth position is
now known, and subsequent gaps can be anticipated. An angle can be written to the TCR2, although if the
mode is
Half_Sync,
the angle could be off by 360 degrees.
4.2.8
Counting
Once wheel sync has been achieved, the Angle Clock system executes repeated cycles of tooth detection
and period timing, driving the TCR2 in wheel synchronization. The rate of the ticks following a tooth are
extrapolated from the previous period by the software when it programs the Tick Rate register.
The Tick Rate register is organized as a 15-bit whole number and a 9-bit fraction and is programmed in
terms of TCR1 counts. The eTPU can automatically capture the TCR1 time of each tooth edge, so the
period is trivial to determine. The new edge time is then stored for the next period calculation. To
determine the tick period, the software need only divide the measured tooth period by the number of tick
counts per tooth. This division can present some problems for the designer depending on the selected
resolution of TCR1 and the speed range of the wheel. See
Section 3.1.3, “Angle Resolution
.” Even when
the TCR1 is properly selected, the software engineer needs to ensure that the intermediate result of the
fixed point calculation does not overrun a register or truncate needed resolution of the tick rate.
At low wheel speeds, the period is long and a left shift can be done after dividing by the ticks per tooth. If
the shift is done before the division, the value may overflow. However, at high speeds, the period is short
and dividing by the ticks per tooth could result in gross errors before the shift is done. The algorithm in the
example below is designed to implement the 9-bit shift in two steps to minimize loss of resolution.
EXAMPLE
if (IsTransALatched()) //If the Tooth edge is detected
{
EdgeCaptureTime = GetCapRegA();//Capture the edge transition time
TempToothPeriod = EdgeCaptureTime-ToothTime;
ToothTime = EdgeCaptureTime;
TempTicks = ((TempToothPeriod*8)/TicksPerTooth)*64;// implements a
left shift by 9 bits and a div by 60
TickRate = TempTicks;
NOTE
The value in the Tick Rate Register must never be programmed to less than
1.0. If the integer value is set to 0, it will be interpreted as 32768.
相關(guān)PDF資料
PDF描述
AN2904FHQ AN2904FHQ - Sound input/output interface IC for digital still camera
AN2933 Understanding the eTPU Channel Hardware
AN30210A Analog IC
AN304 Single Differential Amplifier
AN305 Optoelectronic
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
AN28F010109 制造商:Rochester Electronics LLC 功能描述:- Bulk
AN28F010-120 制造商:未知廠家 制造商全稱:未知廠家 功能描述:x8 Flash EEPROM
AN28F010-150 制造商:未知廠家 制造商全稱:未知廠家 功能描述:x8 Flash EEPROM
AN28F256A-120 制造商:未知廠家 制造商全稱:未知廠家 功能描述:x8 Flash EEPROM
AN28F256A-150 制造商:未知廠家 制造商全稱:未知廠家 功能描述:x8 Flash EEPROM