Ian Smith wrote: > I am guessing that the various ports are diffrent enough to allow BSF's > in a row on some, but not others. The code works if I use portb but > not portd or porte. It may be possible that the PSPMODE bit, TRISE<4> is set to 1, which enables PORTD for a parallel port, and the analog inputs have not been set to digital. movlw b'00000110' ; set all as digital IO movwf ADCON1 Check the TRIS for PORTD(E). > Related question... I am using the USART in portc. How safe is it to > use movwf instructions to set the other 6 pints as output? Should I > leave those two bits as ser or clear, or will the movwf instructions > scramble the serial output? The MOVWF (ADDWF, SUBWF) PORTC data will always be written to the output latches, but these are isolated from the TX and RX pins when the USART is enabled, or when the TRIS bits = 1. When enabled, the USART appears to override the TRISC <7,6> settings. A major point with IO pins, is if you decide to change one to be an OUTPUT, then make sure you specifically set it's output state before doing so. If you have used BSF, BCF on the ports previously, or disabled a periferal, you may not know the logic state of the output latch. -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com