Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: eeprom questions teensy 3.6

  1. #1

    eeprom questions teensy 3.6

    hi,

    i am porting some code from arduino micro to teensy 3.6 and i use the eeprom library to store/recall some configuration and calibration data.

    my understanding is that the teensy 3.6 has an emulated eeprom, and my questions are:

    -is there an up/downside to writing and reading bytes instead of ints to the teensy EEPROM, speedwise and memory wise.

    -are all bytes stored as ints anyways? i am using EEPROM.read() and EEPROM.write()

    on arduino EEPROM.read() and write each read/write a byte, but i don't know about teensy.

    thanks for any insights.

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,031
    The Teensy 3.2, 3.5, and 3.6 have a real EEPROM chip. The Teensy LC, 4.0, and 4.1 have emulated the EEPROM in their flash memory.

    Note, you can read/write an entire structure with the EEPROM library (it uses a template for the type). If you use a struct, I believe it does one transfer instead of multiple transfers if you do it as bytes.

  3. #3
    Member
    Join Date
    Nov 2012
    Location
    Portland
    Posts
    62
    Do look into EEPROM Put(); https://www.arduino.cc/en/Tutorial/L...ples/EEPROMPut It only writes when the value would be changed, which helps with EEPROM endurance. Also note that int/word/long writes are better for EEPROM endurance than the equivalent number of byte writes.

    If you have small number of values to save, you can change the backing ratio and up the endurance, per this thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •