Wednesday, November 23, 2011

SGX-120L Configuration Tool

The SGX-120L serial graphics LCD has several configuration settings that control the display's default startup behavior. You can set the SGX to start with the backlight on or off, blank or with a startup screen, with a particular font size, etc. Setting these options requires adding up the option numbers and sending them to the display using the ESC-W instruction (documented here).

Since we're getting ready to roll out a new version of the SGX, we decided to make a little GUI tool to make configuration easier.  It's available for download here (New SGX Tools...). Here's how it looks in XP dress (works with '95 through Windows 7):

To use the tool, extract it from its ZIP archive to a convenient spot on your PC (Desktop is good; a thumb drive might be better). No installation is required, but the program does create a small file called sgxconfig.dat in the same directory. This file saves your settings between uses of the program.

To send a configuration instruction to the SGX:

  • If version 1.0, set the 9600/2400 switch to 9600 and SET/RUN to SET
  • If version 2.0, make sure that the Dsu (display setup) jumper is uncut
  • Identify the port to which the SGX is connected to and set Comm Port to match. 
  • Pick your options and click Send. They'll take effect the next time the SGX powers up.
A couple of minor version-related differences are worth highlighting:

Write Protection. On the original, v1 SGX, write protection of stored screens was all or nothing, and it was disabled by default. As a result, users would occasionally replace screens 0 and 1 (which are the default font) with some other bitmap, causing text to print in hieroglyphics!

The new v2 SGX guards against fonticide with an additional layer of write protection. Now, screen pages 2 through 16 are writeable by default, but you must explicitly disable font write protection before you can replace screens 0 and 1.

Although there are four possible combinations of the two write-protect bits, only three are valid:

Allows writes to screen pages 2-16; blocks writes to the default font screens (screens 0, 1).

No writes allowed.

Allows writes to all screen pages (0-16) including font (screens 0, 1).

What about both boxes checked? The tool won't permit it, because it would imply (incorrectly) that only writing to the font screens is allowed. No such mode exists. If you were to input this combination manually using ESC-W, it would be equivalent to the middle option, no writes at all.

A reminder: If you're using the tool with one of the gajillion or so v1 SGXes out there, the only valid option is 'write protect all.'

SGX Confirmation. Another new feature of the v2 SGX is the confirmation screen for memory operations. When you send new settings to the display it  just quietly memorizes them. To confirm the download, you'd generally have to cycle the power and check for the new settings.

The v2 SGX will (optionally) display a screen to acknowledge successful reception of a config instruction. It can also remind you in case you've previously cut the display setup (Dsu) jumper intending to prevent configuration changes. Here are the screens:

No comments:

Post a Comment