freqme_interrupt#
Overview#
The freqme_interrupt is a demonstration program of the SDK LPC_FREQME driver’s features.
The example demostrates the usage of frequency-measurement operating mode and pulse-width measurement operating mode.
In frequency measurement mode, the reference clock source is fixed. Users can select target clock source and input reference clock scaling factor, then after a while, the frequency of target clock source will be printed to the terminal. To measure the frequency with a high degree of accuracy, the frequency of target clock is better less than that of the reference clock.
In pulse width measurement mode, the reference clock source is fixed. Users can select target clock source and pulse polarity, then after a while, the high or low period of reference clock will be printed to the terminal.
FREQME uses the known high or low period of the reference clock as a measurement window.
During this window, it counts the number of pulses from the target clock.
By combining the known duration of the reference clock’s high or low period with the counted target pulses, the target clock frequency can be calculated.
If the reference clock has a high period of 1 ms and 1000 target pulses occur during that time, the target frequency is 1 MHz.
To measure the pulse period with a high degree of accuracy, the frequency of reference clock is better less than that of target clock.
Supported Boards#
FRDM-MCXA153
Hardware requirements
Type-C USB cable
FRDM-MCXA153 board
Personal Computer
Board settings
Note: Please populate the crystal oscillator before running this example. To measure the frequency or pulse width of external input clock, please connect input clock signal to J1_2(FREQME_CLK_IN0) or J1_4(FREQME_CLK_IN1)
Prepare the Demo
Connect a Type-C USB cable between the host PC and the MCU-Link port(J15) on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA156
Hardware requirements
Type-C USB cable
FRDM-MCXA156 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J2_1(P1_4, FREQME_CLK_IN0) or J2_3(P1_5, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA346
Hardware requirements
Type-C USB cable
FRDM-MCXA346 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J1_7(P1_4, FREQME_CLK_IN0) or J2_19(P1_5, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXL255
Hardware requirements
Type-C USB cable
FRDM-MCXL255 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to: FREQME_CLK_IN0 - P2_0 (J2) FREQME_CLK_IN1 - P2_1 (J2)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port (J16) 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 following lines are printed to the serial terminal when the demo program is executed.
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Target clock: B
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXN236
Hardware requirements
Type-C USB cable
FRDM-MCXN236 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J9-8(FREQME_GPIO_CLK_A) or J9-7(FREQME_GPIO_CLK_B)
Prepare the Demo
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J10) on the board
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXN947
Hardware requirements
Type-C USB cable
FRDM-MCXN947 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J9-6(FREQME_GPIO_CLK_A) or J9-5(FREQME_GPIO_CLK_B)
Prepare the Demo
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the board
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXN947T
Hardware requirements
Type-C USB cable
FRDM-MCXN947T board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J9-6(FREQME_GPIO_CLK_A) or J9-5(FREQME_GPIO_CLK_B)
Prepare the Demo
Connect a type-c USB cable between the PC host and the MCU-Link USB port (J17) on the board
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
LPCXpresso55S36
Hardware requirements
Mini/micro USB cable
LPCXpresso55S36 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J92_3(FREQME_GPIO_CLK_A) or J92_1(FREQME_GPIO_CLK_B)
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J1) on the board
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- XTAL32MHz
B -- FRO_OSC_12M
C -- FREQME_GPIO_CLK_A
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
MCX-N5XX-EVK
Hardware requirements
Mini/micro USB cable
MCX-N5XX-EVK board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to R917(FREQME_GPIO_CLK_A) or R919(FREQME_GPIO_CLK_B)
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the board
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
MCX-N9XX-EVK
Hardware requirements
Mini/micro USB cable
MCX-N9XX-EVK board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to R917(FREQME_GPIO_CLK_A) or R919(FREQME_GPIO_CLK_B)
Prepare the Demo
Connect a micro USB cable between the PC host and the MCU-Link USB port (J5) on the board
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
MIMXRT700-EVK
Hardware requirements
Micro USB cable
MIMXRT700-EVK board
Personal Computer
Board settings
No special settings are required.
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
The log below shows the output of the freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- OSC_CLK
B -- FRO1_DIV8
C -- LPOSC
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-IMXRT700
Hardware requirements
Type-C USB cable
FRDM-IMXRT700 board
Personal Computer
Board settings
No special settings are required.
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
The log below shows the output of the freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- OSC_CLK
B -- FRO1_DIV8
C -- LPOSC
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA174
Hardware requirements
Type-C USB cable
FRDM-MCXA174 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J7_2(P1_4, FREQME_CLK_IN0) or J7_4(P1_5, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA344
Hardware requirements
Type-C USB cable
FRDM-MCXA344 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J7_2(P1_4, FREQME_CLK_IN0) or J7_4(P1_5, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA266
Hardware requirements
Type-C USB cable
FRDM-MCXA266 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J1_7(P1_4, FREQME_CLK_IN0) or J2_19(P1_5, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA366
Hardware requirements
Type-C USB cable
FRDM-MCXA366 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to J1_7(P1_4, FREQME_CLK_IN0) or J2_19(P1_5, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA577
Hardware requirements
Type-C USB cable
FRDM-MCXA577 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to R134_0(P1_18, FREQME_CLK_IN0) or R133_0(P1_19, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
D -- OSC32K
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXC162
Hardware requirements
Type-C USB cable
FRDM-MCXC162 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to TP20(P1_8, FREQME_CLK_IN0) or TP21(P1_9, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- FRO_12M
B -- FREQME_CLK_IN0
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
FRDM-MCXA287
Hardware requirements
Type-C USB cable
FRDM-MCXA287 board
Personal Computer
Board settings
To measure the frequency or pulse width of external input clock, please connect input clock signal to R134_0(P1_18, FREQME_CLK_IN0) or R133_0(P1_19, FREQME_CLK_IN1)
Prepare the Demo
Connect a USB Type-C cable between the host PC and the MCU-Link USB port on the target board.
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
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 freqme_interrupt demo in the terminal window:
FREQME Interrupt Example!
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.
Frequency Measurement Mode Selected!
Please select the target clock:
A -- CLK_IN
B -- FRO_12M
C -- FREQME_CLK_IN0
D -- OSC32K
Please input the scale factor of reference clock(Ranges from 0 to 31).
20
Target clock frequency is 11999725 Hz.
Please select operate mode...
A -- Frequency Measurement Mode.
B -- Pulse Width Measurement Mode.