{"id":14356,"date":"2022-04-22T19:40:19","date_gmt":"2022-04-22T19:40:19","guid":{"rendered":"https:\/\/wolles-elektronikkiste.de\/eeprom-part-2-external-i2c-eeproms"},"modified":"2023-05-16T17:01:03","modified_gmt":"2023-05-16T17:01:03","slug":"eeprom-part-2-external-i2c-eeproms","status":"publish","type":"post","link":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms","title":{"rendered":"EEPROM Part 2 &#8211; external I2C EEPROMs"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">About this post<\/h2>\n\n<p>In my last post I had explained the use of the internal EEPROM of the AVR microcontrollers or the AVR based Arduino boards. In this article I will focus on the external I2C controlled EEPROMs. With suitable libraries, such as the one from Sparkfun, you can write and read the EEPROMs very conveniently. For a better understanding, however, it is also worthwhile to learn how this works without a library.<\/p>\r\n<p>The article is structured as follows:<\/p>\r\n<ul>\r\n<li><a href=\"#Einfuehrung\">Introduction<\/a><\/li>\r\n<li><a href=\"#Pinout-und-Anschluss\">Pinout and connection to the microcontroller<\/a><\/li>\r\n<li><a href=\"#EEPROM_beschreiben_und_lesen\">Writing to and reading from the EEPROM<\/a><\/li>\r\n<li><a href=\"#Groessere_Datenmengen\">Writing larger data sets<\/a><\/li>\r\n<li><a href=\"#page_write\">Page Write<\/a><\/li>\r\n<li><a href=\"#sparkfun_bibliothek\">Sparkfun Library<\/a><\/li>\r\n<\/ul>\r\n<p>In a <a href=\"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-3-external-spi-eeproms\" target=\"_blank\" rel=\"noopener\">separate post<\/a> I introduce the external SPI based EEPROMs. They are so different from the I2C based EEPROMs that I couldn&#8217;t fit both in a single post. <\/p>\n\n<h2 class=\"wp-block-heading\" id=\"Einfuehrung\">Introduction<\/h2>\n\n<h3 class=\"wp-block-heading\">What is an EEPROM?<\/h3>\n\n<p>The abbreviation EEPROM stands for &#8220;Electrically Erasable Programmable Read Only Memory&#8221;. This somewhat contradictory name has evolved historically. I discussed this in my last post. In short, an EEPROM serves as a memory for data that should not be lost even after the power supply has been switched off.<\/p>\r\n\n<h3 class=\"wp-block-heading\">What are the characteristics of EEPROMs?<\/h3>\n\n<p>One of the advantages of EEPROMs is their compact design. In addition, the data on an EEPROM is stored securely for a comparatively long time. In some cases, manufacturers guarantee data retention of more than 200 years. I will check this in 200 years and complain if necessary ;-).<\/p>\r\n<p>A disadvantage, however, is the comparatively slow write speed of the EEPROMs. It is in the range of milliseconds for a single byte. Through &#8220;Page Writing&#8221;, the models discussed here increase their effective write speed considerably compared to the internal EEPROMs. However, they are still much slower than flash memory.<\/p>\r\n<p>An EEPROM has a limited lifetime in terms of the number of write cycles. However, this disadvantage is of limited relevance, as the specified limit set is usually higher than one million. If the same memory cell were overwritten every second, its lifetime would be reached after ~11.5 days. If you overwrite it every 5 minutes, the lifetime would be exceeded after almost 20 years.<\/p>\r\n\n<h3 class=\"wp-block-heading\">The EEPROMs I will discuss<\/h3>\n\n<p>In this article, I will focus on EEPROMs of the 24 series. These EEPROMs are labeled according to the scheme &#8220;24xxyy&#8221;. <\/p>\r\n<p>The &#8220;xx&#8221; part encodes different voltage ranges and transmission speeds. Often you will find &#8220;LC&#8221;, &#8220;C&#8221; and &#8220;A&#8221; types. The &#8220;yy&#8221; usually indicates the storage capacity in kilobits. At the bottom left you can see, for example, the &#8220;<a href=\"https:\/\/ww1.microchip.com\/downloads\/en\/DeviceDoc\/21189T.pdf\" target=\"_blank\" rel=\"noopener\">24LC64<\/a>&#8220;, which has a capacity of 64 kbit = 8 kilobytes.<\/p>\r\n<p>You control the 24 series via I2C. There are also other series. The 25 series, for example, is controlled by SPI, the 11, 21 and 28 series communicate via one-wire techniques.<\/p>\r\n<p>Further abbreviations define design types (PDIP, SIOC, etc), temperature ranges and others.<\/p>\r\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/24LC64.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"475\" height=\"396\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/24LC64.jpg\" alt=\"EEPROM 24LC64\" class=\"wp-image-13926\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/24LC64.jpg 475w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/24LC64-300x250.jpg 300w\" sizes=\"auto, (max-width: 475px) 100vw, 475px\" \/><\/a><figcaption class=\"wp-element-caption\">24LC64 EEPROM<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/Modul_2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"660\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/Modul_2.jpg\" alt=\"EEPROM 24C256&#13;&#10;\" class=\"wp-image-13930\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/Modul_2.jpg 761w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/Modul_2-300x260.jpg 300w\" sizes=\"auto, (max-width: 761px) 100vw, 761px\" \/><\/a><figcaption class=\"wp-element-caption\">24C256 EEPROM Module<\/figcaption><\/figure><\/div>\n<\/div>\n\n<h4 class=\"wp-block-heading\">Power<\/h4>\n\n<p>The EEPROMs are quite undemanding as far as their power requirements are concerned. While writing, they usually consume 0.1 -1.0 milliamps. When reading, the value is even lower. In standby, the maximum current is a few microamps.<\/p>\r\n\n<h2 class=\"wp-block-heading\" id=\"Pinout-und-Anschluss\">Pinout and connection to the microcontroller<\/h2>\n\n<h4 class=\"wp-block-heading\">Pinout of the 24 EEPROM series<\/h4>\n\n<p>The pinout of the EEPROMs of the 24 series usually looks like this:<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_24Cxxx_pinout.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_24Cxxx_pinout.png\" alt=\"EEPROM Pinout\" class=\"wp-image-13900\" width=\"433\" height=\"295\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_24Cxxx_pinout.png 865w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_24Cxxx_pinout-300x204.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_24Cxxx_pinout-768x523.png 768w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/a><figcaption class=\"wp-element-caption\">EEPROM Pinout (24 series)<\/figcaption><\/figure><\/div>\n<ul>\r\n<li><strong>A0 \/ A1 \/ (A2)<\/strong>: Address pins, 4 to 8 addresses can usually be set.<\/li>\r\n<li><strong>VCC \/ GND<\/strong>: Power supply, for example 2.5 &#8211; 5.5 Volt for the 24LCxx series (check the data sheet!).<\/li>\r\n<li><strong>WP<\/strong>: Write Protection;\r\n<ul>\r\n<li>Inactive when connected to GND.<\/li>\r\n<li>Active when connected to VCC.<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li><strong>SDA\/SCL<\/strong>: I2C connectors, max. 400 kHz for the 24LCxx series (check the data sheet!).\r\n<ul>\r\n<li>Address scheme: 1 0 1 0 A2 A1 A0 with GND = 0 and VCC = 1.<\/li>\r\n<li>Example: A1\/A2\/A3 to GND \u2192 address = 0b1010000 = 80 = 0x50.<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n\n<h3 class=\"wp-block-heading\">Connection to an Arduino Nano<\/h3>\n\n<p>Example circuit of a 24LC256 on an Arduino Nano:<\/p>\r\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_wiring-1024x455.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_wiring-1024x455.png\" alt=\"EEPROM circuit with an Arduino Nano\" class=\"wp-image-13902\" width=\"840\" height=\"373\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_wiring-1024x455.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_wiring-300x133.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_wiring-768x341.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/eeprom_wiring.png 1306w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/a><figcaption class=\"wp-element-caption\">EEPROM circuit with an Arduino Nano<\/figcaption><\/figure>\n<p>Often you can do without the pull-up resistors. Just try it.<\/p>\r\n\n<h2 class=\"wp-block-heading\" id=\"EEPROM_beschreiben_und_lesen\">Write to and reading from the EEPROM<\/h2>\n\n<p>In a first, simple example, we write three byte values to the EEPROM and then read them from the EEPROM. You initiate the writing process with <code>Wire.beginTransmission()<\/code>.<\/p>\r\n<p>In the next step, you use <code>Wire.write()<\/code> to pass the memory address at which you want to store the value. For EEPROMs with a storage capacity up to 2kbit (=256 bytes) you can pass the address as a single byte. But usually you will use bigger ones. In this case, up to 512 kbit (= 64 kByte), the address can be an unsigned integer variable. You split the addresses into the MSB (Most Significant Byte) and LSB (Least Significant Byte).<\/p>\r\n<p>You finalize the writing process with <code>Wire.endTransmission()<\/code>. However, the EEPROM needs some additional time to complete the write cycle. Before that, you can&#8217;t write additional data to the EEPROM. The &#8220;Write Cycle Time&#8221; can be found in the data sheet of your EEPROM. Typically, it is 5 milliseconds.<\/p>\r\n\n<p>You must count the memory used when writing to calculate the next free address. There is no function that warns you that an address has already been written to. Strictly speaking, there is no distinction between &#8220;full&#8221; and &#8220;empty&#8221; memory. There can&#8217;t be no value at all at an address. New EEPROMS usually have 0xFF at all addresses. So, the data can only be overwritten to be deleted.<\/p>\r\n\n<p>For reading, you use the <code>Wire.requestFrom()<\/code> function. You don&#8217;t have to add any waiting time between the read operations.<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"ext_eeprom_byte_write_read.ino\" data-enlighter-title=\"ext_eeprom_byte_write_read.ino\">#include &lt;Wire.h&gt;\r\n#define I2C_ADDRESS 0x50\r\n\r\nvoid setup(){\r\n  Wire.begin();\r\n  Serial.begin(9600);\r\n  \r\n  unsigned int address = 0;\r\n  byte byteVal_1 = 42;\r\n  byte byteVal_2 = 123;\r\n  byte byteVal_3 = 255;\r\n  \r\n  eepromByteWrite(address,byteVal_1);\r\n  address++;\r\n  eepromByteWrite(address,byteVal_2);\r\n  address++;\r\n  eepromByteWrite(address,byteVal_3);\r\n  \r\n  for(address=0; address&lt;3; address++){\r\n    Serial.print(\"Byte at address \");\r\n    Serial.print(address);\r\n    Serial.print(\": \");\r\n    Serial.println(eepromByteRead(address));\r\n  }\r\n}\r\nvoid loop(){}\r\n\r\nvoid eepromByteWrite(unsigned int addr, byte byteToWrite){\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  Wire.write(byteToWrite);\r\n  Wire.endTransmission();\r\n  delay(5); \/\/ important!\r\n}\r\n\r\nint eepromByteRead(unsigned int addr){\r\n  int byteToRead;\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  Wire.endTransmission();\r\n  Wire.requestFrom(I2C_ADDRESS, 1);\r\n  byteToRead = Wire.read();\r\n  return byteToRead;\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n<\/div>\r\n\n<p>Here&#8217;s what the output looks like:<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_byte_write_read.png\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"141\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_byte_write_read.png\" alt=\"Output of ext_eeprom_byte_write_read.ino\" class=\"wp-image-13939\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_byte_write_read.png 728w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_byte_write_read-300x58.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><figcaption class=\"wp-element-caption\">Output of ext_eeprom_byte_write_read.ino<\/figcaption><\/figure><\/div>\n<h2 class=\"wp-block-heading\" id=\"Groessere_Datenmengen\">Write larger data sets to the EEPROM<\/h2>\n\n<p>In the next example, we first create an array of one hundred integers. The value of the i-th element of the array is 10 \u00b7 i (arbitrarily chosen). We write the array to the EEPROM, read it from EEPROM and output it to the serial monitor.<\/p>\r\n<p>Here is the sketch:<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"ext_eeprom_int_array_write_read.ino\" data-enlighter-title=\"ext_eeprom_int_array_write_read.ino\">#include &lt;Wire.h&gt;\r\n#define I2C_ADDRESS 0x50\r\n\r\nvoid setup(){\r\n  Wire.begin();\r\n  \/\/Wire.setClock(400000);\r\n  Serial.begin(9600);\r\n  unsigned int address = 0;\r\n  unsigned long writeStart = 0;\r\n  unsigned long writeDuration = 0;\r\n  \r\n  unsigned int arraySize = 100;\r\n  int intArray[arraySize];\r\n  \r\n  for(unsigned int i=0; i&lt;arraySize; i++){\r\n    intArray[i] = i*10;\r\n  }\r\n  writeStart = millis();\r\n  writeIntArrayToEEPROM(address, intArray, arraySize);\r\n  writeDuration = millis() - writeStart; \r\n\r\n  address = 0;\r\n  for(unsigned int i=0; i&lt;arraySize; i++){\r\n    Serial.print(\"intArray[\");\r\n    Serial.print(i);\r\n    Serial.print(\"]: \");\r\n    Serial.println(readIntFromEEPROM(address + 2*i)); \r\n  }\r\n  Serial.print(\"Time needed for writing [ms]: \");\r\n  Serial.println(writeDuration);\r\n}\r\n\r\nvoid loop(){}\r\n\r\nvoid writeIntArrayToEEPROM(unsigned int addr, int *iArr, unsigned int arrSize){  \r\n  for(unsigned int i = 0; i&lt;arrSize; i++){\r\n    Wire.beginTransmission(I2C_ADDRESS);\r\n    Wire.write((byte)((2*i+addr)&gt;&gt;8));\r\n    Wire.write((byte)((2*i+addr)&amp;0xFF));\r\n    Wire.write((byte)(iArr[i]&gt;&gt;8));\r\n    Wire.write((byte)(iArr[i])&amp;0xFF);\r\n    Wire.endTransmission();\r\n    delay(5);\r\n\/\/    while(isBusy()){   \/\/ alternativ to delay(5).\r\n\/\/      delayMicroseconds(50);\r\n\/\/    }\r\n  }\r\n}\r\n  \r\nunsigned int readIntFromEEPROM(unsigned int addr){\r\n  int intToRead;\r\n  byte msByte;\r\n  byte lsByte;\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  Wire.endTransmission();\r\n  Wire.requestFrom(I2C_ADDRESS, 2);\r\n  msByte = Wire.read();\r\n  lsByte = Wire.read();\r\n  intToRead = msByte&lt;&lt;8 | lsByte;\r\n  return intToRead;\r\n}\r\n\r\nbool isBusy(){\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  return Wire.endTransmission();\r\n}<\/pre>\r\n<\/div>\r\n\n<p>Just a few explanations:<\/p>\r\n<ul>\r\n<li>The array is passed to the write function <code>writeIntArrayToEEPROM()<\/code> as a pointer. I discussed this in my last post.<\/li>\r\n<li>An integer is two bytes (at least on an Arduino). Therefore, not only the address, but also the value to be written must be split into MSB and LSB.<\/li>\r\n<\/ul>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_write_read.png\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"349\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_write_read.png\" alt=\"Output of ext_eeprom_int_array_write_read.ino\" class=\"wp-image-13906\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_write_read.png 728w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_write_read-300x144.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><figcaption class=\"wp-element-caption\">Output of ext_eeprom_int_array_write_read.ino<\/figcaption><\/figure><\/div>\n<p>Writing the array took 552 milliseconds. 500 milliseconds of this time is &#8220;write cycle time&#8221;. If your EEPROM supports Fast I2C, you can reduce the other 52 milliseconds by uncommenting line 6: <code>Wire.setClock(400000)<\/code>. This increases the I2C frequency from 100 to 400 kHz. At 400 kHz I was able to reduce the write process to 519 milliseconds.<\/p>\r\n<p>The data sheet specifies the &#8220;write cycle Ttme&#8221; to be 5 milliseconds. In reality it&#8217;s shorter. As long as the EEPROM is busy with writing, it will not &#8220;listen&#8221; to I2C commands. This means that it will acknowledge during a write cycle. This property is used by the function <code>isBusy()<\/code> to check if the EEPROM is available.<\/p>\r\n<p>Comment line 43, <code>delay(5)<\/code>, and uncomment the following three lines. With this measure and the switch to 400 kHz, the time required to write the array dropped to 380 milliseconds. The real &#8220;write cycle time&#8221; is therefore about 3.5 milliseconds.<\/p>\r\n\n<h2 class=\"wp-block-heading\" id=\"page_write\">EEPROM Page Write<\/h2>\n\n<p>As you have just seen, it is possible to write several bytes to the EEPROM &#8220;in one go&#8221; (Page Write), i.e. without intermediate <code>Wire.endTransmission()<\/code> and <code>delay()<\/code>. Otherwise, writing to the integer array would have taken at least 1000 milliseconds.<\/p>\r\n<p>This works because the EEPROM is segmented into memory sections (Pages) and has a buffer for these sections. The data to be written is quickly transferred to the buffer. And from there the data is written to the memory. The advantage is that writing the entire buffer to the memory takes no longer than the write cycle time. The page size can be found in the data sheet. For the 24LC64 the page size is 32 bytes, for a 24LC256 it is 64 bytes.<\/p>\r\n<p>The pages start and end at fixed memory addresses. Page writing beyond the end of a page does not work.<\/p>\r\n\n<h3 class=\"wp-block-heading\">Limitation by the Wire.write() buffer<\/h3>\n\n<p>For page writing, there is still a limiting factor related to the Arduino. And that&#8217;s the buffer for <code>Wire.write()<\/code>. The following sketch demonstrates the issue:<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"ext_eeprom_wire_limit_test.ino\" data-enlighter-title=\"ext_eeprom_wire_limit_test.ino\">#include &lt;Wire.h&gt;\r\n#define I2C_ADDRESS 0x50\r\n\r\nvoid setup(){\r\n  Wire.begin();\r\n  Serial.begin(9600);\r\n  unsigned int address = 0;\r\n   \r\n  for(unsigned int i=address; i&lt;64; i++){\r\n    eepromByteWrite(i,(byte)i);\r\n  }\r\n\r\n  byte byteArray[64];\r\n  for(byte i=0; i&lt;64; i++){\r\n    byteArray[i] = i*2;\r\n  }\r\n  eepromBytePageWrite(address, byteArray, sizeof(byteArray));\r\n  \r\n  address = 0;\r\n  for(unsigned int i=address; i&lt;sizeof(byteArray); i++){\r\n    Serial.print(\"byteArray[\");\r\n    Serial.print(i);\r\n    Serial.print(\"]: \");\r\n    Serial.println(readEEPROM(i)); \r\n  }\r\n}\r\nvoid loop(){}\r\n\r\nvoid eepromByteWrite(unsigned int addr, byte byteToWrite){\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  Wire.write(byteToWrite);\r\n  Wire.endTransmission();\r\n  delay(5);\r\n}\r\n\r\nvoid eepromBytePageWrite(unsigned int addr, byte *byteArrayToWrite, unsigned int sizeOfArray){\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  for(unsigned int i=addr; i&lt;sizeOfArray; i++){\r\n    Wire.write(byteArrayToWrite[i]);\r\n  }\r\n  Wire.endTransmission();\r\n  delay(5);\r\n}\r\n\r\nbyte readEEPROM(unsigned int addr){\r\n  byte byteToRead;\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  Wire.endTransmission();\r\n  Wire.requestFrom(I2C_ADDRESS, 1);\r\n  byteToRead = Wire.read();\r\n  return byteToRead;\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n<\/div>\r\n\n<p>The sketch writes values to the first 64 EEPROM memory addresses, namely the address itself. The values are written individually and with a 5 millisecond pause. With this, we have a defined initial state. <\/p>\r\n<p>Then the sketch writes (or at least tries to write) 64 new values (address multiplied by 2)&nbsp; to the EEPROM. This time it uses the page write method. Here is the unexpected result:<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output__ext_eeprom_wire_limit_test.png\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"349\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output__ext_eeprom_wire_limit_test.png\" alt=\"Output of ext_eeprom_wire_limit_test.ino\" class=\"wp-image-13944\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output__ext_eeprom_wire_limit_test.png 728w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output__ext_eeprom_wire_limit_test-300x144.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><figcaption class=\"wp-element-caption\">Output of ext_eeprom_wire_limit_test.ino<\/figcaption><\/figure><\/div>\n<p>The first 30 values (0-29) have been replaced by the Page Write procedure, but after that get the old values. The reason is as follows: For successive <code> Wire.write()<\/code> commands (i.e. without intermediate <code>Wire.endTransmission()<\/code>), the data to be written is written to a buffer which is limited to 32 bytes. This happens on the Arduino side, and it has nothing to do with the EEPROM. The transmission of the address requires 2 bytes, so there are still 30 bytes left for the data. All additional <code>Wire.write()<\/code> calls end up in Nirvana. <\/p>\r\n\n<h3 class=\"wp-block-heading\">Correct page writing<\/h3>\n\n<p>When page writing, three aspects have to be considered:<\/p>\r\n<ol>\r\n<li>The page size,<\/li>\r\n<li>the wire.write() buffer, and<\/li>\r\n<li>you must not write beyond a page end.<\/li>\r\n<\/ol>\r\n<p>In the next example, we write an array of 100 integer values (= 200 bytes) to an EEPROM with a page size of 64 bytes using the page write method correctly. If we start at the address 0, then we have 64 bytes which we can write to the page. The limiting factor is the <code>Wire.write()<\/code> buffer. So, we first write the addresses 0-29, then 30-59. After that, we have to consider page end after address 63 and can only another 4 bytes at a time. The same happens in the following two pages. Finally, we write the remaining 8 bytes to the last page. Schematically, it looks like this:<\/p>\r\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-1024x447.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-1024x447.png\" alt=\"Writing 100 integers to an EEPROM with a page size of 64 bytes\" class=\"wp-image-13909\" width=\"842\" height=\"367\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-1024x447.png 1024w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-300x131.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-768x335.png 768w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-1536x670.png 1536w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages-1320x576.png 1320w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_pages.png 1574w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><\/a><figcaption class=\"wp-element-caption\">Writing 100 integers to an EEPROM with a page size of 64 bytes<\/figcaption><\/figure>\n<p>A sketch could look like this:<\/p>\r\n\n<div class=\"scroll-paragraph-long\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"ext_eeprom_int_array_page_write_read.ino\" data-enlighter-title=\"ext_eeprom_int_array_page_write_read.ino\">#include &lt;Wire.h&gt;\r\n#define I2C_ADDRESS 0x50\r\n#define PAGE_SIZE 64\r\n#define WRITE_LIMIT 30 \r\n\r\nvoid setup(){\r\n  Wire.begin();\r\n  Serial.begin(9600);\r\n  unsigned int address = 0;\r\n  unsigned long writeStart = 0;\r\n  unsigned long writeDuration = 0;\r\n  \r\n  unsigned int arraySize = 100;\r\n  int intArray[arraySize];\r\n  \r\n  for(unsigned int i=0; i&lt;arraySize; i++){\r\n    intArray[i] = i*1;\r\n  }\r\n  writeStart = millis();\r\n  writeIntArrayToEEPROM(address, intArray, arraySize);\r\n  writeDuration = millis() - writeStart; \r\n  \r\n  address = 0;\r\n  for(unsigned int i=0; i&lt;arraySize; i++){\r\n    Serial.print(\"intArray[\");\r\n    Serial.print(i);\r\n    Serial.print(\"]: \");\r\n    Serial.println(readIntFromEEPROM(address + 2*i)); \r\n  }\r\n  Serial.print(\"Time needed for writing [ms]: \");\r\n  Serial.println(writeDuration);\r\n}\r\n\r\nvoid loop(){}\r\n\r\nvoid writeIntArrayToEEPROM(unsigned int addr, int *iArr, unsigned int arrSize){  \r\n  unsigned int noOfIntsStillToWrite = arrSize;\r\n  unsigned int arrayIndex = 0;\r\n  \r\n  while((noOfIntsStillToWrite != 0)){\r\n    unsigned int chunk = (WRITE_LIMIT \/ sizeof(int));  \/\/ max chunk in number of ints\r\n    unsigned int positionInPage = (addr % PAGE_SIZE);  \/\/ current position in page\r\n    unsigned int spaceLeftInPage = (PAGE_SIZE - positionInPage) \/ sizeof(int); \/\/ available storage space \r\n    if(spaceLeftInPage &lt; chunk){\r\n      chunk = spaceLeftInPage;\r\n    }\r\n    if(noOfIntsStillToWrite &lt; chunk){\r\n      chunk = noOfIntsStillToWrite;\r\n    }\r\n    writeEEPROM(addr, iArr, chunk, arrayIndex);\r\n    noOfIntsStillToWrite -= chunk;\r\n    addr += (chunk * 2);\r\n    arrayIndex += chunk;\r\n  } \r\n}\r\n\r\nvoid writeEEPROM(unsigned int addr, int *iArr, unsigned int chunkSize, unsigned int arrIdx){  \r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n\r\n  for(unsigned int i=0; i&lt;chunkSize; i++){\r\n    Wire.write((byte)(iArr[i+arrIdx]&gt;&gt;8));\r\n    Wire.write((byte)(iArr[i+arrIdx])&amp;0xFF);\r\n  }\r\n  Wire.endTransmission();\r\n  delay(5); \r\n}\r\n\r\nunsigned int readIntFromEEPROM(unsigned int addr){\r\n  int intToRead;\r\n  byte msByte;\r\n  byte lsByte;\r\n  Wire.beginTransmission(I2C_ADDRESS);\r\n  Wire.write((byte)(addr&gt;&gt;8));\r\n  Wire.write((byte)(addr&amp;0xFF));\r\n  Wire.endTransmission();\r\n  Wire.requestFrom(I2C_ADDRESS, 2);\r\n  msByte = Wire.read();\r\n  lsByte = Wire.read();\r\n  intToRead = msByte&lt;&lt;8 | lsByte;\r\n  return intToRead;\r\n}<\/pre>\r\n<p>&nbsp;<\/p>\r\n<\/div>\r\n\n<p>You &#8211; or your sketch &#8211; have to calculate again and again the number of bytes you can write to the EEPROM in one step. As expected, the speed gain through the page write method is considerable:<\/p>\r\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_page_write_read.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_page_write_read.png\" alt=\"Output of ext_eeprom_int_array_write_read.ino\" class=\"wp-image-13913\" width=\"728\" height=\"349\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_page_write_read.png 728w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/output_ext_eeprom_int_array_page_write_read-300x144.png 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><\/a><figcaption class=\"wp-element-caption\">Output of ext_eeprom_int_array_write_read.ino<\/figcaption><\/figure><\/div>\n<p>Again, you can further increase the speed by using the isBusy() function and by switching to 400 kHz. The latter, of course, only if the EEPROM masters it.<\/p>\r\n\n<h2 class=\"wp-block-heading\" id=\"sparkfun_bibliothek\">Sparkfun Library<\/h2>\n\n<p>You can make your life much easier by using a library. I tested the SparkFun_External_EEPROM_Arduino_Library. It is easy to use and quite comfortable. You can install the library via the library manager of the Arduino IDE or you can download it directly from GitHub (<a href=\"https:\/\/github.com\/sparkfun\/SparkFun_External_EEPROM_Arduino_Library\" target=\"_blank\" rel=\"noopener\">link<\/a>). The functions get() and put() are similar to the corresponding functions from EEPROM.h for the internal EEPROMs of the AVR boards. Their use is similar.<\/p>\r\n<p>If you want to write strings to or read strings from the EEPROM, use the functions <code>putString()<\/code> and <code>getString()<\/code>. The rest should actually be self-explanatory. Here is an example sketch:<\/p>\r\n\n<div class=\"scroll-paragraph\">\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-group=\"Example1_BasicReadWrite.ino\" data-enlighter-title=\"Example1_BasicReadWrite.ino\">#include &lt;Wire.h&gt;\r\n\r\n#include \"SparkFun_External_EEPROM.h\" \/\/ Click here to get the library: http:\/\/librarymanager\/All#SparkFun_External_EEPROM\r\nExternalEEPROM myMem;\r\n\r\nvoid setup()\r\n{\r\n  Serial.begin(115200);\r\n  Serial.println(\"Qwiic EEPROM example\");\r\n\r\n  Wire.begin();\r\n\r\n  if (myMem.begin() == false)\r\n  {\r\n    Serial.println(\"No memory detected. Freezing.\");\r\n    while (1)\r\n      ;\r\n  }\r\n  Serial.println(\"Memory detected!\");\r\n\r\n  Serial.print(\"Mem size in bytes: \");\r\n  Serial.println(myMem.length());\r\n\r\n  \/\/Yes you can read and write bytes, but you shouldn't!\r\n  byte myValue1 = 200;\r\n  myMem.write(0, myValue1); \/\/(location, data)\r\n\r\n  byte myRead1 = myMem.read(0);\r\n  Serial.print(\"I read: \");\r\n  Serial.println(myRead1);\r\n\r\n  \/\/You should use gets and puts. This will automatically and correctly arrange\r\n  \/\/the bytes for larger variable types.\r\n  int myValue2 = -366;\r\n  myMem.put(10, myValue2); \/\/(location, data)\r\n  int myRead2;\r\n  myMem.get(10, myRead2); \/\/location to read, thing to put data into\r\n  Serial.print(\"I read: \");\r\n  Serial.println(myRead2);\r\n\r\n  float myValue3 = -7.35;\r\n  myMem.put(20, myValue3); \/\/(location, data)\r\n  float myRead3;\r\n  myMem.get(20, myRead3); \/\/location to read, thing to put data into\r\n  Serial.print(\"I read: \");\r\n  Serial.println(myRead3);\r\n\r\n  String myString = \"Hi, I am just a simple test string\";\r\n  unsigned long nextEEPROMLocation = myMem.putString(30, myString);\r\n  String myRead4 = \"\";\r\n  myMem.getString(30, myRead4);\r\n  Serial.print(\"I read: \");\r\n  Serial.println(myRead4);\r\n  Serial.print(\"Next available EEPROM location: \");\r\n  Serial.println(nextEEPROMLocation);  \r\n}\r\n\r\nvoid loop()\r\n{\r\n}<\/pre>\r\n<p>\u00a0<\/p>\r\n<\/div>\r\n\n<p>Here&#8217;s what the output looks like:<\/p>\r\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/04\/output_ext_eeprom_sparkfun_example_.png\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"247\" src=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/04\/output_ext_eeprom_sparkfun_example_.png\" alt=\"Ausgabe von Example1_BasicReadWrite.ino\" class=\"wp-image-18093\" srcset=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/04\/output_ext_eeprom_sparkfun_example_.png 875w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/04\/output_ext_eeprom_sparkfun_example_-300x85.png 300w, https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/04\/output_ext_eeprom_sparkfun_example_-768x217.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/a><figcaption class=\"wp-element-caption\">Ausgabe von Example1_BasicReadWrite.ino<\/figcaption><\/figure>\n<p>I recommend to also try out the other example sketches of the library, in particular Example2_Settings.ino.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>I show how you can use I2C controlled EEPROM ICs with your microcontroller. This works very comfortably with a library, but it can also be done without it. <\/p>\n","protected":false},"author":1,"featured_media":14018,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[565],"tags":[1752,1756,1753,556,1725,666,1755,1749,1497,1750,1754,1751],"class_list":["post-14356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-other-parts","tag-24lc256-en","tag-24lc64-en","tag-acknowledge-en","tag-arduino-en-2","tag-eeprom-en","tag-i2c-en","tag-page-size-en","tag-page-write-en","tag-pinout-en","tag-sparkfun-en","tag-wire-write-buffer","tag-write-cycle-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>EEPROM Part 2 - external I2C EEPROMs &#8226; Wolles Elektronikkiste<\/title>\n<meta name=\"description\" content=\"I will show you how to use I2C controlled EEPROMc with your microcontroller without or with a library.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EEPROM Part 2 - external I2C EEPROMs &#8226; Wolles Elektronikkiste\" \/>\n<meta property=\"og:description\" content=\"I will show you how to use I2C controlled EEPROMc with your microcontroller without or with a library.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms\" \/>\n<meta property=\"og:site_name\" content=\"Wolles Elektronikkiste\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-22T19:40:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-16T17:01:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_Post-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Wolfgang Ewald\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wolfgang Ewald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms\"},\"author\":{\"name\":\"Wolfgang Ewald\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"headline\":\"EEPROM Part 2 &#8211; external I2C EEPROMs\",\"datePublished\":\"2022-04-22T19:40:19+00:00\",\"dateModified\":\"2023-05-16T17:01:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms\"},\"wordCount\":1833,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/EEPROM_Post-1.png\",\"keywords\":[\"24LC256\",\"24LC64\",\"Acknowledge\",\"Arduino\",\"EEPROM\",\"I2C\",\"Page Size\",\"Page Write\",\"Pinout\",\"Sparkfun\",\"Wire.write() buffer\",\"Write Cycle\"],\"articleSection\":[\"Other parts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms\",\"name\":\"EEPROM Part 2 - external I2C EEPROMs &#8226; Wolles Elektronikkiste\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/EEPROM_Post-1.png\",\"datePublished\":\"2022-04-22T19:40:19+00:00\",\"dateModified\":\"2023-05-16T17:01:03+00:00\",\"description\":\"I will show you how to use I2C controlled EEPROMc with your microcontroller without or with a library.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#primaryimage\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/EEPROM_Post-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/EEPROM_Post-1.png\",\"width\":1200,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\\\/eeprom-part-2-external-i2c-eeproms#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"EEPROM Part 2 &#8211; external I2C EEPROMs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#website\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en\",\"name\":\"Wolles Elektronikkiste\",\"description\":\"Die wunderbare Welt der Elektronik\",\"publisher\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/en#\\\/schema\\\/person\\\/b774e4d64b4766889a2f7c6e5ec85b46\",\"name\":\"Wolfgang Ewald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"url\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"contentUrl\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\",\"width\":512,\"height\":512,\"caption\":\"Wolfgang Ewald\"},\"logo\":{\"@id\":\"https:\\\/\\\/wolles-elektronikkiste.de\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/cropped-Logo-1.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EEPROM Part 2 - external I2C EEPROMs &#8226; Wolles Elektronikkiste","description":"I will show you how to use I2C controlled EEPROMc with your microcontroller without or with a library.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms","og_locale":"en_US","og_type":"article","og_title":"EEPROM Part 2 - external I2C EEPROMs &#8226; Wolles Elektronikkiste","og_description":"I will show you how to use I2C controlled EEPROMc with your microcontroller without or with a library.","og_url":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms","og_site_name":"Wolles Elektronikkiste","article_published_time":"2022-04-22T19:40:19+00:00","article_modified_time":"2023-05-16T17:01:03+00:00","og_image":[{"width":1200,"height":1200,"url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_Post-1.png","type":"image\/png"}],"author":"Wolfgang Ewald","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Wolfgang Ewald","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#article","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms"},"author":{"name":"Wolfgang Ewald","@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"headline":"EEPROM Part 2 &#8211; external I2C EEPROMs","datePublished":"2022-04-22T19:40:19+00:00","dateModified":"2023-05-16T17:01:03+00:00","mainEntityOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms"},"wordCount":1833,"commentCount":5,"publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_Post-1.png","keywords":["24LC256","24LC64","Acknowledge","Arduino","EEPROM","I2C","Page Size","Page Write","Pinout","Sparkfun","Wire.write() buffer","Write Cycle"],"articleSection":["Other parts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms","url":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms","name":"EEPROM Part 2 - external I2C EEPROMs &#8226; Wolles Elektronikkiste","isPartOf":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#website"},"primaryImageOfPage":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#primaryimage"},"image":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#primaryimage"},"thumbnailUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_Post-1.png","datePublished":"2022-04-22T19:40:19+00:00","dateModified":"2023-05-16T17:01:03+00:00","description":"I will show you how to use I2C controlled EEPROMc with your microcontroller without or with a library.","breadcrumb":{"@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#primaryimage","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_Post-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2022\/03\/EEPROM_Post-1.png","width":1200,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/wolles-elektronikkiste.de\/en\/eeprom-part-2-external-i2c-eeproms#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/wolles-elektronikkiste.de\/en"},{"@type":"ListItem","position":2,"name":"EEPROM Part 2 &#8211; external I2C EEPROMs"}]},{"@type":"WebSite","@id":"https:\/\/wolles-elektronikkiste.de\/en#website","url":"https:\/\/wolles-elektronikkiste.de\/en","name":"Wolles Elektronikkiste","description":"Die wunderbare Welt der Elektronik","publisher":{"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wolles-elektronikkiste.de\/en?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/wolles-elektronikkiste.de\/en#\/schema\/person\/b774e4d64b4766889a2f7c6e5ec85b46","name":"Wolfgang Ewald","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","url":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","contentUrl":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png","width":512,"height":512,"caption":"Wolfgang Ewald"},"logo":{"@id":"https:\/\/wolles-elektronikkiste.de\/wp-content\/uploads\/2019\/03\/cropped-Logo-1.png"}}]}},"_links":{"self":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/14356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/comments?post=14356"}],"version-history":[{"count":0,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/posts\/14356\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media\/14018"}],"wp:attachment":[{"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/media?parent=14356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/categories?post=14356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wolles-elektronikkiste.de\/en\/wp-json\/wp\/v2\/tags?post=14356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}