Interface Design of HD7279A, a Keyboard Display Device

Publisher:码农创想家Latest update time:2011-06-10 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction
Traditional keyboard display driver devices (such as INTEL8279) usually use parallel interfaces, occupying at least 10 I/0 ports of the microcontroller, so this keyboard display driver is not suitable for applications with tight microcontroller resources. The improved ZLG7289 device using SPI (Serial PeripIleral Interface) serial bus and the ZLG7290 device using I2C (Intel IC Bus) serial bus must be connected to an independent crystal oscillator to work, and cannot directly support the RC oscillator circuit. The reset terminal must be connected to the RC reset circuit to reliably reset the device, and the chip select terminal CS cannot be directly grounded, otherwise the display may flicker and software delay debugging is difficult. However, the keyboard display driver dedicated device HD7279A does not have such problems. It can work stably and reliably, has simple peripheral circuits, and can be widely used in instruments, industrial controllers, bar displays, control panels, etc. Here is a typical application design of the HD7279A interface.

2 Introduction to HD7279A
HD7279A is a device with a simple SPI serial interface. It can directly drive 8-bit common cathode digital tubes (or 64 independent LEDs) and manage up to 64-key keyboards. A single chip can complete all the functions of LED display and keyboard interface, greatly simplifying circuit design, occupying very few microcontroller resources (at least 2 lines), completely free of debugging, and simpler peripheral circuits. HD7279A contains a decoder that can directly receive BCD code or hexadecimal code, or not decode, and has two decoding modes at the same time. In addition, the device also has a variety of control instructions, such as blanking, flashing, left shift, right shift and segment addressing, etc. The display control mode is flexible, and its segment addressing capability can be used for independent LED display or information indicator control. Figure 1 shows the pin configuration of HD729A, and the function description of each pin is listed in Table 1. HD7279A has a chip select signal, which can easily realize a display higher than 8 bits or a keyboard interface higher than 64 keys. It can be realized by cascading multiple chips and decoding the chip select signal. When there is only one HD7279A in the application system, the chip select terminal CS can be directly grounded. Figure 2 is its typical application circuit.

In the application, the unused keyboard or LED digital tube can be omitted and will not affect each other. If the keyboard is not used, the 8 10 kΩ position select resistors and 8 100 kΩ pull-down resistors in the typical circuit can be omitted. If only one key is connected, all 8 100 kΩ pull-down resistors must be connected. Unless the LED is not connected, the 8 200 Ω current limiting resistors cannot be omitted. The typical value of the external RC oscillation circuit is: R = 1.5 kΩ, C = 15 pF. The resistance value of the pull-down resistor and the position select resistor should follow a certain proportional relationship. Without affecting the display, the pull-down resistor should be as small as possible to greatly improve the anti-interference ability of the keyboard. When driving high-power LEDs, it is necessary to increase the drive circuit, or try to use high-brightness LEDs to simplify the design. The reset terminal RESET can also be directly controlled by the microcontroller to increase reliability, but it needs to occupy the microcontroller resources, so the best connection method should be selected according to the actual application requirements. Because HD7279A uses dynamic scanning, the current is generally large. Therefore, a decoupling capacitor must be connected in parallel close to the power supply end to reduce interference. The typical value of this capacitor is 100μF.

3 HD7279A的工作原理
HD7279A最显著的优点是与单片机的接口简单,最多只需5条连接线,分别是复位端RESET,片选输入端CS,同步时钟输入端CLK,数据输入输出端DATA和按键有效输出端KEY。在一般应用系统中,RESET可直接接电源,当应用系统中只有一片HD7279A器件时,CS也可以直接接地,此时只需占用3条单片机的I/O端口线,如果应用系统中没有键盘,仅具有显示功能,或者即使有键盘,但单片机软件任务不复杂,均可不接KEY线,使用定时读取键盘键值代码的方法,则此时只需占用2条单片机的I/0端口线。

HD7279A is connected to the microcontroller using the SPI serial interface. There are 3 types and 16 command formats, namely, pure commands without data, commands with data, and commands for reading keyboard key codes.
(1) Reset (clear) command A4H This command clears all displays, and all set character blanking, flashing and other properties are also cleared. In fact, the state after power-on and system initialization is exactly the same, which is equivalent to the initialization command. This command is a pure command.
(2) Download data and decode the command according to mode 0 The first byte of data in this command is a command, where a2, a1, and a0 are the binary codes of a certain bit of the 8-bit LED. The D7th bit DP of the second byte of data (D0~D7) indicates whether the decimal point of the LED is displayed. DP=1 is displayed, otherwise it is not displayed; D6~D7 are X bits, which are irrelevant bits; D3~D0 are d3, d2, d1, and dO respectively. These 4 bits display a number (0~9) or a symbol (H, E, L, P, one, and space) in this LED according to the mode 0 decoding rules.
(3) Read keyboard key code instruction 15H This instruction reads the keyboard key code. The first byte data D7~D0 is the command from the microcontroller to the HD7279A. The second byte data D7~D0 is the key code from the HD7279A to the microcontroller. Its value range is OOH~3FH: a total of 64. When there is no valid key, the key code read is 0FFH. The remaining instructions are similar to the above 3 instructions. Figure 3 shows the SIP/serial interface timing.

4 Typical Applications of HD7279A
4.1 Hardware Design
Taking the keyboard display module in the microcontroller-based medical equipment control system as an example, the HD7279A device in this module is connected to the microcontroller AT89C52 by only three lines, as shown in Figure 4. The 3-pin socket J1 is the connection line between the microcontroller AT89C52 and the HD7279A. It occupies three I/O port lines of the microcontroller: P1.7/CLK is the control synchronization clock generated by the microcontroller, P1.6/CS is the chip select line of HD7279A; P1.5/DATA is the command data output/input line. The keyboard interrupt line KEY is suspended, and the CS end is controlled by the microcontroller for power saving considerations, and can also be grounded. The HD7279A device controls the dynamic display of 4 LED digital tubes and monitors the 16-key keyboard. The CLK clock frequency is about 100 kHz, which is determined by the microcontroller programming delay. Under the synchronous clock of CLK, control commands, display data, and keyboard key code data read in query mode are all input/output from the DATA terminal. Using query mode to read key code can save an I/O port line of the microcontroller, but it takes up more software resources. Since the task of the microcontroller in this example is not complicated, the key code is read every 30 ms.
In Figure 4, DIG4~DIG7 are both 4-bit common cathode digital tube bit selection control lines and keyboard column scan lines. SSA~SSG, SDP, a total of 8 lines, are segment selection control lines of 4-bit digital tubes, which are connected to SA~SG, DP of HD7279A device through 200Ω current limiting resistors, respectively, where SSD~SSG are also the row scan lines of the keyboard. The row resistor RX1 is a pull-down resistor of 8×10 kΩ and cannot be omitted. In the oscillator circuit connected to the RC end of the HD7279A device, the resistor R13 = 1.5 kΩ and the capacitor C2 = 15 pF are both necessary, and when R13 changes within the resistance range of 1~2 kΩ and C2 changes within the range of 10P~20 pF, the circuit can work stably. Outside this range, it may cause the LED to flash unexpectedly or respond to the keyboard insensitively. It should be noted that R13 and C2 must be placed as close as possible to the RC end of the HD7279A device to prevent mutual interference. Cl = 100μF is a filter capacitor, which is beneficial to reduce the impact of LED high current operation on the power supply. LDl~LD4 uses 4-bit independent common cathode high-brightness digital tube LEDs. HD7279A uses dynamic scanning to control the display of LEDs, so the 4 non-display bits should be completely blanked to further increase the brightness. In order to make the 4-bit LED fully bright and ensure sufficient brightness, the operating current of the entire display module is reduced to 50 mA, and the 8 current limiting resistors can be increased to 250~270Ω. It should be noted that the HD7279A does not have a double-key lock function. Therefore, in applications where a double-key lock function is required, the I/O lines of another microcontroller can be used in conjunction with the HD7279A device for determination.

Since HD7279A and the microcontroller use a serial interface (at least 2 lines), the row and column monitoring scan lines of the keyboard and the bit selection and segment selection lines of the display control are shared, there are fewer peripheral components, the component value range is wide, the working current is small, and the operation is stable and reliable. Therefore, the interface circuit design is simple and concise, easy to operate, and has a very high cost performance.
4.2 Software Design
For the keyboard display module in Figure 4, the software programming flow chart shown in Figure 5 is given. Conventional tasks refer to other tasks that the microcontroller application system needs to perform, and the execution time does not exceed 20 ms; display tasks refer to display or control commands sent by the microcontroller to the HD7279A device, and the execution time does not exceed 5 ms; the keyboard is generally pressed for more than 60 ms, and the time interval for reading the key value code is about 30 ms. Therefore, as long as the software execution sequence is reasonably arranged, there will be no conflict between conventional tasks, display tasks and keyboard operations, and no keystroke action will be missed.


5 Conclusion
The keyboard display dedicated device HD7279A is connected to the microcontroller using a serial port, which takes up very little resources, is simple to connect to the keyboard and display device, has rich control commands, various display modes, is easy to layout the circuit board, is low in price, and has a clear and easy-to-learn software structure. It is a device with a very high cost performance, so it is widely used in instrument development.

Reference address:Interface Design of HD7279A, a Keyboard Display Device

Previous article:Robot-based infrared distance measurement
Next article:Implementation of radar constant false alarm based on ADSP-TS201

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号