Sei sulla pagina 1di 61

90 DEGREE CAR PARKING SYSTEM

ABSTRACT:

an automatically controlled parking system with a vertical conveyor and storage shelves arranged on both sides. Tower, shaft and tower/shaft arrangements are possible with entrance at bottom, top or in between. The system can include up to 3 rows of parking places either side of the vertical conveyor. The Parksafe dispenses with the need for ramps and driving lanes, offers security against theft, damage and vandalism and is environmentally friendly in respect of its compact construction and reduced emission of exhaust gases. General running costs (lighting, ventilation, routine maintenance etc.) are less than for conventional multi-storey car parks.

automatic parking system for stacking cars on top of each other within a very small floor plan area. 10 - 80 cars in max. 30 levels

can be supplied as tower (above ground), shaft (below ground) or tower/shaft variants.

multiple row arrangements are possible with 1, 2 or 3 rows beside the vertical conveyor.

adaptable to individual project requirements integrated turntable option safe and secure parking of cars with safety advantages for users. fast access times (dependent upon number of levels and lifts) different car heights can be accommodated large, luxury cars of up to 2.50 tonnes weight (e.g. Mercedes-Benz/ BMW/ Jaguar) can be accommodated.

easy operation with several control options (e.g. magnetic card, remote control)

CHAPTER 1 INTRODUCTION

Automatic multi-stored car parking system is very good substitute for car parking area. Since in modern world, where space has become a very big problem and in the era of miniaturization its become a very crucial necessity to avoid the wastage of space in modern, big companies and apartments etc.

In space where more than 100 cars need to be parked, its a very difficult task to do and also to reduce the wastage of area, this system can be used. This Automatic Car Parking enables the parking of vehicles-floor after floor and thus reducing the space used. Here any number of cars can be park according to requirement. This makes the system modernized and even a space-saving one. This idea is developed using 8051 Microcontroller. Here program is written according to this idea using 8051.

CHAPTER 2

BLOCK DIAGRAM:

DESCRIPTION:

A display is provided at the ground floor which is basically a counter that displays number of cars in each floor. It informs whether the floors are fully filled with the cars or is it having place in a particular floor or not. There is facility of lift to carry the car to up and down. Movement of Lift is controlled by stepper motor. An indicator with a green and red LED is kept in all the floors to indicate whether the lift is busy or is it ready to take the car up or down. If the red LED glows that means the lift is already engaged and the person has to wait for the green LED to glow. In this project we have provided three floors of a building for car parking. Maximum storage capacity of each floor is given as ten. Storage capacity can be changed according to the requirement.

Any one can enter to first or second floor. The third floor in this model is for VIPs only. Therefore when VIPs are to be entering they are expected to enter their password and they will be taken to the third reserved floor. The password will be of 4 digits. The processor checks for the password entered and if it is found to be wrong, a siren is heard. In this particular model 10 passwords are stored. So when a password is entered, the processor checks for it and it is compared with 10 passwords. It indicates whether it is the correct one or not.

When the car enters the lift, the LDR detects its presence and sends a

signal to glow RED LED indicating that the lift is busy. It also sends a signal to motor which makes the motor to rotate. After RED LED glows the lift will take the person and the car up to the floor where the space for parking is available. (For VIP it will be the third floor). When the lift reaches the first floor, the processor compares the filled amount to that of the already fed capacity of that floor, and if it finds that the first floor is fully filled , it goes to the second floor and thus the procedure stops here. As soon as a car is placed in a particular floor, the display counter at the ground floor increments as to indicate the floor capacity has decreased by one. After the lift places the car in a particular floor, it comes back to its normal position and that time, the motor that drives it , also stops. Now processor sends signal to glow GREEN LED indicating that lift is free.

When a person needs to come down from a particular floor to ground floor, he is expected to focus the headlight onto the LDR placed in that floor. Now sensor section sends signal to motor that the lift has to be send back to that particular floor and sends a signal to glow RED LED indicating that the lift is busy. As soon as the lift reaches that particular floor car should come inside the lift, the display counter at the ground floor decrements by one as to indicate the floor capacity has increased by one. Lift comes back to its

normal position and that time, the motor that drives it , also stops. Now processor sends signal to glow GREEN LED indicating that lift is free. If there no parking taking place, the processor carries out the job according to the following priority:1. It checks whether any password is entered. 2. It checks whether any car is entered to lift. 3. It checks whether any car headlight is pressed in front of LDR placed in each floor. It is like a round robin system.

CIRCUIT EXPLANATIONS:

Following are the main sections in this model. 1. Display section

2. Keyboard, indicator & Beeper section 3. Lift & motor section 4. Sensor section 5. LCD section 6. Software program Program is written using 8051 microcontroller. Two 8255 IC's are connected to 8051. All circuits are interfaced with 8255. DISPLAY SECTION: This section displays the floor number along with the number of cars which has been already parked in that particular floor. So whenever a car is ready to either come down or go up, the program either decrements the count or increments the count automatically according to the going up or coming down of a car. Display section is done by interfacing with 8255(PPI) of 8051.Here 3 ports of 8255 are connected to three 7-segment display. Block diagram of this section is shown.

KEYBOARD, INDICATOR & BEEPER

In this section,12 switches are connected in matrix form and it has three LEDs , RED, GREEN&YELLOW. The person, needed to enter the password has to wait until the GREEN LED glows and when it glows, he has to press the START button first. This time the RED LED glows. Then the person has to enter the password. As soon as it is entered, the program checks it with the already stored passwords. If it is correct, YELLOW LED glows. If the entered password is wrong, beeper starts beeping signifying the incorrectness of the password entered. Circuit diagram of keyboard is shown bellow.

The indicator section contains 2 LEDs , RED & GREEN which are present in all the floors. RED LED signifies that the lift is presently busy and shall not entertain any car to enter but if GREEN LED glows, it suggests that the lift is ready and the car can enter the particular floor. Beeper and LED's are connected to port C upper of 8255.

One more advantage of beeper is that; when a person tries to enter the lift irrespective of finding the display section to be FFF (means the floors are already filled), program sends a signal to Beeper section and it starts beeping indicating that he is not supposed to enter the lift since all the floors are already filled

LIFT AND MOTOR SECTION: In lift section, there is a light beam and LDR to know whether a car has entered the lift or not. When the GREEN LED of indicator section glows, that means the lift is ready for the car to enter. When the car enters the lift, the light beam falls on LDR present in the lift gets cut and it gives a signal that a car has entered the lift. Then program decides which floor lift has to go and gives a signal to motor section. Circuit diagram of sensor present in lift is shown below.

The motor section is a mechanical part of the model which is used for taking the lift up/down. When the lift has to go up, program gives the signal and the motor rotates clockwise and if it has to go down, it rotates anticlockwise. First 4 pins port A is connected to motor. Power transistors must be connected to drive the motor. Circuit diagram of this section is shown bellow.

SENSOR SECTION: Sensor section contains LDR's .These LDR's are connected to each floar to give information if any car has to come down. When a person needs to come down from a particular floor to ground floor, he is expected to focus the headlight the car onto the LDR placed in that floor. When light falls on

LDR its resistance decreases. Hence IC 555 triggers and gives a signal. Program identifies that signal and gives a signal to motor section. The circuit diagram sensor is shown bellow. In this project same circuits is connected to three floors. This circuit different if you compared with that of lift sensor shown above.

CHAPTER 3

ATMEGA MICROCONTROLLER: 4.1 ATMEGA 8089S52 DESCRIPTION-

AT89S52 MICROCONTROLLER

Features Compatible with MCS-51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range

Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes

Description The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the Indus-try-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful

microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

Figure.3.5. Block diagram of the microcontroller

Figure.3.6. Pin diagram of 89s52

Pin Description VCC Supply voltage. GND Ground. Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification. Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the inter-nal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and

P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.

Table.3.3. Port functions Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when

emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification. Port Pin Alternate Functions P1.0 T2 (external count input to Timer/Counter 2), clock-out P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control) P1.5 MOSI (used for In-System Programming) P1.6 MISO (used for In-System Programming) P1.7 SCK (used for In-System Programming) Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.

Table.3.4.Alternate Port functions of 89s52

RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out.

ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however,

that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALEdisable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.

XTAL1

Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier.

Memory Organization MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed. Program Memory If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. Data Memory The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction

accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. OSCILLATOR CHARACTERISTICS: XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be configured for use as an on-chip oscillator, as shown in Fig.4. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven, as shown in the figure. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

CHAPTER 4

SOFTWARE IMPLEMENTATION

LCD SECTION: In this project LCD is used to display some messages which is useful to car owners. Here 2X16 LCD ( Liquid Crystal Display) is used. This is used to display messages like WELCOME TO CAR PARKING SYSTEM LIFT IS BUSY PLEASE WAIT PLEASE ENTER YOUR PASSWORD Circuit diagram of LCD section is shown bellow. LCD is interfaced with 8051 microcontroller.

Circuit is now over. Next part is coding. Here is the complete listing of the code for vertical car parking system. Create the hex file and download it to the microcontroller and place the IC in circuit. system is ready. automated car parking

mov r0,#19h mov @r0,#0bfh inc r0 mov @r0,#86h inc r0 mov @r0,#0dbh inc r0 mov @r0,#0cfh

; Storing the equivalent codes of ; common cathode display.

inc r0 mov @r0,#0e6h inc r0 mov @r0,#0edh inc r0 mov @r0,#fdh inc r0 mov @r0,#87h inc r0 mov @r0,#0ffh inc r0 mov @r0,#0e7h inc r0 mov @r0,#39h inc r0 mov @r0,#00h

mov r0,#25h mov @r0,#40h inc r0 mov @r0,#0f9h

; Storing the equivalent codes of ; common anode.

inc r0 mov @r0,#24h inc r0 mov @r0,#30h inc r0 mov @r0,#99h inc r0 mov @r0,#12h inc r0 mov @r0,#02h inc r0 mov @r0,#78h inc r0 mov @r0,#00h inc r0 mov @r0,#18h inc r0 mov @r0,#0eh

mov r0,#45h mov @r0,#00h

; Storing ten 4 digit passwords in ; internal RAM.

inc r0 mov @r0,#01h inc r0 mov @r0,#02h inc r0 mov @r0,#03h inc r0 mov @r0,#08h inc r0 mov @r0,#00 inc r0 mov @r0,#05h inc r0 mov @r0,#01h inc r0 mov @r0,#01h inc r0 mov @r0,#00 inc r0 mov @r0,#00 inc r0

mov @r0,#01h inc r0 mov @r0,#06h inc r0 mov @r0,#00 inc r0 mov @r0,#05h inc r0 mov @r0,#00 inc r0 mov @r0,#09h inc r0 mov @r0,#08h inc r0 mov @r0,#08h inc r0 mov @r0,#06h inc r0 mov @r0,#03h inc r0 mov @r0,#01h

inc r0 mov @r0,#01h inc r0 mov @r0,#07h mov a,#08 STORE: dec a inc r0 mov @r0,a inc r0 movx @r0,a inc r0 movx @r0,a inc r0 movx @r0,a djnz a,STORE

mov dptr,#2023h mov a,#81h movx @dptr,a mov dptr,#2043h mov a,#80h

; Configuring two 8255 ports.

movx @dptr,a mov r3,#00 mov r4,#00 mov r5,#00 mov a,r5 call LED_CODES mov dptr,#2040h movx @dptr,a inc dptr movx @dptr,a inc dptr movx @dptr,a mov dptr,#2022h mov a,#30h movx @dptr,a mov sp,#11h call lcdwel REPEAT: clr psw.3 clr psw.4 mov dptr,#2022h movx a,@dptr ; Calling LCD display subroutine. ; Clears the display.

cjne a,#31h,DONE lift. mov a,#0ah xrl a,r4 jz SIREN call lcdbusy mov a,#10h movx @dptr,a call DELAY mov r7,#02 that... mov r6,#02h call MOTER_UP mov a,#0ah xrl a,r3 jz I_FULL inc r3 call DELAY mov a,r3

; Comparing whether car is inside the

; Call SIREN if second floor is full.

; send lift is busy signal.

; Give number of rotations to motor so

; lift goes to first floor. ; Call motor to rotate clockwise.

; If first floor is full then jump to I_FULL

; Increment the number of car in first floor. ; Display the number of cars.

call LED_CODES mov dptr,#2042h

movx @dptr,a mov r7,#02h motor mov r6,#02h call MOTER_DOWN mov dptr,#2022h mov a,#30h movx @dptr,a call lcdwel sjmp DONE I_FULL: mov r7,#02h tha... mov r6,#02h call MOTER_UP inc r4 call DELAY mov a,r4 ; Increment the number of car in second floor. ; Display the number of cars. ; ...lift goes to second floor. ; Call motor to rotate clockwise. ; Give number of rotations to motor so ; send lift is free signal. ; Call motor to rotate anticlockwise. ; Again load the number of rotations to

call LED_CODES mov dptr,#2041h movx @dptr,a mov r7,#04h

;Again load the number of rotations to

motor. mov r6,#02h call MOTER_DOWN mov dptr,#2022h mov a,#30h movx @dptr,a call lcdwel jmp DONE SIREN: mov a,#70h movx @dptr,a GO: movx a,@dptr ; Subroutine for SIREN. ; send lift is free signal. ; Call motor to rotate anticlockwise.

jb a.0,GO jmp OVER1

DONE: movx a,@dptr cjne a,#33h,OVER1 mov a,#0ah xrl a,r5 jz SIREN mov a,#00 movx @dptr,a

; Compare if start button of the keyboard is pressed.

; Call SIREN if third flore is full.

call lcdbusy setb psw.3 CLEAR: mov r1,#0ah keyboard mov r0,#04h START: mov dptr,#2020h mov a,#0eh movx @dptr,a WAIT: mov dptr,#2022h movx a,@dptr mov r7,#00 xrl a,r7 jz WAIT mov a,#02 LOOP: mov r6,a mov dptr,#2020h movx @dptr,a mov dptr,#2022h movx a,@dptr jnz COLSCAN inc r7 ; Scanning entered password from

mov a,r6 rl a jmp LOOP

COLSCAN: rrc a jc DONE1 inc r7 inc r7 inc r7 sjmp COLSCAN

OVER1: jmp OVER DONE1: mov a,r7 clr psw.3 setb psw.4 mov r0,#19h add a,r0 mov r0,a mov a,@r0 clr psw.4 setb psw.3

mov dptr,#2021h movx @dptr,a inc dptr UP: movx a,@dptr jnz UP mov a,#0ah xrl a,r7 jz CLEAR mov a,#0bh xrl a,r7 jz BIT_CLEAR mov a,r7 mov @r1,a inc r1 mov r7,#0ffh HEAR: djnz r7,HEAR mov r7,#0ffh HEAR1: djnz r7,HEAR1 djnz r0,START ; Store entered each digit.

mov r7,#0ah

;Checking whether entered 4 digit

password mov r0,#45h CHECK: mov r1,#0ah mov r6,#03h CHECK1:mov a,@r0 xrl a,@r1 jnz NEXT inc r1 inc r0 djnz r6,CHECK1 mov dptr,#2022h mov a,#90h movx @dptr,a clr psw.3 jmp OK NEXT: inc r0 djnz r6,NEXT inc r0 djnz r7,CHECK mov dptr,#2022h mov a,#50h ; Jump to OK if password is correct. ; .... is any one of the stored password.

movx @dptr,a AGAIN: movx a,@dptr cjne a,#53h,AGAIN clr psw.3 mov a,#30h wrong. movx @dptr,a REMAIN: movx a,@dptr xrl a,#33h jz REMAIN mov r0,#0ffh STAY: djnz r0,STAY call lcdwel jmp OVER ; Give SIREN if entered password is

LED_CODES:setb psw.4 mov r0,#25h add a,r0 mov r0,a mov a,@r0 clr psw.4

ret

BIT_CLEAR: dec r1 inc r0 mov r6,#0ffh HEAR2: djnz r6,HEAR2 mov r6,#0ffh HEAR3: djnz r6,HEAR3 jmp START

OK: movx a,@dptr cjne a,#91h,OK mov a,#10h movx @dptr,a mov a,#00 mov dptr,#2021h movx @dptr,a call DELAY mov r7,#06h that mov r6,#02h ; lift goes to third flore. ; Give number of rotations to motor so

call MOTER_UP inc r5 call DELAY mov a,r5 call LED_CODES mov dptr,#2040h movx @dptr,a mov r7,#06h mov r6,#02h call

; Call motor to rotate clockwise.

;Increment the number of car entered to third ;... floor and display the number of cars.

MOTER_DOWN

Call

motor

to

rotate

anticlockwise. call lcdwel jmp OVER

MOTER_UP:push r5 clockwise. mov r5,#70h mov r0,r6 mov dptr,#2020h mov a,#88h h3: movx @dptr,a

;Subroutine for motor to rotate

rl a mov r2,#30 h1: mov r1,#255 h2: djnz r1,h2 djnz r2,h1 djnz r5,h3 mov r5,#0ffh djnz r6,h3 mov r6,r0 djnz r7,h3 pop r5 ret

MOTER_DOWN:push r5 anticlockwise. mov r5,#70h mov r0,r6 mov dptr,#2020h mov a,#88h h6: movx @dptr,a rr a

;Subroutine for motor to rotate

mov r2,#30 h4: mov r1,#255 h5: djnz r1,h5 djnz r2,h4 djnz r5,h6 mov r5,#0ffh djnz r6,h6 mov r6,r0 djnz r7,h6 pop r5 ret

DELAY: mov r1,#10h DELAY1: mov r2,#0ffh DELAY2: mov r0,#0ffh DELAY3: djnz r0,DELAY3 djnz r2,DELAY2 djnz r1,DELAY1 ret

; Subroutine for Delay

OVER: mov dptr,#2022h

mov a,#30h movx @dptr,a movx a,@dptr cjne a,#32h,I_OVER mov a,#10h movx @dptr,a call lcdbusy mov r7,#02h mov r6,#02h call MOTER_UP dec r3 mov a,r3 ; Call motor to rotate clockwise.

; Decrements the number of cars entered to ;... first floor and display the number of ;... cars in first floor.

call LED_CODES mov dptr,#2042h movx @dptr,a call DELAY mov r7,#02h mov r6,#02h call

MOTER_DOWN

Call

motor

to

rotate

anticlockwise. mov dptr,#2022h

mov a,#30h movx @dptr,a call lcdwel I_OVER: movx a,@dptr cjne a,#34h,II_OVER mov a,#10h movx @dptr,a call lcdbusy mov r7,#04h mov r6,#02h call MOTER_UP dec r4 mov a,r4 ; Call motor to rotate clockwise.

; Decrements the number of cars entered to ;...second floor and display the number of ;... cars in second floor.

call LED_CODES mov dptr,#2041h movx @dptr,a call DELAY mov r7,#04h mov r6,#02h call MOTER_DOWN mov dptr,#2022h

; Call motor to rotate clockwise.

mov a,#30h movx @dptr,a call lcdwel II_OVER: movx a,@dptr cjne a,#38h,END mov a,#10h movx @dptr,a call lcdbusy mov r7,#06h mov r6,#02h call MOTER_UP dec r5 mov a,r5 ; Call motor to rotate clockwise.

; Decrements the number of cars entered to ;... third floor and display the number of ;... cars in third floor.

call LED_CODES mov dptr,#2040h movx @dptr,a call DELAY mov r7,#06h mov r6,#02h call

MOTOR_DOWN

Call

motor

to

rotate

anticlockwise.

mov dptr,#2022h mov a,#30h movx @dptr,a call lcdwel END: jmp REPEAT

lcdwel: push r3 push r4 SYSTEM mov a,#3ch call command mov a,#0eh call command mov a,#01h call command mov a,#06h call command mov a,#80h call command mov a,#'W' call data

; Subroutine for LCD to display ; WELCOME TO CAR PARKING

mov a,#'E' call data mov a,#'L' call data mov a,#'C' call data mov a,#'O' call data mov a,#'M' call data mov a,#'E' call data mov a,#' ' call data mov a,#88h call command mov a,#'T' call data mov a,#'O' call data mov a,#' '

call data mov a,#'C' call data mov a,#'A' call data1 mov a,#'R' call data mov a,#aah call command mov a,#'P' call data mov a,#'A' call data mov a,#'R' call data mov a,#'K' call data mov a,#'I' call data mov a,#'N' call data

mov a,#'G' call data mov a,#' ' call data mov a,#'S' call data mov a,#'Y' call data mov a,#'S' call data mov a,#'T' call data mov a,#'E' call data mov a,#'M' call data pop r4 pop r3 ret

command:mov p1,a clr p3.4 setb p3.3 clr p3.3 mov r3,#50 A: mov r4,#255 R: djnz r4,R djnz r3,A ret

data: mov p1,a setb p3.4 setb p3.3 clr p3.3 mov r3,#50 AAA: mov r4,#255 AA: djnz r4,AA djnz r3,AAA ret

lcdbusy: push r4 push r3 mov a,#3ch call command mov a,#0eh call command mov a,#01h call command mov a,#06h call command mov a,#80h call command mov a,#'L' call data mov a,#'I' call data mov a,#'F' call data mov a,#'T' call data mov a,#' ' ;

;Subroutine for LCD to display LIFT IS BUSY PLEASE WAIT

call data mov a,#' ' call data mov a,#'I' call data mov a,#'S' call data mov a,#88h call command mov a,#' ' call data mov a,#' ' call data mov a,#'B' call data mov a,#'U' call data mov a,#'S' call data mov a,#'Y' call data

mov a,#aah call command mov a,#'P' call data mov a,#'L' call data mov a,#'E' call data mov a,#'A' call data mov a,#'S' call data mov a,#'E' call data mov a,#' ' call data mov a,#'W' call data mov a,#'A' call data mov a,#'I'

call data mov a,#'T' call data mov a,#' ' call data pop r3 pop r4 ret

CHAPTER 5

CONCLUSION

Potrebbero piacerti anche