PK162-12 Technical Manual Revision: 1.
Contents Contents ii 1 Introduction 1.1 What to Expect From the PK162-12 . . 1.2 What Not to Expect From the PK162-12 1.3 Keypad Interface . . . . . . . . . . . . 1.4 Setup for Testing . . . . . . . . . . . . 1.5 Trying Out the PK162-12 . . . . . . . . 1.6 Trying out a Keypad . . . . . . . . . . 1.6.1 Here’s what to do: . . . . . . . 1.7 Manual Over-ride . . . . . . . . . . . . 1.8 Memory Chip Lock Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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) .
7 Appendix: Command Summary 7.1 General . . . . . . . . . . . . . . 7.2 Issuing Commands . . . . . . . . 7.3 On Numbers . . . . . . . . . . . . 7.3.1 ASCII Characters . . . . . 7.4 Text Commands . . . . . . . . . . 7.5 Keypad Interface Commands . . . 7.6 Bar Graphs and Special Characters 7.7 Miscellaneous Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Introduction The PK162-12 comes equipped with the following features; • • • • • • • • • • • • • • • 16 column by 2 line text PLED display Built in font with provision for up to 8 user defined characters Speeds from 1200 bps to a lighting fast 19.
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. Take care not to connect the display to an unmodified spare power connector in a PC • 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.
1.5 Trying Out the PK162-12 The unit should be connected to power and the PC and backlight 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. 1.
1. 2. 3. 4. 5. 6. Turn off the display Put a jumper on pins 3 and 4 of the keypad connector (C3 and R1) Power up the display. The baud rate is now set to 19,200 Remove the jumper and change the RS-232 port settings to the desired baud rate Turn off the display Power up the display Refer to the "Set RS-232 port speed" command for acceptable baud rates. Figure 2: Manual Over-ride Place jumper on the above pins. 1.
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 Figure below for this chapter.
2.1.1 Power Connection Power is applied via pins 1 and 4. Power requirement for standard units is +5 VDC ±0.25V (units with the wide voltage range option require 7 - 15 Vdc). Power may also be supplied via the RS-232 connector. WARNINGS • Do not apply any power with reversed polarization. • Do not apply any voltage other than the specified voltage. • Do not use any cables other than the cables supplied by Matrix Orbital, unless aware of the modifications required.
Figure 6: Five Volt Power Cable 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.
2.1.4 Power through the DB-9 Connector The display can be powered by pin 9 on the DB-9 connector. If power is applied here, power cannot be applied to the other power connector. The input voltage for pin 9 can only be +5Vdc, even if the unit is wide voltage. NOTE Failure to follow these instructions will result in the destruction of the unit. The jumper shown in the Figure below will have to soldered to use the DB-9 connector for power. Figure 9: DB-9 Power 2.1.
Table 3: RS-232 Pinout Pin Number 2 3 5 2.1.7 Direction Data from LCD Data to LCD - Description Data out(LCD) Data in (LCD) Ground LCD Tx Rx gnd Host Rx Tx gnd Alternate Serial Connection An optional alternate connection header is provided to allow one cable for data and power. Two jumpers will have to be soldered and two removed.
2.1.8 TTL Communications The display can be talked to at TTL (logic 0V to +5V) levels. Two modifications must be made. Figure 13: RS-232 Selects Jumpers 2 and 3 must be closed and 1 and 4 open. 2.1.9 I2 C I2 C Communications I2 C communications runs at 100Kbps and supports up to 127 units on a single communications line. The data line operates on 5 volt CMOS levels. 2.1.10 ACK The idea of ACK is to indicate when the data has been received correctly. ACK does not indicate data incorrectly received.
/ write bit. If we take a standard Phillips 7bit address of 45hex this would be in binary 1000101. This is 7bits. Matrix Orbital would describe the Phillips I2 C address of 45hex as 8Ahex. The read address would be 8Bhex. For more information on Phillips I2 C please visit; ! " #%$ ! & %'() * and for more information specific to our displays visit; + ! & " , -%.%*0/12! ,3*4 " , - .
mands. 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 16: 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 240ohms or more the corresponding resistor may be shorted.
3.1 General Text is displayed on the PK162-12 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. Figure 18: 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. An example of this would be that the cursor is advanced for the next character.
3.4.5 Set Cursor Position (254 71 [column] [row]) (R) 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.
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.
for each position. If the connector has fewer than 7 pins it should be centered on the display connector, starting with Row 3 and Column 1 and going out. Any matrix style keypad will work with the display, as well as momentary switches. The diagram shows the logical layout (row 1, column 1 in upper left). The connector for the keypad is a 10 pin 0.1" spacing male header. Pins 1 through 5 are columns and pins 6 through 10 are rows.
4.4 RS-232 Interface By default on any press of a key, the module will immediately send out the key code at the selected baud rate. This behavior can be modified using commands found in the next section. 4.5 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. 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.
Figure 20: Poll Timing 4.5.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. 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.
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.5.8 GPO or Keypad Mode (254 37 [mode]) The display shares GPO and keypad pins, you can use one of the other but not both at the same time.
5.1.3 Draw Vertical Bar Graph (254 61 [column] [height]) Draws a vertical bar graph in [column] having a height of [height] pixels. The height may range from 0 to 20 (0x00 to 0x14) pixels. The necessary characters must first be initialized by either of the commands shown in section 5.1.1 or 5.1.2, which will determine the width of the graph drawn. Graph may be erased by drawing a bar graph of height = 0 in the same column. 5.1.
Table 7: 8 Byte Map MSB * * * * * * * * * * * * * * * * * * * * * * * * 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 LSB 5 10 15 20 25 30 35 40 Data Byte 0 Data Byte 1 Data Byte 2 Data Byte 3 Data Byte 4 Data Byte 5 Data Byte 6 Data Byte 7 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 g
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.
Table 9: 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. Since "remember" is ON, this setting will be saved in non-volatile memory Turn off "remember" function Any number of commands may be entered between the ’remember ON’ and ’remember OFF’ commands, and all settings will be memorized. 6.1.
Table 10: Default Screen Matrix Orbital PK162-12 The 32 characters define the two 16 character rows of the screen. Table 11: Default Screen Character1 Character21 Character16 Character 32 If sending more than 10 characters to be stored, add in a ~10ms per character delay. Predefined custom characters can be used in the “Start up Screen” as well, by using 0x00 through 0x07 characters. 6.1.
6.1.10 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.13 Set Serial Number (254 52 [byte1] [byte2]) (R) 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 of 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 Appendix: Command Summary 7.1 General The operation of the display is controlled by a simple and consistent command set.
Bytes are usually specified in either decimal or hexadecimal (base 16) form for convenience since binary numbers are confusing to deal with directly.
7.4 Text Commands Syntax in the tables below is given in hex, decimal and decimal with ASCII, in that order, one per line. NOTE The letter "R" in the “Default” column indicates that this state can be saved to nonvolatile memory with the “Remember” command.
Command Underline cursor off Blinking cursor on Blinking cursor off Cursor left Cursor right Syntax 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 R Notes Turns off the underline cursor. On R Turns on the blinking block cursor. 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.
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 2 54 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 key presses buffered until polled. Clear unread key presses. Returns buffered key presses to application.
Command Initialize medium Digits Initialize horizontal bar graph Define custom character Draw vertical bar graph Syntax FE 6D 254 109 254 ’m’ FE 68 254 104 254 ’h’ 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] Draw horizontal bar graph FE 7C [c][r][d][length] 254 124 [c][r][d][length] 254 ’|’ [c][r][d][length] Draw medium digits FE 6F [row][column][digit] 254 111 [row][column][digit] 254 ’o’ [row][column][digit] Notes Initial
Command Remember Syntax FE 93 [0|1] 254 147 Default off Clear Display FE 58 254 88 254 ’X’ N/A Load Startup Screen FE 40 [32 char] 254 64 [32 char] 254 ’@’ [32 char] Matrix Orbital PK162-12 GPO or Keypad Interface Mode FE 25 [mode] 254 37 [mode] 254 % [mode] 0 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 Set I2 C Address FE 33 [address] 254 51 [address] 254 ’3’ [address] 0x50 Read M
Command Read Serial Number Syntax FE 35 254 53 254 ’5’ FE 36 254 54 254 ’6’ Default Enter Flow Control Mode FE 3A [full] [empty] 254 58 [full] [empty] 254 ’:’ [full] [empty] Off Exit Flow Control Mode FE 3B 254 59 254 ’;’ Read Version Number 8 Notes Reads the two byte serial number of the module. Reads the firmware version number of the module. Sets "full" and "empty" marks for the 80 byte display buffer. When buffer reaches [full] display will return 0xFE to host.
Table 25: Electrical Specifications Supply Voltage Supply Current (all pixels off) Supply Current (all pixels on) 4.75 - 5.25 Vdc (optional 7 - 15 Vdc) 16 mA typical 24 mA typical Table 26: Optical Characteristics Number of Characters Matrix format Display Area Character Size Character Pitch Line pitch Dot Size Dot Pitch Luminance Matrix Orbital 32 (16 characters by 2 lines) 5 x 8 with underline 56.0 x 13.8 mm XxY 2.67 x 5.01 mm (XxY) 3.2 mm 5.35 mm 0.51 x 0.6 mm (XxY) 0.54 x 0.
Figure 21: Physical Layout 8.
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.