On Mon, 19 Jan 1998 12:03:53 -0500 "Najemy, Daniel" writes: >Greetings - hoping someone would be able to help here... > >I have a sub-routine that looks as follows: > >bsf STATUS,RP0 ; switch to bank 0 >bcf PORTC,6 ; light an led hanging off port c >bcf STATUS,RP0 ; switch back > >when I modify it as follows.... >bsf STATUS,RP0 ; switch to bank 0 >bcf PORTC,6 ; light an led hanging off port c >bsf PORTC,2 ; >bcf STATUS,RP0 ; switch back > > Looks like the classic read-modify-write without allowing enough time for the port I/O lines to settle. Recall that reading a port actually reads the port pins, not the output register. So... if w is available, you might do something like bank0 ; I have a macro for this... movfw portc ; Get current port settings in w andlw b'10111111' ; Clear bit 6 iorlw b'00000100' ; Set bit 2 movwf portc ; Update the port Harold