[Tinyos-devel] improving FTSP interface

Omprakash Gnawali gnawali at usc.edu
Thu Aug 7 17:26:17 PDT 2008


On Thu, Aug 7, 2008 at 1:26 PM, Miklos Maroti <mmaroti at math.u-szeged.hu> wrote:
>>> >>> so to make it easier for app developers, FTSP can provide
>>> >>> isRollover(uint32_t current_time) command that implements this, right?
>>> >>>
>>> >>> one scenario, where rollover would be useful is when your application
>>> >>> runs for a long time and doesn't query ftsp's global time very often.
>>> >>> 33rd bit could flip twice without the app realizing it, while rollover
>>> >>> bit would stay set. for 32khz clock (hopefully provided soon), this
>>> >>> would mean 4.5 hours which is not totally unreasonable. ftsp could
>>> >>> realize the rollover because it receives periodic timesync messages.
>>> >>>
>>> >>> brano
>>> >> Another solution would be to provide an overflow "interrupt" like the
>>> >> Counters.
>>> >>
>>> >
>>> > Commenting on the interface - an interface such as this or the one
>>> > that Brano suggested should work.
>>> >
>>> > It just does not make sense for an application to make indirect
>>> > inferences which can be error prone.
>>> agreed. especially - miklos's code is usually correct and very
>>> efficient, but hard to understand. i bet only 50% of people will
>>> understand what he proposed above, and less than 1% will understand the
>>> comment that the code will always work (and the reason for it). :)
>>>
>>> any preferences on pull vs push? i'm personally on the pull side
>>> (isRollover) - this allows you to check rollover of any timestamp at any
>>> place in your code. as opposed to forcing everybody to wire yet another
>>> event.
>>>
>>> brano
>>
>> Push has the advantage that you can maintain a 64 bit clock on top of
>> it. Just my 2c.
>>
>>
>
> You need to have the last global time and current global time. So if
> you want to have a command for this, then the user has to maintain the
> last global time or you need to parametrize the interface. It should
> be an event, then a single last global time (the FTSP already has
> this) should be sufficient.
>

One other topic when we are trying to improve FTSP interface - Let's
say, FTSP says the current time is 5 and later it says the current
time is 10, do I know if 5 units of time have elapsed? We probably
want another bit to tell if there was any desync/sync event since the
last read.

This is a nice lead into the push vs pull discussion. If there are a
few bits like these that need to be read for each time reading then it
probably makes sense to make it push.

- om_p


More information about the Tinyos-devel mailing list