hello, I need a memory to write data from MPU6050 and other sensors and I'm not sure which type of memory to chose. I ll be using ESP32 as the brain. I need the memory to be extremely fast so it's able to write like 15 floats every 20ms (i could skip some cycles to write every 40, 60..ms if necessary) it will be writing for 5-10s and I'll use the chip just a few times. I also need the writing to take as little time as possible ideally about 5ms so the PID control can react fast.
It looks nice but I need the memory next week and I'm not able to get a similar FRAM where I live..
I plan to transfer the data to SD card after the flight so volatile memory would be possible if it would mean higher writing speeds - I cant write to sd while flight due to vibrations
Not sure to what you are referring. But for both I have to say, check the data sheets. I have never used FRAM, but I have seen it recommended for fast non-volatile storage. The SRAM that I used was only like 10 samples a second so I was not running anywhere near full speed.
That's like, glacially slow in microcontroller terms. float = 4 bytes generally, so 15 floats = 60 bytes; let's say you want max. 6ms for that which boils down to 10 kbytes/second. Which was very, very slow back in 1965 when magnetic core memory was used.
Sounds like your ESP32 doesn't need anything added to it do handle this. In fact, it'll be spending 99.9% of its time idling.
The SRAM device suggested by @groundFungus in post #6 should be fine. It's has 128kbytes of storage.
A float uses 4 bytes, so 15 floats is 60 bytes, written every 20ms = 3000 bytes per second. For your 10 second run that's 30,000 bytes - around 1/4 the capacity of the device.
The datasheet says it can be clocked at up to 20MHz and it has zero write time.
A further look at the datasheet and it looks like sequential mode is what you need. The chip auto increment the address for you so you can just write away.
@groundFungus@markd833 I also thought of using this flesh and first reading the data to an array of variables long 256 and once we would start a second array the second core of esp32 would save it to the flesh.
Is it a good way to do it? or is the SRAM better?
I'm not an expert on flash devices, so what follows may be garbage!
There may be times when the flash device is busy committing the data to the flash array. You should check the datasheet to see if that is the case, as it might impact your write speed.