cancel
Showing results for 
Search instead for 
Did you mean: 

ADC setting for audio input

cwwk
Associate

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.

0693W00000KcnM2QAJ.png This is the graph from the value I got from IDE after pausing in debug which looks nothing like result from CubeMonitor.

0693W00000KcnPzQAJ.png 

I am currently using the STM32F411E-DISCOVERY and my current ADC setting is as below

0693W00000KcnTXQAZ.png0693W00000KcnQUQAZ.png 

I can't figure out where went wrong.

I'm still new to MCU and stuff so any help is much appreciated :)

1 ACCEPTED SOLUTION

Accepted Solutions
stephane.legargeant
ST Employee

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

View solution in original post

2 REPLIES 2
stephane.legargeant
ST Employee

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

cwwk
Associate

Thanks. It seems that lowering the ADC speed solves the issue.