Skip to main content

Time Delays in 8051 C

 Time Delays in 8051 C

Micro controller / electric engineering.


We can create time delay in 8051 C by two ways:


Using for loop statement


. Using the 8051 timers


We cannot get the exact delays using simple for loops because of following reasons:


1. The instruction execution speed varies according to the number of clock periods per machine cycle. The different variants of 8051 microcontroller use different clock periods per machine cycle.


2. The crystal frequency connected to the X₁-X₂ input pins. The duration of the clock period for the machine cycle is a function of this crystal frequency.


3. In case of C programs, it is the C compiler that converts the C statements and functions to assembly language instructions. As a result different compilers produce different code and hence instructions executed in a loop may vary with different compilers.

Comments

Popular posts from this blog

What is two transistor model of scr ? Explain SCR

  Power electronics Two Transistor Model of SCR full explain and pdf. Basic operating principle of SCR, can easily be understood by the two transistor model of SCR , as it is a combination of p and n layers. This is a pnpn thyristor. If we bisect it through the dotted line then we will get two transistors i.e. one pnp transistor with J 1 and J 2 junctions and another is with J 2 and J 3 junctions as shown in figure below. The relation between the collector current and emitter current is shown below Here, I C is collector current, I E is emitter current, I CBO is forward leakage current, α is common base forward current gain and relationship between I C and I B is Where, I B is base current and β is common emitter forward current gain. Let’s for transistor T 1 this relation holds And that for transistor T 2 Now, by the analysis of two transistors model we can get anode current, From equation (i) and (ii), we get, If applied gate current is I g then cathode current will b...

Addition of vector :- electromagnetic fields , review of vector

 Explain about addition of vector. Consider two coplanar vectors as shown in the fig The vectors which lie in the same plane are called coplanar vectors. Let us find the sum of these two vectors Ā and B The procedure is to move one of the two vectors parallel to itself at the tip of the other vector. Thus move Ā  parallel to itself at the tip of B. Then join tip of A moved, to the origin. This vector represents resultant which is the addition of the two vectors A and B. This is shown in the Fig. 1.4.2. Let us denote this resultant as then It must be remembered that the direction of C is from origin O to the tip of the vector moved. Another point which can be noticed that if B is moved parallel to itself at the tip of A, we get the same resultant C Thus, the order of the addition is not important. The addition of vectors obeys the commutative law ie. A+B=B+A. Another method of performing the addition of vectors is the parallelogram rule. Complete the parallelogram as shown in t...

What is unit vector :- explain unit vector

Electromagnetic fields Unit vector- A unit vector has a function to indicate the direction. Its magnitude is always unity, irrespective of the direction which it indicates and the co-ordinate system under consideration. Thus for any vector, to indicate its direction a unit vector can be used. Consider a unit vector āoA in the direction of OA as shown in o the Fig. This vector indicates the direction of OA but its magnitude is unity. Fig Unit vector aOA So vector OA can be represented completely as its magnitude R and the direction indicated by unit vector along its direction. ŌĀ = |OA| āOA =R āOA āOA=1