Thông báo

Collapse
No announcement yet.

giúp em mạch led ma trận

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

  • giúp em mạch led ma trận

    em tìm thấy cái này trên mạng
    http://www2.hcmuaf.edu.vn/contents.p...=nguyenbavuong
    nhưng trong chương trình ở chỗ chống lem,em không thấy nhãn DDD,em chạy mô phỏng cũng không đúng.có anh nào giúp em với.thanks nhiều.
    đây là code
    $MOD51

    ORG 00H

    MAIN:

    MOV DPTR,#DATABASE ;DIA CHI NAP DU LIEU

    AAA:

    MOV R0,#5 ;TOC DO HIEN KY TU

    BBB:

    LCALL SCANDATA ;NAP DU LIEU

    DJNZ R0,BBB

    INC DPTR

    MOV A,DPL

    MOV R1,DPH

    CJNE R1,#02H,AAA ;KIEM TRA KET THUC CHUOI ?

    CJNE A,#25H,AAA

    SJMP MAIN





    SCANDATA:

    PUSH ACC

    PUSH 00H

    PUSH 01H

    MOV R0,#00H ;DIA CHI DU LIEU DAU TIEN TRON DATABASE

    MOV R1,#01H ;HIEN THI RA COT DAU TIEN

    SCAN:

    MOV A,R0

    MOVC A,@A+DPTR ;NAP DU LIEU TU DATABASE VAO A

    MOV P2, A ;HIEN THI RA DONG TUONG UNG

    MOV P1,R1 ;HIEN THI RA COT DAU TIEN

    LCALL DELAY5MS ;CHUONG TRINH TAO TRE 5 MS

    MOV R4,#40H ;CHONG LEM

    MOV P1,#00H

    DJNZ R4,DDD

    INC R0 ;HIEN THI DU LIEU KE TIEP

    MOV A,R1 ;CHUYEN SANG COT KE TIEP

    RL A

    MOV R1,A

    CJNE R0,#8H,SCAN ;KIEM TRA QUET COT THU 8 CHUA

    POP 01H

    POP 00H

    POP ACC

    RET



    DELAY5MS:

    PUSH 00H

    PUSH 01H

    MOV R1,#10

    CCC:

    MOV R0,#250

    DJNZ R0,$

    DJNZ R1,CCC

    POP 01H

    POP 00H

    RET



    DATABASE:

    DB 00H,00H,00H,00H,00H,00H ;"KHOANG TRANG"

    DB 02H,02H,0FEH,02H, 02H,00H ;"T"

    DB 0FEH,12H, 32H,52H, 8CH,00H ;"R"

    DB 7EH,80H, 80H,80H, 7EH,00H ;"U"

    DB 7CH,82H, 82H,82H, 7CH,00H ;"O"

    DB 0FEH,04H, 08H,10H,0FEH,00H ;"N"

    DB 7CH,82H, 92H,92H, 74H,00H,00H,00H ;"G"



    DB 10H,0FEH,92H,82H, 82H,7CH,00H ;"D"

    DB 0FCH, 22H,22H,22H,0FCH,00H ;"A"

    DB 82H,0FEH,82H,00H, 00H,00H ;"I"



    DB 0FEH,10H,10H,10H,0FEH,00H ;"H"

    DB 7CH,82H,82H,82H, 7CH,00H ;"O"

    DB 7CH,82H,82H,82H, 44H,00H,00H,00H ;"C"



    DB 7CH,82H,82H,82H, 44H,00H ;"C"

    DB 7CH,82H,82H,82H, 7CH,00H ;"O"

    DB 0FEH,04H,08H,10H,0FEH,00H ;"N"

    DB 7CH,82H,92H,92H, 74H,00H,00H,00H ;"G"



    DB 0FEH, 04H,08H,10H,0FEH,00H ;"N"

    DB 7CH, 82H,92H,92H, 74H,00H ;"G"

    DB 0FEH, 10H,10H,10H,0FEH,00H ;"H"

    DB 82H,0FEH,82H,00H ;"I"

    DB 0FEH, 92H,92H,92H, 82H,00H ;"E"

    DB 0FEH, 12H,12H,12H, 0CH,00H,00H,00H ;"P"



    DB 02H,02H,0FEH,02H, 02H,00H ;"T"

    DB 0FEH,12H, 12H,12H, 0CH,00H ;"P"

    DB 80H,00H ;"."

    DB 0FEH,10H, 10H,10H,0FEH,00H ;"H"

    DB 7CH,82H, 82H,82H, 44H,00H ;"C"

    DB 0FEH,04H, 08H,04H,0FEH,00H,00H ;"M"



    DB 10H,10H,10H,00H,00H ;"-"



    DB 0FEH,10H,28H,44H, 82H,00H ;"K"

    DB 0FEH,10H,10H,10H,0FEH,00H ;"H"

    DB 7CH,82H,82H,82H, 7CH,00H ;"O"

    DB 0FCH,22H,22H,22H,0FCH,00H,00H,00H ;"A"



    DB 7CH,82H,82H,82H, 44H,00H ;"C"

    DB 7CH,82H,82H,82H, 7CH,00H ;"O"

    DB 0FEH,04H,08H,10H,0FEH,00H ;"N"

    DB 7CH,82H,92H,92H, 74H,00H,00H,00H ;"G"



    DB 0FEH,04H,08H,10H,0FEH,00H ;"N"

    DB 7CH,82H,92H,92H, 74H,00H ;"G"

    DB 0FEH,10H,10H,10H,0FEH,00H ;"H"

    DB 0FEH,92H,92H,92H, 82H,00H,00H,00H ;"E"



    DB 10H,0FEH,92H,82H, 82H,7CH,00H ;"D"

    DB 82H,0FEH,82H,00H ;"I"

    DB 0FEH, 92H,92H,92H, 82H,00H ;"E"

    DB 0FEH, 04H,08H,10H,0FEH,00H,00H,00H ;"N"



    DB 02H,02H,0FEH,02H,02H,00H ;"T"

    DB 7EH,80H, 80H,80H,7EH,00H,00H ;"U"



    DB 10H,10H,10H,00H,00H ;"-"



    DB 4CH,92H, 92H,92H, 64H,00H ;"S"

    DB 3EH,40H, 80H,40H, 3EH,00H ;"V"

    DB 02H,02H,0FEH,02H, 02H,00H ;"T"

    DB 0FEH,10H, 10H,10H,0FEH,00H ;"H"

    DB 44H, 00H,00H ;":"



    DB 0FEH,80H,80H,80H,80H,00H ;"L"

    DB 7EH,80H,80H,80H,7EH,00H ;"U"

    DB 7EH,80H,80H,80H,7EH,00H,00H,00H ;"U"



    DB 02H, 02H,0FEH,02H, 02H,00H ;"T"

    DB 82H,0FEH, 82H,00H ;"I"

    DB 0FEH, 92H, 92H,92H, 82H,00H ;"E"

    DB 0FEH, 04H, 08H,10H,0FEH,00H,00H,00H ;"N"



    DB 10H,0FEH, 92H,82H, 82H,7CH,00H ;"D"

    DB 0FCH, 22H, 22H,22H,0FCH,00H ;"A"

    DB 02H, 02H,0FEH,02H, 02H,00H,00H,00H ;"T"



    DB 10H,10H,10H,00H,00H ;"-"



    DB 0FEH, 04H, 08H,04H,0FEH,00H ;"M"

    DB 4CH, 92H, 92H,92H, 64H,00H ;"S"

    DB 4CH, 92H, 92H,92H, 64H,00H ;"S"

    DB 3EH, 40H, 80H,40H, 3EH,00H ;"V"

    DB 44H, 00H ;":"



    DB 7CH, 82H, 82H,82H,7CH,00H ;"0"

    DB 4EH, 8AH, 8AH,8AH,72H,00H ;"5"

    DB 7CH, 82H, 82H,82H,7CH,00H ;"0"

    DB 8CH,0C2H,0A2H,92H,8CH,00H ;"2"

    DB 7CH, 82H, 82H,82H,7CH,00H ;"0"

    DB 44H, 92H, 92H,92H,6CH,00H ;"3"

    DB 4CH, 92H, 92H,92H,7CH,00H,00H,00H ;"9"



    END

  • #2
    hi cái này tui có dùng rồi chỗ chông lem báo sai liên tục
    bạn cứ xóa đi là chạy dc ko vấn đề gì nó ko quan trọng
    8051 là con em viết thành thạo. em sẵn sàng giúp đỡ các pác nếu em có thể
    liên lạc với em qua địa chi email: Mob: 01882.076.989

    Comment


    • #3
      mình thấy kiến thức quang báo của các bạn hạn chế quá, nếu được mình sẽ hướng dẫn cho các bạn chi tiết hơn, sdt 0987324303 có gì cứ gọi nha
      --------------------------------------------
      --- cung cấp đèn led, linh kiện điện tử---
      -

      Comment


      • #4
        thanks bạn.bạn có tài code và mach nguyên lí thì share cho mình tham khảo với

        Comment


        • #5
          oh có người giúp rồi
          em có cái code thế này :
          Code:
          ; <sfr51.inc>
          #define SCL P2.1
          #define SDA P2.0
          #define RUN_DATA 40H
          #define MOC 41H
          #define BIEN_32 42H
          #define TIME_BACK 43H
          TIME_MOVE EQU 44H
          
          
          ORG 0000H
          MAIN:
          		DONG1:
          		     LCALL    SCAN    
          		     DJNZ   R0, DONG1
          		     MOV    DPTR,#VINHPHAT
          		M1:    
          		     MOV    R0,#2  
          		M2: 
          			LCALL SCAN ;NAP DU LIEU
          			DJNZ R0,M2
          			INC DPTR
          			MOV A,DPL
          			CJNE A,#LOW(VINHPHAT+50),M1
          
          ;=============================================
          ;=============================================
          
          BACK1: ; MAIN
          MOV RUN_DATA,MOC
          MOV A,RUN_DATA
          MOV TIME_BACK,TIME_MOVE
          ;=====================
          BACK3:
          MOV A,RUN_DATA
          MOVC A,@A+DPTR
          MOV P3,A
          LCALL DELAY
          MOV P3,#0FFH
          ;============
          CLR SCL
          NOP
          SETB SCL
          ;============
          INC RUN_DATA
          MOV A,RUN_DATA
          CJNE A,#200,DEM_32_LAN
          MOV RUN_DATA,#0
          DEM_32_LAN:
          INC BIEN_32
          MOV A,BIEN_32
          CJNE A,#100,BACK3
          MOV RUN_DATA,MOC
          MOV BIEN_32,#0
          ;============================
          SETB SDA
          CLR SCL
          NOP
          SETB SCL
          CLR SDA
          ;=============
          DJNZ TIME_BACK,BACK3
          INC MOC
          MOV A,MOC
          CJNE A,#92,THOAT
          MOV MOC,#0
          THOAT:
          SJMP BACK1
          ;=============================================
          SCAN:
          
          MOV TIME_MOVE,#1
          SETB SDA ; START
          CLR SCL
          SETB SCL
          CLR SDA
          MOV RUN_DATA,#2 ; DEFAUL
          MOV MOC,#2
          MOV BIEN_32,#0
          
          ;=================================
          DELAY:
          MOV R6,#255
          delay1:
          nop 
          nop
          DJNZ R6,delay1
          RET
          ;========================
          VINHPHAT:
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB     7H,3H,0FDH,0FEH,0FDH,3H,7H                                     ;V
          DB     0FFH  
          DB     0H,0H,0FFH                                                                      ;I
          DB     0H,0H,0BFH,0DFH,0EFH,0H,0H                                        ;N
          DB     0FFH 
          DB     0H,0H,0F7H,0F7H,0F7H,0H,0H                                         ;H
          DB     0FFH,0FFH ,0FFH  
          
          DB 0FFH,0FFH,0FFH,0FFH
          DB     0H,0H,77H,77H,7H,8FH,0FFH                                          ;P
          DB     0FFH 
          DB     0H,0H,0F7H,0F7H,0F7H,0H,0H                                         ;H
          DB     0FFH  
          DB     0E0H,0C0H,0B7H,77H,0B7H,0C0H,0E0H                          ; A
          DB     0FFH      
          DB     7FH,7FH,0H,0H,7FH,7FH,0FFH                                       ;T
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
          KINH :
          DB     0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH,0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH  ;HOA 
          DB     0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH,0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH  ;HOA 
          DB     0H,0H,0E7H,0DBH,0BDH,7EH,0FFH                                 ;K   
          DB     0FFH,0H,0H,0FFH                                                             ;I
          DB     0H,0H,0BFH,0DFH,0EFH,0H,0H,0FFH                              ;N
          DB     0H,0H,0F7H,0F7H,0F7H,0H,0H,0FFH                                 ;H
          DB     0FFH,0FFH                                                                     ;CACH
          DB     81H,0H,7EH,7EH,7EH,0BDH,0FFH                                     ;C
          DB     0H,0H,0F7H,0F7H,0F7H,0H,0H,0FFH                                  ;H
          DB     0E0H,0C0H,0B7H,77H,0B7H,0C0H,0E0H,0FFH                   ;A
          DB     81H,0H,7EH,7EH,7EH,0H,81H,0FFH                                    ;O
          DB     0FFH,0FFH                                                                     ;CACH
          DB     81H,0H,7EH,7AH,7CH,0H,80H,0FEH                                  ;Q
          DB     1H,0H,0FEH,0FEH,0FEH,0H,1H,0FFH                               ;U
          DB     0FH,7H,0F0H,0F0H,7H,0FH,0FFH                                      ;Y
          DB     0FFH,0FFH                                                                     ;CACH
          DB     0H,0H,0E7H,0DBH,0BDH,7EH,0FFH                                 ;K   
          DB     0H,0H,0F7H,0F7H,0F7H,0H,0H,0FFH                                 ;H
          DB     0E0H,0C0H,0B7H,77H,0B7H,0C0H,0E0H,0FFH                   ;A
          DB     81H,0H,7EH,7EH,7EH,0BDH,0FFH                                     ;C
          DB     0H,0H,0F7H,0F7H,0F7H,0H,0H,0FFH                                  ;H
          DB     0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH,0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH  ;HOA
          DB     0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH,0FFH,0FFH,0DBH,0E7H,81H,0E7H,0DBH,0FFH,0FFH  ;HOA
          
          END
          và mạch như thế này :
          em ko bit làm cách nào để tăng số byte hiển thị
          và tăng thêm 1 dòng nữa
          ai bít giúp em với
          Last edited by hoangphat; 09-07-2009, 11:06.
          8051 là con em viết thành thạo. em sẵn sàng giúp đỡ các pác nếu em có thể
          liên lạc với em qua địa chi email: Mob: 01882.076.989

          Comment

          Về tác giả

          Collapse

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

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

          Collapse

          Đang tải...
          X