I would try to get rid of the WRITE in the ISR first, but yeah, rule #1... keep ISR as short as possible, set some flags and process the dutys in the main loop.
Another thing.. get rid of all ENABLE/DISABLE DEBUG... for entertainment and testing purpose.
Bookmarks