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.

Timing without timer of uC

Status
Not open for further replies.

AliBahar

Member level 2
Member level 2
Joined
Feb 4, 2015
Messages
42
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
337
Hi every body
I want to create C code for measuring the time of an event without using timers of any particular micro Controller.
can you help me?
 

The C language has no timing statements. You are talking about compiler and processor specific library functions or time related functions of an operation system.
 

You can just increment variable till event happens. This is not very accurate method in C, but you did'nt mentioned the accuracy.
 

The C language has no timing statements. You are talking about compiler and processor specific library functions or time related functions of an operation system.
I know that. I want to create a standard C code which is supportable by all C compilers. so it must be independent from configuration methods of prepherals in CodeVision or Keil and etc.
 

You can just increment variable till event happens. This is not very accurate method in C, but you did'nt mentioned the accuracy.
Besides accuracy considerations, this method isn't independent from compiler and target processor details at all.

The only way to achieve portability of time/timer functions is to define an abstract interface that has to be implemented on the respective target. That's what realtime OS like Free RTOS do.
 

I want to create C code for measuring the time of an event without using timers of any particular micro Controller

The original question should be reformulated, due to even operating under some RTOS, the system much likely would stay still dependant of an internal timer to supply the tick cadency.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top