Thông báo

Collapse
No announcement yet.

mọi người giúp tôi về cách sử dụng ic 74ls595 và uln2803 trong làm mạch ma trận.

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

  • mọi người giúp tôi về cách sử dụng ic 74ls595 và uln2803 trong làm mạch ma trận.

    mọi người giúp tôi về cách sử dụng ic 74ls595 và uln2803 trong làm mạch ma trận..dưới đây là code của ma trận.mọi người giúp tôi xem dãy lệnh nào trong chương trình này thực hiện chức năng chạy chữ từ phải sang trái.ai đó giúp tôi vẽ lưu đồ thuật toán chương trình này được không.mong mọi người giúp đỡ tôi rất cần.
    Last edited by ckddt13; 20-09-2012, 21:49.
    chỉ có thể là niềm đam mê

  • #2
    ai đó giải thich giúp tôi chương trình này.chương trình này chạy chữ trên led matran.từ phải sang trái.a e xem dãy lệnh nào thực hiện chức năng chạy chữ từ phải sang trái.điều khiển chạy 2 dòng chữ thong qua nút bấm.ai đó giúp tôi vẽ lưu đồ thuật toán chương trình này được không
    giúp tôi với




    $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,0FF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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    ORG 00H

    MAIN1:
    LCALL INIT_SYSTEM1
    LJMP BACK1
    RET
    MAIN2:
    LCALL INIT_SYSTEM2
    LJMP BACK1
    RET

    BACK1:
    JNB P3.0,MAIN1
    JNB P3.1,MAIN2

    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,#0ffh,thoat
    MOV MOC,#0
    thoat:ljmp back1
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;

    ;=================================
    INIT_SYSTEM1:
    MOV DPTR,#500h
    MOV TIME_MOVE,#1;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
    ;;;;;;;;---------------------------------------------------
    ;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    INIT_SYSTEM2:
    MOV DPTR,#800h
    MOV TIME_MOVE,#1;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
    Last edited by ckddt13; 20-09-2012, 22:23.
    chỉ có thể là niềm đam mê

    Comment


    • #3
      Chả biết phần cứng thiết kế như thế nào nữa, bạn port như vậy thì a e mò kim ah.
      _--------------------------------------------------

      **** ------------------------------------------***

      Comment


      • #4
        code c bạn có hiểu không:
        #include <REGX52.H>

        unsigned char code code_Tab[97][5]={
        //******************BANG MA ASCII****************
        0xFF,0xFF,0xFF,0xFF,0xFF,//SPACE 0
        0xFF,0xFF,0xA0,0xFF,0xFF,//! 1
        0xFF,0xFF,0xF8,0xF4,0xFF,//' 2
        0xEB,0x80,0xEB,0x80,0xEB,//# 3
        0xDB,0xD5,0x80,0xD5,0xED,//$ 4
        0xD8,0xEA,0x94,0xAB,0x8D,//% 5
        0xC9,0xB6,0xA9,0xDF,0xAF,//& 6
        0xFF,0xFF,0xF8,0xF4,0xFF,//' 7
        0xFF,0xE3,0xDD,0xBE,0xFF,//( 8
        0xFF,0xBE,0xDD,0xE3,0xFF,//) 9
        0xD5,0xE3,0x80,0xE3,0xD5,//* 10
        0xF7,0xF7,0xC1,0xF7,0xF7,//+ 11
        0xFF,0xA7,0xC7,0xFF,0xFF,//, 12
        0xF7,0xF7,0xF7,0xF7,0xF7,//- 13
        0xFF,0x9F,0x9F,0xFF,0xFF,//x 14
        0xFF,0xC9,0xC9,0xFF,0xFF,/// 15
        0xC1,0xAE,0xB6,0xBA,0xC1,//0 16 80
        0xFF,0xBD,0x80,0xBF,0xFF,//1 17
        0x8D,0xB6,0xB6,0xB6,0xB9,//2 18
        0xDD,0xBE,0xB6,0xB6,0xC9,//3 19
        0xE7,0xEB,0xED,0x80,0xEF,//4 20
        0xD8,0xBA,0xBA,0xBA,0xC6,//5 21
        0xC3,0xB5,0xB6,0xB6,0xCF,//6 22
        0xFE,0x8E,0xF6,0xFA,0xFC,//7 23
        0xC9,0xB6,0xB6,0xB6,0xC9,//8 24
        0xF9,0xB6,0xB6,0xD6,0xE1,//9 25
        0xFF,0xC9,0xC9,0xFF,0xFF,//: 26
        0xFF,0xA4,0xC4,0xFF,0xFF,//// 27
        0xF7,0xEB,0xDD,0xBE,0xFF,//< 28
        0xEB,0xEB,0xEB,0xEB,0xEB,//= 29
        0xFF,0xBE,0xDD,0xEB,0xF7,//> 30
        0xFD,0xFE,0xAE,0xF6,0xF9,//? 31
        0xCD,0xB6,0x8E,0xBE,0xC1,//@ 32
        0x83,0xF5,0xF6,0xF5,0x83,//A 33
        0xBE,0x80,0xB6,0xB6,0xC9,//B 34
        0xC1,0xBE,0xBE,0xBE,0xDD,//C 35
        0xBE,0x80,0xBE,0xBE,0xC1,//D 36
        0x80,0xB6,0xB6,0xB6,0xBE,//E 37
        0x80,0xF6,0xF6,0xFE,0xFE,//F 38
        0xC1,0xBE,0xB6,0xB6,0xC5,//G 39
        0x80,0xF7,0xF7,0xF7,0x80,//H 40
        0xFF,0xBE,0x80,0xBE,0xFF,//I 41
        0xDF,0xBF,0xBE,0xC0,0xFE,//J 42
        0x80,0xF7,0xEB,0xDD,0xBE,//K 43
        0x80,0xBF,0xBF,0xBF,0xFF,//L 44
        0x80,0xFD,0xF3,0xFD,0x80,//M 45
        0x80,0xFD,0xFB,0xF7,0x80,//N 46
        0xC1,0xBE,0xBE,0xBE,0xC1,//O 47
        0x80,0xF6,0xF6,0xF6,0xF9,//P 48
        0xC1,0xBE,0xAE,0xDE,0xA1,//Q 49
        0x80,0xF6,0xE6,0xD6,0xB9,//R 50
        0xD9,0xB6,0xB6,0xB6,0xCD,//S 51 83
        0xFE,0xFE,0x80,0xFE,0xFE,//T 52
        0xC0,0xBF,0xBF,0xBF,0xC0,//U 53
        0xE0,0xDF,0xBF,0xDF,0xE0,//V 54
        0xC0,0xBF,0xCF,0xBF,0xC0,//W 55
        0x9C,0xEB,0xF7,0xEB,0x9C,//X 56
        0xFC,0xFB,0x87,0xFB,0xFC,//Y89 24 57
        0x9E,0xAE,0xB6,0xBA,0xBC,//Z90 25 58
        0xFF,0x80,0xBE,0xBE,0xFF,//[ 59
        0xFD,0xFB,0xF7,0xEF,0xDF,//\ 60
        0xFF,0xBE,0xBE,0x80,0xFF,//] 61
        0xFB,0xFD,0xFE,0xFD,0xFB,//^ 92
        0x7F,0x7F,0x7F,0x7F,0x7F,//_ 63
        0xFF,0xFF,0xF8,0xF4,0xFF,//' 64
        0xDF,0xAB,0xAB,0xAB,0xC7,//a 65
        0x80,0xC7,0xBB,0xBB,0xC7,//b
        0xFF,0xC7,0xBB,0xBB,0xBB,//c
        0xC7,0xBB,0xBB,0xC7,0x80,//d
        0xC7,0xAB,0xAB,0xAB,0xF7,//e 69
        0xF7,0x81,0xF6,0xF6,0xFD,//f
        0xF7,0xAB,0xAB,0xAB,0xC3,//g 71
        0x80,0xF7,0xFB,0xFB,0x87,//h 72
        0xFF,0xBB,0x82,0xBF,0xFF,//i 73
        0xDF,0xBF,0xBB,0xC2,0xFF,//j 74
        0xFF,0x80,0xEF,0xD7,0xBB,//k 75
        0xFF,0xBE,0x80,0xBF,0xFF,//l 76
        0x83,0xFB,0x87,0xFB,0x87,//m 77
        0x83,0xF7,0xFB,0xFB,0x87,//n 78
        0xC7,0xBB,0xBB,0xBB,0xC7,//o 79
        0x83,0xEB,0xEB,0xEB,0xF7,//p 80
        0xF7,0xEB,0xEB,0xEB,0x83,//q 81
        0x83,0xF7,0xFB,0xFB,0xF7,//r 82
        0xB7,0xAB,0xAB,0xAB,0xDB,//s 83
        0xFF,0xFB,0xC0,0xBB,0xBB,//t 84
        0xC3,0xBF,0xBF,0xDF,0x80,//u 85
        0xE3,0xDF,0xBF,0xDF,0xE3,//v 86
        0xC3,0xBF,0xCF,0xBF,0xC3,//w 87
        0xBB,0xD7,0xEF,0xD7,0xBB,//x 88
        0xF3,0xAF,0xAF,0xAF,0xC3,//y 89
        0xBB,0x9B,0xAB,0xB3,0xBB,//z 90
        0xFB,0xE1,0xE0,0xE1,0xFB,//^ 62
        0xE3,0xE3,0xC1,0xE3,0xF7,//->93
        0xF7,0xE3,0xC1,0xE3,0xE3,//<-94
        0xEF,0xC3,0x83,0xC3,0xEF,//95
        0xFF,0xFF,0xFF,0xFF,0xFF//BLANK CHAR 96
        };
        // End of code table
        /*
        0x07,0xDB,0xDD,0xDB,0x07,0xFF,0xFF,0xFF, //ma ky tu: A
        0x01,0x6D,0x6D,0x6D,0x93,0xFF,0xFF,0xFF, //ma ky tu: B
        0x83,0x7D,0x7D,0x7D,0xBB,0xFF,0xFF,0xFF, //ma ky tu: C
        0x01,0x7D,0x7D,0xBB,0xC7,0xFF,0xFF,0xFF, //ma ky tu: D
        0x01,0x6D,0x6D,0x6D,0x6D,0xFF,0xFF,0xFF, //ma ky tu: E
        0x01,0xED,0xED,0xED,0xED,0xFF,0xFF,0xFF, //ma ky tu: F
        0x83,0x7D,0x5D,0x5D,0x9B,0xFF,0xFF,0xFF, //ma ky tu: G
        0x01,0xEF,0xEF,0xEF,0x01,0xFF,0xFF,0xFF, //ma ky tu: H
        0x7D,0x7D,0x01,0x7D,0x7D,0xFF,0xFF,0xFF, //ma ky tu: I
        0xFF,0xBF,0x7F,0x7F,0x81,0xFF,0xFF,0xFF, //ma ky tu: J
        0x01,0xEF,0xD7,0xBB,0x7D,0xFF,0xFF,0xFF, //ma ky tu: K
        0x01,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF, //ma ky tu: L
        0x01,0xFB,0xF7,0xFB,0x01,0xFF,0xFF,0xFF, //ma ky tu: M
        0x01,0xFB,0xF7,0xEF,0x01,0xFF,0xFF,0xFF, //ma ky tu: N
        0x83,0x7D,0x7D,0x7D,0x83,0xFF,0xFF,0xFF, //ma ky tu: O
        0x01,0xED,0xED,0xED,0xF3,0xFF,0xFF,0xFF, //ma ky tu: P
        0x83,0x7D,0x5D,0xBD,0x43,0xFF,0xFF,0xFF, //ma ky tu: Q
        0x01,0xED,0xCD,0xAD,0x73,0xFF,0xFF,0xFF, //ma ky tu: R
        0x73,0x6D,0x6D,0x6D,0x9D,0xFF,0xFF,0xFF, //ma ky tu: S
        0xFD,0xFD,0x01,0xFD,0xFD,0xFF,0xFF,0xFF, //ma ky tu: T
        0x81,0x7F,0x7F,0x7F,0x81,0xFF,0xFF,0xFF, //ma ky tu: U
        0xC1,0xBF,0x7F,0xBF,0xC1,0xFF,0xFF,0xFF, //ma ky tu: V
        0x01,0xBF,0xDF,0xBF,0x01,0xFF,0xFF,0xFF, //ma ky tu: W
        0x39,0xD7,0xEF,0xD7,0x39,0xFF,0xFF,0xFF, //ma ky tu: X
        0xF1,0xEF,0x1F,0xEF,0xF1,0xFF,0xFF,0xFF, //ma ky tu: Y
        0x3D,0x5D,0x6D,0x75,0x79,0xFF,0xFF,0xFF, //ma ky tu: Z
        0x93,0x55,0x6D,0x7D,0x7D,0xBB,0xC7,0xEF, //ma ky tu: trai tim ngang
        0xFF,0x7B,0x01,0x7F,0xFF,0xFF,0xFF,0xFF, //ma ky tu: 1
        0x7B,0x3D,0x5D,0x6D,0x73,0xFF,0xFF,0xFF, //ma ky tu: 2
        0xBB,0x6D,0x6D,0x6D,0x93,0xFF,0xFF,0xFF, //ma ky tu: 3
        0x9F,0xAF,0xB7,0xBB,0x1D,0xFF,0xFF,0xFF, //ma ky tu: 4
        0x71,0x75,0x75,0x75,0x8D,0xFF,0xFF,0xFF, //ma ky tu: 5
        0x83,0x5D,0x6D,0x6D,0x9B,0xFF,0xFF,0xFF, //ma ky tu: 6
        0xFD,0x1D,0xED,0xF5,0xF9,0xFF,0xFF,0xFF, //ma ky tu: 7
        0x93,0x6D,0x6D,0x6D,0x93,0xFF,0xFF,0xFF, //ma ky tu: 8
        0x73,0x6D,0x6D,0x6D,0x83,0xFF,0xFF,0xFF, //ma ky tu: 9
        0xF3,0xDD,0xBB,0x78,0xBB,0xDD,0xE3,0xFF, //ma ky tu: cay bich
        0xFF,0xFF,0x5F,0x0F,0x5F,0xFF,0xFF,0xFF, //ma ky tu: ot1
        0xFF,0xFF,0xAF,0x87,0xAF,0xFF,0xFF,0xFF, //ma ky tu: oto2
        0xFF,0xFF,0xD7,0xC3,0xD7,0xFF,0xFF,0xFF, //ma ky tu: oto3
        0xFF,0xFF,0xEB,0xE1,0xEB,0xFF,0xFF,0xFF, //ma ky tu: oto4
        0xFF,0xFF,0xF5,0xF0,0xF5,0xFF,0xFF,0xFF, //ma ky tu: oto5
        0xFF,0xFF,0xFA,0x78,0xFA,0xFF,0xFF,0xFF, //ma ky tu: oto6
        0xFF,0xFF,0x7D,0x3C,0x7D,0xFF,0xFF,0xFF, //ma ky tu: oto7
        0xFF,0xFF,0xBE,0x1E,0xBE,0xFF,0xFF,0xFF, //ma ky tu: oto8

        }; */
        unsigned char Tic,i=0;
        void Wait (unsigned long Valdelay){
        while(Valdelay--);
        }
        void main (){
        unsigned char j;
        TMOD=0x01;
        TR0=1;
        ET0=1;
        EA=1;
        while(1){
        for(j=0;j<5;j++){
        P1=0xFF;
        P2=1<<j;
        P1=code_Tab[i][j];
        Wait(1);
        }
        }
        }
        void INT0_int()interrupt 1{
        Tic++;
        if(Tic==5){
        Tic=0;
        i++;
        if(i==97)i=0;
        }
        } ko biết cách upfile lên như thế nào
        Yêu em do duyên số
        lấy em do sự cố xảy ra.........

        Comment


        • #5
          Giờ bạn kêu làm mới thì còn được..hihi...Bạn muốn làm ntn nói cụ thể ra mình và mọi người sẽ giúp...Code lại nhanh thôi.

          Hotmail: tien168bn.utehy@hotmail.com
          Gmail: tien168bn.utehy@gmail.com

          Comment


          • #6
            tôi chẳng biết pót lên như thế nào.mong bạn thông cảm.mà chương trình trên cũng chỉ rõ rùi mà.tôi nói sơ về phần cứng như sau:vdk 89c51,ma trận 8x64 <=>8 ma trận 8x8 ghép lại. <=>sử dụng 8 con 595 nối ra 8 led ma trận (Q0=>Q7)(nối với cột của ma trận,để led nằm thẳng đứng,có dùng tzt).có lẽ bạn cũng biết để làm gì tôi không nòi thêm.chân DS nối với p2.0,chân SH,ST CP được nối chung với nhau và nối vào p2.1,chân còn lại chắc ko phải nói.cổng p1 được nối với uln 2803.đầu ra 2803 được nối với 8 hàng của led ma trận.p3.0 và p3.1 nối với nút bấm để điều khiển 2 chương trình(2 dòng chữ,mỗi nút bấm là một dong chữ).


            mong bạn xem dãy chương trình trên,đ dãy lệnh nào thực hiện chức năng chạy chữ từ phải sang trái.và giúp tôi vẽ lưu đồ thuật toán cho chương trình đó.mà giải thích tất cả các dãy lệnh trên giup tôi cang tot.
            chỉ có thể là niềm đam mê

            Comment


            • #7
              tôi chỉ cần bạn xem dãy lệnh nào ở chương trình trên thực hiện chức năng chạy chữ từ phải sang trái.và giúp tôi vẽ lưu đồ thuật toán cho chương trình đó.mà giải thích tất cả các dãy lệnh trên giup tôi cang tot.
              chỉ có thể là niềm đam mê

              Comment


              • #8
                mong mọi người giúp đỡ.code ở trên,phần cứng tôi cũng mô tả rõ ràng ở trên.thanks
                chỉ có thể là niềm đam mê

                Comment


                • #9
                  Nguyên văn bởi ckddt13 Xem bài viết
                  mong mọi người giúp đỡ.code ở trên,phần cứng tôi cũng mô tả rõ ràng ở trên.thanks
                  trích:
                  ORG 00H

                  MAIN1:
                  LCALL INIT_SYSTEM1 ;lập thông số ban đầu ch/t 1
                  LJMP BACK1
                  RET
                  MAIN2:
                  LCALL INIT_SYSTEM2 ;lập thông số ban đầu ch/t 2
                  LJMP BACK1
                  RET

                  BACK1:
                  JNB P3.0,MAIN1;phím chon ch/tr
                  JNB P3.1,MAIN2

                  MOV RUN_DATA,MOC
                  MOV A,RUN_DATA
                  MOV TIME_BACK,TIME_MOVE
                  ;=====================
                  BACK3: ; bắt đầu cột thứ nhất
                  MOV A,RUN_DATA ;addr cột thứ nhất=0
                  MOVC A,@A+DPTR;lấy dữ liệu trong bảng(5000)
                  CPL A;bù dlieu chắc cho phù hợp p cứng
                  MOV P1,A ;xuất ra cột
                  LCALL DELAY;
                  MOV P1,#0;tắt dlieu chống nhiễu
                  ;============
                  CLR SCL
                  NOP
                  NOP
                  SETB SCL ;đẩy vào 595
                  ;============
                  INC RUN_DATA ;tăng addr lên (5000+1)
                  MOV A,RUN_DATA
                  CJNE A,#20FFH,DEM_32_LAN;nếu chưa là addr cuối
                  MOV RUN_DATA,#0 ;nếu đủ reset lại addr đầu
                  DEM_32_LAN:
                  INC BIEN_32 ;tăng
                  MOV A,BIEN_32
                  CJNE A,#64,BACK3 ;nếu chưa đủ 64 trở lại,có nghĩa là chưa đủ 2 lần quét 32cot quyết định tốc độ dịch
                  MOV RUN_DATA,MOC ; nếu đủ lấy lại addr ,đây là điểm quyết định dịch chữ đây..
                  MOV BIEN_32,#0;
                  ;============================
                  SETB SDA;
                  CLR SCL
                  NOP
                  SETB SCL
                  CLR SDA ;cho mở cột
                  ;=============
                  DJNZ TIME_BACK,BACK3
                  INC MOC ;tăng moc addr để dịch chữ
                  MOV A,MOC
                  CJNE A,#0ffh,thoat ;chưa đủ 255 tiếp tuc dịch
                  MOV MOC,#0;đủ trở lại từ đầu
                  thoat:ljmp back1;
                  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;

                  TRỜI ƠI TRỜI QUÁ OẢI....

                  nếu bạn hiểu thì cảm ơn tui 100 cái !

                  Comment


                  • #10
                    thanks ban 100 cái.toi da hieu.nhưng vấn đề đặt ra là tôi chưa hiểu vẽ lưu đồ thuật toán ra sao.tôi mong bạn giúp tôi thêm vấn đề này.thanks ban 1000 lần.hj.bởi vì tôi đang làm đồ án học phần cần rõ điều này
                    Last edited by ckddt13; 21-09-2012, 18:31.
                    chỉ có thể là niềm đam mê

                    Comment


                    • #11
                      hix vậy là code bạn đã làm xong rồi còn lưu đồ thôi chứ gì, bạn gõ đồ án led ma trận trên google thì có mà đầu thuật toán, các thầy cũng không dỗi hơi đi xem thuật toán của bạn đúng hay sai đâu miễn là hợp lý là được
                      Yêu em do duyên số
                      lấy em do sự cố xảy ra.........

                      Comment


                      • #12
                        thanks.vâng tôi chỉ còn lưu đồ thôi.thấy vẽ phức tạp quá.tìm mãi không thấy.cả google cung vậy.có lẽ phải vẽ bừa một cái như bạn nói.hix.nói như bạn thì cái gì cũng làm bừa cho xong.dù sao cũng xin cảm ơn.
                        chỉ có thể là niềm đam mê

                        Comment


                        • #13
                          khuyết đại cho led 7d sáng có bóng ma các bác giúp với nhé
                          Click image for larger version

Name:	163LED_7_DK_SANG_MO.jpg
Views:	2
Size:	40.1 KB
ID:	1371147

                          Comment


                          • #14
                            Nguyên văn bởi lamtamnhuccc Xem bài viết
                            khuyết đại cho led 7d sáng có bóng ma các bác giúp với nhé
                            [ATTACH=CONFIG]56879[/ATTACH]
                            chân số 1 của R2 mắc 1 con trở 22k nối vào nguồn 12V.

                            Comment


                            • #15
                              Nguyên văn bởi takado Xem bài viết
                              code c bạn có hiểu không:
                              #include <REGX52.H>

                              unsigned char code code_Tab[97][5]={
                              //******************BANG MA ASCII****************
                              0xFF,0xFF,0xFF,0xFF,0xFF,//SPACE 0
                              0xFF,0xFF,0xA0,0xFF,0xFF,//! 1
                              0xFF,0xFF,0xF8,0xF4,0xFF,//' 2
                              0xEB,0x80,0xEB,0x80,0xEB,//# 3
                              0xDB,0xD5,0x80,0xD5,0xED,//$ 4
                              0xD8,0xEA,0x94,0xAB,0x8D,//% 5
                              0xC9,0xB6,0xA9,0xDF,0xAF,//& 6
                              0xFF,0xFF,0xF8,0xF4,0xFF,//' 7
                              0xFF,0xE3,0xDD,0xBE,0xFF,//( 8
                              0xFF,0xBE,0xDD,0xE3,0xFF,//) 9
                              0xD5,0xE3,0x80,0xE3,0xD5,//* 10
                              0xF7,0xF7,0xC1,0xF7,0xF7,//+ 11
                              0xFF,0xA7,0xC7,0xFF,0xFF,//, 12
                              0xF7,0xF7,0xF7,0xF7,0xF7,//- 13
                              0xFF,0x9F,0x9F,0xFF,0xFF,//x 14
                              0xFF,0xC9,0xC9,0xFF,0xFF,/// 15
                              0xC1,0xAE,0xB6,0xBA,0xC1,//0 16 80
                              0xFF,0xBD,0x80,0xBF,0xFF,//1 17
                              0x8D,0xB6,0xB6,0xB6,0xB9,//2 18
                              0xDD,0xBE,0xB6,0xB6,0xC9,//3 19
                              0xE7,0xEB,0xED,0x80,0xEF,//4 20
                              0xD8,0xBA,0xBA,0xBA,0xC6,//5 21
                              0xC3,0xB5,0xB6,0xB6,0xCF,//6 22
                              0xFE,0x8E,0xF6,0xFA,0xFC,//7 23
                              0xC9,0xB6,0xB6,0xB6,0xC9,//8 24
                              0xF9,0xB6,0xB6,0xD6,0xE1,//9 25
                              0xFF,0xC9,0xC9,0xFF,0xFF,//: 26
                              0xFF,0xA4,0xC4,0xFF,0xFF,//// 27
                              0xF7,0xEB,0xDD,0xBE,0xFF,//< 28
                              0xEB,0xEB,0xEB,0xEB,0xEB,//= 29
                              0xFF,0xBE,0xDD,0xEB,0xF7,//> 30
                              0xFD,0xFE,0xAE,0xF6,0xF9,//? 31
                              0xCD,0xB6,0x8E,0xBE,0xC1,//@ 32
                              0x83,0xF5,0xF6,0xF5,0x83,//A 33
                              0xBE,0x80,0xB6,0xB6,0xC9,//B 34
                              0xC1,0xBE,0xBE,0xBE,0xDD,//C 35
                              0xBE,0x80,0xBE,0xBE,0xC1,//D 36
                              0x80,0xB6,0xB6,0xB6,0xBE,//E 37
                              0x80,0xF6,0xF6,0xFE,0xFE,//F 38
                              0xC1,0xBE,0xB6,0xB6,0xC5,//G 39
                              0x80,0xF7,0xF7,0xF7,0x80,//H 40
                              0xFF,0xBE,0x80,0xBE,0xFF,//I 41
                              0xDF,0xBF,0xBE,0xC0,0xFE,//J 42
                              0x80,0xF7,0xEB,0xDD,0xBE,//K 43
                              0x80,0xBF,0xBF,0xBF,0xFF,//L 44
                              0x80,0xFD,0xF3,0xFD,0x80,//M 45
                              0x80,0xFD,0xFB,0xF7,0x80,//N 46
                              0xC1,0xBE,0xBE,0xBE,0xC1,//O 47
                              0x80,0xF6,0xF6,0xF6,0xF9,//P 48
                              0xC1,0xBE,0xAE,0xDE,0xA1,//Q 49
                              0x80,0xF6,0xE6,0xD6,0xB9,//R 50
                              0xD9,0xB6,0xB6,0xB6,0xCD,//S 51 83
                              0xFE,0xFE,0x80,0xFE,0xFE,//T 52
                              0xC0,0xBF,0xBF,0xBF,0xC0,//U 53
                              0xE0,0xDF,0xBF,0xDF,0xE0,//V 54
                              0xC0,0xBF,0xCF,0xBF,0xC0,//W 55
                              0x9C,0xEB,0xF7,0xEB,0x9C,//X 56
                              0xFC,0xFB,0x87,0xFB,0xFC,//Y89 24 57
                              0x9E,0xAE,0xB6,0xBA,0xBC,//Z90 25 58
                              0xFF,0x80,0xBE,0xBE,0xFF,//[ 59
                              0xFD,0xFB,0xF7,0xEF,0xDF,//\ 60
                              0xFF,0xBE,0xBE,0x80,0xFF,//] 61
                              0xFB,0xFD,0xFE,0xFD,0xFB,//^ 92
                              0x7F,0x7F,0x7F,0x7F,0x7F,//_ 63
                              0xFF,0xFF,0xF8,0xF4,0xFF,//' 64
                              0xDF,0xAB,0xAB,0xAB,0xC7,//a 65
                              0x80,0xC7,0xBB,0xBB,0xC7,//b
                              0xFF,0xC7,0xBB,0xBB,0xBB,//c
                              0xC7,0xBB,0xBB,0xC7,0x80,//d
                              0xC7,0xAB,0xAB,0xAB,0xF7,//e 69
                              0xF7,0x81,0xF6,0xF6,0xFD,//f
                              0xF7,0xAB,0xAB,0xAB,0xC3,//g 71
                              0x80,0xF7,0xFB,0xFB,0x87,//h 72
                              0xFF,0xBB,0x82,0xBF,0xFF,//i 73
                              0xDF,0xBF,0xBB,0xC2,0xFF,//j 74
                              0xFF,0x80,0xEF,0xD7,0xBB,//k 75
                              0xFF,0xBE,0x80,0xBF,0xFF,//l 76
                              0x83,0xFB,0x87,0xFB,0x87,//m 77
                              0x83,0xF7,0xFB,0xFB,0x87,//n 78
                              0xC7,0xBB,0xBB,0xBB,0xC7,//o 79
                              0x83,0xEB,0xEB,0xEB,0xF7,//p 80
                              0xF7,0xEB,0xEB,0xEB,0x83,//q 81
                              0x83,0xF7,0xFB,0xFB,0xF7,//r 82
                              0xB7,0xAB,0xAB,0xAB,0xDB,//s 83
                              0xFF,0xFB,0xC0,0xBB,0xBB,//t 84
                              0xC3,0xBF,0xBF,0xDF,0x80,//u 85
                              0xE3,0xDF,0xBF,0xDF,0xE3,//v 86
                              0xC3,0xBF,0xCF,0xBF,0xC3,//w 87
                              0xBB,0xD7,0xEF,0xD7,0xBB,//x 88
                              0xF3,0xAF,0xAF,0xAF,0xC3,//y 89
                              0xBB,0x9B,0xAB,0xB3,0xBB,//z 90
                              0xFB,0xE1,0xE0,0xE1,0xFB,//^ 62
                              0xE3,0xE3,0xC1,0xE3,0xF7,//->93
                              0xF7,0xE3,0xC1,0xE3,0xE3,//<-94
                              0xEF,0xC3,0x83,0xC3,0xEF,//95
                              0xFF,0xFF,0xFF,0xFF,0xFF//BLANK CHAR 96
                              };
                              // End of code table
                              /*
                              0x07,0xDB,0xDD,0xDB,0x07,0xFF,0xFF,0xFF, //ma ky tu: A
                              0x01,0x6D,0x6D,0x6D,0x93,0xFF,0xFF,0xFF, //ma ky tu: B
                              0x83,0x7D,0x7D,0x7D,0xBB,0xFF,0xFF,0xFF, //ma ky tu: C
                              0x01,0x7D,0x7D,0xBB,0xC7,0xFF,0xFF,0xFF, //ma ky tu: D
                              0x01,0x6D,0x6D,0x6D,0x6D,0xFF,0xFF,0xFF, //ma ky tu: E
                              0x01,0xED,0xED,0xED,0xED,0xFF,0xFF,0xFF, //ma ky tu: F
                              0x83,0x7D,0x5D,0x5D,0x9B,0xFF,0xFF,0xFF, //ma ky tu: G
                              0x01,0xEF,0xEF,0xEF,0x01,0xFF,0xFF,0xFF, //ma ky tu: H
                              0x7D,0x7D,0x01,0x7D,0x7D,0xFF,0xFF,0xFF, //ma ky tu: I
                              0xFF,0xBF,0x7F,0x7F,0x81,0xFF,0xFF,0xFF, //ma ky tu: J
                              0x01,0xEF,0xD7,0xBB,0x7D,0xFF,0xFF,0xFF, //ma ky tu: K
                              0x01,0x7F,0x7F,0x7F,0x7F,0xFF,0xFF,0xFF, //ma ky tu: L
                              0x01,0xFB,0xF7,0xFB,0x01,0xFF,0xFF,0xFF, //ma ky tu: M
                              0x01,0xFB,0xF7,0xEF,0x01,0xFF,0xFF,0xFF, //ma ky tu: N
                              0x83,0x7D,0x7D,0x7D,0x83,0xFF,0xFF,0xFF, //ma ky tu: O
                              0x01,0xED,0xED,0xED,0xF3,0xFF,0xFF,0xFF, //ma ky tu: P
                              0x83,0x7D,0x5D,0xBD,0x43,0xFF,0xFF,0xFF, //ma ky tu: Q
                              0x01,0xED,0xCD,0xAD,0x73,0xFF,0xFF,0xFF, //ma ky tu: R
                              0x73,0x6D,0x6D,0x6D,0x9D,0xFF,0xFF,0xFF, //ma ky tu: S
                              0xFD,0xFD,0x01,0xFD,0xFD,0xFF,0xFF,0xFF, //ma ky tu: T
                              0x81,0x7F,0x7F,0x7F,0x81,0xFF,0xFF,0xFF, //ma ky tu: U
                              0xC1,0xBF,0x7F,0xBF,0xC1,0xFF,0xFF,0xFF, //ma ky tu: V
                              0x01,0xBF,0xDF,0xBF,0x01,0xFF,0xFF,0xFF, //ma ky tu: W
                              0x39,0xD7,0xEF,0xD7,0x39,0xFF,0xFF,0xFF, //ma ky tu: X
                              0xF1,0xEF,0x1F,0xEF,0xF1,0xFF,0xFF,0xFF, //ma ky tu: Y
                              0x3D,0x5D,0x6D,0x75,0x79,0xFF,0xFF,0xFF, //ma ky tu: Z
                              0x93,0x55,0x6D,0x7D,0x7D,0xBB,0xC7,0xEF, //ma ky tu: trai tim ngang
                              0xFF,0x7B,0x01,0x7F,0xFF,0xFF,0xFF,0xFF, //ma ky tu: 1
                              0x7B,0x3D,0x5D,0x6D,0x73,0xFF,0xFF,0xFF, //ma ky tu: 2
                              0xBB,0x6D,0x6D,0x6D,0x93,0xFF,0xFF,0xFF, //ma ky tu: 3
                              0x9F,0xAF,0xB7,0xBB,0x1D,0xFF,0xFF,0xFF, //ma ky tu: 4
                              0x71,0x75,0x75,0x75,0x8D,0xFF,0xFF,0xFF, //ma ky tu: 5
                              0x83,0x5D,0x6D,0x6D,0x9B,0xFF,0xFF,0xFF, //ma ky tu: 6
                              0xFD,0x1D,0xED,0xF5,0xF9,0xFF,0xFF,0xFF, //ma ky tu: 7
                              0x93,0x6D,0x6D,0x6D,0x93,0xFF,0xFF,0xFF, //ma ky tu: 8
                              0x73,0x6D,0x6D,0x6D,0x83,0xFF,0xFF,0xFF, //ma ky tu: 9
                              0xF3,0xDD,0xBB,0x78,0xBB,0xDD,0xE3,0xFF, //ma ky tu: cay bich
                              0xFF,0xFF,0x5F,0x0F,0x5F,0xFF,0xFF,0xFF, //ma ky tu: ot1
                              0xFF,0xFF,0xAF,0x87,0xAF,0xFF,0xFF,0xFF, //ma ky tu: oto2
                              0xFF,0xFF,0xD7,0xC3,0xD7,0xFF,0xFF,0xFF, //ma ky tu: oto3
                              0xFF,0xFF,0xEB,0xE1,0xEB,0xFF,0xFF,0xFF, //ma ky tu: oto4
                              0xFF,0xFF,0xF5,0xF0,0xF5,0xFF,0xFF,0xFF, //ma ky tu: oto5
                              0xFF,0xFF,0xFA,0x78,0xFA,0xFF,0xFF,0xFF, //ma ky tu: oto6
                              0xFF,0xFF,0x7D,0x3C,0x7D,0xFF,0xFF,0xFF, //ma ky tu: oto7
                              0xFF,0xFF,0xBE,0x1E,0xBE,0xFF,0xFF,0xFF, //ma ky tu: oto8

                              }; */
                              unsigned char Tic,i=0;
                              void Wait (unsigned long Valdelay){
                              while(Valdelay--);
                              }
                              void main (){
                              unsigned char j;
                              TMOD=0x01;
                              TR0=1;
                              ET0=1;
                              EA=1;
                              while(1){
                              for(j=0;j<5;j++){
                              P1=0xFF;
                              P2=1<<j;
                              P1=code_Tab[i][j];
                              Wait(1);
                              }
                              }
                              }
                              void INT0_int()interrupt 1{
                              Tic++;
                              if(Tic==5){
                              Tic=0;
                              i++;
                              if(i==97)i=0;
                              }
                              } ko biết cách upfile lên như thế nào
                              bác "Takado" ơi. em đang nghiên cứu cái code C giống của bác. còn mỗi cái thắc mắc là tại sao lại dùng timer 0 chế độ 16 bít vậy??
                              bác coi giúp em cái code này với. khi nào thì nó ngắt. Do tìm hiểu thì ngắt chỉ xảy ra khi cờ TF tràn. mà timer thì không nạp lại.....Đang kẹt chỗ này.
                              8x32.rar file đính kèm về code và mô phỏng
                              p/s sau khi đo xung nhip thi viec nap với không nạp tl0 và THo là như nhau. thời gian ngắt đo được là khoảng 40ms....
                              các bác chỉ giúp.
                              với C hiện vẫn là hạng ruồi, chưa lên hạng gà hic
                              Last edited by xuanhanh1987; 04-12-2012, 01:47.

                              Comment

                              Về tác giả

                              Collapse

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

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

                              Collapse

                              Đang tải...
                              X