This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems with hhandling multiple interrupts

I am using the Keil Compiler for programming the MSC1210 from Texas instruments with a 8051 core. My application needs that i use the Serial port interrupts & Timer 0 interrupt in my project.Both the ISRs are written in different files. When i try to compile the project with both files included, it gives me an "Adress Space Overflow" message. When any 1 of the files is not included the project compiles. I dont understand why this is happening. Kindly help.

  • best guess: you have mistyped an interrupt number. We all have stared and stared on thing that were blatantly wrong and not been able to see it.

    A quote from my mother "the first place you go blind is on the eyes"

    Erik

  • Thanx eric, but i have checked the interrupt no. & i think i have got some clue.There is a routine in the main file which the ISR tries to use. Since the routine was not used by any of the other programs, i just copied the same routine in the ISR file & the error went away. Now does it mean that i have to make duplicate copies of the routines that are used by the main programs & the ISR programs.Also this routine which is used by the ISR uses another routine written in Assembly. Now this routine is used by almost all other programs. In that case, why does this routine doesnt give any problems??

    Also can u help me with using the Timer0 interrupt?? The moment i enable the Timer0(TR) = 1;), my program just starts executing the Timer0 ISR infinitely!!

    Thanx..

  • the key to this is "using"

    if a routine is "using" x, all functiuons called must be "using the same.

    Due to the archirecture of the '51 it is usually a bad idea to have 2 levels (main and int) call the same routine, if you absolutely must, the you need to specify the roiutine as "reentrant" and have both callers be "using" the same level.

    I would, without even considering the other option, use 2 copies of the routine called by both.

    Erik