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.

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.
 
  • Like
Reactions: janor

    janor

    Points: 2
    Helpful Answer Positive Rating
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.

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.
 
  • Like
Reactions: janor

    janor

    Points: 2
    Helpful Answer Positive Rating
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.

thanks a lot mate
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top