Interfacing
Interfacing
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