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
  • 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.

Reply
  • 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.

Children
  • 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.