C51 MCU pulse accumulator C language program 200

Updated on technology 2024-03-16
12 answers
  1. Anonymous users2024-02-06

    If the timer count value is not enough, you can first set the sum number of 1, such as 1ms, and then add another number to 10 to 100ms to get the 1s time.

  2. Anonymous users2024-02-05

    I don't know C language, if you want to assemble, I can give it to you, 1 second = 1000 milliseconds = 1000000us, put it in the specific implementation, you can use the query method, you can also use the interrupt mode, let the crystal oscillator frequency be 6m hertz, then the machine cycle is 12 6m = 2us, the interrupt is simpler, I say the interrupt program, t0 (the pin works in the timing mode, the timing is set to 100ms, use the interrupt, the control interrupt number is 10 overflows, a total of 1000ms, Then t1 (pin count plus one, the specific calculation is as follows:

    T0 adopts method 1, the initial value of counting x=2 16-(100*10 3 2)=10000h-c350h=3cb0h

    T1 adopts counting method 1, which is a 16-bit counting method and can count a large number of bits.

    Write the program yourself and give it to me.

  3. Anonymous users2024-02-04

    To set the 16-bit timing reader t0 or t1, the working mode, the maximum count value is 65536=0xffffh, that is, the initial value of the count th0(th1)=ffh, tl0=ffh is loaded into the high and low bits respectively, which can be set as an interrupt function, and the interrupt will be automatically triggered when the count overflows, and it can be called when the program is running

    Keyboard settings are everywhere, just search for them.

  4. Anonymous users2024-02-03

    The single-chip microcomputer outputs 50 rectangular pulses This is the program source code for 50 pulses. . .

  5. Anonymous users2024-02-02

    Is it Fang Bo? How much does the cycle cost? Please be more detailed.

  6. Anonymous users2024-02-01

    You all know it's easy, why not do it yourself?

    To give you an idea: first figure out the pulse frequency.

    You can capture the time when the pulse goes from high to low, and then you can capture the time when the low level changes to the high level, and the time required in between is a high time t, and the frequency is 1 2t

  7. Anonymous users2024-01-31

    Seriously agree with the opinion upstairs that the interrupt is used to do pulse counting, which is safe and reliable, and the pulse will not be lost. The processing of the four keys can be placed in front of the program, and after reading the state, the corresponding start, stop and other subroutines can be called.

  8. Anonymous users2024-01-30

    What kind of single-chip microcomputer do you use, this is too easy to get, you can do it with only a single-chip microcomputer, you want to interrupt the way to count, the falling edge triggers the interrupt, the input of the sensor control interrupt port, you can get it, a small part of my project is the switch pulse counting. The program will not be given to you, and if you don't understand the design patent, you can still ask.

  9. Anonymous users2024-01-29

    You don't need a counter, you can do it with a single-chip microcomputer.

  10. Anonymous users2024-01-28

    Give pins 1, 0 and 0 to pulse ,,, time is determined by demand.

  11. Anonymous users2024-01-27

    The single-chip microcomputer outputs 50 rectangular pulses This is the program source code for 50 pulses. . .

  12. Anonymous users2024-01-26

    Hello! Is it okay to output pulses from any port?

Related questions
16 answers2024-03-16

Scheduled interrupts, external interrupts?

9 answers2024-03-16

The method of using two timers is to use the timer t0 to control the frequency and the timer t1 to control the duty cycle. The general programming idea is as follows: the t0 timer interrupt makes an i0 port output high, and starts the timer t1 in the interrupt of the timer t0, and this t1 makes the io port output low, so that changing the initial value of timer t0 can change the frequency, and changing the initial value of timer t1 can change the duty cycle. >>>More

4 answers2024-03-16

The introductory course of MCU C language programming is not difficult, it is not easy to say, and the first thing to understand is to understand what these two things are when learning MCU C language? The introductory programming of single-chip microcomputer is mainly to learn C language, followed by circuit and programming language. >>>More

5 answers2024-03-16

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

5 answers2024-03-16

For how to learn single-chip microcomputer, I think it is still necessary to master its hardware, storage structure, assembly must be proficient, because the introduction of assembly is very helpful and understand the hardware, if you learn single-chip microcomputer, and then learn other, such as arm, at this time you can only be familiar with the assembly, but the first time to learn single-chip microcomputer, assembly, must be proficient, I mean at first do not use c to write programs, write with sinks, write can 10 20 assemblers, your assembly will go to the next level, In the future, you'll be using C for development, and you'll see how comfortable it is to optimize C with a solid foundation for assembly. Regarding the study of microcontrollers, I think it is necessary to have: >>>More