hi to all i am trying to control several accelerometers(LIS3LV02DQ) with one microcontroler(atmega16) using I2C interface and my problem is how to adress the slaves(accelerometers).all of the slaves have the same adress in Who Am I register in other words i dont know what must be written in SLA+R/W section, Thank you for any help best regards
control several accelerometers
Started by ●January 28, 2009
Reply by ●January 28, 20092009-01-28
On Jan 28, 1:13 pm, "mahsayeh" <mehrnoosh...@gmail.com> wrote:> hi to all > i am trying to control several accelerometers(LIS3LV02DQ) > with one microcontroler(atmega16) using I2C interface and my problem > is how to adress the slaves(accelerometers).all of the slaves have the > same adress in Who Am I register > in other words i dont know what must be written in SLA+R/W section, > Thank you for any help > best regardsIt would be easier to use the analog accelerometers. Some AVRs have 16 channels and you can read from 5 3-axis accelerometers at the same time.
Reply by ●January 28, 20092009-01-28
On Jan 28, 4:13=A0pm, "mahsayeh" <mehrnoosh...@gmail.com> wrote:> hi to all > i am trying to control several accelerometers(LIS3LV02DQ) > with one microcontroler(atmega16) using I2C interface and my problem > is how to adress the slaves(accelerometers).all of the slaves have the > same adress in Who Am I register > in other words i dont know what must be written in SLA+R/W section, > Thank you for any help > best regardsYou need a I2C mux like the 8 channel PCA9547 or use SPI with a seperate CS line for each LIS3LV02DQ
Reply by ●January 28, 20092009-01-28
mahsayeh schrieb:> hi to all > i am trying to control several accelerometers(LIS3LV02DQ) > with one microcontroler(atmega16) using I2C interfaceWhy I2C?> and my problem > is how to adress the slaves(accelerometers).all of the slaves have the > same adress in Who Am I register > in other words i dont know what must be written in SLA+R/W section,I2C is the cause for your problem here. Why not try SPI and CS for each chip? If you don't have enough outputs, a demultiplexer (like 74*138) may help. Falk
Reply by ●January 28, 20092009-01-28
In article <IK-dnYumbubtVx3UnZ2dnUVZ_rTinZ2d@giganews.com>, mehrnoosh.sh@gmail.com says...> hi to all > i am trying to control several accelerometers(LIS3LV02DQ) > with one microcontroler(atmega16) using I2C interface and my problem > is how to adress the slaves(accelerometers).all of the slaves have the > same adress in Who Am I register > in other words i dont know what must be written in SLA+R/W section, > Thank you for any help > best regardsBecause no pins of this device are dedicated as slave address pins, you can't have more than one on the I2C bus. An alternative is to supply a chip select signal for each device, and then use SPI, which it also supports. --Gene
Reply by ●January 28, 20092009-01-28
mahsayeh wrote:> hi to all > i am trying to control several accelerometers(LIS3LV02DQ) > with one microcontroler(atmega16) using I2C interface and my problem > is how to adress the slaves(accelerometers).all of the slaves have the > same adress in Who Am I register > in other words i dont know what must be written in SLA+R/W section, > Thank you for any help > best regards >If you have enough pins on the microcontroller, you can use a separate I2C interface for each device (bitbanged I2C master is easy to do).
Reply by ●January 29, 20092009-01-29
Gene S. Berkowitz wrote:> Because no pins of this device are dedicated as slave address pins, you > can't have more than one on the I2C bus.Two on the same bus, actually. One is connected as usual, the other one by bit banging with SCL and SDA swapped. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by ●January 29, 20092009-01-29
In article <%Ymgl.14483$yr3.3731@nlpi068.nbdc.sbc.com>, antispam_bogus@hotmail.com says...> > > Gene S. Berkowitz wrote: > > > Because no pins of this device are dedicated as slave address pins, you > > can't have more than one on the I2C bus. > > Two on the same bus, actually. One is connected as usual, the other one > by bit banging with SCL and SDA swapped. >Would it be feasible to do 3 accelerometers by bit-banging using just 4 pins---a separate SCL line for each accelerometer and a common SDA line? I can't remember the I2C specs well enough to recall whether the SDA line from the device stays high (OC off) when the SCL line is stable. Mark Borgerson