| Electronic Components Datasheet Search |
|
AN2577 Datasheet(PDF) 28 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2577 Datasheet(HTML) 28 Page - STMicroelectronics |
|
28 / 34 page ![]() eTPU software design AN2577 28/34 Example case Apparent_Gap: ToothPeriodLast = ToothPeriod; ToothPeriod= TempToothPeriod; ToothTime = EdgeCaptureTime; ToothCount = ToothCount + 1; if (ToothPeriod >= ToothPeriodLast*GapRatio)//verify { CrankStatus = Half_Sync; SetChannelInterrupt();//Inform the host that the crank status is updated ToothCount = 1; /* More */ Last_State = GapVerified; } else 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 on page 13. 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. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |