I'm confused as to why writing (and not writing) to PORTB affects RB1 - it's an INPUT. Are the PORTB pins you've designated as output somehow connected to RB1? --- rituraj singh wrote: > hello, > > I configured RB1 as an input pin. This pin was > connected to a push-button > switch (pulled up to Vdd by a 10K resistor). > > Case 1: > bsf STATUS, RP0 > movlw B'00000111' > movwf TRISB > bcf STATUS, RP0 > clrf PORTB > > Case 2: > > When the above code was written the voltage at RB1 > was some 1.56Volts. > I changed the code to > > bsf STATUS, RP0 > movlw B'00000111' > movwf TRISB > bcf STATUS, RP0 > movlw B'00000111' > movwf PORTB > > But the problem still existed. Voltage at RB1 was > still some 1.56 volts. > > Case 3: > > However when the code was replaced by the following > code, voltage at > RB1 showed 4.97 Volts on switch open.. > > bsf STATUS, RP0 > movlw B'00000111' > movwf TRISB > bcf STATUS, RP0 > > Can any of you please tell why the voltage of RB1 is > reducing in the > first 2 cases? > > Also, in order to prevent this, do I need to > initialise the output pins in > PORTB individually? > > regards, > Rituraj Singh > > -- > http://www.piclist.com hint: The PICList is archived > three different > ways. See http://www.piclist.com/#archives for details. __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.