First off, if you're saving the PRODL register (which is almost always a good idea), you need to check what it's actually saving.
The PROD register is actually a 16-bit combination of the two PRODL/PRODH registers, but it's defined in the device files as a byte.
Code: Select all
PROD as byte absolute $0FF3,
PRODL as byte absolute $0FF3,
PRODH as byte absolute $0FF4,
So 'save(PRODL)' or 'save(PROD)' will only save the lower 8-bits.
If you re-define PROD as
then 'save(PROD)' will save the entire word
It seems to me that the device files should probably define 'PROD' along with the other 16-bit aliases, but they don't
Code: Select all
// alias...
public dim
FSR0 as FSR0L.AsWord,
FSR1 as FSR1L.AsWord,
FSR2 as FSR2L.AsWord,
TABLEPTR as TBLPTRL.AsWord,
PROD as PRODL.AsWord
Note: if you use 'save(0)' to save the system variables then this is taken care of for you... it also saves FSR0, FSR1, and PRODL/PRODH
Now, on to delayms...
delayms() and delayus() both use a few bytes of the system register space as temp storage, so depending on what's in your isrs you may need to add 'save(0, ' to the list, but without knowing what the isrs are doing that's hard to tell. Saving/restoring the system vars adds a far bit of latency to the interrupt, so it's a good idea NOT to use it if at all possible (but that depends on the isr code).
Also, from your other thread it seems you're making a number of subroutines calls in the isrs (because of the stack overflow issue). You need to take a look at this since if these subs use any parameters, temps, or local variables they too would probably have to be added to the 'save' list since the frame variables are recycled
If you're using both high and low priorities, this usually applies to both isrs, so this can be a real issue if you need fast interrupt response.
See if adding something like
Code: Select all
save(0, sub1_used_by_isr, sub2_used_by_isr, etc)
to each of the interrupt handlers helps. If it does, then you know where to start looking.
Also, you aren't using the 'delayxx' calls IN the isrs, are you?