1. You can now buy finished microcontroller project from us, Check out the Store for the complete list of projects.
  2. Need a custom project, Send us some details about your project. So that we can quote the price for it.

loading data in 74hc595

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by dheerajc, Nov 14, 2008.

  1. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
    As per the circuit they are using Row scanning. The Column datas are loaded first through the shift registers and the Row is selected.
    Then the second Row is selected and the column datas are loaded.

    The Column data's are loaded with help of the following lines
    COL_CLK
    COL_DAT
    COL_LOAD
    COL_RESET

    First give a pulse to the COL_RESET, so all the shift register outputs will be zero.
    The load the data for the last bit in the data line and give a clock pulse.
    Repeat the above so after 12th clock all the 12bit datas are moved inside the resisters.
    Now give a clock pulse to COL_LOAD, so the data's on the resisters are loaded to the output pins.
  2. dheerajc

    dheerajc New Member

    Likes Received:
    0
    Trophy Points:
    0
    hi,
    Sir in my moving message display now I am facing problem of how to create an illusion.I am using 89c2051rd2bn.
  3. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
  4. dheerajc

    dheerajc New Member

    Likes Received:
    0
    Trophy Points:
    0
    HI,

    Its 'P89c51RD2BN'.
  5. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
  6. dheerajc

    dheerajc New Member

    Likes Received:
    0
    Trophy Points:
    0
    hi,
    Yes sir I want to move the data.Illusion means,I want to know the
    scrolling technique,in the same way as normal moving message board works.Please tell me the technique.
  7. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
  8. dheerajc

    dheerajc New Member

    Likes Received:
    0
    Trophy Points:
    0
    hi,
    I have already gone thru it,but nothing has clearly mentioned about 'persistance of vision' thing.Right now wt i have done is I am loading 5 byte data one by one and shifting it on successive columns.Like If i want to display lettor "E",then hex code for it is 0xff,0xff,0xdb,0xdb,0xc3.First i display 'ff' on the first column,clear it,then on the next column 'ff' again,clear it,then '0xdb' two times and then '0xc3' in the end.But all this is very slow and it doesnt look like letter 'E'.What exatly i have to do to look it like lettor 'E'.Plz help.Sorry to bother you again.
  9. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
  10. dheerajc

    dheerajc New Member

    Likes Received:
    0
    Trophy Points:
    0
    #include<p89v51rd2.h>

    /*P1 = R1 to R8(8 BITS OF DISPLAY BOARD)
    * col_clk = P2.0
    * col_dat = P2.1
    * col_ldd = P2.2
    * col_rst = p2.3
    * col_clk = SH_CP(SHIFT REGISTER)
    * col_dat = DS(SERIAL INPUT)
    * col_ldd = ST_CP(STORAGE REGISTER)
    * COL_RST = MR(master reset active low)
    * OE = OUTPUT ENABLE (active low)*/


    __sbit __at (0x90) row_1;
    __sbit __at (0x91) row_2;
    __sbit __at (0x92) row_3;
    __sbit __at (0x93) row_4;
    __sbit __at (0x94) row_5;
    __sbit __at (0x95) row_6;
    __sbit __at (0x96) row_7;
    __sbit __at (0x97) row_8;

    __sfr __at (0x90) p1;
    __sbit __at (0xA0) sh_cp;
    __sbit __at (0xA1) ds;
    __sbit __at (0xA2) st_cp;
    __sbit __at (0xA3) mr;
    __sfr __at (0x89) TMOD;
    __sfr __at (0x8D) TH1;
    __sfr __at (0x8B) TL1;

    //#define TR1 TCON_6
    //#define TF1 TCON_7

    void delay();
    void clock2();
    void clock();

    unsigned int i;
    unsigned int j;

    void clock()
    {

    sh_cp = 0;
    delay();
    sh_cp = 1;
    }


    void clock2()
    {
    st_cp = 0;
    delay();
    st_cp = 1;
    }


    void delay()
    {

    for(i=0;i<=300;i++);
    TR1=1; //start timer 1
    while(!TF1); //check TF1 flag
    TR1=0; //clear timer 1
    TF1=0; //clear TF1 flag
    }


    void delay1()
    {
    for(i=0;i<=30000;i++);
    }



    void main()
    {
    char a = 0,b = 0,cnt = 0;

    unsigned char font[5] = {0xff,0xff,0xdb,0xdb,0xc3};
    TMOD=0x20; // * timer1 mode 2
    TL1=0x00;
    TH1=0x0EE; //5 ms delay

    mr = 1; //RESET IS '0'
    do
    {
    for(cnt = 0;cnt<=4;cnt++)
    {
    p1 = font[cnt];
    clock(); //CLOCK FOR SHIFT REGISTER
    clock2(); //CLOCK FOR STORAGE REGISTER
    ds = 0; //SERIAL IN FOR 74HC595
    delay1(); //DELAY FOR DATA TO REMAIN ON ONE COLUMN
    a++;
    if(a==5)
    {
    break;
    }
    }
    }while(1);


    }

    First of all I am trying to display only one character.As i have used three shift registers I have restricted the output to only 5 columns,After that data repeats itself for 23 columns.And please tell me how to start the display again from the first column after 5th column.Ihis code is insufficient thats why I need ur help.

    Thanx
Loading...

Share This Page

Loading...