MSP430 flash memory

Started by Technical Kripa November 12, 2008
Should the flash memory in MSP430 be used only for downloading of data or is it advisable to use flash memory for data logging considering 100000 times writing capability of flash.
In my current project I require to keep log of event at MSP ports. I would have to write say approx 500 bytes a day and the application is supposed to work for around 10 years.
Or should I use EEPROM or something else that one of you can suggest!
Cricket on your mind? Visit the ultimate cricket website. Enter http://beta.cricket.yahoo.com


Beginning Microcontrollers with the MSP430

It would help if I read your question a little more carefully. You're
not wanting to fill up 2M-bytes of memory, you're wanting to overwrite
the data each day, right? If that's the case I would suggest you go
ahead and dedicate a FLASH segment in the MSP430 for your data. Maybe
somebody else has objectionable experience with doing this, but I have
not had any trouble with thousands of erase/write cycles. I have a
product that uses look-up tables that are modified often and it has
been working fine for years.

Dave
--- In m..., Technical Kripa wrote:
>
> Should the flash memory in MSP430 be used only for downloading of
data or is it advisable to use flash memory for data logging
considering 100000 times writing capability of flash.
> In my current project I require to keep log of event at MSP ports. I
would have to write say approx 500 bytes a day and the application is
supposed to work for around 10 years.
> Or should I use EEPROM or something else that one of you can suggest!
>
>
> Cricket on your mind? Visit the ultimate cricket website.
Enter http://beta.cricket.yahoo.com
>
>
>

Your requirements are outside the address range, let alone FLASH
range, of the MSP430 family. You're wanting to write almost 2M-bytes
so whatever you use will have to be external. I would suggest a SD
FLASH memory card. See TI application note slaa281b for details on how
to do this. There is lots of example code out there on the Internet
for talking to the memory card.

Regards -
Dave

--- In m..., Technical Kripa wrote:
>
> Should the flash memory in MSP430 be used only for downloading of
data or is it advisable to use flash memory for data logging
considering 100000 times writing capability of flash.
> In my current project I require to keep log of event at MSP ports. I
would have to write say approx 500 bytes a day and the application is
supposed to work for around 10 years.
> Or should I use EEPROM or something else that one of you can suggest!
>
>
> Cricket on your mind? Visit the ultimate cricket website.
Enter http://beta.cricket.yahoo.com
>
>
>

Dave

I'm not sure why you believe the requirements are outside the range. The requirements are to vague to come to that conclusion. We know that 500 bytes a day are needed. We know that the device has a life expectancy of 10 years. We do not know how many days of data is needed. If the entire life of the product is needed to be stored then it won't work. If you need 30 days worth then its doable.

However, some people (myself included) have had trouble with the MSP430 internal flash. Others haven't had any problems. I would not recommend using it for data storage.

________________________________

From: m... [mailto:m...] On Behalf Of desertrc_tucson
Sent: Wednesday, November 12, 2008 9:54 AM
To: m...
Subject: [msp430] Re: MSP430 flash memory

Your requirements are outside the address range, let alone FLASH
range, of the MSP430 family. You're wanting to write almost 2M-bytes
so whatever you use will have to be external. I would suggest a SD
FLASH memory card. See TI application note slaa281b for details on how
to do this. There is lots of example code out there on the Internet
for talking to the memory card.

Regards -
Dave

--- In m... , Technical Kripa wrote:
>
> Should the flash memory in MSP430 be used only for downloading of
data or is it advisable to use flash memory for data logging
considering 100000 times writing capability of flash.
> In my current project I require to keep log of event at MSP ports. I
would have to write say approx 500bytes a day and the application is
supposed to work for around 10 years.
> Or should I use EEPROM or something else that one of you can suggest!
>
>
> Cricket on your mind? Visit the ultimate cricket website.
Enter http://beta.cricket.yahoo.com
>
>
>


Are you writing the 500-bytes in a burst or writing and erasing? If
you kept your logged data in RAM and just periodically wrote to flash
(say, once a day), you should easily get 10 years. (356 * 10 <
100000). We do something like this in an implanted medical device and
has been well-tested with the MSP430.

You can also look into "wear leveling" techniques to spread-out the
impact on your flash. On the MSP430, you should come up with a method
for erasing as little as possible and writing only the bytes you need.

You can also encode your data with a CRC, so at least you know if your
data are corrupt.

Our experience is that 100000 writes is very conservative, anyway.

Good luck.
Stuart

--- In m..., Technical Kripa wrote:
>
> Should the flash memory in MSP430 be used only for downloading of
data or is it advisable to use flash memory for data logging
considering 100000 times writing capability of flash.
> In my current project I require to keep log of event at MSP ports. I
would have to write say approx 500 bytes a day and the application is
supposed to work for around 10 years.
> Or should I use EEPROM or something else that one of you can suggest!
>
>
> Cricket on your mind? Visit the ultimate cricket website.
Enter http://beta.cricket.yahoo.com
>
>
>

Yes, I agree there's not enough info to determine memory size.

What kind of problems have you had with FLASH? If you cannot trust it
for data then you most certainly cannot trust it for program storage.

I have one product in customers hands that depends on FLASH data
storage, and another on the way very soon. FLASH data is updated often
in both cases. If there are issues with doing this I would be very
interested in knowing what they are. I have not had a bit of trouble.
Pun intended, sorry...

BTW, the 54XX parts have built in tests for FLASH under marginal
read conditions controlled by the FCTL4.MRG0 and FCTL4.MRG1 register
bits. Has anyone ever tried this? Any failures?

Thanks -
Dave

--- In m..., "Dan Muzzey" wrote:
>
> Dave
>
> I'm not sure why you believe the requirements are outside the range.
The requirements are to vague to come to that conclusion. We know
that 500 bytes a day are needed. We know that the device has a life
expectancy of 10 years. We do not know how many days of data is
needed. If the entire life of the product is needed to be stored then
it won't work. If you need 30 days worth then its doable.
>
> However, some people (myself included) have had trouble with the
MSP430 internal flash. Others haven't had any problems. I would not
recommend using it for data storage.
>
> ________________________________
>
> From: m... [mailto:m...] On
Behalf Of desertrc_tucson
> Sent: Wednesday, November 12, 2008 9:54 AM
> To: m...
> Subject: [msp430] Re: MSP430 flash memory
>
> Your requirements are outside the address range, let alone FLASH
> range, of the MSP430 family. You're wanting to write almost 2M-bytes
> so whatever you use will have to be external. I would suggest a SD
> FLASH memory card. See TI application note slaa281b for details on how
> to do this. There is lots of example code out there on the Internet
> for talking to the memory card.
>
> Regards -
> Dave
>
> --- In m... ,
Technical Kripa wrote:
> >
> > Should the flash memory in MSP430 be used only for downloading of
> data or is it advisable to use flash memory for data logging
> considering 100000 times writing capability of flash.
> > In my current project I require to keep log of event at MSP ports. I
> would have to write say approx 500bytes a day and the application is
> supposed to work for around 10 years.
> > Or should I use EEPROM or something else that one of you can suggest!
> >
> >
> > Cricket on your mind? Visit the ultimate cricket website.
> Enter http://beta.cricket.yahoo.com
> >
> >
> >
>
>
>
>
>

Quick answer on the marginal flash....last I check there was an errata on it. Seems ti had a reason to put it in then managed to screw it up putting it in. don't have the details at hand. Search the errata.
-----Original Message-----
From: m... on behalf of desertrc_tucson
Sent: Wed 11/12/2008 3:41 PM
To: m...
Subject: [msp430] Re: MSP430 flash memory

Yes, I agree there's not enough info to determine memory size.

What kind of problems have you had with FLASH? If you cannot trust it
for data then you most certainly cannot trust it for program storage.

I have one product in customers hands that depends on FLASH data
storage, and another on the way very soon. FLASH data is updated often
in both cases. If there are issues with doing this I would be very
interested in knowing what they are. I have not had a bit of trouble.
Pun intended, sorry...

BTW, the 54XX parts have built in tests for FLASH under marginal
read conditions controlled by the FCTL4.MRG0 and FCTL4.MRG1 register
bits. Has anyone ever tried this? Any failures?

Thanks -
Dave

--- In m..., "Dan Muzzey" wrote:
>
> Dave
>
> I'm not sure why you believe the requirements are outside the range.
The requirements are to vague to come to that conclusion. We know
that 500 bytes a day are needed. We know that the device has a life
expectancy of 10 years. We do not know how many days of data is
needed. If the entire life of the product is needed to be stored then
it won't work. If you need 30 days worth then its doable.
>
> However, some people (myself included) have had trouble with the
MSP430 internal flash. Others haven't had any problems. I would not
recommend using it for data storage.
>
> ________________________________
>
> From: m... [mailto:m...] On
Behalf Of desertrc_tucson
> Sent: Wednesday, November 12, 2008 9:54 AM
> To: m...
> Subject: [msp430] Re: MSP430 flash memory
>
> Your requirements are outside the address range, let alone FLASH
> range, of the MSP430 family. You're wanting to write almost 2M-bytes
> so whatever you use will have to be external. I would suggest a SD
> FLASH memory card. See TI application note slaa281b for details on how
> to do this. There is lots of example code out there on the Internet
> for talking to the memory card.
>
> Regards -
> Dave
>
> --- In m... ,
Technical Kripa wrote:
> >
> > Should the flash memory in MSP430 be used only for downloading of
> data or is it advisable to use flash memory for data logging
> considering 100000 times writing capability of flash.
> > In my current project I require to keep log of event at MSP ports. I
> would have to write say approx 500bytes a day and the application is
> supposed to work for around 10 years.
> > Or should I use EEPROM or something else that one of you can suggest!
> >
> >
> > Cricket on your mind? Visit the ultimate cricket website.
> Enter http://beta.cricket.yahoo.com
> >
> >
> >
>
>
>
>
>


Some F2xx devices have marginal Flash read modes too. Yes, there is a
bug, but I found a work-around and was able to test the Flash. Works
fine for me.

F5xx devices have the same marginal Flash read modes. I think the bug
is fixed but I did not try it.

--- In m..., "Dan Muzzey" wrote:
>
> Quick answer on the marginal flash....last I check there was an
errata on it. Seems ti had a reason to put it in then managed to
screw it up putting it in. don't have the details at hand. Search
the errata.
> -----Original Message-----
> From: m... on behalf of desertrc_tucson
> Sent: Wed 11/12/2008 3:41 PM
> To: m...
> Subject: [msp430] Re: MSP430 flash memory
>
> Yes, I agree there's not enough info to determine memory size.
>
> What kind of problems have you had with FLASH? If you cannot trust it
> for data then you most certainly cannot trust it for program storage.
>
> I have one product in customers hands that depends on FLASH data
> storage, and another on the way very soon. FLASH data is updated often
> in both cases. If there are issues with doing this I would be very
> interested in knowing what they are. I have not had a bit of trouble.
> Pun intended, sorry...
>
> BTW, the 54XX parts have built in tests for FLASH under marginal
> read conditions controlled by the FCTL4.MRG0 and FCTL4.MRG1 register
> bits. Has anyone ever tried this? Any failures?
>
> Thanks -
> Dave
>
> --- In m..., "Dan Muzzey" wrote:
> >
> > Dave
> >
> > I'm not sure why you believe the requirements are outside the range.
> The requirements are to vague to come to that conclusion. We know
> that 500 bytes a day are needed. We know that the device has a life
> expectancy of 10 years. We do not know how many days of data is
> needed. If the entire life of the product is needed to be stored then
> it won't work. If you need 30 days worth then its doable.
> >
> > However, some people (myself included) have had trouble with the
> MSP430 internal flash. Others haven't had any problems. I would not
> recommend using it for data storage.
> >
> > ________________________________
> >
> > From: m... [mailto:m...] On
> Behalf Of desertrc_tucson
> > Sent: Wednesday, November 12, 2008 9:54 AM
> > To: m...
> > Subject: [msp430] Re: MSP430 flash memory
> >
> > Your requirements are outside the address range, let alone FLASH
> > range, of the MSP430 family. You're wanting to write almost 2M-bytes
> > so whatever you use will have to be external. I would suggest a SD
> > FLASH memory card. See TI application note slaa281b for details on how
> > to do this. There is lots of example code out there on the Internet
> > for talking to the memory card.
> >
> > Regards -
> > Dave
> >
> > --- In m... ,
> Technical Kripa wrote:
> > >
> > > Should the flash memory in MSP430 be used only for downloading of
> > data or is it advisable to use flash memory for data logging
> > considering 100000 times writing capability of flash.
> > > In my current project I require to keep log of event at MSP ports. I
> > would have to write say approx 500bytes a day and the application is
> > supposed to work for around 10 years.
> > > Or should I use EEPROM or something else that one of you can
suggest!
> > >
> > >
> > > Cricket on your mind? Visit the ultimate cricket website.
> > Enter http://beta.cricket.yahoo.com
> > >
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>
>
>
>

Thanks to all of you who replied...

I would explain the application which is quite basic....

I have 8 fire sensors connected to 8 ADC ports of MSP430F1x.

Set of output voltages of these sensors is as follows:
case 1: Fault condition (if sensor gets disconnected): Output of sensor/input to ADC port = 0V-0.2V
case 2: Fault condition (if sensor terminals get shorted): Output of sensor/input to ADC port = 3.0V-3.2V
case 3:Normal voltage output of sensor (no fire): Output of sensor/input to ADC port = 2V-2.2V
case 4: Voltage output of sensor in case fire is detected/input to ADC port = 2.5-2.7V

I have to make a digital port high (that drives a relay) in case of case 4 above i.e. when fire is detected by any of the eight sensor. Addittionaly I have to make a log of this event with time/date stamp. Last 30 days log would be required. The data logging has to be FIFO

I also require to datalog fault conditions (case 1 & 2) with date/time stamp. Case 3 requires no datalogging.

Probability of fault/fire condition is obviously very low (0-1000 times in 30 days). But I plan to keep datalogging for upto last 5000 events if possible. Life of product is 10-15 years.

The flash has to store the program that consists of
1. The above logic
2. ADC program for 8 sensors
3. LCD display for status and time date display
4. small manipulations here and there

Now, let me know whether I should use flash memory or not. I can use MSP430F149 with 60KB flash.
If anyone can calculate and let me know how much flash space only datalogging of 5000 logs alone would take, I would appreciate.

Regards,
Sanmeet

________________________________
From: old_cow_yellow
To: m...
Sent: Thursday, 13 November, 2008 9:42:02 AM
Subject: [msp430] Re: MSP430 flash memory
Some F2xx devices have marginal Flash read modes too. Yes, there is a
bug, but I found a work-around and was able to test the Flash. Works
fine for me.

F5xx devices have the same marginal Flash read modes. I think the bug
is fixed but I did not try it.

--- In msp430@yahoogroups. com, "Dan Muzzey" wrote:
>
> Quick answer on the marginal flash....last I check there was an
errata on it. Seems ti had a reason to put it in then managed to
screw it up putting it in. don't have the details at hand. Search
the errata.
> -----Original Message-----
> From: msp430@yahoogroups. com on behalf of desertrc_tucson
> Sent: Wed 11/12/2008 3:41 PM
> To: msp430@yahoogroups. com
> Subject: [msp430] Re: MSP430 flash memory
>
> Yes, I agree there's not enough info to determine memory size.
>
> What kind of problems have you had with FLASH? If you cannot trust it
> for data then you most certainly cannot trust it for program storage.
>
> I have one product in customers hands that depends on FLASH data
> storage, and another on the way very soon. FLASH data is updated often
> in both cases. If there are issues with doing this I would be very
> interested in knowing what they are. I have not had a bit of trouble.
> Pun intended, sorry....
>
> BTW, the 54XX parts have built in tests for FLASH under marginal
> read conditions controlled by the FCTL4.MRG0 and FCTL4.MRG1 register
> bits. Has anyone ever tried this? Any failures?
>
> Thanks -
> Dave
>
> --- In msp430@yahoogroups. com, "Dan Muzzey" wrote:
> >
> > Dave
> >
> > I'm not sure why you believe the requirements are outside the range.
> The requirements are to vague to come to that conclusion. We know
> that 500 bytes a day are needed. We know that the device has a life
> expectancy of 10 years. We do not know how many days of data is
> needed. If the entire life of the product is needed to be stored then
> it won't work. If you need 30 days worth then its doable.
> >
> > However, some people (myself included) have had trouble with the
> MSP430 internal flash. Others haven't had any problems. I would not
> recommend using it for data storage.
> >
> > ____________ _________ _________ __
> >
> > From: msp430@yahoogroups. com [mailto:msp430@yahoogroups. com] On
> Behalf Of desertrc_tucson
> > Sent: Wednesday, November 12, 2008 9:54 AM
> > To: msp430@yahoogroups. com
> > Subject: [msp430] Re: MSP430 flash memory
> >
> > Your requirements are outside the address range, let alone FLASH
> > range, of the MSP430 family. You're wanting to write almost 2M-bytes
> > so whatever you use will have to be external. I would suggest a SD
> > FLASH memory card. See TI application note slaa281b for details on how
> > to do this. There is lots of example code out there on the Internet
> > for talking to the memory card.
> >
> > Regards -
> > Dave
> >
> > --- In msp430@yahoogroups. com ,
> Technical Kripa wrote:
> > >
> > > Should the flash memory in MSP430 be used only for downloading of
> > data or is it advisable to use flash memory for data logging
> > considering 100000 times writing capability of flash.
> > > In my current project I require to keep log of event at MSP ports. I
> > would have to write say approx 500Â bytes a day and the application is
> > supposed to work for around 10 years.
> > > Or should I use EEPROM or something else that one of you can
suggest!
> > >
> > >
> > > Cricket on your mind? Visit the ultimate cricket website.
> > Enter http://beta. cricket.yahoo. com
> > >
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>
>
>
>


Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/


Calculating the log of 5000 events is simple. 5000 X size of log event.

I will not use the internal flash to log data or store any parameters. I've lost data while doing this and have had to add code to help deal with this. Others have not had this problem yet at the same time no one can look at the circuit and tell me for a fact what is wrong. Brown out circuits are in place, extra by pass capacitance was added, simply put, other chips haven't given us the same problems as the 449 has. I think the 149 is the same chip minus the LCD.

As for the marginal write feature....why did TI have to put this in place in the first place? If the flash write worked correctly there should be no need for the chip to verify that it actually did what it was suppose to do and do it correctly.

We have never had problems with chips that were programmed externally with a programming tool. Its just the internal flash write that has given us problems.

-----Original Message-----
From: m... on behalf of Technical Kripa
Sent: Thu 11/13/2008 12:59 AM
To: m...
Subject: Re: [msp430] Re: MSP430 flash memory

Thanksto all of you who replied...

I would explain the application which is quite basic....

I have 8 fire sensors connected to 8 ADC ports of MSP430F1x.

Set of output voltages of these sensors is as follows:
case 1: Fault condition (if sensor gets disconnected): Output of sensor/input to ADC port = 0V-0.2V
case 2: Fault condition (if sensor terminals get shorted): Output of sensor/input to ADC port = 3.0V-3.2V
case 3:Normal voltage output of sensor (no fire): Output of sensor/input to ADC port = 2V-2.2V
case 4: Voltage output of sensor in case fire is detected/input to ADC port = 2.5-2.7V

I have to make a digitalport high (that drives a relay) in case of case 4 above i.e. when fire is detected by any of the eight sensor. Addittionaly I have to make a log of this event with time/date stamp. Last 30 days log would be required. The data logging has to be FIFO

I also require to datalog fault conditions (case 1 & 2) with date/time stamp. Case 3 requires no datalogging.

Probability of fault/fire condition is obviously very low (0-1000 times in 30 days). But I plan to keep datalogging for upto last 5000 events if possible. Life of product is 10-15 years.

The flash has to store the program that consists of
1. The above logic
2. ADC program for 8 sensors
3. LCD display for status and time date display
4. small manipulations here and there

Now, let me know whether I should use flash memory or not. I can use MSP430F149 with 60KB flash.
If anyone can calculate and let me know how much flash space only datalogging of 5000 logsalone would take, I would appreciate.

Regards,
Sanmeet

________________________________
From: old_cow_yellow
To: m...
Sent: Thursday, 13 November, 2008 9:42:02 AM
Subject: [msp430] Re: MSP430 flash memory
Some F2xx devices have marginal Flash read modes too. Yes, there is a
bug, but I found a work-around and was able to test the Flash. Works
fine for me.

F5xx devices have the same marginal Flash read modes. I think the bug
is fixed but I did not try it.

--- In msp430@yahoogroups. com, "Dan Muzzey" wrote:
>
> Quick answer on the marginal flash....last I check there was an
errata on it. Seems ti had a reason to put it in then managed to
screw it up putting it in. don't have the details at hand. Search
the errata.
> -----Original Message-----
> From: msp430@yahoogroups. com on behalf of desertrc_tucson
> Sent: Wed 11/12/2008 3:41 PM
> To: msp430@yahoogroups. com
> Subject: [msp430] Re: MSP430 flash memory
>
> Yes, I agree there's not enough info to determine memory size.
>
> What kind of problems have you had with FLASH? If you cannot trust it
> for data then you most certainly cannot trust it for program storage.
>
> I have one product in customers hands that depends on FLASH data
> storage, and another on the way very soon. FLASH data is updated often
> in both cases. If there are issues with doing this I would be very
> interested in knowing what they are. I have not had a bit of trouble.
> Pun intended, sorry....
>
> BTW, the 54XX parts have built in tests for FLASH under marginal
> read conditions controlled by the FCTL4.MRG0 and FCTL4.MRG1 register
> bits. Has anyone ever tried this? Any failures?
>
> Thanks -
> Dave
>
> --- In msp430@yahoogroups. com, "Dan Muzzey" wrote:
> >
> > Dave
> >
> > I'm not sure why you believe the requirements are outside the range.
> The requirements are to vague to come to that conclusion. We know
> that 500 bytes a day are needed. We know that the device has a life
> expectancy of 10 years. We do not know how many days of data is
> needed. If the entire life of the product is needed to be stored then
> it won't work. If you need 30 days worth then its doable.
> >
> > However, some people (myself included) have had trouble with the
> MSP430 internal flash. Others haven't had any problems. I would not
> recommend using it for data storage.
> >
> > ____________ _________ _________ __
> >
> > From: msp430@yahoogroups. com [mailto:msp430@yahoogroups. com] On
> Behalf Of desertrc_tucson
> > Sent: Wednesday, November 12, 2008 9:54 AM
> > To: msp430@yahoogroups. com
> > Subject: [msp430] Re: MSP430 flash memory
> >
> > Your requirements are outside the address range, let alone FLASH
> > range, of the MSP430 family. You're wanting to write almost 2M-bytes
> > so whatever you use will have to be external. I would suggest a SD
> > FLASH memory card. See TI application note slaa281b for details on how
> > to do this. There is lots of example code out there on the Internet
> > for talking to the memory card.
> >
> > Regards -
> > Dave
> >
> > --- In msp430@yahoogroups. com ,
> Technical Kripa wrote:
> > >
> > > Should the flash memory in MSP430 be used only for downloading of
> > data or is it advisable to use flash memory for data logging
> > considering 100000 times writing capability of flash.
> > > In my current project I require to keep log of event at MSP ports. I
> > would have to write say approx 500bytes a day and the application is
> > supposed to work for around 10 years.
> > > Or should I use EEPROM or something else that one of you can
suggest!
> > >
> > >
> > > Cricket on your mind? Visit the ultimate cricket website.
> > Enter http://beta. cricket.yahoo. com
> > >
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>
>
>
>


Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/