cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 - ADC to micro SD card with sampling frequency of 3.6 MHz possible?

elso
Associate III

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!

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
AScha.3
Chief II

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 !

If you feel a post has answered your question, please click "Accept as Solution".

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.

This frequency because the signal to sample is at 500 kHz. 

TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.

If you feel a post has answered your question, please click "Accept as Solution".