MCUXpresso SDK Documentation

lpadc_edma

lpadc_edma#

Overview#

The lpadc_edma example shows how to use ADC to trigger a DMA transfer.

In this example, user should indicate a channel to provide a voltage signal(can be controlled by user) as the LPADC’s sample input and active the low power timer to trigger the ADC conversion upon the set Time reached(can be changed by user). A programmable watermark threshold supports configurable notification of data availability. When FCTRLn[FCOUNT] is greater than FCTRLn[FWMARK], the associated RDY flag is asserted which would generate a DMA request and trigger the eDMA to move the ADC conversion result from ADC result FIFO to user indicated memory. Then the major loop waits for the transfer to be done. The results would be printed on terminal when any key pressed.

Supported Boards#

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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
FRDM-MCXA153
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA153 board

  • Personal Computer

Board settings

No special settings are required.

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.

  5. The J4 pin 8 (ADC0_A0) 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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
FRDM-MCXA156
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA156 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.

Running the demo

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

LPADC EDMA Example
Configuring LPADC...
ADC Full Range: 65536
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 16124
1 = 16123
2 = 16120
3 = 16120
FRDM-MCXA346
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA346 board

  • Personal Computer

Board settings

No special settings are required.

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.

  5. The J2 pin 3 (P1_10) 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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
FRDM-MCXA174
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA174 board

  • Personal Computer

Board settings

No special settings are required.

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.

  5. The J2 pin 3 (P1_10) 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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
FRDM-MCXA344
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA344 board

  • Personal Computer

Board settings

No special settings are required.

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.

  5. The J2 pin 3 (P1_10) 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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
FRDM-MCXA266
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA266 board

  • Personal Computer

Board settings

No special settings are required.

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.

  5. The J2 pin 3 (P1_10) 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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
FRDM-MCXA366
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA366 board

  • Personal Computer

Board settings

No special settings are required.

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.

  5. The J2 pin 3 (P1_10) 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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 following lines are printed to the serial terminal when the demo program is executed.

LPADC EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 following lines are printed to the serial terminal when the demo program is executed.

LPADC EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 following lines are printed to the serial terminal when the demo program is executed.

LPADC EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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 EDMA Example
Configuring LPADC...
ADC Full Range: 4096
Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 3192
1 = 3192
2 = 3184
3 = 3184
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

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

LPADC EDMA Example
Configuring LPADC...
ADC Full Range: 65536Full channel scale (Factor of 1).

Configuring LPADC EDMA...
Press any key to print output buffer:

0 = 21233
1 = 21188
2 = 21208
3 = 22037
4 = 21165
5 = 21278
6 = 21497
7 = 20709
8 = 21032
9 = 20935
10 = 20534
11 = 21283
12 = 21738
13 = 21204
14 = 21080
15 = 21315
16 = 26028
17 = 21379
18 = 21369
19 = 21382
20 = 20647
21 = 21073
22 = 21169
23 = 21088
24 = 21216
25 = 21220
26 = 21112
27 = 21230
28 = 21038
29 = 21065
30 = 21812
31 = 21055
32 = 21106
33 = 21020
34 = 21079
35 = 21124
36 = 20455
37 = 21289
38 = 21153
39 = 21129
40 = 20334
41 = 22759
42 = 22215
43 = 18957
44 = 21060
45 = 21091
46 = 20954
47 = 20765
48 = 21100
49 = 21154


Press any key to print output buffer: