From: "James Daniels" <james.daniels@...>
[...]
> I believe this might be the source of the problems because inside some
> of my routines I'm storing the stack (r13) and then using it as a
> general purpose register. Of course, I restore the stack before
> returning or calling another function so there's not normally a problem.
> However, if an interrupt were to occur whilst r13 contained something
> other than the stack then random areas of memory would be corrupted.
[...]
your understanding is correct. you may not twiddle r13 within your routines
unless you a) are not using interrupts or b) disable interrupts.
regards,
matthew.