Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2C microcontroller interface

Status
Not open for further replies.
Hi all,

This is the first time i am interfacing I2C with any microcontroller...

I wanted to clear some doubts:

1. The I2C slave device has fixed address from the company - or we have to assign it an address... if yes then how.

2. The purpose of repeated start is only to take control of bus continuously and not that the previous data is to be repeated... is it.


Edit : I am deleting some silly questions.

Regards,

Simran..:)
 
Last edited:
If the I2C device is a microcontroller (or has a microcontroller) you can program the address to be anything. It is something like a memory chip or ADC, then the address is probably fixed. THe chip may have a few pins that you can pull high or low to vary the address a bit.
 
Please clarify...

dknguyen said:
If the I2C device is a microcontroller (or has a microcontroller) you can program the address to be anything. It is something like a memory chip or ADC, then the address is probably fixed. THe chip may have a few pins that you can pull high or low to vary the address a bit.


Please clarify more...

Regards,

Simran..:)
 
Sometimes...

Well,

Sometimes i feel the datasheets are more time consuming...

Do companies make tutorials for interfacings...

Afterall, Engineers are also humans...:eek:

Regards,

Simran..
 
Thanks...

Thanks...

but after going all through the tutorials i got some doubts... I wanted to clear those...

They are nothing but questions with few words answers...

If any one can help....

Thanks,

Simran..
 
Last edited:
Ok...

I ran through some tutorials -

Then also i wanted answer of these two questions:

1. The I2C slave device has fixed address by the manufacturer - or we have to assign it an address... if yes then how.

2. The only purpose of ' repeated start ' is only to take control of bus continuously by the master... Please confirm...

Regards,

Simran..
 
simrantogether said:
I ran through some tutorials -

Then also i wanted answer of these two questions:

1. The I2C slave device has fixed address by the manufacturer - or we have to assign it an address... if yes then how.

2. The only purpose of ' repeated start ' is only to take control of bus continuously by the master... Please confirm...

Regards,

Simran..

Hi simran,
Perhaps these two links will give the answer, which I2C device are you using?

**broken link removed**
https://www.esacademy.com/faq/i2c/


https://www.esacademy.com/faq/i2c/busevents/i2cstast.htm
 
Last edited:
simrantogether said:
I ran through some tutorials -

Then also i wanted answer of these two questions:

1. The I2C slave device has fixed address by the manufacturer - or we have to assign it an address... if yes then how.

2. The only purpose of ' repeated start ' is only to take control of bus continuously by the master... Please confirm...

Regards,

Simran..
I'll make it easy
  1. The address used to be assigned by Philips to anyone making I2C chips. Some devices DS1307 have one fixed address, others may have several settable by an I/O pin or two.
  2. "repeated start" is used to hold the bus in a Multi Master I2C design, it can be used or ignored in a Single Master design.
MultiMaster I2C is harder to design because you'll have collisions and have to address them with your software. If you only have 1 cpu then you don't need to worry about it.

Here's the Philips (NXT) official version of the document, it is a must read for I2C.
 

Attachments

  • I2C bus specification Philips (NXT).pdf
    303 KB · Views: 231
repeated start is used when reading data from a eeprom or other i2c device... the transaction loosely goes like this:

1. master sets a start condition on the bus
2. master sends slave address byte with write bit set
3. master sends slave register byte
4. master sets the start condition again, without setting a stop condition
5. master sends slave address with read bit set
6. slave sends data
7. master acks data, requesting more, or sets a stop condition

if you use a high level language, all of this is handled for you. it is important to know the specifics of the low level transactions however, in case you need to debug something. i2c is very easy to read on an oscilloscope.
 
Thanks all...

Thanks all... I understood...:)

means we can set the address by our own using the external pins...

and repeated start can be ignored in case of simgle master operation.

Regards,

Simran..:)
 
blueroomelectronics said:
I'll make it easy
  1. The address used to be assigned by Philips to anyone making I2C chips. Some devices DS1307 have one fixed address, others may have several settable by an I/O pin or two......


  1. I'd gone through the datasheet of DS1307... I didnt find anything related with internal address...

    Let's see...

    Moreover, is SCL also we have to control manually....?

    Fed up of life...

    Regards,

    Simran..
 
Is this the part you are using ?

If so I can see where the data sheet is a bit confusing but Bill covered your question.


From the part data sheet for the fixed address part:
The slave address byte is the first byte received after the master generates the START condition.
The slave address byte contains the 7-bit DS1307 address, which is 1101000, followed by the
direction bit (R/W), which for a write is 0.

It looks like the address is fixed a 0x68.

simrantogether said:
I'd gone through the datasheet of DS1307... I didnt find anything related with internal address...

Let's see...

Moreover, is SCL also we have to control manually....?

Fed up of life...

Regards,

Simran..
 
3v0 said:
Is this

It looks like the address is fixed a 0x68.

Many questions arise...

If the address is fixed as 0x68 then how we can say that we can attach as many number of devices on I2C bus... we want till the addresses are available...

Hence, the conclusion comes to be that we can interface only one DS1307... which is contradictory...

Secondly,

1101000 signifies 0x68 ... sure...

and is there any baud rate followed to transfer the data...


PS: I know i am putting more stress on forum... which i should not do... but i am sorry for that...

Regards,

Simran..
 
Last edited:
simrantogether said:
Many questions arise...

If the address is fixed as 0x68 then how we can say that we can attach as many number of devices on I2C bus... we want till the addresses are available...

Hence, the conclusion comes to be that we can interface only one DS1307... which is contradictory...

Secondly,

1101000 signifies 0x68 ... sure...

and is there any baud rate followed to transfer the data...


PS: I know i am putting more stress on forum... which i should not do... but i am sorry for that...

Just read the documentation, you're asking stupid questions all of which are covered in the documentation you've already been told to read.
 
Status
Not open for further replies.

Latest threads

Back
Top