lpadc_etc_software_trigger_conv#
Overview#
The adc_etc_software_trigger_conv example shows how to use the ADC_ETC to generate a ADC trigger by software trigger.
In this example, the ADC is configured with hardware trigger. Once ADC gets the trigger from the ADC_ETC, the conversion goes, then the ADC_ETC ISR would be executed.
Supported Boards#
MIMXRT1170-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1170-EVKB board
Personal Computer
Board settings
ADC0_IN0 is ADC input. Please sample voltage by J9-10 pin.
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
The log below shows the output of the hello world demo in the terminal window:
ADC_ETC_Software_Trigger_Conv Example Start!
Press any key to get user channel's ADC value.
ADC conversion value is 16
Press any key to get user channel's ADC value.
ADC conversion value is 20
Press any key to get user channel's ADC value.
ADC conversion value is 35
Press any key to get user channel's ADC value.
ADC conversion value is 43
Press any key to get user channel's ADC value.
ADC conversion value is 4
Press any key to get user channel's ADC value.
ADC conversion value is 28
Press any key to get user channel's ADC value.
...
MIMXRT1160-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1160-EVK board
Personal Computer
Board settings
ADC0_IN0 is ADC input. Please sample voltage by J9-10 pin.
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
The log below shows the output of the hello world demo in the terminal window:
ADC_ETC_Software_Trigger_Conv Example Start!
Press any key to get user channel's ADC value.
ADC conversion value is 16
Press any key to get user channel's ADC value.
ADC conversion value is 20
Press any key to get user channel's ADC value.
ADC conversion value is 35
Press any key to get user channel's ADC value.
ADC conversion value is 43
Press any key to get user channel's ADC value.
ADC conversion value is 4
Press any key to get user channel's ADC value.
ADC conversion value is 28
Press any key to get user channel's ADC value.
...
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
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
The log below shows the output of the hello world demo in the terminal window:
ADC_ETC_Software_Trigger_Conv Example Start!
ADC Full Range: 4096
Press any key to get user channel's ADC value.
ADC conversion value is 3056
Press any key to get user channel's ADC value.
ADC conversion value is 1909
Press any key to get user channel's ADC value.
ADC conversion value is 2062
Press any key to get user channel's ADC value.
ADC conversion value is 1979
Press any key to get user channel's ADC value.
ADC conversion value is 1605
Press any key to get user channel's ADC value.
...