Hi,
i have compared clock frequency in both debug and free/run mode and found it to be same.
Regarding LCD issue, I have done different tests and got below inference
1)strcpy is not able to copy the string in run mode
char str[20];
strcpy(str,"Water");
LCDPutString(str);
It displays junk character in Run/free mode but displays correctly "Water" in debug mode
I am not sure if strcpy definition is gets added in run mode. i have added string.h but not sure if compiler is able to find definition
2)when i use following code then it displays correctly "98745" on LCD in both debug and run mode
char str[20];
str[0]='9';str[1]='8';str[2]='7';str[3]='4';str[4]='5';
LCDPutString(str);
3)when i use
LCDPutString("hello);
it displays 5 junk characters in run mode but displays "hello" correctly in debug mode.
4)when i use below code then it displays correctly in both debug and run modes
char str[20]="hello";
LCDPutString(str);
void LCDPutString( char *string)
{
char loop;
for (loop = 0; loop < 5; loop++)//just displaying 5 characters at the moment for test, using sizeof instead to get string length
{
LCD_Write_character(string[loop]);// Write the character to the LCD
halMcuWaitMs(5);
LCDX_Pos++;
if (LCDX_Pos >= 16)// Have we reached the end of the line?
{
LCDX_Pos= 0;// Move to the start of the next line
LCDY_Pos++;
if (LCDY_Pos >= 2)// If we are off the bottom of the screen go back to the top line
LCDY_Pos = 0;
LCDGoto(LCDX_Pos, LCDY_Pos);// Adjust the cursor position on the LCD
}
}
}
Regarding EEPROM and RTC, it works correctly in debug mode but fails to give correct data in run mode.
I am not able to understand where the problem is.
I have changed controller to PIC18F46K80 now mainly to get larger flash size but i get inference as above. My code size is just 47% program memory in this controller
When i used PIC18F45K80, my code size was 92% and hence i went for higher flash. however, i noticed that in PIC18F45K80 following code was displaying correctly in both debug and run mode
char str[20];
strcpy(str,"Water");
LCDPutString(str);
but when i used on PIC18F45K80
LCDPutString("hello");
it displays 5 junk characters in run mode but diplays "hello" in debug mode