MCUXpresso_MCXA153/boards/frdmmcxa153/driver_examples/freqme
Yilin Sun 35e678394a
Initial commit v2.14.2
Signed-off-by: Yilin Sun <imi415@imi.moe>
2024-02-11 19:33:06 +08:00
..
armgcc Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
board.c Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
board.h Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
clock_config.c Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
clock_config.h Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
freqme_interrupt_v3_13.xml Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
freqme_interrupt.c Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
pin_mux.c Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
pin_mux.h Initial commit v2.14.2 2024-02-11 19:33:06 +08:00
readme.md Initial commit v2.14.2 2024-02-11 19:33:06 +08:00

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 target clock source is fixed. Users can select reference clock source and pulse polarity, then after a while, the high or low period of reference clock will be printed to the terminal. To measure the pulse period with a high degree of accuracy, the frequency of reference clock is better less than that of target clock.

SDK version

  • Version: 2.14.2

Toolchain supported

  • IAR embedded Workbench 9.40.2
  • Keil MDK 5.38.1
  • GCC ARM Embedded 12.2
  • MCUXpresso 11.9.0

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

  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.

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
                D -- FREQME_GPIO_CLK_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.