At 01:28 PM 4/30/01 -0500, Mike Mansheim wrote: >I think I've just run into a rwm effect, but not because I'm changing >port directions. >F876 portA configured as follows (set once, doesn't change): >RA0, RA3: analog in >RA1, RA2, RA5: out >RA4: digital in >ADCON1: RA0,1,3 as analog in, RA2,5 as digital i/o. >Whenever RA2 or RA5 are changed, RA1 goes low unexpectedly. >My questions are: >- have I diagnosed the problem correctly? >- I can fix this by simply refreshing RA1 to it's correct state after > any operation on the rest of the port. Is this ok, or is there some > bigger problem with using an analog input pin as a digital output? Yes to both. Hopefully, whatever is being fed by pin RA1 won't get upset by the glitch. You can avoid the problem by not using R-M-W operations on that port. Use a separate register (often called a "shadow register") for your bit manipulations. Then write that register to the port. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 17 years of Engineering Innovation (1984 - 2001) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu