- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using a custom solution for the CYPD3175, modifying the CYPD3171-CLA sample. The PD profiles are sent to the device over I2C, I want to set the current limits over I2C as well but am having an issue finding where in the API the parameters for current limits must be set.
I thought that using the function call:
psrc_set_current(0,100);
Would set the port 0 current limit to 1A, but when I draw 2A on the port, the current limit is not triggered (shutdown of Vbus)
I have set the Rsense to 5mR which is what we are using.
#define VBUS_CSA_RSENSE (50u)
I would appreciate some guidance on how to set the parameters via the PD API so that the Alert flag is set and the Vbus is disabled when a value is exceeded.
Regards
TG
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TG,
1. void psrc_set_current (uint8_t port, uint16_t cur_10mA) is the correct API to add your I2C operations. You could make a function which is for I2C write or Read and then use it in void psrc_set_current (uint8_t port, uint16_t cur_10mA). So that when Type-C PD stack state machine call back function void psrc_set_current (uint8_t port, uint16_t cur_10mA), the I2C operations will be formed.
2. You do not need to call function psrc_set_current (0, 100) for Type-C port with 1A current set. Since the Type-C PD stack will call it if the PD contract is current with 1A.
You could take a look the function and find that the ocp_cur is calculated in this function. ocp_cur is over current protection threshold. Meanwhile, you could open Ez-PD configuration Utility to see what value you have set in your project.
3. The Rsense to 5mR is okay. But you need confirm it with your board. The value shall be Rsense + Resistance on the trace. And please make sure the GND return ground is single loop and cross the Rsense.
Best Regards,
Lisa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TG,
1. void psrc_set_current (uint8_t port, uint16_t cur_10mA) is the correct API to add your I2C operations. You could make a function which is for I2C write or Read and then use it in void psrc_set_current (uint8_t port, uint16_t cur_10mA). So that when Type-C PD stack state machine call back function void psrc_set_current (uint8_t port, uint16_t cur_10mA), the I2C operations will be formed.
2. You do not need to call function psrc_set_current (0, 100) for Type-C port with 1A current set. Since the Type-C PD stack will call it if the PD contract is current with 1A.
You could take a look the function and find that the ocp_cur is calculated in this function. ocp_cur is over current protection threshold. Meanwhile, you could open Ez-PD configuration Utility to see what value you have set in your project.
3. The Rsense to 5mR is okay. But you need confirm it with your board. The value shall be Rsense + Resistance on the trace. And please make sure the GND return ground is single loop and cross the Rsense.
Best Regards,
Lisa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have copied the config.c content for the following:
The OCP is not triggering on more the 2x the current.
I will have to wait for the accurate LCR meter to check the trace resistance.
Regards
TG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After reviewing the schematic I found an error in the BoM that caused a 0.5mR res to be placed instead of a 5mR, Fixing this resolved the issue. Thanks for your help.