Programming: views : 2204

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.
Assemby program code for Automatic Door Opening System (8051 family microcontroller)
Assemby-program-code-for-Automatic-Door-Opening-System-(8051-family-microcontroller)2016-08-05_10_28_50


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

 

This is Original List file data

A51 MACRO ASSEMBLER  AUTOMATIC_DOOR_OPENING_SYSTEM                                        11/10/2014 22:59:44 PAGE     1


MACRO ASSEMBLER A51 V8.02b
OBJECT MODULE PLACED IN automatic door opening system.OBJ
ASSEMBLER INVOKED BY: C:KeilC51BINA51.EXE automatic door opening system.asm SET(SMALL) DEBUG EP

LOC  OBJ            LINE     SOURCE

                       1     ;##################################################################
                       2     ;############project:gsm based LOCK with LDR key input#############
                       3     ;##################################################################
                       4     ;R6,R7 FOR 1mS DELAY
                       5     ;R3,R4,R5 FOR 1S DELAY
                       6     ;---------------------------relays
  00A0                 7     MOTOR11 BIT P2.0
  00A1                 8     MOTOR12 BIT P2.1
                       9     ;---------------------------wire sensors
  0090                10     IR1 BIT P1.0
  0091                11     OPEN_STATUS BIT P1.1
  0092                12     CLOSE_STATUS BIT P1.2
                      13     ;---------------------------BUZZER OUPUTS
  00A6                14     BUZZER BIT P2.6 
  00A5                15     LED_RED BIT P2.5 
  00A7                16     LED_GREEN BIT P2.7 
                      17     ;===============================
0000                  18     ORG 0
0000 020030           19     LJMP MAIN  ;RESET
                      20     
0030                  21     ORG 30H
0030                  22     MAIN:
                      23     ;================================INITIAL SETTINGS
0030 758000           24     MOV P0,#0
0033 7590FF           25     MOV P1,#0FFH
0036 75A000           26     MOV P2,#0
0039 75B000           27     MOV P3,#0
                      28     ;************************************************************
                      29     ;************************************************************
003C C2A5             30     CLR LED_RED
003E C2A7             31     CLR LED_GREEN
0040 C2A6             32     CLR BUZZER
0042 C2A5             33     CLR LED_RED
0044 C2A0             34     CLR MOTOR11
0046 C2A1             35     CLR MOTOR12
                      36     
                      37     
                      38     
                      39     
0048                  40     PROGRAM:
0048 C2A6             41     CLR BUZZER
004A 20900E           42     JB IR1,CLOSE
                      43     
004D                  44     OPEN:
004D 3091F8           45     JNB OPEN_STATUS,PROGRAM
0050 D2A0             46     SETB MOTOR11
0052 C2A1             47     CLR MOTOR12
0054 D2A7             48     SETB LED_GREEN
0056 C2A5             49     CLR LED_RED
0058 02004D           50     LJMP OPEN
                      51     
005B                  52     CLOSE:
005B 3092EA           53     JNB CLOSE_STATUS,PROGRAM
005E C2A0             54     CLR MOTOR11
0060 D2A1             55     SETB MOTOR12
0062 C2A7             56     CLR LED_GREEN
0064 D2A5             57     SETB LED_RED
0066 D2A6             58     SETB BUZZER
A51 MACRO ASSEMBLER  AUTOMATIC_DOOR_OPENING_SYSTEM                                        11/10/2014 22:59:44 PAGE     2

0068 02005B           59     LJMP CLOSE
006B 020048           60     LJMP PROGRAM 
                      61     ;*************************************************************
                      62     ;*************************************************************
                      63     ;=======================DELAY 1 SEC ================DELAY_1S
006E 7F01             64     DELAY_1S:MOV r7,#1      ;Value of R7=no. 0f Second delay for 12Mhz(1.0003S ACCURATE)
0070 7EFF             65     D1S0:   MOV r6,#0ffh
0072 7DF5             66     D1S1:   MOV  r5,#245
0074 00               67     D1S2:   NOP
0075 00               68                     NOP
0076 00               69                     NOP
0077 00               70                     NOP
0078 00               71                     NOP
0079 00               72                     NOP
007A 00               73                     NOP
007B 00               74                     NOP
007C 00               75                     NOP
007D 00               76                     NOP
007E 00               77                     NOP
007F 00               78                     NOP
0080 00               79                     NOP
0081 00               80                     NOP
0082 DDF0             81                     DJNZ r5,D1S2
0084 DEEC             82             DJNZ r6,D1S1
0086 DFE8             83             DJNZ r7,D1S0
0088 22               84             RET
                      85     ;=====================================================DELAY_XXXmS
0089 7F01             86     DELAY_1mS:MOV R7,#1 ;Value of R7=no. 0f mSecond delay for 12Mhz(1.000mS% ACCURATE)
008B 7EF8             87     D0:     MOV R6,#248  
008D 00               88     D1:     NOP
008E 00               89             NOP
008F DEFC             90             DJNZ R6,D1 
0091 DFF8             91     D2:     DJNZ  R7,D0
0093 22               92     D3:     RET
                      93     
0094 7FFA             94     DELAY_250mS:MOV R7,#250;Value of R7=no. 0f mSecond delay for 12Mhz(1.000mS% ACCURATE)
0096 7EF8             95     D250mS0:        MOV R6,#248  
0098 00               96     D250mS1:        NOP
0099 00               97                             NOP
009A DEFC             98                             DJNZ R6,D250mS1 
009C DFF8             99     D250mS2:        DJNZ  R7,D250mS0
009E 22              100     D250mS3:        RET
                     101     ;===============================================INTERRUPT0
009F                 102     OK:
                     103     END
                             
A51 MACRO ASSEMBLER  AUTOMATIC_DOOR_OPENING_SYSTEM                                        11/10/2014 22:59:44 PAGE     3

SYMBOL TABLE LISTING
------ ----- -------


N A M E             T Y P E  V A L U E   ATTRIBUTES

BUZZER . . . . . .  B ADDR   00A0H.6 A   
CLOSE. . . . . . .  C ADDR   005BH   A   
CLOSE_STATUS . . .  B ADDR   0090H.2 A   
D0 . . . . . . . .  C ADDR   008BH   A   
D1 . . . . . . . .  C ADDR   008DH   A   
D1S0 . . . . . . .  C ADDR   0070H   A   
D1S1 . . . . . . .  C ADDR   0072H   A   
D1S2 . . . . . . .  C ADDR   0074H   A   
D2 . . . . . . . .  C ADDR   0091H   A   
D250MS0. . . . . .  C ADDR   0096H   A   
D250MS1. . . . . .  C ADDR   0098H   A   
D250MS2. . . . . .  C ADDR   009CH   A   
D250MS3. . . . . .  C ADDR   009EH   A   
D3 . . . . . . . .  C ADDR   0093H   A   
DELAY_1MS. . . . .  C ADDR   0089H   A   
DELAY_1S . . . . .  C ADDR   006EH   A   
DELAY_250MS. . . .  C ADDR   0094H   A   
IR1. . . . . . . .  B ADDR   0090H.0 A   
LED_GREEN. . . . .  B ADDR   00A0H.7 A   
LED_RED. . . . . .  B ADDR   00A0H.5 A   
MAIN . . . . . . .  C ADDR   0030H   A   
MOTOR11. . . . . .  B ADDR   00A0H.0 A   
MOTOR12. . . . . .  B ADDR   00A0H.1 A   
OK . . . . . . . .  C ADDR   009FH   A   
OPEN . . . . . . .  C ADDR   004DH   A   
OPEN_STATUS. . . .  B ADDR   0090H.1 A   
P0 . . . . . . . .  D ADDR   0080H   A   
P1 . . . . . . . .  D ADDR   0090H   A   
P2 . . . . . . . .  D ADDR   00A0H   A   
P3 . . . . . . . .  D ADDR   00B0H   A   
PROGRAM. . . . . .  C ADDR   0048H   A   


REGISTER BANK(S) USED: 0 


ASSEMBLY COMPLETE.  0 WARNING(S), 0 ERROR(S)
 

 

This is HEX file data, Download file from below link

:03000000020030CB
:100030007580007590FF75A00075B000C2A5C2A7BD
:10004000C2A6C2A5C2A0C2A1C2A620900E3091F83D
:10005000D2A0C2A1D2A7C2A502004D3092EAC2A08E
:10006000D2A1C2A7D2A5D2A602005B0200487F019E
:100070007EFF7DF500000000000000000000000091
:100080000000DDF0DEECDFE8227F017EF80000DE1C
:0F009000FCDFF8227FFA7EF80000DEFCDFF822AA
:00000001FF
 

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

1) Download its hex file (tested).hex Download


Share this page with your friends
share via Whatsapp

Posted By :
Mahesh Nigam
(Scientist)
2020-05-13 16:38
See Author's other Published Topics

Vaisakhi  of Vaisakhi
Vaisakhi
3 मार्च - विश्व वन्यजीव दिवस of 3 मार्च - विश्व वन्यजीव दिवस
3 मार्च - विश्व वन्यजीव दिवस
1 मार्च- विश्व प्रशंसा दिवस of 1 मार्च- विश्व प्रशंसा दिवस
1 मार्च- विश्व प्रशंसा दिवस
1 मार्च- विश्व नागरिक सुरक्षा दिवस of 1 मार्च- विश्व नागरिक सुरक्षा दिवस
1 मार्च- विश्व नागरिक सुरक्षा दिवस
1 मार्च - शून्य भेदभाव दिवस of 1 march शून्य भेदभाव दिवस
1 march शून्य भेदभाव दिवस
करती रही of पूरा नही बस थोड़ा सा ही समझा होता ....
पूरा नही बस थोड़ा सा ही समझा होता ....
वैलेंटाइन of वैलेंटाइन डे मनाने के पीछे एक रोचक तथ्य व 7 से 14 तक वैलेंटाइन सेलिब्रेट करने की सूची
वैलेंटाइन डे मनाने के पीछे एक रोचक तथ्य व 7 से 14 तक वैलेंटाइन सेलिब्रेट करने की सूची
National Test Agency of UGC NET December 2023 results and download its subject wise cut-off
UGC NET December 2023 results and download its subject wise cut-off
परीक्षा पे चर्चा  of परीक्षा पे चर्चा युवाओं के लिए तनाव मुक्त माहौल बनाने के लिए प्रधान मंत्री नरेंद्र मोदी के नेतृत्व में बड़े आंदोलन - 'एग्जाम वॉरियर्स' का हिस्सा है।
परीक्षा पे चर्चा युवाओं के लिए तनाव मुक्त माहौल बनाने के लिए प्रधान मंत्री नरेंद्र मोदी के नेतृत्व में बड़े आंदोलन - 'एग्जाम वॉरियर्स' का हिस्सा है।
तुझे सोच रही हूँ,ज्यादा सोच लिया तो रो दूगी। of तुझे सोच रही हूँ,ज्यादा सोच लिया तो रो दूगी।
तुझे सोच रही हूँ,ज्यादा सोच लिया तो रो दूगी।
Alart  massage  of घबराएं नहीं यह सिर्फ अलर्ट मैसेज हैआपके मोबाइल पर वाइब्रेशन के साथ अलग किस्म की आवाज आये तो घबराये नही
घबराएं नहीं यह सिर्फ अलर्ट मैसेज हैआपके मोबाइल पर वाइब्रेशन के साथ अलग किस्म की आवाज आये तो घबराये नही

Peoples

Comments...

:

can u change your name from unique to ediat

Reply 17:13 2019-09-27

Mahesh Nigam(Scientist):

#Dear Sumesh

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

Reply 17:13 2019-09-27

ayya: is there any hexa value in this program ?

Reply 11:44 2020-05-13

Mahesh Nigam(Scientist): it's a very old program, so let me check is it available in my computer.

Reply 11:58 2020-05-13

ayya: thankyouu so much,

Reply 12:21 2020-05-13

Jeorge Ban: not work, i put it in visual express 2010 it gives like more than 90 errors :( please help me or send me the fixed code.. thanks

Reply 17:41 2020-06-10

Mahesh Nigam(Scientist): Don't used assembly code, it may arise lots of error due to dependent codes that was includes with this source code. Use hex code. It is used by many people and working correctly.

Reply 19:15 2020-06-10

Jeorge Ban: Mr. Mahesh i need your help sir!!! actually i need and assembly code for automatic door opener as example and i need it to be worked in visual c++ 2010 express, if u can provide me one or at least give me any resources that may be helpful for my project, because we don't do it in actual, we just need one example for our semester project to provide an assembly code from visual c++ express 2010... THANKS!

Reply 18:07 2020-06-13

Mahesh Nigam(Scientist): This code was coded on keil software directly in assembly language. I don't have any visual c++ code of it

Reply 00:15 2023-01-05

Rohit: Sir, it`s showing error in proteus 8.11 and it`s not running :(

Reply 23:38 2022-11-27

Rohit: what does IR1 means in the code?? please soon :(

Reply 00:07 2022-11-28

Mahesh Nigam(Scientist): IR1=Infrared sensor 1, i never run it on proteus. This code development form my many previous codes, that's why there be some naming who's actual meaning may different

Reply 00:14 2023-01-05

Gayathri: Can I get the circuit diagram corresponding to this code

Reply 12:34 2024-04-28

Write Your Comment

Related to Programming

Latest topics




More Categories
latest mobile phones ireps.gov.in irctc.co.in Working Principle Viral Discussion True Love quotes True Love Today is Celebrated For Tips for better life Tips and Hacks Technology News Teachers Day Quotes Study Materials Self Motivating Quotes Science Sad Lines (Sayeri) Romantic shayari quotes Robotics Reviews Results Questions_and_Answers Programming Problem Resolved PHP Codes PCB Design Online Works New Year Quotes Shayari Status My World My Responsibilities Motivational lines Mobile Issues Microcontrollers Lucknow Local News Latest Technology Iphone Homeopathy Historical place in India Heart Touching Love Quotes Health Good Night Quotes Good Morning Quotes GeM.gov.in GST portal Funny Lines (Sayeri) Friendship Quotes Food Recipes Exam Time Table Engineering Project Ideas Electronics Electronic and electrical project making ideas Electricals Educations Desh Bhakti Shayeri Criminal Love Cricket News Corona Updates Christmas Quotes Shayari Status CBSE Updates/Circulars Breaking News Breaking Heart Shayeri Break Up Lines (Sayeri) BirthDay Wishes Best kitchen Tips Best Valentine quotes Shayeri Beauty Hacks Basic Knowledges Attitude quotes shayari Attitude quotes Attitude quotes Assembly Election 2022
Go to top

Important Links

  • Contact Us
  • About Us
  • All copyright © 2020 are reserved by Groomix - designed by Groomix

    MORE

    Programming >
    latest mobile phones >
    ireps.gov.in >
    irctc.co.in >
    Working Principle >
    Viral Discussion >
    True Love quotes >
    True Love >
    Today is Celebrated For >
    Tips for better life >
    Tips and Hacks >
    Technology News >
    Teachers Day Quotes >
    Study Materials >
    Self Motivating Quotes >
    Science >
    Sad Lines (Sayeri) >
    Romantic shayari quotes >
    Robotics >
    Reviews >
    Results >
    Questions_and_Answers >
    Problem Resolved >
    PHP Codes >
    PCB Design >
    Online Works >
    New Year Quotes Shayari Status >
    My World My Responsibilities >
    Motivational lines >
    Mobile Issues >
    Microcontrollers >
    Lucknow Local News >
    Latest Technology >
    Iphone >
    Homeopathy >
    Historical place in India >
    Heart Touching Love Quotes >
    Health >
    Good Night Quotes >
    Good Morning Quotes >
    GeM.gov.in >
    GST portal >
    Funny Lines (Sayeri) >
    Friendship Quotes >
    Food Recipes >
    Exam Time Table >
    Engineering Project Ideas >
    Electronics >
    Electronic and electrical project making ideas >
    Electricals >
    Educations >
    Desh Bhakti Shayeri >
    Criminal Love >
    Cricket News >
    Corona Updates >
    Christmas Quotes Shayari Status >
    CBSE Updates/Circulars >
    Breaking News >
    Breaking Heart Shayeri >
    Break Up Lines (Sayeri) >
    BirthDay Wishes >
    Best kitchen Tips >
    Best Valentine quotes Shayeri >
    Beauty Hacks >
    Basic Knowledges >
    Attitude quotes shayari >
    Attitude quotes >
    Attitude quotes >
    Assembly Election 2022 >

    Peoples

    Latest Comments