Jump to main content

##

# 3.31.1 Analog Comparator Controller (ACC)

The Analog Comparator Controller (ACC) configures the analog comparator and generates an interrupt depending on user settings. The analog comparator embeds two 8-to-1 multiplexers that generate two internal inputs. These inputs are compared, resulting in a compare output. The hysteresis level, edge detection and polarity are configurable.

The ACC also generates a fault output which can be used by the Pulse Width Modulator (PWM) fault input.

## Using The Library

The analog comparison status can be polled by the software or can be configured to generate a callback.

- With polling, the application will need to continuously poll to check if the comparison edge occurred

- With Callback, the registered callback function will be called when comparison edge is detected. This means the application do not have to poll continuously.

## Library Interface

Analog Comparator Controller peripheral library provides the following interfaces:

Functions

Name | Description
--- | ---
ACC_Initialize | Initializes ACC module of the device
ACC_StatusGet | Returns comparison status of the ACC
ACC_CallbackRegister | Allows application to register callback with PLIB

Data types and constants

Name | Type | Description
--- | --- | ---
ACC_STATUS_SOURCE | Enum | Identifies ACC Comparison status
ACC_CALLBACK | Typedef | ACC callback function pointer