psp1004umd 0 Posted August 8, 2018 Share Posted August 8, 2018 Hello everyone , i was wondering if we can store some values inside an msp430g2231(or msp430g2231) i know how to do that on an arduino : EEPROM But i can't find anything on an MSP using energia :/ Quote Link to post Share on other sites
Rickta59 589 Posted August 8, 2018 Share Posted August 8, 2018 The msp430g2231 only has a total of 2048 bytes of flash. If you use Energia, you are going to suck up half that flash just getting it to compile an empty sketch. The EEPROM on an atmega328p has 1024 bytes of eeprom. What do you want to store in EEPROM? Quote Link to post Share on other sites
psp1004umd 0 Posted August 9, 2018 Author Share Posted August 9, 2018 Hello , i would like to store only 3 values (from 0 to 254) Quote Link to post Share on other sites
str 0 Posted November 9, 2018 Share Posted November 9, 2018 Hi psp1004umd, this MCU has the following "informational" Flash Memory: Size 256 Byte in 4 Segments á 64 Bytes, Flash 010FFh to 01000h There is a library colled "MspFlash.h" which you can include in your script. With this, you can use the segments B, C and D. A is protected so far. You should be aware of the contraints when writing Flashmemory, you always have to erase the hole segment first: Example: #define Flash1 SEGMENT_B // Alarmdata (AnzAlarme * 3 bytes, max. 21 Alarme moeglich/possible) #define Flash2 SEGMENT_C // Configdata ( 1 byte "Bundesland" (region)), 7 bytes last Time/Date #define Flash3 SEGMENT_D // 16 Feiertagsdaten nach Bundesland (German holidays per region), 3 Byte each. // void WFlash_Alarm() { Flash.erase(Flash1); for (byte i = 0; i < AnzAlarme; i++) { AlarmType::AType *M = &Alarme; Flash.write(Flash1 + (i * 3) , (unsigned char*) M, 3); } } If this is clear, just write a reply. regards, Stephan Quote Link to post Share on other sites
jcR 6 Posted December 16, 2018 Share Posted December 16, 2018 sehr gute Antwort😊!!!! 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.