scorrpeio
Full Member level 5
I have interfaced the nvram with MSP430 through I2C. Compiler used is CCS4.0
I have few variables in float, int and long type which I need to save to the nvram periodically and retrieve back after every power on.
Problem No. 1.
I tried to save the data to memory using unsigned char*. But, my compiler doesnt allow me to assign char pointer to float variable even typecasting.
Problem No. 2
I understand that the data copied to the nvram is in the form of unsigned char so I am worried, if I copy float type variable in the form of bytes to memory, I wont be able to retrive the original value of the variable from the memory.
Please let me know, if I have 10-20 variables in float, long and int format, how can I save them in the nvram such that when I retrieve them, I can restore their values back.
I have few variables in float, int and long type which I need to save to the nvram periodically and retrieve back after every power on.
Problem No. 1.
I tried to save the data to memory using unsigned char*. But, my compiler doesnt allow me to assign char pointer to float variable even typecasting.
Problem No. 2
I understand that the data copied to the nvram is in the form of unsigned char so I am worried, if I copy float type variable in the form of bytes to memory, I wont be able to retrive the original value of the variable from the memory.
Please let me know, if I have 10-20 variables in float, long and int format, how can I save them in the nvram such that when I retrieve them, I can restore their values back.