Other Parts Discussed in Thread: POWERSUITE
Tool/software:
Hi.
I am studying the code for the C2000 DPS BoosterPack - VMC Open Loop and I have two questions.
- Calculate the DACxVALA value-> You guys have ILOAD_NOM = 1.3 and the trip value is 5.2A. To calculate the value of the trip, you make this calculation:
4096*Trip_Value/IL_MAX_SENSE. Shouldn't be 4095 instead of 4096? Because if I want to change the trip value to max_value (7.52A), then DACxVALA would be 4096 and if I follow the equation from the User Guide, DACOUT = (4097/4096)*Vref. DACOUT would be slightly above VREF.

#define BUCK_IL_MAX_SENSE_A ((float32_t) 7.52)
#define BUCK_ILOAD_NOM_A ((float32_t) 1.3)
#define BUCK_USER_DEFAULT_TRIP_A ((float32_t)BUCK_ILOAD_NOM_A * 4)
BUCK_HAL_setOverCurrentTripLimit(BUCK_USER_DEFAULT_TRIP_A);
//
// BUCK_HAL_setOverCurrentTripLimit - Set the comparator digital trip limit to
// match the equivalent Amps value passed in through tripLimit_A. Returns the
// effective digital trip limit.
//
uint16_t BUCK_HAL_setOverCurrentTripLimit(float32_t tripLimit_A)
{
uint16_t dacVal;
//
// Range check and correct desired limit; then convert to digital value
//
if(tripLimit_A >= BUCK_IL_MAX_SENSE_A)
{
dacVal = BUCK_CMPSSDAC_CODES - 1;
}
else if(tripLimit_A < (float32_t)0)
{
dacVal = 0;
}
else
{
dacVal = (uint16_t)(BUCK_CMPSSDAC_CODES *
tripLimit_A /
BUCK_IL_MAX_SENSE_A);
}
//
// Set comparator trip value
//The code enters into ELIF, not the IF
#if(BUCK_OC_CMPSS_CMP_HL == BUCK_CMPSS_COMP_HI)
CMPSS_setDACValueHigh(BUCK_OC_CMPSS_BASE, dacVal);
#elif(BUCK_OC_CMPSS_CMP_HL == BUCK_CMPSS_COMP_LO)
CMPSS_setDACValueLow(BUCK_OC_CMPSS_BASE, dacVal);
#endif
//
// Return effective trip value
//The code enters into ELIF, not the IF
#if(BUCK_OC_CMPSS_CMP_HL == BUCK_CMPSS_COMP_HI)
return( CMPSS_getDACValueHigh(BUCK_OC_CMPSS_BASE) );
#elif(BUCK_OC_CMPSS_CMP_HL == BUCK_CMPSS_COMP_LO)
return( CMPSS_getDACValueLow(BUCK_OC_CMPSS_BASE) );
#endif
}
static inline void
CMPSS_setDACValueLow(uint32_t base, uint16_t value)
{
//
// Check the arguments.
//
ASSERT(CMPSS_isBaseValid(base));
ASSERT(value < 4096U);
//
// Write the DAC value to the DAC value shadow register.
//
HWREGH(base + CMPSS_O_DACLVALS) = value;
}
- My second question: This is more hardware question. Do you guys have a white paper or a document to study how the sensing inductor current through a shunt resistor works? I want to learn how to select the resistor and capacitor value, if I want to design something in the future or what value would be my output depending on the current

EDIT: I noticed this is a differential amplifier

In this document shows me how to calculate C13 and C14 (https://fscdn.rohm.com/en/products/databook/applinote/common/low_side_current_sense_circuit_design_an-e.pdf), but it doesn't show to calculate C10, C11 and C12

