| Electronic Components Datasheet Search |
|
AN2577 Datasheet(PDF) 32 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2577 Datasheet(HTML) 32 Page - STMicroelectronics |
|
32 / 34 page ![]() Angle clock application AN2577 32/34 In an equals-only setup, when a function sets up a channel for action at a future angle, that angle can be any value in the range of the angle clock and the match will occur in the next occurrence of that angle. This is true even if the angle is 719 degrees in the future. The corollary of this is that if a system update results in a decision that an action that was scheduled should occur in the past, the match will wait until the next revolution. Note: In the eTPU angle clock, no counts will be skipped. Any in-range equals-only match will always be satisfied on the next occurrence of the angle. The discrimination between reprogramming to the past rather than the future is left to the eTPU software. The designer must insure that, for example, if a spark is about to occur and the spark fire angle is updated to occur at an earlier angle, the match is forced immediately. If the earlier angle is simply written to the match register, the spark will be missed until the next cycle. There is one additional situation to consider when using equals-only matches with the angle clock. If the tick rate is slow, it is possible to get a service request on an angle match and execute part of a thread before the angle changes. If a function is trying to set up a future match exactly 360 (or 720) degrees after the current one, care must be taken that the register is not written with the current value of TCR2. Please refer to the reference design for examples of how to use a periodic angle clock. 5.3 Angle math If the angle clock is used in the continuous angle mode, angles parameters can be added, subtracted, and compared like any other 24-bit integer. However, when the user selects a periodic reset of the angle clock, modulus arithmetic must be used. If the angle clock is reset every cam revolution (= two crank revolutions), the modulus is 720 degrees expressed in terms of the tick resolution. For example if a 60-tooth wheel is used with 60 ticks per tooth, there would be 7200 ticks per cam cycle (Ticks_Per_Cycle). Adding two angles in such an application would be done thusly: New_Angle = (First_Angle + Second_Angle) % Ticks_Per_Cycle; This operation is mathematically correct, but it might not generate the most efficient code. This is because the modulus is normally generated as a divide instruction. A more efficient coding would be to add the numbers, and if the sum is greater than Ticks_Per_Cycle, subtract Ticks_Per_Cycle. Macros or subroutines for handling this math can be found in the reference design. |
|
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 |