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.
Previous article:Robot-based infrared distance measurement
Next article:Implementation of radar constant false alarm based on ADSP-TS201
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MSP430F5438A clock settings
- Ideal Auto says it will open source its self-developed AEB system code
- Three-phase PFC, current loop does not converge using VIENNA topology
- 【GD32450I-EVAL】USB touch screen driver
- CCS3.3
- Request the schematic diagram of this system board
- How many Gs is the AT in the PULLin VALUE of the reed switch?
- July 9 live broadcast review: Enjoy the purity - AMS active noise reduction and proximity sensing bring a new level of headphone design (including video, ppt)
- ADI chips have increased by NNN times?
- How to improve the anti-interference ability of wireless modules