I2c device address

Status
Not open for further replies.
Most I²C devices have a fixed address but if you are writing the code for all devices you can decide the address of your devices. Just make sure you don't pick the address of any other device that may share the bus.

Mike.
 
You either have to assign different addresses in code or some I/O pins to assign in hardware.

Mike.
 
thank u
so if i want to coonect 10 microcontrollers using i2c then for assigning addresses to them i need to connect 3 (A0A1A2) lines using port pins and how i can make them on ?
i want to send timming on all microcontrollers which is on main RTC
 
thank u
so if i want to coonect 10 microcontrollers using i2c then for assigning addresses to them i need to connect 3 (A0A1A2) lines using port pins and how i can make them on ?

Like Pommie said, either allocate each address in the software (just a single define at the beginning of the program), or write code to read a number of port pins, and allocate the address based on that value - simple switches (or links) and pull-up resistors. Each method has advantages and disadvantages.

i want to send timming on all microcontrollers which is on main RTC

Using I2C seems a VERY complicated way of doing something so simple? - I2C is for connecting chips together easily on a huge PCB, specifically a TV set originally - and is great for using I2C chips where you have no choice. However, for your requirement a simple serial link is all you need, and only needs one pin not two.
 
sir,
Can u suggest me the simplest way if you know?
and what will be the circuit diagram for eight microcontrllers using I2C.
thank u
 
Last edited:
It depends entirely on what you're needing to do, and if it's two way or one way - a very simple method is to chain the serial ports in series, so each device passes the data on to the next.

For I2C all devices simply connect SDA and SCL to the bus lines, with single pullup resistors on each line.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…