Design of a multifunctional answering machine based on single chip microcomputer

Publisher:神雕Latest update time:2015-04-02 Source: eechina Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
        The buzzer is an indispensable hardware device in various quiz competitions. There are many ways to implement the buzzer. Traditional buzzers are generally designed with analog circuits, digital circuits or analog-digital hybrid circuits. This type of buzzer requires more components. As the functions increase, the circuit becomes more complex, and the cost is high, the failure rate is high, the operation is inconvenient, and it is not easy to adjust parameters and upgrade functions. This paper uses AT89C51 as the core, combined with peripheral devices such as keyboard, digital tube, buzzer, etc., to design a 4-way buzzer with functions such as answering, timing, time adjustment, and buzzer alarm.
Overall
design Design requirements
According to the design requirements, this system has the following main functions: (1) The buzzer can be used by 4 contestants or four teams at the same time; (2) The host can set the answering or answering time by himself; (3) It can display the countdown of the answering or answering time; (4) When someone breaks the rule, it can display the contestant number, flashing display and buzzer alarm; (5) When there are 5 seconds left in the answering time, the buzzer alarm prompts.
Working principle of the buzzer
The single-chip microcomputer is used to control each functional module to realize the buzzer function. The single-chip microcomputer collects the contestant's buzzer signal, uses the register to identify and record the first contestant number, transmits the information to the digital tube display, and the internal timer works to record the relevant time and generate a timeout signal. When the buzzer is successful and the countdown ends, there is a buzzer alarm reminder, thereby realizing the single-chip microcomputer buzzer function.
According to the design requirements and the working principle of the single-chip microcomputer, the workflow diagram of the buzzer is designed as shown in Figure 1.



Figure 1 Workflow diagram of the buzzer
       
Hardware design
In terms of hardware design, the single-chip microcomputer AT89C51 is used to control the buzzer module, display module, timing and adjustment module, buzzer prompt module and reset module, thereby realizing the single-chip microcomputer buzzer. The system hardware design schematic diagram is shown in Figure 2.
In Figure 2, U1 is the MCU AT89C51, K1~K4 are 4-way answer buttons, connected to P1.0 to P1.3 respectively; the start key and the end key are connected to the 10th and 11th pins of the MCU respectively. Since the 10th and 11th pins of the MCU have both the serial interface RXD and TXD functions and the IO port functions of P3.0 and P3.1, the buttons here use the IO port functions of the 10th and 11th pins of the MCU. The answer time adjustment button and the answer time adjustment button are connected to the 13th and 14th pins of the MCU respectively, and the "plus one" button and the "minus one" button are connected to the 15th and 16th pins of the MCU respectively. The 4-bit seven-segment digital tube segment selector is connected to the P0 port, the bit selector is connected to the lower 3 bits of the P2 port, and the buzzer output signal is connected to the P3.7 port. [page]



Figure 2 Hardware design schematic diagram


Display module
The display module uses the common 4-bit seven-segment common anode digital tube and uses its dynamic display method to achieve it. The 7 input terminals A~G of the digital tube are connected to P0.0~P0.6 of AT89C51 respectively, and the bit selection codes COM1, COM3, and COM4 are connected to P2.0, P2.1, and P2.2 of the single-chip microcomputer respectively. The single-chip microcomputer determines which bit should be displayed at present. Since the P0 port of the AT89C51 single-chip microcomputer does not have a built-in pull-up resistor, this system uses an external 10kΩ pull-up resistor (using A103 resistor) to ensure that the P0 port is in a high level state when there is no data output.
Key input module
The input signal of the buzzer is controlled by 11 keys, including 4 buzzer keys, 4 countdown adjustment keys, 1 start key, 1 end key, and 1 reset key. Each key has a signal line connected to the single-chip microcomputer circuit, and all keys have a common terminal. Each key is independent of each other and does not affect each other. When a key is pressed, the corresponding single-chip microcomputer pin responds and generates a valid input signal.
Buzzer prompt module
In this design, the 16th pin of AT89C51 is used to drive the buzzer to sound through the driver. The piezoelectric buzzer requires a driving current of about 10mA. The current amplification effect of the transistor can be used to drive the buzzer to achieve a sound prompt.
Reset module
The reset module consists of a reset button, a resistor R1, and an electrolytic capacitor C3. Since the microcontroller is reset at a high level, when the reset button is pressed, the 9-pin RESET pin of the microcontroller is at a high level. At this time, the microcontroller is in a reset state. After power-on, due to the slow charging of the capacitor, the voltage of the 9-pin of the microcontroller gradually changes from high to low. After a period of time, the 9-pin of the microcontroller is in a stable low-level state. At this time, the microcontroller is powered on and reset, and the system program starts to execute from 0000H.
Two functions, hardware reset and software reset, are used in this design. After the hardware reset, the values ​​of each state, register, and memory are restored to the initial value. Adjusting the countdown time for answering and answering requires a memory function, so a soft reset is used. When the program is executed, the jump instruction jumps the program to the starting address of the program execution.




        
Software Design The
answering machine requires a timing memory function. After the time is set once, there is no need to re-set the time after reset. The contestants answer by pressing the keyboard keys, and then the single-chip microcomputer converts it into a font code that can be displayed on the seven-segment digital tube. After the answer is completed, the answering contestant number is displayed on the digital tube, indicating that the answer is successful and the countdown begins.



Figure 3 Software Design Flowchart
[page]

Based on this design idea, the system software design flow chart is shown in Figure 3. The system uses Keil software to write assembly language with reference to the software flow chart. Taking the display module as an example, the corresponding program segments are as follows:
DISPLAY:MOV DPTR,#DAT1; Look-up display program, P0.0~P0.6 segment selection, P2.0~P2.2 bit selection;
  MOV A,R5
  MOVC A,@A+DPTR
  MOV P2,#01H
  MOV P0,A
  ACALL DELAY
  MOV DPTR,#DAT2
  MOV A,R4
  MOVC A,@A+DPTR
  MOV P2,#02H
  MOV P0,A
  ACALL DELAY
  MOV A,R3
  MOVC A,@A+DPTR
  MOV P2,#04H
  MOV P0,A
  ACALL DELAY
  RET
  DAT1 B 00H, 06H,5bH,4fH,66H,6dH,7dH,07H,7fH,6fH,00H,71H;
  DAT2 B 3fH, 06H, 5bH, 4fH, 66H, 6dH, 7dH, 07H, 7fH, 6fH, 00H, 71H 71H;









        
System simulation based on Proteus
Proteus software can not only simulate the working conditions of the microcontroller, but also the working conditions of the microcontroller peripheral circuits or other circuits without the participation of the microcontroller. After simulation, this design realizes the expected function of the buzzer. Module for
successful answering
Figure 4 shows that contestant No. 4 answered successfully, and there are 52 seconds left to answer the question. When the answering time is less than 5 seconds, there will be a buzzer alarm.
Figure 5 shows that contestant No. 1 illegally answered the question before the host pressed the start button. At this time, the digital tube kept flashing and accompanied by a buzzer alarm.
Time adjustment module
Figure 6 shows the time of adjusting the answer time and answer time by the "plus one" or "minus one" key. At this time, the time displayed on the digital tube is set to 58 seconds.
Reset module
Figure 7 shows that the initial state "FFF" is displayed on the digital tube at the beginning of work and after reset. This design uses hardware reset and software reset: when only the system default answer time and answer time are used, both resets can achieve the desired purpose; when the countdown time has been reset, the application software reset is required, which only jumps after executing the command and has no effect on the content of the general register in the chip. Hardware reset will initialize the state of the special register.
Hardware implementation
On the basis of achieving the predetermined goal through Proteus simulation, the single-chip microcomputer AT89C51, reset circuit, buzzer circuit, display circuit, key circuit and power supply circuit are welded, and the completed 4-way answerer is shown in Figure 8.


Figure 8 Picture of the real answering machine


Conclusion
This design uses the actual circuit as the final result, and realizes the expected functions such as answering, countdown, and alarm. It can be applied to general competition occasions and has certain practical value. In addition, this design has strong scalability, such as automatically controlling the scorer to score, and communicating with the PC through the serial port, using the PC to count the scores of the players, realizing intelligent, fair, and just answering, and reducing the influence of human factors. The answering button can also be realized by wireless devices, such as infrared, so that the answering players can answer from a distance, simplifying the line layout of the button module.
Reference address:Design of a multifunctional answering machine based on single chip microcomputer

Previous article:Summary of MCS-51 MCU instruction fast memory method
Next article:Big Prawn talks about getting started with 51 single-chip microcomputer!

Recommended ReadingLatest update time:2024-11-16 20:37

ATMEGA168+L298 controls the forward and reverse rotation of the motor and Proteus simulation
This is a remote control car designed in the previous course. The motor speed is simply controlled to make the car move forward and backward. The left and right turns are also referenced by others on the Internet. If you need it, you can take a look. Please point out any deficiencies. The ATMEGA168 microcontroller +
[Microcontroller]
ATMEGA168+L298 controls the forward and reverse rotation of the motor and Proteus simulation
Proteus and Keil Cx51 microcontroller simulation (serial port simplex communication 2)
The serial ports of the microcontrollers U1 and U2 both work in mode 3, with U1 as a receiver and U2 as a transmitter. The baud rate is 9600. After U1 receives the data sent by U2, it sends it to ports P1, P0 and P2 in turn for running light display. Write a program and simulate it with Proteus. Circuit Diagram:
[Microcontroller]
Research on LCD Display Based on Proteus
Proteus is an EDA tool software published by Labcenter electronics in the UK. It realizes the co-simulation from schematic design, code debugging to single-chip microcomputer and peripheral circuits, and switches to PCB design with one click, realizing the complete design from concept to product. It is the only design
[Power Management]
Research on LCD Display Based on Proteus
51 MCU 8X8 dot matrix snake game (with proteus simulation)
There are six levels in total. Eat 20 to advance to the next level.       // i MCU Forum /i : http://www.51hei.com/bbs/ #include reg51.h #define uchar unsigned char #define SNAKE 20 //Maximum length #define TIME 50 //Display delay time #define SPEED 71 //Speed ​​control //#define keyenable 1 sbit keyenable=P3^
[Microcontroller]
51 MCU 8X8 dot matrix snake game (with proteus simulation)
[51 MCU] Matrix keyboard line-by-line scanning simulation experiment + ultra-detailed Proteus simulation and Keil operation steps
1. Environment I used Keil5 as a compilation tool and proteus for simulation. I don't know if there are other good software that can generate .hex files (.hex files need to be generated for the microcontroller to run) except Keil5. Proteus is a very good simulation software with many components. Of course, I ha
[Microcontroller]
[51 MCU] Matrix keyboard line-by-line scanning simulation experiment + ultra-detailed Proteus simulation and Keil operation steps
Virtual serial port and its use in Proteus
1. Virtual Serial Port A virtual serial port is a serial port simulated by a computer through software. When other design software uses the serial port, you can call the virtual serial port to simulate and check the correctness of the design. First, you need to install the software for setting the virtual serial port.
[Microcontroller]
Reference IAR + Proteus7.6 simulation MSP430 microcontroller setting method
 How to set up WIND's IAR + Proteus7.6 to simulate MSP430 MCU         Proteus7.6 adds the MSP430 series of microcontrollers. The software simulation of MSP430 can be completed by using IAR embedded workbench and Proteus7.6. The steps are as follows. 1. Set up IAR software and generate XX.HEX file (1) Create an MS
[Microcontroller]
Reference IAR + Proteus7.6 simulation MSP430 microcontroller setting method
A short story about Proteus7.5 (1) The use of PNP transistors
When designing a multifunctional electronic clock, I once encountered such a problem. I used the P0 port of the microcontroller to drive an 8-bit common anode digital tube through a three-wire decoder. After connecting the circuit and loading the code, the state of the 8th bit was always high after selecting PNP, and t
[Microcontroller]
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号