Vous êtes sur la page 1sur 1

WALCHAND INSTITUTE OF TECHNOLOGY, SOLAPUR

Electronics & Telecommunication Engineering


Assignment 2
Subject: MCR-I(8051)
Q 1. Write programs for the following.
1. Write a program to perform the following:
(a) Keep monitoring the P1.2 bit until it becomes high
(b) When P1.2 becomes high, write value 45H to port 0
(c) Send a high-to-low (H-to-L) pulse to P2.3
2. Write an 8051 C program to convert ASCII digits of ‘4’ and ‘7’ to
packed BCD and display them on P1.
3. Write an 8051 C program to convert 11111101 (FD hex) to decimal
and display the digits on P0, P1 and P2.
4. Draw LED, Key and Buzzer interfacing to the Microcontroller and write a program to on-off LED when key
is open and on-off Buzzer when key is closed
5. Draw LCD interfacing to the microcontroller and write a program to Display message “Welcome” on it.
6. Assume that register A has packed BCD, write a program to convert packed BCD to two ASCII numbers and
place them in R2 and R6.
7. Draw DAC0808 interfacing to the microcontroller and write a program to generate triangular Waveform.
8. Draw Matrix Keyboard interfacing to the microcontroller and write a program to Display key code on LCD
Display
9. Draw ADC Interfacing to the microcontroller and write a program to Display message Digital conversion
using 8 Led Bar
10. Write an 8051 C program to calculate the checksum byte for the data 25H, 62H, 3FH, and 52H.

Q2 Complete the table by filling all the blank missing fields. Table Columns are Instruction Mnemonic,
Description of Instruction, No. of bytes required, No. of machine cycles required and Flag bits affected
(Carry, Overflow and Auxiliary carry with Y if bit affected and N otherwise)
(Refer: http://vlabs.iitb.ac.in/vlabs-dev/labs_local/8051-Microcontroller-Lab/src/pdfs-docs/8051IS.pdf)
Instruction Description Bytes Machine C OV AC
cycle
DA A
ANL C,/bit
MOVC A,@A+DPTR
INC direct
Add A,R0
SUBB A, #data
CJNE @Rp,#n, radd
MUL AB
MOV 09H,02H
SWAP A
Q3 Explain the operation of following instructions. (Refer: http://vlabs.iitb.ac.in/vlabs-dev/labs_local/8051-
Microcontroller-Lab/src/pdfs-docs/8051IS.pdf)
PUSH, RET, CALL, SJMP rel8
Q4 Draw register format and Explain the significance of various bits for the following registers
TCON: Timer control register TMOD: Timer mode control register
IE: Interrupt Enable register IP: Interrupt Priority Register.
Q5 Find the size of the delay in following program, if the crystal frequency is 11.0592MHz.
DELAY: MOV R2,#200
AGAIN: MOV R3,#250
HERE: NOP
NOP
DJNZ R3,HERE
DJNZ R2,AGAIN 2
RET
_________________________________________________________________________________________

Vous aimerez peut-être aussi