cancel
Showing results for 
Search instead for 
Did you mean: 

About the function of osalThreadDelayMicroseconds.

zeke.huang
Associate III

Hello all,

When I call this function osalThreadDelayMicroseconds(1u), I found that 1us is not implemented, and the actual result is 1ms.

But if you call osalThreadDelayMicroseconds (9000u) it can reach 9ms.

The parameter usec is less than 1000 and is 1ms.

May I ask why I can't achieve 1us?

I used 1000 for system timer tick number:​

0690X000008iV7RQAU.png

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

Hello Zeke ,

Could you confirm your device used ?

As the recommandation, the number of ticks is limited by the system Timer (PIT0) frequency

Do not hesitate to go to the RM in order to check the PIT Limitation.

Best regards

Erwan

View solution in original post

2 REPLIES 2
Erwan YVIN
ST Employee

Hello Zeke ,

Could you confirm your device used ?

As the recommandation, the number of ticks is limited by the system Timer (PIT0) frequency

Do not hesitate to go to the RM in order to check the PIT Limitation.

Best regards

Erwan

Hi Erwn,

Thank you for you reply.

I have confirmed the device used.

I think the system is running at a millisecond level, and it doesn't work through the osalThreadDelayMicroseconds function.

Do you have any better suggestions? Or can you implement subtle delays in assembly language?

Best regards

Zeke