anbarsystem@ZAZ.COM.BR wrote: > Why my codes doesn't work? Ah! I just twigged! You used the BSF/ BCF commands to avoid the need to save W in the interrupt routine. That is an interesting approach, but you need to set the Register Bank just after you save the Status register with BSF STATUS, RB0 and you need to do the same to access the TRIS registers in the initialization code also. It really is preferable (simpler, less instructions overall and possibly as Tony claims more reliable) to simply load the desired I/O mask in W and write it on one operation. I *strongly* recommend you use the TRIS PORTB instruction - that's what it was put there for! Then you don't even need to set RB0 at all. If you set RB0 at some stage, you need to clear it later. Of course, restoring a saved value of the Status register *will* do this. -- Cheers, Paul B.