
Originally Posted by
Bracer
But me...trying to "copy" your way, not knowing what I am doing, do this:
Code:
PORTA = PORTA | %00000101
PORTB = PORTB | %00000101
Pause 500
PORTA = PORTA & %00000010
PORTB = PORTB & %00000010
pause 500
PORTA = PORTA | %00000101 = Read PORTA and set to 1 ports A0 and A2
PORTA = PORTA & %00000010 = Read PORTA and clear ports A0 and A2
you use " | " ( OR ) to SET portspins and & ( AND ) to clear them ... but no mix allowed
you can try ...
Code:
PORTA = PORTA | %00000101
PORTB = PORTB | %00000101
.
.
.
.
Subroutine:
PORTA = PORTA ^ %00000111 ' FLIPS the bits with a " 1 "
PORTB = PORTB ^ %00000111
pause 500
GOTO Subroutine
see your manual " Bitwise Operators " section $4.16.17 
Alain
Last edited by Acetronics2; - 30th August 2010 at 20:44.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks