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

inconsistent unit on setBusConversion #19

Merged
merged 1 commit into from Aug 3, 2018

Conversation

avaldebe
Copy link
Contributor

@avaldebe avaldebe commented Aug 2, 2018

Description

On setBusConversion and setShuntConversion should the unit for convTime parameter μs.
Therefore, the if/else clauses for the higher 4 ranges of the INA226 correspond to 82.440 μs,
41.560 μs, 21.160 μs and 11.000 μs. which is one order of magnitude higher than the values on Tables 7 and 8 on the datasheet.

Fixes #18
** PLEASE NOTE ** that this PR is targeted to the master branch. If I should target other branch, just met me know and I'll work it out.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Compile own INA based project for the ATmega328p

Test Configuration:

  • Arduino version: Platform Atmel AVR, from PlatformIO
    • atmelavr 1.9.0
    • toolchain-atmelavr 1.40902.0
    • framework-arduinoavr 1.10621.1
  • Arduino Hardware: None so far, just complied the code
  • SDK: PlatformIO, version 3.5.4

Checklist:

  • The changes made link back to an existing issue number
  • I have performed a self-review of my own code
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation / Wiki Page(s)
  • My changes generate no new warnings
  • I have checked potential areas where regression errors could occur and have found no issues
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@SV-Zanshin SV-Zanshin merged commit 9c4e126 into Zanduino:master Aug 3, 2018
@mattlogic
Copy link

It looks like something went wrong with this merge. The BackgroundRead.ino file looks OK and its history shows this merge, but the INA.cpp file history does not show this merge, and INA.cpp still has the old 82440/41560/21160/11000 values.

@SV-Zanshin SV-Zanshin self-assigned this Mar 17, 2019
SV-Zanshin pushed a commit that referenced this pull request Mar 17, 2019
@SV-Zanshin
Copy link
Collaborator

Looking at Tables 7 and 8 they show a maximum conversion time at VBUSCT or VSHCT setting "111" binary of 8.244ms. This is the same as 8244us which would indicate that the 4 higher values are indeed still incorrect.

Corrections made to code and uploaded

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

Successfully merging this pull request may close these issues.

inconsistent unit on setBusConversion
3 participants