writing a long int variable to eeprom

Thread Starter


Joined Aug 14, 2007
I am trying to write a float (int32) variable in whole number format (No decimals) into a memory location. I am using a PIC 16F877A. My number keeps getting truncated to the remainder from 255. I understand this will only allow me to write an 8 bit integer to memory, but any suggestions on how to manipulate the data to get around this problem. I am new to this world, so please go easy on me. I don't understand assembler code, I am working from a C compiler, so any remedial help will be appreciated.



Joined Oct 14, 2005
Save the least significant 8 bits first, shift to the right 8 times, and do this four times. To read just reverse the above process.