Question: (b) Write An ASM Code In Microcontroller 8051 For Basic Timer Which Counts From 0500 H - 05FF H Using Timer 0.Estimate The Time Wasted With Detailed Calculation In EEE And CSE Labels Of NSU Sub-routine For The Following ASM Code, Given That Microcontroller 8051 Is Connected With 16 MHz Oscillator.This question hasnt been answered yet Ask an expert Question is not incomplete, please answer.Estimate the time wasted with detailed calculation in EEE and CSE labels of NSU sub-routine for the following ASM code, given that microcontroller 8051 is connected with 16 MHz oscillator.
NSU Sub-Routine MOV RO, 90 EEE: MOV R1, 50 H CSE: MOV R2, 10101011 B ETE: NOP Machine Cycle(s) 2 2 2 1 Page 2 3 1 1 NOP NOP DJNZ R2, ETE DJNZ R1, CSE DJNZ RO, EEE RET 3 3 3 2. 8051 Timer Calculation Software Loops HaveGenerating delay using pure software loops have been already discussed here but such delays are poor in accuracy and cannot be used in sensitive applications. Delay using timer is the most accurate and surely the best method. When the counter is running on the processors clock, it is called a Timer, which counts a predefined number of processor clock pulses and generates a programmable delay. ![]() That means for an 8051 running at 12MHz, the timer clock input will be 1MHz. That means the the timer advances once in every 1uS and the maximum time delay possible using a single 8051 timer is ( 216) x (1S) 65536S. ![]() We will see all these in detail in next sections of this article. Also you can put this in a loop for creating longer time delays (multiples of 1mS). Here Timer 0 of 8051 is used and it is operating in MODE1 (16 bit timer). HERE: JNB TF0,HERE Loops here until TF0 is set (ie;until roll over). The programmer must clear the TR bit in order to stop the timer. Write up a delay subroutine with delay equal to half the time period of the square wave. ![]() The result will be a square wave of the desired frequency at the selected port pin. The circuit diagram is shown below and it can be used for any square wave, but the program has to be accordingly. Programs for different square waves are shown below the circuit diagram. Our webiste has thousands of circuits, projects and other information you that will find interesting.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |