Spark Logic

EEPROM emulator how to use on Maple Mini ?

I want to use EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog emulation on Maple MiniMaple MiniDevelopment and computing boards…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…View in hardware catalog (baite clone).
I find that library given in this topic.

viewtopic.php?f=13&t=274

I have some quaestions over this EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog emulation library.

1.) how to use this library? I looked in example but i got nothing.

2.) i hope this emulation doesn’t write over the original bootloader or deos it?

Replies13

Thu Sep 17, 2015 3:12 pm

		else if (cmd == '1')
{
EEPROM.PageBase0 = 0x801F000;
EEPROM.PageBase1 = 0x801F800;
EEPROM.PageSize  = 0x400;
DisplayConfig();
}
else if (cmd == '2')
{
EEPROM.PageBase0 = 0x801F000;
EEPROM.PageBase1 = 0x801F800;
EEPROM.PageSize  = 0x800;
DisplayConfig();
}

Thu Sep 17, 2015 3:19 pm

As the Maple MiniMaple MiniDevelopment and computing boards…8MHz petertumler Thu Sep 24, 2015 10:58 am Hi, I’m trying to underclock a STM32F103 ( Maple Mini ) to 48MHz (for energy efficiency reasons). According to the datasheet .. The full…View in hardware catalog is a STM32F103RCBT6 (so “RB”) you should use
" 1 set configuration to 0x801F000 / 0x801F800 / 0x400 (RB MCU)\r\n" \

Thu Sep 17, 2015 3:37 pm

Only 10k R/W life? thats not good for me. Microchip PIC32PIC32Microcontrollers and processors…operly. I also found out that some SD-card adapters work better with specific MCU’s ( PIC32 , Tiva-TM4c123, STM32) and some do not. Sounds a little bit esoteric, but I didn’t have…View in hardware catalog , dspic and the other uc, have 100k r/w life. i think i’m gonna buy a SPI or I2C EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog .
Thanks for your response :)

Thu Sep 17, 2015 3:47 pm

If you need much storage (2-4MB) than grab on aliexpress some those winbond w25Q64xxx
I wrote a library for them:
http://www.stm32duino.com/viewtopic.php?f=13&t=9
You need also a smd adapter board for them (total cheap on ali, I have 8 and 16pin boards and I need them all the time)

Thu Sep 17, 2015 3:48 pm

For what is is worth the GD32F103xx claims to have 100k + write cycles – http://www.realsense.com.cn/download/20 … 25_159.pdf page 40 however support for the GD32GD32Microcontrollers and processors…no bootloader and 120MHz clock. RogerClark Mon Feb 22, 2016 8:31 pm I tried to put a GD32 , taken from one board, onto a Maple mini, but my soldering was not good enough, and I ba…View in hardware catalog is still a work in progress.

I suspect that with careful use of the emulated flash, i.e. only writing when absolutely necessary, even 10k cycles is going to be plenty for most use cases, since typically eerom is used for non volatile configuration information. Anything requiring more than a few write cycles per day, and its time to add external storage, or risk premature failure of the product. Back of the envelope calculation suggests 10,000 cycle flash life allows 27 cycles per day for a one year life span, 100,000 allows 270 cycles per day for a one year life span approx (13.5 or 135 per day for 2 year life, 6.7 or 67 per day for a 4 year life etc. for an STM or GD32GD32Microcontrollers and processors…no bootloader and 120MHz clock. RogerClark Mon Feb 22, 2016 8:31 pm I tried to put a GD32 , taken from one board, onto a Maple mini, but my soldering was not good enough, and I ba…View in hardware catalog respectively). These figures also assume you are re-writing the same block every time.

Thu Sep 17, 2015 7:06 pm

The reason to use an EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog is to save pid gains. İf i change these gains every time via programming the board this spend me a lot of time. İ need to configure 9 gain. Only today i change these values 50 times. And can not find any gain usefull yet. For that reason i nees more r/w cycles on an EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog or flash memory. İ bought microchip 24LC512 i2c EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog . its memory is enough for me :) but i should write a code to use them with i2cdevlib, because i use i2cdevlib to use mpu6050 to get dmp data.

Thu Sep 17, 2015 8:20 pm

Exactly for this EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog I have two libraries and example sketches.
Why two libraries?
First one is used with the STM32duino standard “software” I2c, the second one with hardware I2c (“HW” or “hardwire”).
Feel free to use them (hope, I’ve included the original author!)

Thu Sep 17, 2015 8:24 pm

Ok, and here just a simple sketch without library (software I2c):
#include <Wire.h>     // for I2C
#define i2caddr 0x50    // device address for left-hand chip on our breadboard
byte d=0; // data to store in or read from the EEPROM
void setup()
{
Serial.begin(9600); // Initialize the serial line
Serial.println("I2c test");
delay (1000);
Serial.println("Start1");
Wire.begin();         // wake up the I2C
delay (1000);
Serial.println("Start2");
Serial.println("Writing data...");
for (int i=0; i<20; i++)
{
writeData(i,i);
}
Serial.println("DONE");
Serial.println("Reading data...");
for (int i=0; i<20; i++)
{
Serial.print(i);
Serial.print(" : ");
d=readData(i);
Serial.println(d, DEC);
}
Serial.println("DONE");

}

// writes a byte of data in memory location addr
void writeData(unsigned int addr, byte data)
{
Wire.beginTransmission(i2caddr);
// set the pointer position
//Wire.write((int)(addr >> 8));
Wire.write((int)(addr & 0xFF));
Wire.write(data);
Wire.endTransmission();
delay(10);
}

// reads a byte of data from memory location addr
byte readData(unsigned int addr)
{
byte result;
Wire.beginTransmission(i2caddr);
// set the pointer position
//Wire.write((int)(addr >> 8));
Wire.write((int)(addr & 0xFF));
Wire.endTransmission();
Wire.requestFrom(i2caddr,1); // get the byte of data
result = Wire.read();
return result;
}

void loop()
{
}

Wed Oct 21, 2015 12:55 am

I just ran across this. Couldn’t we get more out of it if we rotated the addresses? This will end up being an issue for me, as I need my board to be very small.

Wed Oct 21, 2015 1:28 am

it’s only the write that bumps the counter?
if yes, write a timestamp in the record block, maybe
repeat
write record
until end of eeprom
on subsequent writes, overwrite the oldest record

Sun May 20, 2018 6:57 pm

[z1rqdym – Thu Sep 17, 2015 7:06 pm] –
The reason to use an EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog is to save pid gains. İf i change these gains every time via programming the board this spend me a lot of time. İ need to configure 9 gain. Only today i change these values 50 times. And can not find any gain usefull yet. For that reason i nees more r/w cycles on an EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog or flash memory. İ bought microchip 24LC512 i2c EEPROMEEPROMGeneric components and modules without part numbers…ly bought one of these: … fbb0123c5e It’s really small (50x40mm) but includes an i2c eeprom , and sdcard slot, and all MCU pins broken out. I have still not used it, but plan to u…View in hardware catalog . its memory is enough for me :) but i should write a code to use them with i2cdevlib, because i use i2cdevlib to use mpu6050 to get dmp data.

Since you need to store PID coefficients, I assume you would store those as float values.

If you still want to use flash memory: I had the same question: viewtopic.php?f=28&t=3321
And there is the solution in that topic.

Mon May 21, 2018 5:53 am

It is not necessary to store values such as float, you can store int16, then convert to float
float int_to_float(int16_t input)
{
return (input / 10 + input % 10 * 0.1);
}

Post a reply

Optional · up to 10 MiB