Example: S12ZVC192-ACMP-POT-CW107

Document created by Diana Batrlova Employee on Nov 7, 2018Last modified by Diana Batrlova Employee on Nov 7, 2018
Version 2Show Document
  • View in full screen mode

Tested on: DEVKIT-S12ZVC

MCU: S12ZVC192
Development tool: CodeWarrior 10.7

 

This example shows ACMP - analog comparator, 
which compares voltage from potentiometer and voltage from DAC.
DAC is set at 2.5V and uses the positive input of the comparator.
Potentiometer uses the negative input in the range of 0V - 5V.
When the potentiometer is moved, the output from ACMP will be changed. 
If the voltage at the non-inverting (positive) input > the voltage at the inverting (negative) input,
the output result is in the logic level 1 and the red LED is on.

Outcomes