Handle Interrupt

Hi. I'm doing my thesis on 8051 and i'm programming interrupt routines in Keil C and simulate them. But I can't use variables inside interrupt routines because they generate unpredictable effects on simulations. Does anybody can help me please?

Parents
  • "But I can't use variables inside interrupt routines because they generate unpredictable effects on simulations"

    Darn! There goes the entire fabric of embedded systems programming - no more variables in interrupt routines! :-(

    Clearly, you are doing something seriously wrong - I don't think I've ever seen a non-trivial interrupt routine that doesn't use variables!

    What "simulations" are you talking about - the Keil uVision Simulator, or someting else?

    Did you read the uVision Getting Started guide, and work through the examples in it?

    Have you tried downloading and using the interrupt-driven serial IO example from this site?
    It shows you how interrupts and variables can be used.

    "Does anybody can help me please?"

    Not on the information provided so far!

    Can you post an example? (not forgetting the 'pre' and '/pre' tags - see the Notes when you post)

    Explain what sort of "unpredictable results" you are seing.

Reply
  • "But I can't use variables inside interrupt routines because they generate unpredictable effects on simulations"

    Darn! There goes the entire fabric of embedded systems programming - no more variables in interrupt routines! :-(

    Clearly, you are doing something seriously wrong - I don't think I've ever seen a non-trivial interrupt routine that doesn't use variables!

    What "simulations" are you talking about - the Keil uVision Simulator, or someting else?

    Did you read the uVision Getting Started guide, and work through the examples in it?

    Have you tried downloading and using the interrupt-driven serial IO example from this site?
    It shows you how interrupts and variables can be used.

    "Does anybody can help me please?"

    Not on the information provided so far!

    Can you post an example? (not forgetting the 'pre' and '/pre' tags - see the Notes when you post)

    Explain what sort of "unpredictable results" you are seing.

Children
More questions in this forum