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.

[51] Running large code in ISR

Status
Not open for further replies.

hithesh123

Full Member level 6
Full Member level 6
Joined
Nov 21, 2009
Messages
324
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
lax
Visit site
Activity points
3,548
What is the general rule for code length running in an ISR. Can it have lot of delays(~10ms) and iterating loops.
Ex: ISR code calls 2-3 functions. Those functions have some delay routines etc.
I usually keep it short. But some times long code might be inevitable.
 

It is absolutelly not recomended do nothing else than only handle flags on ISR routines or perform an immediate treatment of a specific task wich requires priority.
 

I agree - keep interrupt service routines as short as possible or you will loose information
the interrupt routines can set flags that are monitored in the main program loop which can then take appropriate actions
 

Forgot to mention that the read-and-store value of some special function register belonging to hardware built-in modules ( such as UART, A/D, etc... ) is also another task usually suitable to do into ISR routines, due if these ones are configured to receive data at high speed rate, doing the read at the main routine - having some dalays there - the program will be subjected at a risk to loose data oversampled.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top