Thông báo

Collapse
No announcement yet.

Mạch điều khiển chạy chữ 2 chương trình dùng 89c51

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

  • Mạch điều khiển chạy chữ 2 chương trình dùng 89c51

    tôi đang cần làm mạch chạy chữ dung led ma trận.nhưng vấn đề là chạy 2 chương trinh khac biệt.Tôi dang muốn chạy chữ i love you và my love (2 chương trình khác nhau).hai chương trình này cùng hiển thị trên một dãy led ma trận.chạy chữ i love you trước,sau 3s thì chạy tiếp chương trình thứ 2(my love).Tôi chỉ biết làm chạy được 1 chương trình(1 dòng chữ tooi)chứ hôn là tôi không biết.
    mình dùng ma trận 8x8
    mong tất cả anh e trên diễn đàn giúp đỡ.tôi đang cần gấp.thanks

  • #2
    ko co ai giup toi a.moi nguoi oi giup toi

    Comment


    • #3
      1 con led matrix 8*8 hiển thị 1 dòng còn khó nữa là đòi chạy 2 dòng,vậy thì nhìn được cái gì,mở rộng led ra mới thấy rõ đc
      vanduc0211@gmail.com

      Comment


      • #4
        vang.duong nhien la toi se phai mo rong led roi.toi ghep cac matix 8x8 lai ma.nhung ma lap trinh lam sao de cung mot day led matrix do co the hien thi dc 2 chuong trinh khac nhau.vi du toi viet chuong trinh dau tien la i love you,chuong tinh 2 la my love.thi phai viet nhu the nao de chuong trinh 1 chay xong tiep theo lai co chuong trinh 2 chay tren cung day led matrix do .mong ban giup do.tui rat can.thanks

        Comment


        • #5
          toi kien thuc con kem mong cac ban chi chi tiet dum.ai co ban cod nao ko

          Comment


          • #6
            giúp đở

            bạn úp đoạn code cho mọi người cùng xem. viết ct 1, rùi viết ct 2, sau đó gọi chúng lên là ok, nhưng ct2 ko dc viết sau dòng end
            không tiếp nhận cuộc gọi qua điện thoại vì đi làm toàn tập, tính khí thất thường, hay nóng võ công lại cao

            Comment


            • #7
              Nguyên văn bởi 01642555134 Xem bài viết
              bạn úp đoạn code cho mọi người cùng xem. viết ct 1, rùi viết ct 2, sau đó gọi chúng lên là ok, nhưng ct2 ko dc viết sau dòng end
              vang.toi cung biet vax.nhung toi ko biet lam nhu the nao.toi hoi kem lam.mong ban co the chi ro hon cho tui,toi dang can lam.thanks
              ma phan cung 1 chuong trinh co kac voi 2 chuong trinh ko ban

              Comment


              • #8
                DAY LA BAN COD MOT CHUONG TRINH CUA TOI(CHUONG TRINH 1)




                $mod51
                SCL equ P2.1
                SDA equ P2.0
                RUN_DATA equ 60H
                MOC equ 61H
                BIEN_32 equ 62H
                TIME_BACK equ 63H
                TIME_MOVE EQU 64H

                org 500h


                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH

                DB 0FFH,0C3H,0BDH,0BEH,96H,0F0H,0F7H,0FFH,0F0H,0FFH,0 F9H,0F6H,0F0H,0FFH,0F0H,0F7H,0F0H,0FFH,0C1H,0BEH,0 BEH,0B6H,0D0H,0F7H
                DB 0FFH,0C7H,0BBH,9DH,0EEH,0DDH,0BBH,0B7H,0CFH,0FFH,0 FFH,0CFH,0B7H,0BBH,0BDH,0DEH,0EEH,0DDH,0BBH,0B7H,8 FH,0FFH,0FFH,0FFH
                DB 0FFH,0E7H,0E7H,0E7H,0E7H,0E6H,0A4H,81H,0C3H,0E7H,0 FFH,0FFH
                DB 0FFH,80H,80H,0FFH,0FFH,0FFH,0FFH,0FFH
                DB 0FFH,80H,80H,0FCH,0FCH,0FCH,0FFH,0E3H,0DDH,0BEH,0B EH,0BEH,0BEH,0DDH,0E3H,0FFH,0FFH,0C7H,0FBH,0FDH,0F CH,0FBH,0C7H
                DB 0FFH,80H,80H,94H,94H,94H,0FFH,0FFH,0FFH,0FFH,80H,8 0H,0CFH,0E7H,0F3H,0F9H,80H,0FFH,0F9H,0F6H,0EEH,0E0 H
                DB 0FFH,80H,0DFH,0EFH,0F7H,0EFH,0DFH,80H,0FFH,0FFH,0F FH,0F3H,0EDH,0DEH,0BEH,0BEH,0FDH,0FFH,0F1H,0EEH,0E EH,0E0H
                DB 0FFH,0FFH,0FFH,0E3H,0DDH,0DEH,0DEH,0DDH,0E3H,0FFH, 0FFH,0FFH,80H,0FFH,0FFH,8EH,0AEH,80H,0FFH,8EH,0AEH ,80H
                DB 0FFH,0EEH,0DDH,0BAH,0B6H,0AEH,0DEH,0FFH,0FFH,0FFH, 0CFH,0B7H,0BBH,0DDH,0EEH,0DDH,0BBH,87H,0FFH,0E7H,0 C3H,81H,64H,0E7H
                org 800h
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
                DB 0FFH,80H,80H,0BEH,0BEH,0C1H,0FFH,0F1H,0EEH,0EEH,0F 1H,0FFH,0F1H,0EEH,0EEH,0EEH,0FFH,0FFH,0FFH,0FFH,0F FH
                DB 80H,80H,0FEH,0FEH,0FEH,0FFH,0F1H,0EEH,0EEH,0E0H,0F FH,0FFH,80H,0B7H,0B7H,0B7H,0CFH,0FFH,0FFH,0FFH,0FF H,0FFH

                DB 0BFH,0BFH,80H,0BFH,0BFH,0F1H,0FEH,0FEH,0F1H,0FFH,0 FFH,0FFH,0FFH
                DB 0FFH,80H,0BEH,0BEH,0BEH,0C1H,0FFH,0F1H,0EEH,0EEH,0 F1H,0FFH,0FFH,0FFH,0FFH
                DB 80H,0F7H,0F7H,0F7H,80H,0FFH,0F1H,0EEH,0EEH,0E0H,0F FH,0E0H,0EFH,0EFH,0F0H,0FFH,80H,0F7H,0F7H,0F8H,0FF H,0FFH,0FFH,0FFH
                DB 0FFH,0FFH
                DB 80H,0B7H,0B7H,0B7H,0CFH,0FFH,80H,0F7H,0F7H,0F8H,0F FH,0E1H,0FEH,0FEH,0E1H,0FFH,0F1H,0EEH,0EEH,0EEH,0F FH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH

                ORG 00H
                ;----------chuong trinh chinh---------------

                ;============= chuong trinh con =================
                MAIN:
                LCALL INIT_SYSTEM


                BACK1:
                MOV RUN_DATA,MOC
                MOV A,RUN_DATA
                MOV TIME_BACK,TIME_MOVE
                ;=====================
                BACK3:
                MOV A,RUN_DATA
                MOVC A,@A+DPTR
                CPL A
                MOV P1,A
                LCALL DELAY
                MOV P1,#0
                ;============
                CLR SCL
                NOP
                NOP
                SETB SCL
                ;============
                INC RUN_DATA
                MOV A,RUN_DATA
                CJNE A,#20FFH,DEM_32_LAN
                MOV RUN_DATA,#0
                DEM_32_LAN:
                INC BIEN_32
                MOV A,BIEN_32
                CJNE A,#64,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,#930,thoat
                MOV MOC,#0
                thoat:ljmp back1
                ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;

                ;=================================
                INIT_SYSTEM:
                MOV DPTR,#500h
                MOV TIME_MOVE,#3;so lan quet chu di lai
                SETB SDA ; START
                CLR SCL
                SETB SCL
                CLR SDA
                MOV RUN_DATA,#1 ; DEFAUL
                MOV MOC,#0
                MOV BIEN_32,#1
                RET
                ;;;;;;;;---------------------------------------------------



                ;=================================
                DELAY:
                mov r6,#200
                de1:nop
                nop
                nop
                djnz r6,de1

                RET
                ;========================


                END



                DAY LA CHUONG TRINH 2 CUA TOI
                $mod51
                SCL equ P2.1
                SDA equ P2.0
                RUN_DATA equ 60H
                MOC equ 61H
                BIEN_32 equ 62H
                TIME_BACK equ 63H
                TIME_MOVE EQU 64H

                org 500h


                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH

                DB 0FFH,0C3H,0BDH,0BEH,96H,0F0H,0F7H,0FFH,0F0H,0FFH,0 F9H,0F6H,0F0H,0FFH,0F0H,0F7H,0F0H,0FFH,0C1H,0BEH,0 BEH,0B6H,0D0H,0F7H
                DB 0FFH,0C7H,0BBH,9DH,0EEH,0DDH,0BBH,0B7H,0CFH,0FFH,0 FFH,0CFH,0B7H,0BBH,0BDH,0DEH,0EEH,0DDH,0BBH,0B7H,8 FH,0FFH,0FFH,0FFH
                DB 0FFH,0E7H,0E7H,0E7H,0E7H,0E6H,0A4H,81H,0C3H,0E7H,0 FFH,0FFH
                DB 0FFH,80H,80H,0FFH,0FFH,0FFH,0FFH,0FFH
                DB 0FFH,80H,80H,0FCH,0FCH,0FCH,0C3H,0BDH,0BEH,0BEH,0B EH,0BDH,0C3H,0FFH,0FFH
                DB 0FFH,87H,0FBH,0FDH,0FEH,0FEH,0FDH,0FBH,87H,0FFH,0F FH,80H,80H,0B6H,0B6H,0B6H,0FFH,0FFH,0FFH,0FFH,0FFH ,0FFH,0FFH,0FFH
                DB 0FFH,0C3H,0BDH,0BEH,0BEH,0FFH,0FDH,80H,0E7H,0DBH,0 BDH,0FEH,0F7H,80H,0B6H,0BDH,0C3H,0FFH,9FH,9FH,80H, 80H,9FH,9FH
                DB 0FFH,0EFH,0DFH,80H,0FFH,0FFH,0BEH,0B6H,0A2H,88H,0F FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F FH,0FFH,0FFH,0FFH
                DB 0FFH,0C7H,0BBH,9DH,0EEH,0DDH,0BBH,0B7H,0CFH,0FFH,0 FFH,0CFH,0B7H,0BBH,0BDH,0DEH,0EEH,0DDH,0BBH,0B7H,8 FH,0FFH,0FFH,0FFH

                org 800h
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
                DB 0FFH,80H,80H,0BEH,0BEH,0C1H,0FFH,0F1H,0EEH,0EEH,0F 1H,0FFH,0F1H,0EEH,0EEH,0EEH,0FFH,0FFH,0FFH,0FFH,0F FH
                DB 80H,80H,0FEH,0FEH,0FEH,0FFH,0F1H,0EEH,0EEH,0E0H,0F FH,0FFH,80H,0B7H,0B7H,0B7H,0CFH,0FFH,0FFH,0FFH,0FF H,0FFH

                DB 0BFH,0BFH,80H,0BFH,0BFH,0F1H,0FEH,0FEH,0F1H,0FFH,0 FFH,0FFH,0FFH
                DB 0FFH,80H,0BEH,0BEH,0BEH,0C1H,0FFH,0F1H,0EEH,0EEH,0 F1H,0FFH,0FFH,0FFH,0FFH
                DB 80H,0F7H,0F7H,0F7H,80H,0FFH,0F1H,0EEH,0EEH,0E0H,0F FH,0E0H,0EFH,0EFH,0F0H,0FFH,80H,0F7H,0F7H,0F8H,0FF H,0FFH,0FFH,0FFH
                DB 0FFH,0FFH
                DB 80H,0B7H,0B7H,0B7H,0CFH,0FFH,80H,0F7H,0F7H,0F8H,0F FH,0E1H,0FEH,0FEH,0E1H,0FFH,0F1H,0EEH,0EEH,0EEH,0F FH,0FFH,0FFH,0FFH
                DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH

                ORG 00H
                ;----------chuong trinh chinh---------------

                ;============= chuong trinh con =================
                MAIN:
                LCALL INIT_SYSTEM


                BACK1:
                MOV RUN_DATA,MOC
                MOV A,RUN_DATA
                MOV TIME_BACK,TIME_MOVE
                ;=====================
                BACK3:
                MOV A,RUN_DATA
                MOVC A,@A+DPTR
                CPL A
                MOV P1,A
                LCALL DELAY
                MOV P1,#0
                ;============
                CLR SCL
                NOP
                NOP
                SETB SCL
                ;============
                INC RUN_DATA
                MOV A,RUN_DATA
                CJNE A,#20FFH,DEM_32_LAN
                MOV RUN_DATA,#0
                DEM_32_LAN:
                INC BIEN_32
                MOV A,BIEN_32
                CJNE A,#64,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,#930,thoat
                MOV MOC,#0
                thoat:ljmp back1
                ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;

                ;=================================
                INIT_SYSTEM:
                MOV DPTR,#500h
                MOV TIME_MOVE,#3;so lan quet chu di lai
                SETB SDA ; START
                CLR SCL
                SETB SCL
                CLR SDA
                MOV RUN_DATA,#1 ; DEFAUL
                MOV MOC,#0
                MOV BIEN_32,#1
                RET
                ;;;;;;;;---------------------------------------------------



                ;=================================
                DELAY:
                mov r6,#200
                de1:nop
                nop
                nop
                djnz r6,de1

                RET
                ;========================


                END

                VAY MUN CHAY 2 CHUONG TRINH NAY THI PHAI LAM NHU THE NAO.TOI MUON CHUONG TRINH 1 CHAY TRUOC MAY GIAY SAU THI CHUONG TRINH 2 LAI CHAY
                MONG MOI NGUOI GIUP DO

                Comment


                • #9
                  Tam dung chuong trinh 1,roi so sanh nhu the nao de tat chuong trinh 1 roi lai mo chuong trinh 2,rui cu lap lai nhu the

                  Comment


                  • #10
                    Tui ko bit lam nhu the nao.co ai bit giup toi voi

                    Comment


                    • #11
                      up cho mọi người thấy giúp đỡ
                      - Mạch nạp vdk 8051, AVR, PIC, EEPROM
                      - Linh kiện điện tử cho sinh viên


                      Comment


                      • #12
                        toi moi vao dien dan bo ngo.chang biet up len bang cach nao


                        ma up phan cung a.phan cod toi tam viet 2 chuong trinh chay chu.gio mun chay 2 chuong trinh do tren cung mot day led matrix(chuong trinh 1 chay truoc,ct2 chay sau) thi phai lam nhu the nao
                        phan cung 2 chuong trinh co khac gi voi viet 1 chuong trinh ko
                        ban hieu y toi roi thi ban co the viet ct ,up cho toi mot chuong trinh nhu the ko,ca phan cung nua.thanks

                        Comment


                        • #13
                          ai pit thi giup toi voi

                          Comment


                          • #14
                            Nguyên văn bởi truongnhh Xem bài viết
                            vang.duong nhien la toi se phai mo rong led roi.toi ghep cac matix 8x8 lai ma.nhung ma lap trinh lam sao de cung mot day led matrix do co the hien thi dc 2 chuong trinh khac nhau.vi du toi viet chuong trinh dau tien la i love you,chuong tinh 2 la my love.thi phai viet nhu the nao de chuong trinh 1 chay xong tiep theo lai co chuong trinh 2 chay tren cung day led matrix do .mong ban giup do.tui rat can.thanks
                            có phải cả hai chương trình là đều chạy chữ không nào, mà là chữ thì chữ nào chả là chữ, chạy trên cũng một dãy led. Vậy thì bạn chỉ cần viết một chương trình con gọi là "chạy chữ', có đầu vào là một dãy kí tự thôi. cả hai chương trình kiểu gì chả giống nhau. khác mỗi là chữ hiện thị là gì.

                            main:
                            b1: thiết lập ban đầu cho các thanh ghi, biến....
                            b2: chay chu ILU
                            b3: delay 3min
                            b4: chay chu mylove
                            b5: quay lại bước hai
                            b6: end

                            Comment


                            • #15
                              thanks.vang .ban co the viet cho toi mot chuong trinh nho nho de mjnh hoa dc ko.thanks

                              Comment

                              Về tác giả

                              Collapse

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

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

                              Collapse

                              Đang tải...
                              X