GLK24064-25 Technical Manual Revision: 1.
Contents Contents ii 1 Introduction 1.1 What to Expect From the GLK24064-25 . . . 1.2 What Not to Expect From the GLK24064-25 1.3 Keypad Interface . . . . . . . . . . . . . . . 1.4 mogd.exe . . . . . . . . . . . . . . . . . . . 1.5 Trying Out the GLK24064-25 . . . . . . . . 1.5.1 Here’s what to do: . . . . . . . . . . 1.6 Trying out a Keypad . . . . . . . . . . . . . 1.6.1 Here’s what to do: . . . . . . . . . . 1.7 Manual Over-ride . . . . . . . . . . . . . . . 1.8 Memory Chip Lock Down . . . . . . . . .
4.3 4.2.3 Continue line (254 101 [x][y]) . . . . . . . . . . . . . . . . . . . . 4.2.4 Put pixel (254 112 [x][y]) . . . . . . . . . . . . . . . . . . . . . . 4.2.5 Draw outline rectangle (254 114 [color][x1][y1][x2][y2]) . . . . . . 4.2.6 Draw solid rectangle (254 120 [color][x1][y1][x2][y2]) . . . . . . . 4.2.7 Initialize bar graph (254 103 [ref][type][x1][y1][x2][y2]) . . . . . 4.2.8 Write to bar graph (254 105 [reference number][value]) . . . . . . 4.2.
7.1.4 7.1.5 7.1.6 7.1.7 7.1.8 7.1.9 7.1.10 7.1.11 7.1.12 7.1.13 Backlight on (254 66 [minutes]) . . . . . . Backlight off (254 70) . . . . . . . . . . . General purpose output on (254 86) . . . . General purpose output off (254 87) . . . . 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) . . . . . . .
1 Introduction The GLK24064-25 comes equipped with the following features; • • • • • • 240 x 64 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 GLK24064-25 The GLK24064-25 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.
2. Wire the connector to the power supply. On most connectors the RED lead will go to +5V and the BLACK lead to GND. Do not connect the GLK24064-25 to a spare floppy drive power lead in the PC; the wiring is not correct and the unit will be damaged. 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.
To experiment, reverse the connector and see if it generates a more logical set of characters. Ultimately, the program in the micro-controller will have to ’map’ these characters to the ones marked on the keypad, which will likely be different. 1.7 Manual Over-ride Manual over-ride should only be required in one instance.
To lock down the memory chip, solder the jumper in the ’red box’ and cut the trace where the red ’X’ is. This will lock down the memory chip, preventing anything from being changed inside it until the track is restored and the solder jumper is removed. 2 Connections 2.1 Power WARNINGS • Do not apply any power with reversed polarization. • Do not apply any voltage other than the specified voltage.
Table 2: Connector Pinout Pin 4 Pin 3 Pin 2 Pin 1 2.1.1 Ground SDA (I2 C data) / Rx SCL (I2 C clock) / Tx Vdc Power Connection (4 pin header) Power is applied via pins 1 and 4. Power requirement is; • +5Vdc ±0.25V on standard voltage units • +7Vdc to +30Vdc with Wide Voltage and Efficient Switching Power supply (-VPT). Figure 4: Power Connector 2.1.2 Five Volt Power Cable If a display module is used in a PC it becomes tempting to plug a spare power connector into the unit.
Matrix Orbital can supply an adapter cable designed to use with the display module when it’s installed in a PC. The cable is wired as shown in the Figure below. Figure 6: Five Volt Cable Simply insert the splitter cable in series with a ’large’ power connector (i.e., one going to a hard drive) and plug the small connector into the display module. The connector is ’keyed’ and will only fit one way.
Figure 8: DB-9 Solder Jumper WARNING For users with wide voltage units, please note; power may only be delivered by +5Vdc through the DB-9 connector, regardless of VPT. Only one modification must to be done. 1. Solder the jumper in the ’red square’. It’s located right of the DB-9 connector, in the middle. Figure 9: DB-9 Solder Jumper 2.2 Communications 2.2.1 RS-232 Communications and DB-9 Connector Pinout A standard DB-9F is provided for RS-232 communications.
Figure 10: RS-232 and Power Connector The RS-232 connector on the serial cable is wired so that a standard ’straight through’ 9 pin D-sub cable may be used to connect the modules to a standard serial port such as COM ports on PCs. Note that this device complies with the EIA232 standard in that it uses signal levels from +/-12V to +/- 12V. It will can also operate correctly at TTL (0 to +5V) levels. To use standard RS-232 no modifications are required. For TTL, please see below.
tor. This will allow TTL RS-232 levels of communication through the DB-9 connector or the power connec- 2.2.3 RS-232 Communication through the Power Connector RS-232 communication can also be achieved through the middle two pins of the power connector. Figure 12: Power Connector Table 4: Connector Pinout Pin 4 Pin 3 Pin 2 Pin 1 Ground Rx Tx Vdc To allow this, the jumpers must be set as indicated below; Figure 13: RS-232 2.2.
Figure 14: Power Connector Table 5: Connector Pinout Pin 4 Pin 3 Pin 2 Pin 1 Ground SDA (I2 C data) SCL (I2 C clock) Vdc The display does not work on I2 C by default. The modification shown below must be done; Figure 15: I2 C 2.2.5 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.
care of these things entirely within hardware subsystems which operate at the same speed as the transmission themselves. The display uses a standard Phillips 7bit address as defined by Phillips. However, Matrix Orbital specifies I2 C address in 8bits. The 8th bit, least significant bit (LSB or Low Order Bit) of the 8bit address is a read / write bit. If we take a standard Phillips 7bit address of 45hex this would be in binary 1000101. This is 7bits.
3 Displaying Text This chapter describes the various text display commands in detail. 3.1 General Text is displayed on the display using fonts saved in its internal flash memory. The display is supplied with a 5x7 font installed. If this is suitable, there is no need to install any other fonts. 3.2 Writing Text to the Display When the display receives a character, it displays that character at the position currently defined.
3.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). The pixel column used is determined by multiplying the width of the widest character in the font by [column]. The pixel row used is determined by multiplying the height of the font by [row + interline spacing]. 3.3.
4 Displaying Graphics This chapter describes the various graphics display commands in detail. Uploading a bitmap to position 1 will result in it being displayed on power up. 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.
4.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). 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.
4.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.
4.2.10 Direct screen write bitmap (254 100 [x1][y1][x2][y2][data]{[data]}) This command is used to draw a bitmap to the screen directly without first storing it in the file space. This is a far quicker method of drawing a bitmap to the screen than using individual pixels. There are some irregularities and limitations to this command. Unlike the format of bitmap download, this command expects data to be sent horizontally instead of vertically.
MSB = 1 shifts right For example, if [ref] is 1; 254 107 1 (hex FE 6B 01) shifts left 254 107 129 (hex FE 6B 81) shifts right This command shifts the contents of the area defined in the "Initialize strip chart" command 8 pixels at a time. 4.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.
5 Keypad Interface This chapter describes the keypad interface and associated commands in detail. 5.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 the user requires keystrokes to be sent to the display, they must then be routed through the micro-controller. 5.
Table 6: Keypad Layout Rows 1 2 3 4 5 1 T O J E Y Columns 2 3 S R N M I H D C X W 4 Q L G B V 5 P K F A U NOTE 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 must be made or the connector must be rewired to meet this requirement. 5.3 I2 C Interface The keypad is read by I2 C master read. In short, this means that a read of the module will always return the first unread key press.
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.
5.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. 5.5.
Of course, the average module will simply have files loaded into it and 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. 6.2 Using mogd.exe The Matrix Orbital interface program "mogd.exe", which is provided on the disk and the website, generates and saves fonts larger than 14 pixels in height.
6.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. 6.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 7: File Format 0xFF Width O-Low O-High Data Data Data Data Data Data Data Data Data Data 6.4.
Table 8: Uploading the File to the Module Host sends 0xfe ’$’ (command) ’2’ (reference) Module sends ’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 • If the module detects that the file will not fit in the avail
Figure 20: 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 21: 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 10: 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 chara
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.8 Set I2 C address 254 51 [address]) This command sets the I2 C write address of the module. This value must be an even number and the read address is one higher. For example if the I2 C write address is set to 0x50, then the read address is 0x51. The change in address is immediate. This address is 0x50 by default, and is reset temporarily back to that value when the ’manual over-ride’ jumper is used on power up. 7.1.
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. Any future attempt to execute this command will result in no change and the module will return to the originally set serial number. 7.1.
in the BASIC program. Or, with C the user could (using Zcomm serial library) A B C0* *D %E%F G 5. B C * * H I D7 ' " >;=< A B C0* *D %E%F G 5. B C * * H I D7 LJ KMJN;=< 8.3 On Numbers Like all computerized devices, the display operates with commands and values in the form of binary numbers. These binary numbers are arranged in 8 digit (i.e. 8 bit) groups called bytes. The decimal value of a byte may have any value from 0 to 255.
Table 14: Example of an ASCII Table The letter The letter The number The number A a 0 9 has a value of has a value of has a value of has a value of 65 decimal or 97 decimal or 48 decimal or 57 decimal or 41 hex 61 hex 30 hex 39 hex This gives rise to the possibility of confusion when parameters are being set on the display. For example, some commands use a [type] parameter to indicate a file type. We’re told that acceptable values are 0 and 5. All parameters must use numeric values (i.e.
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 Put pixel Draw outline rectangle Draw solid rectangle Initialize bar graph Write to bar graph Display saved bitmap Initialize Strip Chart Shift Strip Chart Matrix Orbital Syntax Notes FE 70 [x][y] Puts pixel in position (x,y). Uses 254 112 [x][y] current drawing color. 254 ’p’ [x][y] FE 72 Draws a rectangular outline using [color][x1][y1][x2][y2] color [color].
8.6 Keypad Interface Commands Table 19: Keypad Interface Commands Command Auto repeat mode on Syntax FE 7E [0|1] 254 126 [0|1] 254 ’~’ [0|1] Default off Auto repeat mode off FE 60 254 96 254 ’‘’ FE 41 254 65 254 ’A’ off 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 Auto transmit keypresses on Auto transmit keypresses off Clear key buffer Poll keypad Set debounce time on n/a n/a 52 ms Notes Applies to keypad only.
Command Erase file Syntax FE B0 [type] [ref] 254 173 [type] [ref] Default n/a Purge memory FE 21 59 21 254 33 89 33 n/a Upload bitmap 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] n/a Upload font n/a Notes Erases file in memory. Type = 1 is font, type = 5 is bitmap. [ref] is reference number. Removes all fonts, font metrics, bitmaps and settings from memory.
Command Backlight on Syntax FE 42 [minutes] 254 66 [minutes] 254 ’B’ [minutes] Default on Backlight off 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] on 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 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 f
Command Set Serial Number Syntax FE 34 [byte1][byte2] 254 52 [byte1][byte2] 254 ’4’ [byte1][byte2] Read Serial Number FE 35 254 53 254 ’5’ FE 36 254 54 254 ’6’ Read Version Number 9 Default 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 27: Optical Characteristics Pixel Layout Number of Characters Display Area Dot Size Dot Pitch LED/CCFL Backlight Life Color of Illumination Matrix Orbital 240 x 64 pixels XxY 320 (maximum 40 characters x 8 Lines with 5x7 font) 127.16 x 33.88mm XxY 0.49 x 0.49mm (XxY) 0.53 x 0.
Figure 22: Physical Layout Table 28: Display Options and Availability Model LCD0821 LCD2041 LCD4021 LCD4041 LK162-12 Matrix Orbital E a a a a a V a a a n/a a GLK24064-25 VPT n/a n/a n/a a n/a EL n/a n/a n/a a n/a FL n/a n/a n/a n/a n/a 42
Model LK202-25 LK204-25 LK402-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 n/a n/a a V a a a n/a n/a a a a a a n/a n/a n/a n/a GLK24064-25 VPT n/a a a a a n/a n/a n/a a n/a a n/a n/a a EL 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 a 43