EmbeddedRelated.com
Forums
Memfault Beyond the Launch

control several accelerometers

Started by mahsayeh January 28, 2009
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



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 regards
It 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.
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 regards
You need a I2C mux like the 8 channel PCA9547 or use SPI with a seperate CS line for each LIS3LV02DQ
mahsayeh schrieb:
> hi to all > i am trying to control several accelerometers(LIS3LV02DQ) > with one microcontroler(atmega16) using I2C interface
Why 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
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 regards
Because 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
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).

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
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

Memfault Beyond the Launch