on3pk 4 Posted March 26, 2013 Share Posted March 26, 2013 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? Quote Link to post Share on other sites
simpleavr 399 Posted March 26, 2013 Share Posted March 26, 2013 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. Quote Link to post Share on other sites
on3pk 4 Posted March 26, 2013 Author Share Posted March 26, 2013 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? Quote Link to post Share on other sites
spirilis 1,265 Posted March 26, 2013 Share Posted March 26, 2013 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. Quote Link to post Share on other sites
simpleavr 399 Posted March 26, 2013 Share Posted March 26, 2013 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 http://www.ti.com/lit/ds/symlink/msp430g2553.pdf 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: Quote Link to post Share on other sites
Rei Vilo 695 Posted March 26, 2013 Share Posted March 26, 2013 There's a library for Energia Quote Link to post Share on other sites
on3pk 4 Posted March 26, 2013 Author Share Posted March 26, 2013 There's a library for Energia Quote Link to post Share on other sites
on3pk 4 Posted March 26, 2013 Author Share Posted March 26, 2013 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 Quote Link to post Share on other sites
spirilis 1,265 Posted March 26, 2013 Share Posted March 26, 2013 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 Quote Link to post Share on other sites
Rei Vilo 695 Posted March 26, 2013 Share Posted March 26, 2013 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? You can use the flash memory as EEPROM. All the tips and tricks are explained in the example of the library. Quote Link to post Share on other sites
on3pk 4 Posted March 27, 2013 Author Share Posted March 27, 2013 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). Quote Link to post Share on other sites
roadrunner84 466 Posted March 28, 2013 Share Posted March 28, 2013 prise vs. feature comparison is always tricky. If the atmel contains just that peripheral you need, it might be worth the extra buck. I think most MSP430Gs line up with the ATtiny series, comparing the ATmega would go to the MSP430F5xxx segment in most cases. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.