SLA+R/W

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hello

I'm trying to get the TWI running on my atmega32 .
After acknowledging that the TWI has been initialized I have to load a SLA+R/W into the TWDR.

I am confused with this SLA+R/W. I know that the adress is a 7 bit packet and we add a R/W bit but where do we add it? Is it LSB ? Is it MSB?
Let's say I want to adress a slave with an adress of
0b01110000 .
What is the SLA+W going to be?
0b01110001?
0b11110000?

Any help is appreciated

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's a picture on datasheet page 171.

I2C specification document also has nice pictures about the address byte.

Note than basically the address byte is just any byte of data, but the fact that it is the first byte makes it the address byte.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The r/w bit is bit 0 (LSB)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks , I understand now