Giter VIP home page Giter VIP logo

exteeprom's People

Contributors

jchristensen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exteeprom's Issues

Compatibility with other processors

The change below allows compatibility with other processors like the M0 by using the
Wire.setClock() function to set the I2C bus speed. As TWBR is only available in the smaller AVR processors like the ATmega324P

(there is a pull request for this change by victorpv commented on 10 Sep 2017)

byte extEEPROM::begin(twiClockFreq_t twiFreq)
{
    Wire.begin();
    //TWBR = ( (F_CPU / twiFreq) - 16) / 2;
    Wire.setClock(twiFreq); 	// TRL 21Oct2018, compatibility with other processors
    Wire.beginTransmission(_eepromAddr);
    if (_nAddrBytes == 2) Wire.write(0);      //high addr byte
    Wire.write(0);                            //low addr byte
    return Wire.endTransmission();
}

eep.begin never returns If EEPROM is not connected

Hi, In my use case, EEPROM may not be connected at all times, and when I try to connect it, I cannot make my code continue working if EEPROM is not there to talk with, it stucks at .begin call and doesn't return status field.
Can this behaviour is overridable somehow? Or have anybody fixed this issue on their side?

Wire.requestFrom Error from extEEPROM

Hi. I recently got a new board (FlutterWireless) that uses your library, it is based on SAM3S1A and during compile I get:

In file included from C:\Users\CyberPalin\Documents\Arduino\libraries\extEEPROM\extEEPROM.cpp:56:0:

C:\Users\CyberPalin\AppData\Local\Arduino15\packages\flutter\hardware\sam\0.1.3\libraries\Wire/Wire.h: In member function 'byte extEEPROM::read(long unsigned int, byte*, uint16_t)':

C:\Users\CyberPalin\AppData\Local\Arduino15\packages\flutter\hardware\sam\0.1.3\libraries\Wire/Wire.h:50:10: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)

  uint8_t requestFrom(int, int);

          ^

C:\Users\CyberPalin\AppData\Local\Arduino15\packages\flutter\hardware\sam\0.1.3\libraries\Wire/Wire.h:47:10: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)

  uint8_t requestFrom(uint8_t, uint8_t);

          ^

It doesn't seem to affect anything, but I never know for sure. Any help would be appreciated.

Thanks
Mike

Writing structure in pages...

Hello dear developer. You have got a very good library for working with an external EEPROM. Can you make an example of how to save any structure in the EEPROM no more than a page?

Error compiling example:

byte myData[10];
//write 10 bytes starting at location 42
byte i2cStat = myEEPROM.write(42, &myData, 10);
if ( i2cStat != 0 ) {
	//there was a problem
	if ( i2cStat == EEPROM_ADDR_ERR) {
		//bad address
	}
	else {
		//some other I2C error
	}
}

there are no instances of the overloaded function "extEEPROM :: write", as well as the argument list C / C ++ (304)

fast erase of eeprom area

Hi

i struggled to find a way to erase (ie zero out) eeprom contents page-wise.
i did not find another way than creating a buffer with zeros of the size of the eeprom block i wanted to erase. that'd be a huge waste of memory.

so i copied the ::write function of your lib to ::erase, removed the byte *value parameter and removed the line "values += nWrite; //increment the input data pointer" so the same, only one page wide buffer (in my case 128 bytes) is being written over and over again to the eeprom until all the eeprom area is zeroed out (in my case around 7k!).

please consider adding a fast-erase function to your lib or please point me in the right direction, if I missed something.

thanks!

Compilation error for Arduino Due

When I tried to compile for the Arduino Due:

extEEPROM.cpp:99:7: error: 'TWBR' was not declared in this scope
       TWBR = ( (F_CPU / twiFreq) - 16) / 2;

It compiles if I check if we are on an AVR:

    #ifdef __AVR__
      TWBR = ( (F_CPU / twiFreq) - 16) / 2;
    #endif

However then I think the I2C speed would default to 100kHz (I'm not sure, I'm just starting to use the Arduino Due).

Library validated with Atmel AT24C256C

HI Jack.

I validated your library with the 'Atmel AT24C256C (32k x 8)' component.

I tested it with our 'SmartEverything' board.

It works fine without any changes, if you would like to add it in your README.md
maybe with our Software Company name it would be great.

I also added, in my fork, ( https://github.com/searobin/extEEPROM )
a further example to trigger read and write operations from console,
If you think it could be useful, I can issue a pull request.

add optional i2c pins to begin() function

Hi,

on ESP8266 and probably on other MCUs as well, you can opt in for software (bit banging) i2c just by doing Wire.begin(sda, scl).

please consider adding that to extEEPROM::begin().

Problem with the Example from extEEPROM

i open with winRAR

and see this:

void eeRead(uint8_t chunk)
{
chunk &= 0xFC; //force chunk to be a multiple of 4
uint8_t data[chunk];
uint32_t val = 0, testVal;

Serial << F("Reading...") << endl;

uint32_t msStart = millis();

it looks like ALL Serial.print in the Example are damage!

i can repair it manually but when does it means

Serial.print or Serial.println ?

New fork fails!

Not sure where to vent but Paolo74's fork of your library just showed up in the Arduino IDE as version 3.3.3. My code no longer compiles because the initialization fails to find the enumeration:
ee.begin(twiClock100kHz);
results in:

exit status 1
'twiClock100kHz' was not declared in this scope

Paolo74's fork doesn't allow issues to be raised so I thought I would raise it here. Hope you can forward this on or help explain why the newer library is failing.

Error 9 after 256bytes and read/write not work

----------------
English Google Translate:

Hello,

I used this library that worked perfectly and my growing little by little program.
But now I find myself with mistakes every time.

I instantiate the library in this way "extEEPROM EEPROM( kbits_2, 1, 8 );" for my "ATMEL218 24C02N SU18" (YL-90).
No error is returned by "eeprom.begin( twiClock400kHz )" is when reading or writing, it changes ...

In reading, I have two cases:
 - The reading goes well,
 - I have only "9" errors returned.
This is not random, but it depends on the program that I put on the Arduino.
I add or remove rows and sometimes it works, other times not ...

In writing, I find myself all the time with the "9" error when I exceed the address "255" or I write a sequel that continues to this address, and what has been written before is either false or nothing is written (all at 255 value) ...

byte    eread( unsigned long addr, byte *data, unsigned int len )
{
    byte        stat;

    stat = eeprom.read( addr, data, len );
    if ( stat )
    {
        Serial.print( "read " );
        Serial.print( addr, DEC );
        Serial.print( " -> " );
        Serial.println( stat, DEC );
    }

    return ( stat );
}

byte    ewrite( unsigned long addr, byte *data, unsigned int len )
{
    byte        stat;

    stat = eeprom.write( addr, data, len );
    if ( stat )
    {
        Serial.print( "write " );
        Serial.print( addr, DEC );
        Serial.print( " -> " );
        Serial.println( stat, DEC );
    }

    return ( stat );
}

I can not find a solution, thank you in advance for your help.

----------------
French:

Bonjour,

J'utilisais cette librairie qui fonctionnait parfaitement et mon programme grandissait petit à petit.
Mais maintenant je me retrouve avec des erreurs à chaque fois.

J'instancie la librairie de cette manière "extEEPROM eeprom( kbits_2, 1, 8 );" pour mon "ATMEL218 24C02N SU18" (YL-90).
Aucune erreur n'est retourné par "eeprom.begin( twiClock400kHz );", c'est lors d'une lecture ou écriture, que ça change...

En lecture, j'ai deux cas de figure:

  • La lecture se passe bien,
  • Je n'ai que des erreurs "9" retournées.
    Ce n'est pas aléatoire, mais ça dépend du programme que je met sur l'Arduino.
    J'ajoute, ou enlève des lignes et des fois ça fonctionne, d'autre fois pas...

En écriture, je me retrouve tout le temps avec l'erreur "9" quand je dépasse l'adresse "255" ou que j'écris une suite qui continue sur cette adresse, et ce qui a été écrit avant est soit faux, soit rien ne s'est écrit (tout à la valeur 255)...

byte    eread( unsigned long addr, byte *data, unsigned int len )
{
    byte        stat;

    stat = eeprom.read( addr, data, len );
    if ( stat )
    {
        Serial.print( "read " );
        Serial.print( addr, DEC );
        Serial.print( " -> " );
        Serial.println( stat, DEC );
    }

    return ( stat );
}

byte    ewrite( unsigned long addr, byte *data, unsigned int len )
{
    byte        stat;

    stat = eeprom.write( addr, data, len );
    if ( stat )
    {
        Serial.print( "write " );
        Serial.print( addr, DEC );
        Serial.print( " -> " );
        Serial.println( stat, DEC );
    }

    return ( stat );
}

Je ne trouve pas de solution, merci d'avance pour votre aide.

Potentional endurance problems

Hello,

It should be noted on the library page that the write function implemented (every byte is written separately) could case endurance problems.

For example 24LC256 datasheet clearly states that a byte write will force the entire page to endure a write cycle!

Note: When doing a write of less than 64 bytes,
the data in the rest of the page are
refreshed along with the data bytes being
written. This will force the entire page to
endure a write cycle, for this reason
endurance is specified per page.

Best regards,
amazed

crashes with ESP8266 when writing big amounts of data

Hi

when writing about 10k of data, the ESP8266 randomly resets (software watchdog). I tracked this down to the for loop "//wait up to 50ms for the write to complete" and changed it to this:

for (uint8_t i=50; i; --i) {
            ESP.wdtFeed();
            delay(1);                     //no point in waiting too fast
            communication->beginTransmission(ctrlByte);
            if (_nAddrBytes == 2) communication->write((byte)0);        //high addr byte
            communication->write((byte)0);                              //low addr byte
            txStatus = communication->endTransmission();
            if (txStatus == 0) break;
        }

i read somewhere that the delaymicroseconds thing interferes with the ESP watchdog and so I changed it to delay(1), reduced the loop execution count to 50 and added ESP.wdtFeed();. so far no more resets happening.

Documentation for EEPROM >512k bits

Hi, great library. For EEPROMs >512k bits the chip is connected via A2 and A1 only and A0 is a "not connect". It is important that the chip address in extEEPROM is an even number.

ken

Suggestion for write function

Hello,

Wouldn't it be better if delay was moved after the conditional break?
This way 500us would not be wasted if eeprom write is already complete at the last iteration.

//wait up to 50ms for the write to complete
for (uint8_t i=100; i; --i) {
    //delayMicroseconds(500);                     //no point in waiting too fast
    Wire.beginTransmission(ctrlByte);
    if (_nAddrBytes == 2) Wire.write(0);        //high addr byte
    Wire.write(0);                              //low addr byte
    txStatus = Wire.endTransmission();
    if (txStatus == 0) break;
    delayMicroseconds(500);                     //new place for delay
}

Best regards,
amazed

.write error

Hello @PaoloP74,
First at all, thanks for this great library.

I think there is a problem with .write() method; if external EPPROM is not connected, Arduino gets stuck in that function. Also the same thing with .update() and .read(); they must return error command, but never get stuck.
In my case, it's used in a long time project, and I wanna be sure that if for any reason EEPROM fail, my Arduino aren't not going to be stuck in that function (or restarting using watchdog).

Best regards!

Read/Writes limited by byte

In your readme, you claim "I/O across block, page and device boundaries is supported." However, when attempting to read from a device such as the ST Micro M24M02-02, you can't even get a full page!

It looks like everything is set up in the code properly to handle this, but using a byte to store length ruins it!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.