Hello,
iam working on an esp32-s3 project where iam logging ADC data at 1024(points)*50Hz=50000 signals per second. i want to log this data to and SD-card, i have a dual buffer setup so 1 buffer records data and the other buffer can send data to the sd-card. there is no benefits using this dubbel buffer unless i either use a core for data collection and a core for data sending to SD or i use DMA to send the data from the buffer to the SD-card.
Now is the problem, i dont know how to use DMA, i looked online but i can only find people saying they used it and its fast. I also cant find examples in the Arduino IDE so iam kinda stuck.
Could anyone point me in the right direction, or does anyone have an example code that writes data to SD using DMA. Iam still a beginner so lots of documentation/comments would be usefull.
For writing to the SD i use the SdFat library
Google this arduino sd card dma
The software that handles all the SD card work must also, and quite often, READ data from the card before writing new data to the card.
SPI DMA is covered in the Espressif API Documentation. But that's just for raw data transfers. Working with an SD card involves far more than that. For example, there's a file system you'll have to work with. There's also considerations of buffering, sector size, etc.
How many bytes per data point? Do you know that an SD card can keep up with that rate for sustained logging? If not, your write buffers will overflow ... even with double buffering.
two bytes per data point, in the program i write the data to the sd in binary.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.