I think PBP assumes its in BANK0 unless it does something in a different bank. Since LATF is not in BANK0, PBP will clear the BSR after executing LATF line. When I comment LATF line, sometimes the Interupt occurs during an instruction where BSR !=0, so in the interupt PBP assumes BANK0 for the BANK0 stuff.
Does this make sense? Setting BSR=0 upon entering the ISR will make sure PBP is not confused
Thank you Darrel for letting me keep some of my hair so I can pull it out on the next problem.







Bookmarks