GLK12232-25-WBL Technical Manual Revision: 2.
Contents Contents ii 1 Introduction 1.1 What to Expect From the GLK12232-25-WBL . . 1.2 What Not to Expect From the GLK12232-25-WBL 1.3 Keypad Interface . . . . . . . . . . . . . . . . . . 1.4 mogd.exe . . . . . . . . . . . . . . . . . . . . . . 1.5 Setting up . . . . . . . . . . . . . . . . . . . . . . 1.6 Trying Out the GLK12232-25-WBL . . . . . . . . 1.7 Trying out a Keypad . . . . . . . . . . . . . . . . 1.7.1 Here’s what to do: . . . . . . . . . . . . . 1.8 Manual Over-ride . . . . . . . . . . . . .
4.3 4.2.9 Display saved bitmap (254 98 [reference number][x][y]) Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Enter Flow Control Mode (254 58 [full][empty]) . . . . 4.3.2 Exit Flow Control Mode (254 59) . . . . . . . . . . . . 5 Keypad Interface 5.1 General . . . . . . . . . . . . . . . . . . . . . 5.2 Connections . . . . . . . . . . . . . . . . . . . 5.3 I2 C Interface . . . . . . . . . . . . . . . . . . 5.4 RS-232 Interface . . . . . . . . . . . . . . . . 5.5 Commands . . . .
7.1.13 Read Version Number 254 54) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 8 Appendix: Command Summary 8.1 General . . . . . . . . . . . 8.2 Issuing Commands . . . . . 8.3 Text Commands . . . . . . . 8.4 Graphics Commands . . . . 8.5 Keypad Interface Commands 8.6 File System Commands . . . 8.7 Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Introduction The GLK12232-25-WBL comes equipped with the following features; • • • • • • 122 x 32 pixel graphics display Text display using built in or user supplied fonts Adjustable contrast Backlighting Keypad interface RS-232 or I2 C communications 1.1 What to Expect From the GLK12232-25-WBL The GLK12232-25-WBL is designed as the display unit for an associated controller. The controller may be anything from a single board, special purpose micro-controller to a PC, depending on the application.
1. 2. 3. 4. 5. Insert the Matrix Orbital CD-ROM into the Cd drive. Locate the file "mogd.zip". It should be in the "Download" directory. Unzip mogd.zip to a temporary directory, using a program such as Winzip, Pkzip, etc. Double click on "setup.exe". Follow the instructions on the screen to complete the installation. After installation is complete there will be a Matrix Orbital entry under "Programs" in the "Start Menu". Click on this entry to run mogd.exe. The first time mogd.
1. Refer to the Figure above for the following steps. 2. Wire the connector to the power supply. On most connectors the RED lead will go to +5V and the BLACK lead to GND. NOTE The Manufacturer’s Warranty becomes void if the unit is subjected to over-voltage or reversed polarity. 3. Connect the display to the PC using the serial cable and adapter if required. 4. Connect the power connector, making sure that the +5V goes to V+ as shown in the diagram. 5. Turn on the power: the LCD backlight should come on.
NOTES • The keypad connector must be wired with columns on one side and rows on the other side of the center of the connector. If the keypad isn’t wired this way, an adapter will need to be made. Another method would be to rewire the connector to meet this requirement. • The connector is reversible. Reversing the connector will not damage the keypad or the display, but will however, change the ASCII character map. 3. Press a key on the keypad.
Figure 2: Electrical Connections All connections are made via a 25 pin in-line connector area near the bottom edge of the PCB.
2.1.1 Power Connections WARNINGS • Do not apply any power with reversed polarization. • Do not apply any voltage other than the specified voltage. • Do not use any cables other than the cables supplied by Matrix Orbital, unless aware of the modifications required. • Do not under any circumstances use an unmodified floppy drive power cable. • Do not apply power to both the DB-9 connector AND the 4-pin power connector. • Do not apply more than +5Vdc to pin #9 of the DB-9 connector. 2.1.
Table 3: Connector Pinout Pin 4 Ground Pin 3 SDA (I2 C data) Pin 2 SCL (I2 C clock) Pin 1 Vdc 2.1.4 ACK The idea of ACK is to indicate when the data has been received correctly. ACK does not indicate data incorrectly received. ACK simply fails to indicate when data is correctly received. Clearly, this is of limited usefulness and even less so with Matrix Orbital modules. Matrix orbital modules are not capable of failing to acknowledge an incorrectly received byte in response to that byte’s transition.
Figure 4: Using the General Purpose Outputs If the device which is being driven by a GPO requires a relatively high current (such as a relay) it must have an internal resistance greater than 250 ohms, or must be current limited to 20 mA by means of a suitable resistor. NOTE The GPOs do not have any over current or over / under voltage protection so care must be taken when using them.
3.2 Writing Text to the Display When the display receives a character, it displays that character at the position currently defined. The next character sent to the module then advances to the following position on the display. Characters are drawn using the currently selected font, and only characters defined in the current font are actually processed. Characters which are not defined by the current font are ignored, and the positioning is not advanced for the next character.
3.3.4 Set current text insertion point to top Left (254 72) This command moves the text insertion point to the top left of the display area, based on the metrics of the current font. 3.3.5 Set text insertion point using pixel values (254 121 [x][y]) This command sets the next position for text placement to an individual pixel location. The coordinate ([x position],[y position]) defines a pixel on the screen where the top left corner of the screen is defined as (0,0).
4.1 General Since the display is a bit mapped device, it may be used to display graphics. Graphic images may be created by means of a pixel-oriented graphics program, saved as bitmaps, and loaded into the display using the mogd.exe program. Images may be saved in the display’s memory, and displayed upon command, or they may be downloaded ’on the fly’ (inline) during display operation. Note that ’saved’ and ’on the fly’ graphics images are processed differently.
4.2.1 Set drawing color (254 99 [color]) This command sets the drawing color for subsequent graphic commands that do not have the drawing color passed as a parameter. The parameter [color] is the value of the color where white 0 Hex, and black is 255 Hex. NOTE All non-zero values will display as black. 4.2.2 Draw line (254 108 [x1][y1][x2][y2]) This command will draw a line from (x1,y1) to (x2,y2) using the current drawing color.
4.2.7 Initialize bar graph (254 103 [ref][type][x1][y1][x2][y2]) This command initializes a bar graph referred to by number [reference number] of type [type] with size from (x1,y1) (top left) to (x2,y2) (bottom right).
4.3.1 Enter Flow Control Mode (254 58 [full][empty]) NOTE Flow control applies only to the RS-232 interface. It is not available for I 2 C. This command enables flow control. When the buffer fills so that only [full] bytes are available the display will return an "almost full" message (0xFE) to the micro-controller. When the buffer empties so that only [empty] bytes remain the display will return an "almost empty" message (0xFF) to the micro-controller.
5.2 Connections Figure 7: Keypad Connector The connector is not ’keyed’ so the keypad will probably plug in either of two ways. The display will not be damaged by reversing the connector. However, the keypad will generate a different ASCII character mapping for each position. If the connector has fewer than 10 pins it should be centered on the display connector. The diagram shows the logical layout (row 1, column 1 in upper left). The connector for the keypad is a 10 pin 0.1" spacing male header.
5.3 I2 C Interface The keypad is read by I 2 C master read. In short, this means that a read of the module will always return the first unread key press. A read is initiated by writing to the module with its base address plus 1, then clocking the module’s return byte after the module releases the SDA line. Much more detail on this basic I2 C function can be found in the I 2 C specification by Phillips.
Figure 8: Poll Timing 5.5.2 Auto repeat mode off (254 96) This command turns off auto repeat mode. 5.5.3 Auto transmit keypresses on (254 65) In this mode, all keypresses are sent immediately to the host system without the use of poll keypad command. This is the default mode on power up. 5.5.4 Auto transmit keypresses off (254 79) In this mode, up to 10 keypresses are buffered until the unit is polled by the host system via the poll keypad command.
5.5.7 Set debounce time (254 85 [time]) [time] is in increments of 6554 microseconds. This command sets the time between key press and key read. All key types with the exception of latched piezo switches will ’bounce’ for a varying time, depending on their physical characteristics. The default debounce time for the module is about 52 mS, which is adequate for most membrane keypads. 6 Fonts and Graphics Files 6.
list of mogd should now display the new pre-generated font list. 6.3 Commands In addition to the commands listed below, the mogd.exe program saves fonts and bitmaps to the display’s flash memory. 6.3.1 Erase file (254 173 [type] [ref]) This command erases a file within the display’s memory, in addition to erasing a single file at a time. This command needs to be given two parameters: [type] and [ref]. The file type and reference number are defined when the file is saved to the display using mogd.exe.
The header consists of; • Placeholder for actual EOF (2 bytes, use 0xFF 0xFF - these bytes will be set to their final value by the module) • Nominal character width (1 byte) • Absolute font height (1 byte) • ASCII value of first character defined in this file (1 byte) • ASCII value of last character defined in this file (1 byte) The character list consists of groups of 3 bytes per character; • Offset to character bitmap (2 bytes) • Actual width of this character (1 byte) 6.4.
Table 6: Uploading the File to the Module Host sends Module sends 0xfe ’$’ (command)) ’2’ (reference ’2’ (echo reference) 0x01 (host confirms echo) 0x5e (low size) 0x5e (echo) 0x01 (host confirms echo) 0x00 (high size) 0x00 (echo) 0x01 (file fits)* 0xFF (first byte of data) 0xFF (echo) 0x01 (host confirms echo) 0xFF (second byte of data) 0xFF (echo) 0x01 (host confirms echo) 0x20 (third byte of data) 0x20 (echo) 0x01 (host confirms echo) etc NOTE If the module detects that the file will not fit in the avai
Figure 9: Bitmaps for h, i, and j Now the bitmaps have to be converted to bytes. If the font is 8 bits high, this is a pretty simple job because each vertical column is simply one byte (lsb at the top). In this case however, the font is only 7 bits high so the bytes "wrap around" as shown in the Figure below. Figure 10: Bytes For a 7 Bit High Font We’ve marked in the bits that are set for the letter "h". Remember that the bytes are ’inverted’, i.e., the LSB is at the top.
Table 8: Explanation of Bytes in the File FF FF placeholders for actual EOF 05 font width 07 font height 68 first ASCII character defined 70 last ASCII character defined 00 0F offset to definition of first character (h) 05 number of bytes in definition of first character 00 1 4 offset to definition of second character (i) 03 number of bytes in definition of second character 00 017 offset to definition of third character (j) 04 number of bytes in definition of third character 7F 04 81 80 07 definition of fir
7.1.1 Clear display (254 88) This command clears the display and resets the text write position to the top left of the screen. 7.1.2 Set contrast (254 80 [contrast]) This command sets the display’s contrast to [contrast], where [contrast] is a value between 0x00 and 0xFF (between 0 and 255). Lower values cause ’on’ elements in the display area to appear lighter, while higher values cause ’on’ elements to appear darker. Lighting conditions will affect the actual value used for optimal viewing.
7.1.7 General purpose output off (254 87 [gpo #]) This command turns OFF either of the General Purpose Outputs. [gpo #] is 1 for G1 or 2 for G2. For G1 OFF allows the output to ’float’. For G2 OFF pulls the output to +5V. 7.1.8 Set I2 C address 254 51 [address]) This command sets the I 2 C write address of the module. This value must be an even number and the read address is one higher. For example if the I 2 C write address is set to 0x50, then the read address is 0x51.
Table 10: Speed Settings Speed Value Speed 20 Hex 9600 baud 0F Hex 19200 baud 95 Hex 57600 baud 03 Hex 76800 baud 8A Hex 115000 baud 7.1.11 Set Serial Number (254 52 [byte1] [byte2] Modules may be delivered with the serial number blank. In this case the user may set the desired 2 byte serial number using this one time only command. Upon the execution of this command, the module will echo these two bytes back over the RS-232 interface. The serial number may be set only once.
8.2 Issuing Commands Commands are issued to the display by the micro-controller. In a test setup commands can be issued to the display by means of a BASIC program using the chr$( ) function. In the tables below, we’ve shown commands in hex, ASCII and decimal form. All commands begin with the prefix character 0xFE (254 decimal). These commands are issued on the serial communications link (I 2 C or RS-232) at the currently defined baud rate.
Command Set text insertion point to top left Syntax FE 48 254 72 254 ’H’ Default Set text insertion point using pixel values FE 79 [x] [y] 254 121 [x] [y] 254 ’y’ [x] [y] n/a Set current font FE 31 [font id] 254 49 254 ’1’ FE 32 [metrics] 254 50 [metrics] 254 ’2’ [metrics] n/a Set font metrics n/a Notes This command moves the text insertion point to the top left of the display area, based on the metrics of the current font. See "Set font metrics" for more details.
Command Draw outline rectangle Draw solid rectangle Initialize bar graph Write to bar graph Display saved bitmap Syntax FE 72 [color][x1][y1][x2][y2] 254 114 [color][x1][y1][x2][y2] 254 ’r’ [color][x1][y1][x2][y2] FE 78 [color][x1][y1][x2][y2] 254 120 [color][x1][y1][x2][y2] 254 ’x’ [color][x1][y1][x2][y2] [ref][type][x1][y1][x2][y2] 254 103 [ref][type][x1][y1][x2][y2] 254 ’g’ [ref][type][x1][y1][x2][y2] Notes Draws a rectangular outline using color [color].
Command Auto repeat mode off Auto transmit keypresses on Auto transmit keypresses off Clear key buffer Poll keypad Set debounce time Syntax FE 60 254 96 254 ’‘’ FE 41 254 65 254 ’A’ Default off Notes Applies to keypad only. on FE 4F 254 79 254 ’O’ FE 45 254 69 254 ’E’ FE 26 254 38 254 ’&’ FE 55 [time] 254 85 [time] 254 ’U’ [time] off Sets auto transmit mode for keypad. Keypresses are transmitted to host without polling. Up to 10 keypresses buffered until polled. Clear unread keypresses.
Command Upload bitmap Upload font Syntax FE 6E [ref] [size] [data] 254 94[ref] [size] [data] 254 ’^’ [ref] [size] [data] FE 24 [ref] [size] [data] 254 36 [ref] [size] [data] 254 ’$’ [ref] [size] [data] Default n/a n/a Notes Uploads a bitmap to the memory of the display. Uploads a font to the memory of the display. 8.
Command Backlight off General purpose output on General purpose output off Set I2 C address Read module type Set RS-232 port speed Enter flow control mode Exit flow control mode Set Serial Number Read Serial Number Matrix Orbital Syntax FE 46 254 70 254 ’F’ FE 56 254 86 254 ’V’ FE 57 254 87 254 ’W’ FE 33 [address] 254 51 [address] 254 ’3’ [address] Default on Notes Turns off backlight.
Command Read Version Number 9 Syntax FE 36 254 54 254 ’6’ Default Notes Reads the firmware version number of the module. Returns 1-byte hex value. Appendix: Specifications Table 21: Environmental Specifications Standard Temperature Operating Temperature 0 ◦ C to +50◦ C Storage Temperature -20 ◦C to +70◦C Operating Relative Humidity 90% max non-condensing Vibration (Operating) 4.9 m/s 2 XYZ directions Vibration (Non-Operating) 19.6 m/s 2 XYZ directions Shock (Operating) 29.
Figure 11: Physical Layout Table 24: Display Options Model LCD0821 LCD2041 LCD4021 LCD4041 LK162-12 LK202-25 LK204-25 L402-12 LK404-55 LK404-AT BLC2041 VFD2041 Matrix Orbital E a a a a a a a a a a a a V a a a n/a a a a a n/a n/a a a VPT n/a n/a n/a a n/a n/a a a a a n/a n/a GLK12232-25-WBL EL n/a n/a n/a a n/a n/a n/a n/a a a n/a n/a FL n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a n/a 34
Model VK202-25 VK204-25 BVF2041 GLC24064 GLK12232-25-WBL GLK24064-25 Matrix Orbital E a a a a n/a a V a a a n/a n/a n/a VPT n/a a n/a a n/a a GLK12232-25-WBL EL n/a n/a n/a a n/a n/a FL n/a n/a n/a n/a n/a a 35