Configuration: Timer Constants

Describes how to set the values of timer constants that change the behaviour of the Digitizer Driver.

The timing constants are defined near the beginning of the template port implementation of the platform specific layer in ...\template\template_variant\specific\xyin.cpp.

The values and their meaning are as follows:

KInterSampleTime

This constant determines the rate at which individual samples within a group are collected.

A group of samples is collected when the pen is down, and, in the template port, this is handled by DTemplateDigitiser::TakeSample().

Once all the samples in a group have been collected, the function calls Digitiser::RawSampleValid() in the platform independent layer, whose main purpose is to ensure the validity of the samples by checking the spread. If the samples appear valid, it averages the samples to obtain the current position.

The setting of the timer constant depends on the sample resolution of the digitizer:

  • A high resolution can lead to more jitter between samples, and therefore more smoothing is required to obtain nice steady values. This argues for higher sampling rates, and a smaller value of KInterSampleTime.

  • A low resolution means that there is very little variation between consecutive samples, and therefore fewer are required. This argues for lower sampling rates, and a larger value of KInterSampleTime.

Another consideration when setting this constant is the speed of the communications between the MPU and the digitizer.

In the Symbian reference ports, this value varies between 1 and 3.

KPenDownDelayTime

This value is used in the implementation of the pen interrupt interrupt service routine (ISR). It represents a delay, measured in nano-kernel ticks, between a pen down event and the start of the collection of digitizer samples.

The value is optional. Choose a value of 0 if no delay is required. Typically, a value of 2 is chosen.

KInterGroupTime

This value is used in DTemplateDigitiser::WaitForPenUp() and DTemplateDigitiser::WaitForPenUpDebounce(). After a group of samples has been collected, there is a delay, dictated by the value of this constant, before the collection for the next group begins.

The inverse of the sum of KInterSampleTime, and KInterGroupTime will therefore determine the frequency at which groups of samples are taken. This, in turn, dictates how often pen movement events are issued, and, if no interrupt is used on pen up, how quickly this situation is ascertained. The constant is optional. Typically it is set at 1ms

The delay is optional, a value of zero meaning that there is no delay. Typically, a value of 1 is chosen.

KPenUpDebounceTime

This value is used in DTemplateDigitiser::TakeSample(). If, during sample collection, the pen goes up, then the digitizer will wait for this period of time before deciding whether the removal of the pen is momentary, or whether it is an intentional removal - this is also referred to as debounce.

If, after the delay, the pen is still up, then a pen-up event is issued; otherwise the state of the digitizer reverts to collecting mode, resetting the sample buffer

Typically, this value is set to around 30.

KPenUpPollTime

This value is used in DTemplateDigitiser::TakeSample().

If the pen is down when the system powers on, then the digitizer is sampled using this delay until the pen is up.

Typically, this value is set at 30.