---- START NEW MESSAGE --- Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-8.05) id A024A580068; Fri, 30 Jan 2004 13:44:04 -0800 Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <21.00CC555F@cherry.ease.lsoft.com>; Fri, 30 Jan 2004 16:20:26 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e) with spool id 6079 for PICLIST@MITVMA.MIT.EDU; Fri, 30 Jan 2004 16:20:20 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 0733; Fri, 30 Jan 2004 16:19:45 -0500 Received: from bay8-dav11.bay8.hotmail.com [64.4.26.115] by mitvma.mit.edu (IBM VM SMTP Level 430) via TCP with ESMTP ; Fri, 30 Jan 2004 16:19:45 EST X-Warning: mitvma.mit.edu: Host bay8-dav11.bay8.hotmail.com claimed to be hotmail.com Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 30 Jan 2004 13:19:47 -0800 Received: from 67.65.155.200 by bay8-dav11.bay8.hotmail.com with DAV; Fri, 30 Jan 2004 21:19:47 +0000 X-Originating-IP: [67.65.155.200] X-Originating-Email: [jsears2027@hotmail.com] X-Sender: jsears2027@hotmail.com References: <37FB7AA6F5F9814FB634A7BF4C35A6F5640D07@ESEALNT442.al.sw.ericsson.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-OriginalArrivalTime: 30 Jan 2004 21:19:47.0689 (UTC) FILETIME=[C9F43D90:01C3E776] Message-ID: Date: Fri, 30 Jan 2004 15:19:44 -0600 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: James Nick Sears Subject: Re: [PIC:] Read/Modify/Write vs. Direct manipulation. Its the sam e thing To: PICLIST@MITVMA.MIT.EDU Precedence: list X-RCPT-TO: Status: U X-UIDL: 371856582 ----- Original Message ----- From: "Jan-Erik Soderholm XA (TN/PAC)" To: Sent: Friday, January 30, 2004 3:08 PM Subject: Re: [PICLIST] [PIC:] Read/Modify/Write vs. Direct manipulation. Its the sam e thing > James Nick Sears wrote : > > > If you are in a hurry but your PIC isn't, you can do something like: > > > > bsf PORTD,0 > > btfss PORTD,0 > > goto $-1 > > > > and just wait for the pin to come high before you RMW any other pins. > > Are you sure ? Not entirely, but it did solve the manifestation of RMW problems that I was dealing with driving a capacitive load. > > I don't think the R-M-W problem is about the actual *target bit* of > the bcf/bsf intruction, but rather about the *other* 7 bits of the > port. As I understand it, the main concern is that if you have for example: ; assume PORTD = 00000000 bsf PORTD,0 bsf PORTD,1 then when the first bsf executes the PIC will try to drive RD1 high. If this pin hasn't been driven to Vih before the second bsf executes then PORTD will erroneously read 00000010 instead of 00000011. By waiting for the pin to go high before running the second bsf you avoid this issue. > The pin/bit that is the target of the bcf/bsf is *always* > set to the correct value/level, and the "goto $-1" above will > never be executed. With no load this is true. Nick -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body .