MCUXpresso SDK Documentation

lpadc_polling

lpadc_polling#

Overview#

The lpadc_polling example shows the simplest way to use LPADC driver.

In this example, user should indicate a channel to provide a voltage signal (can be controlled by user) as the LPADC’s sample input. When running the project, typing any key into debug console would trigger the conversion. The execution would check the FIFO valid flag in loop until the flag is asserted, which means the conversion is completed. Then read the conversion result value and print it to debug console.

Note, the default setting of initialization for the ADC converter is just an available configuration. User can change the configuration structure’s setting in application to fit the special requirement.

Supported Boards#

EVK9-MIMX8ULP
Hardware requirements
  • Micro USB cable

  • MIMX8ULP-EVK/EVK9 board

  • J-Link Debug Probe

  • 5V power supply

  • Personal Computer

Board settings
  • Set 0~1.8V voltage input to CH5A(J11-7) by using DC power supply

Please note this application can’t support running with Linux BSP!

Prepare the Demo
  1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW1 to power on the board.

  2. Connect a micro USB cable between the host PC and the J6 USB port on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the demo runs successfully, following information can be seen on the terminal:

LPADC Polling Example
ADC Full Range: 4096
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC value: 0
ADC value: 4095
MIMXRT1170-EVKB
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1170-EVKB board

  • Personal Computer

Board settings

ADC1_IN0 is ADC input. Please sample voltage by J9-10 pin.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

These instructions are displayed/shown on the terminal window:

LPADC Polling Example
ADC Full Range: 4096
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC Value: 951
ADC Value: 1169
ADC Value: 1243
...
EVK-MIMX8ULP
Hardware requirements
  • Micro USB cable

  • MIMX8ULP-EVK/EVK9 board

  • J-Link Debug Probe

  • 5V power supply

  • Personal Computer

Board settings
  • Set 0~1.8V voltage input to CH5A(J11-7) by using DC power supply

Please note this application can’t support running with Linux BSP!

Prepare the Demo
  1. Connect 5V power supply and J-Link Debug Probe to the board, switch SW1 to power on the board.

  2. Connect a micro USB cable between the host PC and the J6 USB port on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the demo runs successfully, following information can be seen on the terminal:

LPADC Polling Example
ADC Full Range: 4096
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC value: 0
ADC value: 4095
MIMXRT1160-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1160-EVK board

  • Personal Computer

Board settings

ADC1_IN0 is ADC input. Please sample voltage by J9-10 pin.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

These instructions are displayed/shown on the terminal window:

LPADC Polling Example
ADC Full Range: 4096
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC Value: 951
ADC Value: 1169
ADC Value: 1243
...
MIMXRT1180-EVK
Hardware requirements
  • Mini/micro USB cable

  • MIMXRT1180-EVK board

  • Personal Computer

Board settings
  • ADC CH7A input signal J41-2(GPIO_AD_02).

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

When the demo runs successfully, the log would be seen on the OpenSDA terminal like:

LPADC Polling Example
ADC Full Range: 65536
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC value: 10538
ADC value: 10538

The analog voltage input range is theoretically 0-1.8V. However, due to the workaround for ERR051152, the maximum voltage should be limited to 1.78V. Due to the errata051385, the ADC reference voltage is connect to the VDDA_ADC_1P8.

EVK-MIMXRT595
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT595 board

  • Personal Computer

Board settings
  • Input voltage signal(0~1.8V) to J30-1(LPADC0 CH0).

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J40) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, following information can be seen on the terminal:

LPADC Polling Example
Please press any key to get user channel's ADC value.
ADC value: 2714
EVK-MIMXRT685
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT685 board

  • Personal Computer

Board settings
  • Set VREF_L to GND, VREF_H to 1.8V (connect JP9, JP10).

  • Input voltage signal(0~1.8V) to J30-1(LPADC0 CH0).

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, following information can be seen on the terminal:

LPADC Polling Example
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-K32L3A6
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K32L3A6 board

  • Personal Computer

Board settings
  • LPADC CH6A Input signal J4-2(ptc11)

Prepare the Demo
  1. Connect a USB to Serial Line between the host PC and the J73 serial port on the target board.

  2. Open a serial terminal with the following 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.

Running the demo

The log below shows in the terminal window:

LPADC Polling Example
Please press any key to get user channel's ADC value.
ADC value: 4079
ADC value: 4079
ADC value: 4080
...
FRDM-IMXRT1152
Hardware requirements
  • Type-C USB cable

  • FRDM-IMXRT1152 board

  • Personal Computer

Board settings

ADC1_IN0 is ADC input. Please sample voltage by J47-8 pin.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

These instructions are displayed/shown on the terminal window:

LPADC Polling Example
ADC Full Range: 4096
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC Value: 951
ADC Value: 1169
ADC Value: 1243
...
FRDM-MCXA153
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA153 board

  • Personal Computer

Board settings
  • ADC CH0A input signal J4-8(PIO2_0).

Prepare the Demo
  1. Connect a Type-C USB cable between the host PC and the MCU-Link port(J15) on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXA156
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA156 board

  • Personal Computer

Board settings
  • ADC CH0A input signal J4-2(P1_10).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXA346
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA346 board

  • Personal Computer

Board settings
  • ADC1 CH8A input signal J2-3(P1_10).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXL255
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXL255 board

  • Personal Computer

Board settings
  • Provide 0-3.3V voltage to J6-1 “AN” pin (ADC ch0 P3_9).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port (J16) on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXN236
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN236 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the type-c and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J8 pin 12 (ADC0_A2) on EVK board is used to monitor the voltage.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-MCXN947
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the type-c and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J8 Pin 28 (ADC0_A2) on EVK board is used to monitor the voltage.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-MCXN947T
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947T Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the type-c and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J8 Pin 28 (ADC0_A2) on EVK board is used to monitor the voltage.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-MCXW71
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW71 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the micro and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J6 Pin 1 (ADC0_A6) on EVK board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
MCX-W71-EVK
Hardware requirements
  • Type-C USB cable

  • MCX-W71-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. 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

  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 demo.

  5. The J4 Pin 9 (ADC0_A6) on EVK board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
KW45B41Z-EVK
Hardware requirements
  • Mini/micro USB cable

  • KW45B41Z-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the micro and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J12 Pin 1 (ADC0_A6) on EVK board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
KW47-EVK
Hardware requirements
  • Type-C USB cable

  • KW47-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. 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

  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 demo.

  5. The J4 Pin 9 (ADC0_A6) on EVK board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
LPCXpresso55S06
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S06 board

  • Personal Computer

Board settings
  • ADC CH0A input signal J13-3(PIO0_23).

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J1) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
LPCXpresso55S16
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S16 board

  • Personal Computer

Board settings
  • ADC CH0A input signal J13-3(PIO0_23). The jumper setting: Default jumpers configuration does not work, you will need to add JP20 and JP21 (JP22 optional for ADC use)

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J1) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
LPCXpresso55S28
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S28 board

  • Personal Computer

Board settings
  • Connect a jumper to P15-2 and P15-3.

  • ADC CH0A input signal P28-1(PIO0-23).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (P6) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Interrupt Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
LPCXpresso55S36
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S36 board

  • Personal Computer

Board settings
  • ADC CH0A input signal J7-1(PIO1_9).

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J1) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
LPCXpresso55S69
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55s69 board

  • Personal Computer

Board settings
  • Connect a jumper to P15-2 and P15-3.

  • ADC CH0A input signal P28-1(PIO0-23).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (P6) on the board

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Interrupt Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
MCX-N5XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N5XX-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the micro and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J20 Pin 28 (ADC0_A2) on EVK board is used to monitor the voltage.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
MCX-N9XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N9XX-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect the micro and mini USB cable between the PC host and the USB ports on the board.

  2. 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

  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 demo.

  5. The J20 Pin 28 (ADC0_A2) on EVK board is used to monitor the voltage.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
MCX-W72-EVK
Hardware requirements
  • Type-C USB cable

  • MCX-W72-EVK Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the EVK board J14.

  2. 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

  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 demo.

  5. The J4 Pin 9 (ADC0_A6) on EVK board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
MIMXRT685-AUD-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT685-AUD-EVK board

  • Personal Computer

Board settings
  • Set VREF_L to GND, VREF_H to 1.8V (connect JP9, JP10).

  • Input voltage signal(0~1.8V) to LPADC0 CH0 (R405, P_5_ADC0_0 side)

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the board

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, following information can be seen on the terminal:

LPADC Polling Example
Please press any key to get user channel's ADC value.
ADC value: 2714
MIMXRT700-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT700-EVK board

  • Personal Computer

Board settings
  • ADC CH0A input signal J24-1(PIO10_0).

Prepare the Demo
  1. Connect a USB cable between the host PC and the MCU-LINK USB port on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

When the example runs successfully, you can see the similar information from the terminal as below.

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 10538
ADC value: 10538
FRDM-MCXA174
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA174 board

  • Personal Computer

Board settings
  • ADC1 CH8A input signal J2-3(P1_10).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXA344
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA344 board

  • Personal Computer

Board settings
  • ADC1 CH8A input signal J2-3(P1_10).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
KW47-LOC
Hardware requirements
  • Type-C USB cable

  • KW47-LOC Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the LOC board J3.

  2. 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

  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 demo.

  5. The J1 Pin 1 (ADC0_A15) on LOC board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: 4096
Please press any key to get user channel's ADC value.
ADC value: 2714
MCXW72-LOC
Hardware requirements
  • Type-C USB cable

  • MCXW72-LOC Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the LOC board J3.

  2. 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

  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 demo.

  5. The J1 Pin 1 (ADC0_A15) on LOC board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: 4096
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-IMXRT1186
Hardware requirements
  • Type-C USB cable

  • FRDM-IMXRT1186 board

  • Personal Computer

Board settings

Change Jumper J27 from 1-2 to 2-3

  • ADC CHA1 input signal J51-8(GPIO_AD_14).

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following 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 demo.

Running the demo

When the demo runs successfully, the log would be seen on the OpenSDA terminal like:

LPADC Polling Example
ADC Full Range: 65536
Full channel scale (Factor of 1).
Please press any key to get user channel's ADC value.
ADC value: 10538
ADC value: 10538

The analog voltage input range is theoretically 0-1.8V. However, due to the workaround for ERR051152, the maximum voltage should be limited to 1.78V. Due to the errata051385, the ADC reference voltage is connect to the VDDA_ADC_1P8.

FRDM-MCXA266
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA266 board

  • Personal Computer

Board settings
  • ADC1 CH8A input signal J2-3(P1_10).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXA366
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA366 board

  • Personal Computer

Board settings
  • ADC1 CH8A input signal J2-3(P1_10).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXW72
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW72 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J10.

  2. 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

  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 demo.

  5. The J6 Pin 1 (ADC0_A6) on FRDM board is used to monitor the voltage. The VREFO 1.8v is used as the ADC reference.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: 4096
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-MCXA577
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA577 board

  • Personal Computer

Board settings
  • ADC0 CH0A input signal J8-21(P2_0).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-MCXC162
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXC162 board

  • Personal Computer

Board settings
  • ADC0 CH0A input signal J1-8(P2_0).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596
FRDM-KW43
Hardware requirements
  • Type-C USB cable

  • FRDM-KW43 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J28.

  2. 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

  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 demo.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-MCXW70
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW70 Board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J28.

  2. 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

  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 demo.

Running the demo

The following lines are printed to the serial terminal when the demo program is executed.

LPADC Polling Example
ADC Full Range: XXXX
Please press any key to get user channel's ADC value.
ADC value: 2714
FRDM-MCXA287
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA287 board

  • Personal Computer

Board settings
  • ADC0 CH0A input signal J8-21(P2_0).

Prepare the Demo
  1. Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 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 demo.

Running the demo

The log below shows the output of the hello world demo in the terminal window:

LPADC Polling Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC value: 35596