tedyapo / arduino-MLX90393

Arduino library for MLX90393 magnetometer sensor
MIT License
49 stars 26 forks source link

reset does not return error status #16

Closed udoklein closed 6 years ago

udoklein commented 6 years ago

Currently reset will always return error code OK. In my opinion it is possible that the command fails. I suggest to return the status from sendCommand instead of discarding it.

tedyapo commented 6 years ago

Thanks for the reports! It don't have a testbed set up for regression tests at the moment. It will probably take a few days to find time to hook up a part so I can verify the changes before merging them in.

tedyapo commented 6 years ago

I pushed the api_cleanup branch which I think has all your recommended changes. It may take a little while until I can test it then merge it in. Until then, you can use that branch if you like.

Thanks for your help!

udoklein commented 6 years ago

I am currently writing a "debug helper" testbed such that I better understand how the library and the chip work. Once I am done I can submit it. So far my understanding is already going up significantly be playing around with the chip.

One thing that struck me is that it appears that I can not read registers from the chip once it is in batch mode. I wonder if this interferes with the cache logic. Do you have any opinion on that? If not: I will find out soon once my debug helper gets more functions. I will then report what I find.

tedyapo commented 6 years ago

It's certainly possible that batch mode prevents you from reading registers; I don't know that I've tried.

Unfortunately, Melexis isn't of much help, either. I've contacted them before and they don't have time for small players.

To learn more, some hacking and experimentation is probably required.

Thanks for reviewing the code and reporting these issues!

On Tue, Jan 9, 2018 at 3:46 PM, Udo Klein notifications@github.com wrote:

I am currently writing a "debug helper" testbed such that I better understand how the library and the chip work. Once I am done I can submit it. So far my understanding is already going up significantly be playing around with the chip.

One thing that struck me is that it appears that I can not read registers from the chip once it is in batch mode. I wonder if this interferes with the cache logic. Do you have any opinion on that? If not: I will find out soon once my debug helper gets more functions. I will then report what I find.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/tedyapo/arduino-MLX90393/issues/16#issuecomment-356408754, or mute the thread https://github.com/notifications/unsubscribe-auth/ATGvQGu8iZ1NLgTaZQt-eW4KjePTleOwks5tI9AMgaJpZM4RYGCI .

udoklein commented 6 years ago

Well, thanks for providing the library in the first place :)

tedyapo commented 6 years ago

fixed in #28

ghost commented 4 years ago

In the latest version of the datasheet it says:

"The MLX90393 only listens to a specific set of commands. Apart from the Reset command, all commands generate a status byte that can be read out."

ghost commented 4 years ago

Reset is messing up my I2C bus and i have to perform a dummy write after doing a reset, otherwise I get an error 121 (on Linux).

tedyapo commented 4 years ago

do you believe that inappropriately reading the status of the reset command is causing your issue?