2022-03-16 01:30 AM
I am trying to create a simple guitar tuner using FFT but currently I am stuck at getting the correct ADC value.
When I tried passing 10Hz sine wave into my MCU, this is what I got from CubeMonitor which looks fine to me.
This is the graph from the value I got from IDE after pausing in debug which looks nothing like result from CubeMonitor.
I am currently using the STM32F411E-DISCOVERY and my current ADC setting is as below
I can't figure out where went wrong.
I'm still new to MCU and stuff so any help is much appreciated :)
Solved! Go to Solution.
2022-04-14 03:02 AM
Hello
Looking at CubeMonitor chart, it seems that value in adc_buf[0] is updated with all values. In the IDE view, the result in the buffer is strange. I guess you want to store the samples in the adc_buf array ? In this case, we should no see the nice curve in cubeMonitor when looking only adc_buf[0],
May be only the adc_buf[0] is udpated ? You should try to check other values (ie adc_buf[1] ) with cube monitor. It could be an issue in the DMA / ADC configuration : MThe number of sample to transfer for DMA may be not correct or ???. Checking the rest of the buffer with CubeMonitor can help.
Best regards
Stephane
2022-04-14 03:02 AM
Hello
Looking at CubeMonitor chart, it seems that value in adc_buf[0] is updated with all values. In the IDE view, the result in the buffer is strange. I guess you want to store the samples in the adc_buf array ? In this case, we should no see the nice curve in cubeMonitor when looking only adc_buf[0],
May be only the adc_buf[0] is udpated ? You should try to check other values (ie adc_buf[1] ) with cube monitor. It could be an issue in the DMA / ADC configuration : MThe number of sample to transfer for DMA may be not correct or ???. Checking the rest of the buffer with CubeMonitor can help.
Best regards
Stephane
2022-04-20 05:38 PM
Thanks. It seems that lowering the ADC speed solves the issue.