2013-11-05 09:21 AM
Okay - I've got data flowing from the L3GD20 into the microcontroller using the DRDY/INT2 signal. As I examine the readings that I am receiving from the sensor chip, though, it appears that I receive ''bogus'' values.
The chip is mounted on a development board, so it isn't moving at all. I would expect to see an unending series of near-zero readings. Several times each second, I get back large positive or negative values (like -4865), which make no sense to me at all. I understand that the readings are in twos complement format. I'm confident that my SPI setup is correct, since (1) the chip is being properly identified during startup and (2) my settings match what the datasheet calls for. I'm also able to see the entire SPI ''conversation'' on my oscilloscope, so I can see that the chip is driving the SDO line in a way that allows the bits to be sampled on the rising edge of SCK. I'm very close to completing this project. Solving this mystery would really help. #spi-data-transfer-reading2013-11-06 12:11 PM
I found the problem. It had nothing to do with the L3GD20 chip - that was working properly. I was taking the readings, adding a 32768 offset and then writing the resulting value to the 16-bit DAC channel for each axis. The SPI setup for the DAC wasn't correct (i.e. the data values were not being sampled on the falling edge of SCK), so the DAC output was acting strange. The readings weren't changing - the DAC output was. Now that the configuration is correct, the voltage signal from the DACs is steady (as it should be).