Accellorometer troubles
Philldapill
Posts: 1,283
I recently ordered some samples of ST's LIS3LV02DL Accellorometer chips. They are three axis, 16-bit chips. Sparkfun sells a breakout board for a similiar chip, LIS3LV02DQ. The datasheets for these chips are nearly identical. I've made my own little PCB, laid out as per the datasheet/sparkfun's design. I am using Tim Moore's OBEX object for the board that sparkfun sells. Here is my problem...
When I connect my board to the propeller using pins 0 and 1(instead of Tim's pin 28/29), I think I can get the chip to "talk" to the propeller. I think this is happening, because after the I2CScan command, the program stops hanging. If I don't have anything connected, the program hangs on that command until I plug the PCB in, then it goes from there. Does this mean that the I2C interface is finding the chip? After this, the values that the object fetches from the chip are not accurate at all.... Always "256" for each X, Y, and Z axis. Also, when I look at the SDA and SCL lines, I see bursts of activity... It's nearly 1am and I need help. [noparse]:([/noparse]
When I connect my board to the propeller using pins 0 and 1(instead of Tim's pin 28/29), I think I can get the chip to "talk" to the propeller. I think this is happening, because after the I2CScan command, the program stops hanging. If I don't have anything connected, the program hangs on that command until I plug the PCB in, then it goes from there. Does this mean that the I2C interface is finding the chip? After this, the values that the object fetches from the chip are not accurate at all.... Always "256" for each X, Y, and Z axis. Also, when I look at the SDA and SCL lines, I see bursts of activity... It's nearly 1am and I need help. [noparse]:([/noparse]
Comments
Without looking at your code, it's hard to tell what the problem is.
Common mistakes... Are the SDA and SCL lines swapped? Are you using pull-up resistors on the SDA and SCL lines?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
And no, Beau, I've tried flipping the SDA and SCL. This is the only combination that allows anything to happen in the program. I have a pull-up on CS, as per the datasheet/Tim's documentation/sparkfun's board. No pull-ups on SDA and SCL currently, but with them on there, the same result happens... Like I said, there is some kind of data on the SDA and SCL lines when I look at it on the scope, but it comes in bursts.
"When I connect my board to the propeller using pins 0 and 1(instead of Tim's pin 28/29), I think I can get the chip to "talk" to the propeller" - as a sanity check, can you get it to communicate using pins 28 and 29?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Now, for some reason, the output of the chip is in multiples of 256. My assumption is that the configuration is somehow set to 16-bit, but the chip is outputting 8-bit or vise versa?
I looked at the datasheet, and it seems the LIS3LV02DQ and LIS3LV02DL are virtually identical - just different packages. The LIS302DL is in fact an 8-bit version(not the chip I have). Sorry about that bad description - it was late at night, and I had a a killer cold coming on.