Keil Logo

Interrupt VS Non Interrupt Overlaying....

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Chris W
Posted
25-Jan-2006 21:08 GMT
Toolset
C51
New! Interrupt VS Non Interrupt Overlaying....
An older post, in the knowledge base describes that variable corruption can occur if local variables in an interrupt are overlayed with non interrupt or lower priority local variables.

http://www.keil.com/support/docs/658.htm

I am using C51.exe V7.06.
BL51.exe V5.03

This post does not state my version of compiler as having this issue, but it sounds like a generic problem.

I can't use the first 3 options because of the complexity of my code, but I am unclear about the last point

"Make sure the memory usage of your interrupts is not greater than the registerbank it's using when it "fires"."

I am not using register banking for any interrupt and I believe I only have then 8 bytes of register bank 0 to use for back up when an interrupt fires.

Does that mean if my interrupt fires and uses more than 8 bytes in common with another level interrupt I could have variable corruption.
Read-Only
Author
Drew Davis
Posted
26-Jan-2006 00:30 GMT
Toolset
C51
New! RE: Interrupt VS Non Interrupt Overlaying....
I think this point is saying merely that if your interrupt uses only registers, then it won't use any data space for local / temporary values. Thus, it won't overlay that storage with another routine's locals, and thus there is no possibility of corrupting data. The other three points are other ways of making sure that your interrupt locals aren't overlaid with another routine's locals.

Every interrupt handler is the root of its own overlay call tree. This should keep you safe for the most part. I was under the impression that this is automatic with C51 7.0. This note may be out of date. (Or, I may be living in a fool's paradise!)

The problem that usually arises is when an interrupt handler wants to call a routine that is shared with another interrupt, or with the main code. This usage requires that routine to be reentrant (either "naturally" so, or because you declare it reentrant and force it to use the software stack rather than overlay mechanism for local storage).
Read-Only
Author
Chris W
Posted
26-Jan-2006 14:45 GMT
Toolset
C51
New! RE: Interrupt VS Non Interrupt Overlaying....
Thank you very much for your prompt response. I saw that previous post and started to wonder how anything in my code was working.

I was concerned that I might see a problem down the road and that I was just lucky so far.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.