LK204-24-USB Technical Manual Revision: 1.
Contents Contents ii 1 Introduction 1.1 What to Expect From the LK204-24-USB . . 1.2 What Not to Expect From the LK204-24-USB 1.3 Keypad Interface . . . . . . . . . . . . . . . 1.4 Setup for Testing . . . . . . . . . . . . . . . 1.5 Trying out the LK204-24-USB . . . . . . . . 1.6 Trying out a Keypad . . . . . . . . . . . . . 1.6.1 Here’s what to do: . . . . . . . . . . . . . . . . . 1 1 1 2 2 3 3 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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 LK204-24-USB is equipped with the following features; • • • • • • • • • • • • • • • • • • • 20 column by 4 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
1.3 Keypad Interface The keypad interface takes row / column input and converts it it ASCII characters, which are delivered out the USB port to the associated controller. 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.
1.5 Trying out the LK204-24-USB The unit should be connected to the USB and the backlight and custom startup screen should come on. • 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 2.1.1 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 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 4, GPO 5 and GPO 6 as +12V, should the user plug in a unmodified 3.5” floppy power cable. Figure 3: Header Table 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 750mA. 2.1.
Figure 5: Jumpers 1 and 2 The display can be powered by the USB port or by external power. Soldering Jumper 1, and removing Jumper 2 will allow for power to be supplied externally. The advantage to this is the display will power up right away, allowing fans to start, for example, without waiting for the OS to power the display. In addition, if the advanced GPOs are set to the +5V position power will be drawn from external power rather than the USB port, thus allowing higher current draw.
2.1.
2.1.5 Serial TTL Communication Figure 7: Rx / Tx LED Header The display can also be talked to at TTL (logic 0V to +5V) levels. This will allow TTL communications through the 4-pin header. Communicating by Serial TTL will bypass the USB components and power will be required to be provided by this header. 8bit, no parity, one stop bit. Speed: 19.2 Kb/s. NOTE Do not power or communicate by USB and Serial TTL at the same time. 2.1.
Figure 8: Fan Header 2.2.1 Advanced General Purpose Outputs & GPO’s 1 to 4 These outputs are capable of controlling high current draw devices, saving power up state, being switched 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 As of Firmware Revision 1.1, the default PWM frequency is 19.1Hz • Default voltage setting is 12V • • • • 2.2.2 Advanced GPO Power Select 12 Volt 5 Volt Figure 10: 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 5, GPO 6, and GPO 7 Figure 11: General Purpose Outputs GPO’s 5, 6, and 7 are low power ouputs providing +5V at 20mA enforced by a 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 6 headers are inter-connected to one communication line. A maximum of 32 1-wire devices can be connected to the display at a time. Figure 12: 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 13: 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. The display does not have provision to download 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 7: 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 15: 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 52 mS, 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 9: Character Values 1 6 11 16 21 26 31 36 2 7 12 17 22 27 32 37 3 8 13 18 23 28 33 38 4 9 14 19 24 29 34 39 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; 4.1.
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 10: 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 are 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-4) 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 4 it behaves exactly as the PWM Value command. For GPOs 5 to 7, 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 15: 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 1.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 16: 1-Wire Transaction Offset (Bytes) 0 Length (Bytes) 1 Name Description Flags The flag byte controls the optional components of the transaction. The number of bits that will be transmitted onto the bus.
Table 18: 1-Wire Error Codes Code 0x00 0x01 0x02 0x03 6.4.2 Description Success Unknown 1-Wire command No devices on the bus Fatal search error 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. The structure of these packets is shown in the Table below.
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.
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. NOTE The factory default for backlight is on. 7.1.6 Backlight off (254 70) (R) This command turns the display off. 7.1.7 Set Backlight Brightness (254 153[brightness]) This command sets the display’s backlight brightness. 7.1.
Table 22: Default Screen Character 1 Character 21 Character 41 Character 61 Character 20 Character 40 Character 60 Character 80 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.
7.1.13 Read Version Number (254 54) This command will return a 1 byte hex value. 8 Appendix: Command Summary 8.1 General The operation of the LK204-24-USB 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.
Table 24: 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 Define custom character Draw vertical bar graph Draw horizontal bar graph Syntax FE 4E [c][8 bytes] 254 78 [c][8 bytes] 254 “N” [c][8 bytes] FE 3D [col][length] 254 61 [col][length] 254 “=”[col][length] Notes Defines one of 8 custom “user” characters. Character number is [c] between 0x00 and 0x07. Draws a vertical bar graph at column [col] of length [length]. Length is measured in pixels (0x00 to 0x14). User must first use the “v” or “s” command to initialize characters.
Command Remember GPO / PWM state Syntax FE C2 254 195 Default n/a Set PWM base frequency (New in Firmware Revision 1.1) FE C4 [index] 254 196 [index] 6 Remember PWM base frequency (New in Firmware Revision 1.1) FE C5 [index] 254 197 [index] 6 Notes This command will set the start up state for all the GPOs. This command sets the base frequency for the PWM modulation. This command will set the PWM frequency for startup. 8.
Command Set contrast and save Syntax FE 91 [contrast] 254 145 [contrast] Default 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 Same as "set contrast" but saves [contrast] as default. Backlight will stay on for [minutes]. If [minutes] = 0 backlight will stay on permanently. Turns off backlight.
Command Set serial number Syntax 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 mode FE 3A [full][empty] 254 58 [full][empty] 254 ’:’ [full][empty] Exit flow control mode FE 3B 254 59 254 ’;’ Matrix Orbital LK204-24-USB Default Off Notes This is a onetime-use command which works only on units without factory set serial numbers. Reads the two byte serial numbers of the module.
9 Appendix: Specifications and Options 9.1 Specifications Table 36: Environmental Specifications Operating Temperature Storage Temperature Operating Relative Humidity Standard Temperature 0C to +50C -20C to +70C 90% max non-condensing Table 37: Electrical Specifications Supply Voltage Supply Current Supply Backlight Current 4.
Figure 16: Physical Layout Matrix Orbital LK204-24-USB 42
9.2 Options Table 39: Options Available on the LK204-24-USB Inverse Yellow; black backlight with yellow text Inverse Blue; blue backlight with white text White backlight with grey glass (Ice blue) Inverse Red; red backlight with white text 10 -IY -WB -GW -R Appendix: Glossary Table 40: 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.