Skip to main content
Visitor II
May 7, 2021
Question

Microseconds Delay Not Working properly in STM32L072 (Discovery Kit - LoRa WAN)

  • May 7, 2021
  • 2 replies
  • 802 views

I am trying to interface DS18B20 (Temperature Sensor) with STM32L072 using OneWire communication. But not able to generate proper delay.

I have reached some of the solutions but did't worked.

https://community.st.com/s/question/0D53W000003LJZsSAO/micro-sec-delay-with-stm32l0

This solution uses UART and custom HAL, that I cannot use.

https://community.st.com/s/question/0D53W00000UiUVjSAN/interfacing-ds18b20-temperature-sensor-with-stm32wb55-development-board

Please Help If any one have better solution

    This topic has been closed for replies.

    2 replies

    Graduate II
    May 7, 2021

    Delay can only gurantee a minimum timing. Maximum timing can not be guaranteed if interrupts happen. Disable interrupts for the delay.

    Graduate II
    May 7, 2021

    Using a free-running TIM to measure elapsed time should work, so perhaps other issues you need to address, like interrupts, or reducing the prescaler to improve the granularity of the count.

    You'll need to evaluate "not working" into a more specific timing failure you can demonstrate/understand on a scope or logic analyzer.