Brooke Clarke wrote: > btfsc STATUS,Z > banksel PORTB ; NEED banksel here or bcf PORTB,7 WHY-O-WHY > ; bcf PORTB,7 ; heart beat off PC4 Testing Switches << inorder to work, > ; commenting out the bsf and bcf lines causes the clock to > ; have garbled display. Why? > ; --- pop pclath, status & w --- > movf PCLATH_TEMP,W (snip) Um, your BTFSC will skip over the next instruction. Without the BANKSEL, that next instruction would be the MOVF; your BANKSEL is going to be replaced with a MOVLW/MOVWF (or maybe a few BSF/BCFs, depends on the PIC you're targeting). If you're skipping over the MOVF, then W will be undefined and your MOVWF PCLATH will clobber PCLATH... OTOH, you might be having issues with context saving at the start of the ISR. Can you post the first 10 or so lines of the ISR, or maybe the entire ISR? Thanks. -- Phil. | Kitsune: Acorn RiscPC SA202 64M+6G ViewFinder philpem@dsl.pipex.com | Cheetah: Athlon64 3200+ A8VDeluxeV2 512M+100G http://www.philpem.me.uk/ | Tiger: Toshiba SatPro4600 Celeron700 256M+40G -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist