![]() |
ADXL345 accelerometer problems
We are having trouble getting our accelerometer to work. I have it hooked up to the digital sidecar with I2C, and am getting no reading from it.
We are using the 8 slot crio with java. Everything has been updated to the latest. Any ideas? |
Re: ADXL345 accelerometer problems
We need more info
How is it wired? What is it wired to? How are you programming it (what is the code)? |
Re: ADXL345 accelerometer problems
It is wired using the 4 i2c pins of the accelerometer to the 4 i2c pins on the digital sidecar.
Here is our code: Code:
package edu.wpi.first.wpilibj.templates; |
Re: ADXL345 accelerometer problems
And all of the wires are straight through? (VCC to VCC, SCL to SCL, SDA to SDA, GND to GND)
And can you get a voltage on SDA and SCL? They should be around 5 volts. If possible, an oscilloscope would be useful in determining whether or not the I2C bus is working. You should hook up a probe to the SDA line, and confirm that the bits are changing. |
Quote:
|
Re: ADXL345 accelerometer problems
Just checking... ;) And the voltage?
|
Not sure about the voltage.
I will check it tomorrow. |
There is about 4.6 volts on the sda and scl.
I am getting a square wave on the scope, but not really sure what I am looking for. |
Got it working!
Used the flat db37 cable included in this years Kop, instead of the old round one. |
Re: ADXL345 accelerometer problems
Interesting. We are having the same problem. We tried replacing the old round cable with the flat one and nothing worked. I'm certain that the flat cable is either bad or just needs to be re-built (currently working on that one). However, I'm curious why the flat cable would work in your situation as opposed to the round cable.
We have hooked our accelerometer up to an o-scope and all seems fine. Does anyone else have any other suggestions? |
Quote:
|
Re: ADXL345 accelerometer problems
That's what we just did and sure enough it worked. Makes sense as when we Ohm'ed it out, pin 1 went to pin 15 on the other end. I didn't think to check the KoP website, but I'm definitely going to check it out. It still seems like a curious situation that the flat works for the accelerometer but the round doesn't. :-/ Oh well, I'll take it at face value for now.
Thanks for the follow up! |
Re: ADXL345 accelerometer problems
Hello all,
We are having the same problem. We are using Java, and I can see traffic on the i2c bus with a scope, but no way to decode it. Signal integrity looks ok, clocking as expected and I can see packets, but no analyzer to decode the traffic. Symptom is no values returned. We don't have labview and so far I am unable to find the wiring diagram or any diagnostic. Based on this thread I also tried both flat and round cables between cRio and side car. I used the code in one of the threads and it is simple enough that shouldn't be the issue. If anyone has it working can you post a photo of the sidecar wiring? Also, do we have to provide our own pullup resistor on CS? The datasheet says one is required for i2c, but it an external one does not seem to help the situation. Could be two problems though. Thanks in advance! Bob |
Re: ADXL345 accelerometer problems
Hello all,
(Apologies if replying to myself is bad form, just wanted to let this thread know the problem was solved.) Hello all, I found it - it was multiple faulty cables to the sidecar. The only one that works is a new flat cable from this year that I repaired according to the instructions on the KoP site. It looks like I probably had two problems at the beginning and after I fixed the other one, had the faulty cable issue. Once I got it running, it has been stable. I will post some photos is anyone is interested in seeing some documentation of an end to end system including some scope shots of traffic. I guess the "bad" cables must be good enough for the low order PWMs and other channels we were using to fool me. So the moral of the story, even if you are sure your round cable is good, ONLY use a new flat cable without a twist until you get it working. Then switch other items one at a time so if it stops working you know what it was that went wrong. Thanks to all who replied! Bob |
Re: ADXL345 accelerometer problems
Quote:
Quote:
Has anyone managed to use I2C with the original white 37-pin cable? |
| All times are GMT -5. The time now is 08:09. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi