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.

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

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,580
Helped
122
Reputation
244
Reaction score
114
Trophy points
1,353
Location
India
Activity points
10,381
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++)
}
 

Hello!

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

Dora.
 

please assume it as 89s51 . (compiler keil) ( calculate avraege compiler )
 

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.
 
Hello!

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

Dora.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top