Jump to content

Store values inside µc

Recommended Posts

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 :/


Share this post

Link to post
Share on other sites

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?

Share this post

Link to post
Share on other sites

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:


#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() {
  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.




Share this post

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.

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...