-
Notifications
You must be signed in to change notification settings - Fork 0
Analog Comparator
SUBLIBinal offers access to the analog comparator of the microcontroller, and will attempt to automatically select comparison values internally within the microcontroller. Comparisons can be conducted by only providing a single analog input, and SUBLIBinal offers a wide range of available values for comparison. Additionally, if a value is not attainable internally, the library will automatically configure the analog comparator to take input in from an external pin and alert the user in the form of an error return. Documentation of the comparator has been divided into three sections including enumerations, structures, and functions implemented within SUBLIBinal.
To view examples of the Comparator implemented with SUBLIBinal, please refer to the Comparator Example code.
The analog comparator is a device that takes two analog inputs. One input is what is being compared against, while the other input is some time-varying signal. Alternatively, both inputs could possibly be time-varying if the user so desires. The comparator continually watches the relationship of these signals and will trigger events based upon certain conditions. For example, if the comparison signal falls below the reference signal, a falling edge is encountered. A rising edge is determined to be the comparison signal rising above the reference. The comparison unit can detect any combination of these two edges and provide the users program input in the form of an interrupt. The analog comparator is a useful tool for measuring capacitance and circuit time constants, as you can use it to enable and disable timers.
SUBLIBinal was created by the Palouse Robosub Club.