Find a single chip microcomputer course design traffic light

Updated on technology 2024-08-06
4 answers
  1. Anonymous users2024-02-15

    org 0000h

    main:mov dptr,#0ff20hmov a,#03h

    movx @dptr,a

    mov 2ah,#1fh

    mov p1,#0ch

    mov r7,#19h

    prg1: lcall delay1

    djnz r7,prg1

    mov p1,#0ah

    mov r7,#05h

    prg2: lcall delay1

    djnz r7, prg2

    mov p1,#21h

    mov 2ah,#1fh

    mov r7, #19h

    pgr3: lcall delay1

    djnz r7,pgr3

    mov p1,#11h

    mov r7,#05h

    pgr4: lcall delay1

    djnz r7, pgr4

    ajmp main

    delay1:dec 2ah

    mov a,2ah

    mov b,#0ah

    div ab

    mov dptr,#tab

    movc a,@a+dptr

    mov r2,a

    mov a, b

    mov dptr ,#tab

    movc a,@a+dptr

    mov r1,a

    mov r6,#64h

    loop: mov a,r2

    mov r4,#02h

    lcall display

    mov a,r1

    mov r4,#01h

    lcall display

    djnz r6,loop

    rettab: db 0c0h,0f9h,0a4h,0b0h,99hdb 92h,82h,0f8h,80h,90hdisplay:mov r0,#0d0h

    mov r5,a

    display1:mov a,r5

    mov dptr,#0ff22h

    movx @dptr,a

    mov dptr,#0ff21h

    mov a,r4

    movx @dptr,a

    djnz r0,display1

    retend

    Similar to your title, you can refer to it if you look at it.

  2. Anonymous users2024-02-14

    It's just 20 points too little, and other people are going to die.

  3. Anonymous users2024-02-13

    This is the problem of the timer, not the problem of the counter, and the biggest gain is to practice the timing control, because the core of the microcontroller is to output the control signal, and the core of the control signal is to output the control signal according to the established timing.

  4. Anonymous users2024-02-12

    It's the problem with counters. Countdown, how many seconds this light is on, how many seconds the next light is on. Or make a variable, the initial value can be set by yourself.

Related questions
5 answers2024-08-06

Hello: I wrote the program:

#include >>>More

11 answers2024-08-06

Hardware--- 8051 microcontroller.

The workload is too much, and my graduation project is to use a single-chip microcomputer to control lighting. >>>More

16 answers2024-08-06

Isn't this thing just a digital tube displaying 16 digits? Prompt you 16 times to get there, let go after you think to press the stop button. If so, the procedure is available for reference: >>>More

5 answers2024-08-06

;When debugging, you need to change the Chinese punctuation marks to English punctuation marks, otherwise the out of memory prompt message will appear. >>>More

5 answers2024-08-06

The above answer is fine.