Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/09/03 18:24
Read: times


 
#38661 - Problem in I2C bit-banged read routine
Hello
I had a problem while doing a bitbanged I2C receive routine while using the 8051 as a master receiver.The code was something like this...
;----start of routine-------
ReadI2C:

mov r0,#8h;
back:
delay
setb scl
delay
mov c,sdaPIN
rlc a
delay
clr scl
delay
djnz r0,back

cjne bytecnt,#01h,posack
negack:
generated a negative acknowledge(setb SDA)
ret
posack:
generated a negative acknoledge(clr SDA)
ret
;---end of routine------

My problem is that I was getting the received data in a less left shifted format..
I mean if I sent 61h (0110 0001), I was recieving 30h (0011 0000)....what could be the problem?Please help
Thank you
Manoj

List of 4 messages in thread
TopicAuthorDate
Problem in I2C bit-banged read routine            01/01/70 00:00      
   RE: Problem in I2C bit-banged read routine            01/01/70 00:00      
      RE: Problem in I2C bit-banged read routine            01/01/70 00:00      
   RE: Problem in I2C bit-banged read routine            01/01/70 00:00      

Back to Subject List