Searching \ for 'Why Microchip say: "do not use BSF & BCF on Port P' 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/ios.htm?key=port
Search entire site for: 'Why Microchip say: "do not use BSF & BCF on Port P'.

Truncated match.
PICList Thread
'Why Microchip say: "do not use BSF & BCF on Port P'
1997\03\11@035512 by Thomas Mohaupt

flavicon
face
Hi,
can anybody explain me the comment Microchip takes in the sourcefile
i2c_low.asm (an554)?

...
InitI2CBus_Master:
 bcf   _rp0
 movf  _portb,w
 andlw 0xFC            ; do not use BSF & BCF on Port Pins
 movwf _portb ; set SDA & SCL to zero. From Now on, simply play with tris
 RELEASE_BUS
...

Why I should not use BSF & BCF on Port Pins? Is it only recommended in this
case to make sure that both pins are zero at the same time?

--ThoMo
*****************************************************************************
* Thomas Mohaupt                   e-mail: spam_OUTmohauptTakeThisOuTspaminformatik.tu-cottbus.de *
* Sielower Landstr. 82       03044 Cottbus     Tel./Fax(PC): +49 355 701423 *
*****************************************************************************

1997\03\11@095450 by Andy Kunz

flavicon
face
>Why I should not use BSF & BCF on Port Pins? Is it only recommended in this
>case to make sure that both pins are zero at the same time?

That's one good reason.

Another is that the output you are driving is trying to pull your signal in
the other direction, and a BSF/BCF does a read before writing
(read/modify/write).  That would cause you to read the opposite of what you
want, change the bit you want changed (a different bit), then write the
updated (and partially incorrect) value back to the port.

Andy

==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"
==================================================================

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