From 18afa982fa0259a7f8b1a0abdd368b721449099c Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Wed, 10 Jul 2024 19:47:25 +0200 Subject: [PATCH] fix #56, performance sketch --- README.md | 21 +++++++++++++++---- .../testFRAMPerformance.ino | 9 ++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fc4a2e2..92ccc95 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ supports 10^5 write cycles (https://docs.arduino.cc/learn/built-in-libraries/eep That is a factor of 10 million more write cycles. -#### Fujitsu +### Fujitsu Types of FRAM tested with this library: @@ -60,7 +60,7 @@ one calls **setSizeBytes(16 \* 1024)** or **setSizeBytes(8 \* 1024)** to set the For the FRAM9 and FRAM11 the size problem is solved (hard coded) in their class. -#### Ramtron / Cypress / Infineon +### Ramtron / Cypress / Infineon Types of FRAM tested with this library: @@ -71,7 +71,20 @@ Types of FRAM tested with this library: | FM24V10 | 128 KB | Y | | FRAM32 | #49 | -#### Notes +### Codes on the chip - Fujitsu + +The datasheet - MB85RC04_DS501_00057_1v0_E-2329111.pdf - page 20 - provides meaning +to the markings on the FRAM devices. +The meaning of Environment code is unclear. + +``` +RC04: Product name +E11900: E1 (Environment code) + 1900 (Year and Week code) +300: 3 (Factory code) + 00(Trace code) +``` + + +### Notes - Not all types of FRAM are tested. Please let me know if you have verified one that is not in the list. - If there is no deviceID **getSize()** will not work correctly. @@ -84,7 +97,7 @@ Not tested: expect the **MB85RC1MT** can be addressed with 2 instances of **FRAM too with adjacent addresses. -#### Related +### Related - https://github.com/RobTillaart/I2C_EEPROM (eeprom) - https://github.com/RobTillaart/I2C_24LC1025 (eeprom) diff --git a/examples/testFRAMPerformance/testFRAMPerformance.ino b/examples/testFRAMPerformance/testFRAMPerformance.ino index b0341ff..3d97a16 100644 --- a/examples/testFRAMPerformance/testFRAMPerformance.ino +++ b/examples/testFRAMPerformance/testFRAMPerformance.ino @@ -56,27 +56,28 @@ void loop() void testReadWriteLarge() { + int size = 600 * sizeof(int); for (int i = 0; i < 600; i++) ar[i] = i; start = micros(); - fram.write(1000, (uint8_t*)ar, 1200); + fram.write(1000, (uint8_t*)ar, size); stop = micros(); Serial.print("WRITE 1200 bytes TIME: \t"); Serial.print(stop - start); Serial.print(" us ==> \t"); - Serial.print((stop - start) / 1200.0, 2); + Serial.print((stop - start) / (1.0 * size), 2); Serial.println(" us/byte."); delay(100); for (int i = 0; i < 600; i++) ar[i] = 0; start = micros(); - fram.read(1000, (uint8_t*)ar, 1200); + fram.read(1000, (uint8_t*)ar, size); stop = micros(); Serial.print("READ 1200 bytes TIME: \t"); Serial.print(stop - start); Serial.print(" us ==> \t"); - Serial.print((stop - start) / 1200.0, 2); + Serial.print((stop - start) / (1.0 * size), 2); Serial.println(" us/byte."); delay(100);