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...
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...
1. Consider the following interface: interface Duty { public String getDuty(); } a. Write a class...
1. Consider the following interface: interface Duty { public String getDuty(); } a. Write a class called Student which implements Duty. Class Student adds 1 data field, id, and 2 methods, getId and setId, along with a 1-argument constructor. The duty of a Student is to study 40 hours a week. b. Write a class called Professor which implements Duty. Class Professor adds 1 data field, name, and 2 methods, getName and setName, along with a 1-argument constructor. The duty...
1.      Create 100 text files automatically; in each file write a random number from 1 to 10....
1.      Create 100 text files automatically; in each file write a random number from 1 to 10. Use outputstreams (fileoutputstream, buffredwriter….) 2.      Read the content of the 100 files and combine them into a 1 single file. 3.      Write java code to do the following: a.      To write the following text into a text file EEEESAAA@23SDCFSAWERF%WASDFGHWERTRQW b.      Read the file using a java program c.      Find how many D’s in the file d.      Extract the text between the @ and the # 1. Create 100 text files...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT