| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
LPC17xx/40xx Comparator example
Peripheral examples

## Detailed Description

Example description
The CMP example demonstrates using the analog comparator.

This example configures the positive voltage input as the voltage found on PIN0.25, which is trimmed through the potentiometer. Adjust the POT up and down to adjust the voltage into the analog comparator. When the voltage crosses the negative voltage input, a CMP IRQ is fired. Based on which side of the voltage is in reference to the bandgap, the LED state will change.

Special connection requirements
Connect P0.25 (J5.24) to P1.7 (J5.29) to input the comparator 0

Build procedures:
LPC17xx/40xx example quickstart for Keil uVision4
LPC17xx/40xx example quickstart for IAR EWARM
LPC17xx/40xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Embedded Artists' LPC4088 Developer's Kit

Submitting LPCOpen issues:
Community support for LPCOpen

## Macros
#define | CMP_ID 1

## Functions
int | main (void)
| Main UART program body.

## Macro Definition Documentation

#define CMP_ID 1

Definition at line 66 of file cmp.c.

## Function Documentation

int main | ( | void |  | ) |

Main UART program body.

Main program body.

Returns
  Doesn't return

Definition at line 84 of file cmp.c.