Problem with PIC flash memory

Thread Starter

peyot

Joined Mar 7, 2011
2
Hi,

I program a PIC16F877 with mikroC and I want to use the PIC's flash program memory to store data to be processed by the program running on the PIC.

I store my data like this:
Rich (BB code):
const unsigned short data1[] = {23, 125, ...};
const unsigned short data2[] = {23, 125, ...};
...
I have 4 array to use all flash memory pages of the PIC.
Example of Code Processing :
Rich (BB code):
unsigned int i;
		
for(i=0;i<MAX;i++) {
	PORTC = data1;			
}
for(i=0;i<MAX;i++) {
	PORTC = data2;			
}
...


But if data + program use more than one page, the program crash on the microcontroller while the compiler gives me no errors.
If you have any idea.
Thank you
 
Top