Arduino - Wire.h - EEPROM - wiite data issue

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

I am using the Wire.h library and connecting to a 24LC04 EEPROM.  The HW is a UNO. 

I am surprised that on writing data I get a wrap around effect after 16 bytes.

 

I use code like;

 Wire.beginTransmission( EEPROMId_plus_page );

 Wire.write( (int) lowbyte(address_byte) );

 Wire.write( datapointer, len );

 

If the address is 0x0f and the data string is 0x01, 0x02, 0x03 etc., then I get 0x01 into address 0x0f, but the next byte (0x02) goes to 0x00 address.

My expectation is that I would continue to populate address 0x10 for the second data byte.

This is my normal expectation using other tools writing on this EEPROM.  In fact with the other tool I do not see this wrap around until I has exhausted the page boundary.

The address range is 0 .. 0xff (within a page).

 

I trust someone out there has the experience to put me at ease ??

 

Regards JC.......

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are seeing this because you have hit a page boundary (page size for this device is 16 bytes not 256 bytes).

github.com/apcountryman/build-avr-gcc: a script for building avr-gcc

github.com/apcountryman/toolchain-avr-gcc: a CMake toolchain for cross compiling for the Atmel AVR family of microcontrollers