The Slope Compensation Control Register 0 (SLPCCON0) controls the operation of the module.
SLPCCON1: SLOPE COMPENSATION CONTROL 0 REGISTER
The SC module can be enabled or disabled by the SCxEN bit.
The SC can act on a signal crossing the rising or falling threshold. This is set with the SCxPOL bit.
The output connection of the SC module is selected by the SCxTSS bits.
The input connection to the SC module is selected by the SCxINS bit.
Setting the Slope Compensation Rate
To set the Slope Compensator rate, the input reference voltage and PWM period must first be determined.
The input reference voltage is simply set to the target circuit peak current sense voltage at the load sensing circuit. The PWM period is simply the inverse of the PWM drive frequency.
The slope compensation output voltage starts at the input reference voltage and should fall at a rate of less than half the target circuit current sense voltage rate of rise. Therefore, the compensator slope, expressed as volts per microsecond, can be computed as shown in equation below.
This calculated slope compensator value is loaded into the Slope Compensator Current Sink Set (SCxISET) bits of the SLPCCON1 register per the table of values. The range of values can also be adjusted with a the slope compensator range bit.
SLPCCON1: SLOPE COMPENSATION CONTROL 1 REGISTER
The SCxRNG bit allows you to select the range for the slope of the compensation.
The SCxISET bits set the slope rate value per the chart below.