AnsweredAssumed Answered

ADXL345 not returning DevID correctly via SPI

Question asked by RonW on Apr 9, 2013
Latest reply on Apr 19, 2013 by neilzhao

I'm using LabVIEW to bit-bang an ADXL-345 via SPI. Because of DAQ hardware limitations I'm running SCLK very slowly - about 400 bps.

 

I'm trying to get the SPI communications working, and am having trouble reading the device ID. I have a 4-channel scope hooked up and it looks to me like I'm generating all the signals correctly, but the device is responding incorrectly. I have no idea what I could be doing wrong.

 

If the DevID request has the multiple byte bit (MB) cleared, the response cycles through three values: x00, xC7 and x8E.

If MB is set, the response is always xC0, unless it's the first ID request after an ID request with MB not set, in which case the response depends on the non-MB response. Here are the patterns:

 

1. DevID Rq w/o MB: Returns x00

2. DevID Rq w/o MB: Returns xC7

3. DevID Rq w/o MB: Returns x8E

4. Goto 1.

 

1. DevID Rq w/o MB: Returns x00

2. DevID Rq w/ MB: Returns xC0

3. Goto 2.

 

1. DevID Rq w/o MB: Returns xC7

2. DevID Rq w/ MB: Returns x80

3. DevID Rq w/ MB: Returns xC0

4. Goto 3.

 

1. DevID Rq w/o MB: Returns x8E

2. DevID Rq w/ MB: Returns x00

3. DevID Rq w/ MB: Returns xC0

4. Goto 3.

 

Following are screen captures from the oscilloscope. In all cases:

Ch1 is /CS

Ch2 is SCLK

Ch3 is SDI (i.e. data to the chip)

Ch4 is SDO (i.e. data from the chip)

 

Dev ID w/o MB. Returned value x00:

DevIDx00.BMP

 

Dev ID w/o MB. Returned value xC7:

DevIDxC7.BMP

 

Dev ID w/o MB. Returned value x8E:

DevIDx8E.BMP

 

Dev ID w/ MB. Returned value x00:

DevIDMBx00.BMP

 

Dev ID w/ MB. Returned value x80:

DevIDMBx80.BMP

 

Dev ID w/ MB. Returned value xC0:

DevIDMBxC0.BMP

Any insight would be appreciated.

Outcomes