Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in FIFO buffer of the Nano 33 IoT #5

Open
jojo1212 opened this issue Aug 27, 2019 · 4 comments
Open

Built-in FIFO buffer of the Nano 33 IoT #5

jojo1212 opened this issue Aug 27, 2019 · 4 comments
Labels
type: enhancement Proposed improvement

Comments

@jojo1212
Copy link

Use of built-in buffer for LSM6DS3 library for nano 33 IoT.

@falltec
Copy link

falltec commented Aug 28, 2019

Hi everybody!
I am doing a project where I want to transmit the accelerometer data at a frequency of about 100 Hz via Wifi to a server. With the "normal" use of the IMU, there are reading interruptions of 50-400ms (depending on the connection strength). This happens when the microcontroller is busy sending the data via HTML-Post request.
With the Fifo-Buffer, the IMU would be able to save the data for a small amount of time (0.1-1s) and the microcontroller could read it out afterwards. This already worked with the external MPU6050 IMU, but the Nano 33 IoT would be a smaller and better solution.

@sandeepmistry sandeepmistry added the type: enhancement Proposed improvement label Sep 18, 2019
@kaiiorg
Copy link

kaiiorg commented Jun 18, 2020

I've gotten FIFO usage to work in my quick and dirty proof of concept but the device has a limitation: it doesn't tell you what the data you're actually reading off the FIFO is. After a lot of trial and error, I've gotten to the point where I'm reading the data off and am apparently getting two samples of accelerometer data to one same of gyro data. Not sure what's causing that at the moment.

image

@kaiiorg
Copy link

kaiiorg commented Jun 19, 2020

After a lot more poking, prodding, and datasheet reading, I've found that the FIFO_STATUS3 and FIFO_STATUS4 registers correspond to the values I'm getting out of the FIFO. I still haven't quite nailed down what rules are used to determine the correspondence, other than dataset order: 1st dataset is the gyro, 2nd is the accelerometer.

I'm also still not sure why I'm getting two accelerometer readings to one gyroscope reading. And I'm not sure why this data is now in a different order from before. Might have gotten out of sync and everything shifted over.

image

@kaiiorg
Copy link

kaiiorg commented Jun 19, 2020

On closer inspection, it turns out I was decimating the gyro data. Off by one bit when configuring the gyro/accelerometer FIFO settings in LSM6DS3_FIFO_CTRL3.

Order of columns:
gX gY gZ aX aY aZ
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants