Apr 29, 2007 #1 Int Art Member level 4 Joined Dec 15, 2001 Messages 70 Helped 9 Reputation 18 Reaction score 6 Trophy points 1,288 Activity points 389 how to change two pins of a port simultaneously without affecting the other pins?
Apr 29, 2007 #2 U unkn0wn Junior Member level 3 Joined Sep 5, 2006 Messages 28 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,482 Re: PIC port Example: MOVLW B'00000011' MOVWF PORTA .. MOVLW B'00000000' MOVWF PORTA
Apr 30, 2007 #3 V Vilte Newbie level 2 Joined Feb 2, 2007 Messages 2 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,283 Activity points 1,289 Re: PIC port Bad example. Code: MOVLW B'00000011' MOVWF PORTA will effect all 8 pins in register. Better use ANDWF, IORWF or XORWF, depend on required value. For example: MOVLW B'11111100' ANDWF PORTA will set bit 0 and bit 1 to 0 without effecting other bits.
Re: PIC port Bad example. Code: MOVLW B'00000011' MOVWF PORTA will effect all 8 pins in register. Better use ANDWF, IORWF or XORWF, depend on required value. For example: MOVLW B'11111100' ANDWF PORTA will set bit 0 and bit 1 to 0 without effecting other bits.