Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   User Processor Execution Time (http://www.chiefdelphi.com/forums/showthread.php?t=43873)

Andrew Blair 12-02-2006 21:18

User Processor Execution Time
 
How long does it take a single loop to execute when called in user_routines.c?

Basically, in Process_Data_From_Master_uP, I am calling a function that multiplies my interrupts by 38, to get interrupts a second, and eventually, revolutions per second. If I call this important function in Process_Data_From_Master_uP, will it execute at a consistent 38 Hz? Or do I need to put it in User_routines_fast.c? And How would I do that? Thanks much.

Code:

 
unsigned int Get_Wheel_Speed(void)
{
 return((Get_Interrupt1()*38)); 
}


Alan Anderson 12-02-2006 21:52

Re: User Processor Execution Time
 
The frequency is consistent, but only on average. You can't count on it being exactly 26.2 milliseconds between calls. And if there's a communication glitch, one or more calls might be skipped entirely.

For what you're doing, you probably should use a timer interrupt.


All times are GMT -5. The time now is 17:32.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi