Kpad User interface with 6x character LCD with backlighting, 8x button keypad, and software dirvers. Driven by TTL level I/O or Data / Address Bus. Technical Manual 950 5 th Street, Davis, CA 9566, USA Tel: 530-758-080 Fax: 530-758-08 Email: sales@tern.com http://www.tern.com
COPYRIGHT Kpad, IEL, FlashCore, 586-Engine, A-Engine, A-Engine86-P, i386-engine, and ACTF are trademarks of TERN, Inc. Am88ES and Am86ES are trademarks of Advanced Micro Devices, Inc. Microsoft, MS-DOS, Windows95/98/000/XP are trademarks of Microsoft Corporation. Paradigm C/C++ is a trademark of Paradigm Systems. Version 3.00 November, 00 No part of this document may be copied or reproduced in any form or by any means without the prior written consent of TERN, Inc. 999-00 950 5 th Street, Davis, CA 9566, USA Tel: 530-758-080 Fax: 530-758-08 Email: sales@tern.com http://www.tern.com Important Notice TERN is developing complex, high technology integration systems. These systems are integrated with software and hardware that are not 00% defect free. TERN products are not designed, intended, authorized, or warranted to be suitable for use in life-support applications, devices, or systems, or in other critical applications. TERN and the Buyer agree that TERN will not be liable for incidental or consequential damages arising from the use of TERN products. It is the Buyer's responsibility to protect life and property against incidental failure. TERN reserves the right to make changes and improvements to its products without providing notice. Temperature readings for controllers are based on the results of limited sample tests; they are provided for design reference use only.
Kpad Chapter : Technical Manual Chapter : Technical Manual. Functional Description The Kpad offers a 6x character LCD with backlighting and adjustable contrast while supporting an 8x keypad. The Kpad-IO is an ideal upgrade to an existing TERN controller to add simplified user interface. The Kpad comes in two versions, the Kpad-IO and the Kpad-Bus. While the two versions provide identical functionality, how they interface to its host controller is quite different. The Kpad-IO is driven by TTL level bidirectional user-programmable I/Os. These TTL level I/Os are driven by the host controllers PPI or by the CPU in the case of the FlashCore. This version uses TTL level I/O for sending commands and data to the on-board LCD controller (on the Kpad PCB). This versions also implements one port of the PPI as input for scanning for activity on the 8x keypad. The Kpad-Bus version uses a completely different implementation to drive the same LCD controller and scan the scan the same keypad. With this version, the host controller s address and data bus, as well as one chip select line from the CPU, interface a PAL and HC59 on the Kpad PCB. This PAL then drives the chip select for the HC59, which interfaces the LCD controller. Both versions require (+5V from driving controller, no external power supply needed) and from its host controller. An on-board potentiometer is then used to control LCD contrast to suit a wide variety of lighting conditions. TERN provides complete software support for all necessary operations, allowing for simple coding or integration into an existing system. The Kpad consists of the Seiko L67 6x character LCD integrated onto to a TERN developed PCB. The Kpad PCB also integrates a 6-key keypad in an 8x configuration. The Kpad-Bus version then adds a PAL, HC59, and 74HC44 to latch data in both directions. Both versions are connected to its driving controller via flat cable. Both version of the Kpad use the same TERN developed PCB, but use different pin header to interface it host controller. TERN Host Controller or I/O Expansion Card TTL level I/O KPAD-IO 6x LCD (D7 D4, RS, E, R/W) 8x Keypad ( inputs from host, 8 outputs to host) Functional block diagram of the Kpad-IO and host -
Chapter : Technical Manual Kpad TERN Host Controller 8-bit A/D Bus, /PCS0 KPAD-BUS PAL 6V8P Drives /59 Chip Select for HC59 Drives /RDK Chip Select for 74HC44 Flip-Flops Header H3 => Potentiometer for VLC Functional block diagram of the Kpad-Bus and host. Features Standard Features Dimensions: 5. x.5 (Total PCB).44 x 0.630 (LCD Viewing Area) 6 x 6 mm (LCD Viewing Area, manufacturer s specification) Power input: +5V regulated DC. Supplied by Host Controller Operating Lifetime: LCD 75,000 Hours (Minimum) LED Backlighting 50,000 Hours (Typical) LCD: Seiko L67 6x character LCD Keypad: 6 keys in 8x configuration.3 Physical Description The Kpad PCB is complete with several pin headers, each with its own purpose. It is only necessary to use one header at a time, dpending on the host controller and interface being used. The J pin header on the Kpad PCB is used in the Kpad-Bus configuration. The Kpad-IO configuration uses the H4 pin header. It is a 7x header that installs via flat cable to the J6 (or J4) header of the AE, AE86, IEL, etc. Furthermore, the H5 header is used for the TD40, TD86, and the FlashCore, all special versions of the Kpad-IO. The following table gives the pin layouts and descriptions for both headers. Refer to the Kpad schematic, as -
Kpad Chapter : Technical Manual well as the schematic for your host controller, for additional details on the TERN CD, in the tern_docs\schs directory. Figure. shows the Kpad-IO version with the A-Engine-P via 34 pin flat calbe. Figure. shows as specialized version of the Kpad-IO specifically designed for the TD40, named TD-Pack. Included in the TD-Pack are the TD40 controller, Kapd-IO, and enclosure. Figure. Kpad-IO with A-Engine-P Figure. TD-Pack -3
Chapter : Technical Manual Kpad J Header: Kpad-Bus 3 4 5 6 7 8 D0 9 0 D D 3 4 D3 /RST 5 6 D4 7 8 D5 /PCS0 9 0 D6 D7 3 4 5 6 A7 7 8 A6 /WR 9 30 A5 /RD 3 3 A4 33 34 A3 35 36 A 37 38 A 39 40 A0 Kpad-Bus Function Pin Name Kpad supply voltage, +5V Ground D7 D0 Data Bus: D7-D0 => Keypad scan A7 A3 A A0 /PCS0 /WR /RD D0 => Data In (HC59) => Input to PAL 6V8P Address Bus: Inputs to PAL 6V8P Select lines for HC59 Clock Input for PAL 6V8P Input to PAL Input to PAL Kpad pin layout and description for Bus version -4
Kpad Chapter : Technical Manual H4 Header: Kpad-IO I07 3 4 I06 5 6 I05 7 8 I04 9 0 I03 I0 3 4 I0 5 6 I00 7 8 I7 9 0 I6 I5 3 4 I4 5 6 I3 7 8 I 9 30 I 3 3 33 34 Kpad-IO Function Pin Name Kpad supply voltage +5V Ground I07 I00 Keypad scan. Tied to Pull-up resistors I7 I4 Data lines of LCD controller D7 D4 I3 LCD controller Enable I LCD controller, mode select Low: Command High: Data I Keypad Scan Keypad Scan Kpad pin layout and description for IO version -5
Chapter : Technical Manual Kpad.4 Software: Kpad-IO The Kpad-IO version uses a direct interface to the LCD controller to minimize the number of IO lines required to drive the Kpad-IO, and thus leave more IO lines free for user application. TERN software drivers for the Kpad-IO send information to the LCD controller in a 4-bit format. As a result only data lines D7 D4 are used. Logically, an 8-bit instruction or character must be sent to the LCD controller in two 4- bit nibbles. As the table in the previous section defines, IO lines I7 I4 from the host controller tie directly to D7 D4 of the LCD controller. In addition, the LCD uses three other control lines, E, RS, and R/W. Since the LCD controller does not send any data back to the host, the R/W is tied to ground by hardware design. The RS line defines the mode of the LCD controller, low indicating a command/instruction and high indicating data. Finally, a falling edge on the E signal will latch all signals present on the LCD controller. A flow chart represents the necessary steps to send both a command and data byte to the LCD controller. TERN software drivers have de-coupled all tasks into separate functions. ppi_lcd_init ppi_lcdcmd ppi_lcddat It is necessary to call this function to initialize the LCD controller. Settings include; 4-bit mode, 5x7 Dot format, lines of characters, Display On, Cursor On, Blink Off. Arguments: void This function will send an 8-bit command/instruction in two 4-bit nibbles. Commands are used to send the initialization routine and set the position of the cursor. Arguments: unsigned char cmd This function is used to send data (or characters) to write to the display. Arguments: unsigned char dat ppi_lcd_clr_line ppi_lprintf kpad This function will clear all 6 characters of either line. Arguments: unsigned char code (code = 0x80 for top line, code = 0xc0 for bottom line) This function will print a sting, by calling ppi_lcddat for each character in the string. Arguments: char * str This function scans the Keypad and returns the key pressed. Arguments: void Returns: unsigned char (these return values can then be decoded to the user s preference) -6
Kpad Chapter : Technical Manual Begin Use mask to get upper 4 bits of byte Command Send Command or Data? Data Use mask to clear RS bit to indicate command Use mask to set RS bit to indicate data When using a PPI to drive these signals, it becomes necessary to first drive the data lines and the RS signal, and then drive the E signal. This will allow the PPI to create stable signal on the LCD controller before latching values. Use mask to set E bit. Output PPI port which drives D7-D4, E, RS Allow signals to settle. Use mask to clear E bit Left shift original byte by 4 to put lower 4-bits onto upper 4 data lines Drive E low to latch D7-D4 and RS * Kpads installed with backlighting need to be aware of this timing issue. It is important to allow the LCD controller time to process the upper four bits before sending the lower four bits. For this reason it may be necessary to add delay statements between the latching of the upper and lower bits. Yes Have all 8 bits been sent*? No Done. byte sent to LCD controller -7
Chapter : Technical Manual Kpad.5 Software: Kpad-Bus The Kpad-Bus version interfaces to the LCD controller in a different way than the Kpad-IO. Here, an 8 channel D flip-flop is used to first latch the four data lines and the RS mode line, then give a falling edge on the E, enable, line to latch the output of the 8 channel flip-flop into the LCD controller. This introduces new components between the host controller and the LCD controller. Begin Set E low. Use mask to get status of data bit. Output result. Go to next data bit All 4 bits sent? No Yes Command Command or Data? Data Use mask to clear RS, indicating command. Output to LCD. Use mask to set RS, indicating data. Output to LCD.. Provide falling edge on E to latch values into controller. Now focus on lower 4 bits of original byte No Have all 8 bits been sent? Yes -8 Done. byte sent to LCD controller
Kpad Chapter : Technical Manual TERN software uses the following pre-defined functions to drive the Kpad-Bus kp_lcd_init kp_lcdcmd kp_lcddat Just as with the Kpad-IO, it is necessary to call this function before any other function call to the Kpad. This initialization routine include: 4-bit mode, 5x7 Dot format, lines of characters, display ON, cursor ON, blink OFF. Arguments: void This function will send an 8-bit command in two 4-bit nibbles. Commands are used to send the initialization routine and set the position of the cursor. Arguments: unsigned char cmd This function is used to send data (or characters) to write to the display. Arguments: unsigned char dat kp_lcd_clr_line kp_lprintf kp_scan This function will clear all 6 characters of either line. Arguments: unsigned char code (code = 0x80 for top line, code = 0xc0 for bottom line) This function will print a sting, by calling kp_lcddat for each character in the string. Arguments: char * str This function scans the Keypad and returns the key pressed. Arguments: void Returns: unsigned char (these return values can then be decoded to the user s preference).6 LCD Address Mapping The following is an address mapping of the 6x character LCD. To move the cursor to any location, just call ppi_lcdcmd for the Kpad-IO, or kp_lcdcmd for the Kpad-Bus, with the address of the desired location. All values are in hexadecimal. Line : 80 8 8 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F Line : C0 C C C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF -9
Chapter : Technical Manual Kpad As a part of the initialization routine in ppi_lcd_init (or kp_lcd_init), the LCD is initialized to auto increment the cursor after receiving a character. It is therefore not necessary to increment the cursor manually..7 Software Drivers and Samples Use this section as a guide to the correct drivers and sample code for your TERN controller. Am88ES / Am86ES / RDC R8830 / RDC R880 based controllers: Kpad-Bus: tern\86\samples\kpad\kpad_bus.c Kpad-IO: tern\86\samples\ae\kp_io.c TD40: tern\86\samples\td40\td40_pck.c TD86: tern\86\samples\td86\td86_pck.c FC40: tern\86\samples\fc\kpad_fc.c i386ex based controllers: i386-engine-m (Kpad-Bus only) i386-engine-l (Kpad-IO only) tern\386\samples\iem\iem_kpad.c tern\386\samples\iel\kpad_io.c 586-Engine and Expansion Cards driven by the 586-Engine (P50 & P00): 586-Engine + P00 (Kpad-IO): tern\586\samples\p00\586_pck.c 586-Engine + P50 (Kpad-IO): tern\586\samples\p50\p50_kpad.c 586-Engine (Kpad-Bus): tern\586\samples\kpad\586_kpad.c.8 Additional Information Refer the TERN CD for the data sheet on the Seiko LCD67, under tern_docs\parts. Also, the technical manual for your specific controller might also provide a specialize tutorial based on that controller on the TERN CD, under tern_docs\manuals. -0
Kpad Chapter : Technical Manual.9 Sample Configurations Shown below are few controller + kpad-bus configurations. The top picture shows the kpad-bus with the 586-Engine. The bottom picture shows the kpad-bus with the A-Engine-P. -
Chapter : Technical Manual Kpad 586-Engine-P plus P00 with Kpad-IO via J6 pin header. -
/PCS0 D0 /WR S6 3 0 9 U3 /RD 4 I I C 5 O I3 K V 7 S5 A6 5 O6 8 I4 S4 A7 6 O5 7 I5 S3 7 O4 6 A5 I6 O3 5 S A4 8 I7 S I O O O 4 8 G E 0 6V8P 9 0 3 PAL6V8P A3 /59 /RDK C 0.0UF CAPNP I00 I0 I0 I03 I04 I05 I06 I07 U 4 A 6 A 8 A3 A4 3 A 5 A 7 A3 A4 /RDK 9 G G D0 3 A0 A A 3 /59 4 5 74HC44 74HC44 Y 8 Y 6 Y3 4 Y4 Y 9 7 Y Y3 5 Y4 3 U D Q0 4 LE Q 5 I S0 Q 6 I S Q3 7 I3 S Q4 9 I4 Q5 0 I5 G Q6 I6 CLR Q7 I7 74HC59 74HC59S RN I7 C 0 I07 3 9 9 3 8 8 I6 I06 4 5 4 7 7 I5 I05 5 6 6 I4 I04 6 6 5 5 I3 I03 7 8 7 4 4 I I0 8 3 3 I I0 I00 9 0 9 0 RN768 C 0.0UF CAPNP D0 D D D3 D4 D5 D6 D7 /RST /PCS0 /WR /RD J 3 4 5 6 7 8 9 0 3 4 5 6 7 8 9 0 3 4 5 6 7 8 9 30 3 3 33 34 35 36 37 38 39 40 D0 D D D3 D4 D5 D6 D7 A7 A6 A5 A4 A3 A A A0 HDRD40 FOR AEP/AE86P/IEM BUS HEADER J0 D7 D6 3 D5 4 D4 5 D3 6 D D 7 D0 8 /WR 9 0 /RD A0 A A 3 A3 4 5 A4 6 A5 A6 7 A7 8 9 0 /PCS0 HDRS0 H HDRD HDRD FOR A-CORE BUS INTERFACE I K9 K0 K K K3 K4 K5 K6 I7 I5 E I3 RS I 8x CONTACTS VLC I00 I0 I0 I03 I04 I05 I06 I07 H3 3 I Contrast Adjust POT H 4 3 0 9 8 7 6 5 4 3 HDRD4 HDRS3 HDRS3 6x LCD HEADER I6 I4 K8 K7 K6 K5 K4 K3 K R/W VLC K I00 I0 I0 I03 I04 I05 I06 I07 TD40/TD86 H5 I/O PIN Interface Title I I4 I6 I00 I0 I04 I06 R R 0 H5 8 6 4 0 8 6 4 HDRD0 HDRD0 9 7 I 5 I3 3 I5 I7 9 I0 7 I03 5 I05 3 I07 EXTERNAL I/O Interface DRIVEN by AE/AE86 PPI I07 I06 I05 I04 I03 I0 I0 I00 I7 I6 I5 I4 I3 I I K K L L H4 3 4 5 6 7 8 9 0 3 4 5 6 7 8 9 0 3 4 5 6 7 8 9 30 3 3 33 34 HDRD34 HDRD34 L LE DIODE LED L I7 DIODE LED TERN/STE S Size Document Number B KPAD.SCH C3 0.0UF CAPNP REV Date: January, 00 Sheet of