This scheme is a determinant matrix keyboard interface circuit based on RS232 bit-by-bit serial communication bus implemented in VHDL language. It has the functions of reset and receiving and sending serial data. The working condition of the chip can be judged according to the display status of the light-emitting diodes led0-led2; the programs that realize all circuit functions are debugged on the field programmable chip EPM7128SLC84-15 produced by ALTERA in the United States. It can judge whether a key is pressed through dynamic scanning, convert the key value into the corresponding ASCII code value, and realize the reception and transmission of serial data under the action of clock pulses.
2. Design
1. Chip pin definition
reset reset input terminal; clk clock input terminal; rxd serial data receiving terminal; retn0-retn7 keyboard scan row input lines; txd serial data transmitting terminal; scan0-scan7 keyboard scan column output lines; led0-led2 display output terminals.
2. Connection diagram between keyboard and chip (as shown in Figure 2, it is an 8×8 64-key keyboard)
3. Dynamic scanning principle
(1) Make the column lines scan0-scan7 output 0 level in turn, and check the level status of the row lines retn0-retn7. If the levels of the row lines retn0-retn7 are all high, it means that no key is pressed. If the levels on retn0-retn7 are not all high, it means that a key is pressed.
(2) If no key is pressed, return to scanning. If a key is pressed, scan row by row to find the key number of the closed key. The process is: first set scan0=0, scan1-scan7=1, detect the level on retn0-retn7, if retn=0, it means that the key in the first row and first column is pressed, if retn1=0, it means that the key in the second row and second column is pressed, and so on; if retn0-retn7 are not 0, it means that no key in this column is pressed; then set scan1=0, detect the key in the second column, and keep looping until the closed key is found.
When a key is pressed, the scan value and retn value at that moment can be used to determine which key is pressed.
4. Chip internal module block diagram
3. Chip Design
The block diagram of the data receiving module is shown in Figure 4.
Reset reset input terminal; clk clock input terminal; rxd serial data receiving terminal; led[20] outputs the lower three bits of the ASCII code value corresponding to the pressed key to drive the light-emitting diode.
This module realizes the control function of receiving and counting serial data and serial-to-parallel conversion.
1.Serial data receiving control unit
Reset reset input terminal; clk clock input terminal; rxd serial data receiving terminal; sh_rx[30] receive counter high 4 bits; sl_rx[10] receive counter low 2 bits.
The serial data receiving counter is set to a 6-bit counter, with the upper 4 bits as sh_r and the lower 2 bits as sl_r. The status of the counter is used to realize the synchronous control and counting control of the serial data.
2. Serial-to-parallel conversion circuit unit
After the serial data received from the RXD end is converted from serial to parallel, the lower three bits are output through the LED output end, driving the light-emitting diodes LED0, LED1, and LED2 to emit light, thereby displaying the lower three bits of each data of the receiving end RXD. When the lower three bits of each data are the same, the display state does not change, otherwise it will flicker, so as to check the working condition of the chip.
IV. Conclusion
This scheme is a design of a matrix keyboard interface circuit based on RS232 bit-by-bit serial communication bus implemented in VHDL language. It has the functions of reset and receiving and sending serial data. The working condition of the chip can be judged according to the display status of the light-emitting diodes led0-led2; the program to realize all circuit functions is debugged on the EPM7128SLC84-15 chip with field programmable function produced by ALTERA in the United States. The design of this circuit is close to life and has strong practicality. After being made into a chip, it can be used as an interface between a general PC keyboard and a host.
Previous article:Connecting a dummy load to a switching power supply is not something you can do whenever you want!
Next article:Circuit design of battery pack monitoring platform based on LTC6802
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- 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
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- Elimination of low frequency signals
- Where can I find the German patent number?
- EK140 Burning Guide
- Two small questions about the lithium battery charging chip bq2407x
- Operating System Timeline and Family Tree
- Report Summary: Silicon Labs Development Kit Review
- ulab 1.0.0 released
- Nexperia Award Live | Introduction and application of automotive-grade power MOSFET and GaN devices in electric vehicles. Registration is open
- Switching Power Supply Interest Group: Mission 01
- About Analog Switches