cancel
Showing results for 
Search instead for 
Did you mean: 

[Proximity Sensor ADC with DMA Problem] I have GP2Y0A41SK0F Sharp for distance measuring sensor. the datasheet says it needs 16.5 ms with 3.7 ms tolerant. for sampling time. So I assumed I need to configure PCLK2 (I use ADC2), ADC Clock Prescaller, ...

Abu Ziyech
Associate

channel sampling, then calculate those parameters until 16.5 ms found. The problem is kinda impossible to get 16.5 ms even I tried to adjust those parameter. anyone has a clue? Iam using STM32F407VGx

1 REPLY 1
Muhammed Güler
Senior III

the mentioned times are required for the sensor to measure the distance and transfer it to the output. You do not need to take samples during this time. You can read whenever you want after waiting for this time without taking a sample at the first boot. or you can use microsecond sample time. you can use AN2834 to find the correct time.

https://www.st.com/resource/en/application_note/cd00211314-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf