Giter Site home page Giter Site logo

sosandroid / fram_mb85rc_i2c Goto Github PK

View Code? Open in Web Editor NEW
56.0 10.0 21.0 147 KB

Arduino library for I2C FRAM - Fujitsu MB85RC & Cypress FM24, CY15B

License: Other

C++ 100.00%
arduino arduino-library fram memory fujitsu cypress ram i2c-fram mb85rc fm24c

fram_mb85rc_i2c's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fram_mb85rc_i2c's Issues

Testing as much memory devices as possible

I need some help to test the memory devices as I do not have all of them.

The strategy:

  • Verifying the device has / has not the Device IDs feature
  • Testing the proper adressing scheme by using Manual Mode example
  • If device has device IDs feature, check if this is recognized by the lib to set it up automatically.
  • Additionnal testing with all the methods of the lib.

Thank you for your help. Fell free to leave your results here

always reading from memory address 0b000XXXXXXXX on <64kb device

datasheet says, when doing the read, you first request write to I2C slave 0x50 | ((MEM_ADDR >> 8) & 0x7), and write MEM_ADDR & 0xFF, then request read from the SAME SLAVE ADDRESS to read the data back.

but in the current implementation, we first transfer the MEM_ADDR by calling FRAM_MB85RC_I2C::I2CAddressAdapt which calculates the correct I2C slave address, but then request read from i2c_addr.
this leads to always reading from 0x000XXXXXX on <64kb devices.

see Palatis@bf7076c for a fix.

Problem with TimerOne

When I use this with TimerOne I get serial output like:

image

Seems the two are incompatible with each other.

When I don't include the FRAM initialization, I have no problems.

Possible typo

This might be correct, but the use of '6' twice looks suspicious:

define ERROR_6 6 // Unused
#define ERROR_7 6 // Fram chip unidentified
#define ERROR_8 8 // Number of bytes asked

If the value for ERROR_7 really is 6 please ignore

1MB device not recognized

I have a Fijitsu MB85RC1MT device soldered to the Adafruit board. The checkDevice code fails, it calls getDeviceIDs and the FRAM is identified correctly but the maxaddress is set to 65536 but the maxadress variable is a uint16_t so the value is actually set to 0 which results in checkDevice failing. In order to get it to work I changed the #define MAXADDRESS_1024 65536 to 65535. THe 512 device probably has the same issue.

Struct limit on the ESP8266?

Hello!
Nice job, congradulations!
I have one issue on the ESP8266, I receive only 32 chars..


Debug

ProductID 0x510
Density code 0x5
Density 256K
Device identfied automatically
...... ...... ......
...... ...... ......
...... ...... ......
mydata :
7
7
8
9
9
10
10
10
11
12
13
13
14
15
15
16
16
16
17
18
18
18
19
19
20
20
20
21
22
22
Init Done - array loaded
...... ...... ......
Calculated address 0x50
Write Done - array loaded in FRAM chip
...... ...... ......
Calculated address 0x50
Read Done - array loaded with read data
...... ...... ......
7
7
8
9
9
10
10
0
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
Read Write test done - check data if successfull
...... ...... ......

did You can try this sample?


code

/**************************************************************************/
/*!
@file FRAM_I2C_store_anything.ino
@author SOSAndroid (E. Ha.)
@license BSD (see license.txt)

Example sketch that stores and retreive any kind of data.

@section  HISTORY

v1.0 - First release
v1.0.1 - fix constructor call error

*/
/**************************************************************************/

#include <Wire.h>
#include <math.h>

#include "C:\Users\Alexandre\OneDrive\PID\FRAM_MB85RC_I2C.h"
#include "C:\Users\Alexandre\OneDrive\PID\FRAM_MB85RC_I2C.cpp"

//define a struct of various data types
typedef struct MYDATA_t {
char SSOM;

char var0;
char var1;

char S1H;
char S1M;
char S1P;
char S1T;

char S2H;
char S2M;
char S2P;
char S2T;

char S3H;
char S3M;
char S3P;
char S3T;

char S4H;
char S4M;
char S4P;
char S4T;

char S5H;
char S5M;
char S5P;
char S5T;

char S6H;
char S6M;
char S6P;
char S6T;

char S7H;
char S7M;
char S7P;
char S7T;

char S8H;
char S8M;
char S8P;
char S8T;

char S9H;
char S9M;
char S9P;
char S9T;

char S10H;
char S10M;
char S10P;
char S10T;

char S11H;
char S11M;
char S11P;
char S11T;

char S12H;
char S12M;
char S12P;
char S12T;

char S13H;
char S13M;
char S13P;
char S13T;

char S14H;
char S14M;
char S14P;
char S14T;

char S15H;
char S15M;
char S15P;
char S15T;

char S16H;
char S16M;
char S16P;
char S16T;

char S17H;
char S17M;
char S17P;
char S17T;

char S18H;
char S18M;
char S18P;
char S18T;

char S19H;
char S19M;
char S19P;
char S19T;

char S20H;
char S20M;
char S20P;
char S20T;

char S21H;
char S21M;
char S21P;
char S21T;

char S22H;
char S22M;
char S22P;
char S22T;

char S23H;
char S23M;
char S23P;
char S23T;

char S24H;
char S24M;
char S24P;
char S24T;

char S25H;
char S25M;
char S25P;
char S25T;

char S26H;
char S26M;
char S26P;
char S26T;

char S27H;
char S27M;
char S27P;
char S27T;

char S28H;
char S28M;
char S28P;
char S28T;

char S29H;
char S29M;
char S29P;
char S29T;

char S30H;
char S30M;
char S30P;
char S30T;

char S31H;
char S31M;
char S31P;
char S31T;

char S32H;
char S32M;
char S32P;
char S32T;

char S33H;
char S33M;
char S33P;
char S33T;

char S34H;
char S34M;
char S34P;
char S34T;

char S35H;
char S35M;
char S35P;
char S35T;

char A1H;
char A1M;
char A1P;
char A1T;

char A2H;
char A2M;
char A2P;
char A2T;

char A3H;
char A3M;
char A3P;
char A3T;

char A4H;
char A4M;
char A4P;
char A4T;

char A5H;
char A5M;
char A5P;
char A5T;

char A6H;
char A6M;
char A6P;
char A6T;

char A7H;
char A7M;
char A7P;
char A7T;

char A8H;
char A8M;
char A8P;
char A8T;

char A9H;
char A9M;
char A9P;
char A9T;

char A10H;
char A10M;
char A10P;
char A10T;
};

//define a struct joining MYDATA_t to an array of bytes to be stored
typedef union MYDATA4I2C_t {
MYDATA_t datastruct;
uint8_t I2CPacket[sizeof(MYDATA_t)];
};

MYDATA4I2C_t mydata; //data to be written in memory
MYDATA4I2C_t readdata; //data read from memory

//random address to write from
uint16_t writeaddress = 0x025;

//Example for mamual mode
uint8_t chipaddress = 0x50;
boolean wp = false; //Allows memory write
int pin = 13;
uint16_t chipDensity = 256; //Just change that value to the density you want : 4, 16, 64, 128, 256, 512 or 1024

//Creating object for FRAM chip
FRAM_MB85RC_I2C mymemory(chipaddress, wp, pin, chipDensity);

void setup() {

Serial.begin(115200);
while (!Serial) ; //wait until Serial ready
Wire.begin();

byte arraySize = sizeof(MYDATA_t);

Serial.println("Starting...");
	
mymemory.begin();

//---------init data - load array
mydata.datastruct.SSOM = 1;

        mydata.datastruct.var0 = 30;
        mydata.datastruct.var1 = 30;

        mydata.datastruct.S1H = 7;
        mydata.datastruct.S1M = 20;
        mydata.datastruct.S1P = 48;
        mydata.datastruct.S1T = 1;

        mydata.datastruct.S2H = 7;
        mydata.datastruct.S2M = 30;
        mydata.datastruct.S2P = 48;
        mydata.datastruct.S2T = 0;

        mydata.datastruct.S3H = 8;
        mydata.datastruct.S3M = 15;
        mydata.datastruct.S3P = 48;
        mydata.datastruct.S3T = 0;

        mydata.datastruct.S4H = 9;
        mydata.datastruct.S4M = 0;
        mydata.datastruct.S4P = 48;
        mydata.datastruct.S4T = 0;

        mydata.datastruct.S5H = 9;
        mydata.datastruct.S5M = 45;
        mydata.datastruct.S5P = 48;
        mydata.datastruct.S5T = 0;

        mydata.datastruct.S6H = 10;
        mydata.datastruct.S6M = 0;
        mydata.datastruct.S6P = 48;
        mydata.datastruct.S6T = 0;

        mydata.datastruct.S7H = 10;
        mydata.datastruct.S7M = 5;
        mydata.datastruct.S7P = 48;
        mydata.datastruct.S7T = 0;

        mydata.datastruct.S8H = 10;
        mydata.datastruct.S8M = 50;
        mydata.datastruct.S8P = 48;
        mydata.datastruct.S8T = 0;

        mydata.datastruct.S9H = 11;
        mydata.datastruct.S9M = 35;
        mydata.datastruct.S9P = 48;
        mydata.datastruct.S9T = 0;

        mydata.datastruct.S10H = 12;
        mydata.datastruct.S10M = 20;
        mydata.datastruct.S10P = 48;
        mydata.datastruct.S10T = 0;

        mydata.datastruct.S11H = 13;
        mydata.datastruct.S11M = 25;
        mydata.datastruct.S11P = 48;
        mydata.datastruct.S11T = 0;

        mydata.datastruct.S12H = 13;
        mydata.datastruct.S12M = 30;
        mydata.datastruct.S12P = 48;
        mydata.datastruct.S12T = 0;

        mydata.datastruct.S13H = 14;
        mydata.datastruct.S13M = 15;
        mydata.datastruct.S13P = 48;
        mydata.datastruct.S13T = 0;

        mydata.datastruct.S14H = 15;
        mydata.datastruct.S14M = 0;
        mydata.datastruct.S14P = 48;
        mydata.datastruct.S14T = 0;

        mydata.datastruct.S15H = 15;
        mydata.datastruct.S15M = 45;
        mydata.datastruct.S15P = 48;
        mydata.datastruct.S15T = 0;

        mydata.datastruct.S16H = 16;
        mydata.datastruct.S16M = 0;
        mydata.datastruct.S16P = 48;
        mydata.datastruct.S16T = 0;

        mydata.datastruct.S17H = 16;
        mydata.datastruct.S17M = 5;
        mydata.datastruct.S17P = 48;
        mydata.datastruct.S17T = 0;

        mydata.datastruct.S18H = 16;
        mydata.datastruct.S18M = 50;
        mydata.datastruct.S18P = 48;
        mydata.datastruct.S18T = 0;

        mydata.datastruct.S19H = 17;
        mydata.datastruct.S19M = 35;
        mydata.datastruct.S19P = 48;
        mydata.datastruct.S19T = 0;

        mydata.datastruct.S20H = 18;
        mydata.datastruct.S20M = 20;
        mydata.datastruct.S20P = 48;
        mydata.datastruct.S20T = 0;

        mydata.datastruct.S21H = 18;
        mydata.datastruct.S21M = 25;
        mydata.datastruct.S21P = 48;
        mydata.datastruct.S21T = 0;

        mydata.datastruct.S22H = 18;
        mydata.datastruct.S22M = 30;
        mydata.datastruct.S22P = 48;
        mydata.datastruct.S22T = 0;

        mydata.datastruct.S23H = 19;
        mydata.datastruct.S23M = 10;
        mydata.datastruct.S23P = 48;
        mydata.datastruct.S23T = 0;

        mydata.datastruct.S24H = 19;
        mydata.datastruct.S24M = 50;
        mydata.datastruct.S24P = 48;
        mydata.datastruct.S24T = 0;

        mydata.datastruct.S25H = 20;
        mydata.datastruct.S25M = 30;
        mydata.datastruct.S25P = 48;
        mydata.datastruct.S25T = 0;

        mydata.datastruct.S26H = 20;
        mydata.datastruct.S26M = 45;
        mydata.datastruct.S26P = 48;
        mydata.datastruct.S26T = 0;

        mydata.datastruct.S27H = 20;
        mydata.datastruct.S27M = 50;
        mydata.datastruct.S27P = 48;
        mydata.datastruct.S27T = 0;

        mydata.datastruct.S28H = 21;
        mydata.datastruct.S28M = 30;
        mydata.datastruct.S28P = 48;
        mydata.datastruct.S28T = 0;

        mydata.datastruct.S29H = 22;
        mydata.datastruct.S29M = 10;
        mydata.datastruct.S29P = 48;
        mydata.datastruct.S29T = 0;

        mydata.datastruct.S30H = 22;
        mydata.datastruct.S30M = 30;
        mydata.datastruct.S30P = 48;
        mydata.datastruct.S30T = 0;

        mydata.datastruct.S31H = 0;
        mydata.datastruct.S31M = 0;
        mydata.datastruct.S31P = 48;
        mydata.datastruct.S31T = 0;

        mydata.datastruct.S32H = 0;
        mydata.datastruct.S32M = 0;
        mydata.datastruct.S32P = 48;
        mydata.datastruct.S32T = 0;

        mydata.datastruct.S33H = 0;
        mydata.datastruct.S33M = 0;
        mydata.datastruct.S33P = 48;
        mydata.datastruct.S33T = 0;

        mydata.datastruct.S34H = 0;
        mydata.datastruct.S34M = 0;
        mydata.datastruct.S34P = 48;
        mydata.datastruct.S34T = 0;

        mydata.datastruct.S35H = 0;
        mydata.datastruct.S35M = 0;
        mydata.datastruct.S35P = 48;
        mydata.datastruct.S35T = 0;

        mydata.datastruct.A1H = 7;
        mydata.datastruct.A1M = 20;
        mydata.datastruct.A1P = 48;
        mydata.datastruct.A1T = 0;

        mydata.datastruct.A2H = 7;
        mydata.datastruct.A2M = 30;
        mydata.datastruct.A2P = 48;
        mydata.datastruct.A2T = 0;

        mydata.datastruct.A3H = 8;
        mydata.datastruct.A3M = 15;
        mydata.datastruct.A3P = 48;
        mydata.datastruct.A3T = 0;

        mydata.datastruct.A4H = 9;
        mydata.datastruct.A4M = 0;
        mydata.datastruct.A4P = 48;
        mydata.datastruct.A4T = 0;

        mydata.datastruct.A5H = 9;
        mydata.datastruct.A5M = 45;
        mydata.datastruct.A5P = 48;
        mydata.datastruct.A5T = 0;

        mydata.datastruct.A6H = 10;
        mydata.datastruct.A6M = 0;
        mydata.datastruct.A6P = 48;
        mydata.datastruct.A6T = 0;

        mydata.datastruct.A7H = 10;
        mydata.datastruct.A7M = 5;
        mydata.datastruct.A7P = 48;
        mydata.datastruct.A7T = 0;

        mydata.datastruct.A8H = 10;
        mydata.datastruct.A8M = 50;
        mydata.datastruct.A8P = 48;
        mydata.datastruct.A8T = 0;

        mydata.datastruct.A9H = 11;
        mydata.datastruct.A9M = 35;
        mydata.datastruct.A9P = 48;
        mydata.datastruct.A9T = 0;

        mydata.datastruct.A10H = 12;
        mydata.datastruct.A10M = 20;
        mydata.datastruct.A10P = 48;
        mydata.datastruct.A10T = 0;
Serial.println("...... ...... ......");

Serial.println(" mydata :");
Serial.println(mydata.datastruct.S1H,DEC);
Serial.println(mydata.datastruct.S2H,DEC);
Serial.println(mydata.datastruct.S3H,DEC);
Serial.println(mydata.datastruct.S4H,DEC);
Serial.println(mydata.datastruct.S5H,DEC);
Serial.println(mydata.datastruct.S6H,DEC);
Serial.println(mydata.datastruct.S7H,DEC);
Serial.println(mydata.datastruct.S8H,DEC);
Serial.println(mydata.datastruct.S9H,DEC);
Serial.println(mydata.datastruct.S10H,DEC);
Serial.println(mydata.datastruct.S11H,DEC);
Serial.println(mydata.datastruct.S12H,DEC);
Serial.println(mydata.datastruct.S13H,DEC);
Serial.println(mydata.datastruct.S14H,DEC);
Serial.println(mydata.datastruct.S15H,DEC);
Serial.println(mydata.datastruct.S16H,DEC);
Serial.println(mydata.datastruct.S17H,DEC);
Serial.println(mydata.datastruct.S18H,DEC);
Serial.println(mydata.datastruct.S19H,DEC);
Serial.println(mydata.datastruct.S20H,DEC);
Serial.println(mydata.datastruct.S21H,DEC);
Serial.println(mydata.datastruct.S22H,DEC);
Serial.println(mydata.datastruct.S23H,DEC);
Serial.println(mydata.datastruct.S24H,DEC);
Serial.println(mydata.datastruct.S25H,DEC);
Serial.println(mydata.datastruct.S26H,DEC);
Serial.println(mydata.datastruct.S27H,DEC);
Serial.println(mydata.datastruct.S28H,DEC);
Serial.println(mydata.datastruct.S29H,DEC);
Serial.println(mydata.datastruct.S30H,DEC);
Serial.println("Init Done - array loaded");
Serial.println("...... ...... ......");

//----------write to FRAM chip
byte result = mymemory.writeArray(writeaddress, arraySize, mydata.I2CPacket);

if (result == 0) Serial.println("Write Done - array loaded in FRAM chip");
if (result != 0) Serial.println("Write failed");
Serial.println("...... ...... ......");

//---------read data from memory chip
result = mymemory.readArray(writeaddress, arraySize, readdata.I2CPacket);
if (result == 0) Serial.println("Read Done - array loaded with read data");
if (result != 0) Serial.println("Read failed");
Serial.println("...... ...... ......");

//---------Send data to serial

 Serial.println(readdata.datastruct.S1H,DEC);
 Serial.println(readdata.datastruct.S2H,DEC);
 Serial.println(readdata.datastruct.S3H,DEC);
 Serial.println(readdata.datastruct.S4H,DEC);
 Serial.println(readdata.datastruct.S5H,DEC);
 Serial.println(readdata.datastruct.S6H,DEC);
 Serial.println(readdata.datastruct.S7H,DEC);
 Serial.println(readdata.datastruct.S8H,DEC);
 Serial.println(readdata.datastruct.S9H,DEC);
 Serial.println(readdata.datastruct.S10H,DEC);
 Serial.println(readdata.datastruct.S11H,DEC);
 Serial.println(readdata.datastruct.S12H,DEC);
 Serial.println(readdata.datastruct.S13H,DEC);
 Serial.println(readdata.datastruct.S14H,DEC);
 Serial.println(readdata.datastruct.S15H,DEC);
 Serial.println(readdata.datastruct.S16H,DEC);
 Serial.println(readdata.datastruct.S17H,DEC);
 Serial.println(readdata.datastruct.S18H,DEC);
 Serial.println(readdata.datastruct.S19H,DEC);
 Serial.println(readdata.datastruct.S20H,DEC);
 Serial.println(readdata.datastruct.S21H,DEC);
 Serial.println(readdata.datastruct.S22H,DEC);
 Serial.println(readdata.datastruct.S23H,DEC);
 Serial.println(readdata.datastruct.S24H,DEC);
 Serial.println(readdata.datastruct.S25H,DEC);
 Serial.println(readdata.datastruct.S26H,DEC);
 Serial.println(readdata.datastruct.S27H,DEC);
 Serial.println(readdata.datastruct.S28H,DEC);
 Serial.println(readdata.datastruct.S29H,DEC);
 Serial.println(readdata.datastruct.S30H,DEC);    

Serial.println("Read Write test done - check data if successfull");
Serial.println("...... ...... ......");	

}

void loop() {
// nothing to do
}

wrong comment

FRAM_MB85RC_I2C.h line 76 has a wrong comment.
Should read: #define DENSITY_MB85RC256V 0x05 // 256K

Cypress FM24C04B multiple issues

This FRAM is being used with this library
Issue 1 in Simple Read Write sketch from examples
Compile error "FRAM_I2C_simple_write_read:52:21: error: request for member 'writeByte' in 'mymemory', which is of non-class type 'FRAM_MB85RC_I2C()'"
Issue 2 None of the other sketches return values or report failed to write and read
Nick Gammons Address finder sketch does not find devices. Some of the FRAM sketches appear to find device on 0x50.
As reported in a previous issue, the chip does work with the Arduino IDE EEPROM examples and successfully clears, writes and reads, so as far as I know, chip not faulty and wiring correct.
Any thoughts please?

Storing a String or DateTime type in FRAM

Hi!
Is it possible to store Strings or DateTime type(from Arduino RTClib) in FRAM?
Can someone share a code snippet that does that? I tried to edit "store anything" example, but adding a String type variable to a struct:
typedef struct MYDATA_t { bool data_0; float data_1; long data_2; int data_3; byte data_4; String log; };

Is causing compilation error:
FRAM_I2C_store_anything:38:14: error: use of deleted function 'MYDATA4I2C_t::MYDATA4I2C_t()' MYDATA4I2C_t mydata; //data to be written in memory ^ /var/folders/5h/7rxp3rmn5351zh6r8cxhz1sr0000gn/T/arduino_modified_sketch_254966/FRAM_I2C_store_anything.ino:33:15: note: 'MYDATA4I2C_t::MYDATA4I2C_t()' is implicitly deleted because the default definition would be ill-formed: typedef union MYDATA4I2C_t { ^ FRAM_I2C_store_anything:34:11: error: union member 'MYDATA4I2C_t::datastruct' with non-trivial 'MYDATA_t::MYDATA_t()' MYDATA_t datastruct; ^ FRAM_I2C_store_anything:39:14: error: use of deleted function 'MYDATA4I2C_t::MYDATA4I2C_t()' MYDATA4I2C_t readdata; //data read from memory ^ /var/folders/5h/7rxp3rmn5351zh6r8cxhz1sr0000gn/T/arduino_modified_sketch_254966/FRAM_I2C_store_anything.ino: In function 'void __static_initialization_and_destruction_0(int, int)': FRAM_I2C_store_anything:39:14: error: use of deleted function 'MYDATA4I2C_t::~MYDATA4I2C_t()' /var/folders/5h/7rxp3rmn5351zh6r8cxhz1sr0000gn/T/arduino_modified_sketch_254966/FRAM_I2C_store_anything.ino:33:15: note: 'MYDATA4I2C_t::~MYDATA4I2C_t()' is implicitly deleted because the default definition would be ill-formed: typedef union MYDATA4I2C_t { ^ FRAM_I2C_store_anything:34:11: error: union member 'MYDATA4I2C_t::datastruct' with non-trivial 'MYDATA_t::~MYDATA_t()' MYDATA_t datastruct; ^ FRAM_I2C_store_anything:38:14: error: use of deleted function 'MYDATA4I2C_t::~MYDATA4I2C_t()' MYDATA4I2C_t mydata; //data to be written in memory ^ exit status 1 use of deleted function 'MYDATA4I2C_t::MYDATA4I2C_t()'

FM24C64-G not recognized

Hi!

I just got a few FM24C64-G chips from AliExpress:
https://www.aliexpress.com/item/1PCS-Fm24c64-g-fm24c64-24c64b-24C64-G-SOP8/32832467105.html

According to its datasheet (http://www.farnell.com/datasheets/305351.pdf), the pinout is the exact same as an EEPROM, so I wired it to an Arduino UNO following this diagram:
http://www.connduino.com/sites/default/files/pictures/programming_eeprom/EEPROM%20connect_bb.png

The problem is that the FRAM is not recognized by the library.
When I run FRAM_I2C_readIDs.ino I get:

Starting...
....... .......
FRAM Device IDs
Manufacturer 0xFFF
ProductID 0xFFF
Density code 0xF
...... ...... ......

When I run FRAM_I2C_simple_write_read.ino I get:

Starting...
FRAM_MB85RC_I2C object created
I2C device address 0x50
WP pin number 13
Write protect management: false
Memory Chip NOT FOUND
...... ...... ......
1st test
Writing at location 0x25
Writing...
Reading...
Written value 0xBE
Read value 0x0
Write Byte test : NOT OK
.... ....
Manufacturer 0xFFF
DensityCode 0xF
Density 0

The strange part is that I have tested writing to the module as if it were an external EEPROM memory and it works!
This is the code I tested: https://bitbucket.org/Electricks/arduiono_sketches/src/d4a242e5b1cdebb4c38a5d93fbd5d17411abe3c4/EEPROM/EEPROM.ino

Any ideas?
Thanks!

Which is the recommended stable release or commit?

Most recent release tag in the repository is v1.2.1 (Mar 9, 2018), however there are more recent commits.
Which one do you recommended? The release tagged 1.2.1 or cloning the latest commit?
Thank you!

FM24C04B problem

Hi, I have connected FM24C04B.
i2c scanner shows me this addresses:

01:07:29.324 -> I2C device found at address 0x50
01:07:29.324 -> I2C device found at address 0x51

but I have only one chip connected to Arduino.
Which address should I use?
Library in debug mode shows me:

01:10:14.034 > FRAM
01:10:14.055 > FRAM_MB85RC_I2C object created
01:10:14.055 > I2C device address 0x50
01:10:14.055 > WP pin number 13
01:10:14.055 > Write protect management: true
01:10:14.055 > Memory Chip NOT FOUND
01:10:14.055 > ...... ...... ......

Thank's for help, reply, etc.

problem reading\writing FM24C04

hi. Try use lib with FM24C04.
I found that first 255 bytes writing and reading correct.
Another 255 bytes writing and reading incorrect.
init string
FRAM_MB85RC_I2C mymemory(0x50, false, 21, 4);

image

Addressing problems

I'm doing some tests using MB85RC16.
I have managed to make the examples work perfectly.
But if I include a new recording at another address he always writes at the beginning where the previous recording was made. This seeming it uses not the last address, and always use the same address for any recording I do.
I tried now record two numbers in two memory locations. But every recording is made and read from the same address.
If we try to read one byte, for example, a completely different place it always returns me first byte that is written at the beginning of the memory.
Ex.: fram.readByte (0x50, & readValue);
Tks

FM24V10 not recognized

I tested the library with a Cypress FM24V10 and the device is not recognized. The debug output reports "Chip not found".

I made sure the chip is working, by talking to it through the Wire library (not using this library). I can successfully read and write bytes. The device ID returned by the chip is 0x004400.

How to use Wire1

I am trying to get the 128Kbit fuji fram working with your library but I am on Wire1 bus. In your library.cpp file I have tried to change Wire to Wire1 and WP pin from 13 to 21 but I still get Memory Chip NOT FOUND (write/read fails). I am using your simple_write_read example. Is there a way to use Wire1 with your library?

Starting...
FRAM_MB85RC_I2C object created
I2C device address 0x50
WP pin number 21
Write protect management: true
Memory Chip NOT FOUND
...... ...... ......
1st test
Writing at location 0x25
Writing...
Reading...
Written value 0xBE
Read value 0x0
Write Byte test : NOT OK
.... ....
Manufacturer 0xFFF
DensityCode 0xF
Density 0

Build Error on Example

IDE: Arduino 1.8.9
Board: AdaFruit Feather M0
Example: FRAM_I2C_simple_write_read

FRAM_I2C_simple_write_read:44:11: error: request for member 'begin' in 'mymemory', which is of non-class type 'FRAM_MB85RC_I2C()'

mymemory.begin();

       ^

FRAM_I2C_simple_write_read:52:21: error: request for member 'writeByte' in 'mymemory', which is of non-class type 'FRAM_MB85RC_I2C()'

resultw = mymemory.writeByte(writeaddress, writevalue);

add an example for working with 1Mbit Devices ?

it is stated:

1M devices are in fact managed as 2 512 devices from lib point of view > create 2 instances of the object with each a differnt address

is it possible to add example code for that, just to show how to do it the right way ?


is it planned to overcome this limitation for 1Mbit (or greater) devices in future,
so that it is not needed anymore to create 2 instances,
but everything that is needed (special addressing and so on) is done internally within the library already ?

Emulation of Arduino EEPROM library

Nice package, works great but would be nice to have it also emulate the Arduino EEPROM library, this would make it easy just to replace it with this package with an external FRAM without any modification...

just a thought...

Test FM24C04B-G

FM24C04B-G

Starting...
FRAM_MB85RC_I2C object created
I2C device address 0x50
WP pin number 13
Write protect management: false
Memory Chip initialized
FRAM Device IDs
Manufacturer 0xF00
ProductID 0xF00
Density code 0xF00
Density 4K
Device properties set
...... ...... ......
...... ...... ......
1st test
Writing at location 0x25
Writing...
Calculated address 0x0
Reading...
Calculated address 0x0
Written value 0xBE
Read value 0xBE
Write Byte test : OK
.... ....
2nd test
Writing at location 0x1B0
Writing...
Calculated address 0x0
Reading...
Calculated address 0x0
Written value 0xBEEF
Read value 0xBEEF
Write word test : OK
.... ....
Manufacturer 0xF00
DensityCode 0xF00
Density 4

FM24V05-G

FM24V05

Starting...
....... .......
FRAM Device IDs
Manufacturer 0xD5A
ProductID 0xC69
Density code 0xC

Starting...
FRAM_MB85RC_I2C object created
I2C device address 0x50
WP pin number 13
Write protect management: false
Memory Chip NOT FOUND
...... ...... ......

Starting...
FRAM_MB85RC_I2C object created
I2C device address 0x50
WP pin number 13
Write protect management: false
Memory Chip NOT FOUND
...... ...... ......
Data_0: true
Data_1: 1.3574999570
Data_2: 314159
Data_3: 142
Data_4: 0x50
...... ...... ......
Init Done - array loaded
...... ...... ......
Write failed
...... ...... ......
Read failed
...... ...... ......
Data_0: false
Data_1: 0.0000000000
Data_2: 0
Data_3: 0
Data_4: 0x0
...... ...... ......
Read Write test done - check data if successfull
...... ...... ......

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.