View previous topic :: View next topic |
Author |
Message |
maria100
Joined: 01 Feb 2012 Posts: 63
|
Reading the whole eeprom |
Posted: Wed Mar 21, 2012 7:39 am |
|
|
Probably for some is kind of silly question , but i wanna know how is possible to read the entirely EEPROM ( 24lc1025)...i have managed to read it but only on addresses..is there a way to make a full "dump" of it ? |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Wed Mar 21, 2012 10:45 am |
|
|
put the function you use to read a specific address inside a loop.
change the address by a variable.
increase the variable (++) once per loop.
Voila! _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Wed Mar 21, 2012 11:33 am |
|
|
does not matter -read by BYTE or read by PAGE
what DOES matter is
where are you going to PUT the data you dump??
128k BYTES is a lot of data my friend
are you just trying to read and scan for a sequence ??
the context of your query means a lot towards how you go about it
and the reason WHY is top of the list |
|
|
maria100
Joined: 01 Feb 2012 Posts: 63
|
|
Posted: Wed Mar 21, 2012 11:44 am |
|
|
i want it to print it on serial port ! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Wed Mar 21, 2012 12:39 pm |
|
|
So, just read it and send it. Remember though that even 'raw', at 9600bps, it'll take a couple of minutes to send, while in hex, probably about 6 minutes...
Best Wishes |
|
|
maria100
Joined: 01 Feb 2012 Posts: 63
|
|
Posted: Wed Mar 21, 2012 1:00 pm |
|
|
Well to read it i must read every 8 bit address? |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Wed Mar 21, 2012 1:32 pm |
|
|
Read every byte??
It depends - check the data sheet -
If you can configure enough temporary storage user ram in your pic -
then you can make an array to hold say 128 bytes of read back at a time,
then using the sequential read function for the EEprom you get a
a page at a time into RAM and then via the PIC uart -
use it as a buffer for that operation. |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Fri Mar 23, 2012 9:52 am |
|
|
my previous post was assuming the data was being dumped to serial.
and yes, it will take a while to print it all.
My suggestion was not the most efficient, however it was the easiest for her, given that she had a single byte function already working. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
|
Posted: Fri Mar 23, 2012 11:10 am |
|
|
You only need to specify the first address where you want to start reading. After that the internal address pointer auto-increments and you just need to make another read request.
The same is true for writing consecutive data to the 24LC and 25LC parts.
Be careful when you get to the end because the address pointer will just loop around and start at the beginning again unless you stop it.
With these parts I usually use the first few bytes to store housekeeping information such as the beginning of the (usually) logging data and the next available address. I then use this to figure out how many bytes to read and dump to a file via UART and a terminal program that can write to a log file. |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1354
|
|
Posted: Fri Mar 23, 2012 12:06 pm |
|
|
jgschmidt wrote: |
The same is true for writing consecutive data to the 24LC and 25LC parts. |
Not completely. With "writing" you have to often times respect page boundaries too, or the the internal incrementer will loop back to the beginning of the current page rather than continue on to the next page. This seems to be true for the 24LC256, 24LC512, 25LC256, 25LC512, and their AA counterparts. With reading it will go all the way to the end of memory, but writing will only to go the end of the current page. |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
|
Posted: Fri Mar 23, 2012 12:44 pm |
|
|
Ah, yes. Thanks for that, Jeremiah.
I usually write in small amounts and then dump large amounts. Checking back to my code I found I was writing integer fractions of a page at a time and therefore only had to set the write address once. |
|
|
|