![]() |
System time
Right now I have worked a long time on customizing a timer found in Kevin's interrupt code to run indefinatly. I was wondering if anyone was able to get a system timer that runs fast enough to use for speed but slow enough so I can get and it doesn't get too big to handle?
/*I used a 1:1 pre-scalar for an interrupt and the controller freaked out, overflowing a 16 bit value every 26.6 ms*/ |
Re: System time
Use a 32 bit timer :-)
In other words, when your 16 bit timer gets to big, add it to a 32 bit variable and reset it. If 16 bits overflows in 26.6ms, 17 bits will overflow in 53.2ms, and so on. 32 bits shouldn't overflow for 29 minutes. |
| All times are GMT -5. The time now is 18:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi