Write faster on AT24C32 The 2019 Stack Overflow Developer Survey Results Are InEeprom write function does not seem to write in more than 100 locationsHow do you write to a free location on an external EEPROM?Problem reading an EEPROM chip using the I2C protocolEEPROM write timeUnderstanding bitwise operationsProblems Writing and Clearing 24FC512 EEPROM using Arduino UnoWhat values are the Atmel MCUs EEPROMs preloaded with?Extending EEPROM lifeWrite to EEPROM before shutdownHow to manage variable I2C read lengths requiring address incrementation (Wire/I2C/EEPROM IC emulation)

What is the formula behind each level spell slot progression that I can use in a spreadsheet?

"as much details as you can remember"

What is the meaning of the verb "bear" in this context?

Loose spokes after only a few rides

Falsification in Math vs Science

Have you ever entered Singapore using a different passport or name?

Delete all lines which don't have n characters before delimiter

Geography at the pixel level

Can someone be penalized for an "unlawful" act if no penalty is specified?

How to deal with fear of taking dependencies

What do hard-Brexiteers want with respect to the Irish border?

Right tool to dig six foot holes?

Are USB sockets on wall outlets live all the time, even when the switch is off?

Is flight data recorder erased after every flight?

Worn-tile Scrabble

Why do UK politicians seemingly ignore opinion polls on Brexit?

Is three citations per paragraph excessive for undergraduate research paper?

Who coined the term "madman theory"?

Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?

Aging parents with no investments

Is a "Democratic" Feudal System Possible?

Resizing object distorts it (Illustrator CC 2018)

Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?

Why is my custom API endpoint not working?



Write faster on AT24C32



The 2019 Stack Overflow Developer Survey Results Are InEeprom write function does not seem to write in more than 100 locationsHow do you write to a free location on an external EEPROM?Problem reading an EEPROM chip using the I2C protocolEEPROM write timeUnderstanding bitwise operationsProblems Writing and Clearing 24FC512 EEPROM using Arduino UnoWhat values are the Atmel MCUs EEPROMs preloaded with?Extending EEPROM lifeWrite to EEPROM before shutdownHow to manage variable I2C read lengths requiring address incrementation (Wire/I2C/EEPROM IC emulation)










1















I'm using AT24C32 EEPROM chip from ATmel. I found code that will write and read bytes from chip.
Code writes and reads bytes correctly and without any problem.



But I have to write few 8-byte values often(every 10-15 seconds). I did "cut" those variables to 48 bit(so 6-byte variable) and with that I speeded up saving but it's still slow.



Is there any chance to speed up saving proccess? Code is below



void EEPROMClass::write48(int16_t address, uint64_t value)

uint8_t byteValue = (value & 0xFF);
write8(address, byteValue);

byteValue = ((value >> 8) & 0xFF);
write8(address + 1, byteValue);

byteValue = ((value >> 16) & 0xFF);
write8(address + 2, byteValue);

byteValue = ((value >> 24) & 0xFF);
write8(address + 3, byteValue);

byteValue = ((value >> 32) & 0xFF);
write8(address + 4, byteValue);

byteValue = ((value >> 40) & 0xFF);
write8(address + 5, byteValue);


void EEPROMClass::write8(int16_t const address, uint8_t const value)

Wire.beginTransmission(AT24C32);

Wire.write(highAddressByte(address));
Wire.write(lowAddressByte(address));

Wire.write(value);
delay(2);
Wire.endTransmission();



delay of 2ms is required otherwise EEPROM will write different value. Code has 4 "6-byte" variables(total of 24 bytes). Every byte is minimum 2ms, so total time to save only "6-byte" variables is 48ms(round to 50ms). That is too slow for me. How to speed up write function?










share|improve this question


























    1















    I'm using AT24C32 EEPROM chip from ATmel. I found code that will write and read bytes from chip.
    Code writes and reads bytes correctly and without any problem.



    But I have to write few 8-byte values often(every 10-15 seconds). I did "cut" those variables to 48 bit(so 6-byte variable) and with that I speeded up saving but it's still slow.



    Is there any chance to speed up saving proccess? Code is below



    void EEPROMClass::write48(int16_t address, uint64_t value)

    uint8_t byteValue = (value & 0xFF);
    write8(address, byteValue);

    byteValue = ((value >> 8) & 0xFF);
    write8(address + 1, byteValue);

    byteValue = ((value >> 16) & 0xFF);
    write8(address + 2, byteValue);

    byteValue = ((value >> 24) & 0xFF);
    write8(address + 3, byteValue);

    byteValue = ((value >> 32) & 0xFF);
    write8(address + 4, byteValue);

    byteValue = ((value >> 40) & 0xFF);
    write8(address + 5, byteValue);


    void EEPROMClass::write8(int16_t const address, uint8_t const value)

    Wire.beginTransmission(AT24C32);

    Wire.write(highAddressByte(address));
    Wire.write(lowAddressByte(address));

    Wire.write(value);
    delay(2);
    Wire.endTransmission();



    delay of 2ms is required otherwise EEPROM will write different value. Code has 4 "6-byte" variables(total of 24 bytes). Every byte is minimum 2ms, so total time to save only "6-byte" variables is 48ms(round to 50ms). That is too slow for me. How to speed up write function?










    share|improve this question
























      1












      1








      1








      I'm using AT24C32 EEPROM chip from ATmel. I found code that will write and read bytes from chip.
      Code writes and reads bytes correctly and without any problem.



      But I have to write few 8-byte values often(every 10-15 seconds). I did "cut" those variables to 48 bit(so 6-byte variable) and with that I speeded up saving but it's still slow.



      Is there any chance to speed up saving proccess? Code is below



      void EEPROMClass::write48(int16_t address, uint64_t value)

      uint8_t byteValue = (value & 0xFF);
      write8(address, byteValue);

      byteValue = ((value >> 8) & 0xFF);
      write8(address + 1, byteValue);

      byteValue = ((value >> 16) & 0xFF);
      write8(address + 2, byteValue);

      byteValue = ((value >> 24) & 0xFF);
      write8(address + 3, byteValue);

      byteValue = ((value >> 32) & 0xFF);
      write8(address + 4, byteValue);

      byteValue = ((value >> 40) & 0xFF);
      write8(address + 5, byteValue);


      void EEPROMClass::write8(int16_t const address, uint8_t const value)

      Wire.beginTransmission(AT24C32);

      Wire.write(highAddressByte(address));
      Wire.write(lowAddressByte(address));

      Wire.write(value);
      delay(2);
      Wire.endTransmission();



      delay of 2ms is required otherwise EEPROM will write different value. Code has 4 "6-byte" variables(total of 24 bytes). Every byte is minimum 2ms, so total time to save only "6-byte" variables is 48ms(round to 50ms). That is too slow for me. How to speed up write function?










      share|improve this question














      I'm using AT24C32 EEPROM chip from ATmel. I found code that will write and read bytes from chip.
      Code writes and reads bytes correctly and without any problem.



      But I have to write few 8-byte values often(every 10-15 seconds). I did "cut" those variables to 48 bit(so 6-byte variable) and with that I speeded up saving but it's still slow.



      Is there any chance to speed up saving proccess? Code is below



      void EEPROMClass::write48(int16_t address, uint64_t value)

      uint8_t byteValue = (value & 0xFF);
      write8(address, byteValue);

      byteValue = ((value >> 8) & 0xFF);
      write8(address + 1, byteValue);

      byteValue = ((value >> 16) & 0xFF);
      write8(address + 2, byteValue);

      byteValue = ((value >> 24) & 0xFF);
      write8(address + 3, byteValue);

      byteValue = ((value >> 32) & 0xFF);
      write8(address + 4, byteValue);

      byteValue = ((value >> 40) & 0xFF);
      write8(address + 5, byteValue);


      void EEPROMClass::write8(int16_t const address, uint8_t const value)

      Wire.beginTransmission(AT24C32);

      Wire.write(highAddressByte(address));
      Wire.write(lowAddressByte(address));

      Wire.write(value);
      delay(2);
      Wire.endTransmission();



      delay of 2ms is required otherwise EEPROM will write different value. Code has 4 "6-byte" variables(total of 24 bytes). Every byte is minimum 2ms, so total time to save only "6-byte" variables is 48ms(round to 50ms). That is too slow for me. How to speed up write function?







      eeprom






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      SilvioCroSilvioCro

      817




      817




















          2 Answers
          2






          active

          oldest

          votes


















          2














          after writing a value to EEPROM, and terminating the I2C connection with a STOP, the EEPROM enters a self writing mode to write what you have sent to it, to it's internal memory. (you don't actually write the values to the memory section; you write them to a buffer, and then the internal controller writes them to its memory section).



          this "self writing mode" takes about 5ms, and you cant do anything about it. but you can use "page writing" instead of byte writing. that 32K model, has a 32 bytes page buffer. you have to send all the bytes (as long as they are under 32 bytes) at once in one I2C transaction. this time, the chip fills its page buffer and then after a STOP, writes it all at once on its memory. in your code, you just write one byte in your buffer each time in a single transaction. like sending a bus with just one passenger at a time.



          remember in this mode, you only set the address of the first byte. the next bytes automatically settle in the next addresses.






          share|improve this answer






























            1














            Mostly the best speed you get, is if you use the 'page' size, which is 32 bytes. It will take longer than 4 bytes, but less then 4 times 8 bytes.



            You could do a check to see if using one page write (of 32 bytes) is faster than 6 times a one byte write.



            However, it depends if you can change your design so it writes 32 bytes at a time.
            E.g. by writing 60 seconds 4 times 8 bytes (32 bytes) in one page write, instead of every 15 seconds 8 bytes. This will be much faster.






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("schematics", function ()
              StackExchange.schematics.init();
              );
              , "cicuitlab");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "540"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f63364%2fwrite-faster-on-at24c32%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              after writing a value to EEPROM, and terminating the I2C connection with a STOP, the EEPROM enters a self writing mode to write what you have sent to it, to it's internal memory. (you don't actually write the values to the memory section; you write them to a buffer, and then the internal controller writes them to its memory section).



              this "self writing mode" takes about 5ms, and you cant do anything about it. but you can use "page writing" instead of byte writing. that 32K model, has a 32 bytes page buffer. you have to send all the bytes (as long as they are under 32 bytes) at once in one I2C transaction. this time, the chip fills its page buffer and then after a STOP, writes it all at once on its memory. in your code, you just write one byte in your buffer each time in a single transaction. like sending a bus with just one passenger at a time.



              remember in this mode, you only set the address of the first byte. the next bytes automatically settle in the next addresses.






              share|improve this answer



























                2














                after writing a value to EEPROM, and terminating the I2C connection with a STOP, the EEPROM enters a self writing mode to write what you have sent to it, to it's internal memory. (you don't actually write the values to the memory section; you write them to a buffer, and then the internal controller writes them to its memory section).



                this "self writing mode" takes about 5ms, and you cant do anything about it. but you can use "page writing" instead of byte writing. that 32K model, has a 32 bytes page buffer. you have to send all the bytes (as long as they are under 32 bytes) at once in one I2C transaction. this time, the chip fills its page buffer and then after a STOP, writes it all at once on its memory. in your code, you just write one byte in your buffer each time in a single transaction. like sending a bus with just one passenger at a time.



                remember in this mode, you only set the address of the first byte. the next bytes automatically settle in the next addresses.






                share|improve this answer

























                  2












                  2








                  2







                  after writing a value to EEPROM, and terminating the I2C connection with a STOP, the EEPROM enters a self writing mode to write what you have sent to it, to it's internal memory. (you don't actually write the values to the memory section; you write them to a buffer, and then the internal controller writes them to its memory section).



                  this "self writing mode" takes about 5ms, and you cant do anything about it. but you can use "page writing" instead of byte writing. that 32K model, has a 32 bytes page buffer. you have to send all the bytes (as long as they are under 32 bytes) at once in one I2C transaction. this time, the chip fills its page buffer and then after a STOP, writes it all at once on its memory. in your code, you just write one byte in your buffer each time in a single transaction. like sending a bus with just one passenger at a time.



                  remember in this mode, you only set the address of the first byte. the next bytes automatically settle in the next addresses.






                  share|improve this answer













                  after writing a value to EEPROM, and terminating the I2C connection with a STOP, the EEPROM enters a self writing mode to write what you have sent to it, to it's internal memory. (you don't actually write the values to the memory section; you write them to a buffer, and then the internal controller writes them to its memory section).



                  this "self writing mode" takes about 5ms, and you cant do anything about it. but you can use "page writing" instead of byte writing. that 32K model, has a 32 bytes page buffer. you have to send all the bytes (as long as they are under 32 bytes) at once in one I2C transaction. this time, the chip fills its page buffer and then after a STOP, writes it all at once on its memory. in your code, you just write one byte in your buffer each time in a single transaction. like sending a bus with just one passenger at a time.



                  remember in this mode, you only set the address of the first byte. the next bytes automatically settle in the next addresses.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 1 hour ago









                  Tirdad Sadri NejadTirdad Sadri Nejad

                  1512




                  1512





















                      1














                      Mostly the best speed you get, is if you use the 'page' size, which is 32 bytes. It will take longer than 4 bytes, but less then 4 times 8 bytes.



                      You could do a check to see if using one page write (of 32 bytes) is faster than 6 times a one byte write.



                      However, it depends if you can change your design so it writes 32 bytes at a time.
                      E.g. by writing 60 seconds 4 times 8 bytes (32 bytes) in one page write, instead of every 15 seconds 8 bytes. This will be much faster.






                      share|improve this answer



























                        1














                        Mostly the best speed you get, is if you use the 'page' size, which is 32 bytes. It will take longer than 4 bytes, but less then 4 times 8 bytes.



                        You could do a check to see if using one page write (of 32 bytes) is faster than 6 times a one byte write.



                        However, it depends if you can change your design so it writes 32 bytes at a time.
                        E.g. by writing 60 seconds 4 times 8 bytes (32 bytes) in one page write, instead of every 15 seconds 8 bytes. This will be much faster.






                        share|improve this answer

























                          1












                          1








                          1







                          Mostly the best speed you get, is if you use the 'page' size, which is 32 bytes. It will take longer than 4 bytes, but less then 4 times 8 bytes.



                          You could do a check to see if using one page write (of 32 bytes) is faster than 6 times a one byte write.



                          However, it depends if you can change your design so it writes 32 bytes at a time.
                          E.g. by writing 60 seconds 4 times 8 bytes (32 bytes) in one page write, instead of every 15 seconds 8 bytes. This will be much faster.






                          share|improve this answer













                          Mostly the best speed you get, is if you use the 'page' size, which is 32 bytes. It will take longer than 4 bytes, but less then 4 times 8 bytes.



                          You could do a check to see if using one page write (of 32 bytes) is faster than 6 times a one byte write.



                          However, it depends if you can change your design so it writes 32 bytes at a time.
                          E.g. by writing 60 seconds 4 times 8 bytes (32 bytes) in one page write, instead of every 15 seconds 8 bytes. This will be much faster.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 1 hour ago









                          Michel KeijzersMichel Keijzers

                          6,97251939




                          6,97251939



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Arduino Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f63364%2fwrite-faster-on-at24c32%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

                              Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

                              Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»