Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Delay control subroutine commonly used in 51 single chip microcomputer

Shulou Source: shulou.com Published: 2022-06-02 05:09:17 09月29日 Update

This article mainly explains "51 single-chip microcomputer commonly used delay control subroutine", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn the "51 single-chip microcomputer commonly used delay control subroutine" it!

Delay control by programming

1. The raising of a question

Through programming, the single-chip microcomputer produces a delay of about 10ms and about 0.5s respectively. The crystal oscillator frequency of single chip microcomputer is 12MHz. Because the crystal frequency of the single chip microcomputer is 12MHz, the time of one machine cycle of the single chip microcomputer is 1 μ s.

two。 Control program

(1) 10ms delay program.

The actual delay time of this program is: 1 + (1 × 2 × 250 × 2) × 20=10.061ms

(2) 0.5s delay program.

Description: in the program, the symbol "; program start *" is used to indicate the beginning of the program, the symbol "; program end *" is used to indicate the end of the program, and "; -" is used to separate the various stages of the program in order to make the program organized and intuitive. These symbols can be input into Keil μ Vision3 software to compile at the same time. The following procedures are the same.

At this point, I believe that everyone on the "51 single-chip microcomputer commonly used delay control subroutine" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Program single chip microcomputer control subroutine common use symbol content actual time frequency crystal oscillator learning programming practical deeper intuitive control program middle use interest at the same time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno macOS MariaDB NVidia