Jump to main content

##

# 3.2.6 Comparator with DAC (CMP DAC)

The high-speed analog comparator module provides a method to monitor voltage, current and other critical signals in a power conversion application that may be too fast for the CPU and ADC to capture. The analog comparator module can be used to implement Peak Current mode control, Critical Conduction mode (variable frequency) and Hysteretic Control mode.

## Using The Library

The High-Speed Analog Comparator with Slope Compensation DAC consists of the following key features:

• Programmable Comparator Hysteresis

• Programmable Output Polarity

• Interrupt Generation Capability

• Dedicated 12-bit Resolution Pulse Density Modulation (PDM) Digital-to-Analog Converter (DAC) for each Analog Comparator

• Multimode Multipole RC Output Filter:

– Transition mode: provides the fastest response

– Fast mode: for tracking DAC slopes

– Steady-State mode: provides 12-bit resolution

• Dedicated Support for the Following Modes:

– Slope Generation

– Hysteretic Control

– Triangular Wave

## Library Interface

This peripheral library provides the following interfaces:

Functions

Name | Description
--- | ---
CMPx_Initialize | Initializes CMPx module of the device
CMPx_Deinitialize | Deinitializes the CMPx module of the device to POR values
CMPx_Calibrate | Calibrates the CMPx module and enables ripple reduction mode
CMPx_StatusGet | Returns the output status of a comparator
CMPx_Enable | Enables the common DAC module
CMPx_Disable | Disables the common DAC module
CMPx_DACEnable | Enables the individual DAC module
CMPx_DACDisable | Disables the individual DAC module
CMPx_DACDataWrite | Writes DAC data to register
CMPx_DACDataHighWrite | Sets higher limit of the slope
CMPx_DACDataLowWrite | Sets lower limit of the slope
CMPx_DACSlopeWrite | Sets slope rate
CMPx_DACSlopeUpdateMode | Updates slope modes specified in CMP_DAC_SLOPE_UPDATE_MODE

Data types and constants

Name | Type | Description
--- | --- | ---
CMP_DAC_SLOPE_UPDATE_MODE | Enum | CMP slope data registers update mode
CMP_CALLBACK | Typedef | Defines the function pointer data type and function signature for the CMP callback function