jlboygenius Posted August 18, 2013 Report Share Posted August 18, 2013 has anyone been able to run two adxl345s at the same time? I've setup two instances: ADXL345 accel(0x53); ADXL345 accelB(0x1D); and each runs the initialize function: accel.initialize(); accelB.initialize(); and: Serial.println(accel.testConnection() ? "ADXL345 connection successful" : "ADXL345 connection failed"); Serial.println(accelB.testConnection() ? "ADXL345B connection successful" : "ADXL345B connection failed"); When both are connected, the arduio outputs on the serial:Init and that's it. just "Init". When only one is connected, data is retrieved for the working one, but only one can work at a time. I can read data from either one, but not both at the same time. One is wired with SDO high, to allow it to run on 0x1D, the other is wired to SDO low and runs on 0x53. wiring: Both are given grd, 3.3v, Both SCL's are connected in parallel to A5, SDA to A4. Does the wiring need to be different? Can you run both at the same time? Samellanak 1 Quote Link to comment Share on other sites More sharing options...
deamonata Posted August 20, 2013 Report Share Posted August 20, 2013 do you have a logic analyser or failing that a good occiloscope? if you do it would be worth checking to see if you are getting an acknowledge from either of them Quote Link to comment Share on other sites More sharing options...
Tim Posted August 20, 2013 Report Share Posted August 20, 2013 Please forgive me... but I would imagine that because of the serial nature of the 12c bus... that it would be somewhat contentious to wire two separate busses in parallel... I would think it should be in series. The one I am working with has a daisy chain output to pass along uncaptured signals to the next potential device. Tim Quote Link to comment Share on other sites More sharing options...
Jeff Rowberg Posted August 23, 2013 Report Share Posted August 23, 2013 I've never tried to run two at the same time, but one thing that comes to mind (since the wiring seems correct to me) is that perhaps the power requirements for both are higher than the source can provide. They don't take much power and this isn't likely to be an issue unless you're actually providing power from a GPIO instead of a supply pin. A logic analyzer on the SDA/SCL lines would definitely be helpful. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.