LK162-12 User Manual LK162-12 rev 4 1
Table of Contents 1. Introduction..................................................................................................................... 5 1.1 1.2 1.3 1.4 1.5 1.6 What it Does ......................................................................................................................................................5 What it Does Not Do ........................................................................................................................................
4.5 Keypad Commands.........................................................................................................................................21 4.5.1 Auto repeat mode on (254 126 [mode]) (R)…………………….........................................................20 4.5.2 Auto repeat mode off (254 96) (R)…....................................................................................................21 4.5.3 Auto transmit keypresses on (254 65) (R)….................................................
7.6 Bar Graphs and Special Characters...............................................................................................................36 7.7 Miscellaneous Commands.............................................................................................................................37 8. Appendix: Specifications and Options.......................................................................... 39 8.1 Specifications.......................................................................
1. Introduction Your LK162-12 has the following features: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 16 column by 2 line text display built-in font with provision for up to 8 user-defined characters Speeds from 1200 bps to a lighting fast 19.
?? A power cable with a 4 pin connector (same connector as used to connect 3.5 inch floppy drive). Do not connect the LK162-12 to an unmodified spare power connector in a PC. To modify such a cable see section 2.1.1. ?? A 5 V power supply. ?? a PC with a spare RS-232 port (COM1 or COM2). ?? A 9 or 25 pin RS-232 serial cable. If you use a 25 conductor cable you'll also need a 9 to 25 pin adapter. Figure 1-1 Connections for Testing 1. Refer to the diagram above and Figure 2-1 for the following steps. 2.
1.6 Trying out a Keypad Since a number of different keypad types can be connected to the LK162-12, the results you get may be a little unpredictable. At this point all we need to do is make sure that your keypad and interface work, and possibly generate an ASCII map for your programming needs. The keypad interface on the LK162-12 converts a row/column connection to an ASCII character. By default, a keypress is transmitted as serial data immediately.
1.7 Manual Override Manual override 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 pins 3 and 4 of the keypad connector (R3 and C1). Power up the display. The baud rate is now set to 19,200.
LOCKED UNLOCKED To lock down the memory chip, solder the jumper as shown in the LOCKED picture above. This will lock down the memory chip, not allowing anything to be changed inside it until the jumpers are restored to their original position.
2. Connections 2.1 Connector Pinout Refer to the diagram below for this chapter. Figure 2-1 Electrical Connections The LK162-12 has four connectors: Connector Function 14 pin dual header 4 pin DB-9F General purpose outputs or Keypad (2x7) (see section 2.2) power (Vdc) and I2C/RS232 communications (see section 2.1.1) RS-232/power (see section 2.1.1.1) 2.1.1 Power Connection Power is applied via pins 1 and 4 as shown in Figure 2-1. Power requirement for standard units is +5 VDC ±0.
1 2 3 4 Figure 2-2 Power connector Pin 1 Pin 2 Pin 3 Pin 4 +5.0 VDC (+7 to +15 Vdc with wide voltage option) SCL (I2C clock) / Tx SDA (I2C data) / Rx Ground 2.1.1.1 Five Volt Modules If the LK162-12 is used in a PC it is tempting to plug a spare power connector into the unit. Don't do this! Wiring for the PC power connector and that required for the LK162-12 are different as shown in Figure 2-3 below.
The 12 volt power cable is designed for use with wide voltage range display modules mounted in a PC. Wiring required for the 12 volt power connector is shown in Figure 2-5 below. +5 V GND +12 V PC wiring +12 V GND Display module wiring Figure 2-5 Wiring for 12 volt modules If you don't want to modify cable wiring yourself, 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 Figure 2-6 below.
8 bits, no parity, 1 stop bit. 2.1.4 DB9 Connection A standard DB-9F is provided for RS-232 communications. Power may also be supplied via this connector if desired. See Figure 2-7 for pin connections. Figure 2-7 RS-232 and power connector Pin Number Direction Description LCD Host 2 Data from LCD Data out (LCD) Tx Rx 3 Data to LCD Data in (LCD) Rx Tx 5 - Ground gnd gnd 2.1.
1 2 3 Pin 1 Pin 2 Pin 3 Pin 4 4 Vdc Tx Rx Ground 2.1.6 TTL Communications The LCD2041 can be talked to at TTL (logic 0V to +5V) levels. Two modifications have to be made. Jumpers 2 and 3 have to be closed and 1 and 4 open. 2.1.7 I²C Communications I²C communications runs at 100 kBps and supports up to 16 units on a single communications line. The I2C data line operates on 5 volt CMOS levels. The idea of ACK is to indicate when the data has been received correctly.
10001010. Matrix Orbital would describe the Philips I2C address of 45hex as 8Ahex. The read address would be 8Bhex. For more information on Phillips I2C please visit… http://www.ping.be/~ping0751/i2cfaq/i2cindex.htm and for more information specific to our displays visit… http://www.lcdforums.com/forums/viewtopic.php?t=910 To communicate by I2C two jumpers have to be set into the I2C position left of the power SIP connector. The I2C setting is default on the LK162-12.
Figure 2-8 General Purpose Outputs Maximum allowable current is 20mA, which is enforced by the current limiting resistor. If the device being switched has a resistance of 240 ohms or more the corresponding resistor may be shorted. Note: The GPOs do not have any over current or over/under voltage protection so care must be taken when using them. For instance if the external device is a relay it must be fully clamped (using a diode and capacitor) to absorb any generated back electro-motive force (EMF).
3. Displaying Text This chapter describes the various text -display commands in detail. A quick reference summary of all text commands is found in section 7.4. There is no specific command to display text. Any data sent to the LCD that is not prefixed by the command prefix (0xFE) will be displays on the LCD. 3.1 General Text is displayed on the LK162-12 using the built-in 5 x 7 dot matrix font (plus up to 8 user-defined characters. 3.
In addition to the built-in characters, users may define up to 8 special characters (which, once defined, occupy positions 0x00 to 0x07 in the above chart). The LK162-12 does not have provision to download other fonts. 3.3 Writing Text to the Display When the display receives a character, it displays that character at the position currently defined. The next character sent to the module then advances to the following position on the display.
3.4.7 Turn on underline cursor (254 74) (R) Turns on the underline cursor. The cursor shows the current text insertion point. Both underline and blinking cursors may be turned on or off independently. The cursor is off by default. 3.4.8 Turn off underline cursor (254 75) (R) Turns off the underline cursor. Does not affect the blinking block cursor. 3.4.9 Turn on block (blinking) cursor (254 83) (R) Turns on the blinking block cursor. The cursor shows the current text insertion point.
4. Keypad Interface This chapter describes the keypad interface and associated commands in detail. 4.1 General The LK162-12 keypad interface processes the keypad row/column matrix into a serial (RS-232 or I2C) data byte stream. Aside from this processing, the keypad has no effect on the LK162-12 display. If you need to send keystrokes to the display, they must be routed through your controller.
Columns 1 2 3 4 1 ‘A’ 41 Hex ‘F’ 46 Hex ‘K’ 4B Hex ‘P’ 50 Hex 2 ‘B’ 42 Hex ‘G’ 47 Hex ‘L’ 4C Hex ‘Q’ 51 Hex 3 ‘C’ 43 Hex ‘H’ 48 Hex ‘M’ 4D Hex ‘R’ 52 Hex Rows 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 your keypad isn't wired this way you will need to make an adapter or rewire the connector to meet this requirement. 4.3 I 2C Interface The keypad is read by I²C master read.
[mode] = 0x01 gives Key down / Key up code mode 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 I²C interface. 2.
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. 4.5.6 Poll keypad (254 38) This command returns any unbuffered keypresses via the RS - 232 interface. The host system must be set up to receive the key codes. When the LK162-12 receives this command it will immediately return any unbuffered keypresses which may have not been read already.
5. Bar Graphs and Special Characters The LK162-12 includes the ability to draw bar graphs (either horizontal or vertical) and allows users to define up to eight special characters. Before issuing commands to the LK162-12 please read sections 7.2 and 7.3. Eight characters (ASCII values 0x00 to 0x07) are set aside for use with bar graphs, user defined characters, and big numbers. Since the same 8 characters are used for each function, the functions may not be used simultaneously.
Custom characters occupy a 5 x 8 pixel matrix. Built-in characters are 5 x 7: the bottom row of pixels is normally reserved for the underline cursor. The underline cursor should be turned off if the bottom row of pixels forms part of a custom character. The characters are defined by issuing the command 254 78 [c] followed by 8 bytes to define the character. [c] is the character number (0x00 to 0x07).
txUart.sendByte(0); txUart.sendByte(0); txUart.sendByte(0); txUart.sendByte(0); txUart.
6. Miscellaneous Commands The commands listed in this chapter don't readily fit in any of the other categories, or are used in more than one category. Before issuing commands to the LK162-12 please read sections 7.2 and 7.3. Some commands, marked with an (R), may be "remembered" to set new defaults that will be in effect each time the unit is powered on. See section 6.1.1 for further information. 6.1 Command List 6.1.1 Remember This command allows a number of settings, such as cursor state, backlight, etc.
6.1.4 Set contrast and save (254 145 [contrast]) This command works in exactly the same way as the “Set Contrast” command. The only difference is that it saves the contrast value in the non-volatile memory of the module, whereas the previous command only changes the value until the next power down. 6.1.5 Backlight on (254 66 [minutes]) (R) This command turns on the backlight for a time of [minutes] minutes. If [minutes] is zero (0), the backlight will remain on indefinitely.
6.1.12 Set I2C address 254 51 [address]) This command sets the I²C write address of the module. This value must be an even number and the read address is one higher. For example if the I²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.13 Read module type (254 55) This command will return, over the RS-232 interface, the model type value of the module.
6.1.17 Read Version Number (254 54) This command will return the firmware version number of the LK162-12. The firmware version number is a 1byte hex value. 6.2 Flow Control The LK162-12 has built-in flow control which may be useful when long strings of text are downloaded to the display. Flow control is enabled or disabled by two commands (see Table 7-4 and the next two sections).
7. Appendix: Command Summary 7.1 General The operation of the LK162-12 is controlled by a simple and consistent command set. Commands control ?? ?? ?? ?? text display graphics display keypad interface miscellaneous operating parameters This chapter includes summary tables of all commands. Individual commands are discussed in detail in Chapters 3 to 5 in the same sequence as in the following tables. 7.2 Issuing Commands Commands are issued to the LK162-12 by the controller.
0101 5 5 1101 D 13 0110 6 6 1110 E 14 0111 7 7 1111 F 15 Based on the table, the byte 01001011 can be represented in hex as 4B, which is usually written as any of 4Bh, 4BH, 4B hex or 0x4B. The numbers can also be expressed in decimal form if preferred. 7.3.1 ASCII Characters Since computers deal internally with numbers only, but externally with both letters and numbers, several schemes were developed to "map" written characters to numeric values.
Auto scroll off FE 52 254 82 254 'R' off R Disables auto scroll. Text will wrap to top left and overwrite existing text. Set cursor position FE 47 [col] [row] 254 71 [col] [row] 254 'G' [col] [row] n/a Moves cursor to the specified column and row. The cursor marks the text insertion point in this and all commands. Send cursor home FE 48 254 72 254 'H' Underline cursor on FE 4A 254 74 254 'J' off R Turns on the underline cursor.
Command Syntax Default 254 'A' LK162-12 rev 4 35 Notes
Auto transmit key presses off FE 4F 254 79 254 'O' off R Up to 10 key presses buffered until polled. Clear key buffer FE 45 254 69 254 'E' n/a Clear unread key presses. Poll keypad FE 26 254 38 254 '&' n/a Returns buffered key presses to application. Returns 0x00 if no key presses. High order bit set unless this is the last/only key press. Set debounce time FE 55 [time] 254 85 [time] 254 'U' [time] 52 ms R Resolution: 1 = 0.6554 ms [time] is a numeric multiplier. 7.
7.7 Miscellaneous Commands Note: The letter "R" in the Default column indicates that this state can be saved to nonvolatile memory with the Remember command. Table 7-4 Miscellaneous Commands Command Syntax Default Notes Remember FE 93 [0|1] 254 147 off Turns the "remember" function on [1] or off [0]. Clear display FE 58 254 88 254 'X' n/a Clears screen of text and graphics, places text cursor at top left.
Command Syntax Default Notes Read module type FE 37 254 55 254 '7' see table Reads the module type. See table in section 6.1.13. Set RS232 port speed FE 39 [speed] 254 57 [speed] 254 '9' [speed] 19,200 baud Sets RS232 speed. See table in section 6.1.
8. Appendix: Specifications and Options 8.1 Specifications 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 -40°C to +85°C Operating Relative Humidity 90% max non-condensing 90% max non-condensing Electrical Specifications Supply Voltage 4.75 - 5.
Figure 8-1 Physical Layout 8.
9. Appendix: Glossary ASCII American Standard Code for Information Interchange. A 7 bit binary code representing the english alphabet, decimal numbers and common punctuation marks. "Also includes control characters" such as carriage return or end of text. An 8 bit superset of the standard ASCII codes is often used today to include foreign characters and other symbols. These supersets are often called extended ASCII character sets.
bus and each one can act as a master by initiating a data transfer. Interface A means by which two systems interact. LCD Liquid Crystal Display Module Type Value This refers to the model number of the module. Pixel The smallest individually controllable element of a display. Pre-Generated Fonts Pre-determined fonts which can be downloaded into graphic liquid crystal displays. Primitive A low-level object or operation from which higher-level, more complex objects and operations can be constructed.