Problem with the speed of a 7x48 led matrix


hi have problem 7x48 led matrix 7 rows connected arduino amplifier , colums driven multiple cd4094be shift register.

like seen in video: https://www.youtube.com/watch?v=qmbdwyahuzu&feature=youtu.be message start fast slow down in middle of matrix , more letters proble become worse letters flickering.

here code:
code: [select]

int data=8;
int clock=9;
int strobe=10;

byte scritta[7][30];


byte alfabeto[][5] = {
 {0,0,0,0,0},
 {31, 36, 68, 36, 31},
 {127, 73, 73, 73, 54},
 {62, 65, 65, 65, 34},
 {127, 65, 65, 34, 28},
 {127, 73, 73, 65, 65},
 {127, 72, 72, 72, 64},
 {62, 65, 65, 69, 38},
 {127, 8, 8, 8, 127},
 {0, 65, 127, 65, 0},
 {2, 1, 1, 1, 126},
 {127, 8, 20, 34, 65},
 {127, 1, 1, 1, 1},
 {127, 32, 16, 32, 127},
 {127, 32, 16, 8, 127},
 {62, 65, 65, 65, 62},
 {127, 72, 72, 72, 48},
 {62, 65, 69, 66, 61},
 {127, 72, 76, 74, 49},
 {50, 73, 73, 73, 38},
 {64, 64, 127, 64, 64},
 {126, 1, 1, 1, 126},
 {124, 2, 1, 2, 124},
 {126, 1, 6, 1, 126},
 {99, 20, 8, 20, 99},
 {96, 16, 15, 16, 96},
 {67, 69, 73, 81, 97},
};



void setup(){
  int i,j,k;
  int lettera;  //letter row
  int colonna;  //memorize column value
  pinmode(0, output);
  //rows
  pinmode(1, output);
  pinmode(2, output);
  pinmode(3, output);
  pinmode(4, output);
  pinmode(5, output);
  pinmode(6, output);
  //every impulse on clock shift data, every impulse on strobe output data inside registers
  pinmode(data, output);   
  pinmode(clock, output);   
  pinmode(strobe, output); 
 
  char msg[]="ciao";
  for(j=0;j<(sizeof(msg)-1);j++){
    lettera=msg[j] - '@';  //row index
    if(msg[j]=='@')
      lettera=0;
    for(i=0;i<5;i++){      //conversion numbers
      colonna=alfabeto[lettera][i];
      for(k=6;k>=0;k--){
        scritta[k][i+j*6]=(colonna%2);
        colonna=colonna/2;
      }
    }
    for(k=0;k<7;k++){
        scritta[k][i+j*6]=(colonna%2);
        colonna=colonna/2;
    }
  }
 
  //initialize matrix
  digitalwrite(data, low);
  for(i=0;i<47;i++){
    digitalwrite(clock, high);
    digitalwrite(clock, low);
   
  }
  digitalwrite(strobe, high);
  digitalwrite(strobe, low);
  delay(1000);
 
}

void loop(){
  int i,j,k,h,pin;
  int  vel=10;
  int r=7,c=24;
 
  int nled;
  nled=47+c;
 
 
  for(j=1;j<=nled;j++){
    for(h=0;h<vel;h++){
      for(i=1;i<=j && i<=c;i++){         
       
       
        digitalwrite(data, high);
        digitalwrite(clock, high);
        digitalwrite(clock, low);
        digitalwrite(data, low);
       
        for(k=0;k<j-i;k++){       
          digitalwrite(clock, high);         
          digitalwrite(clock, low);     
        }
       
        for(pin=0;pin<r;pin++){
          if(i<=c)
            digitalwrite(pin, scritta[pin][c-i]);
        }
        //light column
        digitalwrite(strobe, high);
        //delaymicroseconds(500);
        //delay(100);
        digitalwrite(strobe, low);
       
        //set data 0
        for(k=0;k<nled-i;k++){
          digitalwrite(clock, high);
          digitalwrite(clock, low);     
        }
        digitalwrite(strobe, high);
        digitalwrite(strobe, low);
       
      }
    }
  }   
 
 
}


i think problem code not fast enough i'm asking if there way rewrite code make faster or if there functions better suited drive matrix.

one possible solution thought output pwm right frequence drive registers , @ same synchronize code it, don't know if may work or there easier solutions.

any appreciated. thanks.

hi,

i have problem 7x48 led matrix 7 rows connected arduino amplifier , colums driven multiple cd4094be shift register.
to you, must have more detail of circuit. example:
  • what mean "amplifier"? transistor? npn or pnp? model code , maximum current?
  • why these amplifiers needed? each arduino output seems light 1 led @ instant.
  • how these amplifiers connected matrix?
  • do rows of matrix consist of led anodes or cathodes?
  • why there appear 13 chips on matrix board? '4094 has 8 outputs, 6 needed. other 7 chips?
  • do have link matrix board includes schematic?
  • do have schematic other parts of circuit (arduino + amplifiers)?


the message start fast slow down in middle of matrix , more letters proble become worse letters flickering.

code: [select]

  for(j=1;j<=nled;j++){
    for(h=0;h<vel;h++){
      for(i=1;i<=j && i<=c;i++){          

the scrolling slows down because of these loops. j increased outer loop, inner loop must execute more times. makes inner loop slower each time, until j exceeds c, speed stable.

i think problem code not fast enough i'm asking if there way rewrite code make faster or if there functions better suited drive matrix.
yes, think there is, sure, need answers above questions.

at moment thinking code performing multiplexing in inefficient way. 1 column lit @ instant, each led lit 1 period , off 47 periods. makes code slow , leds dim.

it faster , brighter multiplex 1 row @ time. mean each led lit 1 period off 6 periods. leds appear 8 times brighter. code need send less data shift registers.

however, multiplexing 1 row @ time can done if "amplifiers" can source or sink enough current light 48 leds. around 1a, maybe little more.

there arduino function, shiftout() , library, spi, can send out serial data shift registers more quickly. not think using these correct issues have. if re-write code perform multiplexing more efficiently, think fast enough without using functions/libraries.

paul


Arduino Forum > Using Arduino > LEDs and Multiplexing > Problem with the speed of a 7x48 led matrix


arduino

Comments