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

HSCMAND060PA3A3 pressure read #1

Open
j8asic opened this issue Jun 21, 2016 · 2 comments
Open

HSCMAND060PA3A3 pressure read #1

j8asic opened this issue Jun 21, 2016 · 2 comments

Comments

@j8asic
Copy link

j8asic commented Jun 21, 2016

https://github.com/MikroElektronika/Click_Manometer_HSCMAND060PA3A3/blob/master/library/src/manometer_hw.c#L117

0x1F should be changed to 0x3F to correctly read 14-bit pressure that HSC offers.

Regards,
Josip

@JavaWantaBe
Copy link
Contributor

Thanks Josip, but I am only anding the first byte, then appending the
second byte onto it after a shift of 8. So I am getting full 14bit
resolution.

output = ( (uint16_t)( read_val[0] & 0x1F ) << 8 ) + read_val[1];

On Tue, Jun 21, 2016 at 1:26 PM, Josip Basic notifications@github.com
wrote:

https://github.com/MikroElektronika/Click_Manometer_HSCMAND060PA3A3/blob/master/library/src/manometer_hw.c#L117

0x1F should be changed to 0x3F to correctly read 14-bit pressure that
HSC offers.

Regards,
Josip


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1,
or mute the thread
https://github.com/notifications/unsubscribe/AAhnaer73sFEEAFoFvVwJOujB1d-k3FAks5qN8p_gaJpZM4I6oJu
.

@j8asic
Copy link
Author

j8asic commented Jun 22, 2016

You're getting 13-bit resolution: max(read_val[0] & 0x1F) + max(read_val[1]) = 7936 + 255.
Since 0x1F = 0b11111, you're missing one bit. You need 6 bits from read_val[0], as the status takes 2 bits. Thus I believe 0x3F = 0b111111 is needed.

@j8asic j8asic closed this as completed Jun 22, 2016
@j8asic j8asic reopened this Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants