Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

floating point value into eeprom??????

Status
Not open for further replies.

veer

Newbie level 4
Joined
Apr 28, 2003
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
42
hi,

i am using ADuC812 which has 2k eeprom, single page containing 4bytes and each byte can be assigned independently .The problem is to write a floating point value into eeprom.i am using keil complier.shld i go for ieee754 format representation or is there any other wayout.

kindly reply,
veer.
 

Hi,

you could use an union like this

union
{
float value;
unsigned char bytevalue[4];
}variable;

When you want to write your float value to eeprom use a loop like this

for(i=0; i < 4; i++)
eeprom_write(variable.bytevalue);

hope this helps
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top