Wednesday, November 23, 2011

SGX-120L Bitmap Tool

The SGX-120L serial graphics display can store up to 17 full screen bitmaps in flash memory; two of the bitmaps make up the display's font, the other 15 can be displayed using the ESC-E instruction (or used as alternative fonts).

The most practical way to load bitmaps into the SGX has always been to create .BMP files on a PC (using the free Paint program included with Windows), but our conversion/downloading software has been pretty crude, to say the least. With the introduction of a new SGX coming up, we decided to freshen up the bitmap tool:

The program, which runs under '95 through Windows 7, is available for download here (New SGX Tools...).

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 couple of small files in the same directory. These files save your comm port setting and downloaded-file list between uses of the program.

Using the program is pretty straightforward, but here's a quick rundown:

  • Connect the SGX to your PC serial port. 
  • Set the Comm Port box to match the serial port number you're using. 
  • If the SGX is a version 1.0 model, set the 2400/9600 (bps) switch to 9600
  • If the SGX has previously been write-protected, undo that with the config tool
  • Click Load .BMP File and find a 120x32-pixel monochrome BMP file to download to the SGX. 
  • Click Send to SGX and (assuming the file and comm port are OK) the picture will appear on the display.
To save a picture to the SGX, put a check in the box Save to SGX Flash Memory and select the page number in the box below that. Don't pick page 0 or 1 unless you are replacing the font! Now when you click Send to SGX, the bitmap will be downloaded and memorized to flash inside the display.

As you download and save pictures to the SGX, the program makes a list of BMP files and SGX screen pages and saves it to a text file called sgxscreens.lst. This file is located in the same directory as the program. If you need to set up multiple SGXes with the same bitmaps in the same screen pages, this file helps automate the job. Here's how:

Launch the bitmap tool and download the desired bitmaps to the desired screen pages of the SGX. When that's done, rename the list file sgxscreens.lst to something like mysgxscreens.lst. All that's important is that you keep the extension .lst. (You can examine the file in Notepad or another text editor to check on your files.)

To download the file list to another SGX,  click Load List and select your .lst file. The preview area will be cleared in preparation for the series of downloads, like so:

When the SGX is connected, click Send to SGX and the program will download the files from your list and save them to the same SGX flash pages as the original, manual downloads. As the download progresses, each bitmap will appear in the preview:

When the download is complete, a status message appears:

To load another SGX, click Send to SGX again.

SGX v2 Confirmation Screens. The new SGX-120L version 2.0 (v2) can optionally display a confirmation screen to show whether a memory operation succeeded. In the case of screen downloads, if write-protection is in effect, the SGX will not store the downloaded screen. With the original, v1 SGX, you'd have to check to ensure that a bitmap was actually stored (or be certain you hadn't set write protection and forgotten about it). The v2 can provide a confirmation screen instead:

Confirmation screens are only available during manual downloads; during list-file downloads the images flip by too quickly to make the confirmations useful. Here, it would make sense to either freshly configure the display with write-protection off, or try a single, manual download to test write-protection status before running a list-based download.

Raw-Data Secret Knock. The Comm Port box accepts numbers from 1 to 99, but since ports are assigned sequentially starting at Comm 1, it seems unlikely that many users will have ports into the high double-digits. So Comm Port "99" has been appropriated to write the raw bitmap data to the clipboard. You'll get 30 lines of text with values in hexadecimal format that can be pasted into a text editor for use in a program. If you load a list file and select port 99, the program will put each bitmap on the clipboard with pauses in between to allow you to paste the data like so:

No comments:

Post a Comment