lpcmp_interrupt#
Overview#
The LPCMP interrupt Example shows how to use interrupt with LPCMP driver.
In this example, user should indicate an input channel to capture a voltage signal (can be controlled by user) as the LPCMP’s positive channel input. On the negative side, the internal DAC is used to generate the fixed voltage about half value of reference voltage.
When running the project, change the input voltage of user-defined channel, then the comparator’s output would change between logic one and zero when the user-defined channel’s voltage crosses the internal DAC’s value. The change of comparator’s output would generate the falling and rising edge events with their interrupts enabled. When any LPCMP interrupt happens, the LPCMP’s ISR would turn on the LED light if detecting the output’s rising edge, or turn off it when detecting the output’s falling edge.
Supported Boards#
FRDM-K32L3A6
Hardware requirements
Mini/micro USB cable
FRDM-K32L3A6 board
Personal Computer
Board settings
This example project uses LPCMP instance 0(M4) or instance 1(M0) to compare the voltage signal input from channel 2(PTC9) with the voltage signal(half of VDDIO) output by LPCMP’s internal DAC and output different result. LED1 will turn ON/OFF corresponding to different result. So the voltage signal input from PTC9 should be changed to observe the dynamical LED state.
Input signal to J2-18
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
The log below shows in the terminal window:
LPCMP Interrupt Example.
FRDM-MCXA153
Hardware requirements
Type-C USB cable
FRDM-MCXA153 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
VREFI/P2_7 J3-1 VDD JP8-2
CMP0_IN0/P2_2 J2-9 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN0(P2_2, J2-9) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J3-1(P2_7,VREFI) to JP8-2(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-9(P2_2, CMP0_IN0) will toggle the RED LED.
Prepare the Demo
Connect a Type-C USB cable between the host PC and the MCU-Link port(J15) on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA156
Hardware requirements
Type-C USB cable
FRDM-MCXA156 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN0/P2_2 J2-9 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN0(P2_2, J2-9) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J3-1(P2_7,VREFI) to JP8-2(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-9(P2_2, CMP0_IN0) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA346
Hardware requirements
Type-C USB cable
FRDM-MCXA346 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN1/P1_3 J2-17 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN1(P1_3, J2-17) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J2-1(P2_7,VREFI) to J13-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-17(P1_3, CMP0_IN1) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXN236
Hardware requirements
Type-C USB cable
FRDM-MCXN236 board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(P1_0) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from P1_0 corresponding J7-3 on FRDM board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect the type-c and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXN947
Hardware requirements
Type-C USB cable
FRDM-MCXN947 Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(P1_0) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from P1_0 corresponding J2-17 on EVK board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect the type-c and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXN947T
Hardware requirements
Type-C USB cable
FRDM-MCXN947T Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(P1_0) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from P1_0 corresponding J2-17 on EVK board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect the type-c and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXW71
Hardware requirements
Type-C USB cable
FRDM-MCXW71 Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA4) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. When the demo runs successfully, then the voltage signal input from PTA4 corresponding J4-3 should be used to observe the dynamical IO state. You will see the green led toggle with the voltage change.
Prepare the Demo
Connect the micro and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
MCX-W71-EVK
Hardware requirements
Type-C USB cable
MCX-W71-EVK Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA4) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. When the demo runs successfully, then the voltage signal input from PTA4 corresponding J4-5 should be used to observe the dynamical IO state. You will see the green led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the EVK board J14.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
KW45B41Z-EVK
Hardware requirements
Mini/micro USB cable
KW45B41Z-EVK Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA4) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. When the demo runs successfully, you will detect voltage toggle on J4.P31 of MB board. The voltage signal input from PTA4 corresponding J4-29 on mather board should be changed to observe the dynamical IO state. If the EVK board is used then the voltage signal input from PTA4 corresponding J4-4 should be used to observe the dynamical IO state. You will see the green led toggle with the voltage change.
Prepare the Demo
Connect the micro and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
KW47-EVK
Hardware requirements
Type-C USB cable
KW47-EVK Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA4) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from PTA4 corresponding J4-5 should be used to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the EVK board J14.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
MCX-N5XX-EVK
Hardware requirements
Mini/micro USB cable
MCX-N5XX-EVK Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(P1_0) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from P1_0 corresponding J2-17 on EVK board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect the micro and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
MCX-N9XX-EVK
Hardware requirements
Mini/micro USB cable
MCX-N9XX-EVK Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(P1_0) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from P1_0 corresponding J2-17 on EVK board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect the micro and mini USB cable between the PC host and the USB ports on the board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
MCX-W72-EVK
Hardware requirements
Type-C USB cable
MCX-W72-EVK Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA4) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from PTA4 corresponding J4-5 should be used to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the EVK board J14.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXE31B
Hardware requirements
Type-C USB cable
FRDM-MCXE31B board
Personal Computer
Board settings
This example project uses LPCMP1 to compare the voltage signal input from channel 0(PTA0) with the voltage signal output by LPCMP’s internal DAC.
The voltage signal input from PTA0 corresponding J9-3 on FRDM-MCXE31B board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed. The DAC reference comes from 1.2 V PMC bandgap reference in this project, note that the 1.2 V internal reference voltage is not available in Standby mode. When the voltage applied on J9-3 in higher than 0.6v, the LED will turn on. When the voltage applied on J9-3 in lower than 0.6v, the LED will turn off.
LPCMP Interrupt Example.
FRDM-MCXE32B
Hardware requirements
Type-C USB cable
FRDM-MCXE32B board
Personal Computer
Board settings
This example project uses LPCMP1 to compare the voltage signal input from channel 0(PTA0) with the voltage signal output by LPCMP’s internal DAC.
The voltage signal input from PTA0 corresponding J9-3 on FRDM-MCXE32B board should be changed to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed. The DAC reference comes from 1.2 V PMC bandgap reference in this project, note that the 1.2 V internal reference voltage is not available in Standby mode. When the voltage applied on J9-3 in higher than 0.6v, the LED will turn on. When the voltage applied on J9-3 in lower than 0.6v, the LED will turn off.
LPCMP Interrupt Example.
FRDM-MCXA174
Hardware requirements
Type-C USB cable
FRDM-MCXA174 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN1/P1_3 J2-17 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN1(P1_3, J2-17) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J2-1(P2_7,VREFI) to J13-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-17(P1_3, CMP0_IN1) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA344
Hardware requirements
Type-C USB cable
FRDM-MCXA344 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN1/P1_3 J2-17 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN1(P1_3, J2-17) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J2-1(P2_7,VREFI) to J13-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-17(P1_3, CMP0_IN1) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
KW47-LOC
Hardware requirements
Type-C USB cable
KW47-LOC Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 2(PTA21) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from PTA21 corresponding J1-1 should be used to observe the dynamical IO state. You will see the blue led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the LOC board J3.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
MCXW72-LOC
Hardware requirements
Type-C USB cable
MCXW72-LOC Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 2(PTA21) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from PTA21 corresponding J1-1 should be used to observe the dynamical IO state. You will see the blue led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the LOC board J3.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA266
Hardware requirements
Type-C USB cable
FRDM-MCXA266 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN1/P1_3 J2-17 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN1(P1_3, J2-17) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J2-1(P2_7,VREFI) to J13-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-17(P1_3, CMP0_IN1) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA366
Hardware requirements
Type-C USB cable
FRDM-MCXA366 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN1/P1_3 J2-17 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN1(P1_3, J2-17) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J2-1(P2_7,VREFI) to J13-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of J2-17(P1_3, CMP0_IN1) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXW72
Hardware requirements
Type-C USB cable
FRDM-MCXW72 Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA4) with the voltage signal(half of VREF_OUT) output by LPCMP’s internal DAC. The voltage signal input from PTA4 corresponding J4-3 should be used to observe the dynamical IO state. You will see the green led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the FRDM board J10.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA577
Hardware requirements
Type-C USB cable
FRDM-MCXA577 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN2/P1_4 R132 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN2(P1_4, R132) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J8-28(P2_7,VREFI) to J8-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of CMP0_IN2(P1_4, R132) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXC162
Hardware requirements
Type-C USB cable
FRDM-MCXC162 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN1/P1_3 J6-1 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN1(P1_3, J6-1) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Change the IO state of J6-1(P1_3, CMP0_IN1) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-KW43
Hardware requirements
Type-C USB cable
FRDM-KW43 Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA5) with the voltage signal(half of VREFH) output by LPCMP’s internal DAC. The voltage signal input from PTA5 corresponding J24-3 should be used to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the FRDM board J28.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXW70
Hardware requirements
Type-C USB cable
FRDM-MCXW70 Board
Personal Computer
Board settings
This example project uses LPCMP0 to compare the voltage signal input from channel 0(PTA5) with the voltage signal(half of VREFH) output by LPCMP’s internal DAC. The voltage signal input from PTA5 corresponding J24-3 should be used to observe the dynamical IO state. You will see the red led toggle with the voltage change.
Prepare the Demo
Connect a USB cable between the host PC and the FRDM board J28.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXA287
Hardware requirements
Type-C USB cable
FRDM-MCXA287 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CMP0_IN2/P1_4 J9-24 VDD or GND
This example project uses LPCMP0 to compare the voltage signal input from CMP0_IN2(P1_4, R132) with the voltage signal(half of VREFI) output by LPCMP’s internal DAC. Connect J8-28(P2_7,VREFI) to J8-1(VDD), this will set the VREFI to VDD(The VREFI is used as LPCMP reference voltage). Change the IO state of CMP0_IN2(P1_4, J9-24) will toggle the RED LED.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
Open a serial terminal on PC for the serial device with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.
FRDM-MCXL255
Hardware requirements
Type-C USB cable
FRDM-MCXL255 board
Personal Computer
Board settings
Pin Name Board Location Pin Name Board Location
CM33 CMP0_IN3/P2_15 J6-2 (Mikro bus) > VDD or GND J6_7 or J6_8
CM0+ AON_CMP0_IN3/P0_4 J8_21(Sensor p.) > VDD or GND J8_2 or J8_1
This example project uses LPCMP0 to compare the voltage signal input from input pin with the voltage signal(half of VDD) output by LPCMP’s internal DAC.
Make sure you have solder bridges SJ1 and SJ2 set to
2-1 for the main core (cm33)
2-3 for AON core (cm0+)
Make sure you have solder bridges SJ28 set to 2-3 for CM0+ core.
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port (J16) on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
On the main core blue led will shine when input pin is is high. On AON (cm0+ core) as there is no led, H or L letters will be printed into console instead.
The following lines are printed to the serial terminal when the demo program is executed.
LPCMP Interrupt Example.