Final Term Microprocessor Fall 2021
Final Term Microprocessor Fall 2021
(a) Explain how to access and configure individual bit as input for 8051 application.
[2.5+2.5]
(b) Consider the following 8051 interfacing problem. Crystal frequency: 11.059MHz.The
relay coil is to be energized at an interval of 10 ms. Use timer routine to implement the
operation. [1+1+1+1+1]
DMH (Microprocessor) 1
iii) Construct the delay loop with appropriate timer flag setting
iv) Access and configure relevant pin as needed
v) Call back delay loop from the main function as needed
(b) Consider the following 8051 interfacing problem. Crystal frequency: 11.059MHz. The LED
D8 will light up with every key press as shown below. [1+1+1+1+1]
DMH (Microprocessor) 2
v) Call back action in the main function as needed
The delay between consecutive analog to digital conversion will be dynamically adjusted. If
the analog reading (Vanalog) goes >= VCC/2, delay is 40 ms while if goes <VCC/2 , delay is 20 ms
DMH (Microprocessor) 3
iv. Call back delay function in ADC routine as needed. The off time for WR is 10
ms as shown below
v. Conditional call back in main function as determined from the analog to digital
code conversion equation given below. You can use global variable
Hints:
inti,j ;
for(i=0;i<msec;i++)
Full scale = 5V
N=8 bits
N=8
DMH (Microprocessor) 4