I don´t use external pullups. I use the Arduino DUemilanove-Board directly to cennect with the BMA020.
Do you mean this doesn´t work? Can you give me some advice how to get this Sensor working?
no i have no acces to an oszilloscope. But i was wrong, the arduino board has external pullups. I think all cables are conectet correctly. The problem must be in the sketch.
The best will be if someone can give me a correct sketch which works with my combination of arduino board and BMA020.
First off that IC is not a 5 volt tolerant device so you need to connect a level translator to bring the IO levels down to the supply voltage you're using on VDDIO.
Secondly, when using I2C you need to use the 7bit address for the IC, which in this case is 0x38. Next you need to uncomment the first Wire.endTransmission, because you need it, and then delete the second Wire.endTransmission() because you don't need it.
Also try reading the value from the Chip ID register, address 0x00, and it should return a 2, that way you know for sure you're communicating with the device.
the only question i have is, why is the adress 0X38 and not 0x70 as described in the datasheet?
It's actually both. The 8 bit address is 0x70 for a write operation and 0x71 for a read operation. Since the Arduino knows that bit 0 will toggle between 0 and 1 it has you only enter the 7 bit address (8 bit shifted to the right by one) for all I2C devices.
I try to run the sensor with your code, but I have some problems translating the output to decimal numbers. Can you please explain what you do to read the values?
The communication is working. If i read the address 0x00 it returns a 2.
i have to correct myself - Of Course the ic itself can NOT handle 5v - however i use the IC on a breakout board deliverd/made by elv which has the level translator on board.
Well if you're confident you have it wired up correctly and the above code is not returning a 2 then there may be something wrong with the sensor. I can see that your link has additional pins on the breakout board. Do you have a link to that schematic by any chance?
Ok... I wrote a little programm to run through all possible i2c adresses und requesting de 0 register... None of them returns a 2(what the bma020) is supposed to do....so it seems that the bma is not communicating on the bus at all.
Is there mistake in the wiring or the code i posted above? Its really starting to drive me crazy ,)