chipKIT® Development Platform

Inspired by Arduino™

Storing values to EEprom? troubles

Created Sun, 12 Jan 2014 04:44:45 +0000 by Bartje64


Bartje64

Sun, 12 Jan 2014 04:44:45 +0000

Next hurdle, storing and reading values to the eeprom with the Arduino worked fine, with the Chipkit Uno32 i'm not having much luck.

I'm trying to store a value between 6,000,000 and 30,000,000 Upon boot-up I want to read the value from memory.

I found PROGMEM examples, but could not get it to work due to my lack of experience/knowledge.

The eeprom version worked on the Arduino Uno, but as written, not on the Chipkit. Reading up on the Chipkit, I found info that it does not have eeprom but flash memory (is this correct?). Perhaps that is why the Arduino eeprom version does not work.

Anyways I'm looking for some pointers. It should be simple (so it seems) but I cannot wrap my head around it.

As always, appreciate it....

Bart


Bartje64

Sun, 12 Jan 2014 16:52:32 +0000

Got it working after many tries...

//*********************************** Arduino ****************************************//   
    /*
    freq = String(EEPROM.read(0))+String(EEPROM.read(1))+String(EEPROM.read(2))+String(EEPROM.read(3))+String(EEPROM.read(4))+String(EEPROM.read(5))+String(EEPROM.read(6));
     rx = freq.toInt();
     //Serial.println(rx);
     */
    //***********************************************************************************//

    //**************************** Chipkit Uno32 ****************************************// 

    freq = (String(int(EEPROM.read(0))))+(String(int(EEPROM.read(1))))+(String(int(EEPROM.read(2))))+(String(int(EEPROM.read(3))))+(String(int(EEPROM.read(4))))+(String(int(EEPROM.read(5))))+(String(int(EEPROM.read(6))));
    rx = freq.toInt();
    //Serial.println (rx);

    //***********************************************************************************//