4 ms·
We talked about this in my microcontrollers class today! Not this exact incident but about the problems associated with using the system clock in a micro for pr
by boiler_up800 13y ago
We talked about this in my microcontrollers class today! Not this exact incident but about the problems associated with using the system clock in a micro for precise timing.
Our micro (Freescale HC9S12) is clocked by a 24 MHz crystal quartz oscillator and if you use the timing module to clock the micro, you cannot get exactly 1ms, 10ms, etc. This makes summing the time over a long period tricky.
- azernik 13y agoWhat was the solution proposed in your class? Of the top of my head, I can only think of keeping time values in units of clock-ticks (equivalent to the Linux "jiffy") and only converting to/from milliseconds when turning programmer or user input into internal values.
- sitkack 13y agoThis. There is almost no reason to put time back into ms when absolute clock ticks will do. Never sum low precision values, etc.