i2c EEPROM which suitable?

Akat

New Member
hi guys,

i need 1024 empty space (in eeprom) to keep a number in each of them.. means that i'll keep 1 value of number or character in each memory block separately.. so i have about 1000 value to keep in memory independently.. i decided to go for i2c instead of internal eeprom (which only offered me 256 blocks)

the question is, which i2c eeprom suitable for me??

Device Type Slave Speed Mode
24LC01B EE 128 %1010xxxx i2cfast i2cbyte
24LC02B EE 256 %1010xxxx i2cfast i2cbyte
24LC04B EE 512 %1010xxbx i2cfast i2cbyte
24LC08B EE 1kb %1010xbbx i2cfast i2cbyte
24LC16B EE 2kb %1010bbbx i2cfast i2cbyte
24LC64 EE 8kb %1010dddx i2cfast i2cword
24LC256 EE 64kb %1010dddx i2cfast i2cword

what's confusing me is that EE Type, letsay 24LC01B with EE128, what's 128 means??? 128 blocks of memory space? or 1024 blocks??? (i see in this chip datasheet stating this - 1 block of 256x8 bit memory... which is 128x8 = 1024?) <--- what is that mean?

for my project, which only needs 1024 memory space, should i go for 24LC01B or 24LC08B?
 

Phockzie

New Member
So, if you need 1024 bytes, that's the same as 1KB (kilobyte).

That's equal to 8Kb (kilobits) as there are 8 bits in a byte.

The 24LS series are marked in (Kb) kilobits so you need the 24LS08 at least.

That should do the job.
 

westaust55

Moderator
That table you posted has to have an error wrt the 24LC256

EEPROM:
Device........ Type...Bytes Slave Speed Mode
24LC01B....... EE.....128......%1010xxxx.....i2cfast.....i2cbyte
24LC02B....... EE.....256......%1010xxxx.....i2cfast.....i2cbyte
24LC04B....... EE.....512......%1010xxbx.....i2cfast.....i2cbyte
24LC08B....... EE.....1kb......%1010xbbx.....i2cfast.....i2cbyte
24LC16B....... EE.....2kb......%1010bbbx.....i2cfast.....i2cbyte
24LC64..........EE.....8kb......%1010dddx.....i2cfast.....i2cword
24LC256....... EE.....32kb.....%1010dddx.....i2cfast.....i2cword
24LC512....... EE....64kb.....%1010dddx.....i2cfast.....i2cword

24LC1025..... EE ...128kB....%1010bddx.....i2cfast.....i2cword ___ note "b" = block as IC is like 2 x 64kByte parts in 1 chip (and yes the last digits are 1025)

F-RAM
FM24C16......F-RAM...2kB.....%1010bbbx.....i2cfast.....i2cbyte
FM24C64......E-RAM...8kB.....%1010xxxx.....i2cfast.....i2cword

How often will you be writing to the external memory?
EEPROM have a guaranteed 100,000 writes althought some on this forum have apaprently done far better. At once a second to the same location and you could have failure in about 31 hours.

By comparison, F-RAM which is pin compatible with the EEPROM and has a life of 1 Trillion (10 power of 12) writes.

Note also that any EEPROM or FRAM chip 2kBytes or smaller does not use the three adress pins on the chip, so you can only ever have one "small" 24LCxxx or FM4Cxxx device in total.

With the bigger chips you can have up to 8 devices in any combination of type or size.
 
Last edited:

hippy

Ex-Staff (retired)
what's confusing me is that EE Type, letsay 24LC01B with EE128, what's 128 means???
The number after the letters usually indicates how many kilobits of storage there are within the chip. A kilo is 1024, and each byte needs eight bits so for a 24LC01 that's "01", one, so 1 kilobit, 1024 bits, divide by 8 and that's 128 bytes. For a 24LC256, 256 kilobits, 32 kilobytes.

To hold 1,000 8-bit numbers you'll need at least a 24LC08, 8 kilobits, 1 kilobyte (1024).

Code:
24LC128
    -.-
     `---> 128 kilobits
           -.-
            `-----------> 128
                          --- = 16 kilobytes, 16 * 1024 = 16384
                           8
 

boriz

Senior Member
Always have an overhead/spare. 24LC64 (8K Bytes) is cheap and only 8 pins on the device.

How frequently will you be writing to this memory? Remember EEPROM wares out. Like 500,000 to 1Million writes then boom.
 

rmeldo

Senior Member
Interesting...

So if the FM24C16 can stand trillion of times writing without failing why then Picaxe sell the 24Cxxxx?

What is the downside of the FM24C16 ?
 

Technical

Technical Support
Staff member
Have a look at the price difference between normally eeproms and FRAM!

FRAM is great but
1) very expensive when compared to normal eeproms
2) only available in surface mount format.
 

westaust55

Moderator
Have a look at the price difference between normally eeproms and FRAM!

FRAM is great but
1) very expensive when compared to normal eeproms
2) only available in surface mount format.
Depends where you shop. Now Australia does not always have the best pricing but:

EEPROM 24LC16B MicoZED (REv Ed agents) = AUD$3-00

F-RAM FM24C16 Farnell AUS$3.61

I in fact bought 4 x FM24C16 chips from this source:
http://cgi.ebay.com/NEW-ICS-FM24C16A-G-NVRAM-Memory-IC-RAMTRON-8-SOIC_W0QQitemZ350029440471QQcmdZViewItem?_trksid=p3286.m20.l1116
at US$1-49ea. All up it cost me about AUD$14 (from memory) at the time for 4 F-RAM's but AUD has dropped in value since them. :-( Bought thru Ebay as at the time Farnell did not have in stock.

so for 2kbytes cost difference is insignificant.
I got some SOIC8 to DIP 8 adapters for around AUD$0.50 (that includes postage) from Sydney
and find even using conventional soldering techniques works okay. I started a thread a while back on SOIC8 to DIP8 adapters.

Agree not so comparable on bigger sizes:

EEPROM 24LC256 (32kBytes) Altronics (Perth) AUD$3-45
F-RAM 24C64.....( 8kBytes) Farnell ............ AUD$7.39

But does anyone need more than 8 kBytes of FRAM ?
At $7.39 we are talking 8 times the cost per byte but AUD$8 is not going to break the bank for most.
 
Last edited:
Understanding EEPROMs 8 kbyte - 1024 kbyte ??

I'm thinking of increasing the memory of my AXE110 data logger by simply replacing the 24LC16B chip with a 24LC1025 chip. The datasheet for that chip tells you how to address the memory locations, but not in the same way as the i2c BASIC commands - I assume that the BASIC commands arrange for the necessary information to be sent to the chip. The point is that the datasheet is not very helpful to me as regards working with PICAXE.

1) Aside from whether the AXE110 board is hardwired for this (A2 has to be connected Vcc for this chip I understand), do I have to issue a fresh i2cslave command before I can read/write to the other (non-selected) block ?

2) Is it the case that the chip select pins (labelled A0, A1 and A2 in the datasheets) are all grounded on the AXE110 board so the 24LC1025 cannot be plugged into the memory slot on the board and be expected to work even if issued with correcrt commands ? But all the other 24LC series can ?

3) I need 17 bits to address each memory location (for 1 byte of data) 16-bit (word) way. Why can I only read/write word (2-byte) data for this chip and in fact for all chips of 8 kbyte and greater ? It is possible to address the locations in a bytewise fashion ?

AB
17.June.2011
 

westaust55

Moderator
I'm thinking of increasing the memory of my AXE110 data logger by simply replacing the 24LC16B chip with a 24LC1025 chip. The datasheet for that chip tells you how to address the memory locations, but not in the same way as the i2c BASIC commands - I assume that the BASIC commands arrange for the necessary information to be sent to the chip. The point is that the datasheet is not very helpful to me as regards working with PICAXE.

AB
17.June.2011

Q1) Aside from whether the AXE110 board is hardwired for this (A2 has to be connected Vcc for this chip I understand), do I have to issue a fresh i2cslave command before I can read/write to the other (non-selected) block ?

A1. If you are using an 18X chip then yes a new i2c command is required.
but IF you have an 18M2 chip you can use the newer hi2csetup, hi2cin and hi2cout commands which allow you to identify a new slave device in the read and write related commands ( hi2cin and hi2cout ) in which case while you are only accessing memory chips, it is not necessary to issue a new i2cslave command each time you access the memory chip.

2) Is it the case that the chip select pins (labelled A0, A1 and A2 in the datasheets) are all grounded on the AXE110 board so the 24LC1025 cannot be plugged into the memory slot on the board and be expected to work even if issued with correcrt commands ? But all the other 24LC series can ?

A2. Yes the EEPROM socket on the AXE110 board has all adress pins set to low state (this is to avoid conflict when used with the AXE111 memory expansion board).
From the datasheet:
The A2 input is non-configurable Chip Select. This pin must be tied to VCC in order for this device to operate.
If left floating or tied to VSS, device operation will be undefined.
So i2c commands from the PICAXE will in effect, be ignored.

Q3) I need 17 bits to address each memory location (for 1 byte of data) 16-bit (word) way. Why can I only read/write word (2-byte) data for this chip and in fact for all chips of 8 kbyte and greater ? It is possible to address the locations in a bytewise fashion ?

A3. Not exactly sure I fully understand you question here,
1 address related bit is set/cleared as a part of the chip slave address.
If only using one EEPROM this is almosts et and forget. You only eed to send the [newslave] keyword/parameter once again when you change the "block".
16 bits are then needed toa ddress the memory locations within the EEPROM.

You cannot write or read just one bit at a time. The i2c communications scheme in general, not just how the PICAXE uses it) is based on bytes of data.
If you only want to change one bit at a time then you need to write your program to
a. read the previous data - or leave a copy stored in a PICAXE variable - b0 is good
b. alter the desired bit within the PICAXE variable. This is why b0 can be a good choice of variable as you can access each bit easily. Read about bit variables
c. write the updated data back to the EEPROM

The question is what data are you working with that involves bit increments/values of data?
 

westaust55

Moderator
Re A2 can't you just lift the relevant leg and solder a pullup between it and Vcc?
:eek: heresy!, but Yes - very true.

Or

as I did with an AXE022 board with an 40X1 fitted. I cut one address track on the actual board and bridgedthe A0 pin to the alternate state to change the EEPROM address (in my case from %001 to %000 for consistence with AXE110/AXE111).
 

fritz42_male

Senior Member
Heresy? Nothing wrong with this. Used to use the same technique when expanding old CBM Pet computers from 16 to 32K years ago - piggybacked the new chips on top, bent one leg at right angles and used kynar wire to link that leg to the right spot.

NB
Don't use your teeth to strip Kynar - I chipped a veneer doing this!
 
@Fritz42 - I could try that. I am allergic to surgery - it always seems to majorly wrong when I perform. I don't have a 24LC1025 at present, maybe I'll buy more than 1 !

@ westaust55 -

Thanks for a very clear answer to my Qs 1. and 2. My third point is academic now, but it was, essentially, why do you have read/write words (not bytes) [I interpret your table as meaning this] to 24LC series chips larger than 8K bytes ?
i.e, why isn't 'i2cslave %10100000 i2cfast i2cbyte' a valid command for these chips ?

I hope this makes it clearer - if not, don't answer, because it doesn't matter for practical purposes.

(I was also saying that I could understand this for the 24LC1025 as it was a way of extending a 16 bit address to 17 bits - by using a 16 bit address to address 2 bytes at a time, but I now realise the 'extra bit' comes in the block select bit)

AB
18.June.2011
 

westaust55

Moderator
@ westaust55 -

Thanks for a very clear answer to my Qs 1. and 2. My third point is academic now, but it was, essentially, why do you have read/write words (not bytes) [I interpret your table as meaning this] to 24LC series chips larger than 8K bytes ?

i.e, why isn't 'i2cslave %10100000 i2cfast i2cbyte' a valid command for these chips ?

AB
18.June.2011
within the i2cslave command, the last parameter relates to the number of bits required to access a memory location within the EEPROM

i2cbyte (8-bits) can access locations 0 to 255 and hence only suits the smaller EEPROM chips such as the 24LC08 and 24LC16 - the 24LC16 ignores the physical address pins and uses the bits from the slave address to select blocks 0 to 7 and each block has 256 bytes (0 - 255).

i2cword (16 bits) can access locations 0 to 65535 and as such suits chips up to the 24LC512

When we get to the 24LC1025 there is a need for the extra bit and hence we lose an address bit for use as a block bit.
 
Last edited:

westaust55

Moderator
One point that I forgot to mention yesterday which is as much for Rev Ed (if hippy or Techncial read this), is that the diagrams on the left side of the page in Manual 2 V7.5 are incorrect for the hi2csetup, hi2cin and hi2cout commands in so far as the images indicate incorrectly that the mentioned commands also apply to the 18X.
 
to eclectic:

I'm sure you must be aware that that document is listed in the standard documentation on the PICAXE website.

Yes, I have had a read, having been referred to it by the PICAXE manual part 1 (I think, might have been AXE110.pdf) but can't remember in detail what it says. It gives good examples of code for common devices. Having referred to other manuals and wizard generated I found that it repeated what I had learned by example; nonetheless it is a useful thing to have read first !!

Thank you for drawing it to my attention again. I think it deserves a re-read.

AB
19.June.2011
 
Last edited:

hippy

Ex-Staff (retired)
One point that I forgot to mention yesterday which is as much for Rev Ed (if hippy or Techncial read this), is that the diagrams on the left side of the page in Manual 2 V7.5 are incorrect for the hi2csetup, hi2cin and hi2cout commands in so far as the images indicate incorrectly that the mentioned commands also apply to the 18X.
The HI2C commands do apply to the 18X; they are aliased to the deprecated commands with some compiler checking to ensure what's asked for is supported.

I've noted an issue with needing to leave a comma out of the HI2CSETUP command after I2CMASTER to avoid a syntax error ...

#Picaxe 18X
HI2cSetup I2CMASTER $A0, I2CSLOW, I2CBYTE
HI2cIn 0,( b0 )
HI2cOut 0,( b0 )
 

westaust55

Moderator
Thanks hippy.

So just a PE syntax parsing error -

and manuals are correct :)

had taken it to be unsupported hi2c... commands for the 18X
 
Arguments to i2cslave

Is it necessary to supply i2cslave with a hard constant (%10100010 for example, to select block 1 of 0-7 on an 24LC16B) as argument as in i2cslave %10100010, i2cslow, i2cbyte
or can you use a variable ? (as in this code excerpt)
Code:
.
.
symbol argument = b1
.
.
argument = %10100000
argument = argument + 2
i2cslave argument, i2cslow, i2cbyte
.
.
I am using an AXE110 with 18X and 24LC16B

AB
24June.2011
 

hippy

Ex-Staff (retired)
@ AB : That's perfectly acceptable. You can usually specify everything in variables or as constants; the compiler will indicate where that's not allowed.

#picaxe 18x
b0 = %10100000
b1 = i2cslow
b2 = i2cbyte
i2cslave b0, b1, b2
 
With reference to i2cslave command entry in Manual 2:
There is table (which has been quoted previously in this thread) of settings for different chips which contain speed settings and address lengths (icfast, i2cslow, i2cbyte etc)

I am using an -18X with an 24LC16B; the manual tells me
"Note that the 18X internal architecture means that the slower speed is always used with the 18X, as it is not capable of processing at the faster speed." which I interpret as use i2cslow rather than i2cfast. Indeed the datalogging Wizard generates code which inserts i2cslow. The table says use
i2cfast for the 24LC16B, but evidently you vcan get away with using i2cslow.

Which of these settings is it important to obey ? Are the ones that you MUST set determined by your hardware ? Are i2cfast and i2cslow up to you except were hardware constraints apply ? Is i2cbyte automatically interpreted as the LSbyte of byte if you use i2cbyte where i2cword is biven the table ? etc.

AB
25.June.2011
 

westaust55

Moderator
The most important thing to obey is that the i2c bus MUST (in theory) be operated at the speed of the slowest component on the i2c bus.

The reason is that if you try to operate the bus at a higher speed than the slowest device, the logic of the slowest device may get "confused" and result in a data clash on the i2c bus as a fasta nd slow chip try to respond to the master at the same time.

Many chips these days are capable of operation at 400 kHz i2c bus clock speed, however the DS1307 is one that is (in the datasheet) specified for a max of 100 kHz (= i2cslow)

Hence the AXE011 datalogger wizard will always set the i2c bus speed as i2cslow.


EDIT
wrt the statement about the 18X:
Note
... that the 18X internal architecture means that the slower speed is always used ...
If you use either i2cslow or i2cfast, the 18X will always operate at the slow bus clock speed.
The PE will not throw up an error and prevent the program running.
 
Last edited:
Top