Go Down

Topic: Clock cycle per instructions (Read 2967 times) previous topic - next topic

Techone

I just want to know how many clock cycle it take the ATmega on the Arduino to do the instructions that make your program.

In the day of 8085, 8086, 6809, 6502  ect....   all instruction - Op-Code that some clock cycle to complete.

Example :   MOV A, B  2 clock
                INC A        4 clock
                MOV B, A   2 clock

Where can I fing this information about ATMega / Ardiuno clock cycle per instruction.  In some program / application, this knowledge will be usefull. Because every instructions take time to complete.
               
 

Magician

Exactly, look for microprocessors (AtMega328p or AtMega2560 etc) data sheet on Atmel.com
It around 350 - 500 pages docs, that include all information.

David Pankhurst

Here's a couple of posts about creating a machine language listing of your code - combined with the information Magician provided, you can figure out the cycles for your code:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207951658/2#2
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241117308


retrolefty

Many of the avr instructions work in just one clock cycle. Here is a link to the instruction set, and clock cycles per instruction is listed starting on page 11:

http://www.atmel.com/dyn/resources/prod_documents/doc0856.pdf

Techone

Gentlement...Thank you for the info. I have a lot of reading to do and to figure things out.

I have a new question and I will make a new subject.

Go Up