Go Down

Topic: How do I give an I2C device an address? (Read 575 times) previous topic - next topic

I have my nice shiny new Arduino Mega and a few I2C devices such as a Tiny RTC and a Temp and Humidity sensor.  I have read lots about the I2C interface and I think I understand it with the exception of the device address.  Does one assign a device an address (and if so, how does one do that?) or is the device address hard wired into the device in which case how do I read it?

Many thanks for any help

tobyb121

The easiest thing to do is look at the datasheet, this ought to tell you everything you need to know. Some modules have fixed addresses, some have software controlled addresses, some have hardware controlled addresses (where you have a set of pins that determine the address). Datasheets can be very cryptic and it can be a bit of a pain finding what you want, but a search for "address" should help you find what you want.

Tobyb121

Thank you Toby - I guess I just have to dig a little deeper.


dhenry

Quote
Does one assign a device an address


the device manufactuers assign the addresses.

If you code your own slave, you can make it whatever you want.

marco_c

Quote
you can make it whatever you want


... as long as it is unique for the I2C implementation on your project. It should be clear that all devices have unique addresses for a specific implementation.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy