Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

need help in calculating execution time

Status
Not open for further replies.

kinsiro

New Member
hi, i m using pic16f84a in my project.. i need to know how to calculate the execution time in PICBasicPro.. can any1 teach me..
i m using the following instructions:

if...then
endif
pulsin
pulsout
pauseus
high
low
x = y

thx..
 
Not possible for any compiled language. Now if you're building a clock or whatever, counting instructions can be a difficult way to write code more than a few lines. You can't add or remove lines without affecting the timing, and loops of variable length and/or conditional branching won't use constant timing.

You can time simple bus protocols (like serial comm, i2c, SPI) by number of instructions. But for many applications you want to set up a timer and use interrupts.
 
kinsiro said:
hi, i m using pic16f84a in my project.. i need to know how to calculate the execution time in PICBasicPro.. can any1 teach me..
i m using the following instructions:

if...then
endif
pulsin
pulsout
pauseus
high
low
x = y

thx..
an approx solution
start a timer before ur code starts , stop it at the end . and check the timer val.(assumption no timer overflow) .else use interrupt based counting (need to calculate the interrupt overhead also)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top