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.

Finding Execution time of AVR C (Microcontroller) Code

Status
Not open for further replies.

electrobuz

Member level 2
Joined
May 20, 2013
Messages
46
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,638
Hey,
I want to find the clock cycles or time in ms/us for execution of my code that I am running on an AVR Atmega 16. How do I go about finding it? Any help is appreciated.
 

you can use the avr studio simulator to see the execution cycles and execution time.
use a couple of breakpoints to stop the execution in the parts you are interested in
 

I tried using AVR Studio simulator but could'nt figure out where I would see execution cycles and execution time on the simulator. Any resources where I can see where to spot these details?
 

I'm not using AVR simulator, but a few clicks on the internet confirmed my assumption that the respective function is called stop watch, as in other simulators.
 

The dialog that shows the info is on the left side when the simulator is running

studio_sim1.jpg

The right click includes options to selectively reset stopwatch and cycle counter
studio_sim2.jpg

Set the debug -> AVR simulator options to the correct core clock frequency to get correct timings from the given cpu cycles
 

The Processor tab on the left side is always showing this (for any code):
Untitled.png

It does not show the run time?
Maybe I am not simulating properly? Why is this happening?
 

I don't see the problem, your image shows the same data as mine, the only difference is that you have expanded the registers

Untitled.jpg
 

The Processor tab on the left side is always showing this (for any code):
View attachment 97911

It does not show the run time?
Maybe I am not simulating properly? Why is this happening?
Hi it wont show in Run time but It will show the time IF you break in some place.........
 

Like the stop watch in foot race, you need a start and stop event.

Why don't you play around with the tool a little? I'm sure you'll figure it out.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top