This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Storing variable in perment memory location in LPC2378

Dear sirs
I have one counter variable updating on every 1 second.I have to store that variable in perment memory location.so that I will use that counter after power OFF and ON hardware.but I want value of that variable is last value befour Power OFF the H/W.I want also start counting from last value (not from zero).

Plz suggest me which memory area is sutable to store such variale which is updating at every 1 second.Because it may affect read write cycle life of flash memories.
Here are some memories that I know
1)On chip flash LPC2378
2)On chip RTC battary backup ram of LPC2378
3)External flash
4)External EEPROM.

Thanks&Regards
Parineeta
India

Parents
  • Of the suggested memories, only the battery-backed RAM will not suffer from wear. But the LPC23xx chips are a bit hungry so a supercap will need to be quite large to get longer backup times, and if you switch to silver-oxide or lithium non-chargeable batteries you will have to replace them regularly.

    An EEPROM normally supports an order of magnitude more write cycles than flash. And you may design a scheme where you use 100 memory locations in the EEPROM to scale the life further. Remember that your value is a counter, so the difference between two values is just one - no need for a full 32-bit variable to store each value. Depending on EEPROM type, it may even be that only changes from 0->1 for an individual bit, or from 1->0, may be the only significant wear, in which case you can get even more creative - but such optimizations requires that you contact the chip manufacturer, since such information isn' in the datasheet.

    Note that there are EEPROM-equivalent memories (such as FRAM) that have practically no wear-out count. It may be your simplest solution to the problem - especially since the LPC2378 does not have any built-in EEPROM so your only practical solution to survive a write/second is to pay for hardware.

Reply
  • Of the suggested memories, only the battery-backed RAM will not suffer from wear. But the LPC23xx chips are a bit hungry so a supercap will need to be quite large to get longer backup times, and if you switch to silver-oxide or lithium non-chargeable batteries you will have to replace them regularly.

    An EEPROM normally supports an order of magnitude more write cycles than flash. And you may design a scheme where you use 100 memory locations in the EEPROM to scale the life further. Remember that your value is a counter, so the difference between two values is just one - no need for a full 32-bit variable to store each value. Depending on EEPROM type, it may even be that only changes from 0->1 for an individual bit, or from 1->0, may be the only significant wear, in which case you can get even more creative - but such optimizations requires that you contact the chip manufacturer, since such information isn' in the datasheet.

    Note that there are EEPROM-equivalent memories (such as FRAM) that have practically no wear-out count. It may be your simplest solution to the problem - especially since the LPC2378 does not have any built-in EEPROM so your only practical solution to survive a write/second is to pay for hardware.

Children
  • Dear Sir
    How can I access RTC battary backup RAm area of LPC2378?
    Plz give me some information to store variable in RTC ram.

    Thanks & Regards
    Parineeta
    India.

  • Nothing fancy needed. Enough to set a pointer to point at this region. No much different from all the SFR that are also defined as pointers. Only difference is that you probably don't need to declare this pointer as volatile, unless you will mix the accesses between an ISR and the main loop (or possibly one or more RTX threads).

    But do you have a battery or supercap connected? And have you specified how many hours without power the solution must support (supercap) or how often you need to replace the battery?

    It is meaningless to start with a solution unless you have already all parameters on the table and can guarantee that you can keep the memory protected long enough.

  • Dear sir
    I am designing my hardware kit such as ,When hardware kit is ON at that time I will giving power to RTC RAM from main source not from battary,and I am writing and reading data only when my H/w kit is ON.

    So I think that I am not consuming lot of battary power.Is am right ?

    wating for ur reply....

    Thanks & regards
    Parineeta
    India

  • You must always supply voltage to the Vbat input if you intend to use the RTC or the 2kB of RAM - even if you do not require them to retain data when the chip is unpowered.

    "So I think that I am not consuming lot of battary power.Is am right ?"

    Have you looked at the documentation?

    They claim that in active mode (not really defined) the current is 20uA if the DC-DC is on and 28uA if the DC-DC is off.

    If "active mode" happens to be that the core is powered, then there are no figure at all to specify how much current the chip requires on Vbat when the core isn't powered.

    But as you can see, the current specified is quite high. If we assume that it draws 28uA when the core isn't powered too, then you would need 20mAh/month or 240mAh/year. This makes it problematic with a small button cell, unless you know that the device spends most time powered. Remember that you must also take into account the self-discharge of the battery. And if it does spend most time powered, you must still make sure that it takes the Vbat power from the main supply during that time, and reserves the battery for the time when there is a power loss or your unit is disconnected and shelved.

    Now you need to go back to NXP and ask them what Ibatt-act means, and what value there is for a corresponding Ibatt-nonact... It isn't too fun to implement a critical function without all information documented.