Jason: In my code example, I did not save and restore the W and STATUS registers in the interrupt routine. Please refer to the PIC16C84 data sheet, section 8.10, for an explaination of this. You must do this! Dave Dave Sorlien wrote: > > Jason: > > Your code is attempting to move a single bit into the W register. A > simpler approach is as follows: > > ; ***** THIS CODE IS INSIDE INTERRUPT ROUTINE ***** > one btfss _porta,bit1 ; is port B pin of interest = 0? > goto bit1_is_0 ; yes > > bit1_is_1 ; insert code to be executed if _porta,bit1 is 1 > goto one_done ; once finished > > bit1_is_0 ; insert code to be executed if _porta,bit1 is 0 > > one_done ; if other bits need testing, insert code here > > exit_int bcf intcon,1 ; clear TMR0 interrupt flag > retfie ; interrupt done > > There is no need to mess with intcon,7 (GIE bit) because the interrupt > routine cannot be "interrupted". > > Dave > > Jason A Alexander wrote: > > > > Hello all. I am having a problem with some code I have written.