STM32L462 delay in a microsecond(us)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-28 10:22 PM
HAL Library provide the HAL_Delay() for millisecond delay. I want to use micro second delay in STM32L4 so how I do it? Is it available in HAL library?
Solved! Go to Solution.
- Labels:
-
STM32Cube MCU Packages
-
STM32L4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-31 4:47 AM
> You can simply do a nop loop
No, You can't.
NOP does nothing. NOP is not necessarily a time-consuming NOP. The processor might remove it from the pipeline before it reaches the execution stage.
Use NOP for padding, for example to place the following instruction on a 64-bit boundary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-31 6:29 AM
Also it doesn't account for time in interrupts
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-08 9:09 PM
I tried the DWT method in my code. It basically works.
However, I have 2 issues:
- The delay time is not so accurate; and does not go linear with input value.
- I wonder if it's OK to call DWT_Delay_Init(void) multiple times.

- « Previous
-
- 1
- 2
- Next »