0% found this document useful (0 votes)
10 views

8051

This lab report focuses on the 8051 microcontroller, detailing its features, applications, and programming examples. It includes code for generating a 50% duty cycle pulse, a 0-9 counter using a 7-segment display, and blinking an LED at different speeds. The report aims to familiarize students with the microcontroller's capabilities and practical applications in embedded systems.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

8051

This lab report focuses on the 8051 microcontroller, detailing its features, applications, and programming examples. It includes code for generating a 50% duty cycle pulse, a 0-9 counter using a 7-segment display, and blinking an LED at different speeds. The report aims to familiarize students with the microcontroller's capabilities and practical applications in embedded systems.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

NATIONAL COLLEGE OF ENGINEERING

(Affiliated to Tribhuvan University)

Talchhikhel, Lalitpur

A LAB REPORT ON
8051 MICROCONTROLLER

Submitted by: Submitted to:

Name: Arudhi Bohora Department of Electronics and


Computer Engineering
Roll No: 06
Date: 2081/11/06
Title: A lab on 8051 Microcontroller

Objectives:

 To get familiarize with 8051 microcontroller features.

Theory

The 8051 microcontroller is an 8-bit microcontroller developed by Intel in 1980, widely used in
embedded systems due to its simplicity and efficiency. It features 4KB of ROM, 128 bytes of RAM, 32
general-purpose I/O pins, two timers/counters, and a serial communication interface. With its Harvard
architecture, it can process instructions and data separately, enhancing performance. The 8051 also
supports interrupt handling, making it suitable for real-time applications. Due to its low power
consumption, ease of programming, and versatility, it is commonly used in automation, robotics,
industrial control systems, and consumer electronics.

1. WAP to generate a 50% duty cycle pulse using a PIN


2.3 of microcontroller

CODE:

ORG 00H

CLR P2.3

BACK:

CLR P2.3

LCALL DELAY

SETB P2.3

LCALL DELAY

SJMP BACK

ORG 300H

DELAY:
MOV R5, #64H

AGAIN:

MOV R4, #0FFH

AGAN:

MOV R3, #08H

AGA:

DJNZ R3, AGA

DJNZ R4, AGAN

DJNZ R5, AGAIN

RET

END

OUTPUT:
2. WAP to generate a 0-9 counter using a 7-segment
display.
CODE:

MOV P2, #00H


BACK:
MOV P2, #3FH
LCALL DELAY
MOV P2, #06H
LCALL DELAY
MOV P2, #5BH
LCALL DELAY
MOV P2, #4FH
LCALL DELAY
MOV P2, #66H
LCALL DELAY
MOV P2, #6DH
LCALL DELAY
MOV P2, #7DH
LCALL DELAY
MOV P2, #07H
LCALL DELAY
MOV P2, #7FH
LCALL DELAY
MOV P2, #6FH
LCALL DELAY
SJMP BACK
ORG 300H
DELAY:
MOV R5, #64H
AGAIN: MOV R4, #0FFH
AGAN: MOV R3, #08H
AGA: DJNZ R3, AGA
DJNZ R4, AGAN
DJNZ R5, AGAIN
RET
END
3. WAP to blink the LED with different speed.
CODE:

ORG 00H
CLR P1.1
SETB P2.1
SETB P2.2
FAST: MOV C, P2.1
JNC SLOW
SETB P1.1
LCALL DELAY
CLR P1.1
LCALL DELAY
SLOW: MOV C, P2.2
JNC FAST
SETB P1.1
LCALL DELAY
LCALL DELAY
CLR P1.1
LCALL DELAY
LCALL DELAY
SJMP FAST
ORG 300H
DELAY: MOV R5, #64H
AGAIN: MOV R4, #0FFH
AGAN: MOV R3, #08H
AGA: DJNZ R3, AGA
DJNZ R4, AGAN
DJNZ R5, AGAIN
RET
END

You might also like