EEPROM Considerations

 

Revision 1.23 – 11th March 2014

www.touch-base.com\documentation\general

 

 

Implementations

Enabling EEprom

Read process

Adding EEPROM support

Contact

 

Some pointer device controllers have onboard EEPROM (Electrically Erasable Programmable Read Only Memory). EEPROM can be used to store information pertinent to the controller and also offers a memory storage area for applications and drivers to store data. One of the main uses for this memory with UPDD is to store the calibration data within the controller rather than locally on a system.

 

In all cases an absolute pointer device needs to be calibrated with the systems video display such that the point of contact is aligned with the video image.  UPDD calibration is performed by drawing points on the video display at known locations that are then touched and the touch co-ordinates are noted for the given point of display. The driver can then use this data to scale and map the touch input to the video location. This information, known as the calibration data, needs to be stored for future reference, such that the device is calibrated at each system power up. This information can be stored locally on the system (e.g. the system’s persistent memory, within a file, etc) or externally in the controller’s EEPROM.

 

Given that UPDD supports 100’s of different pointer devices, all with different characteristics, our driver generally stores its calibration data locally within the system.

 

However, there are cases where it is desirable to store calibration data externally. This is especially true of systems where the calibration data cannot be stored locally, such as some embedded system configurations where the entire system is locked down and any changes made are lost when the device is powered off.  In other cases it is desirable to calibrate a touch screen prior to usage on a similar system so that it is calibrated when first used and will only require recalibrating if the EEPROM calibration is inaccurate.  

 

As and when we have been requested to support EEPROM calibration for a given controller it has been added. When one of these controllers is defined in the UPDD build (and with EEprom enabled) and added in the UPDD Console as an active device an EEPROM check box is shown on the UPDD Console, Calibration screen.

 

 

When this EEPROM check box is enabled (or set internally in the UPDD settings), it indicates that;

 

1)     EEPROM calibration is utilised at the NEXT calibration. It is important to note that this setting enables the EEPROM calibration procedure such that at the point of calibration the EEPROM calibration procedure is invoked. 

2)     Since UPDD 4.1.8, build id 1738 the calibration EEPROM retrieval function is invoked to read calibration data in cases where UPDD native calibration data is stored on the controller. 

EEPROM implementations

EEPROM calibration falls into two distinct categories, one whereby UPDD stores its own native calibration data in EEPROM and one whereby the controller’s own firmware calibration procedure is invoked, more commonly known as a firmware calibration.

 

EEprom is implemented in UPDD by the use of specific eeprom protocol code that is written for each controller.  When a controller is defined in our controller production system we indicate the eeprom protocol to use to enable eeprom calibration.

 

The protocol also indicates if eeprom calibration utilises the controllers own firmware calibration capabilities or stores UPDD calibration data for later retrieval, as described below

 

Method

Description

Firmware

UPDD calibration invokes the controller’s firmware calibration commands to perform calibration such that scaled touch co-ordinates are delivered when the device is in use.

 

In most cases, the calibration function implemented within the controller’s firmware dictates the number and location of the calibration points and this will be reflected within the available settings on the calibration dialog.

 

Following calibration the controller’s output is adjusted to map to the video display.

 

Where firmware calibration is use the controller internally rescales the co-ordinate output to be calibrated with the video system and thus generated co-ordinate data is “pre-calibrated” and therefore a retrieval process is not relevant.

 

UPDD

Native

UPDD calibration procedure stores its own calibration data in the controller’s EEPROM. To utilize the calibration data stored in the controller it must be retrieved using the calibration EEPROM retrieval function, typically in the following situations:

 

  • System startup, In locked down environments where updd settings are not held in a persistent state, such as embedded systems, it is important to retrieve the calibration data from the controller as any data stored locally is likely to be loss over a reboot, reverting back to the data built into the embedded image.

    Since 4.1.8, build id 1738 eeprom calibration is automatically retrieved in a Windows desktop environment at system startup for each controller that has the EEPROM setting enabled. Since 5.1.656 setting eepromreadatstartup must also be enabled if this is required, see below.

  • Device hot plug (since 4.1.8, build id 1738) eeprom calibration is automatically retrieved in a Windows desktop environment when a USB device is plugged in and when a new serial device is configured and the EEPROM setting is enabled. Since 5.1.656 setting eepromreadatnewdevice must also be enabled if this is required, see below.

  • Manually requested (since 4.1.8, build id 1738) in the UPDD Console, Calibration dialog enabling the ‘Use eeprom storage’ option will invoke a read of the calibration data.

Starting with version 5.1.656 UPDD the have been a number of changes to eeprom support:

 

  1. The video resolution of the associated monitor is stored in eeprom to accommodate Dynamic Monitor Tracking

  2. Allows greater control over when EEprom data for calibration is automatically read.

    Prior to this release eeprom calibration data was retrieved at system startup and when a new device, with eeprom capabilites, was connected to the system.  With some controllers these reads can be slow or not wanted so we have introduced some additional settings to control when eeprom calibration is read.  EEprom data is always read when the EEprom checkbox is enabled in the UPDD Console if eeprom data exists and the setting below dictate other times eeprom calibration data should be read.

    These options are available on systems running Aidaemon (i.e. most platforms apart from CE and special platforms).  By default the settings are disabled.

    A value of 1 enables the option
    A value of 0 disables the option

 

eepromreadatstartup: eeprom data is read from all devices supporting eeprom calibration and with his option enabled when aidaemon starts (i.e. at system start). This setting is not device specific. Since 5.0.2 May 2014 this is enabled by default.

 

eepromreadatnewdevice: eeprom data is read from newly added devices supporting eeprom calibration and with his option enabled at the time the devices is added to the updd managed list. This excludes devices added while aidaemon is not running (e.g. “cold plugged” usb devices). This setting is not device specific.

 

eepromreadatnewmonitor: eeprom data is read from devices supporting eeprom calibration and with his option enabled at the time when the monitor tracking feature recognises a new monitor and associates it with a touch device. This option is required for tracking monitors based on dimensions. This setting is not device specific.

Any of the above settings can be set by running the UPDD command line utility, tbutils, as per this example:

 

tbutils nodevice setting dw eepromreadatnewdevice 1 – read eeprom calibration at device add.

 

If eeprom data is not retrieved then locally stored calibration data is used. TBcalib returns an error code if the calibration data checksum is incorrect (e.g. retrieving calibration data from a controller that has no calibration data such as a new controller used for the first time).

 

Storage requirements

With UPDD 4.1.10, version 2240 and above, we have rewritten the UPDD EEprom framework to make it easier to implement cross all OS platforms. With this new implementation of eeprom calibration it requires the following amount of storage.

 

number of points x 4  + 22 bytes

 

So

 

4 points needs 38 bytes

9 points needs 54 bytes

25 points needs 122 bytes

 

16 bytes is to hold the calibration style, which must be a maximum of 15 bytes (15 + endofstring)

 

Starting with version 5.1.656 we now also store the video resolution of the associated monitor. This requires a further 4 bytes.

 

Since moving to this new framework (which caters for old eeprom implementation) we have made many internal code changes that relate to eeprom support but are not in a position to test all eeprom able controllers. It is for this reason that we request that you contact us as an when you have a eeprom storage requirement and we will advise at that time.

 

Protocol

For UPDD to be able to store its calibration data in EEPROM the driver needs firmware commands to read and write variable length data to a reserved location.

 

If using USB we prefer to be able to process the data via USB Control Requests via Endpoint 0.  When reading the data this can either be received via the normal interrupt pipe or, preferably, in the data part of the USB Control Request. When passing via the data part of the control request the data may need to be processed in 64 byte blocks.

 

Reading and writing eeprom

The reading and writing of native UPDD EEprom data built into the UPDD calibration program tbcalib. This program export a number of eeprom command line options; eeprom – read eeprom calibration and eepromwrite (4.1.10, build 2432) – write calibration data from the UPDD settings file to eeprom.

 

Enabling EEprom protocols

Give that the EEprom interface to each controller is unique there is separate protocol code written for each controller. When we define a controller we identify the protocol to use. If the EEprom protocol setting is blank then the EEprom option will not be shown

 

The protocol setting protocol identifiers are shown below with an indication when eeprom was last tested. For sheer convenience most EEprom testing is carried out in Windows and in theory if it works in Windows it should work in other OSes. We will investigate further is this proves not to be the case. UPDD versions numbers indicates when support was added.  Those listed in Red indicate additional development work is required to support in the OS and those listed in Gray are untested but in theory should work.

 

Controller

Port type

Protocol id

Description

UPDD version last tested

Firmware interface

 

 

 

 

There is no guarantee that these implementations will work with current versions of the driver or updated controller firmware as a working firmware interface is dependant is dependant on a number of factors and any change could affect eeprom operation.

DMC Fit 10

Serial

dmc-serial

Firmware calibration for scaled touch data

4.1.0

 

 

USB

dmc-usb

Firmware calibration for scaled touch data

4.1.0

 

 

When enabled the calibration procedure is restricted to the range of calibration points supported by the controller’s firmware calibration procedure.

3M SCnnn

Serial / USB

n/a

Hard coded – Firmware calibration for scaled touch data

TBA

 

UPDD invokes the controller’s 3 point calibration procedure. In some older versions of the driver it is important to manually set the number of calibration points to 3 at the same time as enabling EEPROM.

This procedure is also required to initialise / linearise the controller and should be performed at least once irrespective of the need to subsequently utilise EEPROM functionality.

Customers have reported that in some systems with video resolution 800 x 600 this procedure has failed but has worked fine with a 1024 x 768 resolution!  Yet to be fully understood!

ELO Smartset

USB

smartset-usb

Firmware calibration for scaled touch data

4.1.6

 

UPDD invokes the controller’s 3 point calibration procedure. Internally it actually uses a 2 point algorithm with the 3rd point to determine orientation.

Nihon Kaiheiki

USB

nikkai-usb

Firmware calibration for scaled touch data

4.1.8

Nihon Kaiheiki

Serial

nikkai-serial

Firmware calibration for scaled touch data

4.1.8

 

When enabled the calibration procedure is restricted to the range of calibration points supported by the controller’s firmware calibration procedure, being 2, 4, 5 and 9.

Controller

Port type

Protocol id

Description

UPDD version last tested

Software interface

 

 

 

 

 

 

 

Over the lifetime of the driver there have been a number of attempts to implement a generic framework within our driver to best accommodate EEPROM support and minimise the custom code needed for each implementation.  Under 5.0.2 we introduced a new framework so that we could implement eeprom related functions with standard API calls and the internals of the calls handles the individual controller interface based on the protocol id. 

The new generic API calls are TBApiReadEEPROM and TBApiWriteEEPROM. Controllers that are supported by the new framework, highlighted in blue below, support all current eeprom features in UPDD 5.0.2 and above, being:

  • The read and write options in tbcalib are supported
  • The read and write options in tbutils are supported
  • EEPROM based calibration is supported.

 

Zytronic x-y

Serial

zytronic-serial

EEprom storage or UPDD data

5.0.2

 

USB

zytronic-usb

EEprom storage or UPDD data

5.0.2

Zytronic ZXY 100

Serial

zxy100-serial

EEprom storage or UPDD data

5.0.2

 

USB

Zxy100-usb

EEprom storage or UPDD data

5.0.2

Hampshire/Microchip

Tsharc

USB

tsharc-usb

EEprom storage of UPDD data

 

5.0.2

 

Only works with EEprom capable controllers. Further, due to current firmware limitations the data is written to the controller, 1 byte at a time, and depending on the number of calibration points can take a significant time to store and retrieve.  4 points takes approx 20 seconds.

Microchip AR1100

Serial

ar1xxx-serial

EEprom storage of UPDD data Under development

5.0.2

Microchip AR1100

USB

mc-ar1100

EEprom storage of UPDD data Under development

5.0.2

Data Modul

USB

PID 1 and 2

EETI

datamodul

EEprom storage of UPDD data

4.1.8

TRS Star

USB

TRS

EEprom storage of UPDD data

5.1.0

TRS Star

Serial

TRS

EEprom storage of UPDD data

5.1.0

 

The EEProm protocol id settings are held in the UPDD settings file, TBUPDD.INI, within the branch [updd\paramaters\n] (for configured/active controllers) and [updd\parameters\controller\ts00n] the default settings for controllers supported by the driver:

 

eeprom calibration=0x1

eeprom protocol=’protocol id’

 

For CE see EEprom notes in the CE documentation. At the time of writing the CE driver only supports EEprom in controllers whereby UPDD calibration is being stored and not firmware based calibration controllers. This support will be added as required.

 

If you are using a driver which supports one of the above controllers but does not show the EEprom option then it is likely the EEprom setting was/is not defined in the definition of the driver at build time.  If this is the case contact Touch-Base to request an updated build.

Read process

The following dialog is shown during the read process unless the setting eepromreadsilent is set to 1. This can be set using the UPDD command line utility i.e. tbutils nodevice setting dw eepromreadsilent 1

 

 

If valid calibration data is held in the controller it is utilized otherwise calibration data held locally is used.

 

If Calibration settings (no. of points, margin etc) are also held in eeprom (space permitting) they are used as stored. If they are not held then the calibration values defined in the UPDD Console need to match the eeprom data reference points.

The read mechanism has a degree of auto retry and recovery code but repeat read failures or invalid CRC will result in the following dialogue being displayed:

 

 

This could happen whereby EEPROM setting is enabled but a new controller, without any valid calibration data is connected.

 

The tbupdd.ini file setting eepromreadstatus is the return code from the last execution of the eeprom read function of tbcalib, with 0 meaning success.

Adding EEPROM support

We can add support in UPDD for any EEPROM enabled controller as required once supplied the technical documentation which describes the controller’s EEPROM calibration interface.

 

If you are a controller manufacturer and would like to add EEPROM capabilities to you controller, we are aware of three methods that have been utilised as described below:

Raw Mode

Firmware commands are used to specify that raw blocks of data can be stored and retrieved from EEPROM.  In this mode, UPDD simply stores and retrieves the calibration from the controllers EEPROM.

 

This is the simplest method to implement for both the firmware developers and our driver as the EEPROM read and write functions are already built into the UPDD calibration program.

Formatted mode

The controller’s firmware dictates the format of the calibration data passed to the controller which is further processed by the controller.  The co-ordinate data is then scaled and mapped to a grid co-ordinate range, based on the formatted data.  In this case the calibration program has to gather calibration data as dictated by the data format requirement.

Co-operative mode

The controller’s firmware exposes calibration commands such that the calibration program issues a firmware command for each calibration point displayed and the firmware captures the calibration points in real-time.  The number of calibration points and the pattern used is dictated by the firmware’s requirements.  The co-ordinate data is then scaled and mapped to a grid co-ordinate range, based on the capture calibration information.

Contact

For further information or technical assistance please email the technical support team at technical@touch-base.com