Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to implement 1us delay in Linux?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
Hello all,

The Linux's timer tick resolution is 1ms, and how to implement 1us delay in Linux, by hardware or by software?

DAVY
 

u can set by software also. but it is risk process.
u can try by software first
 

Hi,

If you are working on an Intel Pentium class workstation, you can use the assembler instruction "rdtsc", which enables you to read a hardware counter running at cpu clock cycle speed.

You can write a assembler routine which reads this counter and loops until it reach a value corresponding to the delay you need.

See this pdf to see how to access this counter :

h**p://www.eecg.toronto.edu/~de/RDTSCPM1.pdf


Replace * by t
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top