At 08:17 AM 7/9/2010, you wrote: Are you trying to modify someone else's code extracted from an existing PIC design? >The original I2C code goes like this (a part of it). > >txbyte movlw .8 > movwf bitctr > btfss txbuf,7 > goto $+3 > bsf iicport,sda > goto $+3 > bcf iicport,sda > goto $+1 > goto $+1 > bsf iicport,scl > goto $+1 > goto $+1 > bcf iicport,scl > rlf txbuf,same > decfsz bitctr,same > goto $-0Dh > bsf iicport,scl > bsf iicport,sda > retlw 0 > > > > If it works then it is probably a read-write-modify issue, which occurs > > when a pin hasn't changed enough before the next bcf or bsf happens. > >This code would work for me on 16C54's years back. > >Cheers > >Ravi >-- >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist