PK202-24-USB Technical Manual Revision: 1.
Contents Contents ii 1 Introduction 1.1 What to Expect From the PK202-24-USB . . 1.2 What Not to Expect From the PK202-24-USB 1.3 Keypad Interface . . . . . . . . . . . . . . . 1.4 Setup for Testing . . . . . . . . . . . . . . . 1.5 Trying out the PK202-24-USB . . . . . . . . 1.6 Trying out a Keypad . . . . . . . . . . . . . 1.6.1 Here’s what to do: . . . . . . . . . . . . . . . . . 1 1 1 1 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 Miscellaneous Commands 7.1 Command List . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 Remember (254 147 [0|1]) . . . . . . . . . . . . . 7.1.2 Clear display (254 88) . . . . . . . . . . . . . . . 7.1.3 Set brightness (254 89 [brightness]) (R) . . . . . . 7.1.4 Set brightness and Save (254 145 [brightness]) (R) 7.1.5 Display on (254 66 [minutes]) (R) . . . . . . . . . 7.1.6 Display off (254 70) (R) . . . . . . . . . . . . . . 7.1.7 Load Startup Screen (254 64 [40 characters]) . . . 7.1.
1 Introduction The PK202-24-USB is equipped with the following features; • • • • • • • • • • • • • • • • 20 column by 2 line text PLED 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 are ever necessary Ability to add a customized splash / start up screen Use of "Remember" functions to save settings Software controlled brightness with configu
l 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.
5. Windows will give a prompt for drivers for a USB ⇔ Serial Device. 6. Select “Specify location”, and navigate to the directory the file was uncompressed to. 7. Test the display. 1.5 Trying out the PK202-24-USB The unit should be plugged into the USB and the backlight and custom start up 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.
To experiment, reverse the connector to see if it generates a more logical set of characters. Ultimately the program in the controller will have to ’map’ these characters to the ones marked on the keypad, which will likely be different. 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 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.
8bit, no parity, one stop bit. Speed: 19.2 Kb/s Table 4: USB ID VID 0403 PID FA00 FA01 FA02 FA03 FA04 2.1.4 Description USB 2 Serial Communication MX2 / MX3/MX6 MX4 / MX5 LK / VK/PK202-24-USB LK / VK204-24-USB 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.5 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.6 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 • • • • • 2.2.2 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. 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. 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 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; 4.1.
4.1.9 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. 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. 5 Fan and GPO Commands 5.
Table 10: Continued / Size Byte Bit 7 6 5 4 3 2 1 0 Description Continued Packet Size Table 11: Display Return Protocol Types Decimal 49 82 Hex 0x31 0x52 ASCII ’1’ ’R’ Description 1-Wire data Fan RPM data 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.
Table 12: Return RPM Structure Offset 0 2 3 4 5 Size 2 1 1 1 2 Description 0x232A 0x03 0x52 Fan # Fan Period (MSB first) To convert the fan period into an RPM value, follow the following formula; RPM = 18750000 X ∗n Where X is the fan period, and n is the number of ticks that the fan produces per period. The number of ticks is usually 1, 2 or 4. For unknown fans some experimentation is required. NOTE It is not recommended that the RPM is checked more than once every two seconds.
Table 13: PWM Base Frequencies Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Frequency 0.3 Hz 0.6 Hz 1.2 Hz 2.4 Hz 4.8 Hz 9.6 Hz 19.1 Hz 38.2 Hz 76.3 Hz 152.6 Hz 305.2 Hz 610.4 Hz 1220.7 Hz 2441.4 Hz 4882.9 Hz 9765.8 Hz Steps 256 256 256 256 256 256 256 256 256 129 65 33 17 9 5 3 As the frequency increases,the number of valid PWM states will decrease. For example, with an index of 14, there are only 5 PWM states.
This command will set the PWM frequency for startup. It does not alter the current PWM base frequency. Refer to the “Set PWM base frequency” command for valid values of index. 6 1-Wire Commands The 1-wire bus is capable of communicating with many devices over a single wire plus a ground reference. This chapter deals with the capabilities of the display and a brief introduction to the 1-Wire standard. 5 %? M . For more detail consult L 6.
6.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 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. 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.
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.
The example shows the procedure to set “Auto scroll on” as the default condition. Commands are shown in both decimal and hex in the example below; Table 19: Command Example Decimal 254 147 1 254 81 Hex FE 93 01 FE 51 254 147 0 FE 93 00 Function Turn on “Remember” function Turn on auto scroll.
7.1.6 Display off (254 70) (R) This command turns the display off. 7.1.7 Load Startup Screen (254 64 [40 characters]) This command sets and memorizes the startup screen which will appear each time the display is turned on. By default the screen shows; Table 20: Default Screen Matrix Orbital PK202-24-USB The 40 characters define the two 20 character rows of the screen.
7.1.9 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. 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. 7.1.10 Read Serial Number (254 53) This command will return a 2 byte hex value. 7.1.
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. The decimal value of a byte may have any value from 0 to 255. Bytes are usually specified in either decimal or hexadecimal (base 16) form for convenience, since binary numbers are confusing to deal with directly.
acceptable values are 0 to 6. All such parameters must use numeric values (i.e., actual byte values). If we send the ASCII number by mistake it will actually give the value of 48 decimal (30 hex) to the parameter, which is wrong. In the tables given in the following sections ASCII characters are shown as ’A’, with single quotes. 8.4 Text Commands Syntax in the tables below are given in hex, decimal and decimal with ASCII, in that order, one per line.
Command Underline cursor on Underline cursor off Blinking cursor on Blinking cursor off Cursor left Cursor right Syntax 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” Default off R Notes Turns on the underline cursor. R Turns off the underline cursor. on R Turns on the blinking cursor. R Turns off the blinking cursor. Moves the cursor one position to the left.
Command Auto repeat mode on Syntax FE 7E [0x00 | 0x01] 254 126 [0|1] 254 “~”[0|1] Default off R Auto repeat mode off FE 60 254 96 254 “‘” FE 41 254 65 254 “A” off R 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 Auto transmit key presses on Auto transmit key presses off Clear key buffer Poll keypad Set debounce time on R n/a n/a Notes Applies to keypad only. 0x00 = 200 ms typematic, 0x01 = key down / key up codes sent.
Command Initialize wide vertical bar graph Initialize narrow vertical bar graph Draw vertical bar graph Initialize horizontal bar graph Draw horizontal bar graph Define custom character Initialize medium digits Draw medium digits Matrix Orbital Syntax FE 76 254 118 254 “V” FE 73 254 115 254 “s” ”FE 3D [col][height] 254 61 [col][height] 254 "="[col][height] FE 68 254 104 254 “h” FE 7C [column][row][dir][length] 254 124 [column][row][dir][length] 254 [column][row][dir][length] FE 4E [c][8 bytes] 254 78 [c
8.7 Fan and GPO Commands Table 31: Fan and GPO Commands Command General purpose output off Syntax FE 56 254 86 254 “V” Default Off General purpose output on FE 57 254 87 254 “W” Off PWM value FE C0 254 192 0 Return fan RPM FE C1 254 193 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.
8.8 Miscellaneous Commands NOTE The letter “R” in the default column indicates that this state can be saved to nonvolatile memory with the “Remember” command.
Command Load startup screen Syntax FE 40 [40 char] 254 64 [40 char] 254 “@” [40 char] Default Matrix Orbital LK202-24-USB 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 Read module type FE 37 254 55 254 “7” FE 34 [byte1][byte2] 254 52 [byte1][byte2] 254 “4” [byte1][byte2] see table Set serial number Read serial number FE 35 254 53 254 "5" Read version number FE 36 254 54 254 "6" Enter flo
Command Exit flow control 9 Syntax FE 3B 254 59 254 ’;’ Default Notes Turns off control. flow Appendix: Specifications and Options 9.1 Specifications Table 35: Environmental Specifications Operating Temperature Storage Temperature Operating Relative Humidity Vibration (non-operating) Vibration (operating) Shock (Non-operating) Shock (operating) Standard Temperature 0◦ C to +50◦ C -30◦C to +70◦C 20 to 80% non condensing 19.6 M/s2 (Max) 4.
Table 37: Optical Characteristics Number of Characters Matrix format Active Area View Area Character Size Character Pitch Dot Size Dot Pitch Color of Illumination 40 (20 characters by 2 lines) 5 x 8 Matrix 73.45 x 11.4 mm (X x Y) 79.0 x 17.0 mm (X x Y) 3.15 x 5.55 mm (L x W) 3.7 x 5.55 mm (L x W) 0.4 x 0.5 mm (X x Y) 0.5 x 0.
10 Appendix: Glossary Table 38: Appendix: Glossary ASCII Backlight Baudrate Binary Number Bit Bitmap Byte CCFL Configuration Contrast Controller DB-9 Firmware 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.
Font Font Metric Hexadecimal Interface LCD Module Type Value Pixel PLED Pre-Generated Fonts Primitive RS-232 Scroll Serial Number Serial Port Version Number Matrix Orbital A design for a set of characters. A font is the combination of typeface and other qualities, such as size, pitch, and spacing. A definition of where font is to be placed, such as margins and spacing between characters and lines.
Volatile Memory Matrix Orbital Temporary memory. Once the power supply is turned off, volatile memory is then erased.