Method of designing universal keyboard for single chip microcomputer system using old computer

Publisher:温暖阳光Latest update time:2011-11-19 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

How to design a universal keyboard for a single-chip microcomputer system using an old computer www.elecfans.com

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.


symbol

Key code
KEYREC

Key value
KEYNUM

Key
Symbol

Key code
KEYREC

Key value
KEYNUM

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.

Reference address:Method of designing universal keyboard for single chip microcomputer system using old computer

Previous article:Application of electronic scale based on Sinowin SH79F085 microcontroller
Next article:Brushless ESC solution for model aircraft based on Sinowin SH79F168 MCU

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号