lpadc_dual_single_ended_conversion#
Overview#
The lpadc_dual_single_ended_conversion example shows how to use two channel with LPADC driver.
In this example, user should indicate two channel to provide a voltage signal (can be controlled by user) as the LPADC’s sample input, Channel B does not need to be paired with Channel A, Channel B is user selectable.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#
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
Board settings
ADC CH7A input signal J41-2(GPIO_AD_02).
ADC CH6B input signal J41-8(GPIO_AD_05).
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 demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like:
LPADC Triger Dual Channel Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC channal A value: 35822
ADC channal B value: 35826
ADC channal A value: 35734
ADC channal B value: 35763
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.
MIMXRT700-EVK
Hardware requirements
Micro USB cable
MIMXRT700-EVK board
Personal Computer
Board settings
ADC CH0A input signal J24-1(PIO10_0).
ADC CH1B input signal J24-4(PIO10_3).
Prepare the Demo
Connect a USB cable between the host PC and the MCU-LINK 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 demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as below.
LPADC Triger Dual Channel Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC channal A value: 51370
ADC channal B value: 36439
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 CHB1 input signal J51-2(GPIO_AD_15).
ADC CHA1 input signal J51-8(GPIO_AD_14).
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 demo.
Running the demo
When the demo runs successfully, the log would be seen on the OpenSDA terminal like:
LPADC Triger Dual Channel Example
ADC Full Range: 65536
Please press any key to get user channel's ADC value.
ADC channal A value: 35822
ADC channal B value: 35826
ADC channal A value: 35734
ADC channal B value: 35763
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.