Searching \ for 'Bit Value checking (16F84)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'Bit Value checking (16F84)'.

Truncated match.
PICList Thread
'Bit Value checking (16F84)'
1998\11\28@160315 by Paul Phillips

flavicon
picon face
part 0 911 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.71.1712.3"' name=GENERATOR>
</HEAD>
<BODY>
<DIV>&nbsp;</DIV>
<DIV>Hi there</DIV>
<DIV>I'm using: 16F84&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>I'm trying to check to see if PORTB (0-7) are low (all). I'm also wising to
check a value (in W) whether it matches that PORTB value.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Could any one out there help me?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>&nbsp;</DIV>
<DIV>Paul Phillips</DIV>
<DIV><FONT color=#000000 size=2><A
href="spam_OUTPICTakeThisOuTspamColindale.demon.co.uk">.....PICKILLspamspam@spam@Colindale.demon.co.uk</A></FONT></DIV></BODY></HTML>

</x-html>

1998\11\29@025841 by engelec

picon face
Paul,
Try this

           movf    portb,w                ; load portb in w
           xorlw    b'11110000'         ; your compare value
           btfss     status,z                ; if w = your value Z=1
           goto      no
           goto      yes


Andre Abelian

Paul Phillips wrote:

>   Hi thereI'm using: 16F84 I'm trying to check to see if PORTB (0-7)
> are low (all). I'm also wising to check a value (in W) whether it
> matches that PORTB value. Could any one out there help me? Thanks Paul
> PhillipsPICspamKILLspamColindale.demon.co.uk

1998\11\30@104253 by Dmitry Kiryashov

flavicon
face
Paul Phillips wrote:

> I'm trying to check to see if PORTB (0-7) are low (all). I'm also
> wising to check a value (in W) whether it matches that PORTB value.

1a.                                     1b.
       TSTF    PORTB                           TSTF    PORTB
       SKPZ                                    SKPNZ
       GOTO    NOT_ZERO_PORTB                  GOTO    ZERO_PORTB

; execute code for zero variant         ; execute code for non zero variant
;       ...                             ;       ...
       GOTO    NEXT_PART               GOTO    NEXT_PART

NOT_ZERO_PORTB:                         ZERO_PORTB:
; execute code for non zero variant     ; execute code for zero variant
;       ...                             ;       ...

NEXT_PART:                              NEXT_PART:
;       ...                             ;       ...

2a.                             2b.
       XORWF   PORTB,W                 XORWF   PORTB,W
       ANDLW   0b11110000              ANDLW   0b11001100      ;comparing mask'
s
       SKPNZ                           SKPZ
       GOTO    W_EQUAL_PORTB           GOTO    W_NOT_EQUAL_PORTB
;       ...                     ;       ...


Comparing mask bits mean that only bits marked as "1" are needed for
comparision. Other bits are suppressed.

WBR Dmitry.

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...