I want to store some float data in the FRAM register of my TI MSP430 microcontroller and have some prolems.
I don't know how I can do this.
With normal integer variables it is no problem.
Normal integer variables:
void main()
{
uint32_t value = 25;
uint32_t framPtr = 0xD000;
FRAMC_write_uint32_t(value, (uint32_t*)framPtr);
}
void FRAMC_write_uint32_t(uint32_t value,
uint32_t *framPtr)
{
*framPtr = value;
}
But with float values it doesn't work. I tried to change the value inside the function to float, but no result.
This is my float data:
float value = 1.25;
uint32_t framPtr = 0xD000;
With this function it doesn't work:
void FRAM_write_float(float value,
uint32_t *framPtr)
{
*framPtr++ = (float)value;
}
It saved the data 1.40129846e-45 (DEN) (HEX: 0x00000001) in my memory bank.
I hope somebody can help me with my problem. Thanks!