GLC24064 Technical Manual Revision: 2.
Contents Contents ii 1 Introduction 1.1 What to Expect From the GLC24064 . . . 1.2 What Not to Expect From the GLC24064 1.3 mogd.exe . . . . . . . . . . . . . . . . . 1.4 Trying Out the GLC24064 . . . . . . . . 1.4.1 Here’s what to do: . . . . . . . . 1.5 Manual Over-ride . . . . . . . . . . . . . 1.6 Memory Chip Lock Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 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.9 Display Saved Bitmap (254 98 [reference number][x][y]) . . . . . . . 4.2.10 Direct Screen Write Bitmap (254 100 [x1][y1][x2][y2][data]{[data]}) 4.2.11 Initialize Strip Chart (254 106 [ref][x1][y1][x2][y2]) . . . . . . . . . 4.2.12 Shift Strip Chart (254 107 [ref]) . . . . .
7.5 7.6 7.7 Graphics Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File System Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 34 35 8 Appendix: Specifications 8.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Introduction The GLC24064 is equipped with the following features; • • • • • 240 x 64 pixel graphics display Text display using built in or user supplied fonts Adjustable contrast Backlighting RS-232 or I2 C communications 1.1 What to Expect From the GLC24064 The GLC24064 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.
• The port number to be used. (Usually COM1 or COM2) • The baud rate for the connection. It is best to use 19,200 for initial start-up of the display • The type of display unit. Set to 240 x 64 for the GLC24064 Once this information is entered the program can be used to control all functions of the display. 1.4 Trying Out the GLC24064 Before setting up the application it is best to test out the display. This is easily done with a PC.
1.4.1 Here’s what to do: Figure 2: Connections for Testing 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. NOTES • Do not connect the GLC24064 to a spare floppy drive power lead in the PC. The wiring is not correct and the unit will be damaged. • The Manufacturer’s Warranty becomes void if the unit is subjected to over-voltage or reversed polarity. 3.
1.5 Manual Over-ride Manual over-ride should only be required in one instance. If for some reason the module is set at a baud rate which cannot be produced by the host system and all communication to the display is lost, then the user should follow this simple procedure; 1. 2. 3. 4. 5. 6. Turn off the display Put a jumper on the manual over-ride pins. Power up the display. The baud rate is now set to 19,200. Remove the jumper and change the RS-232 port settings to the desired baud rate.
Figure 4: Memory Chip Lockdown To lock down the memory chip simply solder the jumper in the ’red box’ and cut the trace where the ’red X’ is. This will lock down the memory chip, thereby not allowing anything to be 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.
Figure 5: Electrical Connections Table 1: Connectors & Functions Connector 4 pin DB-9F 2 pin header 3x2 header Function Power (Vdc) and I2 C communications or RS-232 RS-232 / power GPO header I2 C and RS-232 select 2.1.1 Power Connection (4 pin header) Power is applied via pins 1 and 4. Power requirement is as follows; • +5Vdc ±0.25V on standard voltage units • +7Vdc to +30Vdc with “Wide voltage” and “Efficient switching power” supply (-VPT).
Table 2: Connector Pinout Pin 4 Pin 3 Pin 2 Pin 1 Ground SDA (I2 C data) / Rx SCL (I2 C clock) / Tx Vdc 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. Do not do this! Wiring for the PC power connector and that required for the module are different, as shown in the Figure below.
NOTE The connector provided does not allow access to the middle two pins which are used for I2 C communications. If this functionality is required, Matrix Orbital suggests wiring a suitable connector. 2.1.
Figure 10: Twelve Volt Power Cable NOTE The connector provided does not allow access to the middle two pins, which are used for I2 C communications. If this functionality is required, Matrix Orbital suggests a suitable connector be wired. 2.1.4 Power Connection (DB-9 Connector) The display can be powered via pin 9 on the DB-9 connector. No matter which voltage option the display is equipped with, the user may only use +5Vdc through pin 9. Using +5Vdc bypasses any voltage regulator on the display.
Figure 12: Power Jumper DB-9 2.2 Communications 2.2.1 RS-232 Communications and DB-9 Connector pinout A standard DB-9F is provided for RS-232 communications. Power may also be supplied via this connector if desired. In addition, the user may use the two middle pins of the power connector for serial communications. 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.
Table 4: 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 2.2.2 RS-232 Communication through the Power Connector RS-232 communication can also be achieved through the middle two pins of the power connector. Figure 14: Power Connector Table 5: Connector Pinout Pin 4 Pin 3 Pin 2 Pin 1 Vdc Tx Rx Ground To allow this, the jumpers must be set as indicated below.
2.2.3 I2 C Communications The display has I2 C communications running at 100 Kbps and up to 127 units can exist on a single communications line. The display I2 C communication lines are the two middle pins of the power connector. These are shared with RS-232 and must be turned on. The default I2 C address is 0x50. The I2 C data line operates on 5 volts.
2.2.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 18: Clamping a Relay 3 Displaying Text This chapter describes the various text-display commands in detail. Before issuing commands to the GLC24064 please read sections 7.2 and 7.3. 3.1 General Text is displayed on the GLC24064 using fonts saved in its internal flash memory. The display is supplied with a 5x7 font installed. If this is suitable, then there is no need to install any other fonts. 3.
3.3 Text Commands In this section commands are identified by their names and decimal values. 3.3.1 Auto Scroll On (254 81) When auto scrolling is on, it causes the display to shift the entire display’s contents up to make room for a new line of text when the text reaches the scroll position defined by the "Set font metrics" command in the display memory (normally, the bottom right character position - default value for the GLC24064 is 64). 3.3.
3.3.6 Set Current Font (254 49 [font ID]) This command instructs the display to use the font specified by [font identifier] as the default font. The value specified should refer to a font already present in the display’s memory. NOTE The font ID is established when the font is saved to the display, normally using the mogd.exe program. The installed 5x7 font ID is 0x01, unless changed by user. 3.3.
In-line bitmaps are processed horizontally and each byte represents a horizontal row of 8 bits, with the next byte representing the next 8 bits to the right. Orientation is left to right - MSB to LSB, which is opposite to the serial transmission sequence (bytes are sent LSB first). Figure 19: Graphic Bitmaps 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. 4.
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. Lines may be drawn from any part of the display to any other part. However, it may be important to note that the line may interpolate differently right to left, or left to right. This means that a line drawn in white from right to left may not fully erase the same line drawn in black from left to right. 4.2.
• [type = 3] Horizontal right referenced The bar graphs may be located anywhere on the display, but if they overlap, they will not display properly. NOTE It is important that [x1] is less than [x2], and [y1] is less than [y2]. This command doesn’t actually draw the graph, it must be ’filled in’ using the “Write to bar graph” command described below.
4.2.11 Initialize Strip Chart (254 106 [ref][x1][y1][x2][y2]) A ’strip chart’ is an area of the screen reserved for horizontal scrolling. This is normally used as follows; 1. 2. 3. 4. Initialize the strip chart, which reserves the appropriate area of the screen. Draw a line segment at the right or left side of the strip chart. Shift the strip chart to the right or left. Draw the next line segment. Used this way the strip chart can produce a graph which scrolls smoothly, horizontally in either direction.
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 I2 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.
When a file is being downloaded with the same ’name’ or reference number as the previously existing file, the old file needs to be deleted first. It is impossible to know if the new file is exactly the same size as the old file since the space vacated by the old files are filled by moving previously existing files down to fill up the vacated space. This ensures that no file space is wasted.
5.3.2 Purge Memory (254 33 89 33) This command completely erases the display’s non-volatile memory. It removes all fonts, font metrics, bitmaps, and settings (current font, cursor position, communication speed, etc.). It is an ’odd’ command in that it is three bytes in length. This is to prevent accidental execution. 5.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.
Table 7: File Format 0xFF Width O-Low O-High Data Data Data Data Data Data Data Data Data Data 0xFF O-High Width O-Low Data Data Data Data Data Data Data Data Data Data X size O-Low O-High Width Data Data Data Data Data Data Data Data Data Data Y size Width O-Low Data Data Data Data Data Data Data Data Data Data Data Start O-High Width Data Data Data Data Data Data Data Data Data Data Data End O-Low O-High Data Data Data Data Data Data Data Data Data Data O-High Width O-Low Data Data Data Data Data Da
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 will become 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).
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
6.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.
6.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. 6.1.
6.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. 6.1.
in the BASIC program. Or, with C the user could (using Zcomm serial library) ZComm1->WriteCommByte(0xfe); ZComm1->WriteCommByte(’X’); 7.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. Sets text insertion point to position (x,y), where x and y are in pixels.
Command Draw Outline Rectangle Draw Solid Rectangle Initialize Bar Graph Write to Bar Graph Display Saved Bitmap Initialize Strip Chart Shift Strip Chart Syntax Notes FE 72 Draws a rectangular outline using [color][x1][y1][x2][y2] color [color]. 254 114 [color][x1][y1][x2][y2] 254 ’r’ [color][x1][y1][x2][y2] FE 78 Draws a solid rectangle using color [color][x1][y1][x2][y2] [color]. 254 120 [color][x1][y1][x2][y2] 254 ’x’ [color][x1][y1][x2][y2] FE Sets aside space for a bar graph.
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 Exi
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 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 25: 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 Matrix Orbital GLC24064 39
8.