Jump to content
43oh

str

Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by str

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

     

×
×
  • Create New...