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.

Counting LOOP time, in PIC

Status
Not open for further replies.

RuH_iranga

Junior Member level 3
Joined
Nov 4, 2010
Messages
31
Helped
7
Reputation
14
Reaction score
6
Trophy points
1,288
Location
sri lanka
Activity points
1,480
Hi
I need to count the loop time(start to end) in milliseconds for each endless loop cycle. I use 18f452 PIC and this loop time is finding to maintain constant loop time in endless loop. Please anyone can give an idea. then I can continue in implement it.

thanks
 

I see 2 options :

1 ) Take a output pin to toogle each time you reach determined poit of program. The result measured at a Frequency-metter is half or real rate F/2.
2 ) If some Timer is still avaliable you can use it to perform account. Once an overflow occurs you must toogle an output pin. The result measured at a Frequency-metter is half of real rate multupyed by Timer magnitude (F/2)*(M). 256 to 8-bit / 65.536 to 16-bit.

+++
 

another technique is to display some start text, execute the test code 1000 times (or more) and display some end text. Using a stopwatch measure the time between the display of the start and end text. You have the overhead of the loop but can meaure that without the test code and subtract it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top