Home Login Sign Up Blogs & Articles Jobs Mobiles & Tablets Online Calculators Engineering Projects List Groomix Enterprises Publish your topics Ask Question About Blogs & Articles Feedback

programming

views : 171

Assemby program code for Automatic Door Opening System (8051 family microcontroller)

This assembly coded to run automatic door opening and closing system. It has infra-red (IR) Sensors to detect proximity approach of object. This input is used to control opening and closing motor system with appropriate delay. Mostly, slide door is used for this purpose, however, any other type can also be operated.

Image : project demonstrating model

Assemby program code

Note : Pin connection should be in according to code below. if any confusion then ask in comments below...

;################### ########################## #####################
;#######Assemby program code for Automatic Door Opening System ########
;##################### ########################## ###################
;R6,R7 FOR 1mS DELAY
;R3,R4,R5 FOR 1S DELAY
;--------------------- ------relays
MOTOR11 BIT P2.0
MOTOR12 BIT P2.1
;--------------------- ------wire sensors
IR1 BIT P1.0
OPEN_STATUS BIT P1.1
CLOSE_STATUS BIT P1.2
;--------------------- ------BUZZER OUPUTS
BUZZER BIT P2.6 
LED_RED BIT P2.5 
LED_GREEN BIT P2.7 
;===================== ==========
ORG 0
LJMP MAIN  ;RESET
ORG 30H
MAIN:
;===================== ===========INITIAL SETTINGS
MOV P0,#0
MOV P1,#0FFH
MOV P2,#0
MOV P3,#0
;********************* ************************** *************
;********************* ************************** *************
CLR LED_RED
CLR LED_GREEN
CLR BUZZER
CLR LED_RED
CLR MOTOR11
CLR MOTOR12

PROGRAM:
CLR BUZZER
JB IR1,CLOSE
OPEN:
JNB OPEN_STATUS,PROGRAM
SETB MOTOR11
CLR MOTOR12
SETB LED_GREEN
CLR LED_RED
LJMP OPEN
CLOSE:
JNB CLOSE_STATUS,PROGRAM
CLR MOTOR11
SETB MOTOR12
CLR LED_GREEN
SETB LED_RED
SETB BUZZER
LJMP CLOSE
LJMP PROGRAM 
;********************* ************************** **************
;********************* ************************** **************
;===================== ==DELAY 1 SEC ================DELAY_1S DELAY_1S:MOV r7,#1    ;Value of R7=no. 0f Second delay for 12Mhz(1.0003S ACCURATE)
D1S0:   MOV r6,#0ffh
D1S1:   MOV  r5,#245
D1S2:   NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        DJNZ r5,D1S2
        DJNZ r6,D1S1
        DJNZ r7,D1S0
        RET
;===================== ========================== ======DELAY_XXXmS
DELAY_1mS:MOV R7,#1 ;Value of R7=no. 0f mSecond delay for 12Mhz(1.000mS% ACCURATE)
D0:    MOV R6,#248  
D1:    NOP
    NOP
    DJNZ R6,D1 
D2:    DJNZ  R7,D0
D3:    RET
DELAY_250mS:MOV R7,#250;Value of R7=no. 0f mSecond delay for 12Mhz(1.000mS% ACCURATE)
D250mS0:    MOV R6,#248  
D250mS1:    NOP
            NOP
            DJNZ R6,D250mS1 
D250mS2:    DJNZ  R7,D250mS0
D250mS3:    RET
;===================== ========================== INTERRUPT0
OK:
END

For any query, feel free to comment below..... 

Posted By :
Mr. Unique

2016-08-09/20:49:38

Share this Page

Comments...

sumesh

can u change your name from unique to ediat

Mr. Unique

#Dear Sumesh

Thanks for your advice but this is beyond the current topics. And its "IDIOT" not "ediat"...

Please, Login to comment or reply

More :programming

programming
Arduino UNO tachometer coding with variable resistor and DC motor speed control

p

programming
Here is the code to interface 2 serial devices with AVR

p

programming
Software Uart for AVR microcontroller tested on 1200 baud rate

p

programming
ATMEL STUDIO-While loop conditioning issues

p

programming
ATMEL STUDIO-While loop is not working using interrupt incremented conditioning

p

programming
Copy and paste code for facebook share button in your websites
programming
How to program atmel 8051 family microcontroller? (step by step)
programming
Embedded program code in C language for Digital Voltmeter for AVR microcontroller
programming
Assemby program code for Automatic Door Opening System (8051 family microcontroller)
programming
Very simple and accurate Seven Segment Display program Code in Embedded C language

p

programming
Highway vehicle speed detector or checker Embedded C language code in MikroC AVR Framework also applicable for 8051 Microcontroller

p

programming
Assembly program for accurate 1 second delay function
programming
What is Embedded system programming?

Latest Updates

programming
Arduino UNO tachometer coding with variable resistor and DC motor speed control
views :167

p

programming
Here is the code to interface 2 serial devices with AVR
views :144

p

programming
Software Uart for AVR microcontroller tested on 1200 baud rate
views :724

p

programming
ATMEL STUDIO-While loop conditioning issues
views :181

p

programming
ATMEL STUDIO-While loop is not working using interrupt incremented conditioning
views :277

p

programming
Copy and paste code for facebook share button in your websites
views :284
programming
How to program atmel 8051 family microcontroller? (step by step)
views :289
programming
Embedded program code in C language for Digital Voltmeter for AVR microcontroller
views :231
programming
Assemby program code for Automatic Door Opening System (8051 family microcontroller)
views :171
programming
Very simple and accurate Seven Segment Display program Code in Embedded C language
views :179

p

programming
Highway vehicle speed detector or checker Embedded C language code in MikroC AVR Framework also applicable for 8051 Microcontroller
views :100

p

programming
Assembly program for accurate 1 second delay function
views :149
programming
What is Embedded system programming?
views :180

Reach Us From Google Map

DO MORE WITH US

PRODUCT CATEGORY