Skip to main content
Abu Ziyech
Visitor II
February 10, 2022
Question

[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, .

  • February 10, 2022
  • 1 reply
  • 724 views

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

    This topic has been closed for replies.

    1 reply

    Muhammed Güler
    Senior III
    February 10, 2022

    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