piclist 2001\01\19\021449a >
Thread: INT/RB0 & Stack?
face BY : Francois Robbertze email (remove spam text)

>I just want to clarify something... when you say that you call a
subroutine, then return to the interrupt >routine, do you mean that you are
calling the interrupt routine directly, and not getting there via an >actual

No, the interrupt gets triggered on a faling edge of RB0. My code looks
something like this:

       Org     0
       Goto   Main
       Org     4
       Goto    INT_handler

;*********************************** MAIN
       Call     RegulateTemperature
       Goto    Main

;************************ INTERRUPT HANDLER *************************
    movwf   savedW
    swapf   StatusReg, 0
    movwf   savedSTAT

    call IncommingData

    swapf   savedSTAT, 0
    movwf   StatusReg
    swapf   savedW, 1
    swapf   savedW, 0

    bcf IntConReg, 1         ;clear interrupt flag
;************************ Regulate Temperature*************************
   Call    SubroutineX
;*************************** IncommingData*****************************
;Do some things
   Call    SubroutineA
   Call    SubroutineB
;***************************** SubroutineA ******************************
   Call    Subroutine C
;Do some things
;Do some things
;Do some things

I am now sure I was not overflowing the stack. I think my fault was that in
the RegulateTemperature routine I was waiting for a Dallas 18A20 to respond
with a temperature reading when the interrupt normally occurs. Thus when the
interrupt routine was exit with the RETFIE command, the stack "POPPED"
backed into an endless loop, because it is waiting for the Dallas18A20 to
respond and this thermometer has time out...and back in a idle state.



http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

<001101c081e8$beaa4700$7ebd1fc4@manager1> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) INT/RB0 & Stack?

month overview.

new search...