Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/core/open_close_dbase_connection.php on line 0

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/Autonomous-car-parking-system/index.php(0) : eval()'d code on line 22

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/Autonomous-car-parking-system/index.php(0) : eval()'d code on line 35

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/get_ad_type_position.php on line 0

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/load_ads.php on line 0

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/sponsor_found.php on line 0

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/freehos1/public_html/projectus/scripts/load_links.php on line 0

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/Autonomous-car-parking-system/index.php(0) : eval()'d code on line 161

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/Autonomous-car-parking-system/index.php(0) : eval()'d code on line 164

Deprecated: Function split() is deprecated in /home/freehos1/public_html/projectus/Autonomous-car-parking-system/index.php(0) : eval()'d code on line 167
8051 89c51 code for car parking
projectus.freehost7.com:UG and PG level projects,mini projects and many more here ...



 

 

Program Coding

; Input Connection:-

; Space Sensor: S1 connected at - P3.0 [Initially OFF]

; Distance Sensor: S2 connected at - P3.3 [Initially ON]

; Output Connection:-

; Steering Motor: M2 connected at - P1.3, P1.2

; Main Motor: M1 connected at - P1.1, P1.0

; --------------MAIN PROGRAM

ORG 0000H ; Program starts at location 0000H

MOV A, #0EH ; ACC loaded with 00001110.

MOV P1, A ; Copy ACC to P1. -> P1 = 00001110. ->

; M2 = 11 (BREAK),

; M1 = 10 (MOVE FORWARD)

START_LOOP:

JNB P3.0, START_LOOP ; Wait for space (low pulse S1)

; _____SPACE FOUND_____

MOV A, #216 ; Set pulse (low) counter = 216

SPACE_CHECK:

JNB P3.0, START_LOOP ; If non-space then goto START_LOOP

JB P3.3, SPACE_CHECK; If not low pulse then goto SPACE_CHECK

LOW_PULSE1:

JNB P3.3, LOW_PULSE1 ; Wait for end of low pulse

DEC A ; Decrement pulse counter

JNZ SPACE_CHECK ; If counter not 0 then goto SPACE_CHECK

; _____COVER CAR LENGTH_____

MOV A,#144 ;Set pulse (low) counter = 144

HIGH_PULSE1:

JB P3.3, HIGH_PULSE1 ; Wait for end of high pulse

LOW_PULSE2:

JNB P3.3, LOW_PULSE2 ; Wait for end of low pulse

DEC A ; Decrement pulse counter

JNZ HIGH_PULSE1 ; If counter not 0 then goto HIGH_PULSE1

; _____PARKING STARTS_____

SETB P1.0 ; P1.0 = 1 -> M1 = 11 (BREAK)

CLR P1.1 ;P1.1 = 0 -> M1 = 01 (MOVE BACKWARD)

CALL TIME_DELAY ;Wait by a time delay

SETB P1.1 ;P1.1 = 1 -> M1 = 11 (BREAK)

CLR P1.3 ; P1.3 = 0 -> M2 = 01 (TURN RIGHT)

CALL MOVE_IN_ARC ; Move in first arc.

CLR P1.2 ; P1.2 = 0 -> M2 = 00 (FREE)

SETB P1.3 ; P1.3 = 1 -> M2 = 10 (TURN LEFT)

CALL MOVE_IN_ARC ; Move in second arc.

CLR P1.3 ; P1.3 = 0 -> M2 = 00 (FREE)

END_LOOP:

JMP END_LOOP ; _____END OF MAIN PROGRAM_____

 

 

 

; --------------MOVE_IN_ARC SUBROUTINE

MOVE_IN_ARC:

CALL TIME_DELAY ; Wait by a time delay

CLR P1.1 ; P1.1 = 0 -> M1 = 01 (MOVE BACKWARD)

LOW_PULSE3:

JNB P3.3, LOW_PULSE3 ; Clear pulse

MOV A, #108 ; Set pulse (low) counter = 108

HIGH_PULSE2:

JB P3.3, HIGH_PULSE2 ; Wait for end of high pulse

LOW_PULSE4:

JNB P3.3, LOW_PULSE4 ; Wait for end of low pulse

DEC A ; Decrement pulse counter

JNZ HIGH_PULSE2 ; If counter not 0 then goto HIGH_PULSE2

SETB P1.1 ; P1.1 = 1 -> M1 = 11 (BREAK)

RET ; _____END OF SUBROUTINE_____

; --------------TIME_DELAY SUBROUTINE

TIME_DELAY:

MOV R0,#10 ;R0 = 255 (0FFH), AGAIN loop counter

LOOP:

MOV R1,#255 ;R1 = 255 (0FFH), HERE loop counter

AGAIN:

MOV R2,#255 ;R2 = 255 (0FFH), HERE loop counter

 

HERE:

DJNZ R2, HERE ; Stay HERE until R1 becomes 0

DJNZ R1, AGAIN ; Goto AGAIN until R0 becomes 0

DJNZ R0, LOOP ; Goto LOOP until R0 becomes 0

RET ; _____END OF SUBROUTINE_____

END ; _____END OF SOURCE ASM FILE_____