LK202-24-USB Technical Manual Revision: 2.
Contents Contents ii 1 Introduction 1.1 What to Expect From the LK202-24-USB . . 1.2 What Not to Expect From the LK202-24-USB 1.3 Keypad Interface . . . . . . . . . . . . . . . 1.4 Setup for Testing . . . . . . . . . . . . . . . 1.5 Trying out the LK202-24-USB . . . . . . . . 1.6 Trying out a Keypad . . . . . . . . . . . . . 1.6.1 Here’s what to do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Connections 2.
Keypad Interface 3.1 General . . . . . . . . . . . . . . . . . . . . . . . 3.2 Connections . . . . . . . . . . . . . . . . . . . . . 3.3 Keypad Commands . . . . . . . . . . . . . . . . . 3.3.1 Auto Repeat Mode On (254 126[mode])(R) 3.3.2 Auto Repeat Mode Off (254 96)(R) . . . . 3.3.3 Auto Transmit Keypresses On (254 65)(R) 3.3.4 Auto Transmit Keypresses Off (254 79)(R) 3.3.5 Clear Key Buffer (254 69) . . . . . . . . . 3.3.6 Poll Keypad (254 38) . . . . . . . . . . . . 3.3.
7.1.5 7.1.6 7.1.7 7.1.8 7.1.9 7.1.10 7.1.11 7.1.12 7.1.13 Backlight on (254 66[minutes]) (R) . . . . . . . . . . . Backlight off (254 70) (R) . . . . . . . . . . . . . . . . Set Backlight Brightness (254 153[brightness]) . . . . . Set and Save Backlight Brightness (254 152[brightness]) Load Startup Screen (254 64 [40 characters]) . . . . . . Read Module Type (254 55) . . . . . . . . . . . . . . . Set Serial Number (254 52 [byte1][byte2]) . . . . . . . Read Serial Number (254 53) . . . . . . . . . . . . . .
1 Introduction The LK202-24-USB is equipped with the following features; • • • • • • • • • • • • • • • • • 20 column by 2 line text display Built in font with provision for up to 8 user defined characters USB communication, or Serial TTL communication Use of up to 100 modules on the same USB host Fully buffered so that no delays in transmission should ever be necessary Ability to add a customized splash / start up screen Use of "Remember" functions to save settings Software controlled contrast Software con
Figure 1: Connections for Testing NOTE The keypad is not used to directly control any aspect of the operation of the display. The display acts simply as a matrix to serial converter. 1.4 Setup for Testing Before setting up the application, it is best to test out the display. This is easily done with a PC.
• Run a PC program such as Hyperterm to experiment with typing text. Make certain it’s configured to use the correct port. Set the baud rate to 19,200 and turn flow control off. Once this is complete, try typing some characters on the keyboard. The characters should now appear on the display screen. Alpha Demo, Display Tuner or MOGD are excellent for basic display tests. 1.
2 Connections 2.1 Connector Pinout Refer to the Figure below for this chapter. Figure 2: Electrical Connections Table 1: Connectors & Functions Connector 14 Pin dual header Rx / Tx 10 Pin header USB Alt.
Table 2: Mating Connectors Connector 3 Pin White Header 3 Pin Red Header 10 Pin Dual Header Rx/Tx 10 Pin Header USB Alt. USB 4 Pin White Header Part # AMP 173979 MOLEX 43009 MOLEX 42375 MOLEX 42375 MOLEX 42375 MOLEX 67068 MOLEX 42375 AMP 171825-4 Mate Part # AMP 173977 MOLEX 7879 Many, ex. MOLEX 70058 Many, ex. MOLEX 70058 Many, ex. MOLEX 70058 Standard USB cable Many, ex. MOLEX 70058 AMP 170205-1 2.1.1 Power USB High power ports can supply 500mA of power.
The display has a secondary power connector used for High Power GPOs. Only if the user is planning on using GPO 1, GPO 2 and GPO 3 as +12V, should the user plug in a unmodified 3.5” floppy power cable. Figure 3: Header Figure 4: Connector Pinout Pin Pin 4 Pin 3 Pin 2 Pin 1 Description +5.0 VDC (normally from PC power supply) Ground Ground +12.0 VDC (normally from PC power supply) Make certain to have sufficient current capacity to handle the desired load. Each High Power GPO can source over 1000mA. 2.
Table 4: USB ID VID 0403 PID FA00 FA01 FA02 FA03 FA04 Description USB 2 Serial Communication MX2 / MX3 MX4 / MX5 LK / VK202-24-USB LK / VK204-24-USB 2.1.3 Alternate USB Communications Figure 5: USB & Alternate USB Table 5: Connector Pinout Pin Number 5 4 3 2 1 Description Ground Not Used D+ D+5V NOTE Please verify pinout with motherboard manuals.
2.1.4 Serial TTL Communications Figure 6: Rx / Tx and LED Headers The display can be communicated to by Serial at TTL levels. Communication will bypass the USB section and requires power and ground to be provided by the header. Do not use this header in conjunction with USB communication. 8bit, no parity, one stop bit. Speed: 19.2 Kb/s 2.1.5 LED Headers The LED headers provide a visual indication of communication over the Rx and Tx line if a LED is connected.
Figure 7: Connections 2.2.1 Advanced General Purpose Outputs & GPO’s 1 to 3 These outputs are capable of controlling high current draw devices, saving power up state, switching to PWM mode and repeat back RPM via Hall effect sensor.
WARNINGS • • • • • RPM Reading should not be used at 5V. There are no current limiting resistors. Maximum current draw is 1000mA. Default voltage setting is 12V. As of Firmware Revision 2.1, the default PWM frequency is 19.1Hz. 2.2.2 Advanced GPO Power Select 12 Volt 5 Volt Figure 9: High / Low Power Select When the jumper is placed in the high power position, the unit supplies +12V to the advanced GPOs. If the jumper is placed in the low power position, +5V is supplied to the GPOs.
2.2.3 GPO 4, GPO 5, and GPO 6 Figure 10: General Purpose Outputs GPO’s 4, 5, and 6 are low power ouputs providing +5V at 20mA, enforced by current limiting resistors. They are ideal for driving LEDs and relays directly. 2.2.4 Dallas 1-Wire Bridge The display offers one Dallas 1-wire bridge. All three headers are connected to one communication line. A maximum of 32 1-wire devices can be connected to the display at a time. Figure 11: 1-Wire Pinout 2.
2.4 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 12: Character Set In addition to the built in characters, users may define up to 8 special characters. Once defined, these characters occupy positions 0x00 to 0x07 in the above chart.
load other fonts. 2.5 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 which are not defined by the built in font print as a space.
2.6.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). 2.6.6 Send Cursor Home (254 72) This command moves the cursor position (text insertion point) to the top left of the display area. 2.6.7 Turn On Underline Cursor (254 74)(R) Turns on the underline cursor. The cursor shows the current text insertion point.
2.6.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. 3 Keypad Interface This chapter describes the keypad interface and associated commands in detail. 3.1 General The display keypad interface processes the keypad row / column matrix into a serial data byte stream. Aside from this processing, the keypad has no effect on the display.
Table 6: Keypad Layout Rows 1 2 3 4 1 A G M S Columns 2 3 4 B C D H I J N O P T U V 5 E K Q W 6 F L R X NOTE The keypad connector must be wired with columns on one side and rows on the other side of the centre of the connector. If the keypad isn’t wired this way the user will need to make an adapter or rewire the connector to meet this requirement. 3.3 Keypad Commands 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.
Figure 14: Poll Timing 3.3.2 Auto Repeat Mode Off (254 96)(R) This command turns off the auto repeat mode 3.3.3 Auto Transmit Keypresses On (254 65)(R) In this mode, all keypresses are sent immediately to the host system without the use of the poll keypad command. This is the default mode on power up. 3.3.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.
3.3.7 Set Debounce Time (254 85 [time])(R) 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 default debounce time for the module is about 52mS, which is adequate for most membrane keypads.
4.1.4 Initialize Horizontal Bar Graph (254 104) This command defines the 8 special / user characters to be blocks suitable for use in drawing horizontal bar graphs. Any previously existing definitions will be lost. Once this command has been issued, any number of horizontal bar graphs may be drawn unless the characters are redefined by another command. 4.1.
Table 8: Character Values 1 6 11 16 21 26 31 36 2 3 4 7 8 9 12 13 14 17 18 19 22 23 24 27 28 29 32 33 34 37 38 39 Cursor Line 5 10 15 20 25 30 35 40 NOTE Custom characters will be erased if any of the “Initialize bar graph” commands are issued. Example of a degree symbol; txUart.sendByte(0xFE); //command prefix txUart.sendByte(’N’); //custom character command txUart.sendByte(0x00); //custom character value 0-7 txUart.sendByte(12); //8 bytes to create txUart.sendByte(18); //the custom character txUart.
protocol is used for reading fan speeds and retrieving 1-wire bus information. The basic structure of the protocol is described in the Table below. Table 9: Display Return Protocol Offset (Bytes) 0 2 3 4 Length (Bytes) 2 1 1 1–127 Value Description 0x23 0x2A Preamble Continued / Size Packet Type Packet Data The first two bytes is the standard preamble to separate the protocol from returned keypresses. The next byte is described in the Table below.
5.2 Fan and GPO Commands 5.2.1 General Purpose Output Off (254 86 [gpo #]) This command turns OFF any of the general purpose outputs. [gpo #] is 1 to 6. 5.2.2 General Purpose Output On (254 87 [gpo #]) This command turns ON any of the general purpose outputs. [gpo #] is 1 to 6. 5.2.3 PWM Value (254 192 [fan #] [PWM value]) This command sets one of the high power GPOs (GPOs 1-3) into PWM mode. This permits speed control of a fan. A PWM value of 0 is off, 128 is 50% power, and 255 is full power.
5.2.5 Remember GPO / PWM State (254 195 [fan #] [PWM value]) This command will set the startup state for all the GPOs. When the device is powered up the next time, the GPOs will be set to the values from this command. For GPOs 1 to 3 it behaves exactly as the PWM Value command. For GPOs 4 to 6, a non-zero value for the PWM value make the GPO on for future startups. A PWM value of 0 will result in the GPO being off. This command does not affect the current state of the GPOs or fans, just power up. 5.2.
Table 14: Example PWM Values for Index =14 Input PWM 0 1- 63 64 -127 128 -191 192 -255 Actual PWM 0 25% 50% 75% 100% Frequencies in the range of 9.6Hz to 38.2Hz are desirable for fan control as they minimize the noise due to PWM modulation. For visual applications such as controlling cold cathode lights, PWM frequencies of 76.3Hz to 305.2Hz are desirable to minimize flicker. 5.2.7 Remember PWM Base Frequency (254 197 [index]) NOTE This command was added in Firmware Version 2.1.
1. Reset and detect presence. 2. ROM command, followed by any required data exchange. 3. Device specific function command, followed by any required data exchange. Before communication can begin, the bus must be reset to force all devices to begin listening. After the reset, all the devices will transmit a presence pulse which indicates that there is at least one device on the bus.
6.4.1 Transaction command (254 C8 1 [flags] [Send Bits] [Recieve bits] [Send data]) The transaction 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. Table 15: 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.
Table 17: 1-Wire Error Codes Code 0x00 0x01 0x02 0x03 Description Success Unknown 1-Wire Command No devices on the bus Fatal search error 6.4.2 Search command (254 C8 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.
7.1.1 Remember (254 147 [0|1]) This command allows a number of settings, such as cursor state, backlight, etc., to automatically be stored in non-volatile memory, so they become new defaults. The command should only be used when required for two reasons; 1. Writing to non-volatile memory is time consuming and slows down the operation of the display. 2. Non-volatile memory has a ’write limit’, and may only be changed approximately 100,00 times.
7.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. 7.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.
Table 21: Default Screen Character 1 Character 21 Character 20 Character 40 If sending more then 10 characters to be stored, add in ~10ms per character delay. Predefined custom characters can be used in the “Startup screen” as well, by using 0x00 through 0x07 characters. 7.1.10 Read Module Type (254 55) This command will return the model type value of the module as a 1 byte hex value.
8 Appendix: Command Summary 8.1 General The operation of the display is controlled by a simple and consistent command set. Commands control; • Text display • Graphic display • Keypad interface • Miscellaneous operating parameters This chapter includes summary tables of all commands. 8.2 Issuing Commands Commands are issued to the display by the controller. In a test setup, commands can be issued to the display by means of a BASIC program, using the chr$() function.
Table 23: Hex Value Table Binary 0000 0001 0010 0011 0100 0101 0110 0111 Hex 0 1 2 3 4 5 6 7 Decimal 0 1 2 3 4 5 6 7 Binary 1000 1001 1010 1011 1100 1101 1110 1111 Hex 8 9 A B C D E F Decimal 8 9 10 11 12 13 14 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 be expressed in decimal form if preferred. 8.3.
NOTE The letter “R” in the default column indicates that this state can be saved to nonvolatile memory with the “Remember” command.
Command Block cursor off Cursor left Cursor right Syntax FE 54 254 84 254 “T” FE 4C 254 76 254 “L” Default R FE 4D 254 77 254 “M” Notes Turns off the blinking block cursor. Moves the cursor one position to the left. If the cursor is already at the beginning of a line it will move to the end of the other line. Moves the cursor one position to the right. If the cursor is already at the end of a line it will move to the beginning of the other line. 8.
Command Auto transmit key presses on Syntax FE 41 254 65 254 “A” Default on R Auto transmit key presses off FE 4F 254 79 254 “O” FE 45 254 69 254 “E” FE 26 254 38 254 “&” off R FE 55 [time] 254 85 [time] 254 “U” [time] 52 ms R Clear key buffer Poll keypad Set debounce time n/a n/a Notes Sets auto transmit mode for keypad. Key presses are transmitted to host without polling. Up to 10 keypresses buffered until polled. Clear unread keypresses. Returns buffered keypresses to application.
Command Draw vertical bar graph Syntax ”FE 3D [col][height] 254 61 [col][height] 254 "="[col][height] Initialize horizontal bar graph FE 68 254 104 254 “h” FE 7C [column][row][dir][length] 254 124 [column][row][dir][length] 254 [column][row][dir][length] Draw horizontal bar graph Define custom character Notes Draws a vertical bar graph at column [col] of height [ height]. Height is measured in pixels (0x00 to 0x14). User must first use the “v” or “s” command to initialize characters.
Command Return fan RPM Syntax FE C1 254 193 Default n/a Remember GPO / PWM state FE C3 254 195 n/a Set PWM base frequency (New in Firmware Revision 2.1) FE C4 [index] 254 196 [index] 6 Remember PWM base frequency (New in Firmware Revision 2.1) FE C5 [index] 254 197 [index] 6 Notes This command will return a packet to the host with the fan RPM contained in it. This command will set the startup state for all the GPOs. This command sets the base frequency for the PWM modulation.
Command Set contrast Syntax FE 50 [contrast] 254 80 [contrast] 254 “P” [contrast] Default 0x80 128 Set contrast and save FE 91 [contrast] 254 145 [contrast] 0x80 128 Backlight on FE 42 [minutes] 254 66 [minutes] 254 “B” [minutes] on R Backlight off FE 46 254 70 254 “F” FE 99 [brightness] 254 153 [brightness] 254 FE 98 [brightness] 254 152 [brightness] 254 on R Notes Sets display contrast. Compensates for viewing angle. Contrast is a value between 0 and 255 (hex 0 to FF). Larger = darker.
Command Read module type Set serial number Syntax FE 37 254 55 254 “7” FE 34 [byte1][byte2] 254 52 [byte1][byte2] 254 “4” [byte1][byte2] Read serial number FE 35 254 53 254 "5" Read version number FE 36 254 54 254 "6" Enter flow control FE 3A [full][empty] 254 58 [full][empty] 254 ’:’ [full][empty] Exit flow control FE 3B 254 59 254 ’;’ Matrix Orbital LK202-24-USB Default see table Off Notes Reads the module type.
9 Appendix: Specifications and Options 9.1 Specifications Table 35: Environmental Specifications Environmental Specifications Standard Temperature Operating Temperature 0C to +50C Storage Temperature -20C to +70C Operating Relative Humidity 90% max non-condensing Table 36: Electrical Specifications Electrical Specifications Supply Voltage 5.
Figure 15: Physical Layout Matrix Orbital LK202-24-USB 41
9.2 Options Table 38: Options Available on LK202-24-USB Inverse Yellow; black backlight with yellow text Inverse Blue; blue backlight with white text Inverse Red; red backlight with white text White backlight with grey glass (Ice blue) -IY -WB -R -GW 10 Appendix: Glossary Table 39: Appendix: Glossary ASCII Backlight Baudrate Binary Number Bit Bitmap Byte CCFL Matrix Orbital American Standard Code for Information Interchange.
Configuration Contrast Controller DB-9 Firmware Font Font Metric Hexadecimal Interface LCD Module Type Value Pixel Pre-Generated Fonts Primitive RS-232 Matrix Orbital The way a system is set up, or the assortment of components that make up the system. Configuration can refer to either hardware or software, or the combination of both. The ratio of luminance between the light state of the display to the dark state of the display.
Scroll Serial Number Serial Port Version Number Volatile Memory Matrix Orbital To view consecutive lines of data on the display screen. The term scroll means that once the screen is full, each new line appears at the bottom edge of the screen and all other lines move up one position. A number that is one of a series and is used for identification of the module. A port, or interface, that can be used for serial communication, in which only 1 bit is transmitted at a time.