On Sun, Mar 22, 1998 at 11:25:30AM -0800, Bruce Cannon wrote: > I've been taking a closer look at pin states on powerup, and am having a > hard time understanding the limitations of this scheme. It appears that > setting the port reg before changing the direction to an output doesn't > help; that the state of the pin is read (as an input) during the TRIS > operation, potentially overwriting the port settings. I think you're confused; writing to the TRIS register will NOT change the state of the port latch; the read/modify/write problem applies only to operations on the port register, if you have pins whose direction is switched at times. All you need do is write the desired output values (using a movwf, not using individual bsf/bcf instructions) to the port, THEN write to TRIS. Clyde -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3354 2411 +61 7 3354 2422 --------------------------------------------------------------------------- HI-TECH C: compiling the real world.