-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addressing problems #2
Comments
Example: #include < Wire.h > uint16_t writeaddress = 0x10; //Creating object for FRAM chip void setup() { Serial.begin(115200); fram.begin(); result = fram.readByte(writeaddress, &readvalue); result = fram.writeByte(writeaddress, 77); result = fram.writeByte(testaddress, 44); result = fram.readByte(writeaddress, &readvalue); result = fram.readByte(testaddress2, &readvalue); void loop() { |
Hi, I designed the lib for devices with 3 bits salve address and 16 bits memory address. MB85RC16 has no slave adresses and 11 bits memory addresses. The 3 upper bits of the memory address are used as the "salve address" to match the I2C protocol. The lib is not compatible with this device. To address this device, this lib has to be modified widely. I do not have the time nor testing devices to do it right now (not even in the coming months) but if you want to try, I can help you a bit. To better understand the difference between the lib behavior and what the device expects, please have a look on page 8 of datasheets for MB85RC256V and MB85RC16. http://edevice.fujitsu.com/fj/DATASHEET/e-ds/MB85RC256V-DS501-00017-5v1-E.pdf |
To make it easier, the things to modify are :
This should be enougth |
My friend! Thank you very much! I managed to work perfectly. |
Fell free to share your code in order to improve the whole lib. This can be usefull to others :) |
In fact I rushed a little.
|
By the way, can you share the device IDs sent to serial when you have the SERiAL_DEBUG enabled ? |
Starting... I gave up. |
Ok,, this is because the the checkDevice method has a lower limit when outputing the results. At the time I wrote the Lib, 4K & 16K devices were not available. I just added a new example which tries to identify the device for you and get its IDs |
The Result: |
Very strange as we do not have the manufacturer ID = 0x00A. I would recommend to switch the memory chip with a 256K. The lib has been heavily tested against this one (MB85RC256V). https://www.adafruit.com/product/1895 If easy with solder station, you can get the chip alone with a DIP to SOIC adapter for cheaper on ebay or equiv. |
Thank you. |
Just had a mail from Fujitsu's marketing manager. The 16K devices does not have Device IDs implemented. From there, I'll try to add support for the chip in the LIB. |
That good news. |
1.1.0b is ready for testing. If you can deeply test the lib against your device It would be appreciated as I do not have one. |
I testing the FRAM_MB85RC_I2C_manual_mode_simple_write_read example. |
I ran some tests by changing the address where writing and reading are made. |
1.1.0b1 is available for testing. The example now test a byte & a word writing at 0x25 and 0x750 memory slots. |
writeaddress2 = 0x0FA ==OK Starting... |
OK, there was an issue with I2CAddressAdapt() to know about the address translation. The issue seems coming from there ... |
Library modified to find out more :) |
:( Starting... |
This works!!! `#include <Wire.h> #define disk1 0x50 //Address of 24LC256 eeprom chip void setup(void) unsigned int address = 0x7FF; writeEEPROM(disk1, address, 56); void loop(){} void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data ) byte readEEPROM(int deviceaddress, unsigned int eeaddress ) Wire.beginTransmission(deviceaddress); Wire.requestFrom(deviceaddress,1); if (Wire.available()) rdata = Wire.read(); return rdata; |
The working example let me thing your have a 64K device. The working process is not compliant with 16K device's datasheet. Can you change the chipDensity to 64 and run the test ? Despite the KO test at 0x750 memory slot, here below the detailed explanation for a 16K device :
|
I ran a program to list all i2c devices. |
I agree this is weird. Can you just change one line in the "Manual Mode" example ?
Modifying this wil change the way the memory adressing is done by the library. This will be exactly the same as the 24LC256 example you gave 2 days ago. Let me know if this works or not :) |
It worked! But I still do not understand why. Because the chip is 16 not 64. Starting... |
Ok, that sounds better and I'm not falling dummy. Thanks for that. To fully test either this is a 64K or higher chip or not, you just have to run the reworked example. I added a calculation of the second test address according to the chip density. |
It worked. Starting... |
The standard behavior of the chips, according to Datasheet, is last memory slot +1 = first memory slot. If you're not looping, just test some other densities that do not support the Device IDs as mentionned in the readme tables. One thing is clear now : you do not have a MB85RC16 chip but something else. |
Closed |
With MB85RC16 I have exactly same problem as porcao. |
I buy 20 MB85RC16 from USA. void writeEEPROM(uint16_t eeaddress, byte data ) byte readEEPROM(uint16_t eeaddress ) |
i test 4k and 16k fram; latest version; following results: if define chipDensity = 4 or 16; when wr addr <= 255; if define chipDensity = 4 or 16; when wr addr > 255; if define chipDensity = 64 or 256; may difference is in function FRAM_MB85RC_I2C::I2CAddressAdapt |
aha, i got it~~ following graph show when read at address 0x1b0 the mistake is in FRAM_MB85RC_I2C::readArray : Changed to:
enjoy it, thank you~~ |
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
The text was updated successfully, but these errors were encountered: