CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Using the program memory as a large EEPROM for datalogging?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

Using the program memory as a large EEPROM for datalogging?
PostPosted: Sun Jul 25, 2004 7:10 am     Reply with quote

I have a project which required around 600bytes of EEPROM storage. I was about to use an SPI off board EEPROM when I thought about the new(ish) facility of writing to the program memory of the PIC at run-time.
Can you use the program memory as a large EEPROM for storing data? The application isn’t time critical and just involves storing live values and then uploading to a PC at a later date.

Any reasons not to use program memory for this job?

Will
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun Jul 25, 2004 9:05 am     Reply with quote

Way fewer write cycles comes to mind.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Sun Jul 25, 2004 5:11 pm     Reply with quote

In a project I needed 2k of storage space so I used the program flash and it worked fine. Just keep in mind that (assuming you are using PIC16s) the maximum write cycles for the flash memory is 10000, as opposed the 100,000 write cycles of the EEPROM. And to be absolutely safe you shouldn't try to use more than 10% of this maximum value, which brings it down to 1000 cycles only. if this is not enough take a look at PIC18 devices which feature bigger EEPROMs.
Ttelmah
Guest







PostPosted: Mon Jul 26, 2004 2:37 am     Reply with quote

Haplo wrote:
In a project I needed 2k of storage space so I used the program flash and it worked fine. Just keep in mind that (assuming you are using PIC16s) the maximum write cycles for the flash memory is 10000, as opposed the 100,000 write cycles of the EEPROM. And to be absolutely safe you shouldn't try to use more than 10% of this maximum value, which brings it down to 1000 cycles only. if this is not enough take a look at PIC18 devices which feature bigger EEPROMs.

For the 16F87x devices, the manufacturer does not quote a 'maximum' write cycle. They only quote a 'min', and this is 1000 cycles.
The 10K figure, is for the 18F chps. Beware also, that this will degrade if the chip is run in a warm enviroment. Really anything beyond 500 cycles, is being 'optimistic', for making safe lifetime calculations, if the enviroment is not controlled.
Personally, one of the Ramtron FRAM memories is a much 'safer' solution, and data can be written to these faster than the internal memory.
The internal memory, is ideal for storing rarely changed parameter (linearisation look-up tables, or servo co-efficients for example, which may only be changed when motors are changed), but are not really suitable for storing 'data', since even if written only once a day, the likely life of the chip, drops to only perhaps a couple of years. I too, have used the memory successfully, on a unit, for a couple of parameters, which are only written when the system is powered down. Since the unit normally runs 24/7, the number of write cyces involved is so small, that othr failures are likely to occur before this is reached. Beware though, that despite the data sheet listing the useable write voltage as 'Vmin to 5.5v', I have in the past found that the internal flash memory, is more critical of it's supply range, than the data sheet suggests. On the 18F chips, there is a partial admission of this, where the voltage for externally timed write/erase cycles, is specified as 4.5v to 5.5v. I have found that the internal erase, becomes slower, and may also fail, if the chip is running on low voltage supplies...

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group