Micro-electronic keyboard design based on single chip microcomputer

The method of designing a miniature electronic organ with a single chip microcomputer is introduced. The circuit, block diagram and program are given.
Keywords: single chip microcomputer, electronic keyboard, program

The single chip microcomputer is widely used because of its small size, strong function and low price. This article introduces the method of designing the micro-electronic keyboard with AT89C51 single-chip microcomputer. It only needs AT89C51 minimum system, expands a set of small keyboards (here, 4×4 keyboard is used as an example, it can be expanded as needed), and then add a piece of LM386 to make audio small power amplifier, output to the speaker. . The power supply can be supplied by three 5th batteries.

1 Design principle The tone is actually a signal with a fixed period. We can use the AT89C51's timer (such as T1) to control, output the square wave periodic signal on the P3.4 pin, and generate the tone. According to different buttons, adjust the overflow time of T1, and output the music of different frequencies, thus making a miniature keyboard.
The pitch (frequency) of each tone is fixed. Table 1 lists the sound name, frequency and the initial value of the timer T1 (8 MHz) for a total of 16 sounds. .

This article refers to the address: http://


2 hardware circuit design The electronic schematic of the micro-electronic keyboard is shown in Figure 1. The keyboard can be arranged into a piano keyboard with small buttons (they can be divided into several rows when the keys are too many), and a button indicator (D1) is added to the figure.
3 software design software consists of initialization program, main program, timer 1 interrupt service program, keyboard scan program and delay program.
(1) The initialization procedure is as follows:


The main block diagram is shown in Figure 2.
(2) Main program:


CJNE R4, #00H,
PLAYKEY; judges whether there is a key to press CLR TR1; no key presses to close T1
SETBP3.2; no key presses the off indicator SJMPSTART; jumps back to the starting position
PLAYKEY: CJNE R4, #20H, K0; There is a key press to assign values ​​to TIMER1L and TIMER1H by key values.










(3) The block diagram of the timer 1 interrupt service is shown in Figure 3.


Timer 1 interrupt service routine:


(4) The block diagram of the keyboard scanning program is shown in Figure 4.


Keyboard scanner:





4 Conclusion This article introduces the method of designing a miniature electronic organ with a single-chip microcomputer. As long as the various programs in this article are serially written, it is a complete 16-key micro-electronics program. Interested readers can design a miniature electronic keyboard with more keys, or even micro The keyboard adds the function of playing demo songs [1]. If you have a higher programming skill, you can program and record the time of the button to make a miniature keyboard with recording function.

Xbox Series X Battery

*These Xbox Series X battery is rechargeable battery pack, specially designed for your Xbox series X/S controller, 2 pieces of 800mAh Ni-MH battery and 1 piece of USB-C charging cable,no need any charging dock can save room and there is no need to worry about the storage of AA batteries.

* The X/S controller is protected from overcharge and power surge, ensuring the safety of charging at night.

* Can play when charging, no need to worry the controller power off, bring you great experience during games

Rechargeable battery pack for Xbox Series X S controller, Fully charged is around 3-4 hours and provides up to 12 hours of playtime.it comes with the type-C cable, no extra adapter required. A GREEN light means charging, RED light means fully charged.

Product Name
Rechargeable Battery for Xbox Series X
weight
130g
Input
TYPE-C 5V
Output
DC2.4-3.0V
Product color
Black
Charging time
about 2 hours
play time
about 10 hours
OEM/ODM
warmly welcome
Advatage
100 QC test before shipping
SX battery packXSX battery pack Xbox Series X Battery Pack

Xbox Series X Battery,Rechargeable Xbox Series X Charge Kit,Xbox Series X Rechargeable Battery Pack,Xbox Series X Battery Pack

Shenzhen GEME electronics Co,.Ltd , https://www.gemesz.com

This entry was posted in on