piclist 1997\08\28\160445a >
Thread: 16c84 stack
picon face BY : John Payson email (remove spam text)

> has any of you come across an application, where you were using all
> the internal/external interrupts in 16c84 (timer,RB0,PA4-7,eeprom)
> and you ran out of stack(8 deep) because one interrupt occured before
> the previous one was serviced , assuming that you could not
> disable other interrupts, and the service routines were
> quite complicated ?

I did once hit stack limits on such an application, but I was actually using
only one interrupt source.  Since I had two different tasks that were running
off the ISR (one that ran every 250 cycles and took about 20 to execute, and
one that ran every 25,000 cycles and took about 600 to execute) my ISR
structure was like this:

       save W & F
       do some stuff
       restore W and F
       decfsz  counter
       enable interrupts
       save W & F somewhere else
       reset counter
       do more processing

Once I streamlined my mainline code to eliminate a couple subroutine depths
everything worked fine.  I'm not sure if this technique of nesting interrupts
is generally a good idea, but in this application it worked out very nicely.

In reply to: <9708281814.AA10020@shakti.hal.com> from "Ravindra Divekar" at Aug 28, 97 11:14:17 am
See also: www.piclist.com/techref/microchip/devices.htm?key=16C
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) 16c84 stack

month overview.

new search...