Fence-Post Errors and xFrequency

nobody wrote on Thursday, April 13, 2006:

Hello Richard,

I’m wondering if the mechanism that uses xFrequency
to determine when tasks run takes into account something like this:

Let’s say the timer is set to something which yields 256 ticks for 250ms.  Should xFrequency be set to 255 or 256? i.e. - 256 ‘states’ since counts start from zero…256 actually means 257 ticks instead?

Maybe the code already accounts for this.

Thanks,
John W.

rtel wrote on Thursday, April 13, 2006:

Is this question relating to the vTaskDelayUntil() function, of the mechanism discussed in the other thread we have just posted to?

Could it be a resolution problem?  For example, if you want to delay for 256 ticks, then the delay period could be between 256 ticks and (255 + n) ticks, where n is the fraction of time left between the delay function being called and the next tick?

Regards.

nobody wrote on Thursday, April 13, 2006:

Hello Richard,

I haven’t looked at that thread to tell you the truth - but I will.

Ex:

Timer_Hz = 1024 (0…1023)
250 ms ‘scales’ to 256 ‘counts’ - is it really
255 ticks since we’re really starting from 0 and not 1 - hence the ‘fencepost’.

Thanks,
John