Author Topic: Lowest System Tick?  (Read 4388 times)

Offline Jamier

  • Newbie
  • *
  • Posts: 14
    • View Profile
Lowest System Tick?
« on: February 29, 2008, 03:31:13 AM »
Hi Mark,

I see the tick resolution in v1.3 is set to 34ms.

Is there a minimum that you would recommend?  It looks like the RTI can go as low at 41us.

We have some time constraints on a scale of 10ms.  It would be nice if we could handle these within a uTasker task.

Thanks

Jamie

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3188
    • View Profile
    • uTasker
Re: Lowest System Tick?
« Reply #1 on: February 29, 2008, 11:31:08 AM »
Jamie

The PIT (periodic interrupt timer) can be set to generate a periodic interrupt up to a maximum rate of around 40ms (limited by the fact that the timer has a limited divide value). It can be set to interrupt at a much faster rate, as you have seen. With the present prescaler, down to 2.5ms - without much faster.
The demo project is set up to use 34ms TICK since this gives quite accurate long term timing (unfortunately the TICK is not exactly 34.0000ms (it is actually about 34.078ms due to the 25MHz oscillator and the limited dividing resolution). One second timer will actually run at 1.002s - other TICK values round to slightly worst values to that is also why 34ms was chosed.

You can change the value of TICK_RESOLUTION to 10 if you need 10ms resolution in your project - everything else will adapt itself accordingly. The only thing to remember is that the TICK interrupt represents an overhead so generally it is set to the lowest resolution required by the system - setting it lower doesn't have any real benefits but results in more interrupts to handle per second. 10ms is however no problem - only when operating in the sub 1ms range would it maybe start to become noticable.

Regards

Mark