Pumpkin, Inc.

Pumpkin User Forums

OSTimer and OSBYTES_OF_TICKS

If you're having difficulty with Salvo's configuration options, post it here.

OSTimer and OSBYTES_OF_TICKS

Postby dfleck » Tue May 14, 2002 8:18 am

In the user manual, the note says "Once this counter reaches its maximum value it remains at that value.". I am using the PICC-18 standard library with OSA configuration. I call OSTimer from my timer1 interrupt which occurs every 2ms. Does the tick counter roll-over or does it stop at 0xFFFFFFFF? Looking at OSTimer it seems the tick counter will roll-over. I was assuming that roll-over of the tick counter would be handled automatically, and that OS_Delay, etc. will work regardless of how long my appilication runs. Is this true, or is manual intervention required to handle the tick counter?

------------------
Donald A. Fleck

Donald A. Fleck
dfleck
 
Posts: 28
Joined: Sun May 12, 2002 11:00 pm
Location: Breinigsville, PA, USA

Re: OSTimer and OSBYTES_OF_TICKS

Postby aek » Tue May 14, 2002 8:27 am

Hi Donald.

Which page of the manual?

The tick counter will rollover from 0xFFFFFFFF to 0x00000000, assuming you're doing a source-code build with OSBYTES_OF_TICKS set to 4.

Your assumption that it will all work without intervention is correct.

Keep in mind that ticks and delays are not the same thing. Ticks are just an open-ended free-running counter that tracks the number of system ticks, and can be read via OSGetTicks(). Ticks are useful for long-term time measurement.

Delays are in ticks units, but that's the only link between them. You could have

code:
#define OSBYTES_OF_TICKS  4
#define OSBYTES_OF_DELAYS 2

and you could infer a time period of up to 2**32x1ms with calls to OSGetTicks(), but you could only delay a task by 2**16x1ms in a single OS_Delay(2**16-1).

Hope this Helps,

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

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

Re: OSTimer and OSBYTES_OF_TICKS

Postby dfleck » Tue May 14, 2002 9:20 am

Thanks. See p.135 (config option OSBYTES_OF_TICKS).

------------------
Donald A. Fleck

Donald A. Fleck
dfleck
 
Posts: 28
Joined: Sun May 12, 2002 11:00 pm
Location: Breinigsville, PA, USA

Re: OSTimer and OSBYTES_OF_TICKS

Postby Salvo Tech Support » Wed May 15, 2002 6:17 am

The OSBYTES_OF_TICKS entry in Chapter 5 of the Salvo User Manual has now been corrected.

It will be part of the manual's next release.

------------------
--------
Salvo Technical Support
Please request all tech support through the Forums.

--------
Salvo Technical Support
Please request all tech support through the Forums.
Salvo Tech Support
 
Posts: 173
Joined: Sun Nov 19, 2000 12:00 am


Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest

cron