Ok!
I found that the 24C08 have 2 Blocks but thats mean that each block have 512 Bytes!
how can I read or write the first block or the second!?
I have just a byte adress!
regards Pesti
Ok!
I found that the 24C08 have 2 Blocks but thats mean that each block have 512 Bytes!
how can I read or write the first block or the second!?
I have just a byte adress!
regards Pesti
Now the answer you want is in the I2CREAD section instead of the I2CWRITE, which, incidentally, goes hand in hand with I2CREAD, because to I2CREAD something, first you have to I2CWRITE something, unless you would rather I2CREAD an empty chip, which isn't really empty, but full of no data, and sometimes no data is better than some data, either of which can be I2CREAD quite effectively, and either of which can be I2CWRITTEN over to replace either the no data or the some data which will be I2CREAD later on.
Thats mean i must use something like this:
EraseEEprom= $A8
EEprom_Block = 0
Tmp_Daten = $00
EraseEEprom:
Erase_Loop:
for NextAdr = 0 to 255
I2CWrite sda,scl,EEprom_Adresse,NextAdr,[Tmp_Daten]
pause 10
Sound Buzzer,[122,1]
next NextAdr
EEprom_Adresse = EEprom_Adresse + 2
EEprom_Block = EEprom_Block + 1
if EEprom_Block => 4 then EEprom_Block = 0 : goto Exit_Loop2
goto Erase_Loop
Exit_Loop2:
Sound Buzzer,[122,250]
goto Main
Regards pesti
Make it easy on yourself, get a 24C256, 32k x 8 eeprom. Word address, byte data
I2Cwrite datapin, clockpin, $a0, address, data
But if you're hellbent on using the 24c08...
address var word 'only use lower 10 bit
addr var byte
control var byte
addr = address.lowbyte
control = $a0 + ( address.highbyte << 2 )
i2cwrite datapin, clockpin, control, address, data-whatever
OK,
I must write this :
Control = $A1
For address = 0 to 1023
addr = address.lowbyte
control = $a0 + ( address.highbyte << 2 )
I2CRead sda, scl,Control, addr,[EEprom_Daten[Byte_Count]]
Pause 10
Byte_Count = Byte_Count + 1
if Byte_Count > 15 then
Byte_Count = 0
HSEROUT [DEC3 NextAdr-15, ": ",HEX2 EEprom_Daten[0],HEX2 EEprom_Daten[1],HEX2 EEprom_Daten[2],HEX2 EEprom_Daten[3],HEX2 EEprom_Daten[4],HEX2 EEprom_Daten[5],HEX2 EEprom_Daten[6],HEX2 EEprom_Daten[7],DEC2 EEprom_Daten[8],DEC2 EEprom_Daten[9],DEC2 EEprom_Daten[10],DEC2 EEprom_Daten[11],DEC2 EEprom_Daten[12],DEC2 EEprom_Daten[13],HEX2 EEprom_Daten[14],HEX2 EEprom_Daten[15],13,10]
endif
next address
Or I make again a mistake ?!
Regards Pesti
Last edited by Pesticida; - 29th January 2008 at 21:59.
Hi
No this dont work!
My chip have the Pin E2 to VCC thats mean The Device Adress is :10101000 for Write and
10101001 For Reading.
I try all combination but dont work.
Regards Pesti
Bookmarks