Pc-Ee-692 Lab
Pc-Ee-692 Lab
Pc-Ee-692 Lab
16. Data Transfer from Peripheral to Memory using DMA Controller 8237/8257
Experiment Title: 16-bit Arithmetic Operations for 8086 Microprocessor
Objectives:
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheet for the 8086 microprocessor
Procedure:
; Subtraction program
SUB AX, BX ; Subtract BX from AX
MOV [RESULT_SUB], AX ; Store result in memory address RESULT_SUB
; Multiplication program
MOV AX, 1234H ; Load multiplicand
MOV BX, 5678H ; Load multiplier
MUL BX ; Multiply AX by BX
MOV [RESULT_MUL], AX ; Store result in memory address RESULT_MUL
; Division program
MOV AX, 5678H ; Load dividend (AX)
MOV BX, 1234H ; Load divisor (BX)
DIV BX ; Divide AX by BX
MOV [RESULT_DIV], AX ; Store quotient in memory address RESULT_DIV
MOV [RESULT_MOD], DX ; Store remainder in memory address RESULT_MOD
RESULT_SUB DW ?
RESULT_MUL DW ?
RESULT_DIV DW ?
RESULT_MOD DW ?
1. Record Observations:
o Document the source code, including comments explaining each instruction and
addressing mode used.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding the implementation of 16-bit
arithmetic operations with various addressing modes on the 8086 microprocessor.
o Discuss the importance of understanding addressing modes in optimizing code
efficiency and flexibility.
Notes:
Adjust memory addresses and data values according to your specific setup and
requirements.
Ensure thorough testing and validation of each arithmetic operation to verify correctness.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
16-bit arithmetic operations on the 8086 microprocessor, utilizing different addressing modes
effectively. This knowledge is essential for understanding microprocessor architecture and
developing skills in assembly language programming for embedded systems.
Objectives:
1. To implement the bubble sort algorithm for sorting an array on the 8086 microprocessor.
2. To understand the process of sorting and its implementation in assembly language.
3. To verify the correctness of the sorting algorithm through testing and debugging.
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheet for the 8086 microprocessor
Procedure:
; Data segment
DATA_SEG SEGMENT
ARRAY DB 6, 2, 8, 1, 3, 9 ; Example array to be sorted
ARRAY_SIZE equ $ - ARRAY ; Calculate size of array
DATA_SEG ENDS
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
; Swap elements
MOV BL, ARRAY[DI] ; Load ARRAY[DI] into BL
MOV ARRAY[DI], ARRAY[DI - 1] ; Move ARRAY[DI - 1] to ARRAY[DI]
MOV ARRAY[DI - 1], BL ; Move BL to ARRAY[DI - 1]
NoSwap:
DEC DI ; Decrement DI for next comparison
LOOP InnerLoop ; Repeat inner loop until CX = 0
; Terminate program
MOV AH, 4CH ; DOS function to terminate program
INT 21H ; Call DOS interrupt
CODE_SEG ENDS
END START
1. Record Observations:
o Document the source code with comments explaining each instruction and the
overall flow of the bubble sort algorithm.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding the implementation of the bubble
sort algorithm on the 8086 microprocessor.
o Discuss the efficiency of bubble sort and considerations for sorting larger arrays
or optimizing sorting algorithms.
Notes:
Adjust the ARRAY values and array size (ARRAY_SIZE) according to your specific
requirements and testing scenarios.
Ensure thorough testing and validation of the sorting algorithm to verify correctness and
efficiency.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and understanding sorting algorithms on the 8086 microprocessor, using assembly language to
manipulate and sort data efficiently. This knowledge is crucial for understanding algorithmic
complexity and implementing efficient algorithms in low-level programming environments.
Objectives:
1. To implement a program that searches for a specific number or character in a string using
the 8086 microprocessor.
2. To understand the concept of string manipulation and searching techniques in assembly
language.
3. To verify the correctness of the search algorithm through testing and debugging.
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheet for the 8086 microprocessor
Procedure:
; Data segment
DATA_SEG SEGMENT
STRING DB 'Hello, World!', '$' ; Example string to search (null-terminated)
SEARCH_CHAR DB 'o' ; Character to search for
FOUND DB 0 ; Flag to indicate if character is found (0 = not found, 1 =
found)
DATA_SEG ENDS
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
SearchLoop:
MOV AL, STRING[SI] ; Load character from string into AL
CMP AL, '$' ; Check for end of string
JE EndSearch ; Exit loop if end of string ('$' found)
; Character found
MOV FOUND, 1 ; Set FOUND flag to indicate character found
JMP EndSearch ; Exit loop
NotFound:
INC SI ; Increment SI to next character in string
LOOP SearchLoop ; Repeat loop until CX = 0
EndSearch:
; Check if character was found
CMP FOUND, 1
JE CharacterFound ; Jump if character was found
MOV AH, 09H ; Print string function
LEA DX, notFoundMsg ; Load address of message into DX
INT 21H ; Call DOS interrupt to print message
JMP EndProgram ; Jump to end program
CharacterFound:
MOV AH, 09H ; Print string function
LEA DX, foundMsg ; Load address of message into DX
INT 21H ; Call DOS interrupt to print message
EndProgram:
; Terminate program
MOV AH, 4CH ; DOS function to terminate program
INT 21H ; Call DOS interrupt
CODE_SEG ENDS
END START
1. Record Observations:
o Document the source code with comments explaining each instruction and the
overall flow of the search algorithm.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding the implementation of the search
algorithm for finding a character in a string on the 8086 microprocessor.
o Discuss the efficiency of the algorithm and considerations for searching larger
strings or optimizing search algorithms.
Notes:
Adjust the STRING and SEARCH_CHAR values according to your specific
requirements and testing scenarios.
Ensure thorough testing and validation of the search algorithm to verify correctness and
efficiency.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and understanding string manipulation and searching algorithms on the 8086 microprocessor.
This knowledge is essential for understanding assembly language programming and its
applications in embedded systems and low-level programming environments.
Objectives:
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheet for the 8086 microprocessor
Procedure:
; Data segment
DATA_SEG SEGMENT
STRING DB 'Hello, World!', '$' ; Example string (null-terminated)
STR_LEN DW ? ; Variable to store string length
DATA_SEG ENDS
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
EndLoop:
DEC CX ; Adjust CX to exclude '$' from count
MOV STR_LEN, CX ; Store string length in STR_LEN
Objectives:
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
RTC IC (e.g., DS1307) and necessary interfacing components (crystal, capacitors, pull-
up resistors)
Digital display unit (7-segment LED display)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheets for the 8086 microprocessor and RTC IC
Procedure:
1. Program Structure:
; Data segment
DATA_SEG SEGMENT
RTC_ADDRESS equ 070H ; RTC address (example for DS1307)
RTC_DATA equ 071H ; RTC data
HOUR DB ?
MINUTE DB ?
SECOND DB ?
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
DisplayLoop:
; Read current time from RTC
CALL READ_RTC
RET
INIT_RTC ENDP
RET
READ_RTC ENDP
CODE_SEG ENDS
END START
1. Record Observations:
o Document the source code with comments explaining each instruction and
subroutine used.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding the implementation of the digital
clock using the 8086 microprocessor.
o Discuss the challenges faced, optimizations made, and the overall functionality
and accuracy of the digital clock design.
Notes:
Adjust the RTC interface code (INIT_RTC and READ_RTC procedures) according to
the RTC IC used (e.g., DS1307).
Ensure proper connection and interfacing of the RTC IC and digital display unit with the
8086 microprocessor.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and interfacing with external devices (RTC and digital display) using the 8086 microprocessor.
This knowledge is crucial for understanding real-time applications and embedded systems
programming in assembly language.
Experiment Title: Interfacing ADC and DAC to 8086 Microprocessor
Objectives:
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
ADC IC (e.g., ADC0804) and necessary interfacing components (capacitors, resistors)
DAC IC (e.g., DAC0800) and necessary interfacing components (op-amps, resistors)
Oscilloscope (optional for signal observation)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheets for the ADC, DAC, and 8086 microprocessor
Procedure:
1. Program Structure:
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
CODE_SEG ENDS
END START
1. Record Observations:
o Document the source code with comments explaining each instruction and
subroutine used.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding the interfacing of ADC and DAC
to the 8086 microprocessor.
o Discuss the functionality, accuracy, and limitations observed during ADC to DAC
data transfer.
Notes:
Adjust the ADC and DAC interface code (INIT_ADC, READ_ADC, WRITE_DAC
procedures) according to the specific ADC (e.g., ADC0804) and DAC (e.g., DAC0800)
ICs used.
Ensure proper connection and interfacing of ADC and DAC with the 8086
microprocessor.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and interfacing analog-to-digital and digital-to-analog conversion circuits with the 8086
microprocessor. This knowledge is essential for understanding embedded systems and signal
processing applications using assembly language programming.
Objectives:
Equipment Needed:
Two microprocessor trainer kits or simulator software (e.g., DOSBox with TASM)
Two 8255 ICs (Programmable Peripheral Interface)
Interconnecting wires and breadboard (if using physical trainer kits)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheets for the 8255 IC and microprocessors
Procedure:
1. Program Structure:
; Data segment
DATA_SEG SEGMENT
PORT_A equ 0200H ; Port A base address
PORT_B equ 0201H ; Port B base address
PORT_C equ 0202H ; Port C base address
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
CODE_SEG ENDS
END START
1. Record Observations:
o Document the source code with comments explaining each instruction and
subroutine used.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding parallel communication between
two microprocessors using the 8255 IC.
o Discuss the functionality, reliability, and potential applications of parallel
communication in embedded systems.
Notes:
Adjust the port addresses (PORT_A, PORT_B, PORT_C) and control word
(CW_MODE1) according to the specific configuration and connections of the 8255 ICs.
Ensure proper connection and interfacing of 8255 ICs with the microprocessors.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in configuring and
utilizing the 8255 IC for parallel communication between microprocessors, enhancing your
understanding of embedded systems and parallel data transfer techniques.
Objectives:
1. To establish serial communication between two microprocessor kits using the 8251
USART.
2. To configure the 8251 IC in both transmitter and receiver modes for data transmission.
3. To understand the concept of serial communication protocols (asynchronous or
synchronous) and data framing.
4. To verify the reliability and efficiency of serial communication using the 8251 IC.
Equipment Needed:
Two microprocessor trainer kits or simulator software (e.g., DOSBox with TASM)
Two 8251 ICs (Universal Synchronous/Asynchronous Receiver Transmitter)
MAX232 or equivalent IC for RS232 voltage level conversion (if using physical trainer
kits)
Interconnecting wires and breadboard (if using physical trainer kits)
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Reference materials or datasheets for the 8251 IC and microprocessors
Procedure:
1. Program Structure:
; Program for Serial Communication between Two Microprocessor Kits using 8251
; Data segment
DATA_SEG SEGMENT
PORT_A equ 0200H ; Base address for 8251 port A (data register)
PORT_B equ 0201H ; Base address for 8251 port B (control/status register)
; Define control word for 8251 initialization (8 data bits, 1 stop bit, no parity)
CW_INIT DB 98H ; 10011000 in binary (B7-B5 = 100 for 8 data bits, B2-B1 = 01
for 1 stop bit)
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
1. Record Observations:
o Document the source code with comments explaining each instruction and
subroutine used.
o Record the results observed during debugging, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding serial communication between
two microprocessors using the 8251 IC.
o Discuss the functionality, reliability, and potential applications of serial
communication in embedded systems.
Notes:
Adjust the port addresses (PORT_A, PORT_B) and control word (CW_INIT) according
to the specific configuration and connections of the 8251 ICs.
Ensure proper connection and interfacing of 8251 ICs with the microprocessors.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in configuring and
utilizing the 8251 USART for serial communication between microprocessor kits, enhancing
your understanding of communication protocols and data transfer techniques in embedded
systems.
Objectives:
Equipment Needed:
8086 microprocessor trainer kit or simulator software (e.g., DOSBox with TASM)
Stepper motor (e.g., 4-wire, 5-wire, or 6-wire stepper motor)
Stepper motor driver circuit (e.g., ULN2003, L298N)
Power supply suitable for stepper motor and driver circuit
Personal computer with assembler and debugger tools (e.g., TASM, DEBUG)
Breadboard and interconnecting wires
Datasheets for stepper motor, driver circuit, and 8086 microprocessor
Procedure:
1. Program Structure:
; Data segment
DATA_SEG SEGMENT
PORT_DATA EQU 0200H ; Base address for data port
PORT_CTRL EQU 0201H ; Base address for control port
; Code segment
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX
RotateCW:
; Send step signal
MOV AL, STEP_SIGNAL
OUT PORT_CTRL, AL
; Delay for motor step
CALL DELAY
CODE_SEG ENDS
END START
2. Explanation of the Stepper Motor Control Program:
o Data Segment: Defines port addresses (PORT_DATA, PORT_CTRL) for
stepper motor control, signals (STEP_SIGNAL, DIRECTION_SIGNAL) for
driver circuit, and variables (DELAY_COUNT, STEPS_PER_REV) for
controlling motor movement.
o Code Segment: Implements the main program (START) to initialize ports, rotate
the stepper motor clockwise (RotateCW loop), and toggle direction for continuous
rotation.
o Subroutines: Includes subroutines (INIT_PORTS for port initialization, DELAY
for delay loop) to manage stepper motor control and timing.
o Stepper Motor Control: Uses output instructions (OUT) to send step and
direction signals to the stepper motor driver circuit, controlling motor rotation.
1. Record Observations:
o Document the source code with comments explaining each instruction and
subroutine used.
o Record the results observed during testing, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding interfacing and programming to
control a stepper motor with the 8086 microprocessor.
o Discuss the functionality, accuracy, and applications of stepper motor control in
embedded systems.
Notes:
By conducting this lab manual experiment, you will gain practical experience in interfacing and
programming to control a stepper motor with the 8086 microprocessor, enhancing your
understanding of motor control techniques and embedded systems design.
Objectives:
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
Personal computer with assembler and debugger tools (e.g., Keil C51, SDCC)
Breadboard and interconnecting wires (if using physical trainer kit)
Reference materials or datasheets for 8051 microcontroller
Experiment Procedure:
1. Arithmetic Instructions:
2. Logical Instructions:
; Data segment
ORG 00H
MOV A, #0A5H ; Load accumulator with 0A5H (binary 10100101)
ANL A, #0F0H ; Perform bitwise AND with 0F0H (binary 11110000)
MOV R0, A ; Store result in R0
; Example: Display or use result stored in R0
; Add more logical instructions as needed
; Data segment
ORG 00H
MOV A, #0FFH ; Load accumulator with all bits set (11111111)
CLR A.0 ; Clear bit 0
SETB A.1 ; Set bit 1
CPL A.2 ; Complement bit 2
MOV R0, A ; Store result in R0
; Example: Display or use result stored in R0
; Add more bit manipulation instructions as needed
1. Record Observations:
o Document the source code with comments explaining each instruction and its
purpose.
o Record the results observed during testing, noting any deviations or errors
encountered.
2. Conclusion:
o Summarize the experiment's findings regarding programming with arithmetic,
logical, and bit manipulation instructions of the 8051 microcontroller.
o Discuss the importance of these instructions in microcontroller programming and
their applications in embedded systems.
Notes:
Adjust the examples and specific instructions (ADD, ANL, CLR, SETB, etc.) based on
your learning objectives and curriculum requirements.
Ensure familiarity with the 8051 microcontroller architecture and instruction set before
proceeding with programming exercises.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
using arithmetic, logical, and bit manipulation instructions of the 8051 microcontroller,
enhancing your skills in microcontroller programming and embedded systems development.
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
Personal computer with assembler and debugger tools (e.g., Keil C51, SDCC)
Breadboard and interconnecting wires (if using physical trainer kit)
Oscilloscope (optional for advanced verification)
Reference materials or datasheets for 8051 microcontroller
Experiment Procedure:
; Data segment
ORG 00H
MAIN:
MOV R0, #100 ; Load R0 with delay count (adjust for desired delay)
DelayLoop:
NOP ; Adjust NOPs for desired delay
NOP
NOP
DJNZ R0, DelayLoop ; Decrement R0 and loop until zero
; Example: Proceed with main program after delay
; Add more instructions as needed
; Data segment
ORG 00H
MAIN:
MOV TMOD, #01H ; Set Timer 0 in mode 1 (16-bit timer)
MOV TH0, #0FFH ; Load initial value for Timer 0 (adjust as needed)
MOV TL0, #0FFH ; Load initial value for Timer 0 (adjust as needed)
SETB TR0 ; Start Timer 0
1. Record Observations:
Document the source code with comments explaining each Timer/Counter
o
operation and its purpose.
o Record the results observed during testing, including any delays generated or
events counted.
2. Conclusion:
o Summarize the experiment's findings regarding Timer/Counter operations in the
8051 microcontroller.
o Discuss the importance of precise timing in microcontroller applications and the
role of Timer/Counter in embedded systems.
Notes:
Adjust the examples and specific Timer/Counter configurations (TMOD, TH0, TL0,
TR0, TF0) based on your learning objectives and curriculum requirements.
Ensure familiarity with Timer/Counter modes and interrupts of the 8051 microcontroller
before proceeding with programming exercises.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and verifying Timer/Counter operations in the 8051 microcontroller, enhancing your skills in
embedded systems development and precise timing control.
Objectives:
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
Personal computer with assembler and debugger tools (e.g., Keil C51, SDCC)
Breadboard and interconnecting wires (if using physical trainer kit)
Oscilloscope (optional for advanced verification)
Reference materials or datasheets for 8051 microcontroller
Experiment Procedure:
Step 1: Setup and Initialization
; Data segment
ORG 00H
; Code segment
External_ISR:
; Interrupt service routine for external interrupt 0 (INT0)
; Example: Toggle LED or perform actions upon INT0 interrupt
; Clear interrupt flag and exit ISR
RETI
; Data segment
ORG 00H
; Code segment
Timer_ISR:
; Interrupt service routine for Timer 0 interrupt
; Example: Generate periodic task or update variables on Timer 0 interrupt
; Clear interrupt flag and exit ISR
RETI
1. Record Observations:
o Document the source code with comments explaining each interrupt handling
routine and its purpose.
o Record the results observed during testing, including ISR execution upon
interrupt events.
2. Conclusion:
o Summarize the experiment's findings regarding interrupt handling in the 8051
microcontroller.
o Discuss the significance of interrupt priority, vector addresses, and ISR execution
flow in embedded systems.
Notes:
Adjust the examples and specific interrupt configurations (ORG addresses, LJMP to
ISRs) based on your learning objectives and curriculum requirements.
Ensure familiarity with interrupt sources (INT0, Timer 0), interrupt enable (IE register),
and interrupt vector table (IVT) of the 8051 microcontroller.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and verifying interrupt handling in the 8051 microcontroller, enhancing your skills in real-time
event processing and embedded systems development.
Experiment Title: UART Operation in 8051
Objectives:
1. To understand the UART communication protocol and its implementation in the 8051
microcontroller.
2. To program UART transmit and receive operations for serial communication.
3. To verify the functionality of UART communication through practical experimentation.
4. To gain proficiency in using UART-related registers and settings of the 8051
microcontroller.
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
Personal computer with UART terminal software (e.g., PuTTY, Tera Term)
Breadboard and interconnecting wires (if using physical trainer kit)
Oscilloscope (optional for advanced verification)
Reference materials or datasheets for 8051 microcontroller and UART communication
Experiment Procedure:
; Data segment
ORG 00H
MAIN:
MOV A, #'A' ; Load character to transmit
MOV SBUF, A ; Send character via UART
; Data segment
ORG 00H
1. Record Observations:
o Document the source code with comments explaining each UART operation and
its purpose.
o Record the results observed during testing, including successful transmission and
reception of data.
2. Conclusion:
o Summarize the experiment's findings regarding UART operation in the 8051
microcontroller.
o Discuss the importance of UART communication in embedded systems and
applications.
Notes:
Adjust the examples and specific UART configurations (SCON, SBUF, baud rate) based
on your learning objectives and curriculum requirements.
Ensure proper UART pin connections and settings (baud rate, data bits, parity, stop bits)
between the 8051 microcontroller and UART terminal.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in programming
and verifying UART operation in the 8051 microcontroller, enhancing your skills in serial
communication and embedded systems development.
Experiment Title: Interfacing LCD to 8051
Objectives:
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
Personal computer with assembler and debugger tools (e.g., Keil C51, SDCC)
LCD module (16x2 or as per specification)
Potentiometer (for contrast adjustment, if required)
Breadboard and interconnecting wires (if using physical trainer kit)
Reference materials or datasheets for 8051 microcontroller and LCD module
Experiment Procedure:
1. Initialization Sequence:
; LCD commands
CLR_DISP EQU 01H ; Clear display command
HOME_DISP EQU 02H ; Return home command
; Data segment
ORG 00H
LCD_CMD:
MOV RS, #0 ; RS = 0 for command register
MOV RW, #0 ; RW = 0 for write operation
MOV DATA_PORT, A ; Send command to data port
SETB EN ; Enable pulse
CLR EN
ACALL DELAY ; Adjust delay for LCD response time
RET
DELAY:
; Adjust delay for LCD initialization
MOV R1, #30
DLY_LOOP:
DJNZ R1, DLY_LOOP
RET
; Main program
MAIN:
ACALL INIT_LCD ; Initialize LCD
; Example: Display text on LCD
MOV A, #'H'
ACALL LCD_DATA ; Display 'H' on LCD
MOV A, #'E'
ACALL LCD_DATA ; Display 'E' on LCD
MOV A, #'L'
ACALL LCD_DATA ; Display 'L' on LCD
MOV A, #'L'
ACALL LCD_DATA ; Display 'L' on LCD
MOV A, #'O'
ACALL LCD_DATA ; Display 'O' on LCD
END
LCD_DATA:
MOV RS, #1 ; RS = 1 for data register
MOV RW, #0 ; RW = 0 for write operation
MOV DATA_PORT, A ; Send data to data port
SETB EN ; Enable pulse
CLR EN
ACALL DELAY ; Adjust delay for LCD response time
RET
1. Record Observations:
o Document the source code with comments explaining each LCD interfacing
function and its purpose.
o Record the results observed during testing, including successful initialization and
character display on the LCD.
2. Conclusion:
o Summarize the experiment's findings regarding LCD interfacing with the 8051
microcontroller.
o Discuss the importance of proper initialization sequence, hardware connections,
and software configuration for successful LCD interfacing.
Notes:
Adjust the examples and specific LCD module configurations (INIT_LCD, LCD_CMD,
LCD_DATA, DELAY) based on your LCD module specifications and interface
requirements.
Ensure proper wiring and connections between the 8051 microcontroller and the LCD
module to avoid hardware issues.
Collaborate with peers or instructors to discuss and validate your observations for better
understanding.
By conducting this lab manual experiment, you will gain practical experience in interfacing an
LCD with the 8051 microcontroller, enhancing your skills in display technology and embedded
systems development.
Experiment Title: Interfacing Matrix Keyboard to 8051
Objectives:
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
Personal computer with assembler and debugger tools (e.g., Keil C51, SDCC)
Matrix keyboard (e.g., 4x4 or 4x3 key configuration)
Pull-up resistors (typically 10kΩ)
Breadboard and interconnecting wires (if using physical trainer kit)
Reference materials or datasheets for 8051 microcontroller and matrix keyboard
Experiment Procedure:
; Data segment
ORG 00H
; Main program
MAIN:
ACALL SCAN_KEYBOARD ; Scan matrix keyboard for key press
; Example: Process key press and perform actions based on the key
; Loop indefinitely
SJMP MAIN
KEY_FOUND:
; Determine which key is pressed based on column and row
; Example: Use lookup table or switch-case to identify key press
; Example: Store or display the pressed key
1. Record Observations:
o Document the source code with comments explaining each part of the matrix
keyboard interfacing program and its purpose.
o Record the results observed during testing, including successful detection of key
presses.
2. Conclusion:
o Summarize the experiment's findings regarding matrix keyboard interfacing with
the 8051 microcontroller.
o Discuss the importance of scanning techniques, hardware configuration, and
software implementation in keyboard interfacing.
Notes:
By conducting this lab manual experiment, you will gain practical experience in interfacing a
matrix keyboard with the 8051 microcontroller, enhancing your skills in input device integration
and embedded systems development.
Experiment Title: Data Transfer from Peripheral to Memory using DMA
Controller 8237/8257
Objectives:
1. To understand the concept of DMA (Direct Memory Access) and its role in data transfer.
2. To interface and configure a DMA controller (8237 or 8257) with the 8051
microcontroller.
3. To program and initiate data transfer from a peripheral device (e.g., ADC, UART) to
memory using DMA.
4. To verify the successful transfer of data through practical experimentation.
Equipment Needed:
8051 microcontroller trainer kit or simulator software (e.g., Keil uVision, Proteus)
DMA controller IC (8237 or 8257)
Peripheral device (e.g., ADC, UART) for data source
Memory for data destination (RAM or other memory devices)
Breadboard and interconnecting wires (if using physical trainer kit)
Reference materials or datasheets for DMA controller and 8051 microcontroller
Experiment Procedure:
; Data segment
ORG 00H
1. Record Observations:
o Document the source code with comments explaining each DMA controller
function and its purpose.
o Record the results observed during testing, including successful data transfer and
any issues encountered.
2. Conclusion:
o Summarize the experiment's findings regarding DMA data transfer from
peripheral to memory using the 8051 microcontroller.
o Discuss the advantages of using DMA for efficient data transfer and its impact on
system performance.
Notes:
By conducting this lab manual experiment, you will gain practical experience in configuring and
programming DMA data transfer operations with the 8051 microcontroller, enhancing your skills
in embedded systems and real-time data handling.