AnsweredAssumed Answered

STM L3GD20 Gyro and STM32F0 Interrupts

Question asked by FarrellF on Jun 20, 2013
Latest reply on Jun 22, 2013 by FarrellF
I have an STM L3GD20 gyro which I am interfacing with an STM32F0. The gyro has two interrupt pins, and INT2 is specifically labeled "DRDY." I'm under the impression that it can produce a pulse after each sample is captured. So if the gyro data rate is set to 95Hz, I should expect 95 pulses per second on the DRDY line, right?

My goal is use an external interrupt to read the gyro data registers after each sample is captured.

I seem to get one (and only one) pulse AFTER I manually read the contents of the 6 data registers (XL, XH, YL, YH, ZL, ZH). If I manually read those registers ~5 times a second, I get ~5 pulses on DRDY per second, etc.

I have tried bypass mode and FIFO mode. Shouldn't I see a pulse on DRDY every 1/95sec?

I have verified that my I2C transaction is not taking too long: My EXTI ISR reads all six data registers ~1300 times per second (verified by toggling a GPIO and looking at the waveform on a scope.) To get the ISR to trigger I have to manually trigger the EXTI in an infinte loop in main(), or toggle the pin by touching it and letting the 60Hz mains AC couple through my body :)

Has anyone used the L3GD20 gyro and got interrupts working?

I suppose I can work around this problem by setting up a timer, and polling the gyro status register at >95Hz, but it seems like there should be a better way.