Jump to content
43oh

How to save variables in FRAM ( MSP430FR4133 ).


Recommended Posts

"uint8_t lo __attribute__ ((section (".text"))) ; " does not work. http://forum.43oh.com/topic/5474-energia-and-wolverine-tips/

But.... it runs.

Simple example

#include <msp430.h>
 #include "LCD_Launchpad.h"
 #define M P2_6
  #define M1 P1_2
 uint8_t L ;
  LCD_LAUNCHPAD myLCD ; 
uint8_t lo __attribute__ ((section (".text"))) ;
void setup()
{
  myLCD.init();
  pinMode(M, INPUT_PULLUP);
  pinMode(M1, INPUT_PULLUP);
 // Serial.begin(9600) ;
  myLCD.clear(); 
}

void loop()
{
 if (digitalRead(M)==0 ){
  SYSCFG0 &= ~PFWP;                   // Program FRAM write enable
        lo=5;                       // Record in FRAM
        SYSCFG0 |= PFWP;                    // Program FRAM write protected (not writable)
    }
    if (digitalRead(M1)==0 ){
      SYSCFG0 &= ~PFWP;                   // Program FRAM write enable
       lo=3;                       // Record in FRAM
        SYSCFG0 |= PFWP;                    // Program FRAM write protected (not writable)
    }
    myLCD.print(lo);
    myLCD.print("Lo");
    delay(1000);
 //   Serial.println(lo);
 }

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