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.

[SOLVED] How to calculate the time used for each setup as following program

Status
Not open for further replies.

thannara123

Advanced Member level 4
Joined
Jan 7, 2010
Messages
1,456
Helped
121
Reputation
242
Reaction score
111
Trophy points
1,353
Location
God's Own country India, India
Activity points
9,483
Hello ,
How to calculate the time used for each setup of the program as following program (example program) If Crystal frequency 12MHz


Code:
while (1)
{
P0 = 0x55;                  // what time take here ?
P2 = 0X55;                 // what time take here ?

delay(250);                // what time take here ? etc ?

P0 = 0x55;
P2 = 0X55;




}

void delay (unsigned int a)
{

Unsigned int i ,j;
for(i=0; i<a; i++)
for(j=0; j<1275; j++)
}
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,137
Helped
282
Reputation
572
Reaction score
266
Trophy points
1,363
Location
Japan
Activity points
11,393
Hello!

This should be in the specs of your processor. It's processor-dependent. Just read the manual.

Dora.
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,137
Helped
282
Reputation
572
Reaction score
266
Trophy points
1,363
Location
Japan
Activity points
11,393
Hello!

I think that on simple operation such as assignations, it should not depend on the compiler.
P0 = 0x55 for example, will likely result in the same assembly code for all compilers.
Now I don't understand what you mean by calculate average compiler.

Again, this should be in the 8051 manual. Any assembler instruction should be detailed (how
many clock it takes). Look at what this is translated to in assembler, and then look at your manual.
I would say it's a few clocks, but how many exactly is in the manual.

Dora.
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,137
Helped
282
Reputation
572
Reaction score
266
Trophy points
1,363
Location
Japan
Activity points
11,393
Hello!

What is a normal compiler? Are there abnormal compilers?
Did you read the 8051 manual?

Dora.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top