Hello all, thanks for looking at this post. This is my first electronics project, and I am looking for some input on why I am getting irregular, blank data (output is simply 0,0,0) from my ADXL313 boards from time to time.
The Story: I am currently working on building an accelerometer tool where an Arduino Uno collects data from three individual ADXL313 eval boards and sends that data to a host computer serially. For this prototype setup, the Arduino samples all three ADXL313 boards sequentially at 1000 Hz via SPI communication, then the Arduino does some calculations, and then it sends that data immediately to a serial COM port on the computer (I use puTTY to see the data). I use a timer counter interrupt to initiate the accelerometer sampling routine, so there are instances where the Arduino cannot send the desired data fast enough before the next interrupt is triggered, but that is a separate issue for later.
The Problem: My problem is that there are times where everything runs smoothly, where the data is displayed nicely on the terminal emulator, but then I will reprogram the Arduino with virtually identical code (only change what values are sent serially, no change in number of bytes sent) and I now get data which is extremely noisy because every second or third sample only displays "0,0,0" for x,y,z acceleration, which is clearly a bug and not normal. Sometimes, I only get a stream of zeros!
Has anyone seen this issue before and been able to pin point the root cause? It does not seem like it would be due to a faulty chip, since I am using three of them and they all experience the same symptoms.
The Details: Here is a summary of the ADXL313 parameters (each of the three programmed the same):
- Full resolution mode, +/- 2 g range, right justified data
- ODR at 3200 Hz
- SPI clock at 5 MHz
- Basic operation: no FIFO, always in measurement mode
- Multiple byte read every 1 ms (1000 Hz sample rate)
- idk what else is relevant here...
Any and all help is most appreciated! I can upload parts of my firmware code if you need more information from me to help figure out my issue. I have been stumped by this for a bit over two weeks now, but I will let you all know if I have progress on my own. Thanks.