Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
1 us delay generation
Jump...
Cancel
Locked
Locked
Replies
4 replies
Subscribers
119 subscribers
Views
3596 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
1 us delay generation
avadhoot kumthekar
over 12 years ago
Note: This was originally posted on 11th May 2011 at
http://forums.arm.com
Dear all,
I am using Linux OS with arm-elf tool chain. I am not able to generate 1 us delay using 'for loop' method of 'C' programming language.Is there anything that i can try?
thanks & regards
Avadhoot
Parents
Jerry Fan
over 12 years ago
Note: This was originally posted on 11th May 2011 at
http://forums.arm.com
sleep() can be used to get delay, but the accuracy is poor, almost 1ms, that is the tick of the linux system. So 1us can not be got by sleep() Cycle conter has a much high accuracy, that is the 1/CPU_freq. But the problem is that if "WFI" was used, for example, the idle task may use that instruction in some RTOS, the CPU will suspend, that is the cycle conter was supend. If "WFI" instruction was not used in Linux, cycle counter is a good way to delay 1us. I think some system API can be called to do that.
Cancel
Vote up
0
Vote down
Cancel
Reply
Jerry Fan
over 12 years ago
Note: This was originally posted on 11th May 2011 at
http://forums.arm.com
sleep() can be used to get delay, but the accuracy is poor, almost 1ms, that is the tick of the linux system. So 1us can not be got by sleep() Cycle conter has a much high accuracy, that is the 1/CPU_freq. But the problem is that if "WFI" was used, for example, the idle task may use that instruction in some RTOS, the CPU will suspend, that is the cycle conter was supend. If "WFI" instruction was not used in Linux, cycle counter is a good way to delay 1us. I think some system API can be called to do that.
Cancel
Vote up
0
Vote down
Cancel
Children
No data