Closed xlfe closed 3 years ago
It was quite some time ago I wrote that code. I cannot remember exactly how I tested it, so thanks for your feedback. I will probably have a look at it, at a later time, because I am currently busy with other projects.
@tomtor of course - just happy having logged an issue to help anyone having similar problems. Thanks for your initial code - it helped a lot getting the esp32 to do what I wanted!
@xlfe I want to read data from a bme280. Is your code open source? Or any chance I could get the relevant parts?
Edit: Just found your repository. Thanks for both of your work!
Hi yes it's here https://github.com/xlfe/ulp-i2c
On Fri, 22 Jan 2021, 10:20 pm DominicD, notifications@github.com wrote:
@xlfe https://github.com/xlfe I want to read data from a bme280. Is your code open source? Or any chance I could get the relevant parts?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomtor/ulp-i2c/issues/3#issuecomment-765333425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI7RO7CZDEUWPEWFNYHYATS3FNOJANCNFSM4FMUBBFA .
is that any working example for bme280 using spi-ulp
Hi yes it's here https://github.com/xlfe/ulp-i2c … On Fri, 22 Jan 2021, 10:20 pm DominicD, @.***> wrote: @xlfe https://github.com/xlfe I want to read data from a bme280. Is your code open source? Or any chance I could get the relevant parts? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI7RO7CZDEUWPEWFNYHYATS3FNOJANCNFSM4FMUBBFA . is that any working example for bme280 using spi-ulp
I used your code to read from a bmp280, but I kept getting strange values - I traced it back to the read16 function - it looks like the bytes were being read in reverse order?
Hi @xlfe
It has taken a long time, but I dusted off this project and running the current code for BMP180 and it prints the correct pressure and temperature.
When I compare
and
the code looks identical, so my read16() is producing a similar result as the Arduino read16.
Correct byte order is always a tricky issue, but compatibility with existing Arduino code is nice, so I don't think the bytes are reversed. You are also the only one reporting this issue.
If you don't agree or have other suggestions, please let me know, because I might be missing something.
No recent activity, code verified to run correctly.
Did some more research, I2C 16 bit transfers are most significant byte first, which is implemented in read16
and write16
.
I used your code to read from a bmp280, but I kept getting strange values - I traced it back to the read16 function - it looks like the bytes were being read in reverse order?
https://github.com/xlfe/ulp-i2c/commit/98e453dff33230174d68896905815564586f92f9#diff-1123c8cab49efa03f9998c97c9d6c2d0