2023-09-20 04:54 AM
Hi, I am new to STM32. I have a STM32H723 nuncleo board where I want to sample 8 bit data from the on-board ADC at the maximum frequency of 3.6 MHz. Then I want to directly transfer the data to a SD card using DMA with SPI. Preferably I would want to add a timestamp to each sample, where this can get tricky to combine with the use of DMA.
ADC -> Memory + adding timestamp (As a buffer)
Memory -> micro SD card
I need some tips and tricks how to do this, and if it is even possible to do at these speeds.
Thanks for all answers!
Solved! Go to Solution.
2023-09-20 05:47 AM
It's possible but microsd communication is subject to delays, so you'll need to buffer data and due to the speed, you will quickly run out of data.
With a 256 kB buffer, you'll run out in about 70 ms. There is no guarantee that the microsd card won't stall for longer than this, but it should work most of the time.
2023-09-20 05:18 AM
so you want write about 30Mbit continuous data stream to SD.
why this frequency ? when stop data ? will be many MB in view seconds...
well, SD in 4-bit mode, at max. 50 mbit - could work.
but writing "timestamp" ...maybe too much delay; just try it !
2023-09-20 05:41 AM
Yes, 4-bit might be enough for the application. The data should be sampled based on some trigger signals, and stop on another trigger. Normally lasting less than 100 ms.
8 bit X 3.6 MHz = 28.8 Mbps
However the interval of the timestamps is not decided yet, but is preferred to be with about 100 ns precision with every sample, but could be done less frequently to fit with the maximum data rate.
2023-09-20 05:42 AM
This frequency because the signal to sample is at 500 kHz.
2023-09-20 05:47 AM
It's possible but microsd communication is subject to delays, so you'll need to buffer data and due to the speed, you will quickly run out of data.
With a 256 kB buffer, you'll run out in about 70 ms. There is no guarantee that the microsd card won't stall for longer than this, but it should work most of the time.
2023-09-20 05:58 AM
so 100ms sampling - and pause, how long ?
100ms at 3,6M -> 360KB ---> store in internal ram ! then write relaxed with time stamp info to SD .
H723 has 432KB ram, so no problem.