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 / I2C problems on PIC 16F913

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



Joined: 17 Aug 2007
Posts: 38

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

LCD / I2C problems on PIC 16F913
PostPosted: Tue Feb 12, 2008 1:20 pm     Reply with quote

Hi All
I'm using 16F913 with LCD module and SSP module as slave.
LCD module used alone has got no problems. SSP used alone has got no problem.
SSP module used together with LCD module lets SSP module be ok, but no way to write on LCD; It is possible driving segs only inside of the isr routine, but I can't do this because of the application.
What could be the problem?
MPLAB 8.0 - Windows XP - CCS PCM 4.057.

This is the main code


Code:
 

cicla1:   
   
   
    DISABLE_SSP_INT();

                                convertiCMD();

       //LCD Module's ready?      
      if(bit_test(*LCDCON,5))
      bit_clear(*LCDCON,5);
      
                                //write
      display_DGT1();   //set LCDDATAx,y
      
       //LCD Module's ready?      

      if(bit_test(*LCDCON,5))
      bit_clear(*LCDCON,5);                        
      
      display_DGT2();   //set LCDDATAx,y                               //LCD Module's ready?      
      
      if(bit_test(*LCDCON,5))
      bit_clear(*LCDCON,5);
      
      display_DGT3();   //set LCDDATAx,y   
                           //mostra DGT3 (unità)
      CCMD1=CMD1;
      CCMD2=CMD2;
   }
      
      
      if(bit_test(*LCDCON,5))
      bit_clear(*LCDCON,5);
      if (LIV4!=LLIV4)
         {
            SLIV4=LIV4;
            LLIV4=LIV4;   
         }
      if (LIV3!=LLIV3)
         {
            SLIV3=LIV3;
            LLIV3=LIV3;   
         }
      if (LIV2!=LLIV2)
         {
            SLIV2=LIV2;
            LLIV2=LIV2;   
         }   
      if (LIV1!=LLIV1)
         {
            SLIV1=LIV1;
            LLIV1=LIV1;   
         }
   

*/
ENABLE_SSP_INT();
   delay_ms(10);
   goto cicla1;


I use data (correctly) received from SSP (I2C) to update LCD custom display (using convertiCMD and displayDGTx()). But no update occurs. Debugging code (line by line), variables (on Watch window) don't change on any operation (e.g. assignments, add, subtraction...).

Is it an MPLAB or silicon problem? I also tried to compile code as release and download on silicon, but I obtained the same result.

I disabled SSP interrupt before executing code for updating display


Thank you for you kind reply.
regards.
Marco Vedovetto
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