Migration#

This section describes recommended workflows to migrate user applications from one iLCD panel to another of a different kind. The described approaches start from the assumption that a running application - which was designed for one iLCD model - exists and has to be ported to a different model.

Basically there are two forms of migration:

  • iLCDs with different resolutions

  • monochrome to color iLCD

This application note expects profound knowledge of the iLCD command set and occasionally refers to the “iLCD Color Commands” document available at http://www.demmel.com/download/ilcd/ilcd-color-commands.pdf.

Migrate to iLCD with different resolution#

When switching to an iLCD panel of different size or resolution, there are two ways of migrating an existing application to the new hardware.

Using Scale Commands Only#

The first approach can be described as “quick and dirty”. By just adding four commands, the entire application is scaled to the desired resolution. Before any command that uses coordinates, graphics or fonts is executed, insert the four new scaling commands (available on all color iLCDs since firmware version 2.0) in the startup macro or send them via any interface:

  • Set Graphics Scaling

  • Set Fonts Scaling

  • Set Column Coordinates

  • Set Row Coordinates Scaling

Graphics and fonts will be scaled pixel-wise with a multiplicative scale factor in horizontal and vertical direction. It is not possible to distort graphics or fonts, they are scaled equally in both directions. Note, that when moving e.g. from the DPP-CT3224-2 (320x240) to the DPP-CT6448 (640x480) with factor 2, the graphics and fonts are not converted to a higher resolution. Every original pixel will just consist of four pixels after scaling.

The scaling for coordinates can be done for both directions independently and even with non-integer values. Therefore it is also possible to scale an application for a different aspect ratio. Note, that the results of scaling operations are pixel and hence integer values. This can lead to unexpected effects due to rounding.

Note, that the default values for all scaling commands are 1. Therefore, the scaling commands have to be repeated after every command which resets all attributes to their default values (“Reset All”, “Reset All and Show Startup Graphic” and “Set Screen Orientation”). To achieve this, it is recommended to use the “Replace Text…” feature in the “Edit Macro” dialogue of iLCD Manager. Just add the scaling commands as used on startup after every \i!, \i$ and \iCO in all macros or re-send them via any interface.

For further information about scaling and command syntax, please refer to the command documentation.

Macro for above-mentioned example:

<CID> C E G 2
<CID> C E F 2
<CID> C E C 2 1
<CID> C E R 2 1

Corresponding string for Terminal:

\iCEG\2
\iCEF\2
\iCEC\D2\D1
\iCER\D2\D1

Replacing Data for New Resolution#

When porting the application to an iLCD with higher resolution than the original one, it is recommended to replace graphics and fonts with more detailed versions to achieve a more appealing representation.

The exact dimensions of all graphics are displayed in the status bar of the preview window in iLCD Manager. Just re-convert the graphics in the desired detail and replace them by choosing “Load…” in the “Edit Graphics” dialogue.

To realize higher resolution fonts, just click “Convert…” in the “Edit Fonts” dialogue of iLCD Manager and re-convert the previously used font in the according size.

Note that after these steps, commands for graphics and coordinate scaling are not longer necessary. The coordinate scaling commands are still useful though.

Migrate Monochrome Application to Color iLCD#

Basically, applications designed for DPC20xx monochrome iLCDs can be run on color iLCDs without any changes.

Text and forms drawn via iLCD commands can be colored by issuing “Set XY Color” commands before the according draw command. Monochrome graphics are also able to be dyed with the attributes foreground and background color.