LK204-25 Technical Manual Revision: 2.
Contents Contents 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 5 5 6 6 Hardware Information 2.1 DB-9 Connector . . . . . . . . . . . . 2.1.
5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.9 Assign Keypad Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 10 Display Functions 10.1 Introduction . . . . . . . 10.2 Display On . . . . . . . 10.3 Display Off . . . . . . . 10.4 Set Brightness . . . . . . 10.5 Set and Save Brightness . 10.6 Set Contrast . . . . . . . 10.7 Set and Save Contrast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Getting Started The LK204-25 is an intelligent LCD display designed to decrease development time by providing an instant solution to any project. With the ability to communicate via serial RS-232/TTL and I2 C protocols, the versatile LK204-25 can be used with virtually any controller. The ease of use is further enhanced by an intuitive command structure to allow display settings such as backlight brightness, contrast and baud rate to be software controlled.
Figure 1: LK204-25 Options 1.2 Accessories NOTE Matrix Orbital provides all the interface accessories needed to get your display up and running. You will find these accessories and others on our e-commerce website at http://www.matrixorbital.com. To contact a sales associate see Section 14.6 on page 58 for contact information.
Figure 5: Serial Cable 4FT Figure 4: Breadboard Cable Figure 6: Communication and 5V Power Cable Figure 7: Aluminum Mountings Matrix Orbital LK204-25 3
Figure 8: Keypad Mountings Figure 9: Mounting Kits Figure 10: 4X4 Keypad Matrix Orbital LK204-25 4
1.3 • • • • • • • • • • • • • • • 1.4 Features 20 column by 4 line alphanumeric liquid crystal display Selectable communication protocol, serial at RS-232 or TTL levels or I2 C Six, 5V -20mA, general purpose outputs for a variety of applications Lightning fast communication speeds, up to 57.
WARNING DO NOT use the standard floppy drive power connector, as this will not provide you with the correct voltage and will damage the display module. Figure 11: PC vs Matrix Orbital Display Module Wiring 1.5 Installing the Software 1.5.1 uProject uProject was designed by Matrix Orbital to provide a simple and easy to use interface that will allow you to test all of the features of our alpha numeric displays. To install uProject from the Matrix Orbital CD, follow the following steps: 1.
Comport The serial port the display is plugged in to. Baudrate The communication speed the display module is set to. (Default 19,200) Figure 12: uProject Settings NOTES • uProject and other alphanumeric software may also be downloaded from Matrix Orbital’s support site at http://www.matrixorbital.
1 DB-9 Connector 2 Power Through DB9 Jumper 3 GPOs 4 Manual Override 5 Power / Data Connector 6 Keypad Interface 7 Protocol Select Jumpers 8 Optional Dallas 1-Wire Bridge Figure 13: LK204-25 2.1 DB-9 Connector The LK204-25 provides a DB-9 Connector to readily interface with serial devices which use the EIA232 standard signal levels of ±12V to ±12V. It is also possible to communicate at TTL levels of 0 to +5V by setting the Protocol Select Jumpers to TTL.
Pin 2 Pin 3 Pin 5 Pin 9 Tx \ SDA (I2 C data) Rx \ SCL (I2 C clock) GND PWR (Must solder Power Through DB9 Jumper. See table 70 on page 54 for power requirements.) Figure 14: RS-232 Pin out 2.1.1 Power Through DB-9 Jumper In order to provide power through pin 9 of the DB-9 Connector you must place a solder jumper on the Power through DB-9 Jumper pictured in figure 15 below.
2.2 Power/Data Connector The Power/Data Connector provides a standard connector for powering the display module. The LK20425 requires five volts for the standard display module, between nine to fifteen for the wide voltage (V) and between nine to thirty-five volts for the wide voltage with efficient power supply module (VPT). The voltage is applied through pins one and four of the four pin Power/Data connector.
Figure 17: Protocol Select Jumpers 2.4 General Purpose Outputs A unique feature of the LK204-25 is the ability to control relays and other external devices using a General Purpose Output, which can provide up to 20 mA of current and +5Vdc from the positive side of the GPO. This is limited by a 240 ohm resistor which is located to the above right of the GPOs as pictured below in figure 21.
2.5 Dallas 1-Wire Bridge In addition to the six general purpose outputs the LK204-25 offers an optional Dallas 1-wire bridge, to allow for an aditional thirty two 1-wire devices to be connected to the display. Please note that the display normally does not come with the Dallas 1-wire bridge. It will have to be ordered as a custom. Please talk to your sales representative if you would like this option. See Section 8 on page 33. Figure 19: Dallas 1-Wire Bridge 2.
Figure 20: Manual Override Jumper Table 1: Default Values Brightness 255 Baud Rate 19.2 kbps I2 C Slave Address 0x50 Data Lock False RS232AutoTransmitData True NOTE The display module will revert back to the old settings once turned off, unless the settings are saved. 2.7 Keypad Interface Connector The LK204-25 provides a Keypad Interface Connector which allows for up to a five by five matrix style keypad to be directly connected to the display module.
Figure 21: Keypad Interface Connector NOTE The Ground / +5V pin is toggled by the jumper to the right of the keypad connector. Jump 1 & 2 for +5V or 2 & 3 for GND. 3 Troubleshooting 3.1 The display does not turn on when power is applied. • First, you will want to make sure that you are using the correct power connector. Standard floppy drive power cables from your PC power supply may fit on the Power/Data Connector however they do not have the correct pin out as can be seen in figure 11 on page 6.
NOTE I2 C communication will always require pull up resistors. • Finally, you may reset the display to it’s default settings using the Manual Override Jumper, see Section 2.6 on page 12. 3.3 The display module is communicating, however text cannot be displayed. • A common cause may be that the contrast settings have been set to low. The solution to this problem is to adjust the contrast settings. The default setting that will work in most environments is 128.
The unit does not respond to general call address ($00). When communicating in I2 C the LK204-25 will send an ACK on the 9th clock cycle when addressed. When writing to the display module, the display will respond with a ACK when the write has successfully been completed. However if the buffer has been filled, or the module is too busy processing data it will respond with a NAK.
4.1.3 Serial Communication In addition to being able to communicate via I2 C the LK204-25 communicates natively through the RS-232 protocol at at a default baud rate of 19,200 bps and is capable of standard baud rates from 9600 to 115,200 bps. Furthermore the LK204-25 is also capable of reproducing any non-standard baud rate in between using values entered into our baud rate generation algorithm and set through command 164 (0xA4).
Description This command sets the RS-232 port to the specified [speed]. The change takes place immediately. [speed] is a single byte specifying the desired port speed. Valid speeds are shown in the table below. The display module can be manually reset to 19,200 baud in the event of an error during transmission, including transmitting a value not listed below, by setting the manual override jumper during power up.
Examples Crystal Speed 16 Mhz Desired BAUD 13,500 speed = crystalspeed −1 8 ∗ DesiredBaud speed = 148.15 − 1 speed = 16, 000, 000 −1 8 ∗ 13, 500 speed = 147.15 • LSB = 0x93 (rounded) • MSB = 0x00 • Intended Baud Rate: 13,500 baud Actual Baud Rate: 16,000,000 =13,514 Percent Difference: 0.1% 8(147+1) NOTES • Results from the formula are rounded down to the nearest whole number (i.e 73.07 = 73). • This formula becomes less acurate as baud rates increase, due to rounding.
5.1.1 Character Set Figure 22: Character Set 5.1.2 Control Characters In addition to a full text set, the LK204-25 display supports the following ASCII Control characters: 0x08 Backspace 0x0C Clear screen / New page 0x0D Carriage return 0x0A Line feed / New line 5.
Syntax Description Remembered Default 5.3 Description Remembered Hexadecimal 0xFE 0x52 Decimal 254 82 ASCII 254 “R” When auto scrolling is disabled the text will wrap to the top left corner of the display area when the text reaches the end of last row. Yes Clear Screen Description Hexadecimal 0xFE 0x58 Decimal 254 88 ASCII 254 “X” This command will immediately clear all of the contents of the display. Remembered No Syntax 5.5 Yes On Auto Scroll Off Syntax 5.
5.6 Set Auto Line Wrap On Syntax Description Hexadecimal 0xFE 0x43 Decimal 254 67 ASCII 254 “C” Enabling Auto Line Wrap will allow the cursor to automatically wrap over to the next line when the current line is full. NOTE Line wraps may occur in the middle of a word. Remembered 5.7 Set Auto Line Wrap Off Syntax Description Remembered 5.8 Yes Hexadecimal 0xFE 0x44 Decimal 254 68 ASCII 254 “D” Disabling Auto Line Wrap will allow you to change the line configuration.
Description This command will allow you to manually set the cursor position, which controls the text insertion point, by specifying the [col] and [row] of the new proposed cursor position. NOTE If the cursor position is set past the end of a line it will wrap to the beginning of the next line. Remembered 5.
Description This command will move the cursor forward one space. If this command is sent when the cursor is at the bottom right position the cursor will wrap back to the home position if line wrap is on. Sending this command will not effect the text displayed on the module, however any characters that are sent will over write the current characters that are being displayed. Remembered No 5.
Description Hexadecimal 0xFE 0x54 Decimal 254 84 ASCII 254 “T” This command will turn the block cursor off. Remembered Yes Syntax 6 6.1 Special Characters Introduction The LK204-25 has the ability to create four different sets of eight custom characters and save them to internal banks of memory. Each set of eight can be recalled from memory at any time, and selected characters can be written to the display screen.
Description The LK204-25 allows for upta to eight custom defined characters to be added onto the the character set. A custom character is a five by eight pixel matrix with each row represented by a byte value. For example: 1 1 1 1 1 1 1 1 Remembered 6.
Description New to the LK204-25 has added five non-volatile memory banks for custom character storage. This is intended to allow you to create your own custom bar graphs, medium/large numbers and startup screen. However, each memory bank may be used to store a set of any eight custom characters; with the only provision being that memory bank zero contains the characters that will be used in the startup screen. By default the memory banks will be loaded as follows: [Bank] 0 1 2 3 4 Remembered 6.
Description Using this command you may create the custom characters. that will be stored in memory bank zero, which will be used in the startup screen. For more information about creating custom characters see Section 6.2 on page 25. NOTES • Changes only take place once the power has been cycled. • This command is the same as sending CMD 254 / 193 / 0 / [ID] / [DATA] Remembered 6.6 Initialize Medium Number Syntax Description Remembered 6.
6.8 Initialize Large Numbers Syntax Description Remembered 6.9 Hexadecimal 0xFE 0x6E Decimal 254 110 ASCII 254 “n” This command will load the default large number characters into the volatile memory. If you have stored your own custom large numbers, use the ’Load Custom Characters’ command instead to load your custom character data into the volatile memory. This command will allow you to use the ’Place Large Numbers’ command.
6.11 Place Horizontal Bar Graph Syntax Parameters Description Hexadecimal Decimal ASCII Parameter Col Row Dir 0xFE 0x7C [Col] [Row] [Dir] [Length] 254 124 [Col] [Row] [Dir] [Length] 254 “|” [Col] [Row] [Dir] [Length] Length Description 1 The column number. 1 The row number. 1 The direction of the bar data (0 or 1). Length 1 The length of the bar data. This command will place a bar graph at [row], [column]. A [Dir] value of zero will cause the bar to go right, and one will cause the bar to go left.
Syntax Description Hexadecimal 0xFE 0x76 Decimal 254 118 ASCII 254 “v” This command will load the wide vertical bar characters into the volatile memory. If you have stored your own custom vertical bar data, use the ’Load Custom Characters’ command instead to load your custom bar data into the volatile memory. This command will allow you to use the ’Place Vertical Bar’ command. NOTE Wide bars have a width of five pixels. Remembered No 6.
7.2 General Purpose Output Off Syntax Parameters Description Hexadecimal 0xFE 0x56 [Num] Decimal 254 86 [Num] ASCII 254 “V” [Num] Parameter Length Description Num 1 GPO number. This command turns OFF general purpose output [num]. NOTE OFF means that the output is pulled LOW. Remembered 7.3 Yes General Purpose Output On Syntax Parameters Description Hexadecimal 0xFE 0x57 [Num] Decimal 254 87 [Num] ASCII 254 “W” [Num] Parameter Length Description Num 1 GPO number.
Description This command will set the startup state for the GPO on the next power up. A value of one will cause the GPO to be off on the next startup while a value of one will cause the GPO to be on. NOTE This command does not affect the current state of the GPO. Remembered 8 8.1 Always Dallas 1-Wire Introduction Another convenient feature of the LK204-25 is that it provides a Dallas 1-wire interface in order to readily communicate with up to thirty two 1-wire devices on a single bus.
Description This command will allow you to begin communicating with the devices on the 1-wire bus by returning a packet containing device information for each 1-wire device on the bus in the form of: Search Return Packet Offset (Bytes) 0 Offset (Bytes) 2 Description 0x232A Preamble 2 1 0x8A Packet is 10 bytes long, another address will follow 0x0A Packet is 10 bytes long, this is the last address 3 4 5 13 1 1 8 1 0x31 - 1-Wire Packet Type Error Code (0x00 for success) 1-Wire Address CRC8 0x00 means
Description This command will perform a single transaction on the 1-wire bus in this order: 1. Bus Reset. 2. Transmit data onto the bus. 3. Receive data from the bus. The number of bits to be transmitted and read must be specified for this command to be successful. NOTE To determine what functions the device will respond to, consult the devices’ data sheet.
connector. The keypad is scanned whenever a key is pressed;there is no continuous key scan. This means that key presses are dealt with immediately without any appreciable latency. This also prevents electrical noise which is often caused by continuous key scans. 9.1.1 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.
Description In this mode, up to 10 key presses are buffered until the unit is polled by the host system, via the poll keypad command 254 38. Issuing this command places the unit in polled mode. NOTE This command is not available in I2 C. Remembered 9.4 Yes Poll Key Press Syntax Description Hexadecimal 0xFE 0x26 Decimal 254 38 ASCII 254 “&” This command returns any buffered key presses via the serial interface. The host system must be set up to receive key codes.
Remembered 9.6 Set Debounce Time Syntax Parameters Description Remembered Default 9.7 No Hexadecimal Decimal ASCII Parameter time 0xFE 0x55 [time] 254 85 [time] 254 “U” [time] Length Description 1 Debounce time in increments of 6.554ms (0 - 255). 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 [time] value is in increments of 6.554ms.
Description Two auto repeat modes are available and are set via the same command: • Resend Key Mode: 0x00 • Key Up/Down Mode: 0x01 Resend Key Mode 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.
Parameters Description Remembered 10 Parameter Length Description KDown 25 Key down codes KUp 25 Key up codes This command will allow you to reassign the key codes that correspond to the key presses on the matrix style key pad. The first 25 bytes that are transmitted will be used for the key down codes and the next 25 bytes that are transmitted will be used for the key up codes.
10.3 Display Off Syntax Description Remembered Hexadecimal 0xFE 0x46 Decimal 254 70 ASCII 254 “F” This command turns the backlight off immediately. The backlight will remain off until a ’Display On’ command has been received. Yes 10.4 Set Brightness Syntax Parameters Description Remembered Default Hexadecimal Decimal Parameter brightness 0xFE 0x99 [brightness] 254 153 [brightness] Length Description 1 Display brightness setting (0 to 255). This command sets the display [brightness].
Description This command sets the display’s contrast to [contrast], where [contrast] is a value between 0x00 and 0xFF (between 0 to 255). Lower values cause ‘on’ elements in the display area to appear lighter, while higher values cause ‘on’ elements to appear darker. Lighting and temperature conditions will affect the actual value used for optimal viewing. Individual display modules will also differ slightly from each other in appearance.
11 Data Security 11.1 Introduction Ensuring that your LK204-25 display’s exactly what you want it to can be the difference between a projects success and failure. This is why we incorporate features such as Data Lock into the LK204-25 With this new feature you now are in control over of how and when settings will be changed so there is no need to worry about the module acting exactly like you expected it to because all the settings may be locked and remembered for the next power up. 11.
11.3 Data Lock Syntax Parameters Hexadecimal Decimal Parameter level 0xFE 0xCA 0xF5 0xA0 [level] 254 202 245 160 [level] Length Description 1 Sets the data lock level Description Paranoia allows you to lock the module from displaying information, as well as enables the protection of the filesystem and module settings.
11.4 Set and Save Data Lock Syntax Parameters Description Remembered Default Hexadecimal 0xFE 0xCB 0xF5 0xA0 [level] Decimal 254 203 245 160 [level] Parameter Length Description level 1 Sets the data lock level This command will set and save the data lock level. See the Data Lock section for more information. Always 0 11.
12.2 Read Version Number Syntax Description Hexadecimal 0xFE 0x36 Decimal 254 54 ASCII 254 “6” This command will return a byte representing the version of the module, see the following table as an example: Hex Value 0x19 0x57 Remembered Version Number Version 1.9 Version 5.7 No 12.
Description Remembered Matrix Orbital This command will return a hex value corresponding to the the model number of the module see the following table: Hex 1 5 7 9 B D F 13 15 21 23 25 27 29 2B 31 33 35 37 39 3B 3D 3F 41 43 45 47 49 4B 4D 4F 51 53 55 57 5B 71 73 77 79 No Product ID LCD0821 LCD2041 LCD4041 LK204-25 VFD2021 VFD4021 VK204-25 GLC24064 GLK24064-25 Unused Unused GLK24064-16-1U-USB GLK19264-7T-1U-USB GLK12232-16-SM LK204-7T-1U LK404-AT LK402-12 LK204-25PC VK202-24-USB VK204-24-USB VK162-12 PK2
13 Command Summary 13.
Description Move Cursor Back Move Cursor Forward Underline Cursor On Underline Cursor Off Blinking Block Cursor On Blinking Block Cursor Off Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x4C 254 76 254 “L” 0xFE 0x4D 254 77 254 “M” 0xFE 0x4A 254 74 254 “J” 0xFE 0x4B 254 75 254 “K” 0xFE 0x53 254 83 254 “S” 0xFE 0x54 254 84 254 “T” Page 23 23 24 24 24 24 13.
Description Initialize Horizontal Bar Place Horizontal Bar Graph Initialize Narrow Vertical Bar Initialize Wide Vertical Bar Place Vertical Bar Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x68 254 104 254 “h” 0xFE 0x7C [Col] [Row] [Dir] [Length] 254 124 [Col] [Row] [Dir] [Length] 254 “|” [Col] [Row] [Dir] [Length] 0xFE 0x73 254 115 254 “s” 0xFE 0x76 254 118 254 “v” 0xFE 0x3D [Column] [Length] 254 61 [Column]
Description Auto Transmit Key Presses On Auto Transmit Key Presses Off Poll Key Press Clear Key Buffer Set Debounce Time Set Auto Repeat Mode Auto Repeat Mode Off Assign Keypad Codes Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal 0xFE 0x41 254 65 254 “A” 0xFE 0x4F 254 79 254 “O” 0xFE 0x26 254 38 254 “&” 0xFE 0x45 254 69 254 “E” 0xFE 0x55 [ti
13.
Command Hex 0x43 0x44 0x45 0x46 0x47 0x48 0x4A 0x4B 0x4C 0x4D 0x4E 0x4F 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x60 0x68 0x6D 0x6E 0x6F 0x73 0x76 0x7C 0x7E 0x91 0x93 0x98 0x99 0xA4 0xC0 0xC1 0xC2 Description Page Dec ASCII 67 “C” 68 “D” 69 “E” 70 “F” 71 “G” 72 “H” 74 “J” 75 “K” 76 “L” 77 “M” 78 “N” 79 “O” 80 “P” 81 “Q” 82 “R” 83 “S” 84 “T” 85 “U” 86 “V” 87 “W” 88 “X” 96 “‘” 104 “h” 109 “m” 110 “n” 111 “o” 115 “s” 118 “v” 124 “|” 126 “~” 145 147 152 153 164 192 193 194 0xC3 0xC8 0xCA 195 200 202 Ma
14 Appendix 14.1 Specifications 14.1.1 Environmental Table 69: Environmental Specifications Standard Temperature Extended Temperature Operating Temperature 0◦ C to +50◦ C -20◦ C to +70◦ C ◦ ◦ Storage Temperature -20 C to +70 C -30◦ C to +80◦ C Operating Relative Humidity 90% max non-condensing Vibration (Operating) 4.9 m/s2 XYZ directions Vibration (Non-Operating) 19.6 m/s2 XYZ directions Shock (Operating) 29.4 m/s2 XYZ directions Shock (Non-Operating) 490 m/s2 XYZ directions 14.1.
NOTE To prolong life, it is recommended that the backlight be turned off when the display is not in use.
14.
14.4 Ordering Information L 1 K 2 20 3 4 4 -25 5 -GW 6 -VPT 7 -E 8 Table 72: Part Numbering Scheme # 1 2 3 4 5 Description Screen Type Input Type Width Height Keypad Buttons 6 Color (Text/Background) 7 Input Voltage 8 Temperature Options L: Liquid Crystal Display* K: External Keypad 20: Twenty Character Columns 4: Four Character Rows -25: Twenty-Five Key Input Maximum NP: Standard Grey/Yellow-Green GW: Grey/White WB: White/Blue R: Red/Black IY: Yellow/Black NP: Standard (4.75-5.
MSB Most Significant Byte LSB Least Significant Byte 14.6 Contacting Matrix Orbital Telephone Sales: 1(403)229-2737 Support: 1(403)204-3750 On The Web Sales: http://www.MatrixOrbital.com Support: http://www.MatrixOrbital.ca Forums: http://www.lcdforums.com 14.7 Revision History Revision 2.0 2.