--===============1637161490== Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by pch.mit.edu id l0IMfZRj025300 I'm using a 12F683 to read a digital sensor, the Sensirion SHT-75. It is= a=20 I2C style interface, but isn't compatible so I'm just doing a software po= rt=20 instead. The data line has a external 10K pull up resistor as specified = by=20 the sensor's data sheet. The problem I'm having is when I change the GP1 pin to an input. The sen= sor=20 should take over the data line and send it's bits serially with the clock= I=20 source via the GP0 output. However the PIC does not seem to read in=20 anything but zeros, even with the line held high. Here is the code for the read: movlw 0x1 movwf GPIO ;clock high nop ;allow settling time movf GPIO,W ;read input andlw 0x2 ;preserve data bit movwf GPIO ;clock low, use Z bit for result return The port is set as an input before this and I tested it by driving the GP= 1=20 pin low after changing it to an input. The scope shows the line is high = so=20 I'm certain the TRISIO register is working right. This works fine in the simulator (MpLab 7.something) but it is driving me= =20 nuts trying to sort it out and of course the end product is holding up la= b=20 work. Can anyone shine some light on this? These things usually turn ou= t=20 to be something obvious I missed but I can't see anything. Thanks, Andy _________________________________________________________________ FREE online classifieds from Windows Live Expo =96 buy and sell with peop= le=20 you know=20 http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=3Dhttp:= //expo.live.com?s_cid=3DHotmail_tagline_12/06 --===============1637161490== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 7bit -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --===============1637161490==--