Build an intersection traffic light using the led, Electrical Engineering

Build an intersection traffic light using the LED's as in the diagram below

1689_Build an intersection traffic light.png

Day

Use the LED's on the trainer (port 11)

Main Street and Side Street alternate.

Main Street is green for 6 seconds, yellow for 2 seconds (Side Street is red while Main Street is green and yellow (8 seconds).

When Main Street is red, Side Street is green for 6 seconds, yellow for 2 seconds.

Night

Bit D0 of the dip switch controls Day and Night. (port 12)

Day is a logic 0 on Bit D0 of the dip switch

Night is a logic 1 on Bit D0 of the dip switch

Main Street is green unless a car is detected on the Side Street.

Bit D1 of the dip switch controls a car on Side Street.

When Bit D1 toggles (changes from its previous state), a car is present on Side Street.

 

For the 2 and 6 second delay, use a ½ second loop program as the core subroutine.

 

TRAFFIC LIGHT FLOW CHART

416_Build an intersection traffic light 2.png

 

 

**********************************************************

************ MAIN ROUTINE (PARTIAL) *************

**********************************************************

 

Label           Nmem  Operand          Comments

 

start              LXI         SP XX,XX      ;set the stack

dmaingrn    CALL     maingrn         ;call main street green light, side red

                     CALL     6 sec delay

dmainyel     CALL     mainyel          ;call main street yellow light, side red      

                     CALL     2 sec delay

dsidegrn     CALL     sidegrn           ; call side street green light, main red etc.

 

nite              IN           $12                 ;check the dip switches

                     RAR                              ;rotate the day-nite bit in to the cy flag

                     JNC       maingrn         ;if 0, still day and goes to day routine,

                                                            ;if 1 falls through to "Call Main Greem"

                     CALL     maingrn         ;returns to "Car at Side Street"

                     IN           12                   

                     RAR

                     RAR

                     CC         mainyel          ;make main yellow

                     JMP       nite

 

************************************************************************

********************** NIGHT SUBROUTINE ***********************

************************************************************************

 

                     CALL     maingrn         ;make the main street green

                     IN           12                    ;check side street

                     RAR                              ;is lsb still a 1 (nite)

                     RAR     

                     JC          mainyel          ;make main street yellow

 

************************************************************************

********************* LIGHT SUBROUTINES **********************

************************************************************************

 

Label           Nmem  Operand          Comments

maingrn      MVI A    %11011011   ; main green, side red

                     OUT       $11

                     CALL     6sec                ; the the 6 sec subroutine

                     RET

etc

********************************************************************************************

******************************** 6 SEC DELAY*******************************************

********************************************************************************************

Refer to the OPEN AND CLOSED LOOP and EXTENDING THE LOOP experiments.

 

********************************************************************************************

******************************** 2 SEC DELAY*******************************************

********************************************************************************************

Refer to the OPEN AND CLOSED LOOP and EXTENDING THE LOOP experiments.

 

Use the following memory locations for each subroutine:

 

MAIN ROUTINE                           $8000            

MAIN GREEN                              $8100            

MAIN YELLOW                            $8200

SIDE GREEN                              $8300

SIDE YELLOW                            $8400

6 SECOND DELAY                      $8500

2 SECOND DELAY                      $8600

HALF SECOND DELAY                 $8700                        

 

Put the MAIN ROUTINE on a separate listing sheet label it MAIN ROUTINE.

Put the MAIN GREEN, MAIN YELLOW on separate listing sheet label it, MAIN GREEN AND YELLOW.

Put the SIDE GREEN and SIDE YELLOW on a separate listing sheet, label it SIDE GREEN AND YELLOW.

Put the HALF SECOND DELAY on a separate listing sheet, label it HALF SECOND DALAY.

Put the 6 and 2 SECOND DELAY routines on a separate listing sheet, label it 2 AND SECOND DELAYS.

Posted Date: 3/19/2013 2:47:50 AM | Location : United States







Related Discussions:- Build an intersection traffic light using the led, Assignment Help, Ask Question on Build an intersection traffic light using the led, Get Answer, Expert's Help, Build an intersection traffic light using the led Discussions

Write discussion on Build an intersection traffic light using the led
Your posts are moderated
Related Questions
Program Counter (PC) It is a   16 bit  register.  It is a memory  pointer. It stores  the memory address  of the next  byte of the program to be executed. Memory  address is of

Q. Frequency-controlled induction-motor drives ? The converters employed for variable-frequency drives can be classified as: • Voltage-source inverter (which is the only one

how does Proportional band affect the performance of control system?

Q. Explain about Differentiator? Shown in Figure is a differentiator which is obtained by replacing R1 in the inverting amplifier of Figure by a capacitor C. Assuming ideal op-

kindly tell me which text book is usefull forlearn the basic electricle.

Q. A 230-V, single-phase, 60-Hz source supplies two loads in parallel. One draws 10 kVA at a lagging power factor of 0.80 and the other draws 6 kWat a lagging power factor of 0.90.

Advantages of High  level  Languages a.It is  easy  to learn  write and debug  the program  written in high  level  languages. b.Programs are more  legible as compared to m

Octal to binary Conversion Conversion form  octal to binary  is the reverse  of this process. Express each  octal digit  in three bit  binary  equivalent. Ex. Convert 3576

What is TPA (transient program area)? The memory system is divided in three major parts: transient program area, System is and XMS that is extended memory system.