8051 – TRAINER BOARD
8051 Lab Trainer kit is proposed to smooth the progress of learning and developing designs of MCU from Intel and NXP. It has the facility to connect PC’s 101/104 Keyboard, to enter user programs in Assembly languages. Serial communication achieved using 8051. It also supports C & assembly language in standalone kit (P89V51RD2). It’s designed as to facilitate On-board Programmer for NXP 8051 MCU through ISP on serial port.
TRAFFIC LIGHT CONTROL
Traffic lights, which may also be known as stoplights, traffic lamps, traffic signals, signal lights, robots or semaphore, are signaling devices positioned at road intersections, pedestrian crossings and other locations to control competing flows of traffic.
INTERFACING TRAFFIC LIGHT WITH 8051
The Traffic light controller section consists of 12 Nos. point LEDS are arranged by 4Lanes in Traffic light interface card. Each lane has Go (Green), Listen (Yellow) and Stop (Red) LED is being placed.
ABOUT THE COLORS OF TRAFFIC LIGHT CONTROL
Traffic lights alternate the right of way of road users by displaying lights of a standard color (red, yellow/amber, and green), using a universal color code (and a precise sequence to enable comprehension by those who are color blind).
In the typical sequence of colored lights:
- Illumination of the green light allows traffic to proceed in the direction denoted,
- Illumination of the yellow/amber light denoting, if safe to do so, prepare to stop short of the intersection, and
- Illumination of the red signal prohibits any traffic from proceeding. Usually, the red light contains some orange in its hue, and the green light contains some blue, for the benefit of people with red-green color blindness, and “green” lights in many areas are in fact blue lenses on a yellow light (which together appear green).
PIN ASSIGNMENT WITH 8051
CIRCUIT DIAGRAM TO INTERFACE TRAFFIC LIGHT
ASSEMBLY PROGRAM TO INTERFACE TRAFFIC LIGHT
***************************************************************************************
Title : Program to interface Traffic Light with 8051
***************************************************************************************
CNTL PORT :4003
PORT A :4000 PORT B :4001
MEMORY ADDRESS | OPCODE | MNEMONICS |
8500 | 9085 45 | START:MOV DPTR,#TRE |
8503 | 7A 0C | MOV R2,#0C |
8505 | E0 | MOVX @DPTR,A |
8506 | C0 83 | PUSH DPH |
8508 | C0 83 | PUSH DPL |
850A | 90 40 03 | MOV DPTR,#CNTL PORT |
850D | F0 | MOVX @DPTR,A |
850E | D0 82 | POP DPL |
8510 | D0 83 | POP DPH |
8512 | A3 | INC DPTR |
8513 | E0 | LOOP1:MOVX @DPTR,A |
8514 | C0 83 | PUSH DPH |
8516 | C0 82 | PUSH DPL |
8518 | 90 40 00 | MOV DPTR,#PORTA |
851B | F0 | MOVX @DPTR,A |
851C | D0 82 | POP DPL |
851E | D0 83 | POP DPH |
8520 | A3 | INC DPTR |
8521 | E0 | MOVX @DPTR,A |
8522 | C0 83 | PUSH DPH |
8524 | C0 82 | PUSH DPL |
8526 | 90 40 01 | MOV DPTR,#PORTB |
8529 | F0 | MOVX @DPTR,A |
852A | 12 85 36 | LCALL DELAY |
852D | D0 82 | POP DPL |
852F | D0 83 | POP DPH |
8531 | A3 | INC DPTR |
8532 | DA DF | DJNZ R2,LOOP1 |
8534 | 80 CA | SJMP START |
8536 | 7F 10 | DELAY:MOV R7,#10H |
8538 | 7D FF | LOOP4:MOV R5,#0FFH |
853A | 7E FF | LOOP3:MOV R6,#0FFH |
853C | 00 | LOOP2:NOP |
853D | 00 | NOP |
853E | DE FC | DJNZ R6, LOOP2 |
8540 | DD F8 | DJNZ R5, LOOP3 |
8542 | DF F4 | DJNZ R7, LOOP4 |
8544 | 22 | RET |
TRE: 8600
8601 21H,09H,10H,00H (SOUTH WAY)
8605 0CH,09H,80H,00H (EAST WAY)
8609 64H,08H,00H,04H (NOURTH WAY)
860D 24H,03H,02H,00H (WEST WAY)
8611 END
NOTE: The schematics sections given is, Traffic light connected to port 1 and Port 3 The sample program is Given based on 8255