Contents Contents ii 1 Introduction 1.1 What to Expect From the GLK12232-25-SM . . 1.2 What Not to Expect From the GLK12232-25-SM 1.3 Keypad Interface . . . . . . . . . . . . . . . . . 1.4 mogd.exe . . . . . . . . . . . . . . . . . . . . . 1.5 Installation . . . . . . . . . . . . . . . . . . . . 1.6 Setting Up . . . . . . . . . . . . . . . . . . . . . 1.7 Trying out the GLK12232-25-SM . . . . . . . . 1.8 Trying out a Keypad . . . . . . . . . . . . . . . 1.8.1 Here’s what to do: . . . . . . . . . . . . 1.
5.3 5.2.6 Draw Solid Rectangle (254 120 [color][x1][y1][x2][y2]) . 5.2.7 Initialize Bar Graph (254 103 [ref][type][x1][y1][x2][y2]) 5.2.8 Write to Bar Graph (254 105 [reference number][value]) . 5.2.9 Display Saved Bitmap (254 98 [reference number][x][y]) . Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Enter Flow Control Mode (254 58 [full][empty]) . . . . . 5.3.2 Exit Flow Control Mode (254 59) . . . . . . . . . . . . . 6 Keypad Interface 6.1 General . . . . . . . . . . . . .
8.1.10 8.1.11 8.1.12 8.1.13 8.1.14 8.1.15 Set I2 C Address 254 51 [address]) . . . . . Read Module Type (254 55) . . . . . . . . Set RS-232 Port Speed (254 57 [speed]) . . Set Serial Number (254 52 [byte1] [byte2] . Read Serial Number (254 53) . . . . . . . Read Version Number (254 54) . . . . . . 9 Appendix: Command Summary 9.1 General . . . . . . . . . . . 9.2 Issuing Commands . . . . . 9.3 Text Commands . . . . . . . 9.4 Graphics Commands . . . . 9.5 Keypad Interface Commands 9.6 File System Commands .
1 Introduction The GLK12232-25-SM comes equipped with the following features; • • • • • • • 122 x 32 pixel graphics display Text display using built in or user supplied fonts Contrast is adjustable by software control Backlighting is adjustable by software control Keypad interface RS-232 or I2 C communications Extended voltage module available (-V). This module is equipped with a constant current source to ensure consistancy in backlight brightness from unit to unit.
1.4 mogd.exe Matrix Orbital has developed an interface program which exercises all the features of the display. It is also used to manage font and graphics downloads. The program, called "mogd.exe", is provided on the Matrix Orbital Cd and website. To install mogd.exe follow these steps; 1. 2. 3. 4. 5. Insert the Matrix Orbital CD-ROM into the appropriate drive. Locate the file "mogd.zip". It should be in the “Download” directory. Unzip mogd.
Make certain the GLK12232-25-SM is equipped with the proper connector for use with this cable. Figure 1: Connections for Testing 1. Refer to 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.
1.8 Trying out a Keypad Since a number of different keypad types can be connected to the display, the results may be a little unpredictable. At this point all we need to do is make sure that the keypad and interface work, and possibly generate an ASCII map for any programming needs. The keypad interface on the display converts a row / column connection to an ASCII character. By default, a keypress is transmitted as serial data immediately. Keypad buffering can be selected using the appropriate commands. 1.
NOTE This procedure does not change settings in the memory chip, it uses default settings stored in the main processor. This allows the user to communicate with the display when all other communications are lost. Once able to communicate with the display, the user may then change the default settings in the memory chip. 2 Memory Chip Lock Down The display uses a memory chip to store speed, start up screen contrast, I 2 C setting and other settings.
Memory Lockdown GPOs Configuration Jumpers Keypad Connector Power/Data Connector Figure 3: Electrical Connections 3.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.
GND TX RX +5V +5V GND GND +12V Figure 4: Power and Data Configuration If a standard module is ordered a 5 Volt input must be applied. You have two options for this to be applied. You can apply power and communication via one cable through the top connector or apply power via an unmodified floppy power cable through the bottom connector and power/ground through the top connector. If a wide voltage module is ordered a 7-15 Volt input must be applied. There is two options for this to be applied.
Table 1: RS-232 Pinout Pin Number 2 3 5 Direction Data from LCD Data to LCD - Description Data out (LCD) Data in (LCD) Ground LCD Tx Rx gnd Host Rx Tx gnd Please see the following figure below for the default RS232 configuration. Figure 5: Default RS232 Configuration 3.1.3 TTL Communications This device complies with the EIA232 standard in that it uses signal levels from +/-12V to +/- 12V. It will also operate correctly at TTL (0 to +5V) levels.
the indicated I2 C setting. The required modification must be carried out, as described in the Figure below. Figure 7: I2 C Connections To communicate in I2C you must connect according to the 4 pin connector as shown in the Figure below. GND SDA SCL +5V +5V GND GND +12V Figure 8: I2 C Connections Now the unit will be able to communicate over I2 C. It uses the same pins as RS-232. Much more detail on this basic I2 C function can be found in the I2 C specification by Phillips.
The two outputs differ slightly in specification; GND GPO1 GND GPO2 • G1 provides an output which is switched LOW when ON. When G1 is OFF it is pulled up to +5V through 150 kohms. In other words it can only be used to ’ground’ an external device. Maximum current is 250 mA. • G2 provides an output which is switched LOW when ON. When G2 is OFF it is pulled up to +5V, supplied by the module. Maximum current is 250 mA. Figure 9: GPO Configuration Both outputs are referenced to ground.
4 Displaying Text This chapter describes the various text-display commands in detail. 4.1 General Text is displayed on the GLK12232-25-SM using fonts saved in its internal flash memory. The display is supplied with a 5x7 font installed. If this is suitable, there will be no need to install any other fonts. 4.2 Writing Text to the Display When the display receives a character, it displays that character at the position currently defined.
scrolling, care should be taken to clear areas where text is being written, particularly when wrapping occurs. This may be done using the “Draw solid rectangle” command with the colour set to white. 4.3.3 Set Text Insertion Point (254 71 [col] [row]) This command sets the insertion point to the [column] and [row] specified. The insertion point is positioned using the base size of the current font (this command does not position the insertion point at a specific pixel).
• [y space] specifies the number of pixels to place between rows of text (i.e. line spacing). • [scroll row] specifies the pixel row where scrolling should start (or, if auto scrolling is off, where wrapping should occur). Typically, this value should be set to the first pixel row immediately below the last row of text that will fit the display. 5 Displaying Graphics This chapter describes the various graphics display commands in detail. 5.
Each pixel in a bitmap is described by a single bit, and may only have the values ON or OFF. For example, shades of grey are not supported. 5.2 Graphics Commands In this section commands are identified by their names and decimal values. The coordinate origin (0,0) is at the top left corner of the display. X values go from 0 to 239 (increasing toward the right) and Y values go from 0 to 63 (increasing toward the bottom). 5.2.
5.2.6 Draw Solid Rectangle (254 120 [color][x1][y1][x2][y2]) This command draws a solid rectangle in the specified color (0 = white, non-zero = black). The top left corner is specified by (x1,y1) and the bottom right corner by (x2,y2). Since this command involves considerable processing overhead, we strongly recommend the use of flow control, particularly if the command is to be repeated frequently.
5.3 Flow Control The display has built in flow control which is very useful during direct bitmap display and multiple pixel placement. Flow control is enabled or disabled by two commands. If flow control is enabled, the display will return an “almost full” message (0xFE) to the micro-controller when its internal buffer fills to a defined level, and an “almost empty" message (0xFF) when the buffer contents drop to a defined level. 5.3.
6.1 General The display keypad interface processes the keypad row / column matrix into a serial (RS-232 or I 2 C) data byte stream. Aside from this processing, the keypad has no effect on the display. If it is necessary to send keystrokes to the display, they must be routed through the micro-controller. 6.2 Connections GND ROW1 GND COL1 Figure 12: Keypad Connector Figure 13: Keypad Connector The connector is not ’keyed’ so the keypad will probably plug in either of two ways.
Table 2: Keypad Layout Rows 1 2 3 4 5 1 A F K P U Columns 2 3 4 B C D G H I L M N Q R S V W X 5 E J O T Y NOTE The keypad connector must be wired with columns on one side and rows on the other side of the center of the connector. In situations where the keypad isn’t wired this way an adapter will need to be made, or the user should rewire the connector to meet this requirement. 6.3 I2 C Interface The keypad is read by I2 C master read.
Two modes of auto repeat are available and are set via the same command. 1. Resend Key Code: This mode is similar to the action of a keyboard on a PC. In this mode, when a key is held down, the key code is transmitted immediately followed by a 1/2 second delay. After this delay, key codes will be sent via the RS-232 interface at a rate of about 5 codes per second. This mode has no effect if polling or if using the I2 C interface. 2.
6.5.5 Clear key buffer (254 69) This command clears any unread keypresses. In a menuing application, if the user presses a key which changes the menu context, any following key presses may be inaccurate and can be cleared out of the buffer between menu changes to prevent jumping around the menu tree. It may also be used to, in effect, reset the keypad in case the host application resets for whatever reason. 6.5.
Of course, the average module will simply have files loaded into it and it will then get to work, without ever having to perform this file reorganization task. The file space may be rewritten up to 100 000 times, but most users will simply load in their fonts and bitmaps once and that will be it. 7.2 Using mogd.exe The Matrix Orbital interface program "mogd.exe", which is provided on the eCD generates and saves fonts larger than 14 pixels in height.
7.3.3 Upload Font (254 36 [ref] [file size] [file data]) This command begins a font upload to the display’s non-volatile memory. [ref] is the reference number to be used for this font. File size is a 2 byte value that must be calculated by the host before the transfer takes place. 7.3.4 Upload Bitmap (254 94[ref] [file size] [file data]) This command begins a bitmap upload to the display’s non-volatile memory. [ref] is the reference number to be used for this bitmap.
Table 3: File Format 0xFF Width O-Low O-High Data Data Data Data Data Data Data Data Data Data 7.4.
Table 4: Uploading the file to the Module Host sends 0xfe ’$’ (command)) ’2’ (reference Module sends 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 available memory when t
Figure 15: Bitmaps for h, i, and j Now the bitmaps have to be converted to bytes. If the font is 8 bits high it becomes a fairly 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’. Figure 16: 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. Each byte is shown in a different colour in the diagram.
Table 6: Explanation of Bytes in the File FF FF 05 07 68 70 00 0F 05 00 14 03 00 017 04 7F 04 81 80 07 C4 3E 10 02 20 B1 07 Placeholders for actual EOF Font width Font height First ASCII character defined Last ASCII character defined Offset to definition of first character (h) Number of bytes in definition of first character Offset to definition of second character (i) Number of bytes in definition of second character Offset to definition of third character (j) Number of bytes in definition of third charac
8.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. Individual display modules will also differ slightly from each other in appearance.
8.1.8 General Purpose Output On (254 86 [gpo #]) This command turns ON either of the general purpose outputs. [gpo #] is 1 for G1 or 2 for G2. Please note that ON means that the output is pulled low. 8.1.9 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. 8.1.
Table 8: Speed Settings Speed Value 20 Hex 0F Hex 95 Hex 03 Hex 8A Hex 8.1.13 Speed 9600 baud 19200 baud 57600 baud 76800 baud 115000 baud 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.
9.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 n/a 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" (section 3.3.7) for more details.
Command Put pixel Draw outline rectangle Draw solid rectangle Initialize bar graph Write to bar graph Display saved bitmap Syntax FE 70 [x][y] 254 112 [x][y] 254 ’p’ [x][y] 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] FE 69 [ref][value] 254 105 [ref][value] 254 ’I
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 ^E [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. 9.
Command Set backlight brightness and save Syntax FE 98 254 152 Default on General purpose output on FE 56 254 86 254 ’V’ FE 57 254 87 254 ’W’ FE 33 [address] 254 51 [address] 254 ’3’ [address] off FE 37 254 55 254 ’7’ FE 39 [speed] 254 57 [speed] 254 ’9’ [speed] FE 3A [full] [empty] 254 58 [full] [empty] 254 ’:’ [full] [empty] see table FE 3B 254 59 254 ’;’ n/a General purpose output off Set I2 C address Read module type Set RS-232 port speed Enter flow control mode Exit flow control mode Matri
Command Set Serial Number Syntax FE 34 [byte1][byte2] 254 52 [byte1][byte2] 254 ’4’ [byte1][byte2] Default n/a Read Serial Number FE 35 254 53 254 ’5’ FE 36 254 54 254 ’6’ n/a Read Version Number 10 n/a Notes This is a onetime-use command which works only on units without factory set serial numbers. Reads the two byte serial number of the module. Reads the firmware version number of the module. Returns a 1-byte hex value.
Table 21: Optical Characteristics Pixel Layout Number of Characters Display Area Dot Size Dot Pitch LED/CCFL Backlight Life Color of Illumination 122 x 32pixels XxY 80 (Maximum 20 Characters x 4Lines with 5x7 Font) 60.2 x 18.0mm XxY 0.40 x 0.40mm (XxY) 0.44 x 0.44mm (XxY) 100, 000 Hours on Average White / Ice Blue >C0*O P%#0* ># !%C * *.C% H QOP > P P% R C>!0Q *.
Model LCD0821 LCD2041 LCD4021 LCD4041 LK162-12 LK202-25 LK204-25 L402-12 LK404-55 LK404-AT BLC2041 VFD2041 VK202-25 VK204-25 BVF2041 GLC24064 GLK12232-25 GLK12232-25-SM GLK24064-25 Matrix Orbital E a a a a a a a a a a a a a a a a n/a n/a a V a a a n/a a a a a n/a n/a a a a a a n/a n/a n/a n/a VPT n/a n/a n/a a n/a n/a a a a a n/a n/a n/a a n/a a n/a n/a a GLK12232-25-SM EL n/a n/a n/a a n/a n/a n/a n/a a a n/a n/a n/a n/a n/a a n/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 n/a n/a n/