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.

Three guidlines for interrupt reentrancy

Status
Not open for further replies.

naresh850

Full Member level 3
Joined
Jun 9, 2006
Messages
157
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,298
Activity points
2,249
reentrancy interrupt

Hello,

What are the guidlines for interrupt reentrancy?


Regards,
NP
 

pic interrupt reentrancy

Answer is same as previous:
• ISRs cannot return a value.
• ISRs cannot be passed parameters.
• On many processors/compilers, floating-point operations are not necessarily re-entrant. In some cases one needs to stack additional registers. In other cases, one simply cannot do floating point in an ISR.
• Furthermore, given that a general rule of thumb is that ISRs should be short and sweet, one wonders about the wisdom of doing floating-point math here
• In a vein similar to the third point, printf() often has problems with reentrancy and performance. So avoid it ISR.

Added after 4 minutes:

Beside above answer few things can be added for reentrancy is:

In the embedded world a routine must satisfy the following conditions to be reentrant:

1. It uses all shared variables in an atomic way, unless each is allocated to a specific instance of the function.
2. It does not call non-reentrant functions.
3. It does not use the hardware in a non-atomic way.

Added after 57 minutes:

Also design your ISR such that whenever it runs, disable all other interrupts.
 
  • Like
Reactions: min2max

    min2max

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top