cancel
Showing results for 
Search instead for 
Did you mean: 

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

FM_360
Associate II

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

2 REPLIES 2
Uwe Bonnes
Principal III

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

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..