Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
1 us delay generation
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
4 replies
Subscribers
126 subscribers
Views
2246 views
Users
0 members are here
Related
1 us delay generation
Offline
avadhoot kumthekar
over 7 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
Offline
Jerry Fan
over 7 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
Up
0
Down
View discussion
Cancel
Offline
Etienne SOBOLE
over 7 years ago
Note: This was originally posted on 11th May 2011 at
http://forums.arm.com
Maybe you could use the Cycle Counter Register
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344b/Bgbjjhaj.html
I never succed to use it, maybe you'll have more chance !
Cancel
Up
0
Down
View discussion
Cancel
Offline
Martin Weidmann
over 7 years ago
Note: This was originally posted on 11th May 2011 at
http://forums.arm.com
Generating a reliable delay of a given length using a loop is difficult with modern processors, doubly so when running under a rich OS such as Linux. There is just so much going on you don't have control over.
Not done much Linux app development, but can't you use some sort of wait()/sleep() call from the OS?
Cancel
Up
0
Down
View discussion
Cancel
Offline
Marcus Harnisch
over 7 years ago
Note: This was originally posted on 12th May 2011 at
http://forums.arm.com
Not sure if usleep(2) is precise enough.
--
Marcus
Cancel
Up
0
Down
View discussion
Cancel
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Suggested Answer
ARM DStudio can't detect Juno CPU core via DStream
0
219
views
2
replies
Latest
12 days ago
by
QiangHuang
Answered
ds-5 community edition request link
+1
315
views
3
replies
Latest
16 days ago
by
Andy Neil
Answered
ARM Development Studio IDE 2020.1 and DE10-NANO --> Linker and debugging issue
+1
924
views
3
replies
Latest
19 days ago
by
Ronan Synnott
Answered
Errors while importing CCS project into IAR project
+1
Arm Compiler
374
views
1
reply
Latest
19 days ago
by
Andy Neil
Answered
Connecting to multiple cores with command line debugger?
0
DS-5 Debugger
1049
views
2
replies
Latest
22 days ago
by
Alex Earl
<
>
View all questions in Arm Development Studio forum