Writing at all 24C02 adress

General discussion on mikroBasic.
Post Reply
Author
Message
Nemweb
Posts: 58
Joined: 04 Jul 2011 18:42

Writing at all 24C02 adress

#1 Post by Nemweb » 29 Dec 2013 22:22

Hi guys. I was learning how to use a 34C02 AND 24C04 memories. I sucesfully wrote and read data, but I got confused when I read the datasheet. It says 34C02 has 2K of memory and 24C04 has 4K, right? But how can I access all this 2K/4K if I can only send bytes trhough I2C, so, 256B?

First byte: MUST be $Ax, where x have my memory "code" and R/W bit
Second byte: The memory address
Third byte: more memory address or data?

tpetar
Posts: 593
Joined: 27 Apr 2012 18:44
Location: Pancevo, Serbia

Re: Writing at all 24C02 adress

#2 Post by tpetar » 30 Dec 2013 01:30

Nemweb wrote:Hi guys. I was learning how to use a 34C02 AND 24C04 memories. I sucesfully wrote and read data, but I got confused when I read the datasheet. It says 34C02 has 2K of memory and 24C04 has 4K, right? But how can I access all this 2K/4K if I can only send bytes trhough I2C, so, 256B?

First byte: MUST be $Ax, where x have my memory "code" and R/W bit
Second byte: The memory address
Third byte: more memory address or data?
Hi Nemweb,

It's very important to read and understand part datasheet clearly.

Size is declared in bits not in bytes, 2Kbits and 4Kbits not 2Kbytes and 4Kbytes.

1byte is 8bits.

Divide Kbits with 8 and you will get Kbytes size.


Best regards,
Peter

Nemweb
Posts: 58
Joined: 04 Jul 2011 18:42

Re: Writing at all 24C02 adress

#3 Post by Nemweb » 02 Jan 2014 18:41

oh yeah! now, reading each datasheet I understood how to control! Thanks and sorry by this idiot question! :mrgreen:

tpetar
Posts: 593
Joined: 27 Apr 2012 18:44
Location: Pancevo, Serbia

Re: Writing at all 24C02 adress

#4 Post by tpetar » 03 Jan 2014 07:09

Nemweb wrote:oh yeah! now, reading each datasheet I understood how to control! Thanks and sorry by this idiot question! :mrgreen:
Hi,

Please be free to ask everything what you want. :)


Best regards,
Peter

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Writing at all 24C02 adress

#5 Post by Dany » 03 Jan 2014 13:01

Hi,

Perhaps also this small article can help: http://www.rosseeld.be/DRO/PIC/X24Cxx.htm.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Nemweb
Posts: 58
Joined: 04 Jul 2011 18:42

Re: Writing at all 24C02 adress

#6 Post by Nemweb » 03 Jan 2014 14:14

ooh! Thanks! It is really helpful (better than reading datasheet)

Post Reply

Return to “mikroBasic General”