LK402-25 Technical Manual Revision: 1.
Contents Contents 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 2 3 4 4 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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 LK402-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 LK402-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 4: Serial Cable 4FT Figure 3: Breadboard Cable Figure 5: Communication and 5V Power Cable 1.3 • • • • • • • • • • • • • • Features 40 column by 2 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.
1.4 Connecting to a PC The LK402-25 connects seamlessly to a PC and it is an excellent means of testing the functionality. To connect your display to a PC, you will require a standard RS-232 9-pin serial cable such as the one pictured in figure 4 on the previous page, as well as a modified 5V power adapter such as the one pictured in figure 1 on page 1. In order to connect your display to a personal computer follow these easy instructions: 1. Plug the serial cable into the com port you wish to use. 2.
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. 2. 3. 4. Insert the Matrix Orbital CD-ROM into the CD drive Locate the file, uProject.exe, which should be in the “CD-drive:\Download” directory. Copy uProject.exe to a directory that you wish to run it from.
2 Hardware Information Refer to the following diagram for this chapter: 1 DB-9 Connector 2 Power Through DB9 Jumper 3 GPOs 4 Keypad Interface 5 Power / Data Connector 6 Manual Override 7 Protocol Select Jumpers 8 Optional Dallas One-Wire Bridge Figure 8: LK402-25 2.1 DB-9 Connector The LK402-25 provides a DB-9 Connector to readily interface with serial devices which use the EIA232 standard signal levels of ±12V to ±12V.
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 10 below. The LK402-25 allows all voltage models to use the power through DB-9 option, see table 68 on page 49 for display module voltage requirements. Figure 10: Power Through DB-9 Jumper WARNING Do not apply voltage through pin 9 of the DB-9 connector AND through the Power/Data Connector at the same time. 2.
WARNINGS • Do not apply any power with reversed polarization. • Do not apply any voltage other than the specified voltage. 2.3 Protocol Select Jumpers The Protocol Select Jumpers, pictured below in figure 12, provide the means necessary to toggle the display module between RS-232, TTL and I2 C protocols. As a default, the jumpers are set to RS-232 mode with solder jumps on the 232 jumpers.
WARNING If connecting a relay, be sure that it is fully clamped using a diode and capacitor in order to absorb any electro-motive force (EMF) which will be generated. 2.5 Dallas 1-Wire Bridge In addition to the six general purpose outputs the LK402-25 offers an Optional Dallas 1-wire bridge, to allow for an aditional thirty two 1-wire devices to be connected to the display. See Section 8 on page 28. This header can be populated by default. Please contact sales for more information.
Table 1: Default Values Contrast 128 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 LK402-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.
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 6 on page 3. Matrix Orbital supplies power cable adapters for connecting to a PC, which can be found in the Accessories Section on page 1.
4 Communications 4.1 Introduction The commands listed in this chapter describe how to configure data flow on the LK402-25. 4.1.1 I2 C Communication Summary The LK402-25 is capable of communicating at 100 KHz in I2 C mode, with 127 units addressable on a single I2 C communication line.
NOTE These delays are consrevative, and may be decreased based on performance 4.1.2 I2 C Transaction Example The typical I2 C transaction contains four parts: the start sequence, addressing, information, and stop sequence. To begin a transaction the data line, SDA, must toggle from high to low while the clock line, SCL, is high. Next, the display must be addressed using a one byte hexadecimal value, the default to write to the unit is 0x50, while read is 0x51.
Description This command sets the I2 C write address of the module between 0x00 and 0xFF. The I2 C write address must be an even number and the read address is automatically set to one higher. For example if the I2 C write address is set to 0x50, then the read address is 0x51. NOTE The change in address is immediate. Remembered Default 4.
4.4 Setting a Non-Standard Baud Rate Syntax Parameters Description Remembered Matrix Orbital Hexadecimal Decimal Parameter speed 0xFE 0xA4 [speed] 254 164 [speed] Length Description 2 Inputed LSB MSB from baud rate formula (12-2047). This command sets the RS-232 port to a non-standard baud rate. The command accepts a two byte parameter that goes directly into the CrystalSpeed modules baud generator. Use the formula, speed = 8×DesiredBaud − 1 to calculate the [speed] for any baud rate setting.
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 17: Character Set 5.1.2 Control Characters In addition to a full text set, the LK402-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 LK402-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 LK402-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 LK402-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 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 21. 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 Horizontal Bar Syntax Description Remembered 6.9 Hexadecimal 0xFE 0x68 Decimal 254 104 ASCII 254 “h” This command will load the default horizontal bar characters into the volatile memory. If you have stored your own custom horizontal 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 Horizontal Bar’ command.
Description This command will load the narrow 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 Narrow bars have a width of two pixels. Remembered No 6.
Description This command will place a bar graph at the specified [Column] with the specified [Length]. The [Length] is the size in pixels of the bar graph. NOTES • A Vertical Bar style must be initialized before this command is executed. • Bar graphs may be one directional only. Remembered 7 7.1 No General Purpose Output Introduction General purpose outputs allow you to connect devices, such as LEDs, to the LK402-25 and supply them with up to 20mA of current at 5V.
Description This command turns ON general purpose output [num]. The standard GPO’s on the LK402-25 output 20mA of current at 5V. NOTE ON means the output is pulled HIGH. Remembered 7.4 Yes Set Startup GPO state Syntax Parameters Description Hexadecimal 0xFE 0xC3 [Num] [state] Decimal 254 195 [Num] [state] Parameter Length Description Num 1 GPO number. state 1 Startup state (0: Off, 1: On) This command will set the startup state for the GPO on the next power up.
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 LK402-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 LK402-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 19 19 20 20 20 20 13.
Description Initialize Narrow Vertical Bar Initialize Wide Vertical Bar Place Vertical Bar Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x73 254 115 254 “s” 0xFE 0x76 254 118 254 “v” 0xFE 0x3D [Column] [Length] 254 61 [Column] [Length] 254 “=” [Column] [Length] Page 25 26 26 13.
Description 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 0xFE 0x26 254 38 254 “&” 0xFE 0x45 254 69 254 “E” 0xFE 0x55 [time] 254 85 [time] 254 “U” [time] 0xFE 0x7E [mode] 254 126 [mode] 254 “~” [mode] 0xFE 0x60 254 96 254 “‘” 0xFE 0xD5 [KDown] [KUp] 254 213 [KDown] [KUp] Page 32
Description Data Lock Set and Save Data Lock Write Customer Data Read Customer Data Syntax Hexadecimal Decimal Hexadecimal Decimal Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0xCA 0xF5 0xA0 [level] 254 202 245 160 [level] 0xFE 0xCB 0xF5 0xA0 [level] 254 203 245 160 [level] 0xFE 0x34 [data] 254 52 [data] 254 “4” [data] 0xFE 0x35 254 53 254 “5” Syntax Hexadecimal Decimal ASCII Hexadecimal Decimal ASCII 0xFE 0x36 254 54 254 “6” 0xFE 0x37 254 55 254 “7” Page 39 40 40 40 13.
Command Hex 0x4A 0x4B 0x4C 0x4D 0x4E 0x4F 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x60 0x68 0x6D 0x6F 0x73 0x76 0x7C 0x7E 0x91 0x93 0x98 0x99 0xA4 0xC0 0xC1 0xC2 Description Page Dec ASCII 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” 111 “o” 115 “s” 118 “v” 124 “|” 126 “~” 145 147 152 153 164 192 193 194 0xC3 0xC8 0xCA 195 200 202 Matrix Orbital Underline Cursor On Underline Cursor Off Move Cursor Back Move Cursor F
14 Appendix 14.1 Specifications 14.1.1 Environmental Table 67: 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.
14.
14.4 Ordering Information L 1 K 2 40 3 2 4 -25 5 Table 70: Part Numbering Scheme # 1 2 3 4 5 Description Screen Type Input Type Width Height Keypad Buttons Options L: Liquid Crystal Display K: External Keypad 40: Forty Character Columns 2: Two Character Rows -25: Twenty-Five Key Input Maximum Table 71: Part Options 14.
Revision 1.0 1.