0% found this document useful (0 votes)
8 views72 pages

Interfacing

The document provides an overview of interfacing various components with the 8051 microcontroller using Embedded C, including a 16x2 LCD module, pushbutton switches, and LED toggling with interrupts. It includes example code snippets for each interfacing scenario, demonstrating how to set up and control these components. Additionally, it briefly mentions database management systems (DBMS) and their applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views72 pages

Interfacing

The document provides an overview of interfacing various components with the 8051 microcontroller using Embedded C, including a 16x2 LCD module, pushbutton switches, and LED toggling with interrupts. It includes example code snippets for each interfacing scenario, demonstrating how to set up and control these components. Additionally, it briefly mentions database management systems (DBMS) and their applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 72

Interfacing in 8051

C?
C?
What is Embedded C?
Interfacing 16×2 LCD module to 8051
• ORG 00H
Wave Drive Mode
• MOV TMOD, #01H
• MAIN: MOV P2, #08H
• ACALL DELAY
• MOV P2, #04H
• ACALL DELAY
• MOV P2, #02H
• ACALL DELAY
• MOV P2, #01H
• ACALL DELAY
• SJMP MAIN
// To generate a delay of 200 *1 ms
• DELAY:MOV R0,#200
• //change this value to required delay in ms
• BACK: MOV TH0,#0FCH
• MOV TL0,#018H
• SETB TR0
• wait: JNB TF0,wait
• CLR TR0
• CLR TF0
• DJNZ R0,BACK
• RET
• END
Full Drive Mode
• ORG 00H
• MOV TMOD,#01H
• MAIN: MOV P2, #0CH
• ACALL DELAY
• MOV P2, #06H
• ACALL DELAY
• MOV P2, #03H
• ACALL DELAY
• MOV P2, #09H
• ACALL DELAY
• SJMP MAIN
Interfacing Pushbutton switch
• MOV P0,#83H // Initializing push button switches and initializing
LED in OFF state.
READSW: MOV A,P0 // Moving the port value to Accumulator.
RRC A // Checking the vale of Port 0 to know if switch 1 is ON or
not
JC NXT // If switch 1 is OFF then jump to NXT to check if switch
2 is ON
CLR P0.7 // Turn ON LED because Switch 1 is ON
SJMP READSW // Read switch status again.
NXT: RRC A // Checking the value of Port 0 to know if switch 2 is
ON or not
JC READSW // Jumping to READSW to check status of switch 1
again (provided switch 2 is OFF)
SETB P0.7 // Turning OFF LED because Switch 2 is ON
SJMP READSW // Jumping to READSW to read status of switch 1
again.
END
Toggling LED using 8051 with interrupt
• ORG 000H // starting address
SJMP LABEL //jumps to the LABEL
ORG 003H // starting address for the ISR(INT0)
ACALL ISR // calls the ISR (interrupt service routine)
RETI // returns from the interrupt
LABEL: MOV A,#10000000B // sets the initial stage of the LEDs (D1
OFF & D2 ON)
MAIN: // main function that sets the interrupt parameters
SETB IP.0 // sets highest priority for the interrupt INT0
SETB TCON.0 // interrupt generated by a falling edge signal at INT0
(pin12)
SETB IE.0 // enables the external interrupt
SETB IE.7 // enables the global interrupt control
SJMP MAIN // jumps back to the MAIN subroutine
ISR: // interrupt service routine
CPL A // complements the current value in accumulator A
MOV P1,A // moves the current accumulator value to port 1
RET // jumps to RETI
END
Interfacing hex keypad to 8051
Database
Management(DBMS)
Database Management System
Database
DBMS
DBMS Environment
Summary
Types of Database
Database System Environment
Applications of DBMS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy