MikroC pro for PIC question...

Status
Not open for further replies.

janor

Newbie level 3
Joined
May 19, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
hi,
I'm using mikroC pro for PIC v5.3 and I was wondering how many clock cycles does the if condition take?
 

it depends on "If" condition. if your condition need some calculation, the needed clock cycle will be more than a simple decision.
for example, processing of "if((X/Y)>=45.678)" need more clock than "if(PORTA.B3)".

if you want to know exact values, you can see "Listing" (view>Listing). in listing file you can see all of the C statements and their corresponding assembly instruction.
 
Reactions: janor

    janor

    Points: 2
    Helpful Answer Positive Rating

yes that helped, thanks a lot...
 

You can also see the time. Build the code. Then, in the "Run" menu, click "Start Debugger". Step over to the line before the if condition. Reset the stopwatch. Then step over to the line after the condition ends. You will see the time listed.

Hope this helps.
Tahmid.
 
Reactions: janor

    janor

    Points: 2
    Helpful Answer Positive Rating

thanks a lot mate
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…