Jump to content
43oh

External EEPROM


Recommended Posts

I'm trying to store a few configuration/calibration settings into a long-term memory - they would only be accessed once (unless I rerun the configuration routines) during the setup(){} function.  So, at least in my eyes it doesn't make sense to deal with flash emulation over an EEPROM, since time isn't a huge factor.

 

This is, for me at least, treading new ground and I'm not entirely sure what to look for in an EEPROM circuit - and they're a lot of options.  Is there an I.C. that other people have used that is relatively inexpensive and supports I2C or SPI?

Link to post
Share on other sites

is there a reason why u can't use the build in infomem segments? they are handy for non-volatile configuration settings. actually ti use them to store factory calibration (clock) values.

 

Hm.  I haven't thought of using those.  For the most part I'm looking at how would I do this with an Atmel/Arduino? And then trying to closely mimic that approach with the Launchpad and Energia.

 

If I did write to the infomem, overwriting the factory calibration settings, would that mess with the mcu's internals?

Link to post
Share on other sites

Don't use Infomem_A, use the B, C and D segments.  Infomem_A has the calibration settings (for the clock's 16MHz, 12MHz, 8MHz, 1MHz, etc. calibrated DCO and BCSCTL1 values, and the ADC10 peripheral reads them too).  Each segment is 64 bytes FYI.  Infomem_B, C and D are available for your own use (so you have 192 bytes available).

 

It's not quite as easy to use as the Arduino/AVR with its built-in EEPROM, as it's a Flash segment that has to be erased & rewritten, but it certainly can be done.  So if you're using Infomem_B, and want to update a value, you will need to copy all 64 bytes of it to RAM temporarily (and make your change), issue the Flash Erase sequence for that segment, then put it in programming mode and rewrite the Infomem_B segment with your temporary-in-RAM buffer.

 

Search around for a flash writing library, I know someone's written one.

Link to post
Share on other sites

there are 4 segments of 64 bytes. (assuming u are looking at value line), ti uses segment A for calibration data and u should avoid it.

 

if u need more non-volatile memory, u can also use program space. the only difference is instead of writing at 64 byte blocks, u need to write at 256 byte blocks.

 
from ti 's datasheet
 
 
 
Flash Memory
The flash memory can be programmed via the Spy-Bi-Wire/JTAG port or in-system by the CPU. The CPU can
perform single-byte and single-word writes to the flash memory. Features of the flash memory include:
Link to post
Share on other sites

I had a thought (though I haven't had a few moments to actually test it out): because there are only 3 usable segments, does that mean I can only store 3 pieces of data?

 

Secondly, I saw this earlier, but, it looks like TI has an example of using an external EEPROM and the 430 here:

http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa208a&docCategoryId=1&familyId=342

Link to post
Share on other sites

Sorta- what it means is that if you want to change some data in a segment but leave the rest of it intact, you will have to temporarily allocate some RAM and save a copy of the data before you reflash the segment since everything inside the segment is lost. Then restore the contents once the flash segment is erased and ready to reprogram.

 

Flash is always "written" by first erasing it, then writing, and it's usually erased in big blocks (known as segments).

 

Sent from my C3PO via Tapatalk

Link to post
Share on other sites

You can use the flash memory as EEPROM. All the tips and tricks are explained in the example of the library.

I meant using only the Infomem segments.  Although, it does look like its possible by writing and reading a given length for data...

 

Just as an aside, its actually cheaper to use an MSP430 mcu ($2) and an external EEPROM ($0.50) than to use an Atmel mega 328 ($3.50).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...