LK202-25 Technical Manual Revision: 3.
Contents Contents ii 1 Introduction 1.1 What to Expect From the LK202-25 . . 1.2 What Not to Expect From the LK202-25 1.3 Keypad Interface . . . . . . . . . . . . 1.4 Setup for Testing . . . . . . . . . . . . 1.5 Trying Out the LK202-25 . . . . . . . 1.6 Trying Out a Keypad . . . . . . . . . . 1.6.1 Here’s What To Do . . . . . . 1.7 Manual Over-ride . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Keypad Interface 4.1 General . . . . . . . . . . . . . . . . . . . . . . . 4.2 Connections . . . . . . . . . . . . . . . . . . . . 4.3 I2 C Interface . . . . . . . . . . . . . . . . . . . . 4.4 RS-232 Interface . . . . . . . . . . . . . . . . . . 4.5 Keypad Commands . . . . . . . . . . . . . . . . . 4.5.1 Auto repeat mode on (254 126 [mode]) (R) 4.5.2 Auto repeat mode off (254 96) (R) . . . . . 4.5.3 Auto transmit keypresses on (254 65) (R) . 4.5.4 Auto transmit keypresses off (254 79) (R) . 4.5.
6.2.1 6.2.2 Enter Flow Control Mode (254 58 [full][empty]) . . . . . . . . . . . . . . . . . . . 29 Exit Flow Control Mode (254 59) . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7 1-Wire Commands 7.1 Device Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3 ROM Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.
1 Introduction The LK202-25 comes equipped with the following features: • • • • • • • • • • • • • • • • • 20 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.2 Kbps over RS-232 Communication over I2 C or RS-232 (with software controlled speed) Use of up to 127 modules on the same 2-wire I2 C interface One wire bus capable of communicating with many devices over a single wire plus a ground reference.
control any aspect of the operation of the display, it acts simply as a matrix to serial converter. To use the keypad to control the display, the controller must be programmed accordingly. 1.4 Setup for Testing Before setting up the application the user may want to try out the display. This is easily done with a PC. If not equipped with a dual bay PC mounting kit, the following will be required; • A 4-pin power connector of the type used to connect 3.5" floppy drive.
1.5 Trying Out the LK202-25 The unit should be connected to power. The PC and display should be on. To experiment with typing text, run a PC terminal program, such as Hyperterm. Make sure it’s configured to use the correct port. Set the baud rate to 19,200. If characters are typed on the keyboard, they should now appear on the display screen. Text will wrap around to the next line when the end of a line has been reached.
NOTES • 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. • The connector is reversible. Reversing the connector will not damage the keypad or the display, but will however, change the ASCII character map. 3. Press a key on the keypad. An upper case ASCII character (A-Y) should appear on the PC screen.
1-Wire Connector Keypad Connector GPOs Configuration Jumpers Power/Data Connector DB9 Connector Figure 2: Electrical Connections The display has four connectors: Matrix Orbital LK202-25 5
Table 2: Connectors and Functions Connector 12 pin dual header 4 pin 10 pin header DB-9F 2.1.1 Function General purpose outputs (6) Power (5.0 VDC), Data (Rx,Tx), I2 C communications and Ground Keypad and ground strapping RS-232 / power Power Connections Power is applied via pin1 and ground via pin 4 as shown in the figure below. Power requirement is +5 VDC ±0.25V. As an alternate power connection, power may also be supplied via the RS-232 connector as described in section2.1.
Table 3: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 2.1.2 +5.0 VDC (+7 to +15 VDC with wide voltage option) SDL (I2 C clock), Rx SCA (I2 C data), Tx Ground Five Volt Modules If the display is used in a PC it becomes 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 display are different, as shown in the Figure below.
2.1.3 Wide Voltage Range Modules NOTE Do not use this cable unless the display module has the "Wide voltage range" option (option V). Use of the 12 volt power cable with 5 volt modules will damage the module. 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 the Figure below.
WARNINGS • Do not apply any voltage other than the specified voltage. • Do not apply voltage to the DB-9 connector AND power connector. • Do not apply more than +5VDC to pin #9 on the DB-9 connector if module is designated “standard voltage”. If the module is designated “wide or extended voltage”, then you may apply between 8-15 Volts accordingly. Please see the figures below for power connections and appropriate solder jump required.
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 5 32 9 Figure 10: DB9 Pinout For RS232 communication via the 4 pin connector, please see the figure and table below. Table 5: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 +5.
2.2.2 TTL Communications A standard DB-9F or 4 pin power connector/communication (female) connector is needed for TTL communications. Power may also be supplied via this connector if desired. A PC is not to be used when TTL communication is established via a direct com port. One modification is required for TTL. The jumps must be removed from the RS232 selection and placed on the TTL selection. Figure 12: TTL Select Note that this device uses signal levels from 0V to + 5V on the TTL setting.
Table 7: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 2.2.3 +5.0 VDC (+7 to +15 VDC with wide voltage option) Rx (receive data) Tx (transmit data) Ground I2 C Communications The display’s I2 C communications runs at 100 Kbps and supports up to 127 units on a single communications line. The I2 C data line operates on 5 volt CMOS levels. One modification is required for I 2 C communication. Please see figure below for appropriate modification.
Table 8: Connector Pinout Pin 1 Pin 2 Pin 3 Pin 4 2.2.4 +5.0 VDC (+7 to +15 VDC with wide voltage option) I2 C SCL (clock) I2 C SDA (data) Ground ACK The idea of ACK is to indicate when data has been received correctly. ACK does not check the validity of the data. Clearly, this is of limited usefulness and even less so with Matrix Orbital modules. Matrix Orbital modules are only capable of failing to acknowledge the bytes following the byte, which was not received.
GND Data +5V Figure 16: 1-Wire Pinout 2.3 General Purpose Outputs The display has six general purpose outputs. These are provided to control relays or other electronic devices. This allows external devices to be turned on or off using the PC or controller and software commands. Each output is wired as shown in the Figure below. The + terminal is connected directly to the module positive supply, the - terminal is connected through a 240ohm current limiting resistor and the electronic switch to ground.
Figure 18: Bypassing 240 ohm Resistor 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). Suggestions for clamping a relay: Figure 19: Clamping a Relay 3 Displaying Text This chapter describes the various text display commands in detail.
3.1 General Text is displayed on the LK202-25 using the built in 5x8 dot matrix font, in addition to up to 8 user defined characters. 3.2 The Built In Character Font The display includes a built in 5x8 dot matrix font with the full range of ASCII characters plus a variety of extended characters, as shown in the Figure below. Figure 20: Character Set 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.
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. Characters are drawn using the built in font and only characters defined in the font are actually displayed. Characters that are not defined by the built in font print as a space (i.e., the cursor is advanced for the next character).
3.4.5 Set cursor position (254 71 [column] [row]) This command sets the cursor position (text insertion point) to the [column] and [row] specified. Columns have values from 1 to 20 (0x01 to 0x14) and rows have values of 1 and 2 (0x01 and 0x02). 3.4.6 Send cursor home (254 72) This command moves the cursor position (text insertion point) to the top left of the display area. 3.4.7 Turn on underline cursor (254 74) (R) Turns on the underline cursor. The cursor shows the current text insertion point.
3.4.12 Cursor right (254 77) Moves the cursor one position to the right but does not erase any character that may be in that position. Note that this command moves the text insertion point even if the cursor is turned off. 4 Keypad Interface This chapter describes the keypad interface and associated commands in detail. 4.1 General The display keypad interface processes the keypad row / column matrix into a serial (RS-232 or I 2 C) data byte stream.
Table 9: Keypad Layout Rows 1 2 3 4 5 1 A F K P U Columns 2 3 B C G H L M Q R V W 4 D I N S X 5 E J O T Y NOTE The keypad connector must be wired with columns on one side and rows on the other side of the center of the connector. In situations where the keypad isn’t wired this way an adapter will need to be made, or the user should rewire the connector to meet this requirement. 4.3 I2 C Interface The keypad can be read by I2 C master read.
4.5.1 Auto repeat mode on (254 126 [mode]) (R) [mode] = 0x00 gives Resend Key Code mode [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.
4.5.4 Auto transmit keypresses off (254 79) (R) In this mode, up to 10 keypresses are buffered until the unit is polled by the host system via the poll keypad command. Issuing this command places the unit in polled mode. 4.5.5 Clear key buffer (254 69) This command clears any unread keypresses.
5.1 Command List 5.1.1 Initialize wide vertical bar graph (254 118) This command defines the 8 special / user characters to be blocks suitable for use in drawing wide (5 pixel) vertical bar graphs. Any previously existing definitions will be lost. Once this command has been issued, any number of vertical bar graphs may be drawn unless the characters are redefined by another command. 5.1.
5.1.6 Define custom character (254 78 [c] [8 bytes]) The display allows up to 8 user defined (custom) characters. These characters occupy the first 8 (0x00 to 0x07) places in the character set. Custom characters occupy a 5x8 pixel matrix. Built in characters are 5x8. 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).
5.1.7 Initialize Medium Digits (254 109) This command defines the 8 special characters to be blocks suitable for use in drawing medium digits. Any previous definitions will be lost. Once this command has been issued, any number of medium characters may be placed until the characters are redefined by another command. 5.1.8 Draw Medium Digits (254 111 [row][column][digit]) Draws a medium digit in [row] and [column] using the specified [digit]. Medium digits occupy two rows.
6.1.3 Set Contrast (254 80 [contrast]) (R) 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.9 Load startup screen (254 64 [40 characters]) This command sets and memorizes the startup screen that will appear each time the display is turned on. By default the screen shows; Table 12: Default Screen Matrix Orbital LK202-25 The 40 characters define the two 20 character rows of the screen. Table 13: Default Screen Character 1 Character 21 Character 20 Character 21 If sending more than 10 characters to be stored, add in a ~10ms per character delay.
6.1.13 Set I2 C address (254 51 [address]) (R) 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.16 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.
size of the FIFO. The reason for this is that the FIFO may be full when the host system receives 0xFE. In the case of 16550 UART the size at its maximum is 16, therefore the value [full] should be set to 16 or greater. 6.2.2 Exit Flow Control Mode (254 59) This command turns off flow control. Bytes may overflow the buffer without warning. 7 1-Wire Commands The 1-wire bus is capable of communicating with many devices over a single wire plus a ground reference.
7.3 ROM Commands The ROM commands allow a device to be singled out for communication or all devices to be included. This manual only presents the three most used ROM commands. For a more detailed listing and description of all the ROM commands, consult the data sheet for the 1-wire device being used. • Match ROM [55h]: To single out a device, the Match ROM command is used. After this command has been issued the 64-bit target address is transmitted in LSB to MSB order.
Table 16: 1-Wire Transaction Offset (Bytes) 0 Length (Bytes) 1 Name Description Flags The flags byte controls the optional components of the transaction. The number of bits that will be transmitted onto the bus. The actual bits to be transmitted are held in the Send Data section. The number of bits to read off the bus after the data to be put on the bus has been sent. The data to be transmitted onto the bus. The data is transmitted MSB to LSB in the order that they are received.
7.4.2 Search command (254 200 2) This is used to find the addresses of all 1-Wire devices on the bus. After this command the display will return one or more “Display return protocol” packets containing either an error code or addresses of 1-wire packets.
5 6-748 9 :- ;.!4 < =?>2 @-ACB.! 2F F A In the BASIC program. Or, with C the user could (using Zcomm serial library) G H 34* *1 %/%I J <- H 3 * * K L 1> ' " DACB G H 34* *1 %/%I J <- H 3 * * K L 1> OM NPMQACB 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.
Table 21: 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, the GPO ON and OFF commands use a number to indicate which GPO is being controlled. We’re told that acceptable values are 1 to 6.
Command Set cursor position Syntax FE 47 [col] [row] 254 71 [col] [row] 254 ’G’ [col] [row] Default N/A Send cursor home FE 48 254 72 254 ’H’ N/A Underline cursor on FE 4A 254 74 254 ’J’ FE 4B 254 75 254 ’K’ FE 53 254 83 254 ’S’ FE 54 254 84 254 ’T’ FE 4C 254 76 254 ’L’ Off R Notes Moves cursor to the specified column and row. The cursor marks the text insertion point in this and all commands. This command moves the cursor to the top left of the display area. Turns on the underline cursor.
8.
8.6 Bar Graphs and Special Characters The commands in this section are used to define and display bar graphs and special characters.
Command Draw medium digits Syntax FE 6F [r][c][digit] 254 111 [r][c][digit] 254 ’o’ [r][c][digit] Notes Draws a medium digit in [row] and [column] using the specified [digit]. Medium digits occupy two rows. When the [row] is specified to be “1”, the medium digit will be displayed correctly. When the [row] is specified to be “2”, only the top part of the medium digit will be displayed. When [row] is specified to be “0”, only the bottom part of the medium digit will be displayed. 8.
Command Backlight on Syntax FE 42 [minutes] 254 66 [minutes] 254 ’B’ [minutes] Default On R Backlight off FE 46 254 70 254 ’F’ FE 99 254 153 On R Set backlight brightness and save FE 98 254 152 On R Load startup screen FE 40 [40 char] 254 64 [40 char] 254 ’@’ [40 char] Matrix Orbital LK202-25 General purpose output off FE 56 [gpo #] 254 86 [gpo #] 254 ’V’ [gpo #] Off General purpose output on FE 57 [gpo #] 254 87 [gpo #] 254 ’W’ [gpo #] Off Remember general purpose output FE C3 [gpo#][gpo
Command Read module type Syntax FE 37 254 55 254 ’7’ FE 39 [speed] 254 57 [speed] 254 ’9’ [speed] FE 34 [byte1][byte2] 254 52 [byte1][byte2] 254 ’4’ [byte1][byte2] Default see table Notes Reads the module type. 19,200 baud Sets speed. N/A FE 35 254 53 254 ’5’ FE 36 254 54 254 ’6’ N/A Enter flow control mode LK202-25.
9 Appendix: Specifications and Options 9.1 Specifications Table 30: Environmental Specifications Operating Temperature Storage Temperature Operating Relative Humidity Vibration (non-operating) Shock (Non-operation) Standard Temperature Extended Temperature 0◦ C to +50◦ C -20◦ C to +70◦ C ◦ ◦ -20 C to +70 C -40◦ C to +85◦ C 20 to 80% non condensing 10 to 55 to 10 Hz (Frequency) 1.
Figure 23: Physical Layout 9.
ASCII Backlight Binary Number Bit Bitmap Byte CCFL Configuration Contrast Controller DB-9 Firmware Font Font Metric Matrix Orbital 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.
Hexadecimal I2 C Interface LCD Module Type Value Pixel PLED Pre-Generated Fonts Primitive RS-232 Scroll Serial Number Serial Port Matrix Orbital Refers to the base-16 number system, which consists of 16 unique symbols: the numbers 0 to 9 and the letters A to F. For example, the decimal number 15 is represented as F in the hexadecimal numbering system. The hexadecimal system is useful because it can represent every byte (8 bits) as two consecutive hexadecimal digits.
Version Number Volatile Memory Matrix Orbital This refers to the firmware revision number of the module. Temporary memory. Once the power supply is turned off volatile memory is then erased.