Microseconds Delay Not Working properly in STM32L072 (Discovery Kit - LoRa WAN)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 5:11 AM
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.
Please Help If any one have better solution
- Labels:
-
STM32Cube MCU Packages
-
STM32L0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 5:28 AM
Delay can only gurantee a minimum timing. Maximum timing can not be guaranteed if interrupts happen. Disable interrupts for the delay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 6:10 AM
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.
Up vote any posts that you find helpful, it shows what's working..
