A novel automobile tail light indicator made with AT89C2051

This paper introduces a novel car taillight indicator. The indicator consists of a special LED array. There are eight groups, each group is illuminated by nine LEDs and placed on the rear glass window of the car. There are five display states. When there is a parking or braking signal, the eight groups of LEDs are all dots. When there is a back signal, the LEDs are flashing. When there is a danger signal, the eight groups of LEDs are divided into two groups. When the signal is turned right, the four groups of LEDs on the right side are illuminated from the middle to the right. When there is a left turn signal, the four groups of LEDs on the left side are illuminated from the middle to the left, and repeat when the turn signal does not disappear. Chic, giving people a new and pleasing feeling.

This article refers to the address: http://

The AT89C2051 chip used in this device is an MSC-51-compatible high-performance processor manufactured by Atmel with its own 2KB programmable flash memory. It has the same core and similar structure functions as the conventional 51 chip, such as RAM, timing/counter, interrupt structure, serial port, oscillator and clock circuit; there are oscillation frequencies up to 24MHz, and there are fewer Streamlined I/O ports, so they are small, making them ideal for small applications.

The assembler and detailed comments are as follows:

STOP BIT 32H; brake sign

DANGE BIT 33H; danger sign

BACK BIT 34H ; reversing sign

RIGHT BIT 35H; turn right sign

LEFT BIT 36H; left turn sign

FLASH BIT 37H; flashing logo

LRSET BIT 38H ;

COUNT EQU 32H ;

ORG 0000H

AJMP MAIN; jump main program

ORG 0030H

AJMP MAIN

MAIN: NOP

MOV R0, #20H ; 20H to 60H unit clear

MOV A, #0

RES: MOV @R0,A

INC R0

CJNE R0, #60H,RES

MOV SP, #60H ; set the stack pointer to 60H

MOV COUNT, #0 ; clear cycle counter

CLR TIME_OUT ; clear timing time to sign

CLR EA

CLR RIGHT; clear right turn sign

CLR STOP; clear brake sign

CLR DANGE; clear danger sign

CLR BACK; clear reverse sign

CLR LEFT; clear left turn sign

CLR LRSET; clear lights up in turn

LOP: ACALL DL1; call delay subroutine

ACALL DL1; call delay subroutine

CPL FLASH; flashing flag is reversed

JNB LRSET, LOP1; no lighting indicator in turn to LOP1

INC COUNT ; in turn up the counter plus 1

MOV A, COUNT

CJNE A, #5, LOP1

MOV COUNT, #0; count to 5 clear

LOP1: ACALL CL ; call process processing subroutine

LOPA: ACALL KEY; call button processing subroutine

AJMP LOP ; return to the main loop

DL1 : MOV R6, #200 ; Delay subroutine

DL11: MOV R5, #250

DJNZ R5, $

DJNZ R6, DL11

RET

CL: NOP; process processing subroutine

JNB STOP, CL1

MOV A, #0FFH; parking or brake sign

CPL A ; display is fully illuminated

MOV P1, A

AJMP CLE

CL1: JNB DANGE, CL2

JB FLASH, CL11; dangerous sign

MOV A, #0FH ; the left and right sets of monitors flash alternately

MOV P1, A

AJMP CLE

CL11: MOV A, #0F0H

MOV P1, A

AJMP CLE

CL2: JNB BACK, CL3

JB FLASH, CL21; with reverse sign

MOV A, #0FFH; display is full or full

MOV P1, A; display is fully illuminated

AJMP CLE

CL21: MOV A, #00H

MOV P1, A; display is completely off

AJMP CLE

CL3: JNB RIGHT, CL4

MOV DPTR, #RIGHT_CHAR; have a right turn sign

MOV A, COUNT; the right four groups of light-emitting arrays are sequentially cycled

MOVC A, @A+DPTR ; take display value

CPL A

MOV P1, A

AJMP CLE

CL4: JNB LEFT, CL5

MOV DPTR, #LEFT_CHAR; has a left turn sign

MOV A, COUNT; the four groups of light-emitting arrays on the left are sequentially cycled

MOVC A, @A+DPTR ; take display value

CPL A

MOV P1, A

AJMP CLE

CL5: MOV A, #0 ; if there is no mark, turn off the display

CPL A

MOV P1, A

CLE: RET

KEY: NOP ; button processing subroutine

CLR STOP ; Clear stop flag

CLR DANGE ; Clear hazard sign

CLR BACK ; Clear backing sign

CLR RIGHT ; Clear right turn sign

CLR LEFT ; Clear left turn sign

JNB P3.2, KEY1

SETB STOP ; P3.2 has a key press, set the stop sign

AJMP KEYE

KEY1: JNB P3.3, KEY11

SETB DANGE ; P3.3 has a key press, set the danger sign

KEY11: MOV A, P3

CJNE A, #22H, KEY2

SETB DANGE ; P3.5 P3.1 Press simultaneously to set the danger sign

AJMP KEYE

KEY2: JNB P3.4, KEY3

SETB BACK; P3.4 has a key press, put the reverse sign

AJMP KEYE

KEY3: JNB P3.5, KEY4

SETB RIGHT ; P3.5 has a key press, set the right turn flag

JB LRSET, KEYE

SETB LRSET ; set left and right cycle display flag

MOV COUNT, #0 ; loop display counter clear

AJMP KEYE

KEY4: JNB P3.1, KEY5

SETB LEFT; P3.1 has a key press, set the left turn flag

JB LRSET, KEYE

SETB LRSET ; set left and right cycle display flag

MOV COUNT, #0 ; loop display counter clear

AJMP KEYE

KEY5: CLR LRSET; clear left and right cycle display flag

KEYE: RET

LEFT_CHAR: DB 00H, 10H, 30H, 70H, 0F0H; light values ​​from right to left

RIGHT_CHAR: DB 00H, 08H, 0CH, 0EH, 0FH; light values ​​from left to right

Cordless Air Pump

Cordless Tyre Inflator,Cordless Handheld Car Air Pump,Best Cordless Tyre Inflator,Cordless Air Compressor Handheld

SHENZHEN SMARTNEWO TECHNOLOGY CO,. LTD , https://www.newopump.com