2024-07-07 11:42 PM
Hi,
I´m using the TCPP package (inside CubeMX). For my application I also need an ADC channel on the same ADC1 as used by TCPP to measure the Bus voltage. But it seems, that I don´t get any result in my application (configured as DMA). Investigating the problem I was wondering, that the channel configured is not used by USBPD, because only the ADCx->DR is read. The channel defined in usbpd_ADC_SNK.h (#define TCPP01_PORT0_VSENSE_ADC_CHANNEL ADC_CHANNEL_2) is nowhere used in the code... ?
Any idea?
Best regards,
Achim
2024-07-08 11:10 PM
Hi AWack
The Vbus voltage monitoring is already implemented and in the code and used for USBPD.
You can re-use the function for your own needs.
It is in the BSP_USBPD_PWR_VBUSGetVoltage function in the usbpd_pwr_user.c source. I copy it below.
In this case (without BSP) we are not using DMA because we monitor only one channel in this application. So we only reference to TCPP01_PORT0_VSENSE_ADC_INSTANCE.
2024-07-09 02:26 AM
Hi Pascal,
ok, I understand. But this means if I want to use DMA with my application i can just replace LL_ADC_REG_ReadConversionData12(TCPP01_PORT0_VSENSE_ADC_INSTANCE); with the DMA variable?
Best regards,
Achim
2024-07-09 10:51 PM