Build an intersection traffic light using the led, Electrical Engineering

Assignment Help:

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.


Related Discussions:- Build an intersection traffic light using the led

Fet operation, FET operation: Figure: I-V characteristics and o...

FET operation: Figure: I-V characteristics and output plot of a JFET n-channel transistor. The FET manages the flow of electrons (or electron holes) from the sourc

Refrigeration and airconditioning, Ask question #Minimum 100 words acceptTh...

Ask question #Minimum 100 words acceptThere are various refrigeration systems employing various methods. State any seven (7) refrigeration systems, mention the method(s) employed t

Determine the thevenin and norton equivalent circuits, Q. (a) Determine the...

Q. (a) Determine the Thévenin and Norton equivalent circuits as viewed by the load resistance R in the network of Figure. (b) Find the value of R if the power dissipated by R is

Show that the force exerted on each charge, Q. Consider two 1-C charges sep...

Q. Consider two 1-C charges separated by 1 min free space. Show that the force exerted on each is about one million tons.

Telecommunication, Design a low noise amplifier using an Infineon RF transi...

Design a low noise amplifier using an Infineon RF transistor BFP640. The amplifier is to be used to amplify the L2 GPS signal and so the centre frequency is 1227MHz and bandwidth 4

Define amplification factor, Q. Define amplification factor? Amplifica...

Q. Define amplification factor? Amplification factor  μ It is the ratio of the drain -source voltage (ΔVDS) to the change in the gate to source voltage (ΔV GS ) at constan

Voltage tripler and quadrupler, Voltage Tripler and Quadrupler: Voltag...

Voltage Tripler and Quadrupler: Voltage Tripler an extension of the half wave voltage across each diode is 2Vm as it is for the filter capacitor circuit. It should be obvious

Define memory for a digital computer, Q. Define Memory For a digital comput...

Q. Define Memory For a digital computer? For a digital computer which stores both programs and data, memory can be divided into three types: random-access memory, mass storage,

Transistor, Transistor A transistor is a semiconductor device that is ...

Transistor A transistor is a semiconductor device that is employed to amplify and switch electronic signals. It is made up of a solid piece of semiconductor material, with min

What is absolute permittivity, Absolute permittivity (ε):  Permittivity ...

Absolute permittivity (ε):  Permittivity is a capacitance or ability to kept energy of a capacitor.  A force was also generated, called as electric force and the symbol. It d

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd