Skip to main content
zeke.huang
Associate II
June 12, 2019
Solved

About the function of osalThreadDelayMicroseconds.

  • June 12, 2019
  • 1 reply
  • 935 views

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 topic has been closed for replies.
    Best answer by Erwan YVIN

    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

    1 reply

    Erwan YVIN
    Erwan YVINBest answer
    ST Employee
    June 28, 2019

    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

    zeke.huang
    Associate II
    July 1, 2019

    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