Using 8-bit PIC® MCU Slope Compensation Module

Last modified by Microchip on 2023/11/09 09:03

The Slope Compensation Control 0 (SLPCCON0) register controls the operation of the module.

Slope compensation chartSlope compensation chart

The Slope Compensation (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 Pulse Width Modulation (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 the following equation.

Slope compensation equationThis 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 the slope compensator range bit.

Slope compensation chart

Slope compensation chart

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 following chart.

Slope compensation chart