[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Required accuracy of timers
From: |
Jonathan Larmour |
Subject: |
Re: [lwip-users] Required accuracy of timers |
Date: |
Thu, 06 Mar 2008 12:34:14 +0000 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20070530) |
H. Peter Anvin wrote:
> H. Peter Anvin wrote:
>> Frédéric BERNON wrote:
>>> microseconds? Which ones? I thought most were in milliseconds. Which
>>> lwIP release do you use?
>>
>> Sorry, I might be mistaken. I'm looking at 1.3.0. Either way, the
>> question still holds.
>>
>
> I guess I really should explain the background.
>
> I'm looking at using this in a raw PC BIOS environment, where the only
> *guaranteed* timer only has a 55 ms granularity. There are ways to get
> better resolution by going straight to the hardware, but PC hardware
> being what it is (utter crap) that's a risky thing for trying to make
> something that works on all platforms.
In practice I don't think there are any timers which require better than
100ms granularity, and I doubt a little inaccuracy delaying a timeout by up
to 55ms would really affect much (as long as it isn't up to 55ms _early_).
Although in any case, PC hardware is actually pretty standard - with
backward compatibility still present for obscenely ancient devices. Usually
you can use the Periodic Interval Timer anywhere. You can see a usage
example in eCos here(hal_pc_clock_initialize and hal_pc_clock_read):
http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/packages/hal/i386/pcmb/current/src/pcmb_misc.c?rev=1.9&content-type=text/x-cvsweb-markup&cvsroot=ecos
with some info from:
http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/packages/hal/i386/pcmb/current/include/pcmb_intr.h?rev=1.5&content-type=text/x-cvsweb-markup&cvsroot=ecos
It uses interrupt IRQ0 i.e. 32.
Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
** Visit us at ESC Silicon Valley <http://www.embedded.com/esc/sv> **
** April 15-17 2008, Booth 3012, San Jose McEnery Convention Center **
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine