acmp_polling_print
Overview
The ACMP Polling project is a simple demonstration program that uses the SDK software. It compares the selected analog input with ACMP internal DAC output continuously and print information corresponding to different comparison result in terminal. The purpose of this demo is to show how to use the ACMP driver in SDK software by polling way. The ACMP can be configured based on default configuration returned by the API ACMP_GetDefaultConfig(). The default configuration is: high speed is not enabled, invert output is not enabled, unfiltered output is not enabled, pin out is not enabled, offset level is level 0, hysteresis level is level 0.
Running the demo
Before example running, please connect the analog input voltage to stable external voltage generator to avoid floating voltage and adjust external voltage generator to be higher than reference DAC output (half of referene voltage) to make the initial comparison result to be 0. Please note that the input voltage should range from 0 to 1.8V. When the demo runs successfully, following information can be seen on the terminal:
The example compares analog input to the reference DAC output(CMP positive port).
The terminal will print CMP's output value when press any key.
Please press any key to get CMP's output value.
The analog input is LOWER than DAC output
The analog input is HIGHER than DAC output