Question

Q1. Write a delay routine for 8051 to create a delay of approximately 1 ms. Q2....

Q1. Write a delay routine for 8051 to create a delay of approximately 1 ms.

Q2. Write a routine for 8051 to create a rectangular wave (on port 2, bit 1) of 66% duty cycle using the above delay routine.

Homework Answers

Answer #1

1.

Algorithm for a delay program of 1mS in 8051 timer :

1. Assume the processor is clocked by a 12KHz crystal.

2. Then the timer clock input will me 12KHz/12 = 1KHz.

3. hence the time taken for the timer to make one increment = 1mS

1 program for delay of 1mS DELAY: MOV R6,#250D MOV R7,#250D LABEL1: DJNZ R6,LABEL1 LABEL2: DJNZ R7,LABEL2 RET
2 GENERATING A RECTANGULAR WAVE OF 1mS /*pulse of 1mS is created on pin p1.0*/ #include<reg51.h> sbit pin=P1^0; void timer_delay(); int i; void main() {  TMOD=0X01; // MODE 1 OF TIMER O IS SELECTED     while(1)         {              pin=0;          timer_delay();          pin=1;          timer_delay(); } } void timer_delay() {         // time delay of 1mS using 12KHz crystal oscillator     TL0=0Xdb;       TH0=0Xff;       TR0=1;  while(!TF0);    TF0=0;  TR0=0; }
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write assembly code to create a 1 sec delay time by using Timer2?
Write assembly code to create a 1 sec delay time by using Timer2?
1) You have two charges; Q1 and Q2, and you move Q1 such that the potential...
1) You have two charges; Q1 and Q2, and you move Q1 such that the potential experienced by Q2 due to Q1 increases. Gravity should be ignored. Then, you must be: Moving Q1 closer to Q2 Moving Q1 further away from Q2 Moving in the same direction as the field due to Q1 Moving in the opposite direction to that of the field due to Q1 Any of the above 2) You move two point charges such that the potential...
Q1) Given the REVENUES of the 4 Hospitals in Jupiter: 1. Primary Care Services of Jupiter...
Q1) Given the REVENUES of the 4 Hospitals in Jupiter: 1. Primary Care Services of Jupiter ($20 million) 2. JFK Emergency Care ($40 million) 3. Palm Beach Gardens Medical Center ($80 million) 4. Jupiter Hospital (3x the revenue of Primary Care Services of Jupiter) Solve for the HHI of Jupiter area hospitals (rounded-off). A) 0.1 B) 0.3 C) 0.5 D) 0.6 E) 0.7 Q2) Assume the HHI of hospitals in Port St. Lucie = 0.35. Which region shows a greater...
particles 1 and 2 of charge q1 = q2 = 3.20 * 10^-19 C are on...
particles 1 and 2 of charge q1 = q2 = 3.20 * 10^-19 C are on a y axis at distance d = 0.17 m from the origin. Particle 2 is located below x axis at -.17m and particle 1 is above. Particle 3 of charge q3 = 6.40 * 10^-19 C is moved gradually along the x axis from x = 0 to x = 5.0 m. At what values of x will the magnitude of the electrostatic force...
write code using python or repl.it 1. List 4 attributes that you'd create for class "student"....
write code using python or repl.it 1. List 4 attributes that you'd create for class "student". 2. List 2 setters and 2 getters for class student including their parameters 3. Write the complete definition for class student including attributes and methods created above using the correct Python syntax. 4. Create one object of class student and print the values of all its attributes. You can either call the getter method or access the attribute directly using the dot notation.
javascript 1.Write a function delay that accepts two arguments, a callback and the wait time in...
javascript 1.Write a function delay that accepts two arguments, a callback and the wait time in milliseconds. Delay should return a function that, when invoked waits for the specified amount of time before executing. HINT - research setTimeout(); 2.Create a function saveOutput that accepts a function (that will accept one argument), and a string (that will act as a password). saveOutput will then return a function that behaves exactly like the passed-in function, except for when the password string is...
Suppose Liam’s utility function for ice cream (q1) and pumpkin pie (q2) is ?? = 10??1^0.5??2^0.5....
Suppose Liam’s utility function for ice cream (q1) and pumpkin pie (q2) is ?? = 10??1^0.5??2^0.5. His income is $1000. The price of a pumpkin pie is $5 and the price of ice cream is $10. Suppose the price of ice cream deceased from $10 to $5, measure the change in Liam’s consumer welfare using CV, EV, and ?CS.
Microprocessor 8086 material. Choose the correct answer. 1-A normal memory write bus cycle of 8086Mp takes...
Microprocessor 8086 material. Choose the correct answer. 1-A normal memory write bus cycle of 8086Mp takes _ clock cycles. * 4 5 6 2 3 2-Reading a word from the memory in one memory read cycle is possible if the required memory address is: * in the stack odd even in the data segment 3-To test bit 0 and bit 4 of (AX) in one step using TEST instruction, the destination and source must be: * AX, 10h AX, 12h...
This program is in C++: Write a program to allow the user to: 1. Create two...
This program is in C++: Write a program to allow the user to: 1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeID, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays . One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to...
Write a Java program using the OOP paradigm to do the following: 1. Main Function: create...
Write a Java program using the OOP paradigm to do the following: 1. Main Function: create a list with a million items, and you can use the generate function to add a million random values to the list. 2. Create a method to sort the list created in the main function using bubble sort, then use the sorted list to search for the (k) value using binary search. 3. Create a method to create a new list of 1000 items...