2021-10-20 01:19 PM
Hello. For a project, I need to read 4 channels analog data and save them in to the sd card for 10 seconds. I should record every data minimum with 750 Hz. And then I generate pwm signal with these data.
I tried that but it was not successful, recording was slow and I was losing some data. So that I decided to use two microcontroller, one of them for data logging and the other one for pwm generating associated with analog input. I agree that this solution is very silly.
I do not know if it is a silly question but I want to ask. Can I do this process (data log with minimum 750 Hz 4 channels and pwm generating associated with recorded analog data) with Nucleo L432 board? Thanks in advance!
2021-10-20 02:52 PM
You should absolutely be able to log data at 750 Hz and store that to a disk. SD card writes are not instantaneous or consistent, so you will need to buffer data and send it out when you have enough stored. For example, save data to a 16kB circular buffer and save the first 8kB to disk when it's populated while the second half is being updated, then save the second half, etc.
2021-10-21 06:11 AM
Thank you for answer. Yes, when I tried I used DMA and buffer. When half of the buffer was fulled, data sent to the sd card module with SPI protocol. But, when the half of the buffer data was sending to the sd card I lost the data. My code is below. Thanks in advance!
2021-10-27 03:45 AM
Hello @Mehmet Çelik ,
Were you able to resolve the issue you described here?
Maybe you problem is related to the known issue in CubeMX v 6.3.0 with DMA initialization (For more detail, please have a look at this post)
It will be interesting to share with us your update please.
Thanks
Imen