Page 1 of 1

EEPROM (how works question)

Posted: Mon Jun 18, 2012 7:12 am
by brandonb
question on how eeprom works with a **16f1938** ... when writing to eeprom i simply write to addresses 0-255 is that right? but i can only write 8 bit numbers to a location? if thats true why does it ask for a "uint" variable? .... what im trying to do is i have { 18 =8 bit items..16 = 16bit items and 16 = 32bit items... to clearify this would take up 114 locations of eeprom is that correct?

Re: EEPROM (how works question)

Posted: Mon Jun 18, 2012 8:55 pm
by kersing
brandonb wrote:question on how eeprom works with a **16f1938** ... when writing to eeprom i simply write to addresses 0-255 is that right?
Correct.
brandonb wrote:but i can only write 8 bit numbers to a location? if thats true why does it ask for a "uint" variable? ....
Only 8 bit wide for 8 bit PIC devices like the one you are using. The uint is because the macro tries to be compatible with devices where the eeprom is 16 bit wide.
brandonb wrote: what im trying to do is i have { 18 =8 bit items..16 = 16bit items and 16 = 32bit items... to clearify this would take up 114 locations of eeprom is that correct?
Correct.
18 * 1 + 16 * 2 + 16 * 4 = 114 ;-)

Re: EEPROM (how works question)

Posted: Mon Jun 18, 2012 11:36 pm
by brandonb
kersing, thanks man!!... i did a calculator below to help convert 32bit to 4 of the 8 bit registers, also thanks david for showing the calcs http://www.matrixmultimedia.com/resourc ... hnique.pdf