Go Down

Topic: SPI EEPROM & GPS logging (Read 1 time) previous topic - next topic


Feb 23, 2010, 08:02 am Last Edit: Feb 23, 2010, 08:03 am by shezi Reason: 1
I have got the exact same chip for an EEPROM as stated on the website tutorial for SPIEEPROM. I also got the hardware interfacing and everything to work using the code provided.


Now I would appreciate some help to understand how to store a "long int" number instead of the "char" as shown in the code. As from the website it seems that you can only write 128 bytes at a time and since in that example they used char (which is 1 byte) they just SPI transfered in the following code:

for (int I=0;I<128;I++)
   spi_transfer(buffer); //write data byte

How would this change for a long int (which is 4 bytes, 32 bits). How would the addressing be affected?

PS: I want to store "latitude, longitude" that comes out of the TinyGPS library functions.

Any sample code or nudge in the right direction to explain the EEPROM addressing and storage will be appreciated.



The art of getting good answers lies in asking good questions.


does it also work for SPI interfaced EEPROM?


The techniques for addressing the memory where the long/int/float/double/etc. is stored byte-by-byte will.
The art of getting good answers lies in asking good questions.


Feb 25, 2010, 11:08 pm Last Edit: Feb 25, 2010, 11:11 pm by Grumpy_Mike Reason: 1
does it also work for SPI interfaced EEPROM?

No it is for internal memory. The same techinque can be used for external memory but you have to write the bits that actually access the memory.

Look at this for external memory.
more specifically:-

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131