How to change two pins of a PIC port simultaneously without affecting the other pins?

Status
Not open for further replies.

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?
 

Re: PIC port

Example:

MOVLW B'00000011'
MOVWF PORTA

..

MOVLW B'00000000'
MOVWF PORTA
 

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.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…