Pumpkin, Inc.

Pumpkin User Forums

OSRealTime() ?

Have an idea on how to make Salvo better? Post it here!

OSRealTime() ?

Postby luben » Sat Apr 06, 2002 9:46 am

Hello,

I wander is it not possible to implement some real time function. Usually the timer in the uP is calling on non "real time period" - lt's let say 10ms, 2ms. And this period is usually adjusted by decreasing the whole Timer period with some value.

Some applications need exactly calculations with the real time - seconds, minutes, hours.

Will be not big deal to add some function, that could calculate the real time from the OSTimer().

It shoud have some coefficients (that contain 2 fields - whole and fraction part) that will bring the opportunity to the user to know the real time - in seconds, minutes, hours with enough precision. This function should not use slowly an dbig mathematic routines. Something like our calendar - 2000 - 365 days, 2004 year - 366 days, 2005 - 365. I mean - some simple rules - add one tick every n ticks, remove one tick every m ticks, p ticks mean one second. This will bring enoug accuracy to the real time function, without complicated calculations.

The idea is not clear yet , just in beginning.

Best regards
Luben

------------------

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: OSRealTime() ?

Postby aek » Sat Apr 06, 2002 9:52 am

Hi Luben.

That certainly would be useful. Perhaps we would require that (another) timer increment a 32-bit timer every second, and then there would be Salvo services that could return "real time".

Of course one could also use OSTimer()to do it if the system tick rate divides interger-wise into 1sec. But there's a lot of room for long-term error, which would make it somewhat useless.

Gotta think about it ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: OSRealTime() ?

Postby Steve Clauter » Mon Apr 08, 2002 9:14 am

Hi Luben,

I am using a I2C interface with a little clock chip, a DS1307. Since I2C is so popular, Salvo should be a natural to utilize that interface for real-time tasks, and lots of other applications. In fact I've got an I2C expansion port on my latest product for memory and additional I/O.

quote:
Originally posted by aek:
Hi Luben.

That certainly would be useful. Perhaps we would require that (another) timer increment a 32-bit timer every second, and then there would be Salvo services that could return "real time".

Of course one could also use OSTimer()to do it if the system tick rate divides interger-wise into 1sec. But there's a lot of room for long-term error, which would make it somewhat useless.

Gotta think about it ...


Steve Clauter
 
Posts: 4
Joined: Thu Jan 17, 2002 12:00 am
Location: Tempe, Arizona, USA


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 0 guests

cron