Calculators are of various types, exquisitely made, sensitive to trigger, and cheap. Using an old calculator to transform it into a universal keyboard for a single-chip microcomputer system can be easily connected to any single-chip microcomputer application system. Whether in experimental production or practical application, it is a simple and convenient method.
I made a universal keyboard with a calculator and used it in several application systems. The effect is better than using ordinary keys and it is very convenient to use.
The circuit is shown in Figure 1 and Figure 2. First, choose a calculator with a suitable and beautiful appearance (this article takes the RS-3890 calculator as an example), open the back cover, find the row and column lines of the keyboard matrix, and mark them. Draw a corresponding diagram of the matrix keyboard and symbols, as shown in Figure 2.
Cut off the printed circuits of the original keyboard's row and column lines leading to the mask chip, and then use thin enameled wires to connect the row and column lines to the corresponding L/O ports of the AT89C2051 microcontroller as the detection lines of the new keyboard.
This article uses P1.0~P1.5 as row lines and P3.2~P3.7 as column lines. If more buttons are needed, the microcontroller can be AT89C51. Use an I/O port of the microcontroller as the sound control port (P1.7 is used in this article) to control the sound of the original calculator beeper.
The keyboard code is outputted by the serial port of the single-chip microcomputer to provide key control information to the single-chip microcomputer application system. This keyboard has only three connections with the application system, and the power supply is taken from the application system, which is very convenient to use.
The flowcharts of the keyboard sending program and the application system key value receiving program are shown in Figure 3 and Figure 4. Write the keyboard code sending source program into 89C2051, and the keyboard code receiving source program into the microcontroller in the application system. The two programs set the same baud rate, use KEYNUM as the keyboard information export, and then use KEYREC and KEYNUM values as control program codes in the application system to complete the operation of the application system.
|
Key code
|
Key value
|
Key
|
Key code
|
Key value
|
O |
0lH |
0lH |
+ |
IOH |
14H |
7 |
02H |
0D |
× |
H |
13H |
|
03H |
1CH |
ON/C |
12H |
00H |
% |
04H |
11H |
2 |
13H |
06H |
|
05H |
15H |
9 |
14H |
0FHH |
|
06H |
ICH |
5 |
15H |
0AH |
|
07H |
12H |
C |
16H |
04H |
Mr |
08H |
19H |
|
17H |
16H |
|
09H |
02H |
0FF |
18H |
OCH |
MR |
0AH |
18H |
1 |
19H |
05H |
+/- |
OBH |
03H |
8 |
oeLh |
0E |
|
0CH |
08H |
4 |
1BH |
09H |
3 |
0D |
07H |
M- |
1CH |
1AH |
|
0E |
17H |
M+ |
oeLh |
ikB |
6 |
0FH |
0BH |
|
oeLh |
oeLh |
The attached table gives the corresponding relationship between the key code and the key value converted after receiving. The key value KEYNUM in the table is defined by the author in a certain application system. Readers can also change the key value according to the requirements of their own application. The KEYREC value is the actual code sent by the keyboard corresponding to the key symbol shown in Figure 2.
Previous article:Application of electronic scale based on Sinowin SH79F085 microcontroller
Next article:Brushless ESC solution for model aircraft based on Sinowin SH79F168 MCU
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- Device thermal coupling and heat dissipation solutions on PCB
- [Mil MYS-8MMX] Mil MYS-8MMQ6-8E2D-180-C Unpacking Report 3——Network
- Some considerations for DSP hardware design
- The significance of weld seam tracking sensors in the field of welding
- TI's new optical stage lighting DLP chipset is said to provide up to 15,000 lumens of monochrome light
- Memory alignment processing for ARM processors
- Last day for pre-registration! In-depth analysis of Infineon's star product IGBT7, live broadcast to understand the device operation and load process
- [Rawpixel RVB2601 development board trial experience] Use FreeRTOS with caution
- Brushless motor drive control hardware circuit sharing
- Share: [Skills Competition Notes 01] Zigbee point-to-point button control program development