High speed acceelro/gyro data #7929
-
|
Hello, I have been trying to get a consistent higher data rate from the LSM6DS3TR-C on the Puck.js. Getting data points one by one using the high level interface works well at lower rates, but at higher rates it is trickier. The chip should be able to do high speeds like 1.66khz, or thereabout? The question is: Has anybody implemented the fifo on this chip, and then piped the contents into memory in bursts? I'm going through the manual for the chip, and there should be a magic combination, but I'm certainly missing some subtleties. Any code examples would be welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
I have looked through the manual for the LSM6DS3TR-C, and set up a program which initiates the fifo on the puck, starting at 12.5hz to keep things easy, and then empties the fifo every second by reading the registers. This process takes about 200ms, which is not good, if we want to increase the frequency. Certainly, 208hz whould be out of the question with this method, and even at 108hz, we would be running out of headrom pretty fast. So I can be a bit more specific: is there some way of pulling all available bytes from the fifo in one go, rather than using the for loop towards the end of the code? We know how many pairs of bytes there are, thanks to the fifo status registers, this is the variable n. I'm sure I'm missing something, since I have no experience working with I2C. |
Beta Was this translation helpful? Give feedback.
-
|
Hi - yes, the reading individually from the FIFO isn't great - usually you could do a single large I2C read of Instead, since the Puck uses software I2C anyway, you should be able to set up your own I2C instance and use that. Something like this should work: I could extend |
Beta Was this translation helpful? Give feedback.
Hi - yes, the reading individually from the FIFO isn't great - usually you could do a single large I2C read of
n*2bytes and that'd be ok, but thePuck.accelRdfunction was only really for convenience and doesn't handle this.Instead, since the Puck uses software I2C anyway, you should be able to set up your own I2C instance and use that. Something like this should work:
I could extend
Puck.accelRdto allow you to read more data, but that'd require you to install a new firmware.