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

LCD Clock wt PIC 18F4550

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



Joined: 01 Mar 2011
Posts: 30

View user's profile Send private message

LCD Clock wt PIC 18F4550
PostPosted: Sun May 15, 2011 12:33 pm     Reply with quote

Hi again, i'm working on a clock program interfaced with an 20x2 LCD display and a pic 4550 clocked at 20Mhz. I've got the whole code up and running but it seems to be a little bit speedy...

Code:
void main()
{
   ////////////////////////////Variables local.//////////////////////////////////
   int32 j;
   int8 k;
   lcd_init();//Initialisation du pilote d'affichage LCD.
   //Faire la boucle tant que l'entré des minutes n'est pas activée.
   do
   {
      //Boucle à compteur pour ajuster le temps à sa valeur réel(60 secondes).
      for(j=1;j<=83000;j++)
      {
         //Appel de la fonction boucle d'affichage.
         Display_Loop(Min1,Min10,Hr10,Hr1);
         //Si l'entré ajustement du temps est activé,changer le temps de la boucle et
         //appel de la fonction ajustement du temps.
         if(input(TIMESET)==0)
         {
            //Boucle à compteur pour accélérer l'écoulement du temps lors de l'ajustement.
            for(k=1;k<=200;k++)
            {
               //Appel de la fonction boucle d'affichage.
               Display_Loop(Min1,Min10,Hr10,Hr1);
            };
            TimeAdjust();//Appel de la fonction ajustement du temps.
         };
      };
      EcouleTemps();//Appel de la fonction écoulement du temps.
   }//Fin de la boucle tant que.
   while(input(TIMESET)==1);
}



i've used the same code with multipexing function and registery shifter with four 7 segments display and i've never had this problem.

Code:
for(j=1;j<=83000;j++)
I thought 60000 would do the trick but i guess not ... i've modified the code a bit though, i had some delays before, but seems i'm not using the multiplexing anymore, i've got rid of them...
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