Hi,
I am trying to store time data in FRAM . I have set up a struct to store the data and I believe I am using the correct method of setting up SYSCFG0 to save the data. However, the data is not persistent after a power cycle. Is my method o
#pragma PERSISTENT(time_array)
struct activation_time
{
unsigned int month;
unsigned int day;
unsigned int hour;
unsigned int minute;
unsigned int second;
unsigned int level;
};
struct activation_time time_array[100];
main()
{
unsigned int index;
SYSCFG0 = FRWPPW | PFWP;
time_array[index].month= RX_buffer[0xB];
time_array[index].day= RX_buffer[0xA];
time_array[index].hour= RX_buffer[0x8];
time_array[index].minute= RX_buffer[0x7];
time_array[index].second= RX_buffer[0x6];
time_array[index].level = adcResult;
SYSCFG0 = FRWPPW | DFWP | PFWP; // Program FRAM write protected (not writable)
if ( index <=99) {index++;}
}f saving a struct allowed?
Thanks in advance
Richard