This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with SAADC examples for audio sampling

I am using nRF52 pca10400 and I would sample some audio signal for short periods of time, but I found a lot of difficulties with the SAADC example from sdk 13, since if I put a value greater than 126 in SAMPLES_IN_BUFFER I get overflow.

image description

I would also increase the sampling frequency by the variable ticks, but the minimum value allowed is 1 [ms] for this variable since it is declared as uint_32. So it means I can reach a maximum sampling frequency of 1kHz (?).

image description

Can I modify in some way the function nrf_drv_timer_ms_to_ticks in order to get a higher sampling frequency?

Thank you.

Parents
  • What exactly do you mean by that you get overflow? Do the logging to UART overflow, or is there some issue with the sampling? There is also a function nrf_drv_timer_us_to_ticks, which can be used for higher sample rates. You can also set the ticks parameter manually, by calculating the desired ticks from the frequency of the timer (16 MHz by default). You can find the documentation of the TIMER peripheral here.

Reply
  • What exactly do you mean by that you get overflow? Do the logging to UART overflow, or is there some issue with the sampling? There is also a function nrf_drv_timer_us_to_ticks, which can be used for higher sample rates. You can also set the ticks parameter manually, by calculating the desired ticks from the frequency of the timer (16 MHz by default). You can find the documentation of the TIMER peripheral here.

Children
No Data
Related