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

Programming using On – Chip ports in 8051

The document outlines a laboratory experiment for programming digital input and output ports using the 8051 microcontroller. It includes the aim, required hardware, algorithms, flowcharts, and assembly language programs for both digital outputs and inputs. The experiment focuses on configuring Port 1 for output and input operations, with sample code provided for each functionality.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Programming using On – Chip ports in 8051

The document outlines a laboratory experiment for programming digital input and output ports using the 8051 microcontroller. It includes the aim, required hardware, algorithms, flowcharts, and assembly language programs for both digital outputs and inputs. The experiment focuses on configuring Port 1 for output and input operations, with sample code provided for each functionality.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ET3491 Embedded Systems and IoT Design

Exp.No:
Programming using On–Chip ports in 8051
Date:

Aim
To write an assembly language program to use digital input and digital output ports
of 8051 microcontroller.

Software/Hardware Required:
 8051 Microcontroller Kit

Algorithm
Digital Outputs using Port 1:

Digital Inputs using Port 1:

TPGIT ECE Page No:


ET3491 Embedded Systems and IoT Design

Flowchart

Digital Outputs using Port 1:

Digital Inputs using Port 1:

TPGIT ECE Page No:


ET3491 Embedded Systems and IoT Design

PROGRAM
Digital Outputs using Port 1:
Label Mnemonics Comments
MOV P1,#00 Configure Port 1 as Output
MOV P1,#55 Output 0s and 1s alternatively on P1
HERE: SJMP HERE Loop here continuously

Digital Inputs using Port 1:


Label Mnemonics Comments
MOV P1,#FF Configure Port 1 as Input
MOV A,P1 Read Port 1 and store in accumulator
MOV DPTR,#4150H Initialise Data Pointer
MOVX @DPTR,A Move accumulator to data memory
HERE: SJMP HERE Loop here continuously

Output:
Address Data
4150H

Result

TPGIT ECE Page No:


ET3491 Embedded Systems and IoT Design

TPGIT ECE Page No:

You might also like