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.

Basic questions of C code and ISR

Status
Not open for further replies.

spider7

Newbie level 4
Newbie level 4
Joined
Feb 5, 2011
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
Hi Everybody,

Can anybody tell me the about some basic questions.

1. In a C code at what speed the Main routine is executed.
2. At what speed the ISR routine is executed.

The MCU is using internal 4 Mhz. The ISR is confugured at 12.5uS.

Thankyou all
 

its upto your prgram ly...it will execute all the things at same speed ly.....each instruction will take some no.of machine cycles and it is upto the instruction and if you find the sum of those times from your program you can get it...
 
hi
there are many things are to be considered
first of all it depends on the compiler and it's optimization techniques.
how it convert the C code to Assembly and then Hex.the more the code, the more time it will take to exicute the code.
In ISR, there are many context saving techniques which used by the compiler which consumes machine cycle.
in assembly you can exatly predict the time consumed

regards

ml
 
very easy to calculate by using formulas. but the time to execute main program and ISR for a single instruction with same machine cycles is same.
 
which chip you are using.. we can tell you more one this.. 12.5us seems too short... your main will be interrupted a lot hope your ISR is not very long..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top