Mvedovetto
Joined: 17 Aug 2007 Posts: 28
|
LCD / I2C problems on PIC 16F913 |
Posted: Tue Feb 12, 2008 1:20 pm |
|
|
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 |
|