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
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
3)when i use
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
void LCDPutString( char *string)
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
if (LCDX_Pos >= 16)// Have we reached the end of the line?
LCDX_Pos= 0;// Move to the start of the next line
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
but when i used on PIC18F45K80
it displays 5 junk characters in run mode but diplays "hello" in debug mode