cancel
Showing results for 
Search instead for 
Did you mean: 

Does HAL Provides a Delay Function for One Micro Second?

Chao
Senior

Hi,

I am looking for a delay function for  1 us, HAL_Delay provides 1 ms, is there one in HAL or somewhere else?

Regards

Chao

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @Chao 

HAL_Delay is able to provide minimum 1 ms delay, but when it comes to microseconds, there isn’t any predefined function to create 1 us delay in HAL Library. You have to create your own function. You can do that using a Timer for example you can refer to this post.

Best Regards.

STTwo-32 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
STTwo-32
ST Employee

Hello @Chao 

HAL_Delay is able to provide minimum 1 ms delay, but when it comes to microseconds, there isn’t any predefined function to create 1 us delay in HAL Library. You have to create your own function. You can do that using a Timer for example you can refer to this post.

Best Regards.

STTwo-32 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Pavel A.
Evangelist III

Actually HAL_Delay (as implemented) cannot even do  a 1 ms delay... but one can provide better implementations.