EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Writing Float value on Flash Memory

Started by jeff...@gmail.com December 24, 2008
Hello Everyone,
First,Merry Christmas to everyone. Lets hope the next year things get better and wars over. =)
I know how to work with Flash w/r on MSP430, but, i want to know if there is a wise way to put float data on memory without the usage of blocks?

hugs

Beginning Microcontrollers with the MSP430

j...@gmail.com wrote:
>
> Hello Everyone,
> First,Merry Christmas to everyone.
>
Yup.
> Lets hope the next year things get better and wars over. =)
>
That is what LBJ said to. IMO, Obama is learning who really runs the
country now and the real reason why we are there now.

> I know how to work with Flash w/r on MSP430, but, i want to know if
> there is a wise way to put float data on memory without the usage of
> blocks?
>
> hugs
>
>
Is there a way to save a float value on the rom memory on the program execution?
The float variable have twice the width of a word, so i was thinking that it would be simple as breaking it in two pieces.
But i wonder if this is possible or not. =)

Hello Everyone,
>First,Merry Christmas to everyone. Lets hope the next year things get better and wars over. =)
>I know how to work with Flash w/r on MSP430, but, i want to know if there is a wise way to put float data on memory without the usage of blocks?
>
>hugs
>
>

Just use a union. Write the float through the 'float' member and then read
the individual bytes/words by the byte or word members.

Eg:

Union {
float my_float_var;
unsigned short my_words[2];
unsigned char my_bytes[4];
} float_mem;

This is just an example for illustration.

Best Regards,
Kris
-----Original Message-----
From: m... [mailto:m...] On Behalf Of
j...@gmail.com
Sent: Thursday, 25 December 2008 9:17 AM
To: m...
Subject: [msp430] Re: Writing Float value on Flash Memory

Is there a way to save a float value on the rom memory on the program
execution?
The float variable have twice the width of a word, so i was thinking that it
would be simple as breaking it in two pieces.
But i wonder if this is possible or not. =)

Hello Everyone,
>First,Merry Christmas to everyone. Lets hope the next year things get
better and wars over. =)
>I know how to work with Flash w/r on MSP430, but, i want to know if there
is a wise way to put float data on memory without the usage of blocks?
>
>hugs
>
>

Problem Solved.
Thanks =)

Hello Everyone,
>First,Merry Christmas to everyone. Lets hope the next year things get better and wars over. =)
>I know how to work with Flash w/r on MSP430, but, i want to know if there is a wise way to put float data on memory without the usage of blocks?
>
>hugs
>
>


The 2024 Embedded Online Conference