Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CMP Example

Overview

The CMP Example compares the analog input to the reference DAC output to control an LED. If the analog input is higher than the DAC output, the LED is on. Otherwise, the LED is turned off.

Supported Platforms

These Freescale Freedom development platforms and Tower System modules are supported by the CMP example.

System Requirement

Hardware requirements

Toolchain requirements

Software requirements

Getting Started

Hardware settings

The CMP Example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board's jumper settings and configurations in default state when running this example.

Prepare the example

  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.
  2. Open a serial terminal with these settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  3. Download the program to the target board.
  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Run the example

These instructions are displayed/shown on the terminal window:

The demo compares analog input to the reference DAC output to control an LED.
The LED is turned ON/OFF when the analog input is LOWER/HIGHER than the DAC output.
Press SW to see the LED status.
The analog input is HIGHER than DAC output!
The analog input is LOWER than DAC output!
The analog input is HIGHER than DAC output!
The analog input is LOWER than DAC output!

Press the SW (*) button on the board and observe the LED toggle. NOTE: For the TWR-K65F180M board, the on-board potentiometer is used instead of the SW button.