The CCG5 has a current sensing sensor for detecting current flowing and performing current limiting.
I would like to use this function (sensing CSP/CSN) to get real value of current passing through kelvin sensor using ADC.
I looked through all the available sources, but I did not find the use of ADC to get value from current sensor.
But after reviewing new SDK 3.3, it is clear that for CCG5C it is possible to use VBUS current monitoring along with VBUS voltage.
How can I get values of current from CSP/CSN sensor (also known as CSA in the code) on CCG5, using ADC or any other method?
Thanks in advance.
CCG5 can refer below implement for CCG5C/6.
You could use latest SDK V3.3 (LINK: https://www.cypress.com/documentation/software-and-drivers/ez-pd-host-software-development-kit ). CCG5 can use EZ-PD HOST SDK.
You could get a API in the firmware or EZ-PDTM CCGx Firmware Stack API Reference Guide Version 3.3.0
In firmware @file pdss_mxhal.c, function uint16_t pd_hal_measure_vbus_cur(uint8_t port).
In EZ-PDTM CCGx Firmware Stack API Reference Guide Version 3.3.0, section 126.96.36.199 pd_hal_measure_vbus_cur().
You could use this API to get VBUS current value which is sensing CSP/CSN.
Do I need to change something here that, since for CCG5 return always 0?
/* Sample the VBus current using ADC. */
uint16_t pd_hal_measure_vbus_cur(uint8_t port)
uint16_t current = 0;
#if ((defined(CCG5C)) || (defined(CCG6)))
#endif /* ((defined(CCG5C)) || (defined(CCG6))) */
#if (defined(CCG3PA) || defined(CCG3PA2))
#endif /* CCGx */
Curently, the API is connecting ADC to the CSA stage 1 output loads the CSA output, and hence ends up making the OCP operation inaccurate.
So, this option is not recommended for customer use on CCG5. If you are not care about this, you can comment out #if ((defined(CCG5C)) || (defined(CCG6))) or change it to #if ((defined(CCG5)) || (defined(CCG6)))