All Projects → RobTillaart → I2C_EEPROM

RobTillaart / I2C_EEPROM

Licence: MIT License
Library for I2C EEPROM - 24LC256

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to I2C EEPROM

miniboot
🏗️ An I2C bootloader for Arduino.
Stars: ✭ 62 (+129.63%)
Mutual labels:  i2c, arduino-library, eeprom
arduino-remote-uploader
Over-the-air arduino programming via xbee, wifi or nordic
Stars: ✭ 31 (+14.81%)
Mutual labels:  arduino-library, eeprom
PCF8591 library
Library to use i2c analog IC with arduino and esp8266. Can read analog value and write analog value with only 2 wire (perfect for ESP-01).
Stars: ✭ 24 (-11.11%)
Mutual labels:  i2c, arduino-library
BME680
Arduino Library to access the Bosch BME680 - temperature, pressure, humidity and gas sensor
Stars: ✭ 30 (+11.11%)
Mutual labels:  i2c, arduino-library
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (+148.15%)
Mutual labels:  i2c, arduino-library
Liquidmenu
Menu creation Arduino library for LCDs, wraps LiquidCrystal.
Stars: ✭ 141 (+422.22%)
Mutual labels:  i2c, arduino-library
arduino-mcp23017
Complete support of MCP23017
Stars: ✭ 44 (+62.96%)
Mutual labels:  i2c, arduino-library
MCP7940
Arduino Library to access the MCP7940M, MCP7940N and MCP7940x Real-Time chips
Stars: ✭ 29 (+7.41%)
Mutual labels:  i2c, arduino-library
gfx demo
GFX Demo for Arduino and the ESP-IDF
Stars: ✭ 63 (+133.33%)
Mutual labels:  i2c, arduino-library
SerialTransfer
Arduino library to transfer dynamic, packetized data fast and reliably via Serial, I2C, or SPI
Stars: ✭ 273 (+911.11%)
Mutual labels:  i2c, arduino-library
Ssd1306
Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
Stars: ✭ 303 (+1022.22%)
Mutual labels:  i2c, arduino-library
PCF8575 library
Library to use i2c digital expander with arduino, esp8266 and esp32. Can read write digital value with only 2 wire (perfect for ESP-01).
Stars: ✭ 28 (+3.7%)
Mutual labels:  i2c, arduino-library
drivers-for-mcu
The driver for the microprocessor
Stars: ✭ 68 (+151.85%)
Mutual labels:  i2c, eeprom
SoftWire
Software I2C implementation for Arduino and other Wiring-type environments
Stars: ✭ 105 (+288.89%)
Mutual labels:  i2c, arduino-library
NvTx
Transactional non volatile storage for Arduino
Stars: ✭ 17 (-37.04%)
Mutual labels:  arduino-library, eeprom
extEEPROM
Arduino library to support external I2C EEPROMs.
Stars: ✭ 111 (+311.11%)
Mutual labels:  arduino-library, eeprom
arduino-sht
Repository for Sensirion humidity and temperature sensor support on Arduino
Stars: ✭ 43 (+59.26%)
Mutual labels:  i2c, arduino-library
hologram-SIMCOM
Easily use any SIMCOM cellular module with Hologram's cloud.
Stars: ✭ 42 (+55.56%)
Mutual labels:  arduino-library
Sim800L-Arduino-Library-revised
HIGH SCHOOL PROJECT - The purpose of this Arduino library is to allow the use of the SIM800L module in a simple and transparent way.
Stars: ✭ 81 (+200%)
Mutual labels:  arduino-library
ShiftRegisterLEDMatrixLib
A library for Arduino that can control LED matrices which use shift registers to manage rows and columns.
Stars: ✭ 32 (+18.52%)
Mutual labels:  arduino-library

Arduino CI Arduino-lint JSON check License: MIT GitHub release

I2C_EEPROM

Arduino Library for external I2C EEPROM - 24LC512, 24LC256, 24LC64/32/16/08/04/02/01.

Description

This library is to access external I2C EEPROM up to 64KB (= 512 Kbit) in size. MicroChip 24LC512, 24LC256, 24LC64, 24LC32, 24LC16, 24LC08, 24LC04, 24LC02, 24LC01 and equivalents.

The I2C_eeprom_cyclic_store interface is documented here

Interface

Constructor

  • I2C_eeprom(uint8_t deviceAddress, TwoWire *wire = &Wire) constructor, optional Wire interface.
  • I2C_eeprom(uint8_t deviceAddress, uint32_t deviceSize, TwoWire *wire = &Wire) constructor, with optional Wire interface.
  • bool begin() initializes the I2C bus and checks if the device is available on the I2C bus.
  • bool begin(uint8_t sda, uint8_t scl) idem for ESP32 / ESP8266 and alike.
  • bool isConnected() test to see if deviceAddress is found on the bus.

Core functions

  • int writeByte(uint16_t memoryAddress, uint8_t value) write a single byte to the specified memory address.
  • int updateByte(uint16_t memoryAddress, uint8_t value) write a single byte, but only if changed. Returns 0 if value was same or write succeeded.
  • int writeBlock(uint16_t memoryAddress, uint8_t * buffer, uint16_t length) write a buffer starting at the specified memory address.
  • int updateBlock(uint16_t memoryAddress, uint8_t * buffer, uint16_t length) write a buffer starting at the specified memory address, but only if changed.
  • int setBlock(uint16_t memoryAddress, uint8_t value, uint16_t length) writes the same byte to length places starting at the specified memory address. Returns 0 if OK.
  • uint8_t readByte(uint16_t memoryAddress) read a single byte from a given address
  • uint16_t readBlock(uint16_t memoryAddress, uint8_t * buffer, uint16_t length) read length bytes into buffer starting at specified memory address. Returns the number of bytes read, which should be length.

Other

  • uint32_t getDeviceSize() idem
  • uint8_t getPageSize() idem
  • uint8_t getPageSize(uint32_t deviceSize) idem
  • uint32_t getLastWrite() idem
  • uint32_t determineSize(bool debug = false) function that determines the size of the EEPROM by detecting when a memory address is folded upon memory address 0. It is based upon the observation that memory wraps around. The debug flag gives some output to Serial.

Warning: this function has changed (again) in 1.4.0

Test results

Type returns Memory Page Size Notes
- 0 connect error, check device address / wiring
24LC512 65536 64 KB 128
24LC256 32768 32 KB 64
24LC128 16384 16 KB 64
24LC64 8192 8 KB 32
24LC32 4096 4 KB 32 not tested with hardware
24LC16 2048 2 KB 16
24LC08 1024 1 KB 16
24LC04 512 512 b 16
24LC02 256 256 b 8
24LC01 128 128 b 8

The function cannot detect smaller than 128 bit EEPROMS.

UpdateBlock()

(new since 1.4.2)

The function updateBlock() reads the block of data and compares it with the new values to see if it needs rewriting.

As the function reads/writes the data in blocks with a maximum length of I2C_BUFFERSIZE (== 30 on AVR limitation). It does this comparison in chunks if the length exceeds this number. The result is that an updateBlock() call can result e.g. in 4 reads and only 2 writes under the hood.

If data is changed often between writes, updateBlock() is slower than writeBlock(). So you should verify if your sketch can make use of the advantages of updateBlock()

ExtraWriteCycleTime (experimental)

(new since 1.5.1)

To improve support older I2C EEPROMs e.g. IS24C16 two functions were added to increase the waiting time before a read and/or write as some older devices have a larger timeout than 5 milliseconds which is the minimum.

  • void setExtraWriteCycleTime(uint8_t ms) idem
  • uint8_t getExtraWriteCycleTime() idem

Limitation

The library does not offer multiple EEPROMS as one continuous storage device.

Future

  • improve error handling, write functions should return bytes written or so.
  • what can we do with the print interface? (investigate)
  • investigate multi-EEPROM storage,
  • investigate smarter strategy for updateBlock() => find first and last changed position could possibly result in less writes.
  • can setBlock use strategies from update

Operational

See examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].