Memory Questions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Memory Questions

1,728 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ub3r on Tue Jul 24 08:55:19 MST 2012
Im using the ADC to measure current and MA/hrs on a solar panel, and i want to store the peak currents, and A/hrs after reboot.

Whats the easiest way to do this?

My understanding is the LPC1343 doesnt have internal eeprom, so is there any example code of how to use the onboard flash to store variables? Or do i have to use external eeprom?
0 Kudos
Reply
7 Replies

1,717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by frame on Wed Jul 25 06:28:38 MST 2012

Quote:
Data can be saved within the interrupt of the BOD.

Be sure that you have time enough to do so, by using larger capacitors.    

Could you explain this in some more detail ?
For systems I know, a brown out happens rather late, when capacitors almost empty.

As second point,  I would avoid writng to Flash under tight time and energy constraints. A write may involve an erase,
adding some hundred milleseconds to finish. And to be clear, Flash erase/write consumes a significantl current.
When erasing and programming, charge pump boosters are started to create a voltage of 9..12V internally, required to get
a charge on the isolated gate. I have measured this for a 8 bit controller, which was drawing about 300% of the normal current
in this case (3mA/10mA).  In relation, it would be less dramatic for a M3, but can't be ignored when running on cap charges.
0 Kudos
Reply

1,718 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Wed Jul 25 03:54:19 MST 2012
Hi ub3r,

Data can be saved within the interrupt of the BOD.

Be sure that you have time enough to do so, by using larger capacitors.
0 Kudos
Reply

1,717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by frame on Wed Jul 25 00:18:07 MST 2012
That depends on your requirements.

My company implemented such an algorithm in a commercial device, that used several Flash blocks in ping-pong mode
(i.e. filling one block successively and erasing the next ahead; and so on, in a turn-around mode).

As the data saving happened after power off while the device was living from a capacitor charge,
and the date were crucial, the implementation was quite complex and included error checking
and recovery from failed block writes.
This part of code was the reason for several field returns ...

If you have no timing constraints, I would suggest a simple two-block mode.
At a write event, erase the last used, and write to the other.
When including some low-1-count signature bytes in your data block (like 0x00),
you have no problems to detect which block was used lastly.
0 Kudos
Reply

1,717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ub3r on Tue Jul 24 17:46:57 MST 2012
Thanks guys im loving this community more and more. :D

Im going to try and implement the flash based solution, if it doesnt work, ill use an i2c eeprom.

Cheers
0 Kudos
Reply

1,717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Clovis on Tue Jul 24 10:46:44 MST 2012
If you don't have to save a lot of data but just a few KiB, and if you don't have to save them constantly but once in a while, you may consider writing in the flash memory of LPC1343 using IAP.

This is not the most neat solution, but it has no-hardware cost.

Check this out
http://www.lpcware.com/content/nxpfile/an11008-flash-based-non-volatile-storage-software
0 Kudos
Reply

1,717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ex-kayoda on Tue Jul 24 10:18:30 MST 2012
I like this 24AA08 http://ww1.microchip.com/downloads/en/devicedoc/21710c.pdf :)

SOT-23-5, 2 pullups as 402 and no problems with reprogramming my chip. Data are save in external storage :rolleyes:

Hardware costs: ~0.30 Euro :eek:
0 Kudos
Reply

1,717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 24 09:11:06 MST 2012
Store it in your RTC chip: MCP79410 :eek:

See: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en550280
0 Kudos
Reply