6.1. ACMP¶
6.1.1. Overview¶
The ACMP example shows how to use ACMP peripheral to compare one analog input level and internal DAC output level. In this example, ACMP’s MIN signal connets analog input pin, PIN signal connects to internl DAC output. The program gradually increases the DAC output vlevel until it is higher than MIN signal level, the ACMP output level will toggle.
6.1.2. Board Setting¶
Please refer to Pin Description for specific board
Connect analog input signal to ACMP MIN pin
Connect ACMP output pin to oscilloscope or multimeter
6.1.3. Running the example¶
When the example runs successfully, the ACMP output pin level reversal can be observed through the oscilloscope or multimeter, and the following message is displayed in the terminal(dac set value varies with the input analog signal level):
> acmp example
> acmp out toggled, the dac set value is 0x8e