CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Reading the whole eeprom

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
maria100



Joined: 01 Feb 2012
Posts: 63

View user's profile Send private message

Reading the whole eeprom
PostPosted: Wed Mar 21, 2012 7:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 10:45 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Wed Mar 21, 2012 11:33 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 11:44 am     Reply with quote

i want it to print it on serial port !
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 12:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 1:00 pm     Reply with quote

Well to read it i must read every 8 bit address?
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Mar 21, 2012 1:32 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 23, 2012 9:52 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 23, 2012 11:10 am     Reply with quote

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: 1346

View user's profile Send private message

PostPosted: Fri Mar 23, 2012 12:06 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 23, 2012 12:44 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group