CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem with LED dot matrix display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
karthickiw



Joined: 09 Aug 2007
Posts: 82
Location: TN, India

View user's profile Send private message Send e-mail

Problem with LED dot matrix display
PostPosted: Sun Mar 29, 2009 7:12 am     Reply with quote

Hi friends,

I write the program to display the “Hello” in scrolling 7X60 LED display. I successful to scrolling the “Hello” massage in 7X60 LED display. I have problem with brightness of LED display Crying or Very sad . I don’t put any resistor for LED display. My coding is below….


Code:

#include<16f876.h>
#use delay(clock=20M)
#fuses NOWDT,HS, PUT, PROTECT, NODEBUG, BROWNOUT, NOLVP, CPD, WRT
#byte port_b=6

#define EXP_OUT_ENABLE PIN_A2    //RCK
#define EXP_OUT_CLOCK PIN_A1     //SCK
#define EXP_OUT_DO PIN_A0        //SER

#define NUMBER_OF_74595 7
#include <74595.C>

int inc=0,chr_no=31,column_no=56,last_inc;  // chr_no calculate from zero//
long int time2=0;

int CONST str_MAP[]={0x00 , 0x00 , 0x00 , 0x00 , 0x00,                     
                     0x7F , 0x08 , 0x08 , 0x08 , 0x7F,
                     0x00 , 0x38 , 0x54 , 0x54 , 0x54,
                     0x48 , 0x00 , 0x7F , 0x00 ,
                     0x00 , 0x7F , 0x00 ,
                     0x38 , 0x44 , 0x44 , 0x44 , 0x38,
                     0x00 , 0x00 , 0x00 , 0x00 , 0x00};



#INT_timer2                                                // move the character in display
void seconds_timer2()
{

time2++;
if(time2==100)
{
inc++;
if (inc==(chr_no+1)) inc=0;
time2=0;
}

}


void main() {
int data[7]=0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0X7F;

   int  mask[7];  //ffef
   int Column=0,str=0,act=0;
   setup_timer_2(T2_DIV_BY_16,255,1);
   enable_interrupts(INT_TIMER2);
   enable_interrupts(GLOBAL);
   //disable_interrupts(INT_TIMER2);
   set_tris_b (0x00);
   str=chr_no;
   column=column_no;
   while (TRUE)
   {

       IF (str==255)
     {
     str=chr_no;
     }
     
   
     
      mask[0]=data[0];                 // move the data into the mask temp space
      mask[1]=data[1];
      mask[2]=data[2];
      mask[3]=data[3];
      mask[4]=data[4];
      mask[5]=data[5];
      mask[6]=data[6];
     
     // port_b=0x00;               
      write_expanded_outputs (data);  // sent the data to 74HC595
      act=str+inc;
      if (act >chr_no) act=act-(chr_no+1);        // rotate the string   
      port_b= str_map[act];       // sent the string to port B
     
      data[0]=mask[0];                       // move the temp data into the data
      data[1]=mask[1];
      data[2]=mask[2];
      data[3]=mask[3];
      data[4]=mask[4];
      data[5]=mask[5];
      data[6]=mask[6];
     
      str--;                           // increase the string pointer
         
     
      if(Column==1)            // check colume is end or not
      {
      data[0]=0XFF;             // referene from frist column
      data[1]=0XFF;
      data[2]=0XFF;
      data[3]=0XFF;
      data[4]=0XFF;
      data[5]=0XFF;
      data[6]=0X7F;
     
      Column=column_no;   
      str=chr_no;
      }
      else
      {
      Column--;
     
     
     
      if ( column <= 8)
      {
         if (column==8)
         {
         data[0]=0X7F;
         data[1]=0XFF;
         data[2]=0XFF;
         data[3]=0XFF;
         data[4]=0XFF;
         data[5]=0XFF;
         data[6]=0XFF;
         }
         else
         {
         rotate_right( &data[0] , 1); //move the next column    L <---- R
         }
      }
      else if( column<=16)
      {
      if (column==16)
         {
         data[0]=0XFF;
         data[1]=0X7F;
         data[2]=0XFF;
         data[3]=0XFF;
         data[4]=0XFF;
         data[5]=0XFF;
         data[6]=0XFF;
         }
         else
         {
         rotate_right( &data[1] , 1); //move the next column    L <---- R
         }
      //rotate_right( &data[1] , 1);
      }
      else if( column<=24)
      {
        if (column==24)
         {
         data[0]=0XFF;
         data[1]=0XFF;
         data[2]=0X7F;
         data[3]=0XFF;
         data[4]=0XFF;
         data[5]=0XFF;
         data[6]=0XFF;
         }
         else
         {
         rotate_right( &data[2] , 1); //move the next column    L <---- R
         }
      }
      else if( column<=32)
      {
        if (column==32)
         {
         data[0]=0XFF;
         data[1]=0XFF;
         data[2]=0XFF;
         data[3]=0X7F;
         data[4]=0XFF;
         data[5]=0XFF;
         data[6]=0XFF;
         }
         else
         {
         rotate_right( &data[3] , 1); //move the next column    L <---- R
         }
      }
      else if( column<=40)
      {
        if (column==40)
         {
         data[0]=0XFF;
         data[1]=0XFF;
         data[2]=0XfF;
         data[3]=0XFF;
         data[4]=0X7F;
         data[5]=0XFF;
         data[6]=0XFF;
         }
         else
         {
         rotate_right( &data[4] , 1); //move the next column    L <---- R
         }
      }
     
      else if( column<=48)
      {
        if (column==48)
         {
         data[0]=0XFF;
         data[1]=0XFF;
         data[2]=0XfF;
         data[3]=0XFF;
         data[4]=0XFF;
         data[5]=0X7F;
         data[6]=0XFF;
         }
         else
         {
         rotate_right( &data[5] , 1); //move the next column    L <---- R
         }
      }
      else if( column<=56)
      {
        if (column==56)
         {
         data[0]=0XFF;
         data[1]=0XFF;
         data[2]=0XfF;
         data[3]=0XFF;
         data[4]=0XFF;
         data[5]=0XFF;
         data[6]=0X7F;
         }
         else
         {
         rotate_right( &data[6] , 1); //move the next column    L <---- R
         }
      }
     
      }

   //delay_us(500);



    }// while
}// main





Give the idea to increase the brightness of the LED display…
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Mar 29, 2009 7:55 am     Reply with quote

without knowing the schematic you have for the HARDWARE - posting all the code in the world won't get an answer. perhaps if you post the same question 5 more times - .............

yours is not a problem of CODE - but of lack of electronics understanding - it appears THAT problem is very common here and has no easy answer .
rote
Guest







Do you have a schematic?
PostPosted: Mon Apr 20, 2009 10:25 pm     Reply with quote

I am interested in this project. I look at code and test is working but I
don't know your circuits.

Please post schematic of this project.

Thank you.
OE8PCK



Joined: 19 Apr 2009
Posts: 14
Location: Klagenfurt, AUSTRIA

View user's profile Send private message

PostPosted: Tue Apr 21, 2009 6:03 am     Reply with quote

I would suggest driving the leds through transistors, this way you can adjust the brightness with resistors. Driving directly on this scale does not seem to be a good idea. Wink

Paul OE8PCK
karthickiw



Joined: 09 Aug 2007
Posts: 82
Location: TN, India

View user's profile Send private message Send e-mail

Re: Do you have a schematic?
PostPosted: Fri May 22, 2009 11:21 pm     Reply with quote

rote wrote:
I am interested in this project. I look at code and test is working but I
don't know your circuits.

Please post schematic of this project.

Thank you.


Give me your email id, I send schematic.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group