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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…