Hi, i have fuond a simple code write 16 byte value into a FRAM chip (fm24cl04b-g).
It work fine, but i have to write 32 byte value, can someone can help me?
I m a newbie ![]()
EepromWrite(0x00, test);
void EepromWrite(uint8_t theMemoryAddress, uint16_t u16Byte)
{
uint8_t lowByte = ((u16Byte) & 0xFF);
// Serial.println(lowByte);
uint8_t highByte = ((u16Byte >> 8) & 0xFF);
//Serial.println(highByte);
Wire.beginTransmission(DEVICEADDRESS);
Wire.write(theMemoryAddress);
Wire.write(lowByte);
Wire.write(highByte);
Wire.endTransmission();
//----------------------------------------------------------------------------
Lettura:
rtest = EepromRead(0x00);
uint16_t EepromRead(uint8_t theMemoryAddress)
{
Wire.beginTransmission(DEVICEADDRESS);
Wire.write(theMemoryAddress);
Wire.endTransmission();
Wire.requestFrom(DEVICEADDRESS,2);
uint8_t lowByte = Wire.read();
uint8_t highByte = Wire.read();
return ((lowByte) & 0xFF) + ((highByte << 8) & 0xFF00);
}
I Know that i have to split a 32 byte valur in 4 8 byte, but i don t know how ?
Thank you.
Regards