-
Notifications
You must be signed in to change notification settings - Fork 18
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
read16 has bytes swapped? #3
Comments
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, ***@***.***> 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 |
|
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 ulp-i2c/main/ulp_example_main.c Line 98 in 6c7996d
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 |
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?
xlfe@98e453d#diff-1123c8cab49efa03f9998c97c9d6c2d0
The text was updated successfully, but these errors were encountered: