cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ System on STM32F103 with fs 100kHz double channel

ChristianPC16
Associate

I need to implement a system with a real and fixed sampling frequency of at least 100kHz, using a STM32F103C8T6, for two analog signals. My main question is: what is the most optimal way to implement this system considering that I also need to do processing of those signals ideally on the same board?. I have just a superficial knowledge about the use of timer triggered interrupts but I don’t know how to implement it correctly for two channels and with this high sample rate.

I would appreciate in advance if you could answer and provide me please with courses, videos, forums or documentation that could help me to implement this project.

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you very much. Do u know where should i put the CDC_Transmit line to send the data buffer by using USB as CDC? i dont know exactly if it should be on the infinite while or in some callback interrupt because it doesnt works on HAL_ADC_ConvCpltCallback function. 

View solution in original post

3 REPLIES 3
TDK
Guru

Convert ADC channels to a buffer using DMA using a timer as a trigger and process those values on the half- and full-complete interrupts. Should be CubeMX examples that use ADC with DMA.

https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Projects/STM3210E_EVAL/Examples/ADC/ADC_Sequencer

 

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

Thank you very much. Do u know where should i put the CDC_Transmit line to send the data buffer by using USB as CDC? i dont know exactly if it should be on the infinite while or in some callback interrupt because it doesnt works on HAL_ADC_ConvCpltCallback function. 

Generally it should be in the main loop. It can work in an interrupt however.

Be aware the call may fail as USB is subject to random delays. Monitor the return value.

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