Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question About XORWF

0 views
Skip to first unread message

zealott

unread,
Feb 10, 2004, 10:05:52 PM2/10/04
to
Carl wrote:
> Hi all,
>
> I am polling my hair out over the most infuriating thing.
>
> I am using a 16F627 and I am currently using this bit of code to flash
> an LED when a fault condition has occured in my circuit.
>
> ncL1
> bsf PORTA,3 ;Turn off PORTA 3 (LOCKED LED)
> call flash
> bcf PORTA,3 ;Turn on PORTA 3 (LOCKED LED)
> call flash
> btfsc PORTA,4 ;Wait for run to be removed
> goto ncL1
> goto stop
>
>
> .. the "flash" sub is just a delay (does not use w).
>
>
> Now I want to optimise this by using...
>
>
> movlw 08h ;00001000 for RA3 XOR
> ncL1
> xorwf PORTA,1 ;Toggle PORTA 3 (LOCKED LED)
> call flash
> btfsc PORTA,4 ;Wait for run to be removed
> goto ncL1
> goto stop
>
>
> But now my LED is always OFF.
>
> Can anyone see a reason why this is not simply xor'ing the RA3
> register?
>
>
>
> Carl.


The only thing I can think of is that maype the assembler does not
understand "08h". Try "0x08" if that dosen't do it, I guess I don't know.

M Webb

unread,
Mar 10, 2004, 8:04:09 AM3/10/04
to
Is it possible that an interupt is corrupting W. Your first code does
not use W at all, your second does.

HTH

Mike.

0 new messages