Problem with PIC flash memory

Discussion in 'Embedded Systems and Microcontrollers' started by peyot, Mar 7, 2011.

  1. peyot

    Thread Starter New Member

    Mar 7, 2011
    2
    0
    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:
    Code ( (Unknown Language)):
    1. const unsigned short data1[] = {23, 125, ...};
    2. const unsigned short data2[] = {23, 125, ...};
    3. ...
    I have 4 array to use all flash memory pages of the PIC.
    Example of Code Processing :
    Code ( (Unknown Language)):
    1.  
    2. unsigned int i;
    3.        
    4. for(i=0;i<MAX;i++) {
    5.     PORTC = data1[i];          
    6. }
    7. for(i=0;i<MAX;i++) {
    8.     PORTC = data2[i];          
    9. }
    10. ...[/i][/i]


    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
     
  2. peyot

    Thread Starter New Member

    Mar 7, 2011
    2
    0
    Apparently the problem was in mikroC.
    After reinstalling, everything work normally.
     
Loading...