Page 1 of 1
Problem with I2C accelerometer BMA020
Posted: 23 Feb 2011, 21:11
by diphthong
Hello,
I bought recently an I2C accelerometer. This involves the BMA020 that is built on a board with level converters and various other components, but no other processors. The problem is that I get the part not running. I do not know if the circuit is constructed correctly. Here is the datasheet of BMA020:
http://www.mikrocontroller.net/attachme ... 080114.pdf
and here is a circuit diagram of the circuit board:
http://teamohnename.bplaced.net/pictures/SP_3DBS.JPG
The program looks like this:
http://teamohnename.bplaced.net/picture ... ted%29.nxc
It is the program for controlling the Wii Nunchuk at the NXT, but changed to the values and addresses of BMA020. Another major problem is that I do not know how to send and read nack and acks.
If you could look at you perhaps?
Thank you and
Regards
diphthong
Re: Problem with I2C accelerometer BMA020
Posted: 24 Feb 2011, 08:02
by aswin0
Hi,
Can you tell us how you wired the sensor board to the NXT? And what is the voltage on the data and clock lines? What kind of error does the sensor generate?
Re: Problem with I2C accelerometer BMA020
Posted: 24 Feb 2011, 19:17
by diphthong
Hello,
the board is connected as follows:
Board: GND - GND NXT
SDO - GND
SDI - SDA NXT, 82K Pullup (blue)
SCK - SCL NXT, 82K Pullup (yellow)
CSB - Vdd (ca. +5V) (green)
GND - GND
INT - 470R resistor, LED (The LED lights continuously)
UPullup - nowhere
Enable - nowhere
UIN - Vdd
If the program is not started, are at SCL and SDA 2V, when it is started, at SCL and SDA 2.9 V.
The sensor itself does not generate error messages, the program does not depend on, but there is no video. The program does not even come into the for loop. PlayTone (2000.50); is played, but the second in the for loop will not play. Is there any Problme with the level converters? Could help a PCA9517?
Thank you for your help and
Regards
diphthong
Re: Problem with I2C accelerometer BMA020
Posted: 24 Feb 2011, 20:03
by h-g-t
According to the spec. sheet you provided the max. voltage is 3.6 but you are using 5v. Are you using a resistor or diode to drop the voltage reaching the chip?
Re: Problem with I2C accelerometer BMA020
Posted: 24 Feb 2011, 20:43
by diphthong
The BMA020 even tolerate only 3.6 V, but it's a linear controller installed (see diagram):
http://teamohnename.bplaced.net/pictures/SP_3DBS.JPG
So the board 2.5V to 6V tolerate.
Re: Problem with I2C accelerometer BMA020
Posted: 25 Feb 2011, 08:58
by aswin0
Hi,
Voltage isn't the issue, as you say there is a voltage regulater on the board. It seems there are also pullups installed on the board (R6 & R8), so you do not have to use your own pullups.
I had simular problems with the sensor I made. This was also a 3.5V sensor and it also gave something like 2V on the SCL and SDA lines. In my case the internal inline 4.K resistors that the NXT has on the I2C lines were the cause of the problem. Once I soldered over them the sensor worked fine. These resistors are there to protect the NXT from abuse, so be very carefull when you mess with them.
Concerning the code. When there are problems it is always good to throw away as much code as possible. This gives you (and us) a better idea about the exact location the problems arise. Also, I would check the I2C functions in the manual. Maybe they provide return codes (I don't know as I use another language). these return codes can give you additional information about the nature of the problem.
Succes
Re: Problem with I2C accelerometer BMA020
Posted: 27 Feb 2011, 10:00
by diphthong
Do you think I should open the NXT and unsolder the resistors? I do not really want so much. Is not there another way?
Thanks and
Greetings
diphthong
Re: Problem with I2C accelerometer BMA020
Posted: 27 Feb 2011, 17:20
by mattallen37
That is going to the extreme. In aswin0's case, it was concluded to be the only option (besides using a mediator), and he decided to take the risks. He had done a lot of experimental work (as you would know if you read through the pages of his experiences) before doing so.