Is there a way to debug accelerometer connection issues?
-
PS - you initially had this according to the error message:
M955 P0 C"spi.cs4+spi.cs3" ; configure accelerometer
but your config.g has this:
M955 P0 C"spi.cs3+spi.cs4" ; configure accelerometer
Which are you using? I think spi.cs3+spi.cs4 is correct for your wiring scheme.
-
@dc42 the white wire is the SCL pin
-
@dc42 said in Is there a way to debug accelerometer connection issues?:
PS - you initially had this according to the error message:
M955 P0 C"spi.cs4+spi.cs3" ; configure accelerometer
but your config.g has this:
M955 P0 C"spi.cs3+spi.cs4" ; configure accelerometer
Which are you using? I think spi.cs3+spi.cs4 is correct for your wiring scheme.
I had originally tried M955 P0 C"spi.cs3+spi.cs4" per my config.
When I was running out of ideas, I tried reversing it. I must have picked up the error message from the latter.This breakout board has QT connections available. Otherwise it's identical.
OK, I see the pin connection now. Is that the newer version of the Adafruit board? What >is the pin between GND and SDA (white wire)?
The pin between VIN and GND says 3V. I had been using VIN, but as that would be 5V on the arduino and 3V on the duet, I just tried again using the 3V pin.
Same result. Unit powers up, but is not found.
Data sheet
https://cdn-learn.adafruit.com/assets/assets/000/085/846/original/lis3dh.pdf?1576396666Schematic
https://learn.adafruit.com/assets/94435The data sheet says that the CS pin must be brought low to enable SPI and it defaults to I2C
Could this be the issue? -
Have you tried using a different Duet pin to connect CS to? E.g. spi.cs1
-
@dc42 said in Is there a way to debug accelerometer connection issues?:
Have you tried using a different Duet pin to connect CS to? E.g. spi.cs1
Just tried it.
Moved green wire (CS) to spi.cs1
Same result.
On a side note, there seem to be two wiring diagrams floating around.
One says it's CS1 and the other CS0https://d17kynu4zpq5hy.cloudfront.net/igi/duet3d/JPWtqVWwLBxCAKyP.huge
https://d17kynu4zpq5hy.cloudfront.net/igi/duet3d/vqBUAZPsxMC5tRgt.huge
The one that says CS0 can be found here
https://duet3d.dozuki.com/Guide/2.)+Wiring+your+Duet+2+WiFi-Ethernet/9 -
OK.
I just tried wiring directly to the LIS3DH using 150mm jumpers and it works!
Strange that the other cable works on an arduino.
Would it be better to use cable that has twisted pairs?
I thought the shielded cable would be a good option. -
@owend What kind of cable are you using? Another user and I had good success with USB 3 cables (mine is 3m long).
-
@diamondback
I was using 9 core shielded
https://www.altronics.com.au/p/w2712-9-core-shielded-data-cable/I'm about to try some CAT5 data cable (4 x twisted pairs)
I'll report back. -
@owend Ok, I tried single twisted pairs first, ie basically the inner part of CAT 5 cable without any shielding, and that didn't work for me. The USB cable is both twisted and shielded multiple times, I connected all the shielding to GND as well.
-
Success!
For me a piece pf CAT5E cable worked.
I'm reasonable confident the connections on the first cable are sound.
Perhaps a better choice would be the USB cables suggested or maybe CAT6 shielded cables?Now I have some data...
Just have to work out what to do with it -
@owend said in Is there a way to debug accelerometer connection issues?:
Success!
For me a piece pf CAT5E cable worked.
I'm reasonable confident the connections on the first cable are sound.
Perhaps a better choice would be the USB cables suggested or maybe CAT6 shielded cables?Now I have some data...
Just have to work out what to do with itAwesome!
-
@owend said in Is there a way to debug accelerometer connection issues?:
Perhaps a better choice would be the USB cables suggested or maybe CAT6 shielded cables?
An oscilloscope would allow you to look at the signals and see if they are missing or distorted.
-
@zapta said in Is there a way to debug accelerometer connection issues?:
An oscilloscope would allow you to look at the signals and see if they are missing or distorted.
True. But out of the reach of many of us.
In my original post topic I was hoping that RRF could somehow self diagnose communication on each pin.
It seems like it's going to be pretty critical to get cables just right for this to work. -
@owend said in Is there a way to debug accelerometer connection issues?:
True. But out of the reach of many of us.
That's correct. Digital oscilloscope prices went down very significantly but it's still a significant amount of money.
I was hoping that RRF could somehow self diagnose communication on each pin.
Let's see if future generations of Duet boards will have an accelerometer connector that will work out of the box with the optional Duetcelerometer module.
-
I have made the accelerometer SPI clock frequency configurable and reduced the default from 4MHz to 2MHz. I expect this will make it easier to obtain a connection. These changes will be in RRF 3.3RC1.
-
What kind of issue do i have?
1.5.2021, 15:42:23: M955 P0 C"spi.cs2+spi.cs3": Accelerometer 0:0 with orientation 20 samples at 1344Hz with 10-bit resolution
M956 P124.0 S10 A0
1.5.2021, 15:45:43: M98 P"0:/macros/ACC": Error: Response timeout: CAN addr 124, req type 4014, RID=0
-
@clownsrache after sending that M955 command, what does M955 without parameters respond with?
-
RRF 3.3RC1 with configurable accelerometer SPI frequency is now available at https://github.com/Duet3D/RepRapFirmware/releases/tag/3.3RC1.
-
@diamondback how would u use a USB cable? it only has 4 wires but we need 7 for the adafruit accelerometer
-
@tekstyle I have had good results with ribbon cable, ensuring that the CS wire is not next to any other signal wires. See the images and description at https://duet3d.dozuki.com/Wiki/Accelerometers#Section_Direct_SPI_connection_to_a_Duet_main_board.