piclist 2001\01\11\090517a >
Thread: Help! :) Error with FSR0 and MPLAB-C18?
www.piclist.com/techref/microchip/languages.htm?key=mplab
face picon face BY : Olin Lathrop email (remove spam text)



>   DEBUG_ROLL=TIMERS[ID].ROLLOVERS_LEFT;
>
> ** Interrupt occurs here **
>
>   DEBUG_ELAPSED=TIMERS[ID].ELAPSED;
>   DEBUG_TIME=TIMERS[ID].TIME;
>
> When the return from interrupt occurs, ID is now 0.  So the code ends up
> indexing the wrong element of the array...

Sounds like the interrupt is trashing some state.  Is the interrupt routine
saving/restoring FSR?  Take a look at the assembly code generated for the
lines above and see what resources it uses.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, @spam@olinspam_OUTspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspam@spam@mitvma.mit.edu


<001701c07bd1$5842d490$260bf6cd@pc> 7bit

See also: www.piclist.com/techref/microchip/languages.htm?key=mplab
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) Help! :) Error with FSR0 and MPLAB-C18?

month overview.

new search...