51 MCU buzzer and digital display matching

Updated on technology 2024-05-05
14 answers
  1. Anonymous users2024-02-09

    1."Add the buzzer, and the ten digits will jump to the display, and the frequency is the same as the frequency of the buzzer">>> this phenomenon may be due to the addition of a delay program when scanning the buzzer buttons, or the call of other functions that take up more time, yes, the screen refresh time and the interval between the buzzer's response have become longer, and it is a change in the time difference, which is what you call the same frequency. Take a look at the program and try to change the buzzer to an LED light or a relay, etc.

    2."Buzzer switches, including pauses, have a delay">>> add buzzer switch? The addition of the watch is generally scanned using an interrupt function at a regular time, so that the scanning of the key will not affect the original program, and there is a debounce delay, which is used to confirm the way when the key is pressed.

    3."If you operate the buzzer in this way, the ring time and the pause time are the same, and it is not easy to control and accelerate. "> your request is a countdown, the speed of the buzzer is getting faster and faster, just write a function, the speed of the sound is beef=1;with beef=0;The length of the time interval between them, the time difference between them can be written with a delay function (the frequency is roughly adjusted), or it can be written with a timer (so that the time difference is very accurate, i.e. the frequency can be determined).

    Hope I can help you!

  2. Anonymous users2024-02-08

    It's not easy to solve, you use two events, a dynamic sketch display (set to event a), and a beep (set to event b), I think the timer you use is to count 1 second, and it is counting method 1, using time slices to solve the problem. Add your beep to the timer (the timer you count).

    For example, if you are using t0, then add this paragraph.

    define: define beep clk 66;

    #define beep_flk 1;

    Global variables: uint16 counter2 = 0;

    uint16 beep_count = beep_clk ;You can change this as you like, but it should be greater than 60*m, and it should be less than the number of interruptions of 1 second.

    Let's say you use uint8 sec = 60;

    The trigger counter used to generate a count for 1 second is: uint8 counter1 = 0;

    void t0 handle(void) interrupt 1 timer 0 interrupt function.

    th0 = 0x...

    tl0 = 0x...This is the count you set for 1 second

    if ( counter2 == beep_count)

    beep = ~beep ;

    counter2 = 0 ;

    if ( counter1 == 0x..This is the counter you set to generate 1 second counter1

    sec--;

    counter1 = 0;

    beep_count = beep_count - beep_flk ;Set this 10 to beep flk, you can change it as you like.

    counter1++;

    counter2++;

    This new program is about 80 machine cycles, and the accuracy m is whatever you want, if you find that the frequency is wrong, try to double th0, double the counter, and try again.

  3. Anonymous users2024-02-07

    The buzzer is controlled in the second timer and is still controlled with beep = beep, but preceded by a conditional control.

    void t0isr() interrupt 1th0=(65536-50000)/256;

    tl0=(65536-50000)%256;

    times++;

    timef++;

    if(timef==(sec/10+1))if(times>=20)

  4. Anonymous users2024-02-06

    I used a timer to control the buzzer, but I can only use beep = beep to achieve that the buzzer does not affect the number, and if you operate the buzzer in this way, the time of the buzzer and the pause time are the same, which is not easy to control and accelerate. Is there a great god who provides a way?

    This way, you can.

    The time of the ringing and the pause time can be linked to the current second.

  5. Anonymous users2024-02-05

    Since it is a 60-second countdown, you can set the display time to 500ms or once in 1s.

    In the same way, the buzzer is also changed once every 500ms or 1s; The only thing to note is that the frequency of the buzzer should not be done in a delayed way, but with a time interruption, so that it will not affect the timing time or program.

  6. Anonymous users2024-02-04

    Post the program out and take a look.

  7. Anonymous users2024-02-03

    Do you post up the circuit diagram and look at it?

  8. Anonymous users2024-02-02

    Buzzers are often used in computers, printers, multimeters and other devices to make a prompt sound, and the prompt sound is generally very simple, that is, it is a simple sound

  9. Anonymous users2024-02-01

    Buzzer? Looking at the circuit, it seems to be a speaker.

    An 8 ohm speaker cannot be used as a load directly, and the impedance does not match.

    At present, 8 ohms is equivalent to a short circuit, which burned out in 2003.

  10. Anonymous users2024-01-31

    It should be that the load capacity of the power supply is not enough, the power supply ULN2003L is enough to drive 1A load, it is estimated that the power supply voltage is lowered after the 2003 driver horn, the single-chip microcomputer does not work, measure whether the power supply voltage is normal.

  11. Anonymous users2024-01-30

    51 can directly drive the buzzer with low effectiveness, so it will not be a hardware problem, no need to add a driving circuit, it must be a problem in the program.

    For example, when doing other writing commands, I changed the output result of the port where you control the buzzer, and I also encountered this problem, and it turned out that the digital tube unintentionally changed the level of my control port when scanning, so that the buzzer kept ringing. Hehe.

    Check out the program.

  12. Anonymous users2024-01-29

    Add a driver to the buzzer. A triode will do. The chip output does not appear to be able to drive the buzzer directly.

  13. Anonymous users2024-01-28

    There are two things that should be checked:

    There is no resistor on the port, and ULN2003 is a Darlington structure inside, and its input current has certain requirements, so it is recommended to use a resistor to pull up;

    2.Procedural problems: It is recommended to use bit operation for the P1 port program to prevent unpredictable changes in the corresponding port due to other reasons;

    3.Circuit interference problem: the buzzer is an inductive device, if the power supply and related wiring processing of the 51 single-chip microcomputer is not perfect, it may affect the normal operation of the single-chip microcomputer due to the interference (interference to the power supply or interference to the line) when the buzzer is working.

  14. Anonymous users2024-01-27

    You're using a passive buzzer, right? Switch to an active buzzer and it will sound.

Related questions
5 answers2024-05-05

If you really want to learn, you don't need to buy a development board. Find a minimal system board, then learn something, buy components and build small circuits by yourself. Run the electronic market by yourself, build the circuit by yourself, in order to know the problem, in order to learn something, buy a development board, according to the circuit on the manual, and then put the program into it, and then the program basically understands, this is not called learning... >>>More

10 answers2024-05-05

It should be that the bias resistor selection is not suitable.

16 answers2024-05-05

Scheduled interrupts, external interrupts?

9 answers2024-05-05

This is normal, because the light on and off is driven by the low level of the single-chip microcomputer (as you can see from your program), and the high-low level load capacity given by the single-chip microcomputer is not very strong, that is to say, although it reaches the voltage, but the current is relatively small, and we write the same situation when we write programs. No problem, don't worry.

5 answers2024-05-05

8086 belongs to the micro process unit (MPU) and is a microprocessor. >>>More