First timer to EEPROM

Denzel

Senior Member
I have a project im in the middle of where I am recording the analogue value of 24 linear pots.
I am measuring the shape of an object as it changes so I need to record the value of my 24 pots to an EEPROM every say 4-8 seconds. This means sending 24 values + a time value to an EEPROM.

Once the EEPROM is full or the recording is finished I intend to send all the data to a computer to graph. I have managed to do this in realtime i.e. take readings, transmit, then graph, but I need to have the unit detached from a computer hence the need for an EEPROM.

I am thinking about using the IC 24LC256 EEPROM as it is the larger of two available from Jaycar NZ. I have never used an EEPROM chip before and don't quite understand how the memory works.
I studied the student exemplar project 'datalogger.pdf' in the help files but I find the use of symbols unusually hard to follow. I understand that this chip has 32Kb of memory (256 / 8 = 32) so how many records would I be able to make?

Also can anyone point me in the direction of a circuit diagram or basic code; I have done a search on the forum and understand that the readI2C, writeI2C commands are used but im a little unsure about te addressing. The exemplar project talks about getting 'data' from 'address' on 'page' of the EEPROM?
 

Denzel

Senior Member
...

I have just come across the axe110 datalogger kit
http://www.rev-ed.co.uk/docs/axe110.pdf
which sounds perfect to ease me into EEPROM projects...

Is it suitable for what I want to do?
the memory expansion sounds fine but can I connect it to my 28x and essentially hand it the 24 values once at a time to record? and use the clock expansion to record a time for the values?

Thanks
 

westaust55

Moderator
Using 24LC256 EEPROMs

Have a read at the i2c tutorial:
http://www.rev-ed.co.uk/docs/axe110_i2c.pdf

What PIACXE chip do you have. It needs to be one with an "X" in the part name eg 18X, 28X1, to have inbuilt i2c comms capability.

Is your data as bytes or words (2 bytes).

i2c can only send bytes of data over link but one i2cwrite comamnd can send many bytes in one instruction.

If you have the data as alrger values (>255) that require words you need to send the two bytes of data that make up the word individually.

Each PICAXE data byte occupies one byte memory location in the EEPROM. the

As you ahve deduced, the EEPROM can hold 32768 bytes of data.
so the number of records sets you can store depends on whether your vlaues are less than 255 or greater than 255.

With 24 records and a time data value 9assume time is 2 bytes), you will have either 26 or 50 bytes of data for each record.

Another thing to keep in mind is that the 24LC256 pas a 64 page write boundary. If when sending multiple bytes in one i2cwrite (or hi2cwrite) command, you cross a page boundary, then you will overwrite data at the satrt of the page and not cros into the enxt page.

This suggests 2 or 1 data sets per 64 byte page with some lost space. There are 512 lots of 64 pages so you could (without trying to recover every byte) easily and quickly fit 512 or 1024 sets of readings into the 24LC256 EEPROM.

A lot to get to grips with there but hope that helps you understand.
 

westaust55

Moderator
I have just come across the axe110 datalogger kit
http://www.rev-ed.co.uk/docs/axe110.pdf
which sounds perfect to ease me into EEPROM projects...

Is it suitable for what I want to do?
the memory expansion sounds fine but can I connect it to my 28x and essentially hand it the 24 values once at a time to record? and use the clock expansion to record a time for the values?

Thanks

Ah, now you mention in post 2 that you have a 28X. It that straight 28X, 28X1, or 28X2?

No the datalogger is specifically for an 18X and only handles 4 inputs.

As per my other post, the i2c tutorial is in fact based upon the datalogger module and very helpful.


The 28 pin PICAXE chip would be better in an AXE022 proto board if not already mounted on another board. The AXE022 has a socket for an EEPROM such as the 24LC256.

I presume that you already have the circuit sorted for the 24 input signals and a time stamp.
 
Last edited:

Denzel

Senior Member
Thank you westaust55. Im starting to get the idea of how the memory works.
My values are less than 255 so i could fit 2 data sets per 64 byte page with about 14 bytes lost (depending on how big a time variable is) and like you say 1024 sets of readings which is fantastic.

I'll take a look a that datasheet.. I need to come to grips with how to read it back and get the right 24 values at a time
 

Denzel

Senior Member
I have got 3 multiplexers getting the 24 values from my pots in to my 28X(only) I haven't added a time chip/circuit yet as Intended to sort out the memory before adding a time value.

When I say is the AXE110 compatible with the 28X i mean can I still have the 18X onboard but instead of it reading four analogue values or however many it does can I link it serially to the 28X and give it the 24 values?
 

BeanieBots

Moderator
You could send the data from the 28X to the 18X and then put it in EEPROM but WHY?
It would be so much easier, cheaper and quicker to have the 28X simply put the data directly into the EEPROM.
 

MFB

Senior Member
complete logger

A data logger design that is often mentioned on the forum appeared in the August and September 2007 issues of the Nuts&Volts magazine. The article describes a complete 18X based logger, covering everything from sensor interfacing to downloading the data to Excel. The only potential problem is that Mike Bessant used a more difficult to obtain FRAM chip. However, you could substitute this for a pin compatible EEPROM chip simply by adding a few mS pause before each I2C write command.
 
Top