Thông báo

Collapse
No announcement yet.

Lam quen 89C51-Ung dung led

Collapse
X
 
  • Lọc
  • Giờ
  • Show
Clear All
new posts

  • Lam quen 89C51-Ung dung led

    Chào các bạn! Minh đang tập làm quen ung dung 89c51:
    Viet ct điều khiển 1 led nhap nhay tại P0.0. Tưởng chừng đơn giản nhưng khi làm thì led tại
    P0.0 tắt mà không nháy? Đã thử kiểm tra thay đổi nhiều lần delay để tăng giảm thời gian về Code, mà led vẫn không nháy. Đây là Code CT viết = asem dùng phàn mềm ride, mong các bạn giúp đỡ ??? Không biết sai ở code, hay do mạch?
    ;Chuong trinh dieu khien LED noi P0.0 chop tat lien tuc
    $include(reg51.inc)
    ORG 0000H
    LOOP:
    ;xoa P0.0 xuong 0
    ;Goi chuong trinh con DELAY
    ;bat P0.0
    ;Goi chuong trinh con DELAY
    ;--------------------------
    clr P0.0
    acall DELAY
    setb P0.0
    acall DELAY
    ;--------------------------
    SJMP LOOP
    ;Chuong trinh con DELAY
    DELAY:

    mov r6,#1000
    dl1: mov r7,#2000
    djnz r7,$
    djnz r6,dl1

    RET
    END

  • #2
    Nguyên văn bởi tyboauto Xem bài viết
    Chào các bạn! Minh đang tập làm quen ung dung 89c51:
    Viet ct điều khiển 1 led nhap nhay tại P0.0. Tưởng chừng đơn giản nhưng khi làm thì led tại
    P0.0 tắt mà không nháy? Đã thử kiểm tra thay đổi nhiều lần delay để tăng giảm thời gian về Code, mà led vẫn không nháy. Đây là Code CT viết = asem dùng phàn mềm ride, mong các bạn giúp đỡ ??? Không biết sai ở code, hay do mạch?
    ;Chuong trinh dieu khien LED noi P0.0 chop tat lien tuc
    $include(reg51.inc)
    ORG 0000H
    LOOP:
    ;xoa P0.0 xuong 0
    ;Goi chuong trinh con DELAY
    ;bat P0.0
    ;Goi chuong trinh con DELAY
    ;--------------------------
    clr P0.0
    acall DELAY
    setb P0.0
    acall DELAY
    ;--------------------------
    SJMP LOOP
    ;Chuong trinh con DELAY
    DELAY:

    mov r6,#1000
    dl1: mov r7,#2000
    djnz r7,$
    djnz r6,dl1

    RET
    END
    thế bác có treo điện trở cho Port0 không đấy...ko có thì nó ko chạy là đúng rồi,chương trình ko sai đâu

    Comment


    • #3
      Rn tối đa chỉ 8 bit tức 255 giá trị sao ghi j dữ vậy?
      Mạch nạp Pickit 2 SE ---> 170k BH 1 năm
      Pic 18F2550 PDIP Thailand bao test 60K/1c


      Comment


      • #4
        ;..:: BAN QUYEN : HUNG TRUNG THINH ::..
        ;PHAN MEM LAP TRINH LED DON CHO DONG CHIP 8051

        PWM EQU R6
        B_GIAY EQU R7
        ORG 0000H
        JMP MAIN
        ORG 00BH
        JMP NGAT_T0
        MAIN:
        MOV TMOD,#01H
        MOV TH0,#0FFH
        MOV TL0,#0F2H
        CLR TF0
        SETB TR0
        MOV IE,#82H
        MAIN1:
        MOV P0,#00000001b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000010b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00001000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00001100b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00011000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00100000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#01000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#10000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000010b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000100b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00001000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#11111111b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#01111111b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00111111b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00011111b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00001111b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00000111b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00000011b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00000001b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#11111111b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#01111111b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00111111b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00011111b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00001111b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00000111b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00000011b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#11111111b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#01111111b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00111111b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00011111b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00001111b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00000111b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00000011b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#11111111b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#01111111b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00111111b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00011111b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00001111b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000111b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000011b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000001b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000001b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000010b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00001000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000100b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00001000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00010000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00100000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#01000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#10000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000010b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000100b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00001000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00010000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00100000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#01000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#10000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000001b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000010b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000100b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00001000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00010000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00100000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#01000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#10000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000001b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000010b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00001000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000100b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00001000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00010000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00100000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#01000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#10000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000010b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000100b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00001000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00010000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00100000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#01000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#10000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000001b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000010b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000100b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00001000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00010000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00100000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#01000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#10000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000001b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000010b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00001000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000100b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00001000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00010000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00100000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#01000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#10000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000010b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000100b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00001000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00010000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00100000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#01000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#10000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000001b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000010b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000100b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00001000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00010000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00100000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#01000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#10000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000001b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000010b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00001000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000100b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00001000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00010000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00100000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#01000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#10000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000010b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000100b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00001000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00010000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00100000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#01000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#10000000b
        MOV P3,#00000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000001b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000010b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000100b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00001000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00010000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00100000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#01000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00000000b
        MOV P3,#10000000b
        MOV B_GIAY,#3
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000100b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00001000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00100000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00010000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00010000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00001000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00100000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000010b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#01000000b
        MOV P1,#00000000b
        MOV P2,#00000000b
        MOV P3,#00000001b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#10000000b
        MOV P1,#00000000b
        MOV P2,#10000000b
        MOV P3,#00000001b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#01000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000001b
        MOV P2,#00100000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00010000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000010b
        MOV P2,#00001000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000100b
        MOV P2,#00000100b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00000100b
        MOV P2,#00000010b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#00001000b
        MOV P2,#00000001b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#10001000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        MOV P0,#00000000b
        MOV P1,#01000000b
        MOV P2,#00000000b
        MOV P3,#00000000b
        MOV B_GIAY,#7
        LCALL DELAY
        JMP MAIN1

        DELAY:
        D: MOV R5,#8
        DD:
        MOV PWM,#0
        DDD: CJNE PWM,#100,DDD
        DJNZ R5,DD
        DJNZ B_GIAY,D
        RET

        NGAT_T0:
        MOV TH0,#0FFH
        MOV TL0,#0F2H
        INC PWM
        RETI
        END



        Một hiệu ứng làm cảm hứng ... BẠn dịch ra hex rồi nap vào chip chạy thử nha!
        Thiết bị truyền dẫn RF , các ứng dụng PLC , ARM , VXL ...

        Comment


        • #5
          Soft lập trình led đơn, dịch ra dc file.ASM và .HEx ok (tự làm ok)

          http://galaxyz.net/data/417375727878...%20don.rar.glx
          Mạch nạp Pickit 2 SE ---> 170k BH 1 năm
          Pic 18F2550 PDIP Thailand bao test 60K/1c


          Comment


          • #6
            Phần mềm này này đã từng post trên topic này rồi sau đó bị diễn đàn xóa vì bản quyền !.... vì nó là sản phẩm thương mại của công ty.. không có thông tin sản phẩm trong đó ! Ai dùng nó .. nó là bản lậu và đang có lỗi khi tạo trạng thái dạng binary..
            Thiết bị truyền dẫn RF , các ứng dụng PLC , ARM , VXL ...

            Comment


            • #7
              r6 và r7 chỉ là thanh ghi 8 bit thôi.dùng cái delay này nè,đúng 1 giây:
              DELAY1S:
              mov r1,#10
              loop1: mov r2,#100
              loop2: mov r3,#100
              loop3: nop
              nop
              nop
              nop
              nop
              nop
              nop
              nop
              djnz r3,loop3
              djnz r2,loop2
              djnz r1,loop1
              ret

              Comment


              • #8
                Nguyên văn bởi hungthinhqni Xem bài viết
                Phần mềm này này đã từng post trên topic này rồi sau đó bị diễn đàn xóa vì bản quyền !.... vì nó là sản phẩm thương mại của công ty.. không có thông tin sản phẩm trong đó ! Ai dùng nó .. nó là bản lậu và đang có lỗi khi tạo trạng thái dạng binary..
                Đây là phần mềm của quangvinhtech, họ nói tăng miễn phí nên chẳng có gì liên quan đến bản quyền (mình đã liên hệ cty rồi) Còn dịch thì nó báo lỗi nhưng nó vẫn ra file .Hex và .asm bình thường. AI thắc mắc cứ liên hệ với số dt trên soft sẽ rõ ràng

                Chúc vui
                Mạch nạp Pickit 2 SE ---> 170k BH 1 năm
                Pic 18F2550 PDIP Thailand bao test 60K/1c


                Comment


                • #9
                  cái đoạn code đẻ dịch led có thể dùng lệnh quay trái, quay phải cho nó ngắn ngọn hơn. chứ code nhiều quá nhìn chóng mặt lắm...

                  Comment


                  • #10
                    Đấy là phần mềm của Bác HẠnh.. Tui đã phát triển thêm khắc phục lỗi ! Nhưng vì mình gọi cho công ty của Quang Vinh thì họ bảo là phần mềm hai triệu dùng 1 năm ! tớ đã viết lại trạng thái và chẩn hơn về băm xung .. v2 khắc phục lỗi biên dịch rồi ! và mình sẽ thương mại nó ! rẽ hơn công Ty anh Vinh
                    Thiết bị truyền dẫn RF , các ứng dụng PLC , ARM , VXL ...

                    Comment


                    • #11
                      Mình nghĩ có lẽ là do Mạch dk gồm: P0 có nối tro thanh10K. P1,P2, P3 không nối. Dùng thạch anh 12Mhz+ 2tu 33p tạo xung nhịp, có thêm nút reset. Không biết có sai không? Liệu bạn leemanhtuan có sơ đồ mạch nào khác không để thí nghiệm được tất cả 4 Port led?
                      Last edited by tyboauto; 11-05-2010, 23:27.

                      Comment


                      • #12
                        mach điều khiển dùng thach anh 12MHz có gì khác khi dùng thach anh 11.0592Mhz ? Nó có liên quan tới thời gian delay trong chương trình không?
                        Last edited by tyboauto; 11-05-2010, 23:54.

                        Comment


                        • #13
                          Trong đoạn Delay1s của bạn hellangel022, cho mình hỏi: Cách tính thời gian delay 1s như thế nào vậy ?
                          Cám ơn.
                          Last edited by tyboauto; 11-05-2010, 23:19.

                          Comment


                          • #14
                            Nguyên văn bởi hungthinhqni Xem bài viết
                            ;..:: BAN QUYEN : HUNG TRUNG THINH ::..
                            ;PHAN MEM LAP TRINH LED DON CHO DONG CHIP 8051

                            PWM EQU R6
                            B_GIAY EQU R7
                            ORG 0000H
                            JMP MAIN
                            ORG 00BH
                            JMP NGAT_T0
                            MAIN:
                            MOV TMOD,#01H
                            MOV TH0,#0FFH
                            MOV TL0,#0F2H
                            CLR TF0
                            SETB TR0
                            MOV IE,#82H
                            MAIN1:
                            MOV P0,#00000001b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000010b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00001000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00001100b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00011000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00100000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#01000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#10000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000010b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000100b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00001000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#11111111b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#01111111b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00111111b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00011111b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00001111b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00000111b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00000011b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00000001b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#11111111b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#01111111b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00111111b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00011111b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00001111b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00000111b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00000011b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#11111111b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#01111111b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00111111b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00011111b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00001111b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00000111b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00000011b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#11111111b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#01111111b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00111111b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00011111b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00001111b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000111b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000011b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000001b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000001b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000010b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00001000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000100b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00001000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00010000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00100000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#01000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#10000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000010b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000100b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00001000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00010000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00100000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#01000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#10000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000001b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000010b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000100b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00001000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00010000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00100000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#01000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#10000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000001b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000010b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00001000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000100b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00001000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00010000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00100000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#01000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#10000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000010b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000100b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00001000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00010000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00100000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#01000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#10000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000001b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000010b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000100b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00001000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00010000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00100000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#01000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#10000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000001b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000010b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00001000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000100b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00001000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00010000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00100000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#01000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#10000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000010b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000100b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00001000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00010000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00100000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#01000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#10000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000001b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000010b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000100b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00001000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00010000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00100000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#01000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#10000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000001b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000010b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00001000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000100b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00001000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00010000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00100000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#01000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#10000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000010b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000100b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00001000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00010000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00100000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#01000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#10000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000001b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000010b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000100b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00001000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00010000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00100000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#01000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00000000b
                            MOV P3,#10000000b
                            MOV B_GIAY,#3
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000100b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00001000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00100000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00010000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00010000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00001000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00100000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000010b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#01000000b
                            MOV P1,#00000000b
                            MOV P2,#00000000b
                            MOV P3,#00000001b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#10000000b
                            MOV P1,#00000000b
                            MOV P2,#10000000b
                            MOV P3,#00000001b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#01000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000001b
                            MOV P2,#00100000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00010000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000010b
                            MOV P2,#00001000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000100b
                            MOV P2,#00000100b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00000100b
                            MOV P2,#00000010b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#00001000b
                            MOV P2,#00000001b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#10001000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            MOV P0,#00000000b
                            MOV P1,#01000000b
                            MOV P2,#00000000b
                            MOV P3,#00000000b
                            MOV B_GIAY,#7
                            LCALL DELAY
                            JMP MAIN1

                            DELAY:
                            D: MOV R5,#8
                            DD:
                            MOV PWM,#0
                            DDD: CJNE PWM,#100,DDD
                            DJNZ R5,DD
                            DJNZ B_GIAY,D
                            RET

                            NGAT_T0:
                            MOV TH0,#0FFH
                            MOV TL0,#0F2H
                            INC PWM
                            RETI
                            END



                            Một hiệu ứng làm cảm hứng ... BẠn dịch ra hex rồi nap vào chip chạy thử nha!
                            Cam on.Mình nghĩ CT nhấp nháy một led đơn giản mạch mình còn chưa chạy liệu CT của bạn dài như thế có chạy không? Minh chưa biết sai ở mạch hay CT? Mình đã sửa lại các giá trị cho thanh gi R6,R7 trong khoảng 255 nhưng vẫn không ăn thua????????
                            Tuy nhiên mã CT của bạn khiên mình tò mò:
                            Mình đang làm quen với VDK, mình không hiểu code ct bạn viết lắm nên cho mình hỏi:
                            1 Ct này khi hoạt động thì Led chạy như thế nào?
                            2 CT gồm các bước chính nào, và tương ứng các bước đó là những đoạn code gi?
                            Hì hì, nếu có j phiền vì hỏi nhiều, xin thứ lỗi nhe. Cám ơn

                            Comment


                            • #15
                              Cậu phân tích thật kỹ nhé ! Trạng thái duoc biễu diễn duoi dang binary ... tại mỗi port ngõ ra VD : p3 den p3.7... trang thai bieu den o muc 1 va 0.
                              Thiết bị truyền dẫn RF , các ứng dụng PLC , ARM , VXL ...

                              Comment

                              Về tác giả

                              Collapse

                              tyboauto Tìm hiểu thêm về tyboauto

                              Bài viết mới nhất

                              Collapse

                              Đang tải...
                              X