StrangerM

How to save variables in FRAM ( MSP430FR4133 ).

2 posts in this topic

"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);
 }

chicken likes this

Share this post


Link to post
Share on other sites

In a result I have made from Launchpad MSP430FR4133 a tachometer, plus ? counter of machine hours and plus ? voltmeter for my boat.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now