Kevin wrote: >When you TRIS a pin as input, then read it, does that not put a logic 1 in >the PORT register if the pin is pulled up? If so, when the pin is TRIS'd to >output again, it will be outputting logic 1.?? > >Therefore, care should be taken when doing I2C in this method to make sure >that the pin is set to output 0 whenever you tris back to an output. As an aside, when doing open-collector code I clear the port pin just before I change it to output. Just to sure that the pin will be low when I need it to be! Helps to avoid having a nasty level collision on a OR'd bus line. Regards... ___________________________________________ David Duffy Audio Visual Devices P/L U8, 9-11 Trade St, Cleveland 4163 Australia Ph: +61 7 38210362 Fax: +61 7 38210281 New Web: www.audiovisualdevices.com.au New email: avd@audiovisualdevices.com.au ___________________________________________ -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics