lpadc_sample_rate_count#
Overview#
The lpadc sample rate count demo application can be used to measure ADC’s sample rate roughly. The sample rate for an ADC is defined as the number of output samples available per unit time, and is specified as samples per second(SPS). The sample rate is the reciprocal of one sample total conversion time. Total conversion time = sampling time + compare time In this demo, users can select sample time, and the compare time is different in different devices, please see device datasheet for details. In this demo the ADC conversion clock is configured as the maximum frequency(Please refer to the datasheet for the maximin value). So theoretically, sample rate = maximum frequency / total conversion time.
Supported Boards#
MIMXRT1170-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1170-EVKB board
Personal Computer
Board settings
No special settings are required.
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 lpadc sample rate count demo in the terminal window:
ADC High Sample Rate Demo!
Current ADC clock frequency is 88004352 Hz!
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
a
Please press any keys to trigger ADC conversion!
Sample Rate: 4187264 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
h
Please press any keys to trigger ADC conversion!
Sample Rate: 590464 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
MIMXRT1160-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1160-EVK board
Personal Computer
Board settings
No special settings are required.
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 lpadc sample rate count demo in the terminal window:
ADC High Sample Rate Demo!
Current ADC clock frequency is 88004352 Hz!
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
a
Please press any keys to trigger ADC conversion!
Sample Rate: 4187264 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
h
Please press any keys to trigger ADC conversion!
Sample Rate: 590464 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
Board settings
No special settings are required.
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 lpadc sample rate count demo in the terminal window:
ADC High Sample Rate Demo!
Current ADC clock frequency is 83375104 Hz!
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
a
Please press any keys to trigger ADC conversion!
Sample Rate: 4376192 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
h
Please press any keys to trigger ADC conversion!
Sample Rate: 566912 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
FRDM-IMXRT1186
Hardware requirements
Type-C USB cable
FRDM-IMXRT1186 board
Personal Computer
Board settings
Change Jumper J27 from 1-2 to 2-3. ADC1_IN1 is ADC input. Please sample voltage by J51-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 lpadc sample rate count demo in the terminal window:
ADC High Sample Rate Demo!
Current ADC clock frequency is 83375104 Hz!
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
a
Please press any keys to trigger ADC conversion!
Sample Rate: 4376192 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
h
Please press any keys to trigger ADC conversion!
Sample Rate: 566912 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
FRDM-IMXRT1152
Hardware requirements
Type-C USB cable
FRDM-IMXRT1152 board
Personal Computer
Board settings
No special settings are required.
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 lpadc sample rate count demo in the terminal window:
ADC High Sample Rate Demo!
Current ADC clock frequency is 88004352 Hz!
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
a
Please press any keys to trigger ADC conversion!
Sample Rate: 4187264 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time
h
Please press any keys to trigger ADC conversion!
Sample Rate: 590464 SPS
Please select sample time!
A -- 3 ADCK cycles total sample time
B -- 5 ADCK cycles total sample time
C -- 7 ADCK cycles total sample time
D -- 11 ADCK cycles total sample time
E -- 19 ADCK cycles total sample time
F -- 35 ADCK cycles total sample time
G -- 67 ADCK cycles total sample time
H -- 131 ADCK cycles total sample time