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

Isense and Vbus ADC measurement inaccuracies #8

Open
Erlkoenig90 opened this issue Feb 8, 2024 · 1 comment
Open

Isense and Vbus ADC measurement inaccuracies #8

Erlkoenig90 opened this issue Feb 8, 2024 · 1 comment
Assignees
Labels
internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system

Comments

@Erlkoenig90
Copy link

Describe the set-up

  • NUCLEO-G474RE + X-NUCLEO-SRC1M1
  • STM32CubeIDE Version: 1.14.1

Describe the bug
The measured Isense current and Vbus voltages are somewhat inaccurate (significantly too low) when compared to multimeter measurements.

How To Reproduce

  1. Compile & Run the project Projects\NUCLEO-G474RE\Applications\USB_PD\SNK1M1_Sink.

  2. Provide a power supply to CN3 and measure the current.

  3. Run STM32CubeMonitor-UCPD.

  4. Compare the displayed Ibus with the manual measurement.

Additional context
The ADC calibration is disabled for the STM32G474. This results in a significant offset of the ADC values. In a simple test project, using the ADC without calibration yields similar offsets. Performing the calibration as shown eliminates this issue:

LL_ADC_StartCalibration(VISENSE_ADC_INSTANCE, LL_ADC_SINGLE_ENDED);

Additionally, the two conversion formulas (voltage, current) use VDD_VALUE to calculate the actual voltage:

vadc = (ADCData * VDD_VALUE) / ADC_FULL_SCALE;

However, when jumper JP8 on the NUCLEO board is set to position 1-2, the external reference voltage with value 3.25V is used. This is the default. The two solutions would be:

  • Replace VDD_VALUE by 3250
  • The documentation for the X-NUCLEO-SRC1M1 or for x-cube-tcpp should indicate that JP8 needs to be set to 2-3

Since the measurements are not ratiometric, and the absolute values of both voltages are of interest, it would be desirable to keep using the fixed reference of 3.25V, and adjust the code accordingly.

@HFISTM HFISTM added the internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system label Feb 29, 2024
@HFISTM
Copy link
Contributor

HFISTM commented Feb 29, 2024

ST Internal Reference: 173465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system
Projects
None yet
Development

No branches or pull requests

3 participants