QUESTION ABOUT FIR(MLX90640) CONNECTION

Discussion related to "under the hood" OpenMV topics.
Raul_
Posts: 7
Joined: Fri Jan 11, 2019 8:19 am

QUESTION ABOUT FIR(MLX90640) CONNECTION

Postby Raul_ » Fri Jan 18, 2019 4:45 am

hi! engineers from Openmv. I just bought a openmv and meet a problem when I connect it to a mlx90640 sensor. I download your new released IDE and when I tried to run the program it tells me it cannot read the data. Can you help me?

By the way, openmv is really a good product. Thanks for your work!
Attachments
微信图片_20190118174630.jpg
微信图片_20190118174619.jpg
Capture.PNG
User avatar
kwagyeman
Posts: 2798
Joined: Sun May 24, 2015 2:10 pm

Re: QUESTION ABOUT FIR(MLX90640) CONNECTION

Postby kwagyeman » Fri Jan 18, 2019 12:45 pm

That would be an I2C error. Um, did the init method succeed?

The error is caused by this code: https://github.com/openmv/openmv/blob/m ... _API.c#L48

Um, also, keep in mind the FPS on the MLX sensor. So, you cannot run it at a very high sample rate in hz. The default sample rate we supply is about the max that you can hit. If you go lower with it that also might be better. If the I2C connection is good then what's happening is that the MLX sensor is running too fast and is overwriting it's internal frame buffer before we have a chance to read it out over I2C. The MLX API driver throws an error when this happens and that's what you are seeing. Slowing down the sensor refresh rate will fix the issue. Given the resolution of the MLX sensor it's not actually possible to pull the image at the max refresh rate they support over I2C easily without going above 400 KHz which then starts to cause issues related to wire length.

...

I can speed the I2C bus up however if you think it might be needed... would need to change our driver for it though to support multiple freqs.
Nyamekye,
Raul_
Posts: 7
Joined: Fri Jan 11, 2019 8:19 am

Re: QUESTION ABOUT FIR(MLX90640) CONNECTION

Postby Raul_ » Sat Jan 19, 2019 1:08 am

kwagyeman wrote:
Fri Jan 18, 2019 12:45 pm
That would be an I2C error. Um, did the init method succeed?

The error is caused by this code: https://github.com/openmv/openmv/blob/m ... _API.c#L48

Um, also, keep in mind the FPS on the MLX sensor. So, you cannot run it at a very high sample rate in hz. The default sample rate we supply is about the max that you can hit. If you go lower with it that also might be better. If the I2C connection is good then what's happening is that the MLX sensor is running too fast and is overwriting it's internal frame buffer before we have a chance to read it out over I2C. The MLX API driver throws an error when this happens and that's what you are seeing. Slowing down the sensor refresh rate will fix the issue. Given the resolution of the MLX sensor it's not actually possible to pull the image at the max refresh rate they support over I2C easily without going above 400 KHz which then starts to cause issues related to wire length.

...

I can speed the I2C bus up however if you think it might be needed... would need to change our driver for it though to support multiple freqs.
Thank you very much for your detailed reply. I change the refresh rate from 16 to 4, to 1 or any smaller value, but the problem still exists.
The heat map doesn't always show, sometimes it just show nothing and return an error.
Attachments
Capture.PNG
Capture.PNG (9.37 KiB) Viewed 191 times
2.PNG
User avatar
kwagyeman
Posts: 2798
Joined: Sun May 24, 2015 2:10 pm

Re: QUESTION ABOUT FIR(MLX90640) CONNECTION

Postby kwagyeman » Sat Jan 19, 2019 2:49 am

Can you give me some more information? It works for me with my MLX 90640 sensor from SparkFun. I notice you are using a different sensor. Do you see any other behavior? Some I can know what went wrong? That error is generated only via with the I2C bus not getting an ACK on reading or the sensor generating data too fast and not being read fast enough by the M7 camera.
Nyamekye,
Raul_
Posts: 7
Joined: Fri Jan 11, 2019 8:19 am

Re: QUESTION ABOUT FIR(MLX90640) CONNECTION

Postby Raul_ » Sat Jan 19, 2019 6:02 am

kwagyeman wrote:
Sat Jan 19, 2019 2:49 am
Can you give me some more information? It works for me with my MLX 90640 sensor from SparkFun. I notice you are using a different sensor. Do you see any other behavior? Some I can know what went wrong? That error is generated only via with the I2C bus not getting an ACK on reading or the sensor generating data too fast and not being read fast enough by the M7 camera.
I spend a whole day trying to find out what's wrong and finally find that I should change the baud rate and refresh rate to make it consistent with your library. Also, I connect PS to GND and it works!

Again, I want to thank you for your help!

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests